@wssto2/vue-core 0.4.24 → 0.4.26

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 (58) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-DcbZBINh.js → AccessGate.vue_vue_type_script_setup_true_lang-J5HoyGNJ.js} +1 -1
  3. package/dist/{Activity-CI-l_OFl.js → Activity-B6R8Jghz.js} +2 -2
  4. package/dist/{Changes-BdR0R20V.js → Changes-BQG7IV49.js} +2 -2
  5. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-BNM_cbXa.js → CollectionPage.vue_vue_type_script_setup_true_lang-BrbQ0Y5d.js} +1 -1
  6. package/dist/{DeadLetters-CRTeoZS1.js → DeadLetters-CJZSWjsn.js} +4 -4
  7. package/dist/{General-hdmVP72B.js → General-tsRC866T.js} +2 -2
  8. package/dist/{NewRolePage-BPeKasOp.js → NewRolePage-L57Zg1Mg.js} +2 -2
  9. package/dist/PhotoViewer.vue_vue_type_script_setup_true_lang-CY5EZiyK.js +433 -0
  10. package/dist/{ProfilePage-Dq9lcO5O.js → ProfilePage-B9WUrImn.js} +2 -2
  11. package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-B6g2760V.js → RoleEditor.vue_vue_type_script_setup_true_lang-Hr0WgL1K.js} +2 -2
  12. package/dist/{RolePage-BYH-0fVI.js → RolePage-uezn-Og1.js} +3 -3
  13. package/dist/{RolesPage-BRm5xDw7.js → RolesPage-DkMAJZR6.js} +2 -2
  14. package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-BltrQnrQ.js → SectionNavigator.vue_vue_type_script_setup_true_lang-BYRc0-qh.js} +1 -1
  15. package/dist/{Sessions-B1eKG_I2.js → Sessions-BDu3nMmz.js} +2 -2
  16. package/dist/{SettingsPage-0P38Ty4w.js → SettingsPage-CA7YCy6K.js} +2 -2
  17. package/dist/{SignIn-Dp8Ji0_r.js → SignIn-DQzS20kM.js} +2 -2
  18. package/dist/{SignInPage-CiStJboK.js → SignInPage-ft3unWwX.js} +2 -2
  19. package/dist/{SignIns-Bo7R2Coi.js → SignIns-C3h_YIkc.js} +2 -2
  20. package/dist/{UserRecord-DGq_PPy1.js → UserRecord-BO5-wsYt.js} +5 -5
  21. package/dist/{UsersList-BulNu4aE.js → UsersList-D3b3DGN5.js} +4 -4
  22. package/dist/access/index.js +1 -1
  23. package/dist/app/index.js +5 -5
  24. package/dist/collection/index.js +3 -3
  25. package/dist/{contributions-DsfmDoRD.js → contributions-BVBZP5Jb.js} +1 -1
  26. package/dist/form/index.js +1 -1
  27. package/dist/{guards-Dve61KjR.js → guards-BJZjc3FZ.js} +1 -1
  28. package/dist/{http-D_D9YbLH.js → http-BFfkA7gN.js} +1 -1
  29. package/dist/identity/index.js +1 -1
  30. package/dist/{index-BmowiT1y.js → index-BVU76sBO.js} +12 -12
  31. package/dist/{index-tnSTp0cM.js → index-C3CzOub7.js} +2 -2
  32. package/dist/{index-Yy28omu6.js → index-CvJSAsfk.js} +5 -5
  33. package/dist/index.d.ts +1 -1
  34. package/dist/index.js +1 -1
  35. package/dist/{navigation-Cm3iChlR.js → navigation-DpcDF0rX.js} +1 -1
  36. package/dist/{neighbors-DVN_cADL.js → neighbors-RVQ4O3Qv.js} +1 -1
  37. package/dist/notifications/index.js +1 -1
  38. package/dist/overlay/PhotoViewer.vue.d.ts +4 -3
  39. package/dist/overlay/PhotoViewerAction.vue.d.ts +22 -0
  40. package/dist/overlay/index.d.ts +1 -0
  41. package/dist/overlay/index.js +47 -23
  42. package/dist/page/index.js +1 -1
  43. package/dist/platform/index.d.ts +25 -1
  44. package/dist/platform/index.js +59 -49
  45. package/dist/platform/platform.d.ts +9 -5
  46. package/dist/platform/session.d.ts +10 -0
  47. package/dist/platform/sessionUser.d.ts +8 -0
  48. package/dist/platform-PZpUkkMS.js +268 -0
  49. package/dist/router/index.js +3 -3
  50. package/dist/{sections-D-kD98vu.js → sections-CeZl-Jxg.js} +1 -1
  51. package/dist/shell/index.js +3 -3
  52. package/dist/{status-Bh3-Cg7o.js → status-8KH7PITT.js} +2 -2
  53. package/dist/styles.css +1 -1
  54. package/dist/testing/index.js +1 -1
  55. package/dist/testing/platform.d.ts +10 -7
  56. package/package.json +3 -2
  57. package/dist/PhotoViewer.vue_vue_type_script_setup_true_lang-QPCW3Xi6.js +0 -411
  58. package/dist/platform-q3cjODLx.js +0 -255
