vue3-router-tab 1.3.8 → 1.4.0

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,6 +1,6 @@
1
1
  import './vue3-router-tab.css';
2
- import { reactive as ae, ref as S, shallowRef as Ct, computed as C, watch as A, nextTick as B, inject as Me, getCurrentInstance as We, onMounted as ke, defineComponent as Ce, provide as Kt, onErrorCaptured as Et, onBeforeUnmount as $t, h as At, resolveComponent as Pt, createElementBlock as x, openBlock as $, createElementVNode as j, withDirectives as St, normalizeClass as J, renderSlot as pe, createVNode as Le, TransitionGroup as It, mergeProps as ve, withCtx as he, Fragment as me, renderList as Oe, withModifiers as ye, createCommentVNode as ee, toDisplayString as je, normalizeProps as xt, createBlock as te, KeepAlive as Dt, resolveDynamicComponent as ze, Transition as Bt, normalizeStyle as Mt, vShow as Lt, isRef as Ot, isReadonly as jt } from "vue";
3
- import { RouterView as zt } from "vue-router";
2
+ import { reactive as ie, ref as S, shallowRef as Kt, computed as k, watch as A, nextTick as B, inject as Le, getCurrentInstance as We, onMounted as ke, defineComponent as Ke, provide as Et, onErrorCaptured as $t, onBeforeUnmount as At, h as Pt, resolveComponent as St, createElementBlock as x, openBlock as $, createElementVNode as j, withDirectives as It, normalizeClass as q, renderSlot as ve, createVNode as Oe, TransitionGroup as xt, mergeProps as he, withCtx as me, Fragment as ye, renderList as je, withModifiers as Te, createCommentVNode as te, toDisplayString as Ue, normalizeProps as Dt, createBlock as ne, KeepAlive as Bt, resolveDynamicComponent as Ve, Transition as Mt, normalizeStyle as Lt, vShow as Ot, isRef as jt, isReadonly as Ut } from "vue";
3
+ import { RouterView as Vt } from "vue-router";
4
4
  function Nt(e = {}) {
5
5
  return {
6
6
  initialTabs: e.initialTabs ?? [],
@@ -11,83 +11,83 @@ function Nt(e = {}) {
11
11
  defaultRoute: e.defaultRoute ?? "/"
12
12
  };
13
13
  }
14
- function V(e, r) {
14
+ function _(e, r) {
15
15
  const o = e.resolve(r);
16
16
  if (!o || !o.matched.length)
17
17
  throw new Error(`[RouterTabs] Unable to resolve route: ${String(r)}`);
18
18
  return o;
19
19
  }
20
- const Ut = {
20
+ const _t = {
21
21
  path: (e) => e.path,
22
22
  fullpath: (e) => e.fullPath,
23
23
  fullname: (e) => e.fullPath,
24
24
  full: (e) => e.fullPath,
25
25
  name: (e) => e.name ? String(e.name) : e.fullPath
26
26
  };
27
- function _(e) {
27
+ function z(e) {
28
28
  const r = e.meta?.key;
29
29
  if (typeof r == "function") {
30
30
  const o = r(e);
31
31
  if (typeof o == "string" && o.length) return o;
32
32
  } else if (typeof r == "string" && r.length) {
33
- const o = Ut[r.toLowerCase()];
33
+ const o = _t[r.toLowerCase()];
34
34
  return o ? o(e) : r;
35
35
  }
36
36
  return e.fullPath;
37
37
  }
38
- function Ke(e, r) {
38
+ function Ee(e, r) {
39
39
  const o = e.meta?.keepAlive;
40
40
  return typeof o == "boolean" ? o : r;
41
41
  }
42
- function Ee(e, r) {
42
+ function $e(e, r) {
43
43
  const o = e.meta?.reuse;
44
44
  return typeof o == "boolean" ? o : r;
45
45
  }
46
- function qe(e) {
46
+ function Je(e) {
47
47
  const r = e.meta ?? {}, o = {};
48
48
  return "title" in r && (o.title = r.title), "tips" in r && (o.tips = r.tips), "icon" in r && (o.icon = r.icon), "closable" in r && (o.closable = r.closable), "tabClass" in r && (o.tabClass = r.tabClass), "target" in r && (o.target = r.target), "href" in r && (o.href = r.href), o;
49
49
  }
50
- function ne(e, r, o) {
51
- const s = qe(e);
50
+ function oe(e, r, o) {
51
+ const s = Je(e);
52
52
  return {
53
- id: _(e),
53
+ id: z(e),
54
54
  to: e.fullPath,
55
55
  fullPath: e.fullPath,
56
56
  matched: e,
57
- alive: Ke(e, o),
58
- reusable: Ee(e, !1),
57
+ alive: Ee(e, o),
58
+ reusable: $e(e, !1),
59
59
  closable: s.closable ?? !0,
60
60
  renderKey: typeof r.renderKey == "number" ? r.renderKey : 0,
61
61
  ...s,
62
62
  ...r
63
63
  };
64
64
  }
65
- function Te(e, r, o, s) {
66
- if (!e.find((p) => p.id === r.id)) {
65
+ function Re(e, r, o, s) {
66
+ if (!e.find((v) => v.id === r.id)) {
67
67
  if (o === "next" && s) {
68
- const p = e.findIndex((T) => T.id === s);
69
- if (p !== -1) {
70
- e.splice(p + 1, 0, r);
68
+ const v = e.findIndex((T) => T.id === s);
69
+ if (v !== -1) {
70
+ e.splice(v + 1, 0, r);
71
71
  return;
72
72
  }
73
73
  }
74
74
  e.push(r);
75
75
  }
76
76
  }
77
- function Re(e, r, o, s) {
77
+ function we(e, r, o, s) {
78
78
  if (!r || r <= 0) return;
79
- const a = e.filter((p) => p.alive);
79
+ const a = e.filter((v) => v.alive);
80
80
  for (; a.length > r; ) {
81
- const p = a.shift();
82
- if (!p || p.id === o) continue;
83
- const T = e.findIndex((i) => i.id === p.id);
81
+ const v = a.shift();
82
+ if (!v || v.id === o) continue;
83
+ const T = e.findIndex((l) => l.id === v.id);
84
84
  if (T > -1) {
85
- const i = e[T], b = `${i.id}::${i.renderKey ?? 0}`;
86
- s.delete(b), i.alive = !1;
85
+ const l = e[T], d = `${l.id}::${l.renderKey ?? 0}`;
86
+ s.delete(d), l.alive = !1;
87
87
  }
88
88
  }
89
89
  }
90
- function Vt(e) {
90
+ function zt(e) {
91
91
  return {
92
92
  to: e.to,
93
93
  title: e.title,
@@ -98,193 +98,187 @@ function Vt(e) {
98
98
  renderKey: e.renderKey
99
99
  };
100
100
  }
101
- function _t(e) {
101
+ function Yt(e) {
102
102
  const r = {};
103
103
  return "title" in e && (r.title = e.title), "tips" in e && (r.tips = e.tips), "icon" in e && (r.icon = e.icon), "tabClass" in e && (r.tabClass = e.tabClass), "closable" in e && (r.closable = e.closable), "renderKey" in e && typeof e.renderKey == "number" && (r.renderKey = e.renderKey), r;
104
104
  }
105
- function Yt(e, r = {}) {
106
- const o = Nt(r), s = ae([]), a = S(null), p = Ct(), T = S(null), i = ae(/* @__PURE__ */ new Set()), b = C(() => Array.from(i));
105
+ function Ft(e, r = {}) {
106
+ const o = Nt(r), s = ie([]), a = S(null), v = Kt(), T = S(null), l = ie(/* @__PURE__ */ new Set()), d = k(() => Array.from(l));
107
107
  let h = !1;
108
108
  function E(u) {
109
- const c = typeof u.matched == "object" ? u : V(e, u);
109
+ const b = typeof u.matched == "object" ? u : _(e, u);
110
110
  return {
111
- key: _(c),
112
- fullPath: c.fullPath,
113
- alive: Ke(c, o.keepAlive),
114
- reusable: Ee(c, !1),
115
- matched: c
111
+ key: z(b),
112
+ fullPath: b.fullPath,
113
+ alive: Ee(b, o.keepAlive),
114
+ reusable: $e(b, !1),
115
+ matched: b
116
116
  };
117
117
  }
118
118
  function P(u) {
119
- const c = _(u);
120
- let f = s.find((y) => y.id === c);
121
- const m = Ke(u, o.keepAlive);
122
- if (f) {
123
- f.fullPath = u.fullPath, f.to = u.fullPath, f.matched = u, f.reusable = Ee(u, f.reusable), typeof f.renderKey != "number" && (f.renderKey = 0);
124
- const y = `${c}::${f.renderKey}`;
125
- return (c.includes("students") || c.includes("classroom") || c.includes("quiz")) && console.log(`[ensureTab] EXISTING tab: ${u.fullPath}`, {
126
- key: c,
127
- shouldBeAlive: m,
128
- currentRenderKey: f.renderKey,
129
- currentCacheKey: y,
130
- isInCache: i.has(y),
131
- aliveCacheSize: i.size,
132
- cacheContents: Array.from(i)
133
- }), m && (i.has(y) ? f.alive || (f.alive = !0, (c.includes("students") || c.includes("classroom") || c.includes("quiz")) && console.log(`[ensureTab] ✅ Reactivated: ${y}`)) : (i.add(y), f.alive = !0, (c.includes("students") || c.includes("classroom") || c.includes("quiz")) && console.log(`[ensureTab] ✅ Added to cache: ${y}`))), Object.assign(f, qe(u)), f;
119
+ const b = z(u);
120
+ let c = s.find((y) => y.id === b);
121
+ const m = Ee(u, o.keepAlive);
122
+ if (c) {
123
+ c.fullPath = u.fullPath, c.to = u.fullPath, c.matched = u, c.reusable = $e(u, c.reusable), typeof c.renderKey != "number" && (c.renderKey = 0);
124
+ const y = `${b}::${c.renderKey}`;
125
+ return m ? l.has(y) ? c.alive || (c.alive = !0) : (l.add(y), c.alive = !0) : c.alive && (l.delete(y), c.alive = !1), Object.assign(c, Je(u)), c;
134
126
  }
135
- if (f = ne(u, {}, o.keepAlive), f.alive) {
136
- const y = `${c}::${f.renderKey ?? 0}`;
137
- i.add(y), (c.includes("students") || c.includes("classroom") || c.includes("quiz")) && console.log(`[ensureTab] NEW tab created and cached: ${y}`);
127
+ if (c = oe(u, {}, o.keepAlive), c.alive) {
128
+ const y = `${b}::${c.renderKey ?? 0}`;
129
+ l.add(y);
138
130
  }
139
- return Te(s, f, o.appendPosition, a.value), Re(s, o.maxAlive, a.value, i), f;
131
+ return Re(s, c, o.appendPosition, a.value), we(s, o.maxAlive, a.value, l), c;
140
132
  }
141
- async function M(u, c = !1, f = "sameTab") {
142
- const m = V(e, u), y = _(m), k = a.value === y;
143
- f === "sameTab" && (f = k), f && await z(y, !0), await e[c ? "replace" : "push"](m), k && await N();
133
+ async function M(u, b = !1, c = "sameTab") {
134
+ const m = _(e, u), y = z(m), w = a.value === y;
135
+ c === "sameTab" && (c = w), c && await U(y, !0), await e[b ? "replace" : "push"](m), w && await V();
144
136
  }
145
137
  function Y(u) {
146
- const c = s.findIndex((I) => I.id === u);
147
- if (c === -1) return o.defaultRoute;
148
- const f = s[c + 1], m = s[c - 1], y = s.find((I) => I.id !== u), k = f || m || y;
149
- return k ? k.to : o.defaultRoute;
138
+ const b = s.findIndex((I) => I.id === u);
139
+ if (b === -1) return o.defaultRoute;
140
+ const c = s[b + 1], m = s[b - 1], y = s.find((I) => I.id !== u), w = c || m || y;
141
+ return w ? w.to : o.defaultRoute;
150
142
  }
151
- async function L(u = a.value, c = {}) {
143
+ async function L(u = a.value, b = {}) {
152
144
  if (!u) return;
153
- if (!c.force && o.keepLastTab && s.length === 1)
145
+ if (!b.force && o.keepLastTab && s.length === 1)
154
146
  throw new Error("[RouterTabs] Unable to close the final tab when keepLastTab is true.");
155
- const m = a.value === u && c.redirect !== null, y = m ? c.redirect ?? Y(u) : null;
156
- await F(u, { force: c.force }), c.redirect !== null && m && y && await e.replace(y);
147
+ const m = a.value === u && b.redirect !== null, y = m ? b.redirect ?? Y(u) : null;
148
+ await F(u, { force: b.force }), b.redirect !== null && m && y && await e.replace(y);
157
149
  }
158
- async function F(u, c = {}) {
159
- const f = s.findIndex((m) => m.id === u);
160
- f !== -1 && (s.splice(f, 1), T.value === u && (T.value = null), a.value === u && (a.value = null, p.value = void 0));
150
+ async function F(u, b = {}) {
151
+ const c = s.findIndex((w) => w.id === u);
152
+ if (c === -1) return;
153
+ const m = s[c], y = `${u}::${m.renderKey ?? 0}`;
154
+ l.delete(y), m.alive = !1, s.splice(c, 1), T.value === u && (T.value = null), a.value === u && (a.value = null, v.value = void 0);
161
155
  }
162
- async function z(u = a.value ?? void 0, c = !1) {
156
+ async function U(u = a.value ?? void 0, b = !1) {
163
157
  if (!u) return;
164
- const f = s.find((I) => I.id === u);
165
- if (!f) return;
166
- const m = o.keepAlive && f.alive, y = `${u}::${f.renderKey ?? 0}`;
167
- m && (i.delete(y), f.alive = !1, await B()), f.renderKey = (f.renderKey ?? 0) + 1;
168
- const k = `${u}::${f.renderKey}`;
169
- m && (i.add(k), f.alive = !0), T.value = u, await B(), c || await B(), T.value = null;
170
- }
171
- async function le(u = !1) {
172
- for (const c of s)
173
- await z(c.id, u);
158
+ const c = s.find((I) => I.id === u);
159
+ if (!c) return;
160
+ const m = o.keepAlive && c.alive, y = `${u}::${c.renderKey ?? 0}`;
161
+ m && (l.delete(y), c.alive = !1, await B()), c.renderKey = (c.renderKey ?? 0) + 1;
162
+ const w = `${u}::${c.renderKey}`;
163
+ m && (l.add(w), c.alive = !0), T.value = u, await B(), b || await B(), T.value = null;
174
164
  }
175
- function R(u, c) {
176
- const f = s.find((y) => y.id === u);
177
- if (!f) return;
178
- const m = `${u}::${f.renderKey ?? 0}`;
179
- c ? (i.add(m), f.alive = !0, Re(s, o.maxAlive, a.value, i)) : (i.delete(m), f.alive = !1);
165
+ async function se(u = !1) {
166
+ for (const b of s)
167
+ await U(b.id, u);
180
168
  }
181
- function X(u) {
182
- const c = s.find((m) => m.id === u);
169
+ function R(u, b) {
170
+ const c = s.find((y) => y.id === u);
183
171
  if (!c) return;
184
- const f = `${u}::${c.renderKey ?? 0}`;
185
- i.delete(f), c.alive = !1, c.renderKey = (c.renderKey ?? 0) + 1;
172
+ const m = `${u}::${c.renderKey ?? 0}`;
173
+ b ? (l.add(m), c.alive = !0, we(s, o.maxAlive, a.value, l)) : (l.delete(m), c.alive = !1);
174
+ }
175
+ function Q(u) {
176
+ const b = s.find((m) => m.id === u);
177
+ if (!b) return;
178
+ const c = `${u}::${b.renderKey ?? 0}`;
179
+ l.delete(c), b.alive = !1, b.renderKey = (b.renderKey ?? 0) + 1;
186
180
  }
187
181
  function O() {
188
- i.clear(), s.forEach((u) => {
182
+ l.clear(), s.forEach((u) => {
189
183
  u.alive = !1;
190
184
  });
191
185
  }
192
186
  function D() {
193
- return b.value.slice();
187
+ return d.value.slice();
194
188
  }
195
- async function Q(u = o.defaultRoute) {
196
- s.splice(0, s.length), a.value = null, p.value = void 0;
197
- for (const c of o.initialTabs) {
198
- const f = V(e, c.to), m = ne(f, c, o.keepAlive);
189
+ async function Z(u = o.defaultRoute) {
190
+ s.splice(0, s.length), a.value = null, v.value = void 0;
191
+ for (const b of o.initialTabs) {
192
+ const c = _(e, b.to), m = oe(c, b, o.keepAlive);
199
193
  s.push(m);
200
194
  }
201
195
  await e.replace(u);
202
196
  }
203
- async function N() {
197
+ async function V() {
204
198
  const u = a.value;
205
- u && await z(u, !0);
199
+ u && await U(u, !0);
206
200
  }
207
- function w(u) {
208
- return typeof u.matched == "object" ? _(u) : _(V(e, u));
201
+ function C(u) {
202
+ return typeof u.matched == "object" ? z(u) : z(_(e, u));
209
203
  }
210
- function se() {
211
- const u = s.find((c) => c.id === a.value);
204
+ function ue() {
205
+ const u = s.find((b) => b.id === a.value);
212
206
  return {
213
- tabs: s.map(Vt),
207
+ tabs: s.map(zt),
214
208
  active: u ? u.to : null
215
209
  };
216
210
  }
217
- async function W(u) {
218
- h = !0, s.splice(0, s.length), a.value = null, p.value = void 0;
219
- const c = u?.tabs ?? [];
220
- for (const m of c)
211
+ async function H(u) {
212
+ h = !0, s.splice(0, s.length), a.value = null, v.value = void 0;
213
+ const b = u?.tabs ?? [];
214
+ for (const m of b)
221
215
  try {
222
- const y = V(e, m.to), k = _t(m), I = ne(y, k, o.keepAlive);
223
- Te(s, I, "last", null);
216
+ const y = _(e, m.to), w = Yt(m), I = oe(y, w, o.keepAlive);
217
+ Re(s, I, "last", null);
224
218
  } catch (y) {
225
219
  console.warn("[RouterTabs] Failed to restore tab", m, y);
226
220
  }
227
221
  h = !1;
228
- const f = u?.active ?? c[c.length - 1]?.to ?? o.defaultRoute;
229
- if (f)
222
+ const c = u?.active ?? b[b.length - 1]?.to ?? o.defaultRoute;
223
+ if (c)
230
224
  try {
231
- await e.replace(f);
225
+ await e.replace(c);
232
226
  } catch (m) {
233
- console.warn("[RouterTabs] Failed to navigate to restored route", f, m);
227
+ console.warn("[RouterTabs] Failed to navigate to restored route", c, m);
234
228
  }
235
229
  }
236
230
  return A(
237
231
  () => e.currentRoute.value,
238
232
  (u) => {
239
233
  if (h) return;
240
- const c = P(u);
241
- a.value = c.id, p.value = c, Re(s, o.maxAlive, a.value, i);
234
+ const b = P(u);
235
+ a.value = b.id, v.value = b, we(s, o.maxAlive, a.value, l);
242
236
  },
243
237
  { immediate: !0 }
244
238
  ), o.initialTabs.length && o.initialTabs.forEach((u) => {
245
- const c = V(e, u.to), f = ne(c, u, o.keepAlive);
246
- Te(s, f, "last", null);
239
+ const b = _(e, u.to), c = oe(b, u, o.keepAlive);
240
+ Re(s, c, "last", null);
247
241
  }), {
248
242
  options: o,
249
243
  tabs: s,
250
244
  activeId: a,
251
- current: p,
252
- includeKeys: b,
245
+ current: v,
246
+ includeKeys: d,
253
247
  refreshingKey: T,
254
248
  openTab: M,
255
249
  closeTab: L,
256
250
  removeTab: F,
257
- refreshTab: z,
258
- refreshAll: le,
251
+ refreshTab: U,
252
+ refreshAll: se,
259
253
  setTabAlive: R,
260
- evictCache: X,
254
+ evictCache: Q,
261
255
  clearCache: O,
262
256
  getCacheKeys: D,
263
- reset: Q,
264
- reload: N,
265
- getRouteKey: w,
257
+ reset: Z,
258
+ reload: V,
259
+ getRouteKey: C,
266
260
  matchRoute: E,
267
- snapshot: se,
268
- hydrate: W,
261
+ snapshot: ue,
262
+ hydrate: H,
269
263
  ensureTab: P
270
264
  };
271
265
  }
272
266
  function Ne(e) {
273
267
  return e ? typeof e == "string" ? { name: e } : e : {};
274
268
  }
275
- const ie = Symbol("RouterTabsContext"), re = "router-tabs:snapshot";
276
- function Ue(e = {}) {
277
- const { optional: r = !1 } = e, o = Me(ie, null);
269
+ const le = Symbol("RouterTabsContext"), ae = "router-tabs:snapshot";
270
+ function _e(e = {}) {
271
+ const { optional: r = !1 } = e, o = Le(le, null);
278
272
  if (o) return o;
279
- const s = Me("$tabs", null);
273
+ const s = Le("$tabs", null);
280
274
  if (s) return s;
281
- const p = We()?.appContext.config.globalProperties.$tabs;
282
- if (p) return p;
275
+ const v = We()?.appContext.config.globalProperties.$tabs;
276
+ if (v) return v;
283
277
  if (!r)
284
278
  throw new Error("[RouterTabs] useRouterTabs must be used within <router-tab>.");
285
279
  return null;
286
280
  }
287
- const Ft = 864e5;
281
+ const Ht = 864e5;
288
282
  function Wt(e) {
289
283
  if (typeof document > "u") return null;
290
284
  const r = `${encodeURIComponent(e)}=`, o = document.cookie ? document.cookie.split("; ") : [];
@@ -293,27 +287,27 @@ function Wt(e) {
293
287
  return decodeURIComponent(s.slice(r.length));
294
288
  return null;
295
289
  }
296
- function Ve(e, r, o) {
290
+ function ze(e, r, o) {
297
291
  if (typeof document > "u") return;
298
292
  const {
299
293
  expiresInDays: s = 7,
300
294
  path: a = "/",
301
- domain: p,
295
+ domain: v,
302
296
  secure: T,
303
- sameSite: i = "lax"
304
- } = o, b = [`${encodeURIComponent(e)}=${encodeURIComponent(r)}`];
297
+ sameSite: l = "lax"
298
+ } = o, d = [`${encodeURIComponent(e)}=${encodeURIComponent(r)}`];
305
299
  if (s !== 1 / 0) {
306
- const h = new Date(Date.now() + s * Ft).toUTCString();
307
- b.push(`Expires=${h}`);
300
+ const h = new Date(Date.now() + s * Ht).toUTCString();
301
+ d.push(`Expires=${h}`);
308
302
  }
309
- a && b.push(`Path=${a}`), p && b.push(`Domain=${p}`), T && b.push("Secure"), i && b.push(`SameSite=${i.charAt(0).toUpperCase()}${i.slice(1)}`), document.cookie = b.join("; ");
303
+ a && d.push(`Path=${a}`), v && d.push(`Domain=${v}`), T && d.push("Secure"), l && d.push(`SameSite=${l.charAt(0).toUpperCase()}${l.slice(1)}`), document.cookie = d.join("; ");
310
304
  }
311
- function _e(e, r) {
305
+ function Ye(e, r) {
312
306
  if (typeof document > "u") return;
313
307
  const { path: o = "/", domain: s } = r, a = [`${encodeURIComponent(e)}=`];
314
308
  a.push("Expires=Thu, 01 Jan 1970 00:00:01 GMT"), o && a.push(`Path=${o}`), s && a.push(`Domain=${s}`), document.cookie = a.join("; ");
315
309
  }
316
- const qt = (e) => JSON.stringify(e ?? null), Ht = (e) => {
310
+ const Jt = (e) => JSON.stringify(e ?? null), Gt = (e) => {
317
311
  if (!e) return null;
318
312
  try {
319
313
  return JSON.parse(e);
@@ -321,65 +315,65 @@ const qt = (e) => JSON.stringify(e ?? null), Ht = (e) => {
321
315
  return null;
322
316
  }
323
317
  };
324
- function He(e = {}) {
318
+ function Ge(e = {}) {
325
319
  const {
326
- cookieKey: r = re,
327
- serialize: o = qt,
328
- deserialize: s = Ht
329
- } = e, a = Ue({ optional: !0 }), p = S(!0), T = (i) => {
320
+ cookieKey: r = ae,
321
+ serialize: o = Jt,
322
+ deserialize: s = Gt
323
+ } = e, a = _e({ optional: !0 }), v = S(!0), T = (l) => {
330
324
  ke(async () => {
331
- const b = s(Wt(r));
332
- if (b && b.tabs?.length)
325
+ const d = s(Wt(r));
326
+ if (d && d.tabs?.length)
333
327
  try {
334
- if (p.value = !0, await i.hydrate(b), b.active) {
328
+ if (v.value = !0, await l.hydrate(d), d.active) {
335
329
  await B();
336
- const E = i.tabs.find((P) => P.to === b.active);
337
- E && (i.activeId.value = E.id, i.current.value = E);
330
+ const E = l.tabs.find((P) => P.to === d.active);
331
+ E && (l.activeId.value = E.id, l.current.value = E);
338
332
  }
339
333
  } finally {
340
- p.value = !1;
334
+ v.value = !1;
341
335
  }
342
336
  else if (Object.prototype.hasOwnProperty.call(e, "fallbackRoute"))
343
337
  try {
344
- p.value = !0;
345
- const E = e.fallbackRoute ?? i.options.defaultRoute;
346
- await i.reset(E);
338
+ v.value = !0;
339
+ const E = e.fallbackRoute ?? l.options.defaultRoute;
340
+ await l.reset(E);
347
341
  } finally {
348
- p.value = !1;
342
+ v.value = !1;
349
343
  }
350
344
  else
351
- p.value = !1;
352
- const h = i.snapshot();
353
- h.tabs.length ? Ve(r, o(h), e) : _e(r, e), p.value = !1;
345
+ v.value = !1;
346
+ const h = l.snapshot();
347
+ h.tabs.length ? ze(r, o(h), e) : Ye(r, e), v.value = !1;
354
348
  }), A(
355
349
  () => ({
356
- tabs: i.tabs.map((b) => ({
357
- to: b.to,
358
- title: b.title,
359
- tips: b.tips,
360
- icon: b.icon,
361
- tabClass: b.tabClass,
362
- closable: b.closable,
363
- renderKey: b.renderKey
350
+ tabs: l.tabs.map((d) => ({
351
+ to: d.to,
352
+ title: d.title,
353
+ tips: d.tips,
354
+ icon: d.icon,
355
+ tabClass: d.tabClass,
356
+ closable: d.closable,
357
+ renderKey: d.renderKey
364
358
  })),
365
- active: i.activeId.value
359
+ active: l.activeId.value
366
360
  }),
367
361
  () => {
368
- if (p.value) return;
369
- const b = i.snapshot();
370
- b.tabs.length ? Ve(r, o(b), e) : _e(r, e);
362
+ if (v.value) return;
363
+ const d = l.snapshot();
364
+ d.tabs.length ? ze(r, o(d), e) : Ye(r, e);
371
365
  },
372
366
  { deep: !0 }
373
367
  );
374
368
  };
375
369
  a ? T(a) : ke(() => {
376
- const i = Ue({ optional: !0 });
377
- i && T(i);
370
+ const l = _e({ optional: !0 });
371
+ l && T(l);
378
372
  });
379
373
  }
380
- const Jt = Ce({
374
+ const qt = Ke({
381
375
  name: "RouterTab",
382
- components: { RouterView: zt },
376
+ components: { RouterView: Vt },
383
377
  props: {
384
378
  tabs: {
385
379
  type: Array,
@@ -419,7 +413,7 @@ const Jt = Ce({
419
413
  },
420
414
  cookieKey: {
421
415
  type: String,
422
- default: re
416
+ default: ae
423
417
  },
424
418
  persistence: {
425
419
  type: Object,
@@ -438,7 +432,7 @@ const Jt = Ce({
438
432
  const s = o.appContext.app.config.globalProperties.$router;
439
433
  if (!s)
440
434
  throw new Error("[RouterTab] Vue Router is required. Make sure to call app.use(router) before RouterTab.");
441
- const a = Yt(s, {
435
+ const a = Ft(s, {
442
436
  initialTabs: e.tabs,
443
437
  keepAlive: e.keepAlive,
444
438
  maxAlive: e.maxAlive,
@@ -446,109 +440,109 @@ const Jt = Ce({
446
440
  appendPosition: e.append,
447
441
  defaultRoute: e.defaultPage
448
442
  });
449
- Kt(ie, a), o.appContext.config.globalProperties.$tabs = a;
450
- const p = C(() => !!o?.slots?.default), T = C(() => !!o?.slots?.start), i = C(() => !!o?.slots?.end), b = S(0), h = C(() => {
451
- b.value;
443
+ Et(le, a), o.appContext.config.globalProperties.$tabs = a;
444
+ const v = k(() => !!o?.slots?.default), T = k(() => !!o?.slots?.start), l = k(() => !!o?.slots?.end), d = S(0), h = k(() => {
445
+ d.value;
452
446
  const t = {};
453
447
  return a.tabs.forEach((n) => {
454
- const l = typeof n.title == "string" ? n.title : String(n.title || ue(n));
455
- t[n.id] = l;
448
+ const i = typeof n.title == "string" ? n.title : String(n.title || ce(n));
449
+ t[n.id] = i;
456
450
  }), t;
457
451
  });
458
452
  function E() {
459
- b.value++;
453
+ d.value++;
460
454
  }
461
455
  const P = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map();
462
456
  function Y(t, n) {
463
457
  if (!(!n || P.has(t)))
464
458
  try {
465
459
  P.set(t, n);
466
- const l = a.tabs.find((g) => a.getRouteKey(g.to) === t);
467
- if (!l) {
460
+ const i = a.tabs.find((p) => a.getRouteKey(p.to) === t);
461
+ if (!i) {
468
462
  console.warn(`[RouterTab] Cannot setup watching: tab not found for ${t}`);
469
463
  return;
470
464
  }
471
- const v = [];
465
+ const g = [];
472
466
  if (n.routeTabTitle !== void 0)
473
467
  try {
474
- const g = A(
468
+ const p = A(
475
469
  () => {
476
- const d = n.routeTabTitle;
477
- return d && typeof d == "object" && "value" in d ? d.value : d;
470
+ const f = n.routeTabTitle;
471
+ return f && typeof f == "object" && "value" in f ? f.value : f;
478
472
  },
479
- (d) => {
480
- if (d != null) {
481
- const U = String(d);
482
- l.title = U, E();
473
+ (f) => {
474
+ if (f != null) {
475
+ const N = String(f);
476
+ i.title = N, E();
483
477
  }
484
478
  },
485
479
  { immediate: !0 }
486
480
  );
487
- v.push(g);
488
- } catch (g) {
489
- console.error(`[RouterTab] Error watching routeTabTitle for ${t}:`, g);
481
+ g.push(p);
482
+ } catch (p) {
483
+ console.error(`[RouterTab] Error watching routeTabTitle for ${t}:`, p);
490
484
  }
491
485
  if (n.routeTabIcon !== void 0)
492
486
  try {
493
- const g = A(
487
+ const p = A(
494
488
  () => {
495
- const d = n.routeTabIcon;
496
- return d && typeof d == "object" && "value" in d ? d.value : d;
489
+ const f = n.routeTabIcon;
490
+ return f && typeof f == "object" && "value" in f ? f.value : f;
497
491
  },
498
- (d) => {
499
- d != null && (l.icon = String(d), E());
492
+ (f) => {
493
+ f != null && (i.icon = String(f), E());
500
494
  },
501
495
  { immediate: !0 }
502
496
  );
503
- v.push(g);
504
- } catch (g) {
505
- console.error(`[RouterTab] Error watching routeTabIcon for ${t}:`, g);
497
+ g.push(p);
498
+ } catch (p) {
499
+ console.error(`[RouterTab] Error watching routeTabIcon for ${t}:`, p);
506
500
  }
507
501
  if (n.routeTabClosable !== void 0)
508
502
  try {
509
- const g = A(
503
+ const p = A(
510
504
  () => {
511
- const d = n.routeTabClosable;
512
- return d && typeof d == "object" && "value" in d ? d.value : d;
505
+ const f = n.routeTabClosable;
506
+ return f && typeof f == "object" && "value" in f ? f.value : f;
513
507
  },
514
- (d) => {
515
- d != null && (l.closable = !!d, E());
508
+ (f) => {
509
+ f != null && (i.closable = !!f, E());
516
510
  },
517
511
  { immediate: !0 }
518
512
  );
519
- v.push(g);
520
- } catch (g) {
521
- console.error(`[RouterTab] Error watching routeTabClosable for ${t}:`, g);
513
+ g.push(p);
514
+ } catch (p) {
515
+ console.error(`[RouterTab] Error watching routeTabClosable for ${t}:`, p);
522
516
  }
523
517
  if (n.routeTabMeta !== void 0)
524
518
  try {
525
- const g = A(
519
+ const p = A(
526
520
  () => {
527
- const d = n.routeTabMeta;
528
- return d && typeof d == "object" && "value" in d ? d.value : d;
521
+ const f = n.routeTabMeta;
522
+ return f && typeof f == "object" && "value" in f ? f.value : f;
529
523
  },
530
- (d) => {
531
- d && typeof d == "object" && (Object.assign(l, d), E());
524
+ (f) => {
525
+ f && typeof f == "object" && (Object.assign(i, f), E());
532
526
  },
533
527
  { immediate: !0, deep: !0 }
534
528
  );
535
- v.push(g);
536
- } catch (g) {
537
- console.error(`[RouterTab] Error watching routeTabMeta for ${t}:`, g);
529
+ g.push(p);
530
+ } catch (p) {
531
+ console.error(`[RouterTab] Error watching routeTabMeta for ${t}:`, p);
538
532
  }
539
- M.set(t, v);
540
- } catch (l) {
541
- console.error(`[RouterTab] Error in setupComponentWatching for ${t}:`, l), L(t);
533
+ M.set(t, g);
534
+ } catch (i) {
535
+ console.error(`[RouterTab] Error in setupComponentWatching for ${t}:`, i), L(t);
542
536
  }
543
537
  }
544
538
  function L(t) {
545
539
  try {
546
540
  const n = M.get(t);
547
- n && (n.forEach((l) => {
541
+ n && (n.forEach((i) => {
548
542
  try {
549
- l();
550
- } catch (v) {
551
- console.error(`[RouterTab] Error cleaning up watcher for ${t}:`, v);
543
+ i();
544
+ } catch (g) {
545
+ console.error(`[RouterTab] Error cleaning up watcher for ${t}:`, g);
552
546
  }
553
547
  }), M.delete(t)), P.delete(t);
554
548
  } catch (n) {
@@ -558,26 +552,26 @@ const Jt = Ce({
558
552
  function F(t, n) {
559
553
  try {
560
554
  t ? t.routeTabTitle !== void 0 || t.routeTabIcon !== void 0 || t.routeTabClosable !== void 0 ? Y(n, t) : t.$ && (t.$.routeTabTitle !== void 0 || t.$.routeTabIcon !== void 0 || t.$.routeTabClosable !== void 0) && Y(n, t.$) : t === null && L(n);
561
- } catch (l) {
562
- console.error(`[RouterTab] Error handling component ref for ${n}:`, l), L(n);
555
+ } catch (i) {
556
+ console.error(`[RouterTab] Error handling component ref for ${n}:`, i), L(n);
563
557
  }
564
558
  }
565
- if (Et((t, n, l) => (console.error("[RouterTab] Error captured from component:", t, l), !1)), e.cookieKey !== null || e.persistence) {
559
+ if ($t((t, n, i) => (console.error("[RouterTab] Error captured from component:", t, i), !1)), e.cookieKey !== null || e.persistence) {
566
560
  const t = {
567
561
  ...e.persistence ?? {}
568
562
  };
569
- e.cookieKey !== null ? t.cookieKey = e.cookieKey || re : t.cookieKey || (t.cookieKey = re), He(t);
563
+ e.cookieKey !== null ? t.cookieKey = e.cookieKey || ae : t.cookieKey || (t.cookieKey = ae), Ge(t);
570
564
  }
571
- const z = C(() => Ne(e.tabTransition)), le = C(() => Ne(e.pageTransition)), R = ae({
565
+ const U = k(() => Ne(e.tabTransition)), se = k(() => Ne(e.pageTransition)), R = ie({
572
566
  visible: !1,
573
567
  target: null,
574
568
  position: { x: 0, y: 0 }
575
- }), X = S(null), O = S([]), D = S(-1), Q = S(null), N = /* @__PURE__ */ new Map(), w = ae({
569
+ }), Q = S(null), O = S([]), D = S(-1), Z = S(null), V = /* @__PURE__ */ new Map(), C = ie({
576
570
  dragging: !1,
577
571
  dragIndex: -1,
578
572
  dropIndex: -1,
579
573
  dragTab: null
580
- }), se = [
574
+ }), ue = [
581
575
  "refresh",
582
576
  "refreshAll",
583
577
  "close",
@@ -585,25 +579,25 @@ const Jt = Ce({
585
579
  "closeRights",
586
580
  "closeOthers"
587
581
  ];
588
- function W(t) {
582
+ function H(t) {
589
583
  return a.tabs.findIndex((n) => n.id === t);
590
584
  }
591
585
  function u(t) {
592
- const n = W(t.id);
586
+ const n = H(t.id);
593
587
  return n > 0 ? a.tabs.slice(0, n) : [];
594
588
  }
595
- function c(t) {
596
- const n = W(t.id);
589
+ function b(t) {
590
+ const n = H(t.id);
597
591
  return n > -1 ? a.tabs.slice(n + 1) : [];
598
592
  }
599
- function f(t) {
593
+ function c(t) {
600
594
  return a.tabs.filter((n) => n.id !== t.id);
601
595
  }
602
596
  async function m(t, n) {
603
- const l = t.filter((v) => v.closable !== !1);
604
- if (l.length) {
605
- for (const v of l)
606
- a.activeId.value === v.id ? await a.closeTab(v.id, { redirect: n.to, force: !0 }) : await a.removeTab(v.id, { force: !0 });
597
+ const i = t.filter((g) => g.closable !== !1);
598
+ if (i.length) {
599
+ for (const g of i)
600
+ a.activeId.value === g.id ? await a.closeTab(g.id, { redirect: n.to, force: !0 }) : await a.removeTab(g.id, { force: !0 });
607
601
  a.activeId.value !== n.id && await a.openTab(n.to, !0, !1);
608
602
  }
609
603
  }
@@ -625,7 +619,7 @@ const Jt = Ce({
625
619
  handler: async ({ target: t }) => {
626
620
  await a.closeTab(t.id);
627
621
  },
628
- enable: ({ target: t }) => fe(t)
622
+ enable: ({ target: t }) => de(t)
629
623
  },
630
624
  closeLefts: {
631
625
  label: "Close to the Left",
@@ -637,83 +631,83 @@ const Jt = Ce({
637
631
  closeRights: {
638
632
  label: "Close to the Right",
639
633
  handler: async ({ target: t }) => {
640
- await m(c(t), t);
634
+ await m(b(t), t);
641
635
  },
642
- enable: ({ target: t }) => c(t).some((n) => n.closable !== !1)
636
+ enable: ({ target: t }) => b(t).some((n) => n.closable !== !1)
643
637
  },
644
638
  closeOthers: {
645
639
  label: "Close Others",
646
640
  handler: async ({ target: t }) => {
647
- await m(f(t), t);
641
+ await m(c(t), t);
648
642
  },
649
- enable: ({ target: t }) => f(t).some((n) => n.closable !== !1)
643
+ enable: ({ target: t }) => c(t).some((n) => n.closable !== !1)
650
644
  }
651
645
  };
652
- function k() {
646
+ function w() {
653
647
  R.visible = !1, R.target = null, D.value = -1, O.value = [];
654
648
  }
655
649
  function I(t, n) {
656
650
  e.contextmenu && (R.target = t, R.position.x = n.clientX, R.position.y = n.clientY, B(() => {
657
- R.visible = !0, document.addEventListener("click", k, { once: !0 }), B(() => {
658
- et();
651
+ R.visible = !0, document.addEventListener("click", w, { once: !0 }), B(() => {
652
+ tt();
659
653
  });
660
654
  }));
661
655
  }
662
- function Ze(t, n) {
663
- const l = typeof t == "string" ? { id: t } : t, v = y[l.id], g = l.label ?? v?.label ?? String(l.id), d = l.visible ?? v?.visible ?? !0;
664
- if (!(typeof d == "function" ? d(n) : d !== !1)) return null;
665
- const ge = l.enable ?? v?.enable ?? !0, wt = typeof ge == "function" ? ge(n) : ge !== !1, Be = l.handler ?? v?.handler;
666
- if (!Be) return null;
656
+ function et(t, n) {
657
+ const i = typeof t == "string" ? { id: t } : t, g = y[i.id], p = i.label ?? g?.label ?? String(i.id), f = i.visible ?? g?.visible ?? !0;
658
+ if (!(typeof f == "function" ? f(n) : f !== !1)) return null;
659
+ const pe = i.enable ?? g?.enable ?? !0, Ct = typeof pe == "function" ? pe(n) : pe !== !1, Me = i.handler ?? g?.handler;
660
+ if (!Me) return null;
667
661
  const kt = async () => {
668
- await Promise.resolve(Be(n));
662
+ await Promise.resolve(Me(n));
669
663
  };
670
664
  return {
671
- id: String(l.id),
672
- label: g,
673
- disabled: !wt,
665
+ id: String(i.id),
666
+ label: p,
667
+ disabled: !Ct,
674
668
  action: kt
675
669
  };
676
670
  }
677
- const q = C(() => {
671
+ const W = k(() => {
678
672
  if (!R.visible || !R.target || e.contextmenu === !1) return [];
679
- const t = Array.isArray(e.contextmenu) ? e.contextmenu : se, n = { target: R.target, controller: a };
680
- return t.map((l) => Ze(l, n)).filter((l) => !!l);
673
+ const t = Array.isArray(e.contextmenu) ? e.contextmenu : ue, n = { target: R.target, controller: a };
674
+ return t.map((i) => et(i, n)).filter((i) => !!i);
681
675
  });
682
- function et() {
683
- const t = X.value;
676
+ function tt() {
677
+ const t = Q.value;
684
678
  if (!t) return;
685
- const n = 8, { innerWidth: l, innerHeight: v } = window, g = t.getBoundingClientRect();
686
- let d = R.position.x, U = R.position.y;
687
- g.right > l - n && (d = Math.max(n, l - g.width - n)), g.bottom > v - n && (U = Math.max(n, v - g.height - n)), (d !== R.position.x || U !== R.position.y) && (R.position.x = d, R.position.y = U);
679
+ const n = 8, { innerWidth: i, innerHeight: g } = window, p = t.getBoundingClientRect();
680
+ let f = R.position.x, N = R.position.y;
681
+ p.right > i - n && (f = Math.max(n, i - p.width - n)), p.bottom > g - n && (N = Math.max(n, g - p.height - n)), (f !== R.position.x || N !== R.position.y) && (R.position.x = f, R.position.y = N);
688
682
  }
689
- function tt(t, n) {
683
+ function nt(t, n) {
690
684
  O.value[n] = t ?? null;
691
685
  }
692
- function nt(t) {
686
+ function ot(t) {
693
687
  if (t < 0) return;
694
688
  O.value[t]?.focus({ preventScroll: !0 });
695
689
  }
696
- function Z(t, n, l = q.value) {
697
- if (!l.length) return -1;
698
- const v = l.length;
699
- let g = t;
700
- for (let d = 0; d < v; d++)
701
- if (g = (g + n + v) % v, !l[g].disabled) return g;
690
+ function ee(t, n, i = W.value) {
691
+ if (!i.length) return -1;
692
+ const g = i.length;
693
+ let p = t;
694
+ for (let f = 0; f < g; f++)
695
+ if (p = (p + n + g) % g, !i[p].disabled) return p;
702
696
  return -1;
703
697
  }
704
- function H(t) {
705
- D.value = t, !(t < 0) && B(() => nt(t));
698
+ function J(t) {
699
+ D.value = t, !(t < 0) && B(() => ot(t));
706
700
  }
707
- function Pe(t) {
708
- const n = Z(D.value, t);
709
- n !== -1 && H(n);
701
+ function Se(t) {
702
+ const n = ee(D.value, t);
703
+ n !== -1 && J(n);
710
704
  }
711
- function ot(t) {
705
+ function rt(t) {
712
706
  if (!R.visible) return;
713
- const n = t.key, l = q.value;
714
- if (!l.length) return;
707
+ const n = t.key, i = W.value;
708
+ if (!i.length) return;
715
709
  if (n === "Tab") {
716
- k();
710
+ w();
717
711
  return;
718
712
  }
719
713
  if ([
@@ -731,93 +725,100 @@ const Jt = Ce({
731
725
  switch (t.preventDefault(), n) {
732
726
  case "ArrowDown":
733
727
  case "ArrowRight":
734
- Pe(1);
728
+ Se(1);
735
729
  break;
736
730
  case "ArrowUp":
737
731
  case "ArrowLeft":
738
- Pe(-1);
732
+ Se(-1);
739
733
  break;
740
734
  case "Home":
741
- H(Z(-1, 1));
735
+ J(ee(-1, 1));
742
736
  break;
743
737
  case "End":
744
- H(Z(l.length, -1));
738
+ J(ee(i.length, -1));
745
739
  break;
746
740
  case "Enter":
747
741
  case " ":
748
742
  case "Spacebar": {
749
- const g = D.value;
750
- if (g > -1) {
751
- const d = l[g];
752
- d.disabled || Se(d);
743
+ const p = D.value;
744
+ if (p > -1) {
745
+ const f = i[p];
746
+ f.disabled || Ie(f);
753
747
  }
754
748
  break;
755
749
  }
756
750
  case "Escape":
757
- k();
751
+ w();
758
752
  break;
759
753
  }
760
754
  }
761
- async function Se(t) {
762
- t.disabled || (k(), await t.action());
755
+ async function Ie(t) {
756
+ t.disabled || (w(), await t.action());
763
757
  }
764
- function ue(t) {
758
+ function ce(t) {
765
759
  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";
766
760
  }
767
- function rt(t) {
768
- return h.value[t.id] || ue(t);
761
+ function at(t) {
762
+ return h.value[t.id] || ce(t);
769
763
  }
770
- function at(t, n) {
771
- return Ce({
764
+ function xe(t, n) {
765
+ return Ke({
772
766
  name: n,
773
- setup(l, { attrs: v, slots: g }) {
774
- return () => At(t, v, g);
767
+ setup(i, { attrs: g, slots: p }) {
768
+ return () => Pt(t, g, p);
775
769
  }
776
770
  });
777
771
  }
778
- const ce = /* @__PURE__ */ new Map(), Ie = S(0);
779
- function it(t, n, l) {
780
- ce.has(l) || (ce.set(l, n), Ie.value++), t && F(t, l);
772
+ const G = /* @__PURE__ */ new Map(), fe = S(0);
773
+ function it(t, n, i) {
774
+ G.has(i) || (G.set(i, n), fe.value++), t && F(t, i);
781
775
  }
782
776
  function lt(t, n) {
783
777
  return t && ((!t.name || t.name !== n) && (t.name = n), t);
784
778
  }
785
- function st(t) {
786
- const n = a.getRouteKey(t), l = s.currentRoute.value, v = a.getRouteKey(l);
787
- return n === v;
779
+ function st(t, n) {
780
+ if (!t) return t;
781
+ const i = G.get(n);
782
+ if (i) return i;
783
+ const g = xe(t, n);
784
+ return G.set(n, g), fe.value++, g;
788
785
  }
789
- function xe(t) {
790
- const n = a.getRouteKey(t), l = a.tabs.find((d) => d.id === n);
791
- if (!l)
786
+ function ut(t) {
787
+ const n = a.getRouteKey(t), i = s.currentRoute.value, g = a.getRouteKey(i);
788
+ return n === g;
789
+ }
790
+ function De(t) {
791
+ const n = a.getRouteKey(t), i = a.tabs.find((f) => f.id === n);
792
+ if (!i)
792
793
  return console.warn("[RouterTab] Tab not found for route:", n), `${n}::0`;
793
- const v = l.renderKey ?? 0, g = `${n}::${v}`;
794
+ const g = i.renderKey ?? 0, p = `${n}::${g}`;
794
795
  return (n.includes("students") || n.includes("classroom") || n.includes("quiz")) && console.log(`[getComponentCacheKey] Route: ${t.fullPath}`, {
795
796
  routeKey: n,
796
- renderKey: v,
797
- cacheKey: g,
798
- tabAlive: l.alive,
799
- includeKeys: be.value,
800
- isIncluded: be.value.includes(g)
801
- }), g;
797
+ renderKey: g,
798
+ cacheKey: p,
799
+ tabAlive: i.alive,
800
+ includeKeys: ge.value,
801
+ isIncluded: ge.value.includes(p)
802
+ }), p;
802
803
  }
803
- function ut(t) {
804
- return `${xe(t)}::refresh`;
804
+ function ct(t) {
805
+ return `${De(t)}::refresh`;
805
806
  }
806
- function fe(t) {
807
+ function de(t) {
807
808
  return !(t.closable === !1 || a.options.keepLastTab && a.tabs.length <= 1);
808
809
  }
809
- async function ct(t) {
810
+ async function ft(t) {
810
811
  await a.closeTab(t.id);
811
812
  }
812
- function ft(t, n) {
813
- n ? N.set(t, n) : N.delete(t);
813
+ function dt(t, n) {
814
+ n ? V.set(t, n) : V.delete(t);
814
815
  }
815
- function de(t) {
816
+ function be(t) {
816
817
  B(() => {
817
- const n = N.get(t), l = Q.value;
818
- if (n && l) {
819
- const v = n.getBoundingClientRect(), g = l.getBoundingClientRect();
820
- (v.left < g.left || v.right > g.right) && n.scrollIntoView({
818
+ const n = V.get(t), i = Z.value;
819
+ if (n && i) {
820
+ const g = n.getBoundingClientRect(), p = i.getBoundingClientRect();
821
+ (g.left < p.left || g.right > p.right) && n.scrollIntoView({
821
822
  behavior: "smooth",
822
823
  block: "nearest",
823
824
  inline: "nearest"
@@ -825,73 +826,73 @@ const Jt = Ce({
825
826
  }
826
827
  });
827
828
  }
828
- function dt(t) {
829
+ function bt(t) {
829
830
  if (t.href && typeof window < "u") {
830
831
  t.target && t.target !== "_self" ? window.open(t.href, t.target) : window.location.assign(t.href);
831
832
  return;
832
833
  }
833
- a.activeId.value !== t.id && (a.openTab(t.to, !1), de(t.id));
834
+ a.activeId.value !== t.id && (a.openTab(t.to, !1), be(t.id));
834
835
  }
835
- function bt(t) {
836
+ function gt(t) {
836
837
  return [
837
838
  "router-tab__item",
838
839
  {
839
840
  "is-active": a.activeId.value === t.id,
840
- "is-closable": fe(t),
841
- "is-dragging": w.dragging && w.dragTab?.id === t.id,
842
- "is-drag-over": w.dropIndex === W(t.id)
841
+ "is-closable": de(t),
842
+ "is-dragging": C.dragging && C.dragTab?.id === t.id,
843
+ "is-drag-over": C.dropIndex === H(t.id)
843
844
  },
844
845
  t.tabClass
845
846
  ];
846
847
  }
847
- function gt(t) {
848
- return a.refreshingKey.value === a.getRouteKey(t);
849
- }
850
848
  function pt(t) {
851
- const n = a.getRouteKey(t), l = a.tabs.find((v) => v.id === n);
852
- return l ? l.alive : !1;
849
+ return a.refreshingKey.value === a.getRouteKey(t);
853
850
  }
854
851
  function vt(t) {
852
+ const n = a.getRouteKey(t), i = a.tabs.find((g) => g.id === n);
853
+ return i ? i.alive : !1;
854
+ }
855
+ function ht(t) {
855
856
  const n = a.getRouteKey(t);
856
- return !!a.tabs.find((v) => v.id === n);
857
+ return !!a.tabs.find((g) => g.id === n);
857
858
  }
858
- function ht(t, n, l) {
859
- e.sortable && (w.dragging = !0, w.dragIndex = n, w.dragTab = t, l.dataTransfer && (l.dataTransfer.effectAllowed = "move", l.dataTransfer.setData("text/plain", t.id)), r("tab-sort", { tab: t, index: n }));
859
+ function mt(t, n, i) {
860
+ e.sortable && (C.dragging = !0, C.dragIndex = n, C.dragTab = t, i.dataTransfer && (i.dataTransfer.effectAllowed = "move", i.dataTransfer.setData("text/plain", t.id)), r("tab-sort", { tab: t, index: n }));
860
861
  }
861
- function mt(t, n) {
862
- !e.sortable || !w.dragging || (n.preventDefault(), n.dataTransfer && (n.dataTransfer.dropEffect = "move"));
862
+ function yt(t, n) {
863
+ !e.sortable || !C.dragging || (n.preventDefault(), n.dataTransfer && (n.dataTransfer.dropEffect = "move"));
863
864
  }
864
- function yt(t) {
865
- !e.sortable || !w.dragging || (w.dropIndex = t);
865
+ function Tt(t) {
866
+ !e.sortable || !C.dragging || (C.dropIndex = t);
866
867
  }
867
- function Tt() {
868
- !e.sortable || w.dragging;
868
+ function Rt() {
869
+ !e.sortable || C.dragging;
869
870
  }
870
- function Rt(t, n) {
871
- if (!(!e.sortable || !w.dragging)) {
872
- if (n.preventDefault(), w.dragIndex !== -1 && w.dragIndex !== t) {
873
- const l = a.tabs.splice(w.dragIndex, 1)[0];
874
- a.tabs.splice(t, 0, l), r("tab-sorted", {
875
- tab: l,
876
- fromIndex: w.dragIndex,
871
+ function wt(t, n) {
872
+ if (!(!e.sortable || !C.dragging)) {
873
+ if (n.preventDefault(), C.dragIndex !== -1 && C.dragIndex !== t) {
874
+ const i = a.tabs.splice(C.dragIndex, 1)[0];
875
+ a.tabs.splice(t, 0, i), r("tab-sorted", {
876
+ tab: i,
877
+ fromIndex: C.dragIndex,
877
878
  toIndex: t
878
879
  });
879
880
  }
880
- De();
881
+ Be();
881
882
  }
882
883
  }
883
- function De() {
884
- w.dragging = !1, w.dragIndex = -1, w.dropIndex = -1, w.dragTab = null;
884
+ function Be() {
885
+ C.dragging = !1, C.dragIndex = -1, C.dropIndex = -1, C.dragTab = null;
885
886
  }
886
887
  ke(() => {
887
- document.addEventListener("keydown", k);
888
- }), $t(() => {
889
- document.removeEventListener("keydown", k), o.appContext.config.globalProperties.$tabs = null, M.forEach((t) => {
888
+ document.addEventListener("keydown", w);
889
+ }), At(() => {
890
+ document.removeEventListener("keydown", w), o.appContext.config.globalProperties.$tabs = null, M.forEach((t) => {
890
891
  t.forEach((n) => {
891
892
  try {
892
893
  n();
893
- } catch (l) {
894
- console.error("[RouterTab] Error during cleanup:", l);
894
+ } catch (i) {
895
+ console.error("[RouterTab] Error during cleanup:", i);
895
896
  }
896
897
  });
897
898
  }), M.clear(), P.clear();
@@ -903,181 +904,182 @@ const Jt = Ce({
903
904
  ), A(
904
905
  () => a.activeId.value,
905
906
  (t) => {
906
- t && de(t), k();
907
+ t && be(t), w();
907
908
  }
908
909
  ), A(
909
910
  () => a.tabs.length,
910
911
  () => {
911
- const t = new Set(a.tabs.map((l) => l.id));
912
- Array.from(P.keys()).forEach((l) => {
913
- t.has(l) || (console.log(`[RouterTab] Cleaning up stale component instance: ${l}`), L(l));
912
+ const t = new Set(a.tabs.map((i) => i.id));
913
+ Array.from(P.keys()).forEach((i) => {
914
+ t.has(i) || (console.log(`[RouterTab] Cleaning up stale component instance: ${i}`), L(i));
914
915
  });
915
916
  }
916
917
  ), A(
917
918
  () => e.contextmenu,
918
919
  (t) => {
919
- t || k();
920
+ t || w();
920
921
  }
921
922
  ), A(
922
- () => q.value.length,
923
+ () => W.value.length,
923
924
  (t) => {
924
- R.visible && t === 0 && k();
925
+ R.visible && t === 0 && w();
925
926
  },
926
927
  { flush: "post" }
927
928
  // Run after component updates to prevent blocking render
928
- ), A(q, (t) => {
929
+ ), A(W, (t) => {
929
930
  if (!R.visible) return;
930
931
  O.value = new Array(t.length).fill(null);
931
- const n = Z(-1, 1, t);
932
- H(n);
932
+ const n = ee(-1, 1, t);
933
+ J(n);
933
934
  }, { flush: "post" }), A(
934
935
  () => R.visible,
935
936
  (t) => {
936
937
  t || (D.value = -1, O.value = []);
937
938
  }
938
939
  );
939
- const be = a.includeKeys;
940
+ const ge = a.includeKeys;
940
941
  return {
941
942
  controller: a,
942
943
  tabs: a.tabs,
943
- includeKeys: be,
944
- componentCache: ce,
945
- componentCacheTrigger: Ie,
944
+ includeKeys: ge,
945
+ componentCache: G,
946
+ componentCacheTrigger: fe,
946
947
  cacheCurrentComponent: it,
947
- tabTransitionProps: z,
948
- pageTransitionProps: le,
949
- buildTabClass: bt,
950
- activate: dt,
951
- close: ct,
948
+ tabTransitionProps: U,
949
+ pageTransitionProps: se,
950
+ buildTabClass: gt,
951
+ activate: bt,
952
+ close: ft,
952
953
  context: R,
953
- menuItems: q,
954
- handleMenuAction: Se,
954
+ menuItems: W,
955
+ handleMenuAction: Ie,
955
956
  showContextMenu: I,
956
- hideContextMenu: k,
957
- getTabTitle: ue,
958
- isClosable: fe,
959
- isRefreshing: gt,
960
- isTabCached: pt,
961
- isTabReady: vt,
962
- hasCustomSlot: p,
957
+ hideContextMenu: w,
958
+ getTabTitle: ce,
959
+ isClosable: de,
960
+ isRefreshing: pt,
961
+ isTabCached: vt,
962
+ isTabReady: ht,
963
+ hasCustomSlot: v,
963
964
  hasStartSlot: T,
964
- hasEndSlot: i,
965
- onDragStart: ht,
966
- onDragOver: mt,
967
- onDragEnter: yt,
968
- onDragLeave: Tt,
969
- onDrop: Rt,
970
- onDragEnd: De,
965
+ hasEndSlot: l,
966
+ onDragStart: mt,
967
+ onDragOver: yt,
968
+ onDragEnter: Tt,
969
+ onDragLeave: Rt,
970
+ onDrop: wt,
971
+ onDragEnd: Be,
971
972
  setupComponentWatching: Y,
972
973
  cleanupComponentWatching: L,
973
974
  handleComponentRef: F,
974
- getReactiveTabTitle: rt,
975
- getComponentCacheKey: xe,
976
- getRefreshComponentKey: ut,
977
- createNamedComponent: at,
975
+ getReactiveTabTitle: at,
976
+ getComponentCacheKey: De,
977
+ getRefreshComponentKey: ct,
978
+ createNamedComponent: xe,
978
979
  ensureNamedComponent: lt,
979
- shouldRenderRoute: st,
980
+ getNamedComponent: st,
981
+ shouldRenderRoute: ut,
980
982
  triggerTabUpdate: E,
981
- menuRef: X,
983
+ menuRef: Q,
982
984
  highlightedIndex: D,
983
- setMenuItemRef: tt,
984
- onMenuKeydown: ot,
985
- highlightMenuIndex: H,
986
- scrollContainer: Q,
987
- setTabRef: ft,
988
- scrollTabIntoView: de
985
+ setMenuItemRef: nt,
986
+ onMenuKeydown: rt,
987
+ highlightMenuIndex: J,
988
+ scrollContainer: Z,
989
+ setTabRef: dt,
990
+ scrollTabIntoView: be
989
991
  };
990
992
  }
991
- }), Gt = (e, r) => {
993
+ }), Xt = (e, r) => {
992
994
  const o = e.__vccOpts || e;
993
995
  for (const [s, a] of r)
994
996
  o[s] = a;
995
997
  return o;
996
- }, Xt = { class: "router-tab" }, Qt = { class: "router-tab__header" }, Zt = {
998
+ }, Qt = { class: "router-tab" }, Zt = { class: "router-tab__header" }, en = {
997
999
  class: "router-tab__scroll",
998
1000
  ref: "scrollContainer"
999
- }, en = ["data-title", "draggable", "onClick", "onAuxclick", "onContextmenu", "onDragstart", "onDragover", "onDragenter", "onDrop"], tn = ["title"], nn = ["onClick"], on = { class: "router-tab__container" }, rn = ["aria-disabled", "disabled", "tabindex", "onMouseenter", "onClick"];
1000
- function an(e, r, o, s, a, p) {
1001
- const T = Pt("RouterView");
1002
- return $(), x("div", Xt, [
1003
- j("header", Qt, [
1001
+ }, tn = ["data-title", "draggable", "onClick", "onAuxclick", "onContextmenu", "onDragstart", "onDragover", "onDragenter", "onDrop"], nn = ["title"], on = ["onClick"], rn = { class: "router-tab__container" }, an = ["aria-disabled", "disabled", "tabindex", "onMouseenter", "onClick"];
1002
+ function ln(e, r, o, s, a, v) {
1003
+ const T = St("RouterView");
1004
+ return $(), x("div", Qt, [
1005
+ j("header", Zt, [
1004
1006
  j("div", {
1005
- class: J(["router-tab__slot-start", { "has-content": e.hasStartSlot }])
1007
+ class: q(["router-tab__slot-start", { "has-content": e.hasStartSlot }])
1006
1008
  }, [
1007
- pe(e.$slots, "start")
1009
+ ve(e.$slots, "start")
1008
1010
  ], 2),
1009
- j("div", Zt, [
1010
- Le(It, ve({
1011
+ j("div", en, [
1012
+ Oe(xt, he({
1011
1013
  tag: "ul",
1012
1014
  class: "router-tab__nav"
1013
1015
  }, e.tabTransitionProps), {
1014
- default: he(() => [
1015
- ($(!0), x(me, null, Oe(e.tabs, (i, b) => ($(), x("li", {
1016
- key: i.id,
1017
- class: J(e.buildTabClass(i)),
1018
- "data-title": e.getTabTitle(i),
1016
+ default: me(() => [
1017
+ ($(!0), x(ye, null, je(e.tabs, (l, d) => ($(), x("li", {
1018
+ key: l.id,
1019
+ class: q(e.buildTabClass(l)),
1020
+ "data-title": e.getTabTitle(l),
1019
1021
  draggable: e.sortable,
1020
1022
  ref_for: !0,
1021
- ref: (h) => e.setTabRef(i.id, h),
1022
- onClick: (h) => e.activate(i),
1023
- onAuxclick: ye((h) => e.close(i), ["middle", "prevent"]),
1024
- onContextmenu: ye((h) => e.showContextMenu(i, h), ["prevent"]),
1025
- onDragstart: (h) => e.onDragStart(i, b, h),
1026
- onDragover: (h) => e.onDragOver(b, h),
1027
- onDragenter: (h) => e.onDragEnter(b),
1023
+ ref: (h) => e.setTabRef(l.id, h),
1024
+ onClick: (h) => e.activate(l),
1025
+ onAuxclick: Te((h) => e.close(l), ["middle", "prevent"]),
1026
+ onContextmenu: Te((h) => e.showContextMenu(l, h), ["prevent"]),
1027
+ onDragstart: (h) => e.onDragStart(l, d, h),
1028
+ onDragover: (h) => e.onDragOver(d, h),
1029
+ onDragenter: (h) => e.onDragEnter(d),
1028
1030
  onDragleave: r[0] || (r[0] = (...h) => e.onDragLeave && e.onDragLeave(...h)),
1029
- onDrop: (h) => e.onDrop(b, h),
1031
+ onDrop: (h) => e.onDrop(d, h),
1030
1032
  onDragend: r[1] || (r[1] = (...h) => e.onDragEnd && e.onDragEnd(...h))
1031
1033
  }, [
1032
- i.icon ? ($(), x("i", {
1034
+ l.icon ? ($(), x("i", {
1033
1035
  key: 0,
1034
- class: J(["router-tab__item-icon", i.icon])
1035
- }, null, 2)) : ee("", !0),
1036
+ class: q(["router-tab__item-icon", l.icon])
1037
+ }, null, 2)) : te("", !0),
1036
1038
  j("span", {
1037
1039
  class: "router-tab__item-title",
1038
- title: e.getReactiveTabTitle(i)
1039
- }, je(e.getReactiveTabTitle(i)), 9, tn),
1040
- e.isClosable(i) ? ($(), x("a", {
1040
+ title: e.getReactiveTabTitle(l)
1041
+ }, Ue(e.getReactiveTabTitle(l)), 9, nn),
1042
+ e.isClosable(l) ? ($(), x("a", {
1041
1043
  key: 1,
1042
1044
  class: "router-tab__item-close",
1043
- onClick: ye((h) => e.close(i), ["stop"])
1044
- }, null, 8, nn)) : ee("", !0)
1045
- ], 42, en))), 128))
1045
+ onClick: Te((h) => e.close(l), ["stop"])
1046
+ }, null, 8, on)) : te("", !0)
1047
+ ], 42, tn))), 128))
1046
1048
  ]),
1047
1049
  _: 1
1048
1050
  }, 16)
1049
1051
  ], 512),
1050
1052
  j("div", {
1051
- class: J(["router-tab__slot-end", { "has-content": e.hasEndSlot }])
1053
+ class: q(["router-tab__slot-end", { "has-content": e.hasEndSlot }])
1052
1054
  }, [
1053
- pe(e.$slots, "end")
1055
+ ve(e.$slots, "end")
1054
1056
  ], 2)
1055
1057
  ]),
1056
- j("div", on, [
1057
- Le(T, null, {
1058
- default: he(({ Component: i, route: b }) => [
1059
- e.hasCustomSlot ? pe(e.$slots, "default", xt(ve({ key: 0 }, {
1060
- Component: i,
1061
- route: b,
1058
+ j("div", rn, [
1059
+ Oe(T, null, {
1060
+ default: me(({ Component: l, route: d }) => [
1061
+ e.hasCustomSlot ? ve(e.$slots, "default", Dt(he({ key: 0 }, {
1062
+ Component: l,
1063
+ route: d,
1062
1064
  controller: e.controller,
1063
- pageRef: (h) => e.handleComponentRef(h, e.controller.getRouteKey(b))
1064
- }))) : ($(), x(me, { key: 1 }, [
1065
- e.controller.options.keepAlive ? ($(), te(Dt, {
1065
+ pageRef: (h) => e.handleComponentRef(h, e.controller.getRouteKey(d))
1066
+ }))) : ($(), x(ye, { key: 1 }, [
1067
+ e.controller.options.keepAlive ? ($(), ne(Bt, {
1066
1068
  key: 0,
1067
1069
  include: e.includeKeys
1068
1070
  }, [
1069
- i ? ($(), te(ze(e.ensureNamedComponent(i, e.controller.getRouteKey(b))), {
1070
- key: e.controller.getRouteKey(b),
1071
- ref: (h) => e.handleComponentRef(h, e.controller.getRouteKey(b)),
1071
+ l ? ($(), ne(Ve(e.getNamedComponent(l, e.getComponentCacheKey(d))), {
1072
+ key: e.isRefreshing(d) ? e.getRefreshComponentKey(d) : e.getComponentCacheKey(d),
1073
+ ref: (h) => e.handleComponentRef(h, e.controller.getRouteKey(d)),
1072
1074
  class: "router-tab-page"
1073
- })) : ee("", !0)
1074
- ], 1032, ["include"])) : ($(), te(Bt, ve({ key: 1 }, e.pageTransitionProps, { appear: "" }), {
1075
- default: he(() => [
1076
- i ? ($(), te(ze(i), {
1077
- key: e.controller.getRouteKey(b),
1078
- ref: (h) => e.handleComponentRef(h, e.controller.getRouteKey(b)),
1075
+ })) : te("", !0)
1076
+ ], 1032, ["include"])) : ($(), ne(Mt, he({ key: 1 }, e.pageTransitionProps, { appear: "" }), {
1077
+ default: me(() => [
1078
+ l ? ($(), ne(Ve(l), {
1079
+ key: e.controller.getRouteKey(d),
1080
+ ref: (h) => e.handleComponentRef(h, e.controller.getRouteKey(d)),
1079
1081
  class: "router-tab-page"
1080
- })) : ee("", !0)
1082
+ })) : te("", !0)
1081
1083
  ]),
1082
1084
  _: 2
1083
1085
  }, 1040))
@@ -1086,34 +1088,34 @@ function an(e, r, o, s, a, p) {
1086
1088
  _: 3
1087
1089
  })
1088
1090
  ]),
1089
- St(j("div", {
1091
+ It(j("div", {
1090
1092
  ref: "menuRef",
1091
1093
  class: "router-tab__contextmenu",
1092
1094
  role: "menu",
1093
- onKeydown: r[2] || (r[2] = (...i) => e.onMenuKeydown && e.onMenuKeydown(...i)),
1094
- style: Mt({ left: e.context.position.x + "px", top: e.context.position.y + "px" })
1095
+ onKeydown: r[2] || (r[2] = (...l) => e.onMenuKeydown && e.onMenuKeydown(...l)),
1096
+ style: Lt({ left: e.context.position.x + "px", top: e.context.position.y + "px" })
1095
1097
  }, [
1096
- ($(!0), x(me, null, Oe(e.menuItems, (i, b) => ($(), x("a", {
1097
- key: i.id,
1098
+ ($(!0), x(ye, null, je(e.menuItems, (l, d) => ($(), x("a", {
1099
+ key: l.id,
1098
1100
  role: "menuitem",
1099
- class: J(["router-tab__contextmenu-item", { "is-focused": b === e.highlightedIndex }]),
1100
- "aria-disabled": i.disabled,
1101
- disabled: i.disabled,
1102
- tabindex: i.disabled ? -1 : b === e.highlightedIndex ? 0 : -1,
1101
+ class: q(["router-tab__contextmenu-item", { "is-focused": d === e.highlightedIndex }]),
1102
+ "aria-disabled": l.disabled,
1103
+ disabled: l.disabled,
1104
+ tabindex: l.disabled ? -1 : d === e.highlightedIndex ? 0 : -1,
1103
1105
  ref_for: !0,
1104
- ref: (h) => e.setMenuItemRef(h, b),
1105
- onMouseenter: (h) => !i.disabled && e.highlightMenuIndex(b),
1106
- onClick: (h) => e.handleMenuAction(i)
1107
- }, je(i.label), 43, rn))), 128))
1106
+ ref: (h) => e.setMenuItemRef(h, d),
1107
+ onMouseenter: (h) => !l.disabled && e.highlightMenuIndex(d),
1108
+ onClick: (h) => e.handleMenuAction(l)
1109
+ }, Ue(l.label), 43, an))), 128))
1108
1110
  ], 36), [
1109
- [Lt, e.context.visible && e.context.target]
1111
+ [Ot, e.context.visible && e.context.target]
1110
1112
  ])
1111
1113
  ]);
1112
1114
  }
1113
- const Ye = /* @__PURE__ */ Gt(Jt, [["render", an]]), ln = {
1115
+ const Fe = /* @__PURE__ */ Xt(qt, [["render", ln]]), sn = {
1114
1116
  class: "router-tabs",
1115
1117
  "aria-hidden": "true"
1116
- }, we = /* @__PURE__ */ Ce({
1118
+ }, Ce = /* @__PURE__ */ Ke({
1117
1119
  name: "RouterTabs",
1118
1120
  __name: "RouterTabs",
1119
1121
  props: {
@@ -1128,10 +1130,10 @@ const Ye = /* @__PURE__ */ Gt(Jt, [["render", an]]), ln = {
1128
1130
  fallbackRoute: {}
1129
1131
  },
1130
1132
  setup(e) {
1131
- return He(e), (o, s) => ($(), x("span", ln));
1133
+ return Ge(e), (o, s) => ($(), x("span", sn));
1132
1134
  }
1133
- }), Je = "tab-theme-style", Ge = "tab-theme-primary-color", sn = "system", Xe = "(prefers-color-scheme: dark)";
1134
- let G = null;
1135
+ }), qe = "tab-theme-style", Xe = "tab-theme-primary-color", un = "system", Qe = "(prefers-color-scheme: dark)";
1136
+ let X = null;
1135
1137
  const K = {
1136
1138
  primary: "#034960",
1137
1139
  background: "#ffffff",
@@ -1146,7 +1148,7 @@ const K = {
1146
1148
  activeButtonBackground: "#034960",
1147
1149
  activeButtonColor: "#ffffff",
1148
1150
  iconColor: "#475569"
1149
- }, un = {
1151
+ }, cn = {
1150
1152
  primary: "#38bdf8",
1151
1153
  background: "#0f172a",
1152
1154
  text: "#f1f5f9",
@@ -1162,7 +1164,7 @@ const K = {
1162
1164
  activeButtonColor: "#0f172a",
1163
1165
  iconColor: "#cbd5e1"
1164
1166
  };
1165
- function cn(e) {
1167
+ function fn(e) {
1166
1168
  if (typeof window > "u") return null;
1167
1169
  const r = window.localStorage.getItem(e);
1168
1170
  if (!r) return null;
@@ -1173,46 +1175,46 @@ function cn(e) {
1173
1175
  return null;
1174
1176
  }
1175
1177
  }
1176
- function $e(e) {
1178
+ function Ae(e) {
1177
1179
  typeof document > "u" || (document.documentElement.style.setProperty("--router-tab-primary", e.primary ?? K.primary), document.documentElement.style.setProperty("--router-tab-header-bg", e.headerBackground ?? K.headerBackground), document.documentElement.style.setProperty("--router-tab-background", e.background ?? K.background), document.documentElement.style.setProperty("--router-tab-active-background", e.activeBackground ?? K.activeBackground), document.documentElement.style.setProperty("--router-tab-text", e.text ?? K.text), document.documentElement.style.setProperty("--router-tab-active-text", e.activeText ?? K.activeText), document.documentElement.style.setProperty("--router-tab-border", e.border ?? K.border), document.documentElement.style.setProperty("--router-tab-active-border", e.activeBorder ?? K.activeBorder), document.documentElement.style.setProperty("--router-tab-button-color", e.buttonColor ?? K.buttonColor), document.documentElement.style.setProperty("--router-tab-active-button-color", e.activeButtonColor ?? K.activeButtonColor), document.documentElement.style.setProperty("--router-tab-button-background", e.buttonBackground ?? K.buttonBackground), document.documentElement.style.setProperty("--router-tab-active-button-background", e.activeButtonBackground ?? K.activeButtonBackground), document.documentElement.style.setProperty("--router-tab-icon-color", e.iconColor ?? K.iconColor));
1178
1180
  }
1179
- function Qe(e) {
1181
+ function Ze(e) {
1180
1182
  if (typeof document > "u") return;
1181
- const r = document.documentElement, o = window.matchMedia(Xe), s = () => {
1183
+ const r = document.documentElement, o = window.matchMedia(Qe), s = () => {
1182
1184
  r.dataset.theme = o.matches ? "dark" : "light";
1183
1185
  };
1184
- G && (o.removeEventListener("change", G), G = null), e === "system" ? (s(), G = () => s(), o.addEventListener("change", G)) : r.dataset.theme = e;
1186
+ X && (o.removeEventListener("change", X), X = null), e === "system" ? (s(), X = () => s(), o.addEventListener("change", X)) : r.dataset.theme = e;
1185
1187
  }
1186
- function fn(e = {}) {
1188
+ function dn(e = {}) {
1187
1189
  if (typeof window > "u") return;
1188
1190
  const {
1189
- styleKey: r = Je,
1190
- primaryKey: o = Ge,
1191
- defaultStyle: s = sn,
1191
+ styleKey: r = qe,
1192
+ primaryKey: o = Xe,
1193
+ defaultStyle: s = un,
1192
1194
  defaultPrimary: a
1193
- } = e, p = window.localStorage.getItem(r) ?? s;
1194
- Qe(p);
1195
- const i = p === "dark" || p === "system" && window.matchMedia(Xe).matches ? { ...un } : { ...K };
1196
- a && (i.primary = a);
1197
- const b = cn(o);
1198
- $e(b ? {
1199
- ...i,
1200
- ...b
1201
- } : i);
1195
+ } = e, v = window.localStorage.getItem(r) ?? s;
1196
+ Ze(v);
1197
+ const l = v === "dark" || v === "system" && window.matchMedia(Qe).matches ? { ...cn } : { ...K };
1198
+ a && (l.primary = a);
1199
+ const d = fn(o);
1200
+ Ae(d ? {
1201
+ ...l,
1202
+ ...d
1203
+ } : l);
1202
1204
  }
1203
- function gn(e, r) {
1205
+ function pn(e, r) {
1204
1206
  if (typeof window > "u") return;
1205
- const o = r?.styleKey ?? Je;
1206
- window.localStorage.setItem(o, e), Qe(e);
1207
+ const o = r?.styleKey ?? qe;
1208
+ window.localStorage.setItem(o, e), Ze(e);
1207
1209
  }
1208
- function pn(e, r) {
1210
+ function vn(e, r) {
1209
1211
  if (typeof window > "u") return;
1210
- const o = r?.primaryKey ?? Ge;
1211
- window.localStorage.setItem(o, JSON.stringify(e)), $e(e);
1212
+ const o = r?.primaryKey ?? Xe;
1213
+ window.localStorage.setItem(o, JSON.stringify(e)), Ae(e);
1212
1214
  }
1213
- function oe(e, r) {
1214
- if (Ot(e)) {
1215
- const s = !jt(e);
1215
+ function re(e, r) {
1216
+ if (jt(e)) {
1217
+ const s = !Ut(e);
1216
1218
  return {
1217
1219
  value: e,
1218
1220
  update: s ? (a) => {
@@ -1223,7 +1225,7 @@ function oe(e, r) {
1223
1225
  }
1224
1226
  if (typeof e == "function")
1225
1227
  return {
1226
- value: C(e),
1228
+ value: k(e),
1227
1229
  update: () => {
1228
1230
  }
1229
1231
  };
@@ -1237,8 +1239,8 @@ function oe(e, r) {
1237
1239
  }
1238
1240
  };
1239
1241
  }
1240
- function Ae(e = {}) {
1241
- const r = oe(e.title, "Untitled"), o = oe(e.icon, ""), s = oe(e.closable, !0), a = oe(e.meta, {});
1242
+ function Pe(e = {}) {
1243
+ const r = re(e.title, "Untitled"), o = re(e.icon, ""), s = re(e.closable, !0), a = re(e.meta, {});
1242
1244
  return {
1243
1245
  routeTabTitle: r.value,
1244
1246
  routeTabIcon: o.value,
@@ -1250,67 +1252,67 @@ function Ae(e = {}) {
1250
1252
  updateMeta: a.update
1251
1253
  };
1252
1254
  }
1253
- function vn(e, r = "Page") {
1254
- return Ae({
1255
- title: C(() => e.value ? "Loading..." : r),
1256
- icon: C(() => e.value ? "mdi-loading mdi-spin" : "mdi-page"),
1257
- closable: C(() => !e.value)
1255
+ function hn(e, r = "Page") {
1256
+ return Pe({
1257
+ title: k(() => e.value ? "Loading..." : r),
1258
+ icon: k(() => e.value ? "mdi-loading mdi-spin" : "mdi-page"),
1259
+ closable: k(() => !e.value)
1258
1260
  });
1259
1261
  }
1260
- function hn(e, r = "Page", o = "mdi-page") {
1261
- return Ae({
1262
- title: C(() => e.value > 0 ? `${r} (${e.value})` : r),
1263
- icon: C(() => e.value > 0 ? "mdi-bell-badge" : o)
1262
+ function mn(e, r = "Page", o = "mdi-page") {
1263
+ return Pe({
1264
+ title: k(() => e.value > 0 ? `${r} (${e.value})` : r),
1265
+ icon: k(() => e.value > 0 ? "mdi-bell-badge" : o)
1264
1266
  });
1265
1267
  }
1266
- function mn(e, r = "Page") {
1268
+ function yn(e, r = "Page") {
1267
1269
  const o = {
1268
1270
  normal: { suffix: "", icon: "mdi-page" },
1269
1271
  loading: { suffix: " - Loading", icon: "mdi-loading mdi-spin" },
1270
1272
  error: { suffix: " - Error", icon: "mdi-alert" },
1271
1273
  success: { suffix: " - Success", icon: "mdi-check-circle" }
1272
1274
  };
1273
- return Ae({
1274
- title: C(() => r + o[e.value].suffix),
1275
- icon: C(() => o[e.value].icon),
1276
- closable: C(() => e.value !== "loading")
1275
+ return Pe({
1276
+ title: k(() => r + o[e.value].suffix),
1277
+ icon: k(() => o[e.value].icon),
1278
+ closable: k(() => e.value !== "loading")
1277
1279
  });
1278
1280
  }
1279
- let Fe = !1;
1280
- const yn = {
1281
+ let He = !1;
1282
+ const Tn = {
1281
1283
  install(e, r) {
1282
- if (Fe) return;
1283
- Fe = !0;
1284
+ if (He) return;
1285
+ He = !0;
1284
1286
  const {
1285
1287
  initTheme: o = !0,
1286
1288
  themeOptions: s,
1287
- componentName: a = Ye.name || "RouterTab",
1288
- tabsComponentName: p = we.name || "RouterTabs"
1289
+ componentName: a = Fe.name || "RouterTab",
1290
+ tabsComponentName: v = Ce.name || "RouterTabs"
1289
1291
  } = r ?? {};
1290
- o && fn(s ?? {}), e.component(a, Ye), e.component(p, we), p.toLowerCase() !== "router-tabs" && e.component("router-tabs", we), Object.defineProperty(e.config.globalProperties, "$tabs", {
1292
+ o && dn(s ?? {}), e.component(a, Fe), e.component(v, Ce), v.toLowerCase() !== "router-tabs" && e.component("router-tabs", Ce), Object.defineProperty(e.config.globalProperties, "$tabs", {
1291
1293
  configurable: !0,
1292
1294
  enumerable: !1,
1293
1295
  get() {
1294
- return e._context.provides[ie];
1296
+ return e._context.provides[le];
1295
1297
  },
1296
1298
  set(T) {
1297
- T && e.provide(ie, T);
1299
+ T && e.provide(le, T);
1298
1300
  }
1299
1301
  });
1300
1302
  }
1301
1303
  };
1302
1304
  export {
1303
- Ye as RouterTab,
1304
- we as RouterTabs,
1305
- yn as default,
1306
- fn as initRouterTabsTheme,
1307
- ie as routerTabsKey,
1308
- pn as setRouterTabsPrimary,
1309
- gn as setRouterTabsTheme,
1310
- vn as useLoadingTab,
1311
- hn as useNotificationTab,
1312
- Ae as useReactiveTab,
1313
- Ue as useRouterTabs,
1314
- He as useRouterTabsPersistence,
1315
- mn as useStatusTab
1305
+ Fe as RouterTab,
1306
+ Ce as RouterTabs,
1307
+ Tn as default,
1308
+ dn as initRouterTabsTheme,
1309
+ le as routerTabsKey,
1310
+ vn as setRouterTabsPrimary,
1311
+ pn as setRouterTabsTheme,
1312
+ hn as useLoadingTab,
1313
+ mn as useNotificationTab,
1314
+ Pe as useReactiveTab,
1315
+ _e as useRouterTabs,
1316
+ Ge as useRouterTabsPersistence,
1317
+ yn as useStatusTab
1316
1318
  };