@wssto2/vue-core 0.4.28 → 0.5.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 (138) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-J5HoyGNJ.js → AccessGate.vue_vue_type_script_setup_true_lang-Nw1IsB8N.js} +1 -1
  3. package/dist/{ActionRow.vue_vue_type_script_setup_true_lang-QPvYudWc.js → ActionRow.vue_vue_type_script_setup_true_lang-BCgKzUvG.js} +1 -1
  4. package/dist/{Activity-BWkVX1Nx.js → Activity-CoGI2_GL.js} +7 -7
  5. package/dist/{Changes-MG77TDwz.js → Changes-Cwfe6wbX.js} +6 -6
  6. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-Bnpv9TEj.js → CollectionPage.vue_vue_type_script_setup_true_lang-CtvHtFLy.js} +4 -4
  7. package/dist/{DateField.vue_vue_type_script_setup_true_lang-CpuH0WTl.js → DateField.vue_vue_type_script_setup_true_lang-DRuWzSaX.js} +1 -1
  8. package/dist/{DeadLetters-CkDE71B3.js → DeadLetters-DyA5Dqn0.js} +7 -7
  9. package/dist/{FormErrors.vue_vue_type_script_setup_true_lang-DGOSc-PS.js → FormErrors.vue_vue_type_script_setup_true_lang-D7edzNTL.js} +2 -2
  10. package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-DSwSRsA5.js → FormGroup.vue_vue_type_script_setup_true_lang-BPchlRCl.js} +2 -2
  11. package/dist/{FormView.vue_vue_type_script_setup_true_lang-BUrYkjmF.js → FormView.vue_vue_type_script_setup_true_lang-CPSYV7iQ.js} +2 -2
  12. package/dist/{General-UTBVEXbN.js → General-DTEfxWls.js} +10 -10
  13. package/dist/MenuButton.vue_vue_type_script_setup_true_lang-AGbN9r5q.js +28 -0
  14. package/dist/{NewRolePage-B7DwFWPk.js → NewRolePage-CRZoUajV.js} +3 -3
  15. package/dist/{NumberField.vue_vue_type_script_setup_true_lang-DaE5BLm4.js → NumberField.vue_vue_type_script_setup_true_lang-ButMV_sf.js} +1 -1
  16. package/dist/ProfilePage-DLY81mvN.js +764 -0
  17. package/dist/RoleEditor.vue_vue_type_script_setup_true_lang-gXbxXG2R.js +325 -0
  18. package/dist/RolePage-B9t586Q8.js +314 -0
  19. package/dist/{RolesPage-B5RwSZ89.js → RolesPage-BRdG-OSL.js} +6 -6
  20. package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-Dmv6TpCi.js → SectionNavigator.vue_vue_type_script_setup_true_lang-Cy9Oi0ts.js} +1 -1
  21. package/dist/{SegmentedField.vue_vue_type_script_setup_true_lang-Dg-_ZjgR.js → SegmentedField.vue_vue_type_script_setup_true_lang-BwyMvkis.js} +1 -1
  22. package/dist/{SelectField.vue_vue_type_script_setup_true_lang-C3FbRQW7.js → SelectField.vue_vue_type_script_setup_true_lang-BzQC1qDQ.js} +11 -12
  23. package/dist/SessionList.vue_vue_type_script_setup_true_lang-DhoTd5D7.js +133 -0
  24. package/dist/{Sessions-DWj2OGo0.js → Sessions-vGyUOnPG.js} +5 -5
  25. package/dist/SettingsPage-V8WeADZZ.js +632 -0
  26. package/dist/{SignIn-COThB9XN.js → SignIn-C-3i8RG6.js} +7 -7
  27. package/dist/{SignInPage-CdzgSvRm.js → SignInPage-D2NA3VKU.js} +4 -4
  28. package/dist/SignIns-eoYPB6kB.js +121 -0
  29. package/dist/{SwitchField.vue_vue_type_script_setup_true_lang-ALvJisiP.js → SwitchField.vue_vue_type_script_setup_true_lang-D_-HACqT.js} +1 -1
  30. package/dist/{TextField.vue_vue_type_script_setup_true_lang-CP2WeU36.js → TextField.vue_vue_type_script_setup_true_lang-DTAQPbW0.js} +2 -2
  31. package/dist/{TextareaField.vue_vue_type_script_setup_true_lang-BJ4__cvJ.js → TextareaField.vue_vue_type_script_setup_true_lang-DsjK2C9T.js} +1 -1
  32. package/dist/{TimeField.vue_vue_type_script_setup_true_lang-DBxKAWRo.js → TimeField.vue_vue_type_script_setup_true_lang-Cz7KhUqt.js} +1 -1
  33. package/dist/{UserRecord-BWMnXz4q.js → UserRecord-BaQl2zzQ.js} +13 -13
  34. package/dist/{UsersList-Chq8yM5C.js → UsersList-BfXWgH5K.js} +9 -9
  35. package/dist/access/RoleCompareDialog.vue.d.ts +1 -1
  36. package/dist/access/RoleEditor.vue.d.ts +2 -0
  37. package/dist/access/constraints.d.ts +28 -0
  38. package/dist/access/context.d.ts +5 -0
  39. package/dist/access/feature.d.ts +17 -0
  40. package/dist/access/index.d.ts +3 -1
  41. package/dist/access/index.js +11 -9
  42. package/dist/access/refusals.d.ts +20 -2
  43. package/dist/app/index.js +6 -6
  44. package/dist/client/index.js +19 -11
  45. package/dist/{client-k9euDWF4.js → client-BHPFfBj3.js} +20 -20
  46. package/dist/collection/index.js +3 -3
  47. package/dist/content/index.js +66 -37
  48. package/dist/{contributions-BVBZP5Jb.js → contributions-DVQPcjJz.js} +1 -1
  49. package/dist/{describeError-B-NMa--w.js → describeError-BqGAUZgX.js} +1 -1
  50. package/dist/{error-CD7x0Jrz.js → error-Bb_dr_Ay.js} +2 -2
  51. package/dist/{fieldMessages-6HVzSDqG.js → fieldMessages-DTXpWnBd.js} +7 -7
  52. package/dist/form/index.js +1235 -1412
  53. package/dist/{guards-BJZjc3FZ.js → guards-DRh4zmxO.js} +1 -1
  54. package/dist/{http-BFfkA7gN.js → http-D_pBg22D.js} +1 -1
  55. package/dist/i18n/index.d.ts +2 -2
  56. package/dist/i18n/index.js +30 -30
  57. package/dist/identity/index.d.ts +2 -0
  58. package/dist/identity/index.js +8 -6
  59. package/dist/identity/profile/DetailsFields.vue.d.ts +8 -0
  60. package/dist/identity/profile/{DetailsPanel.vue.d.ts → DetailsGroup.vue.d.ts} +4 -1
  61. package/dist/identity/profile/{EmailPanel.vue.d.ts → EmailGroup.vue.d.ts} +1 -1
  62. package/dist/identity/profile/SignInsGroup.vue.d.ts +2 -0
  63. package/dist/identity/profile/profileSections.d.ts +37 -0
  64. package/dist/identity/shared/SignInList.vue.d.ts +22 -0
  65. package/dist/identity/shared/deviceLabel.d.ts +7 -0
  66. package/dist/identity/useReturnToOwnAccount.d.ts +10 -0
  67. package/dist/identity/users/context.d.ts +3 -0
  68. package/dist/identity/users/feature.d.ts +3 -0
  69. package/dist/index-WkbzC_ee.js +745 -0
  70. package/dist/index-g-qbUeTk.js +630 -0
  71. package/dist/index-kqk7Mclb.js +480 -0
  72. package/dist/index.d.ts +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/modules/notification/entities.d.ts +19 -0
  75. package/dist/modules/notification/routes.d.ts +25 -1
  76. package/dist/modules/notification/schemas.d.ts +24 -0
  77. package/dist/{navigation-DpcDF0rX.js → navigation-DuQwti76.js} +1 -1
  78. package/dist/{neighbors-RVQ4O3Qv.js → neighbors-IMRQ4rkm.js} +22 -22
  79. package/dist/notifications/context.d.ts +24 -1
  80. package/dist/notifications/feature.d.ts +10 -1
  81. package/dist/notifications/index.d.ts +1 -1
  82. package/dist/notifications/index.js +1 -1
  83. package/dist/notifications/push/DevicesSection.vue.d.ts +12 -0
  84. package/dist/notifications/push/ThisDeviceSection.vue.d.ts +15 -0
  85. package/dist/notifications/push/browser.d.ts +40 -0
  86. package/dist/notifications/push/devices.d.ts +15 -0
  87. package/dist/notifications/push/thisDevice.d.ts +28 -0
  88. package/dist/notifications/settings/ChannelsSection.vue.d.ts +16 -0
  89. package/dist/notifications/settings/{QuietHoursPanel.vue.d.ts → QuietHoursSection.vue.d.ts} +3 -1
  90. package/dist/notifications/settings/SettingsBody.vue.d.ts +17 -0
  91. package/dist/notifications/settings/settings.d.ts +4 -3
  92. package/dist/notifications/settings/state.d.ts +4 -2
  93. package/dist/options-g8RwEhBk.js +366 -0
  94. package/dist/overlay/index.js +37 -59
  95. package/dist/page/index.js +1 -1
  96. package/dist/phone/index.js +10 -11
  97. package/dist/platform/index.js +3 -3
  98. package/dist/{platform-PZpUkkMS.js → platform-Dl1fbScN.js} +2 -2
  99. package/dist/push-worker/index.d.ts +91 -0
  100. package/dist/push-worker/index.js +54 -0
  101. package/dist/resource/index.js +1 -1
  102. package/dist/{routeResource-DlTsGTg_.js → routeResource-CcYA75T2.js} +2 -2
  103. package/dist/router/index.js +3 -3
  104. package/dist/{sections-CeZl-Jxg.js → sections-D5rgQ4YB.js} +1 -1
  105. package/dist/shell/index.js +3 -3
  106. package/dist/signInEvents-DWShrJox.js +30 -0
  107. package/dist/state/index.js +1 -1
  108. package/dist/{status-dGvfh1TP.js → status-C2gHqkj6.js} +2 -2
  109. package/dist/styles.css +1 -1
  110. package/dist/{suggestions-DHJFKB26.js → suggestions-CfFTHi8y.js} +2 -2
  111. package/dist/testing/index.js +1 -1
  112. package/dist/{useCommand-Cj-APj-P.js → useCommand-CtqheKUv.js} +2 -2
  113. package/dist/useGroupSheet-ATvc0IiM.js +278 -0
  114. package/dist/{useLoad-M7V-AVwR.js → useLoad-W4tfxmm5.js} +1 -1
  115. package/dist/{useResourceForm-tGYTfKhH.js → useResourceForm-CJfl8rj_.js} +1 -1
  116. package/package.json +6 -2
  117. package/dist/KeyValue.vue_vue_type_script_setup_true_lang-wcZcvnow.js +0 -35
  118. package/dist/OtpInput.vue_vue_type_script_setup_true_lang-gp4FfWAH.js +0 -95
  119. package/dist/PanelActions.vue_vue_type_script_setup_true_lang-E9VdIGkf.js +0 -46
  120. package/dist/ProfilePage-C8VhiKIh.js +0 -654
  121. package/dist/RoleEditor.vue_vue_type_script_setup_true_lang-DRHmjA9w.js +0 -300
  122. package/dist/RolePage-ODFu68Ce.js +0 -315
  123. package/dist/SessionList.vue_vue_type_script_setup_true_lang-D5qm77Zo.js +0 -111
  124. package/dist/SettingsPage-C3fPSmi7.js +0 -255
  125. package/dist/SignInTable.vue_vue_type_script_setup_true_lang-Bs0yTi2E.js +0 -79
  126. package/dist/SignIns-cztICmqt.js +0 -66
  127. package/dist/control-B4SdblL6.js +0 -350
  128. package/dist/identity/profile/PanelActions.vue.d.ts +0 -17
  129. package/dist/index-BhtJR4c_.js +0 -459
  130. package/dist/index-C3E6DcO0.js +0 -706
  131. package/dist/index-sTBBHqNG.js +0 -504
  132. package/dist/notifications/settings/EmailPanel.vue.d.ts +0 -14
  133. package/dist/options-Ba_0uLWN.js +0 -18
  134. package/dist/route-goWMxDUN.js +0 -13
  135. package/dist/transport-BnP7WC0Y.js +0 -4
  136. /package/dist/identity/{profile/PasswordPanel.vue.d.ts → ReturnMenuItem.vue.d.ts} +0 -0
  137. /package/dist/identity/profile/{SessionsPanel.vue.d.ts → PasswordGroup.vue.d.ts} +0 -0
  138. /package/dist/identity/profile/{SignInsPanel.vue.d.ts → SessionsGroup.vue.d.ts} +0 -0
