@campus-admin/core 2.0.9 → 2.1.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.
package/dist/index.js CHANGED
@@ -1,323 +1,136 @@
1
1
  import './style.css'
2
+ import { a as e, c as t, d as n, i as r, l as i, n as a, o, r as s, s as c, t as l, u } from "./ca-BP878D3q.js";
3
+ import { a as d, c as f, d as p, i as m, l as h, n as g, o as _, r as v, s as y, t as b, u as x } from "./session-Cvdtq46r.js";
2
4
  import "element-plus/es/components/base/style/css";
3
5
  import "element-plus/theme-chalk/dark/css-vars.css";
4
6
  import "@campus-admin/theme/nova.css";
5
- import { Fragment as e, KeepAlive as t, computed as n, createApp as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createStaticVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, h as f, mergeModels as p, nextTick as m, normalizeClass as h, normalizeStyle as g, onBeforeUnmount as _, onMounted as v, openBlock as y, reactive as b, ref as x, renderList as S, renderSlot as C, resolveComponent as w, resolveDynamicComponent as T, toDisplayString as E, unref as D, useId as O, useModel as k, vShow as A, watch as j, watchEffect as M, withCtx as N, withDirectives as P, withModifiers as F } from "vue";
6
- import { createPinia as I, defineStore as L } from "pinia";
7
- import { installUi as R, translateKey as z } from "@campus-admin/ui";
8
- import { LOCALES as ee, frameworkMessages as te } from "@campus-admin/locale";
9
- import { createI18n as B, useI18n as V } from "vue-i18n";
10
- import { RouterLink as ne, createRouter as re, createWebHashHistory as H, createWebHistory as U, useRoute as W, useRouter as G } from "vue-router";
11
- import { applyTheme as ie, deriveCssVars as ae, isHexColor as oe, parseColor as se, resolveMode as ce, resolveTheme as le, toHex as ue } from "@campus-admin/theme";
12
- import { ElLoading as de, ElMessage as fe, ElMessageBox as pe, ElNotification as me } from "element-plus";
13
- import "element-plus/es/components/loading/style/css";
14
- import "element-plus/es/components/notification/style/css";
15
- import "element-plus/es/components/message/style/css";
16
- import "element-plus/es/components/message-box/style/css";
17
- import { pinyin as he } from "pinyin-pro";
7
+ import { Fragment as S, KeepAlive as C, computed as w, createApp as T, createBlock as E, createCommentVNode as D, createElementBlock as O, createElementVNode as k, createStaticVNode as A, createTextVNode as j, createVNode as M, defineAsyncComponent as ee, defineComponent as N, h as P, mergeModels as F, nextTick as I, normalizeClass as L, normalizeStyle as R, onBeforeUnmount as z, onMounted as B, openBlock as V, reactive as te, ref as H, renderList as U, renderSlot as ne, resolveComponent as W, resolveDynamicComponent as G, shallowRef as re, toDisplayString as K, unref as q, useId as ie, useModel as ae, vShow as oe, watch as J, watchEffect as se, withCtx as Y, withDirectives as X, withModifiers as Z } from "vue";
8
+ import { createPinia as ce, defineStore as le } from "pinia";
9
+ import { installUi as ue, translateKey as de } from "@campus-admin/ui";
10
+ import { LOCALES as fe } from "@campus-admin/locale";
11
+ import { RouterLink as pe, createRouter as me, createWebHashHistory as he, createWebHistory as ge, useRoute as _e, useRouter as Q } from "vue-router";
12
+ import { applyTheme as ve, deriveCssVars as ye, isHexColor as be, parseColor as xe, resolveMode as Se, resolveTheme as Ce, toHex as we } from "@campus-admin/theme";
13
+ import { pinyin as Te } from "pinyin-pro";
18
14
  export * from "@campus-admin/ui";
19
- // packages/core/src/storage.ts
20
- var ge = "ca:";
21
- function _e(e, t = "local") {
22
- try {
23
- return (t === "local" ? localStorage : sessionStorage).getItem(ge + e);
24
- } catch {
25
- return null;
26
- }
27
- }
28
- function K(e, t, n = "local") {
29
- try {
30
- let r = n === "local" ? localStorage : sessionStorage;
31
- t === null ? r.removeItem(ge + e) : r.setItem(ge + e, t);
32
- } catch {}
33
- }
34
- function ve(e, t = "local") {
35
- let n = _e(e, t);
36
- if (n) try {
37
- return JSON.parse(n);
38
- } catch {
39
- return;
40
- }
41
- }
42
- function ye(e, t, n = "local") {
43
- K(e, JSON.stringify(t), n);
44
- }
45
- // packages/core/src/i18n.ts
46
- var be = (e) => typeof e == "object" && !!e && !Array.isArray(e);
47
- function xe(e, t) {
48
- let n = { ...e };
49
- for (let [e, r] of Object.entries(t)) {
50
- let t = n[e];
51
- n[e] = be(t) && be(r) ? xe(t, r) : r;
52
- }
53
- return n;
54
- }
55
- var Se = "locale";
56
- function Ce(e) {
57
- return e === "zh-CN" || e === "en-US";
58
- }
59
- function we(e) {
60
- let t = _e(Se), n = Ce(t) ? t : e.defaultLocale ?? "zh-CN", r = Object.fromEntries(["zh-CN", "en-US"].map((t) => [t, xe(te[t], e.messages?.[t] ?? {})])), i = B({
61
- legacy: !1,
62
- locale: n,
63
- fallbackLocale: "zh-CN",
64
- messages: r
65
- });
66
- return typeof document < "u" && j(() => i.global.locale.value, (e) => {
67
- document.documentElement.lang = e;
68
- }, { immediate: !0 }), Te = i, i;
69
- }
70
- var Te;
71
- function Ee(e, t) {
72
- return Te ? Te.global.t(e, t ?? {}) : e;
73
- }
74
- function De(e) {
75
- K(Se, e);
76
- }
77
- function q() {
78
- let { t: e, te: t, locale: n } = V();
79
- return {
80
- t: e,
81
- te: t,
82
- label: (n) => t(n) ? e(n) : n,
83
- locale: n
84
- };
85
- }
86
15
  // packages/core/src/CampusRoot.vue
