vue3-router-tab 1.4.1 → 1.4.3

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