@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,685 @@
1
+ import { defineComponent as V, openBlock as m, createBlock as U, unref as e, withCtx as _, createVNode as n, mergeProps as E, createElementVNode as z, toDisplayString as q, watch as J, createElementBlock as w, Fragment as A, useModel as ve, useId as _e, useTemplateRef as Q, ref as x, onMounted as ge, onBeforeUnmount as ye, computed as D, withModifiers as be, createCommentVNode as H, createTextVNode as j, mergeModels as le, renderList as we, resolveDynamicComponent as re } from "vue";
2
+ import { useI18n as P } from "vue-i18n";
3
+ import { _ as he } from "./AdaptivePageShell.vue_vue_type_script_setup_true_lang-D5i77H6S.js";
4
+ import { u as F } from "./platform-BQOX_Ntw.js";
5
+ import { _ as ee } from "./AsyncSection.vue_vue_type_script_setup_true_lang-DGzQ-Snp.js";
6
+ import { u as te } from "./useLoad-M7V-AVwR.js";
7
+ import { i as S, g as O, j as xe, t as $e, l as ke, f as qe } from "./index-Cq9TuOqH.js";
8
+ import { a as K, u as ne, p as Ce } from "./FormGroup.vue_vue_type_script_setup_true_lang-D6jYfNjW.js";
9
+ import { _ as de } from "./FormView.vue_vue_type_script_setup_true_lang-DvbPEiNQ.js";
10
+ import { u as Se, _ as Ee, a as Ve, b as Pe } from "./useGroupSheet-CPjHydQV.js";
11
+ import { t as C } from "./toast-CqSDTWRX.js";
12
+ import { u as T } from "./serverMessages-B6GHgi40.js";
13
+ import { g as Z } from "./options-B48UiYsG.js";
14
+ import { _ as I } from "./TextField.vue_vue_type_script_setup_true_lang-CWIeeZRE.js";
15
+ import { _ as Ne } from "./IconTile.vue_vue_type_script_setup_true_lang-BmxCuUZ9.js";
16
+ import { u as ce } from "./format-D8KUBmbS.js";
17
+ import { a as W } from "./ActionRow.vue_vue_type_script_setup_true_lang-DybAIOHS.js";
18
+ import { a as Y } from "./error-CD7x0Jrz.js";
19
+ import { a as Ae } from "./leaveGuard-Cc8yeLxM.js";
20
+ import { _ as Me } from "./Modal.vue_vue_type_script_setup_true_lang-DDS0iEnn.js";
21
+ import { _ as X } from "./Button.vue_vue_type_script_setup_true_lang-C74hcb0N.js";
22
+ import { u as Re, _ as De } from "./useCommand-Ch_nx1AQ.js";
23
+ import { _ as Ue } from "./AlertDialog.vue_vue_type_script_setup_true_lang-CrFhR9rJ.js";
24
+ import { _ as Ie } from "./ViewTabs.vue_vue_type_script_setup_true_lang-BjdDXE3T.js";
25
+ const Fe = { class: "font-mono" }, ie = /* @__PURE__ */ V({
26
+ __name: "DetailsFields",
27
+ props: {
28
+ bind: { type: Function },
29
+ login: {}
30
+ },
31
+ setup(h) {
32
+ const l = h, { t: p } = P();
33
+ return (t, a) => (m(), U(e(K), {
34
+ group: "details",
35
+ header: e(p)("core.profile.details.title"),
36
+ footer: e(p)("core.profile.details.login_hint")
37
+ }, {
38
+ default: _(() => [
39
+ n(e(I), E(l.bind("name"), {
40
+ label: e(p)("core.users.fields.name"),
41
+ required: "",
42
+ autocomplete: "name"
43
+ }), null, 16, ["label"]),
44
+ n(e(I), E(l.bind("phone"), {
45
+ label: e(p)("core.users.fields.phone"),
46
+ type: "tel",
47
+ autocomplete: "tel"
48
+ }), null, 16, ["label"]),
49
+ n(e(Z), {
50
+ layout: "value",
51
+ label: e(p)("core.users.fields.login"),
52
+ "data-profile-login": ""
53
+ }, {
54
+ default: _(() => [
55
+ z("span", Fe, q(l.login), 1)
56
+ ]),
57
+ _: 1
58
+ }, 8, ["label"])
59
+ ]),
60
+ _: 1
61
+ }, 8, ["header", "footer"]));
62
+ }
63
+ }), Ge = /* @__PURE__ */ V({
64
+ __name: "DetailsGroup",
65
+ props: {
66
+ profile: {}
67
+ },
68
+ emits: ["updated"],
69
+ setup(h, { emit: l }) {
70
+ const p = h, t = l, { t: a } = P(), { http: c } = F(), s = {
71
+ safeParse(u) {
72
+ const { name: g, phone: y } = u;
73
+ return g.trim() === "" ? { success: !1, error: { issues: [{ path: ["name"], message: a("core.account.validation.required") }] } } : { success: !0, data: { name: g, phone: y.trim() === "" ? void 0 : y } };
74
+ }
75
+ }, o = ne({ ...T(), defaults: () => ({ name: "", phone: "" }), validator: s });
76
+ J(() => p.profile, (u) => o.hydrate({ name: u.name, phone: u.phone }), { immediate: !0 });
77
+ const d = {}, i = Ce({ edit: (u) => d[u].present });
78
+ let r = null;
79
+ const b = Se({
80
+ form: o,
81
+ group: "details",
82
+ fields: ["name", "phone"],
83
+ groupOf: i.groupOf,
84
+ save: async (u) => {
85
+ r = (await c.request(S.profileUpdate, { name: u.name, phone: u.phone.trim() === "" ? void 0 : u.phone })).data;
86
+ },
87
+ onSaved: () => {
88
+ C.success(a("core.profile.details.saved")), r && t("updated", r);
89
+ }
90
+ });
91
+ return d.details = b, (u, g) => (m(), w(A, null, [
92
+ n(e(de), {
93
+ editable: !1,
94
+ "data-profile-details": ""
95
+ }, {
96
+ default: _(() => [
97
+ n(ie, {
98
+ bind: e(o).bind,
99
+ login: p.profile.login
100
+ }, null, 8, ["bind", "login"])
101
+ ]),
102
+ _: 1
103
+ }),
104
+ n(e(Ee), {
105
+ sheet: e(b),
106
+ title: e(a)("core.profile.details.title"),
107
+ editable: !0,
108
+ "group-label": () => e(a)("core.profile.details.title")
109
+ }, {
110
+ default: _(() => [
111
+ n(e(Ve), {
112
+ only: "details",
113
+ editable: !0
114
+ }, {
115
+ default: _(() => [
116
+ n(ie, {
117
+ bind: e(o).bind,
118
+ login: p.profile.login
119
+ }, null, 8, ["bind", "login"])
120
+ ]),
121
+ _: 1
122
+ })
123
+ ]),
124
+ _: 1
125
+ }, 8, ["sheet", "title", "group-label"])
126
+ ], 64));
127
+ }
128
+ }), Be = {
129
+ key: 0,
130
+ class: "max-w-sm text-body text-content-muted"
131
+ }, Le = ["id"], je = {
132
+ key: 2,
133
+ class: "mt-3 text-footnote text-content-muted",
134
+ "data-verify-expires": ""
135
+ }, Oe = { class: "mt-6 flex w-full flex-col gap-2" }, ze = /* @__PURE__ */ V({
136
+ __name: "VerifyCode",
137
+ props: /* @__PURE__ */ le({
138
+ description: { default: void 0 },
139
+ length: { default: 6 },
140
+ resendAvailableAt: { default: null },
141
+ expiresAt: { default: null },
142
+ error: { default: "" },
143
+ expired: { type: Boolean, default: !1 },
144
+ verifying: { type: Boolean, default: !1 },
145
+ resending: { type: Boolean, default: !1 }
146
+ }, {
147
+ modelValue: { default: "" },
148
+ modelModifiers: {}
149
+ }),
150
+ emits: /* @__PURE__ */ le(["verify", "resend", "cancel"], ["update:modelValue"]),
151
+ setup(h, { expose: l, emit: p }) {
152
+ const t = h, a = ve(h, "modelValue"), c = p, { t: s } = P(), o = ce(), d = _e(), i = Q("otp"), r = x(Date.now());
153
+ let b;
154
+ ge(() => b = setInterval(() => r.value = Date.now(), 1e3)), ye(() => clearInterval(b));
155
+ const u = D(() => {
156
+ const k = t.resendAvailableAt ? Date.parse(t.resendAvailableAt) : Number.NaN;
157
+ return Number.isNaN(k) ? 0 : Math.max(0, Math.ceil((k - r.value) / 1e3));
158
+ }), g = D(() => `${Math.floor(u.value / 60)}:${String(u.value % 60).padStart(2, "0")}`), y = D(() => t.expiresAt && !t.expired ? o.time(t.expiresAt) : ""), $ = D(() => a.value.length === t.length), G = D(() => t.verifying || t.resending);
159
+ function M(k = a.value) {
160
+ k.length === t.length && !G.value && !t.expired && c("verify", k);
161
+ }
162
+ function B() {
163
+ u.value === 0 && !G.value && c("resend");
164
+ }
165
+ return J(() => t.error, (k) => {
166
+ k && (a.value = "", i.value?.focus());
167
+ }), l({ focus: () => i.value?.focus() }), (k, N) => (m(), w("form", {
168
+ class: "flex flex-col items-center text-center",
169
+ "data-verify-code": "",
170
+ novalidate: "",
171
+ onSubmit: N[2] || (N[2] = be((R) => M(), ["prevent"]))
172
+ }, [
173
+ t.description ? (m(), w("p", Be, q(t.description), 1)) : H("", !0),
174
+ n(e(Pe), {
175
+ ref_key: "otp",
176
+ ref: i,
177
+ modelValue: a.value,
178
+ "onUpdate:modelValue": N[0] || (N[0] = (R) => a.value = R),
179
+ class: "mt-6",
180
+ length: t.length,
181
+ invalid: !!t.error,
182
+ disabled: t.expired || t.verifying,
183
+ "described-by": t.error ? e(d) : void 0,
184
+ autofocus: "",
185
+ onComplete: M
186
+ }, null, 8, ["modelValue", "length", "invalid", "disabled", "described-by"]),
187
+ t.error ? (m(), w("p", {
188
+ key: 1,
189
+ id: e(d),
190
+ role: "alert",
191
+ class: "mt-3 text-footnote text-content-destructive",
192
+ "data-verify-error": ""
193
+ }, q(t.error), 9, Le)) : y.value ? (m(), w("p", je, q(e(s)("core.profile.email.valid_until", { time: y.value })), 1)) : H("", !0),
194
+ z("div", Oe, [
195
+ t.expired ? H("", !0) : (m(), U(e(X), {
196
+ key: 0,
197
+ type: "submit",
198
+ prominence: "primary",
199
+ size: "lg",
200
+ class: "w-full justify-center",
201
+ disabled: !$.value || t.resending,
202
+ processing: t.verifying,
203
+ "data-verify-submit": ""
204
+ }, {
205
+ default: _(() => [
206
+ j(q(e(s)("core.profile.email.verify")), 1)
207
+ ]),
208
+ _: 1
209
+ }, 8, ["disabled", "processing"])),
210
+ n(e(X), {
211
+ prominence: t.expired ? "primary" : "standard",
212
+ size: "lg",
213
+ class: "w-full justify-center",
214
+ disabled: u.value > 0 || t.verifying,
215
+ processing: t.resending,
216
+ "data-verify-resend": "",
217
+ onClick: B
218
+ }, {
219
+ default: _(() => [
220
+ u.value > 0 ? (m(), w(A, { key: 0 }, [
221
+ j(q(e(s)("core.profile.email.resend_in", { time: g.value })), 1)
222
+ ], 64)) : (m(), w(A, { key: 1 }, [
223
+ j(q(t.expired ? e(s)("core.profile.email.request_new") : e(s)("core.profile.email.resend")), 1)
224
+ ], 64))
225
+ ]),
226
+ _: 1
227
+ }, 8, ["prominence", "disabled", "processing"]),
228
+ n(e(X), {
229
+ prominence: "link",
230
+ class: "mt-1 self-center",
231
+ disabled: t.verifying,
232
+ "data-verify-cancel": "",
233
+ onClick: N[1] || (N[1] = (R) => c("cancel"))
234
+ }, {
235
+ default: _(() => [
236
+ j(q(e(s)("core.profile.email.cancel_change")), 1)
237
+ ]),
238
+ _: 1
239
+ }, 8, ["disabled"])
240
+ ])
241
+ ], 32));
242
+ }
243
+ }), Te = { class: "text-body text-content-muted" }, He = {
244
+ key: 1,
245
+ class: "px-2 py-4 sm:px-6"
246
+ }, We = /* @__PURE__ */ V({
247
+ __name: "EmailChangeDialog",
248
+ emits: ["pending", "changed", "cancelled"],
249
+ setup(h, { expose: l, emit: p }) {
250
+ const t = p, { t: a } = P(), { http: c } = F(), s = T(), o = Q("modal"), d = x("request"), i = x(null), r = x(!1), u = ne({ ...s, defaults: () => ({ email: "", password: "" }), validator: {
251
+ safeParse(f) {
252
+ const { email: v, password: L } = f, se = a("core.account.validation.required"), oe = [...v.trim() === "" ? [{ path: ["email"], message: se }] : [], ...L === "" ? [{ path: ["password"], message: se }] : []];
253
+ return oe.length > 0 ? { success: !1, error: { issues: oe } } : { success: !0, data: { email: v.trim(), current_password: L } };
254
+ }
255
+ }, serverField: (f) => f === "current_password" ? "password" : f }), { confirmDiscard: g } = Ae(() => r.value && d.value === "request" && u.dirty.value), y = x(""), $ = x(""), G = x(!1), M = x(!1), B = x(!1), k = x(!1), N = ["identity.code.expired", "identity.code.too_many_attempts", "identity.code.no_pending"];
256
+ function R() {
257
+ y.value = "", $.value = "", G.value = !1;
258
+ }
259
+ function ue(f) {
260
+ i.value = f, d.value = f ? "verify" : "request", u.hydrate({ email: "", password: "" }), R(), o.value?.present();
261
+ }
262
+ async function ae() {
263
+ const f = await u.submit(async (v) => (await c.request(S.profileRequestEmail, v)).data);
264
+ f.status === "saved" && (i.value = f.value, R(), d.value = "verify", t("pending", f.value));
265
+ }
266
+ async function pe(f) {
267
+ if (!M.value) {
268
+ M.value = !0, $.value = "";
269
+ try {
270
+ const v = (await c.request(S.profileConfirmEmail, { code: f })).data;
271
+ t("changed", v), C.success(a("core.profile.email.changed")), o.value?.dismiss();
272
+ } catch (v) {
273
+ if (O(v)) return;
274
+ if (Y(v) && v.fields.email?.[0]) {
275
+ i.value = null, t("pending", null), d.value = "request", u.errors.set({ email: [s.describeFieldError(v.fields.email[0])] });
276
+ return;
277
+ }
278
+ G.value = Y(v) && v.code !== null && N.includes(v.code), $.value = s.sentence(v, a("core.profile.email.verify_failed"));
279
+ } finally {
280
+ M.value = !1;
281
+ }
282
+ }
283
+ }
284
+ async function fe() {
285
+ if (!B.value) {
286
+ B.value = !0;
287
+ try {
288
+ i.value = (await c.request(S.profileResendEmail)).data, R(), t("pending", i.value), C.success(a("core.profile.email.code_sent", { email: i.value.email }));
289
+ } catch (f) {
290
+ if (O(f)) return;
291
+ if (Y(f) && f.code === "identity.code.no_pending") {
292
+ i.value = null, t("pending", null), d.value = "request", C.error(s.sentence(f, a("core.profile.email.resend_failed")));
293
+ return;
294
+ }
295
+ $.value = s.sentence(f, a("core.profile.email.resend_failed"));
296
+ } finally {
297
+ B.value = !1;
298
+ }
299
+ }
300
+ }
301
+ async function me() {
302
+ if (!k.value) {
303
+ k.value = !0;
304
+ try {
305
+ await c.request(S.profileCancelEmail), i.value = null, t("cancelled"), C.success(a("core.profile.email.cancelled")), o.value?.dismiss();
306
+ } catch (f) {
307
+ O(f) || C.error(s.sentence(f, a("core.profile.email.cancel_failed")));
308
+ } finally {
309
+ k.value = !1;
310
+ }
311
+ }
312
+ }
313
+ return l({ present: ue }), (f, v) => (m(), U(e(Me), {
314
+ ref_key: "modal",
315
+ ref: o,
316
+ size: "md",
317
+ title: d.value === "request" ? e(a)("core.profile.email.change_title") : e(a)("core.profile.email.verify_title"),
318
+ "primary-label": d.value === "request" ? e(a)("core.profile.email.send_code") : void 0,
319
+ "without-footer": d.value === "verify",
320
+ status: e(u).submitting.value ? "processing" : "idle",
321
+ "before-dismiss": e(g),
322
+ onPrimary: ae,
323
+ onPresented: v[1] || (v[1] = (L) => r.value = !0),
324
+ onDismissed: v[2] || (v[2] = (L) => r.value = !1)
325
+ }, {
326
+ default: _(() => [
327
+ d.value === "request" ? (m(), U(e(de), {
328
+ key: 0,
329
+ form: e(u),
330
+ onSubmit: ae
331
+ }, {
332
+ default: _(() => [
333
+ z("p", Te, q(e(a)("core.profile.email.request_hint")), 1),
334
+ n(e(I), E(e(u).bind("email"), {
335
+ label: e(a)("core.profile.email.new_email"),
336
+ type: "email",
337
+ required: "",
338
+ autocomplete: "email"
339
+ }), null, 16, ["label"]),
340
+ n(e(I), E(e(u).bind("password"), {
341
+ label: e(a)("core.profile.email.current_password"),
342
+ type: "password",
343
+ required: "",
344
+ autocomplete: "current-password"
345
+ }), null, 16, ["label"])
346
+ ]),
347
+ _: 1
348
+ }, 8, ["form"])) : (m(), w("div", He, [
349
+ n(ze, {
350
+ modelValue: y.value,
351
+ "onUpdate:modelValue": v[0] || (v[0] = (L) => y.value = L),
352
+ description: e(a)("core.profile.email.verify_description", { email: i.value?.email ?? "" }),
353
+ "resend-available-at": i.value?.resend_available_at ?? null,
354
+ "expires-at": i.value?.expires_at ?? null,
355
+ error: $.value,
356
+ expired: G.value,
357
+ verifying: M.value,
358
+ resending: B.value,
359
+ onVerify: pe,
360
+ onResend: fe,
361
+ onCancel: me
362
+ }, null, 8, ["modelValue", "description", "resend-available-at", "expires-at", "error", "expired", "verifying", "resending"])
363
+ ]))
364
+ ]),
365
+ _: 1
366
+ }, 8, ["title", "primary-label", "without-footer", "status", "before-dismiss"]));
367
+ }
368
+ }), Xe = /* @__PURE__ */ V({
369
+ __name: "EmailGroup",
370
+ props: {
371
+ profile: {}
372
+ },
373
+ emits: ["updated"],
374
+ setup(h, { emit: l }) {
375
+ const p = h, t = l, { t: a } = P(), { http: c } = F(), s = ce(), o = T(), d = Q("dialog"), i = x(!1), r = D(() => p.profile.pending_email), b = (g) => t("updated", { ...p.profile, pending_email: g });
376
+ async function u() {
377
+ if (!i.value) {
378
+ i.value = !0;
379
+ try {
380
+ await c.request(S.profileCancelEmail), C.success(a("core.profile.email.cancelled")), b(null);
381
+ } catch (g) {
382
+ O(g) || C.error(o.sentence(g, a("core.profile.email.cancel_failed")));
383
+ } finally {
384
+ i.value = !1;
385
+ }
386
+ }
387
+ }
388
+ return (g, y) => (m(), w(A, null, [
389
+ n(e(K), {
390
+ header: e(a)("core.profile.email.title"),
391
+ "data-profile-email": ""
392
+ }, {
393
+ default: _(() => [
394
+ n(e(Z), {
395
+ layout: "value",
396
+ label: e(a)("core.profile.email.current"),
397
+ "data-profile-email-current": ""
398
+ }, {
399
+ default: _(() => [
400
+ j(q(p.profile.email), 1)
401
+ ]),
402
+ _: 1
403
+ }, 8, ["label"]),
404
+ n(W, {
405
+ label: e(a)("core.profile.email.change"),
406
+ "data-email-change": "",
407
+ onClick: y[0] || (y[0] = ($) => d.value?.present(null))
408
+ }, null, 8, ["label"]),
409
+ r.value ? (m(), w(A, { key: 0 }, [
410
+ n(e(Z), {
411
+ layout: "setting",
412
+ label: e(a)("core.profile.email.pending", { email: r.value.email }),
413
+ sub: e(a)("core.profile.email.valid_until", { time: e(s).time(r.value.expires_at) }),
414
+ "data-email-pending": ""
415
+ }, {
416
+ leading: _(() => [
417
+ n(e(Ne), {
418
+ tone: "neutral",
419
+ icon: "timeLine"
420
+ })
421
+ ]),
422
+ _: 1
423
+ }, 8, ["label", "sub"]),
424
+ n(W, {
425
+ label: e(a)("core.profile.email.enter_code"),
426
+ "data-email-enter-code": "",
427
+ onClick: y[1] || (y[1] = ($) => d.value?.present(r.value))
428
+ }, null, 8, ["label"]),
429
+ n(W, {
430
+ label: e(a)("core.profile.email.cancel_change"),
431
+ tone: "critical",
432
+ disabled: i.value,
433
+ "data-email-cancel": "",
434
+ onClick: u
435
+ }, null, 8, ["label", "disabled"])
436
+ ], 64)) : H("", !0)
437
+ ]),
438
+ _: 1
439
+ }, 8, ["header"]),
440
+ n(We, {
441
+ ref_key: "dialog",
442
+ ref: d,
443
+ onPending: b,
444
+ onChanged: y[2] || (y[2] = ($) => t("updated", $)),
445
+ onCancelled: y[3] || (y[3] = ($) => b(null))
446
+ }, null, 512)
447
+ ], 64));
448
+ }
449
+ }), Je = { class: "flex justify-end" }, Ke = /* @__PURE__ */ V({
450
+ __name: "PasswordGroup",
451
+ setup(h) {
452
+ const { t: l } = P(), { http: p } = F(), t = x(!1), a = {
453
+ safeParse(s) {
454
+ const o = s, d = l("core.account.validation.required"), i = [
455
+ ...o.current === "" ? [{ path: ["current"], message: d }] : [],
456
+ ...o.password === "" ? [{ path: ["password"], message: d }] : [],
457
+ ...o.password !== "" && o.repeat !== o.password ? [{ path: ["repeat"], message: o.repeat === "" ? d : l("core.account.validation.mismatch") }] : []
458
+ ];
459
+ return i.length > 0 ? { success: !1, error: { issues: i } } : { success: !0, data: { current_password: o.current, new_password: o.password, new_password_confirmation: o.repeat } };
460
+ }
461
+ }, c = Re({
462
+ ...T(),
463
+ defaults: () => ({ current: "", password: "", repeat: "" }),
464
+ validator: a,
465
+ // The server names its fields; the draft's are shorter.
466
+ serverField: (s) => ({ current_password: "current", new_password: "password", new_password_confirmation: "repeat" })[s] ?? s,
467
+ run: (s) => p.request(S.profileChangePassword, s),
468
+ done: () => {
469
+ t.value = !1, C.success(l("core.profile.password.changed"));
470
+ }
471
+ });
472
+ return (s, o) => (m(), w(A, null, [
473
+ n(e(K), { "data-profile-password": "" }, {
474
+ default: _(() => [
475
+ n(W, {
476
+ label: e(l)("core.profile.password.submit"),
477
+ sub: e(l)("core.profile.password.row_sub"),
478
+ "data-change-password": "",
479
+ onClick: o[0] || (o[0] = (d) => e(c).present())
480
+ }, null, 8, ["label", "sub"])
481
+ ]),
482
+ _: 1
483
+ }),
484
+ n(e(De), {
485
+ command: e(c),
486
+ title: e(l)("core.profile.password.title"),
487
+ "confirm-label": e(l)("core.profile.password.submit")
488
+ }, {
489
+ default: _(() => [
490
+ n(e(K), { "data-password-dialog": "" }, {
491
+ default: _(() => [
492
+ n(e(I), E(e(c).form.bind("current"), {
493
+ type: t.value ? "text" : "password",
494
+ label: e(l)("core.profile.password.current"),
495
+ required: "",
496
+ autocomplete: "current-password"
497
+ }), null, 16, ["type", "label"]),
498
+ n(e(I), E(e(c).form.bind("password"), {
499
+ type: t.value ? "text" : "password",
500
+ label: e(l)("core.profile.password.new"),
501
+ required: "",
502
+ autocomplete: "new-password"
503
+ }), null, 16, ["type", "label"]),
504
+ n(e(I), E(e(c).form.bind("repeat"), {
505
+ type: t.value ? "text" : "password",
506
+ label: e(l)("core.profile.password.repeat"),
507
+ required: "",
508
+ autocomplete: "new-password"
509
+ }), null, 16, ["type", "label"])
510
+ ]),
511
+ _: 1
512
+ }),
513
+ z("div", Je, [
514
+ n(e(X), E({
515
+ prominence: "link",
516
+ size: "sm",
517
+ icon: t.value ? "eyeOff" : "eye"
518
+ }, { "aria-pressed": t.value }, {
519
+ "data-password-visibility": "",
520
+ onClick: o[1] || (o[1] = (d) => t.value = !t.value)
521
+ }), {
522
+ default: _(() => [
523
+ j(q(t.value ? e(l)("core.profile.password.hide") : e(l)("core.profile.password.show")), 1)
524
+ ]),
525
+ _: 1
526
+ }, 16, ["icon"])
527
+ ])
528
+ ]),
529
+ _: 1
530
+ }, 8, ["command", "title", "confirm-label"])
531
+ ], 64));
532
+ }
533
+ }), Qe = ["details", "email", "password", "sessions", "signins"];
534
+ function Ye(h, l) {
535
+ const p = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), a = [];
536
+ for (const s of h) {
537
+ if (s.visible && !s.visible(l)) continue;
538
+ const o = s.after ?? s.before;
539
+ (o ? s.after ? t.get(o) ?? t.set(o, []).get(o) : p.get(o) ?? p.set(o, []).get(o) : a).push(s);
540
+ }
541
+ const c = (s) => ({ kind: "section", section: s });
542
+ return [
543
+ ...Qe.flatMap((s) => [...(p.get(s) ?? []).map(c), { kind: "panel", id: s }, ...(t.get(s) ?? []).map(c)]),
544
+ ...a.map(c)
545
+ ];
546
+ }
547
+ const Ze = { "data-profile-sessions": "" }, et = /* @__PURE__ */ V({
548
+ __name: "SessionsGroup",
549
+ setup(h) {
550
+ const { t: l } = P(), { http: p } = F(), t = T(), a = te(async ({ signal: i }) => (await p.request(S.profileSessions, void 0, { signal: i })).data), c = D(() => a.data.value?.sessions ?? []), s = Q("dialog"), o = x(null);
551
+ async function d(i) {
552
+ try {
553
+ await p.request(S.profileRevokeSession, { session_id: i.id }), C.success(l("core.account.sessions.ended"));
554
+ } catch (r) {
555
+ O(r) || C.error(t.sentence(r, l("core.account.sessions.end_failed")));
556
+ }
557
+ await a.reload();
558
+ }
559
+ return (i, r) => (m(), w("div", Ze, [
560
+ n(e(ee), {
561
+ state: e(a).state.value,
562
+ "skeleton-rows": 3,
563
+ "is-empty": () => !1,
564
+ onRetry: r[1] || (r[1] = (b) => e(a).reload())
565
+ }, {
566
+ default: _(() => [
567
+ n(xe, {
568
+ sessions: c.value,
569
+ "can-end": "",
570
+ header: e(l)("core.profile.sessions.title"),
571
+ footer: e(l)("core.profile.sessions.footer"),
572
+ onEnd: r[0] || (r[0] = (b) => {
573
+ o.value = b, s.value?.present(b);
574
+ })
575
+ }, null, 8, ["sessions", "header", "footer"])
576
+ ]),
577
+ _: 1
578
+ }, 8, ["state"]),
579
+ n(e(Ue), {
580
+ ref_key: "dialog",
581
+ ref: s,
582
+ tone: "critical",
583
+ icon: "logoutBoxRLine",
584
+ title: e(l)("core.account.sessions.end_title"),
585
+ message: e(l)("core.account.sessions.end_body", { device: o.value?.device || e(l)("core.account.sessions.unknown_device") }),
586
+ "confirm-label": e(l)("core.account.sessions.end"),
587
+ action: d
588
+ }, null, 8, ["title", "message", "confirm-label"])
589
+ ]));
590
+ }
591
+ }), tt = {
592
+ class: "flex min-w-0 flex-col gap-group-gap",
593
+ "data-profile-signins": ""
594
+ }, at = /* @__PURE__ */ V({
595
+ __name: "SignInsGroup",
596
+ setup(h) {
597
+ const { t: l } = P(), { http: p } = F(), t = ["all", "failed"], a = x("all"), c = x(1), s = te(async ({ signal: o }) => (await p.request(S.profileSignins, { view: a.value, page: c.value, per_page: 20 }, { signal: o })).data);
598
+ return J(a, () => {
599
+ c.value = 1, s.reload();
600
+ }), J(c, () => void s.reload()), (o, d) => (m(), w("div", tt, [
601
+ n(e(ee), {
602
+ state: e(s).state.value,
603
+ "skeleton-rows": 4,
604
+ "is-empty": () => !1,
605
+ onRetry: d[2] || (d[2] = (i) => e(s).reload())
606
+ }, {
607
+ default: _(({ value: i }) => [
608
+ n($e, {
609
+ rows: i.data,
610
+ header: e(l)("core.profile.signins.title"),
611
+ footer: e(l)("core.profile.signins.footer")
612
+ }, {
613
+ "header-trailing": _(() => [
614
+ n(Ie, {
615
+ modelValue: a.value,
616
+ "onUpdate:modelValue": d[0] || (d[0] = (r) => a.value = r),
617
+ views: t,
618
+ counts: e(s).data.value?.meta?.views,
619
+ "label-of": (r) => e(l)(`core.account.signins.views.${r}`),
620
+ label: e(l)("core.profile.signins.title")
621
+ }, null, 8, ["modelValue", "counts", "label-of", "label"])
622
+ ]),
623
+ _: 2
624
+ }, 1032, ["rows", "header", "footer"]),
625
+ n(ke, {
626
+ page: c.value,
627
+ "onUpdate:page": d[1] || (d[1] = (r) => c.value = r),
628
+ "last-page": i.last_page,
629
+ total: i.total
630
+ }, null, 8, ["page", "last-page", "total"])
631
+ ]),
632
+ _: 1
633
+ }, 8, ["state"])
634
+ ]));
635
+ }
636
+ }), st = { class: "flex min-w-0 flex-col gap-group-gap" }, ot = ["data-profile-section"], Vt = /* @__PURE__ */ V({
637
+ __name: "ProfilePage",
638
+ setup(h) {
639
+ const { t: l } = P(), { http: p, session: t } = F(), { profileSections: a } = qe(), c = te(async ({ signal: r }) => (await p.request(S.profileShow, void 0, { signal: r })).data), s = { details: Ge, email: Xe, password: Ke, sessions: et, signins: at }, o = (r) => r.kind === "panel" ? r.id : `section:${r.section.id}`, d = (r) => r.kind === "section" || ["details", "email"].includes(r.id);
640
+ function i(r) {
641
+ c.update(r), t.refresh();
642
+ }
643
+ return (r, b) => (m(), U(e(he), {
644
+ title: e(l)("core.profile.title"),
645
+ description: e(l)("core.profile.description"),
646
+ width: "readable"
647
+ }, {
648
+ default: _(() => [
649
+ n(e(ee), {
650
+ state: e(c).state.value,
651
+ "skeleton-rows": 6,
652
+ "is-empty": () => !1,
653
+ onRetry: b[0] || (b[0] = (u) => e(c).reload())
654
+ }, {
655
+ default: _(({ value: u }) => [
656
+ z("div", st, [
657
+ (m(!0), w(A, null, we(e(Ye)(e(a), u), (g) => (m(), w(A, {
658
+ key: o(g)
659
+ }, [
660
+ g.kind === "section" ? (m(), w("div", {
661
+ key: 0,
662
+ class: "flex min-w-0 flex-col gap-group-gap",
663
+ "data-profile-section": g.section.id
664
+ }, [
665
+ (m(), U(re(g.section.component), {
666
+ profile: u,
667
+ onUpdated: i
668
+ }, null, 40, ["profile"]))
669
+ ], 8, ot)) : (m(), U(re(s[g.id]), E({
670
+ key: 1,
671
+ ref_for: !0
672
+ }, d(g) ? { profile: u } : {}, { onUpdated: i }), null, 16))
673
+ ], 64))), 128))
674
+ ])
675
+ ]),
676
+ _: 1
677
+ }, 8, ["state"])
678
+ ]),
679
+ _: 1
680
+ }, 8, ["title", "description"]));
681
+ }
682
+ });
683
+ export {
684
+ Vt as default
685
+ };