@@ -1,411 +0,0 @@
1
- import { defineComponent as Ae, useModel as Re, ref as _, useTemplateRef as se, watch as Q, computed as g, onBeforeUnmount as Ne, nextTick as ye, onMounted as Xe, openBlock as m, createBlock as Ve, Teleport as Ye, createElementBlock as f, createVNode as T, Transition as Ze, withCtx as Ee, unref as u, createElementVNode as h, toDisplayString as ee, createCommentVNode as k, renderSlot as Ke, normalizeClass as M, withModifiers as re, normalizeStyle as te, Fragment as We, renderList as je, mergeModels as be } from "vue";
2
- import { useI18n as Ue } from "vue-i18n";
3
- import { _ as S } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
4
- import { u as Fe } from "./useDialog-CXR3hN0G.js";
5
- const _e = [1, 1.5, 2, 3, 4, 5], ke = 1, ue = 5, He = (a) => Math.min(ue, Math.max(ke, a)), Me = (a, l) => l % 2 === 0 ? a : { width: a.height, height: a.width };
6
- function qe(a, l, s) {
7
- const i = Me(a, s);
8
- if (i.width <= 0 || i.height <= 0 || l.width <= 0 || l.height <= 0) return { width: 0, height: 0 };
9
- const o = Math.min(l.width / i.width, l.height / i.height);
10
- return { width: a.width * o, height: a.height * o };
11
- }
12
- function Ge(a, l, s) {
13
- return { x: Math.max(0, (a.width * s - l.width) / 2), y: Math.max(0, (a.height * s - l.height) / 2) };
14
- }
15
- function N(a, l, s, i) {
16
- const o = Ge(l, s, i);
17
- return { x: Math.min(o.x, Math.max(-o.x, a.x)) + 0, y: Math.min(o.y, Math.max(-o.y, a.y)) + 0 };
18
- }
19
- function Je(a, l, s, i, o) {
20
- const z = He(l), r = z / a.zoom, $ = { x: s.x - (s.x - a.pan.x) * r, y: s.y - (s.y - a.pan.y) * r };
21
- return { zoom: z, pan: N($, i, o, z) };
22
- }
23
- function Qe(a, l) {
24
- return l === 1 ? _e.find((i) => i > a + 1e-3) ?? ue : [..._e].reverse().find((i) => i < a - 1e-3) ?? ke;
25
- }
26
- function et(a, l, s, i, o) {
27
- const z = Math.min(o.width / a.width, o.height / a.height), r = { width: a.width * z, height: a.height * z }, $ = { width: a.width * s, height: a.height * s }, P = { width: Math.min(1, l.width / $.width), height: Math.min(1, l.height / $.height) }, E = { x: 0.5 - i.x / $.width, y: 0.5 - i.y / $.height };
28
- return {
29
- image: r,
30
- view: { x: (E.x - P.width / 2) * r.width, y: (E.y - P.height / 2) * r.height, width: P.width * r.width, height: P.height * r.height }
31
- };
32
- }
33
- function tt(a, l, s, i) {
34
- return N({ x: (0.5 - a.x) * l.width * i, y: (0.5 - a.y) * l.height * i }, l, s, i);
35
- }
36
- const at = {
37
- key: 0,
38
- class: "relative z-9999"
39
- }, it = ["aria-label"], ot = { class: "flex items-center gap-2 px-4 pt-[max(0.875rem,var(--app-safe-top))] pb-3.5 md:px-4.5" }, nt = { class: "min-w-0 truncate text-headline font-semibold" }, lt = { key: 0 }, st = {
40
- "aria-live": "polite",
41
- "data-test": "photo-counter"
42
- }, rt = ["aria-label", "aria-disabled"], ut = {
43
- class: "w-13 text-center text-subheadline tabular-nums compact:hidden",
44
- "data-test": "zoom-percent"
45
- }, dt = ["aria-label", "aria-disabled"], ct = ["aria-label"], ht = ["href", "download", "aria-label"], vt = ["aria-label"], mt = { class: "flex min-h-0 grow items-center gap-4 px-4 md:px-4.5" }, pt = ["aria-label", "aria-disabled"], ft = ["src", "alt"], gt = ["src"], xt = ["aria-label", "aria-disabled"], wt = ["aria-label", "aria-current", "onClick"], yt = ["src"], bt = {
46
- key: 1,
47
- class: "h-[max(1.25rem,var(--app-safe-bottom))] shrink-0"
48
- }, _t = {
49
- class: "sr-only",
50
- "aria-live": "polite"
51
- }, kt = 8, Mt = 300, I = "flex size-10 shrink-0 cursor-pointer items-center justify-center rounded-full bg-white/8 text-[#f1f5f3] transition-colors duration-motion-fast hover:bg-white/16 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#6ee7b7] aria-disabled:cursor-default aria-disabled:opacity-30 aria-disabled:hover:bg-white/8", Tt = /* @__PURE__ */ Ae({
52
- __name: "PhotoViewer",
53
- props: /* @__PURE__ */ be({
54
- items: {},
55
- title: { default: void 0 }
56
- }, {
57
- index: { default: 0 },
58
- indexModifiers: {}
59
- }),
60
- emits: /* @__PURE__ */ be(["presented", "dismissed"], ["update:index"]),
61
- setup(a, { expose: l, emit: s }) {
62
- const i = a, o = Re(a, "index"), z = s, { t: r } = Ue(), $ = _(null), P = se("stage"), E = se("image"), de = se("strip"), K = Fe($, { initialFocus: "panel", onPresented: () => z("presented"), onDismissed: () => z("dismissed") }), { isOpen: W } = K, ae = _(!1);
63
- Q(W, (e) => {
64
- e && (ae.value = !0);
65
- }, { flush: "sync" });
66
- const ze = () => {
67
- W.value || (ae.value = !1);
68
- }, c = _(1), d = _({ x: 0, y: 0 }), C = _(0), j = _({ width: 0, height: 0 }), x = _({ width: 0, height: 0 }), y = _(0), ie = _(!1), X = _(null), p = g(() => i.items[o.value]), B = g(() => qe(j.value, x.value, C.value)), O = g(() => Me(B.value, C.value)), ce = g(() => B.value.width > 0), $e = g(() => Math.round(c.value * 100)), D = g(() => c.value > 1.001), he = g(() => o.value > 0), ve = g(() => o.value < i.items.length - 1), Pe = g(() => ({
69
- width: `${B.value.width}px`,
70
- height: `${B.value.height}px`,
71
- marginLeft: `${-B.value.width / 2}px`,
72
- marginTop: `${-B.value.height / 2}px`,
73
- transform: `translate(${d.value.x + y.value}px, ${d.value.y}px) scale(${c.value}) rotate(${C.value * 90}deg)`
74
- }));
75
- function U() {
76
- c.value = 1, d.value = { x: 0, y: 0 }, y.value = 0;
77
- }
78
- function F() {
79
- const e = P.value;
80
- e && (x.value = { width: e.clientWidth, height: e.clientHeight }), oe();
81
- }
82
- function oe() {
83
- const e = E.value;
84
- e && e.naturalWidth > 0 && (j.value = { width: e.naturalWidth, height: e.naturalHeight });
85
- }
86
- let H = null;
87
- Q(P, (e) => {
88
- H?.disconnect(), e && (F(), typeof ResizeObserver < "u" && (H = new ResizeObserver(() => {
89
- F(), d.value = N(d.value, O.value, x.value, c.value);
90
- }), H.observe(e)));
91
- }), Ne(() => H?.disconnect()), Q(o, () => {
92
- U(), C.value = 0, j.value = { width: 0, height: 0 }, ye(() => {
93
- oe(), de.value?.querySelector("[aria-current=true]")?.scrollIntoView?.({ inline: "center", block: "nearest" });
94
- });
95
- }), Q(() => i.items.length, (e) => {
96
- e === 0 ? K.dismiss() : o.value > e - 1 && (o.value = e - 1);
97
- });
98
- function Ce(e = 0) {
99
- o.value = Math.min(Math.max(0, e), Math.max(0, i.items.length - 1)), U(), C.value = 0, j.value = { width: 0, height: 0 }, X.value = null, K.present(), ye(F);
100
- }
101
- const me = () => K.dismiss();
102
- l({ present: Ce, dismiss: me });
103
- function V(e) {
104
- const t = o.value + e;
105
- t < 0 || t > i.items.length - 1 || (X.value = e === 1 ? "forward" : "back", o.value = t);
106
- }
107
- function A(e) {
108
- q(Qe(c.value, e), { x: 0, y: 0 });
109
- }
110
- function q(e, t) {
111
- const n = Je({ zoom: c.value, pan: d.value }, e, t, O.value, x.value);
112
- c.value = n.zoom, d.value = n.pan;
113
- }
114
- function ne() {
115
- C.value = (C.value + 3) % 4, d.value = N(d.value, O.value, x.value, c.value);
116
- }
117
- function Te(e) {
118
- if (e.altKey || e.ctrlKey || e.metaKey) return;
119
- const n = {
120
- ArrowLeft: () => V(-1),
121
- ArrowRight: () => V(1),
122
- "+": () => A(1),
123
- "=": () => A(1),
124
- "-": () => A(-1),
125
- _: () => A(-1),
126
- 0: U,
127
- r: ne,
128
- R: ne
129
- }[e.key];
130
- n && (e.preventDefault(), n());
131
- }
132
- const le = (e) => {
133
- const t = P.value?.getBoundingClientRect();
134
- return { x: e.clientX - (t ? t.left + t.width / 2 : 0), y: e.clientY - (t ? t.top + t.height / 2 : 0) };
135
- }, b = /* @__PURE__ */ new Map();
136
- let Y = !1, pe = 0, R = { x: 0, y: 0 }, Z = null;
137
- const fe = () => {
138
- const [e, t] = [...b.values()];
139
- return { x: (e.x + t.x) / 2, y: (e.y + t.y) / 2 };
140
- }, ge = () => {
141
- const [e, t] = [...b.values()];
142
- return Math.hypot(e.x - t.x, e.y - t.y);
143
- };
144
- function Oe(e) {
145
- e.pointerType === "mouse" && e.button !== 0 || (P.value?.setPointerCapture?.(e.pointerId), b.set(e.pointerId, { x: e.clientX, y: e.clientY }), ie.value = !0, b.size === 1 ? (Y = !1, pe = Date.now(), R = { x: 0, y: 0 }) : Y = !0);
146
- }
147
- function Le(e) {
148
- const t = b.get(e.pointerId);
149
- if (!t) return;
150
- const n = { x: e.clientX, y: e.clientY };
151
- if (b.size === 2) {
152
- const [G, J] = [ge(), fe()];
153
- b.set(e.pointerId, n);
154
- const L = fe();
155
- q(c.value * (ge() / (G || 1)), le({ clientX: L.x, clientY: L.y })), d.value = N({ x: d.value.x + L.x - J.x, y: d.value.y + L.y - J.y }, O.value, x.value, c.value);
156
- return;
157
- }
158
- b.set(e.pointerId, n);
159
- const v = { x: n.x - t.x, y: n.y - t.y };
160
- R = { x: R.x + v.x, y: R.y + v.y }, !(!Y && Math.hypot(R.x, R.y) < kt) && (Y = !0, D.value ? d.value = N({ x: d.value.x + v.x, y: d.value.y + v.y }, O.value, x.value, c.value) : y.value = (y.value + v.x) * (y.value + v.x < 0 && !ve.value || y.value + v.x > 0 && !he.value ? 0.6 : 1));
161
- }
162
- function xe(e, t = !1) {
163
- if (!b.delete(e.pointerId) || b.size > 0) return;
164
- ie.value = !1;
165
- const n = le(e);
166
- if (!Y && !t) {
167
- const L = Z && Date.now() - Z.at < Mt && Math.hypot(n.x - Z.point.x, n.y - Z.point.y) < 32;
168
- Z = L ? null : { at: Date.now(), point: n }, L && (D.value ? U() : q(2, n));
169
- return;
170
- }
171
- const v = Date.now() - pe < 250 && Math.abs(y.value) > 30, G = Math.abs(y.value) > Math.max(50, x.value.width * 0.15), J = y.value;
172
- y.value = 0, !t && !D.value && (G || v) && V(J < 0 ? 1 : -1);
173
- }
174
- function Se(e) {
175
- const t = e.deltaMode === 1 ? 16 : 1;
176
- q(c.value * Math.exp(-e.deltaY * t * (e.ctrlKey ? 0.01 : 15e-4)), le(e));
177
- }
178
- const Ie = { width: 120, height: 80 }, w = g(() => ce.value ? et(O.value, x.value, c.value, d.value, Ie) : null);
179
- function we(e) {
180
- if (e.type === "pointermove" && e.buttons === 0) return;
181
- const t = e.currentTarget.getBoundingClientRect();
182
- t.width === 0 || t.height === 0 || (d.value = tt({ x: (e.clientX - t.left) / t.width, y: (e.clientY - t.top) / t.height }, O.value, x.value, c.value));
183
- }
184
- const Be = g(() => {
185
- if (!w.value) return {};
186
- const { width: e, height: t } = C.value % 2 === 0 ? w.value.image : { width: w.value.image.height, height: w.value.image.width };
187
- return { width: `${e}px`, height: `${t}px`, marginLeft: `${-e / 2}px`, marginTop: `${-t / 2}px`, transform: `rotate(${C.value * 90}deg)` };
188
- });
189
- Xe(() => {
190
- W.value && F();
191
- });
192
- const De = g(() => i.title ?? r("core.viewer.label"));
193
- return (e, t) => (m(), Ve(Ye, { to: "body" }, [
194
- ae.value ? (m(), f("div", at, [
195
- T(Ze, {
196
- appear: "",
197
- "enter-active-class": "transition-opacity duration-motion-normal ease-motion-standard",
198
- "enter-from-class": "opacity-0",
199
- "leave-active-class": "pointer-events-none transition-opacity duration-motion-normal ease-motion-standard",
200
- "leave-to-class": "opacity-0",
201
- onAfterLeave: ze
202
- }, {
203
- default: Ee(() => [
204
- u(W) ? (m(), f("div", {
205
- key: 0,
206
- ref_key: "panel",
207
- ref: $,
208
- role: "dialog",
209
- "aria-modal": "true",
210
- "aria-label": De.value,
211
- tabindex: "-1",
212
- "data-part": "panel",
213
- "data-test": "photo-viewer",
214
- class: "fixed inset-0 flex flex-col bg-[#0b1210] text-[#f1f5f3] outline-none",
215
- onKeydown: Te
216
- }, [
217
- h("div", ot, [
218
- h("h2", nt, [
219
- i.title ? (m(), f("span", lt, ee(i.title) + " · ", 1)) : k("", !0),
220
- h("span", st, ee(u(r)("core.viewer.counter", { current: o.value + 1, total: i.items.length })), 1)
221
- ]),
222
- t[6] || (t[6] = h("div", { class: "grow" }, null, -1)),
223
- p.value ? Ke(e.$slots, "actions", {
224
- item: p.value,
225
- index: o.value
226
- }, void 0, void 0, 0) : k("", !0),
227
- h("button", {
228
- type: "button",
229
- class: M([I, "compact:hidden"]),
230
- "aria-label": u(r)("core.viewer.zoom_out"),
231
- "aria-disabled": !D.value,
232
- "data-test": "zoom-out",
233
- onClick: t[0] || (t[0] = (n) => A(-1))
234
- }, [
235
- T(u(S), {
236
- name: "zoomOut",
237
- size: 18
238
- })
239
- ], 10, rt),
240
- h("p", ut, ee(u(r)("core.viewer.zoom_percent", { percent: $e.value })), 1),
241
- h("button", {
242
- type: "button",
243
- class: M([I, "compact:hidden"]),
244
- "aria-label": u(r)("core.viewer.zoom_in"),
245
- "aria-disabled": c.value >= u(ue),
246
- "data-test": "zoom-in",
247
- onClick: t[1] || (t[1] = (n) => A(1))
248
- }, [
249
- T(u(S), {
250
- name: "zoomIn",
251
- size: 18
252
- })
253
- ], 10, dt),
254
- h("button", {
255
- type: "button",
256
- class: M(I),
257
- "aria-label": u(r)("core.viewer.rotate"),
258
- "data-test": "rotate",
259
- onClick: ne
260
- }, [
261
- T(u(S), {
262
- name: "rotateCounterclockwise",
263
- size: 18
264
- })
265
- ], 8, ct),
266
- p.value ? (m(), f("a", {
267
- key: 1,
268
- href: p.value.src,
269
- download: p.value.downloadName ?? "",
270
- target: "_blank",
271
- rel: "noopener",
272
- class: M(I),
273
- "aria-label": u(r)("core.viewer.download"),
274
- "data-test": "download"
275
- }, [
276
- T(u(S), {
277
- name: "download",
278
- size: 18
279
- })
280
- ], 8, ht)) : k("", !0),
281
- h("button", {
282
- type: "button",
283
- class: M([I, "bg-white/16"]),
284
- "aria-label": u(r)("core.actions.close"),
285
- "data-test": "close",
286
- onClick: me
287
- }, [
288
- T(u(S), {
289
- name: "close",
290
- size: 18
291
- })
292
- ], 10, vt)
293
- ]),
294
- h("div", mt, [
295
- i.items.length > 1 ? (m(), f("button", {
296
- key: 0,
297
- type: "button",
298
- class: M([I, "size-12 compact:hidden"]),
299
- "aria-label": u(r)("core.viewer.previous"),
300
- "aria-disabled": !he.value,
301
- "data-test": "previous",
302
- onClick: t[2] || (t[2] = (n) => V(-1))
303
- }, [
304
- T(u(S), {
305
- name: "arrowLeftSLine",
306
- size: 22
307
- })
308
- ], 10, pt)) : k("", !0),
309
- h("div", {
310
- ref_key: "stage",
311
- ref: x,
312
- "data-test": "photo-stage",
313
- class: M(["relative h-full min-w-0 grow touch-none overflow-hidden rounded-md select-none", D.value ? "cursor-grab active:cursor-grabbing" : ""]),
314
- onPointerdown: Oe,
315
- onPointermove: Le,
316
- onPointerup: t[3] || (t[3] = (n) => xe(n)),
317
- onPointercancel: t[4] || (t[4] = (n) => xe(n, !0)),
318
- onWheel: re(Se, ["prevent"])
319
- }, [
320
- p.value ? (m(), f("img", {
321
- key: p.value.src,
322
- ref: "image",
323
- src: p.value.src,
324
- alt: p.value.alt,
325
- draggable: "false",
326
- "data-test": "photo",
327
- class: M(["absolute top-1/2 left-1/2 max-w-none", [ce.value ? "" : "opacity-0", ie.value ? "" : "transition-transform duration-motion-normal ease-motion-standard", X.value === "back" ? "animate-step-back" : X.value === "forward" ? "animate-step-in" : ""]]),
328
- style: te(Pe.value),
329
- onLoad: oe
330
- }, null, 46, ft)) : k("", !0),
331
- D.value && w.value ? (m(), f("div", {
332
- key: 1,
333
- "data-test": "mini-map",
334
- class: "absolute right-3.5 bottom-3.5 overflow-hidden rounded-md bg-black/50 ring-1 ring-white/20",
335
- style: te({ width: `${w.value.image.width}px`, height: `${w.value.image.height}px` }),
336
- onPointerdown: re(we, ["stop"]),
337
- onPointermove: re(we, ["stop"])
338
- }, [
339
- p.value ? (m(), f("img", {
340
- key: 0,
341
- src: p.value.thumb ?? p.value.src,
342
- alt: "",
343
- draggable: "false",
344
- class: "pointer-events-none absolute top-1/2 left-1/2 max-w-none opacity-80",
345
- style: te(Be.value)
346
- }, null, 12, gt)) : k("", !0),
347
- h("span", {
348
- class: "pointer-events-none absolute rounded-xs ring-2 ring-[#6ee7b7]",
349
- "data-test": "mini-map-view",
350
- style: te({ left: `${w.value.view.x}px`, top: `${w.value.view.y}px`, width: `${w.value.view.width}px`, height: `${w.value.view.height}px` })
351
- }, null, 4)
352
- ], 36)) : k("", !0)
353
- ], 34),
354
- i.items.length > 1 ? (m(), f("button", {
355
- key: 1,
356
- type: "button",
357
- class: M([I, "size-12 compact:hidden"]),
358
- "aria-label": u(r)("core.viewer.next"),
359
- "aria-disabled": !ve.value,
360
- "data-test": "next",
361
- onClick: t[5] || (t[5] = (n) => V(1))
362
- }, [
363
- T(u(S), {
364
- name: "arrowRightSLine",
365
- size: 22
366
- })
367
- ], 10, xt)) : k("", !0)
368
- ]),
369
- i.items.length > 1 ? (m(), f("ul", {
370
- key: 0,
371
- ref_key: "strip",
372
- ref: de,
373
- "data-test": "photo-strip",
374
- class: "flex shrink-0 justify-start gap-2 overflow-x-auto px-4 pt-4 pb-[max(1.25rem,var(--app-safe-bottom))] scrollbar-hide md:justify-center md:px-4.5"
375
- }, [
376
- (m(!0), f(We, null, je(i.items, (n, v) => (m(), f("li", {
377
- key: n.src,
378
- class: "shrink-0"
379
- }, [
380
- h("button", {
381
- type: "button",
382
- "aria-label": n.alt,
383
- "aria-current": v === o.value ? "true" : void 0,
384
- "data-test": "thumbnail",
385
- class: M(["block h-11 w-16 cursor-pointer overflow-hidden rounded-[5px] bg-[#2a3431] transition-opacity duration-motion-fast focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#6ee7b7]", v === o.value ? "ring-2 ring-[#6ee7b7]" : "opacity-60 hover:opacity-100"]),
386
- onClick: (G) => {
387
- X.value = v > o.value ? "forward" : "back", o.value = v;
388
- }
389
- }, [
390
- h("img", {
391
- src: n.thumb ?? n.src,
392
- alt: "",
393
- loading: "lazy",
394
- draggable: "false",
395
- class: "size-full object-cover"
396
- }, null, 8, yt)
397
- ], 10, wt)
398
- ]))), 128))
399
- ], 512)) : (m(), f("div", bt)),
400
- h("span", _t, ee(p.value?.alt), 1)
401
- ], 40, it)) : k("", !0)
402
- ]),
403
- _: 3
404
- })
405
- ])) : k("", !0)
406
- ]));
407
- }
408
- });
409
- export {
410
- Tt as _
411
- };
@@ -1,255 +0,0 @@
1
- import { c as P } from "./client-k9euDWF4.js";
2
- import { d as k } from "./context-Ch1r4fdN.js";
3
- import { a as x, A as q } from "./error-CD7x0Jrz.js";
4
- import { shallowRef as U } from "vue";
5
- const _ = (e, n) => e.level === n.level && e.id === n.id, z = (e, n) => Object.prototype.hasOwnProperty.call(e, n);
6
- function C(e, n = {}) {
7
- const t = n.covers ?? _;
8
- function o(r) {
9
- const s = e();
10
- return !s || !z(s.permissions, r) || s.unavailable.includes(r) ? null : s.permissions[r] ?? null;
11
- }
12
- function a(r, s) {
13
- const i = o(r);
14
- return i ? s ? (i.clauses.length > 0 ? i.clauses.map((c) => c.scope) : [i.scope]).some((c) => t(c, s)) : !0 : !1;
15
- }
16
- return {
17
- get root() {
18
- return e()?.root ?? !1;
19
- },
20
- can: a,
21
- canAny: (r) => r.some((s) => a(s)),
22
- canAll: (r) => r.every((s) => a(s)),
23
- held: o
24
- };
25
- }
26
- const A = ["own", "own_location", "all"], m = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
27
- function $(e, n, t) {
28
- return !m(e) || typeof e.level != "string" ? (t.push(`${n}: expected { level: string, id?: number }`), { level: "" }) : (e.id !== void 0 && typeof e.id != "number" && t.push(`${n}.id: expected number`), typeof e.id == "number" ? { level: e.level, id: e.id } : { level: e.level });
29
- }
30
- function S(e, n, t) {
31
- return typeof e == "string" && A.includes(e) ? e : (t.push(`${n}: expected one of ${A.join(", ")}`), "own");
32
- }
33
- function I(e) {
34
- const n = [], t = {}, o = { root: !1, permissions: {}, unavailable: [] };
35
- if (!m(e)) return { snapshot: o, issues: ["access: expected an object"] };
36
- if (!m(e.permissions)) n.push("access.permissions: expected an object");
37
- else
38
- for (const [r, s] of Object.entries(e.permissions)) {
39
- const i = `access.permissions.${r}`;
40
- if (!m(s)) {
41
- n.push(`${i}: expected an object`);
42
- continue;
43
- }
44
- const u = (Array.isArray(s.clauses) ? s.clauses : []).map((c, y) => {
45
- const l = `${i}.clauses[${y}]`;
46
- if (!m(c))
47
- return n.push(`${l}: expected an object`), { scope: { level: "" }, qualifier: "own" };
48
- const f = { scope: $(c.scope, `${l}.scope`, n), qualifier: S(c.qualifier, `${l}.qualifier`, n) };
49
- return typeof c.role == "string" ? { ...f, role: c.role } : f;
50
- });
51
- t[r] = {
52
- scope: $(s.scope, `${i}.scope`, n),
53
- qualifier: S(s.qualifier, `${i}.qualifier`, n),
54
- clauses: u
55
- };
56
- }
57
- const a = e.unavailable ?? [];
58
- return (!Array.isArray(a) || !a.every((r) => typeof r == "string")) && n.push("access.unavailable: expected an array of strings"), {
59
- snapshot: {
60
- root: e.root === !0,
61
- permissions: t,
62
- unavailable: Array.isArray(a) ? a.filter((r) => typeof r == "string") : []
63
- },
64
- issues: n
65
- };
66
- }
67
- const T = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
68
- function j(e, n, t = "navigation") {
69
- return Array.isArray(e) ? e.flatMap((o, a) => {
70
- const r = `${t}[${a}]`;
71
- if (!T(o) || typeof o.i18n != "string")
72
- return n.push(`${r}: expected an object with an i18n key`), [];
73
- for (const i of ["icon", "route"])
74
- o[i] != null && typeof o[i] != "string" && n.push(`${r}.${i}: expected a string`);
75
- const s = o.children == null ? void 0 : j(o.children, n, `${r}.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
- ...s && { children: s }
82
- }
83
- ];
84
- }) : (n.push(`${t}: expected an array`), []);
85
- }
86
- const b = (e) => typeof e == "object" && e !== null && !Array.isArray(e), N = (e) => {
87
- if (b(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 B(e, n = N) {
91
- const t = [];
92
- if (!b(e)) throw O(["expected an object"]);
93
- let o = null;
94
- try {
95
- o = n(e.user);
96
- } catch (u) {
97
- t.push(`user: ${u instanceof Error ? u.message : "invalid"}`);
98
- }
99
- let a = null;
100
- if (e.expires_at !== void 0 && e.expires_at !== null) {
101
- const u = typeof e.expires_at == "string" ? new Date(e.expires_at) : null;
102
- u === null || Number.isNaN(u.getTime()) ? t.push("expires_at: expected an ISO date-time string") : a = u;
103
- }
104
- let r;
105
- if (e.impersonator !== void 0 && e.impersonator !== null) {
106
- const u = e.impersonator;
107
- b(u) && (typeof u.id == "number" || typeof u.id == "string") && typeof u.name == "string" ? r = { id: u.id, name: u.name } : t.push("impersonator: expected { id, name }");
108
- }
109
- const s = I(e.access);
110
- t.push(...s.issues);
111
- const i = e.navigation === void 0 || e.navigation === null ? void 0 : j(e.navigation, t);
112
- if (o === null || t.length > 0) throw O(t);
113
- return { user: o, expiresAt: a, access: s.snapshot, ...r && { impersonator: r }, ...i && { navigation: i } };
114
- }
115
- const O = (e) => new q({ kind: "malformed", message: `Unreadable session payload: ${e.join("; ")}` });
116
- function F(e, n = {}) {
117
- const { mePath: t = "/auth/me", signOutPath: o = "/auth/logout", parseUser: a } = n;
118
- return {
119
- async load(r) {
120
- try {
121
- const { data: s } = await e.get(t, { signal: r, handleUnauthorized: !1 });
122
- return B(s, a);
123
- } catch (s) {
124
- if (x(s) && s.kind === "unauthorized") return null;
125
- throw s;
126
- }
127
- },
128
- async signOut() {
129
- try {
130
- await e.post(o, void 0, { handleUnauthorized: !1 });
131
- } catch (r) {
132
- if (!(x(r) && r.kind === "unauthorized")) throw r;
133
- }
134
- }
135
- };
136
- }
137
- function E(e) {
138
- return e.status === "authenticated" ? e : e.status === "anonymous" && e.reason === "expired" ? e.previous ?? null : null;
139
- }
140
- const w = 3e3;
141
- function H(e, n = {}) {
142
- const t = U({ status: "unknown" });
143
- let o = 0;
144
- const a = new Set(n.beforeSignOut ? [n.beforeSignOut] : []);
145
- let r = !1, s = null, i = null;
146
- function u() {
147
- o++, i?.controller.abort(), i = null;
148
- }
149
- async function c(l) {
150
- const f = new AbortController();
151
- let h;
152
- const g = new Promise((d) => {
153
- h = setTimeout(() => {
154
- f.abort(), n.onError?.(new Error(`A before-sign-out hook did not finish within ${w} ms; signing out without it.`)), d();
155
- }, w);
156
- }), v = Promise.all(
157
- [...a].map(async (d) => {
158
- try {
159
- await d(l, f.signal);
160
- } catch (p) {
161
- n.onError?.(p);
162
- }
163
- })
164
- ).then(() => {
165
- });
166
- await Promise.race([v, g]), clearTimeout(h);
167
- }
168
- function y() {
169
- if (i) return i.promise;
170
- const l = o, f = new AbortController(), h = t.value, g = E(h) !== null;
171
- g || (t.value = { status: "loading" });
172
- const v = async () => {
173
- try {
174
- const p = await e.load(f.signal);
175
- if (o !== l) return t.value;
176
- t.value = p ? { status: "authenticated", ...p } : { status: "anonymous", reason: "none" };
177
- } catch (p) {
178
- if (o !== l) return t.value;
179
- n.onError?.(p), t.value = g ? h : { status: "failed", error: p };
180
- } finally {
181
- o === l && (i = null);
182
- }
183
- return t.value;
184
- }, d = Promise.resolve().then(v);
185
- return i = { controller: f, promise: d }, d;
186
- }
187
- return {
188
- state: t,
189
- restore: () => t.value.status === "unknown" || t.value.status === "failed" ? y() : i?.promise ?? Promise.resolve(t.value),
190
- refresh: y,
191
- establish(l) {
192
- u(), t.value = { status: "authenticated", ...l };
193
- },
194
- expire() {
195
- if (t.value.status !== "authenticated") return;
196
- const { status: l, ...f } = t.value;
197
- u(), t.value = r && !t.value.impersonator ? { status: "anonymous", reason: "expired", previous: f } : { status: "anonymous", reason: "expired" }, n.onExpired?.();
198
- },
199
- signOut() {
200
- return s ?? (s = (async () => {
201
- try {
202
- const l = t.value;
203
- l.status === "authenticated" && a.size > 0 && await c(l.user), u(), t.value = { status: "anonymous", reason: "signedOut" }, await e.signOut();
204
- } finally {
205
- s = null;
206
- }
207
- })()), s;
208
- },
209
- holdExpired(l) {
210
- r = l;
211
- },
212
- onBeforeSignOut(l) {
213
- return a.add(l), () => void a.delete(l);
214
- }
215
- };
216
- }
217
- function M(e) {
218
- let n = null;
219
- const t = P({
220
- baseUrl: e.config.apiBase,
221
- transport: e.transport,
222
- headers: e.headers,
223
- credentials: e.credentials,
224
- requestId: e.requestId,
225
- async onUnauthorized() {
226
- return r.state.value.status !== "authenticated" ? "fail" : e.renewSession && (n ?? (n = e.renewSession(r, t).then(
227
- (i) => i,
228
- () => !1
229
- ).finally(() => {
230
- n = null;
231
- })), await n) ? "retry" : (r.expire(), "fail");
232
- }
233
- }), o = e.session ?? ((i) => F(i)), a = typeof o == "function" ? o(t) : o, r = H(a, { onError: e.onSessionError, onExpired: e.onSessionExpired, beforeSignOut: e.beforeSignOut }), s = C(
234
- () => E(r.state.value)?.access ?? null,
235
- { covers: e.covers }
236
- );
237
- return { config: e.config, http: t, session: r, access: s };
238
- }
239
- const [Q, G] = k("platform");
240
- function J(e, n) {
241
- e.provide(Q, n);
242
- }
243
- export {
244
- M as a,
245
- w as b,
246
- C as c,
247
- H as d,
248
- F as e,
249
- B as f,
250
- Q as g,
251
- E as h,
252
- J as i,
253
- j as p,
254
- G as u
255
- };