@@ -1,504 +0,0 @@
1
- import { r as y } from "./route-goWMxDUN.js";
2
- import { d as se, p as le } from "./feature-DdUAfyi4.js";
3
- import { defineComponent as z, openBlock as g, createBlock as I, unref as a, shallowRef as U, ref as G, readonly as P, withCtx as R, createTextVNode as Q, toDisplayString as L, mergeProps as X, computed as q, createElementBlock as w, createElementVNode as C, createCommentVNode as S, createVNode as T, Fragment as B, renderList as ce, normalizeClass as W, useTemplateRef as de, createSlots as ue } from "vue";
4
- import { d as fe } from "./context-Ch1r4fdN.js";
5
- import { d as Z } from "./defineRoutes-BGAdiIrt.js";
6
- import { useI18n as N } from "vue-i18n";
7
- import { _ as me } from "./AccountMenuItem.vue_vue_type_script_setup_true_lang-CPeNxh5K.js";
8
- import { f as ve } from "./transport-BnP7WC0Y.js";
9
- import { u as pe } from "./mediaQuery-CygcXmFW.js";
10
- import { _ as be } from "./Sheet.vue_vue_type_script_setup_true_lang-DgOFV4fa.js";
11
- import { _ as _e } from "./Popover.vue_vue_type_script_setup_true_lang-C70GrCP7.js";
12
- import { _ as H } from "./HeaderAction.vue_vue_type_script_setup_true_lang-Cgji-Jrr.js";
13
- import { useRouter as ge } from "vue-router";
14
- import { _ as F } from "./Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
15
- import { u as ye } from "./format-D8X4zsx6.js";
16
- import { _ as xe } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
17
- import { _ as he } from "./AsyncSection.vue_vue_type_script_setup_true_lang-B0NfvG3B.js";
18
- const M = {
19
- list: y("GET", "/v1/notifications"),
20
- unread: y("GET", "/v1/notifications/unread"),
21
- read: y("POST", "/v1/notifications/:id/read"),
22
- readAll: y("POST", "/v1/notifications/read"),
23
- stream: y.raw("GET", "/v1/notifications/stream"),
24
- test: y("POST", "/v1/notifications/test"),
25
- preferences: y("GET", "/v1/notifications/preferences"),
26
- preferencesSetEmail: y("PUT", "/v1/notifications/preferences/:category"),
27
- quietHours: y("PUT", "/v1/notifications/quiet-hours")
28
- }, pt = {
29
- deadLettersList: y("GET", "/v1/events/dead-letters", { permission: "events.deadletter:view" }),
30
- deadLettersRetry: y("POST", "/v1/events/dead-letters/:event/:consumer/retry", { permission: "events.deadletter:retry" }),
31
- deadLettersRetryAll: y("POST", "/v1/events/dead-letters/retry", { permission: "events.deadletter:retry" }),
32
- consumers: y("GET", "/v1/events/consumers", { permission: "events.deadletter:view" })
33
- }, [ke, ee] = fe("vue-core.notifications"), we = "events.deadletter:view", bt = "events.deadletter:retry", J = Z({
34
- index: { name: "events.deadletters", path: "/events/dead-letters", component: () => import("./DeadLetters-CkDE71B3.js"), meta: { access: we, titleKey: "core.notifications.dead_letters.title" } }
35
- }), j = Z({
36
- index: { name: "notifications.settings", path: "/profile/notifications", component: () => import("./SettingsPage-C3fPSmi7.js"), meta: { titleKey: "core.notifications.settings.title" } }
37
- }), Te = /* @__PURE__ */ z({
38
- __name: "SettingsMenuItem",
39
- setup(o) {
40
- const { t } = N();
41
- return (e, n) => (g(), I(me, {
42
- label: a(t)("core.notifications.settings.title"),
43
- icon: "notification3Line",
44
- to: a(j).index,
45
- "data-notification-settings-menu-item": ""
46
- }, null, 8, ["label", "to"]));
47
- }
48
- });
49
- function te(o) {
50
- return o.reduce((t, e) => Math.max(t, e.id), 0);
51
- }
52
- function Ee(o, t, e) {
53
- return o.map((n) => n.id === t && n.read_at === null ? { ...n, read_at: e } : n);
54
- }
55
- function Ce(o, t, e) {
56
- return o.map((n) => n.read_at === null && n.id <= t ? { ...n, read_at: e } : n);
57
- }
58
- function Le(o, t) {
59
- const e = te(o);
60
- return [...t.filter((n) => n.id > e), ...o];
61
- }
62
- function Se(o, t) {
63
- const e = new Set(o.map((n) => n.id));
64
- return [...o, ...t.filter((n) => !e.has(n.id))];
65
- }
66
- function Re(o, t, e) {
67
- let n = o.items;
68
- if (t.type === "created" && t.notification && !n.some((r) => r.id === t.notification?.id) && (n = [t.notification, ...n]), t.type === "read") {
69
- const r = new Set(t.read_ids ?? []), _ = t.read_up_to_id ?? 0;
70
- n = n.map((f) => f.read_at === null && (t.all_read ? f.id <= _ : r.has(f.id)) ? { ...f, read_at: e } : f);
71
- }
72
- return { items: n, unreadCount: Math.max(0, t.unread_count) };
73
- }
74
- function $e(o) {
75
- return o > 99 ? "99+" : String(o);
76
- }
77
- const Me = ["created", "read", "unread"];
78
- function Ae(o) {
79
- const t = o.split(`
80
- `).filter((e) => e.startsWith("data:")).map((e) => e.slice(5).replace(/^ /, "")).join(`
81
- `);
82
- if (t === "") return null;
83
- try {
84
- const e = JSON.parse(t);
85
- if (typeof e != "object" || e === null) return null;
86
- const { type: n, unread_count: r } = e;
87
- return typeof n == "string" && Me.includes(n) && typeof r == "number" ? e : null;
88
- } catch {
89
- return null;
90
- }
91
- }
92
- async function Pe({ url: o, transport: t, signal: e, onEvent: n, idleTimeout: r }) {
93
- if (e.aborted) return "aborted";
94
- const _ = new AbortController();
95
- let f = null, E = !1, i;
96
- const b = () => {
97
- _.abort(), f?.cancel().catch(() => {
98
- });
99
- }, v = () => {
100
- clearTimeout(i), i = setTimeout(() => {
101
- E = !0, b();
102
- }, r);
103
- };
104
- e.addEventListener("abort", b, { once: !0 }), v();
105
- try {
106
- const l = await t(o, { method: "GET", headers: { Accept: "text/event-stream" }, credentials: "include", signal: _.signal });
107
- if (l.status === 401) return "unauthorized";
108
- if (!l.ok || !l.body) return "failed";
109
- f = l.body.getReader();
110
- const x = new TextDecoder();
111
- let h = "";
112
- for (; ; ) {
113
- const { done: m, value: s } = await f.read();
114
- if (e.aborted) return "aborted";
115
- if (E) return "stalled";
116
- if (m) return "closed";
117
- v(), h += x.decode(s, { stream: !0 }).replace(/\r\n/g, `
118
- `);
119
- const k = h.split(`
120
-
121
- `);
122
- h = k.pop() ?? "";
123
- for (const p of k) {
124
- const A = Ae(p);
125
- A && n(A);
126
- }
127
- }
128
- } catch (l) {
129
- return e.aborted ? "aborted" : E ? "stalled" : l instanceof Error && l.name === "AbortError" ? "aborted" : "failed";
130
- } finally {
131
- clearTimeout(i), e.removeEventListener("abort", b);
132
- }
133
- }
134
- function ze(o) {
135
- const { http: t, signal: e, pageSize: n = 20, backoff: r = { min: 1e3, max: 3e4 }, idleTimeout: _ = 5e4, transport: f = ve, now: E = () => /* @__PURE__ */ new Date() } = o, i = U([]), b = G(0), v = G(!1), l = U({ status: "idle" }), x = G("idle");
136
- let h = 0;
137
- const m = () => E().toISOString();
138
- async function s() {
139
- try {
140
- const { data: c } = await t.request(M.unread, void 0, { signal: e });
141
- e.aborted || (b.value = c.unread_count);
142
- } catch {
143
- }
144
- }
145
- async function k() {
146
- const c = ++h;
147
- x.value = "idle", l.value = { status: "loading" };
148
- try {
149
- const { data: d } = await t.request(M.list, { limit: n }, { signal: e });
150
- if (e.aborted || c !== h) return;
151
- i.value = Le(d.items, i.value), v.value = d.has_more, l.value = { status: "loaded" };
152
- } catch (d) {
153
- if (e.aborted || c !== h) return;
154
- l.value = { status: "failed", error: d };
155
- }
156
- }
157
- async function p() {
158
- const c = i.value[i.value.length - 1]?.id;
159
- if (!v.value || x.value === "loading" || c === void 0) return;
160
- const d = h;
161
- x.value = "loading";
162
- try {
163
- const { data: u } = await t.request(M.list, { before_id: c, limit: n }, { signal: e });
164
- if (e.aborted || d !== h) return;
165
- i.value = Se(i.value, u.items), v.value = u.has_more, x.value = "idle";
166
- } catch {
167
- !e.aborted && d === h && (x.value = "failed");
168
- }
169
- }
170
- async function A(c) {
171
- if (!(c.read_at !== null || i.value.find((d) => d.id === c.id)?.read_at)) {
172
- i.value = Ee(i.value, c.id, m()), b.value = Math.max(0, b.value - 1);
173
- try {
174
- const { data: d } = await t.request(M.read, { id: c.id }, { signal: e });
175
- e.aborted || (b.value = d.unread_count);
176
- } catch {
177
- if (e.aborted) return;
178
- i.value = i.value.map((d) => d.id === c.id ? { ...d, read_at: null } : d), await s();
179
- }
180
- }
181
- }
182
- async function ae() {
183
- const c = te(i.value);
184
- if (c === 0) return;
185
- const d = new Set(i.value.filter((u) => u.read_at === null && u.id <= c).map((u) => u.id));
186
- i.value = Ce(i.value, c, m()), b.value = Math.max(0, b.value - d.size);
187
- try {
188
- const { data: u } = await t.request(M.readAll, { up_to_id: c }, { signal: e });
189
- e.aborted || (b.value = u.unread_count);
190
- } catch {
191
- if (e.aborted) return;
192
- i.value = i.value.map((u) => d.has(u.id) ? { ...u, read_at: null } : u), await s();
193
- }
194
- }
195
- let $ = r.min, O = null;
196
- const ie = (c) => new Promise((d) => {
197
- const u = () => {
198
- clearTimeout(D), e.removeEventListener("abort", u), O = null, d();
199
- }, D = setTimeout(u, c);
200
- e.addEventListener("abort", u, { once: !0 }), O = u;
201
- });
202
- async function re() {
203
- for (let c = !1; !e.aborted; c = !0) {
204
- if (c && await s(), e.aborted) return;
205
- let d = !1;
206
- if (await Pe({
207
- url: o.streamUrl,
208
- transport: f,
209
- signal: e,
210
- idleTimeout: _,
211
- onEvent(u) {
212
- d = !0;
213
- const D = Re({ items: i.value, unreadCount: b.value }, u, m());
214
- i.value = D.items, b.value = D.unreadCount;
215
- }
216
- }), e.aborted) return;
217
- d && ($ = r.min), await ie($), $ = Math.min($ * 2, r.max);
218
- }
219
- }
220
- const V = () => {
221
- document.visibilityState === "visible" && (s(), $ = r.min, O?.());
222
- }, K = () => {
223
- s(), $ = r.min, O?.();
224
- };
225
- return document.addEventListener("visibilitychange", V), window.addEventListener("online", K), e.addEventListener(
226
- "abort",
227
- () => {
228
- document.removeEventListener("visibilitychange", V), window.removeEventListener("online", K);
229
- },
230
- { once: !0 }
231
- ), e.aborted || re(), { items: P(i), unreadCount: P(b), hasMore: P(v), list: P(l), more: P(x), load: k, loadMore: p, markRead: A, markAllRead: ae };
232
- }
233
- const ne = /* @__PURE__ */ z({
234
- __name: "MarkAllRead",
235
- props: {
236
- inbox: {}
237
- },
238
- setup(o) {
239
- const { t } = N();
240
- return (e, n) => (g(), I(a(F), {
241
- prominence: "plain",
242
- size: "sm",
243
- icon: "checkDoubleLine",
244
- "data-notification-mark-all": "",
245
- disabled: o.inbox.unreadCount.value === 0,
246
- onClick: n[0] || (n[0] = (r) => o.inbox.markAllRead())
247
- }, {
248
- default: R(() => [
249
- Q(L(a(t)("core.notifications.mark_all_read")), 1)
250
- ]),
251
- _: 1
252
- }, 8, ["disabled"]));
253
- }
254
- }), oe = /* @__PURE__ */ z({
255
- __name: "SettingsLink",
256
- emits: ["click"],
257
- setup(o, { emit: t }) {
258
- const e = t, { t: n } = N();
259
- return (r, _) => (g(), I(a(F), X({
260
- prominence: "plain",
261
- size: "sm",
262
- icon: "settings3Line",
263
- to: a(j).index
264
- }, { "aria-label": a(n)("core.notifications.settings.open"), title: a(n)("core.notifications.settings.open") }, {
265
- "data-notification-settings": "",
266
- onClick: _[0] || (_[0] = (f) => e("click"))
267
- }), null, 16, ["to"]));
268
- }
269
- }), Ie = {
270
- "data-notification-inbox": "",
271
- class: "w-full min-w-0 sm:w-96"
272
- }, Ne = {
273
- key: 0,
274
- class: "mb-1 flex items-center justify-between gap-2"
275
- }, Oe = { class: "px-1 text-headline font-semibold" }, De = { class: "flex items-center gap-1" }, qe = { class: "-mx-1 max-h-[min(28rem,60dvh)] overflow-y-auto overscroll-contain" }, Ge = ["data-unread", "onClick"], Ue = { class: "min-w-0 flex-1" }, Be = {
276
- key: 0,
277
- class: "mt-0.5 line-clamp-2 block text-footnote text-content-muted"
278
- }, Fe = ["datetime"], je = {
279
- key: 0,
280
- class: "mt-2 size-2 shrink-0 rounded-full bg-content-link",
281
- "aria-hidden": "true"
282
- }, Ve = {
283
- key: 1,
284
- class: "sr-only"
285
- }, Ke = {
286
- key: 0,
287
- class: "mt-2 flex flex-col items-center gap-1",
288
- "data-notification-more": ""
289
- }, We = {
290
- key: 0,
291
- class: "text-footnote text-status-danger-content",
292
- role: "alert"
293
- }, He = "bg-fill text-content-muted", Y = /* @__PURE__ */ z({
294
- __name: "InboxPanel",
295
- props: {
296
- inbox: {},
297
- appearance: {}
298
- },
299
- emits: ["close"],
300
- setup(o, { emit: t }) {
301
- const e = o, n = t, { t: r } = N(), _ = ge(), f = ye(), { categories: E, settings: i } = ee(), b = {
302
- amber: "bg-category-amber-surface text-category-amber-content",
303
- lime: "bg-category-lime-surface text-category-lime-content",
304
- teal: "bg-category-teal-surface text-category-teal-content",
305
- cyan: "bg-category-cyan-surface text-category-cyan-content",
306
- blue: "bg-category-blue-surface text-category-blue-content",
307
- indigo: "bg-category-indigo-surface text-category-indigo-content",
308
- violet: "bg-category-violet-surface text-category-violet-content",
309
- fuchsia: "bg-category-fuchsia-surface text-category-fuchsia-content",
310
- pink: "bg-category-pink-surface text-category-pink-content"
311
- }, v = q(() => {
312
- const { list: m, items: s } = e.inbox;
313
- if (m.value.status === "failed") {
314
- const k = r("core.notifications.load_error");
315
- return s.value.length > 0 ? { status: "stale", value: s.value, error: k } : { status: "failed", error: k };
316
- }
317
- return m.value.status === "loaded" ? { status: "loaded", value: s.value } : s.value.length > 0 ? { status: "refreshing", value: s.value } : { status: "loading" };
318
- }), l = (m) => {
319
- const s = E[m.category];
320
- return { icon: s?.icon ?? "notification3Line", classes: s?.hue ? b[s.hue] : He };
321
- }, x = (m) => m.startsWith("/") && !m.startsWith("//");
322
- function h(m) {
323
- e.inbox.markRead(m), !(m.link === "" || !x(m.link)) && (n("close"), _.push(m.link));
324
- }
325
- return (m, s) => (g(), w("div", Ie, [
326
- o.appearance === "popover" ? (g(), w("div", Ne, [
327
- C("h2", Oe, L(a(r)("core.notifications.title")), 1),
328
- C("div", De, [
329
- a(i) ? (g(), I(oe, {
330
- key: 0,
331
- onClick: s[0] || (s[0] = (k) => n("close"))
332
- })) : S("", !0),
333
- T(ne, { inbox: o.inbox }, null, 8, ["inbox"])
334
- ])
335
- ])) : S("", !0),
336
- T(a(he), {
337
- state: v.value,
338
- "empty-title": a(r)("core.notifications.empty_title"),
339
- "empty-description": a(r)("core.notifications.empty_description"),
340
- "empty-icon": "notification3Line",
341
- onRetry: s[2] || (s[2] = (k) => o.inbox.load())
342
- }, {
343
- default: R(({ value: k }) => [
344
- C("ul", qe, [
345
- (g(!0), w(B, null, ce(k, (p) => (g(), w("li", {
346
- key: p.id
347
- }, [
348
- C("button", {
349
- type: "button",
350
- "data-notification-item": "",
351
- "data-unread": p.read_at === null ? "true" : void 0,
352
- class: "flex w-full cursor-pointer items-start gap-3 rounded-control px-2 py-2.5 text-left transition-colors duration-motion-fast hover:bg-fill focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
353
- onClick: (A) => h(p)
354
- }, [
355
- C("span", {
356
- class: W(["flex size-9 shrink-0 items-center justify-center rounded-full", l(p).classes]),
357
- "aria-hidden": "true"
358
- }, [
359
- T(a(xe), {
360
- name: l(p).icon,
361
- size: 18
362
- }, null, 8, ["name"])
363
- ], 2),
364
- C("span", Ue, [
365
- C("span", {
366
- class: W(["block text-subheadline", p.read_at === null ? "font-semibold text-content-strong" : "font-medium text-content"])
367
- }, L(p.title), 3),
368
- p.body ? (g(), w("span", Be, L(p.body), 1)) : S("", !0),
369
- C("time", {
370
- datetime: p.created_at,
371
- class: "mt-0.5 block text-footnote text-content-muted"
372
- }, L(a(f).relative(p.created_at)), 9, Fe)
373
- ]),
374
- p.read_at === null ? (g(), w("span", je)) : S("", !0),
375
- p.read_at === null ? (g(), w("span", Ve, L(a(r)("core.notifications.unread")), 1)) : S("", !0)
376
- ], 8, Ge)
377
- ]))), 128))
378
- ]),
379
- o.inbox.hasMore.value ? (g(), w("div", Ke, [
380
- o.inbox.more.value === "failed" ? (g(), w("p", We, L(a(r)("core.notifications.load_more_error")), 1)) : S("", !0),
381
- T(a(F), {
382
- prominence: "plain",
383
- size: "sm",
384
- processing: o.inbox.more.value === "loading",
385
- onClick: s[1] || (s[1] = (p) => o.inbox.loadMore())
386
- }, {
387
- default: R(() => [
388
- Q(L(a(r)("core.notifications.load_more")), 1)
389
- ]),
390
- _: 1
391
- }, 8, ["processing"])
392
- ])) : S("", !0)
393
- ]),
394
- _: 1
395
- }, 8, ["state", "empty-title", "empty-description"])
396
- ]));
397
- }
398
- }), Je = { class: "flex items-center justify-center" }, Ye = /* @__PURE__ */ z({
399
- __name: "NotificationBell",
400
- setup(o) {
401
- const { t } = N(), { inbox: e, settings: n } = ee(), r = pe(), _ = de("sheet"), f = q(() => e.value?.unreadCount.value ?? 0), E = q(() => f.value > 0 ? t("core.notifications.open_unread", { count: f.value }) : t("core.notifications.open")), i = q(() => f.value > 0 ? $e(f.value) : void 0);
402
- return (b, v) => a(e) ? (g(), w(B, { key: 0 }, [
403
- a(r) ? (g(), w(B, { key: 1 }, [
404
- T(H, {
405
- icon: "notification3Line",
406
- label: E.value,
407
- badge: i.value,
408
- "data-notification-bell": "",
409
- onClick: v[1] || (v[1] = (l) => {
410
- _.value?.present(), a(e).load();
411
- })
412
- }, null, 8, ["label", "badge"]),
413
- T(a(be), {
414
- ref_key: "sheet",
415
- ref: _,
416
- title: a(t)("core.notifications.title")
417
- }, ue({
418
- footer: R(() => [
419
- C("div", Je, [
420
- T(ne, { inbox: a(e) }, null, 8, ["inbox"])
421
- ])
422
- ]),
423
- default: R(() => [
424
- T(Y, {
425
- inbox: a(e),
426
- appearance: "sheet",
427
- onClose: v[3] || (v[3] = (l) => _.value?.dismiss())
428
- }, null, 8, ["inbox"])
429
- ]),
430
- _: 2
431
- }, [
432
- a(n) ? {
433
- name: "actions",
434
- fn: R(() => [
435
- T(oe, {
436
- onClick: v[2] || (v[2] = (l) => _.value?.dismiss())
437
- })
438
- ]),
439
- key: "0"
440
- } : void 0
441
- ]), 1032, ["title"])
442
- ], 64)) : (g(), I(a(_e), {
443
- key: 0,
444
- placement: "bottom-start",
445
- width: "auto",
446
- arrow: !1,
447
- label: a(t)("core.notifications.title"),
448
- onPresented: v[0] || (v[0] = (l) => a(e).load())
449
- }, {
450
- trigger: R(({ toggle: l, attrs: x }) => [
451
- T(H, X(x, {
452
- icon: "notification3Line",
453
- label: E.value,
454
- badge: i.value,
455
- "data-notification-bell": "",
456
- onClick: l
457
- }), null, 16, ["label", "badge", "onClick"])
458
- ]),
459
- default: R(({ dismiss: l }) => [
460
- T(Y, {
461
- inbox: a(e),
462
- appearance: "popover",
463
- onClose: l
464
- }, null, 8, ["inbox", "onClose"])
465
- ]),
466
- _: 1
467
- }, 8, ["label"]))
468
- ], 64)) : S("", !0);
469
- }
470
- });
471
- function Qe(o) {
472
- return {
473
- id: "notifications.inbox",
474
- scope: "session",
475
- start({ signal: t, platform: e }) {
476
- const n = e.config.apiBase.replace(/\/+$/, "");
477
- return o.value = ze({ http: e.http, streamUrl: `${n}/${M.stream.path.replace(/^\/+/, "")}`, signal: t }), () => {
478
- o.value = null;
479
- };
480
- }
481
- };
482
- }
483
- function _t(o = {}) {
484
- const t = U(null), e = o.deadLetters ?? {}, n = o.settings ?? !0;
485
- return se({
486
- id: "notifications",
487
- routes: [...e === !1 ? [] : J.records, ...n ? j.records : []],
488
- navigation: e !== !1 && e.destination ? [{ destination: e.destination, to: J.index }] : [],
489
- context: le(ke, { inbox: t, categories: o.categories ?? {}, settings: n }),
490
- contributions: [
491
- { id: "notifications.bell", slot: "headerActions", component: Ye, scope: "authenticated" },
492
- ...n ? [{ id: "notifications.settings", slot: "accountMenu", component: Te, scope: "authenticated", optional: !0, order: -9 }] : []
493
- ],
494
- effects: [Qe(t)]
495
- });
496
- }
497
- export {
498
- bt as R,
499
- j as a,
500
- _t as b,
501
- J as d,
502
- pt as e,
503
- M as n
504
- };
@@ -1,14 +0,0 @@
1
- import type { Preferences } from "../../modules/notification/entities";
2
- /**
3
- * "E-mail me about": one switch per category the application declared, saved as it is switched (one on its way ignores another
4
- * touch). A setting someone else enforces is a row that reads, with who decides; without e-mail there is a sentence and no switches. In-app is not a switch: it is always on.
5
- */
6
- type __VLS_Props = {
7
- preferences: Preferences;
8
- };
9
- declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
- change: (category: string, enabled: boolean) => any;
11
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
- onChange?: ((category: string, enabled: boolean) => any) | undefined;
13
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
- export default _default;
@@ -1,18 +0,0 @@
1
- function l(t) {
2
- const o = /* @__PURE__ */ new Map();
3
- for (const e of t) {
4
- const n = e.group ?? null, r = o.get(n) ?? [];
5
- r.push(e), o.set(n, r);
6
- }
7
- return [...o.entries()].sort(([e], [n]) => e === null ? -1 : n === null ? 1 : 0).map(([e, n]) => ({ title: e, options: n }));
8
- }
9
- function c(t, o) {
10
- const e = s(o.trim());
11
- return e === "" ? t : t.filter((n) => s(n.label).includes(e) || n.description !== void 0 && s(n.description).includes(e));
12
- }
13
- const s = (t) => t.normalize("NFD").replace(/[̀-ͯ]/g, "").toLocaleLowerCase();
14
- export {
15
- s as f,
16
- l as g,
17
- c as m
18
- };
@@ -1,13 +0,0 @@
1
- function u(e, i, r = {}) {
2
- return { method: e, path: i, permission: r.permission, public: r.public === !0, raw: !1 };
3
- }
4
- u.raw = (e, i, r = {}) => ({
5
- method: e,
6
- path: i,
7
- permission: r.permission,
8
- public: r.public === !0,
9
- raw: !0
10
- });
11
- export {
12
- u as r
13
- };
@@ -1,4 +0,0 @@
1
- const s = (t, o) => globalThis.fetch(t, o);
2
- export {
3
- s as f
4
- };