87
- var Oe = /* @__PURE__ */ d({
16
+ var Ee = /* @__PURE__ */ N({
88
17
  __name: "CampusRoot",
89
18
  setup(e) {
90
- let { locale: t } = q();
19
+ let { locale: t } = c();
91
20
  return (e, n) => {
92
- let r = w("router-view"), a = w("ca-config-provider");
93
- return y(), i(a, { locale: D(t) }, {
94
- default: N(() => [u(r)]),
21
+ let r = W("router-view"), i = W("ca-config-provider");
22
+ return V(), E(i, { locale: q(t) }, {
23
+ default: Y(() => [M(r)]),
95
24
  _: 1
96
25
  }, 8, ["locale"]);
97
26
  };
98
27
  }
99
- });
100
- // packages/core/src/types.ts
101
- function ke(e) {
102
- return "children" in e;
103
- }
104
- // packages/core/src/context.ts
105
- var Ae;
106
- function je(e) {
107
- Ae = e;
108
- }
109
- function J() {
110
- if (!Ae) throw Error("[campus] 请先调用 createCampusApp()");
111
- return Ae;
112
- }
113
- function Me(e) {
114
- for (let t of J().menus) {
115
- if (t.key === e && t.path) return { titles: [t.title] };
116
- for (let n of t.children) {
117
- if (n.key === e && n.path) return { titles: [t.title, n.title] };
118
- if (ke(n)) {
119
- let r = n.children.find((t) => t.key === e);
120
- if (r) return { titles: [
121
- t.title,
122
- n.title,
123
- r.title
124
- ] };
125
- }
126
- }
127
- }
128
- }
129
- var Ne = [
130
- "none",
131
- "panel",
132
- "all"
133
- ];
134
- function Pe(e) {
135
- let t = [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
136
- function o(e, s, c, l = 1) {
137
- let u = l === 1 ? i : l === 2 && ke(e) ? a : void 0;
138
- if (u?.has(e.key)) throw Error(`[campus] 菜单${l === 1 ? "一级场景键" : "组键"}重复:${e.key}`);
139
- u?.add(e.key);
140
- let d = e.path !== void 0;
141
- if (d !== (e.component !== void 0)) throw Error(`[campus] 菜单 path 与 component 必须同时出现:${e.key}`);
142
- if (d) {
143
- if (n.has(e.key)) throw Error(`[campus] 菜单页面键重复:${e.key}`);
144
- if (n.add(e.key), typeof e.path != "string" || !e.path.startsWith("/")) throw Error(`[campus] 菜单路径必须以 / 开头:${e.path}`);
145
- if (typeof e.component != "function") throw Error(`[campus] 菜单 component 必须是懒加载函数:${e.key}`);
146
- if (r.has(e.path)) throw Error(`[campus] 菜单路径重复:${e.path}`);
147
- r.add(e.path);
148
- let { children: i, ...a } = e, o = {
149
- ...a,
150
- appKey: s,
151
- groupKey: l === 2 && ke(e) ? e.key : c
152
- };
153
- o.sideCollapse != null && !Ne.includes(o.sideCollapse) && (console.warn(`[campus] 菜单页面 sideCollapse 只能是 none / panel / all,已忽略:${e.key}`), delete o.sideCollapse), o.openMode != null && ![
154
- "normal",
155
- "collapsePanel",
156
- "collapseAll",
157
- "content",
158
- "screen"
159
- ].includes(o.openMode) && (console.warn(`[campus] 菜单页面 openMode 无效,已忽略:${e.key}`), delete o.openMode), t.push(o);
160
- }
161
- if (l === 3 && ("children" in e || !d)) throw Error(`[campus] 三级菜单必须是页面且不能有子菜单:${e.key}`);
162
- if ("children" in e) {
163
- if (!Array.isArray(e.children)) throw Error(`[campus] 菜单 children 必须是数组:${e.key}`);
164
- for (let t of e.children) o(t, s, l === 2 ? e.key : void 0, l + 1);
165
- }
166
- }
167
- for (let t of e) o(t, t.key);
168
- return t;
169
- }
170
- function Fe(e) {
171
- let t = {
172
- home: "/",
173
- login: "/login",
174
- register: "/register",
175
- forgot: "/forgot",
176
- forbidden: "/403",
177
- notFound: "/:pathMatch(.*)*",
178
- ...e.paths
179
- };
180
- for (let e of Object.values(t)) if (!e.startsWith("/") || e.startsWith("//")) throw Error(`[campus] 系统路径必须为站内绝对路径:${e}`);
181
- if ((/* @__PURE__ */ new Set([
182
- t.login,
183
- t.register,
184
- t.forgot,
185
- t.forbidden,
186
- t.notFound
187
- ])).size !== 5) throw Error("[campus] 系统页面路径不能重复");
188
- return t;
189
- }
190
- function Ie(e, t) {
191
- let n = e.homeEntry === !1 ? void 0 : Pe(e.menus).find((e) => e.affix && t(e.permission)), r = !e.accountInMenu && !e.onAccountClick, i = (i) => !!i.path && t(i.permission) && i.key !== n?.key && (!r || i.path !== e.accountPath);
192
- function a(e) {
193
- let t = "children" in e ? e.children.map((e) => a(e)).filter((e) => e !== void 0) : [], n = i(e);
194
- if (!n && !t.length) return;
195
- let r = { ...e };
196
- return "children" in r && (r.children = t), n || (delete r.path, delete r.component, delete r.permission, delete r.affix), r;
197
- }
198
- return {
199
- home: n,
200
- apps: e.menus.map((e) => a(e)).filter((e) => e !== void 0),
201
- accountStandalone: r
202
- };
203
- }
204
- function Y(e) {
205
- return {
206
- login: "login",
207
- register: "register",
208
- forgot: "forgot",
209
- forbidden: "forbidden",
210
- notFound: "not-found",
211
- ...e.routeNames
212
- };
213
- }
214
- // packages/core/src/stores/theme.ts
215
- var Le = "theme-mode", Re = "box-style", ze = "user-primary";
216
- function Be() {
217
- return _e(Re) === "border" ? "border" : "shadow";
28
+ }), De = "theme-mode", Oe = "box-style", ke = "user-primary";
29
+ function Ae() {
30
+ return i(Oe) === "border" ? "border" : "shadow";
218
31
  }
219
- function Ve() {
220
- let e = _e(ze);
221
- return oe(e) ? e : void 0;
32
+ function je() {
33
+ let e = i(ke);
34
+ return be(e) ? e : void 0;
222
35
  }
223
- function He() {
224
- let e = _e(Le);
36
+ function Me() {
37
+ let e = i(De);
225
38
  return e === "light" || e === "dark" || e === "auto" ? e : "auto";
226
39
  }
227
- var Ue = L("campus-theme", () => {
228
- let e = x({}), t = x(He()), r = x(Be()), i = x(Ve()), a = typeof matchMedia == "function" ? matchMedia("(prefers-color-scheme: dark)") : void 0, o = x(a?.matches ?? !1);
229
- a?.addEventListener("change", (e) => o.value = e.matches);
230
- let s = n(() => le(e.value)), c = n(() => e.value.tenantDefault?.locks?.includes("primary") ?? !1), l = n(() => {
231
- let e = s.value.theme, t = i.value;
232
- return !t || c.value ? e : {
40
+ var Ne = le("campus-theme", () => {
41
+ let e = H({}), r = H(Me()), i = H(Ae()), a = H(je()), o = typeof matchMedia == "function" ? matchMedia("(prefers-color-scheme: dark)") : void 0, s = H(o?.matches ?? !1);
42
+ o?.addEventListener("change", (e) => s.value = e.matches);
43
+ let c = w(() => Ce(e.value)), l = w(() => e.value.tenantDefault?.locks?.includes("primary") ?? !1), d = w(() => {
44
+ let e = c.value.theme, t = a.value;
45
+ return !t || l.value ? e : {
233
46
  ...e,
234
47
  primary: t,
235
48
  headerBg: e.headerBg === e.primary ? t : e.headerBg
236
49
  };
237
- }), u = n(() => s.value.issues), d = n(() => ce(t.value, o.value)), f = n(() => ae(l.value, d.value));
238
- M(() => ie(f.value, d.value, l.value.style)), M(() => {
239
- document.documentElement.dataset.caBox = r.value;
50
+ }), p = w(() => c.value.issues), m = w(() => Se(r.value, s.value)), h = w(() => ye(d.value, m.value));
51
+ se(() => ve(h.value, m.value, d.value.style)), se(() => {
52
+ document.documentElement.dataset.caBox = i.value;
240
53
  });
241
- function p(e) {
242
- (e === void 0 || oe(e)) && (i.value = e, K(ze, e ?? null));
54
+ function g(e) {
55
+ (e === void 0 || be(e)) && (a.value = e, n(ke, e ?? null));
243
56
  }
244
- function h(e) {
245
- r.value = e, K(Re, e);
57
+ function _(e) {
58
+ i.value = e, n(Oe, e);
246
59
  }
247
- function g() {
248
- return `theme-layers:${J().theme?.cacheKey ?? location.host}`;
60
+ function v() {
61
+ return `theme-layers:${f().theme?.cacheKey ?? location.host}`;
249
62
  }
250
- function _(e) {
251
- t.value = e, K(Le, e);
63
+ function y(e) {
64
+ r.value = e, n(De, e);
252
65
  }
253
- function v(e, t) {
254
- let n = document, r = ce(e, o.value) !== d.value, i = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
66
+ function b(e, t) {
67
+ let n = document, r = Se(e, s.value) !== m.value, i = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
255
68
  if (!t || !r || i || !n.startViewTransition) {
256
- _(e);
69
+ y(e);
257
70
  return;
258
71
  }
259
- let a = Math.hypot(Math.max(t.x, innerWidth - t.x), Math.max(t.y, innerHeight - t.y)), s = ce(e, o.value) === "dark", c = document.documentElement;
260
- c.dataset.caThemeTransition = s ? "to-dark" : "to-light";
72
+ let a = Math.hypot(Math.max(t.x, innerWidth - t.x), Math.max(t.y, innerHeight - t.y)), o = Se(e, s.value) === "dark", c = document.documentElement;
73
+ c.dataset.caThemeTransition = o ? "to-dark" : "to-light";
261
74
  let l = !1, u = () => {
262
- l || (l = !0, _(e));
263
- }, f = n.startViewTransition(async () => {
264
- u(), await m();
75
+ l || (l = !0, y(e));
76
+ }, d = n.startViewTransition(async () => {
77
+ u(), await I();
265
78
  });
266
79
  setTimeout(u, 300);
267
- let p = () => delete c.dataset.caThemeTransition;
268
- setTimeout(p, 2e3), f.finished?.then(p, p), f.ready.then(() => {
80
+ let f = () => delete c.dataset.caThemeTransition;
81
+ setTimeout(f, 2e3), d.finished?.then(f, f), d.ready.then(() => {
269
82
  let e = `circle(${a}px at ${t.x}px ${t.y}px)`, n = `circle(0px at ${t.x}px ${t.y}px)`;
270
- c.animate({ clipPath: s ? [e, n] : [n, e] }, {
83
+ c.animate({ clipPath: o ? [e, n] : [n, e] }, {
271
84
  duration: 450,
272
85
  easing: "ease-in-out",
273
- pseudoElement: s ? "::view-transition-old(root)" : "::view-transition-new(root)"
86
+ pseudoElement: o ? "::view-transition-old(root)" : "::view-transition-new(root)"
274
87
  });
275
88
  }).catch(() => {});
276
89
  }
277
- function y(t, n = !0) {
278
- e.value = t, n && ye(g(), t);
90
+ function x(t, n = !0) {
91
+ e.value = t, n && u(v(), t);
279
92
  }
280
- async function b() {
281
- let t = ve(g());
282
- t && (e.value = t);
283
- let n = J().theme?.load;
284
- if (n) {
93
+ async function S() {
94
+ let n = t(v());
95
+ n && (e.value = n);
96
+ let r = f().theme?.load;
97
+ if (r) {
285
98
  try {
286
- y(await n());
99
+ x(await r());
287
100
  } catch (e) {
288
101
  console.warn("[campus] 加载站点主题失败,继续使用缓存或默认主题:", e);
289
102
  }
290
- u.value.length && console.warn("[campus] 主题配置有被忽略的字段:", u.value);
103
+ p.value.length && console.warn("[campus] 主题配置有被忽略的字段:", p.value);
291
104
  }
292
105
  }
293
106
  return {
294
107
  layers: e,
295
- mode: t,
296
- boxStyle: r,
297
- setBoxStyle: h,
298
- userPrimary: i,
299
- primaryLocked: c,
300
- setPrimary: p,
301
- theme: l,
302
- issues: u,
303
- effectiveMode: d,
304
- cssVars: f,
305
- setMode: v,
306
- setLayers: y,
307
- boot: b
108
+ mode: r,
109
+ boxStyle: i,
110
+ setBoxStyle: _,
111
+ userPrimary: a,
112
+ primaryLocked: l,
113
+ setPrimary: g,
114
+ theme: d,
115
+ issues: p,
116
+ effectiveMode: m,
117
+ cssVars: h,
118
+ setMode: b,
119
+ setLayers: x,
120
+ boot: S
308
121
  };
309
122
  });
310
123
  // packages/core/src/copyright.ts
311
- function We(e, t = (/* @__PURE__ */ new Date()).getFullYear()) {
124
+ function Pe(e, t = (/* @__PURE__ */ new Date()).getFullYear()) {
312
125
  return e.replaceAll("{year}", String(t));
313
126
  }
314
127
  // packages/core/src/pages/auth/options.ts
315
- var Ge = /^1[3-9]\d{9}$/;
316
- function X() {
317
- return J().login ?? {};
128
+ var Fe = /^1[3-9]\d{9}$/;
129
+ function Ie() {
130
+ return f().login ?? {};
318
131
  }
319
- function Ke() {
320
- let e = J().auth;
132
+ function Le() {
133
+ let e = f().auth;
321
134
  return {
322
135
  captcha: typeof e.captcha == "function",
323
136
  register: typeof e.register == "function" && typeof e.sendSmsCode == "function",
@@ -325,37 +138,37 @@ function Ke() {
325
138
  forgot: typeof e.resetPassword == "function" && typeof e.sendSmsCode == "function"
326
139
  };
327
140
  }
328
- function qe(e) {
329
- return typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : Fe(J()).home;
141
+ function Re(e) {
142
+ return typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : m(f()).home;
330
143
  }
331
144
  // packages/core/src/pages/auth/AuthShell.vue?vue&type=script&setup=true&lang.ts
332
- var Je = {
145
+ var ze = {
333
146
  key: 0,
334
147
  class: "ca-auth__title"
335
- }, Ye = ["src"], Xe = { class: "ca-auth__qrcode" }, Ze = ["src", "alt"], Qe = {
148
+ }, Be = ["src"], Ve = { class: "ca-auth__qrcode" }, He = ["src", "alt"], Ue = {
336
149
  key: 0,
337
150
  class: "ca-auth__caption"
338
- }, $e = { class: "ca-auth__site" }, et = {
151
+ }, We = { class: "ca-auth__site" }, Ge = {
339
152
  key: 0,
340
153
  class: "ca-auth__caption"
341
- }, tt = { class: "ca-auth__main" }, nt = { class: "ca-auth__brand" }, rt = ["src"], it = {
154
+ }, Ke = { class: "ca-auth__main" }, qe = { class: "ca-auth__brand" }, Je = ["src"], Ye = {
342
155
  class: "ca-auth__tabs",
343
156
  role: "tablist"
344
- }, at = [
157
+ }, Xe = [
345
158
  "aria-selected",
346
159
  "tabindex",
347
160
  "onClick",
348
161
  "onKeydown"
349
- ], ot = {
162
+ ], Ze = {
350
163
  class: "ca-auth__body",
351
164
  role: "tabpanel"
352
- }, st = {
165
+ }, Qe = {
353
166
  key: 0,
354
167
  class: "ca-auth__footer"
355
- }, ct = {
168
+ }, $e = {
356
169
  key: 0,
357
170
  class: "ca-auth__version"
358
- }, lt = /*@__PURE__*/ d({
171
+ }, et = /*#__PURE__*/ s(/* @__PURE__ */ N({
359
172
  __name: "AuthShell",
360
173
  props: {
361
174
  tabs: {},
@@ -363,344 +176,71 @@ var Je = {
363
176
  preview: { type: Boolean }
364
177
  },
365
178
  emits: ["update:active"],
366
- setup(t, { emit: r }) {
367
- let c = t, u = r, { t: d, label: f } = q(), p = J().brand, m = X(), _ = Ue(), v = n(() => f(_.theme.siteName ?? p.name)), b = n(() => _.theme.logo ?? p.logo), x = n(() => m.panel?.logo ?? b.value), w = n(() => m.panel?.qrcode), T = n(() => {
368
- let e = m.panel?.caption ?? p.subtitle;
369
- return e ? f(e) : "";
370
- }), O = n(() => m.panel?.title ? f(m.panel.title) : ""), k = n(() => m.panel?.background), A = (e) => typeof e == "number" && Number.isFinite(e) && e > 0 ? `${e}px` : typeof e == "string" && /^[\d.]+(px|rem|em|%)$/.test(e) ? e : void 0, j = n(() => {
371
- let e = m.card, t = {}, n = A(e?.width), r = A(e?.minHeight), i = A(e?.panelWidth), a = A(e?.radius);
179
+ setup(e, { emit: t }) {
180
+ let n = e, r = t, { t: i, label: a } = c(), o = f().brand, s = Ie(), l = Ne(), u = w(() => a(l.theme.siteName ?? o.name)), d = w(() => l.theme.logo ?? o.logo), p = w(() => s.panel?.logo ?? d.value), m = w(() => s.panel?.qrcode), h = w(() => {
181
+ let e = s.panel?.caption ?? o.subtitle;
182
+ return e ? a(e) : "";
183
+ }), g = w(() => s.panel?.title ? a(s.panel.title) : ""), _ = w(() => s.panel?.background), v = (e) => typeof e == "number" && Number.isFinite(e) && e > 0 ? `${e}px` : typeof e == "string" && /^[\d.]+(px|rem|em|%)$/.test(e) ? e : void 0, y = w(() => {
184
+ let e = s.card, t = {}, n = v(e?.width), r = v(e?.minHeight), i = v(e?.panelWidth), a = v(e?.radius);
372
185
  return n && (t["--ca-auth-card-width"] = n), r && (t["--ca-auth-card-min-height"] = r), i && (t["--ca-auth-panel-width"] = i), a && (t["--ca-auth-card-radius"] = a), t;
373
- }), M = n(() => m.background ?? "var(--ca-login-bg)"), P = n(() => m.footer ? m.footer.map((e) => We(f(e))) : p.copyright ? We(f(p.copyright)).split("\n").filter(Boolean) : []);
374
- function F(e, t) {
186
+ }), b = w(() => s.background ?? "var(--ca-login-bg)"), x = w(() => s.footer ? s.footer.map((e) => Pe(a(e))) : o.copyright ? Pe(a(o.copyright)).split("\n").filter(Boolean) : []);
187
+ function C(e, t) {
375
188
  if (e.key !== "ArrowRight" && e.key !== "ArrowLeft") return;
376
- let n = (t + (e.key === "ArrowRight" ? 1 : -1) + c.tabs.length) % c.tabs.length, r = c.tabs[n];
377
- r.to || u("update:active", r.key), e.currentTarget.parentElement?.querySelectorAll("[role=tab]")[n]?.focus(), e.preventDefault();
189
+ let i = (t + (e.key === "ArrowRight" ? 1 : -1) + n.tabs.length) % n.tabs.length, a = n.tabs[i];
190
+ a.to || r("update:active", a.key), e.currentTarget.parentElement?.querySelectorAll("[role=tab]")[i]?.focus(), e.preventDefault();
378
191
  }
379
- return (n, r) => (y(), o("div", { class: h(["ca-auth", { "ca-auth--preview": t.preview }]) }, [s("div", {
192
+ return (t, n) => (V(), O("div", { class: L(["ca-auth", { "ca-auth--preview": e.preview }]) }, [k("div", {
380
193
  class: "ca-auth__stage",
381
- style: g({ background: M.value })
382
- }, [s("div", {
194
+ style: R({ background: b.value })
195
+ }, [k("div", {
383
196
  class: "ca-auth__card",
384
- style: g(j.value)
385
- }, [s("aside", {
197
+ style: R(y.value)
198
+ }, [k("aside", {
386
199
  class: "ca-auth__panel",
387
- style: g(k.value ? { background: k.value } : void 0)
200
+ style: R(_.value ? { background: _.value } : void 0)
388
201
  }, [
389
- O.value && w.value ? (y(), o("h2", Je, E(O.value), 1)) : a("v-if", !0),
390
- x.value ? (y(), o("img", {
202
+ g.value && m.value ? (V(), O("h2", ze, K(g.value), 1)) : D("v-if", !0),
203
+ p.value ? (V(), O("img", {
391
204
  key: 1,
392
- src: x.value,
205
+ src: p.value,
393
206
  alt: "",
394
207
  class: "ca-auth__logo"
395
- }, null, 8, Ye)) : a("v-if", !0),
396
- w.value ? (y(), o(e, { key: 2 }, [s("div", Xe, [s("img", {
397
- src: w.value,
398
- alt: D(d)("campus.auth.qrcodeAlt")
399
- }, null, 8, Ze)]), T.value ? (y(), o("p", Qe, E(T.value), 1)) : a("v-if", !0)], 64)) : (y(), o(e, { key: 3 }, [s("h2", $e, E(O.value || v.value), 1), T.value ? (y(), o("p", et, E(T.value), 1)) : a("v-if", !0)], 64))
400
- ], 4), s("section", tt, [
401
- s("div", nt, [b.value ? (y(), o("img", {
208
+ }, null, 8, Be)) : D("v-if", !0),
209
+ m.value ? (V(), O(S, { key: 2 }, [k("div", Ve, [k("img", {
210
+ src: m.value,
211
+ alt: q(i)("campus.auth.qrcodeAlt")
212
+ }, null, 8, He)]), h.value ? (V(), O("p", Ue, K(h.value), 1)) : D("v-if", !0)], 64)) : (V(), O(S, { key: 3 }, [k("h2", We, K(g.value || u.value), 1), h.value ? (V(), O("p", Ge, K(h.value), 1)) : D("v-if", !0)], 64))
213
+ ], 4), k("section", Ke, [
214
+ k("div", qe, [d.value ? (V(), O("img", {
402
215
  key: 0,
403
- src: b.value,
216
+ src: d.value,
404
217
  alt: ""
405
- }, null, 8, rt)) : a("v-if", !0), s("span", null, E(v.value), 1)]),
406
- s("div", it, [(y(!0), o(e, null, S(t.tabs, (n, r) => (y(), o(e, { key: n.key }, [n.to && !t.preview ? (y(), i(D(ne), {
218
+ }, null, 8, Je)) : D("v-if", !0), k("span", null, K(u.value), 1)]),
219
+ k("div", Ye, [(V(!0), O(S, null, U(e.tabs, (t, n) => (V(), O(S, { key: t.key }, [t.to && !e.preview ? (V(), E(q(pe), {
407
220
  key: 0,
408
- to: n.to,
221
+ to: t.to,
409
222
  role: "tab",
410
223
  "aria-selected": "false",
411
224
  class: "ca-auth__tab",
412
- onKeydown: (e) => F(e, r)
225
+ onKeydown: (e) => C(e, n)
413
226
  }, {
414
- default: N(() => [l(E(n.label), 1)]),
227
+ default: Y(() => [j(K(t.label), 1)]),
415
228
  _: 2
416
- }, 1032, ["to", "onKeydown"])) : (y(), o("button", {
229
+ }, 1032, ["to", "onKeydown"])) : (V(), O("button", {
417
230
  key: 1,
418
231
  type: "button",
419
232
  role: "tab",
420
- class: h(["ca-auth__tab", { "ca-auth__tab--active": n.key === t.active }]),
421
- "aria-selected": n.key === t.active,
422
- tabindex: n.key === t.active ? 0 : -1,
423
- onClick: (e) => n.to ? void 0 : u("update:active", n.key),
424
- onKeydown: (e) => F(e, r)
425
- }, E(n.label), 43, at))], 64))), 128))]),
426
- s("div", ot, [C(n.$slots, "default", {}, void 0, !0)]),
427
- P.value.length ? (y(), o("div", st, [(y(!0), o(e, null, S(P.value, (e) => (y(), o("p", { key: e }, E(e), 1))), 128))])) : a("v-if", !0)
428
- ])], 4), D(m).version ? (y(), o("span", ct, E(D(m).version), 1)) : a("v-if", !0)], 4)], 2));
429
- }
430
- }), Z = (e, t) => {
431
- let n = e.__vccOpts || e;
432
- for (let [e, r] of t) n[e] = r;
433
- return n;
434
- }, ut = /*#__PURE__*/ Z(lt, [["__scopeId", "data-v-3545cdf2"]]), dt = "side-collapsed", ft = L("campus-layout", () => {
435
- let e = x(!1), t = x("desktop"), r = x(!1), i = x(!1), a = x(_e(dt) === "1"), o = x(null), s = n(() => o.value ?? a.value), c = x(!1), l = n(() => c.value && t.value === "desktop"), u = x({}), d = x({}), f;
436
- function p(e, t = !1) {
437
- f = e, e && !t && (o.value = u.value[e] ?? !1);
438
- }
439
- function m(e, t) {
440
- d.value[e] = t;
441
- }
442
- function h(e) {
443
- e in d.value || m(e, !0);
444
- }
445
- async function g(e, n, r) {
446
- e.path && n !== e.path ? (await r(e.path), m(e.key, !0), t.value === "phone" ? V() : t.value === "pad" && re()) : m(e.key, !(d.value[e.key] ?? !1));
447
- }
448
- async function _(e, n, r, a) {
449
- if (e.path) {
450
- if (e.path !== n) {
451
- await r(e.path);
452
- let n = e.openMode == null ? e.sideCollapse === "panel" || e.sideCollapse === "all" : e.openMode !== "normal";
453
- a && e.children.length && t.value === "desktop" && !n && (o.value = !1, u.value[e.key] = !1);
454
- } else e.children.length && (t.value === "desktop" ? v() : t.value === "pad" && (i.value = !i.value));
455
- e.path !== n && e.children.length && t.value === "pad" && re(), e.children.length && t.value === "phone" && V(), e.children.length || H();
456
- } else t.value === "pad" ? i.value = !(a && i.value) : t.value === "desktop" && s.value && v();
457
- }
458
- function v() {
459
- o.value === null ? (a.value = !a.value, K(dt, a.value ? "1" : "0")) : (o.value = !o.value, f && (u.value[f] = o.value));
460
- }
461
- function y() {
462
- c.value = !1, o.value = null;
463
- }
464
- function b(e = "none") {
465
- o.value = e === "panel" || null, c.value = e === "all";
466
- }
467
- let S = "normal", C = null, w = !1, T, E = !1, D = !1, O = !1, k = x(!1);
468
- function A() {
469
- C !== null && (e.value = C);
470
- }
471
- function j() {
472
- w && document.fullscreenElement === document.documentElement && (w = !1, document.exitFullscreen().catch(() => {
473
- w = document.fullscreenElement === document.documentElement;
474
- }).finally(() => {
475
- S === "screen" && !document.fullscreenElement && (D = !0, M());
476
- }));
477
- }
478
- function M() {
479
- E || (S === "screen" ? O || (D || !document.fullscreenElement ? (e.value = !0, k.value = !0) : (A(), k.value = !1)) : j());
480
- }
481
- function N() {
482
- if (E = !0, document.fullscreenElement) D = !1;
483
- else if (!T) {
484
- D = !1;
485
- try {
486
- T = document.documentElement.requestFullscreen().then(() => {
487
- D = !1, w = document.fullscreenElement === document.documentElement;
488
- }, () => {
489
- D = !0;
490
- }).finally(() => {
491
- T = void 0, M();
492
- });
493
- } catch {
494
- D = !0;
495
- }
496
- }
497
- }
498
- function P() {
499
- E = !1, S !== "screen" && j();
500
- }
501
- function F(t, n) {
502
- S = t ?? "normal", O = !1, k.value = !1, b(t == null ? n : t === "collapsePanel" ? "panel" : t === "collapseAll" ? "all" : "none");
503
- let r = S === "content" || S === "screen";
504
- r && C === null && (C = e.value), r || (A(), C = null), S === "content" && (e.value = !0), S === "screen" && !E && N(), E = !1, S === "screen" ? M() : j();
505
- }
506
- function I() {
507
- O = !0, w = !1, k.value = !1;
508
- }
509
- function L() {
510
- w && document.fullscreenElement !== document.documentElement && (w = !1, O = !0, k.value = !1);
511
- }
512
- function R() {
513
- O = !1, N(), E = !1, T || M();
514
- }
515
- function z() {
516
- k.value = !1;
517
- }
518
- function ee() {
519
- O = !0, k.value = !1, e.value = !e.value;
520
- }
521
- function te(e) {
522
- t.value = e, e !== "phone" && (r.value = !1), e !== "pad" && (i.value = !1);
523
- }
524
- function B() {
525
- r.value = !1;
526
- }
527
- function V() {
528
- r.value = !0;
529
- }
530
- function ne() {
531
- i.value = !1;
532
- }
533
- function re() {
534
- i.value = !0;
535
- }
536
- function H() {
537
- r.value = !1, i.value = !1;
538
- }
539
- function U() {
540
- F("normal"), e.value = !1, b("none"), H(), u.value = {}, d.value = {}, f = void 0;
541
- }
542
- return {
543
- enterParentPage: p,
544
- menuGroups: d,
545
- ensureMenuGroup: h,
546
- setMenuGroup: m,
547
- clickMenuApp: _,
548
- clickMenuGroup: g,
549
- reset: U,
550
- pageScreenPrompt: k,
551
- preparePageScreen: N,
552
- cancelPageScreen: P,
553
- applyPageOpenMode: F,
554
- pageScreenManual: I,
555
- syncPageScreen: L,
556
- retryPageScreen: R,
557
- dismissPageScreenPrompt: z,
558
- contentFullscreen: e,
559
- mode: t,
560
- mobileMenuOpen: r,
561
- padPanelOpen: i,
562
- sidePanelSaved: a,
563
- sidePanelTemp: o,
564
- sidePanelCollapsed: s,
565
- sideHidden: c,
566
- sideHiddenActive: l,
567
- toggleSidePanel: v,
568
- showSide: y,
569
- applySideCollapse: b,
570
- toggleContentFullscreen: ee,
571
- setMode: te,
572
- closeMobileMenu: B,
573
- openMobileMenu: V,
574
- closePadPanel: ne,
575
- openPadPanel: re,
576
- closeOverlays: H
577
- };
578
- });
579
- // packages/core/src/tabs-policy.ts
580
- function pt(e, t, n = Date.now()) {
581
- return {
582
- ...e,
583
- [t]: Math.max(n, ...Object.values(e).map((e) => e + 1))
584
- };
585
- }
586
- function mt(e, t, n, r, i) {
587
- let a = e.filter((e) => !r.includes(e));
588
- if (!(a.length <= i)) return a.filter((e) => e !== n).reduce((e, n) => e === void 0 || (t[n] ?? 0) < (t[e] ?? 0) ? n : e, void 0);
589
- }
590
- // packages/core/src/stores/tabs.ts
591
- var ht = "tabs", gt = L("campus-tabs", () => {
592
- let e = Pe(J().menus), t = new Set(e.map((e) => e.key)), r = e.filter((e) => e.affix).map((e) => e.key), i = ve(ht, "session"), a = !Array.isArray(i) && Array.isArray(i?.affix) ? i.affix : [], o = x(a.filter((e) => t.has(e) && !r.includes(e))), s = n(() => [...r, ...o.value]), c = J().maxTabs, l = typeof c == "number" && Number.isFinite(c) ? Math.max(1, Math.floor(c)) : 20, u = (Array.isArray(i) ? i : Array.isArray(i?.visited) ? i.visited : []).filter((e) => typeof e == "string" && t.has(e)), d = x([.../* @__PURE__ */ new Set([...s.value, ...u])]), f = !Array.isArray(i) && i?.active && typeof i.active == "object" ? i.active : {}, p = x(Object.fromEntries(Object.entries(f).filter(([e, n]) => t.has(e) && typeof n == "number" && Number.isFinite(n))));
593
- for (let [e, t] of d.value.entries()) Number.isFinite(p.value[t]) || (p.value[t] = e + 1);
594
- for (;;) {
595
- let e = mt(d.value, p.value, "", s.value, l);
596
- if (!e) break;
597
- d.value.splice(d.value.indexOf(e), 1), delete p.value[e];
598
- }
599
- let h = x({}), g = x(null), _ = n(() => d.value.filter((e) => e !== g.value));
600
- function v() {
601
- p.value = Object.fromEntries(d.value.map((e) => [e, p.value[e] ?? 0])), ye(ht, {
602
- visited: d.value,
603
- active: p.value,
604
- affix: o.value
605
- }, "session");
606
- }
607
- function y(e) {
608
- if (!t.has(e)) return;
609
- d.value.includes(e) || d.value.push(e), p.value = pt(p.value, e);
610
- let n = mt(d.value, p.value, e, s.value, l);
611
- n && d.value.splice(d.value.indexOf(n), 1), v();
612
- }
613
- function b(e) {
614
- if (s.value.includes(e)) return;
615
- let t = d.value.indexOf(e);
616
- if (t !== -1) return d.value.splice(t, 1), v(), d.value[t] ?? d.value[t - 1];
617
- }
618
- function S(e) {
619
- d.value = d.value.filter((t) => t === e || s.value.includes(t)), v();
620
- }
621
- function C(e) {
622
- let t = d.value.indexOf(e);
623
- t !== -1 && (d.value = d.value.filter((e, n) => n >= t || s.value.includes(e)), v());
624
- }
625
- function w(e) {
626
- let t = d.value.indexOf(e);
627
- t !== -1 && (d.value = d.value.filter((e, n) => n <= t || s.value.includes(e)), v());
628
- }
629
- function T() {
630
- d.value = [...s.value], v();
631
- }
632
- async function E(e) {
633
- g.value = e, await m(), h.value[e] = (h.value[e] ?? 0) + 1, g.value = null;
634
- }
635
- function D(e, n) {
636
- return !t.has(e) || r.includes(e) || n && !d.value.includes(e) ? !1 : (n && !o.value.includes(e) && o.value.push(e), n || (o.value = o.value.filter((t) => t !== e)), v(), !0);
637
- }
638
- function O() {
639
- o.value = [], d.value = [...r], p.value = {}, h.value = {}, g.value = null, v();
640
- }
641
- return {
642
- reset: O,
643
- visited: d,
644
- versions: h,
645
- cached: _,
646
- affixKeys: s,
647
- activeAt: p,
648
- maxTabs: l,
649
- open: y,
650
- close: b,
651
- closeLeft: C,
652
- closeRight: w,
653
- closeOthers: S,
654
- closeAll: T,
655
- refresh: E,
656
- setAffix: D
657
- };
658
- }), _t = "session", Q = L("campus-session", () => {
659
- let e = ve(_t, "session"), t = x(e?.token ?? ""), r = x(e?.user), i = n(() => !!(t.value && r.value));
660
- function a(e) {
661
- if (!e) return !0;
662
- let t = r.value?.permissions;
663
- return t === "*" || !!t?.includes(e);
664
- }
665
- function o(e) {
666
- r.value && (r.value = {
667
- ...r.value,
668
- permissions: e
669
- }, ye(_t, {
670
- token: t.value,
671
- user: r.value
672
- }, "session"));
673
- }
674
- async function s(e) {
675
- c(await J().auth.login(e));
676
- }
677
- function c(e) {
678
- t.value = e.token, r.value = e.user, ye(_t, e, "session");
679
- }
680
- async function l() {
681
- try {
682
- await J().auth.logout?.();
683
- } catch (e) {
684
- console.warn("[campus] 退出时通知服务端失败,已清除本地登录态:", e);
685
- } finally {
686
- t.value = "", r.value = void 0, K(_t, null, "session"), gt().reset(), ft().reset();
687
- }
688
- }
689
- function u() {
690
- t.value = "", r.value = void 0, K(_t, null, "session"), gt().reset(), ft().reset();
691
- }
692
- return {
693
- token: t,
694
- user: r,
695
- isLoggedIn: i,
696
- can: a,
697
- setPermissions: o,
698
- login: s,
699
- signIn: c,
700
- logout: l,
701
- expire: u
702
- };
703
- }), vt = {
233
+ class: L(["ca-auth__tab", { "ca-auth__tab--active": t.key === e.active }]),
234
+ "aria-selected": t.key === e.active,
235
+ tabindex: t.key === e.active ? 0 : -1,
236
+ onClick: (e) => t.to ? void 0 : r("update:active", t.key),
237
+ onKeydown: (e) => C(e, n)
238
+ }, K(t.label), 43, Xe))], 64))), 128))]),
239
+ k("div", Ze, [ne(t.$slots, "default", {}, void 0, !0)]),
240
+ x.value.length ? (V(), O("div", Qe, [(V(!0), O(S, null, U(x.value, (e) => (V(), O("p", { key: e }, K(e), 1))), 128))])) : D("v-if", !0)
241
+ ])], 4), q(s).version ? (V(), O("span", $e, K(q(s).version), 1)) : D("v-if", !0)], 4)], 2));
242
+ }
243
+ }), [["__scopeId", "data-v-3545cdf2"]]), tt = {
704
244
  class: "ca-auth-icon",
705
245
  viewBox: "0 0 24 24",
706
246
  width: "16",
@@ -711,7 +251,7 @@ var ht = "tabs", gt = L("campus-tabs", () => {
711
251
  "stroke-linecap": "round",
712
252
  "stroke-linejoin": "round",
713
253
  "aria-hidden": "true"
714
- }, yt = ["d"], $ = /* @__PURE__ */ d({
254
+ }, nt = ["d"], $ = /* @__PURE__ */ N({
715
255
  __name: "AuthIcon",
716
256
  props: { name: {} },
717
257
  setup(e) {
@@ -722,15 +262,15 @@ var ht = "tabs", gt = L("campus-tabs", () => {
722
262
  shield: "M12 3l7 3v5c0 4.5-3 8-7 10-4-2-7-5.500-7-10V6l7-3Zm-3 9 2.500 2.500L15 10",
723
263
  message: "M4 5h16v11H9l-4 3.500V16H4z"
724
264
  };
725
- return (n, r) => (y(), o("svg", vt, [s("path", { d: t[e.name] }, null, 8, yt)]));
265
+ return (n, r) => (V(), O("svg", tt, [k("path", { d: t[e.name] }, null, 8, nt)]));
726
266
  }
727
- }), bt = { class: "ca-auth-row" }, xt = [
267
+ }), rt = { class: "ca-auth-row" }, it = [
728
268
  "title",
729
269
  "aria-label",
730
270
  "disabled"
731
- ], St = ["src"], Ct = { key: 1 }, wt = /*#__PURE__*/ Z(/* @__PURE__ */ d({
271
+ ], at = ["src"], ot = { key: 1 }, st = /*#__PURE__*/ s(/* @__PURE__ */ N({
732
272
  __name: "CaptchaField",
733
- props: /*@__PURE__*/ p({
273
+ props: /*@__PURE__*/ F({
734
274
  scene: {},
735
275
  inputId: {},
736
276
  inputErrorId: {}
@@ -742,33 +282,33 @@ var ht = "tabs", gt = L("campus-tabs", () => {
742
282
  }),
743
283
  emits: ["update:code", "update:captchaKey"],
744
284
  setup(e, { expose: t }) {
745
- let n = e, r = k(e, "code"), i = k(e, "captchaKey"), { t: c, label: l } = q(), d = X().fields?.captcha, f = x(""), p = x(!1), m = x(!1);
746
- async function g() {
747
- m.value = !0;
285
+ let n = e, r = ae(e, "code"), i = ae(e, "captchaKey"), { t: a, label: o } = c(), s = Ie().fields?.captcha, l = H(""), u = H(!1), d = H(!1);
286
+ async function p() {
287
+ d.value = !0;
748
288
  try {
749
- let e = await J().auth.captcha(n.scene);
750
- i.value = e.key, f.value = e.image, p.value = !1;
289
+ let e = await f().auth.captcha(n.scene);
290
+ i.value = e.key, l.value = e.image, u.value = !1;
751
291
  } catch {
752
- f.value = "", p.value = !0;
292
+ l.value = "", u.value = !0;
753
293
  } finally {
754
- r.value = "", m.value = !1;
294
+ r.value = "", d.value = !1;
755
295
  }
756
296
  }
757
- return v(g), t({ refresh: g }), (t, n) => {
758
- let i = w("ca-input");
759
- return y(), o("div", bt, [u(i, {
297
+ return B(p), t({ refresh: p }), (t, n) => {
298
+ let i = W("ca-input");
299
+ return V(), O("div", rt, [M(i, {
760
300
  modelValue: r.value,
761
301
  "onUpdate:modelValue": n[0] ||= (e) => r.value = e,
762
302
  id: e.inputId,
763
- class: h({ "ca-auth-captcha__input": e.inputId }),
764
- placeholder: D(d)?.placeholder ? D(l)(D(d).placeholder) : e.inputId ? void 0 : D(c)("campus.auth.captchaPlaceholder"),
765
- "aria-label": e.inputId ? void 0 : D(c)("campus.auth.captcha"),
303
+ class: L({ "ca-auth-captcha__input": e.inputId }),
304
+ placeholder: q(s)?.placeholder ? q(o)(q(s).placeholder) : e.inputId ? void 0 : q(a)("campus.auth.captchaPlaceholder"),
305
+ "aria-label": e.inputId ? void 0 : q(a)("campus.auth.captcha"),
766
306
  "aria-invalid": e.inputErrorId ? "true" : void 0,
767
307
  "aria-describedby": e.inputErrorId,
768
308
  autocomplete: "off",
769
- maxlength: D(d)?.maxlength ?? 8
309
+ maxlength: q(s)?.maxlength ?? 8
770
310
  }, {
771
- prefix: N(() => [u($, { name: "shield" })]),
311
+ prefix: Y(() => [M($, { name: "shield" })]),
772
312
  _: 1
773
313
  }, 8, [
774
314
  "modelValue",
@@ -779,118 +319,118 @@ var ht = "tabs", gt = L("campus-tabs", () => {
779
319
  "aria-invalid",
780
320
  "aria-describedby",
781
321
  "maxlength"
782
- ]), s("button", {
322
+ ]), k("button", {
783
323
  type: "button",
784
324
  class: "ca-auth-captcha",
785
- title: D(c)("campus.auth.captchaRefresh"),
786
- "aria-label": D(c)("campus.auth.captchaRefresh"),
787
- disabled: m.value,
788
- onClick: g
789
- }, [f.value ? (y(), o("img", {
325
+ title: q(a)("campus.auth.captchaRefresh"),
326
+ "aria-label": q(a)("campus.auth.captchaRefresh"),
327
+ disabled: d.value,
328
+ onClick: p
329
+ }, [l.value ? (V(), O("img", {
790
330
  key: 0,
791
- src: f.value,
331
+ src: l.value,
792
332
  alt: ""
793
- }, null, 8, St)) : p.value ? (y(), o("span", Ct, E(D(c)("campus.auth.captchaFailed")), 1)) : a("v-if", !0)], 8, xt)]);
333
+ }, null, 8, at)) : u.value ? (V(), O("span", ot, K(q(a)("campus.auth.captchaFailed")), 1)) : D("v-if", !0)], 8, it)]);
794
334
  };
795
335
  }
796
- }), [["__scopeId", "data-v-bd481e4d"]]), Tt = {
336
+ }), [["__scopeId", "data-v-bd481e4d"]]), ct = {
797
337
  key: 1,
798
338
  class: "ca-auth-links"
799
- }, Et = { class: "ca-auth-help" }, Dt = /* @__PURE__ */ d({
339
+ }, lt = { class: "ca-auth-help" }, ut = /* @__PURE__ */ N({
800
340
  __name: "LoginForm",
801
341
  props: { preview: { type: Boolean } },
802
- setup(t) {
803
- let r = t, c = W(), d = G(), f = Q(), { t: p, label: m } = q(), h = Ke(), g = X(), _ = g.fields ?? {}, v = b({
342
+ setup(e) {
343
+ let t = e, n = _e(), r = Q(), i = b(), { t: a, label: o } = c(), s = Le(), l = Ie(), u = l.fields ?? {}, p = te({
804
344
  username: "",
805
345
  password: "",
806
346
  captcha: ""
807
- }), C = x(""), T = x(), O = x(), k = x(!1), A = x(""), j = x("error"), M = n(() => ({
347
+ }), m = H(""), h = H(), g = H(), _ = H(!1), v = H(""), y = H("error"), x = w(() => ({
808
348
  username: [{
809
349
  required: !0,
810
- message: p("campus.login.required", { label: p("campus.login.username") }),
350
+ message: a("campus.login.required", { label: a("campus.login.username") }),
811
351
  trigger: "blur"
812
352
  }],
813
353
  password: [{
814
354
  required: !0,
815
- message: p("campus.login.required", { label: p("campus.login.password") }),
355
+ message: a("campus.login.required", { label: a("campus.login.password") }),
816
356
  trigger: "blur"
817
357
  }],
818
- captcha: h.captcha ? [{
358
+ captcha: s.captcha ? [{
819
359
  required: !0,
820
- message: p("campus.auth.captchaRequired"),
360
+ message: a("campus.auth.captchaRequired"),
821
361
  trigger: "blur"
822
362
  }] : []
823
- })), P = n(() => (g.helps ?? [
363
+ })), C = w(() => (l.helps ?? [
824
364
  1,
825
365
  2,
826
366
  3,
827
367
  4
828
- ].map((e) => `campus.auth.help${e}`)).map((e) => m(e).split("{forgot}").flatMap((e, t, n) => t < n.length - 1 ? [e, null] : [e])));
829
- function I(e) {
830
- _.username?.digitsOnly && /\D/.test(e) && (v.username = e.replace(/\D/g, ""));
368
+ ].map((e) => `campus.auth.help${e}`)).map((e) => o(e).split("{forgot}").flatMap((e, t, n) => t < n.length - 1 ? [e, null] : [e])));
369
+ function T(e) {
370
+ u.username?.digitsOnly && /\D/.test(e) && (p.username = e.replace(/\D/g, ""));
831
371
  }
832
- async function L() {
372
+ async function A() {
833
373
  try {
834
- await O.value?.validate();
374
+ await g.value?.validate();
835
375
  } catch {
836
376
  return;
837
377
  }
838
- if (r.preview) j.value = "info", A.value = p("campus.auth.previewNote");
378
+ if (t.preview) y.value = "info", v.value = a("campus.auth.previewNote");
839
379
  else {
840
- k.value = !0, A.value = "", j.value = "error";
380
+ _.value = !0, v.value = "", y.value = "error";
841
381
  try {
842
- await f.login({
843
- username: v.username,
844
- password: v.password,
845
- captcha: h.captcha ? {
846
- key: C.value,
847
- code: v.captcha
382
+ await i.login({
383
+ username: p.username,
384
+ password: p.password,
385
+ captcha: s.captcha ? {
386
+ key: m.value,
387
+ code: p.captcha
848
388
  } : void 0
849
- }), await d.replace(qe(c.query.redirect));
389
+ }), await r.replace(Re(n.query.redirect));
850
390
  } catch (e) {
851
- A.value = e instanceof Error && e.message ? e.message : p("campus.login.failed"), T.value?.refresh();
391
+ v.value = e instanceof Error && e.message ? e.message : a("campus.login.failed"), h.value?.refresh();
852
392
  } finally {
853
- k.value = !1;
393
+ _.value = !1;
854
394
  }
855
395
  }
856
396
  }
857
- function R(e) {
858
- r.preview && e.preventDefault();
397
+ function ee(e) {
398
+ t.preview && e.preventDefault();
859
399
  }
860
- let z = n(() => h.forgot || h.register);
861
- return (t, n) => {
862
- let r = w("ca-alert"), c = w("ca-input"), d = w("ca-form-item"), f = w("ca-button"), g = w("ca-form");
863
- return y(), o(e, null, [
864
- A.value ? (y(), i(r, {
400
+ let N = w(() => s.forgot || s.register);
401
+ return (e, t) => {
402
+ let n = W("ca-alert"), r = W("ca-input"), i = W("ca-form-item"), c = W("ca-button"), l = W("ca-form");
403
+ return V(), O(S, null, [
404
+ v.value ? (V(), E(n, {
865
405
  key: 0,
866
- title: A.value,
867
- type: j.value,
406
+ title: v.value,
407
+ type: y.value,
868
408
  "show-icon": "",
869
409
  closable: !1,
870
410
  class: "ca-auth-alert"
871
- }, null, 8, ["title", "type"])) : a("v-if", !0),
872
- u(g, {
411
+ }, null, 8, ["title", "type"])) : D("v-if", !0),
412
+ M(l, {
873
413
  ref_key: "formRef",
874
- ref: O,
875
- model: v,
876
- rules: M.value,
414
+ ref: g,
415
+ model: p,
416
+ rules: x.value,
877
417
  size: "large",
878
418
  class: "ca-auth-form",
879
- onSubmit: F(L, ["prevent"])
419
+ onSubmit: Z(A, ["prevent"])
880
420
  }, {
881
- default: N(() => [
882
- u(d, { prop: "username" }, {
883
- default: N(() => [u(c, {
884
- modelValue: v.username,
885
- "onUpdate:modelValue": n[0] ||= (e) => v.username = e,
886
- placeholder: D(_).username?.placeholder ? D(m)(D(_).username.placeholder) : D(p)("campus.auth.accountPlaceholder"),
887
- maxlength: D(_).username?.maxlength,
888
- inputmode: D(_).username?.digitsOnly ? "numeric" : void 0,
889
- onInput: I,
890
- "aria-label": D(p)("campus.login.username"),
421
+ default: Y(() => [
422
+ M(i, { prop: "username" }, {
423
+ default: Y(() => [M(r, {
424
+ modelValue: p.username,
425
+ "onUpdate:modelValue": t[0] ||= (e) => p.username = e,
426
+ placeholder: q(u).username?.placeholder ? q(o)(q(u).username.placeholder) : q(a)("campus.auth.accountPlaceholder"),
427
+ maxlength: q(u).username?.maxlength,
428
+ inputmode: q(u).username?.digitsOnly ? "numeric" : void 0,
429
+ onInput: T,
430
+ "aria-label": q(a)("campus.login.username"),
891
431
  autocomplete: "username"
892
432
  }, {
893
- prefix: N(() => [u($, { name: "user" })]),
433
+ prefix: Y(() => [M($, { name: "user" })]),
894
434
  _: 1
895
435
  }, 8, [
896
436
  "modelValue",
@@ -901,18 +441,18 @@ var ht = "tabs", gt = L("campus-tabs", () => {
901
441
  ])]),
902
442
  _: 1
903
443
  }),
904
- u(d, { prop: "password" }, {
905
- default: N(() => [u(c, {
906
- modelValue: v.password,
907
- "onUpdate:modelValue": n[1] ||= (e) => v.password = e,
444
+ M(i, { prop: "password" }, {
445
+ default: Y(() => [M(r, {
446
+ modelValue: p.password,
447
+ "onUpdate:modelValue": t[1] ||= (e) => p.password = e,
908
448
  type: "password",
909
449
  "show-password": "",
910
- maxlength: D(_).password?.maxlength,
911
- placeholder: D(p)("campus.auth.passwordPlaceholder"),
912
- "aria-label": D(p)("campus.login.password"),
450
+ maxlength: q(u).password?.maxlength,
451
+ placeholder: q(a)("campus.auth.passwordPlaceholder"),
452
+ "aria-label": q(a)("campus.login.password"),
913
453
  autocomplete: "current-password"
914
454
  }, {
915
- prefix: N(() => [u($, { name: "lock" })]),
455
+ prefix: Y(() => [M($, { name: "lock" })]),
916
456
  _: 1
917
457
  }, 8, [
918
458
  "modelValue",
@@ -922,63 +462,63 @@ var ht = "tabs", gt = L("campus-tabs", () => {
922
462
  ])]),
923
463
  _: 1
924
464
  }),
925
- D(h).captcha ? (y(), i(d, {
465
+ q(s).captcha ? (V(), E(i, {
926
466
  key: 0,
927
467
  prop: "captcha"
928
468
  }, {
929
- default: N(() => [u(wt, {
469
+ default: Y(() => [M(st, {
930
470
  ref_key: "captchaRef",
931
- ref: T,
932
- code: v.captcha,
933
- "onUpdate:code": n[2] ||= (e) => v.captcha = e,
934
- "captcha-key": C.value,
935
- "onUpdate:captchaKey": n[3] ||= (e) => C.value = e,
471
+ ref: h,
472
+ code: p.captcha,
473
+ "onUpdate:code": t[2] ||= (e) => p.captcha = e,
474
+ "captcha-key": m.value,
475
+ "onUpdate:captchaKey": t[3] ||= (e) => m.value = e,
936
476
  scene: "login"
937
477
  }, null, 8, ["code", "captcha-key"])]),
938
478
  _: 1
939
- })) : a("v-if", !0),
940
- u(f, {
479
+ })) : D("v-if", !0),
480
+ M(c, {
941
481
  type: "primary",
942
482
  "native-type": "submit",
943
483
  size: "large",
944
- loading: k.value,
484
+ loading: _.value,
945
485
  class: "ca-auth-submit"
946
486
  }, {
947
- default: N(() => [l(E(D(p)("campus.login.submit")), 1)]),
487
+ default: Y(() => [j(K(q(a)("campus.login.submit")), 1)]),
948
488
  _: 1
949
489
  }, 8, ["loading"])
950
490
  ]),
951
491
  _: 1
952
492
  }, 8, ["model", "rules"]),
953
- z.value ? (y(), o("div", Tt, [D(h).forgot ? (y(), i(D(ne), {
493
+ N.value ? (V(), O("div", ct, [q(s).forgot ? (V(), E(q(pe), {
954
494
  key: 0,
955
- to: { name: D(Y)(D(J)()).forgot },
956
- onClick: R
495
+ to: { name: q(d)(q(f)()).forgot },
496
+ onClick: ee
957
497
  }, {
958
- default: N(() => [l(E(D(p)("campus.auth.forgotLink")), 1)]),
498
+ default: Y(() => [j(K(q(a)("campus.auth.forgotLink")), 1)]),
959
499
  _: 1
960
- }, 8, ["to"])) : a("v-if", !0), D(h).register ? (y(), i(D(ne), {
500
+ }, 8, ["to"])) : D("v-if", !0), q(s).register ? (V(), E(q(pe), {
961
501
  key: 1,
962
- to: { name: D(Y)(D(J)()).register },
963
- onClick: R
502
+ to: { name: q(d)(q(f)()).register },
503
+ onClick: ee
964
504
  }, {
965
- default: N(() => [l(E(D(p)("campus.auth.registerLink")), 1)]),
505
+ default: Y(() => [j(K(q(a)("campus.auth.registerLink")), 1)]),
966
506
  _: 1
967
- }, 8, ["to"])) : a("v-if", !0)])) : a("v-if", !0),
968
- s("div", Et, [s("h3", null, E(D(p)("campus.auth.helpTitle")), 1), s("ol", null, [(y(!0), o(e, null, S(P.value, (t, n) => (y(), o("li", { key: n }, [(y(!0), o(e, null, S(t, (t, n) => (y(), o(e, { key: n }, [t === null ? D(h).forgot ? (y(), i(D(ne), {
507
+ }, 8, ["to"])) : D("v-if", !0)])) : D("v-if", !0),
508
+ k("div", lt, [k("h3", null, K(q(a)("campus.auth.helpTitle")), 1), k("ol", null, [(V(!0), O(S, null, U(C.value, (e, t) => (V(), O("li", { key: t }, [(V(!0), O(S, null, U(e, (e, t) => (V(), O(S, { key: t }, [e === null ? q(s).forgot ? (V(), E(q(pe), {
969
509
  key: 1,
970
- to: { name: D(Y)(D(J)()).forgot },
971
- onClick: R
510
+ to: { name: q(d)(q(f)()).forgot },
511
+ onClick: ee
972
512
  }, {
973
- default: N(() => [l(E(D(p)("campus.auth.findPassword")), 1)]),
513
+ default: Y(() => [j(K(q(a)("campus.auth.findPassword")), 1)]),
974
514
  _: 1
975
- }, 8, ["to"])) : (y(), o(e, { key: 2 }, [l(E(D(p)("campus.auth.findPassword")), 1)], 64)) : (y(), o(e, { key: 0 }, [l(E(t), 1)], 64))], 64))), 128))]))), 128))])])
515
+ }, 8, ["to"])) : (V(), O(S, { key: 2 }, [j(K(q(a)("campus.auth.findPassword")), 1)], 64)) : (V(), O(S, { key: 0 }, [j(K(e), 1)], 64))], 64))), 128))]))), 128))])])
976
516
  ], 64);
977
517
  };
978
518
  }
979
519
  });
980
520
  // packages/core/src/pages/auth/wechat-host.ts
981
- function Ot(e, t) {
521
+ function dt(e, t) {
982
522
  let n, r = !1, i = () => {
983
523
  if (!r) {
984
524
  r = !0;
@@ -1005,75 +545,75 @@ function Ot(e, t) {
1005
545
  };
1006
546
  }
1007
547
  // packages/core/src/pages/auth/WechatPane.vue?vue&type=script&setup=true&lang.ts
1008
- var kt = {
548
+ var ft = {
1009
549
  key: 0,
1010
550
  class: "ca-auth-wechat"
1011
- }, At = {
551
+ }, pt = {
1012
552
  key: 0,
1013
553
  class: "ca-auth-wechat__failed",
1014
554
  role: "alert"
1015
- }, jt = {
555
+ }, mt = {
1016
556
  key: 1,
1017
557
  class: "ca-auth-wechat"
1018
- }, Mt = { class: "ca-auth-wechat__code" }, Nt = ["src", "alt"], Pt = ["aria-label"], Ft = { class: "ca-auth-wechat__hint" }, It = {
558
+ }, ht = { class: "ca-auth-wechat__code" }, gt = ["src", "alt"], _t = ["aria-label"], vt = { class: "ca-auth-wechat__hint" }, yt = {
1019
559
  key: 0,
1020
560
  class: "ca-auth-wechat__note"
1021
- }, Lt = /* @__PURE__ */ d({
561
+ }, bt = /* @__PURE__ */ N({
1022
562
  __name: "WechatPane",
1023
563
  props: { preview: { type: Boolean } },
1024
564
  setup(e) {
1025
- let t = e, { t: r } = q(), i = n(() => X().panel?.qrcode), d = !t.preview && Ke().wechat, f = x(), p = x(!1), h;
1026
- function g() {
1027
- h?.release(), h = void 0;
565
+ let t = e, { t: n } = c(), r = w(() => Ie().panel?.qrcode), i = !t.preview && Le().wechat, a = H(), o = H(!1), s;
566
+ function l() {
567
+ s?.release(), s = void 0;
1028
568
  }
1029
- async function b() {
1030
- g(), p.value = !1, await m(), f.value && (h = Ot(J().auth.wechat.mount, f.value), p.value = !h.ok);
569
+ async function u() {
570
+ l(), o.value = !1, await I(), a.value && (s = dt(f().auth.wechat.mount, a.value), o.value = !s.ok);
1031
571
  }
1032
- return v(() => {
1033
- d && b();
1034
- }), _(g), (e, t) => {
1035
- let n = w("ca-button");
1036
- return D(d) ? (y(), o("div", kt, [P(s("div", {
572
+ return B(() => {
573
+ i && u();
574
+ }), z(l), (e, t) => {
575
+ let s = W("ca-button");
576
+ return q(i) ? (V(), O("div", ft, [X(k("div", {
1037
577
  ref_key: "host",
1038
- ref: f,
578
+ ref: a,
1039
579
  class: "ca-auth-wechat__host"
1040
- }, null, 512), [[A, !p.value]]), p.value ? (y(), o("div", At, [s("p", null, E(D(r)("campus.auth.wechatMountFailed")), 1), u(n, { onClick: b }, {
1041
- default: N(() => [l(E(D(r)("campus.auth.wechatRetry")), 1)]),
580
+ }, null, 512), [[oe, !o.value]]), o.value ? (V(), O("div", pt, [k("p", null, K(q(n)("campus.auth.wechatMountFailed")), 1), M(s, { onClick: u }, {
581
+ default: Y(() => [j(K(q(n)("campus.auth.wechatRetry")), 1)]),
1042
582
  _: 1
1043
- })])) : a("v-if", !0)])) : (y(), o("div", jt, [
1044
- s("div", Mt, [i.value ? (y(), o("img", {
583
+ })])) : D("v-if", !0)])) : (V(), O("div", mt, [
584
+ k("div", ht, [r.value ? (V(), O("img", {
1045
585
  key: 0,
1046
- src: i.value,
1047
- alt: D(r)("campus.auth.qrcodeAlt")
1048
- }, null, 8, Nt)) : (y(), o("svg", {
586
+ src: r.value,
587
+ alt: q(n)("campus.auth.qrcodeAlt")
588
+ }, null, 8, gt)) : (V(), O("svg", {
1049
589
  key: 1,
1050
590
  viewBox: "0 0 100 100",
1051
591
  role: "img",
1052
- "aria-label": D(r)("campus.auth.qrcodeAlt")
1053
- }, [...t[0] ||= [c("<rect x=\"8\" y=\"8\" width=\"26\" height=\"26\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"5\"></rect><rect x=\"66\" y=\"8\" width=\"26\" height=\"26\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"5\"></rect><rect x=\"8\" y=\"66\" width=\"26\" height=\"26\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"5\"></rect><rect x=\"16\" y=\"16\" width=\"10\" height=\"10\" fill=\"currentColor\"></rect><rect x=\"74\" y=\"16\" width=\"10\" height=\"10\" fill=\"currentColor\"></rect><rect x=\"16\" y=\"74\" width=\"10\" height=\"10\" fill=\"currentColor\"></rect><path d=\"M44 10h8v10h-8zM44 28h16v8H44zM10 44h10v8H10zM28 44h16v10H28zM52 46h10v10H52zM70 44h22v8H70zM44 62h8v14h-8zM58 66h14v8H58zM78 62h14v14H78zM56 82h14v10H56z\" fill=\"currentColor\"></path>", 7)]], 8, Pt))]),
1054
- s("p", Ft, E(D(r)("campus.auth.wechatHint")), 1),
1055
- i.value ? a("v-if", !0) : (y(), o("p", It, E(D(r)("campus.auth.wechatNote")), 1))
592
+ "aria-label": q(n)("campus.auth.qrcodeAlt")
593
+ }, [...t[0] ||= [A("<rect x=\"8\" y=\"8\" width=\"26\" height=\"26\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"5\"></rect><rect x=\"66\" y=\"8\" width=\"26\" height=\"26\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"5\"></rect><rect x=\"8\" y=\"66\" width=\"26\" height=\"26\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"5\"></rect><rect x=\"16\" y=\"16\" width=\"10\" height=\"10\" fill=\"currentColor\"></rect><rect x=\"74\" y=\"16\" width=\"10\" height=\"10\" fill=\"currentColor\"></rect><rect x=\"16\" y=\"74\" width=\"10\" height=\"10\" fill=\"currentColor\"></rect><path d=\"M44 10h8v10h-8zM44 28h16v8H44zM10 44h10v8H10zM28 44h16v10H28zM52 46h10v10H52zM70 44h22v8H70zM44 62h8v14h-8zM58 66h14v8H58zM78 62h14v14H78zM56 82h14v10H56z\" fill=\"currentColor\"></path>", 7)]], 8, _t))]),
594
+ k("p", vt, K(q(n)("campus.auth.wechatHint")), 1),
595
+ r.value ? D("v-if", !0) : (V(), O("p", yt, K(q(n)("campus.auth.wechatNote")), 1))
1056
596
  ]));
1057
597
  };
1058
598
  }
1059
- }), Rt = /* @__PURE__ */ d({
599
+ }), xt = /* @__PURE__ */ N({
1060
600
  __name: "LoginSplit",
1061
601
  props: { preview: { type: Boolean } },
1062
602
  setup(e) {
1063
- let { t } = q(), r = X().tabs?.length ? X().tabs : ["account", "wechat"], a = x(r[0]), o = n(() => r.map((e) => ({
603
+ let { t } = c(), n = Ie().tabs?.length ? Ie().tabs : ["account", "wechat"], r = H(n[0]), i = w(() => n.map((e) => ({
1064
604
  key: e,
1065
605
  label: t(e === "account" ? "campus.auth.tabAccount" : "campus.auth.tabWechat")
1066
606
  })));
1067
- return (t, n) => (y(), i(ut, {
1068
- active: a.value,
1069
- "onUpdate:active": n[0] ||= (e) => a.value = e,
1070
- tabs: o.value,
607
+ return (t, n) => (V(), E(et, {
608
+ active: r.value,
609
+ "onUpdate:active": n[0] ||= (e) => r.value = e,
610
+ tabs: i.value,
1071
611
  preview: e.preview
1072
612
  }, {
1073
- default: N(() => [a.value === "account" ? (y(), i(Dt, {
613
+ default: Y(() => [r.value === "account" ? (V(), E(ut, {
1074
614
  key: 0,
1075
615
  preview: e.preview
1076
- }, null, 8, ["preview"])) : (y(), i(Lt, { key: 1 }))]),
616
+ }, null, 8, ["preview"])) : (V(), E(bt, { key: 1 }))]),
1077
617
  _: 1
1078
618
  }, 8, [
1079
619
  "active",
@@ -1083,90 +623,29 @@ var kt = {
1083
623
  }
1084
624
  });
1085
625
  // packages/core/src/security.ts
1086
- function zt(e) {
626
+ function St(e) {
1087
627
  return e.environment ? e.environment : "production";
1088
628
  }
1089
- function Bt(e) {
1090
- if (zt(e) === "production" && typeof e.auth.captcha != "function") throw Error("[campus] 生产环境必须在 auth 中提供 captcha()(图形验证码);测试环境可设置 environment: 'test' 跳过");
629
+ function Ct(e) {
630
+ if (St(e) === "production" && typeof e.auth.captcha != "function") throw Error("[campus] 生产环境必须在 auth 中提供 captcha()(图形验证码);测试环境可设置 environment: 'test' 跳过");
1091
631
  }
1092
- function Vt(e, t) {
632
+ function wt(e, t) {
1093
633
  return t === "test" || e.length >= 8 && /[A-Za-z]/.test(e) && /\d/.test(e);
1094
634
  }
1095
- // packages/core/src/services/feedback.ts
1096
- var Ht = (e) => e;
1097
- function Ut(e) {
1098
- Ht = e;
1099
- }
1100
- async function Wt(e, t = {}) {
1101
- await pe.alert(e, t.title ?? Ht("campus.common.tip"), {
1102
- type: t.type ?? "info",
1103
- confirmButtonText: t.confirmText ?? Ht("campus.common.ok")
1104
- });
1105
- }
1106
- async function Gt(e, t = {}) {
1107
- try {
1108
- return await pe.confirm(e, t.title ?? Ht("campus.common.tip"), {
1109
- type: t.type ?? "warning",
1110
- confirmButtonText: t.confirmText ?? Ht("campus.common.confirm"),
1111
- cancelButtonText: t.cancelText ?? Ht("campus.common.cancel")
1112
- }), !0;
1113
- } catch (e) {
1114
- if (e === "cancel" || e === "close") return !1;
1115
- throw e;
1116
- }
1117
- }
1118
- var Kt = {
1119
- info: (e) => void fe({
1120
- message: e,
1121
- type: "info"
1122
- }),
1123
- success: (e) => void fe({
1124
- message: e,
1125
- type: "success"
1126
- }),
1127
- warning: (e) => void fe({
1128
- message: e,
1129
- type: "warning"
1130
- }),
1131
- error: (e) => void fe({
1132
- message: e,
1133
- type: "error"
1134
- })
1135
- }, qt = de.service;
1136
- function Jt(e, t, n = {}) {
1137
- let r = me({
1138
- ...n,
1139
- title: n.title ?? Ht(`campus.notify.${e}`),
1140
- message: t,
1141
- type: e
1142
- });
1143
- return m(() => me.updateOffsets(n.position)), r;
1144
- }
1145
- // packages/core/src/services/ca.ts
1146
- var Yt = {
1147
- alert: Wt,
1148
- confirm: Gt,
1149
- toast: Kt,
1150
- loading: qt,
1151
- notify: {
1152
- success: (e, t) => Jt("success", e, t),
1153
- info: (e, t) => Jt("info", e, t),
1154
- warning: (e, t) => Jt("warning", e, t),
1155
- error: (e, t) => Jt("error", e, t)
1156
- }
1157
- }, Xt = { class: "ca-auth-row" }, Zt = ["disabled"], Qt = 60, $t = /* @__PURE__ */ d({
635
+ // packages/core/src/pages/auth/SmsField.vue?vue&type=script&setup=true&lang.ts
636
+ var Tt = { class: "ca-auth-row" }, Et = ["disabled"], Dt = 60, Ot = /* @__PURE__ */ N({
1158
637
  __name: "SmsField",
1159
- props: /*@__PURE__*/ p({ send: { type: Function } }, {
638
+ props: /*@__PURE__*/ F({ send: { type: Function } }, {
1160
639
  modelValue: { default: "" },
1161
640
  modelModifiers: {}
1162
641
  }),
1163
642
  emits: ["update:modelValue"],
1164
643
  setup(e) {
1165
- let t = e, n = k(e, "modelValue"), { t: r } = q(), i = x(0), a = x(!1), c;
1166
- function l() {
1167
- c && clearInterval(c), c = void 0;
644
+ let t = e, n = ae(e, "modelValue"), { t: r } = c(), i = H(0), a = H(!1), o;
645
+ function s() {
646
+ o && clearInterval(o), o = void 0;
1168
647
  }
1169
- async function d() {
648
+ async function l() {
1170
649
  if (!(i.value > 0 || a.value)) {
1171
650
  a.value = !0;
1172
651
  try {
@@ -1176,171 +655,171 @@ var Yt = {
1176
655
  } finally {
1177
656
  a.value = !1;
1178
657
  }
1179
- i.value = Qt, l(), c = setInterval(() => {
1180
- --i.value, i.value <= 0 && l();
658
+ i.value = Dt, s(), o = setInterval(() => {
659
+ --i.value, i.value <= 0 && s();
1181
660
  }, 1e3);
1182
661
  }
1183
662
  }
1184
- return _(l), (e, t) => {
1185
- let c = w("ca-input");
1186
- return y(), o("div", Xt, [u(c, {
663
+ return z(s), (e, t) => {
664
+ let o = W("ca-input");
665
+ return V(), O("div", Tt, [M(o, {
1187
666
  modelValue: n.value,
1188
667
  "onUpdate:modelValue": t[0] ||= (e) => n.value = e,
1189
- placeholder: D(r)("campus.auth.smsPlaceholder"),
1190
- "aria-label": D(r)("campus.auth.smsCode"),
668
+ placeholder: q(r)("campus.auth.smsPlaceholder"),
669
+ "aria-label": q(r)("campus.auth.smsCode"),
1191
670
  autocomplete: "one-time-code",
1192
671
  maxlength: "8"
1193
672
  }, {
1194
- prefix: N(() => [u($, { name: "message" })]),
673
+ prefix: Y(() => [M($, { name: "message" })]),
1195
674
  _: 1
1196
675
  }, 8, [
1197
676
  "modelValue",
1198
677
  "placeholder",
1199
678
  "aria-label"
1200
- ]), s("button", {
679
+ ]), k("button", {
1201
680
  type: "button",
1202
681
  class: "ca-auth-sms",
1203
682
  disabled: i.value > 0 || a.value,
1204
- onClick: d
1205
- }, E(i.value > 0 ? D(r)("campus.auth.resend", { n: i.value }) : D(r)("campus.auth.getCode")), 9, Zt)]);
683
+ onClick: l
684
+ }, K(i.value > 0 ? q(r)("campus.auth.resend", { n: i.value }) : q(r)("campus.auth.getCode")), 9, Et)]);
1206
685
  };
1207
686
  }
1208
- }), en = {
687
+ }), kt = {
1209
688
  key: 0,
1210
689
  class: "ca-auth-hint"
1211
- }, tn = { class: "ca-auth-agreements" }, nn = ["href"], rn = /* @__PURE__ */ d({
690
+ }, At = { class: "ca-auth-agreements" }, jt = ["href"], Mt = /* @__PURE__ */ N({
1212
691
  __name: "RegisterForm",
1213
692
  props: { preview: { type: Boolean } },
1214
- setup(t) {
1215
- let r = t, c = G(), { t: d, label: f } = q(), p = Ke(), m = zt(J()), g = X(), _ = g.agreements ?? [], v = b({
693
+ setup(e) {
694
+ let t = e, n = Q(), { t: r, label: i } = c(), a = Le(), o = St(f()), s = Ie(), u = s.agreements ?? [], p = te({
1216
695
  phone: "",
1217
696
  captcha: "",
1218
697
  code: "",
1219
698
  password: "",
1220
699
  confirm: "",
1221
700
  agree: !1
1222
- }), C = x(""), T = x(), O = x(), k = x(!1), A = x(""), j = x("error"), M = n(() => ({
701
+ }), m = H(""), h = H(), g = H(), _ = H(!1), v = H(""), y = H("error"), b = w(() => ({
1223
702
  phone: [{
1224
703
  required: !0,
1225
- message: d("campus.auth.phonePlaceholder"),
704
+ message: r("campus.auth.phonePlaceholder"),
1226
705
  trigger: "blur"
1227
706
  }, {
1228
- pattern: Ge,
1229
- message: d("campus.auth.phoneInvalid"),
707
+ pattern: Fe,
708
+ message: r("campus.auth.phoneInvalid"),
1230
709
  trigger: "blur"
1231
710
  }],
1232
- captcha: p.captcha ? [{
711
+ captcha: a.captcha ? [{
1233
712
  required: !0,
1234
- message: d("campus.auth.captchaRequired"),
713
+ message: r("campus.auth.captchaRequired"),
1235
714
  trigger: "blur"
1236
715
  }] : [],
1237
716
  code: [{
1238
717
  required: !0,
1239
- message: d("campus.login.required", { label: d("campus.auth.smsCode") }),
718
+ message: r("campus.login.required", { label: r("campus.auth.smsCode") }),
1240
719
  trigger: "blur"
1241
720
  }],
1242
721
  password: [{
1243
722
  required: !0,
1244
- message: d("campus.auth.registerPasswordPlaceholder"),
723
+ message: r("campus.auth.registerPasswordPlaceholder"),
1245
724
  trigger: "blur"
1246
725
  }, {
1247
- validator: (e, t, n) => n(Vt(t, m) ? void 0 : Error(d("campus.auth.passwordPolicy"))),
726
+ validator: (e, t, n) => n(wt(t, o) ? void 0 : Error(r("campus.auth.passwordPolicy"))),
1248
727
  trigger: "blur"
1249
728
  }],
1250
729
  confirm: [{
1251
730
  required: !0,
1252
- message: d("campus.auth.confirmPlaceholder"),
731
+ message: r("campus.auth.confirmPlaceholder"),
1253
732
  trigger: "blur"
1254
733
  }, {
1255
- validator: (e, t, n) => n(t === v.password ? void 0 : Error(d("campus.auth.passwordMismatch"))),
734
+ validator: (e, t, n) => n(t === p.password ? void 0 : Error(r("campus.auth.passwordMismatch"))),
1256
735
  trigger: "blur"
1257
736
  }],
1258
- agree: _.length ? [{
1259
- validator: (e, t, n) => n(t ? void 0 : Error(d("campus.auth.agreeRequired"))),
737
+ agree: u.length ? [{
738
+ validator: (e, t, n) => n(t ? void 0 : Error(r("campus.auth.agreeRequired"))),
1260
739
  trigger: "change"
1261
740
  }] : []
1262
- })), P = n(() => !!(v.phone && v.code && v.password && v.confirm) && (!p.captcha || !!v.captcha) && (!_.length || v.agree));
1263
- function I(e, t) {
1264
- j.value = "error", A.value = e instanceof Error && e.message ? e.message : t;
741
+ })), x = w(() => !!(p.phone && p.code && p.password && p.confirm) && (!a.captcha || !!p.captcha) && (!u.length || p.agree));
742
+ function C(e, t) {
743
+ y.value = "error", v.value = e instanceof Error && e.message ? e.message : t;
1265
744
  }
1266
- async function L() {
1267
- let e = p.captcha ? ["phone", "captcha"] : ["phone"];
745
+ async function T() {
746
+ let e = a.captcha ? ["phone", "captcha"] : ["phone"];
1268
747
  try {
1269
- await O.value?.validateField(e);
748
+ await g.value?.validateField(e);
1270
749
  } catch {
1271
750
  throw Error("invalid");
1272
751
  }
1273
- if (A.value = "", r.preview) j.value = "info", A.value = d("campus.auth.previewNote");
752
+ if (v.value = "", t.preview) y.value = "info", v.value = r("campus.auth.previewNote");
1274
753
  else try {
1275
- await J().auth.sendSmsCode({
1276
- phone: v.phone,
754
+ await f().auth.sendSmsCode({
755
+ phone: p.phone,
1277
756
  scene: "register",
1278
- captcha: p.captcha ? {
1279
- key: C.value,
1280
- code: v.captcha
757
+ captcha: a.captcha ? {
758
+ key: m.value,
759
+ code: p.captcha
1281
760
  } : void 0
1282
- }), Yt.toast.success(d("campus.auth.smsSent"));
761
+ }), l.toast.success(r("campus.auth.smsSent"));
1283
762
  } catch (e) {
1284
- throw I(e, d("campus.login.failed")), T.value?.refresh(), e;
763
+ throw C(e, r("campus.login.failed")), h.value?.refresh(), e;
1285
764
  }
1286
765
  }
1287
- async function R() {
1288
- if (P.value) {
766
+ async function A() {
767
+ if (x.value) {
1289
768
  try {
1290
- await O.value?.validate();
769
+ await g.value?.validate();
1291
770
  } catch {
1292
771
  return;
1293
772
  }
1294
- if (r.preview) j.value = "info", A.value = d("campus.auth.previewNote");
773
+ if (t.preview) y.value = "info", v.value = r("campus.auth.previewNote");
1295
774
  else {
1296
- k.value = !0, A.value = "";
775
+ _.value = !0, v.value = "";
1297
776
  try {
1298
- await J().auth.register({
1299
- phone: v.phone,
1300
- code: v.code,
1301
- password: v.password,
1302
- captcha: p.captcha ? {
1303
- key: C.value,
1304
- code: v.captcha
777
+ await f().auth.register({
778
+ phone: p.phone,
779
+ code: p.code,
780
+ password: p.password,
781
+ captcha: a.captcha ? {
782
+ key: m.value,
783
+ code: p.captcha
1305
784
  } : void 0
1306
- }), Yt.toast.success(d("campus.auth.registerOk")), await c.replace({ name: Y(J()).login });
785
+ }), l.toast.success(r("campus.auth.registerOk")), await n.replace({ name: d(f()).login });
1307
786
  } catch (e) {
1308
- I(e, d("campus.login.failed")), T.value?.refresh();
787
+ C(e, r("campus.login.failed")), h.value?.refresh();
1309
788
  } finally {
1310
- k.value = !1;
789
+ _.value = !1;
1311
790
  }
1312
791
  }
1313
792
  }
1314
793
  }
1315
- return (t, n) => {
1316
- let r = w("ca-alert"), c = w("ca-input"), m = w("ca-form-item"), b = w("ca-checkbox"), x = w("ca-button"), I = w("ca-form");
1317
- return y(), o(e, null, [A.value ? (y(), i(r, {
794
+ return (e, t) => {
795
+ let n = W("ca-alert"), o = W("ca-input"), c = W("ca-form-item"), l = W("ca-checkbox"), d = W("ca-button"), f = W("ca-form");
796
+ return V(), O(S, null, [v.value ? (V(), E(n, {
1318
797
  key: 0,
1319
- title: A.value,
1320
- type: j.value,
798
+ title: v.value,
799
+ type: y.value,
1321
800
  "show-icon": "",
1322
801
  closable: !1,
1323
802
  class: "ca-auth-alert"
1324
- }, null, 8, ["title", "type"])) : a("v-if", !0), u(I, {
803
+ }, null, 8, ["title", "type"])) : D("v-if", !0), M(f, {
1325
804
  ref_key: "formRef",
1326
- ref: O,
1327
- model: v,
1328
- rules: M.value,
805
+ ref: g,
806
+ model: p,
807
+ rules: b.value,
1329
808
  size: "large",
1330
809
  class: "ca-auth-form",
1331
- onSubmit: F(R, ["prevent"])
810
+ onSubmit: Z(A, ["prevent"])
1332
811
  }, {
1333
- default: N(() => [
1334
- u(m, { prop: "phone" }, {
1335
- default: N(() => [u(c, {
1336
- modelValue: v.phone,
1337
- "onUpdate:modelValue": n[0] ||= (e) => v.phone = e,
1338
- placeholder: D(d)("campus.auth.phonePlaceholder"),
1339
- "aria-label": D(d)("campus.auth.phone"),
812
+ default: Y(() => [
813
+ M(c, { prop: "phone" }, {
814
+ default: Y(() => [M(o, {
815
+ modelValue: p.phone,
816
+ "onUpdate:modelValue": t[0] ||= (e) => p.phone = e,
817
+ placeholder: q(r)("campus.auth.phonePlaceholder"),
818
+ "aria-label": q(r)("campus.auth.phone"),
1340
819
  autocomplete: "tel",
1341
820
  maxlength: "11"
1342
821
  }, {
1343
- prefix: N(() => [u($, { name: "phone" })]),
822
+ prefix: Y(() => [M($, { name: "phone" })]),
1344
823
  _: 1
1345
824
  }, 8, [
1346
825
  "modelValue",
@@ -1349,40 +828,40 @@ var Yt = {
1349
828
  ])]),
1350
829
  _: 1
1351
830
  }),
1352
- D(p).captcha ? (y(), i(m, {
831
+ q(a).captcha ? (V(), E(c, {
1353
832
  key: 0,
1354
833
  prop: "captcha"
1355
834
  }, {
1356
- default: N(() => [u(wt, {
835
+ default: Y(() => [M(st, {
1357
836
  ref_key: "captchaRef",
1358
- ref: T,
1359
- code: v.captcha,
1360
- "onUpdate:code": n[1] ||= (e) => v.captcha = e,
1361
- "captcha-key": C.value,
1362
- "onUpdate:captchaKey": n[2] ||= (e) => C.value = e,
837
+ ref: h,
838
+ code: p.captcha,
839
+ "onUpdate:code": t[1] ||= (e) => p.captcha = e,
840
+ "captcha-key": m.value,
841
+ "onUpdate:captchaKey": t[2] ||= (e) => m.value = e,
1363
842
  scene: "register"
1364
843
  }, null, 8, ["code", "captcha-key"])]),
1365
844
  _: 1
1366
- })) : a("v-if", !0),
1367
- u(m, { prop: "code" }, {
1368
- default: N(() => [u($t, {
1369
- modelValue: v.code,
1370
- "onUpdate:modelValue": n[3] ||= (e) => v.code = e,
1371
- send: L
1372
- }, null, 8, ["modelValue"]), D(g).smsHint ? (y(), o("p", en, E(D(f)(D(g).smsHint)), 1)) : a("v-if", !0)]),
845
+ })) : D("v-if", !0),
846
+ M(c, { prop: "code" }, {
847
+ default: Y(() => [M(Ot, {
848
+ modelValue: p.code,
849
+ "onUpdate:modelValue": t[3] ||= (e) => p.code = e,
850
+ send: T
851
+ }, null, 8, ["modelValue"]), q(s).smsHint ? (V(), O("p", kt, K(q(i)(q(s).smsHint)), 1)) : D("v-if", !0)]),
1373
852
  _: 1
1374
853
  }),
1375
- u(m, { prop: "password" }, {
1376
- default: N(() => [u(c, {
1377
- modelValue: v.password,
1378
- "onUpdate:modelValue": n[4] ||= (e) => v.password = e,
854
+ M(c, { prop: "password" }, {
855
+ default: Y(() => [M(o, {
856
+ modelValue: p.password,
857
+ "onUpdate:modelValue": t[4] ||= (e) => p.password = e,
1379
858
  type: "password",
1380
859
  "show-password": "",
1381
- placeholder: D(d)("campus.auth.registerPasswordPlaceholder"),
1382
- "aria-label": D(d)("campus.auth.registerPassword"),
860
+ placeholder: q(r)("campus.auth.registerPasswordPlaceholder"),
861
+ "aria-label": q(r)("campus.auth.registerPassword"),
1383
862
  autocomplete: "new-password"
1384
863
  }, {
1385
- prefix: N(() => [u($, { name: "lock" })]),
864
+ prefix: Y(() => [M($, { name: "lock" })]),
1386
865
  _: 1
1387
866
  }, 8, [
1388
867
  "modelValue",
@@ -1391,17 +870,17 @@ var Yt = {
1391
870
  ])]),
1392
871
  _: 1
1393
872
  }),
1394
- u(m, { prop: "confirm" }, {
1395
- default: N(() => [u(c, {
1396
- modelValue: v.confirm,
1397
- "onUpdate:modelValue": n[5] ||= (e) => v.confirm = e,
873
+ M(c, { prop: "confirm" }, {
874
+ default: Y(() => [M(o, {
875
+ modelValue: p.confirm,
876
+ "onUpdate:modelValue": t[5] ||= (e) => p.confirm = e,
1398
877
  type: "password",
1399
878
  "show-password": "",
1400
- placeholder: D(d)("campus.auth.confirmPlaceholder"),
1401
- "aria-label": D(d)("campus.auth.confirmPlaceholder"),
879
+ placeholder: q(r)("campus.auth.confirmPlaceholder"),
880
+ "aria-label": q(r)("campus.auth.confirmPlaceholder"),
1402
881
  autocomplete: "new-password"
1403
882
  }, {
1404
- prefix: N(() => [u($, { name: "lock" })]),
883
+ prefix: Y(() => [M($, { name: "lock" })]),
1405
884
  _: 1
1406
885
  }, 8, [
1407
886
  "modelValue",
@@ -1410,33 +889,33 @@ var Yt = {
1410
889
  ])]),
1411
890
  _: 1
1412
891
  }),
1413
- D(_).length ? (y(), i(m, {
892
+ q(u).length ? (V(), E(c, {
1414
893
  key: 1,
1415
894
  prop: "agree"
1416
895
  }, {
1417
- default: N(() => [u(b, {
1418
- modelValue: v.agree,
1419
- "onUpdate:modelValue": n[6] ||= (e) => v.agree = e
896
+ default: Y(() => [M(l, {
897
+ modelValue: p.agree,
898
+ "onUpdate:modelValue": t[6] ||= (e) => p.agree = e
1420
899
  }, {
1421
- default: N(() => [l(E(D(d)("campus.auth.agreePrefix")), 1)]),
900
+ default: Y(() => [j(K(q(r)("campus.auth.agreePrefix")), 1)]),
1422
901
  _: 1
1423
- }, 8, ["modelValue"]), s("span", tn, [(y(!0), o(e, null, S(D(_), (e) => (y(), o("a", {
902
+ }, 8, ["modelValue"]), k("span", At, [(V(!0), O(S, null, U(q(u), (e) => (V(), O("a", {
1424
903
  key: e.href,
1425
904
  href: e.href,
1426
905
  target: "_blank",
1427
906
  rel: "noopener noreferrer"
1428
- }, E(D(f)(e.text)), 9, nn))), 128))])]),
907
+ }, K(q(i)(e.text)), 9, jt))), 128))])]),
1429
908
  _: 1
1430
- })) : a("v-if", !0),
1431
- u(x, {
909
+ })) : D("v-if", !0),
910
+ M(d, {
1432
911
  type: "primary",
1433
912
  "native-type": "submit",
1434
913
  size: "large",
1435
- loading: k.value,
1436
- disabled: !P.value,
1437
- class: h(["ca-auth-submit", { "ca-auth-submit--off": !P.value }])
914
+ loading: _.value,
915
+ disabled: !x.value,
916
+ class: L(["ca-auth-submit", { "ca-auth-submit--off": !x.value }])
1438
917
  }, {
1439
- default: N(() => [l(E(D(d)("campus.common.ok")), 1)]),
918
+ default: Y(() => [j(K(q(r)("campus.common.ok")), 1)]),
1440
919
  _: 1
1441
920
  }, 8, [
1442
921
  "loading",
@@ -1448,160 +927,160 @@ var Yt = {
1448
927
  }, 8, ["model", "rules"])], 64);
1449
928
  };
1450
929
  }
1451
- }), an = {
930
+ }), Nt = {
1452
931
  key: 1,
1453
932
  class: "ca-auth-off",
1454
933
  role: "status"
1455
- }, on = /* @__PURE__ */ d({
934
+ }, Pt = /* @__PURE__ */ N({
1456
935
  __name: "RegisterPage",
1457
936
  props: { preview: { type: Boolean } },
1458
937
  setup(e) {
1459
- let { t } = q(), r = Ke().register, a = n(() => [{
938
+ let { t } = c(), n = Le().register, r = w(() => [{
1460
939
  key: "register",
1461
940
  label: t("campus.auth.tabRegister")
1462
941
  }, {
1463
942
  key: "login",
1464
943
  label: t("campus.auth.backLogin"),
1465
- to: Fe(J()).login
944
+ to: m(f()).login
1466
945
  }]);
1467
- return (n, c) => (y(), i(ut, {
946
+ return (i, a) => (V(), E(et, {
1468
947
  active: "register",
1469
- tabs: a.value,
948
+ tabs: r.value,
1470
949
  preview: e.preview
1471
950
  }, {
1472
- default: N(() => [D(r) ? (y(), i(rn, {
951
+ default: Y(() => [q(n) ? (V(), E(Mt, {
1473
952
  key: 0,
1474
953
  preview: e.preview
1475
- }, null, 8, ["preview"])) : (y(), o("div", an, [s("h3", null, E(D(t)("campus.auth.unavailableTitle")), 1), s("p", null, E(D(t)("campus.auth.unavailableDesc")), 1)]))]),
954
+ }, null, 8, ["preview"])) : (V(), O("div", Nt, [k("h3", null, K(q(t)("campus.auth.unavailableTitle")), 1), k("p", null, K(q(t)("campus.auth.unavailableDesc")), 1)]))]),
1476
955
  _: 1
1477
956
  }, 8, ["tabs", "preview"]));
1478
957
  }
1479
- }), sn = {
958
+ }), Ft = {
1480
959
  key: 0,
1481
960
  class: "ca-auth-hint"
1482
- }, cn = /* @__PURE__ */ d({
961
+ }, It = /* @__PURE__ */ N({
1483
962
  __name: "ForgotForm",
1484
963
  props: { preview: { type: Boolean } },
1485
- setup(t) {
1486
- let r = t, s = G(), { t: c, label: d } = q(), f = Ke(), p = zt(J()), m = X(), g = b({
964
+ setup(e) {
965
+ let t = e, n = Q(), { t: r, label: i } = c(), a = Le(), o = St(f()), s = Ie(), u = te({
1487
966
  account: "",
1488
967
  captcha: "",
1489
968
  code: "",
1490
969
  password: "",
1491
970
  confirm: ""
1492
- }), _ = x(""), v = x(), S = x(), C = x(!1), T = x(""), O = x("error"), k = n(() => ({
971
+ }), p = H(""), m = H(), h = H(), g = H(!1), _ = H(""), v = H("error"), y = w(() => ({
1493
972
  account: [{
1494
973
  required: !0,
1495
- message: c("campus.auth.accountRequired"),
974
+ message: r("campus.auth.accountRequired"),
1496
975
  trigger: "blur"
1497
976
  }],
1498
- captcha: f.captcha ? [{
977
+ captcha: a.captcha ? [{
1499
978
  required: !0,
1500
- message: c("campus.auth.captchaRequired"),
979
+ message: r("campus.auth.captchaRequired"),
1501
980
  trigger: "blur"
1502
981
  }] : [],
1503
982
  code: [{
1504
983
  required: !0,
1505
- message: c("campus.login.required", { label: c("campus.auth.smsCode") }),
984
+ message: r("campus.login.required", { label: r("campus.auth.smsCode") }),
1506
985
  trigger: "blur"
1507
986
  }],
1508
987
  password: [{
1509
988
  required: !0,
1510
- message: c("campus.auth.newPasswordPlaceholder"),
989
+ message: r("campus.auth.newPasswordPlaceholder"),
1511
990
  trigger: "blur"
1512
991
  }, {
1513
- validator: (e, t, n) => n(Vt(t, p) ? void 0 : Error(c("campus.auth.passwordPolicy"))),
992
+ validator: (e, t, n) => n(wt(t, o) ? void 0 : Error(r("campus.auth.passwordPolicy"))),
1514
993
  trigger: "blur"
1515
994
  }],
1516
995
  confirm: [{
1517
996
  required: !0,
1518
- message: c("campus.auth.confirmPlaceholder"),
997
+ message: r("campus.auth.confirmPlaceholder"),
1519
998
  trigger: "blur"
1520
999
  }, {
1521
- validator: (e, t, n) => n(t === g.password ? void 0 : Error(c("campus.auth.passwordMismatch"))),
1000
+ validator: (e, t, n) => n(t === u.password ? void 0 : Error(r("campus.auth.passwordMismatch"))),
1522
1001
  trigger: "blur"
1523
1002
  }]
1524
- })), A = n(() => !!(g.account && g.code && g.password && g.confirm) && (!f.captcha || !!g.captcha));
1525
- function j(e, t) {
1526
- O.value = "error", T.value = e instanceof Error && e.message ? e.message : t;
1003
+ })), b = w(() => !!(u.account && u.code && u.password && u.confirm) && (!a.captcha || !!u.captcha));
1004
+ function x(e, t) {
1005
+ v.value = "error", _.value = e instanceof Error && e.message ? e.message : t;
1527
1006
  }
1528
- async function M() {
1529
- let e = f.captcha ? ["account", "captcha"] : ["account"];
1007
+ async function C() {
1008
+ let e = a.captcha ? ["account", "captcha"] : ["account"];
1530
1009
  try {
1531
- await S.value?.validateField(e);
1010
+ await h.value?.validateField(e);
1532
1011
  } catch {
1533
1012
  throw Error("invalid");
1534
1013
  }
1535
- if (T.value = "", r.preview) O.value = "info", T.value = c("campus.auth.previewNote");
1014
+ if (_.value = "", t.preview) v.value = "info", _.value = r("campus.auth.previewNote");
1536
1015
  else try {
1537
- await J().auth.sendSmsCode({
1538
- ...Ge.test(g.account) ? { phone: g.account } : { username: g.account },
1016
+ await f().auth.sendSmsCode({
1017
+ ...Fe.test(u.account) ? { phone: u.account } : { username: u.account },
1539
1018
  scene: "forgot",
1540
- captcha: f.captcha ? {
1541
- key: _.value,
1542
- code: g.captcha
1019
+ captcha: a.captcha ? {
1020
+ key: p.value,
1021
+ code: u.captcha
1543
1022
  } : void 0
1544
- }), Yt.toast.success(c("campus.auth.smsSent"));
1023
+ }), l.toast.success(r("campus.auth.smsSent"));
1545
1024
  } catch (e) {
1546
- throw j(e, c("campus.login.failed")), v.value?.refresh(), e;
1025
+ throw x(e, r("campus.login.failed")), m.value?.refresh(), e;
1547
1026
  }
1548
1027
  }
1549
- async function P() {
1550
- if (A.value) {
1028
+ async function T() {
1029
+ if (b.value) {
1551
1030
  try {
1552
- await S.value?.validate();
1031
+ await h.value?.validate();
1553
1032
  } catch {
1554
1033
  return;
1555
1034
  }
1556
- if (r.preview) O.value = "info", T.value = c("campus.auth.previewNote");
1035
+ if (t.preview) v.value = "info", _.value = r("campus.auth.previewNote");
1557
1036
  else {
1558
- C.value = !0, T.value = "";
1037
+ g.value = !0, _.value = "";
1559
1038
  try {
1560
- await J().auth.resetPassword({
1561
- account: g.account,
1562
- code: g.code,
1563
- password: g.password,
1564
- captcha: f.captcha ? {
1565
- key: _.value,
1566
- code: g.captcha
1039
+ await f().auth.resetPassword({
1040
+ account: u.account,
1041
+ code: u.code,
1042
+ password: u.password,
1043
+ captcha: a.captcha ? {
1044
+ key: p.value,
1045
+ code: u.captcha
1567
1046
  } : void 0
1568
- }), Yt.toast.success(c("campus.auth.resetOk")), await s.replace({ name: Y(J()).login });
1047
+ }), l.toast.success(r("campus.auth.resetOk")), await n.replace({ name: d(f()).login });
1569
1048
  } catch (e) {
1570
- j(e, c("campus.login.failed")), v.value?.refresh();
1049
+ x(e, r("campus.login.failed")), m.value?.refresh();
1571
1050
  } finally {
1572
- C.value = !1;
1051
+ g.value = !1;
1573
1052
  }
1574
1053
  }
1575
1054
  }
1576
1055
  }
1577
- return (t, n) => {
1578
- let r = w("ca-alert"), s = w("ca-input"), p = w("ca-form-item"), b = w("ca-button"), x = w("ca-form");
1579
- return y(), o(e, null, [T.value ? (y(), i(r, {
1056
+ return (e, t) => {
1057
+ let n = W("ca-alert"), o = W("ca-input"), c = W("ca-form-item"), l = W("ca-button"), d = W("ca-form");
1058
+ return V(), O(S, null, [_.value ? (V(), E(n, {
1580
1059
  key: 0,
1581
- title: T.value,
1582
- type: O.value,
1060
+ title: _.value,
1061
+ type: v.value,
1583
1062
  "show-icon": "",
1584
1063
  closable: !1,
1585
1064
  class: "ca-auth-alert"
1586
- }, null, 8, ["title", "type"])) : a("v-if", !0), u(x, {
1065
+ }, null, 8, ["title", "type"])) : D("v-if", !0), M(d, {
1587
1066
  ref_key: "formRef",
1588
- ref: S,
1589
- model: g,
1590
- rules: k.value,
1067
+ ref: h,
1068
+ model: u,
1069
+ rules: y.value,
1591
1070
  size: "large",
1592
1071
  class: "ca-auth-form",
1593
- onSubmit: F(P, ["prevent"])
1072
+ onSubmit: Z(T, ["prevent"])
1594
1073
  }, {
1595
- default: N(() => [
1596
- u(p, { prop: "account" }, {
1597
- default: N(() => [u(s, {
1598
- modelValue: g.account,
1599
- "onUpdate:modelValue": n[0] ||= (e) => g.account = e,
1600
- placeholder: D(c)("campus.auth.accountPlaceholder"),
1601
- "aria-label": D(c)("campus.auth.account"),
1074
+ default: Y(() => [
1075
+ M(c, { prop: "account" }, {
1076
+ default: Y(() => [M(o, {
1077
+ modelValue: u.account,
1078
+ "onUpdate:modelValue": t[0] ||= (e) => u.account = e,
1079
+ placeholder: q(r)("campus.auth.accountPlaceholder"),
1080
+ "aria-label": q(r)("campus.auth.account"),
1602
1081
  autocomplete: "username"
1603
1082
  }, {
1604
- prefix: N(() => [u($, { name: "user" })]),
1083
+ prefix: Y(() => [M($, { name: "user" })]),
1605
1084
  _: 1
1606
1085
  }, 8, [
1607
1086
  "modelValue",
@@ -1610,40 +1089,40 @@ var Yt = {
1610
1089
  ])]),
1611
1090
  _: 1
1612
1091
  }),
1613
- D(f).captcha ? (y(), i(p, {
1092
+ q(a).captcha ? (V(), E(c, {
1614
1093
  key: 0,
1615
1094
  prop: "captcha"
1616
1095
  }, {
1617
- default: N(() => [u(wt, {
1096
+ default: Y(() => [M(st, {
1618
1097
  ref_key: "captchaRef",
1619
- ref: v,
1620
- code: g.captcha,
1621
- "onUpdate:code": n[1] ||= (e) => g.captcha = e,
1622
- "captcha-key": _.value,
1623
- "onUpdate:captchaKey": n[2] ||= (e) => _.value = e,
1098
+ ref: m,
1099
+ code: u.captcha,
1100
+ "onUpdate:code": t[1] ||= (e) => u.captcha = e,
1101
+ "captcha-key": p.value,
1102
+ "onUpdate:captchaKey": t[2] ||= (e) => p.value = e,
1624
1103
  scene: "forgot"
1625
1104
  }, null, 8, ["code", "captcha-key"])]),
1626
1105
  _: 1
1627
- })) : a("v-if", !0),
1628
- u(p, { prop: "code" }, {
1629
- default: N(() => [u($t, {
1630
- modelValue: g.code,
1631
- "onUpdate:modelValue": n[3] ||= (e) => g.code = e,
1632
- send: M
1633
- }, null, 8, ["modelValue"]), D(m).smsHint ? (y(), o("p", sn, E(D(d)(D(m).smsHint)), 1)) : a("v-if", !0)]),
1106
+ })) : D("v-if", !0),
1107
+ M(c, { prop: "code" }, {
1108
+ default: Y(() => [M(Ot, {
1109
+ modelValue: u.code,
1110
+ "onUpdate:modelValue": t[3] ||= (e) => u.code = e,
1111
+ send: C
1112
+ }, null, 8, ["modelValue"]), q(s).smsHint ? (V(), O("p", Ft, K(q(i)(q(s).smsHint)), 1)) : D("v-if", !0)]),
1634
1113
  _: 1
1635
1114
  }),
1636
- u(p, { prop: "password" }, {
1637
- default: N(() => [u(s, {
1638
- modelValue: g.password,
1639
- "onUpdate:modelValue": n[4] ||= (e) => g.password = e,
1115
+ M(c, { prop: "password" }, {
1116
+ default: Y(() => [M(o, {
1117
+ modelValue: u.password,
1118
+ "onUpdate:modelValue": t[4] ||= (e) => u.password = e,
1640
1119
  type: "password",
1641
1120
  "show-password": "",
1642
- placeholder: D(c)("campus.auth.newPasswordPlaceholder"),
1643
- "aria-label": D(c)("campus.auth.newPasswordPlaceholder"),
1121
+ placeholder: q(r)("campus.auth.newPasswordPlaceholder"),
1122
+ "aria-label": q(r)("campus.auth.newPasswordPlaceholder"),
1644
1123
  autocomplete: "new-password"
1645
1124
  }, {
1646
- prefix: N(() => [u($, { name: "lock" })]),
1125
+ prefix: Y(() => [M($, { name: "lock" })]),
1647
1126
  _: 1
1648
1127
  }, 8, [
1649
1128
  "modelValue",
@@ -1652,17 +1131,17 @@ var Yt = {
1652
1131
  ])]),
1653
1132
  _: 1
1654
1133
  }),
1655
- u(p, { prop: "confirm" }, {
1656
- default: N(() => [u(s, {
1657
- modelValue: g.confirm,
1658
- "onUpdate:modelValue": n[5] ||= (e) => g.confirm = e,
1134
+ M(c, { prop: "confirm" }, {
1135
+ default: Y(() => [M(o, {
1136
+ modelValue: u.confirm,
1137
+ "onUpdate:modelValue": t[5] ||= (e) => u.confirm = e,
1659
1138
  type: "password",
1660
1139
  "show-password": "",
1661
- placeholder: D(c)("campus.auth.confirmPlaceholder"),
1662
- "aria-label": D(c)("campus.auth.confirmPlaceholder"),
1140
+ placeholder: q(r)("campus.auth.confirmPlaceholder"),
1141
+ "aria-label": q(r)("campus.auth.confirmPlaceholder"),
1663
1142
  autocomplete: "new-password"
1664
1143
  }, {
1665
- prefix: N(() => [u($, { name: "lock" })]),
1144
+ prefix: Y(() => [M($, { name: "lock" })]),
1666
1145
  _: 1
1667
1146
  }, 8, [
1668
1147
  "modelValue",
@@ -1671,15 +1150,15 @@ var Yt = {
1671
1150
  ])]),
1672
1151
  _: 1
1673
1152
  }),
1674
- u(b, {
1153
+ M(l, {
1675
1154
  type: "primary",
1676
1155
  "native-type": "submit",
1677
1156
  size: "large",
1678
- loading: C.value,
1679
- disabled: !A.value,
1680
- class: h(["ca-auth-submit", { "ca-auth-submit--off": !A.value }])
1157
+ loading: g.value,
1158
+ disabled: !b.value,
1159
+ class: L(["ca-auth-submit", { "ca-auth-submit--off": !b.value }])
1681
1160
  }, {
1682
- default: N(() => [l(E(D(c)("campus.common.ok")), 1)]),
1161
+ default: Y(() => [j(K(q(r)("campus.common.ok")), 1)]),
1683
1162
  _: 1
1684
1163
  }, 8, [
1685
1164
  "loading",
@@ -1691,69 +1170,93 @@ var Yt = {
1691
1170
  }, 8, ["model", "rules"])], 64);
1692
1171
  };
1693
1172
  }
1694
- }), ln = {
1173
+ }), Lt = {
1695
1174
  key: 1,
1696
1175
  class: "ca-auth-off",
1697
1176
  role: "status"
1698
- }, un = /* @__PURE__ */ d({
1177
+ }, Rt = /* @__PURE__ */ N({
1699
1178
  __name: "ForgotPage",
1700
1179
  props: { preview: { type: Boolean } },
1701
1180
  setup(e) {
1702
- let { t } = q(), r = Ke().forgot, a = n(() => [{
1181
+ let { t } = c(), n = Le().forgot, r = w(() => [{
1703
1182
  key: "forgot",
1704
1183
  label: t("campus.auth.tabForgot")
1705
1184
  }, {
1706
1185
  key: "login",
1707
1186
  label: t("campus.auth.backLogin"),
1708
- to: Fe(J()).login
1187
+ to: m(f()).login
1709
1188
  }]);
1710
- return (n, c) => (y(), i(ut, {
1189
+ return (i, a) => (V(), E(et, {
1711
1190
  active: "forgot",
1712
- tabs: a.value,
1191
+ tabs: r.value,
1713
1192
  preview: e.preview
1714
1193
  }, {
1715
- default: N(() => [D(r) ? (y(), i(cn, {
1194
+ default: Y(() => [q(n) ? (V(), E(It, {
1716
1195
  key: 0,
1717
1196
  preview: e.preview
1718
- }, null, 8, ["preview"])) : (y(), o("div", ln, [s("h3", null, E(D(t)("campus.auth.unavailableTitle")), 1), s("p", null, E(D(t)("campus.auth.unavailableDesc")), 1)]))]),
1197
+ }, null, 8, ["preview"])) : (V(), O("div", Lt, [k("h3", null, K(q(t)("campus.auth.unavailableTitle")), 1), k("p", null, K(q(t)("campus.auth.unavailableDesc")), 1)]))]),
1719
1198
  _: 1
1720
1199
  }, 8, ["tabs", "preview"]));
1721
1200
  }
1722
- }), dn = /* @__PURE__ */ d({
1201
+ }), zt = /* @__PURE__ */ N({
1723
1202
  __name: "AuthPreview",
1724
1203
  props: { kind: {} },
1725
1204
  setup(e) {
1726
- return (t, n) => e.kind === "login" ? (y(), i(Rt, {
1205
+ return (t, n) => e.kind === "login" ? (V(), E(xt, {
1727
1206
  key: 0,
1728
1207
  preview: ""
1729
- })) : e.kind === "register" ? (y(), i(on, {
1208
+ })) : e.kind === "register" ? (V(), E(Pt, {
1730
1209
  key: 1,
1731
1210
  preview: ""
1732
- })) : (y(), i(un, {
1211
+ })) : (V(), E(Rt, {
1733
1212
  key: 2,
1734
1213
  preview: ""
1735
1214
  }));
1736
1215
  }
1737
- }), fn = { class: "ca-user-avatar" }, pn = ["src"], mn = /*#__PURE__*/ Z(/* @__PURE__ */ d({
1216
+ }), Bt = [
1217
+ "search",
1218
+ "notes",
1219
+ "todos",
1220
+ "fullscreen",
1221
+ "language",
1222
+ "notifications",
1223
+ "assistant",
1224
+ "settings",
1225
+ "account"
1226
+ ];
1227
+ function Vt(e, t = []) {
1228
+ let n = [...Bt, ...t], r = Array.isArray(e) ? e.filter((e) => n.includes(e)) : [];
1229
+ return [.../* @__PURE__ */ new Set([...r, ...n])];
1230
+ }
1231
+ function Ht(e = []) {
1232
+ let t = new Set(Bt), n = /* @__PURE__ */ new Map();
1233
+ for (let r of e) r.key.trim() && !t.has(r.key) && (t.add(r.key), n.set(r.key, r));
1234
+ return n;
1235
+ }
1236
+ function Ut(e) {
1237
+ return typeof e == "number" && Number.isFinite(e) && e > 0 ? `${e}px` : void 0;
1238
+ }
1239
+ // packages/core/src/layout/UserAvatar.vue?vue&type=script&setup=true&lang.ts
1240
+ var Wt = { class: "ca-user-avatar" }, Gt = ["src"], Kt = /*#__PURE__*/ s(/* @__PURE__ */ N({
1738
1241
  __name: "UserAvatar",
1739
1242
  props: {
1740
1243
  name: {},
1741
1244
  src: {}
1742
1245
  },
1743
- setup(t) {
1744
- let n = t, r = x(!1);
1745
- return j(() => n.src, () => {
1746
- r.value = !1;
1747
- }), (n, i) => (y(), o("span", fn, [t.src && !r.value ? (y(), o("img", {
1246
+ setup(e) {
1247
+ let t = e, n = H(!1);
1248
+ return J(() => t.src, () => {
1249
+ n.value = !1;
1250
+ }), (t, r) => (V(), O("span", Wt, [e.src && !n.value ? (V(), O("img", {
1748
1251
  key: 0,
1749
- src: t.src,
1252
+ src: e.src,
1750
1253
  alt: "",
1751
1254
  draggable: "false",
1752
- onError: i[0] ||= (e) => r.value = !0
1753
- }, null, 40, pn)) : (y(), o(e, { key: 1 }, [l(E(t.name?.slice(0, 1)), 1)], 64))]));
1255
+ onError: r[0] ||= (e) => n.value = !0
1256
+ }, null, 40, Gt)) : (V(), O(S, { key: 1 }, [j(K(e.name?.slice(0, 1)), 1)], 64))]));
1754
1257
  }
1755
- }), [["__scopeId", "data-v-b67c1b85"]]), hn = (e) => e.normalize("NFKC").toLowerCase().trim();
1756
- function gn(e) {
1258
+ }), [["__scopeId", "data-v-b67c1b85"]]), qt = (e) => e.normalize("NFKC").toLowerCase().trim();
1259
+ function Jt(e) {
1757
1260
  return e.filter((e) => /\p{Script=Han}/u.test(e)).flatMap((e) => {
1758
1261
  let t = {
1759
1262
  toneType: "none",
@@ -1761,15 +1264,15 @@ function gn(e) {
1761
1264
  nonZh: "consecutive",
1762
1265
  v: !0
1763
1266
  };
1764
- return [he(e, t), he(e, {
1267
+ return [Te(e, t), Te(e, {
1765
1268
  ...t,
1766
1269
  pattern: "first"
1767
1270
  })].map((e) => e.join("").replace(/[^a-z0-9]/g, ""));
1768
1271
  }).filter(Boolean);
1769
1272
  }
1770
- function _n(e, t, n) {
1771
- return Pe(J().menus).filter((t) => e(t.permission)).map((e) => {
1772
- let r = Me(e.key)?.titles.slice(0, -1) ?? [], i = t(e.title), a = r.map(t).join(" / "), o = [i, n(e.title)].map(hn);
1273
+ function Yt(e, t, n) {
1274
+ return y(f().menus).filter((t) => e(t.permission)).map((e) => {
1275
+ let r = _(e.key)?.titles.slice(0, -1) ?? [], i = t(e.title), a = r.map(t).join(" / "), o = [i, n(e.title)].map(qt);
1773
1276
  return {
1774
1277
  key: e.key,
1775
1278
  path: e.path,
@@ -1777,8 +1280,8 @@ function _n(e, t, n) {
1777
1280
  trail: a,
1778
1281
  icon: e.icon,
1779
1282
  titles: o,
1780
- pinyinTitles: gn(o),
1781
- terms: hn([
1283
+ pinyinTitles: Jt(o),
1284
+ terms: qt([
1782
1285
  a,
1783
1286
  ...r.map(n),
1784
1287
  ...o,
@@ -1787,29 +1290,29 @@ function _n(e, t, n) {
1787
1290
  };
1788
1291
  });
1789
1292
  }
1790
- function vn(e, t) {
1791
- let n = hn(t);
1293
+ function Xt(e, t) {
1294
+ let n = qt(t);
1792
1295
  if (!n) return e;
1793
1296
  let r = n.split(/\s+/), i = /^[a-z0-9\s]+$/.test(n) ? r.join("") : "";
1794
1297
  return e.flatMap((e) => {
1795
1298
  let t = r.every((t) => e.terms.includes(t)), a = i && e.pinyinTitles.some((e) => e.includes(i));
1796
1299
  return !t && !a ? [] : [{
1797
1300
  entry: e,
1798
- score: e.titles.includes(n) || hn(e.path) === n ? 0 : e.titles.some((e) => e.startsWith(n)) ? 1 : e.titles.some((e) => e.includes(n)) ? 2 : e.pinyinTitles.includes(i) ? 3 : t ? 4 : 5
1301
+ score: e.titles.includes(n) || qt(e.path) === n ? 0 : e.titles.some((e) => e.startsWith(n)) ? 1 : e.titles.some((e) => e.includes(n)) ? 2 : e.pinyinTitles.includes(i) ? 3 : t ? 4 : 5
1799
1302
  }];
1800
1303
  }).sort((e, t) => e.score - t.score).map(({ entry: e }) => e);
1801
1304
  }
1802
1305
  // packages/core/src/layout/MenuSearch.vue?vue&type=script&setup=true&lang.ts
1803
- var yn = ["aria-label"], bn = [
1306
+ var Zt = ["aria-label"], Qt = [
1804
1307
  "id",
1805
1308
  "aria-selected",
1806
1309
  "onMousemove",
1807
1310
  "onClick"
1808
- ], xn = { class: "ca-menu-search__label" }, Sn = { key: 0 }, Cn = {
1311
+ ], $t = { class: "ca-menu-search__label" }, en = { key: 0 }, tn = {
1809
1312
  key: 0,
1810
1313
  class: "ca-menu-search__empty",
1811
1314
  role: "status"
1812
- }, wn = { class: "ca-menu-search__keys" }, Tn = /*#__PURE__*/ Z(/* @__PURE__ */ d({
1315
+ }, nn = { class: "ca-menu-search__keys" }, rn = /*#__PURE__*/ s(/* @__PURE__ */ N({
1813
1316
  __name: "MenuSearch",
1814
1317
  props: {
1815
1318
  modelValue: {
@@ -1819,39 +1322,39 @@ var yn = ["aria-label"], bn = [
1819
1322
  modelModifiers: {}
1820
1323
  },
1821
1324
  emits: ["update:modelValue"],
1822
- setup(t) {
1823
- let r = k(t, "modelValue"), { t: c, te: d, label: f, locale: p } = q(), h = Q(), g = G(), _ = x(""), v = x(0), b = O(), C = `${b}-input`, T = `${b}-results`, M = (e) => `${T}-${e}`, I = n(() => {
1824
- let e = p.value === "zh-CN" ? "en-US" : "zh-CN";
1825
- return _n((e) => h.can(e), f, (t) => d(t, e) ? c(t, {}, { locale: e }) : t);
1826
- }), L = n(() => vn(I.value, _.value));
1827
- j(r, (e) => {
1828
- e && (_.value = "", v.value = 0);
1829
- }), j(L, () => {
1830
- v.value = 0;
1325
+ setup(e) {
1326
+ let t = ae(e, "modelValue"), { t: n, te: r, label: i, locale: a } = c(), o = b(), s = Q(), l = H(""), u = H(0), d = ie(), f = `${d}-input`, p = `${d}-results`, m = (e) => `${p}-${e}`, h = w(() => {
1327
+ let e = a.value === "zh-CN" ? "en-US" : "zh-CN";
1328
+ return Yt((e) => o.can(e), i, (t) => r(t, e) ? n(t, {}, { locale: e }) : t);
1329
+ }), g = w(() => Xt(h.value, l.value));
1330
+ J(t, (e) => {
1331
+ e && (l.value = "", u.value = 0);
1332
+ }), J(g, () => {
1333
+ u.value = 0;
1831
1334
  });
1832
- async function R() {
1833
- await m(), await m(), r.value && document.getElementById(C)?.focus();
1335
+ async function _() {
1336
+ await I(), await I(), t.value && document.getElementById(f)?.focus();
1834
1337
  }
1835
- function z(e) {
1836
- r.value = !1, g.push({ name: e.key });
1338
+ function v(e) {
1339
+ t.value = !1, s.push({ name: e.key });
1837
1340
  }
1838
- async function ee(e) {
1839
- if (e.isComposing || e.keyCode === 229 || !L.value.length) return;
1341
+ async function y(e) {
1342
+ if (e.isComposing || e.keyCode === 229 || !g.value.length) return;
1840
1343
  if (e.key === "Enter") {
1841
- e.preventDefault(), z(L.value[v.value]);
1344
+ e.preventDefault(), v(g.value[u.value]);
1842
1345
  return;
1843
1346
  }
1844
1347
  if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
1845
1348
  e.preventDefault();
1846
1349
  let t = e.key === "ArrowDown" ? 1 : -1;
1847
- v.value = (v.value + t + L.value.length) % L.value.length, await m(), document.getElementById(M(v.value))?.scrollIntoView({ block: "nearest" });
1350
+ u.value = (u.value + t + g.value.length) % g.value.length, await I(), document.getElementById(m(u.value))?.scrollIntoView({ block: "nearest" });
1848
1351
  }
1849
- return (t, n) => {
1850
- let d = w("ca-icon"), f = w("ca-input"), p = w("ca-dialog");
1851
- return y(), i(p, {
1852
- modelValue: r.value,
1853
- "onUpdate:modelValue": n[2] ||= (e) => r.value = e,
1854
- title: D(c)("campus.menuSearch.title"),
1352
+ return (e, r) => {
1353
+ let i = W("ca-icon"), a = W("ca-input"), o = W("ca-dialog");
1354
+ return V(), E(o, {
1355
+ modelValue: t.value,
1356
+ "onUpdate:modelValue": r[2] ||= (e) => t.value = e,
1357
+ title: q(n)("campus.menuSearch.title"),
1855
1358
  width: "min(560px, calc(100vw - 24px))",
1856
1359
  top: "min(12vh, 96px)",
1857
1360
  "append-to-body": "",
@@ -1860,28 +1363,28 @@ var yn = ["aria-label"], bn = [
1860
1363
  "header-class": "ca-menu-search__header",
1861
1364
  "body-class": "ca-menu-search__body",
1862
1365
  class: "ca-menu-search",
1863
- onOpenAutoFocus: R
1366
+ onOpenAutoFocus: _
1864
1367
  }, {
1865
- default: N(() => [
1866
- s("div", {
1368
+ default: Y(() => [
1369
+ k("div", {
1867
1370
  class: "ca-menu-search__input",
1868
- onKeydown: ee
1869
- }, [u(f, {
1870
- id: C,
1871
- modelValue: _.value,
1872
- "onUpdate:modelValue": n[0] ||= (e) => _.value = e,
1371
+ onKeydown: y
1372
+ }, [M(a, {
1373
+ id: f,
1374
+ modelValue: l.value,
1375
+ "onUpdate:modelValue": r[0] ||= (e) => l.value = e,
1873
1376
  class: "ca-menu-search__control",
1874
- placeholder: D(c)("campus.menuSearch.placeholder"),
1875
- "aria-label": D(c)("campus.menuSearch.title"),
1876
- "aria-controls": T,
1877
- "aria-expanded": L.value.length > 0,
1878
- "aria-activedescendant": L.value.length ? M(v.value) : void 0,
1377
+ placeholder: q(n)("campus.menuSearch.placeholder"),
1378
+ "aria-label": q(n)("campus.menuSearch.title"),
1379
+ "aria-controls": p,
1380
+ "aria-expanded": g.value.length > 0,
1381
+ "aria-activedescendant": g.value.length ? m(u.value) : void 0,
1879
1382
  "container-role": "combobox",
1880
1383
  "aria-autocomplete": "list",
1881
1384
  autocomplete: "off",
1882
1385
  spellcheck: "false"
1883
1386
  }, {
1884
- prefix: N(() => [u(d, {
1387
+ prefix: Y(() => [M(i, {
1885
1388
  name: "search",
1886
1389
  size: 18,
1887
1390
  "aria-hidden": "true"
@@ -1894,96 +1397,378 @@ var yn = ["aria-label"], bn = [
1894
1397
  "aria-expanded",
1895
1398
  "aria-activedescendant"
1896
1399
  ])], 32),
1897
- P(s("ul", {
1898
- id: T,
1400
+ X(k("ul", {
1401
+ id: p,
1899
1402
  class: "ca-menu-search__results",
1900
1403
  role: "listbox",
1901
- "aria-label": D(c)("campus.menuSearch.results")
1902
- }, [(y(!0), o(e, null, S(L.value, (e, t) => (y(), o("li", {
1903
- id: M(t),
1404
+ "aria-label": q(n)("campus.menuSearch.results")
1405
+ }, [(V(!0), O(S, null, U(g.value, (e, t) => (V(), O("li", {
1406
+ id: m(t),
1904
1407
  key: e.key,
1905
1408
  role: "option",
1906
- "aria-selected": t === v.value,
1907
- onMousemove: (e) => v.value = t,
1908
- onMousedown: n[1] ||= F(() => {}, ["prevent"]),
1909
- onClick: (t) => z(e)
1409
+ "aria-selected": t === u.value,
1410
+ onMousemove: (e) => u.value = t,
1411
+ onMousedown: r[1] ||= Z(() => {}, ["prevent"]),
1412
+ onClick: (t) => v(e)
1910
1413
  }, [
1911
- u(d, {
1414
+ M(i, {
1912
1415
  name: e.icon || "document",
1913
1416
  size: 18,
1914
1417
  "aria-hidden": "true"
1915
1418
  }, null, 8, ["name"]),
1916
- s("span", xn, [s("strong", null, E(e.title), 1), e.trail ? (y(), o("small", Sn, E(e.trail), 1)) : a("v-if", !0)]),
1917
- u(d, {
1419
+ k("span", $t, [k("strong", null, K(e.title), 1), e.trail ? (V(), O("small", en, K(e.trail), 1)) : D("v-if", !0)]),
1420
+ M(i, {
1918
1421
  name: "right",
1919
1422
  size: 16,
1920
1423
  class: "ca-menu-search__arrow",
1921
1424
  "aria-hidden": "true"
1922
1425
  })
1923
- ], 40, bn))), 128))], 8, yn), [[A, L.value.length]]),
1924
- L.value.length ? a("v-if", !0) : (y(), o("p", Cn, E(D(c)("campus.menuSearch.empty")), 1)),
1925
- s("div", wn, [
1926
- s("span", null, [
1927
- n[3] ||= s("kbd", null, "↑", -1),
1928
- n[4] ||= l(),
1929
- n[5] ||= s("kbd", null, "↓", -1),
1930
- l(" " + E(D(c)("campus.menuSearch.navigate")), 1)
1426
+ ], 40, Qt))), 128))], 8, Zt), [[oe, g.value.length]]),
1427
+ g.value.length ? D("v-if", !0) : (V(), O("p", tn, K(q(n)("campus.menuSearch.empty")), 1)),
1428
+ k("div", nn, [
1429
+ k("span", null, [
1430
+ r[3] ||= k("kbd", null, "↑", -1),
1431
+ r[4] ||= j(),
1432
+ r[5] ||= k("kbd", null, "↓", -1),
1433
+ j(" " + K(q(n)("campus.menuSearch.navigate")), 1)
1931
1434
  ]),
1932
- s("span", null, [n[6] ||= s("kbd", null, "↵", -1), l(" " + E(D(c)("campus.menuSearch.open")), 1)]),
1933
- s("span", null, [n[7] ||= s("kbd", null, "Esc", -1), l(" " + E(D(c)("campus.menuSearch.close")), 1)])
1435
+ k("span", null, [r[6] ||= k("kbd", null, "↵", -1), j(" " + K(q(n)("campus.menuSearch.open")), 1)]),
1436
+ k("span", null, [r[7] ||= k("kbd", null, "Esc", -1), j(" " + K(q(n)("campus.menuSearch.close")), 1)])
1934
1437
  ])
1935
1438
  ]),
1936
1439
  _: 1
1937
1440
  }, 8, ["modelValue", "title"]);
1938
1441
  };
1939
1442
  }
1940
- }), [["__scopeId", "data-v-1f227e14"]]), En = { class: "ca-header" }, Dn = [
1443
+ }), [["__scopeId", "data-v-1f227e14"]]), an = ["src"], on = { class: "ca-header__titles" }, sn = { class: "ca-header__name" }, cn = {
1444
+ key: 0,
1445
+ class: "ca-header__subtitle"
1446
+ }, ln = /*#__PURE__*/ s(/* @__PURE__ */ N({
1447
+ __name: "CaHeaderBrand",
1448
+ props: {
1449
+ name: {},
1450
+ logo: {},
1451
+ subtitle: {}
1452
+ },
1453
+ setup(e) {
1454
+ return (t, n) => (V(), O(S, null, [e.logo ? (V(), O("img", {
1455
+ key: 0,
1456
+ src: e.logo,
1457
+ alt: "",
1458
+ class: "ca-header__logo"
1459
+ }, null, 8, an)) : (V(), O(S, { key: 1 }, [D(" 没有配置 logo 时用框架默认标志(学士帽),颜色跟随头部前景色 "), n[0] ||= k("svg", {
1460
+ class: "ca-header__logo",
1461
+ viewBox: "0 0 32 32",
1462
+ fill: "none",
1463
+ stroke: "currentColor",
1464
+ "stroke-width": "2",
1465
+ "stroke-linecap": "round",
1466
+ "stroke-linejoin": "round",
1467
+ "aria-hidden": "true"
1468
+ }, [
1469
+ k("path", { d: "M16 6 3 12.5 16 19l13-6.5L16 6Z" }),
1470
+ k("path", { d: "M9 16.5v5.2c0 1.6 3.1 3.3 7 3.3s7-1.7 7-3.3v-5.2" }),
1471
+ k("path", { d: "M29 12.5V20" })
1472
+ ], -1)], 2112)), k("div", on, [k("strong", sn, K(e.name), 1), e.subtitle ? (V(), O("span", cn, K(e.subtitle), 1)) : D("v-if", !0)])], 64));
1473
+ }
1474
+ }), [["__scopeId", "data-v-41208d6f"]]);
1475
+ // packages/core/src/layout/quick-chat/selection.ts
1476
+ function un(e, t) {
1477
+ let n = [];
1478
+ for (let r of e) {
1479
+ let e = t[r.key];
1480
+ if (r.options.some((t) => t.value === e)) n.push([r.key, e]);
1481
+ else if (r.required) break;
1482
+ }
1483
+ return Object.fromEntries(n);
1484
+ }
1485
+ function dn(e, t, n, r) {
1486
+ let i = e.findIndex((e) => e.key === n);
1487
+ if (i < 0) return t;
1488
+ let a = un(e.slice(0, i), t);
1489
+ return un(e.slice(0, i + 1), {
1490
+ ...a,
1491
+ ...r && { [n]: r }
1492
+ });
1493
+ }
1494
+ function fn(e, t) {
1495
+ let n = un(e, t);
1496
+ return e.every((e) => !e.required || Object.hasOwn(n, e.key));
1497
+ }
1498
+ // packages/core/src/layout/quick-chat/CaQuickChat.vue?vue&type=script&setup=true&lang.ts
1499
+ var pn = ["aria-busy"], mn = {
1500
+ key: 1,
1501
+ class: "ca-quick-chat__status",
1502
+ role: "status"
1503
+ }, hn = {
1504
+ key: 2,
1505
+ class: "ca-quick-chat__error",
1506
+ role: "alert"
1507
+ }, gn = { class: "ca-quick-chat__actions" }, _n = {
1508
+ key: 4,
1509
+ class: "ca-quick-chat__error",
1510
+ role: "alert"
1511
+ }, vn = /*#__PURE__*/ s(/* @__PURE__ */ N({
1512
+ __name: "CaQuickChat",
1513
+ props: /*@__PURE__*/ F({
1514
+ options: {},
1515
+ token: {}
1516
+ }, {
1517
+ modelValue: {
1518
+ type: Boolean,
1519
+ required: !0
1520
+ },
1521
+ modelModifiers: {}
1522
+ }),
1523
+ emits: ["update:modelValue"],
1524
+ setup(e) {
1525
+ let t = e, n = ae(e, "modelValue"), { t: r, label: i } = c(), a = ie(), o = re([]), s = re({}), l = H(""), u = H(), d = H([]), f = H(!1), p = H(!1), m = H(!1), h = H(""), g = H(""), _ = H(), v = H(), y, b, x = w(() => p.value || !f.value || m.value || !fn(o.value, s.value)), C = w(() => !x.value && !!l.value.trim());
1526
+ async function T() {
1527
+ if (!t.options.loadFields) {
1528
+ f.value = !0;
1529
+ return;
1530
+ }
1531
+ y?.abort();
1532
+ let e = new AbortController();
1533
+ y = e, p.value = !0, h.value = "";
1534
+ try {
1535
+ let n = await t.options.loadFields(t.token, s.value, e.signal);
1536
+ if (e.signal.aborted) return;
1537
+ s.value = un(n, s.value), o.value = n, f.value = !0;
1538
+ } catch (t) {
1539
+ if (e.signal.aborted) return;
1540
+ f.value = !1, h.value = t instanceof Error ? t.message : r("campus.quickChat.loadFailed");
1541
+ } finally {
1542
+ y === e && (p.value = !1);
1543
+ }
1544
+ }
1545
+ function A(e, t) {
1546
+ m.value || (s.value[e] ?? "") === (t ?? "") || (s.value = dn(o.value, s.value, e, t), u.value = void 0, d.value = [], g.value = "", T());
1547
+ }
1548
+ function ee(e) {
1549
+ l.value = e;
1550
+ }
1551
+ async function N() {
1552
+ if (!C.value) return;
1553
+ let e = l.value, n = e.trim();
1554
+ m.value = !0, g.value = "";
1555
+ let i = new AbortController();
1556
+ b = i;
1557
+ try {
1558
+ let r = await t.options.send(t.token, {
1559
+ text: n,
1560
+ selection: s.value,
1561
+ threadId: u.value
1562
+ }, i.signal);
1563
+ if (i.signal.aborted) return;
1564
+ r.threadId && (u.value = r.threadId), d.value.push({
1565
+ text: n,
1566
+ sender: "you"
1567
+ }), r.reply && d.value.push({
1568
+ text: r.reply,
1569
+ sender: "assistant"
1570
+ }), l.value === e && (l.value = ""), await I(), _.value && (_.value.scrollTop = _.value.scrollHeight);
1571
+ } catch (e) {
1572
+ i.signal.aborted || (g.value = e instanceof Error ? e.message : r("campus.quickChat.sendFailed"));
1573
+ } finally {
1574
+ i.signal.aborted || (m.value = !1);
1575
+ }
1576
+ }
1577
+ function P(e) {
1578
+ e.key !== "Enter" || e.isComposing || e.keyCode === 229 || e.shiftKey || e.ctrlKey || e.metaKey || e.altKey || (e.preventDefault(), e.repeat || N());
1579
+ }
1580
+ async function F() {
1581
+ await I(), n.value && v.value?.querySelector("textarea:not(:disabled), input:not(:disabled)")?.focus();
1582
+ }
1583
+ return J(n, (e) => {
1584
+ e && !f.value && !p.value && T();
1585
+ }, { immediate: !0 }), J(() => t.token, () => {
1586
+ y?.abort(), b?.abort(), o.value = [], s.value = {}, d.value = [], l.value = "", u.value = void 0, h.value = "", g.value = "", f.value = !1, p.value = !1, m.value = !1, n.value && T();
1587
+ }), z(() => {
1588
+ y?.abort(), b?.abort();
1589
+ }), (t, c) => {
1590
+ let u = W("ca-option"), f = W("ca-select"), y = W("ca-button"), b = W("ca-input"), w = W("ca-dialog");
1591
+ return V(), E(w, {
1592
+ modelValue: n.value,
1593
+ "onUpdate:modelValue": c[1] ||= (e) => n.value = e,
1594
+ title: e.options.title ? q(i)(e.options.title) : q(r)("campus.quickChat.title"),
1595
+ width: "min(620px, calc(100vw - 24px))",
1596
+ top: "min(12vh, 96px)",
1597
+ "append-to-body": "",
1598
+ class: "ca-quick-chat",
1599
+ onOpenAutoFocus: F
1600
+ }, {
1601
+ default: Y(() => [
1602
+ o.value.length ? (V(), O("div", {
1603
+ key: 0,
1604
+ class: "ca-quick-chat__fields",
1605
+ "aria-busy": p.value
1606
+ }, [(V(!0), O(S, null, U(o.value, (e, t) => (V(), O("label", {
1607
+ key: e.key,
1608
+ class: "ca-quick-chat__field"
1609
+ }, [k("span", null, K(q(i)(e.label)), 1), M(f, {
1610
+ id: `${q(a)}-${t}`,
1611
+ "aria-label": q(i)(e.label),
1612
+ "aria-required": e.required,
1613
+ "model-value": s.value[e.key] ?? "",
1614
+ placeholder: q(r)("campus.quickChat.select"),
1615
+ disabled: p.value || m.value || !e.options.length,
1616
+ clearable: !e.required,
1617
+ "onUpdate:modelValue": (t) => A(e.key, t)
1618
+ }, {
1619
+ default: Y(() => [(V(!0), O(S, null, U(e.options, (e) => (V(), E(u, {
1620
+ key: e.value,
1621
+ value: e.value,
1622
+ label: q(i)(e.label)
1623
+ }, null, 8, ["value", "label"]))), 128))]),
1624
+ _: 2
1625
+ }, 1032, [
1626
+ "id",
1627
+ "aria-label",
1628
+ "aria-required",
1629
+ "model-value",
1630
+ "placeholder",
1631
+ "disabled",
1632
+ "clearable",
1633
+ "onUpdate:modelValue"
1634
+ ])]))), 128))], 8, pn)) : D("v-if", !0),
1635
+ p.value ? (V(), O("p", mn, K(q(r)("campus.common.loading")), 1)) : D("v-if", !0),
1636
+ h.value ? (V(), O("div", hn, [j(K(h.value) + " ", 1), M(y, {
1637
+ size: "small",
1638
+ text: "",
1639
+ onClick: T
1640
+ }, {
1641
+ default: Y(() => [j(K(q(r)("campus.quickChat.retry")), 1)]),
1642
+ _: 1
1643
+ })])) : D("v-if", !0),
1644
+ d.value.length ? (V(), O("div", {
1645
+ key: 3,
1646
+ ref_key: "history",
1647
+ ref: _,
1648
+ class: "ca-quick-chat__history",
1649
+ role: "log",
1650
+ "aria-live": "polite"
1651
+ }, [(V(!0), O(S, null, U(d.value, (e, t) => (V(), O("div", {
1652
+ key: t,
1653
+ class: L(["ca-quick-chat__message", { "is-user": e.sender === "you" }])
1654
+ }, [k("strong", null, K(e.sender === "you" ? q(r)("campus.quickChat.you") : q(r)("campus.quickChat.assistant")), 1), k("p", null, K(e.text), 1)], 2))), 128))], 512)) : D("v-if", !0),
1655
+ k("div", {
1656
+ ref_key: "composer",
1657
+ ref: v,
1658
+ class: "ca-quick-chat__composer"
1659
+ }, [e.options.composer ? (V(), E(G(e.options.composer), {
1660
+ key: 0,
1661
+ draft: l.value,
1662
+ selection: s.value,
1663
+ disabled: x.value,
1664
+ sending: m.value,
1665
+ "set-draft": ee,
1666
+ send: N
1667
+ }, null, 8, [
1668
+ "draft",
1669
+ "selection",
1670
+ "disabled",
1671
+ "sending"
1672
+ ])) : (V(), O(S, { key: 1 }, [M(b, {
1673
+ modelValue: l.value,
1674
+ "onUpdate:modelValue": c[0] ||= (e) => l.value = e,
1675
+ type: "textarea",
1676
+ rows: 3,
1677
+ "aria-label": q(r)("campus.quickChat.message"),
1678
+ placeholder: e.options.placeholder ? q(i)(e.options.placeholder) : q(r)("campus.quickChat.placeholder"),
1679
+ onKeydown: P
1680
+ }, null, 8, [
1681
+ "modelValue",
1682
+ "aria-label",
1683
+ "placeholder"
1684
+ ]), k("div", gn, [M(y, {
1685
+ type: "primary",
1686
+ loading: m.value,
1687
+ disabled: !C.value,
1688
+ onClick: N
1689
+ }, {
1690
+ default: Y(() => [j(K(q(r)("campus.quickChat.send")), 1)]),
1691
+ _: 1
1692
+ }, 8, ["loading", "disabled"])])], 64))], 512),
1693
+ g.value ? (V(), O("p", _n, K(g.value), 1)) : D("v-if", !0)
1694
+ ]),
1695
+ _: 1
1696
+ }, 8, ["modelValue", "title"]);
1697
+ };
1698
+ }
1699
+ }), [["__scopeId", "data-v-1c5824ee"]]);
1700
+ // packages/core/src/layout/quick-chat/shortcut.ts
1701
+ function yn(e) {
1702
+ return e.defaultPrevented || e.isComposing || e.repeat ? !1 : !e.target?.closest?.("input, textarea, select, [role=\"textbox\"], [contenteditable]:not([contenteditable=\"false\"])");
1703
+ }
1704
+ // packages/core/src/layout/HeaderBar.vue?vue&type=script&setup=true&lang.ts
1705
+ var bn = { class: "ca-header" }, xn = [
1941
1706
  "title",
1942
1707
  "aria-label",
1943
1708
  "aria-expanded"
1944
- ], On = { class: "ca-header__brand" }, kn = ["src"], An = { class: "ca-header__titles" }, jn = { class: "ca-header__name" }, Mn = {
1709
+ ], Sn = { class: "ca-header__brand" }, Cn = {
1945
1710
  key: 0,
1946
- class: "ca-header__subtitle"
1947
- }, Nn = ["aria-label"], Pn = ["onClick"], Fn = { class: "ca-header__tools" }, In = ["aria-label", "aria-haspopup"], Ln = { class: "ca-header__search-text" }, Rn = {
1711
+ class: "ca-header__center"
1712
+ }, wn = ["aria-label"], Tn = ["onClick"], En = { class: "ca-header__tools" }, Dn = ["aria-label", "aria-haspopup"], On = { class: "ca-header__search-text" }, kn = {
1948
1713
  class: "ca-header__kbd",
1949
1714
  "aria-hidden": "true"
1950
- }, zn = [
1715
+ }, An = [
1951
1716
  "title",
1952
1717
  "aria-label",
1953
1718
  "aria-pressed"
1954
- ], Bn = ["title", "aria-label"], Vn = { class: "ca-header__icon-text" }, Hn = ["title", "aria-label"], Un = ["title", "aria-label"], Wn = ["title", "aria-label"], Gn = ["title", "aria-label"], Kn = { class: "ca-settings__intro" }, qn = { class: "ca-settings__group" }, Jn = { class: "ca-settings__title" }, Yn = ["aria-label"], Xn = ["aria-pressed", "onClick"], Zn = {
1719
+ ], jn = ["title", "aria-label"], Mn = { class: "ca-header__icon-text" }, Nn = ["title", "aria-label"], Pn = [
1720
+ "title",
1721
+ "aria-label",
1722
+ "aria-haspopup",
1723
+ "aria-keyshortcuts"
1724
+ ], Fn = ["title", "aria-label"], In = ["title", "aria-label"], Ln = { class: "ca-settings__intro" }, Rn = { class: "ca-settings__group" }, zn = { class: "ca-settings__title" }, Bn = ["aria-label"], Vn = ["aria-pressed", "onClick"], Hn = {
1955
1725
  key: 0,
1956
1726
  class: "ca-settings__group"
1957
- }, Qn = { class: "ca-settings__color-heading" }, $n = { class: "ca-settings__title" }, er = {
1727
+ }, Un = { class: "ca-settings__color-heading" }, Wn = { class: "ca-settings__title" }, Gn = {
1958
1728
  class: "ca-settings__color-value",
1959
1729
  "aria-live": "polite"
1960
- }, tr = { key: 0 }, nr = ["aria-label"], rr = [
1730
+ }, Kn = { key: 0 }, qn = ["aria-label"], Jn = [
1961
1731
  "aria-label",
1962
1732
  "title",
1963
1733
  "aria-pressed",
1964
1734
  "onClick"
1965
- ], ir = { class: "ca-settings__color-actions" }, ar = { class: "ca-settings__custom" }, or = ["value", "aria-label"], sr = ["disabled"], cr = { class: "ca-settings__group" }, lr = { class: "ca-settings__title" }, ur = ["aria-label"], dr = ["aria-pressed", "onClick"], fr = /*#__PURE__*/ Z(/* @__PURE__ */ d({
1735
+ ], Yn = { class: "ca-settings__color-actions" }, Xn = { class: "ca-settings__custom" }, Zn = ["value", "aria-label"], Qn = ["disabled"], $n = { class: "ca-settings__group" }, er = { class: "ca-settings__title" }, tr = ["aria-label"], nr = ["aria-pressed", "onClick"], rr = /*#__PURE__*/ s(/* @__PURE__ */ N({
1966
1736
  __name: "HeaderBar",
1967
1737
  setup(t) {
1968
- let r = W(), c = G(), d = Q(), f = ft(), p = Ue(), { t: m, label: b, locale: C } = q(), T = J(), O = x(!1), k = typeof navigator < "u" && /Mac|iPhone|iPad/i.test(navigator.platform) ? "⌘ K" : "Ctrl K";
1969
- function A() {
1970
- T.headerTools?.search ? T.headerTools.search() : O.value = !0;
1738
+ let n = _e(), r = Q(), i = b(), a = v(), o = Ne(), { t: s, label: l, locale: u } = c(), p = f(), m = Ht(p.headerToolItems), h = Vt(p.headerToolOrder, [...m.keys()]), g = H(!1), _ = p.quickChat && (p.quickChat.shortcut ?? {
1739
+ label: "G /",
1740
+ aria: "G /",
1741
+ matches: (e) => !(e.ctrlKey || e.metaKey || e.altKey || e.shiftKey) && (e.key.toLowerCase() === "g" || e.key === "/")
1742
+ }), y = w(() => [s("campus.quickChat.title"), _ && _.label].filter(Boolean).join(" · "));
1743
+ function x(e) {
1744
+ i.isLoggedIn && _ && yn(e) && _.matches(e) && (Array.from(document.querySelectorAll("[aria-modal=\"true\"]")).some((e) => e.getClientRects().length > 0) || (e.preventDefault(), g.value = !0));
1971
1745
  }
1972
- function j(e) {
1973
- e.isComposing || e.defaultPrevented || (e.key === "Escape" && O.value ? (e.preventDefault(), e.stopPropagation(), O.value = !1) : !(e.metaKey || e.ctrlKey) || e.altKey || e.shiftKey || e.key.toLowerCase() !== "k" || e.target instanceof Element && e.target.closest("[aria-modal=\"true\"]") || (e.preventDefault(), e.repeat || A()));
1746
+ J(() => i.token, () => {
1747
+ g.value = !1;
1748
+ });
1749
+ let C = ee(() => import("./PersonalNotes-CpdpdMrP.js")), T = ee(() => import("./PersonalTodos-f4XMo1mg.js")), A = H(!1), N = typeof navigator < "u" && /Mac|iPhone|iPad/i.test(navigator.platform) ? "⌘ K" : "Ctrl K";
1750
+ function P() {
1751
+ p.headerTools?.search ? p.headerTools.search() : A.value = !0;
1974
1752
  }
1975
- v(() => window.addEventListener("keydown", j, !0)), _(() => window.removeEventListener("keydown", j, !0));
1976
- let M = x(!1), P = [{
1753
+ function F(e) {
1754
+ e.isComposing || e.defaultPrevented || (e.key === "Escape" && A.value ? (e.preventDefault(), e.stopPropagation(), A.value = !1) : !(e.metaKey || e.ctrlKey) || e.altKey || e.shiftKey || e.key.toLowerCase() !== "k" || e.target instanceof Element && e.target.closest("[aria-modal=\"true\"]") || (e.preventDefault(), e.repeat || P()));
1755
+ }
1756
+ B(() => {
1757
+ window.addEventListener("keydown", F, !0), _ && window.addEventListener("keydown", x, !0);
1758
+ }), z(() => {
1759
+ window.removeEventListener("keydown", F, !0), window.removeEventListener("keydown", x, !0);
1760
+ });
1761
+ let I = H(!1), te = [{
1977
1762
  value: "border",
1978
1763
  label: "campus.settings.boxBorder"
1979
1764
  }, {
1980
1765
  value: "shadow",
1981
1766
  label: "campus.settings.boxShadow"
1982
- }], F = n(() => b(p.theme.siteName ?? T.brand.name)), I = n(() => p.theme.logo ?? T.brand.logo), L = n(() => (T.shortcuts ?? []).filter((e) => d.can(e.permission)));
1983
- function R(e) {
1984
- r.path !== e && c.push(e);
1767
+ }], ne = w(() => l(o.theme.siteName ?? p.brand.name)), re = w(() => o.theme.logo ?? p.brand.logo), ie = w(() => (p.shortcuts ?? []).filter((e) => i.can(e.permission)));
1768
+ function ae(e) {
1769
+ n.path !== e && r.push(e);
1985
1770
  }
1986
- let z = [
1771
+ let oe = [
1987
1772
  {
1988
1773
  value: "light",
1989
1774
  icon: "sunny"
@@ -1996,7 +1781,7 @@ var yn = ["aria-label"], bn = [
1996
1781
  value: "auto",
1997
1782
  icon: "monitor"
1998
1783
  }
1999
- ], te = [
1784
+ ], se = [
2000
1785
  "#1677ff",
2001
1786
  "#364fc7",
2002
1787
  "#6b1d7a",
@@ -2005,48 +1790,48 @@ var yn = ["aria-label"], bn = [
2005
1790
  "#f59f00",
2006
1791
  "#0f9d58",
2007
1792
  "#0ca678"
2008
- ], B = n(() => ue(se(p.theme.primary))), V = n(() => p.userPrimary && te.find((e) => e === B.value));
2009
- function ne(e, t) {
1793
+ ], X = w(() => we(xe(o.theme.primary))), Z = w(() => o.userPrimary && se.find((e) => e === X.value));
1794
+ function ce(e, t) {
2010
1795
  let n = t.currentTarget?.getBoundingClientRect();
2011
- p.setMode(e, n ? {
1796
+ o.setMode(e, n ? {
2012
1797
  x: n.left + n.width / 2,
2013
1798
  y: n.top + n.height / 2
2014
1799
  } : void 0);
2015
1800
  }
2016
- function re(e) {
2017
- C.value = e, De(e);
1801
+ function le(t) {
1802
+ u.value = t, e(t);
2018
1803
  }
2019
- async function H(e) {
2020
- e === "account" ? T.onAccountClick ? await T.onAccountClick("header") : T.accountPath && R(T.accountPath) : (await d.logout(), await c.replace({ name: Y(J()).login }));
1804
+ async function ue(e) {
1805
+ e === "account" ? p.onAccountClick ? await p.onAccountClick("header") : p.accountPath && ae(p.accountPath) : (await i.logout(), await r.replace({ name: d(f()).login }));
2021
1806
  }
2022
- let U = x(!1);
2023
- function ie() {
2024
- U.value = !!document.fullscreenElement;
1807
+ let de = H(!1);
1808
+ function pe() {
1809
+ de.value = !!document.fullscreenElement;
2025
1810
  }
2026
- async function ae() {
2027
- f.pageScreenManual();
1811
+ async function me() {
1812
+ a.pageScreenManual();
2028
1813
  try {
2029
1814
  document.fullscreenElement ? await document.exitFullscreen() : await document.documentElement.requestFullscreen();
2030
1815
  } catch {}
2031
1816
  }
2032
- v(() => {
2033
- ie(), document.addEventListener("fullscreenchange", ie);
2034
- }), _(() => document.removeEventListener("fullscreenchange", ie));
2035
- function oe(e) {
2036
- T.headerTools?.[e]?.();
1817
+ B(() => {
1818
+ pe(), document.addEventListener("fullscreenchange", pe);
1819
+ }), z(() => document.removeEventListener("fullscreenchange", pe));
1820
+ function he(e) {
1821
+ e === "assistant" && p.quickChat && i.isLoggedIn ? g.value = !0 : p.headerTools?.[e]?.();
2037
1822
  }
2038
- return (t, n) => {
2039
- let c = w("ca-icon"), _ = w("ca-dropdown-item"), v = w("ca-dropdown-menu"), x = w("ca-dropdown"), j = w("ca-drawer");
2040
- return y(), o("header", En, [
2041
- a(" 菜单按钮:手机打开抽屉;电脑档两栏都收起时也显示,点击重新显示侧栏 "),
2042
- s("button", {
1823
+ return (e, t) => {
1824
+ let r = W("ca-icon"), c = W("ca-dropdown-item"), d = W("ca-dropdown-menu"), f = W("ca-dropdown"), v = W("ca-drawer");
1825
+ return V(), O("header", bn, [
1826
+ D(" 菜单按钮:手机打开抽屉;电脑档两栏都收起时也显示,点击重新显示侧栏 "),
1827
+ k("button", {
2043
1828
  type: "button",
2044
- class: h(["ca-header__hamburger ca-header__icon", { "is-side-hidden": D(f).sideHiddenActive }]),
2045
- title: D(f).sideHiddenActive ? D(m)("campus.side.openMenu") : void 0,
2046
- "aria-label": D(m)("campus.side.openMenu"),
2047
- "aria-expanded": !D(f).sideHiddenActive && D(f).mobileMenuOpen,
2048
- onClick: n[0] ||= (e) => D(f).sideHiddenActive ? D(f).showSide() : D(f).openMobileMenu()
2049
- }, [...n[8] ||= [s("svg", {
1829
+ class: L(["ca-header__hamburger ca-header__icon", { "is-side-hidden": q(a).sideHiddenActive }]),
1830
+ title: q(a).sideHiddenActive ? q(s)("campus.side.openMenu") : void 0,
1831
+ "aria-label": q(s)("campus.side.openMenu"),
1832
+ "aria-expanded": !q(a).sideHiddenActive && q(a).mobileMenuOpen,
1833
+ onClick: t[0] ||= (e) => q(a).sideHiddenActive ? q(a).showSide() : q(a).openMobileMenu()
1834
+ }, [...t[9] ||= [k("svg", {
2050
1835
  width: "20",
2051
1836
  height: "20",
2052
1837
  viewBox: "0 0 24 24",
@@ -2055,569 +1840,590 @@ var yn = ["aria-label"], bn = [
2055
1840
  "stroke-width": "2",
2056
1841
  "stroke-linecap": "round",
2057
1842
  "aria-hidden": "true"
2058
- }, [s("path", { d: "M4 6h16M4 12h16M4 18h16" })], -1)]], 10, Dn),
2059
- s("div", On, [I.value ? (y(), o("img", {
2060
- key: 0,
2061
- src: I.value,
2062
- alt: "",
2063
- class: "ca-header__logo"
2064
- }, null, 8, kn)) : (y(), o(e, { key: 1 }, [a(" 没有配置 logo 时用框架默认标志(学士帽),颜色跟随头部前景色 "), n[9] ||= s("svg", {
2065
- class: "ca-header__logo",
2066
- viewBox: "0 0 32 32",
2067
- fill: "none",
2068
- stroke: "currentColor",
2069
- "stroke-width": "2",
2070
- "stroke-linecap": "round",
2071
- "stroke-linejoin": "round",
2072
- "aria-hidden": "true"
2073
- }, [
2074
- s("path", { d: "M16 6 3 12.5 16 19l13-6.5L16 6Z" }),
2075
- s("path", { d: "M9 16.5v5.2c0 1.6 3.1 3.3 7 3.3s7-1.7 7-3.3v-5.2" }),
2076
- s("path", { d: "M29 12.5V20" })
2077
- ], -1)], 2112)), s("div", An, [s("strong", jn, E(F.value), 1), D(T).brand.subtitle ? (y(), o("span", Mn, E(D(b)(D(T).brand.subtitle)), 1)) : a("v-if", !0)])]),
2078
- s("nav", {
1843
+ }, [k("path", { d: "M4 6h16M4 12h16M4 18h16" })], -1)]], 10, xn),
1844
+ k("div", Sn, [(V(), E(G(q(p).headerAppearance?.brandComponent ?? ln), {
1845
+ name: ne.value,
1846
+ logo: re.value,
1847
+ subtitle: q(p).brand.subtitle ? q(l)(q(p).brand.subtitle) : void 0
1848
+ }, null, 8, [
1849
+ "name",
1850
+ "logo",
1851
+ "subtitle"
1852
+ ]))]),
1853
+ q(p).headerCenter ? (V(), O("div", Cn, [(V(), E(G(q(p).headerCenter)))])) : (V(), O("nav", {
1854
+ key: 1,
2079
1855
  class: "ca-header__nav",
2080
- "aria-label": D(m)("campus.header.shortcuts")
2081
- }, [(y(!0), o(e, null, S(L.value, (e) => (y(), o("button", {
1856
+ "aria-label": q(s)("campus.header.shortcuts")
1857
+ }, [(V(!0), O(S, null, U(ie.value, (e) => (V(), O("button", {
2082
1858
  key: e.key,
2083
- class: h(["ca-header__nav-item", { "is-active": D(r).path === e.path }]),
1859
+ class: L(["ca-header__nav-item", { "is-active": q(n).path === e.path }]),
2084
1860
  type: "button",
2085
- onClick: (t) => R(e.path)
2086
- }, E(D(b)(e.title)), 11, Pn))), 128))], 8, Nn),
2087
- s("div", Fn, [
2088
- s("button", {
2089
- type: "button",
2090
- class: "ca-header__search",
2091
- "aria-label": D(m)("campus.header.search"),
2092
- "aria-haspopup": D(T).headerTools?.search ? void 0 : "dialog",
2093
- "aria-keyshortcuts": "Meta+K Control+K",
2094
- onClick: A
2095
- }, [
2096
- u(c, {
2097
- name: "search",
2098
- "aria-hidden": "true"
2099
- }),
2100
- s("span", Ln, E(D(m)("campus.header.search")), 1),
2101
- s("kbd", Rn, E(D(k)), 1)
2102
- ], 8, In),
2103
- s("button", {
2104
- type: "button",
2105
- class: "ca-header__icon ca-header__desktop-tool",
2106
- title: U.value ? D(m)("campus.header.exitFullscreen") : D(m)("campus.header.fullscreen"),
2107
- "aria-label": U.value ? D(m)("campus.header.exitFullscreen") : D(m)("campus.header.fullscreen"),
2108
- "aria-pressed": U.value,
2109
- onClick: ae
2110
- }, [u(c, {
2111
- name: U.value ? "exitFullscreen" : "fullscreen",
2112
- size: 18
2113
- }, null, 8, ["name"])], 8, zn),
2114
- u(x, {
2115
- trigger: "click",
2116
- onCommand: re
2117
- }, {
2118
- dropdown: N(() => [u(v, null, {
2119
- default: N(() => [(y(!0), o(e, null, S(D(ee), (e) => (y(), i(_, {
2120
- key: e.code,
2121
- command: e.code,
2122
- class: h({ "is-current": D(C) === e.code })
2123
- }, {
2124
- default: N(() => [l(E(e.code === "zh-CN" ? "简体中文" : "English"), 1)]),
2125
- _: 2
2126
- }, 1032, ["command", "class"]))), 128))]),
2127
- _: 1
2128
- })]),
2129
- default: N(() => [s("button", {
2130
- type: "button",
2131
- class: "ca-header__icon",
2132
- title: D(m)("campus.header.language"),
2133
- "aria-label": D(m)("campus.header.language")
2134
- }, [s("span", Vn, E(D(ee).find((e) => e.code === D(C))?.label), 1)], 8, Bn)]),
2135
- _: 1
2136
- }),
2137
- s("button", {
2138
- type: "button",
2139
- class: "ca-header__icon ca-header__desktop-tool",
2140
- title: D(m)("campus.header.notifications"),
2141
- "aria-label": D(m)("campus.header.notifications"),
2142
- onClick: n[1] ||= (e) => oe("notifications")
2143
- }, [u(c, {
2144
- name: "bell",
2145
- size: 18
2146
- }), n[10] ||= s("i", {
2147
- class: "ca-header__dot is-danger",
2148
- "aria-hidden": "true"
2149
- }, null, -1)], 8, Hn),
2150
- s("button", {
2151
- type: "button",
2152
- class: "ca-header__icon ca-header__desktop-tool",
2153
- title: D(m)("campus.header.assistant"),
2154
- "aria-label": D(m)("campus.header.assistant"),
2155
- onClick: n[2] ||= (e) => oe("assistant")
2156
- }, [u(c, {
2157
- name: "chat",
2158
- size: 18
2159
- }), n[11] ||= s("i", {
2160
- class: "ca-header__dot is-success",
1861
+ onClick: (t) => ae(e.path)
1862
+ }, K(q(l)(e.title)), 11, Tn))), 128))], 8, wn)),
1863
+ k("div", En, [(V(!0), O(S, null, U(q(h), (e) => (V(), O(S, { key: e }, [e === "search" ? (V(), O("button", {
1864
+ key: 0,
1865
+ type: "button",
1866
+ class: "ca-header__search",
1867
+ "aria-label": q(s)("campus.header.search"),
1868
+ "aria-haspopup": q(p).headerTools?.search ? void 0 : "dialog",
1869
+ "aria-keyshortcuts": "Meta+K Control+K",
1870
+ onClick: P
1871
+ }, [
1872
+ M(r, {
1873
+ name: "search",
2161
1874
  "aria-hidden": "true"
2162
- }, null, -1)], 8, Un),
2163
- s("button", {
1875
+ }),
1876
+ k("span", On, K(q(s)("campus.header.search")), 1),
1877
+ k("kbd", kn, K(q(N)), 1)
1878
+ ], 8, Dn)) : e === "notes" && q(i).isLoggedIn && q(p).personalTools?.notes ? (V(), E(q(C), {
1879
+ key: `notes:${q(i).token}`,
1880
+ token: q(i).token,
1881
+ provider: q(p).personalTools.notes,
1882
+ shortcuts: q(p).personalTools.shortcut
1883
+ }, null, 8, [
1884
+ "token",
1885
+ "provider",
1886
+ "shortcuts"
1887
+ ])) : e === "todos" && q(i).isLoggedIn && q(p).personalTools?.todos ? (V(), E(q(T), {
1888
+ key: `todos:${q(i).token}`,
1889
+ token: q(i).token,
1890
+ provider: q(p).personalTools.todos,
1891
+ shortcuts: q(p).personalTools.shortcut
1892
+ }, null, 8, [
1893
+ "token",
1894
+ "provider",
1895
+ "shortcuts"
1896
+ ])) : e === "fullscreen" ? (V(), O("button", {
1897
+ key: 3,
1898
+ type: "button",
1899
+ class: "ca-header__icon ca-header__desktop-tool",
1900
+ title: de.value ? q(s)("campus.header.exitFullscreen") : q(s)("campus.header.fullscreen"),
1901
+ "aria-label": de.value ? q(s)("campus.header.exitFullscreen") : q(s)("campus.header.fullscreen"),
1902
+ "aria-pressed": de.value,
1903
+ onClick: me
1904
+ }, [M(r, {
1905
+ name: de.value ? "exitFullscreen" : "fullscreen",
1906
+ size: 18
1907
+ }, null, 8, ["name"])], 8, An)) : e === "language" ? (V(), E(f, {
1908
+ key: 4,
1909
+ trigger: "click",
1910
+ onCommand: le
1911
+ }, {
1912
+ dropdown: Y(() => [M(d, null, {
1913
+ default: Y(() => [(V(!0), O(S, null, U(q(fe), (e) => (V(), E(c, {
1914
+ key: e.code,
1915
+ command: e.code,
1916
+ class: L({ "is-current": q(u) === e.code })
1917
+ }, {
1918
+ default: Y(() => [j(K(e.code === "zh-CN" ? "简体中文" : "English"), 1)]),
1919
+ _: 2
1920
+ }, 1032, ["command", "class"]))), 128))]),
1921
+ _: 1
1922
+ })]),
1923
+ default: Y(() => [k("button", {
2164
1924
  type: "button",
2165
1925
  class: "ca-header__icon",
2166
- title: D(m)("campus.header.settings"),
2167
- "aria-label": D(m)("campus.header.settings"),
2168
- onClick: n[3] ||= (e) => M.value = !0
2169
- }, [u(c, {
2170
- name: "setting",
2171
- size: 18
2172
- })], 8, Wn),
2173
- u(x, {
2174
- trigger: "click",
2175
- onCommand: H
2176
- }, {
2177
- dropdown: N(() => [u(v, null, {
2178
- default: N(() => [D(T).accountEntry?.header !== !1 && (D(T).accountPath || D(T).onAccountClick) ? (y(), i(_, {
2179
- key: 0,
2180
- command: "account"
2181
- }, {
2182
- default: N(() => [l(E(D(m)("campus.header.myAccount")), 1)]),
2183
- _: 1
2184
- })) : a("v-if", !0), u(_, {
2185
- command: "logout",
2186
- divided: ""
2187
- }, {
2188
- default: N(() => [l(E(D(m)("campus.header.logout")), 1)]),
2189
- _: 1
2190
- })]),
1926
+ title: q(s)("campus.header.language"),
1927
+ "aria-label": q(s)("campus.header.language")
1928
+ }, [k("span", Mn, K(q(fe).find((e) => e.code === q(u))?.label), 1)], 8, jn)]),
1929
+ _: 1
1930
+ })) : e === "notifications" ? (V(), O("button", {
1931
+ key: 5,
1932
+ type: "button",
1933
+ class: "ca-header__icon ca-header__desktop-tool",
1934
+ title: q(s)("campus.header.notifications"),
1935
+ "aria-label": q(s)("campus.header.notifications"),
1936
+ onClick: t[1] ||= (e) => he("notifications")
1937
+ }, [M(r, {
1938
+ name: "bell",
1939
+ size: 18
1940
+ }), t[10] ||= k("i", {
1941
+ class: "ca-header__dot is-danger",
1942
+ "aria-hidden": "true"
1943
+ }, null, -1)], 8, Nn)) : e === "assistant" ? (V(), O("button", {
1944
+ key: 6,
1945
+ type: "button",
1946
+ class: L(["ca-header__icon", { "ca-header__desktop-tool": !q(p).quickChat }]),
1947
+ title: q(p).quickChat ? y.value : q(s)("campus.header.assistant"),
1948
+ "aria-label": q(p).quickChat ? q(s)("campus.quickChat.title") : q(s)("campus.header.assistant"),
1949
+ "aria-haspopup": q(p).quickChat ? "dialog" : void 0,
1950
+ "aria-keyshortcuts": q(_) ? q(_).aria : void 0,
1951
+ onClick: t[2] ||= (e) => he("assistant")
1952
+ }, [M(r, {
1953
+ name: "chat",
1954
+ size: 18
1955
+ }), t[11] ||= k("i", {
1956
+ class: "ca-header__dot is-success",
1957
+ "aria-hidden": "true"
1958
+ }, null, -1)], 10, Pn)) : e === "settings" ? (V(), O("button", {
1959
+ key: 7,
1960
+ type: "button",
1961
+ class: "ca-header__icon",
1962
+ title: q(s)("campus.header.settings"),
1963
+ "aria-label": q(s)("campus.header.settings"),
1964
+ onClick: t[3] ||= (e) => I.value = !0
1965
+ }, [M(r, {
1966
+ name: "setting",
1967
+ size: 18
1968
+ })], 8, Fn)) : e === "account" ? (V(), E(f, {
1969
+ key: 8,
1970
+ trigger: "click",
1971
+ onCommand: ue
1972
+ }, {
1973
+ dropdown: Y(() => [M(d, null, {
1974
+ default: Y(() => [q(p).accountEntry?.header !== !1 && (q(p).accountPath || q(p).onAccountClick) ? (V(), E(c, {
1975
+ key: 0,
1976
+ command: "account"
1977
+ }, {
1978
+ default: Y(() => [j(K(q(s)("campus.header.myAccount")), 1)]),
1979
+ _: 1
1980
+ })) : D("v-if", !0), M(c, {
1981
+ command: "logout",
1982
+ divided: ""
1983
+ }, {
1984
+ default: Y(() => [j(K(q(s)("campus.header.logout")), 1)]),
2191
1985
  _: 1
2192
1986
  })]),
2193
- default: N(() => [s("button", {
2194
- type: "button",
2195
- class: "ca-header__user",
2196
- title: D(m)("campus.header.account"),
2197
- "aria-label": D(d).user?.name
2198
- }, [u(mn, {
2199
- class: "ca-header__avatar",
2200
- name: D(d).user?.name,
2201
- src: D(d).user?.avatar
2202
- }, null, 8, ["name", "src"]), u(c, {
2203
- name: "arrowDown",
2204
- size: 12
2205
- })], 8, Gn)]),
2206
1987
  _: 1
2207
- })
2208
- ]),
2209
- D(T).headerTools?.search ? a("v-if", !0) : (y(), i(Tn, {
2210
- key: 0,
2211
- modelValue: O.value,
2212
- "onUpdate:modelValue": n[4] ||= (e) => O.value = e
1988
+ })]),
1989
+ default: Y(() => [k("button", {
1990
+ type: "button",
1991
+ class: "ca-header__user",
1992
+ title: q(s)("campus.header.account"),
1993
+ "aria-label": q(i).user?.name
1994
+ }, [M(Kt, {
1995
+ class: "ca-header__avatar",
1996
+ name: q(i).user?.name,
1997
+ src: q(i).user?.avatar
1998
+ }, null, 8, ["name", "src"]), M(r, {
1999
+ name: "arrowDown",
2000
+ size: 12
2001
+ })], 8, In)]),
2002
+ _: 1
2003
+ })) : q(m).has(e) && q(i).can(q(m).get(e)?.permission) ? (V(), E(G(q(m).get(e)?.component), { key: 9 })) : D("v-if", !0)], 64))), 128))]),
2004
+ q(p).headerTools?.search ? D("v-if", !0) : (V(), E(rn, {
2005
+ key: 2,
2006
+ modelValue: A.value,
2007
+ "onUpdate:modelValue": t[4] ||= (e) => A.value = e
2213
2008
  }, null, 8, ["modelValue"])),
2214
- u(j, {
2215
- modelValue: M.value,
2216
- "onUpdate:modelValue": n[7] ||= (e) => M.value = e,
2217
- title: D(m)("campus.settings.title"),
2009
+ q(i).isLoggedIn && q(p).quickChat ? (V(), E(vn, {
2010
+ key: q(i).token,
2011
+ modelValue: g.value,
2012
+ "onUpdate:modelValue": t[5] ||= (e) => g.value = e,
2013
+ token: q(i).token,
2014
+ options: q(p).quickChat
2015
+ }, null, 8, [
2016
+ "modelValue",
2017
+ "token",
2018
+ "options"
2019
+ ])) : D("v-if", !0),
2020
+ M(v, {
2021
+ modelValue: I.value,
2022
+ "onUpdate:modelValue": t[8] ||= (e) => I.value = e,
2023
+ title: q(s)("campus.settings.title"),
2218
2024
  size: "min(352px, 100vw)",
2219
2025
  "append-to-body": "",
2220
2026
  "header-class": "ca-settings__header",
2221
2027
  "body-class": "ca-settings__body",
2222
2028
  class: "ca-settings"
2223
2029
  }, {
2224
- default: N(() => [
2225
- s("p", Kn, E(D(m)("campus.settings.deviceNote")), 1),
2226
- s("section", qn, [s("h3", Jn, E(D(m)("campus.settings.themeMode")), 1), s("div", {
2030
+ default: Y(() => [
2031
+ k("p", Ln, K(q(s)("campus.settings.deviceNote")), 1),
2032
+ k("section", Rn, [k("h3", zn, K(q(s)("campus.settings.themeMode")), 1), k("div", {
2227
2033
  class: "ca-settings__segment is-three",
2228
2034
  role: "group",
2229
- "aria-label": D(m)("campus.settings.themeMode")
2230
- }, [(y(), o(e, null, S(z, (e) => s("button", {
2035
+ "aria-label": q(s)("campus.settings.themeMode")
2036
+ }, [(V(), O(S, null, U(oe, (e) => k("button", {
2231
2037
  key: e.value,
2232
2038
  type: "button",
2233
- "aria-pressed": D(p).mode === e.value,
2234
- class: h({ "is-active": D(p).mode === e.value }),
2235
- onClick: (t) => ne(e.value, t)
2236
- }, [u(c, {
2039
+ "aria-pressed": q(o).mode === e.value,
2040
+ class: L({ "is-active": q(o).mode === e.value }),
2041
+ onClick: (t) => ce(e.value, t)
2042
+ }, [M(r, {
2237
2043
  name: e.icon,
2238
2044
  size: 16,
2239
2045
  "aria-hidden": "true"
2240
- }, null, 8, ["name"]), l(E(D(m)(`campus.mode.${e.value}`)), 1)], 10, Xn)), 64))], 8, Yn)]),
2241
- D(p).primaryLocked ? a("v-if", !0) : (y(), o("section", Zn, [
2242
- s("div", Qn, [s("h3", $n, E(D(m)("campus.settings.themeColor")), 1), s("span", er, [D(p).userPrimary ? a("v-if", !0) : (y(), o("span", tr, E(D(m)("campus.settings.siteDefault")), 1)), s("code", null, E(B.value), 1)])]),
2243
- s("div", {
2046
+ }, null, 8, ["name"]), j(K(q(s)(`campus.mode.${e.value}`)), 1)], 10, Vn)), 64))], 8, Bn)]),
2047
+ q(o).primaryLocked ? D("v-if", !0) : (V(), O("section", Hn, [
2048
+ k("div", Un, [k("h3", Wn, K(q(s)("campus.settings.themeColor")), 1), k("span", Gn, [q(o).userPrimary ? D("v-if", !0) : (V(), O("span", Kn, K(q(s)("campus.settings.siteDefault")), 1)), k("code", null, K(X.value), 1)])]),
2049
+ k("div", {
2244
2050
  class: "ca-settings__swatches",
2245
2051
  role: "group",
2246
- "aria-label": D(m)("campus.settings.themeColor")
2247
- }, [(y(), o(e, null, S(te, (e) => s("button", {
2052
+ "aria-label": q(s)("campus.settings.themeColor")
2053
+ }, [(V(), O(S, null, U(se, (e) => k("button", {
2248
2054
  key: e,
2249
2055
  type: "button",
2250
2056
  class: "ca-settings__swatch",
2251
2057
  "aria-label": e,
2252
2058
  title: e,
2253
- "aria-pressed": V.value === e,
2254
- onClick: (t) => D(p).setPrimary(e)
2255
- }, [s("span", {
2059
+ "aria-pressed": Z.value === e,
2060
+ onClick: (t) => q(o).setPrimary(e)
2061
+ }, [k("span", {
2256
2062
  class: "ca-settings__chip",
2257
- style: g({ background: e }),
2063
+ style: R({ background: e }),
2258
2064
  "aria-hidden": "true"
2259
- }, null, 4), V.value === e ? (y(), i(c, {
2065
+ }, null, 4), Z.value === e ? (V(), E(r, {
2260
2066
  key: 0,
2261
2067
  name: "check",
2262
2068
  size: 14,
2263
2069
  "aria-hidden": "true"
2264
- })) : a("v-if", !0)], 8, rr)), 64))], 8, nr),
2265
- s("div", ir, [s("label", ar, [
2266
- u(c, {
2070
+ })) : D("v-if", !0)], 8, Jn)), 64))], 8, qn),
2071
+ k("div", Yn, [k("label", Xn, [
2072
+ M(r, {
2267
2073
  name: "brush",
2268
2074
  size: 16,
2269
2075
  "aria-hidden": "true"
2270
2076
  }),
2271
- l(" " + E(D(m)("campus.settings.themeColorCustom")) + " ", 1),
2272
- s("input", {
2077
+ j(" " + K(q(s)("campus.settings.themeColorCustom")) + " ", 1),
2078
+ k("input", {
2273
2079
  type: "color",
2274
- value: B.value,
2275
- "aria-label": D(m)("campus.settings.themeColorCustom"),
2276
- onInput: n[5] ||= (e) => D(p).setPrimary(e.target.value)
2277
- }, null, 40, or)
2278
- ]), s("button", {
2080
+ value: X.value,
2081
+ "aria-label": q(s)("campus.settings.themeColorCustom"),
2082
+ onInput: t[6] ||= (e) => q(o).setPrimary(e.target.value)
2083
+ }, null, 40, Zn)
2084
+ ]), k("button", {
2279
2085
  type: "button",
2280
2086
  class: "ca-settings__reset",
2281
- disabled: !D(p).userPrimary,
2282
- onClick: n[6] ||= (e) => D(p).setPrimary(void 0)
2283
- }, E(D(m)("campus.settings.themeColorReset")), 9, sr)])
2087
+ disabled: !q(o).userPrimary,
2088
+ onClick: t[7] ||= (e) => q(o).setPrimary(void 0)
2089
+ }, K(q(s)("campus.settings.themeColorReset")), 9, Qn)])
2284
2090
  ])),
2285
- s("section", cr, [s("h3", lr, E(D(m)("campus.settings.boxStyle")), 1), s("div", {
2091
+ k("section", $n, [k("h3", er, K(q(s)("campus.settings.boxStyle")), 1), k("div", {
2286
2092
  class: "ca-settings__segment ca-settings__boxes",
2287
2093
  role: "group",
2288
- "aria-label": D(m)("campus.settings.boxStyle")
2289
- }, [(y(), o(e, null, S(P, (e) => s("button", {
2094
+ "aria-label": q(s)("campus.settings.boxStyle")
2095
+ }, [(V(), O(S, null, U(te, (e) => k("button", {
2290
2096
  key: e.value,
2291
2097
  type: "button",
2292
- "aria-pressed": D(p).boxStyle === e.value,
2293
- class: h({ "is-active": D(p).boxStyle === e.value }),
2294
- onClick: (t) => D(p).setBoxStyle(e.value)
2295
- }, [s("span", {
2296
- class: h(["ca-settings__box-sample", `is-${e.value}`]),
2098
+ "aria-pressed": q(o).boxStyle === e.value,
2099
+ class: L({ "is-active": q(o).boxStyle === e.value }),
2100
+ onClick: (t) => q(o).setBoxStyle(e.value)
2101
+ }, [k("span", {
2102
+ class: L(["ca-settings__box-sample", `is-${e.value}`]),
2297
2103
  "aria-hidden": "true"
2298
- }, [...n[12] ||= [s("span", null, null, -1)]], 2), l(" " + E(D(m)(e.label)), 1)], 10, dr)), 64))], 8, ur)])
2104
+ }, [...t[12] ||= [k("span", null, null, -1)]], 2), j(" " + K(q(s)(e.label)), 1)], 10, nr)), 64))], 8, tr)])
2299
2105
  ]),
2300
2106
  _: 1
2301
2107
  }, 8, ["modelValue", "title"])
2302
2108
  ]);
2303
2109
  };
2304
2110
  }
2305
- }), [["__scopeId", "data-v-9af060a7"]]), pr = {
2111
+ }), [["__scopeId", "data-v-6454609e"]]), ir = {
2306
2112
  key: 0,
2307
2113
  class: "ca-page-header"
2308
- }, mr = { class: "ca-page-header__top" }, hr = { class: "ca-page-header__crumb" }, gr = ["title", "aria-label"], _r = ["title"], vr = { class: "ca-page-header__date" }, yr = /*#__PURE__*/ Z(/* @__PURE__ */ d({
2114
+ }, ar = { class: "ca-page-header__top" }, or = { class: "ca-page-header__crumb" }, sr = ["title", "aria-label"], cr = ["title"], lr = { class: "ca-page-header__date" }, ur = /*#__PURE__*/ s(/* @__PURE__ */ N({
2309
2115
  __name: "PageHeader",
2310
- setup(t) {
2311
- let r = W(), { t: c, label: d, locale: f } = q(), p = gt(), m = new Map(Pe(J().menus).map((e) => [e.key, e])), h = n(() => r.meta.pageKey ? m.get(r.meta.pageKey) : void 0), g = n(() => {
2312
- let e = h.value ? Me(h.value.key) : void 0;
2116
+ setup(e) {
2117
+ let t = _e(), { t: n, label: r, locale: i } = c(), a = g(), o = new Map(y(f().menus).map((e) => [e.key, e])), s = w(() => t.meta.pageKey ? o.get(t.meta.pageKey) : void 0), l = w(() => {
2118
+ let e = s.value ? _(s.value.key) : void 0;
2313
2119
  if (!e) return [];
2314
- let t = e.titles.map((e) => d(e));
2315
- return h.value?.affix ? t.filter((e, n) => e !== t[n - 1]) : t;
2316
- }), v = n(() => h.value?.tip ? d(h.value.tip) : ""), b = x(/* @__PURE__ */ new Date()), C = setInterval(() => b.value = /* @__PURE__ */ new Date(), 6e4);
2317
- _(() => clearInterval(C));
2318
- let T = n(() => {
2319
- let e = b.value;
2320
- if (f.value === "zh-CN") {
2120
+ let t = e.titles.map((e) => r(e));
2121
+ return s.value?.affix ? t.filter((e, n) => e !== t[n - 1]) : t;
2122
+ }), u = w(() => s.value?.tip ? r(s.value.tip) : ""), d = H(/* @__PURE__ */ new Date()), p = setInterval(() => d.value = /* @__PURE__ */ new Date(), 6e4);
2123
+ z(() => clearInterval(p));
2124
+ let m = w(() => {
2125
+ let e = d.value;
2126
+ if (i.value === "zh-CN") {
2321
2127
  let t = new Intl.DateTimeFormat("zh-CN", { weekday: "long" }).format(e);
2322
2128
  return `${e.getFullYear()} 年 ${e.getMonth() + 1} 月 ${e.getDate()} 日 · ${t}`;
2323
2129
  }
2324
- return new Intl.DateTimeFormat(f.value, { dateStyle: "full" }).format(e);
2130
+ return new Intl.DateTimeFormat(i.value, { dateStyle: "full" }).format(e);
2325
2131
  });
2326
- return (t, n) => {
2327
- let r = w("ca-icon"), d = w("ca-breadcrumb-item"), f = w("ca-breadcrumb");
2328
- return h.value ? (y(), o("header", pr, [s("div", mr, [
2329
- s("div", hr, [
2330
- u(r, {
2132
+ return (e, t) => {
2133
+ let r = W("ca-icon"), i = W("ca-breadcrumb-item"), o = W("ca-breadcrumb");
2134
+ return s.value ? (V(), O("header", ir, [k("div", ar, [
2135
+ k("div", or, [
2136
+ M(r, {
2331
2137
  name: "location",
2332
2138
  class: "ca-page-header__icon"
2333
2139
  }),
2334
- s("span", null, E(D(c)("campus.breadcrumb.current")), 1),
2335
- u(f, { separator: ">" }, {
2336
- default: N(() => [(y(!0), o(e, null, S(g.value, (e, t) => (y(), i(d, { key: t }, {
2337
- default: N(() => [l(E(e), 1)]),
2140
+ k("span", null, K(q(n)("campus.breadcrumb.current")), 1),
2141
+ M(o, { separator: ">" }, {
2142
+ default: Y(() => [(V(!0), O(S, null, U(l.value, (e, t) => (V(), E(i, { key: t }, {
2143
+ default: Y(() => [j(K(e), 1)]),
2338
2144
  _: 2
2339
2145
  }, 1024))), 128))]),
2340
2146
  _: 1
2341
2147
  }),
2342
- a(" 刷新当前页面:重新创建页面组件,等于重新进入 "),
2343
- s("button", {
2148
+ D(" 刷新当前页面:重新创建页面组件,等于重新进入 "),
2149
+ k("button", {
2344
2150
  type: "button",
2345
2151
  class: "ca-page-header__refresh",
2346
- title: D(c)("campus.tabs.refresh"),
2347
- "aria-label": D(c)("campus.tabs.refresh"),
2348
- onClick: n[0] ||= (e) => h.value && D(p).refresh(h.value.key)
2349
- }, [u(r, { name: "refresh" })], 8, gr)
2152
+ title: q(n)("campus.tabs.refresh"),
2153
+ "aria-label": q(n)("campus.tabs.refresh"),
2154
+ onClick: t[0] ||= (e) => s.value && q(a).refresh(s.value.key)
2155
+ }, [M(r, { name: "refresh" })], 8, sr)
2350
2156
  ]),
2351
- v.value ? (y(), o("span", {
2157
+ u.value ? (V(), O("span", {
2352
2158
  key: 0,
2353
2159
  class: "ca-page-header__tip",
2354
- title: v.value
2355
- }, E(v.value), 9, _r)) : a("v-if", !0),
2356
- s("time", vr, E(T.value), 1)
2357
- ])])) : a("v-if", !0);
2160
+ title: u.value
2161
+ }, K(u.value), 9, cr)) : D("v-if", !0),
2162
+ k("time", lr, K(m.value), 1)
2163
+ ])])) : D("v-if", !0);
2358
2164
  };
2359
2165
  }
2360
- }), [["__scopeId", "data-v-b71acbe5"]]), br = {
2166
+ }), [["__scopeId", "data-v-b71acbe5"]]), dr = {
2361
2167
  key: 0,
2362
2168
  class: "ca-page-header__titles"
2363
- }, xr = { class: "ca-page-header__title" }, Sr = ["title"], Cr = /*#__PURE__*/ Z(/* @__PURE__ */ d({
2169
+ }, fr = { class: "ca-page-header__title" }, pr = ["title"], mr = /*#__PURE__*/ s(/* @__PURE__ */ N({
2364
2170
  __name: "PageTitle",
2365
2171
  setup(e) {
2366
- let t = W(), { label: r } = q(), i = new Map(Pe(J().menus).map((e) => [e.key, e])), c = n(() => t.meta.pageKey ? i.get(t.meta.pageKey) : void 0), l = n(() => c.value?.pageHeader ?? J().pageHeader ?? !0), u = n(() => c.value ? r(c.value.title) : ""), d = n(() => c.value?.description ? r(c.value.description) : "");
2367
- return (e, t) => c.value ? (y(), o("header", {
2172
+ let t = _e(), { label: n } = c(), r = new Map(y(f().menus).map((e) => [e.key, e])), i = w(() => t.meta.pageKey ? r.get(t.meta.pageKey) : void 0), a = w(() => i.value?.pageHeader ?? f().pageHeader ?? !0), o = w(() => i.value ? n(i.value.title) : ""), s = w(() => i.value?.description ? n(i.value.description) : "");
2173
+ return (e, t) => i.value ? (V(), O("header", {
2368
2174
  key: 0,
2369
- class: h(["ca-page-header__main", { "is-title-hidden": !l.value }])
2175
+ class: L(["ca-page-header__main", { "is-title-hidden": !a.value }])
2370
2176
  }, [
2371
- l.value ? (y(), o("div", br, [
2372
- s("h2", xr, E(u.value), 1),
2373
- a(" 说明和标题同一行,放不下时省略;窗口较矮时直接隐藏,把高度留给内容 "),
2374
- d.value ? (y(), o("p", {
2177
+ a.value ? (V(), O("div", dr, [
2178
+ k("h2", fr, K(o.value), 1),
2179
+ D(" 说明和标题同一行,放不下时省略;窗口较矮时直接隐藏,把高度留给内容 "),
2180
+ s.value ? (V(), O("p", {
2375
2181
  key: 0,
2376
2182
  class: "ca-page-header__desc",
2377
- title: d.value
2378
- }, E(d.value), 9, Sr)) : a("v-if", !0)
2379
- ])) : a("v-if", !0),
2380
- a(" 页面通过 <ca-page-actions> 把按钮放到这里 "),
2381
- t[0] ||= s("div", {
2183
+ title: s.value
2184
+ }, K(s.value), 9, pr)) : D("v-if", !0)
2185
+ ])) : D("v-if", !0),
2186
+ D(" 页面通过 <ca-page-actions> 把按钮放到这里 "),
2187
+ t[0] ||= k("div", {
2382
2188
  id: "ca-page-actions",
2383
2189
  class: "ca-page-header__actions"
2384
2190
  }, null, -1)
2385
- ], 2)) : a("v-if", !0);
2191
+ ], 2)) : D("v-if", !0);
2386
2192
  }
2387
- }), [["__scopeId", "data-v-22464957"]]), wr = ["aria-label"], Tr = ["onClick"], Er = { class: "ca-side__rail-list" }, Dr = ["aria-current", "title"], Or = [
2193
+ }), [["__scopeId", "data-v-22464957"]]), hr = ["aria-label"], gr = ["onClick"], _r = { class: "ca-side__rail-list" }, vr = ["aria-current", "title"], yr = [
2388
2194
  "aria-current",
2389
2195
  "aria-expanded",
2390
2196
  "title",
2391
2197
  "onClick"
2392
- ], kr = {
2198
+ ], br = {
2393
2199
  key: 0,
2394
2200
  class: "ca-side__badge"
2395
- }, Ar = { class: "ca-side__tools" }, jr = [
2201
+ }, xr = { class: "ca-side__tools" }, Sr = [
2396
2202
  "title",
2397
2203
  "aria-label",
2398
2204
  "aria-pressed"
2399
- ], Mr = [
2205
+ ], Cr = [
2400
2206
  "title",
2401
2207
  "aria-label",
2402
2208
  "aria-expanded"
2403
- ], Nr = ["title", "aria-label"], Pr = ["inert"], Fr = { class: "ca-side__panel-inner" }, Ir = {
2209
+ ], wr = ["title", "aria-label"], Tr = ["inert"], Er = { class: "ca-side__panel-inner" }, Dr = {
2404
2210
  key: 0,
2405
2211
  class: "ca-side__title"
2406
- }, Lr = { class: "ca-side__group-label" }, Rr = {
2212
+ }, Or = { class: "ca-side__group-label" }, kr = {
2407
2213
  key: 1,
2408
2214
  class: "ca-side__group-badge"
2409
- }, zr = /*#__PURE__*/ Z(/* @__PURE__ */ d({
2215
+ }, Ar = /*#__PURE__*/ s(/* @__PURE__ */ N({
2410
2216
  __name: "SideMenu",
2411
- setup(t) {
2412
- let r = W(), c = G(), d = Q(), f = ft(), { t: p, label: g } = q(), _ = J(), v = n(() => f.sidePanelCollapsed), b = () => f.toggleSidePanel(), C = x(_e("side-text-hidden") === "1");
2413
- function T() {
2414
- C.value = !C.value, K("side-text-hidden", C.value ? "1" : "0");
2217
+ setup(e) {
2218
+ let t = _e(), r = Q(), a = b(), o = v(), { t: s, label: l } = c(), u = f(), m = w(() => o.sidePanelCollapsed), h = () => o.toggleSidePanel(), g = H(i("side-text-hidden") === "1");
2219
+ function _() {
2220
+ g.value = !g.value, n("side-text-hidden", g.value ? "1" : "0");
2415
2221
  }
2416
- async function O(e) {
2417
- e === "account" ? _.onAccountClick ? await _.onAccountClick("side") : _.accountPath && r.path !== _.accountPath && await c.push(_.accountPath) : (await d.logout(), await c.replace({ name: Y(J()).login }));
2222
+ async function y(e) {
2223
+ e === "account" ? u.onAccountClick ? await u.onAccountClick("side") : u.accountPath && t.path !== u.accountPath && await r.push(u.accountPath) : (await a.logout(), await r.replace({ name: d(f()).login }));
2418
2224
  }
2419
- let k = n(() => Ie(_, (e) => d.can(e))), M = n(() => k.value.home), F = n(() => k.value.apps), I = k.value.accountStandalone, L = x(), R = n(() => !!M.value && r.path === M.value.path);
2420
- j(() => [r.path, r.meta.appKey], () => {
2421
- L.value = R.value || I && r.path === _.accountPath ? void 0 : r.meta.appKey ?? F.value[0]?.key;
2225
+ let C = w(() => x(u, (e) => a.can(e))), T = w(() => C.value.home), A = w(() => C.value.apps), ee = C.value.accountStandalone, N = H(), P = w(() => !!T.value && t.path === T.value.path);
2226
+ J(() => [t.path, t.meta.appKey], () => {
2227
+ N.value = P.value || ee && t.path === u.accountPath ? void 0 : t.meta.appKey ?? A.value[0]?.key;
2422
2228
  }, { immediate: !0 });
2423
- let z = n(() => F.value.find((e) => e.key === L.value)), ee = n(() => (f.mode === "phone" ? !f.mobileMenuOpen : f.mode === "pad" ? !f.padPanelOpen : v.value || f.sideHiddenActive) || !z.value?.children.length), te = x();
2424
- j(z, (e) => e?.children.length && (te.value = e), { immediate: !0 });
2425
- let B = n(() => z.value?.children.length ? z.value : te.value);
2426
- function V(e) {
2229
+ let F = w(() => A.value.find((e) => e.key === N.value)), R = w(() => (o.mode === "phone" ? !o.mobileMenuOpen : o.mode === "pad" ? !o.padPanelOpen : m.value || o.sideHiddenActive) || !F.value?.children.length), z = H();
2230
+ J(F, (e) => e?.children.length && (z.value = e), { immediate: !0 });
2231
+ let B = w(() => F.value?.children.length ? F.value : z.value);
2232
+ function te(e) {
2427
2233
  let t = typeof e.badge == "function" ? e.badge() : e.badge ?? 0;
2428
2234
  return t > 0 ? t : 0;
2429
2235
  }
2430
2236
  function ne(e) {
2431
- return e.children.reduce((e, t) => e + (ke(t) ? V(t) : 0), 0);
2237
+ return e.children.reduce((e, t) => e + (p(t) ? te(t) : 0), 0);
2432
2238
  }
2433
- let re = x(), H = !0;
2434
- function U(e, t) {
2435
- H || f.setMenuGroup(e, t);
2239
+ let G = H(), re = !0;
2240
+ function ie(e, t) {
2241
+ re || o.setMenuGroup(e, t);
2436
2242
  }
2437
- let ie = n(() => Object.keys(f.menuGroups).filter((e) => f.menuGroups[e]));
2438
- j(() => r.meta.groupKey, (e) => {
2439
- e && f.ensureMenuGroup(e);
2440
- }, { immediate: !0 }), j([
2441
- () => f.menuGroups,
2243
+ let ae = w(() => Object.keys(o.menuGroups).filter((e) => o.menuGroups[e]));
2244
+ J(() => t.meta.groupKey, (e) => {
2245
+ e && o.ensureMenuGroup(e);
2246
+ }, { immediate: !0 }), J([
2247
+ () => o.menuGroups,
2442
2248
  B,
2443
- () => r.path
2249
+ () => t.path
2444
2250
  ], async () => {
2445
- H = !0, await m();
2446
- for (let e of B.value?.children ?? []) ke(e) && e.children.length && (f.menuGroups[e.key] ? re.value?.open(e.key) : re.value?.close(e.key));
2447
- H = !1;
2251
+ re = !0, await I();
2252
+ for (let e of B.value?.children ?? []) p(e) && e.children.length && (o.menuGroups[e.key] ? G.value?.open(e.key) : G.value?.close(e.key));
2253
+ re = !1;
2448
2254
  }, {
2449
2255
  deep: !0,
2450
2256
  immediate: !0
2451
2257
  });
2452
- async function ae(e) {
2453
- let t = F.value.find((t) => t.key === e);
2454
- if (!t) return;
2455
- let n = L.value === e;
2456
- L.value = e, await f.clickMenuApp(t, r.path, (e) => c.push(e), n);
2258
+ async function se(e) {
2259
+ let n = A.value.find((t) => t.key === e);
2260
+ if (!n) return;
2261
+ let i = N.value === e;
2262
+ N.value = e, await o.clickMenuApp(n, t.path, (e) => r.push(e), i);
2457
2263
  }
2458
- function oe(e, t) {
2459
- let n = e.currentTarget, i = e.type === "keydown";
2460
- (n.firstElementChild?.contains(e.target) || i && e.target === n) && (!i || ["Enter", " "].includes(e.key)) && (e.preventDefault(), e.stopPropagation(), f.clickMenuGroup(t, r.path, (e) => c.push(e)));
2264
+ function Z(e, n) {
2265
+ let i = e.currentTarget, a = e.type === "keydown";
2266
+ (i.firstElementChild?.contains(e.target) || a && e.target === i) && (!a || ["Enter", " "].includes(e.key)) && (e.preventDefault(), e.stopPropagation(), o.clickMenuGroup(n, t.path, (e) => r.push(e)));
2461
2267
  }
2462
- let se = n(() => (_.shortcuts ?? []).filter((e) => d.can(e.permission)));
2463
- function ce(e) {
2464
- f.closeOverlays(), r.path !== e && c.push(e);
2268
+ let ce = w(() => (u.shortcuts ?? []).filter((e) => a.can(e.permission)));
2269
+ function le(e) {
2270
+ o.closeOverlays(), t.path !== e && r.push(e);
2465
2271
  }
2466
- return (t, n) => {
2467
- let c = w("ca-icon"), m = w("ca-dropdown-item"), x = w("ca-dropdown-menu"), k = w("ca-dropdown"), j = w("ca-menu-item"), I = w("ca-sub-menu"), L = w("ca-menu");
2468
- return y(), o(e, null, [a(" 两栏都收起(只在电脑档):整个侧栏向左滑出,第二栏同时收起;不可聚焦由 CaLayout 的 inert 负责 "), s("aside", { class: h(["ca-side", {
2469
- "is-pad-open": D(f).mode === "pad" && D(f).padPanelOpen,
2470
- "is-hidden": D(f).sideHiddenActive,
2471
- "is-text-hidden": C.value
2272
+ return (e, n) => {
2273
+ let r = W("ca-icon"), i = W("ca-dropdown-item"), c = W("ca-dropdown-menu"), d = W("ca-dropdown"), f = W("ca-menu-item"), v = W("ca-sub-menu"), b = W("ca-menu");
2274
+ return V(), O(S, null, [D(" 两栏都收起(只在电脑档):整个侧栏向左滑出,第二栏同时收起;不可聚焦由 CaLayout 的 inert 负责 "), k("aside", { class: L(["ca-side", {
2275
+ "is-pad-open": q(o).mode === "pad" && q(o).padPanelOpen,
2276
+ "is-hidden": q(o).sideHiddenActive,
2277
+ "is-text-hidden": g.value
2472
2278
  }]) }, [
2473
- se.value.length ? (y(), o("nav", {
2279
+ ce.value.length ? (V(), O("nav", {
2474
2280
  key: 0,
2475
2281
  class: "ca-side__shortcuts",
2476
- "aria-label": D(p)("campus.header.shortcuts")
2477
- }, [(y(!0), o(e, null, S(se.value, (e) => (y(), o("button", {
2282
+ "aria-label": q(s)("campus.header.shortcuts")
2283
+ }, [(V(!0), O(S, null, U(ce.value, (e) => (V(), O("button", {
2478
2284
  key: e.key,
2479
2285
  type: "button",
2480
- class: h({ "is-active": D(r).path === e.path }),
2481
- onClick: (t) => ce(e.path)
2482
- }, E(D(g)(e.title)), 11, Tr))), 128))], 8, wr)) : a("v-if", !0),
2483
- s("nav", { class: h(["ca-side__rail", { "is-compact": C.value }]) }, [
2484
- a(" 入口列表单独滚动;底部工具按钮固定在外面,窗口再矮也不会被挤出屏幕 "),
2485
- s("div", Er, [M.value ? (y(), o("button", {
2286
+ class: L({ "is-active": q(t).path === e.path }),
2287
+ onClick: (t) => le(e.path)
2288
+ }, K(q(l)(e.title)), 11, gr))), 128))], 8, hr)) : D("v-if", !0),
2289
+ k("nav", { class: L(["ca-side__rail", { "is-compact": g.value }]) }, [
2290
+ D(" 入口列表单独滚动;底部工具按钮固定在外面,窗口再矮也不会被挤出屏幕 "),
2291
+ k("div", _r, [T.value ? (V(), O("button", {
2486
2292
  key: 0,
2487
2293
  type: "button",
2488
- class: h(["ca-side__rail-item", { "is-active": R.value }]),
2489
- "aria-current": R.value ? "page" : void 0,
2490
- title: D(p)("campus.side.home"),
2491
- onClick: n[0] ||= (e) => ce(M.value.path)
2492
- }, [u(c, { name: "home" }), P(s("span", { class: "ca-side__rail-text" }, E(D(p)("campus.side.home")), 513), [[A, !C.value || D(f).mobileMenuOpen]])], 10, Dr)) : a("v-if", !0), (y(!0), o(e, null, S(F.value, (e) => (y(), o("button", {
2294
+ class: L(["ca-side__rail-item", { "is-active": P.value }]),
2295
+ "aria-current": P.value ? "page" : void 0,
2296
+ title: q(s)("campus.side.home"),
2297
+ onClick: n[0] ||= (e) => le(T.value.path)
2298
+ }, [M(r, { name: "home" }), X(k("span", { class: "ca-side__rail-text" }, K(q(s)("campus.side.home")), 513), [[oe, !g.value || q(o).mobileMenuOpen]])], 10, vr)) : D("v-if", !0), (V(!0), O(S, null, U(A.value, (e) => (V(), O("button", {
2493
2299
  key: e.key,
2494
2300
  type: "button",
2495
- class: h(["ca-side__rail-item", {
2496
- "is-active": e.path === D(r).path,
2497
- "is-ancestor": e.key === z.value?.key && e.path !== D(r).path
2301
+ class: L(["ca-side__rail-item", {
2302
+ "is-active": e.path === q(t).path,
2303
+ "is-ancestor": e.key === F.value?.key && e.path !== q(t).path
2498
2304
  }]),
2499
- "aria-current": e.path === D(r).path ? "page" : void 0,
2500
- "aria-expanded": e.children.length ? e.key === z.value?.key && !ee.value : void 0,
2501
- title: D(g)(e.title),
2502
- onClick: (t) => ae(e.key)
2305
+ "aria-current": e.path === q(t).path ? "page" : void 0,
2306
+ "aria-expanded": e.children.length ? e.key === F.value?.key && !R.value : void 0,
2307
+ title: q(l)(e.title),
2308
+ onClick: (t) => se(e.key)
2503
2309
  }, [
2504
- u(c, {
2310
+ M(r, {
2505
2311
  name: e.icon,
2506
2312
  fallback: "grid"
2507
2313
  }, null, 8, ["name"]),
2508
- P(s("span", { class: "ca-side__rail-text" }, E(D(g)(e.title)), 513), [[A, !C.value || D(f).mobileMenuOpen]]),
2509
- ne(e) ? (y(), o("span", kr, E(ne(e)), 1)) : a("v-if", !0)
2510
- ], 10, Or))), 128))]),
2511
- s("div", Ar, [
2512
- s("button", {
2314
+ X(k("span", { class: "ca-side__rail-text" }, K(q(l)(e.title)), 513), [[oe, !g.value || q(o).mobileMenuOpen]]),
2315
+ ne(e) ? (V(), O("span", br, K(ne(e)), 1)) : D("v-if", !0)
2316
+ ], 10, yr))), 128))]),
2317
+ k("div", xr, [
2318
+ k("button", {
2513
2319
  type: "button",
2514
2320
  class: "ca-side__tool",
2515
- title: C.value ? D(p)("campus.side.showText") : D(p)("campus.side.hideText"),
2516
- "aria-label": C.value ? D(p)("campus.side.showText") : D(p)("campus.side.hideText"),
2517
- "aria-pressed": C.value,
2518
- onClick: T
2519
- }, [u(c, {
2520
- name: C.value ? "view" : "hide",
2321
+ title: g.value ? q(s)("campus.side.showText") : q(s)("campus.side.hideText"),
2322
+ "aria-label": g.value ? q(s)("campus.side.showText") : q(s)("campus.side.hideText"),
2323
+ "aria-pressed": g.value,
2324
+ onClick: _
2325
+ }, [M(r, {
2326
+ name: g.value ? "view" : "hide",
2521
2327
  size: 18
2522
- }, null, 8, ["name"])], 8, jr),
2523
- s("button", {
2328
+ }, null, 8, ["name"])], 8, Sr),
2329
+ k("button", {
2524
2330
  type: "button",
2525
2331
  class: "ca-side__tool ca-side__tool--collapse",
2526
- title: v.value ? D(p)("campus.side.expand") : D(p)("campus.side.collapse"),
2527
- "aria-label": v.value ? D(p)("campus.side.expand") : D(p)("campus.side.collapse"),
2528
- "aria-expanded": !v.value,
2529
- onClick: b
2530
- }, [u(c, {
2531
- name: v.value ? "expand" : "fold",
2332
+ title: m.value ? q(s)("campus.side.expand") : q(s)("campus.side.collapse"),
2333
+ "aria-label": m.value ? q(s)("campus.side.expand") : q(s)("campus.side.collapse"),
2334
+ "aria-expanded": !m.value,
2335
+ onClick: h
2336
+ }, [M(r, {
2337
+ name: m.value ? "expand" : "fold",
2532
2338
  size: 18
2533
- }, null, 8, ["name"])], 8, Mr),
2534
- u(k, {
2339
+ }, null, 8, ["name"])], 8, Cr),
2340
+ M(d, {
2535
2341
  trigger: "click",
2536
2342
  placement: "right-end",
2537
- onCommand: O
2343
+ onCommand: y
2538
2344
  }, {
2539
- dropdown: N(() => [u(x, null, {
2540
- default: N(() => [D(_).accountEntry?.side !== !1 && (D(_).accountPath || D(_).onAccountClick) ? (y(), i(m, {
2345
+ dropdown: Y(() => [M(c, null, {
2346
+ default: Y(() => [q(u).accountEntry?.side !== !1 && (q(u).accountPath || q(u).onAccountClick) ? (V(), E(i, {
2541
2347
  key: 0,
2542
2348
  command: "account"
2543
2349
  }, {
2544
- default: N(() => [l(E(D(p)("campus.header.myAccount")), 1)]),
2350
+ default: Y(() => [j(K(q(s)("campus.header.myAccount")), 1)]),
2545
2351
  _: 1
2546
- })) : a("v-if", !0), u(m, {
2352
+ })) : D("v-if", !0), M(i, {
2547
2353
  command: "logout",
2548
2354
  divided: ""
2549
2355
  }, {
2550
- default: N(() => [l(E(D(p)("campus.header.logout")), 1)]),
2356
+ default: Y(() => [j(K(q(s)("campus.header.logout")), 1)]),
2551
2357
  _: 1
2552
2358
  })]),
2553
2359
  _: 1
2554
2360
  })]),
2555
- default: N(() => [s("button", {
2361
+ default: Y(() => [k("button", {
2556
2362
  type: "button",
2557
2363
  class: "ca-side__tool",
2558
- title: D(d).user?.name,
2559
- "aria-label": D(d).user?.name
2560
- }, [u(mn, {
2364
+ title: q(a).user?.name,
2365
+ "aria-label": q(a).user?.name
2366
+ }, [M(Kt, {
2561
2367
  class: "ca-side__avatar",
2562
- name: D(d).user?.name,
2563
- src: D(d).user?.avatar
2564
- }, null, 8, ["name", "src"])], 8, Nr)]),
2368
+ name: q(a).user?.name,
2369
+ src: q(a).user?.avatar
2370
+ }, null, 8, ["name", "src"])], 8, wr)]),
2565
2371
  _: 1
2566
2372
  })
2567
2373
  ])
2568
2374
  ], 2),
2569
- a(" 第二栏:隐藏时宽度渐变到 0(而不是直接消失),首页与其他页之间切换时内容区不会突然跳动 "),
2570
- s("div", {
2571
- class: h(["ca-side__panel", {
2572
- "is-hidden": ee.value,
2573
- "is-empty": !z.value?.children.length
2375
+ D(" 第二栏:隐藏时宽度渐变到 0(而不是直接消失),首页与其他页之间切换时内容区不会突然跳动 "),
2376
+ k("div", {
2377
+ class: L(["ca-side__panel", {
2378
+ "is-hidden": R.value,
2379
+ "is-empty": !F.value?.children.length
2574
2380
  }]),
2575
- inert: ee.value && !D(f).mobileMenuOpen
2576
- }, [s("div", Fr, [
2577
- B.value ? (y(), o("div", Ir, E(D(g)(B.value.title)), 1)) : a("v-if", !0),
2578
- a(" key 绑定场景:切换场景时重建菜单,展开状态不会串到别的场景 "),
2579
- (y(), i(L, {
2381
+ inert: R.value && !q(o).mobileMenuOpen
2382
+ }, [k("div", Er, [
2383
+ B.value ? (V(), O("div", Dr, K(q(l)(B.value.title)), 1)) : D("v-if", !0),
2384
+ D(" key 绑定场景:切换场景时重建菜单,展开状态不会串到别的场景 "),
2385
+ (V(), E(b, {
2580
2386
  ref_key: "menuRef",
2581
- ref: re,
2387
+ ref: G,
2582
2388
  key: B.value?.key,
2583
- "default-active": D(r).path,
2584
- "default-openeds": ie.value,
2389
+ "default-active": q(t).path,
2390
+ "default-openeds": ae.value,
2585
2391
  router: "",
2586
2392
  class: "ca-side__menu",
2587
- onSelect: n[1] ||= (e) => D(f).closeOverlays(),
2588
- onOpen: n[2] ||= (e) => U(e, !0),
2589
- onClose: n[3] ||= (e) => U(e, !1)
2393
+ onSelect: n[1] ||= (e) => q(o).closeOverlays(),
2394
+ onOpen: n[2] ||= (e) => ie(e, !0),
2395
+ onClose: n[3] ||= (e) => ie(e, !1)
2590
2396
  }, {
2591
- default: N(() => [(y(!0), o(e, null, S(B.value?.children ?? [], (t) => (y(), o(e, { key: t.key }, [a(" 二级是菜单组:可展开,下面是三级页面 "), D(ke)(t) && t.children.length ? (y(), i(I, {
2397
+ default: Y(() => [(V(!0), O(S, null, U(B.value?.children ?? [], (e) => (V(), O(S, { key: e.key }, [D(" 二级是菜单组:可展开,下面是三级页面 "), q(p)(e) && e.children.length ? (V(), E(v, {
2592
2398
  key: 0,
2593
- index: t.key,
2399
+ index: e.key,
2594
2400
  tabindex: "0",
2595
- class: h({
2596
- "is-current-page": t.path === D(r).path,
2597
- "is-ancestor": D(r).meta.groupKey === t.key && t.path !== D(r).path
2401
+ class: L({
2402
+ "is-current-page": e.path === q(t).path,
2403
+ "is-ancestor": q(t).meta.groupKey === e.key && e.path !== q(t).path
2598
2404
  }),
2599
- "aria-current": t.path === D(r).path ? "page" : void 0,
2600
- onClickCapture: (e) => oe(e, t),
2601
- onKeydownCapture: (e) => oe(e, t)
2405
+ "aria-current": e.path === q(t).path ? "page" : void 0,
2406
+ onClickCapture: (t) => Z(t, e),
2407
+ onKeydownCapture: (t) => Z(t, e)
2602
2408
  }, {
2603
- title: N(() => [s("span", Lr, [
2604
- t.icon ? (y(), i(c, {
2409
+ title: Y(() => [k("span", Or, [
2410
+ e.icon ? (V(), E(r, {
2605
2411
  key: 0,
2606
- name: t.icon
2607
- }, null, 8, ["name"])) : a("v-if", !0),
2608
- s("span", null, E(D(g)(t.title)), 1),
2609
- V(t) ? (y(), o("span", Rr, E(V(t)), 1)) : a("v-if", !0)
2412
+ name: e.icon
2413
+ }, null, 8, ["name"])) : D("v-if", !0),
2414
+ k("span", null, K(q(l)(e.title)), 1),
2415
+ te(e) ? (V(), O("span", kr, K(te(e)), 1)) : D("v-if", !0)
2610
2416
  ])]),
2611
- default: N(() => [(y(!0), o(e, null, S(t.children, (e) => (y(), i(j, {
2417
+ default: Y(() => [(V(!0), O(S, null, U(e.children, (e) => (V(), E(f, {
2612
2418
  class: "ca-side__submenu-item",
2613
2419
  key: e.key,
2614
2420
  index: e.path,
2615
- "aria-current": e.path === D(r).path ? "page" : void 0
2421
+ "aria-current": e.path === q(t).path ? "page" : void 0
2616
2422
  }, {
2617
- default: N(() => [e.icon ? (y(), i(c, {
2423
+ default: Y(() => [e.icon ? (V(), E(r, {
2618
2424
  key: 0,
2619
2425
  name: e.icon
2620
- }, null, 8, ["name"])) : a("v-if", !0), s("span", null, E(D(g)(e.title)), 1)]),
2426
+ }, null, 8, ["name"])) : D("v-if", !0), k("span", null, K(q(l)(e.title)), 1)]),
2621
2427
  _: 2
2622
2428
  }, 1032, ["index", "aria-current"]))), 128))]),
2623
2429
  _: 2
@@ -2627,377 +2433,390 @@ var yn = ["aria-label"], bn = [
2627
2433
  "aria-current",
2628
2434
  "onClickCapture",
2629
2435
  "onKeydownCapture"
2630
- ])) : (y(), o(e, { key: 1 }, [a(" 二级直接是页面 "), u(j, {
2631
- index: t.path,
2632
- "aria-current": t.path === D(r).path ? "page" : void 0
2436
+ ])) : (V(), O(S, { key: 1 }, [D(" 二级直接是页面 "), M(f, {
2437
+ class: "ca-side__menu-item",
2438
+ index: e.path,
2439
+ "aria-current": e.path === q(t).path ? "page" : void 0
2633
2440
  }, {
2634
- default: N(() => [t.icon ? (y(), i(c, {
2441
+ default: Y(() => [e.icon ? (V(), E(r, {
2635
2442
  key: 0,
2636
- name: t.icon
2637
- }, null, 8, ["name"])) : a("v-if", !0), s("span", null, E(D(g)(t.title)), 1)]),
2443
+ name: e.icon
2444
+ }, null, 8, ["name"])) : D("v-if", !0), k("span", null, K(q(l)(e.title)), 1)]),
2638
2445
  _: 2
2639
2446
  }, 1032, ["index", "aria-current"])], 2112))], 64))), 128))]),
2640
2447
  _: 1
2641
2448
  }, 8, ["default-active", "default-openeds"]))
2642
- ])], 10, Pr)
2449
+ ])], 10, Tr)
2643
2450
  ], 2)], 2112);
2644
2451
  };
2645
2452
  }
2646
- }), [["__scopeId", "data-v-71272a0f"]]), Br = {
2453
+ }), [["__scopeId", "data-v-53f91ad6"]]), jr = {
2647
2454
  key: 0,
2648
2455
  class: "ca-copyright"
2649
- }, Vr = ["href"], Hr = /*#__PURE__*/ Z(/* @__PURE__ */ d({
2456
+ }, Mr = ["href"], Nr = /*#__PURE__*/ s(/* @__PURE__ */ N({
2650
2457
  __name: "CaCopyright",
2651
- setup(t) {
2652
- let r = J().brand, { label: i } = q(), c = n(() => r.copyright ? We(i(r.copyright)) : ""), l = n(() => r.copyrightLinks ?? []);
2653
- return (t, n) => c.value ? (y(), o("footer", Br, [s("span", null, E(c.value), 1), (y(!0), o(e, null, S(l.value, (t) => (y(), o(e, { key: t.href }, [n[0] ||= s("span", {
2458
+ setup(e) {
2459
+ let t = f().brand, { label: n } = c(), r = w(() => t.copyright ? Pe(n(t.copyright)) : ""), i = w(() => t.copyrightLinks ?? []);
2460
+ return (e, t) => r.value ? (V(), O("footer", jr, [k("span", null, K(r.value), 1), (V(!0), O(S, null, U(i.value, (e) => (V(), O(S, { key: e.href }, [t[0] ||= k("span", {
2654
2461
  class: "ca-copyright__dot",
2655
2462
  "aria-hidden": "true"
2656
- }, "·", -1), s("a", {
2657
- href: t.href,
2463
+ }, "·", -1), k("a", {
2464
+ href: e.href,
2658
2465
  target: "_blank",
2659
2466
  rel: "noopener noreferrer"
2660
- }, E(t.text), 9, Vr)], 64))), 128))])) : a("v-if", !0);
2467
+ }, K(e.text), 9, Mr)], 64))), 128))])) : D("v-if", !0);
2661
2468
  }
2662
- }), [["__scopeId", "data-v-c51879e8"]]), Ur = { class: "ca-tabs" }, Wr = ["onClick"], Gr = { class: "ca-tabs__more" }, Kr = [
2469
+ }), [["__scopeId", "data-v-c51879e8"]]), Pr = { class: "ca-tabs" }, Fr = ["onClick"], Ir = { class: "ca-tabs__more" }, Lr = [
2663
2470
  "title",
2664
2471
  "aria-label",
2665
2472
  "aria-pressed"
2666
- ], qr = /*#__PURE__*/ Z(/* @__PURE__ */ d({
2473
+ ], Rr = /*#__PURE__*/ s(/* @__PURE__ */ N({
2667
2474
  __name: "TabsBar",
2668
- setup(t) {
2669
- let r = W(), c = G(), d = gt(), f = ft(), { t: p, label: g } = q(), _ = new Map(Pe(J().menus).map((e) => [e.key, e])), b = n(() => d.visited.map((e) => _.get(e)).filter((e) => !!e).map((e) => ({
2475
+ setup(e) {
2476
+ let t = _e(), n = Q(), r = g(), i = v(), { t: a, label: o } = c(), s = new Map(y(f().menus).map((e) => [e.key, e])), l = w(() => r.visited.map((e) => s.get(e)).filter((e) => !!e).map((e) => ({
2670
2477
  key: e.key,
2671
2478
  path: e.path,
2672
- title: g(e.title),
2479
+ title: o(e.title),
2673
2480
  closable: !e.affix,
2674
- icon: e.affix ? e.icon : void 0
2675
- }))), C = n(() => r.meta.pageKey), T = n(() => [{
2481
+ icon: e.icon ?? "document"
2482
+ }))), u = w(() => t.meta.pageKey), d = w(() => [{
2676
2483
  name: "fixed",
2677
2484
  scroll: !1,
2678
- items: b.value.filter((e) => !e.closable)
2485
+ items: l.value.filter((e) => !e.closable)
2679
2486
  }, {
2680
2487
  name: "list",
2681
2488
  scroll: !0,
2682
- items: b.value.filter((e) => e.closable)
2683
- }]), O = x();
2684
- function k() {
2685
- m(() => {
2686
- O.value?.querySelector(".is-active")?.scrollIntoView({
2489
+ items: l.value.filter((e) => e.closable)
2490
+ }]), p = H();
2491
+ function m() {
2492
+ I(() => {
2493
+ p.value?.querySelector(".is-active")?.scrollIntoView({
2687
2494
  inline: "nearest",
2688
2495
  block: "nearest",
2689
2496
  behavior: "smooth"
2690
2497
  });
2691
2498
  });
2692
2499
  }
2693
- j([C, () => b.value.length], k), v(k);
2694
- function A(e) {
2695
- let t = d.close(e);
2696
- if (e !== C.value) return;
2697
- let n = t ? _.get(t)?.path : void 0;
2698
- c.push(n ?? "/");
2500
+ J([u, () => l.value.length], m), B(m);
2501
+ function h(e) {
2502
+ let t = r.close(e);
2503
+ if (e !== u.value) return;
2504
+ let i = t ? s.get(t)?.path : void 0;
2505
+ n.push(i ?? "/");
2699
2506
  }
2700
- let M = n(() => {
2701
- let e = d.visited.indexOf(C.value ?? "");
2702
- return d.visited.some((t, n) => n < e && !d.affixKeys.includes(t));
2703
- }), P = n(() => {
2704
- let e = d.visited.indexOf(C.value ?? "");
2705
- return e !== -1 && d.visited.some((t, n) => n > e && !d.affixKeys.includes(t));
2507
+ let _ = w(() => {
2508
+ let e = r.visited.indexOf(u.value ?? "");
2509
+ return r.visited.some((t, n) => n < e && !r.affixKeys.includes(t));
2510
+ }), b = w(() => {
2511
+ let e = r.visited.indexOf(u.value ?? "");
2512
+ return e !== -1 && r.visited.some((t, n) => n > e && !r.affixKeys.includes(t));
2706
2513
  });
2707
- function I(e) {
2708
- let t = C.value;
2709
- e === "closeAll" ? (d.closeAll(), c.push(_.get(d.affixKeys[0] ?? "")?.path ?? "/")) : t && (e === "close" ? A(t) : e === "closeLeft" ? d.closeLeft(t) : e === "closeRight" ? d.closeRight(t) : d.closeOthers(t));
2514
+ function x(e) {
2515
+ let t = u.value;
2516
+ e === "closeAll" ? (r.closeAll(), n.push(s.get(r.affixKeys[0] ?? "")?.path ?? "/")) : t && (e === "close" ? h(t) : e === "closeLeft" ? r.closeLeft(t) : e === "closeRight" ? r.closeRight(t) : r.closeOthers(t));
2710
2517
  }
2711
- return (t, n) => {
2712
- let r = w("ca-icon"), d = w("ca-dropdown-item"), m = w("ca-dropdown-menu"), g = w("ca-dropdown");
2713
- return y(), o("div", Ur, [
2714
- (y(!0), o(e, null, S(T.value, (t) => (y(), o("div", {
2715
- key: t.name,
2518
+ return (e, t) => {
2519
+ let r = W("ca-icon"), o = W("ca-dropdown-item"), s = W("ca-dropdown-menu"), c = W("ca-dropdown");
2520
+ return V(), O("div", Pr, [
2521
+ (V(!0), O(S, null, U(d.value, (e) => (V(), O("div", {
2522
+ key: e.name,
2716
2523
  ref_for: !0,
2717
- ref: (e) => {
2718
- t.scroll && (O.value = e);
2524
+ ref: (t) => {
2525
+ e.scroll && (p.value = t);
2719
2526
  },
2720
- class: h(t.scroll ? "ca-tabs__list" : "ca-tabs__fixed")
2721
- }, [(y(!0), o(e, null, S(t.items, (e) => (y(), o("div", {
2527
+ class: L(e.scroll ? "ca-tabs__list" : "ca-tabs__fixed")
2528
+ }, [(V(!0), O(S, null, U(e.items, (e) => (V(), O("div", {
2722
2529
  key: e.key,
2723
- class: h(["ca-tabs__item", { "is-active": e.key === C.value }]),
2724
- onClick: (t) => D(c).push(e.path)
2530
+ class: L(["ca-tabs__item", { "is-active": e.key === u.value }]),
2531
+ onClick: (t) => q(n).push(e.path)
2725
2532
  }, [
2726
- e.icon ? (y(), i(r, {
2533
+ e.icon ? (V(), E(r, {
2727
2534
  key: 0,
2728
2535
  name: e.icon
2729
- }, null, 8, ["name"])) : a("v-if", !0),
2730
- s("span", null, E(e.title), 1),
2731
- e.closable ? (y(), i(r, {
2536
+ }, null, 8, ["name"])) : D("v-if", !0),
2537
+ k("span", null, K(e.title), 1),
2538
+ e.closable ? (V(), E(r, {
2732
2539
  key: 1,
2733
2540
  name: "close",
2734
2541
  class: "ca-tabs__close",
2735
- onClick: F((t) => A(e.key), ["stop"])
2736
- }, null, 8, ["onClick"])) : a("v-if", !0)
2737
- ], 10, Wr))), 128))], 2))), 128)),
2738
- u(g, {
2542
+ onClick: Z((t) => h(e.key), ["stop"])
2543
+ }, null, 8, ["onClick"])) : D("v-if", !0)
2544
+ ], 10, Fr))), 128))], 2))), 128)),
2545
+ M(c, {
2739
2546
  trigger: "click",
2740
- onCommand: I
2547
+ onCommand: x
2741
2548
  }, {
2742
- dropdown: N(() => [u(m, null, {
2743
- default: N(() => [
2744
- u(d, { command: "close" }, {
2745
- default: N(() => [l(E(D(p)("campus.tabs.close")), 1)]),
2549
+ dropdown: Y(() => [M(s, null, {
2550
+ default: Y(() => [
2551
+ M(o, { command: "close" }, {
2552
+ default: Y(() => [j(K(q(a)("campus.tabs.close")), 1)]),
2746
2553
  _: 1
2747
2554
  }),
2748
- M.value ? (y(), i(d, {
2555
+ _.value ? (V(), E(o, {
2749
2556
  key: 0,
2750
2557
  command: "closeLeft"
2751
2558
  }, {
2752
- default: N(() => [l(E(D(p)("campus.tabs.closeLeft")), 1)]),
2559
+ default: Y(() => [j(K(q(a)("campus.tabs.closeLeft")), 1)]),
2753
2560
  _: 1
2754
- })) : a("v-if", !0),
2755
- P.value ? (y(), i(d, {
2561
+ })) : D("v-if", !0),
2562
+ b.value ? (V(), E(o, {
2756
2563
  key: 1,
2757
2564
  command: "closeRight"
2758
2565
  }, {
2759
- default: N(() => [l(E(D(p)("campus.tabs.closeRight")), 1)]),
2566
+ default: Y(() => [j(K(q(a)("campus.tabs.closeRight")), 1)]),
2760
2567
  _: 1
2761
- })) : a("v-if", !0),
2762
- u(d, { command: "closeOthers" }, {
2763
- default: N(() => [l(E(D(p)("campus.tabs.closeOthers")), 1)]),
2568
+ })) : D("v-if", !0),
2569
+ M(o, { command: "closeOthers" }, {
2570
+ default: Y(() => [j(K(q(a)("campus.tabs.closeOthers")), 1)]),
2764
2571
  _: 1
2765
2572
  }),
2766
- u(d, { command: "closeAll" }, {
2767
- default: N(() => [l(E(D(p)("campus.tabs.closeAll")), 1)]),
2573
+ M(o, { command: "closeAll" }, {
2574
+ default: Y(() => [j(K(q(a)("campus.tabs.closeAll")), 1)]),
2768
2575
  _: 1
2769
2576
  })
2770
2577
  ]),
2771
2578
  _: 1
2772
2579
  })]),
2773
- default: N(() => [s("span", Gr, [u(r, { name: "arrowDown" })])]),
2580
+ default: Y(() => [k("span", Ir, [M(r, { name: "arrowDown" })])]),
2774
2581
  _: 1
2775
2582
  }),
2776
- a(" 内容全屏:隐藏头部和侧栏,再点一次恢复 "),
2777
- s("button", {
2583
+ D(" 内容全屏:隐藏头部和侧栏,再点一次恢复 "),
2584
+ k("button", {
2778
2585
  type: "button",
2779
2586
  class: "ca-tabs__more ca-tabs__fullscreen",
2780
- title: D(f).contentFullscreen ? D(p)("campus.tabs.exitFullscreen") : D(p)("campus.tabs.fullscreen"),
2781
- "aria-label": D(f).contentFullscreen ? D(p)("campus.tabs.exitFullscreen") : D(p)("campus.tabs.fullscreen"),
2782
- "aria-pressed": D(f).contentFullscreen,
2783
- onClick: n[0] ||= (e) => D(f).toggleContentFullscreen()
2784
- }, [u(r, { name: D(f).contentFullscreen ? "exitFullscreen" : "fullscreen" }, null, 8, ["name"])], 8, Kr)
2587
+ title: q(i).contentFullscreen ? q(a)("campus.tabs.exitFullscreen") : q(a)("campus.tabs.fullscreen"),
2588
+ "aria-label": q(i).contentFullscreen ? q(a)("campus.tabs.exitFullscreen") : q(a)("campus.tabs.fullscreen"),
2589
+ "aria-pressed": q(i).contentFullscreen,
2590
+ onClick: t[0] ||= (e) => q(i).toggleContentFullscreen()
2591
+ }, [M(r, { name: q(i).contentFullscreen ? "exitFullscreen" : "fullscreen" }, null, 8, ["name"])], 8, Lr)
2785
2592
  ]);
2786
2593
  };
2787
2594
  }
2788
- }), [["__scopeId", "data-v-1d7ba823"]]), Jr = 1200, Yr = "(max-width: 768px)", Xr = `(min-width: 769px) and (max-width: ${Jr}px)`, Zr = ["aria-label"], Qr = ["aria-label"], $r = { class: "ca-main" }, ei = {
2595
+ }), [["__scopeId", "data-v-13754aa3"]]), zr = 1200, Br = "(max-width: 768px)", Vr = `(min-width: 769px) and (max-width: ${zr}px)`, Hr = {
2596
+ key: 0,
2597
+ class: "ca-shell__header-surface",
2598
+ "aria-hidden": "true",
2599
+ inert: ""
2600
+ }, Ur = ["aria-label"], Wr = ["aria-label"], Gr = { class: "ca-main" }, Kr = {
2789
2601
  key: 0,
2790
2602
  class: "ca-screen-prompt",
2791
2603
  role: "status"
2792
- }, ti = { class: "ca-content" }, ni = { class: "ca-content__page" }, ri = /*#__PURE__*/ Z(/* @__PURE__ */ d({
2604
+ }, qr = { class: "ca-content" }, Jr = { class: "ca-content__page" }, Yr = /*#__PURE__*/ s(/* @__PURE__ */ N({
2793
2605
  __name: "CaLayout",
2794
2606
  setup(e) {
2795
- let n = W(), r = gt(), c = ft(), { t: d } = q(), f = window.matchMedia(Yr), p = window.matchMedia(Xr), m = "";
2796
- function g() {
2797
- let e = f.matches ? "phone" : p.matches ? "pad" : "desktop";
2798
- c.setMode(e);
2607
+ let t = _e(), n = f().headerAppearance, r = Ut(n?.height), i = g(), a = v(), { t: o } = c(), s = window.matchMedia(Br), l = window.matchMedia(Vr), u = "";
2608
+ function d() {
2609
+ let e = s.matches ? "phone" : l.matches ? "pad" : "desktop";
2610
+ a.setMode(e);
2799
2611
  }
2800
- g(), j(() => c.mode === "phone" && c.mobileMenuOpen, (e) => {
2801
- e ? (m = document.body.style.overflow, document.body.style.overflow = "hidden") : document.body.style.overflow = m;
2802
- }), j(() => n.fullPath, () => c.closeOverlays());
2803
- function b(e) {
2804
- e.key === "Escape" && (c.mobileMenuOpen || c.padPanelOpen ? c.closeOverlays() : c.contentFullscreen && c.toggleContentFullscreen());
2612
+ d(), J(() => a.mode === "phone" && a.mobileMenuOpen, (e) => {
2613
+ e ? (u = document.body.style.overflow, document.body.style.overflow = "hidden") : document.body.style.overflow = u;
2614
+ }), J(() => t.fullPath, () => a.closeOverlays());
2615
+ function p(e) {
2616
+ e.key === "Escape" && (a.mobileMenuOpen || a.padPanelOpen ? a.closeOverlays() : a.contentFullscreen && a.toggleContentFullscreen());
2805
2617
  }
2806
- v(() => {
2807
- g(), f.addEventListener("change", g), p.addEventListener("change", g), window.addEventListener("keydown", b), document.addEventListener("fullscreenchange", c.syncPageScreen);
2808
- }), _(() => {
2809
- f.removeEventListener("change", g), p.removeEventListener("change", g), window.removeEventListener("keydown", b), document.removeEventListener("fullscreenchange", c.syncPageScreen), c.applyPageOpenMode("normal"), document.body.style.overflow = m;
2618
+ B(() => {
2619
+ d(), s.addEventListener("change", d), l.addEventListener("change", d), window.addEventListener("keydown", p), document.addEventListener("fullscreenchange", a.syncPageScreen);
2620
+ }), z(() => {
2621
+ s.removeEventListener("change", d), l.removeEventListener("change", d), window.removeEventListener("keydown", p), document.removeEventListener("fullscreenchange", a.syncPageScreen), a.applyPageOpenMode("normal"), document.body.style.overflow = u;
2810
2622
  });
2811
- function x() {
2812
- let e = n.meta.pageKey;
2813
- return e ? `${e}:${r.versions[e] ?? 0}` : n.fullPath;
2623
+ function m() {
2624
+ let e = t.meta.pageKey;
2625
+ return e ? `${e}:${i.versions[e] ?? 0}` : t.fullPath;
2814
2626
  }
2815
- return (e, n) => {
2816
- let f = w("ca-button"), p = w("router-view");
2817
- return y(), o("div", { class: h(["ca-shell", { "is-fullscreen": D(c).contentFullscreen }]) }, [P(u(fr, null, null, 512), [[A, !D(c).contentFullscreen]]), s("div", { class: h(["ca-body", { "is-fullscreen": D(c).contentFullscreen }]) }, [
2818
- D(c).mode === "phone" && D(c).mobileMenuOpen ? (y(), o("button", {
2819
- key: 0,
2627
+ return (e, t) => {
2628
+ let s = W("ca-button"), c = W("router-view");
2629
+ return V(), O("div", {
2630
+ class: L(["ca-shell", { "is-fullscreen": q(a).contentFullscreen }]),
2631
+ style: R({
2632
+ "--ca-configured-header-height": q(r),
2633
+ "--ca-header-surface": q(n)?.background
2634
+ })
2635
+ }, [X(M(rr, null, null, 512), [[oe, !q(a).contentFullscreen]]), k("div", { class: L(["ca-body", { "is-fullscreen": q(a).contentFullscreen }]) }, [
2636
+ q(a).contentFullscreen ? D("v-if", !0) : (V(), O("div", Hr, [q(n)?.backgroundComponent ? (V(), E(G(q(n).backgroundComponent), { key: 0 })) : D("v-if", !0)])),
2637
+ q(a).mode === "phone" && q(a).mobileMenuOpen ? (V(), O("button", {
2638
+ key: 1,
2820
2639
  type: "button",
2821
2640
  class: "ca-mobile-scrim",
2822
- "aria-label": D(d)("campus.side.closeMenu"),
2823
- onClick: n[0] ||= (e) => D(c).closeMobileMenu()
2824
- }, null, 8, Zr)) : a("v-if", !0),
2825
- D(c).mode === "pad" && D(c).padPanelOpen ? (y(), o("button", {
2826
- key: 1,
2641
+ "aria-label": q(o)("campus.side.closeMenu"),
2642
+ onClick: t[0] ||= (e) => q(a).closeMobileMenu()
2643
+ }, null, 8, Ur)) : D("v-if", !0),
2644
+ q(a).mode === "pad" && q(a).padPanelOpen ? (V(), O("button", {
2645
+ key: 2,
2827
2646
  type: "button",
2828
2647
  class: "ca-pad-scrim",
2829
- "aria-label": D(d)("campus.side.closeMenu"),
2830
- onClick: n[1] ||= (e) => D(c).closePadPanel()
2831
- }, null, 8, Qr)) : a("v-if", !0),
2832
- a(" 手机抽屉关闭时、电脑档两栏都收起时,侧栏不在屏幕上,不可聚焦 "),
2833
- P(u(zr, {
2834
- class: h({ "is-mobile-open": D(c).mobileMenuOpen }),
2835
- inert: D(c).mode === "phone" && !D(c).mobileMenuOpen || D(c).sideHiddenActive
2836
- }, null, 8, ["class", "inert"]), [[A, !D(c).contentFullscreen]]),
2837
- s("main", $r, [
2838
- u(qr),
2839
- u(yr),
2840
- D(c).pageScreenPrompt ? (y(), o("div", ei, [u(f, {
2648
+ "aria-label": q(o)("campus.side.closeMenu"),
2649
+ onClick: t[1] ||= (e) => q(a).closePadPanel()
2650
+ }, null, 8, Wr)) : D("v-if", !0),
2651
+ D(" 手机抽屉关闭时、电脑档两栏都收起时,侧栏不在屏幕上,不可聚焦 "),
2652
+ X(M(Ar, {
2653
+ class: L({ "is-mobile-open": q(a).mobileMenuOpen }),
2654
+ inert: q(a).mode === "phone" && !q(a).mobileMenuOpen || q(a).sideHiddenActive
2655
+ }, null, 8, ["class", "inert"]), [[oe, !q(a).contentFullscreen]]),
2656
+ k("main", Gr, [
2657
+ M(Rr),
2658
+ M(ur),
2659
+ q(a).pageScreenPrompt ? (V(), O("div", Kr, [M(s, {
2841
2660
  size: "small",
2842
- onClick: n[2] ||= (e) => D(c).retryPageScreen()
2661
+ onClick: t[2] ||= (e) => q(a).retryPageScreen()
2843
2662
  }, {
2844
- default: N(() => [l(E(D(d)("campus.tabs.enterScreen")), 1)]),
2663
+ default: Y(() => [j(K(q(o)("campus.tabs.enterScreen")), 1)]),
2845
2664
  _: 1
2846
- }), u(f, {
2665
+ }), M(s, {
2847
2666
  size: "small",
2848
- "aria-label": D(d)("campus.tabs.dismissScreen"),
2849
- onClick: n[3] ||= (e) => D(c).dismissPageScreenPrompt()
2667
+ "aria-label": q(o)("campus.tabs.dismissScreen"),
2668
+ onClick: t[3] ||= (e) => q(a).dismissPageScreenPrompt()
2850
2669
  }, {
2851
- default: N(() => [l(E(D(d)("campus.tabs.dismissScreen")), 1)]),
2670
+ default: Y(() => [j(K(q(o)("campus.tabs.dismissScreen")), 1)]),
2852
2671
  _: 1
2853
- }, 8, ["aria-label"])])) : a("v-if", !0),
2854
- s("div", ti, [
2855
- u(Cr),
2856
- a(" 页面区撑满剩余高度,版权在其后:内容少时贴窗口底,内容长时滚到最底才出现 "),
2857
- s("div", ni, [u(p, null, {
2858
- default: N(({ Component: e }) => [a(" include 与标签名单同步;缓存容量包含固定标签。 "), (y(), i(t, {
2859
- include: D(r).cached,
2860
- max: D(r).maxTabs + D(r).affixKeys.length
2861
- }, [e ? (y(), i(T(e), { key: x() })) : a("v-if", !0)], 1032, ["include", "max"]))]),
2672
+ }, 8, ["aria-label"])])) : D("v-if", !0),
2673
+ k("div", qr, [
2674
+ M(mr),
2675
+ D(" 页面区撑满剩余高度,版权在其后:内容少时贴窗口底,内容长时滚到最底才出现 "),
2676
+ k("div", Jr, [M(c, null, {
2677
+ default: Y(({ Component: e }) => [D(" include 与标签名单同步;缓存容量包含固定标签。 "), (V(), E(C, {
2678
+ include: q(i).cached,
2679
+ max: q(i).maxTabs + q(i).affixKeys.length
2680
+ }, [e ? (V(), E(G(e), { key: m() })) : D("v-if", !0)], 1032, ["include", "max"]))]),
2862
2681
  _: 1
2863
2682
  })]),
2864
- u(Hr)
2683
+ M(Nr)
2865
2684
  ])
2866
2685
  ])
2867
- ], 2)], 2);
2686
+ ], 2)], 6);
2868
2687
  };
2869
2688
  }
2870
- }), [["__scopeId", "data-v-90594751"]]), ii = { class: "ca-exception" }, ai = { class: "ca-exception__code" }, oi = { class: "ca-exception__text" }, si = /*#__PURE__*/ Z(/* @__PURE__ */ d({
2689
+ }), [["__scopeId", "data-v-fac967c0"]]), Xr = { class: "ca-exception" }, Zr = { class: "ca-exception__code" }, Qr = { class: "ca-exception__text" }, $r = /*#__PURE__*/ s(/* @__PURE__ */ N({
2871
2690
  __name: "ExceptionPage",
2872
2691
  props: { kind: {} },
2873
2692
  setup(e) {
2874
- let t = e, r = G(), i = Fe(J()).home, { t: a } = q(), c = n(() => t.kind === "forbidden" ? "403" : "404"), d = n(() => a(t.kind === "forbidden" ? "campus.error.forbidden" : "campus.error.notFound"));
2693
+ let t = e, n = Q(), r = m(f()).home, { t: i } = c(), a = w(() => t.kind === "forbidden" ? "403" : "404"), o = w(() => i(t.kind === "forbidden" ? "campus.error.forbidden" : "campus.error.notFound"));
2875
2694
  return (e, t) => {
2876
- let n = w("ca-button");
2877
- return y(), o("div", ii, [
2878
- s("h1", ai, E(c.value), 1),
2879
- s("p", oi, E(d.value), 1),
2880
- u(n, {
2695
+ let s = W("ca-button");
2696
+ return V(), O("div", Xr, [
2697
+ k("h1", Zr, K(a.value), 1),
2698
+ k("p", Qr, K(o.value), 1),
2699
+ M(s, {
2881
2700
  type: "primary",
2882
- onClick: t[0] ||= (e) => D(r).replace(D(i))
2701
+ onClick: t[0] ||= (e) => q(n).replace(q(r))
2883
2702
  }, {
2884
- default: N(() => [l(E(D(a)("campus.error.backHome")), 1)]),
2703
+ default: Y(() => [j(K(q(i)("campus.error.backHome")), 1)]),
2885
2704
  _: 1
2886
2705
  })
2887
2706
  ]);
2888
2707
  };
2889
2708
  }
2890
- }), [["__scopeId", "data-v-c6bc58c6"]]), ci = { class: "ca-login" }, li = { class: "ca-login__main" }, ui = { class: "ca-card ca-login__card" }, di = { class: "ca-login__brand" }, fi = ["src"], pi = { class: "ca-login__name" }, mi = {
2709
+ }), [["__scopeId", "data-v-c6bc58c6"]]), ei = { class: "ca-login" }, ti = { class: "ca-login__main" }, ni = { class: "ca-card ca-login__card" }, ri = { class: "ca-login__brand" }, ii = ["src"], ai = { class: "ca-login__name" }, oi = {
2891
2710
  key: 1,
2892
2711
  class: "ca-login__subtitle"
2893
- }, hi = ["id"], gi = /*#__PURE__*/ Z(/* @__PURE__ */ d({
2712
+ }, si = ["id"], ci = /*#__PURE__*/ s(/* @__PURE__ */ N({
2894
2713
  __name: "LoginPage",
2895
- setup(t) {
2896
- let r = W(), c = G(), d = Q(), f = Ue(), { t: p, label: h } = q(), g = J().brand, _ = n(() => h(f.theme.siteName ?? g.name)), v = n(() => f.theme.logo ?? g.logo), C = Ke(), T = b({
2714
+ setup(e) {
2715
+ let t = _e(), n = Q(), r = b(), i = Ne(), { t: a, label: o } = c(), s = f().brand, l = w(() => o(i.theme.siteName ?? s.name)), u = w(() => i.theme.logo ?? s.logo), d = Le(), p = te({
2897
2716
  username: "",
2898
2717
  password: "",
2899
2718
  captcha: ""
2900
- }), k = x(""), A = x([]), j = x(), M = x(!1), P = x(""), I = O(), L = n(() => [
2719
+ }), m = H(""), h = H([]), g = H(), _ = H(!1), v = H(""), y = ie(), x = w(() => [
2901
2720
  {
2902
2721
  key: "username",
2903
- label: p("campus.login.username")
2722
+ label: a("campus.login.username")
2904
2723
  },
2905
2724
  {
2906
2725
  key: "password",
2907
- label: p("campus.login.password")
2726
+ label: a("campus.login.password")
2908
2727
  },
2909
- ...C.captcha ? [{
2728
+ ...d.captcha ? [{
2910
2729
  key: "captcha",
2911
- label: p("campus.auth.captcha")
2730
+ label: a("campus.auth.captcha")
2912
2731
  }] : []
2913
2732
  ].map((e) => {
2914
- let t = j.value?.getField(e.key), n = `${I}-${e.key}`, r = t?.validateState === "error" ? t.validateMessage : "";
2733
+ let t = g.value?.getField(e.key), n = `${y}-${e.key}`, r = t?.validateState === "error" ? t.validateMessage : "";
2915
2734
  return {
2916
2735
  ...e,
2917
2736
  id: n,
2918
2737
  error: r,
2919
2738
  errorId: r ? `${n}-error` : void 0
2920
2739
  };
2921
- })), R = n(() => ({
2740
+ })), C = w(() => ({
2922
2741
  username: [{
2923
2742
  required: !0,
2924
- message: p("campus.login.required", { label: p("campus.login.username") }),
2743
+ message: a("campus.login.required", { label: a("campus.login.username") }),
2925
2744
  trigger: "blur"
2926
2745
  }],
2927
2746
  password: [{
2928
2747
  required: !0,
2929
- message: p("campus.login.required", { label: p("campus.login.password") }),
2748
+ message: a("campus.login.required", { label: a("campus.login.password") }),
2930
2749
  trigger: "blur"
2931
2750
  }],
2932
- captcha: C.captcha ? [{
2751
+ captcha: d.captcha ? [{
2933
2752
  required: !0,
2934
- message: p("campus.auth.captchaRequired"),
2753
+ message: a("campus.auth.captchaRequired"),
2935
2754
  trigger: "blur"
2936
2755
  }] : []
2937
2756
  }));
2938
- async function z() {
2939
- if (!M.value) {
2940
- P.value = "";
2757
+ async function T() {
2758
+ if (!_.value) {
2759
+ v.value = "";
2941
2760
  try {
2942
- await j.value?.validate();
2761
+ await g.value?.validate();
2943
2762
  } catch {
2944
- await m();
2945
- let e = L.value.find((e) => e.error);
2763
+ await I();
2764
+ let e = x.value.find((e) => e.error);
2946
2765
  e && document.getElementById(e.id)?.focus();
2947
2766
  return;
2948
2767
  }
2949
- if (!M.value) {
2950
- M.value = !0;
2768
+ if (!_.value) {
2769
+ _.value = !0;
2951
2770
  try {
2952
- await d.login({
2953
- username: T.username,
2954
- password: T.password,
2955
- captcha: C.captcha ? {
2956
- key: k.value,
2957
- code: T.captcha
2771
+ await r.login({
2772
+ username: p.username,
2773
+ password: p.password,
2774
+ captcha: d.captcha ? {
2775
+ key: m.value,
2776
+ code: p.captcha
2958
2777
  } : void 0
2959
- }), await c.replace(qe(r.query.redirect));
2778
+ }), await n.replace(Re(t.query.redirect));
2960
2779
  } catch (e) {
2961
- P.value = e instanceof Error && e.message ? e.message : p("campus.login.failed"), A.value[0]?.refresh();
2780
+ v.value = e instanceof Error && e.message ? e.message : a("campus.login.failed"), h.value[0]?.refresh();
2962
2781
  } finally {
2963
- M.value = !1;
2782
+ _.value = !1;
2964
2783
  }
2965
2784
  }
2966
2785
  }
2967
2786
  }
2968
- return (t, n) => {
2969
- let r = w("ca-alert"), c = w("ca-input"), d = w("ca-form-item"), f = w("ca-button"), m = w("ca-form");
2970
- return y(), o("div", ci, [s("main", li, [s("div", ui, [
2971
- s("div", di, [
2972
- v.value ? (y(), o("img", {
2787
+ return (e, t) => {
2788
+ let n = W("ca-alert"), r = W("ca-input"), i = W("ca-form-item"), c = W("ca-button"), d = W("ca-form");
2789
+ return V(), O("div", ei, [k("main", ti, [k("div", ni, [
2790
+ k("div", ri, [
2791
+ u.value ? (V(), O("img", {
2973
2792
  key: 0,
2974
- src: v.value,
2793
+ src: u.value,
2975
2794
  alt: "",
2976
2795
  class: "ca-login__logo"
2977
- }, null, 8, fi)) : a("v-if", !0),
2978
- s("h1", pi, E(_.value), 1),
2979
- D(g).subtitle ? (y(), o("p", mi, E(D(h)(D(g).subtitle)), 1)) : a("v-if", !0)
2796
+ }, null, 8, ii)) : D("v-if", !0),
2797
+ k("h1", ai, K(l.value), 1),
2798
+ q(s).subtitle ? (V(), O("p", oi, K(q(o)(q(s).subtitle)), 1)) : D("v-if", !0)
2980
2799
  ]),
2981
- P.value ? (y(), i(r, {
2800
+ v.value ? (V(), E(n, {
2982
2801
  key: 0,
2983
- title: P.value,
2802
+ title: v.value,
2984
2803
  type: "error",
2985
2804
  "show-icon": "",
2986
2805
  closable: !1,
2987
2806
  class: "ca-login__error"
2988
- }, null, 8, ["title"])) : a("v-if", !0),
2989
- u(m, {
2807
+ }, null, 8, ["title"])) : D("v-if", !0),
2808
+ M(d, {
2990
2809
  ref_key: "formRef",
2991
- ref: j,
2992
- model: T,
2993
- rules: R.value,
2810
+ ref: g,
2811
+ model: p,
2812
+ rules: C.value,
2994
2813
  size: "large",
2995
2814
  "label-position": "top",
2996
2815
  "hide-required-asterisk": "",
2997
2816
  class: "ca-auth-form ca-login__form",
2998
- onSubmit: F(z, ["prevent"])
2817
+ onSubmit: Z(T, ["prevent"])
2999
2818
  }, {
3000
- default: N(() => [(y(!0), o(e, null, S(L.value, (e) => (y(), i(d, {
2819
+ default: Y(() => [(V(!0), O(S, null, U(x.value, (e) => (V(), E(i, {
3001
2820
  key: e.key,
3002
2821
  prop: e.key,
3003
2822
  label: e.label,
@@ -3005,15 +2824,15 @@ var yn = ["aria-label"], bn = [
3005
2824
  "show-message": !1,
3006
2825
  class: "ca-login__field"
3007
2826
  }, {
3008
- default: N(() => [e.key === "captcha" ? (y(), i(wt, {
2827
+ default: Y(() => [e.key === "captcha" ? (V(), E(st, {
3009
2828
  key: 0,
3010
2829
  ref_for: !0,
3011
2830
  ref_key: "captchaFields",
3012
- ref: A,
3013
- code: T.captcha,
3014
- "onUpdate:code": n[0] ||= (e) => T.captcha = e,
3015
- "captcha-key": k.value,
3016
- "onUpdate:captchaKey": n[1] ||= (e) => k.value = e,
2831
+ ref: h,
2832
+ code: p.captcha,
2833
+ "onUpdate:code": t[0] ||= (e) => p.captcha = e,
2834
+ "captcha-key": m.value,
2835
+ "onUpdate:captchaKey": t[1] ||= (e) => m.value = e,
3017
2836
  scene: "login",
3018
2837
  "input-id": e.id,
3019
2838
  "input-error-id": e.errorId
@@ -3022,11 +2841,11 @@ var yn = ["aria-label"], bn = [
3022
2841
  "captcha-key",
3023
2842
  "input-id",
3024
2843
  "input-error-id"
3025
- ])) : (y(), i(c, {
2844
+ ])) : (V(), E(r, {
3026
2845
  key: 1,
3027
2846
  id: e.id,
3028
- modelValue: T[e.key],
3029
- "onUpdate:modelValue": (t) => T[e.key] = t,
2847
+ modelValue: p[e.key],
2848
+ "onUpdate:modelValue": (t) => p[e.key] = t,
3030
2849
  class: "ca-login__input",
3031
2850
  type: e.key === "password" ? "password" : "text",
3032
2851
  "show-password": e.key === "password",
@@ -3042,52 +2861,52 @@ var yn = ["aria-label"], bn = [
3042
2861
  "autocomplete",
3043
2862
  "aria-invalid",
3044
2863
  "aria-describedby"
3045
- ])), e.error ? (y(), o("p", {
2864
+ ])), e.error ? (V(), O("p", {
3046
2865
  key: 2,
3047
2866
  id: e.errorId,
3048
2867
  class: "ca-login__field-error"
3049
- }, E(e.error), 9, hi)) : a("v-if", !0)]),
2868
+ }, K(e.error), 9, si)) : D("v-if", !0)]),
3050
2869
  _: 2
3051
2870
  }, 1032, [
3052
2871
  "prop",
3053
2872
  "label",
3054
2873
  "for"
3055
- ]))), 128)), u(f, {
2874
+ ]))), 128)), M(c, {
3056
2875
  type: "primary",
3057
2876
  "native-type": "submit",
3058
- loading: M.value,
2877
+ loading: _.value,
3059
2878
  class: "ca-login__submit"
3060
2879
  }, {
3061
- default: N(() => [l(E(D(p)("campus.login.submit")), 1)]),
2880
+ default: Y(() => [j(K(q(a)("campus.login.submit")), 1)]),
3062
2881
  _: 1
3063
2882
  }, 8, ["loading"])]),
3064
2883
  _: 1
3065
2884
  }, 8, ["model", "rules"])
3066
- ])]), u(Hr, { class: "ca-login__copyright" })]);
2885
+ ])]), M(Nr, { class: "ca-login__copyright" })]);
3067
2886
  };
3068
2887
  }
3069
2888
  }), [["__scopeId", "data-v-163d1aec"]]);
3070
2889
  // packages/core/src/router.ts
3071
- function _i(e) {
2890
+ function li(e) {
3072
2891
  return async () => {
3073
2892
  let t = await e.component();
3074
- return d({
2893
+ return N({
3075
2894
  name: e.key,
3076
- setup: () => () => f(t.default)
2895
+ setup: () => () => P(t.default)
3077
2896
  });
3078
2897
  };
3079
2898
  }
3080
- var vi = d({
2899
+ var ui = N({
3081
2900
  name: "CaForbidden",
3082
- setup: () => () => f(si, { kind: "forbidden" })
3083
- }), yi = d({
2901
+ setup: () => () => P($r, { kind: "forbidden" })
2902
+ }), di = N({
3084
2903
  name: "CaNotFound",
3085
- setup: () => () => f(si, { kind: "notFound" })
2904
+ setup: () => () => P($r, { kind: "notFound" })
3086
2905
  });
3087
- function bi(e, t) {
3088
- let n = Pe(e.menus);
2906
+ function fi(e, t) {
2907
+ let n = y(e.menus);
3089
2908
  if (!n.length) throw Error("[campus] 菜单里至少需要一个页面");
3090
- let r = Fe(e), i = Y(e);
2909
+ let r = m(e), i = d(e);
3091
2910
  if (new Set(Object.values(i)).size !== 5 || n.some((e) => Object.values(i).includes(e.key))) throw Error("[campus] 系统路由名称重复或与页面键冲突,请配置 routeNames");
3092
2911
  for (let e of n) if ([
3093
2912
  r.login,
@@ -3100,33 +2919,33 @@ function bi(e, t) {
3100
2919
  {
3101
2920
  path: r.login,
3102
2921
  name: i.login,
3103
- component: e.login?.style === "split" ? Rt : gi,
2922
+ component: e.login?.style === "split" ? xt : ci,
3104
2923
  meta: { public: !0 }
3105
2924
  },
3106
2925
  {
3107
2926
  path: r.register,
3108
2927
  name: i.register,
3109
- component: on,
2928
+ component: Pt,
3110
2929
  meta: { public: !0 }
3111
2930
  },
3112
2931
  {
3113
2932
  path: r.forgot,
3114
2933
  name: i.forgot,
3115
- component: un,
2934
+ component: Rt,
3116
2935
  meta: { public: !0 }
3117
2936
  },
3118
2937
  {
3119
2938
  path: "/",
3120
- component: ri,
2939
+ component: Yr,
3121
2940
  redirect: n.some((e) => e.path === "/") ? void 0 : () => {
3122
- let e = Q(t);
2941
+ let e = b(t);
3123
2942
  return r.home === "/" ? n.find((t) => e.can(t.permission))?.path ?? r.forbidden : r.home;
3124
2943
  },
3125
2944
  children: [
3126
2945
  ...n.map((e) => ({
3127
2946
  path: e.path,
3128
2947
  name: e.key,
3129
- component: _i(e),
2948
+ component: li(e),
3130
2949
  meta: {
3131
2950
  pageKey: e.key,
3132
2951
  appKey: e.appKey,
@@ -3139,12 +2958,12 @@ function bi(e, t) {
3139
2958
  {
3140
2959
  path: r.forbidden,
3141
2960
  name: i.forbidden,
3142
- component: vi
2961
+ component: ui
3143
2962
  },
3144
2963
  {
3145
2964
  path: r.notFound,
3146
2965
  name: i.notFound,
3147
- component: yi
2966
+ component: di
3148
2967
  },
3149
2968
  ...r.notFound === "/:pathMatch(.*)*" ? [] : [{
3150
2969
  path: "/:pathMatch(.*)*",
@@ -3152,12 +2971,12 @@ function bi(e, t) {
3152
2971
  }]
3153
2972
  ]
3154
2973
  }
3155
- ], o = re({
3156
- history: e.history === "web" ? U() : H(),
2974
+ ], o = me({
2975
+ history: e.history === "web" ? ge() : he(),
3157
2976
  routes: a
3158
- }), s = ft(t);
2977
+ }), s = v(t);
3159
2978
  return o.beforeEach((e, n) => {
3160
- let a = Q(t);
2979
+ let a = b(t);
3161
2980
  return e.meta.public ? a.isLoggedIn && e.name === i.login ? { path: r.home } : !0 : a.isLoggedIn ? a.can(e.meta.permission) ? (e.path === n.path && n.matched.length || e.meta.openMode !== "screen" || s.preparePageScreen(), !0) : { name: i.forbidden } : {
3162
2981
  name: i.login,
3163
2982
  query: e.fullPath === r.home ? void 0 : { redirect: e.fullPath }
@@ -3166,51 +2985,51 @@ function bi(e, t) {
3166
2985
  if (i) s.cancelPageScreen();
3167
2986
  else {
3168
2987
  if (n.path === r.path && r.matched.length || s.applyPageOpenMode(n.meta.openMode, n.meta.sideCollapse), n.path !== r.path || !r.matched.length) {
3169
- let r = Ie(e, (e) => Q(t).can(e)).apps.find((e) => e.key === n.meta.appKey);
2988
+ let r = x(e, (e) => b(t).can(e)).apps.find((e) => e.key === n.meta.appKey);
3170
2989
  s.enterParentPage(r?.path === n.path && r.children.length ? r.key : void 0, n.meta.openMode == null ? n.meta.sideCollapse === "panel" || n.meta.sideCollapse === "all" : n.meta.openMode !== "normal"), n.meta.groupKey && s.ensureMenuGroup(n.meta.groupKey);
3171
2990
  }
3172
- n.meta.pageKey && gt(t).open(n.meta.pageKey);
2991
+ n.meta.pageKey && g(t).open(n.meta.pageKey);
3173
2992
  }
3174
2993
  }), o.onError(() => s.cancelPageScreen()), o;
3175
2994
  }
3176
2995
  // packages/core/src/services/login.ts
3177
- async function xi(e, t, n, r) {
3178
- e.signIn(n), await t.replace(qe(r));
2996
+ async function pi(e, t, n, r) {
2997
+ e.signIn(n), await t.replace(Re(r));
3179
2998
  }
3180
2999
  // packages/core/src/services/auth.ts
3181
- var Si, Ci;
3182
- function wi(e, t) {
3183
- Si = e, Ci = t;
3000
+ var mi, hi;
3001
+ function gi(e, t) {
3002
+ mi = e, hi = t;
3184
3003
  }
3185
- async function Ti(e) {
3186
- if (J(), !Si || !Ci) return;
3187
- let t = Q(Ci);
3004
+ async function _i(e) {
3005
+ if (f(), !mi || !hi) return;
3006
+ let t = b(hi);
3188
3007
  if (!t.isLoggedIn) return;
3189
- t.expire(), Yt.toast.warning(e || Ee("campus.auth.sessionExpired"));
3190
- let n = Si.currentRoute.value;
3191
- n.name !== "login" && await Si.replace({
3192
- name: Y(J()).login,
3193
- query: n.fullPath === Fe(J()).home ? void 0 : { redirect: n.fullPath }
3008
+ t.expire(), l.toast.warning(e || o("campus.auth.sessionExpired"));
3009
+ let n = mi.currentRoute.value;
3010
+ n.name !== "login" && await mi.replace({
3011
+ name: d(f()).login,
3012
+ query: n.fullPath === m(f()).home ? void 0 : { redirect: n.fullPath }
3194
3013
  });
3195
3014
  }
3196
- async function Ei(e, t) {
3197
- if (J(), !Si || !Ci) throw Error("[campus] 应用尚未创建,无法完成登录");
3198
- await xi(Q(Ci), Si, e, t);
3015
+ async function vi(e, t) {
3016
+ if (f(), !mi || !hi) throw Error("[campus] 应用尚未创建,无法完成登录");
3017
+ await pi(b(hi), mi, e, t);
3199
3018
  }
3200
3019
  // packages/core/src/app.ts
3201
- function Di(e) {
3202
- Bt(e), je(e);
3203
- let t = r(Oe), n = I();
3020
+ function yi(e) {
3021
+ Ct(e), h(e);
3022
+ let t = T(Ee), n = ce();
3204
3023
  t.use(n);
3205
- let i = we(e);
3024
+ let i = r(e);
3206
3025
  t.use(i);
3207
- let a = (e, t) => i.global.t(e, t ?? {});
3208
- t.provide(z, a), Ut(a), t.config.globalProperties.$ca = Yt, R(t), t.component("CaAuthPreview", dn);
3209
- let o = bi(e, n);
3210
- return wi(o, n), t.use(o), Ue(n).boot(), t;
3026
+ let o = (e, t) => i.global.t(e, t ?? {});
3027
+ t.provide(de, o), a(o), t.config.globalProperties.$ca = l, ue(t), t.component("CaAuthPreview", zt);
3028
+ let s = fi(e, n);
3029
+ return gi(s, n), t.use(s), Ne(n).boot(), t;
3211
3030
  }
3212
3031
  // packages/core/src/index.ts
3213
- function Oi(e) {
3032
+ function bi(e) {
3214
3033
  return e;
3215
3034
  }
3216
- export { Yt as ca, Ei as completeLogin, Di as createCampusApp, Oi as defineMenus, Ti as handleUnauthorized, zt as resolveEnvironment, Ee as t, q as useCampusT, ft as useLayoutStore, Q as useSessionStore, gt as useTabsStore, Ue as useThemeStore };
3035
+ export { ln as CaHeaderBrand, vn as CaQuickChat, l as ca, vi as completeLogin, yi as createCampusApp, bi as defineMenus, _i as handleUnauthorized, St as resolveEnvironment, o as t, c as useCampusT, v as useLayoutStore, b as useSessionStore, g as useTabsStore, Ne as useThemeStore };