vue3-router-tab 1.3.0 → 1.3.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.
@@ -1,5 +1,5 @@
1
1
  import './vue3-router-tab.css';
2
- import { reactive as ge, ref as $, shallowRef as bt, computed as k, watch as A, nextTick as _, inject as Ae, getCurrentInstance as Oe, onMounted as me, defineComponent as Ue, provide as pt, onBeforeUnmount as gt, resolveComponent as mt, createElementBlock as I, openBlock as P, createElementVNode as O, createCommentVNode as U, normalizeClass as J, renderSlot as ue, createVNode as q, TransitionGroup as vt, mergeProps as Q, withCtx as Z, Fragment as ce, renderList as Ee, withModifiers as fe, toDisplayString as Ke, normalizeProps as yt, Transition as Ie, createBlock as de, KeepAlive as ht, resolveDynamicComponent as xe, normalizeStyle as Tt, isRef as kt, isReadonly as wt } from "vue";
2
+ import { reactive as pe, ref as $, shallowRef as dt, computed as k, watch as A, nextTick as N, inject as Pe, getCurrentInstance as je, onMounted as ge, defineComponent as Oe, provide as bt, onBeforeUnmount as pt, resolveComponent as gt, createElementBlock as x, openBlock as C, createElementVNode as O, createCommentVNode as ie, normalizeClass as H, renderSlot as le, createVNode as Ae, TransitionGroup as mt, mergeProps as se, withCtx as ue, Fragment as Ke, renderList as Ee, withModifiers as ce, toDisplayString as Ie, createBlock as J, normalizeProps as vt, Transition as yt, resolveDynamicComponent as fe, KeepAlive as ht, normalizeStyle as Tt, isRef as kt, isReadonly as wt } from "vue";
3
3
  import { RouterView as Ct } from "vue-router";
