@webx-ui/module-auth 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,68 +1,68 @@
1
- import { inject as ye, defineComponent as X, computed as U, ref as T, useTemplateRef as re, onBeforeUnmount as Ze, resolveComponent as H, openBlock as h, createBlock as V, withCtx as t, createVNode as a, withModifiers as Pe, createCommentVNode as E, createElementVNode as W, createTextVNode as m, toDisplayString as s, watch as ue, unref as e, isRef as be, normalizeClass as Fe, createElementBlock as G, resolveDynamicComponent as Oe, createSlots as Re, Fragment as ce, renderList as _e, h as Be } from "vue";
2
- import { useTranslate as J, HttpError as et, useAdmin as ee, useI18n as Ee, useErrorText as ve, rowMenuWidth as tt, WxDate as ie, WxRowMenu as Ve, WxFilterChips as De, WxListScreen as Ne, useTheme as at } from "@webx-ui/module-admin";
3
- import { useRouter as lt, useRoute as nt } from "vue-router";
4
- import { useModal as ge, WxDialog as we, WxFormItem as K, WxInput as le, WxSelect as ne, WxSpace as oe, WxCheckbox as ze, WxText as B, WxButton as M, toast as Q, useElementWidth as xe, WxTable as ke, WxEntityCard as Ce, WxBadge as j, WxAvatar as ot, WxIcon as Z, confirm as Ie, createModal as $e, WxCard as Le, WxHeading as he, WxTabs as st, WxTab as me, WxAlert as it, WxThemeSwitch as rt } from "@webx-ui/core";
5
- const Me = /* @__PURE__ */ Symbol("webx-auth");
6
- function Ae() {
7
- const n = ye(Me, null);
1
+ import { inject as ye, defineComponent as Q, computed as U, ref as W, useTemplateRef as re, onBeforeUnmount as Ze, resolveComponent as q, openBlock as h, createBlock as $, withCtx as t, createVNode as a, withModifiers as Fe, createCommentVNode as O, createElementVNode as L, createTextVNode as d, toDisplayString as o, watch as ue, unref as e, isRef as ge, normalizeClass as Re, createElementBlock as Y, resolveDynamicComponent as Oe, createSlots as we, Fragment as de, renderList as _e, onMounted as et, h as Be } from "vue";
2
+ import { useTranslate as K, HttpError as tt, useAdmin as Z, useI18n as Ee, useErrorText as me, rowMenuWidth as at, WxDate as ie, WxRowMenu as Le, WxFilterChips as De, WxListScreen as Me, WxScreen as lt, useTheme as nt } from "@webx-ui/module-admin";
3
+ import { useRouter as st, useRoute as ot } from "vue-router";
4
+ import { useModal as xe, WxDialog as ke, WxFormItem as H, WxInput as le, WxSelect as ne, WxSpace as se, WxCheckbox as Se, WxText as R, WxButton as I, toast as j, useElementWidth as Ce, WxTable as $e, WxEntityCard as Ae, WxBadge as J, WxAvatar as it, WxIcon as ee, confirm as Ne, createModal as Ve, WxHeading as ce, WxCard as be, WxSkeleton as rt, WxTabs as ut, WxTab as fe, WxAlert as ct, WxThemeSwitch as dt } from "@webx-ui/core";
5
+ const Ie = /* @__PURE__ */ Symbol("webx-auth");
6
+ function ze() {
7
+ const n = ye(Ie, null);
8
8
  if (n === null)
9
9
  throw new Error("useAuth() was called outside a panel that installed the auth plugin.");
10
10
  return n;
11
11
  }
12
- function ut(n) {
13
- const u = `${n.apiPath}/auth`;
12
+ function mt(n) {
13
+ const r = `${n.apiPath}/auth`;
14
14
  return {
15
15
  async me() {
16
16
  try {
17
- return (await n.http.get(`${u}/me`)).data;
17
+ return (await n.http.get(`${r}/me`)).data;
18
18
  } catch (l) {
19
- if (dt(l))
19
+ if (pt(l))
20
20
  return null;
21
21
  throw l;
22
22
  }
23
23
  },
24
24
  async login(l) {
25
- const o = await n.http.post(`${u}/login`, {
25
+ const s = await n.http.post(`${r}/login`, {
26
26
  email: l.email,
27
27
  password: l.password,
28
28
  remember: l.remember ?? !1
29
29
  });
30
- return n.setUser(o.data), await n.reload(), o.data;
30
+ return n.setUser(s.data), await n.reload(), s.data;
31
31
  },
32
32
  async setLocale(l) {
33
- const o = await n.http.put(`${u}/locale`, { locale: l });
34
- n.setUser(o.data), await n.setLocale(l);
33
+ const s = await n.http.put(`${r}/locale`, { locale: l });
34
+ n.setUser(s.data), await n.setLocale(l);
35
35
  },
36
36
  async setTheme(l) {
37
- const o = await n.http.put(`${u}/theme`, {
37
+ const s = await n.http.put(`${r}/theme`, {
38
38
  theme: l === "system" ? null : l
39
39
  });
40
- n.setUser(o.data);
40
+ n.setUser(s.data);
41
41
  },
42
42
  async updateProfile(l) {
43
- const o = await n.http.put(
44
- `${u}/me`,
43
+ const s = await n.http.put(
44
+ `${r}/me`,
45
45
  l
46
46
  );
47
- return n.setUser(o.data), o.data;
47
+ return n.setUser(s.data), s.data;
48
48
  },
49
49
  async logout() {
50
50
  try {
51
- await n.http.post(`${u}/logout`);
51
+ await n.http.post(`${r}/logout`);
52
52
  } finally {
53
53
  n.setUser(null), n.state.status = "unauthenticated", n.state.manifest = null;
54
54
  }
55
55
  }
56
56
  };
57
57
  }
58
- const He = /* @__PURE__ */ Symbol("webx-auth-avatar"), Ke = /* @__PURE__ */ Symbol("webx-auth-avatar-field");
59
- function ct(n, u, l = null, o = null) {
60
- n.provide(Me, u), n.provide(He, l), n.provide(Ke, o);
58
+ const qe = /* @__PURE__ */ Symbol("webx-auth-avatar"), He = /* @__PURE__ */ Symbol("webx-auth-avatar-field");
59
+ function vt(n, r, l = null, s = null) {
60
+ n.provide(Ie, r), n.provide(qe, l), n.provide(He, s);
61
61
  }
62
- function dt(n) {
62
+ function pt(n) {
63
63
  return typeof n == "object" && n !== null && "status" in n && n.status === 401;
64
64
  }
65
- const mt = ["title", "aria-label", "aria-pressed"], vt = /* @__PURE__ */ X({
65
+ const ft = ["title", "aria-label", "aria-pressed"], ht = /* @__PURE__ */ Q({
66
66
  __name: "LoginCard",
67
67
  props: {
68
68
  emailLabel: { default: void 0 },
@@ -77,171 +77,171 @@ const mt = ["title", "aria-label", "aria-pressed"], vt = /* @__PURE__ */ X({
77
77
  autofocus: { type: Boolean, default: !0 }
78
78
  },
79
79
  emits: ["success"],
80
- setup(n, { expose: u, emit: l }) {
81
- const o = n, b = l, c = Ae(), z = J("webx-auth"), r = U(() => ({
82
- email: o.emailLabel ?? z("card.email"),
83
- password: o.passwordLabel ?? z("card.password"),
84
- remember: o.rememberLabel ?? z("card.remember"),
85
- submit: o.submitLabel ?? z("card.submit"),
86
- capsLock: o.capsLockWarning ?? z("card.caps-lock"),
87
- reveal: o.revealLabel ?? z("card.reveal"),
88
- hide: o.hideLabel ?? z("card.hide")
89
- })), f = T(""), F = T(""), p = T(!1), g = T(!1), w = T(!1), d = T(!1), x = T(""), y = T({}), _ = T(0), L = re("emailField");
90
- let $ = null;
91
- Ze(Y);
92
- const O = U(() => _.value > 0), i = U(
93
- () => o.throttleMessage === void 0 ? z("card.throttled", { seconds: _.value }) : o.throttleMessage.replace(":seconds", String(_.value))
80
+ setup(n, { expose: r, emit: l }) {
81
+ const s = n, g = l, c = ze(), A = K("webx-auth"), i = U(() => ({
82
+ email: s.emailLabel ?? A("card.email"),
83
+ password: s.passwordLabel ?? A("card.password"),
84
+ remember: s.rememberLabel ?? A("card.remember"),
85
+ submit: s.submitLabel ?? A("card.submit"),
86
+ capsLock: s.capsLockWarning ?? A("card.caps-lock"),
87
+ reveal: s.revealLabel ?? A("card.reveal"),
88
+ hide: s.hideLabel ?? A("card.hide")
89
+ })), m = W(""), P = W(""), p = W(!1), w = W(!1), x = W(!1), f = W(!1), y = W(""), v = W({}), b = W(0), S = re("emailField");
90
+ let V = null;
91
+ Ze(G);
92
+ const B = U(() => b.value > 0), u = U(
93
+ () => s.throttleMessage === void 0 ? A("card.throttled", { seconds: b.value }) : s.throttleMessage.replace(":seconds", String(b.value))
94
94
  );
95
- async function v() {
96
- if (!(g.value || O.value)) {
97
- g.value = !0, x.value = "", y.value = {};
95
+ async function _() {
96
+ if (!(w.value || B.value)) {
97
+ w.value = !0, y.value = "", v.value = {};
98
98
  try {
99
99
  await c.login({
100
- email: f.value,
101
- password: F.value,
100
+ email: m.value,
101
+ password: P.value,
102
102
  remember: p.value
103
- }), F.value = "", b("success");
103
+ }), P.value = "", g("success");
104
104
  } catch (k) {
105
- A(k);
105
+ z(k);
106
106
  } finally {
107
- g.value = !1;
107
+ w.value = !1;
108
108
  }
109
109
  }
110
110
  }
111
- function A(k) {
112
- if (!(k instanceof et)) {
113
- x.value = k instanceof Error ? k.message : String(k);
111
+ function z(k) {
112
+ if (!(k instanceof tt)) {
113
+ y.value = k instanceof Error ? k.message : String(k);
114
114
  return;
115
115
  }
116
116
  if (k.isValidation) {
117
- y.value = k.errors;
117
+ v.value = k.errors;
118
118
  return;
119
119
  }
120
120
  if (k.isThrottled) {
121
- I(k.retryAfter ?? 60);
121
+ N(k.retryAfter ?? 60);
122
122
  return;
123
123
  }
124
- x.value = k.message;
124
+ y.value = k.message;
125
125
  }
126
- function I(k) {
127
- Y(), _.value = k, $ = setInterval(() => {
128
- _.value -= 1, _.value <= 0 && Y();
126
+ function N(k) {
127
+ G(), b.value = k, V = setInterval(() => {
128
+ b.value -= 1, b.value <= 0 && G();
129
129
  }, 1e3);
130
130
  }
131
- function Y() {
132
- $ !== null && (clearInterval($), $ = null), _.value = 0;
131
+ function G() {
132
+ V !== null && (clearInterval(V), V = null), b.value = 0;
133
133
  }
134
134
  function D(k) {
135
- d.value = k.getModifierState("CapsLock");
135
+ f.value = k.getModifierState("CapsLock");
136
136
  }
137
- return u({ focus: () => L.value?.focus() }), (k, R) => {
138
- const C = H("wx-alert"), q = H("wx-icon"), de = H("wx-input"), P = H("wx-form-item"), N = H("wx-checkbox"), S = H("wx-button"), ae = H("wx-form"), Xe = H("wx-card");
139
- return h(), V(Xe, {
137
+ return r({ focus: () => S.value?.focus() }), (k, E) => {
138
+ const C = q("wx-alert"), X = q("wx-icon"), pe = q("wx-input"), F = q("wx-form-item"), M = q("wx-checkbox"), T = q("wx-button"), ae = q("wx-form"), Xe = q("wx-card");
139
+ return h(), $(Xe, {
140
140
  class: "wx-login",
141
141
  padding: 24
142
142
  }, {
143
143
  default: t(() => [
144
144
  a(ae, {
145
- errors: y.value,
146
- disabled: g.value,
145
+ errors: v.value,
146
+ disabled: w.value,
147
147
  gap: "md",
148
- onSubmit: Pe(v, ["prevent"])
148
+ onSubmit: Fe(_, ["prevent"])
149
149
  }, {
150
150
  default: t(() => [
151
- x.value !== "" ? (h(), V(C, {
151
+ y.value !== "" ? (h(), $(C, {
152
152
  key: 0,
153
153
  type: "danger",
154
154
  variant: "soft",
155
155
  live: "",
156
- description: x.value,
156
+ description: y.value,
157
157
  class: "wx-login__message"
158
- }, null, 8, ["description"])) : O.value ? (h(), V(C, {
158
+ }, null, 8, ["description"])) : B.value ? (h(), $(C, {
159
159
  key: 1,
160
160
  type: "warning",
161
161
  variant: "soft",
162
162
  live: "",
163
- description: i.value,
163
+ description: u.value,
164
164
  class: "wx-login__message"
165
- }, null, 8, ["description"])) : E("", !0),
166
- a(P, { name: "email" }, {
165
+ }, null, 8, ["description"])) : O("", !0),
166
+ a(F, { name: "email" }, {
167
167
  default: t(() => [
168
- a(de, {
168
+ a(pe, {
169
169
  ref_key: "emailField",
170
- ref: L,
171
- modelValue: f.value,
172
- "onUpdate:modelValue": R[0] || (R[0] = (se) => f.value = se),
170
+ ref: S,
171
+ modelValue: m.value,
172
+ "onUpdate:modelValue": E[0] || (E[0] = (oe) => m.value = oe),
173
173
  type: "email",
174
- placeholder: r.value.email,
175
- "aria-label": r.value.email,
174
+ placeholder: i.value.email,
175
+ "aria-label": i.value.email,
176
176
  autocomplete: "username",
177
177
  autofocus: n.autofocus,
178
178
  inputmode: "email",
179
179
  size: "lg"
180
180
  }, {
181
181
  prefix: t(() => [
182
- a(q, { name: "mail" })
182
+ a(X, { name: "mail" })
183
183
  ]),
184
184
  _: 1
185
185
  }, 8, ["modelValue", "placeholder", "aria-label", "autofocus"])
186
186
  ]),
187
187
  _: 1
188
188
  }),
189
- a(P, {
189
+ a(F, {
190
190
  name: "password",
191
- help: d.value ? r.value.capsLock : void 0
191
+ help: f.value ? i.value.capsLock : void 0
192
192
  }, {
193
193
  default: t(() => [
194
- a(de, {
195
- modelValue: F.value,
196
- "onUpdate:modelValue": R[2] || (R[2] = (se) => F.value = se),
197
- type: w.value ? "text" : "password",
198
- placeholder: r.value.password,
199
- "aria-label": r.value.password,
194
+ a(pe, {
195
+ modelValue: P.value,
196
+ "onUpdate:modelValue": E[2] || (E[2] = (oe) => P.value = oe),
197
+ type: x.value ? "text" : "password",
198
+ placeholder: i.value.password,
199
+ "aria-label": i.value.password,
200
200
  autocomplete: "current-password",
201
201
  size: "lg",
202
202
  onKeydown: D,
203
203
  onKeyup: D
204
204
  }, {
205
205
  prefix: t(() => [
206
- a(q, { name: "lock" })
206
+ a(X, { name: "lock" })
207
207
  ]),
208
208
  suffix: t(() => [
209
- W("button", {
209
+ L("button", {
210
210
  type: "button",
211
211
  class: "wx-login__reveal",
212
- title: w.value ? r.value.hide : r.value.reveal,
213
- "aria-label": w.value ? r.value.hide : r.value.reveal,
214
- "aria-pressed": w.value,
212
+ title: x.value ? i.value.hide : i.value.reveal,
213
+ "aria-label": x.value ? i.value.hide : i.value.reveal,
214
+ "aria-pressed": x.value,
215
215
  tabindex: "-1",
216
- onClick: R[1] || (R[1] = (se) => w.value = !w.value)
216
+ onClick: E[1] || (E[1] = (oe) => x.value = !x.value)
217
217
  }, [
218
- a(q, {
219
- name: w.value ? "eye-off" : "eye"
218
+ a(X, {
219
+ name: x.value ? "eye-off" : "eye"
220
220
  }, null, 8, ["name"])
221
- ], 8, mt)
221
+ ], 8, ft)
222
222
  ]),
223
223
  _: 1
224
224
  }, 8, ["modelValue", "type", "placeholder", "aria-label"])
225
225
  ]),
226
226
  _: 1
227
227
  }, 8, ["help"]),
228
- n.remember ? (h(), V(N, {
228
+ n.remember ? (h(), $(M, {
229
229
  key: 2,
230
230
  modelValue: p.value,
231
- "onUpdate:modelValue": R[3] || (R[3] = (se) => p.value = se),
232
- label: r.value.remember,
231
+ "onUpdate:modelValue": E[3] || (E[3] = (oe) => p.value = oe),
232
+ label: i.value.remember,
233
233
  class: "wx-login__remember"
234
- }, null, 8, ["modelValue", "label"])) : E("", !0),
235
- a(S, {
234
+ }, null, 8, ["modelValue", "label"])) : O("", !0),
235
+ a(T, {
236
236
  type: "primary",
237
237
  "native-type": "submit",
238
238
  size: "lg",
239
239
  block: "",
240
- loading: g.value,
241
- disabled: O.value
240
+ loading: w.value,
241
+ disabled: B.value
242
242
  }, {
243
243
  default: t(() => [
244
- m(s(r.value.submit), 1)
244
+ d(o(i.value.submit), 1)
245
245
  ]),
246
246
  _: 1
247
247
  }, 8, ["loading", "disabled"])
@@ -253,20 +253,20 @@ const mt = ["title", "aria-label", "aria-pressed"], vt = /* @__PURE__ */ X({
253
253
  });
254
254
  };
255
255
  }
256
- }), pe = (n, u) => {
256
+ }), ve = (n, r) => {
257
257
  const l = n.__vccOpts || n;
258
- for (const [o, b] of u)
259
- l[o] = b;
258
+ for (const [s, g] of r)
259
+ l[s] = g;
260
260
  return l;
261
- }, pt = /* @__PURE__ */ pe(vt, [["__scopeId", "data-v-3c206e31"]]);
262
- function Ye(n) {
261
+ }, yt = /* @__PURE__ */ ve(ht, [["__scopeId", "data-v-3c206e31"]]);
262
+ function Ke(n) {
263
263
  return n.types["wx-media"]?.component ?? null;
264
264
  }
265
- function je(n) {
266
- const u = n.assetUrls;
267
- return u ? async (l) => (await u([l]))[l] ?? null : null;
265
+ function Ye(n) {
266
+ const r = n.assetUrls;
267
+ return r ? async (l) => (await r([l]))[l] ?? null : null;
268
268
  }
269
- const Ge = {
269
+ const je = {
270
270
  card: {
271
271
  email: "Email",
272
272
  password: "Password",
@@ -345,6 +345,8 @@ const Ge = {
345
345
  "only-dry": "Dry runs only",
346
346
  arguments: "Arguments",
347
347
  "no-arguments": "Called with no arguments",
348
+ request: "The agent's request",
349
+ "request-hint": "What the agent passed to the tool. The answer is not kept.",
348
350
  error: "Refused with",
349
351
  empty: "No calls match"
350
352
  },
@@ -402,7 +404,9 @@ const Ge = {
402
404
  "next-1": "The client opens this site in a browser and asks you to sign in to the panel, with your usual password. It never sees the password.",
403
405
  "next-2": 'The panel shows who is asking and where the answer goes. There is a "read only" switch on that screen, and turning it on is the safe way to begin.',
404
406
  "next-3": "From then on the agent acts as you: it can do what you can do and nothing more, and every call it makes is written down.",
405
- mine: "Your connections"
407
+ mine: "Your connections",
408
+ rules: "Rules for agents",
409
+ "rules-hint": "Every connected agent reads these before it writes anything a visitor will see."
406
410
  },
407
411
  errors: {
408
412
  unauthenticated: "Unauthenticated.",
@@ -431,56 +435,56 @@ const Ge = {
431
435
  language: "Interface language"
432
436
  }
433
437
  };
434
- function fe(n) {
435
- const u = `${n.apiPath}/auth`, l = (o) => o.data;
438
+ function he(n) {
439
+ const r = `${n.apiPath}/auth`, l = (s) => s.data;
436
440
  return {
437
- list: (o = {}) => n.http.get(`${u}/admins`, {
441
+ list: (s = {}) => n.http.get(`${r}/admins`, {
438
442
  query: {
439
- q: o.q || void 0,
440
- role: o.role ?? void 0,
441
- active: o.active ?? void 0,
442
- sort: o.sort,
443
- page: o.page,
444
- per_page: o.per_page
443
+ q: s.q || void 0,
444
+ role: s.role ?? void 0,
445
+ active: s.active ?? void 0,
446
+ sort: s.sort,
447
+ page: s.page,
448
+ per_page: s.per_page
445
449
  }
446
- }).then((b) => ({ ...b.meta, data: b.data })),
447
- get: (o) => n.http.get(`${u}/admins/${o}`).then(l),
448
- create: (o) => n.http.post(`${u}/admins`, o).then(l),
449
- update: (o, b) => n.http.patch(`${u}/admins/${o}`, b).then(l),
450
- remove: (o) => n.http.delete(`${u}/admins/${o}`),
451
- roles: () => n.http.get(`${u}/roles`).then(l),
452
- calls: (o = {}) => n.http.get(`${u}/mcp-calls`, {
450
+ }).then((g) => ({ ...g.meta, data: g.data })),
451
+ get: (s) => n.http.get(`${r}/admins/${s}`).then(l),
452
+ create: (s) => n.http.post(`${r}/admins`, s).then(l),
453
+ update: (s, g) => n.http.patch(`${r}/admins/${s}`, g).then(l),
454
+ remove: (s) => n.http.delete(`${r}/admins/${s}`),
455
+ roles: () => n.http.get(`${r}/roles`).then(l),
456
+ calls: (s = {}) => n.http.get(`${r}/mcp-calls`, {
453
457
  query: {
454
- user: o.user ?? void 0,
455
- tool: o.tool ?? void 0,
456
- outcome: o.outcome ?? void 0,
457
- page: o.page,
458
- per_page: o.per_page
458
+ user: s.user ?? void 0,
459
+ tool: s.tool ?? void 0,
460
+ outcome: s.outcome ?? void 0,
461
+ page: s.page,
462
+ per_page: s.per_page
459
463
  }
460
- }).then((b) => ({ ...b.meta, data: b.data, filters: b.filters }))
464
+ }).then((g) => ({ ...g.meta, data: g.data, filters: g.filters }))
461
465
  };
462
466
  }
463
- const Se = /* @__PURE__ */ new WeakSet();
467
+ const We = /* @__PURE__ */ new WeakSet();
464
468
  function te() {
465
469
  try {
466
- const { i18n: n } = ee();
467
- Se.has(n) || (n.defaults("webx-auth", Ge), Se.add(n));
470
+ const { i18n: n } = Z();
471
+ We.has(n) || (n.defaults("webx-auth", je), We.add(n));
468
472
  } catch {
469
473
  }
470
474
  }
471
- const ft = { class: "wx-admin-form" }, ht = {
475
+ const _t = { class: "wx-admin-form" }, bt = {
472
476
  key: 0,
473
477
  class: "wx-admin-form__aside"
474
- }, yt = { class: "wx-admin-form__fields" }, _t = /* @__PURE__ */ X({
478
+ }, gt = { class: "wx-admin-form__fields" }, wt = /* @__PURE__ */ Q({
475
479
  __name: "AdminDialog",
476
480
  props: {
477
481
  admin: { default: null },
478
482
  avatarField: { default: void 0 }
479
483
  },
480
484
  setup(n) {
481
- const u = n, { resolve: l, dismiss: o, open: b } = ge(), c = ee(), z = fe(c), r = Ee();
485
+ const r = n, { resolve: l, dismiss: s, open: g } = xe(), c = Z(), A = he(c), i = Ee();
482
486
  te();
483
- const f = J("webx-auth"), F = ve(), p = T([]), g = T(!1), w = T({}), d = T({
487
+ const m = K("webx-auth"), P = me(), p = W([]), w = W(!1), x = W({}), f = W({
484
488
  name: "",
485
489
  email: "",
486
490
  password: "",
@@ -489,81 +493,81 @@ const ft = { class: "wx-admin-form" }, ht = {
489
493
  is_super: !1,
490
494
  locale: null,
491
495
  roles: []
492
- }), x = U({
493
- get: () => d.value.avatar ? { path: d.value.avatar } : null,
494
- set: (i) => {
495
- d.value.avatar = i?.path ?? null;
496
+ }), y = U({
497
+ get: () => f.value.avatar ? { path: f.value.avatar } : null,
498
+ set: (u) => {
499
+ f.value.avatar = u?.path ?? null;
496
500
  }
497
- }), y = U(() => u.admin !== null), _ = U(() => p.value.map((i) => ({ value: i.id, label: i.name }))), L = U(() => [
498
- { value: "auto", label: f("admins.locale-auto") },
499
- ...r.state.panelLocales.map((i) => ({ value: i.code, label: i.nativeName }))
501
+ }), v = U(() => r.admin !== null), b = U(() => p.value.map((u) => ({ value: u.id, label: u.name }))), S = U(() => [
502
+ { value: "auto", label: m("admins.locale-auto") },
503
+ ...i.state.panelLocales.map((u) => ({ value: u.code, label: u.nativeName }))
500
504
  ]);
501
- z.roles().then((i) => p.value = i), ue(
502
- () => u.admin,
503
- (i) => {
504
- d.value = {
505
- name: i?.name ?? "",
506
- email: i?.email ?? "",
505
+ A.roles().then((u) => p.value = u), ue(
506
+ () => r.admin,
507
+ (u) => {
508
+ f.value = {
509
+ name: u?.name ?? "",
510
+ email: u?.email ?? "",
507
511
  password: "",
508
- avatar: i?.avatar ?? null,
509
- is_active: i?.is_active ?? !0,
510
- is_super: i?.is_super ?? !1,
511
- locale: i?.locale ?? "auto",
512
- roles: i?.roles.map((v) => v.id) ?? []
513
- }, w.value = {};
512
+ avatar: u?.avatar ?? null,
513
+ is_active: u?.is_active ?? !0,
514
+ is_super: u?.is_super ?? !1,
515
+ locale: u?.locale ?? "auto",
516
+ roles: u?.roles.map((_) => _.id) ?? []
517
+ }, x.value = {};
514
518
  },
515
519
  { immediate: !0 }
516
520
  );
517
- function $(i) {
518
- return w.value[i]?.[0];
521
+ function V(u) {
522
+ return x.value[u]?.[0];
519
523
  }
520
- async function O() {
521
- g.value = !0, w.value = {};
522
- const i = {
523
- name: d.value.name,
524
- email: d.value.email,
525
- avatar: d.value.avatar,
526
- is_active: d.value.is_active,
527
- is_super: d.value.is_super,
528
- locale: d.value.locale === "auto" ? null : d.value.locale,
529
- roles: d.value.roles ?? []
524
+ async function B() {
525
+ w.value = !0, x.value = {};
526
+ const u = {
527
+ name: f.value.name,
528
+ email: f.value.email,
529
+ avatar: f.value.avatar,
530
+ is_active: f.value.is_active,
531
+ is_super: f.value.is_super,
532
+ locale: f.value.locale === "auto" ? null : f.value.locale,
533
+ roles: f.value.roles ?? []
530
534
  };
531
- d.value.password && (i.password = d.value.password);
535
+ f.value.password && (u.password = f.value.password);
532
536
  try {
533
- const v = u.admin ? await z.update(u.admin.id, i) : await z.create(i);
534
- Q.success(f(y.value ? "admins.updated" : "admins.created")), l(v);
535
- } catch (v) {
536
- const A = v.body;
537
- A?.errors ? w.value = A.errors : Q.danger(F(v));
537
+ const _ = r.admin ? await A.update(r.admin.id, u) : await A.create(u);
538
+ j.success(m(v.value ? "admins.updated" : "admins.created")), l(_);
539
+ } catch (_) {
540
+ const z = _.body;
541
+ z?.errors ? x.value = z.errors : j.danger(P(_));
538
542
  } finally {
539
- g.value = !1;
543
+ w.value = !1;
540
544
  }
541
545
  }
542
- return (i, v) => (h(), V(e(we), {
543
- open: e(b),
544
- "onUpdate:open": v[9] || (v[9] = (A) => be(b) ? b.value = A : null),
545
- title: y.value ? e(f)("admins.edit-short") : e(f)("admins.new-short"),
546
+ return (u, _) => (h(), $(e(ke), {
547
+ open: e(g),
548
+ "onUpdate:open": _[9] || (_[9] = (z) => ge(g) ? g.value = z : null),
549
+ title: v.value ? e(m)("admins.edit-short") : e(m)("admins.new-short"),
546
550
  width: 720
547
551
  }, {
548
552
  footer: t(() => [
549
- a(e(oe), { size: "sm" }, {
553
+ a(e(se), { size: "sm" }, {
550
554
  default: t(() => [
551
- a(e(M), {
555
+ a(e(I), {
552
556
  variant: "outline",
553
- onClick: v[8] || (v[8] = (A) => e(o)())
557
+ onClick: _[8] || (_[8] = (z) => e(s)())
554
558
  }, {
555
559
  default: t(() => [
556
- m(s(e(f)("admins.cancel")), 1)
560
+ d(o(e(m)("admins.cancel")), 1)
557
561
  ]),
558
562
  _: 1
559
563
  }),
560
- a(e(M), {
564
+ a(e(I), {
561
565
  type: "primary",
562
- loading: g.value,
563
- onClick: O
566
+ loading: w.value,
567
+ onClick: B
564
568
  }, {
565
569
  default: t(() => [
566
- m(s(e(f)("admins.save")), 1)
570
+ d(o(e(m)("admins.save")), 1)
567
571
  ]),
568
572
  _: 1
569
573
  }, 8, ["loading"])
@@ -572,41 +576,41 @@ const ft = { class: "wx-admin-form" }, ht = {
572
576
  })
573
577
  ]),
574
578
  default: t(() => [
575
- W("div", ft, [
576
- W("div", {
577
- class: Fe(["wx-admin-form__grid", { "has-aside": n.avatarField }])
579
+ L("div", _t, [
580
+ L("div", {
581
+ class: Re(["wx-admin-form__grid", { "has-aside": n.avatarField }])
578
582
  }, [
579
- n.avatarField ? (h(), G("div", ht, [
580
- (h(), V(Oe(n.avatarField), {
581
- modelValue: x.value,
582
- "onUpdate:modelValue": v[0] || (v[0] = (A) => x.value = A),
583
- label: e(f)("admins.avatar"),
583
+ n.avatarField ? (h(), Y("div", bt, [
584
+ (h(), $(Oe(n.avatarField), {
585
+ modelValue: y.value,
586
+ "onUpdate:modelValue": _[0] || (_[0] = (z) => y.value = z),
587
+ label: e(m)("admins.avatar"),
584
588
  aspect: "1/1",
585
589
  captions: !1
586
590
  }, null, 8, ["modelValue", "label"]))
587
- ])) : E("", !0),
588
- W("div", yt, [
589
- a(e(K), {
590
- label: e(f)("admins.name"),
591
- error: $("name")
591
+ ])) : O("", !0),
592
+ L("div", gt, [
593
+ a(e(H), {
594
+ label: e(m)("admins.name"),
595
+ error: V("name")
592
596
  }, {
593
597
  default: t(() => [
594
598
  a(e(le), {
595
- modelValue: d.value.name,
596
- "onUpdate:modelValue": v[1] || (v[1] = (A) => d.value.name = A),
599
+ modelValue: f.value.name,
600
+ "onUpdate:modelValue": _[1] || (_[1] = (z) => f.value.name = z),
597
601
  name: "name"
598
602
  }, null, 8, ["modelValue"])
599
603
  ]),
600
604
  _: 1
601
605
  }, 8, ["label", "error"]),
602
- a(e(K), {
603
- label: e(f)("admins.email"),
604
- error: $("email")
606
+ a(e(H), {
607
+ label: e(m)("admins.email"),
608
+ error: V("email")
605
609
  }, {
606
610
  default: t(() => [
607
611
  a(e(le), {
608
- modelValue: d.value.email,
609
- "onUpdate:modelValue": v[2] || (v[2] = (A) => d.value.email = A),
612
+ modelValue: f.value.email,
613
+ "onUpdate:modelValue": _[2] || (_[2] = (z) => f.value.email = z),
610
614
  type: "email",
611
615
  name: "email",
612
616
  autocomplete: "off"
@@ -614,15 +618,15 @@ const ft = { class: "wx-admin-form" }, ht = {
614
618
  ]),
615
619
  _: 1
616
620
  }, 8, ["label", "error"]),
617
- a(e(K), {
618
- label: e(f)("admins.password"),
619
- error: $("password"),
620
- help: y.value ? e(f)("admins.password-keep") : e(f)("admins.password-hint")
621
+ a(e(H), {
622
+ label: e(m)("admins.password"),
623
+ error: V("password"),
624
+ help: v.value ? e(m)("admins.password-keep") : e(m)("admins.password-hint")
621
625
  }, {
622
626
  default: t(() => [
623
627
  a(e(le), {
624
- modelValue: d.value.password,
625
- "onUpdate:modelValue": v[3] || (v[3] = (A) => d.value.password = A),
628
+ modelValue: f.value.password,
629
+ "onUpdate:modelValue": _[3] || (_[3] = (z) => f.value.password = z),
626
630
  type: "password",
627
631
  name: "password",
628
632
  autocomplete: "new-password"
@@ -630,53 +634,53 @@ const ft = { class: "wx-admin-form" }, ht = {
630
634
  ]),
631
635
  _: 1
632
636
  }, 8, ["label", "error", "help"]),
633
- a(e(K), {
634
- label: e(f)("admins.roles"),
635
- error: $("roles")
637
+ a(e(H), {
638
+ label: e(m)("admins.roles"),
639
+ error: V("roles")
636
640
  }, {
637
641
  default: t(() => [
638
642
  a(e(ne), {
639
- modelValue: d.value.roles,
640
- "onUpdate:modelValue": v[4] || (v[4] = (A) => d.value.roles = A),
641
- options: _.value,
643
+ modelValue: f.value.roles,
644
+ "onUpdate:modelValue": _[4] || (_[4] = (z) => f.value.roles = z),
645
+ options: b.value,
642
646
  multiple: ""
643
647
  }, null, 8, ["modelValue", "options"])
644
648
  ]),
645
649
  _: 1
646
650
  }, 8, ["label", "error"]),
647
- a(e(K), {
648
- label: e(f)("admins.locale")
651
+ a(e(H), {
652
+ label: e(m)("admins.locale")
649
653
  }, {
650
654
  default: t(() => [
651
655
  a(e(ne), {
652
- modelValue: d.value.locale,
653
- "onUpdate:modelValue": v[5] || (v[5] = (A) => d.value.locale = A),
654
- options: L.value
656
+ modelValue: f.value.locale,
657
+ "onUpdate:modelValue": _[5] || (_[5] = (z) => f.value.locale = z),
658
+ options: S.value
655
659
  }, null, 8, ["modelValue", "options"])
656
660
  ]),
657
661
  _: 1
658
662
  }, 8, ["label"]),
659
- a(e(oe), { size: "md" }, {
663
+ a(e(se), { size: "md" }, {
660
664
  default: t(() => [
661
- a(e(ze), {
662
- modelValue: d.value.is_active,
663
- "onUpdate:modelValue": v[6] || (v[6] = (A) => d.value.is_active = A),
664
- label: e(f)("admins.active")
665
+ a(e(Se), {
666
+ modelValue: f.value.is_active,
667
+ "onUpdate:modelValue": _[6] || (_[6] = (z) => f.value.is_active = z),
668
+ label: e(m)("admins.active")
665
669
  }, null, 8, ["modelValue", "label"]),
666
- a(e(ze), {
667
- modelValue: d.value.is_super,
668
- "onUpdate:modelValue": v[7] || (v[7] = (A) => d.value.is_super = A),
669
- label: e(f)("admins.super")
670
+ a(e(Se), {
671
+ modelValue: f.value.is_super,
672
+ "onUpdate:modelValue": _[7] || (_[7] = (z) => f.value.is_super = z),
673
+ label: e(m)("admins.super")
670
674
  }, null, 8, ["modelValue", "label"])
671
675
  ]),
672
676
  _: 1
673
677
  }),
674
- a(e(B), {
678
+ a(e(R), {
675
679
  size: "sm",
676
680
  tone: "muted"
677
681
  }, {
678
682
  default: t(() => [
679
- m(s(e(f)("admins.super-hint")), 1)
683
+ d(o(e(m)("admins.super-hint")), 1)
680
684
  ]),
681
685
  _: 1
682
686
  })
@@ -687,7 +691,7 @@ const ft = { class: "wx-admin-form" }, ht = {
687
691
  _: 1
688
692
  }, 8, ["open", "title"]));
689
693
  }
690
- }), We = 480, Je = /* @__PURE__ */ X({
694
+ }), Te = 480, Ge = /* @__PURE__ */ Q({
691
695
  __name: "AdminList",
692
696
  props: {
693
697
  picking: { type: Boolean, default: !1 },
@@ -697,34 +701,34 @@ const ft = { class: "wx-admin-form" }, ht = {
697
701
  resolveAvatar: { type: Function, default: void 0 }
698
702
  },
699
703
  emits: ["open", "chosen", "selection", "remove"],
700
- setup(n, { expose: u, emit: l }) {
701
- const o = n, b = l, c = ee(), z = fe(c);
704
+ setup(n, { expose: r, emit: l }) {
705
+ const s = n, g = l, c = Z(), A = he(c);
702
706
  te();
703
- const r = re("root"), f = xe(r), F = U(() => f.value > 0 && f.value < We), p = J("webx-auth"), g = J("webx-admin"), w = T(null), d = T([]), x = T(!1), y = T("all"), _ = T("any"), L = T([]), $ = T({});
704
- let O = { page: 1, perPage: 20, sort: null, search: "" };
705
- const i = U(() => [
707
+ const i = re("root"), m = Ce(i), P = U(() => m.value > 0 && m.value < Te), p = K("webx-auth"), w = K("webx-admin"), x = W(null), f = W([]), y = W(!1), v = W("all"), b = W("any"), S = W([]), V = W({});
708
+ let B = { page: 1, perPage: 20, sort: null, search: "" };
709
+ const u = U(() => [
706
710
  { value: "all", label: p("admins.all-roles") },
707
- ...d.value.map((P) => ({ value: P.slug, label: P.name }))
708
- ]), v = U(() => [
711
+ ...f.value.map((F) => ({ value: F.slug, label: F.name }))
712
+ ]), _ = U(() => [
709
713
  { value: "any", label: p("admins.any-state") },
710
714
  { value: "yes", label: p("admins.only-active") },
711
715
  { value: "no", label: p("admins.only-inactive") }
712
- ]), A = U(() => {
713
- const P = [], N = d.value.find((S) => S.slug === y.value);
714
- return N && P.push({
716
+ ]), z = U(() => {
717
+ const F = [], M = f.value.find((T) => T.slug === v.value);
718
+ return M && F.push({
715
719
  key: "role",
716
- label: `${p("admins.filter-role")}: ${N.name}`,
717
- clear: () => y.value = "all"
718
- }), _.value !== "any" && P.push({
720
+ label: `${p("admins.filter-role")}: ${M.name}`,
721
+ clear: () => v.value = "all"
722
+ }), b.value !== "any" && F.push({
719
723
  key: "state",
720
- label: `${p("admins.filter-state")}: ${_.value === "yes" ? p("admins.only-active") : p("admins.only-inactive")}`,
721
- clear: () => _.value = "any"
722
- }), P;
724
+ label: `${p("admins.filter-state")}: ${b.value === "yes" ? p("admins.only-active") : p("admins.only-inactive")}`,
725
+ clear: () => b.value = "any"
726
+ }), F;
723
727
  });
724
- function I() {
725
- y.value = "all", _.value = "any";
728
+ function N() {
729
+ v.value = "all", b.value = "any";
726
730
  }
727
- const Y = U(() => F.value ? [{ key: "card", label: "" }] : [
731
+ const G = U(() => P.value ? [{ key: "card", label: "" }] : [
728
732
  { key: "name", label: p("admins.name"), sortable: !0 },
729
733
  { key: "email", label: p("admins.email"), sortable: !0, hideBelow: 560 },
730
734
  { key: "roles", label: p("admins.roles"), hideBelow: 760 },
@@ -741,205 +745,205 @@ const ft = { class: "wx-admin-form" }, ht = {
741
745
  {
742
746
  key: "actions",
743
747
  label: "",
744
- width: tt,
748
+ width: at,
745
749
  align: "right",
746
- hidden: !o.removable,
750
+ hidden: !s.removable,
747
751
  // A card puts them along its top instead, through the `card-actions` slot.
748
752
  hideOnCards: !0
749
753
  }
750
754
  ]);
751
- z.roles().then((P) => d.value = P), ue([y, _], () => D(O));
752
- async function D(P) {
753
- O = P, x.value = !0;
755
+ A.roles().then((F) => f.value = F), ue([v, b], () => D(B));
756
+ async function D(F) {
757
+ B = F, y.value = !0;
754
758
  try {
755
- w.value = await z.list({
756
- q: P.search,
757
- role: y.value === "all" ? null : y.value,
758
- active: _.value === "any" ? null : _.value,
759
- sort: P.sort ? `${P.sort.order === "desc" ? "-" : ""}${P.sort.key}` : "name",
760
- page: P.page,
761
- per_page: P.perPage
759
+ x.value = await A.list({
760
+ q: F.search,
761
+ role: v.value === "all" ? null : v.value,
762
+ active: b.value === "any" ? null : b.value,
763
+ sort: F.sort ? `${F.sort.order === "desc" ? "-" : ""}${F.sort.key}` : "name",
764
+ page: F.page,
765
+ per_page: F.perPage
762
766
  }), k();
763
767
  } finally {
764
- x.value = !1;
768
+ y.value = !1;
765
769
  }
766
770
  }
767
771
  async function k() {
768
- const P = o.resolveAvatar;
769
- if (P)
770
- for (const N of w.value?.data ?? []) {
771
- if (!N.avatar || $.value[N.avatar]) continue;
772
- const S = await P(N.avatar);
773
- S && ($.value = { ...$.value, [N.avatar]: S });
772
+ const F = s.resolveAvatar;
773
+ if (F)
774
+ for (const M of x.value?.data ?? []) {
775
+ if (!M.avatar || V.value[M.avatar]) continue;
776
+ const T = await F(M.avatar);
777
+ T && (V.value = { ...V.value, [M.avatar]: T });
774
778
  }
775
779
  }
776
- function R(P) {
780
+ function E(F) {
777
781
  return [
778
782
  {
779
783
  key: "delete",
780
784
  icon: "trash",
781
785
  label: p("admins.delete"),
782
786
  danger: !0,
783
- run: () => b("remove", P)
787
+ run: () => g("remove", F)
784
788
  }
785
789
  ];
786
790
  }
787
- function C(P) {
788
- if (o.picking) {
789
- b("chosen", [P]);
791
+ function C(F) {
792
+ if (s.picking) {
793
+ g("chosen", [F]);
790
794
  return;
791
795
  }
792
- b("open", P);
796
+ g("open", F);
793
797
  }
794
- const q = U(() => !(o.picking && o.multiple));
795
- function de(P, N) {
796
- L.value = N, b("selection", N);
798
+ const X = U(() => !(s.picking && s.multiple));
799
+ function pe(F, M) {
800
+ S.value = M, g("selection", M);
797
801
  }
798
- return u({ reload: () => D(O), chosen: () => L.value }), (P, N) => (h(), G("div", {
802
+ return r({ reload: () => D(B), chosen: () => S.value }), (F, M) => (h(), Y("div", {
799
803
  ref_key: "root",
800
- ref: r,
804
+ ref: i,
801
805
  class: "wx-admin-list"
802
806
  }, [
803
- a(e(ke), {
804
- data: w.value,
805
- columns: Y.value,
807
+ a(e($e), {
808
+ data: x.value,
809
+ columns: G.value,
806
810
  "row-key": "id",
807
811
  searchable: "",
808
- clickable: q.value,
809
- hover: q.value,
812
+ clickable: X.value,
813
+ hover: X.value,
810
814
  flush: "",
811
- loading: x.value,
815
+ loading: y.value,
812
816
  "search-placeholder": e(p)("admins.search"),
813
817
  "empty-text": e(p)("admins.empty"),
814
818
  selectable: n.picking && n.multiple,
815
- "select-row-label": e(g)("filters.select-row"),
816
- "select-all-label": e(g)("filters.select-all"),
817
- "cards-below": We,
818
- "filters-count": A.value.length,
819
- "filters-label": e(g)("filters.title"),
819
+ "select-row-label": e(w)("filters.select-row"),
820
+ "select-all-label": e(w)("filters.select-all"),
821
+ "cards-below": Te,
822
+ "filters-count": z.value.length,
823
+ "filters-label": e(w)("filters.title"),
820
824
  onRowClick: C,
821
825
  onStateChange: D,
822
- onSelectionChange: de
823
- }, Re({
824
- "cell-name": t(({ row: S }) => [
825
- a(e(oe), {
826
+ onSelectionChange: pe
827
+ }, we({
828
+ "cell-name": t(({ row: T }) => [
829
+ a(e(se), {
826
830
  size: "sm",
827
831
  align: "center"
828
832
  }, {
829
833
  default: t(() => [
830
- a(e(ot), {
831
- name: S.name,
832
- src: S.avatar ? $.value[S.avatar] : void 0,
834
+ a(e(it), {
835
+ name: T.name,
836
+ src: T.avatar ? V.value[T.avatar] : void 0,
833
837
  size: "sm"
834
838
  }, null, 8, ["name", "src"]),
835
- W("span", null, s(S.name), 1),
836
- S.is_super ? (h(), V(e(j), {
839
+ L("span", null, o(T.name), 1),
840
+ T.is_super ? (h(), $(e(J), {
837
841
  key: 0,
838
842
  type: "warning"
839
843
  }, {
840
844
  default: t(() => [
841
- m(s(e(p)("admins.super")), 1)
845
+ d(o(e(p)("admins.super")), 1)
842
846
  ]),
843
847
  _: 1
844
- })) : E("", !0)
848
+ })) : O("", !0)
845
849
  ]),
846
850
  _: 2
847
851
  }, 1024)
848
852
  ]),
849
- "cell-roles": t(({ row: S }) => [
850
- S.roles.length > 0 ? (h(), V(e(oe), {
853
+ "cell-roles": t(({ row: T }) => [
854
+ T.roles.length > 0 ? (h(), $(e(se), {
851
855
  key: 0,
852
856
  size: "xs",
853
857
  wrap: ""
854
858
  }, {
855
859
  default: t(() => [
856
- (h(!0), G(ce, null, _e(S.roles, (ae) => (h(), V(e(j), {
860
+ (h(!0), Y(de, null, _e(T.roles, (ae) => (h(), $(e(J), {
857
861
  key: ae.id
858
862
  }, {
859
863
  default: t(() => [
860
- m(s(ae.name), 1)
864
+ d(o(ae.name), 1)
861
865
  ]),
862
866
  _: 2
863
867
  }, 1024))), 128))
864
868
  ]),
865
869
  _: 2
866
- }, 1024)) : (h(), V(e(B), {
870
+ }, 1024)) : (h(), $(e(R), {
867
871
  key: 1,
868
872
  size: "sm",
869
873
  tone: "muted"
870
874
  }, {
871
875
  default: t(() => [
872
- m(s(e(p)("admins.no-roles")), 1)
876
+ d(o(e(p)("admins.no-roles")), 1)
873
877
  ]),
874
878
  _: 1
875
879
  }))
876
880
  ]),
877
- "cell-is_active": t(({ row: S }) => [
878
- a(e(j), {
879
- type: S.is_active ? "success" : "default",
881
+ "cell-is_active": t(({ row: T }) => [
882
+ a(e(J), {
883
+ type: T.is_active ? "success" : "default",
880
884
  dot: ""
881
885
  }, {
882
886
  default: t(() => [
883
- m(s(S.is_active ? e(p)("admins.active") : e(p)("admins.only-inactive")), 1)
887
+ d(o(T.is_active ? e(p)("admins.active") : e(p)("admins.only-inactive")), 1)
884
888
  ]),
885
889
  _: 2
886
890
  }, 1032, ["type"])
887
891
  ]),
888
- "card-actions": t(({ row: S }) => [
889
- n.removable ? (h(), V(e(Ve), {
892
+ "card-actions": t(({ row: T }) => [
893
+ n.removable ? (h(), $(e(Le), {
890
894
  key: 0,
891
- actions: R(S),
892
- label: S.name
893
- }, null, 8, ["actions", "label"])) : E("", !0)
895
+ actions: E(T),
896
+ label: T.name
897
+ }, null, 8, ["actions", "label"])) : O("", !0)
894
898
  ]),
895
- "cell-actions": t(({ row: S }) => [
896
- a(e(Ve), {
897
- actions: R(S),
898
- label: S.name
899
+ "cell-actions": t(({ row: T }) => [
900
+ a(e(Le), {
901
+ actions: E(T),
902
+ label: T.name
899
903
  }, null, 8, ["actions", "label"])
900
904
  ]),
901
- "cell-last_login_at": t(({ row: S }) => [
905
+ "cell-last_login_at": t(({ row: T }) => [
902
906
  a(e(ie), {
903
- value: S.last_login_at,
904
- tone: S.last_login_at ? "default" : "muted",
907
+ value: T.last_login_at,
908
+ tone: T.last_login_at ? "default" : "muted",
905
909
  compact: ""
906
910
  }, null, 8, ["value", "tone"])
907
911
  ]),
908
- "cell-card": t(({ row: S }) => [
909
- a(e(Ce), {
912
+ "cell-card": t(({ row: T }) => [
913
+ a(e(Ae), {
910
914
  variant: "plain",
911
915
  shape: "circle",
912
- title: S.name,
913
- image: S.avatar ? $.value[S.avatar] : void 0,
914
- subtitle: S.email
916
+ title: T.name,
917
+ image: T.avatar ? V.value[T.avatar] : void 0,
918
+ subtitle: T.email
915
919
  }, {
916
920
  meta: t(() => [
917
- S.is_super ? (h(), V(e(j), {
921
+ T.is_super ? (h(), $(e(J), {
918
922
  key: 0,
919
923
  type: "warning",
920
924
  size: "sm"
921
925
  }, {
922
926
  default: t(() => [
923
- m(s(e(p)("admins.super")), 1)
927
+ d(o(e(p)("admins.super")), 1)
924
928
  ]),
925
929
  _: 1
926
- })) : E("", !0),
927
- (h(!0), G(ce, null, _e(S.roles, (ae) => (h(), V(e(j), {
930
+ })) : O("", !0),
931
+ (h(!0), Y(de, null, _e(T.roles, (ae) => (h(), $(e(J), {
928
932
  key: ae.id,
929
933
  size: "sm"
930
934
  }, {
931
935
  default: t(() => [
932
- m(s(ae.name), 1)
936
+ d(o(ae.name), 1)
933
937
  ]),
934
938
  _: 2
935
939
  }, 1024))), 128)),
936
- a(e(j), {
937
- type: S.is_active ? "success" : "default",
940
+ a(e(J), {
941
+ type: T.is_active ? "success" : "default",
938
942
  dot: "",
939
943
  size: "sm"
940
944
  }, {
941
945
  default: t(() => [
942
- m(s(S.is_active ? e(p)("admins.active") : e(p)("admins.only-inactive")), 1)
946
+ d(o(T.is_active ? e(p)("admins.active") : e(p)("admins.only-inactive")), 1)
943
947
  ]),
944
948
  _: 2
945
949
  }, 1032, ["type"])
@@ -952,221 +956,221 @@ const ft = { class: "wx-admin-form" }, ht = {
952
956
  n.filters ? {
953
957
  name: "filters",
954
958
  fn: t(() => [
955
- a(e(K), {
959
+ a(e(H), {
956
960
  label: e(p)("admins.filter-role")
957
961
  }, {
958
962
  default: t(() => [
959
963
  a(e(ne), {
960
- modelValue: y.value,
961
- "onUpdate:modelValue": N[0] || (N[0] = (S) => y.value = S),
962
- options: i.value,
964
+ modelValue: v.value,
965
+ "onUpdate:modelValue": M[0] || (M[0] = (T) => v.value = T),
966
+ options: u.value,
963
967
  size: "sm"
964
968
  }, null, 8, ["modelValue", "options"])
965
969
  ]),
966
970
  _: 1
967
971
  }, 8, ["label"]),
968
- a(e(K), {
972
+ a(e(H), {
969
973
  label: e(p)("admins.filter-state")
970
974
  }, {
971
975
  default: t(() => [
972
976
  a(e(ne), {
973
- modelValue: _.value,
974
- "onUpdate:modelValue": N[1] || (N[1] = (S) => _.value = S),
975
- options: v.value,
977
+ modelValue: b.value,
978
+ "onUpdate:modelValue": M[1] || (M[1] = (T) => b.value = T),
979
+ options: _.value,
976
980
  size: "sm"
977
981
  }, null, 8, ["modelValue", "options"])
978
982
  ]),
979
983
  _: 1
980
984
  }, 8, ["label"]),
981
- A.value.length > 0 ? (h(), V(e(M), {
985
+ z.value.length > 0 ? (h(), $(e(I), {
982
986
  key: 0,
983
987
  variant: "text",
984
988
  size: "sm",
985
989
  block: "",
986
- onClick: I
990
+ onClick: N
987
991
  }, {
988
992
  icon: t(() => [
989
- a(e(Z), { name: "close" })
993
+ a(e(ee), { name: "close" })
990
994
  ]),
991
995
  default: t(() => [
992
- m(" " + s(e(g)("filters.reset")), 1)
996
+ d(" " + o(e(w)("filters.reset")), 1)
993
997
  ]),
994
998
  _: 1
995
- })) : E("", !0)
999
+ })) : O("", !0)
996
1000
  ]),
997
1001
  key: "0"
998
1002
  } : void 0,
999
1003
  n.filters ? {
1000
1004
  name: "applied",
1001
1005
  fn: t(() => [
1002
- a(e(De), { filters: A.value }, null, 8, ["filters"])
1006
+ a(e(De), { filters: z.value }, null, 8, ["filters"])
1003
1007
  ]),
1004
1008
  key: "1"
1005
1009
  } : void 0
1006
1010
  ]), 1032, ["data", "columns", "clickable", "hover", "loading", "search-placeholder", "empty-text", "selectable", "select-row-label", "select-all-label", "filters-count", "filters-label"])
1007
1011
  ], 512));
1008
1012
  }
1009
- }), bt = { class: "wx-call-list__details" }, gt = {
1013
+ }), xt = { class: "wx-call-list__details" }, kt = { class: "wx-call-list__label" }, Ct = {
1010
1014
  key: 1,
1011
1015
  class: "wx-call-list__arguments"
1012
- }, wt = {
1016
+ }, $t = {
1013
1017
  class: "wx-call-list__glyph",
1014
1018
  "aria-hidden": "true"
1015
- }, xt = {
1016
- key: 1,
1019
+ }, At = {
1020
+ key: 2,
1017
1021
  class: "wx-call-list__arguments"
1018
- }, Te = 480, kt = /* @__PURE__ */ X({
1022
+ }, Ue = 480, Vt = /* @__PURE__ */ Q({
1019
1023
  __name: "CallList",
1020
- setup(n, { expose: u }) {
1021
- const l = ee(), o = fe(l);
1024
+ setup(n, { expose: r }) {
1025
+ const l = Z(), s = he(l);
1022
1026
  te();
1023
- const b = re("root"), c = xe(b), z = U(() => c.value > 0 && c.value < Te), r = J("webx-auth"), f = J("webx-admin"), F = T(null), p = T({ users: [], tools: [] }), g = T(!1), w = T("all"), d = T("all"), x = T("any");
1024
- let y = { page: 1, perPage: 30, sort: null, search: "" };
1025
- function _(k) {
1026
- return k === null ? r("calls.local") : k.name ?? r("calls.deleted", { id: k.id });
1027
+ const g = re("root"), c = Ce(g), A = U(() => c.value > 0 && c.value < Ue), i = K("webx-auth"), m = K("webx-admin"), P = W(null), p = W({ users: [], tools: [] }), w = W(!1), x = W("all"), f = W("all"), y = W("any");
1028
+ let v = { page: 1, perPage: 30, sort: null, search: "" };
1029
+ function b(k) {
1030
+ return k === null ? i("calls.local") : k.name ?? i("calls.deleted", { id: k.id });
1027
1031
  }
1028
- const L = U(() => [
1029
- { value: "all", label: r("calls.everybody") },
1032
+ const S = U(() => [
1033
+ { value: "all", label: i("calls.everybody") },
1030
1034
  ...p.value.users.map((k) => ({
1031
1035
  value: k.id === null ? "none" : String(k.id),
1032
- label: _(k.id === null ? null : { id: k.id, name: k.name })
1036
+ label: b(k.id === null ? null : { id: k.id, name: k.name })
1033
1037
  }))
1034
- ]), $ = U(() => [
1035
- { value: "all", label: r("calls.all-tools") },
1038
+ ]), V = U(() => [
1039
+ { value: "all", label: i("calls.all-tools") },
1036
1040
  ...p.value.tools.map((k) => ({ value: k, label: k }))
1037
- ]), O = U(() => [
1038
- { value: "any", label: r("calls.any-outcome") },
1039
- { value: "ok", label: r("calls.only-answered") },
1040
- { value: "failed", label: r("calls.only-refused") },
1041
- { value: "dry", label: r("calls.only-dry") }
1042
- ]), i = U(() => {
1043
- const k = [], R = L.value.find((q) => q.value === w.value);
1044
- w.value !== "all" && R && k.push({
1041
+ ]), B = U(() => [
1042
+ { value: "any", label: i("calls.any-outcome") },
1043
+ { value: "ok", label: i("calls.only-answered") },
1044
+ { value: "failed", label: i("calls.only-refused") },
1045
+ { value: "dry", label: i("calls.only-dry") }
1046
+ ]), u = U(() => {
1047
+ const k = [], E = S.value.find((X) => X.value === x.value);
1048
+ x.value !== "all" && E && k.push({
1045
1049
  key: "user",
1046
- label: `${r("calls.filter-user")}: ${R.label}`,
1047
- clear: () => w.value = "all"
1048
- }), d.value !== "all" && k.push({
1050
+ label: `${i("calls.filter-user")}: ${E.label}`,
1051
+ clear: () => x.value = "all"
1052
+ }), f.value !== "all" && k.push({
1049
1053
  key: "tool",
1050
- label: `${r("calls.filter-tool")}: ${d.value}`,
1051
- clear: () => d.value = "all"
1054
+ label: `${i("calls.filter-tool")}: ${f.value}`,
1055
+ clear: () => f.value = "all"
1052
1056
  });
1053
- const C = O.value.find((q) => q.value === x.value);
1054
- return x.value !== "any" && C && k.push({
1057
+ const C = B.value.find((X) => X.value === y.value);
1058
+ return y.value !== "any" && C && k.push({
1055
1059
  key: "outcome",
1056
- label: `${r("calls.filter-outcome")}: ${C.label}`,
1057
- clear: () => x.value = "any"
1060
+ label: `${i("calls.filter-outcome")}: ${C.label}`,
1061
+ clear: () => y.value = "any"
1058
1062
  }), k;
1059
1063
  });
1060
- function v() {
1061
- w.value = "all", d.value = "all", x.value = "any";
1064
+ function _() {
1065
+ x.value = "all", f.value = "all", y.value = "any";
1062
1066
  }
1063
- const A = U(() => z.value ? [{ key: "card", label: "" }] : [
1064
- { key: "at", label: r("calls.when") },
1065
- { key: "user", label: r("calls.who"), hideBelow: 640 },
1066
- { key: "tool", label: r("calls.tool") },
1067
- { key: "outcome", label: r("calls.outcome") },
1068
- { key: "duration_ms", label: r("calls.took"), align: "right", hideBelow: 820 },
1069
- { key: "client", label: r("calls.client"), hideBelow: 960 }
1067
+ const z = U(() => A.value ? [{ key: "card", label: "" }] : [
1068
+ { key: "at", label: i("calls.when") },
1069
+ { key: "user", label: i("calls.who"), hideBelow: 640 },
1070
+ { key: "tool", label: i("calls.tool") },
1071
+ { key: "outcome", label: i("calls.outcome") },
1072
+ { key: "duration_ms", label: i("calls.took"), align: "right", hideBelow: 820 },
1073
+ { key: "client", label: i("calls.client"), hideBelow: 960 }
1070
1074
  ]);
1071
- ue([w, d, x], () => I({ ...y, page: 1 }));
1072
- async function I(k) {
1073
- y = k, g.value = !0;
1075
+ ue([x, f, y], () => N({ ...v, page: 1 }));
1076
+ async function N(k) {
1077
+ v = k, w.value = !0;
1074
1078
  try {
1075
- F.value = await o.calls({
1076
- user: w.value === "all" ? null : w.value,
1077
- tool: d.value === "all" ? null : d.value,
1078
- outcome: x.value === "any" ? null : x.value,
1079
+ P.value = await s.calls({
1080
+ user: x.value === "all" ? null : x.value,
1081
+ tool: f.value === "all" ? null : f.value,
1082
+ outcome: y.value === "any" ? null : y.value,
1079
1083
  page: k.page,
1080
1084
  per_page: k.perPage
1081
- }), p.value = F.value.filters;
1085
+ }), p.value = P.value.filters;
1082
1086
  } finally {
1083
- g.value = !1;
1087
+ w.value = !1;
1084
1088
  }
1085
1089
  }
1086
- function Y(k) {
1087
- return k.ok ? k.dry_run ? { type: "info", label: r("calls.dry-run") } : { type: "success", label: r("calls.answered") } : { type: "danger", label: r("calls.refused") };
1090
+ function G(k) {
1091
+ return k.ok ? k.dry_run ? { type: "info", label: i("calls.dry-run") } : { type: "success", label: i("calls.answered") } : { type: "danger", label: i("calls.refused") };
1088
1092
  }
1089
1093
  function D(k) {
1090
1094
  return k.arguments !== null || k.error !== null;
1091
1095
  }
1092
- return u({ reload: () => I(y) }), (k, R) => (h(), G("div", {
1096
+ return r({ reload: () => N(v) }), (k, E) => (h(), Y("div", {
1093
1097
  ref_key: "root",
1094
- ref: b,
1098
+ ref: g,
1095
1099
  class: "wx-call-list"
1096
1100
  }, [
1097
- a(e(ke), {
1098
- data: F.value,
1099
- columns: A.value,
1101
+ a(e($e), {
1102
+ data: P.value,
1103
+ columns: z.value,
1100
1104
  "row-key": "id",
1101
1105
  flush: "",
1102
- loading: g.value,
1106
+ loading: w.value,
1103
1107
  clickable: !1,
1104
- expandable: !z.value,
1108
+ expandable: !A.value,
1105
1109
  "expandable-if": D,
1106
- "empty-text": e(r)("calls.empty"),
1107
- "cards-below": Te,
1108
- "filters-count": i.value.length,
1109
- "filters-label": e(f)("filters.title"),
1110
- onStateChange: I
1110
+ "empty-text": e(i)("calls.empty"),
1111
+ "cards-below": Ue,
1112
+ "filters-count": u.value.length,
1113
+ "filters-label": e(m)("filters.title"),
1114
+ onStateChange: N
1111
1115
  }, {
1112
1116
  filters: t(() => [
1113
- a(e(K), {
1114
- label: e(r)("calls.filter-user")
1117
+ a(e(H), {
1118
+ label: e(i)("calls.filter-user")
1115
1119
  }, {
1116
1120
  default: t(() => [
1117
1121
  a(e(ne), {
1118
- modelValue: w.value,
1119
- "onUpdate:modelValue": R[0] || (R[0] = (C) => w.value = C),
1120
- options: L.value,
1122
+ modelValue: x.value,
1123
+ "onUpdate:modelValue": E[0] || (E[0] = (C) => x.value = C),
1124
+ options: S.value,
1121
1125
  size: "sm"
1122
1126
  }, null, 8, ["modelValue", "options"])
1123
1127
  ]),
1124
1128
  _: 1
1125
1129
  }, 8, ["label"]),
1126
- a(e(K), {
1127
- label: e(r)("calls.filter-tool")
1130
+ a(e(H), {
1131
+ label: e(i)("calls.filter-tool")
1128
1132
  }, {
1129
1133
  default: t(() => [
1130
1134
  a(e(ne), {
1131
- modelValue: d.value,
1132
- "onUpdate:modelValue": R[1] || (R[1] = (C) => d.value = C),
1133
- options: $.value,
1135
+ modelValue: f.value,
1136
+ "onUpdate:modelValue": E[1] || (E[1] = (C) => f.value = C),
1137
+ options: V.value,
1134
1138
  size: "sm"
1135
1139
  }, null, 8, ["modelValue", "options"])
1136
1140
  ]),
1137
1141
  _: 1
1138
1142
  }, 8, ["label"]),
1139
- a(e(K), {
1140
- label: e(r)("calls.filter-outcome")
1143
+ a(e(H), {
1144
+ label: e(i)("calls.filter-outcome")
1141
1145
  }, {
1142
1146
  default: t(() => [
1143
1147
  a(e(ne), {
1144
- modelValue: x.value,
1145
- "onUpdate:modelValue": R[2] || (R[2] = (C) => x.value = C),
1146
- options: O.value,
1148
+ modelValue: y.value,
1149
+ "onUpdate:modelValue": E[2] || (E[2] = (C) => y.value = C),
1150
+ options: B.value,
1147
1151
  size: "sm"
1148
1152
  }, null, 8, ["modelValue", "options"])
1149
1153
  ]),
1150
1154
  _: 1
1151
1155
  }, 8, ["label"]),
1152
- i.value.length > 0 ? (h(), V(e(M), {
1156
+ u.value.length > 0 ? (h(), $(e(I), {
1153
1157
  key: 0,
1154
1158
  variant: "text",
1155
1159
  size: "sm",
1156
1160
  block: "",
1157
- onClick: v
1161
+ onClick: _
1158
1162
  }, {
1159
1163
  icon: t(() => [
1160
- a(e(Z), { name: "close" })
1164
+ a(e(ee), { name: "close" })
1161
1165
  ]),
1162
1166
  default: t(() => [
1163
- m(" " + s(e(f)("filters.reset")), 1)
1167
+ d(" " + o(e(m)("filters.reset")), 1)
1164
1168
  ]),
1165
1169
  _: 1
1166
- })) : E("", !0)
1170
+ })) : O("", !0)
1167
1171
  ]),
1168
1172
  applied: t(() => [
1169
- a(e(De), { filters: i.value }, null, 8, ["filters"])
1173
+ a(e(De), { filters: u.value }, null, 8, ["filters"])
1170
1174
  ]),
1171
1175
  "cell-at": t(({ row: C }) => [
1172
1176
  a(e(ie), {
@@ -1176,113 +1180,133 @@ const ft = { class: "wx-admin-form" }, ht = {
1176
1180
  }, null, 8, ["value"])
1177
1181
  ]),
1178
1182
  "cell-user": t(({ row: C }) => [
1179
- a(e(B), {
1183
+ a(e(R), {
1180
1184
  tone: C.user === null || C.user.name === null ? "muted" : "default"
1181
1185
  }, {
1182
1186
  default: t(() => [
1183
- m(s(_(C.user)), 1)
1187
+ d(o(b(C.user)), 1)
1184
1188
  ]),
1185
1189
  _: 2
1186
1190
  }, 1032, ["tone"])
1187
1191
  ]),
1188
1192
  "cell-tool": t(({ row: C }) => [
1189
- a(e(B), {
1193
+ a(e(R), {
1190
1194
  mono: "",
1191
1195
  size: "sm"
1192
1196
  }, {
1193
1197
  default: t(() => [
1194
- m(s(C.tool), 1)
1198
+ d(o(C.tool), 1)
1195
1199
  ]),
1196
1200
  _: 2
1197
1201
  }, 1024)
1198
1202
  ]),
1199
1203
  "cell-outcome": t(({ row: C }) => [
1200
- a(e(j), {
1201
- type: Y(C).type,
1204
+ a(e(J), {
1205
+ type: G(C).type,
1202
1206
  dot: ""
1203
1207
  }, {
1204
1208
  default: t(() => [
1205
- m(s(Y(C).label), 1)
1209
+ d(o(G(C).label), 1)
1206
1210
  ]),
1207
1211
  _: 2
1208
1212
  }, 1032, ["type"])
1209
1213
  ]),
1210
1214
  "cell-duration_ms": t(({ row: C }) => [
1211
- a(e(B), {
1215
+ a(e(R), {
1212
1216
  size: "sm",
1213
1217
  tone: "muted"
1214
1218
  }, {
1215
1219
  default: t(() => [
1216
- m(s(e(r)("calls.ms", { count: C.duration_ms })), 1)
1220
+ d(o(e(i)("calls.ms", { count: C.duration_ms })), 1)
1217
1221
  ]),
1218
1222
  _: 2
1219
1223
  }, 1024)
1220
1224
  ]),
1221
1225
  "cell-client": t(({ row: C }) => [
1222
- C.client ? (h(), V(e(B), {
1226
+ C.client ? (h(), $(e(R), {
1223
1227
  key: 0,
1224
1228
  size: "sm"
1225
1229
  }, {
1226
1230
  default: t(() => [
1227
- m(s(C.client), 1)
1231
+ d(o(C.client), 1)
1228
1232
  ]),
1229
1233
  _: 2
1230
- }, 1024)) : (h(), V(e(B), {
1234
+ }, 1024)) : (h(), $(e(R), {
1231
1235
  key: 1,
1232
1236
  size: "sm",
1233
1237
  tone: "muted"
1234
1238
  }, {
1235
- default: t(() => [...R[3] || (R[3] = [
1236
- m("—", -1)
1239
+ default: t(() => [...E[3] || (E[3] = [
1240
+ d("—", -1)
1237
1241
  ])]),
1238
1242
  _: 1
1239
1243
  }))
1240
1244
  ]),
1241
1245
  expanded: t(({ row: C }) => [
1242
- W("div", bt, [
1243
- C.error ? (h(), V(e(B), {
1246
+ L("div", xt, [
1247
+ C.error ? (h(), $(e(R), {
1244
1248
  key: 0,
1245
1249
  tone: "danger",
1246
1250
  size: "sm",
1247
1251
  class: "wx-call-list__error"
1248
1252
  }, {
1249
1253
  default: t(() => [
1250
- W("strong", null, s(e(r)("calls.error")) + ":", 1),
1251
- m(" " + s(C.error), 1)
1254
+ L("strong", null, o(e(i)("calls.error")) + ":", 1),
1255
+ d(" " + o(C.error), 1)
1252
1256
  ]),
1253
1257
  _: 2
1254
- }, 1024)) : E("", !0),
1255
- C.arguments ? (h(), G("pre", gt, s(C.arguments), 1)) : (h(), V(e(B), {
1258
+ }, 1024)) : O("", !0),
1259
+ L("div", kt, [
1260
+ a(e(R), {
1261
+ size: "sm",
1262
+ weight: "semibold"
1263
+ }, {
1264
+ default: t(() => [
1265
+ d(o(e(i)("calls.request")), 1)
1266
+ ]),
1267
+ _: 1
1268
+ }),
1269
+ a(e(R), {
1270
+ size: "xs",
1271
+ tone: "muted"
1272
+ }, {
1273
+ default: t(() => [
1274
+ d(o(e(i)("calls.request-hint")), 1)
1275
+ ]),
1276
+ _: 1
1277
+ })
1278
+ ]),
1279
+ C.arguments ? (h(), Y("pre", Ct, o(C.arguments), 1)) : (h(), $(e(R), {
1256
1280
  key: 2,
1257
1281
  size: "sm",
1258
1282
  tone: "muted"
1259
1283
  }, {
1260
1284
  default: t(() => [
1261
- m(s(e(r)("calls.no-arguments")), 1)
1285
+ d(o(e(i)("calls.no-arguments")), 1)
1262
1286
  ]),
1263
1287
  _: 1
1264
1288
  }))
1265
1289
  ])
1266
1290
  ]),
1267
1291
  "cell-card": t(({ row: C }) => [
1268
- a(e(Ce), {
1292
+ a(e(Ae), {
1269
1293
  variant: "plain",
1270
1294
  title: C.tool,
1271
- subtitle: _(C.user)
1295
+ subtitle: b(C.user)
1272
1296
  }, {
1273
1297
  media: t(() => [
1274
- W("span", wt, [
1275
- a(e(Z), { name: "sliders" })
1298
+ L("span", $t, [
1299
+ a(e(ee), { name: "sliders" })
1276
1300
  ])
1277
1301
  ]),
1278
1302
  meta: t(() => [
1279
- a(e(j), {
1280
- type: Y(C).type,
1303
+ a(e(J), {
1304
+ type: G(C).type,
1281
1305
  dot: "",
1282
1306
  size: "sm"
1283
1307
  }, {
1284
1308
  default: t(() => [
1285
- m(s(Y(C).label), 1)
1309
+ d(o(G(C).label), 1)
1286
1310
  ]),
1287
1311
  _: 2
1288
1312
  }, 1032, ["type"]),
@@ -1290,39 +1314,49 @@ const ft = { class: "wx-admin-form" }, ht = {
1290
1314
  value: C.at,
1291
1315
  compact: ""
1292
1316
  }, null, 8, ["value"]),
1293
- C.client ? (h(), V(e(B), {
1317
+ C.client ? (h(), $(e(R), {
1294
1318
  key: 0,
1295
1319
  size: "xs",
1296
1320
  tone: "muted"
1297
1321
  }, {
1298
1322
  default: t(() => [
1299
- m(s(C.client), 1)
1323
+ d(o(C.client), 1)
1300
1324
  ]),
1301
1325
  _: 2
1302
- }, 1024)) : E("", !0)
1326
+ }, 1024)) : O("", !0)
1303
1327
  ]),
1304
1328
  default: t(() => [
1305
- D(C) ? (h(), V(e(oe), {
1329
+ D(C) ? (h(), $(e(se), {
1306
1330
  key: 0,
1307
1331
  direction: "vertical",
1308
1332
  size: "xs",
1309
1333
  class: "wx-call-list__card-details"
1310
1334
  }, {
1311
1335
  default: t(() => [
1312
- C.error ? (h(), V(e(B), {
1336
+ C.error ? (h(), $(e(R), {
1313
1337
  key: 0,
1314
1338
  tone: "danger",
1315
1339
  size: "sm"
1316
1340
  }, {
1317
1341
  default: t(() => [
1318
- m(s(C.error), 1)
1342
+ d(o(C.error), 1)
1319
1343
  ]),
1320
1344
  _: 2
1321
- }, 1024)) : E("", !0),
1322
- C.arguments ? (h(), G("pre", xt, s(C.arguments), 1)) : E("", !0)
1345
+ }, 1024)) : O("", !0),
1346
+ C.arguments ? (h(), $(e(R), {
1347
+ key: 1,
1348
+ size: "xs",
1349
+ tone: "muted"
1350
+ }, {
1351
+ default: t(() => [
1352
+ d(o(e(i)("calls.request")), 1)
1353
+ ]),
1354
+ _: 1
1355
+ })) : O("", !0),
1356
+ C.arguments ? (h(), Y("pre", At, o(C.arguments), 1)) : O("", !0)
1323
1357
  ]),
1324
1358
  _: 2
1325
- }, 1024)) : E("", !0)
1359
+ }, 1024)) : O("", !0)
1326
1360
  ]),
1327
1361
  _: 2
1328
1362
  }, 1032, ["title", "subtitle"])
@@ -1332,29 +1366,29 @@ const ft = { class: "wx-admin-form" }, ht = {
1332
1366
  ], 512));
1333
1367
  }
1334
1368
  });
1335
- function Ct(n) {
1336
- const u = `${n.apiPath}/auth/connections`;
1369
+ function zt(n) {
1370
+ const r = `${n.apiPath}/auth/connections`;
1337
1371
  return {
1338
- list: (l = "mine") => n.http.get(u, { query: { all: l === "all" ? 1 : void 0 } }).then((o) => ({
1339
- data: o.data,
1340
- scope: o.meta.scope,
1341
- canSeeEverybody: o.meta.can_see_everybody
1372
+ list: (l = "mine") => n.http.get(r, { query: { all: l === "all" ? 1 : void 0 } }).then((s) => ({
1373
+ data: s.data,
1374
+ scope: s.meta.scope,
1375
+ canSeeEverybody: s.meta.can_see_everybody
1342
1376
  })),
1343
- disconnect: (l) => n.http.delete(`${u}/${l}`).then((o) => o.data)
1377
+ disconnect: (l) => n.http.delete(`${r}/${l}`).then((s) => s.data)
1344
1378
  };
1345
1379
  }
1346
- const $t = {
1380
+ const Lt = {
1347
1381
  class: "wx-connection-list__glyph",
1348
1382
  "aria-hidden": "true"
1349
- }, Ue = 560, qe = /* @__PURE__ */ X({
1383
+ }, Pe = 560, Je = /* @__PURE__ */ Q({
1350
1384
  __name: "ConnectionList",
1351
1385
  props: {
1352
1386
  scope: { default: "mine" }
1353
1387
  },
1354
- setup(n, { expose: u }) {
1355
- const l = n, o = ee(), b = Ct(o);
1388
+ setup(n, { expose: r }) {
1389
+ const l = n, s = Z(), g = zt(s);
1356
1390
  te();
1357
- const c = J("webx-auth"), z = ve(), r = re("root"), f = xe(r), F = U(() => f.value > 0 && f.value < Ue), p = T([]), g = T(!1), w = T(null), d = U(() => F.value ? [{ key: "card", label: "" }] : [
1391
+ const c = K("webx-auth"), A = me(), i = re("root"), m = Ce(i), P = U(() => m.value > 0 && m.value < Pe), p = W([]), w = W(!1), x = W(null), f = U(() => P.value ? [{ key: "card", label: "" }] : [
1358
1392
  { key: "client", label: c("connections.client"), minWidth: 210 },
1359
1393
  ...l.scope === "all" ? [{ key: "user", label: c("connections.who"), minWidth: 140 }] : [],
1360
1394
  { key: "read_only", label: c("connections.allowed"), minWidth: 160 },
@@ -1362,81 +1396,81 @@ const $t = {
1362
1396
  { key: "last_used_at", label: c("connections.last-used"), minWidth: 130 },
1363
1397
  { key: "end", label: "", align: "right", width: 140 }
1364
1398
  ]);
1365
- function x($) {
1366
- return $.user.name ?? c("calls.deleted", { id: $.user.id });
1399
+ function y(V) {
1400
+ return V.user.name ?? c("calls.deleted", { id: V.user.id });
1367
1401
  }
1368
- function y($) {
1369
- if ($.read_only) return c("connections.read-only");
1402
+ function v(V) {
1403
+ if (V.read_only) return c("connections.read-only");
1370
1404
  if (l.scope !== "all") return c("connections.full-you");
1371
- const O = $.user.name?.split(" ")[0];
1372
- return c("connections.full", { name: O || x($) });
1405
+ const B = V.user.name?.split(" ")[0];
1406
+ return c("connections.full", { name: B || y(V) });
1373
1407
  }
1374
- async function _() {
1375
- g.value = !0;
1408
+ async function b() {
1409
+ w.value = !0;
1376
1410
  try {
1377
- p.value = (await b.list(l.scope)).data;
1378
- } catch ($) {
1379
- Q.danger(z($));
1411
+ p.value = (await g.list(l.scope)).data;
1412
+ } catch (V) {
1413
+ j.danger(A(V));
1380
1414
  } finally {
1381
- g.value = !1;
1415
+ w.value = !1;
1382
1416
  }
1383
1417
  }
1384
- async function L($) {
1385
- if (await Ie({
1386
- title: c("connections.confirm-title", { client: $.client }),
1418
+ async function S(V) {
1419
+ if (await Ne({
1420
+ title: c("connections.confirm-title", { client: V.client }),
1387
1421
  message: c("connections.confirm-text"),
1388
1422
  confirmText: c("connections.confirm"),
1389
1423
  cancelText: c("connections.cancel"),
1390
1424
  tone: "danger"
1391
1425
  })) {
1392
- w.value = $.id;
1426
+ x.value = V.id;
1393
1427
  try {
1394
- const i = await b.disconnect($.id);
1395
- p.value = p.value.map((v) => v.id === i.id ? i : v), Q.success(c("connections.done", { client: $.client }));
1396
- } catch (i) {
1397
- Q.danger(z(i));
1428
+ const u = await g.disconnect(V.id);
1429
+ p.value = p.value.map((_) => _.id === u.id ? u : _), j.success(c("connections.done", { client: V.client }));
1430
+ } catch (u) {
1431
+ j.danger(A(u));
1398
1432
  } finally {
1399
- w.value = null;
1433
+ x.value = null;
1400
1434
  }
1401
1435
  }
1402
1436
  }
1403
- return ue(() => l.scope, _, { immediate: !0 }), u({ reload: _ }), ($, O) => (h(), G("div", {
1437
+ return ue(() => l.scope, b, { immediate: !0 }), r({ reload: b }), (V, B) => (h(), Y("div", {
1404
1438
  ref_key: "root",
1405
- ref: r,
1439
+ ref: i,
1406
1440
  class: "wx-connection-list"
1407
1441
  }, [
1408
- a(e(ke), {
1442
+ a(e($e), {
1409
1443
  data: p.value,
1410
- columns: d.value,
1444
+ columns: f.value,
1411
1445
  "row-key": "id",
1412
1446
  flush: "",
1413
- loading: g.value,
1447
+ loading: w.value,
1414
1448
  clickable: !1,
1415
1449
  "empty-text": n.scope === "all" ? e(c)("connections.empty-all") : e(c)("connections.empty"),
1416
- "cards-below": Ue,
1417
- "row-class": (i) => i.revoked_at ? "is-ended" : ""
1450
+ "cards-below": Pe,
1451
+ "row-class": (u) => u.revoked_at ? "is-ended" : ""
1418
1452
  }, {
1419
- "cell-client": t(({ row: i }) => [
1420
- a(e(oe), {
1453
+ "cell-client": t(({ row: u }) => [
1454
+ a(e(se), {
1421
1455
  direction: "vertical",
1422
1456
  size: "none"
1423
1457
  }, {
1424
1458
  default: t(() => [
1425
- a(e(B), {
1426
- tone: i.revoked_at ? "muted" : "default",
1459
+ a(e(R), {
1460
+ tone: u.revoked_at ? "muted" : "default",
1427
1461
  weight: "medium"
1428
1462
  }, {
1429
1463
  default: t(() => [
1430
- m(s(i.client), 1)
1464
+ d(o(u.client), 1)
1431
1465
  ]),
1432
1466
  _: 2
1433
1467
  }, 1032, ["tone"]),
1434
- a(e(B), {
1468
+ a(e(R), {
1435
1469
  size: "xs",
1436
1470
  tone: "muted"
1437
1471
  }, {
1438
1472
  default: t(() => [
1439
- m(s(e(c)("connections.returns-to", { host: i.host })), 1)
1473
+ d(o(e(c)("connections.returns-to", { host: u.host })), 1)
1440
1474
  ]),
1441
1475
  _: 2
1442
1476
  }, 1024)
@@ -1444,145 +1478,145 @@ const $t = {
1444
1478
  _: 2
1445
1479
  }, 1024)
1446
1480
  ]),
1447
- "cell-user": t(({ row: i }) => [
1448
- a(e(B), {
1449
- tone: i.user.name === null ? "muted" : "default"
1481
+ "cell-user": t(({ row: u }) => [
1482
+ a(e(R), {
1483
+ tone: u.user.name === null ? "muted" : "default"
1450
1484
  }, {
1451
1485
  default: t(() => [
1452
- m(s(x(i)), 1)
1486
+ d(o(y(u)), 1)
1453
1487
  ]),
1454
1488
  _: 2
1455
1489
  }, 1032, ["tone"])
1456
1490
  ]),
1457
- "cell-read_only": t(({ row: i }) => [
1458
- i.revoked_at ? (h(), V(e(j), {
1491
+ "cell-read_only": t(({ row: u }) => [
1492
+ u.revoked_at ? (h(), $(e(J), {
1459
1493
  key: 0,
1460
1494
  type: "default",
1461
1495
  dot: ""
1462
1496
  }, {
1463
1497
  default: t(() => [
1464
- m(s(e(c)("connections.disconnected")), 1)
1498
+ d(o(e(c)("connections.disconnected")), 1)
1465
1499
  ]),
1466
1500
  _: 1
1467
- })) : (h(), V(e(j), {
1501
+ })) : (h(), $(e(J), {
1468
1502
  key: 1,
1469
- type: i.read_only ? "info" : "success",
1503
+ type: u.read_only ? "info" : "success",
1470
1504
  dot: ""
1471
1505
  }, {
1472
1506
  default: t(() => [
1473
- m(s(y(i)), 1)
1507
+ d(o(v(u)), 1)
1474
1508
  ]),
1475
1509
  _: 2
1476
1510
  }, 1032, ["type"]))
1477
1511
  ]),
1478
- "cell-connected_at": t(({ row: i }) => [
1512
+ "cell-connected_at": t(({ row: u }) => [
1479
1513
  a(e(ie), {
1480
- value: i.connected_at,
1514
+ value: u.connected_at,
1481
1515
  tone: "muted",
1482
1516
  compact: ""
1483
1517
  }, null, 8, ["value"])
1484
1518
  ]),
1485
- "cell-last_used_at": t(({ row: i }) => [
1486
- i.last_used_at ? (h(), V(e(ie), {
1519
+ "cell-last_used_at": t(({ row: u }) => [
1520
+ u.last_used_at ? (h(), $(e(ie), {
1487
1521
  key: 0,
1488
- value: i.last_used_at,
1522
+ value: u.last_used_at,
1489
1523
  tone: "default",
1490
1524
  compact: ""
1491
- }, null, 8, ["value"])) : (h(), V(e(B), {
1525
+ }, null, 8, ["value"])) : (h(), $(e(R), {
1492
1526
  key: 1,
1493
1527
  size: "sm",
1494
1528
  tone: "muted"
1495
1529
  }, {
1496
1530
  default: t(() => [
1497
- m(s(e(c)("connections.never-used")), 1)
1531
+ d(o(e(c)("connections.never-used")), 1)
1498
1532
  ]),
1499
1533
  _: 1
1500
1534
  }))
1501
1535
  ]),
1502
- "cell-end": t(({ row: i }) => [
1503
- i.revoked_at ? E("", !0) : (h(), V(e(M), {
1536
+ "cell-end": t(({ row: u }) => [
1537
+ u.revoked_at ? O("", !0) : (h(), $(e(I), {
1504
1538
  key: 0,
1505
1539
  type: "danger",
1506
1540
  variant: "text",
1507
1541
  size: "sm",
1508
- loading: w.value === i.id,
1509
- onClick: (v) => L(i)
1542
+ loading: x.value === u.id,
1543
+ onClick: (_) => S(u)
1510
1544
  }, {
1511
1545
  default: t(() => [
1512
- m(s(e(c)("connections.disconnect")), 1)
1546
+ d(o(e(c)("connections.disconnect")), 1)
1513
1547
  ]),
1514
1548
  _: 1
1515
1549
  }, 8, ["loading", "onClick"]))
1516
1550
  ]),
1517
- "cell-card": t(({ row: i }) => [
1518
- a(e(Ce), {
1551
+ "cell-card": t(({ row: u }) => [
1552
+ a(e(Ae), {
1519
1553
  variant: "plain",
1520
- title: i.client,
1521
- subtitle: e(c)("connections.returns-to", { host: i.host })
1554
+ title: u.client,
1555
+ subtitle: e(c)("connections.returns-to", { host: u.host })
1522
1556
  }, {
1523
1557
  media: t(() => [
1524
- W("span", $t, [
1525
- a(e(Z), { name: "link" })
1558
+ L("span", Lt, [
1559
+ a(e(ee), { name: "link" })
1526
1560
  ])
1527
1561
  ]),
1528
1562
  meta: t(() => [
1529
- i.revoked_at ? (h(), V(e(j), {
1563
+ u.revoked_at ? (h(), $(e(J), {
1530
1564
  key: 0,
1531
1565
  type: "default",
1532
1566
  dot: "",
1533
1567
  size: "sm"
1534
1568
  }, {
1535
1569
  default: t(() => [
1536
- m(s(e(c)("connections.disconnected")), 1)
1570
+ d(o(e(c)("connections.disconnected")), 1)
1537
1571
  ]),
1538
1572
  _: 1
1539
- })) : (h(), V(e(j), {
1573
+ })) : (h(), $(e(J), {
1540
1574
  key: 1,
1541
- type: i.read_only ? "info" : "success",
1575
+ type: u.read_only ? "info" : "success",
1542
1576
  dot: "",
1543
1577
  size: "sm"
1544
1578
  }, {
1545
1579
  default: t(() => [
1546
- m(s(y(i)), 1)
1580
+ d(o(v(u)), 1)
1547
1581
  ]),
1548
1582
  _: 2
1549
1583
  }, 1032, ["type"])),
1550
- n.scope === "all" ? (h(), V(e(B), {
1584
+ n.scope === "all" ? (h(), $(e(R), {
1551
1585
  key: 2,
1552
1586
  size: "xs",
1553
1587
  tone: "muted"
1554
1588
  }, {
1555
1589
  default: t(() => [
1556
- m(s(x(i)), 1)
1590
+ d(o(y(u)), 1)
1557
1591
  ]),
1558
1592
  _: 2
1559
- }, 1024)) : E("", !0),
1560
- i.last_used_at ? (h(), V(e(ie), {
1593
+ }, 1024)) : O("", !0),
1594
+ u.last_used_at ? (h(), $(e(ie), {
1561
1595
  key: 3,
1562
- value: i.last_used_at,
1596
+ value: u.last_used_at,
1563
1597
  compact: ""
1564
- }, null, 8, ["value"])) : (h(), V(e(B), {
1598
+ }, null, 8, ["value"])) : (h(), $(e(R), {
1565
1599
  key: 4,
1566
1600
  size: "xs",
1567
1601
  tone: "muted"
1568
1602
  }, {
1569
1603
  default: t(() => [
1570
- m(s(e(c)("connections.never-used")), 1)
1604
+ d(o(e(c)("connections.never-used")), 1)
1571
1605
  ]),
1572
1606
  _: 1
1573
1607
  }))
1574
1608
  ]),
1575
1609
  actions: t(() => [
1576
- i.revoked_at ? E("", !0) : (h(), V(e(M), {
1610
+ u.revoked_at ? O("", !0) : (h(), $(e(I), {
1577
1611
  key: 0,
1578
1612
  type: "danger",
1579
1613
  variant: "text",
1580
1614
  size: "sm",
1581
- loading: w.value === i.id,
1582
- onClick: (v) => L(i)
1615
+ loading: x.value === u.id,
1616
+ onClick: (_) => S(u)
1583
1617
  }, {
1584
1618
  default: t(() => [
1585
- m(s(e(c)("connections.disconnect")), 1)
1619
+ d(o(e(c)("connections.disconnect")), 1)
1586
1620
  ]),
1587
1621
  _: 1
1588
1622
  }, 8, ["loading", "onClick"]))
@@ -1594,7 +1628,7 @@ const $t = {
1594
1628
  }, 8, ["data", "columns", "loading", "empty-text", "row-class"])
1595
1629
  ], 512));
1596
1630
  }
1597
- }), At = /* @__PURE__ */ X({
1631
+ }), St = /* @__PURE__ */ Q({
1598
1632
  __name: "AdminsPage",
1599
1633
  props: {
1600
1634
  base: { default: "/admins" },
@@ -1603,235 +1637,330 @@ const $t = {
1603
1637
  resolveAvatar: { type: Function, default: void 0 }
1604
1638
  },
1605
1639
  setup(n) {
1606
- const u = n, l = ee(), o = fe(l), b = u.avatarField ?? Ye(l) ?? void 0, c = u.resolveAvatar ?? je(l) ?? void 0, z = lt(), r = nt();
1640
+ const r = n, l = Z(), s = he(l), g = r.avatarField ?? Ke(l) ?? void 0, c = r.resolveAvatar ?? Ye(l) ?? void 0, A = st(), i = ot();
1607
1641
  te();
1608
- const f = J("webx-auth"), F = ve(), p = re("list"), g = T(null), w = $e(_t), d = l.can("admins.manage"), x = l.can("admins.audit"), y = U(
1609
- () => l.state.manifest?.modules.find((v) => v.id === "admins")?.title ?? f("admins.title")
1610
- ), _ = U(() => {
1611
- const v = [{ value: "admins", label: y.value }];
1612
- return x && v.push({ value: "calls", label: f("calls.title") }), d && v.push({ value: "connections", label: f("connections.title") }), v.length > 1 ? v : void 0;
1613
- }), L = U({
1614
- get: () => u.current,
1615
- set: (v) => {
1616
- const A = v === "admins" ? u.base : `${u.base}/${String(v)}`;
1617
- A !== r.path && z.push(A);
1642
+ const m = K("webx-auth"), P = me(), p = re("list"), w = W(null), x = Ve(wt), f = l.can("admins.manage"), y = l.can("admins.audit"), v = U(
1643
+ () => l.state.manifest?.modules.find((_) => _.id === "admins")?.title ?? m("admins.title")
1644
+ ), b = U(() => {
1645
+ const _ = [{ value: "admins", label: v.value }];
1646
+ return y && _.push({ value: "calls", label: m("calls.title") }), f && _.push({ value: "connections", label: m("connections.title") }), _.length > 1 ? _ : void 0;
1647
+ }), S = U({
1648
+ get: () => r.current,
1649
+ set: (_) => {
1650
+ const z = _ === "admins" ? r.base : `${r.base}/${String(_)}`;
1651
+ z !== i.path && A.push(z);
1618
1652
  }
1619
- }), $ = U(
1620
- () => d && u.current === "admins" ? [
1653
+ }), V = U(
1654
+ () => f && r.current === "admins" ? [
1621
1655
  {
1622
1656
  key: "new",
1623
- label: f("admins.new-short"),
1657
+ label: m("admins.new-short"),
1624
1658
  icon: "plus",
1625
1659
  primary: !0,
1626
1660
  run: () => {
1627
- O(null);
1661
+ B(null);
1628
1662
  }
1629
1663
  }
1630
1664
  ] : []
1631
1665
  );
1632
- async function O(v) {
1633
- g.value = v, await w({ admin: v, avatarField: b }) && p.value?.reload();
1666
+ async function B(_) {
1667
+ w.value = _, await x({ admin: _, avatarField: g }) && p.value?.reload();
1634
1668
  }
1635
- async function i(v) {
1636
- if (await Ie({
1637
- title: f("admins.delete-title", { name: v.name }),
1638
- message: f("admins.delete-text"),
1639
- confirmText: f("admins.delete"),
1640
- cancelText: f("admins.cancel"),
1669
+ async function u(_) {
1670
+ if (await Ne({
1671
+ title: m("admins.delete-title", { name: _.name }),
1672
+ message: m("admins.delete-text"),
1673
+ confirmText: m("admins.delete"),
1674
+ cancelText: m("admins.cancel"),
1641
1675
  tone: "danger"
1642
1676
  }))
1643
1677
  try {
1644
- await o.remove(v.id), Q.success(f("admins.deleted")), p.value?.reload();
1645
- } catch (I) {
1646
- Q.danger(F(I));
1678
+ await s.remove(_.id), j.success(m("admins.deleted")), p.value?.reload();
1679
+ } catch (N) {
1680
+ j.danger(P(N));
1647
1681
  }
1648
1682
  }
1649
- return (v, A) => (h(), V(e(Ne), {
1650
- view: L.value,
1651
- "onUpdate:view": A[0] || (A[0] = (I) => L.value = I),
1652
- title: y.value,
1653
- views: _.value,
1654
- actions: $.value
1683
+ return (_, z) => (h(), $(e(Me), {
1684
+ view: S.value,
1685
+ "onUpdate:view": z[0] || (z[0] = (N) => S.value = N),
1686
+ title: v.value,
1687
+ views: b.value,
1688
+ actions: V.value
1655
1689
  }, {
1656
1690
  default: t(() => [
1657
- n.current === "calls" ? (h(), V(kt, { key: 0 })) : n.current === "connections" ? (h(), V(qe, {
1691
+ n.current === "calls" ? (h(), $(Vt, { key: 0 })) : n.current === "connections" ? (h(), $(Je, {
1658
1692
  key: 1,
1659
1693
  scope: "all"
1660
- })) : (h(), V(Je, {
1694
+ })) : (h(), $(Ge, {
1661
1695
  key: 2,
1662
1696
  ref_key: "list",
1663
1697
  ref: p,
1664
- removable: e(d),
1698
+ removable: e(f),
1665
1699
  "resolve-avatar": e(c),
1666
- onOpen: O,
1667
- onRemove: i
1700
+ onOpen: B,
1701
+ onRemove: u
1668
1702
  }, null, 8, ["removable", "resolve-avatar"]))
1669
1703
  ]),
1670
1704
  _: 1
1671
1705
  }, 8, ["view", "title", "views", "actions"]));
1672
1706
  }
1673
- }), Vt = { class: "wx-connect" }, zt = { class: "wx-connect__row" }, Lt = { class: "wx-connect__url" }, St = { class: "wx-connect__section" }, Wt = { class: "wx-connect__steps" }, Tt = { class: "wx-connect__steps" }, Ut = { class: "wx-connect__snippet" }, Pt = { class: "wx-connect__snippet" }, Ft = { class: "wx-connect__section" }, Ot = { class: "wx-connect__links" }, Rt = { class: "wx-connect__steps" }, Bt = { class: "wx-connect__section" }, Et = /* @__PURE__ */ X({
1707
+ }), Wt = {
1708
+ key: 0,
1709
+ class: "wx-content-rules"
1710
+ }, Tt = { class: "wx-content-rules__foot" }, Ut = /* @__PURE__ */ Q({
1711
+ __name: "ContentRulesCard",
1712
+ setup(n) {
1713
+ const r = Z();
1714
+ te();
1715
+ const l = K("webx-auth"), s = K("webx-admin"), g = me(), c = U(() => {
1716
+ const v = r.state.manifest?.modules.find((b) => b.id === "settings")?.meta?.content_screen;
1717
+ return typeof v == "string" ? v : null;
1718
+ }), A = r.can("settings.view") || r.can("settings.manage"), i = r.can("settings.manage"), m = W({}), P = W({}), p = W(!0), w = W(!1), x = `${r.apiPath}/settings/content`;
1719
+ et(async () => {
1720
+ if (!(!c.value || !A))
1721
+ try {
1722
+ const y = await r.http.get(x);
1723
+ m.value = y.data.values;
1724
+ } catch (y) {
1725
+ j.danger(g(y));
1726
+ } finally {
1727
+ p.value = !1;
1728
+ }
1729
+ });
1730
+ async function f() {
1731
+ w.value = !0, P.value = {};
1732
+ try {
1733
+ const y = await r.http.put(x, {
1734
+ values: m.value
1735
+ });
1736
+ m.value = y.data.values, j.success(s("editor.saved"));
1737
+ } catch (y) {
1738
+ const v = y.body;
1739
+ v?.errors && (P.value = v.errors), j.danger(g(y));
1740
+ } finally {
1741
+ w.value = !1;
1742
+ }
1743
+ }
1744
+ return (y, v) => c.value && e(A) ? (h(), Y("section", Wt, [
1745
+ a(e(ce), {
1746
+ level: 2,
1747
+ size: "sm"
1748
+ }, {
1749
+ default: t(() => [
1750
+ d(o(e(l)("connect.rules")), 1)
1751
+ ]),
1752
+ _: 1
1753
+ }),
1754
+ a(e(be), null, we({
1755
+ default: t(() => [
1756
+ p.value ? (h(), $(e(rt), {
1757
+ key: 0,
1758
+ rows: 4
1759
+ })) : (h(), $(e(lt), {
1760
+ key: 1,
1761
+ modelValue: m.value,
1762
+ "onUpdate:modelValue": v[0] || (v[0] = (b) => m.value = b),
1763
+ name: c.value,
1764
+ errors: P.value,
1765
+ disabled: !e(i)
1766
+ }, null, 8, ["modelValue", "name", "errors", "disabled"]))
1767
+ ]),
1768
+ _: 2
1769
+ }, [
1770
+ p.value ? void 0 : {
1771
+ name: "footer",
1772
+ fn: t(() => [
1773
+ L("div", Tt, [
1774
+ a(e(R), {
1775
+ size: "sm",
1776
+ tone: "muted"
1777
+ }, {
1778
+ default: t(() => [
1779
+ d(o(e(l)("connect.rules-hint")), 1)
1780
+ ]),
1781
+ _: 1
1782
+ }),
1783
+ e(i) ? (h(), $(e(I), {
1784
+ key: 0,
1785
+ type: "primary",
1786
+ loading: w.value,
1787
+ onClick: f
1788
+ }, {
1789
+ default: t(() => [
1790
+ d(o(e(s)("editor.save")), 1)
1791
+ ]),
1792
+ _: 1
1793
+ }, 8, ["loading"])) : O("", !0)
1794
+ ])
1795
+ ]),
1796
+ key: "0"
1797
+ }
1798
+ ]), 1024)
1799
+ ])) : O("", !0);
1800
+ }
1801
+ }), Pt = /* @__PURE__ */ ve(Ut, [["__scopeId", "data-v-55be157e"]]), Ft = { class: "wx-connect" }, Rt = { class: "wx-connect__section" }, Ot = { class: "wx-connect__row" }, Bt = { class: "wx-connect__url" }, Et = { class: "wx-connect__section" }, Dt = { class: "wx-connect__steps" }, Mt = { class: "wx-connect__steps" }, Nt = { class: "wx-connect__snippet" }, It = { class: "wx-connect__snippet" }, qt = { class: "wx-connect__section" }, Ht = { class: "wx-connect__links" }, Kt = { class: "wx-connect__steps" }, Yt = { class: "wx-connect__section" }, jt = /* @__PURE__ */ Q({
1674
1802
  __name: "ConnectPage",
1675
1803
  setup(n) {
1676
- const u = ee();
1804
+ const r = Z();
1677
1805
  te();
1678
- const l = J("webx-auth"), o = T(!1);
1679
- let b;
1806
+ const l = K("webx-auth"), s = W(!1);
1807
+ let g;
1680
1808
  const c = U(() => {
1681
- const x = u.state.manifest?.modules.find((y) => y.id === "connect")?.meta;
1682
- return typeof x?.url == "string" ? x.url : "";
1683
- }), z = U(() => {
1809
+ const y = r.state.manifest?.modules.find((v) => v.id === "connect")?.meta;
1810
+ return typeof y?.url == "string" ? y.url : "";
1811
+ }), A = U(() => {
1684
1812
  try {
1685
1813
  return new URL(c.value).hostname.split(".")[0] || "webx";
1686
1814
  } catch {
1687
1815
  return "webx";
1688
1816
  }
1689
- }), r = U(() => `claude mcp add --transport http ${z.value} ${c.value}`), f = U(() => `[mcp_servers.${z.value}]
1690
- url = "${c.value}"`), F = U(() => {
1691
- const x = g(JSON.stringify({ url: c.value }));
1692
- return `cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(z.value)}&config=${x}`;
1817
+ }), i = U(() => `claude mcp add --transport http ${A.value} ${c.value}`), m = U(() => `[mcp_servers.${A.value}]
1818
+ url = "${c.value}"`), P = U(() => {
1819
+ const y = w(JSON.stringify({ url: c.value }));
1820
+ return `cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(A.value)}&config=${y}`;
1693
1821
  }), p = U(() => {
1694
- const x = JSON.stringify({ name: z.value, type: "http", url: c.value });
1695
- return `vscode:mcp/install?${encodeURIComponent(x)}`;
1822
+ const y = JSON.stringify({ name: A.value, type: "http", url: c.value });
1823
+ return `vscode:mcp/install?${encodeURIComponent(y)}`;
1696
1824
  });
1697
- function g(x) {
1698
- const y = new TextEncoder().encode(x);
1699
- let _ = "";
1700
- for (const L of y) _ += String.fromCharCode(L);
1701
- return encodeURIComponent(btoa(_));
1825
+ function w(y) {
1826
+ const v = new TextEncoder().encode(y);
1827
+ let b = "";
1828
+ for (const S of v) b += String.fromCharCode(S);
1829
+ return encodeURIComponent(btoa(b));
1702
1830
  }
1703
- async function w(x) {
1831
+ async function x(y) {
1704
1832
  try {
1705
1833
  if (navigator.clipboard?.writeText)
1706
- await navigator.clipboard.writeText(x);
1707
- else if (!d(x))
1834
+ await navigator.clipboard.writeText(y);
1835
+ else if (!f(y))
1708
1836
  throw new Error("no clipboard");
1709
- o.value = !0, clearTimeout(b), b = setTimeout(() => o.value = !1, 2e3);
1837
+ s.value = !0, clearTimeout(g), g = setTimeout(() => s.value = !1, 2e3);
1710
1838
  } catch {
1711
- if (d(x)) return;
1712
- Q.danger(l("connect.copy-failed"));
1839
+ if (f(y)) return;
1840
+ j.danger(l("connect.copy-failed"));
1713
1841
  }
1714
1842
  }
1715
- function d(x) {
1716
- const y = document.createElement("textarea");
1717
- y.value = x, y.setAttribute("readonly", ""), y.style.position = "fixed", y.style.opacity = "0", document.body.append(y), y.select();
1843
+ function f(y) {
1844
+ const v = document.createElement("textarea");
1845
+ v.value = y, v.setAttribute("readonly", ""), v.style.position = "fixed", v.style.opacity = "0", document.body.append(v), v.select();
1718
1846
  try {
1719
1847
  return document.execCommand("copy");
1720
1848
  } catch {
1721
1849
  return !1;
1722
1850
  } finally {
1723
- y.remove();
1851
+ v.remove();
1724
1852
  }
1725
1853
  }
1726
- return (x, y) => (h(), V(e(Ne), {
1854
+ return (y, v) => (h(), $(e(Me), {
1727
1855
  title: e(l)("connect.title"),
1728
1856
  card: !1
1729
1857
  }, {
1730
1858
  default: t(() => [
1731
- W("div", Vt, [
1732
- a(e(B), { class: "wx-connect__lead" }, {
1859
+ L("div", Ft, [
1860
+ a(e(R), { class: "wx-connect__lead" }, {
1733
1861
  default: t(() => [
1734
- m(s(e(l)("connect.lead")), 1)
1735
- ]),
1736
- _: 1
1737
- }),
1738
- a(e(Le), { bordered: "" }, {
1739
- default: t(() => [
1740
- a(e(B), {
1741
- size: "xs",
1742
- tone: "muted",
1743
- class: "wx-connect__label"
1744
- }, {
1745
- default: t(() => [
1746
- m(s(e(l)("connect.address")), 1)
1747
- ]),
1748
- _: 1
1749
- }),
1750
- W("div", zt, [
1751
- W("code", Lt, s(c.value), 1),
1752
- a(e(M), {
1753
- type: "primary",
1754
- disabled: c.value === "",
1755
- onClick: y[0] || (y[0] = (_) => w(c.value))
1756
- }, {
1757
- icon: t(() => [
1758
- a(e(Z), {
1759
- name: o.value ? "check" : "copy"
1760
- }, null, 8, ["name"])
1761
- ]),
1762
- default: t(() => [
1763
- m(" " + s(o.value ? e(l)("connect.copied") : e(l)("connect.copy")), 1)
1764
- ]),
1765
- _: 1
1766
- }, 8, ["disabled"])
1767
- ])
1862
+ d(o(e(l)("connect.lead")), 1)
1768
1863
  ]),
1769
1864
  _: 1
1770
1865
  }),
1771
- W("section", St, [
1772
- a(e(he), {
1866
+ L("section", Rt, [
1867
+ a(e(ce), {
1773
1868
  level: 2,
1774
1869
  size: "sm"
1775
1870
  }, {
1776
1871
  default: t(() => [
1777
- m(s(e(l)("connect.how")), 1)
1872
+ d(o(e(l)("connect.address")), 1)
1778
1873
  ]),
1779
1874
  _: 1
1780
1875
  }),
1781
- a(e(st), {
1876
+ a(e(be), { bordered: "" }, {
1877
+ default: t(() => [
1878
+ L("div", Ot, [
1879
+ L("code", Bt, o(c.value), 1),
1880
+ a(e(I), {
1881
+ type: "primary",
1882
+ disabled: c.value === "",
1883
+ onClick: v[0] || (v[0] = (b) => x(c.value))
1884
+ }, {
1885
+ icon: t(() => [
1886
+ a(e(ee), {
1887
+ name: s.value ? "check" : "copy"
1888
+ }, null, 8, ["name"])
1889
+ ]),
1890
+ default: t(() => [
1891
+ d(" " + o(s.value ? e(l)("connect.copied") : e(l)("connect.copy")), 1)
1892
+ ]),
1893
+ _: 1
1894
+ }, 8, ["disabled"])
1895
+ ])
1896
+ ]),
1897
+ _: 1
1898
+ })
1899
+ ]),
1900
+ L("section", Et, [
1901
+ a(e(ce), {
1902
+ level: 2,
1903
+ size: "sm"
1904
+ }, {
1905
+ default: t(() => [
1906
+ d(o(e(l)("connect.how")), 1)
1907
+ ]),
1908
+ _: 1
1909
+ }),
1910
+ a(e(ut), {
1782
1911
  variant: "line",
1783
1912
  "aria-label": e(l)("connect.how")
1784
1913
  }, {
1785
1914
  default: t(() => [
1786
- a(e(me), {
1915
+ a(e(fe), {
1787
1916
  value: "claude",
1788
1917
  label: e(l)("connect.claude-title")
1789
1918
  }, {
1790
1919
  default: t(() => [
1791
- W("ol", Wt, [
1792
- W("li", null, s(e(l)("connect.claude-1")), 1),
1793
- W("li", null, s(e(l)("connect.claude-2")), 1),
1794
- W("li", null, s(e(l)("connect.claude-3")), 1)
1920
+ L("ol", Dt, [
1921
+ L("li", null, o(e(l)("connect.claude-1")), 1),
1922
+ L("li", null, o(e(l)("connect.claude-2")), 1),
1923
+ L("li", null, o(e(l)("connect.claude-3")), 1)
1795
1924
  ])
1796
1925
  ]),
1797
1926
  _: 1
1798
1927
  }, 8, ["label"]),
1799
- a(e(me), {
1928
+ a(e(fe), {
1800
1929
  value: "chatgpt",
1801
1930
  label: e(l)("connect.chatgpt-title")
1802
1931
  }, {
1803
1932
  default: t(() => [
1804
- W("ol", Tt, [
1805
- W("li", null, s(e(l)("connect.chatgpt-1")), 1),
1806
- W("li", null, s(e(l)("connect.chatgpt-2")), 1),
1807
- W("li", null, s(e(l)("connect.chatgpt-3")), 1)
1933
+ L("ol", Mt, [
1934
+ L("li", null, o(e(l)("connect.chatgpt-1")), 1),
1935
+ L("li", null, o(e(l)("connect.chatgpt-2")), 1),
1936
+ L("li", null, o(e(l)("connect.chatgpt-3")), 1)
1808
1937
  ])
1809
1938
  ]),
1810
1939
  _: 1
1811
1940
  }, 8, ["label"]),
1812
- a(e(me), {
1941
+ a(e(fe), {
1813
1942
  value: "claude-code",
1814
1943
  label: e(l)("connect.claude-code-title")
1815
1944
  }, {
1816
1945
  default: t(() => [
1817
- a(e(B), { size: "sm" }, {
1946
+ a(e(R), { size: "sm" }, {
1818
1947
  default: t(() => [
1819
- m(s(e(l)("connect.claude-code-hint")), 1)
1948
+ d(o(e(l)("connect.claude-code-hint")), 1)
1820
1949
  ]),
1821
1950
  _: 1
1822
1951
  }),
1823
- W("div", Ut, [
1824
- W("pre", null, s(r.value), 1),
1825
- a(e(M), {
1952
+ L("div", Nt, [
1953
+ L("pre", null, o(i.value), 1),
1954
+ a(e(I), {
1826
1955
  variant: "text",
1827
1956
  size: "sm",
1828
- onClick: y[1] || (y[1] = (_) => w(r.value))
1957
+ onClick: v[1] || (v[1] = (b) => x(i.value))
1829
1958
  }, {
1830
1959
  icon: t(() => [
1831
- a(e(Z), { name: "copy" })
1960
+ a(e(ee), { name: "copy" })
1832
1961
  ]),
1833
1962
  default: t(() => [
1834
- m(" " + s(e(l)("connect.copy-line")), 1)
1963
+ d(" " + o(e(l)("connect.copy-line")), 1)
1835
1964
  ]),
1836
1965
  _: 1
1837
1966
  })
@@ -1839,29 +1968,29 @@ url = "${c.value}"`), F = U(() => {
1839
1968
  ]),
1840
1969
  _: 1
1841
1970
  }, 8, ["label"]),
1842
- a(e(me), {
1971
+ a(e(fe), {
1843
1972
  value: "codex",
1844
1973
  label: e(l)("connect.codex-title")
1845
1974
  }, {
1846
1975
  default: t(() => [
1847
- a(e(B), { size: "sm" }, {
1976
+ a(e(R), { size: "sm" }, {
1848
1977
  default: t(() => [
1849
- m(s(e(l)("connect.codex-hint")), 1)
1978
+ d(o(e(l)("connect.codex-hint")), 1)
1850
1979
  ]),
1851
1980
  _: 1
1852
1981
  }),
1853
- W("div", Pt, [
1854
- W("pre", null, s(f.value), 1),
1855
- a(e(M), {
1982
+ L("div", It, [
1983
+ L("pre", null, o(m.value), 1),
1984
+ a(e(I), {
1856
1985
  variant: "text",
1857
1986
  size: "sm",
1858
- onClick: y[2] || (y[2] = (_) => w(f.value))
1987
+ onClick: v[2] || (v[2] = (b) => x(m.value))
1859
1988
  }, {
1860
1989
  icon: t(() => [
1861
- a(e(Z), { name: "copy" })
1990
+ a(e(ee), { name: "copy" })
1862
1991
  ]),
1863
1992
  default: t(() => [
1864
- m(" " + s(e(l)("connect.copy-line")), 1)
1993
+ d(" " + o(e(l)("connect.copy-line")), 1)
1865
1994
  ]),
1866
1995
  _: 1
1867
1996
  })
@@ -1873,82 +2002,83 @@ url = "${c.value}"`), F = U(() => {
1873
2002
  _: 1
1874
2003
  }, 8, ["aria-label"])
1875
2004
  ]),
1876
- W("section", Ft, [
1877
- a(e(he), {
2005
+ L("section", qt, [
2006
+ a(e(ce), {
1878
2007
  level: 2,
1879
2008
  size: "sm"
1880
2009
  }, {
1881
2010
  default: t(() => [
1882
- m(s(e(l)("connect.one-click")), 1)
2011
+ d(o(e(l)("connect.one-click")), 1)
1883
2012
  ]),
1884
2013
  _: 1
1885
2014
  }),
1886
- a(e(B), {
2015
+ a(e(R), {
1887
2016
  size: "sm",
1888
2017
  tone: "muted"
1889
2018
  }, {
1890
2019
  default: t(() => [
1891
- m(s(e(l)("connect.one-click-hint")), 1)
2020
+ d(o(e(l)("connect.one-click-hint")), 1)
1892
2021
  ]),
1893
2022
  _: 1
1894
2023
  }),
1895
- W("div", Ot, [
1896
- a(e(M), {
1897
- href: F.value,
2024
+ L("div", Ht, [
2025
+ a(e(I), {
2026
+ href: P.value,
1898
2027
  variant: "outline",
1899
2028
  disabled: c.value === "",
1900
2029
  class: "wx-connect__link"
1901
2030
  }, {
1902
2031
  icon: t(() => [
1903
- a(e(Z), { name: "external-link" })
2032
+ a(e(ee), { name: "external-link" })
1904
2033
  ]),
1905
2034
  default: t(() => [
1906
- m(" " + s(e(l)("connect.install-in", { client: e(l)("connect.cursor-title") })), 1)
2035
+ d(" " + o(e(l)("connect.install-in", { client: e(l)("connect.cursor-title") })), 1)
1907
2036
  ]),
1908
2037
  _: 1
1909
2038
  }, 8, ["href", "disabled"]),
1910
- a(e(M), {
2039
+ a(e(I), {
1911
2040
  href: p.value,
1912
2041
  variant: "outline",
1913
2042
  disabled: c.value === "",
1914
2043
  class: "wx-connect__link"
1915
2044
  }, {
1916
2045
  icon: t(() => [
1917
- a(e(Z), { name: "external-link" })
2046
+ a(e(ee), { name: "external-link" })
1918
2047
  ]),
1919
2048
  default: t(() => [
1920
- m(" " + s(e(l)("connect.install-in", { client: e(l)("connect.vscode-title") })), 1)
2049
+ d(" " + o(e(l)("connect.install-in", { client: e(l)("connect.vscode-title") })), 1)
1921
2050
  ]),
1922
2051
  _: 1
1923
2052
  }, 8, ["href", "disabled"])
1924
2053
  ])
1925
2054
  ]),
1926
- a(e(it), {
2055
+ a(e(ct), {
1927
2056
  type: "info",
1928
2057
  title: e(l)("connect.next")
1929
2058
  }, {
1930
2059
  default: t(() => [
1931
- W("ol", Rt, [
1932
- W("li", null, s(e(l)("connect.next-1")), 1),
1933
- W("li", null, s(e(l)("connect.next-2")), 1),
1934
- W("li", null, s(e(l)("connect.next-3")), 1)
2060
+ L("ol", Kt, [
2061
+ L("li", null, o(e(l)("connect.next-1")), 1),
2062
+ L("li", null, o(e(l)("connect.next-2")), 1),
2063
+ L("li", null, o(e(l)("connect.next-3")), 1)
1935
2064
  ])
1936
2065
  ]),
1937
2066
  _: 1
1938
2067
  }, 8, ["title"]),
1939
- W("section", Bt, [
1940
- a(e(he), {
2068
+ a(Pt),
2069
+ L("section", Yt, [
2070
+ a(e(ce), {
1941
2071
  level: 2,
1942
2072
  size: "sm"
1943
2073
  }, {
1944
2074
  default: t(() => [
1945
- m(s(e(l)("connect.mine")), 1)
2075
+ d(o(e(l)("connect.mine")), 1)
1946
2076
  ]),
1947
2077
  _: 1
1948
2078
  }),
1949
- a(e(Le), { padding: "none" }, {
2079
+ a(e(be), { padding: "none" }, {
1950
2080
  default: t(() => [
1951
- a(qe, { scope: "mine" })
2081
+ a(Je, { scope: "mine" })
1952
2082
  ]),
1953
2083
  _: 1
1954
2084
  })
@@ -1958,42 +2088,42 @@ url = "${c.value}"`), F = U(() => {
1958
2088
  _: 1
1959
2089
  }, 8, ["title"]));
1960
2090
  }
1961
- }), Dt = /* @__PURE__ */ pe(Et, [["__scopeId", "data-v-92d62c98"]]);
1962
- function na(n = {}) {
1963
- const u = n.path ?? "/admins", l = (o) => ({
1964
- render: () => Be(At, {
1965
- base: u,
1966
- current: o,
2091
+ }), Gt = /* @__PURE__ */ ve(jt, [["__scopeId", "data-v-0eba9ed6"]]);
2092
+ function va(n = {}) {
2093
+ const r = n.path ?? "/admins", l = (s) => ({
2094
+ render: () => Be(St, {
2095
+ base: r,
2096
+ current: s,
1967
2097
  avatarField: n.avatarField,
1968
2098
  resolveAvatar: n.resolveAvatar
1969
2099
  })
1970
2100
  });
1971
2101
  return {
1972
2102
  id: "admins",
1973
- path: u,
2103
+ path: r,
1974
2104
  routes: [
1975
- { path: u, name: "webx.admins", component: l("admins") },
2105
+ { path: r, name: "webx.admins", component: l("admins") },
1976
2106
  // What their agents did, and which agents they let in: two more views of the same
1977
2107
  // section, each with an address of its own so that its filters survive a trip to the
1978
2108
  // people and back.
1979
- { path: `${u}/calls`, name: "webx.admins.calls", component: l("calls") },
2109
+ { path: `${r}/calls`, name: "webx.admins.calls", component: l("calls") },
1980
2110
  {
1981
- path: `${u}/connections`,
2111
+ path: `${r}/connections`,
1982
2112
  name: "webx.admins.connections",
1983
2113
  component: l("connections")
1984
2114
  }
1985
2115
  ]
1986
2116
  };
1987
2117
  }
1988
- function oa(n = {}) {
1989
- const u = n.path ?? "/connect";
2118
+ function pa(n = {}) {
2119
+ const r = n.path ?? "/connect";
1990
2120
  return {
1991
2121
  id: "connect",
1992
- path: u,
1993
- routes: [{ path: u, name: "webx.connect", component: Dt }]
2122
+ path: r,
2123
+ routes: [{ path: r, name: "webx.connect", component: Gt }]
1994
2124
  };
1995
2125
  }
1996
- const Nt = /* @__PURE__ */ X({
2126
+ const Jt = /* @__PURE__ */ Q({
1997
2127
  __name: "AdminPicker",
1998
2128
  props: {
1999
2129
  multiple: { type: Boolean, default: !1 },
@@ -2001,30 +2131,30 @@ const Nt = /* @__PURE__ */ X({
2001
2131
  resolveAvatar: { type: Function, default: void 0 }
2002
2132
  },
2003
2133
  setup(n) {
2004
- const u = n, { open: l, resolve: o, dismiss: b } = ge();
2134
+ const r = n, { open: l, resolve: s, dismiss: g } = xe();
2005
2135
  te();
2006
- const c = J("webx-auth"), z = re("list"), r = T(0);
2007
- function f(p) {
2008
- o(p);
2136
+ const c = K("webx-auth"), A = re("list"), i = W(0);
2137
+ function m(p) {
2138
+ s(p);
2009
2139
  }
2010
- function F(p) {
2011
- r.value = p.length;
2140
+ function P(p) {
2141
+ i.value = p.length;
2012
2142
  }
2013
- return (p, g) => (h(), V(e(we), {
2143
+ return (p, w) => (h(), $(e(ke), {
2014
2144
  open: e(l),
2015
- "onUpdate:open": g[2] || (g[2] = (w) => be(l) ? l.value = w : null),
2145
+ "onUpdate:open": w[2] || (w[2] = (x) => ge(l) ? l.value = x : null),
2016
2146
  title: n.title ?? e(c)(n.multiple ? "admins.select-many" : "admins.select-one"),
2017
2147
  width: 880
2018
- }, Re({
2148
+ }, we({
2019
2149
  default: t(() => [
2020
- a(Je, {
2150
+ a(Ge, {
2021
2151
  ref_key: "list",
2022
- ref: z,
2152
+ ref: A,
2023
2153
  picking: "",
2024
2154
  multiple: n.multiple,
2025
- "resolve-avatar": u.resolveAvatar,
2026
- onChosen: f,
2027
- onSelection: F
2155
+ "resolve-avatar": r.resolveAvatar,
2156
+ onChosen: m,
2157
+ onSelection: P
2028
2158
  }, null, 8, ["multiple", "resolve-avatar"])
2029
2159
  ]),
2030
2160
  _: 2
@@ -2032,36 +2162,36 @@ const Nt = /* @__PURE__ */ X({
2032
2162
  n.multiple ? {
2033
2163
  name: "footer",
2034
2164
  fn: t(() => [
2035
- a(e(oe), {
2165
+ a(e(se), {
2036
2166
  size: "sm",
2037
2167
  align: "center"
2038
2168
  }, {
2039
2169
  default: t(() => [
2040
- a(e(B), {
2170
+ a(e(R), {
2041
2171
  size: "sm",
2042
2172
  tone: "muted"
2043
2173
  }, {
2044
2174
  default: t(() => [
2045
- m(s(e(c)("admins.chosen", { count: r.value })), 1)
2175
+ d(o(e(c)("admins.chosen", { count: i.value })), 1)
2046
2176
  ]),
2047
2177
  _: 1
2048
2178
  }),
2049
- a(e(M), {
2179
+ a(e(I), {
2050
2180
  variant: "outline",
2051
- onClick: g[0] || (g[0] = (w) => e(b)())
2181
+ onClick: w[0] || (w[0] = (x) => e(g)())
2052
2182
  }, {
2053
2183
  default: t(() => [
2054
- m(s(e(c)("admins.cancel")), 1)
2184
+ d(o(e(c)("admins.cancel")), 1)
2055
2185
  ]),
2056
2186
  _: 1
2057
2187
  }),
2058
- a(e(M), {
2188
+ a(e(I), {
2059
2189
  type: "primary",
2060
- disabled: r.value === 0,
2061
- onClick: g[1] || (g[1] = (w) => e(o)(z.value?.chosen() ?? []))
2190
+ disabled: i.value === 0,
2191
+ onClick: w[1] || (w[1] = (x) => e(s)(A.value?.chosen() ?? []))
2062
2192
  }, {
2063
2193
  default: t(() => [
2064
- m(s(e(c)("admins.save")), 1)
2194
+ d(o(e(c)("admins.save")), 1)
2065
2195
  ]),
2066
2196
  _: 1
2067
2197
  }, 8, ["disabled"])
@@ -2073,104 +2203,104 @@ const Nt = /* @__PURE__ */ X({
2073
2203
  } : void 0
2074
2204
  ]), 1032, ["open", "title"]));
2075
2205
  }
2076
- }), Qe = $e(Nt);
2077
- async function sa(n = {}) {
2206
+ }), Qe = Ve(Jt);
2207
+ async function fa(n = {}) {
2078
2208
  return (await Qe({ ...n, multiple: !1 }))?.[0];
2079
2209
  }
2080
- function ia(n = {}) {
2210
+ function ha(n = {}) {
2081
2211
  return Qe({ ...n, multiple: !0 });
2082
2212
  }
2083
- const It = { class: "wx-profile-host" }, Mt = { class: "wx-profile" }, Ht = {
2213
+ const Qt = { class: "wx-profile-host" }, Xt = { class: "wx-profile" }, Zt = {
2084
2214
  key: 0,
2085
2215
  class: "wx-profile__aside"
2086
- }, Kt = { class: "wx-profile__fields" }, Yt = /* @__PURE__ */ X({
2216
+ }, ea = { class: "wx-profile__fields" }, ta = /* @__PURE__ */ Q({
2087
2217
  __name: "ProfileDialog",
2088
2218
  props: {
2089
2219
  avatarField: { default: void 0 }
2090
2220
  },
2091
2221
  setup(n) {
2092
- const u = n, { resolve: l, dismiss: o, open: b } = ge(), c = ee(), z = Ae();
2222
+ const r = n, { resolve: l, dismiss: s, open: g } = xe(), c = Z(), A = ze();
2093
2223
  te();
2094
- const r = J("webx-auth"), f = ve(), F = T(!1), p = T({}), g = T({
2224
+ const i = K("webx-auth"), m = me(), P = W(!1), p = W({}), w = W({
2095
2225
  name: c.state.user?.name ?? "",
2096
2226
  avatar: c.state.user?.avatar ?? null,
2097
2227
  password: "",
2098
2228
  current_password: ""
2099
- }), w = T(g.value.avatar ? { path: g.value.avatar } : null);
2100
- function d(y) {
2101
- return p.value[y]?.[0];
2229
+ }), x = W(w.value.avatar ? { path: w.value.avatar } : null);
2230
+ function f(v) {
2231
+ return p.value[v]?.[0];
2102
2232
  }
2103
- async function x() {
2104
- F.value = !0, p.value = {};
2233
+ async function y() {
2234
+ P.value = !0, p.value = {};
2105
2235
  try {
2106
- await z.updateProfile({
2107
- name: g.value.name,
2108
- avatar: w.value?.path ?? null,
2236
+ await A.updateProfile({
2237
+ name: w.value.name,
2238
+ avatar: x.value?.path ?? null,
2109
2239
  // Blank is left out entirely rather than sent as an empty string: the server reads a
2110
2240
  // filled password as "change it", and an empty one would be a change to nothing.
2111
- ...g.value.password ? { password: g.value.password, current_password: g.value.current_password } : {}
2112
- }), Q.success(r("profile.saved")), l(!0);
2113
- } catch (y) {
2114
- const _ = y.body;
2115
- _?.errors ? p.value = _.errors : Q.danger(f(y));
2241
+ ...w.value.password ? { password: w.value.password, current_password: w.value.current_password } : {}
2242
+ }), j.success(i("profile.saved")), l(!0);
2243
+ } catch (v) {
2244
+ const b = v.body;
2245
+ b?.errors ? p.value = b.errors : j.danger(m(v));
2116
2246
  } finally {
2117
- F.value = !1;
2247
+ P.value = !1;
2118
2248
  }
2119
2249
  }
2120
- return (y, _) => (h(), V(e(we), {
2121
- open: e(b),
2122
- "onUpdate:open": _[5] || (_[5] = (L) => be(b) ? b.value = L : null),
2123
- title: e(r)("profile.title"),
2250
+ return (v, b) => (h(), $(e(ke), {
2251
+ open: e(g),
2252
+ "onUpdate:open": b[5] || (b[5] = (S) => ge(g) ? g.value = S : null),
2253
+ title: e(i)("profile.title"),
2124
2254
  width: 560
2125
2255
  }, {
2126
2256
  footer: t(() => [
2127
- a(e(M), {
2128
- onClick: _[4] || (_[4] = (L) => e(o)())
2257
+ a(e(I), {
2258
+ onClick: b[4] || (b[4] = (S) => e(s)())
2129
2259
  }, {
2130
2260
  default: t(() => [
2131
- m(s(e(r)("profile.cancel")), 1)
2261
+ d(o(e(i)("profile.cancel")), 1)
2132
2262
  ]),
2133
2263
  _: 1
2134
2264
  }),
2135
- a(e(M), {
2265
+ a(e(I), {
2136
2266
  type: "primary",
2137
- loading: F.value,
2138
- onClick: x
2267
+ loading: P.value,
2268
+ onClick: y
2139
2269
  }, {
2140
2270
  default: t(() => [
2141
- m(s(e(r)("profile.save")), 1)
2271
+ d(o(e(i)("profile.save")), 1)
2142
2272
  ]),
2143
2273
  _: 1
2144
2274
  }, 8, ["loading"])
2145
2275
  ]),
2146
2276
  default: t(() => [
2147
- W("div", It, [
2148
- W("div", Mt, [
2149
- u.avatarField ? (h(), G("div", Ht, [
2150
- (h(), V(Oe(u.avatarField), {
2151
- modelValue: w.value,
2152
- "onUpdate:modelValue": _[0] || (_[0] = (L) => w.value = L),
2153
- label: e(r)("profile.avatar"),
2277
+ L("div", Qt, [
2278
+ L("div", Xt, [
2279
+ r.avatarField ? (h(), Y("div", Zt, [
2280
+ (h(), $(Oe(r.avatarField), {
2281
+ modelValue: x.value,
2282
+ "onUpdate:modelValue": b[0] || (b[0] = (S) => x.value = S),
2283
+ label: e(i)("profile.avatar"),
2154
2284
  aspect: "1/1",
2155
2285
  captions: !1
2156
2286
  }, null, 8, ["modelValue", "label"]))
2157
- ])) : E("", !0),
2158
- W("div", Kt, [
2159
- a(e(K), {
2160
- label: e(r)("profile.name"),
2161
- error: d("name")
2287
+ ])) : O("", !0),
2288
+ L("div", ea, [
2289
+ a(e(H), {
2290
+ label: e(i)("profile.name"),
2291
+ error: f("name")
2162
2292
  }, {
2163
2293
  default: t(() => [
2164
2294
  a(e(le), {
2165
- modelValue: g.value.name,
2166
- "onUpdate:modelValue": _[1] || (_[1] = (L) => g.value.name = L),
2295
+ modelValue: w.value.name,
2296
+ "onUpdate:modelValue": b[1] || (b[1] = (S) => w.value.name = S),
2167
2297
  name: "name"
2168
2298
  }, null, 8, ["modelValue"])
2169
2299
  ]),
2170
2300
  _: 1
2171
2301
  }, 8, ["label", "error"]),
2172
- a(e(K), {
2173
- label: e(r)("admins.email")
2302
+ a(e(H), {
2303
+ label: e(i)("admins.email")
2174
2304
  }, {
2175
2305
  default: t(() => [
2176
2306
  a(e(le), {
@@ -2180,37 +2310,37 @@ const It = { class: "wx-profile-host" }, Mt = { class: "wx-profile" }, Ht = {
2180
2310
  ]),
2181
2311
  _: 1
2182
2312
  }, 8, ["label"]),
2183
- a(e(K), {
2184
- label: e(r)("profile.password"),
2185
- help: e(r)("profile.password-hint"),
2186
- error: d("password")
2313
+ a(e(H), {
2314
+ label: e(i)("profile.password"),
2315
+ help: e(i)("profile.password-hint"),
2316
+ error: f("password")
2187
2317
  }, {
2188
2318
  default: t(() => [
2189
2319
  a(e(le), {
2190
- modelValue: g.value.password,
2191
- "onUpdate:modelValue": _[2] || (_[2] = (L) => g.value.password = L),
2320
+ modelValue: w.value.password,
2321
+ "onUpdate:modelValue": b[2] || (b[2] = (S) => w.value.password = S),
2192
2322
  type: "password",
2193
2323
  autocomplete: "new-password"
2194
2324
  }, null, 8, ["modelValue"])
2195
2325
  ]),
2196
2326
  _: 1
2197
2327
  }, 8, ["label", "help", "error"]),
2198
- g.value.password ? (h(), V(e(K), {
2328
+ w.value.password ? (h(), $(e(H), {
2199
2329
  key: 0,
2200
- label: e(r)("profile.current-password"),
2201
- help: e(r)("profile.current-password-hint"),
2202
- error: d("current_password")
2330
+ label: e(i)("profile.current-password"),
2331
+ help: e(i)("profile.current-password-hint"),
2332
+ error: f("current_password")
2203
2333
  }, {
2204
2334
  default: t(() => [
2205
2335
  a(e(le), {
2206
- modelValue: g.value.current_password,
2207
- "onUpdate:modelValue": _[3] || (_[3] = (L) => g.value.current_password = L),
2336
+ modelValue: w.value.current_password,
2337
+ "onUpdate:modelValue": b[3] || (b[3] = (S) => w.value.current_password = S),
2208
2338
  type: "password",
2209
2339
  autocomplete: "current-password"
2210
2340
  }, null, 8, ["modelValue"])
2211
2341
  ]),
2212
2342
  _: 1
2213
- }, 8, ["label", "help", "error"])) : E("", !0)
2343
+ }, 8, ["label", "help", "error"])) : O("", !0)
2214
2344
  ])
2215
2345
  ])
2216
2346
  ])
@@ -2218,7 +2348,7 @@ const It = { class: "wx-profile-host" }, Mt = { class: "wx-profile" }, Ht = {
2218
2348
  _: 1
2219
2349
  }, 8, ["open", "title"]));
2220
2350
  }
2221
- }), jt = /* @__PURE__ */ pe(Yt, [["__scopeId", "data-v-9583a67a"]]), Gt = ["title"], Jt = { class: "wx-user-menu__who" }, qt = { class: "wx-user-menu__name" }, Qt = { class: "wx-user-menu__email" }, Xt = /* @__PURE__ */ X({
2351
+ }), aa = /* @__PURE__ */ ve(ta, [["__scopeId", "data-v-9583a67a"]]), la = ["title"], na = { class: "wx-user-menu__who" }, sa = { class: "wx-user-menu__name" }, oa = { class: "wx-user-menu__email" }, ia = /* @__PURE__ */ Q({
2222
2352
  __name: "UserMenu",
2223
2353
  props: {
2224
2354
  signOutLabel: { default: void 0 },
@@ -2227,200 +2357,200 @@ const It = { class: "wx-profile-host" }, Mt = { class: "wx-profile" }, Ht = {
2227
2357
  expanded: { type: Boolean, default: !1 }
2228
2358
  },
2229
2359
  setup(n) {
2230
- const u = n, l = ee(), o = Ae(), b = Ee(), c = at(), z = J("webx-auth"), r = b.scope("webx-admin"), f = U(() => l.state.user), F = U(
2231
- () => b.state.panelLocales.length > 1 ? b.state.panelLocales : []
2232
- ), p = ye(He, null), g = ye(Ke, null), w = T(void 0);
2360
+ const r = n, l = Z(), s = ze(), g = Ee(), c = nt(), A = K("webx-auth"), i = g.scope("webx-admin"), m = U(() => l.state.user), P = U(
2361
+ () => g.state.panelLocales.length > 1 ? g.state.panelLocales : []
2362
+ ), p = ye(qe, null), w = ye(He, null), x = W(void 0);
2233
2363
  ue(
2234
- () => typeof f.value?.avatar == "string" ? f.value.avatar : null,
2235
- async (L) => {
2236
- const $ = u.resolveAvatar ?? p;
2237
- if (L === null || L === "" || $ === null) {
2238
- w.value = void 0;
2364
+ () => typeof m.value?.avatar == "string" ? m.value.avatar : null,
2365
+ async (S) => {
2366
+ const V = r.resolveAvatar ?? p;
2367
+ if (S === null || S === "" || V === null) {
2368
+ x.value = void 0;
2239
2369
  return;
2240
2370
  }
2241
- const O = await $(L);
2242
- f.value?.avatar === L && (w.value = O ?? void 0);
2371
+ const B = await V(S);
2372
+ m.value?.avatar === S && (x.value = B ?? void 0);
2243
2373
  },
2244
2374
  { immediate: !0 }
2245
2375
  );
2246
- const d = $e(jt);
2247
- function x() {
2376
+ const f = Ve(aa);
2377
+ function y() {
2248
2378
  setTimeout(
2249
2379
  () => {
2250
- d({ avatarField: u.avatarField ?? g ?? void 0 });
2380
+ f({ avatarField: r.avatarField ?? w ?? void 0 });
2251
2381
  },
2252
2382
  0
2253
2383
  );
2254
2384
  }
2255
- const y = U({
2385
+ const v = U({
2256
2386
  get: () => c.state.preference,
2257
- set: (L) => {
2258
- c.set(L), o.setTheme(L);
2387
+ set: (S) => {
2388
+ c.set(S), s.setTheme(S);
2259
2389
  }
2260
2390
  });
2261
- async function _(L) {
2262
- L !== b.state.locale && await o.setLocale(L);
2391
+ async function b(S) {
2392
+ S !== g.state.locale && await s.setLocale(S);
2263
2393
  }
2264
- return (L, $) => {
2265
- const O = H("wx-avatar"), i = H("wx-icon"), v = H("wx-text"), A = H("wx-dropdown-item"), I = H("wx-divider"), Y = H("wx-dropdown");
2266
- return f.value !== null ? (h(), V(Y, { key: 0 }, {
2394
+ return (S, V) => {
2395
+ const B = q("wx-avatar"), u = q("wx-icon"), _ = q("wx-text"), z = q("wx-dropdown-item"), N = q("wx-divider"), G = q("wx-dropdown");
2396
+ return m.value !== null ? (h(), $(G, { key: 0 }, {
2267
2397
  trigger: t(() => [
2268
- W("button", {
2398
+ L("button", {
2269
2399
  type: "button",
2270
- class: Fe(["wx-user-menu__trigger", { "wx-user-menu__trigger--named": n.expanded }]),
2271
- title: f.value.name
2400
+ class: Re(["wx-user-menu__trigger", { "wx-user-menu__trigger--named": n.expanded }]),
2401
+ title: m.value.name
2272
2402
  }, [
2273
- a(O, {
2274
- name: f.value.name,
2275
- src: w.value,
2403
+ a(B, {
2404
+ name: m.value.name,
2405
+ src: x.value,
2276
2406
  size: "lg"
2277
2407
  }, null, 8, ["name", "src"]),
2278
- n.expanded ? (h(), G(ce, { key: 0 }, [
2279
- W("span", Jt, [
2280
- W("span", qt, s(f.value.name), 1),
2281
- W("span", Qt, s(f.value.email), 1)
2408
+ n.expanded ? (h(), Y(de, { key: 0 }, [
2409
+ L("span", na, [
2410
+ L("span", sa, o(m.value.name), 1),
2411
+ L("span", oa, o(m.value.email), 1)
2282
2412
  ]),
2283
- a(i, {
2413
+ a(u, {
2284
2414
  name: "chevron-up",
2285
2415
  size: "sm",
2286
2416
  class: "wx-user-menu__chevron"
2287
2417
  })
2288
- ], 64)) : E("", !0)
2289
- ], 10, Gt)
2418
+ ], 64)) : O("", !0)
2419
+ ], 10, la)
2290
2420
  ]),
2291
2421
  default: t(() => [
2292
- a(A, { disabled: "" }, {
2422
+ a(z, { disabled: "" }, {
2293
2423
  default: t(() => [
2294
- a(v, { size: "sm" }, {
2424
+ a(_, { size: "sm" }, {
2295
2425
  default: t(() => [
2296
- m(s(f.value.email), 1)
2426
+ d(o(m.value.email), 1)
2297
2427
  ]),
2298
2428
  _: 1
2299
2429
  })
2300
2430
  ]),
2301
2431
  _: 1
2302
2432
  }),
2303
- a(I, { spacing: "sm" }),
2304
- a(A, {
2433
+ a(N, { spacing: "sm" }),
2434
+ a(z, {
2305
2435
  icon: "user",
2306
- onClick: x
2436
+ onClick: y
2307
2437
  }, {
2308
2438
  default: t(() => [
2309
- m(s(e(z)("profile.menu")), 1)
2439
+ d(o(e(A)("profile.menu")), 1)
2310
2440
  ]),
2311
2441
  _: 1
2312
2442
  }),
2313
- a(I, { spacing: "sm" }),
2314
- a(A, { disabled: "" }, {
2443
+ a(N, { spacing: "sm" }),
2444
+ a(z, { disabled: "" }, {
2315
2445
  default: t(() => [
2316
- a(v, {
2446
+ a(_, {
2317
2447
  size: "sm",
2318
2448
  tone: "muted"
2319
2449
  }, {
2320
2450
  default: t(() => [
2321
- m(s(e(r)("theme.label")), 1)
2451
+ d(o(e(i)("theme.label")), 1)
2322
2452
  ]),
2323
2453
  _: 1
2324
2454
  })
2325
2455
  ]),
2326
2456
  _: 1
2327
2457
  }),
2328
- W("div", {
2458
+ L("div", {
2329
2459
  class: "wx-user-menu__theme",
2330
- onClick: $[1] || ($[1] = Pe(() => {
2460
+ onClick: V[1] || (V[1] = Fe(() => {
2331
2461
  }, ["stop"]))
2332
2462
  }, [
2333
- a(e(rt), {
2334
- modelValue: y.value,
2335
- "onUpdate:modelValue": $[0] || ($[0] = (D) => y.value = D),
2463
+ a(e(dt), {
2464
+ modelValue: v.value,
2465
+ "onUpdate:modelValue": V[0] || (V[0] = (D) => v.value = D),
2336
2466
  size: "sm",
2337
2467
  block: "",
2338
- "aria-label": e(r)("theme.label"),
2339
- "light-label": e(r)("theme.light"),
2340
- "dark-label": e(r)("theme.dark"),
2341
- "system-label": e(r)("theme.system")
2468
+ "aria-label": e(i)("theme.label"),
2469
+ "light-label": e(i)("theme.light"),
2470
+ "dark-label": e(i)("theme.dark"),
2471
+ "system-label": e(i)("theme.system")
2342
2472
  }, null, 8, ["modelValue", "aria-label", "light-label", "dark-label", "system-label"])
2343
2473
  ]),
2344
- F.value.length > 0 ? (h(), G(ce, { key: 0 }, [
2345
- a(I, { spacing: "sm" }),
2346
- a(A, { disabled: "" }, {
2474
+ P.value.length > 0 ? (h(), Y(de, { key: 0 }, [
2475
+ a(N, { spacing: "sm" }),
2476
+ a(z, { disabled: "" }, {
2347
2477
  default: t(() => [
2348
- a(v, {
2478
+ a(_, {
2349
2479
  size: "sm",
2350
2480
  tone: "muted"
2351
2481
  }, {
2352
2482
  default: t(() => [
2353
- m(s(e(z)("menu.language")), 1)
2483
+ d(o(e(A)("menu.language")), 1)
2354
2484
  ]),
2355
2485
  _: 1
2356
2486
  })
2357
2487
  ]),
2358
2488
  _: 1
2359
2489
  }),
2360
- (h(!0), G(ce, null, _e(F.value, (D) => (h(), V(A, {
2490
+ (h(!0), Y(de, null, _e(P.value, (D) => (h(), $(z, {
2361
2491
  key: D.code,
2362
- icon: D.code === e(b).state.locale ? "check" : void 0,
2363
- onClick: (k) => _(D.code)
2492
+ icon: D.code === e(g).state.locale ? "check" : void 0,
2493
+ onClick: (k) => b(D.code)
2364
2494
  }, {
2365
2495
  default: t(() => [
2366
- m(s(D.nativeName), 1)
2496
+ d(o(D.nativeName), 1)
2367
2497
  ]),
2368
2498
  _: 2
2369
2499
  }, 1032, ["icon", "onClick"]))), 128)),
2370
- a(I, { spacing: "sm" })
2371
- ], 64)) : E("", !0),
2372
- a(A, {
2500
+ a(N, { spacing: "sm" })
2501
+ ], 64)) : O("", !0),
2502
+ a(z, {
2373
2503
  icon: "logout",
2374
- onClick: $[2] || ($[2] = (D) => e(o).logout())
2504
+ onClick: V[2] || (V[2] = (D) => e(s).logout())
2375
2505
  }, {
2376
2506
  default: t(() => [
2377
- m(s(n.signOutLabel ?? e(z)("menu.sign-out")), 1)
2507
+ d(o(n.signOutLabel ?? e(A)("menu.sign-out")), 1)
2378
2508
  ]),
2379
2509
  _: 1
2380
2510
  })
2381
2511
  ]),
2382
2512
  _: 1
2383
- })) : E("", !0);
2513
+ })) : O("", !0);
2384
2514
  };
2385
2515
  }
2386
- }), ra = /* @__PURE__ */ pe(Xt, [["__scopeId", "data-v-09f012fd"]]);
2387
- function ua(n = {}) {
2388
- const u = n.path ?? "/login";
2516
+ }), ya = /* @__PURE__ */ ve(ia, [["__scopeId", "data-v-09f012fd"]]);
2517
+ function _a(n = {}) {
2518
+ const r = n.path ?? "/login";
2389
2519
  return {
2390
2520
  install(l) {
2391
- const o = ut(l.context);
2392
- l.i18n.defaults("webx-auth", Ge), ct(
2521
+ const s = mt(l.context);
2522
+ l.i18n.defaults("webx-auth", je), vt(
2393
2523
  l.app,
2394
- o,
2395
- n.resolveAvatar ?? je(l.context),
2396
- n.avatarField ?? Ye(l.context)
2397
- ), l.context.useSessionLoader(() => o.me()), l.router.addRoute({
2398
- path: u,
2524
+ s,
2525
+ n.resolveAvatar ?? Ye(l.context),
2526
+ n.avatarField ?? Ke(l.context)
2527
+ ), l.context.useSessionLoader(() => s.me()), l.router.addRoute({
2528
+ path: r,
2399
2529
  name: "webx.login",
2400
2530
  meta: { public: !0 },
2401
- component: { render: () => Be(pt, { ...n.card }) }
2402
- }), l.router.beforeEach((b) => b.meta.public === !0 || l.context.state.status !== "unauthenticated" ? !0 : { path: u, query: b.fullPath === "/" ? {} : { next: b.fullPath } }), ue(
2531
+ component: { render: () => Be(yt, { ...n.card }) }
2532
+ }), l.router.beforeEach((g) => g.meta.public === !0 || l.context.state.status !== "unauthenticated" ? !0 : { path: r, query: g.fullPath === "/" ? {} : { next: g.fullPath } }), ue(
2403
2533
  () => l.context.state.status,
2404
- (b) => {
2534
+ (g) => {
2405
2535
  const c = l.router.currentRoute.value;
2406
- if (b === "unauthenticated" && c.path !== u) {
2407
- l.router.replace({ path: u, query: { next: c.fullPath } });
2536
+ if (g === "unauthenticated" && c.path !== r) {
2537
+ l.router.replace({ path: r, query: { next: c.fullPath } });
2408
2538
  return;
2409
2539
  }
2410
- if (b === "ready" && c.path === u) {
2411
- const z = c.query.next;
2412
- if (typeof z == "string" && Zt(z)) {
2413
- location.assign(z);
2540
+ if (g === "ready" && c.path === r) {
2541
+ const A = c.query.next;
2542
+ if (typeof A == "string" && ra(A)) {
2543
+ location.assign(A);
2414
2544
  return;
2415
2545
  }
2416
- l.router.replace(typeof z == "string" ? z : "/");
2546
+ l.router.replace(typeof A == "string" ? A : "/");
2417
2547
  }
2418
2548
  }
2419
2549
  );
2420
2550
  }
2421
2551
  };
2422
2552
  }
2423
- function Zt(n) {
2553
+ function ra(n) {
2424
2554
  if (!/^https?:\/\//i.test(n))
2425
2555
  return !1;
2426
2556
  try {
@@ -2430,27 +2560,27 @@ function Zt(n) {
2430
2560
  }
2431
2561
  }
2432
2562
  export {
2433
- Je as WxAdminList,
2434
- At as WxAdminsPage,
2435
- kt as WxAgentCallList,
2436
- Dt as WxConnectPage,
2437
- qe as WxConnectionList,
2438
- pt as WxLoginCard,
2439
- jt as WxProfileDialog,
2440
- ra as WxUserMenu,
2441
- na as admins,
2442
- ua as auth,
2443
- Me as authKey,
2444
- Ge as authMessages,
2445
- Ke as avatarFieldKey,
2446
- He as avatarResolverKey,
2447
- oa as connect,
2448
- fe as createAdminsApi,
2449
- ut as createAuthSession,
2450
- Ct as createConnectionsApi,
2451
- ct as provideAuth,
2452
- sa as selectAdmin,
2453
- ia as selectAdmins,
2454
- Ae as useAuth
2563
+ Ge as WxAdminList,
2564
+ St as WxAdminsPage,
2565
+ Vt as WxAgentCallList,
2566
+ Gt as WxConnectPage,
2567
+ Je as WxConnectionList,
2568
+ yt as WxLoginCard,
2569
+ aa as WxProfileDialog,
2570
+ ya as WxUserMenu,
2571
+ va as admins,
2572
+ _a as auth,
2573
+ Ie as authKey,
2574
+ je as authMessages,
2575
+ He as avatarFieldKey,
2576
+ qe as avatarResolverKey,
2577
+ pa as connect,
2578
+ he as createAdminsApi,
2579
+ mt as createAuthSession,
2580
+ zt as createConnectionsApi,
2581
+ vt as provideAuth,
2582
+ fa as selectAdmin,
2583
+ ha as selectAdmins,
2584
+ ze as useAuth
2455
2585
  };
2456
2586
  //# sourceMappingURL=index.js.map