@wssto2/vue-core 0.4.28 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-J5HoyGNJ.js → AccessGate.vue_vue_type_script_setup_true_lang-DZ9GcLC1.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-dpY2kIs2.js} +7 -7
  5. package/dist/{Changes-MG77TDwz.js → Changes-CL8F1w8q.js} +6 -6
  6. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-Bnpv9TEj.js → CollectionPage.vue_vue_type_script_setup_true_lang-l-e-6WeS.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-BZLyL5lR.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-mrVzi-5R.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-B2DItwvf.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-EiTIYzZ5.js +764 -0
  17. package/dist/RoleEditor.vue_vue_type_script_setup_true_lang-BqqilJGF.js +325 -0
  18. package/dist/RolePage-jMHAt9y8.js +314 -0
  19. package/dist/{RolesPage-B5RwSZ89.js → RolesPage-B9GaVQBx.js} +6 -6
  20. package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-Dmv6TpCi.js → SectionNavigator.vue_vue_type_script_setup_true_lang-Ci04hApd.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-CHLokZ9e.js} +5 -5
  25. package/dist/SettingsPage-CudoKdXm.js +632 -0
  26. package/dist/{SignIn-COThB9XN.js → SignIn-ypRvdmjg.js} +7 -7
  27. package/dist/{SignInPage-CdzgSvRm.js → SignInPage-CbPeKlAo.js} +4 -4
  28. package/dist/SignIns-BApzbGq-.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-BCTaBajE.js} +13 -13
  34. package/dist/{UsersList-Chq8yM5C.js → UsersList-CqSK3cQL.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 +118 -116
  44. package/dist/app/keepAlive.d.ts +4 -8
  45. package/dist/client/index.js +19 -11
  46. package/dist/{client-k9euDWF4.js → client-BHPFfBj3.js} +20 -20
  47. package/dist/collection/index.js +3 -3
  48. package/dist/content/index.js +66 -37
  49. package/dist/{contributions-BVBZP5Jb.js → contributions-fx5q5n1u.js} +1 -1
  50. package/dist/{describeError-B-NMa--w.js → describeError-BqGAUZgX.js} +1 -1
  51. package/dist/{error-CD7x0Jrz.js → error-Bb_dr_Ay.js} +2 -2
  52. package/dist/{fieldMessages-6HVzSDqG.js → fieldMessages-DTXpWnBd.js} +7 -7
  53. package/dist/form/index.js +1235 -1412
  54. package/dist/{guards-BJZjc3FZ.js → guards-D4mXf_2X.js} +1 -1
  55. package/dist/{http-BFfkA7gN.js → http-CdQowFlW.js} +1 -1
  56. package/dist/i18n/index.d.ts +2 -2
  57. package/dist/i18n/index.js +30 -30
  58. package/dist/identity/index.d.ts +3 -1
  59. package/dist/identity/index.js +7 -6
  60. package/dist/identity/profile/DetailsFields.vue.d.ts +8 -0
  61. package/dist/identity/profile/{DetailsPanel.vue.d.ts → DetailsGroup.vue.d.ts} +4 -1
  62. package/dist/identity/profile/{EmailPanel.vue.d.ts → EmailGroup.vue.d.ts} +1 -1
  63. package/dist/identity/profile/SignInsGroup.vue.d.ts +2 -0
  64. package/dist/identity/profile/profileSections.d.ts +37 -0
  65. package/dist/identity/session.d.ts +10 -7
  66. package/dist/identity/shared/SignInList.vue.d.ts +22 -0
  67. package/dist/identity/shared/deviceLabel.d.ts +7 -0
  68. package/dist/identity/useReturnToOwnAccount.d.ts +10 -0
  69. package/dist/identity/users/context.d.ts +3 -0
  70. package/dist/identity/users/feature.d.ts +3 -0
  71. package/dist/index-BTRv8mcf.js +630 -0
  72. package/dist/index-VPzJJN6Z.js +745 -0
  73. package/dist/index-auJqVMWC.js +478 -0
  74. package/dist/index.d.ts +1 -1
  75. package/dist/index.js +1 -1
  76. package/dist/keepAlive-z3IRFkQq.js +46 -0
  77. package/dist/modules/notification/entities.d.ts +19 -0
  78. package/dist/modules/notification/routes.d.ts +25 -1
  79. package/dist/modules/notification/schemas.d.ts +24 -0
  80. package/dist/{navigation-DpcDF0rX.js → navigation-Bc5EQ_Si.js} +1 -1
  81. package/dist/{neighbors-RVQ4O3Qv.js → neighbors-Bv6vnWlW.js} +22 -22
  82. package/dist/notifications/context.d.ts +24 -1
  83. package/dist/notifications/feature.d.ts +10 -1
  84. package/dist/notifications/index.d.ts +1 -1
  85. package/dist/notifications/index.js +1 -1
  86. package/dist/notifications/push/DevicesSection.vue.d.ts +12 -0
  87. package/dist/notifications/push/ThisDeviceSection.vue.d.ts +15 -0
  88. package/dist/notifications/push/browser.d.ts +40 -0
  89. package/dist/notifications/push/devices.d.ts +15 -0
  90. package/dist/notifications/push/thisDevice.d.ts +28 -0
  91. package/dist/notifications/settings/ChannelsSection.vue.d.ts +16 -0
  92. package/dist/notifications/settings/{QuietHoursPanel.vue.d.ts → QuietHoursSection.vue.d.ts} +3 -1
  93. package/dist/notifications/settings/SettingsBody.vue.d.ts +17 -0
  94. package/dist/notifications/settings/settings.d.ts +4 -3
  95. package/dist/notifications/settings/state.d.ts +4 -2
  96. package/dist/options-g8RwEhBk.js +366 -0
  97. package/dist/overlay/index.js +37 -59
  98. package/dist/page/index.js +1 -1
  99. package/dist/phone/index.js +10 -11
  100. package/dist/platform/index.js +3 -3
  101. package/dist/platform/platform.d.ts +7 -2
  102. package/dist/platform/session.d.ts +17 -0
  103. package/dist/platform-Dx6STiwY.js +283 -0
  104. package/dist/push-worker/index.d.ts +91 -0
  105. package/dist/push-worker/index.js +54 -0
  106. package/dist/resource/index.js +1 -1
  107. package/dist/{routeResource-DlTsGTg_.js → routeResource-CcYA75T2.js} +2 -2
  108. package/dist/router/index.js +3 -3
  109. package/dist/{sections-CeZl-Jxg.js → sections-B0HxIOC2.js} +1 -1
  110. package/dist/shell/index.js +3 -3
  111. package/dist/signInEvents-DWShrJox.js +30 -0
  112. package/dist/state/index.js +1 -1
  113. package/dist/{status-dGvfh1TP.js → status-BUFELJz2.js} +2 -2
  114. package/dist/styles.css +1 -1
  115. package/dist/{suggestions-DHJFKB26.js → suggestions-CfFTHi8y.js} +2 -2
  116. package/dist/testing/index.js +1 -1
  117. package/dist/{useCommand-Cj-APj-P.js → useCommand-CtqheKUv.js} +2 -2
  118. package/dist/useGroupSheet-ATvc0IiM.js +278 -0
  119. package/dist/{useLoad-M7V-AVwR.js → useLoad-W4tfxmm5.js} +1 -1
  120. package/dist/{useResourceForm-tGYTfKhH.js → useResourceForm-CJfl8rj_.js} +1 -1
  121. package/package.json +6 -2
  122. package/dist/KeyValue.vue_vue_type_script_setup_true_lang-wcZcvnow.js +0 -35
  123. package/dist/OtpInput.vue_vue_type_script_setup_true_lang-gp4FfWAH.js +0 -95
  124. package/dist/PanelActions.vue_vue_type_script_setup_true_lang-E9VdIGkf.js +0 -46
  125. package/dist/ProfilePage-C8VhiKIh.js +0 -654
  126. package/dist/RoleEditor.vue_vue_type_script_setup_true_lang-DRHmjA9w.js +0 -300
  127. package/dist/RolePage-ODFu68Ce.js +0 -315
  128. package/dist/SessionList.vue_vue_type_script_setup_true_lang-D5qm77Zo.js +0 -111
  129. package/dist/SettingsPage-C3fPSmi7.js +0 -255
  130. package/dist/SignInTable.vue_vue_type_script_setup_true_lang-Bs0yTi2E.js +0 -79
  131. package/dist/SignIns-cztICmqt.js +0 -66
  132. package/dist/control-B4SdblL6.js +0 -350
  133. package/dist/identity/profile/PanelActions.vue.d.ts +0 -17
  134. package/dist/index-BhtJR4c_.js +0 -459
  135. package/dist/index-C3E6DcO0.js +0 -706
  136. package/dist/index-sTBBHqNG.js +0 -504
  137. package/dist/keepAlive-CDvMQlcJ.js +0 -49
  138. package/dist/notifications/settings/EmailPanel.vue.d.ts +0 -14
  139. package/dist/options-Ba_0uLWN.js +0 -18
  140. package/dist/platform-PZpUkkMS.js +0 -268
  141. package/dist/route-goWMxDUN.js +0 -13
  142. package/dist/transport-BnP7WC0Y.js +0 -4
  143. /package/dist/identity/{profile/PasswordPanel.vue.d.ts → ReturnMenuItem.vue.d.ts} +0 -0
  144. /package/dist/identity/profile/{SessionsPanel.vue.d.ts → PasswordGroup.vue.d.ts} +0 -0
  145. /package/dist/identity/profile/{SignInsPanel.vue.d.ts → SessionsGroup.vue.d.ts} +0 -0
@@ -0,0 +1,283 @@
1
+ import { c as U } from "./client-BHPFfBj3.js";
2
+ import { d as _ } from "./context-Ch1r4fdN.js";
3
+ import { i as A, A as z } from "./error-Bb_dr_Ay.js";
4
+ import { shallowRef as C } from "vue";
5
+ const I = (e, t) => e.level === t.level && e.id === t.id, T = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
6
+ function N(e, t = {}) {
7
+ const n = t.covers ?? I;
8
+ function o(s) {
9
+ const r = e();
10
+ return !r || !T(r.permissions, s) || r.unavailable.includes(s) ? null : r.permissions[s] ?? null;
11
+ }
12
+ function i(s, r) {
13
+ const c = o(s);
14
+ return c ? r ? (c.clauses.length > 0 ? c.clauses.map((f) => f.scope) : [c.scope]).some((f) => n(f, r)) : !0 : !1;
15
+ }
16
+ return {
17
+ get root() {
18
+ return e()?.root ?? !1;
19
+ },
20
+ can: i,
21
+ canAny: (s) => s.some((r) => i(r)),
22
+ canAll: (s) => s.every((r) => i(r)),
23
+ held: o
24
+ };
25
+ }
26
+ const $ = ["own", "own_location", "all"], y = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
27
+ function S(e, t, n) {
28
+ return !y(e) || typeof e.level != "string" ? (n.push(`${t}: expected { level: string, id?: number }`), { level: "" }) : (e.id !== void 0 && typeof e.id != "number" && n.push(`${t}.id: expected number`), typeof e.id == "number" ? { level: e.level, id: e.id } : { level: e.level });
29
+ }
30
+ function O(e, t, n) {
31
+ return typeof e == "string" && $.includes(e) ? e : (n.push(`${t}: expected one of ${$.join(", ")}`), "own");
32
+ }
33
+ function B(e) {
34
+ const t = [], n = {}, o = { root: !1, permissions: {}, unavailable: [] };
35
+ if (!y(e)) return { snapshot: o, issues: ["access: expected an object"] };
36
+ if (!y(e.permissions)) t.push("access.permissions: expected an object");
37
+ else
38
+ for (const [s, r] of Object.entries(e.permissions)) {
39
+ const c = `access.permissions.${s}`;
40
+ if (!y(r)) {
41
+ t.push(`${c}: expected an object`);
42
+ continue;
43
+ }
44
+ const a = (Array.isArray(r.clauses) ? r.clauses : []).map((f, b) => {
45
+ const h = `${c}.clauses[${b}]`;
46
+ if (!y(f))
47
+ return t.push(`${h}: expected an object`), { scope: { level: "" }, qualifier: "own" };
48
+ const d = { scope: S(f.scope, `${h}.scope`, t), qualifier: O(f.qualifier, `${h}.qualifier`, t) };
49
+ return typeof f.role == "string" ? { ...d, role: f.role } : d;
50
+ });
51
+ n[s] = {
52
+ scope: S(r.scope, `${c}.scope`, t),
53
+ qualifier: O(r.qualifier, `${c}.qualifier`, t),
54
+ clauses: a
55
+ };
56
+ }
57
+ const i = e.unavailable ?? [];
58
+ return (!Array.isArray(i) || !i.every((s) => typeof s == "string")) && t.push("access.unavailable: expected an array of strings"), {
59
+ snapshot: {
60
+ root: e.root === !0,
61
+ permissions: n,
62
+ unavailable: Array.isArray(i) ? i.filter((s) => typeof s == "string") : []
63
+ },
64
+ issues: t
65
+ };
66
+ }
67
+ const F = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
68
+ function P(e, t, n = "navigation") {
69
+ return Array.isArray(e) ? e.flatMap((o, i) => {
70
+ const s = `${n}[${i}]`;
71
+ if (!F(o) || typeof o.i18n != "string")
72
+ return t.push(`${s}: expected an object with an i18n key`), [];
73
+ for (const c of ["icon", "route"])
74
+ o[c] != null && typeof o[c] != "string" && t.push(`${s}.${c}: expected a string`);
75
+ const r = o.children == null ? void 0 : P(o.children, t, `${s}.children`);
76
+ return [
77
+ {
78
+ i18n: o.i18n,
79
+ ...typeof o.icon == "string" && { icon: o.icon },
80
+ ...typeof o.route == "string" && { route: o.route },
81
+ ...r && { children: r }
82
+ }
83
+ ];
84
+ }) : (t.push(`${n}: expected an array`), []);
85
+ }
86
+ const w = (e) => typeof e == "object" && e !== null && !Array.isArray(e), H = (e) => {
87
+ if (w(e) && (typeof e.id == "number" || typeof e.id == "string")) return { id: e.id };
88
+ throw new TypeError("expected an object with a numeric or string id");
89
+ };
90
+ function Q(e, t = H) {
91
+ const n = [];
92
+ if (!w(e)) throw j(["expected an object"]);
93
+ let o = null;
94
+ try {
95
+ o = t(e.user);
96
+ } catch (a) {
97
+ n.push(`user: ${a instanceof Error ? a.message : "invalid"}`);
98
+ }
99
+ let i = null;
100
+ if (e.expires_at !== void 0 && e.expires_at !== null) {
101
+ const a = typeof e.expires_at == "string" ? new Date(e.expires_at) : null;
102
+ a === null || Number.isNaN(a.getTime()) ? n.push("expires_at: expected an ISO date-time string") : i = a;
103
+ }
104
+ let s;
105
+ if (e.impersonator !== void 0 && e.impersonator !== null) {
106
+ const a = e.impersonator;
107
+ w(a) && (typeof a.id == "number" || typeof a.id == "string") && typeof a.name == "string" ? s = { id: a.id, name: a.name } : n.push("impersonator: expected { id, name }");
108
+ }
109
+ const r = B(e.access);
110
+ n.push(...r.issues);
111
+ const c = e.navigation === void 0 || e.navigation === null ? void 0 : P(e.navigation, n);
112
+ if (o === null || n.length > 0) throw j(n);
113
+ return { user: o, expiresAt: i, access: r.snapshot, ...s && { impersonator: s }, ...c && { navigation: c } };
114
+ }
115
+ const j = (e) => new z({ kind: "malformed", message: `Unreadable session payload: ${e.join("; ")}` });
116
+ function R(e, t = {}) {
117
+ const { mePath: n = "/auth/me", signOutPath: o = "/auth/logout", parseUser: i } = t;
118
+ return {
119
+ async load(s) {
120
+ try {
121
+ const { data: r } = await e.get(n, { signal: s, handleUnauthorized: !1 });
122
+ return Q(r, i);
123
+ } catch (r) {
124
+ if (A(r) && r.kind === "unauthorized") return null;
125
+ throw r;
126
+ }
127
+ },
128
+ async signOut() {
129
+ try {
130
+ await e.post(o, void 0, { handleUnauthorized: !1 });
131
+ } catch (s) {
132
+ if (!(A(s) && s.kind === "unauthorized")) throw s;
133
+ }
134
+ }
135
+ };
136
+ }
137
+ function k(e) {
138
+ return e.status === "authenticated" ? e : e.status === "anonymous" && e.reason === "expired" ? e.previous ?? null : null;
139
+ }
140
+ const E = 3e3;
141
+ function D(e, t = {}) {
142
+ const n = C({ status: "unknown" });
143
+ let o = 0;
144
+ const i = new Set(t.beforeSignOut ? [t.beforeSignOut] : []);
145
+ let s = !1, r = null, c = null, a = null;
146
+ function f() {
147
+ o++, a?.controller.abort(), a = null;
148
+ }
149
+ async function b(u) {
150
+ const l = new AbortController();
151
+ let g;
152
+ const v = new Promise((m) => {
153
+ g = setTimeout(() => {
154
+ l.abort(), t.onError?.(new Error(`A before-sign-out hook did not finish within ${E} ms; signing out without it.`)), m();
155
+ }, E);
156
+ }), x = Promise.all(
157
+ [...i].map(async (m) => {
158
+ try {
159
+ await m(u, l.signal);
160
+ } catch (p) {
161
+ t.onError?.(p);
162
+ }
163
+ })
164
+ ).then(() => {
165
+ });
166
+ await Promise.race([x, v]), clearTimeout(g);
167
+ }
168
+ function h() {
169
+ if (a) return a.promise;
170
+ const u = o, l = new AbortController(), g = n.value, v = k(g) !== null;
171
+ v || (n.value = { status: "loading" });
172
+ const x = async () => {
173
+ try {
174
+ const p = await e.load(l.signal);
175
+ if (o !== u) return n.value;
176
+ n.value = p ? { status: "authenticated", ...p } : { status: "anonymous", reason: "none" };
177
+ } catch (p) {
178
+ if (o !== u) return n.value;
179
+ t.onError?.(p), n.value = v ? g : { status: "failed", error: p };
180
+ } finally {
181
+ o === u && (a = null);
182
+ }
183
+ return n.value;
184
+ }, m = Promise.resolve().then(x);
185
+ return a = { controller: l, promise: m }, m;
186
+ }
187
+ const d = {
188
+ state: n,
189
+ restore: () => n.value.status === "unknown" || n.value.status === "failed" ? h() : a?.promise ?? Promise.resolve(n.value),
190
+ refresh: h,
191
+ establish(u) {
192
+ f(), n.value = { status: "authenticated", ...u };
193
+ },
194
+ update(u) {
195
+ const l = n.value;
196
+ if (l.status === "authenticated") {
197
+ if (u.user && u.user.id !== l.user.id)
198
+ throw new Error(`session.update cannot change who is signed in (user ${String(l.user.id)} to ${String(u.user.id)}); use session.establish for a different person.`);
199
+ n.value = {
200
+ ...l,
201
+ user: u.user ?? l.user,
202
+ access: u.access ?? l.access,
203
+ ...(u.navigation ?? l.navigation) && { navigation: u.navigation ?? l.navigation }
204
+ };
205
+ }
206
+ },
207
+ expire() {
208
+ if (n.value.status !== "authenticated") return;
209
+ const { status: u, ...l } = n.value;
210
+ f(), n.value = s && !n.value.impersonator ? { status: "anonymous", reason: "expired", previous: l } : { status: "anonymous", reason: "expired" }, t.onExpired?.();
211
+ },
212
+ signOut() {
213
+ return r ?? (r = (async () => {
214
+ try {
215
+ const u = n.value;
216
+ u.status === "authenticated" && i.size > 0 && await b(u.user), f(), n.value = { status: "anonymous", reason: "signedOut" }, await e.signOut();
217
+ } finally {
218
+ r = null;
219
+ }
220
+ })()), r;
221
+ },
222
+ get renewable() {
223
+ return t.renew !== void 0 && (t.renewable?.() ?? !0);
224
+ },
225
+ renew() {
226
+ return n.value.status !== "authenticated" ? Promise.resolve(!1) : (c ?? (c = (async () => {
227
+ try {
228
+ if (d.renewable && await t.renew(d)) return !0;
229
+ } catch {
230
+ }
231
+ return d.expire(), !1;
232
+ })().finally(() => {
233
+ c = null;
234
+ })), c);
235
+ },
236
+ holdExpired(u) {
237
+ s = u;
238
+ },
239
+ onBeforeSignOut(u) {
240
+ return i.add(u), () => void i.delete(u);
241
+ }
242
+ };
243
+ return d;
244
+ }
245
+ function V(e) {
246
+ const t = U({
247
+ baseUrl: e.config.apiBase,
248
+ transport: e.transport,
249
+ headers: e.headers,
250
+ credentials: e.credentials,
251
+ requestId: e.requestId,
252
+ async onUnauthorized() {
253
+ return await i.renew() ? "retry" : "fail";
254
+ }
255
+ }), n = e.session ?? ((r) => R(r)), o = typeof n == "function" ? n(t) : n, i = D(o, {
256
+ onError: e.onSessionError,
257
+ onExpired: e.onSessionExpired,
258
+ beforeSignOut: e.beforeSignOut,
259
+ renew: e.renewSession && ((r) => e.renewSession(r, t)),
260
+ renewable: e.renewable
261
+ }), s = N(
262
+ () => k(i.state.value)?.access ?? null,
263
+ { covers: e.covers }
264
+ );
265
+ return { config: e.config, http: t, session: i, access: s };
266
+ }
267
+ const q = _("platform"), K = q[0], W = q[1];
268
+ function X(e, t) {
269
+ e.provide(K, t);
270
+ }
271
+ export {
272
+ V as a,
273
+ E as b,
274
+ N as c,
275
+ D as d,
276
+ R as e,
277
+ Q as f,
278
+ K as g,
279
+ k as h,
280
+ X as i,
281
+ P as p,
282
+ W as u
283
+ };
@@ -0,0 +1,91 @@
1
+ /** The JSON go-core's push worker sends (NOTIF-DEVICE-001): no secrets and no customer contact data. */
2
+ export interface PushPayload {
3
+ /** 0 for a bundle of several notifications. */
4
+ notification_id: number;
5
+ category: string;
6
+ title: string;
7
+ body: string;
8
+ /** An in-app path. */
9
+ link: string;
10
+ /** Notifications with the same tag replace each other. */
11
+ tag: string;
12
+ /** For the app icon badge; absent when the server did not say. */
13
+ unread_count?: number;
14
+ }
15
+ export interface PushHandlersOptions {
16
+ /** The notification's icon (a URL on the application's origin). */
17
+ icon?: string;
18
+ /** The small monochrome badge some platforms draw; default the icon. */
19
+ badge?: string;
20
+ /** Shown when a push carries no title. Default "". */
21
+ fallbackTitle?: string;
22
+ }
23
+ /** A push payload read defensively: a missing or malformed field becomes its empty value, so a notification is always shown. */
24
+ export declare function readPayload(raw: unknown): PushPayload;
25
+ /**
26
+ * The path, query and hash of a link when it stays on `origin`, "/" otherwise: a payload can name another site or a
27
+ * `javascript:` URL, and only the application's own pages are ever opened.
28
+ */
29
+ export declare function sameOriginLink(link: unknown, origin: string): string;
30
+ interface WaitableEvent {
31
+ waitUntil(work: Promise<unknown>): void;
32
+ }
33
+ interface PushEventLike extends WaitableEvent {
34
+ data: {
35
+ json(): unknown;
36
+ } | null;
37
+ }
38
+ interface NotificationClickEventLike extends WaitableEvent {
39
+ notification: {
40
+ close(): void;
41
+ data?: unknown;
42
+ };
43
+ }
44
+ interface WindowClientLike {
45
+ url: string;
46
+ focus(): Promise<unknown>;
47
+ navigate?(url: string): Promise<unknown>;
48
+ }
49
+ /** The part of the service worker's global scope the handlers use; `self` is one. */
50
+ export interface PushWorkerScope {
51
+ addEventListener(type: "push", listener: (event: PushEventLike) => void): void;
52
+ addEventListener(type: "notificationclick", listener: (event: NotificationClickEventLike) => void): void;
53
+ location: {
54
+ origin: string;
55
+ };
56
+ registration: {
57
+ showNotification(title: string, options: {
58
+ body: string;
59
+ icon?: string;
60
+ badge?: string;
61
+ tag?: string;
62
+ data: {
63
+ notification_id: number;
64
+ link: string;
65
+ };
66
+ }): Promise<void>;
67
+ };
68
+ clients: {
69
+ matchAll(options: {
70
+ type: "window";
71
+ includeUncontrolled: true;
72
+ }): Promise<readonly WindowClientLike[]>;
73
+ openWindow(url: string): Promise<unknown>;
74
+ };
75
+ navigator: {
76
+ setAppBadge?(count: number): Promise<void>;
77
+ clearAppBadge?(): Promise<void>;
78
+ };
79
+ }
80
+ /**
81
+ * Adds the two handlers go-core's web push needs to the service worker:
82
+ *
83
+ * - `push` shows every push as a notification (browsers, Apple's above all, drop a subscription that pushes silently), titled and
84
+ * tagged as the payload says, and sets the app icon badge to its `unread_count` (clearing it at 0);
85
+ * - `notificationclick` closes the notification and brings the application's window to the front on the notification's link: an
86
+ * open window of this origin is focused and navigated, otherwise a new one is opened. A link to another origin opens "/".
87
+ *
88
+ * Call it once, at the top level of the worker's file. `scope` is the worker's global scope (`self`) and is only given in tests.
89
+ */
90
+ export declare function installPushHandlers(options?: PushHandlersOptions, scope?: PushWorkerScope): void;
91
+ export {};
@@ -0,0 +1,54 @@
1
+ function l(i) {
2
+ const t = typeof i == "object" && i !== null ? i : {}, n = (o) => typeof t[o] == "string" ? t[o] : "";
3
+ return {
4
+ notification_id: typeof t.notification_id == "number" ? t.notification_id : 0,
5
+ category: n("category"),
6
+ title: n("title"),
7
+ body: n("body"),
8
+ link: n("link"),
9
+ tag: n("tag"),
10
+ ...typeof t.unread_count == "number" ? { unread_count: t.unread_count } : {}
11
+ };
12
+ }
13
+ function d(i, t) {
14
+ if (typeof i != "string" || i === "") return "/";
15
+ try {
16
+ const n = new URL(i, t);
17
+ return n.origin === t ? n.pathname + n.search + n.hash : "/";
18
+ } catch {
19
+ return "/";
20
+ }
21
+ }
22
+ function g(i = {}, t = self) {
23
+ t.addEventListener("push", (n) => {
24
+ let o;
25
+ try {
26
+ o = n.data?.json();
27
+ } catch {
28
+ o = void 0;
29
+ }
30
+ const a = l(o), r = t.registration.showNotification(a.title || i.fallbackTitle || "", {
31
+ body: a.body,
32
+ ...i.icon ? { icon: i.icon } : {},
33
+ ...i.badge ?? i.icon ? { badge: i.badge ?? i.icon } : {},
34
+ ...a.tag ? { tag: a.tag } : {},
35
+ data: { notification_id: a.notification_id, link: d(a.link, t.location.origin) }
36
+ }), { unread_count: e } = a, c = e !== void 0 && t.navigator.setAppBadge && t.navigator.clearAppBadge ? (e > 0 ? t.navigator.setAppBadge(e) : t.navigator.clearAppBadge()).catch(() => {
37
+ }) : Promise.resolve();
38
+ n.waitUntil(Promise.all([r, c]));
39
+ }), t.addEventListener("notificationclick", (n) => {
40
+ n.notification.close();
41
+ const o = n.notification.data ?? {}, a = d(o.link, t.location.origin);
42
+ n.waitUntil(
43
+ t.clients.matchAll({ type: "window", includeUncontrolled: !0 }).then(async (r) => {
44
+ const e = r.find((c) => new URL(c.url).origin === t.location.origin);
45
+ return e ? (await e.focus(), e.navigate ? e.navigate(a).catch(() => t.clients.openWindow(a)) : t.clients.openWindow(a)) : t.clients.openWindow(a);
46
+ })
47
+ );
48
+ });
49
+ }
50
+ export {
51
+ g as installPushHandlers,
52
+ l as readPayload,
53
+ d as sameOriginLink
54
+ };
@@ -1,4 +1,4 @@
1
- import { p as o, u as r, a, b as u } from "../routeResource-DlTsGTg_.js";
1
+ import { p as o, u as r, a, b as u } from "../routeResource-CcYA75T2.js";
2
2
  import { _ as R, a as c } from "../ResourcePage.vue_vue_type_script_setup_true_lang-BFBGvevP.js";
3
3
  export {
4
4
  R as RecordPager,
@@ -2,8 +2,8 @@ import { computed as f, toValue as A, shallowRef as w, watch as R, getCurrentSco
2
2
  import { useRoute as M } from "vue-router";
3
3
  import { M as h } from "./context-Ch1r4fdN.js";
4
4
  import { useI18n as S } from "vue-i18n";
5
- import { a as p } from "./error-CD7x0Jrz.js";
6
- import { a as _ } from "./describeError-B-NMa--w.js";
5
+ import { i as p } from "./error-Bb_dr_Ay.js";
6
+ import { a as _ } from "./describeError-BqGAUZgX.js";
7
7
  function D(e) {
8
8
  if (!/^\d+$/.test(e)) return null;
9
9
  const n = Number(e);
@@ -1,9 +1,9 @@
1
1
  import { _ as a, c as o, a as r, i as t } from "../NoAccess.vue_vue_type_script_setup_true_lang-DWxq-MTM.js";
2
2
  import { d as c } from "../defineRoutes-BGAdiIrt.js";
3
3
  import { A as u, f as p, i as f, r as A, u as m } from "../access-DmAceEo5.js";
4
- import { i as l, r as x } from "../guards-BJZjc3FZ.js";
5
- import { u as y } from "../sections-CeZl-Jxg.js";
6
- import { b as v, c as N, n as H, u as b } from "../navigation-DpcDF0rX.js";
4
+ import { i as l, r as x } from "../guards-D4mXf_2X.js";
5
+ import { u as y } from "../sections-B0HxIOC2.js";
6
+ import { b as v, c as N, n as H, u as b } from "../navigation-Bc5EQ_Si.js";
7
7
  export {
8
8
  u as AppRouterView,
9
9
  a as NoAccess,
@@ -1,7 +1,7 @@
1
1
  import { computed as n, watch as h } from "vue";
2
2
  import { useI18n as b } from "vue-i18n";
3
3
  import { useRoute as g, useRouter as p } from "vue-router";
4
- import { u as y } from "./platform-PZpUkkMS.js";
4
+ import { u as y } from "./platform-Dx6STiwY.js";
5
5
  import { i as w } from "./access-DmAceEo5.js";
6
6
  function j() {
7
7
  const t = g(), u = p(), { access: c } = y(), { t: r } = b(), i = n(() => {
@@ -3,12 +3,12 @@ import { useI18n as B } from "vue-i18n";
3
3
  import { _ as we } from "../Avatar.vue_vue_type_script_setup_true_lang-BPj_fkJR.js";
4
4
  import { _ as P, u as Xe, c as Ue } from "../Icon.vue_vue_type_script_lang-D7oC-d-S.js";
5
5
  import { _ as We } from "../Popover.vue_vue_type_script_setup_true_lang-C70GrCP7.js";
6
- import { u as xe, S as X } from "../contributions-BVBZP5Jb.js";
6
+ import { u as xe, S as X } from "../contributions-fx5q5n1u.js";
7
7
  import { u as Ye } from "../environment-Dva-SG8D.js";
8
8
  import { _ as He } from "../CountryFlag.vue_vue_type_script_setup_true_lang-Kry_vPPZ.js";
9
9
  import { l as pe } from "../languageName-CItV_SOv.js";
10
10
  import { t as _e } from "../toast-CqSDTWRX.js";
11
- import { u as J, h as ue } from "../platform-PZpUkkMS.js";
11
+ import { u as J, h as ue } from "../platform-Dx6STiwY.js";
12
12
  import { a as qe, _ as ve, h as ke } from "../AccountMenuItem.vue_vue_type_script_setup_true_lang-CPeNxh5K.js";
13
13
  import { _ as Ge } from "../Sheet.vue_vue_type_script_setup_true_lang-DgOFV4fa.js";
14
14
  import { _ as Qe } from "../LeaveGuardRoot.vue_vue_type_script_setup_true_lang-Cv7KlA5y.js";
@@ -17,7 +17,7 @@ import { _ as Ze } from "../BottomDock.vue_vue_type_script_setup_true_lang-CjN7x
17
17
  import { b as $e } from "../chrome-nUcmVu8G.js";
18
18
  import { p as Se, A as et } from "../access-DmAceEo5.js";
19
19
  import { RouterLink as Le, useRoute as tt, useRouter as de } from "vue-router";
20
- import { u as nt } from "../navigation-DpcDF0rX.js";
20
+ import { u as nt } from "../navigation-Bc5EQ_Si.js";
21
21
  import { u as at } from "../leaveGuard-Cc8yeLxM.js";
22
22
  import { u as ot, S as st } from "../dialogStack-DZZg55w0.js";
23
23
  import { a as H } from "../mediaQuery-CygcXmFW.js";
@@ -0,0 +1,30 @@
1
+ const i = (e) => /Edg\/|EdgA\/|EdgiOS\//.test(e) ? "Edge" : /Firefox\/|FxiOS\//.test(e) ? "Firefox" : /Chrome\/|CriOS\//.test(e) ? "Chrome" : /Safari\/|iPhone|iPad/.test(e) ? "Safari" : "", s = (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" : "";
2
+ function u(e) {
3
+ const n = e.trim();
4
+ if (n === "") return "";
5
+ const t = i(n), r = s(n);
6
+ return t && r ? `${t} · ${r}` : [...n].slice(0, 80).join("");
7
+ }
8
+ const o = {
9
+ signed_in: { tone: "positive", byOther: !1 },
10
+ wrong_password: { tone: "critical", byOther: !1 },
11
+ locked_out: { tone: "critical", byOther: !1 },
12
+ refused_inactive: { tone: "critical", byOther: !1 },
13
+ signed_in_as: { tone: "warning", byOther: !0 },
14
+ unlocked: { tone: "neutral", byOther: !0 },
15
+ signed_out_everywhere: { tone: "neutral", byOther: !0 },
16
+ session_revoked: { tone: "neutral", byOther: !0 }
17
+ };
18
+ function c(e) {
19
+ const n = o[e];
20
+ return n ? { ...n, known: !0 } : { tone: "neutral", byOther: !1, known: !1 };
21
+ }
22
+ function a(e, n) {
23
+ const t = c(e);
24
+ return t.known ? t.byOther && n ? `core.account.signins.events_by.${e}` : `core.account.signins.events.${e}` : "core.account.signins.events.unknown";
25
+ }
26
+ export {
27
+ a,
28
+ u as d,
29
+ c as s
30
+ };
@@ -7,7 +7,7 @@ import { _ as G } from "../EmptyState.vue_vue_type_script_setup_true_lang-50p-Mp
7
7
  import { defineComponent as m, computed as k, openBlock as e, createElementBlock as a, normalizeClass as p, createVNode as d, unref as i, createElementVNode as u, renderSlot as f, createBlock as S, toDisplayString as l, createCommentVNode as c } from "vue";
8
8
  import { _ as x } from "../Icon.vue_vue_type_script_lang-D7oC-d-S.js";
9
9
  import { useI18n as g } from "vue-i18n";
10
- import { u as K } from "../useLoad-M7V-AVwR.js";
10
+ import { u as K } from "../useLoad-W4tfxmm5.js";
11
11
  import { D as X, W as Y, u as Z } from "../useWaitStatus-fsacMl4W.js";
12
12
  const $ = ["amber", "lime", "teal", "cyan", "blue", "indigo", "violet", "fuchsia", "pink"], V = /* @__PURE__ */ m({
13
13
  __name: "FieldNote",
@@ -1,5 +1,5 @@
1
- import { a, r as o } from "./http-BFfkA7gN.js";
2
- import { i as r } from "./index-BhtJR4c_.js";
1
+ import { a, r as o } from "./http-CdQowFlW.js";
2
+ import { i as r } from "./index-auJqVMWC.js";
3
3
  const n = ["active", "locked", "inactive", "all"];
4
4
  function l(i) {
5
5
  return a({