4
4
  function Rt(e = {}) {
5
5
  return {
@@ -11,7 +11,7 @@ function Rt(e = {}) {
11
11
  defaultRoute: e.defaultRoute ?? "/"
12
12
  };
13
13
  }
14
- function V(e, n) {
14
+ function U(e, n) {
15
15
  const o = e.resolve(n);
16
16
  if (!o || !o.matched.length)
17
17
  throw new Error(`[RouterTabs] Unable to resolve route: ${String(n)}`);
@@ -24,7 +24,7 @@ const Pt = {
24
24
  full: (e) => e.fullPath,
25
25
  name: (e) => e.name ? String(e.name) : e.fullPath
26
26
  };
27
- function N(e) {
27
+ function V(e) {
28
28
  const n = e.meta?.key;
29
29
  if (typeof n == "function") {
30
30
  const o = n(e);
@@ -35,34 +35,34 @@ function N(e) {
35
35
  }
36
36
  return e.fullPath;
37
37
  }
38
- function ve(e, n) {
38
+ function me(e, n) {
39
39
  const o = e.meta?.keepAlive;
40
40
  return typeof o == "boolean" ? o : n;
41
41
  }
42
- function ye(e, n) {
42
+ function ve(e, n) {
43
43
  const o = e.meta?.reuse;
44
44
  return typeof o == "boolean" ? o : n;
45
45
  }
46
- function Ve(e) {
46
+ function Ue(e) {
47
47
  const n = e.meta ?? {}, o = {};
48
48
  return "title" in n && (o.title = n.title), "tips" in n && (o.tips = n.tips), "icon" in n && (o.icon = n.icon), "closable" in n && (o.closable = n.closable), "tabClass" in n && (o.tabClass = n.tabClass), "target" in n && (o.target = n.target), "href" in n && (o.href = n.href), o;
49
49
  }
50
- function ee(e, n, o) {
51
- const l = Ve(e);
50
+ function q(e, n, o) {
51
+ const l = Ue(e);
52
52
  return {
53
- id: N(e),
53
+ id: V(e),
54
54
  to: e.fullPath,
55
55
  fullPath: e.fullPath,
56
56
  matched: e,
57
- alive: ve(e, o),
58
- reusable: ye(e, !1),
57
+ alive: me(e, o),
58
+ reusable: ve(e, !1),
59
59
  closable: l.closable ?? !0,
60
60
  renderKey: typeof n.renderKey == "number" ? n.renderKey : 0,
61
61
  ...l,
62
62
  ...n
63
63
  };
64
64
  }
65
- function be(e, n, o, l) {
65
+ function de(e, n, o, l) {
66
66
  if (!e.find((p) => p.id === n.id)) {
67
67
  if (o === "next" && l) {
68
68
  const p = e.findIndex((T) => T.id === l);
@@ -74,7 +74,7 @@ function be(e, n, o, l) {
74
74
  e.push(n);
75
75
  }
76
76
  }
77
- function Se(e, n, o) {
77
+ function xe(e, n, o) {
78
78
  if (!n || n <= 0) return;
79
79
  const l = e.filter((r) => r.alive);
80
80
  for (; l.length > n; ) {
@@ -95,48 +95,48 @@ function At(e) {
95
95
  renderKey: e.renderKey
96
96
  };
97
97
  }
98
- function Et(e) {
98
+ function Kt(e) {
99
99
  const n = {};
100
100
  return "title" in e && (n.title = e.title), "tips" in e && (n.tips = e.tips), "icon" in e && (n.icon = e.icon), "tabClass" in e && (n.tabClass = e.tabClass), "closable" in e && (n.closable = e.closable), "renderKey" in e && typeof e.renderKey == "number" && (n.renderKey = e.renderKey), n;
101
101
  }
102
- function Kt(e, n = {}) {
103
- const o = Rt(n), l = ge([]), r = $(null), p = bt(), T = $(null), s = k(
102
+ function Et(e, n = {}) {
103
+ const o = Rt(n), l = pe([]), r = $(null), p = dt(), T = $(null), s = k(
104
104
  () => l.filter((i) => i.alive).map((i) => `${i.id}::${i.renderKey ?? 0}`)
105
105
  );
106
106
  let c = !1;
107
107
  function g(i) {
108
- const b = typeof i.matched == "object" ? i : V(e, i);
108
+ const b = typeof i.matched == "object" ? i : U(e, i);
109
109
  return {
110
- key: N(b),
110
+ key: V(b),
111
111
  fullPath: b.fullPath,
112
- alive: ve(b, o.keepAlive),
113
- reusable: ye(b, !1),
112
+ alive: me(b, o.keepAlive),
113
+ reusable: ve(b, !1),
114
114
  matched: b
115
115
  };
116
116
  }
117
- function R(i) {
118
- const b = N(i);
117
+ function P(i) {
118
+ const b = V(i);
119
119
  let d = l.find((h) => h.id === b);
120
- return d ? (d.fullPath = i.fullPath, d.to = i.fullPath, d.matched = i, d.alive = ve(i, o.keepAlive), d.reusable = ye(i, d.reusable), typeof d.renderKey != "number" && (d.renderKey = 0), Object.assign(d, Ve(i)), d) : (d = ee(i, {}, o.keepAlive), be(l, d, o.appendPosition, r.value), Se(l, o.maxAlive, r.value), d);
120
+ return d ? (d.fullPath = i.fullPath, d.to = i.fullPath, d.matched = i, d.alive = me(i, o.keepAlive), d.reusable = ve(i, d.reusable), typeof d.renderKey != "number" && (d.renderKey = 0), Object.assign(d, Ue(i)), d) : (d = q(i, {}, o.keepAlive), de(l, d, o.appendPosition, r.value), xe(l, o.maxAlive, r.value), d);
121
121
  }
122
- async function S(i, b = !1, d = !0) {
123
- const h = V(e, i), w = N(h), E = r.value === w;
124
- d === "sameTab" && (d = E), d && await L(w, !0), await e[b ? "replace" : "push"](h), E && await y();
122
+ async function D(i, b = !1, d = !0) {
123
+ const h = U(e, i), w = V(h), K = r.value === w;
124
+ d === "sameTab" && (d = K), d && await L(w, !0), await e[b ? "replace" : "push"](h), K && await y();
125
125
  }
126
126
  function B(i) {
127
- const b = l.findIndex((x) => x.id === i);
127
+ const b = l.findIndex((I) => I.id === i);
128
128
  if (b === -1) return o.defaultRoute;
129
- const d = l[b + 1], h = l[b - 1], w = l.find((x) => x.id !== i), E = d || h || w;
130
- return E ? E.to : o.defaultRoute;
129
+ const d = l[b + 1], h = l[b - 1], w = l.find((I) => I.id !== i), K = d || h || w;
130
+ return K ? K.to : o.defaultRoute;
131
131
  }
132
132
  async function z(i = r.value, b = {}) {
133
133
  if (!i) return;
134
134
  if (!b.force && o.keepLastTab && l.length === 1)
135
135
  throw new Error("[RouterTabs] Unable to close the final tab when keepLastTab is true.");
136
136
  const h = r.value === i && b.redirect !== null, w = h ? b.redirect ?? B(i) : null;
137
- await Y(i, { force: b.force }), b.redirect !== null && h && w && await e.replace(w);
137
+ await _(i, { force: b.force }), b.redirect !== null && h && w && await e.replace(w);
138
138
  }
139
- async function Y(i, b = {}) {
139
+ async function _(i, b = {}) {
140
140
  const d = l.findIndex((h) => h.id === i);
141
141
  d !== -1 && (l.splice(d, 1), T.value === i && (T.value = null), r.value === i && (r.value = null, p.value = void 0));
142
142
  }
@@ -145,16 +145,16 @@ function Kt(e, n = {}) {
145
145
  const d = l.find((w) => w.id === i);
146
146
  if (!d) return;
147
147
  const h = o.keepAlive && d.alive;
148
- h && (d.alive = !1, await _()), d.renderKey = (d.renderKey ?? 0) + 1, h && (d.alive = !0), T.value = i, await _(), await _(), T.value = null;
148
+ h && (d.alive = !1, await N()), d.renderKey = (d.renderKey ?? 0) + 1, h && (d.alive = !0), T.value = i, await N(), b || await N(), T.value = null;
149
149
  }
150
- async function ae(i = !1) {
150
+ async function te(i = !1) {
151
151
  for (const b of l)
152
152
  await L(b.id, i);
153
153
  }
154
- async function re(i = o.defaultRoute) {
154
+ async function ne(i = o.defaultRoute) {
155
155
  l.splice(0, l.length), r.value = null, p.value = void 0;
156
156
  for (const b of o.initialTabs) {
157
- const d = V(e, b.to), h = ee(d, b, o.keepAlive);
157
+ const d = U(e, b.to), h = q(d, b, o.keepAlive);
158
158
  l.push(h);
159
159
  }
160
160
  await e.replace(i);
@@ -164,7 +164,7 @@ function Kt(e, n = {}) {
164
164
  i && await L(i, !0);
165
165
  }
166
166
  function G(i) {
167
- return typeof i.matched == "object" ? N(i) : N(V(e, i));
167
+ return typeof i.matched == "object" ? V(i) : V(U(e, i));
168
168
  }
169
169
  function M() {
170
170
  const i = l.find((b) => b.id === r.value);
@@ -173,13 +173,13 @@ function Kt(e, n = {}) {
173
173
  active: i ? i.to : null
174
174
  };
175
175
  }
176
- async function D(i) {
176
+ async function S(i) {
177
177
  c = !0, l.splice(0, l.length), r.value = null, p.value = void 0;
178
178
  const b = i?.tabs ?? [];
179
179
  for (const h of b)
180
180
  try {
181
- const w = V(e, h.to), E = Et(h), x = ee(w, E, o.keepAlive);
182
- be(l, x, "last", null);
181
+ const w = U(e, h.to), K = Kt(h), I = q(w, K, o.keepAlive);
182
+ de(l, I, "last", null);
183
183
  } catch {
184
184
  }
185
185
  c = !1;
@@ -194,13 +194,13 @@ function Kt(e, n = {}) {
194
194
  () => e.currentRoute.value,
195
195
  (i) => {
196
196
  if (c) return;
197
- const b = R(i);
198
- r.value = b.id, p.value = b, Se(l, o.maxAlive, r.value);
197
+ const b = P(i);
198
+ r.value = b.id, p.value = b, xe(l, o.maxAlive, r.value);
199
199
  },
200
200
  { immediate: !0 }
201
201
  ), o.initialTabs.length && o.initialTabs.forEach((i) => {
202
- const b = V(e, i.to), d = ee(b, i, o.keepAlive);
203
- be(l, d, "last", null);
202
+ const b = U(e, i.to), d = q(b, i, o.keepAlive);
203
+ de(l, d, "last", null);
204
204
  }), {
205
205
  options: o,
206
206
  tabs: l,
@@ -208,29 +208,29 @@ function Kt(e, n = {}) {
208
208
  current: p,
209
209
  includeKeys: s,
210
210
  refreshingKey: T,
211
- openTab: S,
211
+ openTab: D,
212
212
  closeTab: z,
213
- removeTab: Y,
213
+ removeTab: _,
214
214
  refreshTab: L,
215
- refreshAll: ae,
216
- reset: re,
215
+ refreshAll: te,
216
+ reset: ne,
217
217
  reload: y,
218
218
  getRouteKey: G,
219
219
  matchRoute: g,
220
220
  snapshot: M,
221
- hydrate: D
221
+ hydrate: S
222
222
  };
223
223
  }
224
224
  function De(e) {
225
225
  return e ? typeof e == "string" ? { name: e } : e : {};
226
226
  }
227
- const oe = Symbol("RouterTabsContext"), ne = "router-tabs:snapshot";
228
- function $e(e = {}) {
229
- const { optional: n = !1 } = e, o = Ae(oe, null);
227
+ const ee = Symbol("RouterTabsContext"), Z = "router-tabs:snapshot";
228
+ function Se(e = {}) {
229
+ const { optional: n = !1 } = e, o = Pe(ee, null);
230
230
  if (o) return o;
231
- const l = Ae("$tabs", null);
231
+ const l = Pe("$tabs", null);
232
232
  if (l) return l;
233
- const p = Oe()?.appContext.config.globalProperties.$tabs;
233
+ const p = je()?.appContext.config.globalProperties.$tabs;
234
234
  if (p) return p;
235
235
  if (!n)
236
236
  throw new Error("[RouterTabs] useRouterTabs must be used within <router-tab>.");
@@ -245,7 +245,7 @@ function xt(e) {
245
245
  return decodeURIComponent(l.slice(n.length));
246
246
  return null;
247
247
  }
248
- function Be(e, n, o) {
248
+ function $e(e, n, o) {
249
249
  if (typeof document > "u") return;
250
250
  const {
251
251
  expiresInDays: l = 7,
@@ -260,12 +260,12 @@ function Be(e, n, o) {
260
260
  }
261
261
  r && c.push(`Path=${r}`), p && c.push(`Domain=${p}`), T && c.push("Secure"), s && c.push(`SameSite=${s.charAt(0).toUpperCase()}${s.slice(1)}`), document.cookie = c.join("; ");
262
262
  }
263
- function Me(e, n) {
263
+ function Be(e, n) {
264
264
  if (typeof document > "u") return;
265
265
  const { path: o = "/", domain: l } = n, r = [`${encodeURIComponent(e)}=`];
266
266
  r.push("Expires=Thu, 01 Jan 1970 00:00:01 GMT"), o && r.push(`Path=${o}`), l && r.push(`Domain=${l}`), document.cookie = r.join("; ");
267
267
  }
268
- const St = (e) => JSON.stringify(e ?? null), Dt = (e) => {
268
+ const Dt = (e) => JSON.stringify(e ?? null), St = (e) => {
269
269
  if (!e) return null;
270
270
  try {
271
271
  return JSON.parse(e);
@@ -273,20 +273,20 @@ const St = (e) => JSON.stringify(e ?? null), Dt = (e) => {
273
273
  return null;
274
274
  }
275
275
  };
276
- function Ne(e = {}) {
276
+ function Ve(e = {}) {
277
277
  const {
278
- cookieKey: n = ne,
279
- serialize: o = St,
280
- deserialize: l = Dt
281
- } = e, r = $e({ optional: !0 }), p = $(!0), T = (s) => {
282
- me(async () => {
278
+ cookieKey: n = Z,
279
+ serialize: o = Dt,
280
+ deserialize: l = St
281
+ } = e, r = Se({ optional: !0 }), p = $(!0), T = (s) => {
282
+ ge(async () => {
283
283
  const c = l(xt(n));
284
284
  if (c && c.tabs?.length)
285
285
  try {
286
286
  if (p.value = !0, await s.hydrate(c), c.active) {
287
- await _();
288
- const R = s.tabs.find((S) => S.to === c.active);
289
- R && (s.activeId.value = R.id, s.current.value = R);
287
+ await N();
288
+ const P = s.tabs.find((D) => D.to === c.active);
289
+ P && (s.activeId.value = P.id, s.current.value = P);
290
290
  }
291
291
  } finally {
292
292
  p.value = !1;
@@ -294,15 +294,15 @@ function Ne(e = {}) {
294
294
  else if (Object.prototype.hasOwnProperty.call(e, "fallbackRoute"))
295
295
  try {
296
296
  p.value = !0;
297
- const R = e.fallbackRoute ?? s.options.defaultRoute;
298
- await s.reset(R);
297
+ const P = e.fallbackRoute ?? s.options.defaultRoute;
298
+ await s.reset(P);
299
299
  } finally {
300
300
  p.value = !1;
301
301
  }
302
302
  else
303
303
  p.value = !1;
304
304
  const g = s.snapshot();
305
- g.tabs.length ? Be(n, o(g), e) : Me(n, e), p.value = !1;
305
+ g.tabs.length ? $e(n, o(g), e) : Be(n, e), p.value = !1;
306
306
  }), A(
307
307
  () => ({
308
308
  tabs: s.tabs.map((c) => ({
@@ -319,17 +319,17 @@ function Ne(e = {}) {
319
319
  () => {
320
320
  if (p.value) return;
321
321
  const c = s.snapshot();
322
- c.tabs.length ? Be(n, o(c), e) : Me(n, e);
322
+ c.tabs.length ? $e(n, o(c), e) : Be(n, e);
323
323
  },
324
324
  { deep: !0 }
325
325
  );
326
326
  };
327
- r ? T(r) : me(() => {
328
- const s = $e({ optional: !0 });
327
+ r ? T(r) : ge(() => {
328
+ const s = Se({ optional: !0 });
329
329
  s && T(s);
330
330
  });
331
331
  }
332
- const $t = Ue({
332
+ const $t = Oe({
333
333
  name: "RouterTab",
334
334
  components: { RouterView: Ct },
335
335
  props: {
@@ -371,7 +371,7 @@ const $t = Ue({
371
371
  },
372
372
  cookieKey: {
373
373
  type: String,
374
- default: ne
374
+ default: Z
375
375
  },
376
376
  persistence: {
377
377
  type: Object,
@@ -384,13 +384,13 @@ const $t = Ue({
384
384
  },
385
385
  emits: ["tab-sort", "tab-sorted"],
386
386
  setup(e, { emit: n }) {
387
- const o = Oe();
387
+ const o = je();
388
388
  if (!o)
389
389
  throw new Error("[RouterTab] component must be used within a Vue application context.");
390
390
  const l = o.appContext.app.config.globalProperties.$router;
391
391
  if (!l)
392
392
  throw new Error("[RouterTab] Vue Router is required. Make sure to call app.use(router) before RouterTab.");
393
- const r = Kt(l, {
393
+ const r = Et(l, {
394
394
  initialTabs: e.tabs,
395
395
  keepAlive: e.keepAlive,
396
396
  maxAlive: e.maxAlive,
@@ -398,22 +398,22 @@ const $t = Ue({
398
398
  appendPosition: e.append,
399
399
  defaultRoute: e.defaultPage
400
400
  });
401
- pt(oe, r), o.appContext.config.globalProperties.$tabs = r;
401
+ bt(ee, r), o.appContext.config.globalProperties.$tabs = r;
402
402
  const p = k(() => !!o?.slots?.default), T = k(() => !!o?.slots?.start), s = k(() => !!o?.slots?.end), c = $(0), g = k(() => {
403
403
  c.value;
404
404
  const t = {};
405
405
  return r.tabs.forEach((a) => {
406
- const f = typeof a.title == "string" ? a.title : String(a.title || ie(a));
406
+ const f = typeof a.title == "string" ? a.title : String(a.title || oe(a));
407
407
  t[a.id] = f;
408
408
  }), t;
409
409
  });
410
- function R() {
410
+ function P() {
411
411
  c.value++;
412
412
  }
413
- const S = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map();
413
+ const D = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map();
414
414
  function z(t, a) {
415
- if (!a || S.has(t)) return;
416
- S.set(t, a);
415
+ if (!a || D.has(t)) return;
416
+ D.set(t, a);
417
417
  const f = r.tabs.find((v) => r.getRouteKey(v.to) === t);
418
418
  if (!f) return;
419
419
  const m = [];
@@ -426,7 +426,7 @@ const $t = Ue({
426
426
  (u) => {
427
427
  if (u != null) {
428
428
  const j = String(u);
429
- f.title = j, R();
429
+ f.title = j, P();
430
430
  }
431
431
  },
432
432
  { immediate: !0 }
@@ -440,7 +440,7 @@ const $t = Ue({
440
440
  return u && typeof u == "object" && "value" in u ? u.value : u;
441
441
  },
442
442
  (u) => {
443
- u != null && (f.icon = String(u), R());
443
+ u != null && (f.icon = String(u), P());
444
444
  },
445
445
  { immediate: !0 }
446
446
  );
@@ -453,7 +453,7 @@ const $t = Ue({
453
453
  return u && typeof u == "object" && "value" in u ? u.value : u;
454
454
  },
455
455
  (u) => {
456
- u != null && (f.closable = !!u, R());
456
+ u != null && (f.closable = !!u, P());
457
457
  },
458
458
  { immediate: !0 }
459
459
  );
@@ -466,7 +466,7 @@ const $t = Ue({
466
466
  return u && typeof u == "object" && "value" in u ? u.value : u;
467
467
  },
468
468
  (u) => {
469
- u && typeof u == "object" && (Object.assign(f, u), R());
469
+ u && typeof u == "object" && (Object.assign(f, u), P());
470
470
  },
471
471
  { immediate: !0, deep: !0 }
472
472
  );
@@ -474,24 +474,24 @@ const $t = Ue({
474
474
  }
475
475
  B.set(t, m);
476
476
  }
477
- function Y(t) {
477
+ function _(t) {
478
478
  const a = B.get(t);
479
- a && (a.forEach((f) => f()), B.delete(t)), S.delete(t);
479
+ a && (a.forEach((f) => f()), B.delete(t)), D.delete(t);
480
480
  }
481
481
  function L(t, a) {
482
- t ? t.routeTabTitle !== void 0 || t.routeTabIcon !== void 0 || t.routeTabClosable !== void 0 ? z(a, t) : t.$ && (t.$.routeTabTitle !== void 0 || t.$.routeTabIcon !== void 0 || t.$.routeTabClosable !== void 0) && z(a, t.$) : t === null && Y(a);
482
+ t ? t.routeTabTitle !== void 0 || t.routeTabIcon !== void 0 || t.routeTabClosable !== void 0 ? z(a, t) : t.$ && (t.$.routeTabTitle !== void 0 || t.$.routeTabIcon !== void 0 || t.$.routeTabClosable !== void 0) && z(a, t.$) : t === null && _(a);
483
483
  }
484
484
  if (e.cookieKey !== null || e.persistence) {
485
485
  const t = {
486
486
  ...e.persistence ?? {}
487
487
  };
488
- e.cookieKey !== null ? t.cookieKey = e.cookieKey || ne : t.cookieKey || (t.cookieKey = ne), Ne(t);
488
+ e.cookieKey !== null ? t.cookieKey = e.cookieKey || Z : t.cookieKey || (t.cookieKey = Z), Ve(t);
489
489
  }
490
- const ae = k(() => De(e.tabTransition)), re = k(() => De(e.pageTransition)), y = ge({
490
+ const te = k(() => De(e.tabTransition)), ne = k(() => De(e.pageTransition)), y = pe({
491
491
  visible: !1,
492
492
  target: null,
493
493
  position: { x: 0, y: 0 }
494
- }), G = $(null), M = $([]), D = $(-1), i = ge({
494
+ }), G = $(null), M = $([]), S = $(-1), i = pe({
495
495
  dragging: !1,
496
496
  dragIndex: -1,
497
497
  dropIndex: -1,
@@ -515,10 +515,10 @@ const $t = Ue({
515
515
  const a = d(t.id);
516
516
  return a > -1 ? r.tabs.slice(a + 1) : [];
517
517
  }
518
- function E(t) {
518
+ function K(t) {
519
519
  return r.tabs.filter((a) => a.id !== t.id);
520
520
  }
521
- async function x(t, a) {
521
+ async function I(t, a) {
522
522
  const f = t.filter((m) => m.closable !== !1);
523
523
  if (f.length) {
524
524
  for (const m of f)
@@ -526,7 +526,7 @@ const $t = Ue({
526
526
  r.activeId.value !== a.id && await r.openTab(a.to, !0, !1);
527
527
  }
528
528
  }
529
- const He = {
529
+ const Fe = {
530
530
  refresh: {
531
531
  label: "Refresh",
532
532
  handler: async ({ target: t }) => {
@@ -544,73 +544,73 @@ const $t = Ue({
544
544
  handler: async ({ target: t }) => {
545
545
  await r.closeTab(t.id);
546
546
  },
547
- enable: ({ target: t }) => le(t)
547
+ enable: ({ target: t }) => ae(t)
548
548
  },
549
549
  closeLefts: {
550
550
  label: "Close to the Left",
551
551
  handler: async ({ target: t }) => {
552
- await x(h(t), t);
552
+ await I(h(t), t);
553
553
  },
554
554
  enable: ({ target: t }) => h(t).some((a) => a.closable !== !1)
555
555
  },
556
556
  closeRights: {
557
557
  label: "Close to the Right",
558
558
  handler: async ({ target: t }) => {
559
- await x(w(t), t);
559
+ await I(w(t), t);
560
560
  },
561
561
  enable: ({ target: t }) => w(t).some((a) => a.closable !== !1)
562
562
  },
563
563
  closeOthers: {
564
564
  label: "Close Others",
565
565
  handler: async ({ target: t }) => {
566
- await x(E(t), t);
566
+ await I(K(t), t);
567
567
  },
568
- enable: ({ target: t }) => E(t).some((a) => a.closable !== !1)
568
+ enable: ({ target: t }) => K(t).some((a) => a.closable !== !1)
569
569
  }
570
570
  };
571
- function K() {
572
- y.visible = !1, y.target = null, D.value = -1, M.value = [];
571
+ function E() {
572
+ y.visible = !1, y.target = null, S.value = -1, M.value = [];
573
573
  }
574
- function Je(t, a) {
575
- e.contextmenu && (y.visible = !0, y.target = t, y.position.x = a.clientX, y.position.y = a.clientY, document.addEventListener("click", K, { once: !0 }), _(() => {
576
- Ge();
574
+ function He(t, a) {
575
+ e.contextmenu && (y.visible = !0, y.target = t, y.position.x = a.clientX, y.position.y = a.clientY, document.addEventListener("click", E, { once: !0 }), N(() => {
576
+ We();
577
577
  }));
578
578
  }
579
- function We(t, a) {
580
- const f = typeof t == "string" ? { id: t } : t, m = He[f.id], v = f.label ?? m?.label ?? String(f.id), u = f.visible ?? m?.visible ?? !0;
579
+ function Je(t, a) {
580
+ const f = typeof t == "string" ? { id: t } : t, m = Fe[f.id], v = f.label ?? m?.label ?? String(f.id), u = f.visible ?? m?.visible ?? !0;
581
581
  if (!(typeof u == "function" ? u(a) : u !== !1)) return null;
582
- const se = f.enable ?? m?.enable ?? !0, ft = typeof se == "function" ? se(a) : se !== !1, Pe = f.handler ?? m?.handler;
583
- if (!Pe) return null;
584
- const dt = async () => {
585
- await Promise.resolve(Pe(a));
582
+ const re = f.enable ?? m?.enable ?? !0, ct = typeof re == "function" ? re(a) : re !== !1, Re = f.handler ?? m?.handler;
583
+ if (!Re) return null;
584
+ const ft = async () => {
585
+ await Promise.resolve(Re(a));
586
586
  };
587
587
  return {
588
588
  id: String(f.id),
589
589
  label: v,
590
- disabled: !ft,
591
- action: dt
590
+ disabled: !ct,
591
+ action: ft
592
592
  };
593
593
  }
594
- const F = k(() => {
594
+ const Y = k(() => {
595
595
  if (!y.visible || !y.target || e.contextmenu === !1) return [];
596
596
  const t = Array.isArray(e.contextmenu) ? e.contextmenu : b, a = { target: y.target, controller: r };
597
- return t.map((f) => We(f, a)).filter((f) => !!f);
597
+ return t.map((f) => Je(f, a)).filter((f) => !!f);
598
598
  });
599
- function Ge() {
599
+ function We() {
600
600
  const t = G.value;
601
601
  if (!t) return;
602
602
  const a = 8, { innerWidth: f, innerHeight: m } = window, v = t.getBoundingClientRect();
603
603
  let u = y.position.x, j = y.position.y;
604
604
  v.right > f - a && (u = Math.max(a, f - v.width - a)), v.bottom > m - a && (j = Math.max(a, m - v.height - a)), (u !== y.position.x || j !== y.position.y) && (y.position.x = u, y.position.y = j);
605
605
  }
606
- function Xe(t, a) {
606
+ function Ge(t, a) {
607
607
  M.value[a] = t ?? null;
608
608
  }
609
- function qe(t) {
609
+ function Xe(t) {
610
610
  if (t < 0) return;
611
611
  M.value[t]?.focus({ preventScroll: !0 });
612
612
  }
613
- function X(t, a, f = F.value) {
613
+ function X(t, a, f = Y.value) {
614
614
  if (!f.length) return -1;
615
615
  const m = f.length;
616
616
  let v = t;
@@ -618,19 +618,19 @@ const $t = Ue({
618
618
  if (v = (v + a + m) % m, !f[v].disabled) return v;
619
619
  return -1;
620
620
  }
621
- function H(t) {
622
- D.value = t, !(t < 0) && _(() => qe(t));
621
+ function F(t) {
622
+ S.value = t, !(t < 0) && N(() => Xe(t));
623
623
  }
624
- function ke(t) {
625
- const a = X(D.value, t);
626
- a !== -1 && H(a);
624
+ function Te(t) {
625
+ const a = X(S.value, t);
626
+ a !== -1 && F(a);
627
627
  }
628
- function Qe(t) {
628
+ function qe(t) {
629
629
  if (!y.visible) return;
630
- const a = t.key, f = F.value;
630
+ const a = t.key, f = Y.value;
631
631
  if (!f.length) return;
632
632
  if (a === "Tab") {
633
- K();
633
+ E();
634
634
  return;
635
635
  }
636
636
  if ([
@@ -648,90 +648,90 @@ const $t = Ue({
648
648
  switch (t.preventDefault(), a) {
649
649
  case "ArrowDown":
650
650
  case "ArrowRight":
651
- ke(1);
651
+ Te(1);
652
652
  break;
653
653
  case "ArrowUp":
654
654
  case "ArrowLeft":
655
- ke(-1);
655
+ Te(-1);
656
656
  break;
657
657
  case "Home":
658
- H(X(-1, 1));
658
+ F(X(-1, 1));
659
659
  break;
660
660
  case "End":
661
- H(X(f.length, -1));
661
+ F(X(f.length, -1));
662
662
  break;
663
663
  case "Enter":
664
664
  case " ":
665
665
  case "Spacebar": {
666
- const v = D.value;
666
+ const v = S.value;
667
667
  if (v > -1) {
668
668
  const u = f[v];
669
- u.disabled || we(u);
669
+ u.disabled || ke(u);
670
670
  }
671
671
  break;
672
672
  }
673
673
  case "Escape":
674
- K();
674
+ E();
675
675
  break;
676
676
  }
677
677
  }
678
- async function we(t) {
679
- t.disabled || (K(), await t.action());
678
+ async function ke(t) {
679
+ t.disabled || (E(), await t.action());
680
680
  }
681
- function ie(t) {
681
+ function oe(t) {
682
682
  return typeof t.title == "string" && t.title.trim() ? t.title : Array.isArray(t.title) && t.title.length && String(t.title[0]).trim() ? String(t.title[0]) : "Untitled";
683
683
  }
684
- function Ze(t) {
685
- return g.value[t.id] || ie(t);
684
+ function Qe(t) {
685
+ return g.value[t.id] || oe(t);
686
686
  }
687
- function Ce(t) {
687
+ function we(t) {
688
688
  const a = r.getRouteKey(t), m = r.tabs.find((v) => v.id === a)?.renderKey ?? 0;
689
689
  return `${a}::${m}`;
690
690
  }
691
- function et(t) {
692
- return `${Ce(t)}::refresh`;
691
+ function Ze(t) {
692
+ return `${we(t)}::refresh`;
693
693
  }
694
- function le(t) {
694
+ function ae(t) {
695
695
  return !(t.closable === !1 || r.options.keepLastTab && r.tabs.length <= 1);
696
696
  }
697
- async function tt(t) {
697
+ async function et(t) {
698
698
  await r.closeTab(t.id);
699
699
  }
700
- function nt(t) {
700
+ function tt(t) {
701
701
  if (t.href && typeof window < "u") {
702
702
  t.target && t.target !== "_self" ? window.open(t.href, t.target) : window.location.assign(t.href);
703
703
  return;
704
704
  }
705
705
  r.activeId.value !== t.id && r.openTab(t.to, !1);
706
706
  }
707
- function ot(t) {
707
+ function nt(t) {
708
708
  return [
709
709
  "router-tab__item",
710
710
  {
711
711
  "is-active": r.activeId.value === t.id,
712
- "is-closable": le(t),
712
+ "is-closable": ae(t),
713
713
  "is-dragging": i.dragging && i.dragTab?.id === t.id,
714
714
  "is-drag-over": i.dropIndex === d(t.id)
715
715
  },
716
716
  t.tabClass
717
717
  ];
718
718
  }
719
- function at(t) {
719
+ function ot(t) {
720
720
  return r.refreshingKey.value === r.getRouteKey(t);
721
721
  }
722
- function rt(t, a, f) {
722
+ function at(t, a, f) {
723
723
  e.sortable && (i.dragging = !0, i.dragIndex = a, i.dragTab = t, f.dataTransfer && (f.dataTransfer.effectAllowed = "move", f.dataTransfer.setData("text/plain", t.id)), n("tab-sort", { tab: t, index: a }));
724
724
  }
725
- function it(t, a) {
725
+ function rt(t, a) {
726
726
  !e.sortable || !i.dragging || (a.preventDefault(), a.dataTransfer && (a.dataTransfer.dropEffect = "move"));
727
727
  }
728
- function lt(t) {
728
+ function it(t) {
729
729
  !e.sortable || !i.dragging || (i.dropIndex = t);
730
730
  }
731
- function st() {
731
+ function lt() {
732
732
  !e.sortable || i.dragging;
733
733
  }
734
- function ut(t, a) {
734
+ function st(t, a) {
735
735
  if (!(!e.sortable || !i.dragging)) {
736
736
  if (a.preventDefault(), i.dragIndex !== -1 && i.dragIndex !== t) {
737
737
  const f = r.tabs.splice(i.dragIndex, 1)[0];
@@ -741,18 +741,18 @@ const $t = Ue({
741
741
  toIndex: t
742
742
  });
743
743
  }
744
- Re();
744
+ Ce();
745
745
  }
746
746
  }
747
- function Re() {
747
+ function Ce() {
748
748
  i.dragging = !1, i.dragIndex = -1, i.dropIndex = -1, i.dragTab = null;
749
749
  }
750
- me(() => {
751
- document.addEventListener("keydown", K);
752
- }), gt(() => {
753
- document.removeEventListener("keydown", K), o.appContext.config.globalProperties.$tabs = null, B.forEach((t) => {
750
+ ge(() => {
751
+ document.addEventListener("keydown", E);
752
+ }), pt(() => {
753
+ document.removeEventListener("keydown", E), o.appContext.config.globalProperties.$tabs = null, B.forEach((t) => {
754
754
  t.forEach((a) => a());
755
- }), B.clear(), S.clear();
755
+ }), B.clear(), D.clear();
756
756
  }), A(
757
757
  () => e.keepAlive,
758
758
  (t) => {
@@ -760,66 +760,66 @@ const $t = Ue({
760
760
  }
761
761
  ), A(
762
762
  () => r.activeId.value,
763
- () => K()
763
+ () => E()
764
764
  ), A(
765
765
  () => e.contextmenu,
766
766
  (t) => {
767
- t || K();
767
+ t || E();
768
768
  }
769
769
  ), A(
770
- () => F.value.length,
770
+ () => Y.value.length,
771
771
  (t) => {
772
- y.visible && t === 0 && K();
772
+ y.visible && t === 0 && E();
773
773
  }
774
- ), A(F, (t) => {
774
+ ), A(Y, (t) => {
775
775
  if (M.value = new Array(t.length).fill(null), !y.visible) return;
776
776
  const a = X(-1, 1, t);
777
- H(a);
777
+ F(a);
778
778
  }), A(
779
779
  () => y.visible,
780
780
  (t) => {
781
- t || (D.value = -1, M.value = []);
781
+ t || (S.value = -1, M.value = []);
782
782
  }
783
783
  );
784
- const ct = r.includeKeys;
784
+ const ut = r.includeKeys;
785
785
  return {
786
786
  controller: r,
787
787
  tabs: r.tabs,
788
- includeKeys: ct,
789
- tabTransitionProps: ae,
790
- pageTransitionProps: re,
791
- buildTabClass: ot,
792
- activate: nt,
793
- close: tt,
788
+ includeKeys: ut,
789
+ tabTransitionProps: te,
790
+ pageTransitionProps: ne,
791
+ buildTabClass: nt,
792
+ activate: tt,
793
+ close: et,
794
794
  context: y,
795
- menuItems: F,
796
- handleMenuAction: we,
797
- showContextMenu: Je,
798
- hideContextMenu: K,
799
- getTabTitle: ie,
800
- isClosable: le,
801
- isRefreshing: at,
795
+ menuItems: Y,
796
+ handleMenuAction: ke,
797
+ showContextMenu: He,
798
+ hideContextMenu: E,
799
+ getTabTitle: oe,
800
+ isClosable: ae,
801
+ isRefreshing: ot,
802
802
  hasCustomSlot: p,
803
803
  hasStartSlot: T,
804
804
  hasEndSlot: s,
805
- onDragStart: rt,
806
- onDragOver: it,
807
- onDragEnter: lt,
808
- onDragLeave: st,
809
- onDrop: ut,
810
- onDragEnd: Re,
805
+ onDragStart: at,
806
+ onDragOver: rt,
807
+ onDragEnter: it,
808
+ onDragLeave: lt,
809
+ onDrop: st,
810
+ onDragEnd: Ce,
811
811
  setupComponentWatching: z,
812
- cleanupComponentWatching: Y,
812
+ cleanupComponentWatching: _,
813
813
  handleComponentRef: L,
814
- getReactiveTabTitle: Ze,
815
- getComponentCacheKey: Ce,
816
- getRefreshComponentKey: et,
817
- triggerTabUpdate: R,
814
+ getReactiveTabTitle: Qe,
815
+ getComponentCacheKey: we,
816
+ getRefreshComponentKey: Ze,
817
+ triggerTabUpdate: P,
818
818
  menuRef: G,
819
- highlightedIndex: D,
820
- setMenuItemRef: Xe,
821
- onMenuKeydown: Qe,
822
- highlightMenuIndex: H
819
+ highlightedIndex: S,
820
+ setMenuItemRef: Ge,
821
+ onMenuKeydown: qe,
822
+ highlightMenuIndex: F
823
823
  };
824
824
  }
825
825
  }), Bt = (e, n) => {
@@ -827,30 +827,30 @@ const $t = Ue({
827
827
  for (const [l, r] of n)
828
828
  o[l] = r;
829
829
  return o;
830
- }, Mt = { class: "router-tab" }, Lt = { class: "router-tab__header" }, jt = { class: "router-tab__scroll" }, Ot = ["data-title", "draggable", "onClick", "onAuxclick", "onContextmenu", "onDragstart", "onDragover", "onDragenter", "onDrop"], Ut = ["title"], Vt = ["onClick"], Nt = { class: "router-tab__container" }, _t = ["aria-disabled", "disabled", "tabindex", "onMouseenter", "onClick"];
831
- function zt(e, n, o, l, r, p) {
832
- const T = mt("RouterView");
833
- return P(), I("div", Mt, [
830
+ }, Mt = { class: "router-tab" }, Lt = { class: "router-tab__header" }, jt = { class: "router-tab__scroll" }, Ot = ["data-title", "draggable", "onClick", "onAuxclick", "onContextmenu", "onDragstart", "onDragover", "onDragenter", "onDrop"], Ut = ["title"], Vt = ["onClick"], Nt = { class: "router-tab__container" }, zt = ["aria-disabled", "disabled", "tabindex", "onMouseenter", "onClick"];
831
+ function _t(e, n, o, l, r, p) {
832
+ const T = gt("RouterView");
833
+ return C(), x("div", Mt, [
834
834
  O("header", Lt, [
835
835
  O("div", {
836
- class: J(["router-tab__slot-start", { "has-content": e.hasStartSlot }])
836
+ class: H(["router-tab__slot-start", { "has-content": e.hasStartSlot }])
837
837
  }, [
838
- ue(e.$slots, "start")
838
+ le(e.$slots, "start")
839
839
  ], 2),
840
840
  O("div", jt, [
841
- q(vt, Q({
841
+ Ae(mt, se({
842
842
  tag: "ul",
843
843
  class: "router-tab__nav"
844
844
  }, e.tabTransitionProps), {
845
- default: Z(() => [
846
- (P(!0), I(ce, null, Ee(e.tabs, (s, c) => (P(), I("li", {
845
+ default: ue(() => [
846
+ (C(!0), x(Ke, null, Ee(e.tabs, (s, c) => (C(), x("li", {
847
847
  key: s.id,
848
- class: J(e.buildTabClass(s)),
848
+ class: H(e.buildTabClass(s)),
849
849
  "data-title": e.getTabTitle(s),
850
850
  draggable: e.sortable,
851
851
  onClick: (g) => e.activate(s),
852
- onAuxclick: fe((g) => e.close(s), ["middle", "prevent"]),
853
- onContextmenu: fe((g) => e.showContextMenu(s, g), ["prevent"]),
852
+ onAuxclick: ce((g) => e.close(s), ["middle", "prevent"]),
853
+ onContextmenu: ce((g) => e.showContextMenu(s, g), ["prevent"]),
854
854
  onDragstart: (g) => e.onDragStart(s, c, g),
855
855
  onDragover: (g) => e.onDragOver(c, g),
856
856
  onDragenter: (g) => e.onDragEnter(c),
@@ -858,71 +858,67 @@ function zt(e, n, o, l, r, p) {
858
858
  onDrop: (g) => e.onDrop(c, g),
859
859
  onDragend: n[1] || (n[1] = (...g) => e.onDragEnd && e.onDragEnd(...g))
860
860
  }, [
861
- s.icon ? (P(), I("i", {
861
+ s.icon ? (C(), x("i", {
862
862
  key: 0,
863
- class: J(["router-tab__item-icon", s.icon])
864
- }, null, 2)) : U("", !0),
863
+ class: H(["router-tab__item-icon", s.icon])
864
+ }, null, 2)) : ie("", !0),
865
865
  O("span", {
866
866
  class: "router-tab__item-title",
867
867
  title: e.getReactiveTabTitle(s)
868
- }, Ke(e.getReactiveTabTitle(s)), 9, Ut),
869
- e.isClosable(s) ? (P(), I("a", {
868
+ }, Ie(e.getReactiveTabTitle(s)), 9, Ut),
869
+ e.isClosable(s) ? (C(), x("a", {
870
870
  key: 1,
871
871
  class: "router-tab__item-close",
872
- onClick: fe((g) => e.close(s), ["stop"])
873
- }, null, 8, Vt)) : U("", !0)
872
+ onClick: ce((g) => e.close(s), ["stop"])
873
+ }, null, 8, Vt)) : ie("", !0)
874
874
  ], 42, Ot))), 128))
875
875
  ]),
876
876
  _: 1
877
877
  }, 16)
878
878
  ]),
879
879
  O("div", {
880
- class: J(["router-tab__slot-end", { "has-content": e.hasEndSlot }])
880
+ class: H(["router-tab__slot-end", { "has-content": e.hasEndSlot }])
881
881
  }, [
882
- ue(e.$slots, "end")
882
+ le(e.$slots, "end")
883
883
  ], 2)
884
884
  ]),
885
885
  O("div", Nt, [
886
- q(T, null, {
887
- default: Z((s) => [
888
- e.hasCustomSlot ? ue(e.$slots, "default", yt(Q({ key: 0 }, {
886
+ Ae(T, null, {
887
+ default: ue((s) => [
888
+ e.hasCustomSlot ? le(e.$slots, "default", vt(se({ key: 0 }, {
889
889
  ...s,
890
890
  controller: e.controller,
891
891
  // Expose a ref binder so custom slots can keep reactivity
892
892
  pageRef: (c) => e.handleComponentRef(c, e.controller.getRouteKey(s.route))
893
- }))) : (P(), I(ce, { key: 1 }, [
894
- q(Ie, Q(e.pageTransitionProps, { appear: "" }), {
895
- default: Z(() => [
896
- e.controller.options.keepAlive ? (P(), de(ht, {
897
- key: 0,
898
- include: e.includeKeys,
899
- max: e.controller.options.maxAlive || void 0
900
- }, [
901
- e.isRefreshing(s.route) ? U("", !0) : (P(), de(xe(s.Component), {
902
- key: e.getComponentCacheKey(s.route),
903
- ref: (c) => e.handleComponentRef(c, e.controller.getRouteKey(s.route)),
904
- class: "router-tab-page"
905
- }))
906
- ], 1032, ["include", "max"])) : U("", !0)
907
- ]),
908
- _: 2
909
- }, 1040),
910
- q(Ie, Q(e.pageTransitionProps, { appear: "" }), {
911
- default: Z(() => [
912
- !e.controller.options.keepAlive || e.isRefreshing(s.route) ? (P(), de(xe(s.Component), {
913
- key: e.getRefreshComponentKey(s.route),
893
+ }))) : (C(), J(yt, se({ key: 1 }, e.pageTransitionProps, { appear: "" }), {
894
+ default: ue(() => [
895
+ e.isRefreshing(s.route) ? (C(), J(fe(s.Component), {
896
+ key: e.getRefreshComponentKey(s.route),
897
+ ref: (c) => e.handleComponentRef(c, e.controller.getRouteKey(s.route)),
898
+ class: "router-tab-page"
899
+ })) : e.controller.options.keepAlive ? (C(), J(ht, {
900
+ key: 1,
901
+ include: e.includeKeys,
902
+ max: e.controller.options.maxAlive || void 0
903
+ }, [
904
+ (C(), J(fe(s.Component), {
905
+ key: e.getComponentCacheKey(s.route),
914
906
  ref: (c) => e.handleComponentRef(c, e.controller.getRouteKey(s.route)),
915
907
  class: "router-tab-page"
916
- })) : U("", !0)
917
- ]),
918
- _: 2
919
- }, 1040)
920
- ], 64))
908
+ }))
909
+ ], 1032, ["include", "max"])) : (C(), J(fe(s.Component), {
910
+ key: e.getComponentCacheKey(s.route),
911
+ ref: (c) => e.handleComponentRef(c, e.controller.getRouteKey(s.route)),
912
+ class: "router-tab-page"
913
+ }))
914
+ ]),
915
+ _: 2
916
+ }, 1040))
921
917
  ]),
922
918
  _: 3
923
919
  })
924
920
  ]),
925
- e.context.visible && e.context.target ? (P(), I("div", {
921
+ e.context.visible && e.context.target ? (C(), x("div", {
926
922
  key: 0,
927
923
  ref: "menuRef",
928
924
  class: "router-tab__contextmenu",
@@ -930,10 +926,10 @@ function zt(e, n, o, l, r, p) {
930
926
  onKeydown: n[2] || (n[2] = (...s) => e.onMenuKeydown && e.onMenuKeydown(...s)),
931
927
  style: Tt({ left: e.context.position.x + "px", top: e.context.position.y + "px" })
932
928
  }, [
933
- (P(!0), I(ce, null, Ee(e.menuItems, (s, c) => (P(), I("a", {
929
+ (C(!0), x(Ke, null, Ee(e.menuItems, (s, c) => (C(), x("a", {
934
930
  key: s.id,
935
931
  role: "menuitem",
936
- class: J(["router-tab__contextmenu-item", { "is-focused": c === e.highlightedIndex }]),
932
+ class: H(["router-tab__contextmenu-item", { "is-focused": c === e.highlightedIndex }]),
937
933
  "aria-disabled": s.disabled,
938
934
  disabled: s.disabled,
939
935
  tabindex: s.disabled ? -1 : c === e.highlightedIndex ? 0 : -1,
@@ -941,14 +937,14 @@ function zt(e, n, o, l, r, p) {
941
937
  ref: (g) => e.setMenuItemRef(g, c),
942
938
  onMouseenter: (g) => !s.disabled && e.highlightMenuIndex(c),
943
939
  onClick: (g) => e.handleMenuAction(s)
944
- }, Ke(s.label), 43, _t))), 128))
945
- ], 36)) : U("", !0)
940
+ }, Ie(s.label), 43, zt))), 128))
941
+ ], 36)) : ie("", !0)
946
942
  ]);
947
943
  }
948
- const Le = /* @__PURE__ */ Bt($t, [["render", zt]]), Yt = {
944
+ const Me = /* @__PURE__ */ Bt($t, [["render", _t]]), Yt = {
949
945
  class: "router-tabs",
950
946
  "aria-hidden": "true"
951
- }, pe = /* @__PURE__ */ Ue({
947
+ }, be = /* @__PURE__ */ Oe({
952
948
  name: "RouterTabs",
953
949
  __name: "RouterTabs",
954
950
  props: {
@@ -963,11 +959,11 @@ const Le = /* @__PURE__ */ Bt($t, [["render", zt]]), Yt = {
963
959
  fallbackRoute: {}
964
960
  },
965
961
  setup(e) {
966
- return Ne(e), (o, l) => (P(), I("span", Yt));
962
+ return Ve(e), (o, l) => (C(), x("span", Yt));
967
963
  }
968
- }), _e = "tab-theme-style", ze = "tab-theme-primary-color", Ft = "system", Ye = "(prefers-color-scheme: dark)";
964
+ }), Ne = "tab-theme-style", ze = "tab-theme-primary-color", Ft = "system", _e = "(prefers-color-scheme: dark)";
969
965
  let W = null;
970
- const C = {
966
+ const R = {
971
967
  primary: "#034960",
972
968
  background: "#ffffff",
973
969
  text: "#1e293b",
@@ -1008,12 +1004,12 @@ function Jt(e) {
1008
1004
  return null;
1009
1005
  }
1010
1006
  }
1011
- function he(e) {
1012
- typeof document > "u" || (document.documentElement.style.setProperty("--router-tab-primary", e.primary ?? C.primary), document.documentElement.style.setProperty("--router-tab-header-bg", e.headerBackground ?? C.headerBackground), document.documentElement.style.setProperty("--router-tab-background", e.background ?? C.background), document.documentElement.style.setProperty("--router-tab-active-background", e.activeBackground ?? C.activeBackground), document.documentElement.style.setProperty("--router-tab-text", e.text ?? C.text), document.documentElement.style.setProperty("--router-tab-active-text", e.activeText ?? C.activeText), document.documentElement.style.setProperty("--router-tab-border", e.border ?? C.border), document.documentElement.style.setProperty("--router-tab-active-border", e.activeBorder ?? C.activeBorder), document.documentElement.style.setProperty("--router-tab-button-color", e.buttonColor ?? C.buttonColor), document.documentElement.style.setProperty("--router-tab-active-button-color", e.activeButtonColor ?? C.activeButtonColor), document.documentElement.style.setProperty("--router-tab-button-background", e.buttonBackground ?? C.buttonBackground), document.documentElement.style.setProperty("--router-tab-active-button-background", e.activeButtonBackground ?? C.activeButtonBackground), document.documentElement.style.setProperty("--router-tab-icon-color", e.iconColor ?? C.iconColor));
1007
+ function ye(e) {
1008
+ typeof document > "u" || (document.documentElement.style.setProperty("--router-tab-primary", e.primary ?? R.primary), document.documentElement.style.setProperty("--router-tab-header-bg", e.headerBackground ?? R.headerBackground), document.documentElement.style.setProperty("--router-tab-background", e.background ?? R.background), document.documentElement.style.setProperty("--router-tab-active-background", e.activeBackground ?? R.activeBackground), document.documentElement.style.setProperty("--router-tab-text", e.text ?? R.text), document.documentElement.style.setProperty("--router-tab-active-text", e.activeText ?? R.activeText), document.documentElement.style.setProperty("--router-tab-border", e.border ?? R.border), document.documentElement.style.setProperty("--router-tab-active-border", e.activeBorder ?? R.activeBorder), document.documentElement.style.setProperty("--router-tab-button-color", e.buttonColor ?? R.buttonColor), document.documentElement.style.setProperty("--router-tab-active-button-color", e.activeButtonColor ?? R.activeButtonColor), document.documentElement.style.setProperty("--router-tab-button-background", e.buttonBackground ?? R.buttonBackground), document.documentElement.style.setProperty("--router-tab-active-button-background", e.activeButtonBackground ?? R.activeButtonBackground), document.documentElement.style.setProperty("--router-tab-icon-color", e.iconColor ?? R.iconColor));
1013
1009
  }
1014
- function Fe(e) {
1010
+ function Ye(e) {
1015
1011
  if (typeof document > "u") return;
1016
- const n = document.documentElement, o = window.matchMedia(Ye), l = () => {
1012
+ const n = document.documentElement, o = window.matchMedia(_e), l = () => {
1017
1013
  n.dataset.theme = o.matches ? "dark" : "light";
1018
1014
  };
1019
1015
  W && (o.removeEventListener("change", W), W = null), e === "system" ? (l(), W = () => l(), o.addEventListener("change", W)) : n.dataset.theme = e;
@@ -1021,31 +1017,31 @@ function Fe(e) {
1021
1017
  function Wt(e = {}) {
1022
1018
  if (typeof window > "u") return;
1023
1019
  const {
1024
- styleKey: n = _e,
1020
+ styleKey: n = Ne,
1025
1021
  primaryKey: o = ze,
1026
1022
  defaultStyle: l = Ft,
1027
1023
  defaultPrimary: r
1028
1024
  } = e, p = window.localStorage.getItem(n) ?? l;
1029
- Fe(p);
1030
- const s = p === "dark" || p === "system" && window.matchMedia(Ye).matches ? { ...Ht } : { ...C };
1025
+ Ye(p);
1026
+ const s = p === "dark" || p === "system" && window.matchMedia(_e).matches ? { ...Ht } : { ...R };
1031
1027
  r && (s.primary = r);
1032
1028
  const c = Jt(o);
1033
- he(c ? {
1029
+ ye(c ? {
1034
1030
  ...s,
1035
1031
  ...c
1036
1032
  } : s);
1037
1033
  }
1038
1034
  function qt(e, n) {
1039
1035
  if (typeof window > "u") return;
1040
- const o = n?.styleKey ?? _e;
1041
- window.localStorage.setItem(o, e), Fe(e);
1036
+ const o = n?.styleKey ?? Ne;
1037
+ window.localStorage.setItem(o, e), Ye(e);
1042
1038
  }
1043
1039
  function Qt(e, n) {
1044
1040
  if (typeof window > "u") return;
1045
1041
  const o = n?.primaryKey ?? ze;
1046
- window.localStorage.setItem(o, JSON.stringify(e)), he(e);
1042
+ window.localStorage.setItem(o, JSON.stringify(e)), ye(e);
1047
1043
  }
1048
- function te(e, n) {
1044
+ function Q(e, n) {
1049
1045
  if (kt(e)) {
1050
1046
  const l = !wt(e);
1051
1047
  return {
@@ -1072,8 +1068,8 @@ function te(e, n) {
1072
1068
  }
1073
1069
  };
1074
1070
  }
1075
- function Te(e = {}) {
1076
- const n = te(e.title, "Untitled"), o = te(e.icon, ""), l = te(e.closable, !0), r = te(e.meta, {});
1071
+ function he(e = {}) {
1072
+ const n = Q(e.title, "Untitled"), o = Q(e.icon, ""), l = Q(e.closable, !0), r = Q(e.meta, {});
1077
1073
  return {
1078
1074
  routeTabTitle: n.value,
1079
1075
  routeTabIcon: o.value,
@@ -1086,14 +1082,14 @@ function Te(e = {}) {
1086
1082
  };
1087
1083
  }
1088
1084
  function Zt(e, n = "Page") {
1089
- return Te({
1085
+ return he({
1090
1086
  title: k(() => e.value ? "Loading..." : n),
1091
1087
  icon: k(() => e.value ? "mdi-loading mdi-spin" : "mdi-page"),
1092
1088
  closable: k(() => !e.value)
1093
1089
  });
1094
1090
  }
1095
1091
  function en(e, n = "Page", o = "mdi-page") {
1096
- return Te({
1092
+ return he({
1097
1093
  title: k(() => e.value > 0 ? `${n} (${e.value})` : n),
1098
1094
  icon: k(() => e.value > 0 ? "mdi-bell-badge" : o)
1099
1095
  });
@@ -1105,47 +1101,47 @@ function tn(e, n = "Page") {
1105
1101
  error: { suffix: " - Error", icon: "mdi-alert" },
1106
1102
  success: { suffix: " - Success", icon: "mdi-check-circle" }
1107
1103
  };
1108
- return Te({
1104
+ return he({
1109
1105
  title: k(() => n + o[e.value].suffix),
1110
1106
  icon: k(() => o[e.value].icon),
1111
1107
  closable: k(() => e.value !== "loading")
1112
1108
  });
1113
1109
  }
1114
- let je = !1;
1110
+ let Le = !1;
1115
1111
  const nn = {
1116
1112
  install(e, n) {
1117
- if (je) return;
1118
- je = !0;
1113
+ if (Le) return;
1114
+ Le = !0;
1119
1115
  const {
1120
1116
  initTheme: o = !0,
1121
1117
  themeOptions: l,
1122
- componentName: r = Le.name || "RouterTab",
1123
- tabsComponentName: p = pe.name || "RouterTabs"
1118
+ componentName: r = Me.name || "RouterTab",
1119
+ tabsComponentName: p = be.name || "RouterTabs"
1124
1120
  } = n ?? {};
1125
- o && Wt(l ?? {}), e.component(r, Le), e.component(p, pe), p.toLowerCase() !== "router-tabs" && e.component("router-tabs", pe), Object.defineProperty(e.config.globalProperties, "$tabs", {
1121
+ o && Wt(l ?? {}), e.component(r, Me), e.component(p, be), p.toLowerCase() !== "router-tabs" && e.component("router-tabs", be), Object.defineProperty(e.config.globalProperties, "$tabs", {
1126
1122
  configurable: !0,
1127
1123
  enumerable: !1,
1128
1124
  get() {
1129
- return e._context.provides[oe];
1125
+ return e._context.provides[ee];
1130
1126
  },
1131
1127
  set(T) {
1132
- T && e.provide(oe, T);
1128
+ T && e.provide(ee, T);
1133
1129
  }
1134
1130
  });
1135
1131
  }
1136
1132
  };
1137
1133
  export {
1138
- Le as RouterTab,
1139
- pe as RouterTabs,
1134
+ Me as RouterTab,
1135
+ be as RouterTabs,
1140
1136
  nn as default,
1141
1137
  Wt as initRouterTabsTheme,
1142
- oe as routerTabsKey,
1138
+ ee as routerTabsKey,
1143
1139
  Qt as setRouterTabsPrimary,
1144
1140
  qt as setRouterTabsTheme,
1145
1141
  Zt as useLoadingTab,
1146
1142
  en as useNotificationTab,
1147
- Te as useReactiveTab,
1148
- $e as useRouterTabs,
1149
- Ne as useRouterTabsPersistence,
1143
+ he as useReactiveTab,
1144
+ Se as useRouterTabs,
1145
+ Ve as useRouterTabsPersistence,
1150
1146
  tn as useStatusTab
1151
1147
  };