@synopackageland/sdk 0.9.0 → 0.9.2

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 (55) hide show
  1. package/README.md +1 -1
  2. package/dist/i18n/authorization/de.json +7 -2
  3. package/dist/i18n/authorization/en.json +6 -1
  4. package/dist/i18n/authorization/es.json +6 -1
  5. package/dist/i18n/authorization/fr.json +6 -1
  6. package/dist/i18n/authorization/it.json +6 -1
  7. package/dist/i18n/authorization/ja.json +7 -2
  8. package/dist/i18n/authorization/ko.json +7 -2
  9. package/dist/i18n/authorization/zh-CN.json +6 -1
  10. package/dist/i18n/authorization/zh-TW.json +6 -1
  11. package/dist/i18n/delegate/de.json +2 -0
  12. package/dist/i18n/delegate/en.json +2 -0
  13. package/dist/i18n/delegate/es.json +2 -0
  14. package/dist/i18n/delegate/fr.json +2 -0
  15. package/dist/i18n/delegate/it.json +2 -0
  16. package/dist/i18n/delegate/ja.json +2 -0
  17. package/dist/i18n/delegate/ko.json +2 -0
  18. package/dist/i18n/delegate/zh-CN.json +2 -0
  19. package/dist/i18n/delegate/zh-TW.json +2 -0
  20. package/dist/i18n/files/de.json +5 -2
  21. package/dist/i18n/files/en.json +5 -2
  22. package/dist/i18n/files/es.json +5 -2
  23. package/dist/i18n/files/fr.json +5 -2
  24. package/dist/i18n/files/it.json +5 -2
  25. package/dist/i18n/files/ja.json +5 -2
  26. package/dist/i18n/files/ko.json +5 -2
  27. package/dist/i18n/files/zh-CN.json +5 -2
  28. package/dist/i18n/files/zh-TW.json +5 -2
  29. package/dist/i18n/save/de.json +2 -0
  30. package/dist/i18n/save/en.json +2 -0
  31. package/dist/i18n/save/es.json +2 -0
  32. package/dist/i18n/save/fr.json +2 -0
  33. package/dist/i18n/save/it.json +2 -0
  34. package/dist/i18n/save/ja.json +2 -0
  35. package/dist/i18n/save/ko.json +2 -0
  36. package/dist/i18n/save/zh-CN.json +2 -0
  37. package/dist/i18n/save/zh-TW.json +2 -0
  38. package/dist/index.js +2136 -2029
  39. package/dist/src/authorization/AuthorizationGate.vue.d.ts +2 -2
  40. package/dist/src/authorization/AuthorizationSettings.vue.d.ts +3 -0
  41. package/dist/src/authorization/use-authorization.d.ts +20 -0
  42. package/dist/src/delegate/copy.d.ts +4 -0
  43. package/dist/src/delegate/long-running.d.ts +1 -1
  44. package/dist/src/delegate/save-copy.d.ts +6 -0
  45. package/dist/src/files/FolderIcon.vue.d.ts +8 -0
  46. package/dist/src/files/size.d.ts +2 -0
  47. package/dist/src/i18n.d.ts +3 -2
  48. package/dist/src/nas/locale.d.ts +3 -0
  49. package/dist/src/protocol/v1.d.ts +1 -7
  50. package/dist/src/vue.d.ts +2 -0
  51. package/dist/style.css +1 -1
  52. package/dist/vue.js +1335 -1220
  53. package/package.json +3 -3
  54. package/spec/protocol/v1/README.md +11 -0
  55. package/spec/protocol/v1/errors.json +0 -8
