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