@wssto2/vue-core 0.9.4 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/ActionRow.vue_vue_type_script_setup_true_lang-DybAIOHS.js +64 -0
  3. package/dist/Activity-CdkJW68R.js +169 -0
  4. package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-DdJOodn8.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-D5i77H6S.js} +147 -159
  5. package/dist/{AsyncSection.vue_vue_type_script_setup_true_lang-BdeOKqz_.js → AsyncSection.vue_vue_type_script_setup_true_lang-DGzQ-Snp.js} +1 -1
  6. package/dist/BottomDockPortal.vue_vue_type_script_setup_true_lang-DmwR-2SP.js +17 -0
  7. package/dist/Button.vue_vue_type_script_setup_true_lang-C74hcb0N.js +123 -0
  8. package/dist/Changes-DxK_QfiB.js +69 -0
  9. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-DHcekGNn.js → CollectionPage.vue_vue_type_script_setup_true_lang-x0jyJ01f.js} +19 -18
  10. package/dist/{DataTable.vue_vue_type_script_setup_true_lang-8kBsNRuq.js → DataTable.vue_vue_type_script_setup_true_lang-C_ZytnW-.js} +1 -1
  11. package/dist/{DateField.vue_vue_type_script_setup_true_lang-BhKdCVFn.js → DateField.vue_vue_type_script_setup_true_lang-CeNwBbJT.js} +1 -1
  12. package/dist/{DeadLetters-Bb5pPlOY.js → DeadLetters-DnA7LP1w.js} +5 -6
  13. package/dist/DrawnCheck.vue_vue_type_script_setup_true_lang-9DzDJlIA.js +38 -0
  14. package/dist/FormGroup.vue_vue_type_script_setup_true_lang-D6jYfNjW.js +427 -0
  15. package/dist/{FormView.vue_vue_type_script_setup_true_lang-aaNnMIOi.js → FormView.vue_vue_type_script_setup_true_lang-DvbPEiNQ.js} +2 -2
  16. package/dist/{General-BAG7S6wV.js → General-2matxl2Y.js} +23 -24
  17. package/dist/Highlight.vue_vue_type_script_setup_true_lang-DZGBmwcX.js +29 -0
  18. package/dist/{IncidentRecord-D8aOpNHo.js → IncidentRecord-Bt3G4HlX.js} +14 -15
  19. package/dist/{IncidentsList-C0cFl0Db.js → IncidentsList-2iwgqp9J.js} +3 -3
  20. package/dist/{Modal.vue_vue_type_script_setup_true_lang-BlHhdmMy.js → Modal.vue_vue_type_script_setup_true_lang-DDS0iEnn.js} +9 -8
  21. package/dist/{NewRolePage-C6Iu-EQJ.js → NewRolePage-DhGFwvk3.js} +4 -4
  22. package/dist/{NumberField.vue_vue_type_script_setup_true_lang-TGGAq8J-.js → NumberField.vue_vue_type_script_setup_true_lang-B3UrXNqH.js} +1 -1
  23. package/dist/{PersonAccess.vue_vue_type_script_setup_true_lang-qz1tmYpF.js → PersonAccess.vue_vue_type_script_setup_true_lang-DbGZSNQc.js} +56 -56
  24. package/dist/ProfilePage-CpuyDBAv.js +685 -0
  25. package/dist/ProgressTrack.vue_vue_type_script_setup_true_lang-DrOm8k--.js +30 -0
  26. package/dist/{RecordHeader.vue_vue_type_script_setup_true_lang-B9mN7UxZ.js → RecordHeader.vue_vue_type_script_setup_true_lang-DqGc3Jyo.js} +1 -1
  27. package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-Cw8mGf_B.js → ResourcePage.vue_vue_type_script_setup_true_lang-DljhsTU4.js} +3 -3
  28. package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-CJPvOVDV.js → RoleEditor.vue_vue_type_script_setup_true_lang-C0FIotFA.js} +11 -12
  29. package/dist/{RolePage-Dj_ocMnM.js → RolePage-DaNv049g.js} +10 -10
  30. package/dist/{RolesPage-PXrs4O-1.js → RolesPage-6hlzJes_.js} +6 -6
  31. package/dist/SearchInput.vue_vue_type_script_setup_true_lang-w4eAqyZ9.js +32 -0
  32. package/dist/{SectionList.vue_vue_type_script_setup_true_lang-CtdF1zuv.js → SectionList.vue_vue_type_script_setup_true_lang-DR0_NsqC.js} +1 -1
  33. package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-B5ove3rM.js → SectionNavigator.vue_vue_type_script_setup_true_lang-Dh3sXUt_.js} +2 -2
  34. package/dist/{SegmentedField.vue_vue_type_script_setup_true_lang-ChfDFAA2.js → SegmentedField.vue_vue_type_script_setup_true_lang-zv_AxpBn.js} +1 -1
  35. package/dist/{SelectField.vue_vue_type_script_setup_true_lang-BP8nAQwo.js → SelectField.vue_vue_type_script_setup_true_lang-BZwdANL3.js} +3 -3
  36. package/dist/{ServiceAccountDialog.vue_vue_type_script_setup_true_lang-aWkKwxNe.js → ServiceAccountDialog.vue_vue_type_script_setup_true_lang-FJbWxME_.js} +20 -20
  37. package/dist/{ServiceAccountRecord-bxX9yQkC.js → ServiceAccountRecord-0-JF5lRx.js} +24 -24
  38. package/dist/{ServiceAccountsList-BXE6htxk.js → ServiceAccountsList-DcsnOcf-.js} +32 -32
  39. package/dist/{Sessions--Gvc0kxw.js → Sessions-DgWhpk-i.js} +23 -24
  40. package/dist/{SettingsPage-DzDC7gD-.js → SettingsPage-BXPWATYU.js} +28 -30
  41. package/dist/{SignIn-CTI_699e.js → SignIn-DPoUwHZd.js} +9 -10
  42. package/dist/{SignInPage-HKC1bm2E.js → SignInPage-OyrVemro.js} +4 -4
  43. package/dist/SignIns-BMDrZVVp.js +64 -0
  44. package/dist/StatusLine.vue_vue_type_script_setup_true_lang-DsdQmLq6.js +56 -0
  45. package/dist/{SwitchField.vue_vue_type_script_setup_true_lang-BMA2YXTZ.js → SwitchField.vue_vue_type_script_setup_true_lang-Ds4q0bbl.js} +1 -1
  46. package/dist/{TextField.vue_vue_type_script_setup_true_lang-BFVsqcBX.js → TextField.vue_vue_type_script_setup_true_lang-CWIeeZRE.js} +2 -2
  47. package/dist/{TextareaField.vue_vue_type_script_setup_true_lang-Dyh4Hhyl.js → TextareaField.vue_vue_type_script_setup_true_lang-D2j4s96s.js} +1 -1
  48. package/dist/{TimeField.vue_vue_type_script_setup_true_lang-gGFfQLuK.js → TimeField.vue_vue_type_script_setup_true_lang-D-Em4glH.js} +1 -1
  49. package/dist/UserRecord-BW-gdCqi.js +202 -0
  50. package/dist/UsersList-B3ZF_1Dj.js +74 -0
  51. package/dist/access/index.js +4 -4
  52. package/dist/app/index.d.ts +1 -0
  53. package/dist/app/index.js +11 -10
  54. package/dist/app/languages.d.ts +8 -0
  55. package/dist/{application-BmXW6iW_.js → application-CuzT-0vW.js} +1 -1
  56. package/dist/button/index.js +6 -5
  57. package/dist/collection/Highlight.vue.d.ts +12 -0
  58. package/dist/collection/PickerModal.vue.d.ts +26 -0
  59. package/dist/collection/definition.d.ts +6 -6
  60. package/dist/collection/http.d.ts +6 -6
  61. package/dist/collection/index.d.ts +6 -1
  62. package/dist/collection/index.js +145 -85
  63. package/dist/collection/picker.d.ts +39 -0
  64. package/dist/collection/types.d.ts +9 -4
  65. package/dist/collection/useCollection.d.ts +5 -5
  66. package/dist/content/ActivityStream.vue.d.ts +62 -0
  67. package/dist/content/CommentThread.vue.d.ts +52 -0
  68. package/dist/content/Composer.vue.d.ts +36 -0
  69. package/dist/content/index.d.ts +3 -0
  70. package/dist/content/index.js +321 -56
  71. package/dist/controls/index.js +28 -54
  72. package/dist/form/index.js +132 -134
  73. package/dist/format/index.d.ts +1 -0
  74. package/dist/format/index.js +10 -6
  75. package/dist/format/slug.d.ts +8 -0
  76. package/dist/http-Dm0uXY9O.js +95 -0
  77. package/dist/i18n/index.d.ts +15 -0
  78. package/dist/i18n/index.js +89 -63
  79. package/dist/i18n/plural.d.ts +23 -0
  80. package/dist/i18n/serverMessages.d.ts +16 -0
  81. package/dist/identity/embed.d.ts +39 -0
  82. package/dist/identity/index.d.ts +22 -1
  83. package/dist/identity/index.js +40 -21
  84. package/dist/identity/session.d.ts +9 -1
  85. package/dist/identity/shared/ChangeFeed.vue.d.ts +6 -3
  86. package/dist/identity/users/context.d.ts +11 -0
  87. package/dist/identity/users/dialogs.d.ts +10 -0
  88. package/dist/identity/users/ext.d.ts +8 -0
  89. package/dist/identity/users/feature.d.ts +22 -1
  90. package/dist/identity/users/list.d.ts +12 -1
  91. package/dist/identity/users/personSections.d.ts +15 -6
  92. package/dist/identity/users/replace.d.ts +45 -0
  93. package/dist/identity/users/words.d.ts +28 -0
  94. package/dist/incidents/api.d.ts +1 -1
  95. package/dist/incidents/index.js +1 -1
  96. package/dist/{index-Dz0LkLM8.js → index-ClJeyW3F.js} +4 -4
  97. package/dist/index-Cq9TuOqH.js +1264 -0
  98. package/dist/{index-Dm-sdJJr.js → index-kEHY7hcG.js} +31 -32
  99. package/dist/index.d.ts +1 -1
  100. package/dist/index.js +1 -1
  101. package/dist/keepAlive-ClGnsIzT.js +55 -0
  102. package/dist/modal/index.js +3 -3
  103. package/dist/modules/identity/entities.d.ts +7 -0
  104. package/dist/modules/identity/routes.d.ts +8 -4
  105. package/dist/modules/identity/schemas.d.ts +16 -0
  106. package/dist/{neighbors-DVfU9T0o.js → neighbors-OyvGi233.js} +2 -2
  107. package/dist/notifications/deadletters/list.d.ts +1 -1
  108. package/dist/notifications/index.js +1 -1
  109. package/dist/{options-QuOkMKVZ.js → options-B48UiYsG.js} +2 -2
  110. package/dist/page/index.js +11 -11
  111. package/dist/phone/index.js +1 -1
  112. package/dist/pwa/AndroidInstallBanner.vue.d.ts +18 -0
  113. package/dist/pwa/InstallQrSheet.vue.d.ts +21 -0
  114. package/dist/pwa/IosInstallGuide.vue.d.ts +19 -0
  115. package/dist/pwa/QrCode.vue.d.ts +16 -0
  116. package/dist/pwa/index.d.ts +4 -0
  117. package/dist/pwa/index.js +244 -24
  118. package/dist/resource/index.js +1 -1
  119. package/dist/rowLayout-BsKEzEME.js +650 -0
  120. package/dist/shell/DarkModeRow.vue.d.ts +15 -0
  121. package/dist/shell/OfflineNotice.vue.d.ts +2 -0
  122. package/dist/shell/QuickSearchButton.vue.d.ts +2 -0
  123. package/dist/shell/QuickSearchPalette.vue.d.ts +12 -0
  124. package/dist/shell/darkMode.d.ts +26 -0
  125. package/dist/shell/index.d.ts +10 -0
  126. package/dist/shell/index.js +954 -579
  127. package/dist/shell/offlineNotice.d.ts +3 -0
  128. package/dist/shell/quickSearch.d.ts +14 -0
  129. package/dist/shell/quickSearchControl.d.ts +69 -0
  130. package/dist/shortcut-DUR6yPWA.js +93 -0
  131. package/dist/state/BackgroundTaskCapsule.vue.d.ts +18 -0
  132. package/dist/state/backgroundTasks.d.ts +58 -0
  133. package/dist/state/index.d.ts +4 -0
  134. package/dist/state/index.js +194 -80
  135. package/dist/state/useCountUp.d.ts +9 -0
  136. package/dist/styles.css +1 -1
  137. package/dist/{suggestions-BVQhoXzS.js → suggestions-q_v3M7G6.js} +1 -1
  138. package/dist/testing/collection.d.ts +1 -1
  139. package/dist/{useCommand-Dc8Lgs9h.js → useCommand-Ch_nx1AQ.js} +4 -4
  140. package/dist/{useGroupSheet-DQ6cVG-z.js → useGroupSheet-CPjHydQV.js} +14 -15
  141. package/dist/{useRecordDialog-BTsbHY38.js → useRecordDialog-DdkauXnU.js} +1 -1
  142. package/dist/{useResourceForm-DJ4Q75pq.js → useResourceForm-Dl6YFYyz.js} +1 -1
  143. package/package.json +3 -2
  144. package/dist/ActionRow.vue_vue_type_script_setup_true_lang-Cg1lhpcA.js +0 -45
  145. package/dist/Activity-29hsZ28j.js +0 -156
  146. package/dist/Button.vue_vue_type_script_setup_true_lang-Dp7OB-eF.js +0 -192
  147. package/dist/Changes-Dxjdkd_5.js +0 -129
  148. package/dist/FormErrors.vue_vue_type_script_setup_true_lang-CIggKPtq.js +0 -295
  149. package/dist/FormGroup.vue_vue_type_script_setup_true_lang-B37dixvJ.js +0 -137
  150. package/dist/PageBar.vue_vue_type_script_setup_true_lang-qI94fjJv.js +0 -47
  151. package/dist/ProfilePage-BnohZIEg.js +0 -764
  152. package/dist/ProgressTrack.vue_vue_type_script_setup_true_lang-B6Prw9hi.js +0 -64
  153. package/dist/SectionIntro.vue_vue_type_script_setup_true_lang-CZtPrmXD.js +0 -23
  154. package/dist/SessionList.vue_vue_type_script_setup_true_lang-Cnyt5V8T.js +0 -133
  155. package/dist/SignIns-BcqBgWgN.js +0 -121
  156. package/dist/UserRecord-CtUPpbCt.js +0 -267
  157. package/dist/UsersList-BMkIgIg8.js +0 -155
  158. package/dist/definition-C7QuyV3i.js +0 -54
  159. package/dist/http-nz92KjdS.js +0 -42
  160. package/dist/identity/fieldMessages.d.ts +0 -15
  161. package/dist/identity/users/languages.d.ts +0 -4
  162. package/dist/index-CdtofdcJ.js +0 -501
  163. package/dist/keepAlive-z3IRFkQq.js +0 -46
  164. package/dist/languages-BShG9LpE.js +0 -10
  165. package/dist/rowLayout-CT8vWYgI.js +0 -663
  166. package/dist/signInEvents-DWShrJox.js +0 -30
  167. package/dist/status-BRA14qwX.js +0 -34
  168. package/dist/useWaitStatus-fsacMl4W.js +0 -24
  169. /package/dist/{fieldMessages-B6GHgi40.js → serverMessages-B6GHgi40.js} +0 -0