package/dist/vue.js CHANGED
@@ -1,11 +1,11 @@
1
- import { shellCopy as Oe, nasCopy as oe, nasErrorCopy as we, format as ve, saveCopy as Ce, saveError as be, createNasProvider as $e, identityCopy as qe, backgroundCopy as Re, createBackgroundPickerProvider as Le, backgroundErrorCopy as Be, requestKey as _e, delegateCopy as xe, errorCopy as Fe, scopedPicker as Ne, authorizationCopy as Me } from "./index.js";
2
- import { activePage as yt, authorizationCatalogs as mt, backgroundCatalogs as bt, catalogs as kt, createBackgroundSaveFacade as _t, createFileTransfers as gt, decodeResponse as ht, delegateCatalogs as wt, encodeRequest as Ct, identityCatalogs as $t, nasCatalogs as xt, protocolCodes as St, protocolOps as zt, protocolSchemas as Vt, saveCatalogs as Ut, shellCatalogs as Pt, shellPages as Dt, uiLocale as At, uiLocales as Et } from "./index.js";
3
- import { inject as He, ref as c, onBeforeUnmount as se, defineComponent as ae, computed as N, openBlock as t, createBlock as h, unref as e, withCtx as s, createVNode as b, renderSlot as ke, createElementVNode as g, onMounted as ie, createElementBlock as C, toDisplayString as l, createTextVNode as p, createCommentVNode as y, Fragment as j, renderList as te, watch as Se, withModifiers as ce, onUnmounted as ze, nextTick as Ke, resolveDynamicComponent as Je } from "vue";
4
- import { AppLayout as Xe, PageContent as Ge, PageHeader as Qe, AppSidebar as We, Button as z, FilePicker as Ye, Callout as Q, TreeView as Ze, DataGrid as je, Dialog as Ve, SettingsSection as de, Link as Ue, Form as pe, FormItem as ne, Input as re, FormActions as fe, Select as Pe, Checkbox as ea, Surface as aa } from "@synopackageland/ui";
5
- import { Timer as la, Info as ta, Folder as ge, File as na, TriangleAlert as sa, ShieldCheck as he } from "@lucide/vue";
6
- const ua = /* @__PURE__ */ Symbol("executor-setup");
7
- function ia() {
8
- return He(ua, {
1
+ import { shellCopy as Ge, nasCopy as ve, nasErrorCopy as Ee, format as Ue, uiLocale as Je, saveCopy as Re, saveError as ze, createNasProvider as Te, identityCopy as Xe, backgroundCopy as Qe, createBackgroundPickerProvider as Ye, backgroundErrorCopy as We, requestKey as De, delegateCopy as qe, errorCopy as Ze, scopedPicker as je, authorizationCopy as ea } from "./index.js";
2
+ import { activePage as Tt, authorizationCatalogs as qt, backgroundCatalogs as Ot, catalogs as Bt, createBackgroundSaveFacade as Lt, createFileTransfers as Ft, decodeResponse as Nt, delegateCatalogs as Mt, encodeRequest as Kt, identityCatalogs as Ht, nasCatalogs as Gt, protocolCodes as Jt, protocolOps as Xt, protocolSchemas as Qt, saveCatalogs as Yt, shellCatalogs as Wt, shellPages as Zt, uiLocales as jt } from "./index.js";
3
+ import { inject as Oe, ref as v, onBeforeUnmount as de, defineComponent as se, computed as N, openBlock as t, createBlock as w, unref as e, withCtx as s, createVNode as y, renderSlot as Ve, createElementVNode as h, markRaw as aa, onMounted as fe, createElementBlock as $, createTextVNode as k, toDisplayString as l, createCommentVNode as b, withKeys as Ie, withModifiers as be, watch as Be, Fragment as te, onUnmounted as Le, nextTick as la, renderList as ce, provide as ta } from "vue";
4
+ import { AppLayout as na, PageContent as sa, PageHeader as ia, AppSidebar as oa, IconButton as xe, Breadcrumb as ua, FilePicker as ra, Button as A, Callout as W, TreeView as da, DataGrid as va, Dialog as Pe, SettingsSection as pe, Link as Fe, Form as he, FormItem as re, Input as me, FormActions as _e, Select as Ne, Checkbox as ca, SettingsRow as fa } from "@synopackageland/ui";
5
+ import { Timer as pa, Info as ya, Folder as ma, ChevronLeft as ba, ChevronRight as ka, RotateCw as ha, File as _a, ShieldCheck as ga } from "@lucide/vue";
6
+ const wa = /* @__PURE__ */ Symbol("executor-setup");
7
+ function Ca() {
8
+ return Oe(wa, {
9
9
  async status() {
10
10
  return { state: "blocked", reason: "setup-unavailable" };
11
11
  },
@@ -17,102 +17,102 @@ function ia() {
17
17
  }
18
18
  });
19
19
  }
20
- function tt(f) {
21
- const P = c(!1), a = c(!1), $ = c(), u = c("");
22
- let r = !1, n = 0, i, o;
23
- function w() {
24
- clearTimeout(i), clearTimeout(o);
20
+ function Ct(c) {
21
+ const S = v(!1), a = v(!1), m = v(), i = v("");
22
+ let r = !1, n = 0, o, u;
23
+ function x() {
24
+ clearTimeout(o), clearTimeout(u);
25
25
  }
26
- function d(V = "") {
27
- n++, w(), $.value = void 0, u.value = V;
26
+ function d(T = "") {
27
+ n++, x(), m.value = void 0, i.value = T;
28
28
  }
29
- function k(V) {
29
+ function p(T) {
30
30
  if (r) return;
31
- const R = Date.parse(V.expiresAt) - Date.now();
32
- if (!Number.isFinite(R) || R <= 0) {
31
+ const q = Date.parse(T.expiresAt) - Date.now();
32
+ if (!Number.isFinite(q) || q <= 0) {
33
33
  d("expired");
34
34
  return;
35
35
  }
36
- w(), $.value = V, u.value = "", i = setTimeout(() => d("expired"), R);
37
- const W = n;
38
- o = setTimeout(async () => {
36
+ x(), m.value = T, i.value = "", o = setTimeout(() => d("expired"), q);
37
+ const j = n;
38
+ u = setTimeout(async () => {
39
39
  try {
40
- const X = await f.call("identity.session");
41
- !r && n === W && k(X);
40
+ const Y = await c.call("identity.session");
41
+ !r && n === j && p(Y);
42
42
  } catch {
43
- !r && n === W && d("expired");
43
+ !r && n === j && d("expired");
44
44
  }
45
- }, Math.min(6e4, R));
45
+ }, Math.min(6e4, q));
46
46
  }
47
- async function E() {
47
+ async function V() {
48
48
  try {
49
- const V = await f.call("identity.status");
49
+ const T = await c.call("identity.status");
50
50
  if (r) return;
51
- if (P.value = V.enabled === !0, P.value)
51
+ if (S.value = T.enabled === !0, S.value)
52
52
  try {
53
- k(await f.call("identity.session", { bootstrap: !0 }));
53
+ p(await c.call("identity.session", { bootstrap: !0 }));
54
54
  } catch {
55
55
  r || d();
56
56
  }
57
- } catch (V) {
58
- const R = V?.code;
59
- P.value = !["unknown_method", "admin_required", "app_privilege_denied", "session_required"].includes(R || ""), P.value && (u.value = "unavailable");
57
+ } catch (T) {
58
+ const q = T?.code;
59
+ S.value = !["unknown_method", "admin_required", "app_privilege_denied", "session_required"].includes(q || ""), S.value && (i.value = "unavailable");
60
60
  } finally {
61
61
  r || (a.value = !0);
62
62
  }
63
63
  }
64
- async function m(V, R) {
65
- const W = n;
64
+ async function C(T, q) {
65
+ const j = n;
66
66
  try {
67
- const X = await f.call(V, R);
68
- if (r || P.value && W !== n) throw { code: "session_required" };
69
- return X;
70
- } catch (X) {
71
- const F = X?.code;
72
- throw !r && W === n && P.value && ["session_required", "session_revalidation_required"].includes(F || "") && d(F === "session_revalidation_required" ? "revalidate" : "expired"), X;
67
+ const Y = await c.call(T, q);
68
+ if (r || S.value && j !== n) throw { code: "session_required" };
69
+ return Y;
70
+ } catch (Y) {
71
+ const J = Y?.code;
72
+ throw !r && j === n && S.value && ["session_required", "session_revalidation_required"].includes(J || "") && d(J === "session_revalidation_required" ? "revalidate" : "expired"), Y;
73
73
  }
74
74
  }
75
- async function U(V, R, W) {
76
- const X = await f.call("identity.login", { account: V, password: R, otp: W });
77
- r || (n++, k(X));
75
+ async function f(T, q, j) {
76
+ const Y = await c.call("identity.login", { account: T, password: q, otp: j });
77
+ r || (n++, p(Y));
78
78
  }
79
- async function S() {
80
- const V = await f.call("identity.session", { bootstrap: !0 });
81
- r || (n++, k(V));
79
+ async function P() {
80
+ const T = await c.call("identity.session", { bootstrap: !0 });
81
+ r || (n++, p(T));
82
82
  }
83
- async function A() {
84
- await f.call("identity.logout"), r || d();
83
+ async function R() {
84
+ await c.call("identity.logout"), r || d();
85
85
  }
86
- function H() {
86
+ function K() {
87
87
  r = !0, d();
88
88
  }
89
- return { enabled: P, ready: a, subject: $, notice: u, start: E, call: m, login: U, bootstrap: S, logout: A, dispose: H };
89
+ return { enabled: S, ready: a, subject: m, notice: i, start: V, call: C, login: f, bootstrap: P, logout: R, dispose: K };
90
90
  }
91
- function oa() {
92
- const f = c(!1), P = c();
93
- let a = !1, $ = 0, u;
91
+ function $a() {
92
+ const c = v(!1), S = v();
93
+ let a = !1, m = 0, i;
94
94
  function r() {
95
- $++, u?.abort(), u = void 0, f.value = !1, P.value = void 0;
95
+ m++, i?.abort(), i = void 0, c.value = !1, S.value = void 0;
96
96
  }
97
- async function n(i) {
98
- if (a || f.value) return;
99
- const o = ++$, w = new AbortController();
100
- u = w, f.value = !0, P.value = void 0;
97
+ async function n(o) {
98
+ if (a || c.value) return;
99
+ const u = ++m, x = new AbortController();
100
+ i = x, c.value = !0, S.value = void 0;
101
101
  try {
102
- const d = await i(w.signal);
103
- return !a && o === $ ? d : void 0;
102
+ const d = await o(x.signal);
103
+ return !a && u === m ? d : void 0;
104
104
  } catch (d) {
105
- !a && o === $ && (P.value = d);
105
+ !a && u === m && (S.value = d);
106
106
  return;
107
107
  } finally {
108
- !a && o === $ && (f.value = !1, u = void 0);
108
+ !a && u === m && (c.value = !1, i = void 0);
109
109
  }
110
110
  }
111
- return se(() => {
111
+ return de(() => {
112
112
  a = !0, r();
113
- }), { busy: f, error: P, run: n, cancel: r };
113
+ }), { busy: c, error: S, run: n, cancel: r };
114
114
  }
115
- const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
115
+ const xa = { class: "app-page-content" }, Sa = /* @__PURE__ */ se({
116
116
  __name: "AppShell",
117
117
  props: {
118
118
  locale: {},
@@ -121,36 +121,36 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
121
121
  description: {}
122
122
  },
123
123
  emits: ["update:modelValue"],
124
- setup(f, { emit: P }) {
125
- const a = f, $ = P, u = N(() => Oe(a.locale)), r = { status: ta, background: la }, n = N(() => [{
126
- items: a.pages.map((o) => ({ key: o, label: u.value[o], icon: r[o] }))
127
- }]), i = N(() => u.value[a.modelValue] ?? u.value.status);
128
- return (o, w) => (t(), h(e(Xe), {
124
+ setup(c, { emit: S }) {
125
+ const a = c, m = S, i = N(() => Ge(a.locale)), r = { status: ya, background: pa }, n = N(() => [{
126
+ items: a.pages.map((u) => ({ key: u, label: i.value[u], icon: r[u] }))
127
+ }]), o = N(() => i.value[a.modelValue] ?? i.value.status);
128
+ return (u, x) => (t(), w(e(na), {
129
129
  class: "app-shell",
130
130
  "min-height": "0",
131
131
  "wide-layout": "window"
132
132
  }, {
133
133
  sidebar: s(() => [
134
- b(e(We), {
135
- "model-value": f.modelValue,
134
+ y(e(oa), {
135
+ "model-value": c.modelValue,
136
136
  groups: n.value,
137
- "onUpdate:modelValue": w[0] || (w[0] = (d) => $("update:modelValue", d))
137
+ "onUpdate:modelValue": x[0] || (x[0] = (d) => m("update:modelValue", d))
138
138
  }, null, 8, ["model-value", "groups"])
139
139
  ]),
140
140
  default: s(() => [
141
- b(e(Ge), { class: "app-page" }, {
141
+ y(e(sa), { class: "app-page" }, {
142
142
  default: s(() => [
143
- b(e(Qe), {
144
- title: i.value,
145
- description: f.description
143
+ y(e(ia), {
144
+ title: o.value,
145
+ description: c.description
146
146
  }, {
147
147
  actions: s(() => [
148
- ke(o.$slots, "actions", {}, void 0, !0)
148
+ Ve(u.$slots, "actions", {}, void 0, !0)
149
149
  ]),
150
150
  _: 3
151
151
  }, 8, ["title", "description"]),
152
- g("div", ra, [
153
- ke(o.$slots, "default", {}, void 0, !0)
152
+ h("div", xa, [
153
+ Ve(u.$slots, "default", {}, void 0, !0)
154
154
  ])
155
155
  ]),
156
156
  _: 3
@@ -159,28 +159,45 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
159
159
  _: 3
160
160
  }));
161
161
  }
162
- }), ue = (f, P) => {
163
- const a = f.__vccOpts || f;
164
- for (const [$, u] of P)
165
- a[$] = u;
162
+ }), oe = (c, S) => {
163
+ const a = c.__vccOpts || c;
164
+ for (const [m, i] of S)
165
+ a[m] = i;
166
166
  return a;
167
- }, nt = /* @__PURE__ */ ue(da, [["__scopeId", "data-v-05f63ca5"]]), va = ["aria-busy", "aria-label"], ca = ["aria-label"], pa = {
167
+ }, $t = /* @__PURE__ */ oe(Sa, [["__scopeId", "data-v-05f63ca5"]]), Se = /* @__PURE__ */ se({
168
+ __name: "FolderIcon",
169
+ props: {
170
+ size: { default: 16 }
171
+ },
172
+ setup(c) {
173
+ return (S, a) => (t(), w(e(ma), {
174
+ size: c.size,
175
+ "aria-hidden": "true",
176
+ "data-folder-icon": "",
177
+ style: { color: "#d9a20b", fill: "#f6c445" }
178
+ }, null, 8, ["size"]));
179
+ }
180
+ }), Ae = ["B", "KB", "MB", "GB", "TB", "PB"];
181
+ function za(c, S) {
182
+ let a = 0, m = c;
183
+ for (; m >= 1024 && a < Ae.length - 1; )
184
+ m /= 1024, a++;
185
+ return `${new Intl.NumberFormat(S, { maximumFractionDigits: a ? 1 : 0 }).format(m)} ${Ae[a]}`;
186
+ }
187
+ const Va = ["aria-busy", "aria-label"], Pa = { class: "file-toolbar file-location" }, Ua = ["aria-label"], Da = {
168
188
  key: 0,
169
189
  class: "file-toolbar"
170
- }, fa = {
190
+ }, Ia = {
171
191
  key: 1,
172
192
  role: "status"
173
- }, ya = { role: "alert" }, ma = {
193
+ }, Aa = { role: "alert" }, Ea = {
174
194
  key: 4,
175
195
  role: "status"
176
- }, ba = { class: "file-columns" }, ka = ["aria-label"], _a = { class: "file-content" }, ga = {
177
- key: 1,
178
- class: "file-name"
179
- }, ha = { class: "file-bytes" }, wa = {
196
+ }, Ra = { class: "file-columns" }, Ta = ["aria-label"], qa = { class: "file-content" }, Oa = ["onKeydown"], Ba = { class: "file-empty" }, La = { class: "file-bytes" }, Fa = {
180
197
  key: 5,
181
198
  class: "file-selection",
182
199
  role: "status"
183
- }, Ca = /* @__PURE__ */ ae({
200
+ }, Na = /* @__PURE__ */ se({
184
201
  __name: "FileBrowser",
185
202
  props: {
186
203
  provider: {},
@@ -189,281 +206,311 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
189
206
  transfers: { type: Boolean, default: !1 }
190
207
  },
191
208
  emits: ["selected"],
192
- setup(f, { emit: P }) {
193
- const a = f, $ = P, u = N(() => oe(a.locale)), r = oa(), { busy: n, error: i } = r, o = c([]), w = c([]), d = c([]), k = c(), E = c(), m = c([]), U = c(), S = c({ key: "name", direction: "asc" }), A = c(0), H = c([]), V = c(!1);
194
- let R = new AbortController();
195
- async function W() {
196
- const v = k.value;
197
- !v || v.isDir || !a.provider.download || await r.run(async (_) => (await a.provider.info(v.path, _), a.provider.download(v.path), !0));
209
+ setup(c, { emit: S }) {
210
+ const a = c, m = S, i = N(() => ve(a.locale)), r = $a(), { busy: n, error: o } = r, u = v([]), x = v([]), d = v([]), p = v(), V = v(), C = v([]), f = v(), P = v({ key: "name", direction: "asc" }), R = v(0), K = v([]), T = v(!1);
211
+ let q = new AbortController();
212
+ async function j() {
213
+ const g = p.value;
214
+ !g || g.isDir || !a.provider.download || await r.run(async (D) => (await a.provider.info(g.path, D), a.provider.download(g.path), !0));
215
+ }
216
+ async function Y() {
217
+ const g = d.value.at(-1)?.path, D = K.value[0];
218
+ if (!g || !D || !a.provider.upload) return;
219
+ T.value = !1, await r.run(async (M) => (await a.provider.upload(g, D, M), !0)) && (K.value = [], await le(d.value), T.value = !0);
220
+ }
221
+ const J = N(() => [
222
+ { key: "name", label: i.value.nameColumn, sortable: !0 },
223
+ { key: "kind", label: i.value.kindColumn },
224
+ { key: "bytes", label: i.value.sizeColumn, align: "right", sortable: !0 }
225
+ ]), L = aa(Se);
226
+ function X(g) {
227
+ return { id: g.path, label: g.name, icon: L, data: g };
228
+ }
229
+ function H(g) {
230
+ p.value = g, m("selected", g?.path);
231
+ }
232
+ function ee(g) {
233
+ (a.mode === "folder" ? g.isDir : !g.isDir) && H(g);
198
234
  }
199
- async function X() {
200
- const v = d.value.at(-1)?.path, _ = H.value[0];
201
- if (!v || !_ || !a.provider.upload) return;
202
- V.value = !1, await r.run(async (G) => (await a.provider.upload(v, _, G), !0)) && (H.value = [], await q(d.value), V.value = !0);
235
+ function ae(g) {
236
+ g.isDir ? $e(g) : ee(g);
203
237
  }
204
- const F = N(() => [
205
- { key: "name", label: u.value.nameColumn, sortable: !0 },
206
- { key: "kind", label: u.value.kindColumn },
207
- { key: "bytes", label: u.value.sizeColumn, align: "right", sortable: !0 },
208
- { key: "selection", label: u.value.selectAction }
209
- ]);
210
- function L(v) {
211
- return { id: v.path, label: v.name, icon: ge, data: v };
238
+ const Q = (g) => u.value.find((D) => D.path === g.path);
239
+ function E(g, D, I = []) {
240
+ for (const M of g) {
241
+ const ne = [...I, M.data];
242
+ if (M.id === D) return ne;
243
+ const ie = E(M.children ?? [], D, ne);
244
+ if (ie) return ie;
245
+ }
246
+ }
247
+ function B(g, D) {
248
+ for (const I of g) {
249
+ if (I.id === D) return I;
250
+ const M = B(I.children ?? [], D);
251
+ if (M) return M;
252
+ }
212
253
  }
213
- function J(v) {
214
- k.value = v, $("selected", v?.path);
254
+ function _(g, D, I) {
255
+ return g.map((M) => M.id === D ? { ...M, children: I } : M.children ? { ...M, children: _(M.children, D, I) } : M);
215
256
  }
216
- function K(v, _, x = []) {
217
- for (const G of v) {
218
- const Z = [...x, G.data];
219
- if (G.id === _) return Z;
220
- const ee = K(G.children ?? [], _, Z);
221
- if (ee) return ee;
257
+ let z = 0;
258
+ async function G(g) {
259
+ const D = ++z;
260
+ for (const I of g.slice(0, -1)) {
261
+ const M = B(x.value, I.path);
262
+ if (!M) break;
263
+ if (M.children === void 0) {
264
+ const ne = await Z(M);
265
+ if (D !== z || !ne) return;
266
+ x.value = _(x.value, M.id, ne);
267
+ }
268
+ C.value.includes(M.id) || (C.value = [...C.value, M.id]);
222
269
  }
270
+ f.value = g.at(-1)?.path;
223
271
  }
224
- async function Y(v) {
225
- const _ = A.value, x = R.signal;
272
+ async function Z(g) {
273
+ const D = R.value, I = q.signal;
226
274
  try {
227
- const G = [];
228
- let Z = 0;
229
- for (; Z !== void 0; ) {
230
- const ee = await a.provider.list(v.id, { offset: Z, sortBy: "name", sortDirection: "ASC" }, x);
231
- if (x.aborted || _ !== A.value) return;
232
- G.push(...ee.entries.filter((me) => me.isDir).map(L)), Z = ee.nextOffset;
275
+ const M = [];
276
+ let ne = 0;
277
+ for (; ne !== void 0; ) {
278
+ const ie = await a.provider.list(g.id, { offset: ne, sortBy: "name", sortDirection: "ASC" }, I);
279
+ if (I.aborted || D !== R.value) return;
280
+ M.push(...ie.entries.filter((He) => He.isDir).map(X)), ne = ie.nextOffset;
233
281
  }
234
- return G;
235
- } catch (G) {
236
- !x.aborted && _ === A.value && (i.value = G, J());
282
+ return M;
283
+ } catch (M) {
284
+ !I.aborted && D === R.value && (o.value = M, H());
237
285
  return;
238
286
  }
239
287
  }
240
- async function q(v, _ = !1) {
288
+ async function le(g, D = !1) {
241
289
  if (n.value) return;
242
- J(), o.value = _ ? o.value : [], E.value = _ ? E.value : void 0;
243
- const x = _ ? E.value ?? 0 : 0, G = v.at(-1)?.path;
244
- d.value = v;
245
- const Z = await r.run((ee) => G ? a.provider.list(G, { offset: x, sortBy: S.value.key, sortDirection: S.value.direction === "asc" ? "ASC" : "DESC" }, ee) : a.provider.shares(x, ee));
246
- Z && (o.value = _ ? [...o.value, ...Z.entries] : Z.entries, E.value = Z.nextOffset, G || (w.value = o.value.filter((ee) => ee.isDir).map(L)));
290
+ H(), u.value = D ? u.value : [], V.value = D ? V.value : void 0;
291
+ const I = D ? V.value ?? 0 : 0, M = g.at(-1)?.path;
292
+ d.value = g;
293
+ const ne = await r.run((ie) => M ? a.provider.list(M, { offset: I, sortBy: P.value.key, sortDirection: P.value.direction === "asc" ? "ASC" : "DESC" }, ie) : a.provider.shares(I, ie));
294
+ ne && (u.value = D ? [...u.value, ...ne.entries] : ne.entries, V.value = ne.nextOffset, M ? a.mode === "folder" && !D && H(g.at(-1)) : x.value = u.value.filter((ie) => ie.isDir).map(X), D || G(g));
295
+ }
296
+ const ge = N(() => [{ id: "", display: i.value.roots }, ...d.value.map((g) => ({ id: g.path, display: g.name }))]);
297
+ function Ce(g) {
298
+ const D = ge.value.findIndex((I) => I.id === g.id);
299
+ D < d.value.length && ke(d.value.slice(0, D));
247
300
  }
248
- function O(v) {
249
- q([...d.value, v]);
301
+ function $e(g) {
302
+ ke([...d.value, g]);
250
303
  }
251
- function T(v) {
252
- S.value = { key: v?.key === "bytes" ? "size" : "name", direction: v?.direction ?? "asc" }, q(d.value);
304
+ const ye = v([[]]), ue = v(0);
305
+ function ke(g) {
306
+ n.value || (g.at(-1)?.path !== d.value.at(-1)?.path && (ye.value = [...ye.value.slice(0, ue.value + 1), g], ue.value++), le(g));
253
307
  }
254
- function M() {
255
- n.value || (A.value++, R.abort(), R = new AbortController(), w.value = [], m.value = [], U.value = void 0, q([]));
308
+ function O(g) {
309
+ n.value || (ue.value += g, le(ye.value[ue.value]));
256
310
  }
257
- return ie(() => {
258
- q([]);
259
- }), se(() => {
260
- A.value++, R.abort();
261
- }), (v, _) => (t(), C("section", {
311
+ function F(g) {
312
+ P.value = { key: g?.key === "bytes" ? "size" : "name", direction: g?.direction ?? "asc" }, le(d.value);
313
+ }
314
+ function U() {
315
+ n.value || (R.value++, q.abort(), q = new AbortController(), x.value = [], C.value = [], f.value = void 0, ye.value = [[]], ue.value = 0, le([]));
316
+ }
317
+ return fe(() => {
318
+ le([]);
319
+ }), de(() => {
320
+ R.value++, q.abort();
321
+ }), (g, D) => (t(), $("section", {
262
322
  class: "file-browser",
263
323
  "aria-busy": e(n),
264
- "aria-label": u.value.title
324
+ "aria-label": i.value.title
265
325
  }, [
266
- g("p", null, l(u.value.ownPermissions), 1),
267
- g("nav", {
268
- class: "file-toolbar",
269
- "aria-label": u.value.directoryKind
270
- }, [
271
- b(e(z), {
272
- variant: "secondary",
273
- disabled: e(n),
274
- onClick: M
326
+ h("div", Pa, [
327
+ y(e(xe), {
328
+ label: i.value.back,
329
+ size: "sm",
330
+ disabled: e(n) || ue.value === 0,
331
+ onClick: D[0] || (D[0] = (I) => O(-1))
275
332
  }, {
276
333
  default: s(() => [
277
- p(l(u.value.refresh), 1)
334
+ y(e(ba), {
335
+ size: 16,
336
+ "aria-hidden": "true"
337
+ })
278
338
  ]),
279
339
  _: 1
280
- }, 8, ["disabled"]),
281
- d.value.length ? (t(), h(e(z), {
282
- key: 0,
283
- variant: "secondary",
284
- disabled: e(n),
285
- onClick: _[0] || (_[0] = (x) => q(d.value.slice(0, -1)))
340
+ }, 8, ["label", "disabled"]),
341
+ y(e(xe), {
342
+ label: i.value.forward,
343
+ size: "sm",
344
+ disabled: e(n) || ue.value === ye.value.length - 1,
345
+ onClick: D[1] || (D[1] = (I) => O(1))
286
346
  }, {
287
347
  default: s(() => [
288
- p(l(u.value.back), 1)
348
+ y(e(ka), {
349
+ size: 16,
350
+ "aria-hidden": "true"
351
+ })
289
352
  ]),
290
353
  _: 1
291
- }, 8, ["disabled"])) : y("", !0),
292
- b(e(z), {
293
- variant: "secondary",
354
+ }, 8, ["label", "disabled"]),
355
+ y(e(xe), {
356
+ label: i.value.refresh,
357
+ size: "sm",
294
358
  disabled: e(n),
295
- onClick: _[1] || (_[1] = (x) => q([]))
359
+ onClick: U
296
360
  }, {
297
361
  default: s(() => [
298
- p(l(u.value.roots), 1)
362
+ y(e(ha), {
363
+ size: 14,
364
+ "aria-hidden": "true"
365
+ })
299
366
  ]),
300
367
  _: 1
301
- }, 8, ["disabled"]),
302
- (t(!0), C(j, null, te(d.value, (x, G) => (t(), h(e(z), {
303
- key: x.path,
304
- variant: "secondary",
305
- disabled: e(n),
306
- onClick: (Z) => q(d.value.slice(0, G + 1))
307
- }, {
308
- default: s(() => [
309
- p(l(x.name), 1)
310
- ]),
311
- _: 2
312
- }, 1032, ["disabled", "onClick"]))), 128))
313
- ], 8, ca),
314
- f.transfers && f.provider.upload && d.value.length ? (t(), C("div", pa, [
315
- b(e(Ye), {
316
- modelValue: H.value,
317
- "onUpdate:modelValue": _[2] || (_[2] = (x) => H.value = x),
368
+ }, 8, ["label", "disabled"]),
369
+ h("nav", {
370
+ class: "file-path",
371
+ "aria-label": i.value.location
372
+ }, [
373
+ y(e(ua), {
374
+ items: ge.value,
375
+ "collapsed-label": i.value.fullPath,
376
+ onClickItem: Ce
377
+ }, null, 8, ["items", "collapsed-label"])
378
+ ], 8, Ua)
379
+ ]),
380
+ c.transfers && c.provider.upload && d.value.length ? (t(), $("div", Da, [
381
+ y(e(ra), {
382
+ modelValue: K.value,
383
+ "onUpdate:modelValue": D[2] || (D[2] = (I) => K.value = I),
318
384
  variant: "compact",
319
385
  disabled: e(n),
320
386
  "max-files": 1,
321
387
  "max-size": 16 * 1024 ** 3,
322
- title: u.value.upload,
323
- onRejected: _[3] || (_[3] = (x) => i.value = { code: "upload_size_required" })
388
+ title: i.value.upload,
389
+ onRejected: D[3] || (D[3] = (I) => o.value = { code: "upload_size_required" })
324
390
  }, null, 8, ["modelValue", "disabled", "title"]),
325
- b(e(z), {
391
+ y(e(A), {
326
392
  variant: "primary",
327
- disabled: e(n) || !H.value.length,
328
- onClick: X
393
+ disabled: e(n) || !K.value.length,
394
+ onClick: Y
329
395
  }, {
330
396
  default: s(() => [
331
- p(l(u.value.upload), 1)
397
+ k(l(i.value.upload), 1)
332
398
  ]),
333
399
  _: 1
334
400
  }, 8, ["disabled"])
335
- ])) : y("", !0),
336
- V.value ? (t(), C("p", fa, l(u.value.uploaded), 1)) : y("", !0),
337
- f.transfers && f.provider.download && k.value && !k.value.isDir && !e(i) ? (t(), h(e(z), {
401
+ ])) : b("", !0),
402
+ T.value ? (t(), $("p", Ia, l(i.value.uploaded), 1)) : b("", !0),
403
+ c.transfers && c.provider.download && p.value && !p.value.isDir && !e(o) ? (t(), w(e(A), {
338
404
  key: 2,
339
405
  variant: "secondary",
340
406
  disabled: e(n),
341
- onClick: W
407
+ onClick: j
342
408
  }, {
343
409
  default: s(() => [
344
- p(l(u.value.download), 1)
410
+ k(l(i.value.download), 1)
345
411
  ]),
346
412
  _: 1
347
- }, 8, ["disabled"])) : y("", !0),
348
- e(i) ? (t(), h(e(Q), {
413
+ }, 8, ["disabled"])) : b("", !0),
414
+ e(o) ? (t(), w(e(W), {
349
415
  key: 3,
350
416
  tone: "danger"
351
417
  }, {
352
418
  default: s(() => [
353
- g("span", ya, l(e(we)(e(i), u.value)), 1)
419
+ h("span", Aa, l(e(Ee)(e(o), i.value)), 1)
354
420
  ]),
355
421
  _: 1
356
- })) : y("", !0),
357
- e(n) ? (t(), C("p", ma, l(u.value.loading), 1)) : y("", !0),
358
- g("div", ba, [
359
- g("aside", {
422
+ })) : b("", !0),
423
+ e(n) ? (t(), $("p", Ea, l(i.value.loading), 1)) : b("", !0),
424
+ h("div", Ra, [
425
+ h("aside", {
360
426
  class: "file-tree",
361
- "aria-label": u.value.roots
427
+ "aria-label": i.value.roots
362
428
  }, [
363
- w.value.length ? (t(), h(e(Ze), {
364
- key: A.value,
365
- modelValue: U.value,
366
- "onUpdate:modelValue": _[4] || (_[4] = (x) => U.value = x),
367
- nodes: w.value,
368
- "onUpdate:nodes": _[5] || (_[5] = (x) => w.value = x),
369
- expanded: m.value,
370
- "onUpdate:expanded": _[6] || (_[6] = (x) => m.value = x),
371
- "load-children": Y,
372
- "expand-label": (x, G) => e(ve)(G ? u.value.collapse : u.value.expand, x.label),
373
- onSelect: _[7] || (_[7] = (x) => q(K(w.value, x.id) ?? [x.data]))
374
- }, null, 8, ["modelValue", "nodes", "expanded", "expand-label"])) : y("", !0)
375
- ], 8, ka),
376
- g("div", _a, [
377
- e(i) ? y("", !0) : (t(), h(e(je), {
429
+ x.value.length ? (t(), w(e(da), {
430
+ key: R.value,
431
+ modelValue: f.value,
432
+ "onUpdate:modelValue": D[4] || (D[4] = (I) => f.value = I),
433
+ nodes: x.value,
434
+ "onUpdate:nodes": D[5] || (D[5] = (I) => x.value = I),
435
+ expanded: C.value,
436
+ "onUpdate:expanded": D[6] || (D[6] = (I) => C.value = I),
437
+ "load-children": Z,
438
+ "expand-label": (I, M) => e(Ue)(M ? i.value.collapse : i.value.expand, I.label),
439
+ onSelect: D[7] || (D[7] = (I) => ke(E(x.value, I.id) ?? [I.data]))
440
+ }, null, 8, ["modelValue", "nodes", "expanded", "expand-label"])) : b("", !0)
441
+ ], 8, Ta),
442
+ h("div", qa, [
443
+ e(o) ? b("", !0) : (t(), w(e(va), {
378
444
  key: 0,
379
- columns: F.value,
380
- rows: o.value.map((x) => ({ ...x, kind: x.isDir ? u.value.directoryKind : u.value.fileKind })),
445
+ columns: J.value,
446
+ rows: u.value.map((I) => ({ ...I, kind: I.isDir ? i.value.directoryKind : i.value.fileKind })),
381
447
  "row-key": "path",
382
448
  footer: !1,
383
449
  resizable: !1,
384
450
  "local-sort": !1,
385
451
  "local-pagination": !1,
386
452
  loading: e(n),
387
- "loading-text": u.value.loading,
388
- sort: { key: S.value.key === "size" ? "bytes" : S.value.key, direction: S.value.direction },
389
- labels: { empty: u.value.emptyFolder },
390
- "onUpdate:sort": T
453
+ "loading-text": i.value.loading,
454
+ sort: { key: P.value.key === "size" ? "bytes" : P.value.key, direction: P.value.direction },
455
+ labels: { empty: i.value.emptyFolder },
456
+ "selected-keys": p.value ? [p.value.path] : [],
457
+ "onUpdate:sort": F,
458
+ onRowClick: D[8] || (D[8] = (I) => {
459
+ e(n) || ee(Q(I));
460
+ }),
461
+ onRowDblclick: D[9] || (D[9] = (I) => {
462
+ e(n) || ae(Q(I));
463
+ })
391
464
  }, {
392
- "cell-name": s(({ row: x }) => [
393
- x.isDir ? (t(), h(e(z), {
394
- key: 0,
395
- variant: "secondary",
396
- disabled: e(n),
397
- "aria-label": e(ve)(u.value.open, String(x.name)),
398
- onClick: (G) => O(o.value.find((Z) => Z.path === x.path))
399
- }, {
400
- default: s(() => [
401
- b(e(ge), {
402
- size: 16,
403
- "aria-hidden": "true"
404
- }),
405
- p(l(x.name), 1)
406
- ]),
407
- _: 2
408
- }, 1032, ["disabled", "aria-label", "onClick"])) : (t(), C("span", ga, [
409
- b(e(na), {
465
+ "cell-name": s(({ row: I }) => [
466
+ h("span", {
467
+ class: "file-name",
468
+ tabindex: "0",
469
+ onKeydown: [
470
+ Ie(be((M) => !e(n) && ae(Q(I)), ["prevent"]), ["enter"]),
471
+ Ie(be((M) => !e(n) && ee(Q(I)), ["prevent"]), ["space"])
472
+ ]
473
+ }, [
474
+ I.isDir ? (t(), w(Se, { key: 0 })) : (t(), w(e(_a), {
475
+ key: 1,
476
+ class: "file-icon",
410
477
  size: 16,
411
478
  "aria-hidden": "true"
412
- }),
413
- p(l(x.name), 1)
414
- ]))
479
+ })),
480
+ k(l(I.name), 1)
481
+ ], 40, Oa)
415
482
  ]),
416
- "cell-bytes": s(({ row: x }) => [
417
- g("span", ha, l(x.isDir ? "—" : x.bytes ?? "—"), 1)
483
+ empty: s(() => [
484
+ h("div", Ba, [
485
+ y(Se, { size: 40 }),
486
+ h("span", null, l(i.value.emptyFolder), 1)
487
+ ])
418
488
  ]),
419
- "cell-selection": s(({ row: x }) => [
420
- (f.mode === "folder" ? x.isDir : !x.isDir) ? (t(), h(e(z), {
421
- key: 0,
422
- variant: "secondary",
423
- disabled: e(n),
424
- "aria-pressed": k.value?.path === x.path,
425
- "aria-label": e(ve)(u.value.select, String(x.name)),
426
- onClick: (G) => J(o.value.find((Z) => Z.path === x.path))
427
- }, {
428
- default: s(() => [
429
- p(l(u.value.selectAction), 1)
430
- ]),
431
- _: 1
432
- }, 8, ["disabled", "aria-pressed", "aria-label", "onClick"])) : y("", !0)
489
+ "cell-bytes": s(({ row: I }) => [
490
+ h("span", La, l(I.isDir || I.bytes === void 0 ? "—" : e(za)(I.bytes, e(Je)(c.locale))), 1)
433
491
  ]),
434
492
  _: 1
435
- }, 8, ["columns", "rows", "loading", "loading-text", "sort", "labels"])),
436
- E.value !== void 0 && !e(i) ? (t(), h(e(z), {
493
+ }, 8, ["columns", "rows", "loading", "loading-text", "sort", "labels", "selected-keys"])),
494
+ V.value !== void 0 && !e(o) ? (t(), w(e(A), {
437
495
  key: 1,
438
496
  variant: "secondary",
439
497
  disabled: e(n),
440
- onClick: _[8] || (_[8] = (x) => q(d.value, !0))
441
- }, {
442
- default: s(() => [
443
- p(l(u.value.loadMore), 1)
444
- ]),
445
- _: 1
446
- }, 8, ["disabled"])) : y("", !0),
447
- f.mode === "folder" && d.value.length && !e(i) ? (t(), h(e(z), {
448
- key: 2,
449
- variant: "secondary",
450
- disabled: e(n),
451
- onClick: _[9] || (_[9] = (x) => J(d.value.at(-1)))
498
+ onClick: D[10] || (D[10] = (I) => le(d.value, !0))
452
499
  }, {
453
500
  default: s(() => [
454
- p(l(e(ve)(u.value.select, d.value.at(-1).name)), 1)
501
+ k(l(i.value.loadMore), 1)
455
502
  ]),
456
503
  _: 1
457
- }, 8, ["disabled"])) : y("", !0)
504
+ }, 8, ["disabled"])) : b("", !0)
458
505
  ])
459
506
  ]),
460
- k.value && !e(i) ? (t(), C("p", wa, l(e(ve)(u.value.selected, k.value.path)), 1)) : y("", !0)
461
- ], 8, va));
507
+ p.value && !e(o) ? (t(), $("p", Fa, l(e(Ue)(i.value.selected, p.value.path)), 1)) : b("", !0)
508
+ ], 8, Va));
462
509
  }
463
- }), De = /* @__PURE__ */ ue(Ca, [["__scopeId", "data-v-f1aee828"]]), $a = {
510
+ }), Me = /* @__PURE__ */ oe(Na, [["__scopeId", "data-v-0b21604d"]]), Ma = {
464
511
  key: 0,
465
512
  class: "save-consent"
466
- }, xa = ["aria-busy", "inert"], Sa = /* @__PURE__ */ ae({
513
+ }, Ka = ["aria-busy", "inert"], Ha = /* @__PURE__ */ se({
467
514
  __name: "NasPicker",
468
515
  props: {
469
516
  open: { type: Boolean },
@@ -475,264 +522,272 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
475
522
  destination: {}
476
523
  },
477
524
  emits: ["update:open", "selected", "authorized"],
478
- setup(f, { emit: P }) {
479
- const a = f, $ = P, u = c(), r = N(() => oe(a.locale)), n = N(() => Ce(a.locale)), i = c(!1), o = c();
480
- let w = 0, d = !1;
481
- Se(() => a.open, () => {
482
- w++, u.value = void 0, o.value = void 0;
483
- }), se(() => {
484
- d = !0, w++;
525
+ setup(c, { emit: S }) {
526
+ const a = c, m = S, i = v(), r = N(() => ve(a.locale)), n = N(() => Re(a.locale)), o = v(!1), u = v();
527
+ let x = 0, d = !1;
528
+ Be(() => a.open, () => {
529
+ x++, i.value = void 0, u.value = void 0;
530
+ }), de(() => {
531
+ d = !0, x++;
485
532
  });
486
- function k() {
487
- i.value || (u.value = void 0, $("update:open", !1));
533
+ function p() {
534
+ o.value || (i.value = void 0, m("update:open", !1));
488
535
  }
489
- async function E() {
490
- const m = u.value, U = a.destination, S = w;
491
- if (!(!m || i.value || !a.open || d || U && a.mode !== "folder")) {
492
- if (!U) {
493
- $("selected", m), k();
536
+ async function V() {
537
+ const C = i.value, f = a.destination, P = x;
538
+ if (!(!C || o.value || !a.open || d || f && a.mode !== "folder")) {
539
+ if (!f) {
540
+ m("selected", C), p();
494
541
  return;
495
542
  }
496
- i.value = !0, o.value = void 0;
543
+ o.value = !0, u.value = void 0;
497
544
  try {
498
- const A = await U.selectDestination({ key: U.key, path: m });
499
- if (d || S !== w) return;
500
- if (!A || typeof A.id != "string" || !A.id || typeof A.username != "string" || !A.username || A.path !== m || A.key !== U.key || A.lifetime !== "until-revoked") throw { code: "commit-uncertain" };
501
- $("authorized", A), i.value = !1, k();
502
- } catch (A) {
503
- !d && S === w && (o.value = A);
545
+ const R = await f.selectDestination({ key: f.key, path: C });
546
+ if (d || P !== x) return;
547
+ if (!R || typeof R.id != "string" || !R.id || typeof R.username != "string" || !R.username || R.path !== C || R.key !== f.key || R.lifetime !== "until-revoked") throw { code: "commit-uncertain" };
548
+ m("authorized", R), o.value = !1, p();
549
+ } catch (R) {
550
+ !d && P === x && (u.value = R);
504
551
  } finally {
505
- d || (i.value = !1);
552
+ d || (o.value = !1);
506
553
  }
507
554
  }
508
555
  }
509
- return (m, U) => (t(), h(e(Ve), {
510
- open: f.open,
511
- title: f.title ?? (f.mode === "folder" ? r.value.choose : r.value.chooseFile),
512
- description: f.description ?? r.value.ownPermissions,
556
+ return (C, f) => (t(), w(e(Pe), {
557
+ open: c.open,
558
+ title: c.title ?? (c.mode === "folder" ? r.value.choose : r.value.chooseFile),
559
+ description: c.description ?? r.value.ownPermissions,
513
560
  "close-label": r.value.close,
514
- "show-close": !i.value,
561
+ "show-close": !o.value,
515
562
  width: "800px",
516
- onEscapeKeyDown: U[1] || (U[1] = (S) => {
517
- i.value && S.preventDefault();
563
+ onEscapeKeyDown: f[1] || (f[1] = (P) => {
564
+ o.value && P.preventDefault();
518
565
  }),
519
- onInteractOutside: U[2] || (U[2] = (S) => {
520
- i.value && S.preventDefault();
566
+ onInteractOutside: f[2] || (f[2] = (P) => {
567
+ o.value && P.preventDefault();
521
568
  }),
522
- "onUpdate:open": U[3] || (U[3] = (S) => {
523
- S || k();
569
+ "onUpdate:open": f[3] || (f[3] = (P) => {
570
+ P || p();
524
571
  })
525
572
  }, {
526
573
  footer: s(() => [
527
- b(e(z), {
574
+ y(e(A), {
528
575
  variant: "secondary",
529
- disabled: i.value,
530
- onClick: k
576
+ disabled: o.value,
577
+ onClick: p
531
578
  }, {
532
579
  default: s(() => [
533
- p(l(r.value.cancel), 1)
580
+ k(l(r.value.cancel), 1)
534
581
  ]),
535
582
  _: 1
536
583
  }, 8, ["disabled"]),
537
- b(e(z), {
584
+ y(e(A), {
538
585
  variant: "primary",
539
- disabled: !u.value || i.value || !!f.destination && f.mode !== "folder",
540
- onClick: E
586
+ disabled: !i.value || o.value || !!c.destination && c.mode !== "folder",
587
+ onClick: V
541
588
  }, {
542
589
  default: s(() => [
543
- p(l(r.value.confirm), 1)
590
+ k(l(r.value.confirm), 1)
544
591
  ]),
545
592
  _: 1
546
593
  }, 8, ["disabled"])
547
594
  ]),
548
595
  default: s(() => [
549
- f.destination ? (t(), C("p", $a, l(n.value.selection), 1)) : y("", !0),
550
- o.value ? (t(), h(e(Q), {
596
+ c.destination ? (t(), $("p", Ma, l(n.value.selection), 1)) : b("", !0),
597
+ u.value ? (t(), w(e(W), {
551
598
  key: 1,
552
599
  tone: "danger",
553
600
  role: "alert",
554
601
  class: "save-message"
555
602
  }, {
556
603
  default: s(() => [
557
- p(l(e(be)(o.value, n.value)), 1)
604
+ k(l(e(ze)(u.value, n.value)), 1)
558
605
  ]),
559
606
  _: 1
560
- })) : y("", !0),
561
- g("div", {
607
+ })) : b("", !0),
608
+ h("div", {
562
609
  class: "nas-picker-content",
563
- "aria-busy": i.value,
564
- inert: i.value
610
+ "aria-busy": o.value,
611
+ inert: o.value
565
612
  }, [
566
- f.open ? (t(), h(De, {
613
+ c.open ? (t(), w(Me, {
567
614
  key: 0,
568
- provider: f.provider,
569
- locale: f.locale,
570
- mode: f.mode,
571
- onSelected: U[0] || (U[0] = (S) => u.value = S)
572
- }, null, 8, ["provider", "locale", "mode"])) : y("", !0)
573
- ], 8, xa)
615
+ provider: c.provider,
616
+ locale: c.locale,
617
+ mode: c.mode,
618
+ onSelected: f[0] || (f[0] = (P) => i.value = P)
619
+ }, null, 8, ["provider", "locale", "mode"])) : b("", !0)
620
+ ], 8, Ka)
574
621
  ]),
575
622
  _: 1
576
623
  }, 8, ["open", "title", "description", "close-label", "show-close"]));
577
624
  }
578
- }), ye = /* @__PURE__ */ ue(Sa, [["__scopeId", "data-v-535a0e54"]]), za = { role: "alert" }, Va = { class: "files-actions" }, Ua = {
625
+ }), we = /* @__PURE__ */ oe(Ha, [["__scopeId", "data-v-535a0e54"]]), Ga = { role: "alert" }, Ja = { class: "files-actions" }, Xa = {
579
626
  key: 0,
580
627
  class: "files-path",
581
628
  role: "status"
582
- }, Pa = /* @__PURE__ */ ae({
629
+ }, Qa = /* @__PURE__ */ se({
583
630
  __name: "FilesPage",
584
631
  props: {
585
632
  ctx: {}
586
633
  },
587
- setup(f) {
588
- const P = f, a = c(), $ = c(!1), u = c("folder"), r = c(!1), n = c(""), i = c(0), o = $e(P.ctx);
589
- let w = !1, d;
590
- async function k() {
591
- if (!w) {
592
- a.value = void 0, $.value = !1, n.value = "", r.value = !1, i.value++;
634
+ setup(c) {
635
+ const S = c, a = v(), m = v(!1), i = v("folder"), r = v(!1), n = v(""), o = v(0), u = Te(S.ctx);
636
+ let x = !1, d;
637
+ async function p() {
638
+ if (!x) {
639
+ a.value = void 0, m.value = !1, n.value = "", r.value = !1, o.value++;
593
640
  try {
594
- await P.ctx.call("nas.session.status"), w || ($.value = !0);
595
- } catch (E) {
596
- !w && E?.code !== "unknown_method" && (a.value = E);
641
+ await S.ctx.call("nas.session.status"), x || (m.value = !0);
642
+ } catch (V) {
643
+ !x && V?.code !== "unknown_method" && (a.value = V);
597
644
  }
598
645
  }
599
646
  }
600
- return ie(() => {
601
- d = P.ctx.reopen(() => {
602
- k();
603
- }), k();
604
- }), se(() => {
605
- w = !0, d?.(), o.dispose();
606
- }), (E, m) => (t(), C(j, null, [
607
- a.value ? (t(), h(e(Q), {
647
+ return fe(() => {
648
+ d = S.ctx.reopen(() => {
649
+ p();
650
+ }), p();
651
+ }), de(() => {
652
+ x = !0, d?.(), u.dispose();
653
+ }), (V, C) => (t(), $(te, null, [
654
+ a.value ? (t(), w(e(W), {
608
655
  key: 0,
609
656
  tone: "danger"
610
657
  }, {
611
658
  default: s(() => [
612
- g("span", za, l(e(we)(a.value, e(oe)(f.ctx.locale))), 1),
613
- b(e(z), {
659
+ h("span", Ga, l(e(Ee)(a.value, e(ve)(c.ctx.locale))), 1),
660
+ y(e(A), {
614
661
  variant: "secondary",
615
- onClick: k
662
+ onClick: p
616
663
  }, {
617
664
  default: s(() => [
618
- p(l(e(oe)(f.ctx.locale).refresh), 1)
665
+ k(l(e(ve)(c.ctx.locale).refresh), 1)
619
666
  ]),
620
667
  _: 1
621
668
  })
622
669
  ]),
623
670
  _: 1
624
- })) : y("", !0),
625
- $.value ? (t(), h(e(de), {
671
+ })) : b("", !0),
672
+ m.value ? (t(), w(e(pe), {
626
673
  key: 1,
627
- title: e(oe)(f.ctx.locale).title,
674
+ title: e(ve)(c.ctx.locale).title,
628
675
  collapsible: !1
629
676
  }, {
630
677
  default: s(() => [
631
- g("div", Va, [
632
- b(e(z), {
678
+ h("p", null, l(e(ve)(c.ctx.locale).ownPermissions), 1),
679
+ h("div", Ja, [
680
+ y(e(A), {
633
681
  variant: "secondary",
634
- onClick: m[0] || (m[0] = (U) => {
635
- u.value = "folder", r.value = !0;
682
+ onClick: C[0] || (C[0] = (f) => {
683
+ i.value = "folder", r.value = !0;
636
684
  })
637
685
  }, {
638
686
  default: s(() => [
639
- p(l(e(oe)(f.ctx.locale).choose), 1)
687
+ k(l(e(ve)(c.ctx.locale).choose), 1)
640
688
  ]),
641
689
  _: 1
642
690
  }),
643
- b(e(z), {
691
+ y(e(A), {
644
692
  variant: "secondary",
645
- onClick: m[1] || (m[1] = (U) => {
646
- u.value = "file", r.value = !0;
693
+ onClick: C[1] || (C[1] = (f) => {
694
+ i.value = "file", r.value = !0;
647
695
  })
648
696
  }, {
649
697
  default: s(() => [
650
- p(l(e(oe)(f.ctx.locale).chooseFile), 1)
698
+ k(l(e(ve)(c.ctx.locale).chooseFile), 1)
651
699
  ]),
652
700
  _: 1
653
701
  })
654
702
  ]),
655
- n.value ? (t(), C("p", Ua, l(n.value), 1)) : y("", !0),
656
- (t(), h(De, {
657
- key: i.value,
658
- provider: e(o),
659
- locale: f.ctx.locale,
703
+ n.value ? (t(), $("p", Xa, l(n.value), 1)) : b("", !0),
704
+ (t(), w(Me, {
705
+ key: o.value,
706
+ provider: e(u),
707
+ locale: c.ctx.locale,
660
708
  transfers: ""
661
709
  }, null, 8, ["provider", "locale"])),
662
- b(ye, {
663
- provider: e(o),
664
- locale: f.ctx.locale,
665
- mode: u.value,
710
+ y(we, {
711
+ provider: e(u),
712
+ locale: c.ctx.locale,
713
+ mode: i.value,
666
714
  open: r.value,
667
- "onUpdate:open": m[2] || (m[2] = (U) => r.value = U),
668
- onSelected: m[3] || (m[3] = (U) => n.value = U)
715
+ "onUpdate:open": C[2] || (C[2] = (f) => r.value = f),
716
+ onSelected: C[3] || (C[3] = (f) => n.value = f)
669
717
  }, null, 8, ["provider", "locale", "mode", "open"])
670
718
  ]),
671
719
  _: 1
672
- }, 8, ["title"])) : y("", !0)
720
+ }, 8, ["title"])) : b("", !0)
673
721
  ], 64));
674
722
  }
675
- }), st = /* @__PURE__ */ ue(Pa, [["__scopeId", "data-v-97bc5d15"]]), Da = { key: 0 }, Aa = { key: 0 }, Ea = { key: 3 }, Ta = { role: "alert" }, ut = /* @__PURE__ */ ae({
723
+ }), xt = /* @__PURE__ */ oe(Qa, [["__scopeId", "data-v-699931fa"]]), Ya = { key: 0 }, Wa = { key: 0 }, Za = { key: 3 }, ja = { role: "alert" }, el = 5e3, St = /* @__PURE__ */ se({
676
724
  __name: "PortalSettings",
677
725
  props: {
678
726
  portal: {}
679
727
  },
680
- setup(f) {
681
- const P = f, a = P.portal.messages, $ = c(), u = c(""), r = c(!1), n = c("");
682
- let i = !1;
683
- function o(d) {
684
- i || ($.value = d, u.value = d.alias || d.defaultAlias);
728
+ setup(c) {
729
+ const S = c, a = S.portal.messages, m = v(), i = v(""), r = v(!1), n = v("");
730
+ let o = !1;
731
+ function u(p) {
732
+ o || (m.value = p, i.value = p.alias || p.defaultAlias);
685
733
  }
686
- async function w(d) {
687
- if (!r.value) {
688
- r.value = !0, n.value = "";
689
- try {
690
- o(await d());
691
- } catch (k) {
692
- i || (n.value = a[k?.code || ""] || a.portal_unavailable);
693
- } finally {
694
- i || (r.value = !1);
734
+ const x = /* @__PURE__ */ Symbol("late");
735
+ async function d(p) {
736
+ if (r.value) return;
737
+ r.value = !0, n.value = "";
738
+ const V = p();
739
+ try {
740
+ const C = await Promise.race([V, new Promise((f) => setTimeout(() => f(x), el))]);
741
+ if (C !== x) {
742
+ u(C);
743
+ return;
695
744
  }
745
+ V.then(u, () => {
746
+ }), u(await S.portal.status());
747
+ } catch (C) {
748
+ o || (n.value = a[C?.code || ""] || a.portal_unavailable);
749
+ } finally {
750
+ o || (r.value = !1);
696
751
  }
697
752
  }
698
- return ie(() => {
699
- P.portal.status().then(o);
700
- }), se(() => {
701
- i = !0;
702
- }), (d, k) => $.value ? (t(), h(e(de), {
753
+ return fe(() => {
754
+ S.portal.status().then(u);
755
+ }), de(() => {
756
+ o = !0;
757
+ }), (p, V) => m.value ? (t(), w(e(pe), {
703
758
  key: 0,
704
759
  title: e(a).title,
705
760
  collapsible: !1,
706
761
  "aria-busy": r.value
707
762
  }, {
708
763
  default: s(() => [
709
- $.value.state === "active" ? (t(), C("p", Da, [
710
- p(l(e(a).link) + " ", 1),
711
- b(e(Ue), {
712
- href: $.value.url,
764
+ m.value.state === "active" ? (t(), $("p", Ya, [
765
+ k(l(e(a).link) + " ", 1),
766
+ y(e(Fe), {
767
+ href: m.value.url,
713
768
  external: ""
714
769
  }, {
715
770
  default: s(() => [
716
- p(l($.value.url), 1)
771
+ k(l(m.value.url), 1)
717
772
  ]),
718
773
  _: 1
719
774
  }, 8, ["href"])
720
- ])) : y("", !0),
721
- $.value.canManage ? (t(), C(j, { key: 1 }, [
722
- $.value.state !== "active" ? (t(), C("p", Aa, l(e(a).inactive), 1)) : y("", !0),
723
- b(e(pe), {
724
- onSubmit: k[2] || (k[2] = ce((E) => w(() => f.portal.apply(u.value)), ["prevent"]))
775
+ ])) : b("", !0),
776
+ m.value.canManage ? (t(), $(te, { key: 1 }, [
777
+ m.value.state !== "active" ? (t(), $("p", Wa, l(e(a).inactive), 1)) : b("", !0),
778
+ y(e(he), {
779
+ onSubmit: V[2] || (V[2] = be((C) => d(() => c.portal.apply(i.value)), ["prevent"]))
725
780
  }, {
726
781
  default: s(() => [
727
- b(e(ne), {
782
+ y(e(re), {
728
783
  label: e(a).alias,
729
784
  "label-for": "portal-alias"
730
785
  }, {
731
786
  default: s(() => [
732
- b(e(re), {
787
+ y(e(me), {
733
788
  id: "portal-alias",
734
- modelValue: u.value,
735
- "onUpdate:modelValue": k[0] || (k[0] = (E) => u.value = E),
789
+ modelValue: i.value,
790
+ "onUpdate:modelValue": V[0] || (V[0] = (C) => i.value = C),
736
791
  maxlength: "64",
737
792
  autocomplete: "off",
738
793
  disabled: r.value
@@ -740,227 +795,227 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
740
795
  ]),
741
796
  _: 1
742
797
  }, 8, ["label"]),
743
- b(e(fe), null, {
798
+ y(e(_e), null, {
744
799
  default: s(() => [
745
- b(e(z), {
800
+ y(e(A), {
746
801
  type: "submit",
747
802
  variant: "primary",
748
803
  disabled: r.value
749
804
  }, {
750
805
  default: s(() => [
751
- p(l(e(a).apply), 1)
806
+ k(l(e(a).apply), 1)
752
807
  ]),
753
808
  _: 1
754
809
  }, 8, ["disabled"]),
755
- $.value.state === "active" ? (t(), h(e(z), {
810
+ m.value.state === "active" ? (t(), w(e(A), {
756
811
  key: 0,
757
812
  variant: "secondary",
758
813
  disabled: r.value,
759
- onClick: k[1] || (k[1] = (E) => w(() => f.portal.disable()))
814
+ onClick: V[1] || (V[1] = (C) => d(() => c.portal.disable()))
760
815
  }, {
761
816
  default: s(() => [
762
- p(l(e(a).disable), 1)
817
+ k(l(e(a).disable), 1)
763
818
  ]),
764
819
  _: 1
765
- }, 8, ["disabled"])) : y("", !0)
820
+ }, 8, ["disabled"])) : b("", !0)
766
821
  ]),
767
822
  _: 1
768
823
  })
769
824
  ]),
770
825
  _: 1
771
826
  }),
772
- b(e(z), {
827
+ y(e(A), {
773
828
  variant: "secondary",
774
- onClick: k[3] || (k[3] = (E) => f.portal.openControlPanel())
829
+ onClick: V[3] || (V[3] = (C) => c.portal.openControlPanel())
775
830
  }, {
776
831
  default: s(() => [
777
- p(l(e(a).advanced), 1)
832
+ k(l(e(a).advanced), 1)
778
833
  ]),
779
834
  _: 1
780
835
  })
781
- ], 64)) : $.value.controlPanel ? (t(), h(e(z), {
836
+ ], 64)) : m.value.controlPanel ? (t(), w(e(A), {
782
837
  key: 2,
783
838
  variant: "secondary",
784
- onClick: k[4] || (k[4] = (E) => f.portal.openControlPanel())
839
+ onClick: V[4] || (V[4] = (C) => c.portal.openControlPanel())
785
840
  }, {
786
841
  default: s(() => [
787
- p(l(e(a).controlPanel), 1)
842
+ k(l(e(a).controlPanel), 1)
788
843
  ]),
789
844
  _: 1
790
- })) : $.value.state !== "active" ? (t(), C("p", Ea, l(e(a).askAdmin), 1)) : y("", !0),
791
- n.value ? (t(), h(e(Q), {
845
+ })) : m.value.state !== "active" ? (t(), $("p", Za, l(e(a).askAdmin), 1)) : b("", !0),
846
+ n.value ? (t(), w(e(W), {
792
847
  key: 4,
793
848
  tone: "danger"
794
849
  }, {
795
850
  default: s(() => [
796
- g("span", Ta, l(n.value), 1)
851
+ h("span", ja, l(n.value), 1)
797
852
  ]),
798
853
  _: 1
799
- })) : y("", !0)
854
+ })) : b("", !0)
800
855
  ]),
801
856
  _: 1
802
- }, 8, ["title", "aria-busy"])) : y("", !0);
857
+ }, 8, ["title", "aria-busy"])) : b("", !0);
803
858
  }
804
- }), Ia = ["aria-busy"], Oa = {
859
+ }), al = ["aria-busy"], ll = {
805
860
  key: 1,
806
861
  role: "status"
807
- }, qa = { role: "alert" }, Ra = { role: "status" }, La = /* @__PURE__ */ ae({
862
+ }, tl = { role: "alert" }, nl = { role: "status" }, sl = /* @__PURE__ */ se({
808
863
  __name: "LoginPage",
809
864
  props: {
810
865
  session: {},
811
866
  locale: {}
812
867
  },
813
- setup(f) {
814
- const P = f, a = N(() => qe(P.locale)), $ = c(""), u = c(""), r = c(""), n = c(!1), i = c(!1), o = c(""), w = c(), d = N(() => window.location.protocol === "https:");
815
- let k = !1;
816
- function E(A) {
817
- const H = A?.code;
818
- return a.value.errors[H || ""] || a.value.errors.failed;
868
+ setup(c) {
869
+ const S = c, a = N(() => Xe(S.locale)), m = v(""), i = v(""), r = v(""), n = v(!1), o = v(!1), u = v(""), x = v(), d = N(() => window.location.protocol === "https:");
870
+ let p = !1;
871
+ function V(R) {
872
+ const K = R?.code;
873
+ return a.value.errors[K || ""] || a.value.errors.failed;
819
874
  }
820
- async function m() {
821
- if (!(i.value || !d.value || !$.value || !u.value || n.value && !r.value)) {
822
- i.value = !0, o.value = "";
875
+ async function C() {
876
+ if (!(o.value || !d.value || !m.value || !i.value || n.value && !r.value)) {
877
+ o.value = !0, u.value = "";
823
878
  try {
824
- await P.session.login($.value, u.value, r.value), u.value = "", r.value = "";
825
- } catch (A) {
826
- if (k) return;
827
- r.value = "", A?.code === "otp_required" ? n.value = !0 : (o.value = E(A), u.value = "", n.value = !1);
879
+ await S.session.login(m.value, i.value, r.value), i.value = "", r.value = "";
880
+ } catch (R) {
881
+ if (p) return;
882
+ r.value = "", R?.code === "otp_required" ? n.value = !0 : (u.value = V(R), i.value = "", n.value = !1);
828
883
  } finally {
829
- k || (i.value = !1, n.value && (await Ke(), k || w.value?.querySelector("input")?.focus()));
884
+ p || (o.value = !1, n.value && (await la(), p || x.value?.querySelector("input")?.focus()));
830
885
  }
831
886
  }
832
887
  }
833
- async function U() {
834
- if (!i.value) {
835
- i.value = !0, o.value = "";
888
+ async function f() {
889
+ if (!o.value) {
890
+ o.value = !0, u.value = "";
836
891
  try {
837
- await P.session.bootstrap();
838
- } catch (A) {
839
- k || (o.value = E(A));
892
+ await S.session.bootstrap();
893
+ } catch (R) {
894
+ p || (u.value = V(R));
840
895
  } finally {
841
- k || (i.value = !1);
896
+ p || (o.value = !1);
842
897
  }
843
898
  }
844
899
  }
845
- function S() {
846
- u.value = "", r.value = "", n.value = !1, o.value = "";
900
+ function P() {
901
+ i.value = "", r.value = "", n.value = !1, u.value = "";
847
902
  }
848
- return ze(() => {
849
- k = !0, u.value = "", r.value = "";
850
- }), (A, H) => (t(), C("main", {
903
+ return Le(() => {
904
+ p = !0, i.value = "", r.value = "";
905
+ }), (R, K) => (t(), $("main", {
851
906
  class: "identity-login",
852
- "aria-busy": i.value
907
+ "aria-busy": o.value
853
908
  }, [
854
- b(e(de), {
909
+ y(e(pe), {
855
910
  title: a.value.title,
856
911
  collapsible: !1
857
912
  }, {
858
913
  default: s(() => [
859
- g("p", null, l(a.value.intro), 1),
860
- d.value ? y("", !0) : (t(), h(e(Q), {
914
+ h("p", null, l(a.value.intro), 1),
915
+ d.value ? b("", !0) : (t(), w(e(W), {
861
916
  key: 0,
862
917
  tone: "warning",
863
918
  title: a.value.httpsTitle
864
919
  }, {
865
920
  default: s(() => [
866
- p(l(a.value.errors.https_required), 1)
921
+ k(l(a.value.errors.https_required), 1)
867
922
  ]),
868
923
  _: 1
869
924
  }, 8, ["title"])),
870
- f.session.notice.value ? (t(), C("p", Oa, l(a.value.notices[f.session.notice.value]), 1)) : y("", !0),
871
- o.value ? (t(), h(e(Q), {
925
+ c.session.notice.value ? (t(), $("p", ll, l(a.value.notices[c.session.notice.value]), 1)) : b("", !0),
926
+ u.value ? (t(), w(e(W), {
872
927
  key: 2,
873
928
  tone: "danger",
874
929
  title: a.value.failedTitle
875
930
  }, {
876
931
  default: s(() => [
877
- g("span", qa, l(o.value), 1)
932
+ h("span", tl, l(u.value), 1)
878
933
  ]),
879
934
  _: 1
880
- }, 8, ["title"])) : y("", !0),
881
- b(e(pe), {
882
- onSubmit: ce(m, ["prevent"])
935
+ }, 8, ["title"])) : b("", !0),
936
+ y(e(he), {
937
+ onSubmit: be(C, ["prevent"])
883
938
  }, {
884
939
  default: s(() => [
885
- b(e(ne), {
940
+ y(e(re), {
886
941
  label: a.value.account
887
942
  }, {
888
943
  default: s(() => [
889
- b(e(re), {
890
- modelValue: $.value,
891
- "onUpdate:modelValue": H[0] || (H[0] = (V) => $.value = V),
944
+ y(e(me), {
945
+ modelValue: m.value,
946
+ "onUpdate:modelValue": K[0] || (K[0] = (T) => m.value = T),
892
947
  autocomplete: "username",
893
- disabled: i.value || n.value || !d.value
948
+ disabled: o.value || n.value || !d.value
894
949
  }, null, 8, ["modelValue", "disabled"])
895
950
  ]),
896
951
  _: 1
897
952
  }, 8, ["label"]),
898
- n.value ? (t(), C(j, { key: 1 }, [
899
- g("p", Ra, l(a.value.otpPrompt), 1),
900
- g("div", {
953
+ n.value ? (t(), $(te, { key: 1 }, [
954
+ h("p", nl, l(a.value.otpPrompt), 1),
955
+ h("div", {
901
956
  ref_key: "otpField",
902
- ref: w
957
+ ref: x
903
958
  }, [
904
- b(e(ne), {
959
+ y(e(re), {
905
960
  label: a.value.otp
906
961
  }, {
907
962
  default: s(() => [
908
- b(e(re), {
963
+ y(e(me), {
909
964
  modelValue: r.value,
910
- "onUpdate:modelValue": H[2] || (H[2] = (V) => r.value = V),
965
+ "onUpdate:modelValue": K[2] || (K[2] = (T) => r.value = T),
911
966
  inputmode: "numeric",
912
967
  autocomplete: "one-time-code",
913
- disabled: i.value
968
+ disabled: o.value
914
969
  }, null, 8, ["modelValue", "disabled"])
915
970
  ]),
916
971
  _: 1
917
972
  }, 8, ["label"])
918
973
  ], 512)
919
- ], 64)) : (t(), h(e(ne), {
974
+ ], 64)) : (t(), w(e(re), {
920
975
  key: 0,
921
976
  label: a.value.password
922
977
  }, {
923
978
  default: s(() => [
924
- b(e(re), {
925
- modelValue: u.value,
926
- "onUpdate:modelValue": H[1] || (H[1] = (V) => u.value = V),
979
+ y(e(me), {
980
+ modelValue: i.value,
981
+ "onUpdate:modelValue": K[1] || (K[1] = (T) => i.value = T),
927
982
  type: "password",
928
983
  autocomplete: "current-password",
929
- disabled: i.value || !d.value
984
+ disabled: o.value || !d.value
930
985
  }, null, 8, ["modelValue", "disabled"])
931
986
  ]),
932
987
  _: 1
933
988
  }, 8, ["label"])),
934
- b(e(fe), null, {
989
+ y(e(_e), null, {
935
990
  default: s(() => [
936
- b(e(z), {
991
+ y(e(A), {
937
992
  type: "submit",
938
993
  variant: "primary",
939
- disabled: i.value || !d.value || !$.value || !u.value || n.value && !r.value
994
+ disabled: o.value || !d.value || !m.value || !i.value || n.value && !r.value
940
995
  }, {
941
996
  default: s(() => [
942
- p(l(i.value ? a.value.signingIn : n.value ? a.value.verify : a.value.signIn), 1)
997
+ k(l(o.value ? a.value.signingIn : n.value ? a.value.verify : a.value.signIn), 1)
943
998
  ]),
944
999
  _: 1
945
1000
  }, 8, ["disabled"]),
946
- n.value ? (t(), h(e(z), {
1001
+ n.value ? (t(), w(e(A), {
947
1002
  key: 0,
948
1003
  variant: "secondary",
949
- disabled: i.value,
950
- onClick: S
1004
+ disabled: o.value,
1005
+ onClick: P
951
1006
  }, {
952
1007
  default: s(() => [
953
- p(l(a.value.otherAccount), 1)
1008
+ k(l(a.value.otherAccount), 1)
954
1009
  ]),
955
1010
  _: 1
956
- }, 8, ["disabled"])) : (t(), h(e(z), {
1011
+ }, 8, ["disabled"])) : (t(), w(e(A), {
957
1012
  key: 1,
958
1013
  variant: "secondary",
959
- disabled: i.value || !d.value,
960
- onClick: U
1014
+ disabled: o.value || !d.value,
1015
+ onClick: f
961
1016
  }, {
962
1017
  default: s(() => [
963
- p(l(a.value.continueDSM), 1)
1018
+ k(l(a.value.continueDSM), 1)
964
1019
  ]),
965
1020
  _: 1
966
1021
  }, 8, ["disabled"]))
@@ -973,337 +1028,337 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
973
1028
  ]),
974
1029
  _: 1
975
1030
  }, 8, ["title"])
976
- ], 8, Ia));
1031
+ ], 8, al));
977
1032
  }
978
- }), it = /* @__PURE__ */ ue(La, [["__scopeId", "data-v-f7afcf5e"]]), Ba = { class: "integration-help" }, Fa = { role: "status" }, Na = { class: "integration-help" }, Ma = { class: "integration-help" }, Ha = { class: "integration-help" }, Ka = { class: "integration-actions" }, Ja = { class: "integration-actions" }, Xa = {
1033
+ }), zt = /* @__PURE__ */ oe(sl, [["__scopeId", "data-v-f7afcf5e"]]), il = { class: "integration-help" }, ol = { role: "status" }, ul = { class: "integration-help" }, rl = { class: "integration-help" }, dl = { class: "integration-help" }, vl = { class: "integration-actions" }, cl = { class: "integration-actions" }, fl = {
979
1034
  key: 0,
980
1035
  role: "status",
981
1036
  "data-bg-picked": ""
982
- }, Ga = { class: "integration-actions" }, Qa = { key: 1 }, Wa = {
1037
+ }, pl = { class: "integration-actions" }, yl = { key: 1 }, ml = {
983
1038
  key: 2,
984
1039
  class: "integration-jobs"
985
- }, Ya = ["data-job-state", "data-job-id"], Za = { class: "nas-folder-name" }, ja = {
1040
+ }, bl = ["data-job-state", "data-job-id"], kl = { class: "nas-folder-name" }, hl = {
986
1041
  key: 0,
987
1042
  class: "integration-help"
988
- }, el = {
1043
+ }, _l = {
989
1044
  key: 4,
990
1045
  class: "integration-help"
991
- }, al = ["aria-label"], ll = { class: "integration-help" }, tl = { key: 1 }, nl = {
1046
+ }, gl = ["aria-label"], wl = { class: "integration-help" }, Cl = { key: 1 }, $l = {
992
1047
  key: 2,
993
1048
  class: "integration-jobs"
994
- }, sl = ["data-schedule-id"], ul = { class: "nas-folder-name" }, il = {
1049
+ }, xl = ["data-schedule-id"], Sl = { class: "nas-folder-name" }, zl = {
995
1050
  key: 0,
996
1051
  class: "integration-help"
997
- }, ol = {
1052
+ }, Vl = {
998
1053
  key: 1,
999
1054
  class: "integration-help"
1000
- }, rl = { class: "integration-help" }, dl = { class: "integration-actions" }, vl = { class: "integration-actions" }, cl = { class: "integration-actions" }, pl = /* @__PURE__ */ ae({
1055
+ }, Pl = { class: "integration-help" }, Ul = { class: "integration-actions" }, Dl = { class: "integration-actions" }, Il = { class: "integration-actions" }, Al = /* @__PURE__ */ se({
1001
1056
  __name: "BackgroundPanel",
1002
1057
  props: {
1003
1058
  ctx: {}
1004
1059
  },
1005
- setup(f) {
1006
- const P = f, a = N(() => Re(P.ctx.locale)), $ = (I, B) => I.replace(/\{(\w+)\}/g, (D, le) => String(B[le] ?? "")), u = c(), r = c([]), n = c(), i = c(!1), o = c(!1), w = c([]), d = c(), k = c(!1), E = c("3600"), m = c(), U = c(), S = c(), A = c(!1), H = c(!1), V = c(), R = c(""), W = c(""), X = Le(P.ctx);
1007
- let F, L = !1;
1008
- const J = (I) => !["queued", "running"].includes(I.state);
1009
- async function K(I, B) {
1060
+ setup(c) {
1061
+ const S = c, a = N(() => Qe(S.ctx.locale)), m = (O, F) => O.replace(/\{(\w+)\}/g, (U, g) => String(F[g] ?? "")), i = v(), r = v([]), n = v(), o = v(!1), u = v(!1), x = v([]), d = v(), p = v(!1), V = v("3600"), C = v(), f = v(), P = v(), R = v(!1), K = v(!1), T = v(), q = v(""), j = v(""), Y = Ye(S.ctx);
1062
+ let J, L = !1;
1063
+ const X = (O) => !["queued", "running"].includes(O.state);
1064
+ async function H(O, F) {
1010
1065
  try {
1011
- return await P.ctx.call(I, B);
1012
- } catch (D) {
1066
+ return await S.ctx.call(O, F);
1067
+ } catch (U) {
1013
1068
  if (L) return;
1014
- D?.code === "unsupported" ? (i.value = !0, r.value = [], w.value = [], d.value = void 0, m.value = void 0, U.value = void 0, u.value = void 0, S.value = void 0, V.value = void 0, R.value && URL.revokeObjectURL(R.value), R.value = "") : L || (n.value = D);
1069
+ U?.code === "unsupported" ? (o.value = !0, r.value = [], x.value = [], d.value = void 0, C.value = void 0, f.value = void 0, i.value = void 0, P.value = void 0, T.value = void 0, q.value && URL.revokeObjectURL(q.value), q.value = "") : L || (n.value = U);
1015
1070
  return;
1016
1071
  }
1017
1072
  }
1018
- async function Y() {
1019
- if (!(L || A.value)) {
1020
- A.value = !0;
1073
+ async function ee() {
1074
+ if (!(L || R.value)) {
1075
+ R.value = !0;
1021
1076
  try {
1022
- const I = await K("bg.status");
1023
- if (!I || L) return;
1024
- if (!I.limits || typeof I.admin != "boolean") {
1077
+ const O = await H("bg.status");
1078
+ if (!O || L) return;
1079
+ if (!O.limits || typeof O.admin != "boolean") {
1025
1080
  n.value = { code: "unavailable" };
1026
1081
  return;
1027
1082
  }
1028
- i.value = !1, u.value = I;
1029
- const B = await K("bg.jobs.list");
1030
- B && !L && (r.value = B.jobs ?? []);
1031
- const D = await K("bg.schedules.list");
1032
- D && !L && (w.value = D.schedules ?? []), !L && r.value.every(J) && w.value.every((le) => !le.enabled) && F && (clearInterval(F), F = void 0);
1083
+ o.value = !1, i.value = O;
1084
+ const F = await H("bg.jobs.list");
1085
+ F && !L && (r.value = F.jobs ?? []);
1086
+ const U = await H("bg.schedules.list");
1087
+ U && !L && (x.value = U.schedules ?? []), !L && r.value.every(X) && x.value.every((g) => !g.enabled) && J && (clearInterval(J), J = void 0);
1033
1088
  } finally {
1034
- A.value = !1;
1089
+ R.value = !1;
1035
1090
  }
1036
1091
  }
1037
1092
  }
1038
- function q() {
1039
- F || (F = setInterval(() => {
1040
- Y();
1093
+ function ae() {
1094
+ J || (J = setInterval(() => {
1095
+ ee();
1041
1096
  }, 3e3));
1042
1097
  }
1043
- async function O(I) {
1044
- if (!o.value) {
1045
- o.value = !0, n.value = void 0;
1098
+ async function Q(O) {
1099
+ if (!u.value) {
1100
+ u.value = !0, n.value = void 0;
1046
1101
  try {
1047
- await I(), await Y(), (w.value.some((B) => B.enabled) || r.value.some((B) => !J(B))) && q();
1102
+ await O(), await ee(), (x.value.some((F) => F.enabled) || r.value.some((F) => !X(F))) && ae();
1048
1103
  } finally {
1049
- L || (o.value = !1);
1104
+ L || (u.value = !1);
1050
1105
  }
1051
1106
  }
1052
1107
  }
1053
- const T = () => O(async () => {
1054
- if (!S.value) return;
1055
- await K("bg.jobs.purge", { owner: S.value }) && (S.value = void 0);
1056
- }), M = N(() => [{ value: "3600", label: a.value.hourly }, { value: "86400", label: a.value.daily }, { value: "604800", label: a.value.weekly }]), v = (I) => {
1057
- d.value = I, k.value = !1, E.value = "3600";
1058
- }, _ = () => O(async () => {
1059
- if (!d.value || !k.value) return;
1060
- await K("bg.schedules.create", { key: _e(), jobId: d.value.id, intervalSeconds: Number(E.value), consent: !0 }) && (d.value = void 0);
1061
- }), x = (I) => O(() => K("bg.schedules.disable", { id: I })), G = () => O(async () => {
1062
- if (!m.value) return;
1063
- await K("bg.schedules.delete", { id: m.value.id }) && (m.value = void 0);
1064
- }), Z = () => O(async () => {
1065
- if (!U.value) return;
1066
- await K("bg.schedules.enable", { id: U.value.id, consent: !0 }) && (U.value = void 0);
1067
- }), ee = (I) => {
1068
- const B = new Date(I);
1069
- return Number.isFinite(B.getTime()) ? B.toLocaleString() : a.value.unknownTime;
1070
- }, me = (I) => I.copyRetained && I.state === "succeeded" && !I.scheduleId && I.submitter?.user === u.value?.owner?.user && I.submitter?.uid === u.value?.owner?.uid, Ae = (I) => O(() => K("bg.jobs.cancel", { id: I })), Ee = (I) => {
1071
- const B = I.lastIndexOf("/");
1072
- V.value = { folder: I.slice(0, B), relative: I.slice(B + 1) };
1073
- }, Te = () => O(async () => {
1074
- if (!V.value) return;
1075
- await K("bg.jobs.submit", { key: _e(), ...V.value }) && (V.value = void 0);
1108
+ const E = () => Q(async () => {
1109
+ if (!P.value) return;
1110
+ await H("bg.jobs.purge", { owner: P.value }) && (P.value = void 0);
1111
+ }), B = N(() => [{ value: "3600", label: a.value.hourly }, { value: "86400", label: a.value.daily }, { value: "604800", label: a.value.weekly }]), _ = (O) => {
1112
+ d.value = O, p.value = !1, V.value = "3600";
1113
+ }, z = () => Q(async () => {
1114
+ if (!d.value || !p.value) return;
1115
+ await H("bg.schedules.create", { key: De(), jobId: d.value.id, intervalSeconds: Number(V.value), consent: !0 }) && (d.value = void 0);
1116
+ }), G = (O) => Q(() => H("bg.schedules.disable", { id: O })), Z = () => Q(async () => {
1117
+ if (!C.value) return;
1118
+ await H("bg.schedules.delete", { id: C.value.id }) && (C.value = void 0);
1119
+ }), le = () => Q(async () => {
1120
+ if (!f.value) return;
1121
+ await H("bg.schedules.enable", { id: f.value.id, consent: !0 }) && (f.value = void 0);
1122
+ }), ge = (O) => {
1123
+ const F = new Date(O);
1124
+ return Number.isFinite(F.getTime()) ? F.toLocaleString() : a.value.unknownTime;
1125
+ }, Ce = (O) => O.copyRetained && O.state === "succeeded" && !O.scheduleId && O.submitter?.user === i.value?.owner?.user && O.submitter?.uid === i.value?.owner?.uid, $e = (O) => Q(() => H("bg.jobs.cancel", { id: O })), ye = (O) => {
1126
+ const F = O.lastIndexOf("/");
1127
+ T.value = { folder: O.slice(0, F), relative: O.slice(F + 1) };
1128
+ }, ue = () => Q(async () => {
1129
+ if (!T.value) return;
1130
+ await H("bg.jobs.submit", { key: De(), ...T.value }) && (T.value = void 0);
1076
1131
  });
1077
- async function Ie(I) {
1078
- const B = await K("bg.jobs.result", { id: I.id });
1079
- !B || L || (R.value && URL.revokeObjectURL(R.value), R.value = URL.createObjectURL(new Blob([JSON.stringify(B.result, null, 2)], { type: "application/json" })), W.value = `${I.name || I.id}.sha256.json`);
1132
+ async function ke(O) {
1133
+ const F = await H("bg.jobs.result", { id: O.id });
1134
+ !F || L || (q.value && URL.revokeObjectURL(q.value), q.value = URL.createObjectURL(new Blob([JSON.stringify(F.result, null, 2)], { type: "application/json" })), j.value = `${O.name || O.id}.sha256.json`);
1080
1135
  }
1081
- return ie(() => {
1082
- Y().then(() => {
1083
- (w.value.some((I) => I.enabled) || r.value.some((I) => !J(I))) && q();
1136
+ return fe(() => {
1137
+ ee().then(() => {
1138
+ (x.value.some((O) => O.enabled) || r.value.some((O) => !X(O))) && ae();
1084
1139
  });
1085
- }), se(() => {
1086
- L = !0, X.dispose(), F && clearInterval(F), R.value && URL.revokeObjectURL(R.value);
1087
- }), (I, B) => (t(), h(e(de), {
1088
- "aria-busy": o.value || A.value,
1140
+ }), de(() => {
1141
+ L = !0, Y.dispose(), J && clearInterval(J), q.value && URL.revokeObjectURL(q.value);
1142
+ }), (O, F) => (t(), w(e(pe), {
1143
+ "aria-busy": u.value || R.value,
1089
1144
  title: a.value.title,
1090
1145
  collapsible: !1,
1091
1146
  "data-background-panel": ""
1092
1147
  }, {
1093
1148
  default: s(() => [
1094
- i.value ? (t(), h(e(Q), {
1149
+ o.value ? (t(), w(e(W), {
1095
1150
  key: 0,
1096
1151
  tone: "warning"
1097
1152
  }, {
1098
1153
  default: s(() => [
1099
- p(l(a.value.unsupported), 1)
1154
+ k(l(a.value.unsupported), 1)
1100
1155
  ]),
1101
1156
  _: 1
1102
- })) : (t(), C(j, { key: 1 }, [
1103
- g("p", Ba, l(a.value.help), 1),
1104
- n.value ? (t(), h(e(Q), {
1157
+ })) : (t(), $(te, { key: 1 }, [
1158
+ h("p", il, l(a.value.help), 1),
1159
+ n.value ? (t(), w(e(W), {
1105
1160
  key: 0,
1106
1161
  tone: "danger",
1107
1162
  role: "alert"
1108
1163
  }, {
1109
1164
  default: s(() => [
1110
- p(l(e(Be)(n.value, a.value)), 1)
1165
+ k(l(e(We)(n.value, a.value)), 1)
1111
1166
  ]),
1112
1167
  _: 1
1113
- })) : y("", !0),
1114
- u.value ? (t(), C(j, { key: 1 }, [
1115
- g("p", Fa, l(u.value.worker?.alive ? $(a.value.workerRunning, { user: u.value.worker.username }) : a.value.workerStopped), 1),
1116
- g("p", Na, l($(a.value.limits, { size: u.value.limits.maxInputBytes / 1024, queue: u.value.limits.maxQueued, seconds: u.value.limits.jobTimeoutSeconds })), 1),
1117
- g("p", Ma, l(u.value.admin ? a.value.adminScope : a.value.ownerScope), 1),
1118
- g("p", Ha, l($(a.value.ownerLimits, { jobs: u.value.limits.maxOwnerPending, size: u.value.limits.maxOwnerBytes / 1024 })), 1),
1119
- g("div", Ka, [
1120
- b(e(z), {
1168
+ })) : b("", !0),
1169
+ i.value ? (t(), $(te, { key: 1 }, [
1170
+ h("p", ol, l(i.value.worker?.alive ? m(a.value.workerRunning, { user: i.value.worker.username }) : a.value.workerStopped), 1),
1171
+ h("p", ul, l(m(a.value.limits, { size: i.value.limits.maxInputBytes / 1024, queue: i.value.limits.maxQueued, seconds: i.value.limits.jobTimeoutSeconds })), 1),
1172
+ h("p", rl, l(i.value.admin ? a.value.adminScope : a.value.ownerScope), 1),
1173
+ h("p", dl, l(m(a.value.ownerLimits, { jobs: i.value.limits.maxOwnerPending, size: i.value.limits.maxOwnerBytes / 1024 })), 1),
1174
+ h("div", vl, [
1175
+ y(e(A), {
1121
1176
  variant: "secondary",
1122
- disabled: o.value,
1123
- onClick: Y
1177
+ disabled: u.value,
1178
+ onClick: ee
1124
1179
  }, {
1125
1180
  default: s(() => [
1126
- p(l(a.value.refresh), 1)
1181
+ k(l(a.value.refresh), 1)
1127
1182
  ]),
1128
1183
  _: 1
1129
1184
  }, 8, ["disabled"])
1130
1185
  ]),
1131
- g("template", null, [
1132
- g("div", Ja, [
1133
- b(e(z), {
1186
+ h("template", null, [
1187
+ h("div", cl, [
1188
+ y(e(A), {
1134
1189
  variant: "secondary",
1135
- disabled: o.value,
1136
- onClick: B[0] || (B[0] = (D) => H.value = !0)
1190
+ disabled: u.value,
1191
+ onClick: F[0] || (F[0] = (U) => K.value = !0)
1137
1192
  }, {
1138
1193
  default: s(() => [
1139
- p(l(a.value.chooseFile), 1)
1194
+ k(l(a.value.chooseFile), 1)
1140
1195
  ]),
1141
1196
  _: 1
1142
1197
  }, 8, ["disabled"]),
1143
- b(e(z), {
1198
+ y(e(A), {
1144
1199
  variant: "primary",
1145
- disabled: o.value || !V.value,
1146
- onClick: Te
1200
+ disabled: u.value || !T.value,
1201
+ onClick: ue
1147
1202
  }, {
1148
1203
  default: s(() => [
1149
- p(l(a.value.submit), 1)
1204
+ k(l(a.value.submit), 1)
1150
1205
  ]),
1151
1206
  _: 1
1152
1207
  }, 8, ["disabled"])
1153
1208
  ]),
1154
- V.value ? (t(), C("p", Xa, l($(a.value.chosen, { path: `${V.value.folder}/${V.value.relative}` })), 1)) : y("", !0),
1155
- b(ye, {
1156
- open: H.value,
1157
- "onUpdate:open": B[1] || (B[1] = (D) => H.value = D),
1158
- locale: f.ctx.locale,
1159
- provider: e(X),
1209
+ T.value ? (t(), $("p", fl, l(m(a.value.chosen, { path: `${T.value.folder}/${T.value.relative}` })), 1)) : b("", !0),
1210
+ y(we, {
1211
+ open: K.value,
1212
+ "onUpdate:open": F[1] || (F[1] = (U) => K.value = U),
1213
+ locale: c.ctx.locale,
1214
+ provider: e(Y),
1160
1215
  mode: "file",
1161
1216
  title: a.value.pickerTitle,
1162
1217
  description: a.value.pickerConsent,
1163
- onSelected: Ee
1218
+ onSelected: ye
1164
1219
  }, null, 8, ["open", "locale", "provider", "title", "description"])
1165
1220
  ]),
1166
- S.value && u.value.admin ? (t(), h(e(Q), {
1221
+ P.value && i.value.admin ? (t(), w(e(W), {
1167
1222
  key: 0,
1168
1223
  tone: "warning"
1169
1224
  }, {
1170
1225
  default: s(() => [
1171
- g("p", null, l($(a.value.purgeConfirm, { user: S.value.user, uid: S.value.uid })), 1),
1172
- g("div", Ga, [
1173
- b(e(z), {
1226
+ h("p", null, l(m(a.value.purgeConfirm, { user: P.value.user, uid: P.value.uid })), 1),
1227
+ h("div", pl, [
1228
+ y(e(A), {
1174
1229
  variant: "secondary",
1175
- disabled: o.value,
1176
- onClick: T
1230
+ disabled: u.value,
1231
+ onClick: E
1177
1232
  }, {
1178
1233
  default: s(() => [
1179
- p(l(a.value.confirmPurge), 1)
1234
+ k(l(a.value.confirmPurge), 1)
1180
1235
  ]),
1181
1236
  _: 1
1182
1237
  }, 8, ["disabled"]),
1183
- b(e(z), {
1238
+ y(e(A), {
1184
1239
  variant: "secondary",
1185
- disabled: o.value,
1186
- onClick: B[2] || (B[2] = (D) => S.value = void 0)
1240
+ disabled: u.value,
1241
+ onClick: F[2] || (F[2] = (U) => P.value = void 0)
1187
1242
  }, {
1188
1243
  default: s(() => [
1189
- p(l(a.value.keepJobs), 1)
1244
+ k(l(a.value.keepJobs), 1)
1190
1245
  ]),
1191
1246
  _: 1
1192
1247
  }, 8, ["disabled"])
1193
1248
  ])
1194
1249
  ]),
1195
1250
  _: 1
1196
- })) : y("", !0),
1197
- r.value.length ? (t(), C("ul", Wa, [
1198
- (t(!0), C(j, null, te(r.value, (D) => (t(), C("li", {
1199
- key: D.id,
1200
- "data-job-state": D.state,
1201
- "data-job-id": D.id
1251
+ })) : b("", !0),
1252
+ r.value.length ? (t(), $("ul", ml, [
1253
+ (t(!0), $(te, null, ce(r.value, (U) => (t(), $("li", {
1254
+ key: U.id,
1255
+ "data-job-state": U.state,
1256
+ "data-job-id": U.id
1202
1257
  }, [
1203
- g("span", Za, l(D.name) + " — " + l(a.value[`state_${D.state}`]), 1),
1204
- u.value.admin && D.submitter ? (t(), C("span", ja, l($(a.value.owner, { user: D.submitter.user, uid: D.submitter.uid })), 1)) : y("", !0),
1205
- u.value.admin && D.submitter ? (t(), h(e(z), {
1258
+ h("span", kl, l(U.name) + " — " + l(a.value[`state_${U.state}`]), 1),
1259
+ i.value.admin && U.submitter ? (t(), $("span", hl, l(m(a.value.owner, { user: U.submitter.user, uid: U.submitter.uid })), 1)) : b("", !0),
1260
+ i.value.admin && U.submitter ? (t(), w(e(A), {
1206
1261
  key: 1,
1207
1262
  variant: "secondary",
1208
- disabled: o.value,
1209
- onClick: (le) => S.value = D.submitter
1263
+ disabled: u.value,
1264
+ onClick: (g) => P.value = U.submitter
1210
1265
  }, {
1211
1266
  default: s(() => [
1212
- p(l(a.value.purgeOwner), 1)
1267
+ k(l(a.value.purgeOwner), 1)
1213
1268
  ]),
1214
1269
  _: 1
1215
- }, 8, ["disabled", "onClick"])) : y("", !0),
1216
- J(D) ? y("", !0) : (t(), h(e(z), {
1270
+ }, 8, ["disabled", "onClick"])) : b("", !0),
1271
+ X(U) ? b("", !0) : (t(), w(e(A), {
1217
1272
  key: 2,
1218
1273
  variant: "secondary",
1219
- disabled: o.value,
1220
- onClick: (le) => Ae(D.id)
1274
+ disabled: u.value,
1275
+ onClick: (g) => $e(U.id)
1221
1276
  }, {
1222
1277
  default: s(() => [
1223
- p(l(a.value.cancel), 1)
1278
+ k(l(a.value.cancel), 1)
1224
1279
  ]),
1225
1280
  _: 1
1226
1281
  }, 8, ["disabled", "onClick"])),
1227
- me(D) ? (t(), h(e(z), {
1282
+ Ce(U) ? (t(), w(e(A), {
1228
1283
  key: 3,
1229
1284
  variant: "secondary",
1230
- disabled: o.value,
1231
- onClick: (le) => v(D)
1285
+ disabled: u.value,
1286
+ onClick: (g) => _(U)
1232
1287
  }, {
1233
1288
  default: s(() => [
1234
- p(l(a.value.scheduleCopy), 1)
1289
+ k(l(a.value.scheduleCopy), 1)
1235
1290
  ]),
1236
1291
  _: 1
1237
- }, 8, ["disabled", "onClick"])) : y("", !0),
1238
- D.scheduleId ? (t(), C("span", el, l(a.value.scheduledJob), 1)) : y("", !0),
1239
- D.state === "succeeded" ? (t(), h(e(z), {
1292
+ }, 8, ["disabled", "onClick"])) : b("", !0),
1293
+ U.scheduleId ? (t(), $("span", _l, l(a.value.scheduledJob), 1)) : b("", !0),
1294
+ U.state === "succeeded" ? (t(), w(e(A), {
1240
1295
  key: 5,
1241
1296
  variant: "secondary",
1242
- disabled: o.value,
1243
- onClick: (le) => Ie(D)
1297
+ disabled: u.value,
1298
+ onClick: (g) => ke(U)
1244
1299
  }, {
1245
1300
  default: s(() => [
1246
- p(l(a.value.result), 1)
1301
+ k(l(a.value.result), 1)
1247
1302
  ]),
1248
1303
  _: 1
1249
- }, 8, ["disabled", "onClick"])) : y("", !0)
1250
- ], 8, Ya))), 128))
1251
- ])) : (t(), C("p", Qa, l(a.value.noJobs), 1)),
1252
- g("section", {
1304
+ }, 8, ["disabled", "onClick"])) : b("", !0)
1305
+ ], 8, bl))), 128))
1306
+ ])) : (t(), $("p", yl, l(a.value.noJobs), 1)),
1307
+ h("section", {
1253
1308
  "data-bg-schedules": "",
1254
1309
  class: "bg-schedules",
1255
1310
  "aria-label": a.value.schedulesTitle
1256
1311
  }, [
1257
- g("h3", null, l(a.value.schedulesTitle), 1),
1258
- g("p", ll, l(a.value.scheduleHelp), 1),
1259
- d.value ? (t(), h(e(pe), {
1312
+ h("h3", null, l(a.value.schedulesTitle), 1),
1313
+ h("p", wl, l(a.value.scheduleHelp), 1),
1314
+ d.value ? (t(), w(e(he), {
1260
1315
  key: 0,
1261
1316
  class: "bg-schedule-form",
1262
- onSubmit: ce(_, ["prevent"])
1317
+ onSubmit: be(z, ["prevent"])
1263
1318
  }, {
1264
1319
  default: s(() => [
1265
- g("p", null, l($(a.value.scheduleSource, { name: d.value.name })), 1),
1266
- b(e(ne), {
1320
+ h("p", null, l(m(a.value.scheduleSource, { name: d.value.name })), 1),
1321
+ y(e(re), {
1267
1322
  label: a.value.interval
1268
1323
  }, {
1269
1324
  default: s(() => [
1270
- b(e(Pe), {
1271
- modelValue: E.value,
1272
- "onUpdate:modelValue": B[3] || (B[3] = (D) => E.value = D),
1325
+ y(e(Ne), {
1326
+ modelValue: V.value,
1327
+ "onUpdate:modelValue": F[3] || (F[3] = (U) => V.value = U),
1273
1328
  "data-schedule-interval": "",
1274
- options: M.value,
1275
- disabled: o.value
1329
+ options: B.value,
1330
+ disabled: u.value
1276
1331
  }, null, 8, ["modelValue", "options", "disabled"])
1277
1332
  ]),
1278
1333
  _: 1
1279
1334
  }, 8, ["label"]),
1280
- b(e(ea), {
1281
- modelValue: k.value,
1282
- "onUpdate:modelValue": B[4] || (B[4] = (D) => k.value = D),
1335
+ y(e(ca), {
1336
+ modelValue: p.value,
1337
+ "onUpdate:modelValue": F[4] || (F[4] = (U) => p.value = U),
1283
1338
  "data-schedule-consent": "",
1284
- disabled: o.value,
1339
+ disabled: u.value,
1285
1340
  label: a.value.scheduleConsent
1286
1341
  }, null, 8, ["modelValue", "disabled", "label"]),
1287
- b(e(fe), null, {
1342
+ y(e(_e), null, {
1288
1343
  default: s(() => [
1289
- b(e(z), {
1344
+ y(e(A), {
1290
1345
  type: "submit",
1291
1346
  variant: "primary",
1292
- disabled: o.value || !k.value
1347
+ disabled: u.value || !p.value
1293
1348
  }, {
1294
1349
  default: s(() => [
1295
- p(l(a.value.createSchedule), 1)
1350
+ k(l(a.value.createSchedule), 1)
1296
1351
  ]),
1297
1352
  _: 1
1298
1353
  }, 8, ["disabled"]),
1299
- b(e(z), {
1354
+ y(e(A), {
1300
1355
  type: "button",
1301
1356
  variant: "secondary",
1302
- disabled: o.value,
1303
- onClick: B[5] || (B[5] = (D) => d.value = void 0)
1357
+ disabled: u.value,
1358
+ onClick: F[5] || (F[5] = (U) => d.value = void 0)
1304
1359
  }, {
1305
1360
  default: s(() => [
1306
- p(l(a.value.cancel), 1)
1361
+ k(l(a.value.cancel), 1)
1307
1362
  ]),
1308
1363
  _: 1
1309
1364
  }, 8, ["disabled"])
@@ -1312,148 +1367,148 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
1312
1367
  })
1313
1368
  ]),
1314
1369
  _: 1
1315
- })) : y("", !0),
1316
- w.value.length ? (t(), C("ul", nl, [
1317
- (t(!0), C(j, null, te(w.value, (D) => (t(), C("li", {
1318
- key: D.id,
1319
- "data-schedule-id": D.id
1370
+ })) : b("", !0),
1371
+ x.value.length ? (t(), $("ul", $l, [
1372
+ (t(!0), $(te, null, ce(x.value, (U) => (t(), $("li", {
1373
+ key: U.id,
1374
+ "data-schedule-id": U.id
1320
1375
  }, [
1321
- g("span", ul, l(D.name) + " — " + l(D.enabled ? a.value.scheduleOn : a.value.scheduleOff), 1),
1322
- u.value.admin ? (t(), C("span", il, l($(a.value.owner, { user: D.owner.user, uid: D.owner.uid })), 1)) : y("", !0),
1323
- D.enabled ? (t(), C("span", ol, l($(a.value.nextRun, { time: ee(D.nextAt) })), 1)) : y("", !0),
1324
- g("span", rl, l($(a.value.missedRuns, { count: D.missed })), 1),
1325
- D.reason === "worker-changed" ? (t(), h(e(Q), {
1376
+ h("span", Sl, l(U.name) + " — " + l(U.enabled ? a.value.scheduleOn : a.value.scheduleOff), 1),
1377
+ i.value.admin ? (t(), $("span", zl, l(m(a.value.owner, { user: U.owner.user, uid: U.owner.uid })), 1)) : b("", !0),
1378
+ U.enabled ? (t(), $("span", Vl, l(m(a.value.nextRun, { time: ge(U.nextAt) })), 1)) : b("", !0),
1379
+ h("span", Pl, l(m(a.value.missedRuns, { count: U.missed })), 1),
1380
+ U.reason === "worker-changed" ? (t(), w(e(W), {
1326
1381
  key: 2,
1327
1382
  tone: "warning"
1328
1383
  }, {
1329
1384
  default: s(() => [
1330
- p(l(a.value.revisionChanged), 1)
1385
+ k(l(a.value.revisionChanged), 1)
1331
1386
  ]),
1332
1387
  _: 1
1333
- })) : D.reason === "input-unavailable" ? (t(), h(e(Q), {
1388
+ })) : U.reason === "input-unavailable" ? (t(), w(e(W), {
1334
1389
  key: 3,
1335
1390
  tone: "warning"
1336
1391
  }, {
1337
1392
  default: s(() => [
1338
- p(l(a.value.errors["input-unavailable"]), 1)
1393
+ k(l(a.value.errors["input-unavailable"]), 1)
1339
1394
  ]),
1340
1395
  _: 1
1341
- })) : y("", !0),
1342
- g("div", dl, [
1343
- D.enabled ? (t(), h(e(z), {
1396
+ })) : b("", !0),
1397
+ h("div", Ul, [
1398
+ U.enabled ? (t(), w(e(A), {
1344
1399
  key: 0,
1345
1400
  variant: "secondary",
1346
- disabled: o.value,
1347
- onClick: (le) => x(D.id)
1401
+ disabled: u.value,
1402
+ onClick: (g) => G(U.id)
1348
1403
  }, {
1349
1404
  default: s(() => [
1350
- p(l(a.value.disableSchedule), 1)
1405
+ k(l(a.value.disableSchedule), 1)
1351
1406
  ]),
1352
1407
  _: 1
1353
- }, 8, ["disabled", "onClick"])) : u.value.admin ? (t(), h(e(z), {
1408
+ }, 8, ["disabled", "onClick"])) : i.value.admin ? (t(), w(e(A), {
1354
1409
  key: 1,
1355
1410
  variant: "secondary",
1356
- disabled: o.value,
1357
- onClick: (le) => U.value = D
1411
+ disabled: u.value,
1412
+ onClick: (g) => f.value = U
1358
1413
  }, {
1359
1414
  default: s(() => [
1360
- p(l(a.value.enableSchedule), 1)
1415
+ k(l(a.value.enableSchedule), 1)
1361
1416
  ]),
1362
1417
  _: 1
1363
- }, 8, ["disabled", "onClick"])) : y("", !0),
1364
- b(e(z), {
1418
+ }, 8, ["disabled", "onClick"])) : b("", !0),
1419
+ y(e(A), {
1365
1420
  variant: "secondary",
1366
- disabled: o.value,
1367
- onClick: (le) => m.value = D
1421
+ disabled: u.value,
1422
+ onClick: (g) => C.value = U
1368
1423
  }, {
1369
1424
  default: s(() => [
1370
- p(l(a.value.deleteSchedule), 1)
1425
+ k(l(a.value.deleteSchedule), 1)
1371
1426
  ]),
1372
1427
  _: 1
1373
1428
  }, 8, ["disabled", "onClick"])
1374
1429
  ])
1375
- ], 8, sl))), 128))
1376
- ])) : (t(), C("p", tl, l(a.value.noSchedules), 1)),
1377
- m.value ? (t(), h(e(Q), {
1430
+ ], 8, xl))), 128))
1431
+ ])) : (t(), $("p", Cl, l(a.value.noSchedules), 1)),
1432
+ C.value ? (t(), w(e(W), {
1378
1433
  key: 3,
1379
1434
  tone: "warning"
1380
1435
  }, {
1381
1436
  default: s(() => [
1382
- g("p", null, l($(a.value.deleteScheduleConsent, { name: m.value.name })), 1),
1383
- g("div", vl, [
1384
- b(e(z), {
1437
+ h("p", null, l(m(a.value.deleteScheduleConsent, { name: C.value.name })), 1),
1438
+ h("div", Dl, [
1439
+ y(e(A), {
1385
1440
  variant: "danger",
1386
- disabled: o.value,
1387
- onClick: G
1441
+ disabled: u.value,
1442
+ onClick: Z
1388
1443
  }, {
1389
1444
  default: s(() => [
1390
- p(l(a.value.confirmDeleteSchedule), 1)
1445
+ k(l(a.value.confirmDeleteSchedule), 1)
1391
1446
  ]),
1392
1447
  _: 1
1393
1448
  }, 8, ["disabled"]),
1394
- b(e(z), {
1449
+ y(e(A), {
1395
1450
  variant: "secondary",
1396
- disabled: o.value,
1397
- onClick: B[6] || (B[6] = (D) => m.value = void 0)
1451
+ disabled: u.value,
1452
+ onClick: F[6] || (F[6] = (U) => C.value = void 0)
1398
1453
  }, {
1399
1454
  default: s(() => [
1400
- p(l(a.value.cancel), 1)
1455
+ k(l(a.value.cancel), 1)
1401
1456
  ]),
1402
1457
  _: 1
1403
1458
  }, 8, ["disabled"])
1404
1459
  ])
1405
1460
  ]),
1406
1461
  _: 1
1407
- })) : y("", !0),
1408
- U.value ? (t(), h(e(Q), {
1462
+ })) : b("", !0),
1463
+ f.value ? (t(), w(e(W), {
1409
1464
  key: 4,
1410
1465
  tone: "warning"
1411
1466
  }, {
1412
1467
  default: s(() => [
1413
- g("p", null, l($(a.value.enableScheduleConsent, { name: U.value.name })), 1),
1414
- g("div", cl, [
1415
- b(e(z), {
1468
+ h("p", null, l(m(a.value.enableScheduleConsent, { name: f.value.name })), 1),
1469
+ h("div", Il, [
1470
+ y(e(A), {
1416
1471
  variant: "primary",
1417
- disabled: o.value,
1418
- onClick: Z
1472
+ disabled: u.value,
1473
+ onClick: le
1419
1474
  }, {
1420
1475
  default: s(() => [
1421
- p(l(a.value.confirmEnableSchedule), 1)
1476
+ k(l(a.value.confirmEnableSchedule), 1)
1422
1477
  ]),
1423
1478
  _: 1
1424
1479
  }, 8, ["disabled"]),
1425
- b(e(z), {
1480
+ y(e(A), {
1426
1481
  variant: "secondary",
1427
- disabled: o.value,
1428
- onClick: B[7] || (B[7] = (D) => U.value = void 0)
1482
+ disabled: u.value,
1483
+ onClick: F[7] || (F[7] = (U) => f.value = void 0)
1429
1484
  }, {
1430
1485
  default: s(() => [
1431
- p(l(a.value.cancel), 1)
1486
+ k(l(a.value.cancel), 1)
1432
1487
  ]),
1433
1488
  _: 1
1434
1489
  }, 8, ["disabled"])
1435
1490
  ])
1436
1491
  ]),
1437
1492
  _: 1
1438
- })) : y("", !0)
1439
- ], 8, al),
1440
- R.value ? (t(), h(e(Ue), {
1493
+ })) : b("", !0)
1494
+ ], 8, gl),
1495
+ q.value ? (t(), w(e(Fe), {
1441
1496
  key: 3,
1442
- href: R.value,
1443
- download: W.value
1497
+ href: q.value,
1498
+ download: j.value
1444
1499
  }, {
1445
1500
  default: s(() => [
1446
- p(l(a.value.download), 1)
1501
+ k(l(a.value.download), 1)
1447
1502
  ]),
1448
1503
  _: 1
1449
- }, 8, ["href", "download"])) : y("", !0)
1450
- ], 64)) : y("", !0)
1504
+ }, 8, ["href", "download"])) : b("", !0)
1505
+ ], 64)) : b("", !0)
1451
1506
  ], 64))
1452
1507
  ]),
1453
1508
  _: 1
1454
1509
  }, 8, ["aria-busy", "title"]));
1455
1510
  }
1456
- }), ot = /* @__PURE__ */ ue(pl, [["__scopeId", "data-v-7954713f"]]), fl = { role: "status" }, yl = { key: 1 }, ml = { key: 2 }, rt = /* @__PURE__ */ ae({
1511
+ }), Vt = /* @__PURE__ */ oe(Al, [["__scopeId", "data-v-7954713f"]]), El = { role: "status" }, Rl = { key: 1 }, Tl = { key: 2 }, Pt = /* @__PURE__ */ se({
1457
1512
  __name: "ExecutorSettings",
1458
1513
  props: {
1459
1514
  admin: { type: Boolean },
@@ -1461,137 +1516,137 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
1461
1516
  ctx: {}
1462
1517
  },
1463
1518
  emits: ["confirmed"],
1464
- setup(f, { emit: P }) {
1465
- const a = f, $ = P, u = ia(), r = N(() => xe(a.locale)), n = c(), i = c(""), o = c(!1), w = c(!1), d = c(), k = c(""), E = c([]), m = N(() => d.value?.scope_mode === "install-selected"), U = N(() => [{ label: r.value.homeScope, value: "home" }, ...E.value]), S = N(() => !m.value || !!k.value && U.value.some((F) => F.value === k.value)), A = N(() => m.value && !d.value?.selection), H = N(() => k.value !== d.value?.selection?.scope);
1466
- let V = !1;
1467
- async function R(F) {
1468
- const L = F ?? await u.status();
1469
- if (V || (n.value = L, !a.ctx)) return;
1470
- const J = await a.ctx.call("delegate.status");
1471
- if (V || (d.value = J, J.scope_mode !== "install-selected")) return;
1472
- const K = [];
1473
- let Y = 0;
1474
- for (let q = 0; q < 128; q++) {
1475
- const O = await a.ctx.call("bg.browse", { offset: Y });
1476
- if (V) return;
1477
- if (!Array.isArray(O.shares) || !Number.isSafeInteger(O.total) || O.total < 0 || !O.shares.length && Y < O.total) throw { code: "EXECUTOR_PROTOCOL" };
1478
- for (const T of O.shares)
1479
- T.isdir && T.path === "/" + T.name && !["home", "homes"].includes(T.name.toLowerCase()) && K.push({ label: T.name, value: "shared:" + T.name });
1480
- if (Y += O.shares.length, Y >= O.total) break;
1481
- if (q === 127) throw { code: "EXECUTOR_PROTOCOL" };
1519
+ setup(c, { emit: S }) {
1520
+ const a = c, m = S, i = Ca(), r = N(() => qe(a.locale)), n = v(), o = v(""), u = v(!1), x = v(!1), d = v(!1), p = v(), V = v(""), C = v([]), f = N(() => p.value?.scope_mode === "install-selected"), P = N(() => [{ label: r.value.homeScope, value: "home" }, ...C.value]), R = N(() => !f.value || !!V.value && P.value.some((L) => L.value === V.value)), K = N(() => f.value && !p.value?.selection), T = N(() => V.value !== p.value?.selection?.scope);
1521
+ let q = !1;
1522
+ async function j(L) {
1523
+ const X = L ?? await i.status();
1524
+ if (q || (n.value = X, !a.ctx)) return;
1525
+ const H = await a.ctx.call("delegate.status");
1526
+ if (q || (p.value = H, H.scope_mode !== "install-selected")) return;
1527
+ const ee = [];
1528
+ let ae = 0;
1529
+ for (let Q = 0; Q < 128; Q++) {
1530
+ const E = await a.ctx.call("bg.browse", { offset: ae });
1531
+ if (q) return;
1532
+ if (!Array.isArray(E.shares) || !Number.isSafeInteger(E.total) || E.total < 0 || !E.shares.length && ae < E.total) throw { code: "EXECUTOR_PROTOCOL" };
1533
+ for (const B of E.shares)
1534
+ B.isdir && B.path === "/" + B.name && !["home", "homes"].includes(B.name.toLowerCase()) && ee.push({ label: B.name, value: "shared:" + B.name });
1535
+ if (ae += E.shares.length, ae >= E.total) break;
1536
+ if (Q === 127) throw { code: "EXECUTOR_PROTOCOL" };
1482
1537
  }
1483
- E.value = K, k.value = J.selection?.scope ?? J.preselection ?? "";
1538
+ C.value = ee, V.value = H.selection?.scope ?? H.preselection ?? "";
1484
1539
  }
1485
- async function W() {
1486
- if (!(!a.admin || o.value)) {
1487
- o.value = !0, w.value = !1;
1540
+ async function Y() {
1541
+ if (!(!a.admin || u.value)) {
1542
+ u.value = !0, d.value = !1;
1488
1543
  try {
1489
- await R();
1544
+ await j();
1490
1545
  } catch {
1491
- V || (w.value = !0);
1546
+ q || (d.value = !0);
1492
1547
  } finally {
1493
- V || (o.value = !1);
1548
+ q || (u.value = !1);
1494
1549
  }
1495
1550
  }
1496
1551
  }
1497
- async function X() {
1498
- if (!a.admin || o.value || !i.value || !S.value || w.value) return;
1499
- o.value = !0, w.value = !1;
1500
- const F = i.value;
1501
- i.value = "";
1552
+ async function J() {
1553
+ if (!a.admin || u.value || !o.value || !R.value || d.value) return;
1554
+ u.value = !0, d.value = !1;
1555
+ const L = o.value;
1556
+ o.value = "", x.value = !0;
1502
1557
  try {
1503
- const L = m.value ? await u.authorize(F, k.value) : await u.authorize(F);
1504
- await R(L), V || $("confirmed");
1558
+ let X = f.value ? await i.authorize(L, V.value) : await i.authorize(L);
1559
+ await j(X), !q && f.value && X.state === "ready" && K.value && (X = await i.authorize(L, V.value), await j(X)), q || m("confirmed");
1505
1560
  } catch {
1506
- V || (w.value = !0);
1561
+ q || (d.value = !0);
1507
1562
  } finally {
1508
- V || (o.value = !1);
1563
+ q || (u.value = !1, x.value = !1);
1509
1564
  }
1510
1565
  }
1511
- return ie(() => {
1512
- u.subscribe?.((F) => {
1513
- V || (n.value = F);
1514
- }), W();
1515
- }), se(() => {
1516
- V = !0, i.value = "";
1517
- }), (F, L) => f.admin ? (t(), h(e(de), {
1566
+ return fe(() => {
1567
+ i.subscribe?.((L) => {
1568
+ q || (n.value = L);
1569
+ }), Y();
1570
+ }), de(() => {
1571
+ q = !0, o.value = "";
1572
+ }), (L, X) => c.admin ? (t(), w(e(pe), {
1518
1573
  key: 0,
1519
1574
  title: r.value.setupTitle,
1520
1575
  collapsible: !1,
1521
- "aria-busy": o.value
1576
+ "aria-busy": u.value
1522
1577
  }, {
1523
1578
  default: s(() => [
1524
- g("p", null, l(r.value.setupHelp), 1),
1525
- w.value ? (t(), h(e(Q), {
1579
+ h("p", null, l(r.value.setupHelp), 1),
1580
+ d.value ? (t(), w(e(W), {
1526
1581
  key: 0,
1527
1582
  tone: "danger",
1528
1583
  role: "alert"
1529
1584
  }, {
1530
1585
  default: s(() => [
1531
- p(l(r.value.setupError), 1)
1586
+ k(l(r.value.setupError), 1)
1532
1587
  ]),
1533
1588
  _: 1
1534
- })) : y("", !0),
1535
- g("p", fl, l(n.value?.state === "ready" ? A.value ? r.value.scopeNeeds : r.value.ready : n.value?.state === "needs-admin-approval" ? r.value.needs : r.value.blocked), 1),
1536
- n.value?.reason && (n.value.state === "blocked" || n.value.state === "unsupported") ? (t(), C("p", yl, l(r.value.details) + ": " + l(n.value.reason), 1)) : y("", !0),
1537
- d.value?.selection ? (t(), C("p", ml, l(r.value.protectedScope) + ": " + l(d.value.selection.root), 1)) : y("", !0),
1538
- d.value?.mismatch ? (t(), h(e(Q), {
1589
+ })) : b("", !0),
1590
+ h("p", El, l(x.value ? r.value.confirming : n.value ? n.value.state === "ready" ? K.value ? r.value.scopeNeeds : r.value.ready : n.value.state === "needs-admin-approval" ? r.value.needs : r.value.blocked : r.value.loading), 1),
1591
+ n.value?.reason && (n.value.state === "blocked" || n.value.state === "unsupported") ? (t(), $("p", Rl, l(r.value.details) + ": " + l(n.value.reason), 1)) : b("", !0),
1592
+ p.value?.selection ? (t(), $("p", Tl, l(r.value.protectedScope) + ": " + l(p.value.selection.root), 1)) : b("", !0),
1593
+ p.value?.mismatch ? (t(), w(e(W), {
1539
1594
  key: 3,
1540
1595
  tone: "warning"
1541
1596
  }, {
1542
1597
  default: s(() => [
1543
- p(l(r.value.scopeMismatch) + " " + l(r.value.preselection) + ": " + l(d.value.preselection) + " · " + l(r.value.protectedScope) + ": " + l(d.value.selection?.root), 1)
1598
+ k(l(r.value.scopeMismatch) + " " + l(r.value.preselection) + ": " + l(p.value.preselection) + " · " + l(r.value.protectedScope) + ": " + l(p.value.selection?.root), 1)
1544
1599
  ]),
1545
1600
  _: 1
1546
- })) : y("", !0),
1547
- n.value?.state === "needs-admin-approval" || n.value?.retry || m.value && n.value?.state === "ready" ? (t(), h(e(pe), {
1601
+ })) : b("", !0),
1602
+ n.value?.state === "needs-admin-approval" || n.value?.retry || f.value && n.value?.state === "ready" ? (t(), w(e(he), {
1548
1603
  key: 4,
1549
- onSubmit: ce(X, ["prevent"])
1604
+ onSubmit: be(J, ["prevent"])
1550
1605
  }, {
1551
1606
  default: s(() => [
1552
- m.value ? (t(), C(j, { key: 0 }, [
1553
- g("p", null, l(d.value?.selection ? r.value.scopeChangeHelp : r.value.preselectionHelp), 1),
1554
- b(e(ne), {
1607
+ f.value ? (t(), $(te, { key: 0 }, [
1608
+ h("p", null, l(p.value?.selection ? r.value.scopeChangeHelp : r.value.preselectionHelp), 1),
1609
+ y(e(re), {
1555
1610
  label: r.value.scopeLabel,
1556
1611
  "label-for": "delegate-scope"
1557
1612
  }, {
1558
1613
  default: s(() => [
1559
- b(e(Pe), {
1614
+ y(e(Ne), {
1560
1615
  id: "delegate-scope",
1561
- modelValue: k.value,
1562
- "onUpdate:modelValue": L[0] || (L[0] = (J) => k.value = J),
1563
- options: U.value,
1564
- disabled: o.value || w.value
1616
+ modelValue: V.value,
1617
+ "onUpdate:modelValue": X[0] || (X[0] = (H) => V.value = H),
1618
+ options: P.value,
1619
+ disabled: u.value || d.value
1565
1620
  }, null, 8, ["modelValue", "options", "disabled"])
1566
1621
  ]),
1567
1622
  _: 1
1568
1623
  }, 8, ["label"])
1569
- ], 64)) : y("", !0),
1570
- b(e(ne), {
1624
+ ], 64)) : b("", !0),
1625
+ y(e(re), {
1571
1626
  label: r.value.password,
1572
1627
  "label-for": "delegate-password"
1573
1628
  }, {
1574
1629
  default: s(() => [
1575
- b(e(re), {
1630
+ y(e(me), {
1576
1631
  id: "delegate-password",
1577
- modelValue: i.value,
1578
- "onUpdate:modelValue": L[1] || (L[1] = (J) => i.value = J),
1632
+ modelValue: o.value,
1633
+ "onUpdate:modelValue": X[1] || (X[1] = (H) => o.value = H),
1579
1634
  type: "password",
1580
1635
  autocomplete: "current-password",
1581
- disabled: o.value || w.value
1636
+ disabled: u.value || d.value
1582
1637
  }, null, 8, ["modelValue", "disabled"])
1583
1638
  ]),
1584
1639
  _: 1
1585
1640
  }, 8, ["label"]),
1586
- b(e(fe), null, {
1641
+ y(e(_e), null, {
1587
1642
  default: s(() => [
1588
- b(e(z), {
1643
+ y(e(A), {
1589
1644
  type: "submit",
1590
1645
  variant: "primary",
1591
- disabled: o.value || w.value || !i.value || !S.value || m.value && !!d.value?.selection && !H.value
1646
+ disabled: u.value || d.value || !o.value || !R.value || f.value && !!p.value?.selection && !T.value
1592
1647
  }, {
1593
1648
  default: s(() => [
1594
- p(l(m.value ? d.value?.selection ? r.value.confirmScope : r.value.confirmShare : r.value.authorize), 1)
1649
+ k(l(f.value ? p.value?.selection ? r.value.confirmScope : r.value.confirmShare : r.value.authorize), 1)
1595
1650
  ]),
1596
1651
  _: 1
1597
1652
  }, 8, ["disabled"])
@@ -1600,162 +1655,162 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
1600
1655
  })
1601
1656
  ]),
1602
1657
  _: 1
1603
- })) : y("", !0),
1604
- b(e(z), {
1658
+ })) : b("", !0),
1659
+ y(e(A), {
1605
1660
  variant: "secondary",
1606
- disabled: o.value,
1607
- onClick: W
1661
+ disabled: u.value,
1662
+ onClick: Y
1608
1663
  }, {
1609
1664
  default: s(() => [
1610
- p(l(r.value.refresh), 1)
1665
+ k(l(r.value.refresh), 1)
1611
1666
  ]),
1612
1667
  _: 1
1613
1668
  }, 8, ["disabled"])
1614
1669
  ]),
1615
1670
  _: 1
1616
- }, 8, ["title", "aria-busy"])) : y("", !0);
1671
+ }, 8, ["title", "aria-busy"])) : b("", !0);
1617
1672
  }
1618
- }), bl = {
1673
+ }), ql = {
1619
1674
  key: 1,
1620
1675
  role: "status"
1621
- }, kl = {
1676
+ }, Ol = {
1622
1677
  key: 2,
1623
1678
  role: "status"
1624
- }, _l = {
1679
+ }, Bl = {
1625
1680
  key: 0,
1626
1681
  role: "status",
1627
1682
  class: "destination"
1628
- }, gl = { class: "section-heading" }, hl = { key: 3 }, wl = {
1683
+ }, Ll = { class: "section-heading" }, Fl = { key: 3 }, Nl = {
1629
1684
  key: 4,
1630
1685
  class: "records"
1631
- }, Cl = ["data-job-state"], $l = ["role"], xl = { key: 5 }, Sl = {
1686
+ }, Ml = ["data-job-state"], Kl = ["role"], Hl = { key: 5 }, Gl = {
1632
1687
  key: 6,
1633
1688
  class: "records"
1634
- }, zl = /* @__PURE__ */ ae({
1689
+ }, Jl = /* @__PURE__ */ se({
1635
1690
  __name: "DelegatePanel",
1636
1691
  props: {
1637
1692
  ctx: {}
1638
1693
  },
1639
- setup(f) {
1640
- const P = f, a = N(() => xe(P.ctx.locale)), $ = $e(P.ctx), u = c(), r = c([]), n = c([]), i = c(!1), o = c(), w = c(""), d = c(!1), k = c(""), E = c(""), m = c("");
1641
- let U = !1, S, A;
1642
- Se([E, k, m], () => {
1643
- A = void 0;
1694
+ setup(c) {
1695
+ const S = c, a = N(() => qe(S.ctx.locale)), m = Te(S.ctx), i = v(), r = v([]), n = v([]), o = v(!1), u = v(), x = v(""), d = v(!1), p = v(""), V = v(""), C = v("");
1696
+ let f = !1, P, R;
1697
+ Be([V, p, C], () => {
1698
+ R = void 0;
1644
1699
  }, { flush: "sync" });
1645
- const H = (M) => ["queued", "running", "waiting_executor"].includes(M.state), V = N(() => n.value.some((M) => M.state === "waiting_executor")), R = ["EXECUTOR_UNAVAILABLE", "EXECUTOR_TIMEOUT"], W = N(() => V.value && R.includes(o.value?.code ?? "")), X = N(() => u.value && u.value.state !== "ready" && !(V.value && u.value.state === "needs-admin-approval" && R.includes(u.value.reason ?? "")));
1646
- async function F() {
1647
- if (U) return;
1648
- const [M, v, _] = await Promise.allSettled([P.ctx.call("delegate.status"), P.ctx.call("delegate.list"), P.ctx.call("delegate.jobs.list")]);
1649
- if (!U) {
1650
- M.status === "fulfilled" && (u.value = M.value), v.status === "fulfilled" && (r.value = (v.value.delegations ?? []).filter((x) => !x.revoked)), _.status === "fulfilled" && (n.value = _.value.jobs ?? []);
1651
- for (const x of [M, v, _]) if (x.status === "rejected") throw x.reason;
1700
+ const K = (B) => ["queued", "running", "waiting_executor"].includes(B.state), T = N(() => n.value.some((B) => B.state === "waiting_executor")), q = ["EXECUTOR_UNAVAILABLE", "EXECUTOR_TIMEOUT"], j = N(() => T.value && q.includes(u.value?.code ?? "")), Y = N(() => i.value && i.value.state !== "ready" && !(T.value && i.value.state === "needs-admin-approval" && q.includes(i.value.reason ?? "")));
1701
+ async function J() {
1702
+ if (f) return;
1703
+ const [B, _, z] = await Promise.allSettled([S.ctx.call("delegate.status"), S.ctx.call("delegate.list"), S.ctx.call("delegate.jobs.list")]);
1704
+ if (!f) {
1705
+ B.status === "fulfilled" && (i.value = B.value), _.status === "fulfilled" && (r.value = (_.value.delegations ?? []).filter((G) => !G.revoked)), z.status === "fulfilled" && (n.value = z.value.jobs ?? []);
1706
+ for (const G of [B, _, z]) if (G.status === "rejected") throw G.reason;
1652
1707
  }
1653
1708
  }
1654
- async function L(M) {
1655
- if (!(i.value || U)) {
1656
- i.value = !0, o.value = void 0;
1709
+ async function L(B) {
1710
+ if (!(o.value || f)) {
1711
+ o.value = !0, u.value = void 0;
1657
1712
  try {
1658
- await M();
1659
- } catch (v) {
1660
- U || (o.value = v);
1713
+ await B();
1714
+ } catch (_) {
1715
+ f || (u.value = _);
1661
1716
  } finally {
1662
- U || (i.value = !1);
1717
+ f || (o.value = !1);
1663
1718
  }
1664
1719
  }
1665
1720
  }
1666
- const J = () => L(F), K = (M) => L(async () => {
1667
- await P.ctx.call("delegate.revoke", { delegation_id: M }), await F();
1668
- }), Y = (M) => L(async () => {
1669
- const v = await P.ctx.call("delegate.jobs.cancel", { id: M });
1670
- U || (w.value = v.revocation_pending ? a.value.pending : ""), await F();
1671
- }), q = N(() => u.value?.state === "ready" && !!k.value && !!E.value && !!m.value), O = () => L(async () => {
1672
- q.value && (await P.ctx.call("delegate.jobs.submit", { key: A ?? (A = crypto.randomUUID()), url: E.value, dest: k.value, name: m.value }), U || (E.value = "", m.value = "", k.value = ""), await F());
1673
- }), T = (M) => {
1674
- const v = new Date(M);
1675
- return Number.isNaN(v.getTime()) ? "—" : v.toLocaleString(P.ctx.locale);
1721
+ const X = () => L(J), H = (B) => L(async () => {
1722
+ await S.ctx.call("delegate.revoke", { delegation_id: B }), await J();
1723
+ }), ee = (B) => L(async () => {
1724
+ const _ = await S.ctx.call("delegate.jobs.cancel", { id: B });
1725
+ f || (x.value = _.revocation_pending ? a.value.pending : ""), await J();
1726
+ }), ae = N(() => i.value?.state === "ready" && !!p.value && !!V.value && !!C.value), Q = () => L(async () => {
1727
+ ae.value && (await S.ctx.call("delegate.jobs.submit", { key: R ?? (R = crypto.randomUUID()), url: V.value, dest: p.value, name: C.value }), f || (V.value = "", C.value = "", p.value = ""), await J());
1728
+ }), E = (B) => {
1729
+ const _ = new Date(B);
1730
+ return Number.isNaN(_.getTime()) ? "—" : _.toLocaleString(S.ctx.locale);
1676
1731
  };
1677
- return ie(() => {
1678
- J(), S = setInterval(() => {
1679
- n.value.some(H) && J();
1732
+ return fe(() => {
1733
+ X(), P = setInterval(() => {
1734
+ n.value.some(K) && X();
1680
1735
  }, 3e3);
1681
- }), se(() => {
1682
- U = !0, S && clearInterval(S), $.dispose();
1683
- }), (M, v) => (t(), h(e(de), {
1736
+ }), de(() => {
1737
+ f = !0, P && clearInterval(P), m.dispose();
1738
+ }), (B, _) => (t(), w(e(pe), {
1684
1739
  title: a.value.title,
1685
1740
  collapsible: !1,
1686
- "aria-busy": i.value,
1741
+ "aria-busy": o.value,
1687
1742
  class: "delegate-panel"
1688
1743
  }, {
1689
1744
  default: s(() => [
1690
- g("p", null, l(a.value.help), 1),
1691
- o.value && !W.value ? (t(), h(e(Q), {
1745
+ h("p", null, l(a.value.help), 1),
1746
+ u.value && !j.value ? (t(), w(e(W), {
1692
1747
  key: 0,
1693
1748
  tone: "danger",
1694
1749
  role: "alert"
1695
1750
  }, {
1696
1751
  default: s(() => [
1697
- p(l(e(Fe)(o.value, a.value)), 1)
1752
+ k(l(e(Ze)(u.value, a.value)), 1)
1698
1753
  ]),
1699
1754
  _: 1
1700
- })) : y("", !0),
1701
- w.value ? (t(), C("p", bl, l(w.value), 1)) : y("", !0),
1702
- X.value ? (t(), C("p", kl, l(u.value?.state === "needs-admin-approval" ? a.value.needs : a.value.blocked), 1)) : y("", !0),
1703
- b(e(pe), {
1704
- onSubmit: ce(O, ["prevent"])
1755
+ })) : b("", !0),
1756
+ x.value ? (t(), $("p", ql, l(x.value), 1)) : b("", !0),
1757
+ Y.value ? (t(), $("p", Ol, l(i.value?.state === "needs-admin-approval" ? a.value.needs : a.value.blocked), 1)) : b("", !0),
1758
+ y(e(he), {
1759
+ onSubmit: be(Q, ["prevent"])
1705
1760
  }, {
1706
1761
  default: s(() => [
1707
- b(e(ne), {
1762
+ y(e(re), {
1708
1763
  label: a.value.url,
1709
1764
  "label-for": "delegate-url"
1710
1765
  }, {
1711
1766
  default: s(() => [
1712
- b(e(re), {
1767
+ y(e(me), {
1713
1768
  id: "delegate-url",
1714
- modelValue: E.value,
1715
- "onUpdate:modelValue": v[0] || (v[0] = (_) => E.value = _),
1769
+ modelValue: V.value,
1770
+ "onUpdate:modelValue": _[0] || (_[0] = (z) => V.value = z),
1716
1771
  type: "url",
1717
- disabled: i.value || u.value?.state !== "ready"
1772
+ disabled: o.value || i.value?.state !== "ready"
1718
1773
  }, null, 8, ["modelValue", "disabled"])
1719
1774
  ]),
1720
1775
  _: 1
1721
1776
  }, 8, ["label"]),
1722
- b(e(ne), {
1777
+ y(e(re), {
1723
1778
  label: a.value.name,
1724
1779
  "label-for": "delegate-name"
1725
1780
  }, {
1726
1781
  default: s(() => [
1727
- b(e(re), {
1782
+ y(e(me), {
1728
1783
  id: "delegate-name",
1729
- modelValue: m.value,
1730
- "onUpdate:modelValue": v[1] || (v[1] = (_) => m.value = _),
1784
+ modelValue: C.value,
1785
+ "onUpdate:modelValue": _[1] || (_[1] = (z) => C.value = z),
1731
1786
  "data-file-name": "",
1732
- disabled: i.value || u.value?.state !== "ready"
1787
+ disabled: o.value || i.value?.state !== "ready"
1733
1788
  }, null, 8, ["modelValue", "disabled"])
1734
1789
  ]),
1735
1790
  _: 1
1736
1791
  }, 8, ["label"]),
1737
- g("p", null, l(a.value.size), 1),
1738
- k.value ? (t(), C("p", _l, l(a.value.destination) + ": " + l(k.value), 1)) : y("", !0),
1739
- b(e(fe), null, {
1792
+ h("p", null, l(a.value.size), 1),
1793
+ p.value ? (t(), $("p", Bl, l(a.value.destination) + ": " + l(p.value), 1)) : b("", !0),
1794
+ y(e(_e), null, {
1740
1795
  default: s(() => [
1741
- b(e(z), {
1796
+ y(e(A), {
1742
1797
  type: "button",
1743
1798
  variant: "secondary",
1744
- disabled: i.value || u.value?.state !== "ready",
1745
- onClick: v[2] || (v[2] = (_) => d.value = !0)
1799
+ disabled: o.value || i.value?.state !== "ready",
1800
+ onClick: _[2] || (_[2] = (z) => d.value = !0)
1746
1801
  }, {
1747
1802
  default: s(() => [
1748
- p(l(a.value.choose), 1)
1803
+ k(l(a.value.choose), 1)
1749
1804
  ]),
1750
1805
  _: 1
1751
1806
  }, 8, ["disabled"]),
1752
- b(e(z), {
1807
+ y(e(A), {
1753
1808
  type: "submit",
1754
1809
  variant: "primary",
1755
- disabled: i.value || !q.value
1810
+ disabled: o.value || !ae.value
1756
1811
  }, {
1757
1812
  default: s(() => [
1758
- p(l(a.value.submit), 1)
1813
+ k(l(a.value.submit), 1)
1759
1814
  ]),
1760
1815
  _: 1
1761
1816
  }, 8, ["disabled"])
@@ -1765,64 +1820,64 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
1765
1820
  ]),
1766
1821
  _: 1
1767
1822
  }),
1768
- b(ye, {
1823
+ y(we, {
1769
1824
  open: d.value,
1770
- "onUpdate:open": v[3] || (v[3] = (_) => d.value = _),
1771
- locale: f.ctx.locale,
1772
- provider: e($),
1825
+ "onUpdate:open": _[3] || (_[3] = (z) => d.value = z),
1826
+ locale: c.ctx.locale,
1827
+ provider: e(m),
1773
1828
  mode: "folder",
1774
- onSelected: v[4] || (v[4] = (_) => k.value = _)
1829
+ onSelected: _[4] || (_[4] = (z) => p.value = z)
1775
1830
  }, null, 8, ["open", "locale", "provider"]),
1776
- g("div", gl, [
1777
- g("h3", null, l(a.value.downloads), 1),
1778
- b(e(z), {
1831
+ h("div", Ll, [
1832
+ h("h3", null, l(a.value.downloads), 1),
1833
+ y(e(A), {
1779
1834
  variant: "secondary",
1780
- disabled: i.value,
1781
- onClick: J
1835
+ disabled: o.value,
1836
+ onClick: X
1782
1837
  }, {
1783
1838
  default: s(() => [
1784
- p(l(a.value.refresh), 1)
1839
+ k(l(a.value.refresh), 1)
1785
1840
  ]),
1786
1841
  _: 1
1787
1842
  }, 8, ["disabled"])
1788
1843
  ]),
1789
- !n.value.length && !o.value ? (t(), C("p", hl, l(a.value.noJobs), 1)) : (t(), C("ul", wl, [
1790
- (t(!0), C(j, null, te(n.value, (_) => (t(), C("li", {
1791
- key: _.id,
1792
- "data-job-state": _.state
1844
+ !n.value.length && !u.value ? (t(), $("p", Fl, l(a.value.noJobs), 1)) : (t(), $("ul", Nl, [
1845
+ (t(!0), $(te, null, ce(n.value, (z) => (t(), $("li", {
1846
+ key: z.id,
1847
+ "data-job-state": z.state
1793
1848
  }, [
1794
- g("span", {
1795
- role: _.state === "waiting_executor" ? "status" : void 0
1796
- }, l(_.name) + " · " + l(a.value[_.state]), 9, $l),
1797
- H(_) ? (t(), h(e(z), {
1849
+ h("span", {
1850
+ role: z.state === "waiting_executor" ? "status" : void 0
1851
+ }, l(z.name) + " · " + l(a.value[z.state]), 9, Kl),
1852
+ K(z) ? (t(), w(e(A), {
1798
1853
  key: 0,
1799
1854
  variant: "secondary",
1800
- disabled: i.value,
1801
- onClick: (x) => Y(_.id)
1855
+ disabled: o.value,
1856
+ onClick: (G) => ee(z.id)
1802
1857
  }, {
1803
1858
  default: s(() => [
1804
- p(l(a.value.cancel), 1)
1859
+ k(l(a.value.cancel), 1)
1805
1860
  ]),
1806
1861
  _: 1
1807
- }, 8, ["disabled", "onClick"])) : y("", !0)
1808
- ], 8, Cl))), 128))
1862
+ }, 8, ["disabled", "onClick"])) : b("", !0)
1863
+ ], 8, Ml))), 128))
1809
1864
  ])),
1810
- g("h3", null, l(a.value.delegations), 1),
1811
- !r.value.length && !o.value ? (t(), C("p", xl, l(a.value.noDelegations), 1)) : (t(), C("ul", Sl, [
1812
- (t(!0), C(j, null, te(r.value, (_) => (t(), C("li", {
1813
- key: _.delegation_id
1865
+ h("h3", null, l(a.value.delegations), 1),
1866
+ !r.value.length && !u.value ? (t(), $("p", Hl, l(a.value.noDelegations), 1)) : (t(), $("ul", Gl, [
1867
+ (t(!0), $(te, null, ce(r.value, (z) => (t(), $("li", {
1868
+ key: z.delegation_id
1814
1869
  }, [
1815
- g("div", null, [
1816
- g("strong", null, l(_.path), 1),
1817
- g("p", null, l(a.value.expires) + ": " + l(T(_.expires_at)), 1)
1870
+ h("div", null, [
1871
+ h("strong", null, l(z.path), 1),
1872
+ h("p", null, l(a.value.expires) + ": " + l(E(z.expires_at)), 1)
1818
1873
  ]),
1819
- b(e(z), {
1874
+ y(e(A), {
1820
1875
  variant: "secondary",
1821
- disabled: i.value,
1822
- onClick: (x) => K(_.delegation_id)
1876
+ disabled: o.value,
1877
+ onClick: (G) => H(z.delegation_id)
1823
1878
  }, {
1824
1879
  default: s(() => [
1825
- p(l(a.value.revoke), 1)
1880
+ k(l(a.value.revoke), 1)
1826
1881
  ]),
1827
1882
  _: 1
1828
1883
  }, 8, ["disabled", "onClick"])
@@ -1832,19 +1887,19 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
1832
1887
  _: 1
1833
1888
  }, 8, ["title", "aria-busy"]));
1834
1889
  }
1835
- }), dt = /* @__PURE__ */ ue(zl, [["__scopeId", "data-v-d79ee942"]]), Vl = {
1890
+ }), Ut = /* @__PURE__ */ oe(Jl, [["__scopeId", "data-v-d79ee942"]]), Xl = {
1836
1891
  key: 1,
1837
1892
  role: "status"
1838
- }, Ul = {
1893
+ }, Ql = {
1839
1894
  key: 2,
1840
1895
  role: "status"
1841
- }, Pl = { key: 3 }, Dl = {
1896
+ }, Yl = { key: 3 }, Wl = {
1842
1897
  key: 7,
1843
1898
  role: "status"
1844
- }, Al = { class: "save-actions" }, El = { key: 8 }, Tl = {
1899
+ }, Zl = { class: "save-actions" }, jl = { key: 8 }, et = {
1845
1900
  key: 10,
1846
1901
  class: "save-actions"
1847
- }, Il = { key: 12 }, Ol = { class: "save-records" }, ql = { class: "save-actions" }, Rl = { key: 14 }, Ll = { class: "save-records" }, Bl = ["data-job-id", "data-save-state"], Fl = { key: 0 }, Nl = { key: 3 }, Ml = /* @__PURE__ */ ae({
1902
+ }, at = { key: 12 }, lt = { class: "save-records" }, tt = { class: "save-actions" }, nt = { key: 14 }, st = { class: "save-records" }, it = ["data-job-id", "data-save-state"], ot = { key: 0 }, ut = { key: 3 }, rt = /* @__PURE__ */ se({
1848
1903
  __name: "BackgroundSavePanel",
1849
1904
  props: {
1850
1905
  sdk: {},
@@ -1853,472 +1908,532 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
1853
1908
  picker: {}
1854
1909
  },
1855
1910
  emits: ["authorized"],
1856
- setup(f, { emit: P }) {
1857
- const a = f, $ = P, u = c(!1), r = c(""), n = N(() => Ce(a.locale)), i = c(), o = c([]), w = c([]), d = c(!1), k = c(), E = c(""), m = c([]), U = N(() => a.picker && (i.value?.selection ? Ne(a.picker.provider, i.value.selection.root) : i.value?.scopeMode === "install-selected" ? void 0 : a.picker.provider));
1858
- let S = !1, A;
1859
- const H = (T) => T.state === "copying" && T.code === "CANCEL_REQUESTED", V = (T) => H(T) ? "canceling" : T.state === "committed" && !T.receipt?.path ? "uncertain" : T.state, R = (T) => ["queued", "copying"].includes(T.state) && !H(T);
1860
- function W() {
1861
- i.value = void 0, o.value = [], w.value = [], m.value = [], u.value = !1;
1911
+ setup(c, { emit: S }) {
1912
+ const a = c, m = S, i = v(!1), r = v(""), n = N(() => Re(a.locale)), o = v(), u = v([]), x = v([]), d = v(!1), p = v(), V = v(""), C = v([]), f = N(() => a.picker && (o.value?.selection ? je(a.picker.provider, o.value.selection.root) : o.value?.scopeMode === "install-selected" ? void 0 : a.picker.provider));
1913
+ let P = !1, R;
1914
+ const K = (E) => E.state === "copying" && E.code === "CANCEL_REQUESTED", T = (E) => K(E) ? "canceling" : E.state === "committed" && !E.receipt?.path ? "uncertain" : E.state, q = (E) => ["queued", "copying"].includes(E.state) && !K(E);
1915
+ function j() {
1916
+ o.value = void 0, u.value = [], x.value = [], C.value = [], i.value = !1;
1862
1917
  }
1863
- async function X() {
1864
- const [T, M, v, _] = await Promise.all([a.sdk.status(), a.sdk.list(), a.sdk.operations(), Promise.all((a.picker?.keys ?? []).map((x) => a.sdk.destination(x)))]);
1865
- if (!S) {
1866
- if (!T || typeof T.disabled != "boolean" || !Array.isArray(M) || !Array.isArray(v)) throw { code: "unavailable" };
1867
- (i.value?.selection?.generation !== T.selection?.generation || i.value?.selection?.scope !== T.selection?.scope) && (u.value = !1), i.value = T, o.value = _.length ? M.filter((x) => _.some((G) => G.status === "active" && G.destination?.id === x.id)) : M, w.value = v, m.value = _;
1918
+ async function Y() {
1919
+ const [E, B, _, z] = await Promise.all([a.sdk.status(), a.sdk.list(), a.sdk.operations(), Promise.all((a.picker?.keys ?? []).map((G) => a.sdk.destination(G)))]);
1920
+ if (!P) {
1921
+ if (!E || typeof E.disabled != "boolean" || !Array.isArray(B) || !Array.isArray(_)) throw { code: "unavailable" };
1922
+ (o.value?.selection?.generation !== E.selection?.generation || o.value?.selection?.scope !== E.selection?.scope) && (i.value = !1), o.value = E, u.value = z.length ? B.filter((G) => z.some((Z) => Z.status === "active" && Z.destination?.id === G.id)) : B, x.value = _, C.value = z;
1868
1923
  }
1869
1924
  }
1870
- async function F(T) {
1871
- if (!(S || d.value)) {
1872
- d.value = !0, k.value = void 0, E.value = "";
1925
+ async function J(E) {
1926
+ if (!(P || d.value)) {
1927
+ d.value = !0, p.value = void 0, V.value = "";
1873
1928
  try {
1874
- await T();
1875
- } catch (M) {
1876
- S || (W(), k.value = M);
1929
+ await E();
1930
+ } catch (B) {
1931
+ P || (j(), p.value = B);
1877
1932
  } finally {
1878
- S || (d.value = !1);
1933
+ P || (d.value = !1);
1879
1934
  }
1880
1935
  }
1881
1936
  }
1882
- const L = () => F(X);
1883
- function J(T) {
1884
- $("authorized", T), L();
1937
+ const L = () => J(Y);
1938
+ function X(E) {
1939
+ m("authorized", E), L();
1885
1940
  }
1886
- const K = (T) => F(async () => {
1887
- if ((await a.sdk.revoke({ delegation_id: T }))?.revoked !== !0) throw { code: "commit-uncertain" };
1888
- await X(), S || (E.value = n.value.revoked);
1889
- }), Y = (T) => F(async () => {
1890
- await a.sdk.cancel({ delegation_id: T.delegation_id, job_id: T.job_id }), await X();
1891
- }), q = () => F(async () => {
1892
- if (!a.admin || !i.value) return;
1893
- const T = i.value.disabled;
1894
- if ((T ? await a.sdk.enable() : await a.sdk.disable())?.disabled !== !T) throw { code: "commit-uncertain" };
1895
- await X();
1896
- }), O = (T) => F(async () => {
1897
- const M = "example-" + Array.from(crypto.getRandomValues(new Uint8Array(16)), (v) => v.toString(16).padStart(2, "0")).join("");
1898
- await a.sdk.exportExample({ key: T, job_id: M }), await X();
1941
+ const H = (E) => J(async () => {
1942
+ if ((await a.sdk.revoke({ delegation_id: E }))?.revoked !== !0) throw { code: "commit-uncertain" };
1943
+ await Y(), P || (V.value = n.value.revoked);
1944
+ }), ee = (E) => J(async () => {
1945
+ await a.sdk.cancel({ delegation_id: E.delegation_id, job_id: E.job_id }), await Y();
1946
+ }), ae = () => J(async () => {
1947
+ if (!a.admin || !o.value) return;
1948
+ const E = o.value.disabled;
1949
+ if ((E ? await a.sdk.enable() : await a.sdk.disable())?.disabled !== !E) throw { code: "commit-uncertain" };
1950
+ await Y();
1951
+ }), Q = (E) => J(async () => {
1952
+ const B = "example-" + Array.from(crypto.getRandomValues(new Uint8Array(16)), (_) => _.toString(16).padStart(2, "0")).join("");
1953
+ await a.sdk.exportExample({ key: E, job_id: B }), await Y();
1899
1954
  });
1900
- return ie(() => {
1901
- L(), A = setInterval(() => {
1902
- w.value.some(R) && L();
1955
+ return fe(() => {
1956
+ L(), R = setInterval(() => {
1957
+ x.value.some(q) && L();
1903
1958
  }, 3e3);
1904
- }), se(() => {
1905
- S = !0, A && clearInterval(A);
1906
- }), (T, M) => (t(), h(e(de), {
1959
+ }), de(() => {
1960
+ P = !0, R && clearInterval(R);
1961
+ }), (E, B) => (t(), w(e(pe), {
1907
1962
  title: n.value.title,
1908
1963
  collapsible: !1,
1909
1964
  "aria-busy": d.value,
1910
1965
  class: "background-save-panel"
1911
1966
  }, {
1912
1967
  default: s(() => [
1913
- g("p", null, l(n.value.help), 1),
1914
- k.value ? (t(), h(e(Q), {
1968
+ h("p", null, l(n.value.help), 1),
1969
+ p.value ? (t(), w(e(W), {
1915
1970
  key: 0,
1916
1971
  tone: "danger",
1917
1972
  role: "alert",
1918
1973
  class: "save-message"
1919
1974
  }, {
1920
1975
  default: s(() => [
1921
- p(l(e(be)(k.value, n.value)), 1)
1976
+ k(l(e(ze)(p.value, n.value)), 1)
1922
1977
  ]),
1923
1978
  _: 1
1924
- })) : y("", !0),
1925
- d.value && !i.value ? (t(), C("p", Vl, l(n.value.loading), 1)) : y("", !0),
1926
- E.value ? (t(), C("p", Ul, l(E.value), 1)) : y("", !0),
1927
- i.value?.selection ? (t(), C("p", Pl, [
1928
- g("strong", null, l(n.value.scope), 1),
1929
- p(": " + l(i.value.selection.root), 1)
1930
- ])) : y("", !0),
1931
- i.value?.mismatch ? (t(), h(e(Q), {
1979
+ })) : b("", !0),
1980
+ d.value && !o.value ? (t(), $("p", Xl, l(n.value.loading), 1)) : b("", !0),
1981
+ V.value ? (t(), $("p", Ql, l(V.value), 1)) : b("", !0),
1982
+ o.value?.selection ? (t(), $("p", Yl, [
1983
+ h("strong", null, l(n.value.scope), 1),
1984
+ k(": " + l(o.value.selection.root), 1)
1985
+ ])) : b("", !0),
1986
+ o.value?.mismatch ? (t(), w(e(W), {
1932
1987
  key: 4,
1933
1988
  tone: "warning"
1934
1989
  }, {
1935
1990
  default: s(() => [
1936
- p(l(n.value.scopeMismatch) + " " + l(i.value.preselection) + " → " + l(i.value.selection?.root), 1)
1991
+ k(l(n.value.scopeMismatch) + " " + l(o.value.preselection) + " → " + l(o.value.selection?.root), 1)
1937
1992
  ]),
1938
1993
  _: 1
1939
- })) : y("", !0),
1940
- i.value?.scopeMode === "install-selected" && !i.value.selection ? (t(), h(e(Q), {
1994
+ })) : b("", !0),
1995
+ o.value?.scopeMode === "install-selected" && !o.value.selection ? (t(), w(e(W), {
1941
1996
  key: 5,
1942
1997
  tone: "warning"
1943
1998
  }, {
1944
1999
  default: s(() => [
1945
- p(l(n.value.scopeNeeds), 1)
2000
+ k(l(n.value.scopeNeeds), 1)
1946
2001
  ]),
1947
2002
  _: 1
1948
- })) : y("", !0),
1949
- i.value?.disabled ? (t(), h(e(Q), {
2003
+ })) : b("", !0),
2004
+ o.value?.disabled ? (t(), w(e(W), {
1950
2005
  key: 6,
1951
2006
  tone: "warning",
1952
2007
  role: "status",
1953
2008
  class: "save-message"
1954
2009
  }, {
1955
2010
  default: s(() => [
1956
- p(l(n.value.disabled), 1)
2011
+ k(l(n.value.disabled), 1)
1957
2012
  ]),
1958
2013
  _: 1
1959
- })) : i.value ? (t(), C("p", Dl, l(n.value.enabled), 1)) : y("", !0),
1960
- g("div", Al, [
1961
- b(e(z), {
2014
+ })) : o.value && !(o.value.scopeMode === "install-selected" && !o.value.selection) ? (t(), $("p", Wl, l(n.value.enabled), 1)) : b("", !0),
2015
+ h("div", Zl, [
2016
+ y(e(A), {
1962
2017
  variant: "secondary",
1963
2018
  disabled: d.value,
1964
2019
  onClick: L
1965
2020
  }, {
1966
2021
  default: s(() => [
1967
- p(l(n.value.refresh), 1)
2022
+ k(l(n.value.refresh), 1)
1968
2023
  ]),
1969
2024
  _: 1
1970
2025
  }, 8, ["disabled"]),
1971
- f.admin && i.value ? (t(), h(e(z), {
2026
+ c.admin && o.value ? (t(), w(e(A), {
1972
2027
  key: 0,
1973
- variant: i.value.disabled ? "secondary" : "danger",
2028
+ variant: o.value.disabled ? "secondary" : "danger",
1974
2029
  disabled: d.value,
1975
- onClick: q
2030
+ onClick: ae
1976
2031
  }, {
1977
2032
  default: s(() => [
1978
- p(l(i.value.disabled ? n.value.enable : n.value.disable), 1)
2033
+ k(l(o.value.disabled ? n.value.enable : n.value.disable), 1)
1979
2034
  ]),
1980
2035
  _: 1
1981
- }, 8, ["variant", "disabled"])) : y("", !0)
2036
+ }, 8, ["variant", "disabled"])) : b("", !0)
1982
2037
  ]),
1983
- f.admin && i.value ? (t(), C("p", El, l(n.value.disableHelp), 1)) : y("", !0),
1984
- g("h3", null, l(n.value.delegations), 1),
1985
- m.value.some((v) => v.status === "reselection-required") ? (t(), h(e(Q), {
2038
+ c.admin && o.value ? (t(), $("p", jl, l(n.value.disableHelp), 1)) : b("", !0),
2039
+ h("h3", null, l(n.value.delegations), 1),
2040
+ C.value.some((_) => _.status === "reselection-required") ? (t(), w(e(W), {
1986
2041
  key: 9,
1987
2042
  tone: "warning"
1988
2043
  }, {
1989
2044
  default: s(() => [
1990
- p(l(n.value.reselect), 1)
2045
+ k(l(n.value.reselect), 1)
1991
2046
  ]),
1992
2047
  _: 1
1993
- })) : y("", !0),
1994
- f.picker ? (t(), C("div", Tl, [
1995
- (t(!0), C(j, null, te(f.picker.keys, (v) => (t(), h(e(z), {
1996
- key: v,
2048
+ })) : b("", !0),
2049
+ c.picker ? (t(), $("div", et, [
2050
+ (t(!0), $(te, null, ce(c.picker.keys, (_) => (t(), w(e(A), {
2051
+ key: _,
1997
2052
  variant: "secondary",
1998
- disabled: d.value || !i.value || i.value.disabled || !U.value,
1999
- onClick: (_) => {
2000
- r.value = v, u.value = !0;
2053
+ disabled: d.value || !o.value || o.value.disabled || !f.value,
2054
+ onClick: (z) => {
2055
+ r.value = _, i.value = !0;
2001
2056
  }
2002
2057
  }, {
2003
2058
  default: s(() => [
2004
- p(l(n.value.choose) + " (" + l(v) + ")", 1)
2059
+ k(l(n.value.choose) + " (" + l(_) + ")", 1)
2005
2060
  ]),
2006
2061
  _: 2
2007
2062
  }, 1032, ["disabled", "onClick"]))), 128))
2008
- ])) : y("", !0),
2009
- U.value ? (t(), h(ye, {
2010
- key: i.value?.selection?.scope,
2011
- open: u.value,
2012
- "onUpdate:open": M[0] || (M[0] = (v) => u.value = v),
2013
- provider: U.value,
2014
- locale: f.locale,
2063
+ ])) : b("", !0),
2064
+ f.value ? (t(), w(we, {
2065
+ key: o.value?.selection?.scope,
2066
+ open: i.value,
2067
+ "onUpdate:open": B[0] || (B[0] = (_) => i.value = _),
2068
+ provider: f.value,
2069
+ locale: c.locale,
2015
2070
  mode: "folder",
2016
- destination: { key: r.value, selectDestination: f.sdk.selectDestination },
2017
- onAuthorized: J
2018
- }, null, 8, ["open", "provider", "locale", "destination"])) : y("", !0),
2019
- i.value && !o.value.length ? (t(), C("p", Il, l(n.value.empty), 1)) : y("", !0),
2020
- g("ul", Ol, [
2021
- (t(!0), C(j, null, te(o.value, (v) => (t(), C("li", {
2022
- key: v.id
2071
+ destination: { key: r.value, selectDestination: c.sdk.selectDestination },
2072
+ onAuthorized: X
2073
+ }, null, 8, ["open", "provider", "locale", "destination"])) : b("", !0),
2074
+ o.value && !u.value.length ? (t(), $("p", at, l(n.value.empty), 1)) : b("", !0),
2075
+ h("ul", lt, [
2076
+ (t(!0), $(te, null, ce(u.value, (_) => (t(), $("li", {
2077
+ key: _.id
2023
2078
  }, [
2024
- g("div", null, [
2025
- g("strong", null, l(v.path), 1),
2026
- g("p", null, l(n.value.untilRevoked), 1)
2079
+ h("div", null, [
2080
+ h("strong", null, l(_.path), 1),
2081
+ h("p", null, l(n.value.untilRevoked), 1)
2027
2082
  ]),
2028
- b(e(z), {
2083
+ y(e(A), {
2029
2084
  variant: "secondary",
2030
2085
  disabled: d.value,
2031
- onClick: (_) => K(v.id)
2086
+ onClick: (z) => H(_.id)
2032
2087
  }, {
2033
2088
  default: s(() => [
2034
- p(l(n.value.revoke), 1)
2089
+ k(l(n.value.revoke), 1)
2035
2090
  ]),
2036
2091
  _: 1
2037
2092
  }, 8, ["disabled", "onClick"])
2038
2093
  ]))), 128))
2039
2094
  ]),
2040
- m.value.some((v) => v.status === "active") ? (t(), C(j, { key: 13 }, [
2041
- g("p", null, l(n.value.exampleHelp), 1),
2042
- g("div", ql, [
2043
- (t(!0), C(j, null, te(m.value.filter((v) => v.status === "active"), (v) => (t(), h(e(z), {
2044
- key: v.key,
2095
+ C.value.some((_) => _.status === "active") ? (t(), $(te, { key: 13 }, [
2096
+ h("p", null, l(n.value.exampleHelp), 1),
2097
+ h("div", tt, [
2098
+ (t(!0), $(te, null, ce(C.value.filter((_) => _.status === "active"), (_) => (t(), w(e(A), {
2099
+ key: _.key,
2045
2100
  variant: "secondary",
2046
- disabled: d.value || i.value?.disabled,
2047
- onClick: (_) => O(v.key)
2101
+ disabled: d.value || o.value?.disabled,
2102
+ onClick: (z) => Q(_.key)
2048
2103
  }, {
2049
2104
  default: s(() => [
2050
- p(l(n.value.example) + " (" + l(v.key) + ")", 1)
2105
+ k(l(n.value.example) + " (" + l(_.key) + ")", 1)
2051
2106
  ]),
2052
2107
  _: 2
2053
2108
  }, 1032, ["disabled", "onClick"]))), 128))
2054
2109
  ])
2055
- ], 64)) : y("", !0),
2056
- g("h3", null, l(n.value.operations), 1),
2057
- i.value && !w.value.length ? (t(), C("p", Rl, l(n.value.noOperations), 1)) : y("", !0),
2058
- g("ul", Ll, [
2059
- (t(!0), C(j, null, te(w.value, (v) => (t(), C("li", {
2060
- key: v.job_id,
2061
- "data-job-id": v.job_id,
2062
- "data-save-state": V(v)
2110
+ ], 64)) : b("", !0),
2111
+ h("h3", null, l(n.value.operations), 1),
2112
+ o.value && !x.value.length ? (t(), $("p", nt, l(n.value.noOperations), 1)) : b("", !0),
2113
+ h("ul", st, [
2114
+ (t(!0), $(te, null, ce(x.value, (_) => (t(), $("li", {
2115
+ key: _.job_id,
2116
+ "data-job-id": _.job_id,
2117
+ "data-save-state": T(_)
2063
2118
  }, [
2064
- g("div", null, [
2065
- g("strong", null, l(v.name), 1),
2066
- g("p", null, l(n.value[V(v)]) + " · " + l(v.job_id), 1),
2067
- V(v) === "committed" ? (t(), C("p", Fl, l(v.receipt?.path), 1)) : y("", !0),
2068
- V(v) === "uncertain" ? (t(), h(e(Q), {
2119
+ h("div", null, [
2120
+ h("strong", null, l(_.name), 1),
2121
+ h("p", null, l(n.value[T(_)]) + " · " + l(_.job_id), 1),
2122
+ T(_) === "committed" ? (t(), $("p", ot, l(_.receipt?.path), 1)) : b("", !0),
2123
+ T(_) === "uncertain" ? (t(), w(e(W), {
2069
2124
  key: 1,
2070
2125
  tone: "warning",
2071
2126
  class: "save-message"
2072
2127
  }, {
2073
2128
  default: s(() => [
2074
- p(l(n.value.uncertainHelp), 1)
2129
+ k(l(n.value.uncertainHelp), 1)
2075
2130
  ]),
2076
2131
  _: 1
2077
- })) : V(v) === "interrupted" ? (t(), h(e(Q), {
2132
+ })) : T(_) === "interrupted" ? (t(), w(e(W), {
2078
2133
  key: 2,
2079
2134
  tone: "warning",
2080
2135
  class: "save-message"
2081
2136
  }, {
2082
2137
  default: s(() => [
2083
- p(l(n.value.interruptedHelp), 1)
2138
+ k(l(n.value.interruptedHelp), 1)
2084
2139
  ]),
2085
2140
  _: 1
2086
- })) : y("", !0),
2087
- v.code && !H(v) ? (t(), C("p", Nl, l(e(be)({ code: v.code }, n.value)), 1)) : y("", !0)
2141
+ })) : b("", !0),
2142
+ T(_) === "interrupted" && _.code ? (t(), $("p", ut, l(e(ze)({ code: _.code }, n.value)), 1)) : b("", !0)
2088
2143
  ]),
2089
- R(v) ? (t(), h(e(z), {
2144
+ q(_) ? (t(), w(e(A), {
2090
2145
  key: 0,
2091
2146
  variant: "secondary",
2092
2147
  disabled: d.value,
2093
- onClick: (_) => Y(v)
2148
+ onClick: (z) => ee(_)
2094
2149
  }, {
2095
2150
  default: s(() => [
2096
- p(l(n.value.cancel), 1)
2151
+ k(l(n.value.cancel), 1)
2097
2152
  ]),
2098
2153
  _: 1
2099
- }, 8, ["disabled", "onClick"])) : y("", !0)
2100
- ], 8, Bl))), 128))
2154
+ }, 8, ["disabled", "onClick"])) : b("", !0)
2155
+ ], 8, it))), 128))
2101
2156
  ])
2102
2157
  ]),
2103
2158
  _: 1
2104
2159
  }, 8, ["title", "aria-busy"]));
2105
2160
  }
2106
- }), vt = /* @__PURE__ */ ue(Ml, [["__scopeId", "data-v-c4022c90"]]), Hl = {
2107
- class: "authorization-announcement",
2108
- role: "status",
2109
- "aria-live": "polite",
2110
- "aria-atomic": "true"
2111
- }, Kl = ["aria-busy", "data-authorization-state"], Jl = {
2112
- class: "authorization-icon",
2113
- "aria-hidden": "true"
2114
- }, Xl = { class: "authorization-title" }, Gl = { class: "authorization-body" }, Ql = { class: "authorization-actions" }, Wl = {
2115
- key: 1,
2116
- class: "authorization-authorized"
2117
- }, Yl = { class: "authorization-ready" }, Zl = /* @__PURE__ */ ae({
2161
+ }), Dt = /* @__PURE__ */ oe(rt, [["__scopeId", "data-v-c38db985"]]), Ke = /* @__PURE__ */ Symbol("authorization");
2162
+ function dt() {
2163
+ const c = Oe(Ke, void 0);
2164
+ if (!c) throw Error("authorization controls must be placed inside AuthorizationGate");
2165
+ return c;
2166
+ }
2167
+ const vt = { class: "authorization-content" }, ct = ["aria-busy", "data-authorization-state"], ft = { class: "authorization-body" }, pt = /* @__PURE__ */ se({
2118
2168
  __name: "AuthorizationGate",
2119
2169
  props: {
2120
2170
  ctx: {},
2121
2171
  name: {}
2122
2172
  },
2123
2173
  emits: ["ready"],
2124
- setup(f, { emit: P }) {
2125
- const a = f, $ = P, u = c(), r = c(), n = c(!1), i = c(!1), o = c(!1);
2126
- let w = !1, d = 0, k = !1, E;
2127
- const m = N(() => Me(a.ctx.locale, a.name ?? a.ctx.displayName ?? "")), U = N(() => u.value?.state === "ready"), S = N(() => u.value || r.value), A = N(() => S.value?.state === "authorization_required"), H = N(() => ["helper_untrusted", "cli_untrusted"].includes(S.value?.reason || "")), V = N(() => A.value && !H.value), R = N(() => S.value?.reason === "credential_not_ready" ? "credential" : "unavailable"), W = N(() => S.value ? A.value ? m.value("title") : S.value.state === "ready" ? m.value("ready") : S.value.state === "not_admin" ? m.value("not_admin.title") : S.value.state === "session_expired" ? m.value("session_expired.title") : m.value(R.value + ".title") : m.value("checking")), X = N(() => A.value ? m.value("purpose") : S.value?.state === "not_admin" ? m.value("not_admin.body") : S.value?.state === "session_expired" ? m.value("session_expired.body") : S.value?.state === "unavailable" ? m.value(R.value + ".body") : m.value("purpose")), F = ["grant_missing", "upgrade_reapproval", "helper_untrusted", "cli_untrusted", "grant_incompatible", "package_identity_changed", "maintenance_task_missing", "maintenance_task_mismatch", "helper_health_rejected", "capability_missing"], L = N(() => F.includes(S.value?.reason || "") ? S.value.reason : "unknown"), J = N(() => H.value ? "next.reinstall" : L.value === "grant_missing" ? "next.install" : L.value === "upgrade_reapproval" || L.value === "grant_incompatible" ? "next.update" : "next.repair");
2128
- async function K(Y) {
2129
- if (n.value || w) return;
2130
- const q = ++d;
2131
- r.value = Y === "request" && u.value?.state === "authorization_required" ? u.value : void 0, n.value = !0, i.value = !1, u.value = void 0;
2174
+ setup(c, { emit: S }) {
2175
+ const a = c, m = S, i = v(), r = v(), n = v(!1), o = v(!1), u = v(!1);
2176
+ let x = [], d = !1, p = 0, V = !1, C;
2177
+ const f = N(() => ea(a.ctx.locale, a.name ?? a.ctx.displayName ?? "")), P = N(() => i.value || r.value), R = N(() => P.value?.state === "authorization_required"), K = N(() => ["helper_untrusted", "cli_untrusted"].includes(P.value?.reason || "")), T = N(() => R.value && !K.value), q = N(() => P.value?.reason === "credential_not_ready" ? "credential" : "unavailable"), j = N(() => P.value ? R.value ? f.value("title") : P.value.state === "ready" ? f.value("ready") : P.value.state === "not_admin" ? f.value("not_admin.title") : P.value.state === "session_expired" ? f.value("session_expired.title") : f.value(q.value + ".title") : f.value("checking")), Y = N(() => R.value ? f.value("purpose") : P.value?.state === "not_admin" ? f.value("not_admin.body") : P.value?.state === "session_expired" ? f.value("session_expired.body") : P.value?.state === "unavailable" ? f.value(q.value + ".body") : f.value("purpose")), J = ["grant_missing", "upgrade_reapproval", "helper_untrusted", "cli_untrusted", "grant_incompatible", "package_identity_changed", "maintenance_task_missing", "maintenance_task_mismatch", "helper_health_rejected", "capability_missing"], L = N(() => J.includes(P.value?.reason || "") ? P.value.reason : "unknown"), X = N(() => K.value ? "next.reinstall" : L.value === "grant_missing" ? "next.install" : L.value === "upgrade_reapproval" || L.value === "grant_incompatible" ? "next.update" : "next.repair");
2178
+ function H(z) {
2179
+ if (!z || z.command !== "authorization" || z.schema_version !== 1 || !["ready", "authorization_required", "not_admin", "session_expired", "unavailable"].includes(z.state) || z.reason === "upgrade_reapproval" && z.state !== "authorization_required") throw Error("invalid status");
2180
+ return z;
2181
+ }
2182
+ const ee = [1e3, 3e3];
2183
+ async function ae(z) {
2184
+ const G = z === "status" && !u.value ? ee : [];
2185
+ for (let Z = 0; ; Z++) {
2186
+ try {
2187
+ const le = H(await a.ctx.authorization?.[z]());
2188
+ if (le.state !== "unavailable" || Z >= G.length) return le;
2189
+ } catch (le) {
2190
+ if (le.code === "session_required" || Z >= G.length) throw le;
2191
+ }
2192
+ if (await new Promise((le) => setTimeout(le, G[Z])), d) throw Error("disposed");
2193
+ }
2194
+ }
2195
+ async function Q(z) {
2196
+ if (n.value || d) return;
2197
+ const G = ++p;
2198
+ r.value = z === "request" && i.value?.state === "authorization_required" ? i.value : void 0, n.value = !0, o.value = !1, i.value = void 0;
2132
2199
  try {
2133
- const O = await a.ctx.authorization?.[Y]();
2134
- if (w || q !== d) return;
2135
- if (!O || O.command !== "authorization" || O.schema_version !== 1 || !["ready", "authorization_required", "not_admin", "session_expired", "unavailable"].includes(O.state) || O.reason === "upgrade_reapproval" && O.state !== "authorization_required") throw Error("invalid status");
2136
- u.value = O, O.state === "ready" && $("ready");
2137
- } catch (O) {
2138
- !w && q === d && (u.value = O.code === "session_required" ? { command: "authorization", schema_version: 1, state: "session_expired", reason: "session_expired" } : r.value || { command: "authorization", schema_version: 1, state: "unavailable", reason: "service_unavailable" }, i.value = !0);
2200
+ const Z = await ae(z);
2201
+ if (d || G !== p) return;
2202
+ i.value = Z, u.value = Z.state !== "ready", Z.state === "ready" && E(!0), Z.state === "ready" && m("ready");
2203
+ } catch (Z) {
2204
+ !d && G === p && (i.value = Z.code === "session_required" ? { command: "authorization", schema_version: 1, state: "session_expired", reason: "session_expired" } : r.value || { command: "authorization", schema_version: 1, state: "unavailable", reason: "service_unavailable" }, o.value = !0, u.value = !0);
2139
2205
  } finally {
2140
- !w && q === d && (n.value = !1, r.value = void 0, k && (k = !1, K("status")));
2206
+ !d && G === p && (n.value = !1, r.value = void 0, V && (V = !1, Q("status")));
2141
2207
  }
2142
2208
  }
2143
- return ie(() => {
2144
- E = a.ctx.reopen(() => {
2145
- n.value ? k = !0 : K("status");
2146
- }), K("status");
2147
- }), ze(() => {
2148
- w = !0, d++, typeof E == "function" && E();
2149
- }), (Y, q) => (t(), C(j, null, [
2150
- g("p", Hl, l(n.value ? m.value("authorizing") : W.value), 1),
2151
- U.value ? (t(), C("div", Wl, [
2152
- g("div", Yl, [
2153
- b(e(he), {
2154
- size: 16,
2155
- "aria-hidden": "true"
2156
- }),
2157
- g("span", null, l(m.value("ready")), 1),
2158
- f.ctx.authorization?.canManage?.() ? (t(), h(e(z), {
2209
+ function E(z) {
2210
+ const G = x;
2211
+ x = [], G.forEach((Z) => Z(z));
2212
+ }
2213
+ function B(z) {
2214
+ u.value = z, z || E(!1);
2215
+ }
2216
+ function _() {
2217
+ return i.value?.state === "ready" ? Promise.resolve(!0) : (n.value || (u.value = !0), new Promise((z) => x.push(z)));
2218
+ }
2219
+ return ta(Ke, { state: N(() => i.value?.state ?? "checking"), requireAuthorization: _, text: f, busy: n, canManage: () => !!a.ctx.authorization?.canManage?.(), revoke: () => Q("revoke") }), fe(() => {
2220
+ C = a.ctx.reopen(() => {
2221
+ n.value ? V = !0 : Q("status");
2222
+ }), Q("status");
2223
+ }), Le(() => {
2224
+ d = !0, p++, E(!1), typeof C == "function" && C();
2225
+ }), (z, G) => (t(), $(te, null, [
2226
+ h("div", vt, [
2227
+ Ve(z.$slots, "default", {}, void 0, !0)
2228
+ ]),
2229
+ y(e(Pe), {
2230
+ open: u.value,
2231
+ title: j.value,
2232
+ width: "480px",
2233
+ "onUpdate:open": B
2234
+ }, {
2235
+ footer: s(() => [
2236
+ T.value ? (t(), w(e(A), {
2159
2237
  key: 0,
2160
- variant: "secondary",
2238
+ variant: "primary",
2239
+ loading: n.value,
2161
2240
  disabled: n.value,
2162
- onClick: q[2] || (q[2] = (O) => o.value = !0)
2241
+ onClick: G[0] || (G[0] = (Z) => Q("request"))
2163
2242
  }, {
2164
2243
  default: s(() => [
2165
- p(l(m.value("revoke")), 1)
2244
+ k(l(n.value ? f.value("authorizing") : f.value("authorize")), 1)
2166
2245
  ]),
2167
2246
  _: 1
2168
- }, 8, ["disabled"])) : y("", !0)
2169
- ]),
2170
- ke(Y.$slots, "default", {}, void 0, !0)
2171
- ])) : (t(), C("div", {
2172
- key: 0,
2173
- class: "authorization-view",
2174
- "aria-busy": n.value,
2175
- "data-authorization-state": u.value?.state || "checking"
2176
- }, [
2177
- b(e(aa), {
2178
- class: "authorization-card",
2179
- padding: "lg",
2180
- raised: "",
2181
- "aria-label": W.value
2182
- }, {
2183
- default: s(() => [
2184
- g("span", Jl, [
2185
- (t(), h(Je(S.value?.state === "unavailable" || S.value?.state === "session_expired" ? e(sa) : e(he)), { class: "authorization-icon-glyph" }))
2247
+ }, 8, ["loading", "disabled"])) : (t(), w(e(A), {
2248
+ key: 1,
2249
+ variant: "primary",
2250
+ loading: n.value,
2251
+ disabled: n.value,
2252
+ onClick: G[1] || (G[1] = (Z) => Q("status"))
2253
+ }, {
2254
+ default: s(() => [
2255
+ k(l(n.value ? f.value("checking") : f.value("retry")), 1)
2186
2256
  ]),
2187
- g("h1", Xl, l(W.value), 1),
2188
- g("p", Gl, l(X.value), 1),
2189
- A.value ? (t(), h(e(Q), {
2257
+ _: 1
2258
+ }, 8, ["loading", "disabled"]))
2259
+ ]),
2260
+ default: s(() => [
2261
+ h("div", {
2262
+ class: "authorization-view",
2263
+ "aria-busy": n.value,
2264
+ "data-authorization-state": i.value?.state || "checking"
2265
+ }, [
2266
+ h("p", ft, l(Y.value), 1),
2267
+ R.value ? (t(), w(e(W), {
2190
2268
  key: 0,
2191
2269
  class: "authorization-status",
2192
2270
  tone: ["grant_missing", "upgrade_reapproval"].includes(L.value) ? "info" : "warning",
2193
- title: m.value("reason." + L.value)
2271
+ title: f.value("reason." + L.value)
2194
2272
  }, {
2195
2273
  default: s(() => [
2196
- p(l(m.value(J.value)), 1)
2274
+ k(l(f.value(X.value)), 1)
2197
2275
  ]),
2198
2276
  _: 1
2199
- }, 8, ["tone", "title"])) : y("", !0),
2200
- i.value ? (t(), h(e(Q), {
2277
+ }, 8, ["tone", "title"])) : b("", !0),
2278
+ o.value ? (t(), w(e(W), {
2201
2279
  key: 1,
2202
2280
  class: "authorization-failed",
2203
2281
  tone: "warning"
2204
2282
  }, {
2205
2283
  default: s(() => [
2206
- p(l(m.value("failed")), 1)
2284
+ k(l(f.value("failed")), 1)
2207
2285
  ]),
2208
2286
  _: 1
2209
- })) : y("", !0),
2210
- g("div", Ql, [
2211
- V.value ? (t(), h(e(z), {
2212
- key: 0,
2213
- variant: "primary",
2214
- loading: n.value,
2215
- disabled: n.value,
2216
- onClick: q[0] || (q[0] = (O) => K("request"))
2217
- }, {
2218
- default: s(() => [
2219
- p(l(n.value ? m.value("authorizing") : m.value("authorize")), 1)
2220
- ]),
2221
- _: 1
2222
- }, 8, ["loading", "disabled"])) : (t(), h(e(z), {
2223
- key: 1,
2224
- variant: "primary",
2225
- loading: n.value,
2226
- disabled: n.value,
2227
- onClick: q[1] || (q[1] = (O) => K("status"))
2228
- }, {
2229
- default: s(() => [
2230
- p(l(n.value ? m.value("checking") : m.value("retry")), 1)
2287
+ })) : b("", !0)
2288
+ ], 8, ct)
2289
+ ]),
2290
+ _: 1
2291
+ }, 8, ["open", "title"])
2292
+ ], 64));
2293
+ }
2294
+ }), It = /* @__PURE__ */ oe(pt, [["__scopeId", "data-v-e16b5f7d"]]), yt = { class: "authorization-setting" }, mt = {
2295
+ class: "authorization-state",
2296
+ role: "status"
2297
+ }, bt = { class: "authorization-revoke-body" }, kt = /* @__PURE__ */ se({
2298
+ __name: "AuthorizationSettings",
2299
+ setup(c) {
2300
+ const { state: S, requireAuthorization: a, text: m, busy: i, canManage: r, revoke: n } = dt(), o = v(!1), u = { checking: "checking", ready: "ready", authorization_required: "state.required", not_admin: "not_admin.title", session_expired: "session_expired.title", unavailable: "state.unavailable" };
2301
+ return (x, d) => (t(), $(te, null, [
2302
+ y(e(pe), {
2303
+ title: e(m)("settings.title"),
2304
+ collapsible: !1
2305
+ }, {
2306
+ default: s(() => [
2307
+ y(e(fa), {
2308
+ label: e(m)("settings.status"),
2309
+ description: e(m)("purpose"),
2310
+ align: "center"
2311
+ }, {
2312
+ default: s(() => [
2313
+ h("div", yt, [
2314
+ h("span", mt, [
2315
+ e(S) === "ready" ? (t(), w(e(ga), {
2316
+ key: 0,
2317
+ size: 16,
2318
+ "aria-hidden": "true"
2319
+ })) : b("", !0),
2320
+ k(l(e(m)(u[e(S)])), 1)
2231
2321
  ]),
2232
- _: 1
2233
- }, 8, ["loading", "disabled"]))
2234
- ])
2235
- ]),
2236
- _: 1
2237
- }, 8, ["aria-label"])
2238
- ], 8, Kl)),
2239
- b(e(Ve), {
2322
+ e(S) === "ready" && e(r)() ? (t(), w(e(A), {
2323
+ key: 0,
2324
+ variant: "secondary",
2325
+ disabled: e(i),
2326
+ onClick: d[0] || (d[0] = (p) => o.value = !0)
2327
+ }, {
2328
+ default: s(() => [
2329
+ k(l(e(m)("revoke")), 1)
2330
+ ]),
2331
+ _: 1
2332
+ }, 8, ["disabled"])) : e(S) !== "ready" && e(S) !== "checking" ? (t(), w(e(A), {
2333
+ key: 1,
2334
+ variant: "secondary",
2335
+ onClick: d[1] || (d[1] = (p) => e(a)())
2336
+ }, {
2337
+ default: s(() => [
2338
+ k(l(e(m)("settings.details")), 1)
2339
+ ]),
2340
+ _: 1
2341
+ })) : b("", !0)
2342
+ ])
2343
+ ]),
2344
+ _: 1
2345
+ }, 8, ["label", "description"])
2346
+ ]),
2347
+ _: 1
2348
+ }, 8, ["title"]),
2349
+ y(e(Pe), {
2240
2350
  open: o.value,
2241
- "onUpdate:open": q[5] || (q[5] = (O) => o.value = O),
2242
- title: m.value("revoke.title"),
2243
- description: m.value("revoke.body")
2351
+ "onUpdate:open": d[4] || (d[4] = (p) => o.value = p),
2352
+ title: e(m)("revoke.title"),
2353
+ width: "480px"
2244
2354
  }, {
2245
2355
  footer: s(() => [
2246
- b(e(z), {
2356
+ y(e(A), {
2247
2357
  variant: "secondary",
2248
- onClick: q[3] || (q[3] = (O) => o.value = !1)
2358
+ onClick: d[2] || (d[2] = (p) => o.value = !1)
2249
2359
  }, {
2250
2360
  default: s(() => [
2251
- p(l(m.value("cancel")), 1)
2361
+ k(l(e(m)("cancel")), 1)
2252
2362
  ]),
2253
2363
  _: 1
2254
2364
  }),
2255
- b(e(z), {
2365
+ y(e(A), {
2256
2366
  variant: "danger",
2257
- disabled: n.value,
2258
- onClick: q[4] || (q[4] = (O) => {
2259
- o.value = !1, K("revoke");
2367
+ disabled: e(i),
2368
+ onClick: d[3] || (d[3] = (p) => {
2369
+ o.value = !1, e(n)();
2260
2370
  })
2261
2371
  }, {
2262
2372
  default: s(() => [
2263
- p(l(m.value("revoke")), 1)
2373
+ k(l(e(m)("revoke")), 1)
2264
2374
  ]),
2265
2375
  _: 1
2266
2376
  }, 8, ["disabled"])
2267
2377
  ]),
2378
+ default: s(() => [
2379
+ h("p", bt, l(e(m)("revoke.body")), 1)
2380
+ ]),
2268
2381
  _: 1
2269
- }, 8, ["open", "title", "description"])
2382
+ }, 8, ["open", "title"])
2270
2383
  ], 64));
2271
2384
  }
2272
- }), ct = /* @__PURE__ */ ue(Zl, [["__scopeId", "data-v-c8a34087"]]);
2385
+ }), At = /* @__PURE__ */ oe(kt, [["__scopeId", "data-v-f031e7c7"]]);
2273
2386
  export {
2274
- nt as AppShell,
2275
- ct as AuthorizationGate,
2276
- ot as BackgroundPanel,
2277
- vt as BackgroundSavePanel,
2278
- dt as DelegatePanel,
2279
- rt as ExecutorSettings,
2280
- ua as ExecutorSetupKey,
2281
- De as FileBrowser,
2282
- st as FilesPage,
2283
- it as LoginPage,
2284
- ye as NasPicker,
2285
- ut as PortalSettings,
2286
- yt as activePage,
2287
- mt as authorizationCatalogs,
2288
- Me as authorizationCopy,
2289
- bt as backgroundCatalogs,
2290
- Re as backgroundCopy,
2291
- Be as backgroundErrorCopy,
2292
- kt as catalogs,
2293
- Le as createBackgroundPickerProvider,
2294
- _t as createBackgroundSaveFacade,
2295
- gt as createFileTransfers,
2296
- $e as createNasProvider,
2297
- tt as createSession,
2298
- ht as decodeResponse,
2299
- wt as delegateCatalogs,
2300
- xe as delegateCopy,
2301
- Ct as encodeRequest,
2302
- Fe as errorCopy,
2303
- ve as format,
2304
- $t as identityCatalogs,
2305
- qe as identityCopy,
2306
- xt as nasCatalogs,
2307
- oe as nasCopy,
2308
- we as nasErrorCopy,
2309
- St as protocolCodes,
2310
- zt as protocolOps,
2311
- Vt as protocolSchemas,
2312
- _e as requestKey,
2313
- Ut as saveCatalogs,
2314
- Ce as saveCopy,
2315
- be as saveError,
2316
- Ne as scopedPicker,
2317
- Pt as shellCatalogs,
2318
- Oe as shellCopy,
2319
- Dt as shellPages,
2320
- At as uiLocale,
2321
- Et as uiLocales,
2322
- ia as useExecutorSetup,
2323
- oa as useNasRequest
2387
+ $t as AppShell,
2388
+ It as AuthorizationGate,
2389
+ At as AuthorizationSettings,
2390
+ Vt as BackgroundPanel,
2391
+ Dt as BackgroundSavePanel,
2392
+ Ut as DelegatePanel,
2393
+ Pt as ExecutorSettings,
2394
+ wa as ExecutorSetupKey,
2395
+ Me as FileBrowser,
2396
+ xt as FilesPage,
2397
+ zt as LoginPage,
2398
+ we as NasPicker,
2399
+ St as PortalSettings,
2400
+ Tt as activePage,
2401
+ qt as authorizationCatalogs,
2402
+ ea as authorizationCopy,
2403
+ Ot as backgroundCatalogs,
2404
+ Qe as backgroundCopy,
2405
+ We as backgroundErrorCopy,
2406
+ Bt as catalogs,
2407
+ Ye as createBackgroundPickerProvider,
2408
+ Lt as createBackgroundSaveFacade,
2409
+ Ft as createFileTransfers,
2410
+ Te as createNasProvider,
2411
+ Ct as createSession,
2412
+ Nt as decodeResponse,
2413
+ Mt as delegateCatalogs,
2414
+ qe as delegateCopy,
2415
+ Kt as encodeRequest,
2416
+ Ze as errorCopy,
2417
+ Ue as format,
2418
+ Ht as identityCatalogs,
2419
+ Xe as identityCopy,
2420
+ Gt as nasCatalogs,
2421
+ ve as nasCopy,
2422
+ Ee as nasErrorCopy,
2423
+ Jt as protocolCodes,
2424
+ Xt as protocolOps,
2425
+ Qt as protocolSchemas,
2426
+ De as requestKey,
2427
+ Yt as saveCatalogs,
2428
+ Re as saveCopy,
2429
+ ze as saveError,
2430
+ je as scopedPicker,
2431
+ Wt as shellCatalogs,
2432
+ Ge as shellCopy,
2433
+ Zt as shellPages,
2434
+ Je as uiLocale,
2435
+ jt as uiLocales,
2436
+ dt as useAuthorization,
2437
+ Ca as useExecutorSetup,
2438
+ $a as useNasRequest
2324
2439
  };