@sito/dashboard-app 0.0.56 → 0.0.58
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.
- package/README.md +6 -4
- package/dist/dashboard-app.cjs +1 -1
- package/dist/dashboard-app.js +475 -466
- package/dist/hooks/dialogs/types.d.ts +7 -5
- package/dist/main.css +1 -1
- package/dist/providers/Auth/authContext.d.ts +1 -0
- package/package.json +1 -1
package/dist/dashboard-app.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
var Ye = Object.defineProperty;
|
|
2
2
|
var Xe = (r, e, s) => e in r ? Ye(r, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[e] = s;
|
|
3
|
-
var
|
|
3
|
+
var A = (r, e, s) => Xe(r, typeof e != "symbol" ? e + "" : e, s);
|
|
4
4
|
import "./main.css";
|
|
5
5
|
import { State as Ze, inputStateClassName as et, labelStateClassName as tt, helperTextStateClassName as st, useTranslation as k, Button as H, Loading as re, TextInput as rt, FileInput as nt, IconButton as ot, Actions as it, ActionsDropdown as at, useTableOptions as ct, Badge as lt, Action as ut } from "@sito/dashboard";
|
|
6
6
|
export * from "@sito/dashboard";
|
|
7
|
-
import { Action as
|
|
8
|
-
import { jsxs as
|
|
7
|
+
import { Action as pr, Actions as gr, ActionsDropdown as br, Button as yr } from "@sito/dashboard";
|
|
8
|
+
import { jsxs as E, jsx as h, Fragment as ae } from "react/jsx-runtime";
|
|
9
9
|
import { FontAwesomeIcon as q } from "@fortawesome/react-fontawesome";
|
|
10
|
-
import { forwardRef as
|
|
11
|
-
import { faEyeSlash as mt, faEye as ht, faClose as De, faTrash as ft, faRotateLeft as Le, faPencil as pt, faCircleNotch as Re, faCloudArrowDown as gt, faCloudUpload as bt, faArrowUp as yt, faArrowLeft as wt, faAdd as ve, faFilter as St, faBars as
|
|
10
|
+
import { forwardRef as xe, useState as R, useCallback as S, useEffect as M, useReducer as $e, useRef as F, useMemo as V, createContext as X, useContext as Y, useLayoutEffect as dt } from "react";
|
|
11
|
+
import { faEyeSlash as mt, faEye as ht, faClose as De, faTrash as ft, faRotateLeft as Le, faPencil as pt, faCircleNotch as Re, faCloudArrowDown as gt, faCloudUpload as bt, faArrowUp as yt, faArrowLeft as wt, faAdd as ve, faFilter as St, faBars as Tt, faSearch as Ct, faCircleCheck as vt, faWarning as Et } from "@fortawesome/free-solid-svg-icons";
|
|
12
12
|
import { createPortal as Ie } from "react-dom";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
13
|
+
import { faSadTear as kt } from "@fortawesome/free-regular-svg-icons";
|
|
14
|
+
import { QueryClient as Nt, QueryClientProvider as _e, useMutation as ne, useQueryClient as Z, useQuery as At } from "@tanstack/react-query";
|
|
15
15
|
import { useForm as Pe } from "react-hook-form";
|
|
16
|
-
const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs =
|
|
16
|
+
const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = xe(function(r, e) {
|
|
17
17
|
const {
|
|
18
18
|
value: s,
|
|
19
19
|
defaultValue: t,
|
|
@@ -29,29 +29,29 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
|
|
|
29
29
|
labelClassName: f = "",
|
|
30
30
|
helperText: p = "",
|
|
31
31
|
helperTextClassName: b = "",
|
|
32
|
-
...
|
|
33
|
-
} = r,
|
|
32
|
+
...y
|
|
33
|
+
} = r, g = s !== void 0, [T, w] = R(
|
|
34
34
|
() => Ee(t)
|
|
35
|
-
),
|
|
36
|
-
|
|
35
|
+
), v = g ? Ee(s) : T, N = (U) => {
|
|
36
|
+
g || w(U.currentTarget.value.length > 0), n == null || n(U);
|
|
37
37
|
};
|
|
38
|
-
return /* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ E("div", { className: `form-paragraph-container group ${d}`, children: [
|
|
39
39
|
/* @__PURE__ */ h(
|
|
40
40
|
"textarea",
|
|
41
41
|
{
|
|
42
42
|
ref: e,
|
|
43
43
|
name: i,
|
|
44
44
|
id: c,
|
|
45
|
-
className: `text-input text-area form-paragraph-textarea peer ${et(o)} ${
|
|
45
|
+
className: `text-input text-area form-paragraph-textarea peer ${et(o)} ${v ? "has-value" : ""} ${y.placeholder ? "has-placeholder" : ""} ${m}`,
|
|
46
46
|
required: u,
|
|
47
47
|
defaultValue: t,
|
|
48
|
-
...
|
|
49
|
-
onChange:
|
|
48
|
+
...g ? { value: s } : {},
|
|
49
|
+
onChange: N,
|
|
50
50
|
disabled: l,
|
|
51
|
-
...
|
|
51
|
+
...y
|
|
52
52
|
}
|
|
53
53
|
),
|
|
54
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ E(
|
|
55
55
|
"label",
|
|
56
56
|
{
|
|
57
57
|
htmlFor: c,
|
|
@@ -79,10 +79,10 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
|
|
|
79
79
|
buttonEnd: i = !0,
|
|
80
80
|
reset: c
|
|
81
81
|
} = r;
|
|
82
|
-
return /* @__PURE__ */
|
|
82
|
+
return /* @__PURE__ */ E("form", { className: "form-container", onSubmit: t(n), children: [
|
|
83
83
|
s,
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ E("div", { className: `form-actions ${i ? "end" : ""}`, children: [
|
|
85
|
+
/* @__PURE__ */ E(
|
|
86
86
|
H,
|
|
87
87
|
{
|
|
88
88
|
type: "submit",
|
|
@@ -117,7 +117,7 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
|
|
|
117
117
|
)
|
|
118
118
|
] })
|
|
119
119
|
] });
|
|
120
|
-
}, ks =
|
|
120
|
+
}, ks = xe(function(r, e) {
|
|
121
121
|
const { t: s } = k(), [t, n] = R(!1);
|
|
122
122
|
return /* @__PURE__ */ h(rt, { ...r, type: t ? "text" : "password", ref: e, children: /* @__PURE__ */ h(
|
|
123
123
|
z,
|
|
@@ -132,7 +132,7 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
|
|
|
132
132
|
icon: t ? mt : ht
|
|
133
133
|
}
|
|
134
134
|
) });
|
|
135
|
-
}),
|
|
135
|
+
}), ye = (r) => {
|
|
136
136
|
const { t: e } = k(), {
|
|
137
137
|
title: s,
|
|
138
138
|
children: t,
|
|
@@ -147,7 +147,7 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
|
|
|
147
147
|
},
|
|
148
148
|
[o, n]
|
|
149
149
|
);
|
|
150
|
-
|
|
150
|
+
M(() => (window.addEventListener("keydown", l), () => {
|
|
151
151
|
window.removeEventListener("keydown", l);
|
|
152
152
|
}), [l]);
|
|
153
153
|
const u = S(
|
|
@@ -156,7 +156,7 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
|
|
|
156
156
|
},
|
|
157
157
|
[n]
|
|
158
158
|
);
|
|
159
|
-
return
|
|
159
|
+
return M(() => {
|
|
160
160
|
const d = (m) => {
|
|
161
161
|
m ? document.body.style.overflow = "hidden" : document.body.style.overflow = "auto";
|
|
162
162
|
};
|
|
@@ -171,12 +171,12 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
|
|
|
171
171
|
"aria-hidden": !o,
|
|
172
172
|
onClick: u,
|
|
173
173
|
className: `dialog-backdrop animated ${o ? `opened ${a}` : "closed"} ${i}`,
|
|
174
|
-
children: /* @__PURE__ */
|
|
174
|
+
children: /* @__PURE__ */ E(
|
|
175
175
|
"div",
|
|
176
176
|
{
|
|
177
177
|
className: `dialog elevated animated ${o ? `opened ${a}` : "closed"} ${c}`,
|
|
178
178
|
children: [
|
|
179
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ E("div", { className: "dialog-header", children: [
|
|
180
180
|
/* @__PURE__ */ h("h3", { className: "dialog-title", children: s }),
|
|
181
181
|
/* @__PURE__ */ h(
|
|
182
182
|
z,
|
|
@@ -201,7 +201,7 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
|
|
|
201
201
|
),
|
|
202
202
|
document.body
|
|
203
203
|
);
|
|
204
|
-
},
|
|
204
|
+
}, we = (r) => {
|
|
205
205
|
const {
|
|
206
206
|
primaryText: e,
|
|
207
207
|
cancelText: s,
|
|
@@ -219,12 +219,12 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
|
|
|
219
219
|
cancelAriaLabel: p,
|
|
220
220
|
extraActions: b = []
|
|
221
221
|
} = r;
|
|
222
|
-
return /* @__PURE__ */
|
|
222
|
+
return /* @__PURE__ */ E(
|
|
223
223
|
"div",
|
|
224
224
|
{
|
|
225
225
|
className: `dialog-actions ${u ? "end" : ""} ${a}`,
|
|
226
226
|
children: [
|
|
227
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ E(
|
|
228
228
|
H,
|
|
229
229
|
{
|
|
230
230
|
type: c,
|
|
@@ -248,7 +248,7 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
|
|
|
248
248
|
]
|
|
249
249
|
}
|
|
250
250
|
),
|
|
251
|
-
b == null ? void 0 : b.map((
|
|
251
|
+
b == null ? void 0 : b.map((y) => /* @__PURE__ */ h(H, { ...y }, y.id)),
|
|
252
252
|
/* @__PURE__ */ h(
|
|
253
253
|
H,
|
|
254
254
|
{
|
|
@@ -275,10 +275,10 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
|
|
|
275
275
|
extraActions: a = [],
|
|
276
276
|
...l
|
|
277
277
|
} = r;
|
|
278
|
-
return /* @__PURE__ */ h(
|
|
278
|
+
return /* @__PURE__ */ h(ye, { ...l, handleClose: o, children: /* @__PURE__ */ E("form", { onSubmit: t(n), children: [
|
|
279
279
|
/* @__PURE__ */ h("div", { className: "form-container", children: s }),
|
|
280
280
|
/* @__PURE__ */ h(
|
|
281
|
-
|
|
281
|
+
we,
|
|
282
282
|
{
|
|
283
283
|
primaryType: "submit",
|
|
284
284
|
primaryText: e("_accessibility:buttons.submit"),
|
|
@@ -305,10 +305,10 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
|
|
|
305
305
|
extraActions: i = [],
|
|
306
306
|
...c
|
|
307
307
|
} = r;
|
|
308
|
-
return /* @__PURE__ */
|
|
308
|
+
return /* @__PURE__ */ E(ye, { ...c, handleClose: n, children: [
|
|
309
309
|
s,
|
|
310
310
|
/* @__PURE__ */ h(
|
|
311
|
-
|
|
311
|
+
we,
|
|
312
312
|
{
|
|
313
313
|
primaryText: e("_accessibility:buttons.ok"),
|
|
314
314
|
cancelText: e("_accessibility:buttons.cancel"),
|
|
@@ -327,15 +327,15 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
|
|
|
327
327
|
)
|
|
328
328
|
] });
|
|
329
329
|
};
|
|
330
|
-
function
|
|
330
|
+
function xt(r) {
|
|
331
331
|
const { message: e, className: s = "" } = r, { t } = k();
|
|
332
332
|
return /* @__PURE__ */ h("p", { className: `import-error-message ${s}`, children: e ?? t("_messages:errors.parseFile", {
|
|
333
333
|
defaultValue: "Failed to process file"
|
|
334
334
|
}) });
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function $t(r) {
|
|
337
337
|
const { message: e, className: s = "" } = r, { t } = k();
|
|
338
|
-
return /* @__PURE__ */
|
|
338
|
+
return /* @__PURE__ */ E("div", { className: `import-loading ${s}`, children: [
|
|
339
339
|
/* @__PURE__ */ h(re, { loaderClass: "w-5 h-5", className: "!w-auto" }),
|
|
340
340
|
/* @__PURE__ */ h("span", { children: e ?? t("_messages:loading.processingFile", {
|
|
341
341
|
defaultValue: "Processing file..."
|
|
@@ -346,7 +346,7 @@ function Dt(r) {
|
|
|
346
346
|
const { items: e, max: s = 5, className: t = "" } = r, { t: n } = k();
|
|
347
347
|
if (!e || e.length === 0) return null;
|
|
348
348
|
const o = e.slice(0, s);
|
|
349
|
-
return /* @__PURE__ */
|
|
349
|
+
return /* @__PURE__ */ E("div", { className: `import-preview ${t}`, children: [
|
|
350
350
|
/* @__PURE__ */ h("p", { className: "import-preview-count", children: n("_pages:common.actions.import.previewCount", {
|
|
351
351
|
count: e.length,
|
|
352
352
|
defaultValue: `Preview: ${e.length} items`
|
|
@@ -354,7 +354,7 @@ function Dt(r) {
|
|
|
354
354
|
/* @__PURE__ */ h("pre", { className: "import-preview-content", children: JSON.stringify(o, null, 2) })
|
|
355
355
|
] });
|
|
356
356
|
}
|
|
357
|
-
const
|
|
357
|
+
const Me = () => ({
|
|
358
358
|
file: null,
|
|
359
359
|
previewItems: null,
|
|
360
360
|
parseError: null,
|
|
@@ -391,10 +391,10 @@ function Lt(r, e) {
|
|
|
391
391
|
case "SET_OVERRIDE":
|
|
392
392
|
return { ...r, overrideExisting: e.value };
|
|
393
393
|
case "RESET":
|
|
394
|
-
return { ...
|
|
394
|
+
return { ...Me(), inputKey: r.inputKey + 1 };
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
|
-
const
|
|
397
|
+
const xs = (r) => {
|
|
398
398
|
const { t: e } = k(), {
|
|
399
399
|
children: s,
|
|
400
400
|
handleSubmit: t,
|
|
@@ -407,32 +407,32 @@ const $s = (r) => {
|
|
|
407
407
|
open: u,
|
|
408
408
|
extraActions: d = [],
|
|
409
409
|
...m
|
|
410
|
-
} = r, [f, p] =
|
|
410
|
+
} = r, [f, p] = $e(
|
|
411
411
|
Lt,
|
|
412
|
-
|
|
412
|
+
Me()
|
|
413
413
|
), {
|
|
414
414
|
file: b,
|
|
415
|
-
previewItems:
|
|
416
|
-
parseError:
|
|
417
|
-
processing:
|
|
415
|
+
previewItems: y,
|
|
416
|
+
parseError: g,
|
|
417
|
+
processing: T,
|
|
418
418
|
overrideExisting: w,
|
|
419
|
-
inputKey:
|
|
420
|
-
} = f,
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
}, [c]),
|
|
419
|
+
inputKey: v
|
|
420
|
+
} = f, N = F(c), U = F(i);
|
|
421
|
+
M(() => {
|
|
422
|
+
N.current = c;
|
|
423
|
+
}, [c]), M(() => {
|
|
424
424
|
U.current = i;
|
|
425
|
-
}, [i]),
|
|
425
|
+
}, [i]), M(() => {
|
|
426
426
|
u || p({ type: "RESET" });
|
|
427
427
|
}, [u]);
|
|
428
428
|
const B = S(
|
|
429
|
-
async (
|
|
430
|
-
var
|
|
429
|
+
async (C, D) => {
|
|
430
|
+
var L;
|
|
431
431
|
if (U.current) {
|
|
432
432
|
p({ type: "START_PROCESSING" });
|
|
433
433
|
try {
|
|
434
|
-
const _ = await U.current(
|
|
435
|
-
p({ type: "SET_PREVIEW", items: _ ?? [] }), (
|
|
434
|
+
const _ = await U.current(C, { override: D });
|
|
435
|
+
p({ type: "SET_PREVIEW", items: _ ?? [] }), (L = N.current) == null || L.call(N, _ ?? []);
|
|
436
436
|
} catch (_) {
|
|
437
437
|
console.error(_);
|
|
438
438
|
const K = _ instanceof Error ? _.message : "Failed to parse file";
|
|
@@ -442,36 +442,36 @@ const $s = (r) => {
|
|
|
442
442
|
},
|
|
443
443
|
[]
|
|
444
444
|
);
|
|
445
|
-
return /* @__PURE__ */
|
|
445
|
+
return /* @__PURE__ */ E(ye, { ...m, open: u, handleClose: n, children: [
|
|
446
446
|
/* @__PURE__ */ h(
|
|
447
447
|
nt,
|
|
448
448
|
{
|
|
449
449
|
onClear: () => {
|
|
450
|
-
var
|
|
451
|
-
p({ type: "SET_FILE", file: null }), (
|
|
450
|
+
var C;
|
|
451
|
+
p({ type: "SET_FILE", file: null }), (C = N.current) == null || C.call(N, []);
|
|
452
452
|
},
|
|
453
|
-
onChange: (
|
|
454
|
-
var
|
|
455
|
-
const
|
|
456
|
-
if (
|
|
457
|
-
p({ type: "SET_FILE", file: null }), (_ =
|
|
453
|
+
onChange: (C) => {
|
|
454
|
+
var L, _;
|
|
455
|
+
const D = (L = C.target.files) == null ? void 0 : L[0];
|
|
456
|
+
if (!D) {
|
|
457
|
+
p({ type: "SET_FILE", file: null }), (_ = N.current) == null || _.call(N, []);
|
|
458
458
|
return;
|
|
459
459
|
}
|
|
460
|
-
p({ type: "SET_FILE", file:
|
|
460
|
+
p({ type: "SET_FILE", file: D }), B(D, w);
|
|
461
461
|
},
|
|
462
462
|
label: e("_accessibility:labels.file")
|
|
463
463
|
},
|
|
464
|
-
|
|
464
|
+
v
|
|
465
465
|
),
|
|
466
|
-
/* @__PURE__ */
|
|
466
|
+
/* @__PURE__ */ E("label", { className: "import-override-label", children: [
|
|
467
467
|
/* @__PURE__ */ h(
|
|
468
468
|
"input",
|
|
469
469
|
{
|
|
470
470
|
type: "checkbox",
|
|
471
471
|
checked: w,
|
|
472
|
-
onChange: (
|
|
473
|
-
const
|
|
474
|
-
p({ type: "SET_OVERRIDE", value:
|
|
472
|
+
onChange: (C) => {
|
|
473
|
+
const D = C.target.checked;
|
|
474
|
+
p({ type: "SET_OVERRIDE", value: D }), l == null || l(D), b && B(b, D);
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
477
|
),
|
|
@@ -479,17 +479,17 @@ const $s = (r) => {
|
|
|
479
479
|
defaultValue: "Override existing items"
|
|
480
480
|
}) })
|
|
481
481
|
] }),
|
|
482
|
-
/* @__PURE__ */ h(
|
|
483
|
-
|
|
484
|
-
a ? a(
|
|
482
|
+
/* @__PURE__ */ h(xt, { message: g }),
|
|
483
|
+
T && /* @__PURE__ */ h($t, {}),
|
|
484
|
+
a ? a(y) : !!y && y.length > 0 && /* @__PURE__ */ h(Dt, { items: y }),
|
|
485
485
|
s,
|
|
486
486
|
/* @__PURE__ */ h(
|
|
487
|
-
|
|
487
|
+
we,
|
|
488
488
|
{
|
|
489
489
|
primaryText: e("_accessibility:buttons.ok"),
|
|
490
490
|
cancelText: e("_accessibility:buttons.cancel"),
|
|
491
491
|
onPrimaryClick: () => {
|
|
492
|
-
(!i || !!
|
|
492
|
+
(!i || !!y && y.length > 0) && t();
|
|
493
493
|
},
|
|
494
494
|
onCancel: n,
|
|
495
495
|
isLoading: o,
|
|
@@ -504,9 +504,9 @@ const $s = (r) => {
|
|
|
504
504
|
)
|
|
505
505
|
] });
|
|
506
506
|
};
|
|
507
|
-
var
|
|
507
|
+
var O = /* @__PURE__ */ ((r) => (r[r.success = 0] = "success", r[r.error = 1] = "error", r[r.warning = 2] = "warning", r[r.info = 3] = "info", r))(O || {}), P = /* @__PURE__ */ ((r) => (r.GET = "GET", r.POST = "POST", r.PUT = "PUT", r.PATCH = "PATCH", r.DELETE = "DELETE", r))(P || {});
|
|
508
508
|
const Rt = (r) => Array.isArray(r) || r instanceof Headers ? !1 : typeof r == "object" && r !== null && ("headers" in r || "credentials" in r), It = (r) => r ? Rt(r) ? r : { headers: r } : {}, _t = (r) => r ? r instanceof Headers ? Object.fromEntries(r.entries()) : Array.isArray(r) ? Object.fromEntries(r) : r : {};
|
|
509
|
-
async function
|
|
509
|
+
async function he(r, e = "GET", s, t) {
|
|
510
510
|
const n = It(t), o = {
|
|
511
511
|
...s !== void 0 ? { "Content-Type": "application/json" } : {},
|
|
512
512
|
..._t(n.headers)
|
|
@@ -561,30 +561,30 @@ function Pt(r, e) {
|
|
|
561
561
|
}
|
|
562
562
|
return r;
|
|
563
563
|
}
|
|
564
|
-
const
|
|
564
|
+
const fe = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Date ? encodeURIComponent(r.toISOString()) : encodeURIComponent(String(r)), Mt = (r) => {
|
|
565
565
|
if (typeof r != "string") return;
|
|
566
566
|
const e = r.trim().toUpperCase();
|
|
567
567
|
if (e === "ACTIVE" || e === "DELETED" || e === "ALL")
|
|
568
568
|
return e;
|
|
569
|
-
},
|
|
569
|
+
}, Oe = (r, e, s) => {
|
|
570
570
|
const t = [];
|
|
571
571
|
if (e) {
|
|
572
572
|
const { sortingBy: n, sortingOrder: o, currentPage: i, pageSize: c } = e;
|
|
573
573
|
n !== void 0 && t.push(`sort=${String(n)}`), o !== void 0 && t.push(`order=${o}`), i !== void 0 && t.push(`page=${i}`), c !== void 0 && t.push(`pageSize=${c}`);
|
|
574
574
|
}
|
|
575
575
|
if (s) {
|
|
576
|
-
const n =
|
|
576
|
+
const n = Mt(s.softDeleteScope);
|
|
577
577
|
n && t.push(`softDeleteScope=${encodeURIComponent(n)}`);
|
|
578
578
|
const o = Object.entries(s).filter(
|
|
579
579
|
([i, c]) => i !== "softDeleteScope" && c !== null && c !== void 0 && c !== ""
|
|
580
580
|
).flatMap(([i, c]) => {
|
|
581
581
|
if (Array.isArray(c))
|
|
582
|
-
return c.map((a) => a instanceof Date ? `${i}==${W(a)}` :
|
|
583
|
-
if (
|
|
582
|
+
return c.map((a) => a instanceof Date ? `${i}==${W(a)}` : fe(a) ? `${i}==${W(a.id ?? "")}` : `${i}==${W(a)}`);
|
|
583
|
+
if (fe(c) && "start" in c && "end" in c) {
|
|
584
584
|
const a = [];
|
|
585
585
|
return c.start != null && c.start !== "" && a.push(`${i}>=${W(c.start)}`), c.end != null && c.end !== "" && a.push(`${i}<=${W(c.end)}`), a;
|
|
586
586
|
}
|
|
587
|
-
return c instanceof Date ? `${i}==${W(c)}` :
|
|
587
|
+
return c instanceof Date ? `${i}==${W(c)}` : fe(c) ? `${i}==${W(c.id ?? "")}` : `${i}==${W(c)}`;
|
|
588
588
|
});
|
|
589
589
|
o.length > 0 && t.push(`filters=${o.join(",")}`);
|
|
590
590
|
}
|
|
@@ -597,15 +597,15 @@ const he = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
|
|
|
597
597
|
* @param tokenAcquirer custom token acquirer
|
|
598
598
|
*/
|
|
599
599
|
constructor(e, s = "user", t = !0, n, o = {}) {
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
600
|
+
A(this, "baseUrl");
|
|
601
|
+
A(this, "userKey");
|
|
602
|
+
A(this, "rememberKey");
|
|
603
|
+
A(this, "refreshTokenKey");
|
|
604
|
+
A(this, "accessTokenExpiresAtKey");
|
|
605
|
+
A(this, "refreshEndpoint");
|
|
606
|
+
A(this, "refreshExpirySkewMs");
|
|
607
|
+
A(this, "secured");
|
|
608
|
+
A(this, "tokenAcquirer");
|
|
609
609
|
this.baseUrl = e, this.secured = t, this.userKey = s, this.rememberKey = o.rememberKey ?? "remember", this.refreshTokenKey = o.refreshTokenKey ?? "refreshToken", this.accessTokenExpiresAtKey = o.accessTokenExpiresAtKey ?? "accessTokenExpiresAt", this.refreshEndpoint = o.refreshEndpoint ?? "auth/refresh", this.refreshExpirySkewMs = o.refreshExpirySkewMs ?? 5e3, this.tokenAcquirer = n ?? this.defaultTokenAcquirer;
|
|
610
610
|
}
|
|
611
611
|
defaultTokenAcquirer(e) {
|
|
@@ -660,7 +660,7 @@ const he = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
|
|
|
660
660
|
return;
|
|
661
661
|
}
|
|
662
662
|
const n = (async () => {
|
|
663
|
-
const { data: o, status: i, error: c } = await
|
|
663
|
+
const { data: o, status: i, error: c } = await he(
|
|
664
664
|
this.buildUrl(this.refreshEndpoint),
|
|
665
665
|
P.POST,
|
|
666
666
|
{ refreshToken: e }
|
|
@@ -699,13 +699,13 @@ const he = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
|
|
|
699
699
|
}
|
|
700
700
|
async makeRequestWithRefresh(e, s, t, n) {
|
|
701
701
|
this.secured && this.shouldRefreshBeforeRequest() && await this.refreshAccessTokenWithMutex();
|
|
702
|
-
let o = await
|
|
702
|
+
let o = await he(
|
|
703
703
|
this.buildUrl(e),
|
|
704
704
|
s,
|
|
705
705
|
t,
|
|
706
706
|
this.mergeRequestConfig(n)
|
|
707
707
|
);
|
|
708
|
-
return this.secured && o.status === 401 && this.canRefresh() && (await this.refreshAccessTokenWithMutex(), o = await
|
|
708
|
+
return this.secured && o.status === 401 && this.canRefresh() && (await this.refreshAccessTokenWithMutex(), o = await he(
|
|
709
709
|
this.buildUrl(e),
|
|
710
710
|
s,
|
|
711
711
|
t,
|
|
@@ -737,7 +737,7 @@ const he = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
|
|
|
737
737
|
* @returns Result list
|
|
738
738
|
*/
|
|
739
739
|
async get(e, s, t) {
|
|
740
|
-
const n =
|
|
740
|
+
const n = Oe(e, s, t), {
|
|
741
741
|
data: o,
|
|
742
742
|
error: i,
|
|
743
743
|
status: c
|
|
@@ -821,11 +821,11 @@ const he = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
|
|
|
821
821
|
return n;
|
|
822
822
|
}
|
|
823
823
|
};
|
|
824
|
-
|
|
824
|
+
A(se, "refreshInFlight", /* @__PURE__ */ new Map());
|
|
825
825
|
let de = se;
|
|
826
|
-
class
|
|
826
|
+
class Ot {
|
|
827
827
|
constructor(e, s = "user", t = {}) {
|
|
828
|
-
|
|
828
|
+
A(this, "api");
|
|
829
829
|
this.api = new de(e, s, !1, void 0, t);
|
|
830
830
|
}
|
|
831
831
|
async login(e) {
|
|
@@ -870,10 +870,10 @@ class Mt {
|
|
|
870
870
|
);
|
|
871
871
|
}
|
|
872
872
|
}
|
|
873
|
-
class
|
|
873
|
+
class $s {
|
|
874
874
|
constructor(e, s, t = {}) {
|
|
875
|
-
|
|
876
|
-
this.auth = new
|
|
875
|
+
A(this, "auth");
|
|
876
|
+
this.auth = new Ot(e, s, t);
|
|
877
877
|
}
|
|
878
878
|
/**
|
|
879
879
|
* @returns auth
|
|
@@ -889,9 +889,9 @@ class Ds {
|
|
|
889
889
|
* @param secured to see if the api client requires jwt protection
|
|
890
890
|
*/
|
|
891
891
|
constructor(e, s, t = "user", n = !0, o = {}) {
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
892
|
+
A(this, "table");
|
|
893
|
+
A(this, "secured");
|
|
894
|
+
A(this, "api");
|
|
895
895
|
this.table = e, this.secured = n, this.api = new de(s, t, n, void 0, o);
|
|
896
896
|
}
|
|
897
897
|
/**
|
|
@@ -940,7 +940,7 @@ class Ds {
|
|
|
940
940
|
* @returns - List of elements
|
|
941
941
|
*/
|
|
942
942
|
async export(e) {
|
|
943
|
-
const s =
|
|
943
|
+
const s = Oe(
|
|
944
944
|
`${this.table}/export`,
|
|
945
945
|
void 0,
|
|
946
946
|
e
|
|
@@ -987,10 +987,10 @@ class Ds {
|
|
|
987
987
|
}
|
|
988
988
|
class Ls {
|
|
989
989
|
constructor(e, s, t = 1) {
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
990
|
+
A(this, "table");
|
|
991
|
+
A(this, "dbName");
|
|
992
|
+
A(this, "version");
|
|
993
|
+
A(this, "db", null);
|
|
994
994
|
this.table = e, this.dbName = s, this.version = t;
|
|
995
995
|
}
|
|
996
996
|
close() {
|
|
@@ -1044,8 +1044,8 @@ class Ls {
|
|
|
1044
1044
|
var f;
|
|
1045
1045
|
const t = await this.transaction("readonly"), n = await this.request(t.getAll()), o = this.applyFilter(n, s), i = (e == null ? void 0 : e.sortingBy) ?? "id", c = ((f = e == null ? void 0 : e.sortingOrder) == null ? void 0 : f.toLowerCase()) ?? "asc";
|
|
1046
1046
|
o.sort((p, b) => {
|
|
1047
|
-
const
|
|
1048
|
-
return
|
|
1047
|
+
const y = p[i], g = b[i];
|
|
1048
|
+
return y < g ? c === "asc" ? -1 : 1 : y > g ? c === "asc" ? 1 : -1 : 0;
|
|
1049
1049
|
});
|
|
1050
1050
|
const a = (e == null ? void 0 : e.pageSize) ?? 10, l = (e == null ? void 0 : e.currentPage) ?? 0, u = o.length, d = Math.ceil(u / a), m = o.slice(
|
|
1051
1051
|
l * a,
|
|
@@ -1143,7 +1143,7 @@ class Ls {
|
|
|
1143
1143
|
return e === "DELETED" ? t : !t;
|
|
1144
1144
|
}
|
|
1145
1145
|
}
|
|
1146
|
-
const
|
|
1146
|
+
const be = (r) => typeof r == "object" && r !== null, Ft = (r) => be(r) ? "start" in r || "end" in r : !1, Ut = (r) => r !== void 0, ie = (r) => r instanceof Date ? r.toISOString() : r, Kt = (r) => {
|
|
1147
1147
|
if (typeof r != "string") return;
|
|
1148
1148
|
const e = r.trim().toUpperCase();
|
|
1149
1149
|
if (e === "ACTIVE") return "ACTIVE";
|
|
@@ -1152,12 +1152,12 @@ const ge = (r) => typeof r == "object" && r !== null, Ft = (r) => ge(r) ? "start
|
|
|
1152
1152
|
};
|
|
1153
1153
|
class Rs {
|
|
1154
1154
|
constructor(e, s, t = {}) {
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1155
|
+
A(this, "table");
|
|
1156
|
+
A(this, "supabase");
|
|
1157
|
+
A(this, "idColumn");
|
|
1158
|
+
A(this, "deletedAtColumn");
|
|
1159
|
+
A(this, "defaultSortColumn");
|
|
1160
|
+
A(this, "options");
|
|
1161
1161
|
this.table = e, this.supabase = s, this.options = t, this.idColumn = t.idColumn ?? "id", this.deletedAtColumn = t.deletedAtColumn ?? "deletedAt", this.defaultSortColumn = t.defaultSortColumn ?? this.idColumn;
|
|
1162
1162
|
}
|
|
1163
1163
|
resolveStatus(e) {
|
|
@@ -1199,7 +1199,7 @@ class Rs {
|
|
|
1199
1199
|
return;
|
|
1200
1200
|
const c = o === "deletedAt" ? this.deletedAtColumn : o;
|
|
1201
1201
|
if (Array.isArray(i)) {
|
|
1202
|
-
const a = i.map((l) => l instanceof Date ? l.toISOString() :
|
|
1202
|
+
const a = i.map((l) => l instanceof Date ? l.toISOString() : be(l) ? this.resolveObjectFilterValue(l) : ie(l)).filter(Ut);
|
|
1203
1203
|
a.length > 0 && (t = t.in(c, a));
|
|
1204
1204
|
return;
|
|
1205
1205
|
}
|
|
@@ -1217,7 +1217,7 @@ class Rs {
|
|
|
1217
1217
|
t = t.eq(c, i.toISOString());
|
|
1218
1218
|
return;
|
|
1219
1219
|
}
|
|
1220
|
-
if (
|
|
1220
|
+
if (be(i)) {
|
|
1221
1221
|
t = t.eq(
|
|
1222
1222
|
c,
|
|
1223
1223
|
this.resolveObjectFilterValue(i)
|
|
@@ -1456,7 +1456,7 @@ function Ps(r) {
|
|
|
1456
1456
|
const e = r ? new Date(r) : /* @__PURE__ */ new Date(), s = String(e.getDate()).padStart(2, "0"), t = String(e.getMonth() + 1).padStart(2, "0"), n = String(e.getFullYear()).slice(-2), o = String(e.getHours()).padStart(2, "0"), i = String(e.getMinutes()).padStart(2, "0");
|
|
1457
1457
|
return `${s}/${t}/${n} ${o}:${i}`;
|
|
1458
1458
|
}
|
|
1459
|
-
function
|
|
1459
|
+
function Ms(r) {
|
|
1460
1460
|
const e = r ? new Date(r) : /* @__PURE__ */ new Date(), s = e.getFullYear(), t = String(e.getMonth() + 1).padStart(2, "0"), n = String(e.getDate()).padStart(2, "0"), o = String(e.getHours()).padStart(2, "0"), i = String(e.getMinutes()).padStart(2, "0");
|
|
1461
1461
|
return `${s}-${t}-${n}T${o}:${i}`;
|
|
1462
1462
|
}
|
|
@@ -1465,33 +1465,33 @@ const Ht = () => {
|
|
|
1465
1465
|
const r = navigator, e = ((s = r == null ? void 0 : r.userAgentData) == null ? void 0 : s.platform) || (r == null ? void 0 : r.platform) || "";
|
|
1466
1466
|
return /Mac|iPhone|iPod|iPad/i.test(e);
|
|
1467
1467
|
};
|
|
1468
|
-
function
|
|
1468
|
+
function Se(r) {
|
|
1469
1469
|
if (!r || typeof r != "object") return !1;
|
|
1470
1470
|
const e = r;
|
|
1471
1471
|
return Array.isArray(e.errors) && e.errors.every(
|
|
1472
1472
|
(s) => Array.isArray(s) && s.length === 2 && typeof s[0] == "string"
|
|
1473
1473
|
);
|
|
1474
1474
|
}
|
|
1475
|
-
function
|
|
1475
|
+
function Te(r) {
|
|
1476
1476
|
if (!r || typeof r != "object") return !1;
|
|
1477
1477
|
const e = r;
|
|
1478
1478
|
return typeof (e == null ? void 0 : e.status) == "number" && typeof (e == null ? void 0 : e.message) == "string";
|
|
1479
1479
|
}
|
|
1480
|
-
function
|
|
1480
|
+
function Os(r, e) {
|
|
1481
1481
|
return r != null && r.errors ? r.errors.map(([s, t]) => e(s, t)) : [];
|
|
1482
1482
|
}
|
|
1483
|
-
const Fe =
|
|
1483
|
+
const Fe = X(
|
|
1484
1484
|
void 0
|
|
1485
1485
|
);
|
|
1486
1486
|
function Fs(r) {
|
|
1487
|
-
const { children: e } = r, s = F(0), [t, n] =
|
|
1487
|
+
const { children: e } = r, s = F(0), [t, n] = $e(
|
|
1488
1488
|
(m, f) => {
|
|
1489
|
-
const { type: p, items: b, id:
|
|
1489
|
+
const { type: p, items: b, id: y } = f;
|
|
1490
1490
|
switch (p) {
|
|
1491
1491
|
case "set":
|
|
1492
1492
|
return b ?? [];
|
|
1493
1493
|
case "remove":
|
|
1494
|
-
return
|
|
1494
|
+
return y !== void 0 ? m.filter((g) => g.id !== y) : [];
|
|
1495
1495
|
}
|
|
1496
1496
|
return m;
|
|
1497
1497
|
},
|
|
@@ -1500,7 +1500,7 @@ function Fs(r) {
|
|
|
1500
1500
|
), o = (m) => m.map((f) => ({ ...f, id: s.current++ })), i = S(
|
|
1501
1501
|
(m) => n({
|
|
1502
1502
|
type: "set",
|
|
1503
|
-
items: o([{ ...m, type:
|
|
1503
|
+
items: o([{ ...m, type: O.error }])
|
|
1504
1504
|
}),
|
|
1505
1505
|
[]
|
|
1506
1506
|
), c = S(
|
|
@@ -1512,7 +1512,7 @@ function Fs(r) {
|
|
|
1512
1512
|
), l = S(
|
|
1513
1513
|
(m) => n({
|
|
1514
1514
|
type: "set",
|
|
1515
|
-
items: o([{ ...m, type:
|
|
1515
|
+
items: o([{ ...m, type: O.success }])
|
|
1516
1516
|
}),
|
|
1517
1517
|
[]
|
|
1518
1518
|
), u = (m) => n({ type: "remove", id: m }), d = V(() => ({
|
|
@@ -1532,11 +1532,11 @@ function Fs(r) {
|
|
|
1532
1532
|
return /* @__PURE__ */ h(Fe.Provider, { value: d, children: e });
|
|
1533
1533
|
}
|
|
1534
1534
|
const oe = () => {
|
|
1535
|
-
const r =
|
|
1535
|
+
const r = Y(Fe);
|
|
1536
1536
|
if (!r)
|
|
1537
1537
|
throw new Error("NotificationContext must be used within a Provider");
|
|
1538
1538
|
return r;
|
|
1539
|
-
}, Ce = () => new
|
|
1539
|
+
}, Ce = () => new Nt({
|
|
1540
1540
|
defaultOptions: {
|
|
1541
1541
|
queries: {
|
|
1542
1542
|
refetchInterval: !1,
|
|
@@ -1548,23 +1548,23 @@ const oe = () => {
|
|
|
1548
1548
|
// default: true
|
|
1549
1549
|
}
|
|
1550
1550
|
}
|
|
1551
|
-
}), Us = Ce(), Ue =
|
|
1551
|
+
}), Us = Ce(), Ue = X(
|
|
1552
1552
|
void 0
|
|
1553
1553
|
), Ks = (r) => {
|
|
1554
1554
|
const { children: e, manager: s, queryClient: t } = r, [n] = R(Ce), o = t ?? n;
|
|
1555
1555
|
return /* @__PURE__ */ h(Ue.Provider, { value: { client: s }, children: /* @__PURE__ */ h(_e, { client: o, children: e }) });
|
|
1556
1556
|
}, Bt = () => {
|
|
1557
|
-
const r =
|
|
1557
|
+
const r = Y(Ue);
|
|
1558
1558
|
if (!r)
|
|
1559
1559
|
throw new Error("managerContext must be used within a Provider");
|
|
1560
1560
|
return r.client;
|
|
1561
|
-
},
|
|
1561
|
+
}, me = X(
|
|
1562
1562
|
void 0
|
|
1563
1563
|
), Vt = () => {
|
|
1564
|
-
const r =
|
|
1564
|
+
const r = Y(me);
|
|
1565
1565
|
if (!r) throw new Error("authContext must be used within a Provider");
|
|
1566
1566
|
return r;
|
|
1567
|
-
}, js = (r) => {
|
|
1567
|
+
}, Ke = () => Y(me), js = (r) => {
|
|
1568
1568
|
const {
|
|
1569
1569
|
children: e,
|
|
1570
1570
|
guestMode: s = "guest_mode",
|
|
@@ -1575,23 +1575,23 @@ const oe = () => {
|
|
|
1575
1575
|
} = r, c = Bt(), [a, l] = R({}), u = S(() => {
|
|
1576
1576
|
I(t), I(n), I(o), I(i);
|
|
1577
1577
|
}, [i, o, n, t]), d = S(() => !!G(s, "boolean") && a.token === void 0, [a.token, s]), m = S(
|
|
1578
|
-
(
|
|
1579
|
-
Q(s,
|
|
1578
|
+
(g) => {
|
|
1579
|
+
Q(s, g);
|
|
1580
1580
|
},
|
|
1581
1581
|
[s]
|
|
1582
1582
|
), f = S(
|
|
1583
|
-
(
|
|
1584
|
-
if (!
|
|
1585
|
-
const w = G(n, "boolean"),
|
|
1586
|
-
l(
|
|
1583
|
+
(g, T) => {
|
|
1584
|
+
if (!g) return;
|
|
1585
|
+
const w = G(n, "boolean"), v = T ?? (typeof w == "boolean" ? w : !1);
|
|
1586
|
+
l(g), I(s), Q(t, g.token), Q(n, v), typeof g.refreshToken == "string" && g.refreshToken.length ? Q(o, g.refreshToken) : I(o), typeof g.accessTokenExpiresAt == "string" && g.accessTokenExpiresAt.length ? Q(i, g.accessTokenExpiresAt) : I(i);
|
|
1587
1587
|
},
|
|
1588
1588
|
[i, s, o, n, t]
|
|
1589
1589
|
), p = S(async () => {
|
|
1590
|
-
const
|
|
1590
|
+
const g = G(t) ?? a.token, T = G(o) ?? (typeof a.refreshToken == "string" ? a.refreshToken : void 0);
|
|
1591
1591
|
try {
|
|
1592
1592
|
await c.Auth.logout({
|
|
1593
|
-
accessToken:
|
|
1594
|
-
refreshToken:
|
|
1593
|
+
accessToken: g,
|
|
1594
|
+
refreshToken: T
|
|
1595
1595
|
});
|
|
1596
1596
|
} catch (w) {
|
|
1597
1597
|
console.error(w);
|
|
@@ -1606,12 +1606,12 @@ const oe = () => {
|
|
|
1606
1606
|
t
|
|
1607
1607
|
]), b = S(async () => {
|
|
1608
1608
|
try {
|
|
1609
|
-
const
|
|
1610
|
-
f(
|
|
1611
|
-
} catch (
|
|
1612
|
-
console.error(
|
|
1609
|
+
const g = await c.Auth.getSession();
|
|
1610
|
+
f(g);
|
|
1611
|
+
} catch (g) {
|
|
1612
|
+
console.error(g), p();
|
|
1613
1613
|
}
|
|
1614
|
-
}, [f, p, c.Auth]),
|
|
1614
|
+
}, [f, p, c.Auth]), y = V(() => ({
|
|
1615
1615
|
account: a,
|
|
1616
1616
|
logUser: f,
|
|
1617
1617
|
logoutUser: p,
|
|
@@ -1626,13 +1626,13 @@ const oe = () => {
|
|
|
1626
1626
|
d,
|
|
1627
1627
|
m
|
|
1628
1628
|
]);
|
|
1629
|
-
return /* @__PURE__ */ h(
|
|
1630
|
-
},
|
|
1631
|
-
const r =
|
|
1629
|
+
return /* @__PURE__ */ h(me.Provider, { value: y, children: e });
|
|
1630
|
+
}, Qs = () => Vt(), je = X(void 0), Gt = () => {
|
|
1631
|
+
const r = Y(je);
|
|
1632
1632
|
if (!r)
|
|
1633
1633
|
throw new Error("supabaseManagerContext must be used within a Provider");
|
|
1634
1634
|
return r.client;
|
|
1635
|
-
},
|
|
1635
|
+
}, qs = (r) => {
|
|
1636
1636
|
const {
|
|
1637
1637
|
children: e,
|
|
1638
1638
|
guestMode: s = "guest_mode",
|
|
@@ -1642,7 +1642,7 @@ const oe = () => {
|
|
|
1642
1642
|
accessTokenExpiresAtKey: i = "accessTokenExpiresAt",
|
|
1643
1643
|
sessionMapper: c
|
|
1644
1644
|
} = r, a = Gt(), l = F(c ?? ke);
|
|
1645
|
-
|
|
1645
|
+
M(() => {
|
|
1646
1646
|
l.current = c ?? ke;
|
|
1647
1647
|
}, [c]);
|
|
1648
1648
|
const [u, d] = R({}), m = S(() => {
|
|
@@ -1653,38 +1653,38 @@ const oe = () => {
|
|
|
1653
1653
|
},
|
|
1654
1654
|
[s]
|
|
1655
1655
|
), b = S(
|
|
1656
|
-
(w,
|
|
1656
|
+
(w, v) => {
|
|
1657
1657
|
if (!w) return;
|
|
1658
|
-
const
|
|
1658
|
+
const N = G(n, "boolean"), U = v ?? (typeof N == "boolean" ? N : !1);
|
|
1659
1659
|
d(w), I(s), Q(t, w.token), Q(n, U), typeof w.refreshToken == "string" && w.refreshToken.length ? Q(o, w.refreshToken) : I(o), typeof w.accessTokenExpiresAt == "string" && w.accessTokenExpiresAt.length ? Q(i, w.accessTokenExpiresAt) : I(i);
|
|
1660
1660
|
},
|
|
1661
1661
|
[i, s, o, n, t]
|
|
1662
|
-
),
|
|
1662
|
+
), y = S(async () => {
|
|
1663
1663
|
try {
|
|
1664
1664
|
await a.auth.signOut();
|
|
1665
1665
|
} catch (w) {
|
|
1666
1666
|
console.error(w);
|
|
1667
1667
|
}
|
|
1668
1668
|
d({}), m();
|
|
1669
|
-
}, [m, a.auth]),
|
|
1669
|
+
}, [m, a.auth]), g = S(async () => {
|
|
1670
1670
|
try {
|
|
1671
|
-
const { data: w, error:
|
|
1672
|
-
if (
|
|
1671
|
+
const { data: w, error: v } = await a.auth.getSession();
|
|
1672
|
+
if (v) throw v;
|
|
1673
1673
|
if (!w.session) {
|
|
1674
1674
|
d({}), m();
|
|
1675
1675
|
return;
|
|
1676
1676
|
}
|
|
1677
1677
|
b(l.current(w.session));
|
|
1678
1678
|
} catch (w) {
|
|
1679
|
-
console.error(w), await
|
|
1679
|
+
console.error(w), await y();
|
|
1680
1680
|
}
|
|
1681
|
-
}, [m, b,
|
|
1682
|
-
|
|
1681
|
+
}, [m, b, y, a.auth]);
|
|
1682
|
+
M(() => {
|
|
1683
1683
|
let w = !0;
|
|
1684
1684
|
(async () => {
|
|
1685
|
-
w && await
|
|
1685
|
+
w && await g();
|
|
1686
1686
|
})();
|
|
1687
|
-
const { data:
|
|
1687
|
+
const { data: N } = a.auth.onAuthStateChange((U, B) => {
|
|
1688
1688
|
if (w) {
|
|
1689
1689
|
if (!B) {
|
|
1690
1690
|
d({}), m();
|
|
@@ -1694,29 +1694,29 @@ const oe = () => {
|
|
|
1694
1694
|
}
|
|
1695
1695
|
});
|
|
1696
1696
|
return () => {
|
|
1697
|
-
w = !1,
|
|
1697
|
+
w = !1, N.subscription.unsubscribe();
|
|
1698
1698
|
};
|
|
1699
|
-
}, [m, b,
|
|
1700
|
-
const
|
|
1699
|
+
}, [m, b, g, a.auth]);
|
|
1700
|
+
const T = V(() => ({
|
|
1701
1701
|
account: u,
|
|
1702
1702
|
logUser: b,
|
|
1703
|
-
logoutUser:
|
|
1704
|
-
logUserFromLocal:
|
|
1703
|
+
logoutUser: y,
|
|
1704
|
+
logUserFromLocal: g,
|
|
1705
1705
|
isInGuestMode: f,
|
|
1706
1706
|
setGuestMode: p
|
|
1707
1707
|
}), [
|
|
1708
1708
|
u,
|
|
1709
1709
|
b,
|
|
1710
|
-
g,
|
|
1711
1710
|
y,
|
|
1711
|
+
g,
|
|
1712
1712
|
f,
|
|
1713
1713
|
p
|
|
1714
1714
|
]);
|
|
1715
|
-
return /* @__PURE__ */ h(
|
|
1716
|
-
},
|
|
1715
|
+
return /* @__PURE__ */ h(me.Provider, { value: T, children: e });
|
|
1716
|
+
}, Hs = (r) => {
|
|
1717
1717
|
const { children: e, supabase: s, queryClient: t } = r, [n] = R(Ce), o = t ?? n;
|
|
1718
1718
|
return /* @__PURE__ */ h(je.Provider, { value: { client: s }, children: /* @__PURE__ */ h(_e, { client: o, children: e }) });
|
|
1719
|
-
}, Qe =
|
|
1719
|
+
}, Qe = X({}), Bs = (r) => {
|
|
1720
1720
|
const { children: e, location: s, navigate: t, linkComponent: n, searchComponent: o } = r;
|
|
1721
1721
|
return /* @__PURE__ */ h(
|
|
1722
1722
|
Qe.Provider,
|
|
@@ -1726,7 +1726,7 @@ const oe = () => {
|
|
|
1726
1726
|
}
|
|
1727
1727
|
);
|
|
1728
1728
|
}, ce = () => {
|
|
1729
|
-
const r =
|
|
1729
|
+
const r = Y(Qe);
|
|
1730
1730
|
if (r === void 0 || Object.keys(r).length === 0)
|
|
1731
1731
|
throw new Error(
|
|
1732
1732
|
"Config provider has not been set. This step is required and cannot be skipped."
|
|
@@ -1740,9 +1740,9 @@ const oe = () => {
|
|
|
1740
1740
|
clearDynamicItems: () => {
|
|
1741
1741
|
},
|
|
1742
1742
|
dynamicItems: {}
|
|
1743
|
-
}, qe =
|
|
1743
|
+
}, qe = X(
|
|
1744
1744
|
Wt
|
|
1745
|
-
),
|
|
1745
|
+
), Vs = (r) => {
|
|
1746
1746
|
const { children: e } = r, [s, t] = R({}), n = S(
|
|
1747
1747
|
(a, l) => t((u) => ({
|
|
1748
1748
|
...u,
|
|
@@ -1776,22 +1776,24 @@ const oe = () => {
|
|
|
1776
1776
|
children: e
|
|
1777
1777
|
}
|
|
1778
1778
|
);
|
|
1779
|
-
}, zt = () =>
|
|
1780
|
-
function
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1779
|
+
}, zt = () => Y(qe);
|
|
1780
|
+
function Gs(r) {
|
|
1781
|
+
var y;
|
|
1782
|
+
const { t: e } = k(), { open: s, onClose: t, menuMap: n, logo: o } = r, i = Ke(), { dynamicItems: c } = zt(), { linkComponent: a, location: l } = ce(), u = a, d = V(() => n.filter((g) => {
|
|
1783
|
+
var v;
|
|
1784
|
+
const T = g.auth, w = !!((v = i == null ? void 0 : i.account) != null && v.email);
|
|
1785
|
+
return T == null || T && w || !T && !w;
|
|
1786
|
+
}), [(y = i == null ? void 0 : i.account) == null ? void 0 : y.email, n]), m = S(
|
|
1785
1787
|
(g) => {
|
|
1786
1788
|
g.key === "Escape" && s && t();
|
|
1787
1789
|
},
|
|
1788
1790
|
[t, s]
|
|
1789
1791
|
);
|
|
1790
|
-
|
|
1792
|
+
M(() => (document.addEventListener("keydown", m), () => {
|
|
1791
1793
|
document.removeEventListener("keydown", m);
|
|
1792
1794
|
}), [m]);
|
|
1793
1795
|
const f = S(
|
|
1794
|
-
(g,
|
|
1796
|
+
(g, T) => T ? g === `${l.pathname}${l.search}` : g === l.pathname,
|
|
1795
1797
|
[l.pathname, l.search]
|
|
1796
1798
|
), p = S(
|
|
1797
1799
|
(g) => /* @__PURE__ */ h(
|
|
@@ -1814,13 +1816,13 @@ function Vs(r) {
|
|
|
1814
1816
|
g.id
|
|
1815
1817
|
),
|
|
1816
1818
|
[u, s, e, f]
|
|
1817
|
-
), b = V(() => d.map((g,
|
|
1818
|
-
const
|
|
1819
|
+
), b = V(() => d.map((g, T) => {
|
|
1820
|
+
const w = g.page ?? String(T), v = `drawer-list-item ${f(g.path) ? "active" : ""} animated`;
|
|
1819
1821
|
if (g.type === "divider")
|
|
1820
|
-
return /* @__PURE__ */ h("li", { className:
|
|
1821
|
-
const
|
|
1822
|
-
return /* @__PURE__ */
|
|
1823
|
-
/* @__PURE__ */
|
|
1822
|
+
return /* @__PURE__ */ h("li", { className: v, children: /* @__PURE__ */ h("hr", { className: "drawer-divider" }) }, w);
|
|
1823
|
+
const N = g.children ?? (g.page && c ? c[g.page] : null);
|
|
1824
|
+
return /* @__PURE__ */ E("li", { className: v, children: [
|
|
1825
|
+
/* @__PURE__ */ E(
|
|
1824
1826
|
u,
|
|
1825
1827
|
{
|
|
1826
1828
|
tabIndex: s ? 0 : -1,
|
|
@@ -1835,8 +1837,8 @@ function Vs(r) {
|
|
|
1835
1837
|
]
|
|
1836
1838
|
}
|
|
1837
1839
|
),
|
|
1838
|
-
|
|
1839
|
-
] },
|
|
1840
|
+
N && /* @__PURE__ */ h("ul", { className: "drawer-children-list", children: N.map(p) })
|
|
1841
|
+
] }, w);
|
|
1840
1842
|
}), [u, c, f, s, d, p, e]);
|
|
1841
1843
|
return /* @__PURE__ */ h(
|
|
1842
1844
|
"div",
|
|
@@ -1845,8 +1847,8 @@ function Vs(r) {
|
|
|
1845
1847
|
"aria-disabled": !s,
|
|
1846
1848
|
className: `${s ? "opened" : "closed"} drawer-backdrop`,
|
|
1847
1849
|
onClick: () => t(),
|
|
1848
|
-
children: /* @__PURE__ */
|
|
1849
|
-
/* @__PURE__ */
|
|
1850
|
+
children: /* @__PURE__ */ E("aside", { className: `${s ? "opened" : "closed"} drawer animated`, children: [
|
|
1851
|
+
/* @__PURE__ */ E("div", { className: "drawer-header-container", children: [
|
|
1850
1852
|
o,
|
|
1851
1853
|
/* @__PURE__ */ h("h2", { className: "drawer-header poppins", children: e("_pages:home.appName") })
|
|
1852
1854
|
] }),
|
|
@@ -1856,9 +1858,9 @@ function Vs(r) {
|
|
|
1856
1858
|
);
|
|
1857
1859
|
}
|
|
1858
1860
|
const z = ({ icon: r, ...e }) => /* @__PURE__ */ h(ot, { icon: /* @__PURE__ */ h(q, { icon: r }), ...e });
|
|
1859
|
-
var
|
|
1861
|
+
var pe, Ne;
|
|
1860
1862
|
function Jt() {
|
|
1861
|
-
if (Ne) return
|
|
1863
|
+
if (Ne) return pe;
|
|
1862
1864
|
Ne = 1;
|
|
1863
1865
|
const r = (c, a = "local", l = void 0) => {
|
|
1864
1866
|
if (a === "local") {
|
|
@@ -1901,7 +1903,7 @@ function Jt() {
|
|
|
1901
1903
|
}
|
|
1902
1904
|
return "";
|
|
1903
1905
|
};
|
|
1904
|
-
return
|
|
1906
|
+
return pe = {
|
|
1905
1907
|
getCookie: o,
|
|
1906
1908
|
createCookie: n,
|
|
1907
1909
|
deleteCookie: (c) => document.cookie = `${c}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`,
|
|
@@ -1909,10 +1911,10 @@ function Jt() {
|
|
|
1909
1911
|
scrollTo: t,
|
|
1910
1912
|
parseQueries: e,
|
|
1911
1913
|
validation: r
|
|
1912
|
-
},
|
|
1914
|
+
}, pe;
|
|
1913
1915
|
}
|
|
1914
1916
|
var Yt = Jt();
|
|
1915
|
-
function
|
|
1917
|
+
function Ws() {
|
|
1916
1918
|
const { t: r, language: e } = k();
|
|
1917
1919
|
return { timeAge: S(
|
|
1918
1920
|
(t) => {
|
|
@@ -1945,7 +1947,7 @@ const He = (r) => {
|
|
|
1945
1947
|
}
|
|
1946
1948
|
});
|
|
1947
1949
|
return { open: a, onClick: m, close: d, dialogFn: f, isLoading: f.isPending };
|
|
1948
|
-
},
|
|
1950
|
+
}, zs = (r) => {
|
|
1949
1951
|
const { t: e } = k(), {
|
|
1950
1952
|
showStackNotifications: s,
|
|
1951
1953
|
showSuccessNotification: t,
|
|
@@ -1958,57 +1960,57 @@ const He = (r) => {
|
|
|
1958
1960
|
onSuccess: u,
|
|
1959
1961
|
queryKey: d,
|
|
1960
1962
|
onSuccessMessage: m
|
|
1961
|
-
} = r, { control: f, handleSubmit: p, reset: b, setError:
|
|
1963
|
+
} = r, { control: f, handleSubmit: p, reset: b, setError: y, getValues: g, setValue: T } = Pe({
|
|
1962
1964
|
defaultValues: i
|
|
1963
|
-
}), w = F(null),
|
|
1964
|
-
const
|
|
1965
|
-
if (!(
|
|
1965
|
+
}), w = F(null), v = S(() => {
|
|
1966
|
+
const C = document.activeElement;
|
|
1967
|
+
if (!(C instanceof HTMLElement)) {
|
|
1966
1968
|
w.current = null;
|
|
1967
1969
|
return;
|
|
1968
1970
|
}
|
|
1969
|
-
w.current =
|
|
1970
|
-
}, []),
|
|
1971
|
-
(
|
|
1972
|
-
const
|
|
1973
|
-
if (!_) return
|
|
1971
|
+
w.current = C.closest("form");
|
|
1972
|
+
}, []), N = S(
|
|
1973
|
+
(C) => {
|
|
1974
|
+
const D = C == null ? void 0 : C.errors, L = [], _ = w.current;
|
|
1975
|
+
if (!_) return L;
|
|
1974
1976
|
let K = !1;
|
|
1975
|
-
return
|
|
1977
|
+
return D && D.forEach(([le, ee]) => {
|
|
1976
1978
|
const j = _.querySelector(`[name="${le}"]`);
|
|
1977
|
-
(j instanceof HTMLInputElement || j instanceof HTMLTextAreaElement || j instanceof HTMLSelectElement) && (K || (j.focus(), K = !0), j.classList.add("error"),
|
|
1978
|
-
}),
|
|
1979
|
+
(j instanceof HTMLInputElement || j instanceof HTMLTextAreaElement || j instanceof HTMLSelectElement) && (K || (j.focus(), K = !0), j.classList.add("error"), L.push(e(`_entities:${d}.${le}.${ee}`)));
|
|
1980
|
+
}), L;
|
|
1979
1981
|
},
|
|
1980
1982
|
[e, d]
|
|
1981
1983
|
), U = S(() => {
|
|
1982
|
-
const
|
|
1983
|
-
if (!
|
|
1984
|
-
|
|
1985
|
-
|
|
1984
|
+
const C = w.current;
|
|
1985
|
+
if (!C) return;
|
|
1986
|
+
C.querySelectorAll("input, textarea, select").forEach((L) => {
|
|
1987
|
+
L.classList.remove("error");
|
|
1986
1988
|
});
|
|
1987
1989
|
}, []), B = ne(
|
|
1988
1990
|
{
|
|
1989
1991
|
mutationFn: c,
|
|
1990
|
-
onError: (
|
|
1991
|
-
console.error(
|
|
1992
|
-
const
|
|
1993
|
-
if (l) l(
|
|
1994
|
-
else if (
|
|
1995
|
-
const
|
|
1992
|
+
onError: (C) => {
|
|
1993
|
+
console.error(C);
|
|
1994
|
+
const D = C;
|
|
1995
|
+
if (l) l(C);
|
|
1996
|
+
else if (Se(D)) {
|
|
1997
|
+
const L = N(D);
|
|
1996
1998
|
s(
|
|
1997
|
-
|
|
1999
|
+
L.map(
|
|
1998
2000
|
(_) => ({
|
|
1999
2001
|
message: _,
|
|
2000
|
-
type:
|
|
2002
|
+
type: O.error
|
|
2001
2003
|
})
|
|
2002
2004
|
)
|
|
2003
2005
|
);
|
|
2004
|
-
} else if (
|
|
2005
|
-
const
|
|
2006
|
-
n({ message: _ ||
|
|
2006
|
+
} else if (Te(D)) {
|
|
2007
|
+
const L = D.message || e("_accessibility:errors.500"), _ = e(`_accessibility:errors.${D.status}`);
|
|
2008
|
+
n({ message: _ || L });
|
|
2007
2009
|
} else
|
|
2008
2010
|
n({ message: e("_accessibility:errors.500") });
|
|
2009
2011
|
},
|
|
2010
|
-
onSuccess: async (
|
|
2011
|
-
await o.invalidateQueries({ queryKey: d }), u && u(
|
|
2012
|
+
onSuccess: async (C) => {
|
|
2013
|
+
await o.invalidateQueries({ queryKey: d }), u && u(C), m && t({
|
|
2012
2014
|
message: m
|
|
2013
2015
|
});
|
|
2014
2016
|
}
|
|
@@ -2016,16 +2018,16 @@ const He = (r) => {
|
|
|
2016
2018
|
);
|
|
2017
2019
|
return {
|
|
2018
2020
|
control: f,
|
|
2019
|
-
getValues:
|
|
2020
|
-
setValue:
|
|
2021
|
+
getValues: g,
|
|
2022
|
+
setValue: T,
|
|
2021
2023
|
handleSubmit: p,
|
|
2022
|
-
onSubmit: (
|
|
2023
|
-
|
|
2024
|
-
a ? a(
|
|
2024
|
+
onSubmit: (C) => {
|
|
2025
|
+
v(), U(), B.mutate(
|
|
2026
|
+
a ? a(C) : C
|
|
2025
2027
|
);
|
|
2026
2028
|
},
|
|
2027
2029
|
reset: b,
|
|
2028
|
-
setError:
|
|
2030
|
+
setError: y,
|
|
2029
2031
|
isLoading: B.isPending
|
|
2030
2032
|
};
|
|
2031
2033
|
}, Xt = (r) => {
|
|
@@ -2082,7 +2084,7 @@ const He = (r) => {
|
|
|
2082
2084
|
[o, n, c, a, i, s, t, l]
|
|
2083
2085
|
)
|
|
2084
2086
|
};
|
|
2085
|
-
},
|
|
2087
|
+
}, Js = (r) => {
|
|
2086
2088
|
const { t: e } = k(), {
|
|
2087
2089
|
onClick: s,
|
|
2088
2090
|
hidden: t = !1,
|
|
@@ -2160,26 +2162,26 @@ const es = (r) => {
|
|
|
2160
2162
|
[n, t, o, s, e]
|
|
2161
2163
|
)
|
|
2162
2164
|
};
|
|
2163
|
-
},
|
|
2165
|
+
}, Ys = (r) => {
|
|
2164
2166
|
const { queryKey: e, onSuccess: s, ...t } = r, n = Z(), { showStackNotifications: o } = oe(), { t: i } = k(), { open: c, onClick: a, close: l, dialogFn: u, isLoading: d } = He({
|
|
2165
2167
|
onSuccessMessage: i("_pages:common.actions.delete.successMessage"),
|
|
2166
2168
|
onError: (f) => {
|
|
2167
2169
|
const p = f;
|
|
2168
|
-
if (
|
|
2170
|
+
if (Se(p))
|
|
2169
2171
|
o(
|
|
2170
2172
|
p.errors.map(
|
|
2171
|
-
([b,
|
|
2172
|
-
message: i(`_pages:${b}.errors.${
|
|
2173
|
-
type:
|
|
2173
|
+
([b, y]) => ({
|
|
2174
|
+
message: i(`_pages:${b}.errors.${y}`),
|
|
2175
|
+
type: O.error
|
|
2174
2176
|
})
|
|
2175
2177
|
)
|
|
2176
2178
|
);
|
|
2177
|
-
else if (
|
|
2178
|
-
const b = p.message || i("_accessibility:errors.500"),
|
|
2179
|
+
else if (Te(p)) {
|
|
2180
|
+
const b = p.message || i("_accessibility:errors.500"), y = i(`_accessibility:errors.${p.status}`);
|
|
2179
2181
|
o([
|
|
2180
2182
|
{
|
|
2181
|
-
message:
|
|
2182
|
-
type:
|
|
2183
|
+
message: y || b,
|
|
2184
|
+
type: O.error
|
|
2183
2185
|
}
|
|
2184
2186
|
]);
|
|
2185
2187
|
}
|
|
@@ -2205,8 +2207,8 @@ const es = (r) => {
|
|
|
2205
2207
|
const {
|
|
2206
2208
|
closeOnSubmit: e = !0,
|
|
2207
2209
|
defaultValues: s,
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
+
dtoToForm: t,
|
|
2211
|
+
formToDto: n,
|
|
2210
2212
|
mode: o = "state",
|
|
2211
2213
|
onApply: i,
|
|
2212
2214
|
onClear: c,
|
|
@@ -2215,102 +2217,105 @@ const es = (r) => {
|
|
|
2215
2217
|
reinitializeOnOpen: u,
|
|
2216
2218
|
resetOnOpen: d,
|
|
2217
2219
|
title: m
|
|
2218
|
-
} = r, [f, p] = R(), [b,
|
|
2220
|
+
} = r, [f, p] = R(), [b, y] = R(!1), g = F(!1), T = F(null), { open: w, handleClose: v, handleOpen: N } = Be(), { control: U, handleSubmit: B, reset: C, setError: D, getValues: L, setValue: _ } = Pe({
|
|
2219
2221
|
defaultValues: s || {}
|
|
2220
2222
|
});
|
|
2221
|
-
|
|
2223
|
+
M(() => {
|
|
2222
2224
|
if (!w) {
|
|
2223
|
-
|
|
2225
|
+
g.current = !1, T.current = null;
|
|
2224
2226
|
return;
|
|
2225
2227
|
}
|
|
2226
|
-
if (
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
if (u && s) {
|
|
2236
|
-
T(s);
|
|
2237
|
-
return;
|
|
2238
|
-
}
|
|
2239
|
-
d && T(s || {});
|
|
2228
|
+
if (g.current) return;
|
|
2229
|
+
if (g.current = !0, T.current) {
|
|
2230
|
+
C(T.current), T.current = null;
|
|
2231
|
+
return;
|
|
2232
|
+
}
|
|
2233
|
+
const $ = t;
|
|
2234
|
+
if (u && $) {
|
|
2235
|
+
C($(s || {}));
|
|
2236
|
+
return;
|
|
2240
2237
|
}
|
|
2241
|
-
|
|
2238
|
+
if (u && s) {
|
|
2239
|
+
C(s);
|
|
2240
|
+
return;
|
|
2241
|
+
}
|
|
2242
|
+
d && C(s || {});
|
|
2243
|
+
}, [s, t, w, u, C, d]);
|
|
2242
2244
|
const K = S(() => {
|
|
2243
|
-
|
|
2244
|
-
}, [
|
|
2245
|
-
(
|
|
2246
|
-
let
|
|
2247
|
-
typeof
|
|
2245
|
+
v(), C();
|
|
2246
|
+
}, [v, C]), le = S(
|
|
2247
|
+
($) => {
|
|
2248
|
+
let x, te;
|
|
2249
|
+
typeof $ == "number" || $ == null ? x = $ : (x = $.id, te = $.values), p(x), te ? w ? C(te) : T.current = te : T.current = null, w || N();
|
|
2248
2250
|
},
|
|
2249
|
-
[
|
|
2251
|
+
[N, w, C]
|
|
2250
2252
|
), ee = S(
|
|
2251
|
-
(
|
|
2252
|
-
|
|
2253
|
+
($) => {
|
|
2254
|
+
const x = n;
|
|
2255
|
+
return x ? x($, { id: f }) : $;
|
|
2256
|
+
},
|
|
2257
|
+
[n, f]
|
|
2253
2258
|
), j = S(
|
|
2254
|
-
async (
|
|
2255
|
-
a && await a(
|
|
2259
|
+
async ($, x, te) => {
|
|
2260
|
+
a && await a($, {
|
|
2256
2261
|
close: K,
|
|
2257
2262
|
id: f,
|
|
2258
|
-
phase:
|
|
2263
|
+
phase: x,
|
|
2259
2264
|
values: te
|
|
2260
2265
|
});
|
|
2261
2266
|
},
|
|
2262
2267
|
[K, f, a]
|
|
2263
2268
|
), We = S(async () => {
|
|
2264
2269
|
if (!i) return;
|
|
2265
|
-
const
|
|
2266
|
-
|
|
2270
|
+
const $ = L();
|
|
2271
|
+
y(!0);
|
|
2267
2272
|
try {
|
|
2268
|
-
const
|
|
2269
|
-
await i(
|
|
2273
|
+
const x = ee($);
|
|
2274
|
+
await i(x, {
|
|
2270
2275
|
close: K,
|
|
2271
2276
|
id: f,
|
|
2272
|
-
values:
|
|
2277
|
+
values: $
|
|
2273
2278
|
});
|
|
2274
|
-
} catch (
|
|
2275
|
-
throw await j(
|
|
2276
|
-
}),
|
|
2279
|
+
} catch (x) {
|
|
2280
|
+
throw await j(x, "apply", $).catch(() => {
|
|
2281
|
+
}), x;
|
|
2277
2282
|
} finally {
|
|
2278
|
-
|
|
2283
|
+
y(!1);
|
|
2279
2284
|
}
|
|
2280
|
-
}, [K,
|
|
2281
|
-
const
|
|
2285
|
+
}, [K, L, j, f, ee, i]), ze = S(async () => {
|
|
2286
|
+
const $ = L();
|
|
2282
2287
|
if (c) {
|
|
2283
|
-
|
|
2288
|
+
y(!0);
|
|
2284
2289
|
try {
|
|
2285
2290
|
await c();
|
|
2286
|
-
} catch (
|
|
2287
|
-
throw await j(
|
|
2288
|
-
}),
|
|
2291
|
+
} catch (x) {
|
|
2292
|
+
throw await j(x, "clear", $).catch(() => {
|
|
2293
|
+
}), x;
|
|
2289
2294
|
} finally {
|
|
2290
|
-
|
|
2295
|
+
y(!1);
|
|
2291
2296
|
}
|
|
2292
2297
|
}
|
|
2293
2298
|
try {
|
|
2294
|
-
|
|
2295
|
-
} catch (
|
|
2296
|
-
throw await j(
|
|
2297
|
-
}),
|
|
2299
|
+
C(s || {});
|
|
2300
|
+
} catch (x) {
|
|
2301
|
+
throw await j(x, "clear", $).catch(() => {
|
|
2302
|
+
}), x;
|
|
2298
2303
|
}
|
|
2299
|
-
}, [s,
|
|
2300
|
-
async (
|
|
2301
|
-
|
|
2304
|
+
}, [s, L, j, c, C]), Je = S(
|
|
2305
|
+
async ($) => {
|
|
2306
|
+
y(!0);
|
|
2302
2307
|
try {
|
|
2303
|
-
const
|
|
2304
|
-
l && await l(
|
|
2308
|
+
const x = ee($);
|
|
2309
|
+
l && await l(x, {
|
|
2305
2310
|
close: K,
|
|
2306
2311
|
id: f,
|
|
2307
|
-
values:
|
|
2312
|
+
values: $
|
|
2308
2313
|
}), e && K();
|
|
2309
|
-
} catch (
|
|
2310
|
-
throw await j(
|
|
2311
|
-
}),
|
|
2314
|
+
} catch (x) {
|
|
2315
|
+
throw await j(x, "submit", $).catch(() => {
|
|
2316
|
+
}), x;
|
|
2312
2317
|
} finally {
|
|
2313
|
-
|
|
2318
|
+
y(!1);
|
|
2314
2319
|
}
|
|
2315
2320
|
},
|
|
2316
2321
|
[K, e, j, f, ee, l]
|
|
@@ -2322,26 +2327,26 @@ const es = (r) => {
|
|
|
2322
2327
|
openDialog: le,
|
|
2323
2328
|
handleClose: K,
|
|
2324
2329
|
control: U,
|
|
2325
|
-
getValues:
|
|
2330
|
+
getValues: L,
|
|
2326
2331
|
setValue: _,
|
|
2327
2332
|
handleSubmit: B,
|
|
2328
2333
|
onSubmit: Je,
|
|
2329
|
-
reset:
|
|
2330
|
-
setError:
|
|
2334
|
+
reset: C,
|
|
2335
|
+
setError: D,
|
|
2331
2336
|
title: m,
|
|
2332
2337
|
isSubmitting: b,
|
|
2333
2338
|
onApply: We,
|
|
2334
2339
|
onClear: ze,
|
|
2335
2340
|
isLoading: b
|
|
2336
2341
|
};
|
|
2337
|
-
},
|
|
2338
|
-
const e = Z(), { mutationFn: s, queryKey: t, onSuccess: n, onError: o,
|
|
2342
|
+
}, Xs = (r) => {
|
|
2343
|
+
const e = Z(), { mutationFn: s, queryKey: t, onSuccess: n, onError: o, formToDto: i, ...c } = r, a = ne({
|
|
2339
2344
|
mutationFn: s
|
|
2340
2345
|
});
|
|
2341
2346
|
return Ve({
|
|
2342
2347
|
...c,
|
|
2343
2348
|
mode: "entity",
|
|
2344
|
-
|
|
2349
|
+
formToDto: i,
|
|
2345
2350
|
onSubmit: async (l) => {
|
|
2346
2351
|
try {
|
|
2347
2352
|
const u = await a.mutateAsync(l);
|
|
@@ -2351,19 +2356,19 @@ const es = (r) => {
|
|
|
2351
2356
|
}
|
|
2352
2357
|
}
|
|
2353
2358
|
});
|
|
2354
|
-
},
|
|
2359
|
+
}, Zs = (r) => {
|
|
2355
2360
|
const e = Z(), s = F(), t = F(), {
|
|
2356
2361
|
mutationFn: n,
|
|
2357
2362
|
queryKey: o,
|
|
2358
2363
|
onSuccess: i,
|
|
2359
2364
|
onError: c,
|
|
2360
|
-
|
|
2365
|
+
formToDto: a,
|
|
2361
2366
|
getFunction: l,
|
|
2362
2367
|
dtoToForm: u,
|
|
2363
2368
|
title: d,
|
|
2364
2369
|
...m
|
|
2365
2370
|
} = r, f = F(u);
|
|
2366
|
-
|
|
2371
|
+
M(() => {
|
|
2367
2372
|
f.current = u;
|
|
2368
2373
|
}, [u]);
|
|
2369
2374
|
const p = ne({
|
|
@@ -2374,50 +2379,53 @@ const es = (r) => {
|
|
|
2374
2379
|
title: d,
|
|
2375
2380
|
onSubmit: async (w) => {
|
|
2376
2381
|
try {
|
|
2377
|
-
const
|
|
2378
|
-
o && await e.invalidateQueries({ queryKey: o }), i && await i(
|
|
2379
|
-
} catch (
|
|
2380
|
-
throw c && c(
|
|
2382
|
+
const v = await p.mutateAsync(w);
|
|
2383
|
+
o && await e.invalidateQueries({ queryKey: o }), i && await i(v);
|
|
2384
|
+
} catch (v) {
|
|
2385
|
+
throw c && c(v), v;
|
|
2381
2386
|
}
|
|
2382
2387
|
},
|
|
2383
|
-
|
|
2384
|
-
|
|
2388
|
+
formToDto: (w) => {
|
|
2389
|
+
const v = a;
|
|
2390
|
+
return v ? v(w, s.current) : w;
|
|
2391
|
+
}
|
|
2392
|
+
}), { reset: y } = b, T = At({
|
|
2385
2393
|
queryFn: () => l(b.id),
|
|
2386
2394
|
queryKey: [...o || ["put-dialog", d], b.id],
|
|
2387
2395
|
enabled: b.open && !!b.id
|
|
2388
2396
|
});
|
|
2389
|
-
return
|
|
2390
|
-
if (
|
|
2391
|
-
if (s.current =
|
|
2392
|
-
|
|
2397
|
+
return M(() => {
|
|
2398
|
+
if (T.data && t.current !== T.data) {
|
|
2399
|
+
if (s.current = T.data, t.current = T.data, f.current && y) {
|
|
2400
|
+
y(f.current(T.data));
|
|
2393
2401
|
return;
|
|
2394
2402
|
}
|
|
2395
|
-
|
|
2403
|
+
y == null || y(T.data);
|
|
2396
2404
|
}
|
|
2397
|
-
}, [
|
|
2405
|
+
}, [T.data, y]), {
|
|
2398
2406
|
...b,
|
|
2399
|
-
isLoading: b.isLoading || p.isPending ||
|
|
2407
|
+
isLoading: b.isLoading || p.isPending || T.isFetching || T.isLoading
|
|
2400
2408
|
};
|
|
2401
|
-
},
|
|
2409
|
+
}, er = (r) => {
|
|
2402
2410
|
const { queryKey: e, onSuccess: s, ...t } = r, n = Z(), { showStackNotifications: o } = oe(), { t: i } = k(), { open: c, onClick: a, close: l, dialogFn: u, isLoading: d } = He({
|
|
2403
2411
|
onSuccessMessage: i("_pages:common.actions.restore.successMessage"),
|
|
2404
2412
|
onError: (f) => {
|
|
2405
2413
|
const p = f;
|
|
2406
|
-
if (
|
|
2414
|
+
if (Se(p))
|
|
2407
2415
|
o(
|
|
2408
2416
|
p.errors.map(
|
|
2409
|
-
([b,
|
|
2410
|
-
message: i(`_pages:${b}.errors.${
|
|
2411
|
-
type:
|
|
2417
|
+
([b, y]) => ({
|
|
2418
|
+
message: i(`_pages:${b}.errors.${y}`),
|
|
2419
|
+
type: O.error
|
|
2412
2420
|
})
|
|
2413
2421
|
)
|
|
2414
2422
|
);
|
|
2415
|
-
else if (
|
|
2416
|
-
const b = p.message || i("_accessibility:errors.500"),
|
|
2423
|
+
else if (Te(p)) {
|
|
2424
|
+
const b = p.message || i("_accessibility:errors.500"), y = i(`_accessibility:errors.${p.status}`);
|
|
2417
2425
|
o([
|
|
2418
2426
|
{
|
|
2419
|
-
message:
|
|
2420
|
-
type:
|
|
2427
|
+
message: y || b,
|
|
2428
|
+
type: O.error
|
|
2421
2429
|
}
|
|
2422
2430
|
]);
|
|
2423
2431
|
}
|
|
@@ -2437,7 +2445,7 @@ const es = (r) => {
|
|
|
2437
2445
|
action: m
|
|
2438
2446
|
};
|
|
2439
2447
|
};
|
|
2440
|
-
function
|
|
2448
|
+
function tr(r) {
|
|
2441
2449
|
const { t: e } = k(), s = Z(), {
|
|
2442
2450
|
queryKey: t,
|
|
2443
2451
|
mutationFn: n,
|
|
@@ -2447,13 +2455,13 @@ function er(r) {
|
|
|
2447
2455
|
onError: a
|
|
2448
2456
|
} = r, [l, u] = R(!1), [d, m] = R(null), [f, p] = R(!1), b = ne({
|
|
2449
2457
|
mutationFn: n,
|
|
2450
|
-
onError: (
|
|
2451
|
-
console.error(
|
|
2458
|
+
onError: (g) => {
|
|
2459
|
+
console.error(g), a == null || a(g);
|
|
2452
2460
|
},
|
|
2453
2461
|
onSuccess: async () => {
|
|
2454
2462
|
await s.invalidateQueries({ queryKey: t });
|
|
2455
2463
|
}
|
|
2456
|
-
}), { action:
|
|
2464
|
+
}), { action: y } = ts({
|
|
2457
2465
|
onClick: () => u(!0)
|
|
2458
2466
|
});
|
|
2459
2467
|
return {
|
|
@@ -2464,15 +2472,15 @@ function er(r) {
|
|
|
2464
2472
|
items: d,
|
|
2465
2473
|
override: f
|
|
2466
2474
|
}), u(!1), m(null), p(!1);
|
|
2467
|
-
} catch (
|
|
2468
|
-
console.error(
|
|
2475
|
+
} catch (g) {
|
|
2476
|
+
console.error(g);
|
|
2469
2477
|
}
|
|
2470
2478
|
},
|
|
2471
2479
|
isLoading: b.isPending,
|
|
2472
2480
|
fileProcessor: i,
|
|
2473
|
-
onFileProcessed: (
|
|
2481
|
+
onFileProcessed: (g) => m(g),
|
|
2474
2482
|
renderCustomPreview: c,
|
|
2475
|
-
onOverrideChange: (
|
|
2483
|
+
onOverrideChange: (g) => p(g),
|
|
2476
2484
|
open: l,
|
|
2477
2485
|
title: e("_pages:common.actions.import.dialog.title", {
|
|
2478
2486
|
entity: e(`_pages:${o}.title`)
|
|
@@ -2480,10 +2488,10 @@ function er(r) {
|
|
|
2480
2488
|
handleClose: () => {
|
|
2481
2489
|
u(!1), m(null), p(!1);
|
|
2482
2490
|
},
|
|
2483
|
-
action:
|
|
2491
|
+
action: y
|
|
2484
2492
|
};
|
|
2485
2493
|
}
|
|
2486
|
-
const
|
|
2494
|
+
const sr = (r) => {
|
|
2487
2495
|
const { showSuccessNotification: e } = oe(), { t: s } = k(), {
|
|
2488
2496
|
entity: t,
|
|
2489
2497
|
mutationFn: n,
|
|
@@ -2515,11 +2523,11 @@ function ss(r) {
|
|
|
2515
2523
|
const [e, s] = R(Ae), t = S(() => {
|
|
2516
2524
|
s(Ae());
|
|
2517
2525
|
}, []);
|
|
2518
|
-
return
|
|
2526
|
+
return M(() => (window.addEventListener("scroll", t), () => {
|
|
2519
2527
|
window.removeEventListener("scroll", t);
|
|
2520
2528
|
}), [t]), e > r;
|
|
2521
2529
|
}
|
|
2522
|
-
const
|
|
2530
|
+
const rr = (r) => {
|
|
2523
2531
|
const { t: e } = k(), {
|
|
2524
2532
|
icon: s = yt,
|
|
2525
2533
|
threshold: t = 200,
|
|
@@ -2549,11 +2557,11 @@ const sr = (r) => {
|
|
|
2549
2557
|
}
|
|
2550
2558
|
);
|
|
2551
2559
|
};
|
|
2552
|
-
function
|
|
2560
|
+
function nr(r) {
|
|
2553
2561
|
const { t: e } = k();
|
|
2554
2562
|
if ("children" in r) {
|
|
2555
|
-
const { children:
|
|
2556
|
-
return /* @__PURE__ */ h("div", { className: `error-container${
|
|
2563
|
+
const { children: v, className: N } = r;
|
|
2564
|
+
return /* @__PURE__ */ h("div", { className: `error-container${N ? ` ${N}` : ""}`, children: v });
|
|
2557
2565
|
}
|
|
2558
2566
|
const {
|
|
2559
2567
|
error: t,
|
|
@@ -2569,22 +2577,22 @@ function rr(r) {
|
|
|
2569
2577
|
className: f,
|
|
2570
2578
|
children: p,
|
|
2571
2579
|
onClick: b,
|
|
2572
|
-
...
|
|
2573
|
-
} = a ?? {}, { className:
|
|
2574
|
-
return /* @__PURE__ */
|
|
2580
|
+
...y
|
|
2581
|
+
} = a ?? {}, { className: g, ...T } = l ?? {}, w = o !== null;
|
|
2582
|
+
return /* @__PURE__ */ E("div", { className: `error-container${u ? ` ${u}` : ""}`, children: [
|
|
2575
2583
|
w && /* @__PURE__ */ h(
|
|
2576
2584
|
q,
|
|
2577
2585
|
{
|
|
2578
2586
|
...o,
|
|
2579
|
-
icon: (o == null ? void 0 : o.icon) ??
|
|
2587
|
+
icon: (o == null ? void 0 : o.icon) ?? kt,
|
|
2580
2588
|
className: `error-icon${o != null && o.className ? ` ${o.className}` : ""}`
|
|
2581
2589
|
}
|
|
2582
2590
|
),
|
|
2583
2591
|
/* @__PURE__ */ h(
|
|
2584
2592
|
"p",
|
|
2585
2593
|
{
|
|
2586
|
-
...
|
|
2587
|
-
className: `error-message${
|
|
2594
|
+
...T,
|
|
2595
|
+
className: `error-message${g ? ` ${g}` : ""}`,
|
|
2588
2596
|
children: n ?? (t == null ? void 0 : t.message) ?? e("_accessibility:errors.unknownError")
|
|
2589
2597
|
}
|
|
2590
2598
|
),
|
|
@@ -2594,10 +2602,10 @@ function rr(r) {
|
|
|
2594
2602
|
type: "button",
|
|
2595
2603
|
variant: "submit",
|
|
2596
2604
|
color: "primary",
|
|
2597
|
-
...
|
|
2605
|
+
...y,
|
|
2598
2606
|
className: `error-retry ${f ? ` ${f}` : ""}`,
|
|
2599
|
-
onClick: (
|
|
2600
|
-
b == null || b(
|
|
2607
|
+
onClick: (v) => {
|
|
2608
|
+
b == null || b(v), v.defaultPrevented || m();
|
|
2601
2609
|
},
|
|
2602
2610
|
children: p ?? c ?? e("_accessibility:actions.retry", { defaultValue: "Retry" })
|
|
2603
2611
|
}
|
|
@@ -2606,8 +2614,8 @@ function rr(r) {
|
|
|
2606
2614
|
}
|
|
2607
2615
|
const rs = (r) => {
|
|
2608
2616
|
const { showBackButton: e, title: s, actions: t } = r, { t: n } = k(), { navigate: o } = ce();
|
|
2609
|
-
return /* @__PURE__ */
|
|
2610
|
-
/* @__PURE__ */
|
|
2617
|
+
return /* @__PURE__ */ E("div", { className: "page-header", children: [
|
|
2618
|
+
/* @__PURE__ */ E("div", { className: "page-header-left", children: [
|
|
2611
2619
|
e && /* @__PURE__ */ h(
|
|
2612
2620
|
z,
|
|
2613
2621
|
{
|
|
@@ -2621,7 +2629,7 @@ const rs = (r) => {
|
|
|
2621
2629
|
),
|
|
2622
2630
|
/* @__PURE__ */ h("h2", { className: "page-header-title", children: s })
|
|
2623
2631
|
] }),
|
|
2624
|
-
/* @__PURE__ */
|
|
2632
|
+
/* @__PURE__ */ E("div", { children: [
|
|
2625
2633
|
/* @__PURE__ */ h(
|
|
2626
2634
|
it,
|
|
2627
2635
|
{
|
|
@@ -2638,7 +2646,7 @@ const rs = (r) => {
|
|
|
2638
2646
|
)
|
|
2639
2647
|
] })
|
|
2640
2648
|
] });
|
|
2641
|
-
},
|
|
2649
|
+
}, or = (r) => {
|
|
2642
2650
|
const {
|
|
2643
2651
|
title: e,
|
|
2644
2652
|
children: s,
|
|
@@ -2693,7 +2701,7 @@ const rs = (r) => {
|
|
|
2693
2701
|
i,
|
|
2694
2702
|
u
|
|
2695
2703
|
]);
|
|
2696
|
-
return /* @__PURE__ */
|
|
2704
|
+
return /* @__PURE__ */ E("main", { className: "page-main", children: [
|
|
2697
2705
|
/* @__PURE__ */ h(
|
|
2698
2706
|
rs,
|
|
2699
2707
|
{
|
|
@@ -2717,7 +2725,7 @@ const rs = (r) => {
|
|
|
2717
2725
|
}
|
|
2718
2726
|
)
|
|
2719
2727
|
] });
|
|
2720
|
-
},
|
|
2728
|
+
}, ir = (r) => {
|
|
2721
2729
|
const { t: e } = k(), {
|
|
2722
2730
|
className: s = "",
|
|
2723
2731
|
itemClassName: t = "",
|
|
@@ -2732,7 +2740,7 @@ const rs = (r) => {
|
|
|
2732
2740
|
loadMoreComponent: m = null,
|
|
2733
2741
|
observerRootMargin: f = "0px 0px 200px 0px",
|
|
2734
2742
|
observerThreshold: p = 0
|
|
2735
|
-
} = r, b = F(!1),
|
|
2743
|
+
} = r, b = F(!1), y = F(null), g = S(async () => {
|
|
2736
2744
|
if (!(!l || !d) && !(u || b.current)) {
|
|
2737
2745
|
b.current = !0;
|
|
2738
2746
|
try {
|
|
@@ -2742,36 +2750,36 @@ const rs = (r) => {
|
|
|
2742
2750
|
}
|
|
2743
2751
|
}
|
|
2744
2752
|
}, [l, u, d]);
|
|
2745
|
-
return
|
|
2746
|
-
if (!l || !d || !
|
|
2747
|
-
const
|
|
2753
|
+
return M(() => {
|
|
2754
|
+
if (!l || !d || !y.current || typeof IntersectionObserver > "u") return;
|
|
2755
|
+
const T = new IntersectionObserver(
|
|
2748
2756
|
(w) => {
|
|
2749
|
-
w.some((
|
|
2757
|
+
w.some((v) => v.isIntersecting) && g();
|
|
2750
2758
|
},
|
|
2751
2759
|
{
|
|
2752
2760
|
rootMargin: f,
|
|
2753
2761
|
threshold: p
|
|
2754
2762
|
}
|
|
2755
2763
|
);
|
|
2756
|
-
return
|
|
2764
|
+
return T.observe(y.current), () => T.disconnect();
|
|
2757
2765
|
}, [
|
|
2758
2766
|
l,
|
|
2759
2767
|
d,
|
|
2760
2768
|
f,
|
|
2761
2769
|
p,
|
|
2762
|
-
|
|
2763
|
-
]), n ? /* @__PURE__ */ h(re, {}) : /* @__PURE__ */ h(ae, { children: a != null && a.length ? /* @__PURE__ */
|
|
2764
|
-
a == null ? void 0 : a.map((
|
|
2765
|
-
l && d && /* @__PURE__ */ h("li", { className: "pretty-grid-load-more", ref:
|
|
2770
|
+
g
|
|
2771
|
+
]), n ? /* @__PURE__ */ h(re, {}) : /* @__PURE__ */ h(ae, { children: a != null && a.length ? /* @__PURE__ */ E("ul", { className: `pretty-grid-main ${s}`, children: [
|
|
2772
|
+
a == null ? void 0 : a.map((T) => /* @__PURE__ */ h("li", { className: `pretty-grid-item ${t}`, children: c(T) }, T.id)),
|
|
2773
|
+
l && d && /* @__PURE__ */ h("li", { className: "pretty-grid-load-more", ref: y, children: m })
|
|
2766
2774
|
] }) : /* @__PURE__ */ h(ae, { children: o || /* @__PURE__ */ h(ds, { message: i }) }) });
|
|
2767
|
-
}, Ge =
|
|
2775
|
+
}, Ge = X({
|
|
2768
2776
|
title: "",
|
|
2769
2777
|
setTitle: () => {
|
|
2770
2778
|
},
|
|
2771
2779
|
rightContent: null,
|
|
2772
2780
|
setRightContent: () => {
|
|
2773
2781
|
}
|
|
2774
|
-
}),
|
|
2782
|
+
}), ar = (r) => {
|
|
2775
2783
|
const { children: e } = r, [s, t] = R(""), [n, o] = R(null), i = S((l) => {
|
|
2776
2784
|
t(l);
|
|
2777
2785
|
}, []), c = S((l) => {
|
|
@@ -2786,25 +2794,25 @@ const rs = (r) => {
|
|
|
2786
2794
|
[s, i, n, c]
|
|
2787
2795
|
);
|
|
2788
2796
|
return /* @__PURE__ */ h(Ge.Provider, { value: a, children: e });
|
|
2789
|
-
}, ns = () =>
|
|
2790
|
-
function
|
|
2797
|
+
}, ns = () => Y(Ge);
|
|
2798
|
+
function cr(r) {
|
|
2791
2799
|
const { t: e } = k(), { openDrawer: s, showSearch: t = !0, menuButtonProps: n } = r, { searchComponent: o, location: i } = ce(), { title: c, rightContent: a } = ns(), [l, u] = R(!1), d = S((p) => {
|
|
2792
2800
|
(Ht() ? p.metaKey : p.ctrlKey) && p.shiftKey && p.key.toLowerCase() === "f" && (u(!0), p.preventDefault());
|
|
2793
2801
|
}, []);
|
|
2794
|
-
|
|
2802
|
+
M(() => (window.addEventListener("keydown", d), () => {
|
|
2795
2803
|
window.removeEventListener("keydown", d);
|
|
2796
2804
|
}), [d]);
|
|
2797
2805
|
const m = o, f = t && !!m;
|
|
2798
|
-
return /* @__PURE__ */
|
|
2806
|
+
return /* @__PURE__ */ E(ae, { children: [
|
|
2799
2807
|
i.pathname !== "/" && !!m && /* @__PURE__ */ h(m, { open: l, onClose: () => u(!1) }),
|
|
2800
|
-
/* @__PURE__ */
|
|
2801
|
-
/* @__PURE__ */
|
|
2808
|
+
/* @__PURE__ */ E("header", { id: "header", className: "header", children: [
|
|
2809
|
+
/* @__PURE__ */ E("div", { className: "navbar-left", children: [
|
|
2802
2810
|
/* @__PURE__ */ h(
|
|
2803
2811
|
z,
|
|
2804
2812
|
{
|
|
2805
2813
|
...n,
|
|
2806
2814
|
type: (n == null ? void 0 : n.type) ?? "button",
|
|
2807
|
-
icon: (n == null ? void 0 : n.icon) ??
|
|
2815
|
+
icon: (n == null ? void 0 : n.icon) ?? Tt,
|
|
2808
2816
|
onClick: (p) => {
|
|
2809
2817
|
var b;
|
|
2810
2818
|
(b = n == null ? void 0 : n.onClick) == null || b.call(n, p), s();
|
|
@@ -2816,12 +2824,12 @@ function ar(r) {
|
|
|
2816
2824
|
),
|
|
2817
2825
|
/* @__PURE__ */ h("h1", { className: "poppins navbar-title", children: c || e("_pages:home.appName") })
|
|
2818
2826
|
] }),
|
|
2819
|
-
/* @__PURE__ */
|
|
2827
|
+
/* @__PURE__ */ E("div", { className: "navbar-right", children: [
|
|
2820
2828
|
a,
|
|
2821
2829
|
f && /* @__PURE__ */ h(
|
|
2822
2830
|
z,
|
|
2823
2831
|
{
|
|
2824
|
-
icon:
|
|
2832
|
+
icon: Ct,
|
|
2825
2833
|
className: "navbar-search-btn",
|
|
2826
2834
|
onClick: () => u(!0)
|
|
2827
2835
|
}
|
|
@@ -2830,37 +2838,37 @@ function ar(r) {
|
|
|
2830
2838
|
] })
|
|
2831
2839
|
] });
|
|
2832
2840
|
}
|
|
2833
|
-
const ue = 300, os = (r) => r ??
|
|
2841
|
+
const ue = 300, os = (r) => r ?? O.error, is = (r) => {
|
|
2834
2842
|
switch (r) {
|
|
2835
|
-
case
|
|
2843
|
+
case O.error:
|
|
2836
2844
|
return Et;
|
|
2837
2845
|
default:
|
|
2838
2846
|
return vt;
|
|
2839
2847
|
}
|
|
2840
|
-
},
|
|
2848
|
+
}, ge = (r) => {
|
|
2841
2849
|
switch (r) {
|
|
2842
|
-
case
|
|
2850
|
+
case O.success:
|
|
2843
2851
|
return "!text-success";
|
|
2844
|
-
case
|
|
2852
|
+
case O.error:
|
|
2845
2853
|
return "!text-error";
|
|
2846
|
-
case
|
|
2854
|
+
case O.warning:
|
|
2847
2855
|
return "!text-warning";
|
|
2848
2856
|
default:
|
|
2849
2857
|
return "!text-info";
|
|
2850
2858
|
}
|
|
2851
2859
|
}, as = (r) => {
|
|
2852
2860
|
switch (r) {
|
|
2853
|
-
case
|
|
2861
|
+
case O.success:
|
|
2854
2862
|
return "bg-bg-success";
|
|
2855
|
-
case
|
|
2863
|
+
case O.error:
|
|
2856
2864
|
return "bg-bg-error";
|
|
2857
|
-
case
|
|
2865
|
+
case O.warning:
|
|
2858
2866
|
return "bg-bg-warning";
|
|
2859
2867
|
default:
|
|
2860
2868
|
return "bg-bg-info";
|
|
2861
2869
|
}
|
|
2862
2870
|
};
|
|
2863
|
-
function
|
|
2871
|
+
function lr() {
|
|
2864
2872
|
const { t: r } = k(), { notification: e, removeNotification: s } = oe(), [t, n] = R([]), o = F(t);
|
|
2865
2873
|
dt(() => {
|
|
2866
2874
|
o.current = t;
|
|
@@ -2877,7 +2885,7 @@ function cr() {
|
|
|
2877
2885
|
},
|
|
2878
2886
|
[s]
|
|
2879
2887
|
);
|
|
2880
|
-
return
|
|
2888
|
+
return M(() => {
|
|
2881
2889
|
let a = null;
|
|
2882
2890
|
const l = () => {
|
|
2883
2891
|
a && clearTimeout(a), i.current && (clearTimeout(i.current), i.current = null);
|
|
@@ -2909,7 +2917,7 @@ function cr() {
|
|
|
2909
2917
|
return i.current = setTimeout(() => {
|
|
2910
2918
|
n(m.map((f) => ({ ...f, closing: !1 }))), i.current = null;
|
|
2911
2919
|
}, ue), l;
|
|
2912
|
-
}, [e]),
|
|
2920
|
+
}, [e]), M(() => {
|
|
2913
2921
|
if (!t.length) return;
|
|
2914
2922
|
let a;
|
|
2915
2923
|
const l = window.setTimeout(() => {
|
|
@@ -2923,21 +2931,21 @@ function cr() {
|
|
|
2923
2931
|
}, [t.length, c]), Ie(
|
|
2924
2932
|
/* @__PURE__ */ h("div", { className: `notification-portal ${t.length ? "active" : ""}`, children: t.map(({ id: a, type: l, message: u, closing: d }) => {
|
|
2925
2933
|
const m = os(l);
|
|
2926
|
-
return /* @__PURE__ */
|
|
2934
|
+
return /* @__PURE__ */ E(
|
|
2927
2935
|
"div",
|
|
2928
2936
|
{
|
|
2929
2937
|
className: `notification ${d ? "closing" : ""} ${as(m)}`,
|
|
2930
2938
|
onClick: (f) => f.stopPropagation(),
|
|
2931
2939
|
children: [
|
|
2932
|
-
/* @__PURE__ */
|
|
2940
|
+
/* @__PURE__ */ E("div", { className: "notification-body", children: [
|
|
2933
2941
|
/* @__PURE__ */ h(
|
|
2934
2942
|
q,
|
|
2935
2943
|
{
|
|
2936
2944
|
icon: is(m),
|
|
2937
|
-
className: `notification-icon ${
|
|
2945
|
+
className: `notification-icon ${ge(m)}`
|
|
2938
2946
|
}
|
|
2939
2947
|
),
|
|
2940
|
-
/* @__PURE__ */ h("p", { className: `notification-text ${
|
|
2948
|
+
/* @__PURE__ */ h("p", { className: `notification-text ${ge(m)}`, children: u })
|
|
2941
2949
|
] }),
|
|
2942
2950
|
/* @__PURE__ */ h(
|
|
2943
2951
|
z,
|
|
@@ -2949,7 +2957,7 @@ function cr() {
|
|
|
2949
2957
|
onClick: (f) => {
|
|
2950
2958
|
f.stopPropagation(), a !== void 0 && c(a);
|
|
2951
2959
|
},
|
|
2952
|
-
iconClassName: `${
|
|
2960
|
+
iconClassName: `${ge(m)} notification-close-icon`,
|
|
2953
2961
|
name: r("_accessibility:buttons.closeNotification"),
|
|
2954
2962
|
"aria-label": r("_accessibility:ariaLabels.closeNotification")
|
|
2955
2963
|
}
|
|
@@ -2962,7 +2970,7 @@ function cr() {
|
|
|
2962
2970
|
document.body
|
|
2963
2971
|
);
|
|
2964
2972
|
}
|
|
2965
|
-
function
|
|
2973
|
+
function ur(r) {
|
|
2966
2974
|
const { className: e, ...s } = r;
|
|
2967
2975
|
return /* @__PURE__ */ h("div", { className: "splash-screen", children: /* @__PURE__ */ h(
|
|
2968
2976
|
re,
|
|
@@ -3024,12 +3032,12 @@ const cs = (r) => {
|
|
|
3024
3032
|
useLinks: c = !0,
|
|
3025
3033
|
tabButtonProps: a
|
|
3026
3034
|
} = r, [l, u] = R(s ?? ((f = e[0]) == null ? void 0 : f.id)), d = t ?? l, m = V(() => e.find((p) => p.id === d), [e, d]);
|
|
3027
|
-
return /* @__PURE__ */
|
|
3035
|
+
return /* @__PURE__ */ E("div", { className: `tabs-layout-main ${o}`, children: [
|
|
3028
3036
|
/* @__PURE__ */ h(
|
|
3029
3037
|
"ul",
|
|
3030
3038
|
{
|
|
3031
3039
|
className: `horizontal tabs tabs-container ${i}`,
|
|
3032
|
-
children: e.map(({ id: p, to: b, label:
|
|
3040
|
+
children: e.map(({ id: p, to: b, label: y }) => /* @__PURE__ */ h("li", { children: /* @__PURE__ */ h(
|
|
3033
3041
|
cs,
|
|
3034
3042
|
{
|
|
3035
3043
|
onClick: () => {
|
|
@@ -3041,7 +3049,7 @@ const cs = (r) => {
|
|
|
3041
3049
|
active: d === p,
|
|
3042
3050
|
useLinks: c,
|
|
3043
3051
|
tabButtonProps: a,
|
|
3044
|
-
children:
|
|
3052
|
+
children: y
|
|
3045
3053
|
}
|
|
3046
3054
|
) }, p))
|
|
3047
3055
|
}
|
|
@@ -3061,12 +3069,12 @@ const cs = (r) => {
|
|
|
3061
3069
|
alt: l = "",
|
|
3062
3070
|
final: u = !1
|
|
3063
3071
|
} = r, { t: d } = k();
|
|
3064
|
-
return /* @__PURE__ */
|
|
3072
|
+
return /* @__PURE__ */ E("div", { className: "big-appear step-container", children: [
|
|
3065
3073
|
a && /* @__PURE__ */ h("img", { src: a, alt: l }),
|
|
3066
3074
|
e != null && /* @__PURE__ */ h("h2", { className: "step-title", children: e }),
|
|
3067
3075
|
s != null && /* @__PURE__ */ h("div", { className: "step-body", children: s }),
|
|
3068
3076
|
t != null && /* @__PURE__ */ h("div", { className: "step-content", children: t }),
|
|
3069
|
-
/* @__PURE__ */ h("div", { className: "step-actions", children: u ? /* @__PURE__ */
|
|
3077
|
+
/* @__PURE__ */ h("div", { className: "step-actions", children: u ? /* @__PURE__ */ E(ae, { children: [
|
|
3070
3078
|
/* @__PURE__ */ h(
|
|
3071
3079
|
H,
|
|
3072
3080
|
{
|
|
@@ -3089,7 +3097,7 @@ const cs = (r) => {
|
|
|
3089
3097
|
children: d("_accessibility:buttons.signIn")
|
|
3090
3098
|
}
|
|
3091
3099
|
)
|
|
3092
|
-
] }) : /* @__PURE__ */
|
|
3100
|
+
] }) : /* @__PURE__ */ E(ae, { children: [
|
|
3093
3101
|
/* @__PURE__ */ h(
|
|
3094
3102
|
H,
|
|
3095
3103
|
{
|
|
@@ -3114,7 +3122,7 @@ const cs = (r) => {
|
|
|
3114
3122
|
)
|
|
3115
3123
|
] }) })
|
|
3116
3124
|
] });
|
|
3117
|
-
},
|
|
3125
|
+
}, dr = (r) => {
|
|
3118
3126
|
const {
|
|
3119
3127
|
steps: e,
|
|
3120
3128
|
signInPath: s = "/auth/sign-in",
|
|
@@ -3122,7 +3130,7 @@ const cs = (r) => {
|
|
|
3122
3130
|
onSkip: n,
|
|
3123
3131
|
onSignIn: o,
|
|
3124
3132
|
onStartAsGuest: i
|
|
3125
|
-
} = r,
|
|
3133
|
+
} = r, c = Ke(), { navigate: a } = ce(), [l, u] = R(1), d = S(() => {
|
|
3126
3134
|
if (n) {
|
|
3127
3135
|
n();
|
|
3128
3136
|
return;
|
|
@@ -3139,16 +3147,16 @@ const cs = (r) => {
|
|
|
3139
3147
|
i();
|
|
3140
3148
|
return;
|
|
3141
3149
|
}
|
|
3142
|
-
c(!0), a(t);
|
|
3143
|
-
}, [t, a, i
|
|
3144
|
-
id:
|
|
3150
|
+
c == null || c.setGuestMode(!0), a(t);
|
|
3151
|
+
}, [c, t, a, i]), p = V(() => e.map((b, y) => ({
|
|
3152
|
+
id: y + 1,
|
|
3145
3153
|
label: "",
|
|
3146
3154
|
content: /* @__PURE__ */ h(
|
|
3147
3155
|
us,
|
|
3148
3156
|
{
|
|
3149
3157
|
...b,
|
|
3150
|
-
final:
|
|
3151
|
-
onClickNext: () => u((
|
|
3158
|
+
final: y === e.length - 1,
|
|
3159
|
+
onClickNext: () => u((g) => g + 1),
|
|
3152
3160
|
onSkip: d,
|
|
3153
3161
|
onStartAsGuest: f,
|
|
3154
3162
|
onSignIn: m
|
|
@@ -3171,7 +3179,7 @@ const cs = (r) => {
|
|
|
3171
3179
|
action: t,
|
|
3172
3180
|
iconProps: n
|
|
3173
3181
|
} = r;
|
|
3174
|
-
return /* @__PURE__ */
|
|
3182
|
+
return /* @__PURE__ */ E("div", { className: "empty-container", children: [
|
|
3175
3183
|
n && /* @__PURE__ */ h(q, { ...n }),
|
|
3176
3184
|
/* @__PURE__ */ h("p", { ...s, children: e }),
|
|
3177
3185
|
t && /* @__PURE__ */ h(ut, { showTooltips: !1, showText: !0, ...t })
|
|
@@ -3179,93 +3187,94 @@ const cs = (r) => {
|
|
|
3179
3187
|
};
|
|
3180
3188
|
export {
|
|
3181
3189
|
de as APIClient,
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3190
|
+
pr as Action,
|
|
3191
|
+
gr as Actions,
|
|
3192
|
+
br as ActionsDropdown,
|
|
3185
3193
|
z as AppIconButton,
|
|
3186
|
-
|
|
3187
|
-
|
|
3194
|
+
Ot as AuthClient,
|
|
3195
|
+
me as AuthContext,
|
|
3188
3196
|
js as AuthProvider,
|
|
3189
3197
|
Ds as BaseClient,
|
|
3190
|
-
|
|
3191
|
-
|
|
3198
|
+
yr as Button,
|
|
3199
|
+
Bs as ConfigProvider,
|
|
3192
3200
|
As as ConfirmationDialog,
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3201
|
+
ye as Dialog,
|
|
3202
|
+
we as DialogActions,
|
|
3203
|
+
Gs as Drawer,
|
|
3196
3204
|
qe as DrawerMenuContext,
|
|
3197
|
-
|
|
3205
|
+
Vs as DrawerMenuProvider,
|
|
3198
3206
|
ds as Empty,
|
|
3199
|
-
|
|
3207
|
+
nr as Error,
|
|
3200
3208
|
Es as FormContainer,
|
|
3201
3209
|
Ns as FormDialog,
|
|
3202
3210
|
J as GlobalActions,
|
|
3203
|
-
|
|
3211
|
+
$s as IManager,
|
|
3204
3212
|
z as IconButton,
|
|
3205
|
-
|
|
3213
|
+
xs as ImportDialog,
|
|
3206
3214
|
Ls as IndexedDBClient,
|
|
3207
3215
|
Ks as ManagerProvider,
|
|
3208
3216
|
P as Methods,
|
|
3209
|
-
|
|
3217
|
+
cr as Navbar,
|
|
3210
3218
|
Ge as NavbarContext,
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3219
|
+
ar as NavbarProvider,
|
|
3220
|
+
lr as Notification,
|
|
3221
|
+
O as NotificationEnumType,
|
|
3214
3222
|
Fs as NotificationProvider,
|
|
3215
|
-
|
|
3216
|
-
|
|
3223
|
+
dr as Onboarding,
|
|
3224
|
+
or as Page,
|
|
3217
3225
|
vs as ParagraphInput,
|
|
3218
3226
|
ks as PasswordInput,
|
|
3219
|
-
|
|
3220
|
-
|
|
3227
|
+
ir as PrettyGrid,
|
|
3228
|
+
ur as SplashScreen,
|
|
3221
3229
|
us as Step,
|
|
3222
|
-
|
|
3230
|
+
qs as SupabaseAuthProvider,
|
|
3223
3231
|
Rs as SupabaseDataClient,
|
|
3224
3232
|
je as SupabaseManagerContext,
|
|
3225
|
-
|
|
3233
|
+
Hs as SupabaseManagerProvider,
|
|
3226
3234
|
cs as Tab,
|
|
3227
3235
|
ls as TabsLayout,
|
|
3228
|
-
|
|
3236
|
+
rr as ToTop,
|
|
3229
3237
|
Pt as buildQueryUrl,
|
|
3230
3238
|
Ce as createQueryClient,
|
|
3231
3239
|
Is as enumToKeyValueArray,
|
|
3232
|
-
|
|
3240
|
+
Ms as formatForDatetimeLocal,
|
|
3233
3241
|
G as fromLocal,
|
|
3234
3242
|
_s as getFormattedDateTime,
|
|
3235
3243
|
Ps as getShortFormattedDateTime,
|
|
3236
|
-
|
|
3244
|
+
Te as isHttpError,
|
|
3237
3245
|
Ht as isMac,
|
|
3238
|
-
|
|
3239
|
-
|
|
3246
|
+
Se as isValidationError,
|
|
3247
|
+
he as makeRequest,
|
|
3240
3248
|
ke as mapSupabaseSessionToSessionDto,
|
|
3241
|
-
|
|
3242
|
-
|
|
3249
|
+
Os as mapValidationErrors,
|
|
3250
|
+
Oe as parseQueries,
|
|
3243
3251
|
Us as queryClient,
|
|
3244
3252
|
I as removeFromLocal,
|
|
3245
3253
|
Q as toLocal,
|
|
3246
|
-
|
|
3254
|
+
Qs as useAuth,
|
|
3247
3255
|
Vt as useAuthContext,
|
|
3248
3256
|
ce as useConfig,
|
|
3249
3257
|
He as useConfirmationForm,
|
|
3250
3258
|
Xt as useDeleteAction,
|
|
3251
|
-
|
|
3259
|
+
Ys as useDeleteDialog,
|
|
3252
3260
|
Be as useDialog,
|
|
3253
3261
|
zt as useDrawerMenu,
|
|
3254
|
-
|
|
3262
|
+
Js as useEditAction,
|
|
3255
3263
|
es as useExportAction,
|
|
3256
|
-
|
|
3264
|
+
sr as useExportActionMutate,
|
|
3257
3265
|
Ve as useFormDialog,
|
|
3258
3266
|
ts as useImportAction,
|
|
3259
|
-
|
|
3267
|
+
tr as useImportDialog,
|
|
3260
3268
|
Bt as useManager,
|
|
3261
3269
|
ns as useNavbar,
|
|
3262
3270
|
oe as useNotification,
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3271
|
+
Ke as useOptionalAuthContext,
|
|
3272
|
+
Xs as usePostDialog,
|
|
3273
|
+
zs as usePostForm,
|
|
3274
|
+
Zs as usePutDialog,
|
|
3266
3275
|
Zt as useRestoreAction,
|
|
3267
|
-
|
|
3276
|
+
er as useRestoreDialog,
|
|
3268
3277
|
ss as useScrollTrigger,
|
|
3269
3278
|
Gt as useSupabase,
|
|
3270
|
-
|
|
3279
|
+
Ws as useTimeAge
|
|
3271
3280
|
};
|