@@ -0,0 +1,1264 @@
1
+ import { r as h } from "./route-goWMxDUN.js";
2
+ import { d as se, p as oe } from "./feature-DdUAfyi4.js";
3
+ import { k as Ie, u as Le } from "./keepAlive-ClGnsIzT.js";
4
+ import { d as Y } from "./defineRoutes-BGAdiIrt.js";
5
+ import { d as B } from "./context-Ch1r4fdN.js";
6
+ import { defineComponent as E, computed as A, watch as te, openBlock as m, createElementBlock as k, ref as ie, useTemplateRef as Re, watchEffect as Ke, onBeforeUnmount as Ue, createVNode as v, unref as t, createElementVNode as g, toDisplayString as _, createCommentVNode as S, createBlock as w, useId as je, Teleport as ze, normalizeClass as ce, createTextVNode as T, withCtx as p, mergeProps as R, h as qe, Fragment as U, renderList as W, createSlots as fe, renderSlot as Fe } from "vue";
7
+ import { a as F } from "./error-CD7x0Jrz.js";
8
+ import { u as ge } from "./environment-Dva-SG8D.js";
9
+ import { u as G } from "./describeError-B-NMa--w.js";
10
+ import { t as j } from "./toast-CqSDTWRX.js";
11
+ import { u as I, h as H, f as ne } from "./platform-BQOX_Ntw.js";
12
+ import { useI18n as C } from "vue-i18n";
13
+ import { _ as _e } from "./Icon.vue_vue_type_script_lang-BhhsFYwp.js";
14
+ import { useRouter as he, useRoute as Ne, RouterLink as De } from "vue-router";
15
+ import { _ as ve } from "./AccountMenuItem.vue_vue_type_script_setup_true_lang-BIYgaihv.js";
16
+ import { _ as z } from "./Button.vue_vue_type_script_setup_true_lang-C74hcb0N.js";
17
+ import { u as Be } from "./leaveGuard-Cc8yeLxM.js";
18
+ import { _ as Ge } from "./FormView.vue_vue_type_script_setup_true_lang-DvbPEiNQ.js";
19
+ import { _ as K } from "./TextField.vue_vue_type_script_setup_true_lang-CWIeeZRE.js";
20
+ import { u as Ve } from "./mediaQuery-CygcXmFW.js";
21
+ import { u as Me } from "./useDialog-DfNmqM-0.js";
22
+ import { c as We } from "./closeOverlays-CjVsIrpL.js";
23
+ import { u as He, a as V } from "./FormGroup.vue_vue_type_script_setup_true_lang-D6jYfNjW.js";
24
+ import { u as J } from "./format-D8KUBmbS.js";
25
+ import { b as Xe } from "./routeResource-DlTsGTg_.js";
26
+ import { _ as D } from "./IconTile.vue_vue_type_script_setup_true_lang-BmxCuUZ9.js";
27
+ import { g as q } from "./options-B48UiYsG.js";
28
+ import { u as ye, _ as be } from "./useCommand-Ch_nx1AQ.js";
29
+ import { u as we } from "./serverMessages-B6GHgi40.js";
30
+ import { _ as Ye } from "./SelectField.vue_vue_type_script_setup_true_lang-BZwdANL3.js";
31
+ import { d as Je, r as Qe } from "./http-Dm0uXY9O.js";
32
+ import { z as i } from "zod";
33
+ import "./ActionRow.vue_vue_type_script_setup_true_lang-DybAIOHS.js";
34
+ import { _ as X } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
35
+ import { _ as Ze } from "./DataTable.vue_vue_type_script_setup_true_lang-C_ZytnW-.js";
36
+ import { _ as et } from "./Avatar.vue_vue_type_script_setup_true_lang-BPj_fkJR.js";
37
+ import { _ as tt } from "./AccessGate.vue_vue_type_script_setup_true_lang-CzQbD2Pc.js";
38
+ import "./routes-Beyr5NQo.js";
39
+ const P = {
40
+ login: h("POST", "/v1/auth/login", { public: !0 }),
41
+ refresh: h("POST", "/v1/auth/refresh", { public: !0 }),
42
+ logout: h("POST", "/v1/auth/logout"),
43
+ me: h("GET", "/v1/auth/me"),
44
+ changeLocale: h("POST", "/v1/auth/change-locale"),
45
+ loginAs: h("POST", "/v1/auth/login-as"),
46
+ loginAsReturn: h("POST", "/v1/auth/login-as/return"),
47
+ usersList: h("GET", "/v1/iam/users", { permission: "iam.user:view" }),
48
+ usersShow: h("GET", "/v1/iam/users/:id", { permission: "iam.user:view" }),
49
+ usersCreate: h("POST", "/v1/iam/users", { permission: "iam.user:manage" }),
50
+ usersUpdate: h("PUT", "/v1/iam/users/:id", { permission: "iam.user:manage" }),
51
+ usersSetPassword: h("PUT", "/v1/iam/users/:id/password", { permission: "iam.user:manage" }),
52
+ usersDeactivate: h("POST", "/v1/iam/users/:id/deactivate", { permission: "iam.user:manage" }),
53
+ usersActivate: h("POST", "/v1/iam/users/:id/activate", { permission: "iam.user:manage" }),
54
+ usersUnlock: h("POST", "/v1/iam/users/:id/unlock", { permission: "iam.user:manage" }),
55
+ usersSignins: h("GET", "/v1/iam/users/:id/signins", { permission: "iam.user:view" }),
56
+ usersChanges: h("GET", "/v1/iam/users/:id/changes", { permission: "iam.user:view" }),
57
+ usersActivity: h("GET", "/v1/iam/users/:id/activity", { permission: "iam.user.activity:view" }),
58
+ usersSessions: h("GET", "/v1/iam/users/:id/sessions", { permission: "iam.user:view" }),
59
+ usersRevokeSession: h("DELETE", "/v1/iam/users/:id/sessions/:session_id", { permission: "iam.user:manage" }),
60
+ usersRevokeSessions: h("DELETE", "/v1/iam/users/:id/sessions", { permission: "iam.user:manage" }),
61
+ profileShow: h("GET", "/v1/iam/profile"),
62
+ profileUpdate: h("PUT", "/v1/iam/profile"),
63
+ profileChangePassword: h("PUT", "/v1/iam/profile/password"),
64
+ profileRequestEmail: h("POST", "/v1/iam/profile/email"),
65
+ profileResendEmail: h("POST", "/v1/iam/profile/email/resend"),
66
+ profileConfirmEmail: h("POST", "/v1/iam/profile/email/confirm"),
67
+ profileCancelEmail: h("DELETE", "/v1/iam/profile/email"),
68
+ profileSignins: h("GET", "/v1/iam/profile/signins"),
69
+ profileSessions: h("GET", "/v1/iam/profile/sessions"),
70
+ profileRevokeSession: h("DELETE", "/v1/iam/profile/sessions/:session_id")
71
+ }, [nt, xe] = B("vue-core.identity"), Q = (e) => F(e) && e.kind === "unauthorized";
72
+ function st(e) {
73
+ if (!F(e) || e.code !== "identity.signin.locked") return null;
74
+ const n = e.params?.locked_until, o = typeof n == "string" ? new Date(n) : null;
75
+ return o && !Number.isNaN(o.getTime()) ? o : null;
76
+ }
77
+ async function ot({ http: e, session: n }, o) {
78
+ await e.request(P.login, o, { handleUnauthorized: !1 }), await ae({ session: n });
79
+ }
80
+ async function ae({ session: e }) {
81
+ const n = await e.refresh();
82
+ if (n.status === "failed") throw n.error;
83
+ if (n.status !== "authenticated") throw new Error("The server accepted the request but reports nobody signed in.");
84
+ }
85
+ async function it(e, n) {
86
+ await e.http.request(P.loginAs, { user_id: n }), await ae(e);
87
+ }
88
+ async function at(e) {
89
+ await e.http.request(P.loginAsReturn), await ae(e);
90
+ }
91
+ const rt = { hidden: "" }, ct = /* @__PURE__ */ E({
92
+ __name: "LocaleSync",
93
+ setup(e) {
94
+ const { http: n, session: o } = I(), s = ge(), a = G(), c = A(() => {
95
+ const r = o.state.value, l = r.status === "authenticated" ? r.user.locale : void 0;
96
+ return typeof l == "string" ? l : null;
97
+ });
98
+ let d = null;
99
+ return te(c, async (r) => {
100
+ d = r, r !== null && r !== s.locale.value && s.locales.includes(r) && await s.setLocale(r);
101
+ }, { immediate: !0 }), te(s.locale, async (r) => {
102
+ if (!(o.state.value.status !== "authenticated" || r === d))
103
+ try {
104
+ await n.request(P.changeLocale, { locale: r }), d = r;
105
+ } catch (l) {
106
+ if (Q(l)) return;
107
+ j.error(a(l)), F(l) && l.code === "identity.locale.unsupported" && d !== null && await s.setLocale(d);
108
+ }
109
+ }), (r, l) => (m(), k("span", rt));
110
+ }
111
+ });
112
+ function ke() {
113
+ const e = I(), n = he(), { home: o } = xe(), s = G(), a = ie(!1), c = A(() => H(e.session.state.value)?.impersonator != null);
114
+ async function d() {
115
+ a.value = !0;
116
+ try {
117
+ await at(e), await n.push(o);
118
+ } catch (r) {
119
+ Q(r) || j.error(s(r)), e.session.refresh();
120
+ } finally {
121
+ a.value = !1;
122
+ }
123
+ }
124
+ return { impersonating: c, returning: a, leave: d };
125
+ }
126
+ const lt = { class: "min-w-0 flex-1" }, ut = { class: "hidden md:inline" }, dt = { class: "md:hidden" }, mt = ["disabled"], pt = /* @__PURE__ */ E({
127
+ __name: "ImpersonationBanner",
128
+ setup(e) {
129
+ const { t: n } = C(), o = I(), { returning: s, leave: a } = ke(), c = A(() => H(o.session.state.value)?.impersonator ?? null), d = A(() => {
130
+ const u = H(o.session.state.value)?.user;
131
+ return typeof u?.name == "string" ? u.name : typeof u?.login == "string" ? u.login : String(u?.id ?? "");
132
+ }), r = Re("strip");
133
+ let l = null;
134
+ return Ke(() => {
135
+ l?.disconnect(), l = null;
136
+ const u = r.value;
137
+ if (!u) return void document.documentElement.style.removeProperty("--shell-banner-h");
138
+ if (typeof ResizeObserver > "u") return;
139
+ const f = () => document.documentElement.style.setProperty("--shell-banner-h", `${u.offsetHeight}px`);
140
+ l = new ResizeObserver(f), l.observe(u), f();
141
+ }, { flush: "post" }), Ue(() => {
142
+ l?.disconnect(), document.documentElement.style.removeProperty("--shell-banner-h");
143
+ }), (u, f) => c.value ? (m(), k("div", {
144
+ key: 0,
145
+ ref_key: "strip",
146
+ ref: r,
147
+ role: "status",
148
+ "data-impersonation-banner": "",
149
+ class: "sticky top-0 z-40 flex flex-wrap items-center gap-x-3 gap-y-1.5 bg-status-warning-surface px-4 py-2 text-subheadline text-status-warning-content shadow-[inset_0_-1px_0_rgb(154_74_7/0.25)]"
150
+ }, [
151
+ v(t(_e), {
152
+ name: "informationLine",
153
+ size: 18,
154
+ class: "shrink-0 compact:hidden"
155
+ }),
156
+ g("span", lt, [
157
+ g("span", ut, _(t(n)("core.identity.impersonation.banner", { name: d.value })), 1),
158
+ g("span", dt, _(t(n)("core.identity.impersonation.banner_short", { name: d.value })), 1)
159
+ ]),
160
+ g("button", {
161
+ type: "button",
162
+ disabled: t(s),
163
+ class: "hit-target cursor-pointer rounded-control bg-status-warning-solid px-3 py-1 text-footnote font-semibold whitespace-nowrap text-white transition duration-motion-fast hover:brightness-110 disabled:opacity-45",
164
+ onClick: f[0] || (f[0] = //@ts-ignore
165
+ (...b) => t(a) && t(a)(...b))
166
+ }, _(t(n)("core.identity.impersonation.return")), 9, mt)
167
+ ], 512)) : S("", !0);
168
+ }
169
+ }), ft = /* @__PURE__ */ E({
170
+ __name: "ReturnMenuItem",
171
+ setup(e) {
172
+ const { t: n } = C(), { impersonating: o, leave: s } = ke();
173
+ return (a, c) => t(o) ? (m(), w(ve, {
174
+ key: 0,
175
+ label: t(n)("core.identity.impersonation.return"),
176
+ icon: "logoutBoxRLine",
177
+ "data-return-menu-item": "",
178
+ onClick: t(s)
179
+ }, null, 8, ["label", "onClick"])) : S("", !0);
180
+ }
181
+ });
182
+ function gt(e = {}) {
183
+ const { t: n } = C(), o = I(), s = J(), a = G(), d = He({
184
+ defaults: () => ({ login: e.login ?? "", password: "" }),
185
+ validator: {
186
+ safeParse(l) {
187
+ const u = l, f = ["login", "password"].filter((b) => u[b] === "").map((b) => ({ path: [b], message: n("core.identity.signin.required") }));
188
+ return f.length === 0 ? { success: !0, data: u } : { success: !1, error: { issues: f } };
189
+ }
190
+ },
191
+ failureMessage(l, u) {
192
+ const f = st(u);
193
+ return f ? n("core.errors.identity.signin.locked", { locked_until: s.time(f) }) : F(u) ? a(u) : void 0;
194
+ }
195
+ }), r = A(() => d.errors.first("password") ?? (d.failure.value?.error ? d.failure.value.message : void 0));
196
+ return { form: d, passwordError: r, submit: async () => (await d.submit((l) => ot(o, l))).status === "saved" };
197
+ }
198
+ const _t = ["aria-labelledby"], ht = ["id"], vt = { class: "mt-1 text-subheadline text-content-muted" }, yt = { class: "flex items-center gap-2 rounded-control bg-status-success-surface px-2.5 py-2 text-footnote text-status-success-content" }, bt = { class: "flex flex-col gap-1.5" }, wt = { class: "text-footnote text-content-muted" }, xt = {
199
+ class: "rounded-control bg-fill px-2.5 py-2 text-body text-content-muted",
200
+ "data-expiry-login": ""
201
+ }, kt = /* @__PURE__ */ E({
202
+ __name: "SessionExpiry",
203
+ setup(e) {
204
+ const { t: n } = C(), { session: o } = I(), s = Ne(), a = Be(), c = G(), d = Ve(), r = je(), l = A(() => {
205
+ const $ = o.state.value, O = $.status === "anonymous" && $.reason === "expired" ? $.previous?.user : void 0;
206
+ return typeof O?.login == "string" ? O.login : null;
207
+ }), u = A(() => l.value !== null && s.meta.public !== !0), f = ie(null), b = Me(f, { onEscape: () => {
208
+ } }), { isOpen: x } = b, { form: y, passwordError: N, submit: M } = gt({ login: l.value ?? "" });
209
+ te(u, ($) => {
210
+ $ ? (y.hydrate({ login: l.value ?? "", password: "" }), We(), j.dismiss(), b.present()) : b.dismissWithoutAsking();
211
+ }, { immediate: !0, flush: "post" });
212
+ async function L() {
213
+ if (!(a.hasUnsavedChanges() && !await a.confirm()))
214
+ try {
215
+ await o.signOut();
216
+ } catch ($) {
217
+ Q($) || j.error(c($));
218
+ }
219
+ }
220
+ return ($, O) => (m(), w(ze, { to: "body" }, [
221
+ t(x) ? (m(), k("div", {
222
+ key: 0,
223
+ class: "relative z-10000",
224
+ role: "alertdialog",
225
+ "aria-modal": "true",
226
+ "aria-labelledby": t(r),
227
+ "data-session-expiry": ""
228
+ }, [
229
+ O[0] || (O[0] = g("div", {
230
+ class: "fixed inset-0 bg-scrim",
231
+ "aria-hidden": "true"
232
+ }, null, -1)),
233
+ g("div", {
234
+ class: ce(["fixed inset-0 flex p-4", t(d) ? "items-end p-0" : "items-center justify-center"])
235
+ }, [
236
+ g("div", {
237
+ ref_key: "panel",
238
+ ref: f,
239
+ tabindex: "-1",
240
+ class: ce(["flex w-full flex-col gap-4 bg-surface-overlay p-6 shadow-float outline-none", t(d) ? "rounded-t-2xl pb-[max(2rem,var(--app-safe-bottom))]" : "max-w-sm rounded-menu"])
241
+ }, [
242
+ g("div", null, [
243
+ g("h2", {
244
+ id: t(r),
245
+ class: "text-headline font-semibold text-content-strong"
246
+ }, _(t(n)("core.identity.expired.title")), 9, ht),
247
+ g("p", vt, _(t(n)("core.identity.expired.body")), 1)
248
+ ]),
249
+ g("p", yt, [
250
+ v(t(_e), {
251
+ name: "checkboxCircleFill",
252
+ size: 16,
253
+ class: "shrink-0"
254
+ }),
255
+ T(" " + _(t(n)("core.identity.expired.kept")), 1)
256
+ ]),
257
+ v(t(Ge), { onSubmit: t(M) }, {
258
+ default: p(() => [
259
+ g("div", bt, [
260
+ g("span", wt, _(t(n)("core.identity.username")), 1),
261
+ g("span", xt, _(l.value), 1)
262
+ ]),
263
+ v(t(K), R(t(y).bind("password"), {
264
+ label: t(n)("core.identity.signin.password"),
265
+ type: "password",
266
+ autocomplete: "current-password",
267
+ required: "",
268
+ error: t(N)
269
+ }), null, 16, ["label", "error"]),
270
+ v(t(z), {
271
+ type: "submit",
272
+ prominence: "primary",
273
+ class: "w-full",
274
+ processing: t(y).submitting.value
275
+ }, {
276
+ default: p(() => [
277
+ T(_(t(n)("core.identity.signin.submit")), 1)
278
+ ]),
279
+ _: 1
280
+ }, 8, ["processing"])
281
+ ]),
282
+ _: 1
283
+ }, 8, ["onSubmit"]),
284
+ v(t(z), {
285
+ prominence: "plain",
286
+ class: "self-center",
287
+ onClick: L
288
+ }, {
289
+ default: p(() => [
290
+ T(_(t(n)("core.identity.expired.sign_out")), 1)
291
+ ]),
292
+ _: 1
293
+ })
294
+ ], 2)
295
+ ], 2)
296
+ ], 8, _t)) : S("", !0)
297
+ ]));
298
+ }
299
+ }), St = Y({
300
+ login: { name: "login", path: "/login", component: () => import("./SignInPage-OyrVemro.js"), meta: { public: !0, titleKey: "core.identity.signin.title" } }
301
+ });
302
+ function Xn(e = {}) {
303
+ return se({
304
+ id: "identity",
305
+ routes: St.records,
306
+ context: oe(nt, { home: e.home ?? "/" }),
307
+ holdsExpiredSession: !0,
308
+ contributions: [
309
+ // Not optional: a shell without a `host` could not ask for the password, and the person would be stuck on a dead page.
310
+ { id: "identity.expiry", slot: "host", component: kt, scope: "always" },
311
+ // Not optional either: acting as somebody else must always be visible.
312
+ { id: "identity.impersonation", slot: "banner", component: pt, scope: "authenticated" },
313
+ // The same way out in the account menu (a shell without that slot shows only the banner's button).
314
+ { id: "identity.return", slot: "accountMenu", component: ft, scope: "authenticated", optional: !0, order: -20 },
315
+ { id: "identity.locale", slot: "host", component: ct, scope: "authenticated", optional: !0 }
316
+ ],
317
+ effects: [Ie()]
318
+ });
319
+ }
320
+ const Et = (e) => F(e) && e.kind === "unauthorized";
321
+ function Yn(e = {}) {
322
+ const n = e.tokenKey ?? "embed_access_token", o = e.expiresKey ?? "embed_expires_at", s = () => {
323
+ try {
324
+ return e.storage ?? sessionStorage;
325
+ } catch {
326
+ return null;
327
+ }
328
+ }, a = (d) => {
329
+ try {
330
+ return s()?.getItem(d) ?? null;
331
+ } catch {
332
+ return null;
333
+ }
334
+ };
335
+ return {
336
+ start(d, r) {
337
+ try {
338
+ s()?.setItem(n, d), s()?.setItem(o, r);
339
+ } catch {
340
+ }
341
+ },
342
+ end() {
343
+ try {
344
+ s()?.removeItem(n), s()?.removeItem(o);
345
+ } catch {
346
+ }
347
+ },
348
+ token: () => a(n),
349
+ active: () => a(n) !== null,
350
+ expired() {
351
+ const d = a(o);
352
+ return d === null || new Date(d) <= /* @__PURE__ */ new Date();
353
+ }
354
+ };
355
+ }
356
+ const $t = (e) => () => {
357
+ const n = e.token();
358
+ return n ? { Authorization: `Bearer ${n}` } : {};
359
+ };
360
+ function Tt(e, n, o, s) {
361
+ return {
362
+ async load(a) {
363
+ if (!s.active()) return e.load(a);
364
+ if (s.expired())
365
+ return s.end(), null;
366
+ try {
367
+ const { data: c } = await n.request(P.me, void 0, { signal: a, handleUnauthorized: !1 });
368
+ return ne(c, o);
369
+ } catch (c) {
370
+ if (!Et(c)) throw c;
371
+ return s.end(), null;
372
+ }
373
+ },
374
+ async signOut() {
375
+ try {
376
+ await e.signOut();
377
+ } finally {
378
+ s.end();
379
+ }
380
+ }
381
+ };
382
+ }
383
+ const Ct = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Pt = (e) => {
384
+ if (!Ct(e)) throw new TypeError("expected an object");
385
+ if (typeof e.id != "number") throw new TypeError("id: expected a number");
386
+ for (const n of ["login", "name", "email", "locale"])
387
+ if (typeof e[n] != "string") throw new TypeError(`${n}: expected a string`);
388
+ return { id: e.id, login: e.login, name: e.name, email: e.email, locale: e.locale };
389
+ }, ee = (e) => F(e) && e.kind === "unauthorized", Se = (e, n) => e.request(P.refresh, { refresh_token: "" }, { signal: n, handleUnauthorized: !1 });
390
+ function Ot(e, n) {
391
+ return {
392
+ async load(o) {
393
+ try {
394
+ const { data: s } = await e.request(P.me, void 0, { signal: o, handleUnauthorized: !1 });
395
+ return ne(s, n);
396
+ } catch (s) {
397
+ if (!ee(s)) throw s;
398
+ }
399
+ try {
400
+ const { data: s } = await Se(e, o);
401
+ return ne(s, n);
402
+ } catch (s) {
403
+ if (ee(s)) return null;
404
+ throw s;
405
+ }
406
+ },
407
+ async signOut() {
408
+ try {
409
+ await e.request(P.logout, void 0, { handleUnauthorized: !1 });
410
+ } catch (o) {
411
+ if (!ee(o)) throw o;
412
+ }
413
+ }
414
+ };
415
+ }
416
+ function Jn(e) {
417
+ const n = e?.parseUser ?? Pt, o = e?.embed;
418
+ return {
419
+ session: (a) => {
420
+ const c = Ot(a, n);
421
+ return o ? Tt(c, a, n, o) : c;
422
+ },
423
+ ...(o || e?.renewable) && { renewable: () => !o?.active() && (e?.renewable?.() ?? !0) },
424
+ ...o && { headers: $t(o), onSessionExpired: o.end },
425
+ async renewSession(a, c) {
426
+ try {
427
+ return await Se(c), (await a.refresh()).status === "authenticated";
428
+ } catch {
429
+ return !1;
430
+ }
431
+ }
432
+ };
433
+ }
434
+ const Ee = Y({
435
+ index: { name: "profile", path: "/profile", component: () => import("./ProfilePage-CpuyDBAv.js"), meta: { titleKey: "core.profile.title" } }
436
+ }), At = /* @__PURE__ */ E({
437
+ __name: "ProfileMenuItem",
438
+ setup(e) {
439
+ const { t: n } = C();
440
+ return (o, s) => (m(), w(ve, {
441
+ label: t(n)("core.profile.menu"),
442
+ icon: "user3Line",
443
+ to: t(Ee).index,
444
+ "data-profile-menu-item": ""
445
+ }, null, 8, ["label", "to"]));
446
+ }
447
+ }), [It, $e] = B("vue-core.users"), Lt = Symbol("vue-core.users.person"), [Qn, Zn] = B("vue-core.users.personActions"), [es, ts] = B("vue-core.users.personSessions"), le = ["general", "signin", "sessions", "signins", "changes", "activity"];
448
+ function ue(e, n) {
449
+ const o = E({
450
+ name: `PersonSection(${e.path})`,
451
+ setup() {
452
+ const s = Xe(Lt);
453
+ return () => s.data.value ? qe(e.component, e.props?.(s.data.value) ?? {}) : null;
454
+ }
455
+ });
456
+ return { name: `users.record.${e.path}`, path: e.path, component: o, meta: { ...e.meta, ...n !== void 0 && { section: { ...e.meta.section, groupKey: n } } } };
457
+ }
458
+ function Rt(e, n) {
459
+ for (const { path: s, after: a } of n)
460
+ if (a !== void 0 && !le.includes(a))
461
+ throw new Error(`usersFeature: the section "${s}" is placed after "${a}", which is not a section of a person's record (${le.join(", ")}).`);
462
+ const o = (s) => n.filter((a) => a.after === s.path).map((a) => ue(a, s.meta?.section?.groupKey));
463
+ return [...e.flatMap((s) => [s, ...o(s)]), ...n.filter((s) => s.after === void 0).map((s) => ue(s))];
464
+ }
465
+ const de = "iam.user:view", ns = "iam.user:manage", Kt = "iam.user.activity:view", Te = Y({
466
+ index: { name: "users.index", path: "/users", component: () => import("./UsersList-B3ZF_1Dj.js"), meta: { access: de, titleKey: "core.users.title" } },
467
+ record: {
468
+ name: "users.record",
469
+ path: "/users/:id",
470
+ component: () => import("./UserRecord-BW-gdCqi.js"),
471
+ meta: { access: de, titleKey: "core.users.title", remountOnParam: "id" },
472
+ children: [
473
+ { name: "users.record.general", path: "general", component: () => import("./General-2matxl2Y.js"), meta: { section: { labelKey: "core.users.sections.general", icon: "user3Line", groupKey: "core.users.section_groups.person" } } },
474
+ { name: "users.record.signin", path: "signin", component: () => import("./SignIn-DPoUwHZd.js"), meta: { section: { labelKey: "core.users.sections.signin", icon: "key2Line", groupKey: "core.users.section_groups.access" } } },
475
+ { name: "users.record.sessions", path: "sessions", component: () => import("./Sessions-DgWhpk-i.js"), meta: { section: { labelKey: "core.users.sections.sessions", icon: "deviceLine", groupKey: "core.users.section_groups.access" } } },
476
+ { name: "users.record.signins", path: "signins", component: () => import("./SignIns-BMDrZVVp.js"), meta: { section: { labelKey: "core.users.sections.signins", icon: "timeFill", groupKey: "core.users.section_groups.activity" } } },
477
+ { name: "users.record.changes", path: "changes", component: () => import("./Changes-DxK_QfiB.js"), meta: { section: { labelKey: "core.users.sections.changes", icon: "edit", groupKey: "core.users.section_groups.activity" } } },
478
+ { name: "users.record.activity", path: "activity", component: () => import("./Activity-CdkJW68R.js"), meta: { access: Kt, section: { labelKey: "core.users.sections.activity", icon: "listCheck", groupKey: "core.users.section_groups.activity" } } }
479
+ ]
480
+ }
481
+ });
482
+ function Ut(e, n, o) {
483
+ return Te.records.map((s) => {
484
+ if (s.name === "users.index") return { ...s, path: e, ...n.list && { component: n.list } };
485
+ if (s.name !== "users.record") return s;
486
+ const a = (s.children ?? []).map((c) => c.name === "users.record.general" && n.general ? { ...c, component: n.general } : c);
487
+ return { ...s, path: `${e}/:id`, children: Rt(a, o) };
488
+ });
489
+ }
490
+ function ss(e = {}) {
491
+ const n = e.people ?? !0, o = e.profile ?? !0, s = e.signInAs ?? "iam.user:impersonate", a = e.replace ?? {}, c = (e.path ?? "/users").replace(/\/+$/, "") || "/users";
492
+ return se({
493
+ id: "users",
494
+ routes: [...n ? Ut(c, a, e.sections ?? []) : [], ...o ? Ee.records : []],
495
+ context: oe(It, {
496
+ signInAs: s,
497
+ activityAreas: e.activityAreas ?? {},
498
+ profileSections: e.profileSections ?? [],
499
+ replace: a,
500
+ collection: e.collection,
501
+ activityRecords: e.activityRecords ?? {},
502
+ changeWords: e.changeWords
503
+ }),
504
+ navigation: n && e.destination ? [{ destination: e.destination, to: Te.index, within: ["users.record"] }] : [],
505
+ // The entry of the account menu; a shell without that menu leaves it out.
506
+ contributions: o ? [{ id: "users.profile", slot: "accountMenu", component: At, scope: "authenticated", optional: !0, order: -10 }] : [],
507
+ requires: n && s !== !1 ? ["identity"] : []
508
+ });
509
+ }
510
+ const jt = /* @__PURE__ */ E({
511
+ __name: "DeactivateDialog",
512
+ props: {
513
+ id: {},
514
+ name: {},
515
+ sessionCount: {}
516
+ },
517
+ emits: ["done"],
518
+ setup(e, { expose: n, emit: o }) {
519
+ const s = e, a = o, { t: c } = C(), { http: d } = I(), r = ye({
520
+ ...we(),
521
+ defaults: () => ({}),
522
+ run: () => d.request(P.usersDeactivate, { id: s.id }),
523
+ done: () => {
524
+ j.success(c("core.users.deactivate.done", { name: s.name })), a("done");
525
+ }
526
+ });
527
+ return n({ open: () => r.present() }), (l, u) => (m(), w(t(be), {
528
+ command: t(r),
529
+ title: t(c)("core.users.deactivate.title"),
530
+ subtitle: s.name,
531
+ "confirm-label": t(c)("core.users.actions.deactivate_short"),
532
+ "busy-label": t(c)("core.users.deactivate.busy"),
533
+ "done-label": t(c)("core.users.deactivate.done_label"),
534
+ size: "md"
535
+ }, {
536
+ default: p(() => [
537
+ v(t(V), { "data-deactivate-dialog": "" }, {
538
+ default: p(() => [
539
+ v(t(q), {
540
+ layout: "setting",
541
+ label: t(c)("core.users.deactivate.signs_out", { n: s.sessionCount ?? 0 }),
542
+ sub: t(c)("core.users.deactivate.signs_out_sub")
543
+ }, {
544
+ leading: p(() => [
545
+ v(t(D), {
546
+ tone: "anchor",
547
+ icon: "logoutBoxRLine"
548
+ })
549
+ ]),
550
+ _: 1
551
+ }, 8, ["label", "sub"]),
552
+ v(t(q), {
553
+ layout: "setting",
554
+ label: t(c)("core.users.deactivate.cannot_sign_in"),
555
+ sub: t(c)("core.users.deactivate.cannot_sign_in_sub")
556
+ }, {
557
+ leading: p(() => [
558
+ v(t(D), {
559
+ tone: "anchor",
560
+ icon: "lockLine"
561
+ })
562
+ ]),
563
+ _: 1
564
+ }, 8, ["label", "sub"])
565
+ ]),
566
+ _: 1
567
+ })
568
+ ]),
569
+ _: 1
570
+ }, 8, ["command", "title", "subtitle", "confirm-label", "busy-label", "done-label"]));
571
+ }
572
+ }), zt = /* @__PURE__ */ E({
573
+ __name: "NewUserDialog",
574
+ emits: ["created"],
575
+ setup(e, { expose: n, emit: o }) {
576
+ const { t: s } = C(), { http: a } = I(), c = ge(), d = we(), r = Le(), l = () => ({ login: "", name: "", email: "", phone: "", locale: c.locale.value, password: "", repeat: "" }), u = (y) => y.trim() === "", f = {
577
+ safeParse(y) {
578
+ const { repeat: N, locale: M, ...L } = y, $ = s("core.account.validation.required"), O = ["login", "name", "email", "password"].filter((Z) => u(L[Z])).map((Z) => ({ path: [Z], message: $ }));
579
+ return M === null && O.push({ path: ["locale"], message: $ }), !u(L.password) && N !== L.password && O.push({ path: ["repeat"], message: u(N) ? $ : s("core.account.validation.mismatch") }), O.length > 0 ? { success: !1, error: { issues: O } } : { success: !0, data: { ...L, locale: M ?? "", phone: u(L.phone) ? void 0 : L.phone } };
580
+ }
581
+ }, b = o, x = ye({
582
+ ...d,
583
+ defaults: l,
584
+ validator: f,
585
+ run: async (y) => (await a.request(P.usersCreate, y)).data,
586
+ done: (y) => {
587
+ j.success(s("core.users.create.done", { name: y.name })), b("created", y);
588
+ }
589
+ });
590
+ return n({ create: () => x.present() }), (y, N) => (m(), w(t(be), {
591
+ command: t(x),
592
+ title: t(s)("core.users.create.title"),
593
+ subtitle: t(s)("core.users.create.subtitle"),
594
+ "confirm-label": t(s)("core.users.create.action"),
595
+ size: "md"
596
+ }, {
597
+ default: p(() => [
598
+ v(t(V), { "label-width": "11rem" }, {
599
+ default: p(() => [
600
+ v(t(K), R(t(x).form.bind("name"), {
601
+ label: t(s)("core.users.fields.name"),
602
+ required: "",
603
+ autocomplete: "off"
604
+ }), null, 16, ["label"]),
605
+ v(t(K), R(t(x).form.bind("login"), {
606
+ label: t(s)("core.users.fields.login"),
607
+ required: "",
608
+ mono: "",
609
+ autocomplete: "off"
610
+ }), null, 16, ["label"]),
611
+ v(t(K), R(t(x).form.bind("password"), {
612
+ label: t(s)("core.users.fields.password"),
613
+ type: "password",
614
+ required: "",
615
+ autocomplete: "new-password"
616
+ }), null, 16, ["label"]),
617
+ v(t(K), R(t(x).form.bind("repeat"), {
618
+ label: t(s)("core.users.fields.password_repeat"),
619
+ type: "password",
620
+ required: "",
621
+ autocomplete: "new-password"
622
+ }), null, 16, ["label"]),
623
+ v(t(K), R(t(x).form.bind("email"), {
624
+ label: t(s)("core.users.fields.email"),
625
+ type: "email",
626
+ required: "",
627
+ autocomplete: "off"
628
+ }), null, 16, ["label"]),
629
+ v(t(K), R(t(x).form.bind("phone"), {
630
+ label: t(s)("core.users.fields.phone"),
631
+ type: "tel",
632
+ autocomplete: "off"
633
+ }), null, 16, ["label"]),
634
+ v(t(Ye), R(t(x).form.bind("locale"), {
635
+ label: t(s)("core.users.fields.locale"),
636
+ options: t(r),
637
+ required: ""
638
+ }), null, 16, ["label", "options"])
639
+ ]),
640
+ _: 1
641
+ })
642
+ ]),
643
+ _: 1
644
+ }, 8, ["command", "title", "subtitle", "confirm-label"]));
645
+ }
646
+ });
647
+ function os() {
648
+ const { replace: e } = $e();
649
+ return { newUser: e.newUser ?? zt, deactivate: e.deactivate ?? jt };
650
+ }
651
+ i.object({
652
+ id: i.number().int(),
653
+ area: i.string().max(32).optional(),
654
+ from: i.string().max(10).optional(),
655
+ to: i.string().max(10).optional(),
656
+ page: i.number().int().optional(),
657
+ per_page: i.number().int().optional()
658
+ });
659
+ i.object({
660
+ locale: i.string().min(1).max(16)
661
+ });
662
+ i.object({
663
+ current_password: i.string().min(1).max(200),
664
+ new_password: i.string().min(1).max(200),
665
+ new_password_confirmation: i.string().min(1).max(200)
666
+ });
667
+ const qt = i.enum(["all", "access", "details"]);
668
+ i.object({
669
+ id: i.number().int(),
670
+ view: qt.optional(),
671
+ page: i.number().int().optional(),
672
+ per_page: i.number().int().optional()
673
+ });
674
+ i.object({
675
+ code: i.string().min(1).max(12)
676
+ });
677
+ i.object({
678
+ login: i.string().min(1).max(100),
679
+ name: i.string().min(1).max(150),
680
+ email: i.string().min(1).max(255),
681
+ phone: i.string().max(30).optional(),
682
+ locale: i.string().min(1).max(16),
683
+ password: i.string().min(1).max(200),
684
+ ext: i.unknown().optional()
685
+ });
686
+ i.object({
687
+ id: i.number().int(),
688
+ details: i.unknown().optional()
689
+ });
690
+ const Ce = i.enum(["never", "idle"]), Ft = i.enum(["active", "locked", "inactive", "all"]);
691
+ i.object({
692
+ view: Ft.optional(),
693
+ search: i.string().max(100).optional(),
694
+ order_col: i.string().max(16).optional(),
695
+ order_dir: i.string().max(4).optional(),
696
+ page: i.number().int().optional(),
697
+ per_page: i.number().int().optional(),
698
+ last_sign_in: Ce.optional()
699
+ });
700
+ i.object({
701
+ user_id: i.number().int().refine((e) => e !== 0, { params: { code: "required" } })
702
+ });
703
+ i.object({
704
+ login: i.string().min(1).max(100),
705
+ password: i.string().min(1).max(200)
706
+ });
707
+ i.object({
708
+ session_id: i.number().int()
709
+ });
710
+ const Pe = i.enum(["all", "failed"]);
711
+ i.object({
712
+ view: Pe.optional(),
713
+ page: i.number().int().optional(),
714
+ per_page: i.number().int().optional()
715
+ });
716
+ i.object({
717
+ refresh_token: i.string().max(255)
718
+ });
719
+ i.object({
720
+ email: i.string().min(1).max(255),
721
+ current_password: i.string().min(1).max(200)
722
+ });
723
+ i.object({
724
+ id: i.number().int(),
725
+ password: i.string().min(1).max(200)
726
+ });
727
+ i.object({
728
+ id: i.number().int(),
729
+ view: Pe.optional(),
730
+ page: i.number().int().optional(),
731
+ per_page: i.number().int().optional()
732
+ });
733
+ i.object({
734
+ name: i.string().min(1).max(150),
735
+ phone: i.string().max(30).optional()
736
+ });
737
+ i.object({
738
+ id: i.number().int(),
739
+ login: i.string().min(1).max(100),
740
+ name: i.string().min(1).max(150),
741
+ email: i.string().min(1).max(255),
742
+ phone: i.string().max(30).optional(),
743
+ locale: i.string().min(1).max(16),
744
+ ext: i.unknown().optional()
745
+ });
746
+ i.object({
747
+ id: i.number().int()
748
+ });
749
+ i.object({
750
+ id: i.number().int(),
751
+ session_id: i.number().int()
752
+ });
753
+ const Nt = ["active", "locked", "inactive", "all"];
754
+ function Dt(e) {
755
+ return Je({
756
+ id: "identity.users",
757
+ stateVersion: 1,
758
+ load: async (n, { signal: o }) => {
759
+ const s = await e.request(
760
+ P.usersList,
761
+ {
762
+ view: n.view ?? void 0,
763
+ search: n.search || void 0,
764
+ order_col: n.sort ?? void 0,
765
+ order_dir: n.sort ? n.direction : void 0,
766
+ page: n.page,
767
+ per_page: n.pageSize,
768
+ last_sign_in: Ce.safeParse(n.filters.last_sign_in).data
769
+ },
770
+ { signal: o }
771
+ );
772
+ return Qe(s, n);
773
+ },
774
+ key: (n) => n.id,
775
+ query: { sorts: ["login", "name", "email", "created_at"], filters: ["last_sign_in"], views: Nt },
776
+ defaults: { sort: "name", direction: "asc", view: "active" }
777
+ });
778
+ }
779
+ function is() {
780
+ const { collection: e } = $e(), { http: n } = I();
781
+ return e ?? Dt(n);
782
+ }
783
+ const as = (e) => e === "locked" ? "critical" : e === "inactive" ? "neutral" : "positive", Bt = {
784
+ key: 0,
785
+ class: "flex items-center justify-between gap-3 px-row-inset text-footnote text-content-muted",
786
+ "data-page-bar": ""
787
+ }, Gt = { class: "flex gap-2" }, rs = /* @__PURE__ */ E({
788
+ __name: "PageBar",
789
+ props: {
790
+ page: {},
791
+ lastPage: {},
792
+ total: {}
793
+ },
794
+ emits: ["update:page"],
795
+ setup(e, { emit: n }) {
796
+ const o = e, s = n, { t: a } = C();
797
+ return (c, d) => o.lastPage > 1 ? (m(), k("div", Bt, [
798
+ g("span", null, _(t(a)("core.collection.page.page_of", { current: o.page, total: o.lastPage })) + " · " + _(o.total), 1),
799
+ g("span", Gt, [
800
+ v(t(z), {
801
+ size: "sm",
802
+ disabled: o.page <= 1,
803
+ onClick: d[0] || (d[0] = (r) => s("update:page", o.page - 1))
804
+ }, {
805
+ default: p(() => [
806
+ T(_(t(a)("core.collection.page.previous")), 1)
807
+ ]),
808
+ _: 1
809
+ }, 8, ["disabled"]),
810
+ v(t(z), {
811
+ size: "sm",
812
+ disabled: o.page >= o.lastPage,
813
+ onClick: d[1] || (d[1] = (r) => s("update:page", o.page + 1))
814
+ }, {
815
+ default: p(() => [
816
+ T(_(t(a)("core.collection.page.next")), 1)
817
+ ]),
818
+ _: 1
819
+ }, 8, ["disabled"])
820
+ ])
821
+ ])) : S("", !0);
822
+ }
823
+ }), Vt = {
824
+ class: "flex flex-col gap-y-0.5 md:flex-row md:flex-wrap md:items-center md:gap-x-1.5",
825
+ "data-session-facts": ""
826
+ }, Mt = {
827
+ key: 0,
828
+ class: "font-mono"
829
+ }, Wt = {
830
+ key: 1,
831
+ "aria-hidden": "true",
832
+ class: "hidden md:inline"
833
+ }, Ht = {
834
+ key: 0,
835
+ class: "mt-1 flex flex-wrap gap-1"
836
+ }, cs = /* @__PURE__ */ E({
837
+ __name: "SessionList",
838
+ props: {
839
+ sessions: {},
840
+ canEnd: { type: Boolean },
841
+ header: {},
842
+ footer: {}
843
+ },
844
+ emits: ["end"],
845
+ setup(e, { emit: n }) {
846
+ const o = e, s = n, { t: a } = C(), c = J();
847
+ return (d, r) => (m(), w(t(V), {
848
+ header: o.header,
849
+ footer: o.footer
850
+ }, {
851
+ default: p(() => [
852
+ o.sessions.length === 0 ? (m(), w(t(q), {
853
+ key: 0,
854
+ layout: "setting",
855
+ label: t(a)("core.account.sessions.empty")
856
+ }, null, 8, ["label"])) : S("", !0),
857
+ (m(!0), k(U, null, W(o.sessions, (l) => (m(), w(t(q), {
858
+ key: l.id,
859
+ layout: "setting",
860
+ label: l.device || t(a)("core.account.sessions.unknown_device"),
861
+ "data-session": l.id
862
+ }, fe({
863
+ leading: p(() => [
864
+ v(t(D), {
865
+ tone: "anchor",
866
+ icon: "deviceLine"
867
+ })
868
+ ]),
869
+ sub: p(() => [
870
+ g("span", Vt, [
871
+ l.ip ? (m(), k("span", Mt, _(l.ip), 1)) : S("", !0),
872
+ l.ip ? (m(), k("span", Wt, "·")) : S("", !0),
873
+ g("span", null, _(t(a)("core.account.sessions.last_active", { when: t(c).dateTime(l.last_used_at) })), 1),
874
+ r[0] || (r[0] = g("span", {
875
+ "aria-hidden": "true",
876
+ class: "hidden md:inline"
877
+ }, "·", -1)),
878
+ g("span", null, _(t(a)("core.account.sessions.expires", { when: t(c).dateTime(l.expires_at) })), 1)
879
+ ]),
880
+ l.current || l.opened_by ? (m(), k("span", Ht, [
881
+ l.current ? (m(), w(t(X), {
882
+ key: 0,
883
+ tone: "positive",
884
+ dot: "",
885
+ "data-session-current": ""
886
+ }, {
887
+ default: p(() => [
888
+ T(_(t(a)("core.account.sessions.this_device")), 1)
889
+ ]),
890
+ _: 1
891
+ })) : S("", !0),
892
+ l.opened_by ? (m(), w(t(X), {
893
+ key: 1,
894
+ tone: "warning",
895
+ "data-session-opened-by": ""
896
+ }, {
897
+ default: p(() => [
898
+ T(_(l.opened_by.name ? t(a)("core.account.sessions.opened_by", { name: l.opened_by.name }) : t(a)("core.account.sessions.opened_by_other")), 1)
899
+ ]),
900
+ _: 2
901
+ }, 1024)) : S("", !0)
902
+ ])) : S("", !0),
903
+ o.canEnd && !l.current ? (m(), w(t(z), {
904
+ key: 1,
905
+ prominence: "plain",
906
+ tone: "critical",
907
+ size: "sm",
908
+ class: "mt-1 -ml-2 md:hidden",
909
+ "data-end-session-inline": l.id,
910
+ onClick: (u) => s("end", l)
911
+ }, {
912
+ default: p(() => [
913
+ T(_(t(a)("core.account.sessions.end")), 1)
914
+ ]),
915
+ _: 1
916
+ }, 8, ["data-end-session-inline", "onClick"])) : S("", !0)
917
+ ]),
918
+ _: 2
919
+ }, [
920
+ o.canEnd && !l.current ? {
921
+ name: "trailing",
922
+ fn: p(() => [
923
+ v(t(z), {
924
+ prominence: "plain",
925
+ tone: "critical",
926
+ size: "sm",
927
+ class: "hidden md:inline-flex",
928
+ "data-end-session": l.id,
929
+ onClick: (u) => s("end", l)
930
+ }, {
931
+ default: p(() => [
932
+ T(_(t(a)("core.account.sessions.end")), 1)
933
+ ]),
934
+ _: 1
935
+ }, 8, ["data-end-session", "onClick"])
936
+ ]),
937
+ key: "0"
938
+ } : void 0
939
+ ]), 1032, ["label", "data-session"]))), 128))
940
+ ]),
941
+ _: 1
942
+ }, 8, ["header", "footer"]));
943
+ }
944
+ }), Xt = 80, Yt = (e) => /Edg\/|EdgA\/|EdgiOS\//.test(e) ? "Edge" : /Firefox\/|FxiOS\//.test(e) ? "Firefox" : /Chrome\/|CriOS\//.test(e) ? "Chrome" : /Safari\/|iPhone|iPad/.test(e) ? "Safari" : "", Jt = (e) => e.includes("iPhone") ? "iPhone" : e.includes("iPad") ? "iPad" : e.includes("Android") ? "Android" : e.includes("Windows") ? "Windows" : /Mac OS X|Macintosh/.test(e) ? "macOS" : /Linux|X11/.test(e) ? "Linux" : "";
945
+ function Oe(e) {
946
+ const n = e.trim();
947
+ if (n === "") return "";
948
+ const o = Yt(n), s = Jt(n);
949
+ return o && s ? `${o} · ${s}` : [...n].slice(0, Xt).join("");
950
+ }
951
+ const Qt = {
952
+ signed_in: { tone: "positive", byOther: !1 },
953
+ wrong_password: { tone: "critical", byOther: !1 },
954
+ locked_out: { tone: "critical", byOther: !1 },
955
+ refused_inactive: { tone: "critical", byOther: !1 },
956
+ signed_in_as: { tone: "warning", byOther: !0 },
957
+ unlocked: { tone: "neutral", byOther: !0 },
958
+ signed_out_everywhere: { tone: "neutral", byOther: !0 },
959
+ session_revoked: { tone: "neutral", byOther: !0 }
960
+ };
961
+ function re(e) {
962
+ const n = Qt[e];
963
+ return n ? { ...n, known: !0 } : { tone: "neutral", byOther: !1, known: !1 };
964
+ }
965
+ function Ae(e, n) {
966
+ const o = re(e);
967
+ return o.known ? o.byOther && n ? `core.account.signins.events_by.${e}` : `core.account.signins.events.${e}` : "core.account.signins.events.unknown";
968
+ }
969
+ const Zt = ["title"], en = { class: "font-mono" }, ls = /* @__PURE__ */ E({
970
+ __name: "SignInList",
971
+ props: {
972
+ rows: {},
973
+ header: {},
974
+ footer: {}
975
+ },
976
+ setup(e) {
977
+ const n = e, { t: o } = C(), s = J(), a = (c) => o(Ae(c.event, c.actor?.name || null), { name: c.actor?.name ?? "" });
978
+ return (c, d) => (m(), w(t(V), {
979
+ header: n.header,
980
+ footer: n.footer,
981
+ "data-signin-list": ""
982
+ }, fe({
983
+ default: p(() => [
984
+ n.rows.length === 0 ? (m(), w(t(q), {
985
+ key: 0,
986
+ layout: "setting",
987
+ label: t(o)("core.account.signins.empty"),
988
+ "data-signin-empty": ""
989
+ }, null, 8, ["label"])) : S("", !0),
990
+ (m(!0), k(U, null, W(n.rows, (r) => (m(), w(t(q), {
991
+ key: r.id,
992
+ layout: "setting",
993
+ label: t(Oe)(r.device) || t(o)("core.account.sessions.unknown_device"),
994
+ "data-signin-row": ""
995
+ }, {
996
+ leading: p(() => [
997
+ v(t(D), {
998
+ tone: "neutral",
999
+ icon: "timeLine"
1000
+ })
1001
+ ]),
1002
+ sub: p(() => [
1003
+ g("span", {
1004
+ class: "flex flex-col gap-y-0.5 md:flex-row md:flex-wrap md:items-center md:gap-x-1.5",
1005
+ title: r.device,
1006
+ "data-signin-facts": ""
1007
+ }, [
1008
+ g("span", null, _(t(s).dateTime(r.created_at)), 1),
1009
+ r.ip ? (m(), k(U, { key: 0 }, [
1010
+ d[0] || (d[0] = g("span", {
1011
+ "aria-hidden": "true",
1012
+ class: "hidden md:inline"
1013
+ }, "·", -1)),
1014
+ g("span", en, _(r.ip), 1)
1015
+ ], 64)) : S("", !0)
1016
+ ], 8, Zt)
1017
+ ]),
1018
+ default: p(() => [
1019
+ v(t(X), {
1020
+ tone: t(re)(r.event).tone,
1021
+ "data-event": r.event
1022
+ }, {
1023
+ default: p(() => [
1024
+ T(_(a(r)), 1)
1025
+ ]),
1026
+ _: 2
1027
+ }, 1032, ["tone", "data-event"])
1028
+ ]),
1029
+ _: 2
1030
+ }, 1032, ["label"]))), 128))
1031
+ ]),
1032
+ _: 2
1033
+ }, [
1034
+ c.$slots["header-trailing"] ? {
1035
+ name: "header-trailing",
1036
+ fn: p(() => [
1037
+ Fe(c.$slots, "header-trailing")
1038
+ ]),
1039
+ key: "0"
1040
+ } : void 0
1041
+ ]), 1032, ["header", "footer"]));
1042
+ }
1043
+ }), tn = {
1044
+ class: "overflow-hidden rounded-group bg-surface-cell shadow-group",
1045
+ "data-signin-table": ""
1046
+ }, nn = ["title"], sn = { class: "font-mono text-footnote" }, on = {
1047
+ class: "px-4 py-8 text-center text-body text-content-muted",
1048
+ "data-signin-empty": ""
1049
+ }, us = /* @__PURE__ */ E({
1050
+ __name: "SignInTable",
1051
+ props: {
1052
+ rows: {},
1053
+ loading: { type: Boolean }
1054
+ },
1055
+ setup(e) {
1056
+ const n = e, { t: o } = C(), s = A(() => [
1057
+ { key: "created_at", label: o("core.account.signins.columns.time"), kind: "timestamp", width: 170, mobile: "meta" },
1058
+ { key: "event", label: o("core.account.signins.columns.event"), mobile: "primary" },
1059
+ { key: "device", label: o("core.account.signins.columns.device"), hideBelow: "md", width: 320, mobile: "hidden" },
1060
+ { key: "ip", label: o("core.account.signins.columns.ip"), hideBelow: "md", width: 140, mobile: "hidden" }
1061
+ ]), a = (c) => o(Ae(c.event, c.actor?.name || null), { name: c.actor?.name ?? "" });
1062
+ return (c, d) => (m(), k("div", tn, [
1063
+ v(t(Ze), {
1064
+ rows: n.rows,
1065
+ columns: s.value,
1066
+ "row-key": (r) => r.id,
1067
+ loading: n.loading
1068
+ }, {
1069
+ "cell-event": p(({ item: r }) => [
1070
+ v(t(X), {
1071
+ tone: t(re)(r.event).tone,
1072
+ "data-event": r.event
1073
+ }, {
1074
+ default: p(() => [
1075
+ T(_(a(r)), 1)
1076
+ ]),
1077
+ _: 2
1078
+ }, 1032, ["tone", "data-event"])
1079
+ ]),
1080
+ "cell-device": p(({ item: r }) => [
1081
+ g("span", {
1082
+ class: "block truncate",
1083
+ title: r.device
1084
+ }, _(t(Oe)(r.device) || "—"), 9, nn)
1085
+ ]),
1086
+ "cell-ip": p(({ item: r }) => [
1087
+ g("span", sn, _(r.ip || "—"), 1)
1088
+ ]),
1089
+ empty: p(() => [
1090
+ g("p", on, _(t(o)("core.account.signins.empty")), 1)
1091
+ ]),
1092
+ _: 1
1093
+ }, 8, ["rows", "columns", "row-key", "loading"])
1094
+ ]));
1095
+ }
1096
+ }), an = { class: "flex items-center pl-0.5" }, rn = { class: "flex flex-wrap items-center gap-x-1.5" }, cn = {
1097
+ class: "font-medium text-content",
1098
+ "data-change-actor": ""
1099
+ }, ln = { key: 1 }, ds = /* @__PURE__ */ E({
1100
+ __name: "ChangeFeed",
1101
+ props: {
1102
+ rows: {},
1103
+ words: { type: Function }
1104
+ },
1105
+ setup(e) {
1106
+ const n = e, { t: o, te: s } = C(), a = (u, f) => o(u, f ?? {}), c = J(), d = /* @__PURE__ */ new Set(["created", "activated", "deactivated", "password"]), r = (u) => o(`core.users.changes.fields.${u}`), l = A(
1107
+ () => n.rows.map((u) => {
1108
+ const f = n.words?.(u, a), b = f?.sentence ?? (s(`core.users.changes.actions.${u.action}`) ? o(`core.users.changes.actions.${u.action}`) : o("core.users.changes.actions.unknown")), x = d.has(u.action) ? [] : u.fields.filter((y) => y !== "password" && s(`core.users.changes.fields.${y}`)).map((y) => y in u.before || y in u.after ? o("core.users.changes.diff", { field: r(y), before: u.before[y] || "—", after: u.after[y] || "—" }) : r(y));
1109
+ return { row: u, sentence: b, details: [...x, ...f?.details ?? []] };
1110
+ })
1111
+ );
1112
+ return (u, f) => (m(), w(t(V), { "data-change-feed": "" }, {
1113
+ default: p(() => [
1114
+ (m(!0), k(U, null, W(l.value, (b) => (m(), w(t(q), {
1115
+ key: b.row.id,
1116
+ layout: "setting",
1117
+ label: b.sentence,
1118
+ "data-change-row": ""
1119
+ }, {
1120
+ leading: p(() => [
1121
+ g("span", an, [
1122
+ b.row.actor?.name ? (m(), w(t(et), {
1123
+ key: 0,
1124
+ name: b.row.actor.name,
1125
+ size: "sm"
1126
+ }, null, 8, ["name"])) : (m(), w(t(D), {
1127
+ key: 1,
1128
+ tone: "anchor",
1129
+ icon: "edit"
1130
+ }))
1131
+ ])
1132
+ ]),
1133
+ sub: p(() => [
1134
+ g("span", rn, [
1135
+ b.row.actor ? (m(), k(U, { key: 0 }, [
1136
+ g("span", cn, _(b.row.actor.name || t(o)("core.account.somebody_else")), 1),
1137
+ f[0] || (f[0] = g("span", { "aria-hidden": "true" }, "·", -1))
1138
+ ], 64)) : S("", !0),
1139
+ (m(!0), k(U, null, W(b.details, (x, y) => (m(), k(U, { key: y }, [
1140
+ typeof x != "string" ? (m(), w(t(De), {
1141
+ key: 0,
1142
+ to: x.to,
1143
+ class: "text-content-link",
1144
+ "data-change-link": ""
1145
+ }, {
1146
+ default: p(() => [
1147
+ T(_(x.text), 1)
1148
+ ]),
1149
+ _: 2
1150
+ }, 1032, ["to"])) : (m(), k("span", ln, _(x), 1)),
1151
+ f[1] || (f[1] = g("span", { "aria-hidden": "true" }, "·", -1))
1152
+ ], 64))), 128)),
1153
+ g("span", null, _(t(c).dateTime(b.row.created_at)), 1)
1154
+ ])
1155
+ ]),
1156
+ _: 2
1157
+ }, 1032, ["label"]))), 128))
1158
+ ]),
1159
+ _: 1
1160
+ }));
1161
+ }
1162
+ }), ms = /* @__PURE__ */ E({
1163
+ __name: "SignInAsButton",
1164
+ props: {
1165
+ userId: {},
1166
+ name: {},
1167
+ permission: {}
1168
+ },
1169
+ setup(e) {
1170
+ const n = e, { t: o } = C(), s = I(), a = he(), { home: c } = xe(), d = G(), r = ie(!1), l = A(() => {
1171
+ const f = H(s.session.state.value);
1172
+ return f !== null && f.impersonator === void 0 && f.user.id !== n.userId;
1173
+ });
1174
+ async function u() {
1175
+ r.value = !0;
1176
+ try {
1177
+ await it(s, n.userId), await a.push(c);
1178
+ } catch (f) {
1179
+ Q(f) || j.error(d(f, { fallback: o("core.identity.impersonation.sign_in_as_failed", { name: n.name }) }));
1180
+ } finally {
1181
+ r.value = !1;
1182
+ }
1183
+ }
1184
+ return (f, b) => l.value ? (m(), w(t(tt), {
1185
+ key: 0,
1186
+ permission: n.permission
1187
+ }, {
1188
+ default: p(() => [
1189
+ v(t(z), {
1190
+ processing: r.value,
1191
+ "data-sign-in-as": "",
1192
+ onClick: u
1193
+ }, {
1194
+ default: p(() => [
1195
+ T(_(t(o)("core.identity.impersonation.sign_in_as", { name: n.name })), 1)
1196
+ ]),
1197
+ _: 1
1198
+ }, 8, ["processing"])
1199
+ ]),
1200
+ _: 1
1201
+ }, 8, ["permission"])) : S("", !0);
1202
+ }
1203
+ }), [un, ps] = B("vue-core.serviceaccounts"), me = "iam.serviceaccount:view", fs = "iam.serviceaccount:manage", gs = "iam.serviceaccount:revoke", pe = Y({
1204
+ index: { name: "serviceaccounts.index", path: "/iam/service-accounts", component: () => import("./ServiceAccountsList-DcsnOcf-.js"), meta: { access: me, titleKey: "core.serviceaccounts.title_plural" } },
1205
+ record: {
1206
+ name: "serviceaccounts.record",
1207
+ path: "/iam/service-accounts/:id",
1208
+ component: () => import("./ServiceAccountRecord-0-JF5lRx.js"),
1209
+ meta: { access: me, titleKey: "core.serviceaccounts.title_plural", remountOnParam: "id" }
1210
+ }
1211
+ });
1212
+ function _s(e = {}) {
1213
+ return se({
1214
+ id: "serviceaccounts",
1215
+ routes: pe.records,
1216
+ context: oe(un, { tenants: e.tenants ?? null }),
1217
+ navigation: e.destination ? [{ destination: e.destination, to: pe.index, within: ["serviceaccounts.record"] }] : [],
1218
+ requires: ["access"]
1219
+ });
1220
+ }
1221
+ export {
1222
+ Jn as A,
1223
+ Ot as B,
1224
+ st as C,
1225
+ Pt as D,
1226
+ Ee as E,
1227
+ at as F,
1228
+ _s as G,
1229
+ ot as H,
1230
+ it as I,
1231
+ Dt as J,
1232
+ ss as K,
1233
+ ns as M,
1234
+ Lt as P,
1235
+ gs as R,
1236
+ Nt as U,
1237
+ ms as _,
1238
+ gt as a,
1239
+ os as b,
1240
+ Te as c,
1241
+ is as d,
1242
+ Zn as e,
1243
+ $e as f,
1244
+ Q as g,
1245
+ ts as h,
1246
+ P as i,
1247
+ cs as j,
1248
+ us as k,
1249
+ rs as l,
1250
+ ds as m,
1251
+ ps as n,
1252
+ fs as o,
1253
+ pe as p,
1254
+ es as q,
1255
+ Qn as r,
1256
+ as as s,
1257
+ ls as t,
1258
+ xe as u,
1259
+ jt as v,
1260
+ zt as w,
1261
+ $t as x,
1262
+ Yn as y,
1263
+ Xn as z
1264
+ };