@overmap-ai/forms 1.0.17-blur-updates.1 → 1.0.17-blur-updates.3
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/dist/forms/builder/utils.d.ts +1 -1
- package/dist/forms/renderer/FormRenderer/FormRenderer.d.ts +1 -1
- package/dist/forms.js +1114 -1093
- package/dist/forms.umd.cjs +12 -12
- package/package.json +1 -1
package/dist/forms.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var I = (t, n, e) =>
|
|
4
|
-
import { jsxs as x, jsx as s, Fragment as
|
|
5
|
-
import { Popover as
|
|
1
|
+
var lr = Object.defineProperty;
|
|
2
|
+
var cr = (t, n, e) => n in t ? lr(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
|
|
3
|
+
var I = (t, n, e) => cr(t, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { jsxs as x, jsx as s, Fragment as be } from "react/jsx-runtime";
|
|
5
|
+
import { Popover as le, IconButton as V, RiIcon as F, Text as ge, Spinner as wt, ButtonGroup as xt, Tooltip as Ne, Separator as Xt, Checkbox as lt, Button as Q, DayPicker as dr, useToast as Ct, Input as pe, Badge as kt, Card as He, Menu as _, TextArea as Hn, Heading as Gn, HoverCard as Rt, useAlertDialog as ur, Tabs as Te, useSize as fr, IconToggleButton as mr } from "@overmap-ai/blocks";
|
|
6
6
|
import * as p from "react";
|
|
7
|
-
import { memo as O, useCallback as N, useMemo as P, forwardRef as
|
|
8
|
-
import { useField as
|
|
9
|
-
import * as
|
|
10
|
-
import
|
|
11
|
-
import { RiCheckboxCircleLine as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { DragDropContext as
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { ReactSketchCanvas as
|
|
19
|
-
const
|
|
7
|
+
import { memo as O, useCallback as N, useMemo as P, forwardRef as Xe, createContext as hr, useContext as pr, useState as $, useRef as me, useEffect as K, Fragment as Xn, useLayoutEffect as Kt, useReducer as gr } from "react";
|
|
8
|
+
import { useField as Qt, useFormikContext as Ie, useFormik as Yt, FormikProvider as Jt } from "formik";
|
|
9
|
+
import * as vr from "react-dom";
|
|
10
|
+
import yr from "react-dom";
|
|
11
|
+
import { RiCheckboxCircleLine as br, RiCalendarLine as wr, RiListCheck as xr, RiHashtag as Cr, RiQrCodeLine as Er, RiCheckboxLine as Ir, RiMenuFoldLine as Sr, RiInputField as Rr, RiAlignJustify as Nr, RiUpload2Line as Tr, RiFileCopyLine as Lr, RiDeleteBin7Fill as Fr, RiImageLine as Ar, RiArrowDownLine as Dr, RiArrowUpLine as Or } from "react-icons/ri";
|
|
12
|
+
import J from "lodash.get";
|
|
13
|
+
import Zt from "lodash.set";
|
|
14
|
+
import { DragDropContext as Kn, Droppable as en, Draggable as tn } from "@hello-pangea/dnd";
|
|
15
|
+
import Pr from "qr-scanner";
|
|
16
|
+
import kr from "lodash.clonedeep";
|
|
17
|
+
import { Colors as Qn, fileToBlob as Yn, hashFile as Rn, DeferredPromise as Mr } from "@overmap-ai/core";
|
|
18
|
+
import { ReactSketchCanvas as zr } from "react-sketch-canvas";
|
|
19
|
+
const Jn = O((t) => {
|
|
20
20
|
const { selectedColor: n, allColors: e, onFinish: i, trigger: r } = t, o = N(
|
|
21
21
|
(a) => () => {
|
|
22
22
|
i(a);
|
|
23
23
|
},
|
|
24
24
|
[i]
|
|
25
25
|
);
|
|
26
|
-
return /* @__PURE__ */ x(
|
|
27
|
-
/* @__PURE__ */ s(
|
|
28
|
-
/* @__PURE__ */ s(
|
|
29
|
-
|
|
26
|
+
return /* @__PURE__ */ x(le.Root, { children: [
|
|
27
|
+
/* @__PURE__ */ s(le.Trigger, { children: r }),
|
|
28
|
+
/* @__PURE__ */ s(le.Content, { size: "sm", children: /* @__PURE__ */ s("div", { className: "grid w-max grid-cols-7 gap-x-1 gap-y-1", children: e.map((a) => /* @__PURE__ */ s(
|
|
29
|
+
V,
|
|
30
30
|
{
|
|
31
31
|
onClick: o(a),
|
|
32
32
|
style: {
|
|
@@ -41,39 +41,39 @@ const Kn = O((t) => {
|
|
|
41
41
|
)) }) })
|
|
42
42
|
] });
|
|
43
43
|
});
|
|
44
|
-
|
|
45
|
-
function
|
|
44
|
+
Jn.displayName = "ColorPicker";
|
|
45
|
+
function Zn(t) {
|
|
46
46
|
var n, e, i = "";
|
|
47
47
|
if (typeof t == "string" || typeof t == "number") i += t;
|
|
48
48
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
49
49
|
var r = t.length;
|
|
50
|
-
for (n = 0; n < r; n++) t[n] && (e =
|
|
50
|
+
for (n = 0; n < r; n++) t[n] && (e = Zn(t[n])) && (i && (i += " "), i += e);
|
|
51
51
|
} else for (e in t) t[e] && (i && (i += " "), i += e);
|
|
52
52
|
return i;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
for (var t, n, e = 0, i = "", r = arguments.length; e < r; e++) (t = arguments[e]) && (n =
|
|
54
|
+
function _r() {
|
|
55
|
+
for (var t, n, e = 0, i = "", r = arguments.length; e < r; e++) (t = arguments[e]) && (n = Zn(t)) && (i && (i += " "), i += n);
|
|
56
56
|
return i;
|
|
57
57
|
}
|
|
58
|
-
const
|
|
58
|
+
const qe = _r, Br = ["image/jpeg", "image/png", "image/svg+xml"], Vr = [
|
|
59
59
|
// .csv
|
|
60
60
|
"text/csv",
|
|
61
61
|
// .xlsx
|
|
62
62
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
63
63
|
// .xls
|
|
64
64
|
"application/vnd.ms-excel"
|
|
65
|
-
],
|
|
66
|
-
const { fileType: n } = t, e = P(() =>
|
|
65
|
+
], $r = ["application/pdf"], nn = O((t) => {
|
|
66
|
+
const { fileType: n } = t, e = P(() => Vr.includes(n) ? /* @__PURE__ */ s(F, { icon: "RiFileExcelLine" }) : $r.includes(n) ? /* @__PURE__ */ s(F, { icon: "RiFilePdfLine" }) : Br.includes(n) ? /* @__PURE__ */ s(F, { icon: "RiFileImageLine" }) : /* @__PURE__ */ s(F, { icon: "RiFileLine" }), [n]);
|
|
67
67
|
return /* @__PURE__ */ s("div", { className: "h-max w-max", children: e });
|
|
68
68
|
});
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
|
|
69
|
+
nn.displayName = "FileIcon";
|
|
70
|
+
const ei = O(
|
|
71
|
+
Xe((t, n) => {
|
|
72
72
|
const { file: e, className: i, error: r, rightSlot: o, ...a } = t;
|
|
73
73
|
return /* @__PURE__ */ x(
|
|
74
74
|
"div",
|
|
75
75
|
{
|
|
76
|
-
className:
|
|
76
|
+
className: qe(
|
|
77
77
|
i,
|
|
78
78
|
"flex h-8 w-full items-center gap-2 rounded-md border border-(--base-a6) bg-(--base-2) text-sm py-1 px-2 h-max",
|
|
79
79
|
{
|
|
@@ -83,21 +83,21 @@ const Yn = O(
|
|
|
83
83
|
ref: n,
|
|
84
84
|
...a,
|
|
85
85
|
children: [
|
|
86
|
-
r ? /* @__PURE__ */ s(F, { icon: "RiFileWarningLine" }) : /* @__PURE__ */ s(
|
|
87
|
-
r || (e ? /* @__PURE__ */ s(
|
|
86
|
+
r ? /* @__PURE__ */ s(F, { icon: "RiFileWarningLine" }) : /* @__PURE__ */ s(nn, { fileType: (e == null ? void 0 : e.type) ?? "" }),
|
|
87
|
+
r || (e ? /* @__PURE__ */ s(ge, { className: "truncate", children: e.name }) : /* @__PURE__ */ s("div", { className: "flex w-full justify-center", children: /* @__PURE__ */ s(wt, {}) })),
|
|
88
88
|
o
|
|
89
89
|
]
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
92
|
})
|
|
93
93
|
);
|
|
94
|
-
|
|
95
|
-
const
|
|
94
|
+
ei.displayName = "FileCard";
|
|
95
|
+
const nt = 500, Ue = 1e4, we = {
|
|
96
96
|
danger: "danger",
|
|
97
97
|
warning: "warning",
|
|
98
98
|
info: "base",
|
|
99
99
|
success: "success"
|
|
100
|
-
},
|
|
100
|
+
}, ws = {
|
|
101
101
|
boolean: "RiCheckboxCircleLine",
|
|
102
102
|
date: "RiCalendarLine",
|
|
103
103
|
"multi-string": "RiListCheck",
|
|
@@ -111,7 +111,7 @@ const et = 500, Ve = 1e4, be = {
|
|
|
111
111
|
custom: "RiCodeSSlashLine",
|
|
112
112
|
section: "RiFolderLine"
|
|
113
113
|
};
|
|
114
|
-
class
|
|
114
|
+
class ti {
|
|
115
115
|
constructor(n) {
|
|
116
116
|
I(this, "type");
|
|
117
117
|
I(this, "identifier");
|
|
@@ -135,12 +135,12 @@ class Jn {
|
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
-
const
|
|
138
|
+
const ee = {
|
|
139
139
|
label: "",
|
|
140
140
|
description: "",
|
|
141
141
|
required: !1
|
|
142
142
|
};
|
|
143
|
-
class
|
|
143
|
+
class G extends ti {
|
|
144
144
|
constructor(e) {
|
|
145
145
|
const { label: i, required: r, image: o, fieldValidators: a = [], formValidators: l = [], ...m } = e;
|
|
146
146
|
super(m);
|
|
@@ -202,9 +202,9 @@ class H extends Jn {
|
|
|
202
202
|
return JSON.parse(e);
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
I(
|
|
206
|
-
const
|
|
207
|
-
const { id: n, field: e, formId: i, size: r, showInputOnly: o, onValuesChange: a, ...l } = t, [m, c, d] =
|
|
205
|
+
I(G, "fieldTypeName"), I(G, "fieldTypeDescription");
|
|
206
|
+
const Z = (t) => {
|
|
207
|
+
const { id: n, field: e, formId: i, size: r, showInputOnly: o, onValuesChange: a, ...l } = t, [m, c, d] = Qt(e.getId()), { touched: u } = c, h = c.error ?? e.description, y = c.error ? "danger" : void 0, b = n ?? `${i}-${e.getId()}-input`, f = `${b}-label`, g = e.required ? `${e.label} *` : e.label, C = P(() => ({
|
|
208
208
|
...m,
|
|
209
209
|
// name and value not being overridden
|
|
210
210
|
onChange: (E) => {
|
|
@@ -231,40 +231,40 @@ const J = (t) => {
|
|
|
231
231
|
/* Props that should be spread on the html element representing the field */
|
|
232
232
|
{ ...l, "aria-labelledby": f }
|
|
233
233
|
];
|
|
234
|
-
},
|
|
234
|
+
}, ni = hr(() => {
|
|
235
235
|
throw new Error("No ImageViewerProvider found");
|
|
236
|
-
}),
|
|
237
|
-
function
|
|
236
|
+
}), rn = () => pr(ni);
|
|
237
|
+
function he(t, n, { checkForDefaultPrevented: e = !0 } = {}) {
|
|
238
238
|
return function(r) {
|
|
239
239
|
if (t == null || t(r), e === !1 || !r.defaultPrevented)
|
|
240
240
|
return n == null ? void 0 : n(r);
|
|
241
241
|
};
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function Nn(t, n) {
|
|
244
244
|
if (typeof t == "function")
|
|
245
245
|
return t(n);
|
|
246
246
|
t != null && (t.current = n);
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function ii(...t) {
|
|
249
249
|
return (n) => {
|
|
250
250
|
let e = !1;
|
|
251
251
|
const i = t.map((r) => {
|
|
252
|
-
const o =
|
|
252
|
+
const o = Nn(r, n);
|
|
253
253
|
return !e && typeof o == "function" && (e = !0), o;
|
|
254
254
|
});
|
|
255
255
|
if (e)
|
|
256
256
|
return () => {
|
|
257
257
|
for (let r = 0; r < i.length; r++) {
|
|
258
258
|
const o = i[r];
|
|
259
|
-
typeof o == "function" ? o() :
|
|
259
|
+
typeof o == "function" ? o() : Nn(t[r], null);
|
|
260
260
|
}
|
|
261
261
|
};
|
|
262
262
|
};
|
|
263
263
|
}
|
|
264
|
-
function
|
|
265
|
-
return p.useCallback(
|
|
264
|
+
function Se(...t) {
|
|
265
|
+
return p.useCallback(ii(...t), t);
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function Ur(t, n) {
|
|
268
268
|
const e = p.createContext(n), i = (o) => {
|
|
269
269
|
const { children: a, ...l } = o, m = p.useMemo(() => l, Object.values(l));
|
|
270
270
|
return /* @__PURE__ */ s(e.Provider, { value: m, children: a });
|
|
@@ -278,7 +278,7 @@ function $r(t, n) {
|
|
|
278
278
|
}
|
|
279
279
|
return [i, r];
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function jr(t, n = []) {
|
|
282
282
|
let e = [];
|
|
283
283
|
function i(o, a) {
|
|
284
284
|
const l = p.createContext(a), m = e.length;
|
|
@@ -308,9 +308,9 @@ function Vr(t, n = []) {
|
|
|
308
308
|
);
|
|
309
309
|
};
|
|
310
310
|
};
|
|
311
|
-
return r.scopeName = t, [i,
|
|
311
|
+
return r.scopeName = t, [i, Wr(r, ...n)];
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function Wr(...t) {
|
|
314
314
|
const n = t[0];
|
|
315
315
|
if (t.length === 1) return n;
|
|
316
316
|
const e = () => {
|
|
@@ -328,16 +328,16 @@ function Ur(...t) {
|
|
|
328
328
|
};
|
|
329
329
|
return e.scopeName = n.scopeName, e;
|
|
330
330
|
}
|
|
331
|
-
var
|
|
332
|
-
},
|
|
333
|
-
}),
|
|
334
|
-
function
|
|
335
|
-
const [n, e] = p.useState(
|
|
336
|
-
return
|
|
337
|
-
e((i) => i ?? String(
|
|
331
|
+
var ct = globalThis != null && globalThis.document ? p.useLayoutEffect : () => {
|
|
332
|
+
}, qr = p.useId || (() => {
|
|
333
|
+
}), Hr = 0;
|
|
334
|
+
function Nt(t) {
|
|
335
|
+
const [n, e] = p.useState(qr());
|
|
336
|
+
return ct(() => {
|
|
337
|
+
e((i) => i ?? String(Hr++));
|
|
338
338
|
}, [t]), t || (n ? `radix-${n}` : "");
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function xe(t) {
|
|
341
341
|
const n = p.useRef(t);
|
|
342
342
|
return p.useEffect(() => {
|
|
343
343
|
n.current = t;
|
|
@@ -346,13 +346,13 @@ function we(t) {
|
|
|
346
346
|
return (i = n.current) == null ? void 0 : i.call(n, ...e);
|
|
347
347
|
}, []);
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function Gr({
|
|
350
350
|
prop: t,
|
|
351
351
|
defaultProp: n,
|
|
352
352
|
onChange: e = () => {
|
|
353
353
|
}
|
|
354
354
|
}) {
|
|
355
|
-
const [i, r] =
|
|
355
|
+
const [i, r] = Xr({ defaultProp: n, onChange: e }), o = t !== void 0, a = o ? t : i, l = xe(e), m = p.useCallback(
|
|
356
356
|
(c) => {
|
|
357
357
|
if (o) {
|
|
358
358
|
const u = typeof c == "function" ? c(t) : c;
|
|
@@ -364,42 +364,42 @@ function qr({
|
|
|
364
364
|
);
|
|
365
365
|
return [a, m];
|
|
366
366
|
}
|
|
367
|
-
function
|
|
367
|
+
function Xr({
|
|
368
368
|
defaultProp: t,
|
|
369
369
|
onChange: n
|
|
370
370
|
}) {
|
|
371
|
-
const e = p.useState(t), [i] = e, r = p.useRef(i), o =
|
|
371
|
+
const e = p.useState(t), [i] = e, r = p.useRef(i), o = xe(n);
|
|
372
372
|
return p.useEffect(() => {
|
|
373
373
|
r.current !== i && (o(i), r.current = i);
|
|
374
374
|
}, [i, r, o]), e;
|
|
375
375
|
}
|
|
376
|
-
var
|
|
377
|
-
const { children: e, ...i } = t, r = p.Children.toArray(e), o = r.find(
|
|
376
|
+
var on = p.forwardRef((t, n) => {
|
|
377
|
+
const { children: e, ...i } = t, r = p.Children.toArray(e), o = r.find(Qr);
|
|
378
378
|
if (o) {
|
|
379
379
|
const a = o.props.children, l = r.map((m) => m === o ? p.Children.count(a) > 1 ? p.Children.only(null) : p.isValidElement(a) ? a.props.children : null : m);
|
|
380
|
-
return /* @__PURE__ */ s(
|
|
380
|
+
return /* @__PURE__ */ s(Mt, { ...i, ref: n, children: p.isValidElement(a) ? p.cloneElement(a, void 0, l) : null });
|
|
381
381
|
}
|
|
382
|
-
return /* @__PURE__ */ s(
|
|
382
|
+
return /* @__PURE__ */ s(Mt, { ...i, ref: n, children: e });
|
|
383
383
|
});
|
|
384
|
-
|
|
385
|
-
var
|
|
384
|
+
on.displayName = "Slot";
|
|
385
|
+
var Mt = p.forwardRef((t, n) => {
|
|
386
386
|
const { children: e, ...i } = t;
|
|
387
387
|
if (p.isValidElement(e)) {
|
|
388
|
-
const r =
|
|
388
|
+
const r = Jr(e);
|
|
389
389
|
return p.cloneElement(e, {
|
|
390
|
-
...
|
|
390
|
+
...Yr(i, e.props),
|
|
391
391
|
// @ts-ignore
|
|
392
|
-
ref: n ?
|
|
392
|
+
ref: n ? ii(n, r) : r
|
|
393
393
|
});
|
|
394
394
|
}
|
|
395
395
|
return p.Children.count(e) > 1 ? p.Children.only(null) : null;
|
|
396
396
|
});
|
|
397
|
-
|
|
398
|
-
var
|
|
399
|
-
function
|
|
400
|
-
return p.isValidElement(t) && t.type ===
|
|
397
|
+
Mt.displayName = "SlotClone";
|
|
398
|
+
var Kr = ({ children: t }) => /* @__PURE__ */ s(be, { children: t });
|
|
399
|
+
function Qr(t) {
|
|
400
|
+
return p.isValidElement(t) && t.type === Kr;
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function Yr(t, n) {
|
|
403
403
|
const e = { ...n };
|
|
404
404
|
for (const i in n) {
|
|
405
405
|
const r = t[i], o = n[i];
|
|
@@ -409,12 +409,12 @@ function Kr(t, n) {
|
|
|
409
409
|
}
|
|
410
410
|
return { ...t, ...e };
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function Jr(t) {
|
|
413
413
|
var i, r;
|
|
414
414
|
let n = (i = Object.getOwnPropertyDescriptor(t.props, "ref")) == null ? void 0 : i.get, e = n && "isReactWarning" in n && n.isReactWarning;
|
|
415
415
|
return e ? t.ref : (n = (r = Object.getOwnPropertyDescriptor(t, "ref")) == null ? void 0 : r.get, e = n && "isReactWarning" in n && n.isReactWarning, e ? t.props.ref : t.props.ref || t.ref);
|
|
416
416
|
}
|
|
417
|
-
var
|
|
417
|
+
var Zr = [
|
|
418
418
|
"a",
|
|
419
419
|
"button",
|
|
420
420
|
"div",
|
|
@@ -431,18 +431,18 @@ var Yr = [
|
|
|
431
431
|
"span",
|
|
432
432
|
"svg",
|
|
433
433
|
"ul"
|
|
434
|
-
],
|
|
434
|
+
], ce = Zr.reduce((t, n) => {
|
|
435
435
|
const e = p.forwardRef((i, r) => {
|
|
436
|
-
const { asChild: o, ...a } = i, l = o ?
|
|
436
|
+
const { asChild: o, ...a } = i, l = o ? on : n;
|
|
437
437
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ s(l, { ...a, ref: r });
|
|
438
438
|
});
|
|
439
439
|
return e.displayName = `Primitive.${n}`, { ...t, [n]: e };
|
|
440
440
|
}, {});
|
|
441
|
-
function
|
|
442
|
-
t &&
|
|
441
|
+
function eo(t, n) {
|
|
442
|
+
t && vr.flushSync(() => t.dispatchEvent(n));
|
|
443
443
|
}
|
|
444
|
-
function
|
|
445
|
-
const e =
|
|
444
|
+
function to(t, n = globalThis == null ? void 0 : globalThis.document) {
|
|
445
|
+
const e = xe(t);
|
|
446
446
|
p.useEffect(() => {
|
|
447
447
|
const i = (r) => {
|
|
448
448
|
r.key === "Escape" && e(r);
|
|
@@ -450,11 +450,11 @@ function Zr(t, n = globalThis == null ? void 0 : globalThis.document) {
|
|
|
450
450
|
return n.addEventListener("keydown", i, { capture: !0 }), () => n.removeEventListener("keydown", i, { capture: !0 });
|
|
451
451
|
}, [e, n]);
|
|
452
452
|
}
|
|
453
|
-
var
|
|
453
|
+
var no = "DismissableLayer", zt = "dismissableLayer.update", io = "dismissableLayer.pointerDownOutside", ro = "dismissableLayer.focusOutside", Tn, ri = p.createContext({
|
|
454
454
|
layers: /* @__PURE__ */ new Set(),
|
|
455
455
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
456
456
|
branches: /* @__PURE__ */ new Set()
|
|
457
|
-
}),
|
|
457
|
+
}), oi = p.forwardRef(
|
|
458
458
|
(t, n) => {
|
|
459
459
|
const {
|
|
460
460
|
disableOutsidePointerEvents: e = !1,
|
|
@@ -464,27 +464,27 @@ var eo = "DismissableLayer", kt = "dismissableLayer.update", to = "dismissableLa
|
|
|
464
464
|
onInteractOutside: a,
|
|
465
465
|
onDismiss: l,
|
|
466
466
|
...m
|
|
467
|
-
} = t, c = p.useContext(
|
|
467
|
+
} = t, c = p.useContext(ri), [d, u] = p.useState(null), h = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, y] = p.useState({}), b = Se(n, (R) => u(R)), f = Array.from(c.layers), [g] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), C = f.indexOf(g), w = d ? f.indexOf(d) : -1, v = c.layersWithOutsidePointerEventsDisabled.size > 0, E = w >= C, S = so((R) => {
|
|
468
468
|
const T = R.target, D = [...c.branches].some((M) => M.contains(T));
|
|
469
469
|
!E || D || (r == null || r(R), a == null || a(R), R.defaultPrevented || l == null || l());
|
|
470
|
-
}, h), L =
|
|
470
|
+
}, h), L = lo((R) => {
|
|
471
471
|
const T = R.target;
|
|
472
472
|
[...c.branches].some((M) => M.contains(T)) || (o == null || o(R), a == null || a(R), R.defaultPrevented || l == null || l());
|
|
473
473
|
}, h);
|
|
474
|
-
return
|
|
474
|
+
return to((R) => {
|
|
475
475
|
w === c.layers.size - 1 && (i == null || i(R), !R.defaultPrevented && l && (R.preventDefault(), l()));
|
|
476
476
|
}, h), p.useEffect(() => {
|
|
477
477
|
if (d)
|
|
478
|
-
return e && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (
|
|
479
|
-
e && c.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents =
|
|
478
|
+
return e && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (Tn = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(d)), c.layers.add(d), Ln(), () => {
|
|
479
|
+
e && c.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = Tn);
|
|
480
480
|
};
|
|
481
481
|
}, [d, h, e, c]), p.useEffect(() => () => {
|
|
482
|
-
d && (c.layers.delete(d), c.layersWithOutsidePointerEventsDisabled.delete(d),
|
|
482
|
+
d && (c.layers.delete(d), c.layersWithOutsidePointerEventsDisabled.delete(d), Ln());
|
|
483
483
|
}, [d, c]), p.useEffect(() => {
|
|
484
484
|
const R = () => y({});
|
|
485
|
-
return document.addEventListener(
|
|
485
|
+
return document.addEventListener(zt, R), () => document.removeEventListener(zt, R);
|
|
486
486
|
}, []), /* @__PURE__ */ s(
|
|
487
|
-
|
|
487
|
+
ce.div,
|
|
488
488
|
{
|
|
489
489
|
...m,
|
|
490
490
|
ref: b,
|
|
@@ -492,9 +492,9 @@ var eo = "DismissableLayer", kt = "dismissableLayer.update", to = "dismissableLa
|
|
|
492
492
|
pointerEvents: v ? E ? "auto" : "none" : void 0,
|
|
493
493
|
...t.style
|
|
494
494
|
},
|
|
495
|
-
onFocusCapture:
|
|
496
|
-
onBlurCapture:
|
|
497
|
-
onPointerDownCapture:
|
|
495
|
+
onFocusCapture: he(t.onFocusCapture, L.onFocusCapture),
|
|
496
|
+
onBlurCapture: he(t.onBlurCapture, L.onBlurCapture),
|
|
497
|
+
onPointerDownCapture: he(
|
|
498
498
|
t.onPointerDownCapture,
|
|
499
499
|
S.onPointerDownCapture
|
|
500
500
|
)
|
|
@@ -502,27 +502,27 @@ var eo = "DismissableLayer", kt = "dismissableLayer.update", to = "dismissableLa
|
|
|
502
502
|
);
|
|
503
503
|
}
|
|
504
504
|
);
|
|
505
|
-
|
|
506
|
-
var
|
|
507
|
-
const e = p.useContext(
|
|
505
|
+
oi.displayName = no;
|
|
506
|
+
var oo = "DismissableLayerBranch", ao = p.forwardRef((t, n) => {
|
|
507
|
+
const e = p.useContext(ri), i = p.useRef(null), r = Se(n, i);
|
|
508
508
|
return p.useEffect(() => {
|
|
509
509
|
const o = i.current;
|
|
510
510
|
if (o)
|
|
511
511
|
return e.branches.add(o), () => {
|
|
512
512
|
e.branches.delete(o);
|
|
513
513
|
};
|
|
514
|
-
}, [e.branches]), /* @__PURE__ */ s(
|
|
514
|
+
}, [e.branches]), /* @__PURE__ */ s(ce.div, { ...t, ref: r });
|
|
515
515
|
});
|
|
516
|
-
|
|
517
|
-
function
|
|
518
|
-
const e =
|
|
516
|
+
ao.displayName = oo;
|
|
517
|
+
function so(t, n = globalThis == null ? void 0 : globalThis.document) {
|
|
518
|
+
const e = xe(t), i = p.useRef(!1), r = p.useRef(() => {
|
|
519
519
|
});
|
|
520
520
|
return p.useEffect(() => {
|
|
521
521
|
const o = (l) => {
|
|
522
522
|
if (l.target && !i.current) {
|
|
523
523
|
let m = function() {
|
|
524
|
-
|
|
525
|
-
|
|
524
|
+
ai(
|
|
525
|
+
io,
|
|
526
526
|
e,
|
|
527
527
|
c,
|
|
528
528
|
{ discrete: !0 }
|
|
@@ -544,11 +544,11 @@ function oo(t, n = globalThis == null ? void 0 : globalThis.document) {
|
|
|
544
544
|
onPointerDownCapture: () => i.current = !0
|
|
545
545
|
};
|
|
546
546
|
}
|
|
547
|
-
function
|
|
548
|
-
const e =
|
|
547
|
+
function lo(t, n = globalThis == null ? void 0 : globalThis.document) {
|
|
548
|
+
const e = xe(t), i = p.useRef(!1);
|
|
549
549
|
return p.useEffect(() => {
|
|
550
550
|
const r = (o) => {
|
|
551
|
-
o.target && !i.current &&
|
|
551
|
+
o.target && !i.current && ai(ro, e, { originalEvent: o }, {
|
|
552
552
|
discrete: !1
|
|
553
553
|
});
|
|
554
554
|
};
|
|
@@ -558,22 +558,22 @@ function ao(t, n = globalThis == null ? void 0 : globalThis.document) {
|
|
|
558
558
|
onBlurCapture: () => i.current = !1
|
|
559
559
|
};
|
|
560
560
|
}
|
|
561
|
-
function
|
|
562
|
-
const t = new CustomEvent(
|
|
561
|
+
function Ln() {
|
|
562
|
+
const t = new CustomEvent(zt);
|
|
563
563
|
document.dispatchEvent(t);
|
|
564
564
|
}
|
|
565
|
-
function
|
|
565
|
+
function ai(t, n, e, { discrete: i }) {
|
|
566
566
|
const r = e.originalEvent.target, o = new CustomEvent(t, { bubbles: !1, cancelable: !0, detail: e });
|
|
567
|
-
n && r.addEventListener(t, n, { once: !0 }), i ?
|
|
567
|
+
n && r.addEventListener(t, n, { once: !0 }), i ? eo(r, o) : r.dispatchEvent(o);
|
|
568
568
|
}
|
|
569
|
-
var
|
|
569
|
+
var Tt = "focusScope.autoFocusOnMount", Lt = "focusScope.autoFocusOnUnmount", Fn = { bubbles: !1, cancelable: !0 }, co = "FocusScope", si = p.forwardRef((t, n) => {
|
|
570
570
|
const {
|
|
571
571
|
loop: e = !1,
|
|
572
572
|
trapped: i = !1,
|
|
573
573
|
onMountAutoFocus: r,
|
|
574
574
|
onUnmountAutoFocus: o,
|
|
575
575
|
...a
|
|
576
|
-
} = t, [l, m] = p.useState(null), c =
|
|
576
|
+
} = t, [l, m] = p.useState(null), c = xe(r), d = xe(o), u = p.useRef(null), h = Se(n, (f) => m(f)), y = p.useRef({
|
|
577
577
|
paused: !1,
|
|
578
578
|
pause() {
|
|
579
579
|
this.paused = !0;
|
|
@@ -587,15 +587,15 @@ var Rt = "focusScope.autoFocusOnMount", Nt = "focusScope.autoFocusOnUnmount", Tn
|
|
|
587
587
|
let f = function(v) {
|
|
588
588
|
if (y.paused || !l) return;
|
|
589
589
|
const E = v.target;
|
|
590
|
-
l.contains(E) ? u.current = E :
|
|
590
|
+
l.contains(E) ? u.current = E : fe(u.current, { select: !0 });
|
|
591
591
|
}, g = function(v) {
|
|
592
592
|
if (y.paused || !l) return;
|
|
593
593
|
const E = v.relatedTarget;
|
|
594
|
-
E !== null && (l.contains(E) ||
|
|
594
|
+
E !== null && (l.contains(E) || fe(u.current, { select: !0 }));
|
|
595
595
|
}, C = function(v) {
|
|
596
596
|
if (document.activeElement === document.body)
|
|
597
597
|
for (const S of v)
|
|
598
|
-
S.removedNodes.length > 0 &&
|
|
598
|
+
S.removedNodes.length > 0 && fe(l);
|
|
599
599
|
};
|
|
600
600
|
document.addEventListener("focusin", f), document.addEventListener("focusout", g);
|
|
601
601
|
const w = new MutationObserver(C);
|
|
@@ -605,16 +605,16 @@ var Rt = "focusScope.autoFocusOnMount", Nt = "focusScope.autoFocusOnUnmount", Tn
|
|
|
605
605
|
}
|
|
606
606
|
}, [i, l, y.paused]), p.useEffect(() => {
|
|
607
607
|
if (l) {
|
|
608
|
-
|
|
608
|
+
Dn.add(y);
|
|
609
609
|
const f = document.activeElement;
|
|
610
610
|
if (!l.contains(f)) {
|
|
611
|
-
const C = new CustomEvent(
|
|
612
|
-
l.addEventListener(
|
|
611
|
+
const C = new CustomEvent(Tt, Fn);
|
|
612
|
+
l.addEventListener(Tt, c), l.dispatchEvent(C), C.defaultPrevented || (uo(go(li(l)), { select: !0 }), document.activeElement === f && fe(l));
|
|
613
613
|
}
|
|
614
614
|
return () => {
|
|
615
|
-
l.removeEventListener(
|
|
616
|
-
const C = new CustomEvent(
|
|
617
|
-
l.addEventListener(
|
|
615
|
+
l.removeEventListener(Tt, c), setTimeout(() => {
|
|
616
|
+
const C = new CustomEvent(Lt, Fn);
|
|
617
|
+
l.addEventListener(Lt, d), l.dispatchEvent(C), C.defaultPrevented || fe(f ?? document.body, { select: !0 }), l.removeEventListener(Lt, d), Dn.remove(y);
|
|
618
618
|
}, 0);
|
|
619
619
|
};
|
|
620
620
|
}
|
|
@@ -624,25 +624,25 @@ var Rt = "focusScope.autoFocusOnMount", Nt = "focusScope.autoFocusOnUnmount", Tn
|
|
|
624
624
|
if (!e && !i || y.paused) return;
|
|
625
625
|
const g = f.key === "Tab" && !f.altKey && !f.ctrlKey && !f.metaKey, C = document.activeElement;
|
|
626
626
|
if (g && C) {
|
|
627
|
-
const w = f.currentTarget, [v, E] =
|
|
628
|
-
v && E ? !f.shiftKey && C === E ? (f.preventDefault(), e &&
|
|
627
|
+
const w = f.currentTarget, [v, E] = fo(w);
|
|
628
|
+
v && E ? !f.shiftKey && C === E ? (f.preventDefault(), e && fe(v, { select: !0 })) : f.shiftKey && C === v && (f.preventDefault(), e && fe(E, { select: !0 })) : C === w && f.preventDefault();
|
|
629
629
|
}
|
|
630
630
|
},
|
|
631
631
|
[e, i, y.paused]
|
|
632
632
|
);
|
|
633
|
-
return /* @__PURE__ */ s(
|
|
633
|
+
return /* @__PURE__ */ s(ce.div, { tabIndex: -1, ...a, ref: h, onKeyDown: b });
|
|
634
634
|
});
|
|
635
|
-
|
|
636
|
-
function
|
|
635
|
+
si.displayName = co;
|
|
636
|
+
function uo(t, { select: n = !1 } = {}) {
|
|
637
637
|
const e = document.activeElement;
|
|
638
638
|
for (const i of t)
|
|
639
|
-
if (
|
|
639
|
+
if (fe(i, { select: n }), document.activeElement !== e) return;
|
|
640
640
|
}
|
|
641
|
-
function
|
|
642
|
-
const n =
|
|
641
|
+
function fo(t) {
|
|
642
|
+
const n = li(t), e = An(n, t), i = An(n.reverse(), t);
|
|
643
643
|
return [e, i];
|
|
644
644
|
}
|
|
645
|
-
function
|
|
645
|
+
function li(t) {
|
|
646
646
|
const n = [], e = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, {
|
|
647
647
|
acceptNode: (i) => {
|
|
648
648
|
const r = i.tagName === "INPUT" && i.type === "hidden";
|
|
@@ -652,11 +652,11 @@ function oi(t) {
|
|
|
652
652
|
for (; e.nextNode(); ) n.push(e.currentNode);
|
|
653
653
|
return n;
|
|
654
654
|
}
|
|
655
|
-
function
|
|
655
|
+
function An(t, n) {
|
|
656
656
|
for (const e of t)
|
|
657
|
-
if (!
|
|
657
|
+
if (!mo(e, { upTo: n })) return e;
|
|
658
658
|
}
|
|
659
|
-
function
|
|
659
|
+
function mo(t, { upTo: n }) {
|
|
660
660
|
if (getComputedStyle(t).visibility === "hidden") return !0;
|
|
661
661
|
for (; t; ) {
|
|
662
662
|
if (n !== void 0 && t === n) return !1;
|
|
@@ -665,54 +665,54 @@ function uo(t, { upTo: n }) {
|
|
|
665
665
|
}
|
|
666
666
|
return !1;
|
|
667
667
|
}
|
|
668
|
-
function
|
|
668
|
+
function ho(t) {
|
|
669
669
|
return t instanceof HTMLInputElement && "select" in t;
|
|
670
670
|
}
|
|
671
|
-
function
|
|
671
|
+
function fe(t, { select: n = !1 } = {}) {
|
|
672
672
|
if (t && t.focus) {
|
|
673
673
|
const e = document.activeElement;
|
|
674
|
-
t.focus({ preventScroll: !0 }), t !== e &&
|
|
674
|
+
t.focus({ preventScroll: !0 }), t !== e && ho(t) && n && t.select();
|
|
675
675
|
}
|
|
676
676
|
}
|
|
677
|
-
var
|
|
678
|
-
function
|
|
677
|
+
var Dn = po();
|
|
678
|
+
function po() {
|
|
679
679
|
let t = [];
|
|
680
680
|
return {
|
|
681
681
|
add(n) {
|
|
682
682
|
const e = t[0];
|
|
683
|
-
n !== e && (e == null || e.pause()), t =
|
|
683
|
+
n !== e && (e == null || e.pause()), t = On(t, n), t.unshift(n);
|
|
684
684
|
},
|
|
685
685
|
remove(n) {
|
|
686
686
|
var e;
|
|
687
|
-
t =
|
|
687
|
+
t = On(t, n), (e = t[0]) == null || e.resume();
|
|
688
688
|
}
|
|
689
689
|
};
|
|
690
690
|
}
|
|
691
|
-
function
|
|
691
|
+
function On(t, n) {
|
|
692
692
|
const e = [...t], i = e.indexOf(n);
|
|
693
693
|
return i !== -1 && e.splice(i, 1), e;
|
|
694
694
|
}
|
|
695
|
-
function
|
|
695
|
+
function go(t) {
|
|
696
696
|
return t.filter((n) => n.tagName !== "A");
|
|
697
697
|
}
|
|
698
|
-
var
|
|
698
|
+
var vo = "Portal", ci = p.forwardRef((t, n) => {
|
|
699
699
|
var l;
|
|
700
700
|
const { container: e, ...i } = t, [r, o] = p.useState(!1);
|
|
701
|
-
|
|
701
|
+
ct(() => o(!0), []);
|
|
702
702
|
const a = e || r && ((l = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : l.body);
|
|
703
|
-
return a ?
|
|
703
|
+
return a ? yr.createPortal(/* @__PURE__ */ s(ce.div, { ...i, ref: n }), a) : null;
|
|
704
704
|
});
|
|
705
|
-
|
|
706
|
-
function
|
|
705
|
+
ci.displayName = vo;
|
|
706
|
+
function yo(t, n) {
|
|
707
707
|
return p.useReducer((e, i) => n[e][i] ?? e, t);
|
|
708
708
|
}
|
|
709
|
-
var
|
|
710
|
-
const { present: n, children: e } = t, i =
|
|
709
|
+
var Et = (t) => {
|
|
710
|
+
const { present: n, children: e } = t, i = bo(n), r = typeof e == "function" ? e({ present: i.isPresent }) : p.Children.only(e), o = Se(i.ref, wo(r));
|
|
711
711
|
return typeof e == "function" || i.isPresent ? p.cloneElement(r, { ref: o }) : null;
|
|
712
712
|
};
|
|
713
|
-
|
|
714
|
-
function
|
|
715
|
-
const [n, e] = p.useState(), i = p.useRef({}), r = p.useRef(t), o = p.useRef("none"), a = t ? "mounted" : "unmounted", [l, m] =
|
|
713
|
+
Et.displayName = "Presence";
|
|
714
|
+
function bo(t) {
|
|
715
|
+
const [n, e] = p.useState(), i = p.useRef({}), r = p.useRef(t), o = p.useRef("none"), a = t ? "mounted" : "unmounted", [l, m] = yo(a, {
|
|
716
716
|
mounted: {
|
|
717
717
|
UNMOUNT: "unmounted",
|
|
718
718
|
ANIMATION_OUT: "unmountSuspended"
|
|
@@ -726,19 +726,19 @@ function vo(t) {
|
|
|
726
726
|
}
|
|
727
727
|
});
|
|
728
728
|
return p.useEffect(() => {
|
|
729
|
-
const c =
|
|
729
|
+
const c = Ke(i.current);
|
|
730
730
|
o.current = l === "mounted" ? c : "none";
|
|
731
|
-
}, [l]),
|
|
731
|
+
}, [l]), ct(() => {
|
|
732
732
|
const c = i.current, d = r.current;
|
|
733
733
|
if (d !== t) {
|
|
734
|
-
const h = o.current, y =
|
|
734
|
+
const h = o.current, y = Ke(c);
|
|
735
735
|
t ? m("MOUNT") : y === "none" || (c == null ? void 0 : c.display) === "none" ? m("UNMOUNT") : m(d && h !== y ? "ANIMATION_OUT" : "UNMOUNT"), r.current = t;
|
|
736
736
|
}
|
|
737
|
-
}, [t, m]),
|
|
737
|
+
}, [t, m]), ct(() => {
|
|
738
738
|
if (n) {
|
|
739
739
|
let c;
|
|
740
740
|
const d = n.ownerDocument.defaultView ?? window, u = (y) => {
|
|
741
|
-
const f =
|
|
741
|
+
const f = Ke(i.current).includes(y.animationName);
|
|
742
742
|
if (y.target === n && f && (m("ANIMATION_END"), !r.current)) {
|
|
743
743
|
const g = n.style.animationFillMode;
|
|
744
744
|
n.style.animationFillMode = "forwards", c = d.setTimeout(() => {
|
|
@@ -746,7 +746,7 @@ function vo(t) {
|
|
|
746
746
|
});
|
|
747
747
|
}
|
|
748
748
|
}, h = (y) => {
|
|
749
|
-
y.target === n && (o.current =
|
|
749
|
+
y.target === n && (o.current = Ke(i.current));
|
|
750
750
|
};
|
|
751
751
|
return n.addEventListener("animationstart", h), n.addEventListener("animationcancel", u), n.addEventListener("animationend", u), () => {
|
|
752
752
|
d.clearTimeout(c), n.removeEventListener("animationstart", h), n.removeEventListener("animationcancel", u), n.removeEventListener("animationend", u);
|
|
@@ -760,37 +760,37 @@ function vo(t) {
|
|
|
760
760
|
}, [])
|
|
761
761
|
};
|
|
762
762
|
}
|
|
763
|
-
function
|
|
763
|
+
function Ke(t) {
|
|
764
764
|
return (t == null ? void 0 : t.animationName) || "none";
|
|
765
765
|
}
|
|
766
|
-
function
|
|
766
|
+
function wo(t) {
|
|
767
767
|
var i, r;
|
|
768
768
|
let n = (i = Object.getOwnPropertyDescriptor(t.props, "ref")) == null ? void 0 : i.get, e = n && "isReactWarning" in n && n.isReactWarning;
|
|
769
769
|
return e ? t.ref : (n = (r = Object.getOwnPropertyDescriptor(t, "ref")) == null ? void 0 : r.get, e = n && "isReactWarning" in n && n.isReactWarning, e ? t.props.ref : t.props.ref || t.ref);
|
|
770
770
|
}
|
|
771
|
-
var
|
|
772
|
-
function
|
|
771
|
+
var Ft = 0;
|
|
772
|
+
function xo() {
|
|
773
773
|
p.useEffect(() => {
|
|
774
774
|
const t = document.querySelectorAll("[data-radix-focus-guard]");
|
|
775
|
-
return document.body.insertAdjacentElement("afterbegin", t[0] ??
|
|
776
|
-
|
|
775
|
+
return document.body.insertAdjacentElement("afterbegin", t[0] ?? Pn()), document.body.insertAdjacentElement("beforeend", t[1] ?? Pn()), Ft++, () => {
|
|
776
|
+
Ft === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((n) => n.remove()), Ft--;
|
|
777
777
|
};
|
|
778
778
|
}, []);
|
|
779
779
|
}
|
|
780
|
-
function
|
|
780
|
+
function Pn() {
|
|
781
781
|
const t = document.createElement("span");
|
|
782
782
|
return t.setAttribute("data-radix-focus-guard", ""), t.tabIndex = 0, t.style.outline = "none", t.style.opacity = "0", t.style.position = "fixed", t.style.pointerEvents = "none", t;
|
|
783
783
|
}
|
|
784
|
-
var
|
|
785
|
-
return
|
|
784
|
+
var oe = function() {
|
|
785
|
+
return oe = Object.assign || function(n) {
|
|
786
786
|
for (var e, i = 1, r = arguments.length; i < r; i++) {
|
|
787
787
|
e = arguments[i];
|
|
788
788
|
for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (n[o] = e[o]);
|
|
789
789
|
}
|
|
790
790
|
return n;
|
|
791
|
-
},
|
|
791
|
+
}, oe.apply(this, arguments);
|
|
792
792
|
};
|
|
793
|
-
function
|
|
793
|
+
function di(t, n) {
|
|
794
794
|
var e = {};
|
|
795
795
|
for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && n.indexOf(i) < 0 && (e[i] = t[i]);
|
|
796
796
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -798,17 +798,17 @@ function si(t, n) {
|
|
|
798
798
|
n.indexOf(i[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[r]) && (e[i[r]] = t[i[r]]);
|
|
799
799
|
return e;
|
|
800
800
|
}
|
|
801
|
-
function
|
|
801
|
+
function Co(t, n, e) {
|
|
802
802
|
if (e || arguments.length === 2) for (var i = 0, r = n.length, o; i < r; i++)
|
|
803
803
|
(o || !(i in n)) && (o || (o = Array.prototype.slice.call(n, 0, i)), o[i] = n[i]);
|
|
804
804
|
return t.concat(o || Array.prototype.slice.call(n));
|
|
805
805
|
}
|
|
806
|
-
var
|
|
807
|
-
function
|
|
806
|
+
var it = "right-scroll-bar-position", rt = "width-before-scroll-bar", Eo = "with-scroll-bars-hidden", Io = "--removed-body-scroll-bar-size";
|
|
807
|
+
function At(t, n) {
|
|
808
808
|
return typeof t == "function" ? t(n) : t && (t.current = n), t;
|
|
809
809
|
}
|
|
810
|
-
function
|
|
811
|
-
var e =
|
|
810
|
+
function So(t, n) {
|
|
811
|
+
var e = $(function() {
|
|
812
812
|
return {
|
|
813
813
|
// value
|
|
814
814
|
value: t,
|
|
@@ -828,31 +828,31 @@ function Eo(t, n) {
|
|
|
828
828
|
})[0];
|
|
829
829
|
return e.callback = n, e.facade;
|
|
830
830
|
}
|
|
831
|
-
var
|
|
832
|
-
function
|
|
833
|
-
var e =
|
|
831
|
+
var Ro = typeof window < "u" ? p.useLayoutEffect : p.useEffect, kn = /* @__PURE__ */ new WeakMap();
|
|
832
|
+
function No(t, n) {
|
|
833
|
+
var e = So(null, function(i) {
|
|
834
834
|
return t.forEach(function(r) {
|
|
835
|
-
return
|
|
835
|
+
return At(r, i);
|
|
836
836
|
});
|
|
837
837
|
});
|
|
838
|
-
return
|
|
839
|
-
var i =
|
|
838
|
+
return Ro(function() {
|
|
839
|
+
var i = kn.get(e);
|
|
840
840
|
if (i) {
|
|
841
841
|
var r = new Set(i), o = new Set(t), a = e.current;
|
|
842
842
|
r.forEach(function(l) {
|
|
843
|
-
o.has(l) ||
|
|
843
|
+
o.has(l) || At(l, null);
|
|
844
844
|
}), o.forEach(function(l) {
|
|
845
|
-
r.has(l) ||
|
|
845
|
+
r.has(l) || At(l, a);
|
|
846
846
|
});
|
|
847
847
|
}
|
|
848
|
-
|
|
848
|
+
kn.set(e, t);
|
|
849
849
|
}, [t]), e;
|
|
850
850
|
}
|
|
851
|
-
function
|
|
851
|
+
function To(t) {
|
|
852
852
|
return t;
|
|
853
853
|
}
|
|
854
|
-
function
|
|
855
|
-
n === void 0 && (n =
|
|
854
|
+
function Lo(t, n) {
|
|
855
|
+
n === void 0 && (n = To);
|
|
856
856
|
var e = [], i = !1, r = {
|
|
857
857
|
read: function() {
|
|
858
858
|
if (i)
|
|
@@ -906,78 +906,78 @@ function No(t, n) {
|
|
|
906
906
|
};
|
|
907
907
|
return r;
|
|
908
908
|
}
|
|
909
|
-
function
|
|
909
|
+
function Fo(t) {
|
|
910
910
|
t === void 0 && (t = {});
|
|
911
|
-
var n =
|
|
912
|
-
return n.options =
|
|
911
|
+
var n = Lo(null);
|
|
912
|
+
return n.options = oe({ async: !0, ssr: !1 }, t), n;
|
|
913
913
|
}
|
|
914
|
-
var
|
|
915
|
-
var n = t.sideCar, e =
|
|
914
|
+
var ui = function(t) {
|
|
915
|
+
var n = t.sideCar, e = di(t, ["sideCar"]);
|
|
916
916
|
if (!n)
|
|
917
917
|
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
918
918
|
var i = n.read();
|
|
919
919
|
if (!i)
|
|
920
920
|
throw new Error("Sidecar medium not found");
|
|
921
|
-
return p.createElement(i,
|
|
921
|
+
return p.createElement(i, oe({}, e));
|
|
922
922
|
};
|
|
923
|
-
|
|
924
|
-
function
|
|
925
|
-
return t.useMedium(n),
|
|
923
|
+
ui.isSideCarExport = !0;
|
|
924
|
+
function Ao(t, n) {
|
|
925
|
+
return t.useMedium(n), ui;
|
|
926
926
|
}
|
|
927
|
-
var
|
|
928
|
-
},
|
|
927
|
+
var fi = Fo(), Dt = function() {
|
|
928
|
+
}, It = p.forwardRef(function(t, n) {
|
|
929
929
|
var e = p.useRef(null), i = p.useState({
|
|
930
|
-
onScrollCapture:
|
|
931
|
-
onWheelCapture:
|
|
932
|
-
onTouchMoveCapture:
|
|
933
|
-
}), r = i[0], o = i[1], a = t.forwardProps, l = t.children, m = t.className, c = t.removeScrollBar, d = t.enabled, u = t.shards, h = t.sideCar, y = t.noIsolation, b = t.inert, f = t.allowPinchZoom, g = t.as, C = g === void 0 ? "div" : g, w = t.gapMode, v =
|
|
930
|
+
onScrollCapture: Dt,
|
|
931
|
+
onWheelCapture: Dt,
|
|
932
|
+
onTouchMoveCapture: Dt
|
|
933
|
+
}), r = i[0], o = i[1], a = t.forwardProps, l = t.children, m = t.className, c = t.removeScrollBar, d = t.enabled, u = t.shards, h = t.sideCar, y = t.noIsolation, b = t.inert, f = t.allowPinchZoom, g = t.as, C = g === void 0 ? "div" : g, w = t.gapMode, v = di(t, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), E = h, S = No([e, n]), L = oe(oe({}, v), r);
|
|
934
934
|
return p.createElement(
|
|
935
935
|
p.Fragment,
|
|
936
936
|
null,
|
|
937
|
-
d && p.createElement(E, { sideCar:
|
|
938
|
-
a ? p.cloneElement(p.Children.only(l),
|
|
937
|
+
d && p.createElement(E, { sideCar: fi, removeScrollBar: c, shards: u, noIsolation: y, inert: b, setCallbacks: o, allowPinchZoom: !!f, lockRef: e, gapMode: w }),
|
|
938
|
+
a ? p.cloneElement(p.Children.only(l), oe(oe({}, L), { ref: S })) : p.createElement(C, oe({}, L, { className: m, ref: S }), l)
|
|
939
939
|
);
|
|
940
940
|
});
|
|
941
|
-
|
|
941
|
+
It.defaultProps = {
|
|
942
942
|
enabled: !0,
|
|
943
943
|
removeScrollBar: !0,
|
|
944
944
|
inert: !1
|
|
945
945
|
};
|
|
946
|
-
|
|
947
|
-
fullWidth:
|
|
948
|
-
zeroRight:
|
|
946
|
+
It.classNames = {
|
|
947
|
+
fullWidth: rt,
|
|
948
|
+
zeroRight: it
|
|
949
949
|
};
|
|
950
|
-
var
|
|
950
|
+
var Do = function() {
|
|
951
951
|
if (typeof __webpack_nonce__ < "u")
|
|
952
952
|
return __webpack_nonce__;
|
|
953
953
|
};
|
|
954
|
-
function
|
|
954
|
+
function Oo() {
|
|
955
955
|
if (!document)
|
|
956
956
|
return null;
|
|
957
957
|
var t = document.createElement("style");
|
|
958
958
|
t.type = "text/css";
|
|
959
|
-
var n =
|
|
959
|
+
var n = Do();
|
|
960
960
|
return n && t.setAttribute("nonce", n), t;
|
|
961
961
|
}
|
|
962
|
-
function
|
|
962
|
+
function Po(t, n) {
|
|
963
963
|
t.styleSheet ? t.styleSheet.cssText = n : t.appendChild(document.createTextNode(n));
|
|
964
964
|
}
|
|
965
|
-
function
|
|
965
|
+
function ko(t) {
|
|
966
966
|
var n = document.head || document.getElementsByTagName("head")[0];
|
|
967
967
|
n.appendChild(t);
|
|
968
968
|
}
|
|
969
|
-
var
|
|
969
|
+
var Mo = function() {
|
|
970
970
|
var t = 0, n = null;
|
|
971
971
|
return {
|
|
972
972
|
add: function(e) {
|
|
973
|
-
t == 0 && (n =
|
|
973
|
+
t == 0 && (n = Oo()) && (Po(n, e), ko(n)), t++;
|
|
974
974
|
},
|
|
975
975
|
remove: function() {
|
|
976
976
|
t--, !t && n && (n.parentNode && n.parentNode.removeChild(n), n = null);
|
|
977
977
|
}
|
|
978
978
|
};
|
|
979
|
-
},
|
|
980
|
-
var t =
|
|
979
|
+
}, zo = function() {
|
|
980
|
+
var t = Mo();
|
|
981
981
|
return function(n, e) {
|
|
982
982
|
p.useEffect(function() {
|
|
983
983
|
return t.add(n), function() {
|
|
@@ -985,40 +985,40 @@ var Po = function() {
|
|
|
985
985
|
};
|
|
986
986
|
}, [n && e]);
|
|
987
987
|
};
|
|
988
|
-
},
|
|
989
|
-
var t =
|
|
988
|
+
}, mi = function() {
|
|
989
|
+
var t = zo(), n = function(e) {
|
|
990
990
|
var i = e.styles, r = e.dynamic;
|
|
991
991
|
return t(i, r), null;
|
|
992
992
|
};
|
|
993
993
|
return n;
|
|
994
|
-
},
|
|
994
|
+
}, _o = {
|
|
995
995
|
left: 0,
|
|
996
996
|
top: 0,
|
|
997
997
|
right: 0,
|
|
998
998
|
gap: 0
|
|
999
|
-
},
|
|
999
|
+
}, Ot = function(t) {
|
|
1000
1000
|
return parseInt(t || "", 10) || 0;
|
|
1001
|
-
},
|
|
1001
|
+
}, Bo = function(t) {
|
|
1002
1002
|
var n = window.getComputedStyle(document.body), e = n[t === "padding" ? "paddingLeft" : "marginLeft"], i = n[t === "padding" ? "paddingTop" : "marginTop"], r = n[t === "padding" ? "paddingRight" : "marginRight"];
|
|
1003
|
-
return [
|
|
1004
|
-
},
|
|
1003
|
+
return [Ot(e), Ot(i), Ot(r)];
|
|
1004
|
+
}, Vo = function(t) {
|
|
1005
1005
|
if (t === void 0 && (t = "margin"), typeof window > "u")
|
|
1006
|
-
return
|
|
1007
|
-
var n =
|
|
1006
|
+
return _o;
|
|
1007
|
+
var n = Bo(t), e = document.documentElement.clientWidth, i = window.innerWidth;
|
|
1008
1008
|
return {
|
|
1009
1009
|
left: n[0],
|
|
1010
1010
|
top: n[1],
|
|
1011
1011
|
right: n[2],
|
|
1012
1012
|
gap: Math.max(0, i - e + n[2] - n[0])
|
|
1013
1013
|
};
|
|
1014
|
-
},
|
|
1014
|
+
}, $o = mi(), je = "data-scroll-locked", Uo = function(t, n, e, i) {
|
|
1015
1015
|
var r = t.left, o = t.top, a = t.right, l = t.gap;
|
|
1016
1016
|
return e === void 0 && (e = "margin"), `
|
|
1017
|
-
.`.concat(
|
|
1017
|
+
.`.concat(Eo, ` {
|
|
1018
1018
|
overflow: hidden `).concat(i, `;
|
|
1019
1019
|
padding-right: `).concat(l, "px ").concat(i, `;
|
|
1020
1020
|
}
|
|
1021
|
-
body[`).concat(
|
|
1021
|
+
body[`).concat(je, `] {
|
|
1022
1022
|
overflow: hidden `).concat(i, `;
|
|
1023
1023
|
overscroll-behavior: contain;
|
|
1024
1024
|
`).concat([
|
|
@@ -1035,136 +1035,136 @@ var Po = function() {
|
|
|
1035
1035
|
].filter(Boolean).join(""), `
|
|
1036
1036
|
}
|
|
1037
1037
|
|
|
1038
|
-
.`).concat(
|
|
1038
|
+
.`).concat(it, ` {
|
|
1039
1039
|
right: `).concat(l, "px ").concat(i, `;
|
|
1040
1040
|
}
|
|
1041
1041
|
|
|
1042
|
-
.`).concat(
|
|
1042
|
+
.`).concat(rt, ` {
|
|
1043
1043
|
margin-right: `).concat(l, "px ").concat(i, `;
|
|
1044
1044
|
}
|
|
1045
1045
|
|
|
1046
|
-
.`).concat(
|
|
1046
|
+
.`).concat(it, " .").concat(it, ` {
|
|
1047
1047
|
right: 0 `).concat(i, `;
|
|
1048
1048
|
}
|
|
1049
1049
|
|
|
1050
|
-
.`).concat(
|
|
1050
|
+
.`).concat(rt, " .").concat(rt, ` {
|
|
1051
1051
|
margin-right: 0 `).concat(i, `;
|
|
1052
1052
|
}
|
|
1053
1053
|
|
|
1054
|
-
body[`).concat(
|
|
1055
|
-
`).concat(
|
|
1054
|
+
body[`).concat(je, `] {
|
|
1055
|
+
`).concat(Io, ": ").concat(l, `px;
|
|
1056
1056
|
}
|
|
1057
1057
|
`);
|
|
1058
|
-
},
|
|
1059
|
-
var t = parseInt(document.body.getAttribute(
|
|
1058
|
+
}, Mn = function() {
|
|
1059
|
+
var t = parseInt(document.body.getAttribute(je) || "0", 10);
|
|
1060
1060
|
return isFinite(t) ? t : 0;
|
|
1061
|
-
},
|
|
1061
|
+
}, jo = function() {
|
|
1062
1062
|
p.useEffect(function() {
|
|
1063
|
-
return document.body.setAttribute(
|
|
1064
|
-
var t =
|
|
1065
|
-
t <= 0 ? document.body.removeAttribute(
|
|
1063
|
+
return document.body.setAttribute(je, (Mn() + 1).toString()), function() {
|
|
1064
|
+
var t = Mn() - 1;
|
|
1065
|
+
t <= 0 ? document.body.removeAttribute(je) : document.body.setAttribute(je, t.toString());
|
|
1066
1066
|
};
|
|
1067
1067
|
}, []);
|
|
1068
|
-
},
|
|
1068
|
+
}, Wo = function(t) {
|
|
1069
1069
|
var n = t.noRelative, e = t.noImportant, i = t.gapMode, r = i === void 0 ? "margin" : i;
|
|
1070
|
-
|
|
1070
|
+
jo();
|
|
1071
1071
|
var o = p.useMemo(function() {
|
|
1072
|
-
return
|
|
1072
|
+
return Vo(r);
|
|
1073
1073
|
}, [r]);
|
|
1074
|
-
return p.createElement(
|
|
1075
|
-
},
|
|
1074
|
+
return p.createElement($o, { styles: Uo(o, !n, r, e ? "" : "!important") });
|
|
1075
|
+
}, _t = !1;
|
|
1076
1076
|
if (typeof window < "u")
|
|
1077
1077
|
try {
|
|
1078
|
-
var
|
|
1078
|
+
var Qe = Object.defineProperty({}, "passive", {
|
|
1079
1079
|
get: function() {
|
|
1080
|
-
return
|
|
1080
|
+
return _t = !0, !0;
|
|
1081
1081
|
}
|
|
1082
1082
|
});
|
|
1083
|
-
window.addEventListener("test",
|
|
1083
|
+
window.addEventListener("test", Qe, Qe), window.removeEventListener("test", Qe, Qe);
|
|
1084
1084
|
} catch {
|
|
1085
|
-
|
|
1085
|
+
_t = !1;
|
|
1086
1086
|
}
|
|
1087
|
-
var
|
|
1087
|
+
var Le = _t ? { passive: !1 } : !1, qo = function(t) {
|
|
1088
1088
|
return t.tagName === "TEXTAREA";
|
|
1089
|
-
},
|
|
1089
|
+
}, hi = function(t, n) {
|
|
1090
1090
|
if (!(t instanceof Element))
|
|
1091
1091
|
return !1;
|
|
1092
1092
|
var e = window.getComputedStyle(t);
|
|
1093
1093
|
return (
|
|
1094
1094
|
// not-not-scrollable
|
|
1095
1095
|
e[n] !== "hidden" && // contains scroll inside self
|
|
1096
|
-
!(e.overflowY === e.overflowX && !
|
|
1096
|
+
!(e.overflowY === e.overflowX && !qo(t) && e[n] === "visible")
|
|
1097
1097
|
);
|
|
1098
|
-
},
|
|
1099
|
-
return
|
|
1100
|
-
},
|
|
1101
|
-
return
|
|
1102
|
-
},
|
|
1098
|
+
}, Ho = function(t) {
|
|
1099
|
+
return hi(t, "overflowY");
|
|
1100
|
+
}, Go = function(t) {
|
|
1101
|
+
return hi(t, "overflowX");
|
|
1102
|
+
}, zn = function(t, n) {
|
|
1103
1103
|
var e = n.ownerDocument, i = n;
|
|
1104
1104
|
do {
|
|
1105
1105
|
typeof ShadowRoot < "u" && i instanceof ShadowRoot && (i = i.host);
|
|
1106
|
-
var r =
|
|
1106
|
+
var r = pi(t, i);
|
|
1107
1107
|
if (r) {
|
|
1108
|
-
var o =
|
|
1108
|
+
var o = gi(t, i), a = o[1], l = o[2];
|
|
1109
1109
|
if (a > l)
|
|
1110
1110
|
return !0;
|
|
1111
1111
|
}
|
|
1112
1112
|
i = i.parentNode;
|
|
1113
1113
|
} while (i && i !== e.body);
|
|
1114
1114
|
return !1;
|
|
1115
|
-
},
|
|
1115
|
+
}, Xo = function(t) {
|
|
1116
1116
|
var n = t.scrollTop, e = t.scrollHeight, i = t.clientHeight;
|
|
1117
1117
|
return [
|
|
1118
1118
|
n,
|
|
1119
1119
|
e,
|
|
1120
1120
|
i
|
|
1121
1121
|
];
|
|
1122
|
-
},
|
|
1122
|
+
}, Ko = function(t) {
|
|
1123
1123
|
var n = t.scrollLeft, e = t.scrollWidth, i = t.clientWidth;
|
|
1124
1124
|
return [
|
|
1125
1125
|
n,
|
|
1126
1126
|
e,
|
|
1127
1127
|
i
|
|
1128
1128
|
];
|
|
1129
|
-
},
|
|
1130
|
-
return t === "v" ? Wo(n) : qo(n);
|
|
1131
|
-
}, mi = function(t, n) {
|
|
1129
|
+
}, pi = function(t, n) {
|
|
1132
1130
|
return t === "v" ? Ho(n) : Go(n);
|
|
1133
|
-
},
|
|
1131
|
+
}, gi = function(t, n) {
|
|
1132
|
+
return t === "v" ? Xo(n) : Ko(n);
|
|
1133
|
+
}, Qo = function(t, n) {
|
|
1134
1134
|
return t === "h" && n === "rtl" ? -1 : 1;
|
|
1135
|
-
},
|
|
1136
|
-
var o =
|
|
1135
|
+
}, Yo = function(t, n, e, i, r) {
|
|
1136
|
+
var o = Qo(t, window.getComputedStyle(n).direction), a = o * i, l = e.target, m = n.contains(l), c = !1, d = a > 0, u = 0, h = 0;
|
|
1137
1137
|
do {
|
|
1138
|
-
var y =
|
|
1139
|
-
(b || C) &&
|
|
1138
|
+
var y = gi(t, l), b = y[0], f = y[1], g = y[2], C = f - g - o * b;
|
|
1139
|
+
(b || C) && pi(t, l) && (u += C, h += b), l instanceof ShadowRoot ? l = l.host : l = l.parentNode;
|
|
1140
1140
|
} while (
|
|
1141
1141
|
// portaled content
|
|
1142
1142
|
!m && l !== document.body || // self content
|
|
1143
1143
|
m && (n.contains(l) || n === l)
|
|
1144
1144
|
);
|
|
1145
1145
|
return (d && Math.abs(u) < 1 || !d && Math.abs(h) < 1) && (c = !0), c;
|
|
1146
|
-
},
|
|
1146
|
+
}, Ye = function(t) {
|
|
1147
1147
|
return "changedTouches" in t ? [t.changedTouches[0].clientX, t.changedTouches[0].clientY] : [0, 0];
|
|
1148
|
-
},
|
|
1148
|
+
}, _n = function(t) {
|
|
1149
1149
|
return [t.deltaX, t.deltaY];
|
|
1150
|
-
},
|
|
1150
|
+
}, Bn = function(t) {
|
|
1151
1151
|
return t && "current" in t ? t.current : t;
|
|
1152
|
-
},
|
|
1152
|
+
}, Jo = function(t, n) {
|
|
1153
1153
|
return t[0] === n[0] && t[1] === n[1];
|
|
1154
|
-
},
|
|
1154
|
+
}, Zo = function(t) {
|
|
1155
1155
|
return `
|
|
1156
1156
|
.block-interactivity-`.concat(t, ` {pointer-events: none;}
|
|
1157
1157
|
.allow-interactivity-`).concat(t, ` {pointer-events: all;}
|
|
1158
1158
|
`);
|
|
1159
|
-
},
|
|
1160
|
-
function
|
|
1161
|
-
var n = p.useRef([]), e = p.useRef([0, 0]), i = p.useRef(), r = p.useState(
|
|
1159
|
+
}, ea = 0, Fe = [];
|
|
1160
|
+
function ta(t) {
|
|
1161
|
+
var n = p.useRef([]), e = p.useRef([0, 0]), i = p.useRef(), r = p.useState(ea++)[0], o = p.useState(mi)[0], a = p.useRef(t);
|
|
1162
1162
|
p.useEffect(function() {
|
|
1163
1163
|
a.current = t;
|
|
1164
1164
|
}, [t]), p.useEffect(function() {
|
|
1165
1165
|
if (t.inert) {
|
|
1166
1166
|
document.body.classList.add("block-interactivity-".concat(r));
|
|
1167
|
-
var f =
|
|
1167
|
+
var f = Co([t.lockRef.current], (t.shards || []).map(Bn), !0).filter(Boolean);
|
|
1168
1168
|
return f.forEach(function(g) {
|
|
1169
1169
|
return g.classList.add("allow-interactivity-".concat(r));
|
|
1170
1170
|
}), function() {
|
|
@@ -1177,98 +1177,98 @@ function Zo(t) {
|
|
|
1177
1177
|
var l = p.useCallback(function(f, g) {
|
|
1178
1178
|
if ("touches" in f && f.touches.length === 2 || f.type === "wheel" && f.ctrlKey)
|
|
1179
1179
|
return !a.current.allowPinchZoom;
|
|
1180
|
-
var C =
|
|
1180
|
+
var C = Ye(f), w = e.current, v = "deltaX" in f ? f.deltaX : w[0] - C[0], E = "deltaY" in f ? f.deltaY : w[1] - C[1], S, L = f.target, R = Math.abs(v) > Math.abs(E) ? "h" : "v";
|
|
1181
1181
|
if ("touches" in f && R === "h" && L.type === "range")
|
|
1182
1182
|
return !1;
|
|
1183
|
-
var T =
|
|
1183
|
+
var T = zn(R, L);
|
|
1184
1184
|
if (!T)
|
|
1185
1185
|
return !0;
|
|
1186
|
-
if (T ? S = R : (S = R === "v" ? "h" : "v", T =
|
|
1186
|
+
if (T ? S = R : (S = R === "v" ? "h" : "v", T = zn(R, L)), !T)
|
|
1187
1187
|
return !1;
|
|
1188
1188
|
if (!i.current && "changedTouches" in f && (v || E) && (i.current = S), !S)
|
|
1189
1189
|
return !0;
|
|
1190
1190
|
var D = i.current || S;
|
|
1191
|
-
return
|
|
1191
|
+
return Yo(D, g, f, D === "h" ? v : E);
|
|
1192
1192
|
}, []), m = p.useCallback(function(f) {
|
|
1193
1193
|
var g = f;
|
|
1194
|
-
if (!(!
|
|
1195
|
-
var C = "deltaY" in g ?
|
|
1196
|
-
return S.name === g.type && (S.target === g.target || g.target === S.shadowParent) &&
|
|
1194
|
+
if (!(!Fe.length || Fe[Fe.length - 1] !== o)) {
|
|
1195
|
+
var C = "deltaY" in g ? _n(g) : Ye(g), w = n.current.filter(function(S) {
|
|
1196
|
+
return S.name === g.type && (S.target === g.target || g.target === S.shadowParent) && Jo(S.delta, C);
|
|
1197
1197
|
})[0];
|
|
1198
1198
|
if (w && w.should) {
|
|
1199
1199
|
g.cancelable && g.preventDefault();
|
|
1200
1200
|
return;
|
|
1201
1201
|
}
|
|
1202
1202
|
if (!w) {
|
|
1203
|
-
var v = (a.current.shards || []).map(
|
|
1203
|
+
var v = (a.current.shards || []).map(Bn).filter(Boolean).filter(function(S) {
|
|
1204
1204
|
return S.contains(g.target);
|
|
1205
1205
|
}), E = v.length > 0 ? l(g, v[0]) : !a.current.noIsolation;
|
|
1206
1206
|
E && g.cancelable && g.preventDefault();
|
|
1207
1207
|
}
|
|
1208
1208
|
}
|
|
1209
1209
|
}, []), c = p.useCallback(function(f, g, C, w) {
|
|
1210
|
-
var v = { name: f, delta: g, target: C, should: w, shadowParent:
|
|
1210
|
+
var v = { name: f, delta: g, target: C, should: w, shadowParent: na(C) };
|
|
1211
1211
|
n.current.push(v), setTimeout(function() {
|
|
1212
1212
|
n.current = n.current.filter(function(E) {
|
|
1213
1213
|
return E !== v;
|
|
1214
1214
|
});
|
|
1215
1215
|
}, 1);
|
|
1216
1216
|
}, []), d = p.useCallback(function(f) {
|
|
1217
|
-
e.current =
|
|
1217
|
+
e.current = Ye(f), i.current = void 0;
|
|
1218
1218
|
}, []), u = p.useCallback(function(f) {
|
|
1219
|
-
c(f.type,
|
|
1219
|
+
c(f.type, _n(f), f.target, l(f, t.lockRef.current));
|
|
1220
1220
|
}, []), h = p.useCallback(function(f) {
|
|
1221
|
-
c(f.type,
|
|
1221
|
+
c(f.type, Ye(f), f.target, l(f, t.lockRef.current));
|
|
1222
1222
|
}, []);
|
|
1223
1223
|
p.useEffect(function() {
|
|
1224
|
-
return
|
|
1224
|
+
return Fe.push(o), t.setCallbacks({
|
|
1225
1225
|
onScrollCapture: u,
|
|
1226
1226
|
onWheelCapture: u,
|
|
1227
1227
|
onTouchMoveCapture: h
|
|
1228
|
-
}), document.addEventListener("wheel", m,
|
|
1229
|
-
|
|
1228
|
+
}), document.addEventListener("wheel", m, Le), document.addEventListener("touchmove", m, Le), document.addEventListener("touchstart", d, Le), function() {
|
|
1229
|
+
Fe = Fe.filter(function(f) {
|
|
1230
1230
|
return f !== o;
|
|
1231
|
-
}), document.removeEventListener("wheel", m,
|
|
1231
|
+
}), document.removeEventListener("wheel", m, Le), document.removeEventListener("touchmove", m, Le), document.removeEventListener("touchstart", d, Le);
|
|
1232
1232
|
};
|
|
1233
1233
|
}, []);
|
|
1234
1234
|
var y = t.removeScrollBar, b = t.inert;
|
|
1235
1235
|
return p.createElement(
|
|
1236
1236
|
p.Fragment,
|
|
1237
1237
|
null,
|
|
1238
|
-
b ? p.createElement(o, { styles:
|
|
1239
|
-
y ? p.createElement(
|
|
1238
|
+
b ? p.createElement(o, { styles: Zo(r) }) : null,
|
|
1239
|
+
y ? p.createElement(Wo, { gapMode: t.gapMode }) : null
|
|
1240
1240
|
);
|
|
1241
1241
|
}
|
|
1242
|
-
function
|
|
1242
|
+
function na(t) {
|
|
1243
1243
|
for (var n = null; t !== null; )
|
|
1244
1244
|
t instanceof ShadowRoot && (n = t.host, t = t.host), t = t.parentNode;
|
|
1245
1245
|
return n;
|
|
1246
1246
|
}
|
|
1247
|
-
const
|
|
1248
|
-
var
|
|
1249
|
-
return p.createElement(
|
|
1247
|
+
const ia = Ao(fi, ta);
|
|
1248
|
+
var vi = p.forwardRef(function(t, n) {
|
|
1249
|
+
return p.createElement(It, oe({}, t, { ref: n, sideCar: ia }));
|
|
1250
1250
|
});
|
|
1251
|
-
|
|
1252
|
-
var
|
|
1251
|
+
vi.classNames = It.classNames;
|
|
1252
|
+
var ra = function(t) {
|
|
1253
1253
|
if (typeof document > "u")
|
|
1254
1254
|
return null;
|
|
1255
1255
|
var n = Array.isArray(t) ? t[0] : t;
|
|
1256
1256
|
return n.ownerDocument.body;
|
|
1257
|
-
},
|
|
1258
|
-
return t && (t.host ||
|
|
1259
|
-
},
|
|
1257
|
+
}, Ae = /* @__PURE__ */ new WeakMap(), Je = /* @__PURE__ */ new WeakMap(), Ze = {}, Pt = 0, yi = function(t) {
|
|
1258
|
+
return t && (t.host || yi(t.parentNode));
|
|
1259
|
+
}, oa = function(t, n) {
|
|
1260
1260
|
return n.map(function(e) {
|
|
1261
1261
|
if (t.contains(e))
|
|
1262
1262
|
return e;
|
|
1263
|
-
var i =
|
|
1263
|
+
var i = yi(e);
|
|
1264
1264
|
return i && t.contains(i) ? i : (console.error("aria-hidden", e, "in not contained inside", t, ". Doing nothing"), null);
|
|
1265
1265
|
}).filter(function(e) {
|
|
1266
1266
|
return !!e;
|
|
1267
1267
|
});
|
|
1268
|
-
},
|
|
1269
|
-
var r =
|
|
1270
|
-
|
|
1271
|
-
var o =
|
|
1268
|
+
}, aa = function(t, n, e, i) {
|
|
1269
|
+
var r = oa(n, Array.isArray(t) ? t : [t]);
|
|
1270
|
+
Ze[e] || (Ze[e] = /* @__PURE__ */ new WeakMap());
|
|
1271
|
+
var o = Ze[e], a = [], l = /* @__PURE__ */ new Set(), m = new Set(r), c = function(u) {
|
|
1272
1272
|
!u || l.has(u) || (l.add(u), c(u.parentNode));
|
|
1273
1273
|
};
|
|
1274
1274
|
r.forEach(c);
|
|
@@ -1278,26 +1278,26 @@ var na = function(t) {
|
|
|
1278
1278
|
d(h);
|
|
1279
1279
|
else
|
|
1280
1280
|
try {
|
|
1281
|
-
var y = h.getAttribute(i), b = y !== null && y !== "false", f = (
|
|
1282
|
-
|
|
1281
|
+
var y = h.getAttribute(i), b = y !== null && y !== "false", f = (Ae.get(h) || 0) + 1, g = (o.get(h) || 0) + 1;
|
|
1282
|
+
Ae.set(h, f), o.set(h, g), a.push(h), f === 1 && b && Je.set(h, !0), g === 1 && h.setAttribute(e, "true"), b || h.setAttribute(i, "true");
|
|
1283
1283
|
} catch (C) {
|
|
1284
1284
|
console.error("aria-hidden: cannot operate on ", h, C);
|
|
1285
1285
|
}
|
|
1286
1286
|
});
|
|
1287
1287
|
};
|
|
1288
|
-
return d(n), l.clear(),
|
|
1288
|
+
return d(n), l.clear(), Pt++, function() {
|
|
1289
1289
|
a.forEach(function(u) {
|
|
1290
|
-
var h =
|
|
1291
|
-
|
|
1292
|
-
}),
|
|
1290
|
+
var h = Ae.get(u) - 1, y = o.get(u) - 1;
|
|
1291
|
+
Ae.set(u, h), o.set(u, y), h || (Je.has(u) || u.removeAttribute(i), Je.delete(u)), y || u.removeAttribute(e);
|
|
1292
|
+
}), Pt--, Pt || (Ae = /* @__PURE__ */ new WeakMap(), Ae = /* @__PURE__ */ new WeakMap(), Je = /* @__PURE__ */ new WeakMap(), Ze = {});
|
|
1293
1293
|
};
|
|
1294
|
-
},
|
|
1294
|
+
}, sa = function(t, n, e) {
|
|
1295
1295
|
e === void 0 && (e = "data-aria-hidden");
|
|
1296
|
-
var i = Array.from(Array.isArray(t) ? t : [t]), r =
|
|
1297
|
-
return r ? (i.push.apply(i, Array.from(r.querySelectorAll("[aria-live]"))),
|
|
1296
|
+
var i = Array.from(Array.isArray(t) ? t : [t]), r = ra(t);
|
|
1297
|
+
return r ? (i.push.apply(i, Array.from(r.querySelectorAll("[aria-live]"))), aa(i, r, e, "aria-hidden")) : function() {
|
|
1298
1298
|
return null;
|
|
1299
1299
|
};
|
|
1300
|
-
},
|
|
1300
|
+
}, an = "Dialog", [bi, xs] = jr(an), [la, te] = bi(an), wi = (t) => {
|
|
1301
1301
|
const {
|
|
1302
1302
|
__scopeDialog: n,
|
|
1303
1303
|
children: e,
|
|
@@ -1305,20 +1305,20 @@ var na = function(t) {
|
|
|
1305
1305
|
defaultOpen: r,
|
|
1306
1306
|
onOpenChange: o,
|
|
1307
1307
|
modal: a = !0
|
|
1308
|
-
} = t, l = p.useRef(null), m = p.useRef(null), [c = !1, d] =
|
|
1308
|
+
} = t, l = p.useRef(null), m = p.useRef(null), [c = !1, d] = Gr({
|
|
1309
1309
|
prop: i,
|
|
1310
1310
|
defaultProp: r,
|
|
1311
1311
|
onChange: o
|
|
1312
1312
|
});
|
|
1313
1313
|
return /* @__PURE__ */ s(
|
|
1314
|
-
|
|
1314
|
+
la,
|
|
1315
1315
|
{
|
|
1316
1316
|
scope: n,
|
|
1317
1317
|
triggerRef: l,
|
|
1318
1318
|
contentRef: m,
|
|
1319
|
-
contentId:
|
|
1320
|
-
titleId:
|
|
1321
|
-
descriptionId:
|
|
1319
|
+
contentId: Nt(),
|
|
1320
|
+
titleId: Nt(),
|
|
1321
|
+
descriptionId: Nt(),
|
|
1322
1322
|
open: c,
|
|
1323
1323
|
onOpenChange: d,
|
|
1324
1324
|
onOpenToggle: p.useCallback(() => d((u) => !u), [d]),
|
|
@@ -1327,50 +1327,50 @@ var na = function(t) {
|
|
|
1327
1327
|
}
|
|
1328
1328
|
);
|
|
1329
1329
|
};
|
|
1330
|
-
|
|
1331
|
-
var
|
|
1330
|
+
wi.displayName = an;
|
|
1331
|
+
var xi = "DialogTrigger", Ci = p.forwardRef(
|
|
1332
1332
|
(t, n) => {
|
|
1333
|
-
const { __scopeDialog: e, ...i } = t, r =
|
|
1333
|
+
const { __scopeDialog: e, ...i } = t, r = te(xi, e), o = Se(n, r.triggerRef);
|
|
1334
1334
|
return /* @__PURE__ */ s(
|
|
1335
|
-
|
|
1335
|
+
ce.button,
|
|
1336
1336
|
{
|
|
1337
1337
|
type: "button",
|
|
1338
1338
|
"aria-haspopup": "dialog",
|
|
1339
1339
|
"aria-expanded": r.open,
|
|
1340
1340
|
"aria-controls": r.contentId,
|
|
1341
|
-
"data-state":
|
|
1341
|
+
"data-state": cn(r.open),
|
|
1342
1342
|
...i,
|
|
1343
1343
|
ref: o,
|
|
1344
|
-
onClick:
|
|
1344
|
+
onClick: he(t.onClick, r.onOpenToggle)
|
|
1345
1345
|
}
|
|
1346
1346
|
);
|
|
1347
1347
|
}
|
|
1348
1348
|
);
|
|
1349
|
-
|
|
1350
|
-
var
|
|
1349
|
+
Ci.displayName = xi;
|
|
1350
|
+
var sn = "DialogPortal", [ca, Ei] = bi(sn, {
|
|
1351
1351
|
forceMount: void 0
|
|
1352
|
-
}),
|
|
1353
|
-
const { __scopeDialog: n, forceMount: e, children: i, container: r } = t, o =
|
|
1354
|
-
return /* @__PURE__ */ s(
|
|
1352
|
+
}), Ii = (t) => {
|
|
1353
|
+
const { __scopeDialog: n, forceMount: e, children: i, container: r } = t, o = te(sn, n);
|
|
1354
|
+
return /* @__PURE__ */ s(ca, { scope: n, forceMount: e, children: p.Children.map(i, (a) => /* @__PURE__ */ s(Et, { present: e || o.open, children: /* @__PURE__ */ s(ci, { asChild: !0, container: r, children: a }) })) });
|
|
1355
1355
|
};
|
|
1356
|
-
|
|
1357
|
-
var
|
|
1356
|
+
Ii.displayName = sn;
|
|
1357
|
+
var dt = "DialogOverlay", Si = p.forwardRef(
|
|
1358
1358
|
(t, n) => {
|
|
1359
|
-
const e =
|
|
1360
|
-
return o.modal ? /* @__PURE__ */ s(
|
|
1359
|
+
const e = Ei(dt, t.__scopeDialog), { forceMount: i = e.forceMount, ...r } = t, o = te(dt, t.__scopeDialog);
|
|
1360
|
+
return o.modal ? /* @__PURE__ */ s(Et, { present: i || o.open, children: /* @__PURE__ */ s(da, { ...r, ref: n }) }) : null;
|
|
1361
1361
|
}
|
|
1362
1362
|
);
|
|
1363
|
-
|
|
1364
|
-
var
|
|
1363
|
+
Si.displayName = dt;
|
|
1364
|
+
var da = p.forwardRef(
|
|
1365
1365
|
(t, n) => {
|
|
1366
|
-
const { __scopeDialog: e, ...i } = t, r =
|
|
1366
|
+
const { __scopeDialog: e, ...i } = t, r = te(dt, e);
|
|
1367
1367
|
return (
|
|
1368
1368
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
1369
1369
|
// ie. when `Overlay` and `Content` are siblings
|
|
1370
|
-
/* @__PURE__ */ s(
|
|
1371
|
-
|
|
1370
|
+
/* @__PURE__ */ s(vi, { as: on, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ s(
|
|
1371
|
+
ce.div,
|
|
1372
1372
|
{
|
|
1373
|
-
"data-state":
|
|
1373
|
+
"data-state": cn(r.open),
|
|
1374
1374
|
...i,
|
|
1375
1375
|
ref: n,
|
|
1376
1376
|
style: { pointerEvents: "auto", ...i.style }
|
|
@@ -1378,46 +1378,46 @@ var la = p.forwardRef(
|
|
|
1378
1378
|
) })
|
|
1379
1379
|
);
|
|
1380
1380
|
}
|
|
1381
|
-
),
|
|
1381
|
+
), Ce = "DialogContent", Ri = p.forwardRef(
|
|
1382
1382
|
(t, n) => {
|
|
1383
|
-
const e =
|
|
1384
|
-
return /* @__PURE__ */ s(
|
|
1383
|
+
const e = Ei(Ce, t.__scopeDialog), { forceMount: i = e.forceMount, ...r } = t, o = te(Ce, t.__scopeDialog);
|
|
1384
|
+
return /* @__PURE__ */ s(Et, { present: i || o.open, children: o.modal ? /* @__PURE__ */ s(ua, { ...r, ref: n }) : /* @__PURE__ */ s(fa, { ...r, ref: n }) });
|
|
1385
1385
|
}
|
|
1386
1386
|
);
|
|
1387
|
-
|
|
1388
|
-
var
|
|
1387
|
+
Ri.displayName = Ce;
|
|
1388
|
+
var ua = p.forwardRef(
|
|
1389
1389
|
(t, n) => {
|
|
1390
|
-
const e =
|
|
1390
|
+
const e = te(Ce, t.__scopeDialog), i = p.useRef(null), r = Se(n, e.contentRef, i);
|
|
1391
1391
|
return p.useEffect(() => {
|
|
1392
1392
|
const o = i.current;
|
|
1393
|
-
if (o) return
|
|
1393
|
+
if (o) return sa(o);
|
|
1394
1394
|
}, []), /* @__PURE__ */ s(
|
|
1395
|
-
|
|
1395
|
+
Ni,
|
|
1396
1396
|
{
|
|
1397
1397
|
...t,
|
|
1398
1398
|
ref: r,
|
|
1399
1399
|
trapFocus: e.open,
|
|
1400
1400
|
disableOutsidePointerEvents: !0,
|
|
1401
|
-
onCloseAutoFocus:
|
|
1401
|
+
onCloseAutoFocus: he(t.onCloseAutoFocus, (o) => {
|
|
1402
1402
|
var a;
|
|
1403
1403
|
o.preventDefault(), (a = e.triggerRef.current) == null || a.focus();
|
|
1404
1404
|
}),
|
|
1405
|
-
onPointerDownOutside:
|
|
1405
|
+
onPointerDownOutside: he(t.onPointerDownOutside, (o) => {
|
|
1406
1406
|
const a = o.detail.originalEvent, l = a.button === 0 && a.ctrlKey === !0;
|
|
1407
1407
|
(a.button === 2 || l) && o.preventDefault();
|
|
1408
1408
|
}),
|
|
1409
|
-
onFocusOutside:
|
|
1409
|
+
onFocusOutside: he(
|
|
1410
1410
|
t.onFocusOutside,
|
|
1411
1411
|
(o) => o.preventDefault()
|
|
1412
1412
|
)
|
|
1413
1413
|
}
|
|
1414
1414
|
);
|
|
1415
1415
|
}
|
|
1416
|
-
),
|
|
1416
|
+
), fa = p.forwardRef(
|
|
1417
1417
|
(t, n) => {
|
|
1418
|
-
const e =
|
|
1418
|
+
const e = te(Ce, t.__scopeDialog), i = p.useRef(!1), r = p.useRef(!1);
|
|
1419
1419
|
return /* @__PURE__ */ s(
|
|
1420
|
-
|
|
1420
|
+
Ni,
|
|
1421
1421
|
{
|
|
1422
1422
|
...t,
|
|
1423
1423
|
ref: n,
|
|
@@ -1436,12 +1436,12 @@ var ca = p.forwardRef(
|
|
|
1436
1436
|
}
|
|
1437
1437
|
);
|
|
1438
1438
|
}
|
|
1439
|
-
),
|
|
1439
|
+
), Ni = p.forwardRef(
|
|
1440
1440
|
(t, n) => {
|
|
1441
|
-
const { __scopeDialog: e, trapFocus: i, onOpenAutoFocus: r, onCloseAutoFocus: o, ...a } = t, l =
|
|
1442
|
-
return
|
|
1441
|
+
const { __scopeDialog: e, trapFocus: i, onOpenAutoFocus: r, onCloseAutoFocus: o, ...a } = t, l = te(Ce, e), m = p.useRef(null), c = Se(n, m);
|
|
1442
|
+
return xo(), /* @__PURE__ */ x(be, { children: [
|
|
1443
1443
|
/* @__PURE__ */ s(
|
|
1444
|
-
|
|
1444
|
+
si,
|
|
1445
1445
|
{
|
|
1446
1446
|
asChild: !0,
|
|
1447
1447
|
loop: !0,
|
|
@@ -1449,13 +1449,13 @@ var ca = p.forwardRef(
|
|
|
1449
1449
|
onMountAutoFocus: r,
|
|
1450
1450
|
onUnmountAutoFocus: o,
|
|
1451
1451
|
children: /* @__PURE__ */ s(
|
|
1452
|
-
|
|
1452
|
+
oi,
|
|
1453
1453
|
{
|
|
1454
1454
|
role: "dialog",
|
|
1455
1455
|
id: l.contentId,
|
|
1456
1456
|
"aria-describedby": l.descriptionId,
|
|
1457
1457
|
"aria-labelledby": l.titleId,
|
|
1458
|
-
"data-state":
|
|
1458
|
+
"data-state": cn(l.open),
|
|
1459
1459
|
...a,
|
|
1460
1460
|
ref: c,
|
|
1461
1461
|
onDismiss: () => l.onOpenChange(!1)
|
|
@@ -1463,50 +1463,50 @@ var ca = p.forwardRef(
|
|
|
1463
1463
|
)
|
|
1464
1464
|
}
|
|
1465
1465
|
),
|
|
1466
|
-
/* @__PURE__ */ x(
|
|
1467
|
-
/* @__PURE__ */ s(
|
|
1468
|
-
/* @__PURE__ */ s(
|
|
1466
|
+
/* @__PURE__ */ x(be, { children: [
|
|
1467
|
+
/* @__PURE__ */ s(pa, { titleId: l.titleId }),
|
|
1468
|
+
/* @__PURE__ */ s(va, { contentRef: m, descriptionId: l.descriptionId })
|
|
1469
1469
|
] })
|
|
1470
1470
|
] });
|
|
1471
1471
|
}
|
|
1472
|
-
),
|
|
1472
|
+
), ln = "DialogTitle", ma = p.forwardRef(
|
|
1473
1473
|
(t, n) => {
|
|
1474
|
-
const { __scopeDialog: e, ...i } = t, r =
|
|
1475
|
-
return /* @__PURE__ */ s(
|
|
1474
|
+
const { __scopeDialog: e, ...i } = t, r = te(ln, e);
|
|
1475
|
+
return /* @__PURE__ */ s(ce.h2, { id: r.titleId, ...i, ref: n });
|
|
1476
1476
|
}
|
|
1477
1477
|
);
|
|
1478
|
-
|
|
1479
|
-
var
|
|
1478
|
+
ma.displayName = ln;
|
|
1479
|
+
var Ti = "DialogDescription", ha = p.forwardRef(
|
|
1480
1480
|
(t, n) => {
|
|
1481
|
-
const { __scopeDialog: e, ...i } = t, r =
|
|
1482
|
-
return /* @__PURE__ */ s(
|
|
1481
|
+
const { __scopeDialog: e, ...i } = t, r = te(Ti, e);
|
|
1482
|
+
return /* @__PURE__ */ s(ce.p, { id: r.descriptionId, ...i, ref: n });
|
|
1483
1483
|
}
|
|
1484
1484
|
);
|
|
1485
|
-
|
|
1486
|
-
var
|
|
1485
|
+
ha.displayName = Ti;
|
|
1486
|
+
var Li = "DialogClose", Fi = p.forwardRef(
|
|
1487
1487
|
(t, n) => {
|
|
1488
|
-
const { __scopeDialog: e, ...i } = t, r =
|
|
1488
|
+
const { __scopeDialog: e, ...i } = t, r = te(Li, e);
|
|
1489
1489
|
return /* @__PURE__ */ s(
|
|
1490
|
-
|
|
1490
|
+
ce.button,
|
|
1491
1491
|
{
|
|
1492
1492
|
type: "button",
|
|
1493
1493
|
...i,
|
|
1494
1494
|
ref: n,
|
|
1495
|
-
onClick:
|
|
1495
|
+
onClick: he(t.onClick, () => r.onOpenChange(!1))
|
|
1496
1496
|
}
|
|
1497
1497
|
);
|
|
1498
1498
|
}
|
|
1499
1499
|
);
|
|
1500
|
-
|
|
1501
|
-
function
|
|
1500
|
+
Fi.displayName = Li;
|
|
1501
|
+
function cn(t) {
|
|
1502
1502
|
return t ? "open" : "closed";
|
|
1503
1503
|
}
|
|
1504
|
-
var
|
|
1505
|
-
contentName:
|
|
1506
|
-
titleName:
|
|
1504
|
+
var Ai = "DialogTitleWarning", [Cs, Di] = Ur(Ai, {
|
|
1505
|
+
contentName: Ce,
|
|
1506
|
+
titleName: ln,
|
|
1507
1507
|
docsSlug: "dialog"
|
|
1508
|
-
}),
|
|
1509
|
-
const n =
|
|
1508
|
+
}), pa = ({ titleId: t }) => {
|
|
1509
|
+
const n = Di(Ai), e = `\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
|
|
1510
1510
|
|
|
1511
1511
|
If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
1512
1512
|
|
|
@@ -1514,19 +1514,19 @@ For more information, see https://radix-ui.com/primitives/docs/components/${n.do
|
|
|
1514
1514
|
return p.useEffect(() => {
|
|
1515
1515
|
t && (document.getElementById(t) || console.error(e));
|
|
1516
1516
|
}, [e, t]), null;
|
|
1517
|
-
},
|
|
1518
|
-
const i = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${
|
|
1517
|
+
}, ga = "DialogDescriptionWarning", va = ({ contentRef: t, descriptionId: n }) => {
|
|
1518
|
+
const i = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Di(ga).contentName}}.`;
|
|
1519
1519
|
return p.useEffect(() => {
|
|
1520
1520
|
var o;
|
|
1521
1521
|
const r = (o = t.current) == null ? void 0 : o.getAttribute("aria-describedby");
|
|
1522
1522
|
n && r && (document.getElementById(n) || console.warn(i));
|
|
1523
1523
|
}, [i, t, n]), null;
|
|
1524
|
-
},
|
|
1525
|
-
function
|
|
1526
|
-
return
|
|
1524
|
+
}, dn = wi, ya = Ci, un = Ii, fn = Si, mn = Ri, Oi = Fi, et = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, ot = { exports: {} }, ba = ot.exports, Vn;
|
|
1525
|
+
function wa() {
|
|
1526
|
+
return Vn || (Vn = 1, function(t, n) {
|
|
1527
1527
|
(function(e, i) {
|
|
1528
1528
|
i();
|
|
1529
|
-
})(
|
|
1529
|
+
})(ba, function() {
|
|
1530
1530
|
function e(c, d) {
|
|
1531
1531
|
return typeof d > "u" ? d = { autoBom: !1 } : typeof d != "object" && (console.warn("Deprecated: Expected third argument to be a object"), d = { autoBom: !d }), d.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type) ? new Blob(["\uFEFF", c], { type: c.type }) : c;
|
|
1532
1532
|
}
|
|
@@ -1555,7 +1555,7 @@ function ya() {
|
|
|
1555
1555
|
d.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), c.dispatchEvent(d);
|
|
1556
1556
|
}
|
|
1557
1557
|
}
|
|
1558
|
-
var a = typeof window == "object" && window.window === window ? window : typeof self == "object" && self.self === self ? self : typeof
|
|
1558
|
+
var a = typeof window == "object" && window.window === window ? window : typeof self == "object" && self.self === self ? self : typeof et == "object" && et.global === et ? et : void 0, l = a.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent), m = a.saveAs || (typeof window != "object" || window !== a ? function() {
|
|
1559
1559
|
} : "download" in HTMLAnchorElement.prototype && !l ? function(c, d, u) {
|
|
1560
1560
|
var h = a.URL || a.webkitURL, y = document.createElement("a");
|
|
1561
1561
|
d = d || c.name || "download", y.download = d, y.rel = "noopener", typeof c == "string" ? (y.href = c, y.origin === location.origin ? o(y) : r(y.href) ? i(c, d, u) : o(y, y.target = "_blank")) : (y.href = h.createObjectURL(c), setTimeout(function() {
|
|
@@ -1590,11 +1590,11 @@ function ya() {
|
|
|
1590
1590
|
});
|
|
1591
1591
|
a.saveAs = m.saveAs = m, t.exports = m;
|
|
1592
1592
|
});
|
|
1593
|
-
}(
|
|
1593
|
+
}(ot)), ot.exports;
|
|
1594
1594
|
}
|
|
1595
|
-
var
|
|
1596
|
-
const
|
|
1597
|
-
const { file: n, onClose: e } = t, i =
|
|
1595
|
+
var hn = wa();
|
|
1596
|
+
const Pi = O((t) => {
|
|
1597
|
+
const { file: n, onClose: e } = t, i = me(null), r = N(() => {
|
|
1598
1598
|
var l;
|
|
1599
1599
|
if (!i.current) return;
|
|
1600
1600
|
const a = document.createElement("canvas");
|
|
@@ -1602,37 +1602,37 @@ const Ai = O((t) => {
|
|
|
1602
1602
|
m && navigator.clipboard.write([new ClipboardItem({ "image/png": m })]);
|
|
1603
1603
|
}, "image/png");
|
|
1604
1604
|
}, []), o = N(() => {
|
|
1605
|
-
|
|
1605
|
+
hn.saveAs(n, n.name);
|
|
1606
1606
|
}, [n]);
|
|
1607
|
-
return /* @__PURE__ */ s(
|
|
1608
|
-
|
|
1607
|
+
return /* @__PURE__ */ s(dn, { open: !0, onOpenChange: e, children: /* @__PURE__ */ s(un, { children: /* @__PURE__ */ s(
|
|
1608
|
+
fn,
|
|
1609
1609
|
{
|
|
1610
1610
|
className: "bg-(--color-background) fixed inset-0 data-[state='open']:fade-in-0 data-[state='open']:zoom-in-95 data-[state='closed']:animate-out data-[state='closed']:fade-out-0 data-[state='closed']:zoom-out-95 data-[state='open']:animate-in",
|
|
1611
1611
|
"data-floating-content": "",
|
|
1612
1612
|
children: /* @__PURE__ */ x(
|
|
1613
|
-
|
|
1613
|
+
mn,
|
|
1614
1614
|
{
|
|
1615
1615
|
className: "absolute inset-0 py-12",
|
|
1616
1616
|
"data-floating-content": "",
|
|
1617
1617
|
onOpenAutoFocus: (a) => a.preventDefault(),
|
|
1618
1618
|
children: [
|
|
1619
1619
|
/* @__PURE__ */ x(
|
|
1620
|
-
|
|
1620
|
+
xt,
|
|
1621
1621
|
{
|
|
1622
1622
|
className: "flex gap-2 items-center top-0 absolute right-0 p-2",
|
|
1623
1623
|
accentColor: "base",
|
|
1624
1624
|
variant: "ghost",
|
|
1625
1625
|
children: [
|
|
1626
|
-
/* @__PURE__ */ x(
|
|
1627
|
-
/* @__PURE__ */ s(
|
|
1628
|
-
/* @__PURE__ */ s(
|
|
1626
|
+
/* @__PURE__ */ x(Ne.Root, { children: [
|
|
1627
|
+
/* @__PURE__ */ s(Ne.Trigger, { asChild: !0, children: /* @__PURE__ */ s(V, { onClick: r, "aria-label": "copy to clipboard", children: /* @__PURE__ */ s(F, { icon: "RiFileCopyLine" }) }) }),
|
|
1628
|
+
/* @__PURE__ */ s(Ne.Content, { size: "sm", children: "Copy" })
|
|
1629
1629
|
] }),
|
|
1630
|
-
/* @__PURE__ */ x(
|
|
1631
|
-
/* @__PURE__ */ s(
|
|
1632
|
-
/* @__PURE__ */ s(
|
|
1630
|
+
/* @__PURE__ */ x(Ne.Root, { children: [
|
|
1631
|
+
/* @__PURE__ */ s(Ne.Trigger, { asChild: !0, children: /* @__PURE__ */ s(V, { onClick: o, "aria-label": "download", children: /* @__PURE__ */ s(F, { icon: "RiDownload2Line" }) }) }),
|
|
1632
|
+
/* @__PURE__ */ s(Ne.Content, { size: "sm", children: "Download" })
|
|
1633
1633
|
] }),
|
|
1634
|
-
/* @__PURE__ */ s(
|
|
1635
|
-
/* @__PURE__ */ s(
|
|
1634
|
+
/* @__PURE__ */ s(Xt, { orientation: "vertical", size: "sm" }),
|
|
1635
|
+
/* @__PURE__ */ s(Oi, { asChild: !0, children: /* @__PURE__ */ s(V, { onClick: e, "aria-label": "close", children: /* @__PURE__ */ s(F, { icon: "RiCloseLine" }) }) })
|
|
1636
1636
|
]
|
|
1637
1637
|
}
|
|
1638
1638
|
),
|
|
@@ -1651,9 +1651,9 @@ const Ai = O((t) => {
|
|
|
1651
1651
|
}
|
|
1652
1652
|
) }) });
|
|
1653
1653
|
});
|
|
1654
|
-
|
|
1655
|
-
const
|
|
1656
|
-
const { children: n } = t, [e, i] =
|
|
1654
|
+
Pi.displayName = "ImageViewer";
|
|
1655
|
+
const xa = O((t) => {
|
|
1656
|
+
const { children: n } = t, [e, i] = $(null), r = N(() => {
|
|
1657
1657
|
i(null);
|
|
1658
1658
|
}, []), o = N(
|
|
1659
1659
|
(m) => {
|
|
@@ -1663,15 +1663,15 @@ const ba = O((t) => {
|
|
|
1663
1663
|
), a = N(() => {
|
|
1664
1664
|
e && (e.onClose && e.onClose(), r());
|
|
1665
1665
|
}, [r, e]), l = P(() => o, [o]);
|
|
1666
|
-
return /* @__PURE__ */ x(
|
|
1666
|
+
return /* @__PURE__ */ x(ni.Provider, { value: l, children: [
|
|
1667
1667
|
n,
|
|
1668
|
-
e && /* @__PURE__ */ s(
|
|
1668
|
+
e && /* @__PURE__ */ s(Pi, { file: e.file, onClose: a })
|
|
1669
1669
|
] });
|
|
1670
1670
|
});
|
|
1671
|
-
|
|
1672
|
-
const
|
|
1673
|
-
const { className: n, label: e, children: i, severity: r, inputId: o, labelId: a, image: l } = t, [m, c] =
|
|
1674
|
-
|
|
1671
|
+
xa.displayName = "FileViewerProvider";
|
|
1672
|
+
const ae = (t) => {
|
|
1673
|
+
const { className: n, label: e, children: i, severity: r, inputId: o, labelId: a, image: l } = t, [m, c] = $(void 0), d = rn(), u = r ? we[r] : "base";
|
|
1674
|
+
K(() => {
|
|
1675
1675
|
l instanceof Promise ? l.then(c).catch(console.error) : c(l);
|
|
1676
1676
|
}, [l]);
|
|
1677
1677
|
const h = m ? URL.createObjectURL(m) : void 0, y = N(() => {
|
|
@@ -1689,24 +1689,24 @@ const oe = (t) => {
|
|
|
1689
1689
|
onClick: y
|
|
1690
1690
|
}
|
|
1691
1691
|
),
|
|
1692
|
-
/* @__PURE__ */ s("label", { className:
|
|
1692
|
+
/* @__PURE__ */ s("label", { className: qe(n, "flex flex-col gap-1 w-max"), htmlFor: o, children: /* @__PURE__ */ s(ge, { accentColor: u, size: "sm", id: a, weight: "medium", children: e }) }),
|
|
1693
1693
|
i
|
|
1694
1694
|
] });
|
|
1695
|
-
},
|
|
1696
|
-
const { helpText: n, children: e, severity: i } = t, r = i ?
|
|
1695
|
+
}, ki = (t) => {
|
|
1696
|
+
const { helpText: n, children: e, severity: i } = t, r = i ? we[i] : "base";
|
|
1697
1697
|
return /* @__PURE__ */ x("div", { className: "flex flex-col gap-1", children: [
|
|
1698
1698
|
e,
|
|
1699
|
-
!!n && /* @__PURE__ */ s("div", { className: "flex flex-col w-full", children: /* @__PURE__ */ s(
|
|
1699
|
+
!!n && /* @__PURE__ */ s("div", { className: "flex flex-col w-full", children: /* @__PURE__ */ s(ge, { accentColor: r, size: "xs", children: n }) })
|
|
1700
1700
|
] });
|
|
1701
|
-
},
|
|
1701
|
+
}, se = (t) => {
|
|
1702
1702
|
const { children: n, ...e } = t;
|
|
1703
|
-
return /* @__PURE__ */ s(
|
|
1704
|
-
},
|
|
1705
|
-
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: a, helpText: l, label: m, fieldProps: c }, d] =
|
|
1703
|
+
return /* @__PURE__ */ s(ki, { ...e, children: n });
|
|
1704
|
+
}, Ca = [!0, "true"], Mi = O((t) => {
|
|
1705
|
+
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: a, helpText: l, label: m, fieldProps: c }, d] = Z(t), { name: u, onBlur: h, onChange: y } = c, b = o ? null : l, f = o ? "" : m, g = Ca.includes(c.value), C = N(() => {
|
|
1706
1706
|
h(g);
|
|
1707
1707
|
}, [h, g]);
|
|
1708
|
-
return /* @__PURE__ */ s(
|
|
1709
|
-
|
|
1708
|
+
return /* @__PURE__ */ s(se, { helpText: b, severity: r, children: /* @__PURE__ */ s(
|
|
1709
|
+
ae,
|
|
1710
1710
|
{
|
|
1711
1711
|
size: i,
|
|
1712
1712
|
severity: r,
|
|
@@ -1716,7 +1716,7 @@ const oe = (t) => {
|
|
|
1716
1716
|
image: o ? void 0 : a.image,
|
|
1717
1717
|
className: "items-center flex-row-reverse justify-end gap-2",
|
|
1718
1718
|
children: /* @__PURE__ */ s(
|
|
1719
|
-
|
|
1719
|
+
lt.Root,
|
|
1720
1720
|
{
|
|
1721
1721
|
id: n,
|
|
1722
1722
|
name: u,
|
|
@@ -1728,17 +1728,17 @@ const oe = (t) => {
|
|
|
1728
1728
|
accentColor: "primary",
|
|
1729
1729
|
variant: "surface",
|
|
1730
1730
|
...d,
|
|
1731
|
-
children: /* @__PURE__ */ s(
|
|
1731
|
+
children: /* @__PURE__ */ s(lt.Indicator, { children: /* @__PURE__ */ s(F, { icon: "RiCheckLine" }) })
|
|
1732
1732
|
}
|
|
1733
1733
|
)
|
|
1734
1734
|
}
|
|
1735
1735
|
) });
|
|
1736
1736
|
});
|
|
1737
|
-
|
|
1738
|
-
const
|
|
1739
|
-
...
|
|
1737
|
+
Mi.displayName = "BooleanInput";
|
|
1738
|
+
const Ea = {
|
|
1739
|
+
...ee,
|
|
1740
1740
|
type: "boolean"
|
|
1741
|
-
},
|
|
1741
|
+
}, De = class De extends G {
|
|
1742
1742
|
constructor(e) {
|
|
1743
1743
|
super({ ...e, type: "boolean" });
|
|
1744
1744
|
I(this, "onlyValidateAfterTouched", !1);
|
|
@@ -1755,16 +1755,16 @@ const xa = {
|
|
|
1755
1755
|
}
|
|
1756
1756
|
static deserialize(e) {
|
|
1757
1757
|
if (e.type !== "boolean") throw new Error("Type mismatch.");
|
|
1758
|
-
return new
|
|
1758
|
+
return new De(e);
|
|
1759
1759
|
}
|
|
1760
1760
|
getInput(e) {
|
|
1761
|
-
return /* @__PURE__ */ s(
|
|
1761
|
+
return /* @__PURE__ */ s(Mi, { ...e, field: this });
|
|
1762
1762
|
}
|
|
1763
1763
|
};
|
|
1764
|
-
I(
|
|
1765
|
-
let
|
|
1766
|
-
const
|
|
1767
|
-
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: a, helpText: l, label: m, fieldProps: c }, d] =
|
|
1764
|
+
I(De, "fieldTypeName", "Checkbox"), I(De, "fieldTypeDescription", "Perfect for both optional and required yes/no questions."), I(De, "Icon", br);
|
|
1765
|
+
let Ge = De;
|
|
1766
|
+
const zi = O((t) => {
|
|
1767
|
+
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: a, helpText: l, label: m, fieldProps: c }, d] = Z(t), { name: u, onChange: h, onBlur: y } = c, [b, f] = $(!1), g = o ? null : l, C = o ? "" : m, w = c.value ? new Date(c.value) : void 0, v = N(
|
|
1768
1768
|
(S) => {
|
|
1769
1769
|
S && h(S.toISOString()), f(!1);
|
|
1770
1770
|
},
|
|
@@ -1775,8 +1775,8 @@ const Pi = O((t) => {
|
|
|
1775
1775
|
},
|
|
1776
1776
|
[c.value, y]
|
|
1777
1777
|
);
|
|
1778
|
-
return /* @__PURE__ */ s(
|
|
1779
|
-
|
|
1778
|
+
return /* @__PURE__ */ s(se, { helpText: g, severity: r, children: /* @__PURE__ */ s(
|
|
1779
|
+
ae,
|
|
1780
1780
|
{
|
|
1781
1781
|
size: i,
|
|
1782
1782
|
severity: r,
|
|
@@ -1784,9 +1784,9 @@ const Pi = O((t) => {
|
|
|
1784
1784
|
labelId: e,
|
|
1785
1785
|
label: C,
|
|
1786
1786
|
image: o ? void 0 : a.image,
|
|
1787
|
-
children: /* @__PURE__ */ x(
|
|
1788
|
-
/* @__PURE__ */ s(
|
|
1789
|
-
|
|
1787
|
+
children: /* @__PURE__ */ x(le.Root, { open: b, onOpenChange: E, children: [
|
|
1788
|
+
/* @__PURE__ */ s(le.Trigger, { asChild: !0, children: /* @__PURE__ */ x(
|
|
1789
|
+
Q,
|
|
1790
1790
|
{
|
|
1791
1791
|
id: n,
|
|
1792
1792
|
name: u,
|
|
@@ -1806,8 +1806,8 @@ const Pi = O((t) => {
|
|
|
1806
1806
|
]
|
|
1807
1807
|
}
|
|
1808
1808
|
) }),
|
|
1809
|
-
/* @__PURE__ */ s(
|
|
1810
|
-
|
|
1809
|
+
/* @__PURE__ */ s(le.Content, { align: "start", children: /* @__PURE__ */ s(
|
|
1810
|
+
dr,
|
|
1811
1811
|
{
|
|
1812
1812
|
required: !1,
|
|
1813
1813
|
mode: "single",
|
|
@@ -1820,11 +1820,11 @@ const Pi = O((t) => {
|
|
|
1820
1820
|
}
|
|
1821
1821
|
) });
|
|
1822
1822
|
});
|
|
1823
|
-
|
|
1824
|
-
const
|
|
1825
|
-
...
|
|
1823
|
+
zi.displayName = "DateInput";
|
|
1824
|
+
const Ia = {
|
|
1825
|
+
...ee,
|
|
1826
1826
|
type: "date"
|
|
1827
|
-
},
|
|
1827
|
+
}, Oe = class Oe extends G {
|
|
1828
1828
|
constructor(e) {
|
|
1829
1829
|
super({ ...e, type: "date" });
|
|
1830
1830
|
I(this, "onlyValidateAfterTouched", !1);
|
|
@@ -1837,27 +1837,27 @@ const Ca = {
|
|
|
1837
1837
|
}
|
|
1838
1838
|
static deserialize(e) {
|
|
1839
1839
|
if (e.type !== "date") throw new Error("Type mismatch.");
|
|
1840
|
-
return new
|
|
1840
|
+
return new Oe(e);
|
|
1841
1841
|
}
|
|
1842
1842
|
getInput(e) {
|
|
1843
|
-
return /* @__PURE__ */ s(
|
|
1843
|
+
return /* @__PURE__ */ s(zi, { field: this, ...e });
|
|
1844
1844
|
}
|
|
1845
1845
|
};
|
|
1846
|
-
I(
|
|
1847
|
-
let
|
|
1848
|
-
const
|
|
1849
|
-
const { field: n, ...e } = t, [{ value: i }] =
|
|
1846
|
+
I(Oe, "fieldTypeName", "Date"), I(Oe, "fieldTypeDescription", "Allows specifying a date."), I(Oe, "Icon", wr);
|
|
1847
|
+
let Bt = Oe;
|
|
1848
|
+
const _i = O((t) => {
|
|
1849
|
+
const { field: n, ...e } = t, [{ value: i }] = Qt(n.options.clonedFieldIdentifier), r = P(() => {
|
|
1850
1850
|
const o = n.options.getFieldToClone(i);
|
|
1851
|
-
return o ?
|
|
1851
|
+
return o ? yn(o) : null;
|
|
1852
1852
|
}, [n.options, i]);
|
|
1853
|
-
return
|
|
1853
|
+
return Bi(r, e);
|
|
1854
1854
|
});
|
|
1855
|
-
|
|
1856
|
-
const
|
|
1857
|
-
...
|
|
1855
|
+
_i.displayName = "FieldInputCloner";
|
|
1856
|
+
const Sa = {
|
|
1857
|
+
...ee,
|
|
1858
1858
|
type: "custom"
|
|
1859
1859
|
};
|
|
1860
|
-
class
|
|
1860
|
+
class ut extends G {
|
|
1861
1861
|
constructor(e, i) {
|
|
1862
1862
|
super({ ...e, type: "custom" });
|
|
1863
1863
|
I(this, "Component");
|
|
@@ -1873,75 +1873,96 @@ class ct extends H {
|
|
|
1873
1873
|
return /* @__PURE__ */ s(i, { field: this, ...e });
|
|
1874
1874
|
}
|
|
1875
1875
|
}
|
|
1876
|
-
I(
|
|
1877
|
-
class
|
|
1876
|
+
I(ut, "fieldTypeName", "Custom"), I(ut, "fieldTypeDescription", "Allows re-rendering of field already in the form");
|
|
1877
|
+
class Ra extends ut {
|
|
1878
1878
|
constructor(n) {
|
|
1879
|
-
super(n,
|
|
1879
|
+
super(n, _i);
|
|
1880
1880
|
}
|
|
1881
1881
|
}
|
|
1882
|
-
const
|
|
1883
|
-
const e = P(() => t.map((i) => /* @__PURE__ */ s(
|
|
1882
|
+
const Bi = (t, n) => P(() => !n || !t ? null : t.getInput(n), [t, n]), ft = (t, n) => {
|
|
1883
|
+
const e = P(() => t.map((i) => /* @__PURE__ */ s(Xn, { children: i.getInput(n) }, i.getId())), [t, n]);
|
|
1884
1884
|
return /* @__PURE__ */ s("div", { className: "flex flex-col gap-4", children: e });
|
|
1885
|
-
}
|
|
1885
|
+
};
|
|
1886
|
+
let tt;
|
|
1887
|
+
const Na = new Uint8Array(16);
|
|
1888
|
+
function Ta() {
|
|
1889
|
+
if (!tt && (tt = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !tt))
|
|
1890
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
1891
|
+
return tt(Na);
|
|
1892
|
+
}
|
|
1893
|
+
const j = [];
|
|
1894
|
+
for (let t = 0; t < 256; ++t)
|
|
1895
|
+
j.push((t + 256).toString(16).slice(1));
|
|
1896
|
+
function La(t, n = 0) {
|
|
1897
|
+
return j[t[n + 0]] + j[t[n + 1]] + j[t[n + 2]] + j[t[n + 3]] + "-" + j[t[n + 4]] + j[t[n + 5]] + "-" + j[t[n + 6]] + j[t[n + 7]] + "-" + j[t[n + 8]] + j[t[n + 9]] + "-" + j[t[n + 10]] + j[t[n + 11]] + j[t[n + 12]] + j[t[n + 13]] + j[t[n + 14]] + j[t[n + 15]];
|
|
1898
|
+
}
|
|
1899
|
+
const Fa = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), $n = {
|
|
1900
|
+
randomUUID: Fa
|
|
1901
|
+
};
|
|
1902
|
+
function Aa(t, n, e) {
|
|
1903
|
+
if ($n.randomUUID && !t)
|
|
1904
|
+
return $n.randomUUID();
|
|
1905
|
+
t = t || {};
|
|
1906
|
+
const i = t.random || (t.rng || Ta)();
|
|
1907
|
+
return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, La(i);
|
|
1908
|
+
}
|
|
1909
|
+
const ve = (t) => t.type === "section", mt = (t = "", n = []) => ({
|
|
1886
1910
|
type: "section",
|
|
1887
1911
|
fields: n,
|
|
1888
1912
|
identifier: t,
|
|
1889
1913
|
label: null,
|
|
1890
1914
|
condition: null,
|
|
1891
1915
|
conditional: !1
|
|
1892
|
-
}),
|
|
1916
|
+
}), Da = (t) => {
|
|
1893
1917
|
if (!t) return;
|
|
1894
1918
|
const n = t.fields;
|
|
1895
1919
|
let e = [];
|
|
1896
1920
|
const i = [];
|
|
1897
1921
|
for (const r of n)
|
|
1898
|
-
r.type === "section" ? (e.length > 0 && (i.push(
|
|
1899
|
-
return e.length > 0 && i.push(
|
|
1922
|
+
r.type === "section" ? (e.length > 0 && (i.push(mt(`AUTO_section-${n.indexOf(r)}`, e)), e = []), i.push(r)) : e.push(r);
|
|
1923
|
+
return e.length > 0 && i.push(mt("AUTO_section-last", e)), { ...t, fields: i, description: t.description ?? "" };
|
|
1900
1924
|
};
|
|
1901
|
-
function
|
|
1925
|
+
function Vt(t, n, e) {
|
|
1902
1926
|
const i = Array.from(t), [r] = i.splice(n, 1);
|
|
1903
1927
|
if (!r) throw new Error("Could not find field to reorder.");
|
|
1904
1928
|
return i.splice(e, 0, r), i;
|
|
1905
1929
|
}
|
|
1906
|
-
function
|
|
1930
|
+
function Vi(t, n, e) {
|
|
1907
1931
|
const i = Array.from(t ?? []);
|
|
1908
1932
|
return i.splice(n, 0, e), i;
|
|
1909
1933
|
}
|
|
1910
|
-
function
|
|
1934
|
+
function ht(t, n) {
|
|
1911
1935
|
const e = Array.from(t);
|
|
1912
1936
|
return e.splice(n, 1), e;
|
|
1913
1937
|
}
|
|
1914
|
-
const
|
|
1915
|
-
const e = /* @__PURE__ */ new Date();
|
|
1916
|
-
return `${Ar(n)}-${e.getTime()}`;
|
|
1917
|
-
}, _i = (t, n) => {
|
|
1938
|
+
const pn = () => Aa(), $i = (t, n) => {
|
|
1918
1939
|
if (!n) return null;
|
|
1919
1940
|
for (const e of t)
|
|
1920
1941
|
if (e.type === "section") {
|
|
1921
|
-
const i =
|
|
1942
|
+
const i = $i(e.fields, n);
|
|
1922
1943
|
if (i) return i;
|
|
1923
1944
|
} else if (e.identifier === n)
|
|
1924
1945
|
return e;
|
|
1925
1946
|
return null;
|
|
1926
|
-
},
|
|
1927
|
-
const
|
|
1947
|
+
}, Ui = (t, n) => t.filter((e, i) => i < n).flatMap((e) => e.fields), pt = (t, n, e, i, r) => {
|
|
1948
|
+
const o = {
|
|
1928
1949
|
...e,
|
|
1929
|
-
identifier:
|
|
1930
|
-
},
|
|
1931
|
-
if (
|
|
1950
|
+
identifier: pn()
|
|
1951
|
+
}, a = J(i, t);
|
|
1952
|
+
if (a === void 0)
|
|
1932
1953
|
throw new Error("Parent path must point to an existing field.");
|
|
1933
|
-
if (!Array.isArray(
|
|
1954
|
+
if (!Array.isArray(a))
|
|
1934
1955
|
throw new Error("Parent path must point to an array.");
|
|
1935
|
-
const
|
|
1936
|
-
r(t,
|
|
1937
|
-
},
|
|
1956
|
+
const l = Vi(a, n, o);
|
|
1957
|
+
r(t, l).then();
|
|
1958
|
+
}, Oa = (t, n, e) => {
|
|
1938
1959
|
const i = {
|
|
1939
|
-
...
|
|
1960
|
+
...mt(),
|
|
1940
1961
|
label: ""
|
|
1941
1962
|
};
|
|
1942
|
-
|
|
1943
|
-
},
|
|
1944
|
-
const { showError: t } =
|
|
1963
|
+
pt("fields", t, i, n, e);
|
|
1964
|
+
}, gn = () => {
|
|
1965
|
+
const { showError: t } = Ct(), n = N(
|
|
1945
1966
|
(i, r, o, a, l, m) => {
|
|
1946
1967
|
const c = i[r];
|
|
1947
1968
|
if (!c) throw new Error("Could not find section context.");
|
|
@@ -1958,7 +1979,7 @@ const mn = (t, n) => {
|
|
|
1958
1979
|
});
|
|
1959
1980
|
return;
|
|
1960
1981
|
}
|
|
1961
|
-
m("fields",
|
|
1982
|
+
m("fields", Vt(l.fields, o, d));
|
|
1962
1983
|
},
|
|
1963
1984
|
[t]
|
|
1964
1985
|
), e = N(
|
|
@@ -1968,7 +1989,7 @@ const mn = (t, n) => {
|
|
|
1968
1989
|
if (i.identifier === a.identifier)
|
|
1969
1990
|
c(
|
|
1970
1991
|
`fields.${r}.fields`,
|
|
1971
|
-
|
|
1992
|
+
Vt(i.fields, o, m)
|
|
1972
1993
|
).then();
|
|
1973
1994
|
else {
|
|
1974
1995
|
const u = i.fields[o];
|
|
@@ -1980,24 +2001,24 @@ const mn = (t, n) => {
|
|
|
1980
2001
|
});
|
|
1981
2002
|
return;
|
|
1982
2003
|
}
|
|
1983
|
-
c(`fields.${r}.fields`,
|
|
2004
|
+
c(`fields.${r}.fields`, ht(i.fields, o)).then(), c(
|
|
1984
2005
|
`fields.${l}.fields`,
|
|
1985
|
-
|
|
2006
|
+
Vi(a.fields, m, u)
|
|
1986
2007
|
).then();
|
|
1987
2008
|
}
|
|
1988
2009
|
},
|
|
1989
2010
|
[t]
|
|
1990
2011
|
);
|
|
1991
2012
|
return { reorderSection: n, reorderField: e };
|
|
1992
|
-
},
|
|
1993
|
-
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: a, helpText: l, label: m, fieldProps: c }, d] =
|
|
2013
|
+
}, ji = O((t) => {
|
|
2014
|
+
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: a, helpText: l, label: m, fieldProps: c }, d] = Z(t), u = o ? null : l, h = o ? "" : m, { name: y, onChange: b, onBlur: f } = c, g = P(() => Array.isArray(c.value) ? c.value : [], [c.value]), C = `${n}-droppable`, { disabled: w } = d, [v, E] = $(""), [S, L] = $(""), R = S || u, T = N(
|
|
1994
2015
|
(k) => {
|
|
1995
2016
|
b(k), f(k);
|
|
1996
2017
|
},
|
|
1997
2018
|
[b, f]
|
|
1998
2019
|
), D = N(
|
|
1999
2020
|
(k) => {
|
|
2000
|
-
g.findIndex((
|
|
2021
|
+
g.findIndex((q) => q === k.target.value.trim()) >= 0 ? L("All options must be unique") : k.target.value ? L("") : L("Option cannot be empty"), E(k.target.value);
|
|
2001
2022
|
},
|
|
2002
2023
|
[E, g]
|
|
2003
2024
|
), M = N(() => {
|
|
@@ -2008,29 +2029,29 @@ const mn = (t, n) => {
|
|
|
2008
2029
|
}
|
|
2009
2030
|
const k = v.trim();
|
|
2010
2031
|
T([...g, k]), E("");
|
|
2011
|
-
}, [v, S, T, g]),
|
|
2032
|
+
}, [v, S, T, g]), X = N(
|
|
2012
2033
|
(k) => {
|
|
2013
2034
|
k.key === "Enter" && (k.preventDefault(), M());
|
|
2014
2035
|
},
|
|
2015
2036
|
[M]
|
|
2016
|
-
),
|
|
2037
|
+
), ne = N(
|
|
2017
2038
|
(k) => {
|
|
2018
|
-
T(
|
|
2039
|
+
T(ht(g, k));
|
|
2019
2040
|
},
|
|
2020
2041
|
[g, T]
|
|
2021
2042
|
), B = N(
|
|
2022
2043
|
(k) => {
|
|
2023
2044
|
if (!k.destination) return;
|
|
2024
|
-
const
|
|
2025
|
-
T(
|
|
2045
|
+
const q = k.source.index, de = k.destination.index;
|
|
2046
|
+
T(Vt(g, q, de));
|
|
2026
2047
|
},
|
|
2027
2048
|
[T, g]
|
|
2028
|
-
),
|
|
2049
|
+
), Y = N(() => {
|
|
2029
2050
|
f(g);
|
|
2030
2051
|
}, [f, g]);
|
|
2031
|
-
return /* @__PURE__ */ s(
|
|
2032
|
-
/* @__PURE__ */ s(
|
|
2033
|
-
|
|
2052
|
+
return /* @__PURE__ */ s(Kn, { onDragEnd: B, children: /* @__PURE__ */ x("div", { className: "flex flex-col gap-2", children: [
|
|
2053
|
+
/* @__PURE__ */ s(se, { helpText: R, severity: r, children: /* @__PURE__ */ s(
|
|
2054
|
+
ae,
|
|
2034
2055
|
{
|
|
2035
2056
|
size: i,
|
|
2036
2057
|
severity: r,
|
|
@@ -2039,21 +2060,21 @@ const mn = (t, n) => {
|
|
|
2039
2060
|
label: h,
|
|
2040
2061
|
image: o ? void 0 : a.image,
|
|
2041
2062
|
children: (!w || g.length === 0) && /* @__PURE__ */ x("div", { className: "flex gap-2", children: [
|
|
2042
|
-
/* @__PURE__ */ s(
|
|
2043
|
-
|
|
2063
|
+
/* @__PURE__ */ s(pe.Root, { className: "grow", accentColor: "base", variant: "surface", size: "sm", children: /* @__PURE__ */ s(
|
|
2064
|
+
pe.Field,
|
|
2044
2065
|
{
|
|
2045
2066
|
value: v,
|
|
2046
2067
|
onChange: D,
|
|
2047
|
-
onKeyDown:
|
|
2068
|
+
onKeyDown: X,
|
|
2048
2069
|
id: n,
|
|
2049
2070
|
placeholder: a.placeholder,
|
|
2050
|
-
onBlur:
|
|
2071
|
+
onBlur: Y,
|
|
2051
2072
|
name: y,
|
|
2052
2073
|
...d
|
|
2053
2074
|
}
|
|
2054
2075
|
) }),
|
|
2055
2076
|
/* @__PURE__ */ s(
|
|
2056
|
-
|
|
2077
|
+
V,
|
|
2057
2078
|
{
|
|
2058
2079
|
size: "sm",
|
|
2059
2080
|
accentColor: "base",
|
|
@@ -2068,25 +2089,25 @@ const mn = (t, n) => {
|
|
|
2068
2089
|
] })
|
|
2069
2090
|
}
|
|
2070
2091
|
) }),
|
|
2071
|
-
/* @__PURE__ */ s(
|
|
2092
|
+
/* @__PURE__ */ s(en, { droppableId: C, children: (k) => /* @__PURE__ */ x(
|
|
2072
2093
|
"div",
|
|
2073
2094
|
{
|
|
2074
2095
|
className: "flex flex-col",
|
|
2075
2096
|
...k.droppableProps,
|
|
2076
2097
|
ref: k.innerRef,
|
|
2077
2098
|
children: [
|
|
2078
|
-
g.map((
|
|
2079
|
-
|
|
2099
|
+
g.map((q, de) => /* @__PURE__ */ s(
|
|
2100
|
+
tn,
|
|
2080
2101
|
{
|
|
2081
|
-
draggableId: `${
|
|
2082
|
-
index:
|
|
2102
|
+
draggableId: `${q}-draggable`,
|
|
2103
|
+
index: de,
|
|
2083
2104
|
isDragDisabled: w,
|
|
2084
|
-
children: ({ draggableProps:
|
|
2085
|
-
|
|
2105
|
+
children: ({ draggableProps: ie, dragHandleProps: ue, innerRef: Re }) => /* @__PURE__ */ x(
|
|
2106
|
+
kt,
|
|
2086
2107
|
{
|
|
2087
|
-
...
|
|
2088
|
-
...
|
|
2089
|
-
ref:
|
|
2108
|
+
...ue,
|
|
2109
|
+
...ie,
|
|
2110
|
+
ref: Re,
|
|
2090
2111
|
className: "mb-1 flex items-center justify-between gap-2",
|
|
2091
2112
|
accentColor: "base",
|
|
2092
2113
|
size: "sm",
|
|
@@ -2094,10 +2115,10 @@ const mn = (t, n) => {
|
|
|
2094
2115
|
children: [
|
|
2095
2116
|
/* @__PURE__ */ s("span", {
|
|
2096
2117
|
// TODO: remove this, its just a saftey check for old compatibility of what was acceptable as a value for multi string
|
|
2097
|
-
children: typeof
|
|
2118
|
+
children: typeof q == "object" && "label" in q ? q.label : q
|
|
2098
2119
|
}),
|
|
2099
2120
|
/* @__PURE__ */ s(
|
|
2100
|
-
|
|
2121
|
+
V,
|
|
2101
2122
|
{
|
|
2102
2123
|
size: "xs",
|
|
2103
2124
|
variant: "ghost",
|
|
@@ -2106,7 +2127,7 @@ const mn = (t, n) => {
|
|
|
2106
2127
|
accentColor: "base",
|
|
2107
2128
|
disabled: w,
|
|
2108
2129
|
onClick: () => {
|
|
2109
|
-
|
|
2130
|
+
ne(de);
|
|
2110
2131
|
},
|
|
2111
2132
|
children: /* @__PURE__ */ s(F, { icon: "RiCloseLargeLine" })
|
|
2112
2133
|
}
|
|
@@ -2115,7 +2136,7 @@ const mn = (t, n) => {
|
|
|
2115
2136
|
}
|
|
2116
2137
|
)
|
|
2117
2138
|
},
|
|
2118
|
-
|
|
2139
|
+
q
|
|
2119
2140
|
)),
|
|
2120
2141
|
k.placeholder
|
|
2121
2142
|
]
|
|
@@ -2123,13 +2144,13 @@ const mn = (t, n) => {
|
|
|
2123
2144
|
) })
|
|
2124
2145
|
] }) });
|
|
2125
2146
|
});
|
|
2126
|
-
|
|
2127
|
-
const
|
|
2128
|
-
...
|
|
2147
|
+
ji.displayName = "MultiStringInput";
|
|
2148
|
+
const Pa = {
|
|
2149
|
+
...ee,
|
|
2129
2150
|
type: "multi-string",
|
|
2130
2151
|
minimum_length: 0,
|
|
2131
2152
|
maximum_length: null
|
|
2132
|
-
},
|
|
2153
|
+
}, Pe = class Pe extends G {
|
|
2133
2154
|
constructor(e) {
|
|
2134
2155
|
const { minimum_length: i, maximum_length: r, placeholder: o, ...a } = e;
|
|
2135
2156
|
super({ ...a, type: "multi-string" });
|
|
@@ -2144,7 +2165,7 @@ const Na = {
|
|
|
2144
2165
|
throw new Error("Expected an array.");
|
|
2145
2166
|
}
|
|
2146
2167
|
getInput(e) {
|
|
2147
|
-
return /* @__PURE__ */ s(
|
|
2168
|
+
return /* @__PURE__ */ s(ji, { field: this, ...e });
|
|
2148
2169
|
}
|
|
2149
2170
|
serialize() {
|
|
2150
2171
|
return {
|
|
@@ -2169,17 +2190,17 @@ const Na = {
|
|
|
2169
2190
|
}
|
|
2170
2191
|
static deserialize(e) {
|
|
2171
2192
|
if (e.type !== "multi-string") throw new Error("Type mismatch.");
|
|
2172
|
-
return new
|
|
2193
|
+
return new Pe(e);
|
|
2173
2194
|
}
|
|
2174
2195
|
};
|
|
2175
|
-
I(
|
|
2176
|
-
let
|
|
2177
|
-
const
|
|
2196
|
+
I(Pe, "fieldTypeName", "Multi-string"), I(Pe, "fieldTypeDescription", "Allows the user to provide multiple unique strings."), I(Pe, "Icon", xr);
|
|
2197
|
+
let gt = Pe;
|
|
2198
|
+
const Wi = O((t) => {
|
|
2178
2199
|
const [
|
|
2179
2200
|
{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: a, helpText: l, label: m, fieldProps: c, touched: d, helpers: u },
|
|
2180
2201
|
h
|
|
2181
|
-
] =
|
|
2182
|
-
|
|
2202
|
+
] = Z(t), { name: y, onBlur: b, onChange: f, value: g } = c, C = o ? null : l, w = o ? "" : m, [v, E] = $("");
|
|
2203
|
+
Kt(() => {
|
|
2183
2204
|
E(g);
|
|
2184
2205
|
}, [g]);
|
|
2185
2206
|
const S = N(
|
|
@@ -2191,8 +2212,8 @@ const Vi = O((t) => {
|
|
|
2191
2212
|
), L = N(() => {
|
|
2192
2213
|
f(v), b(v);
|
|
2193
2214
|
}, [v, b, f]);
|
|
2194
|
-
return /* @__PURE__ */ s(
|
|
2195
|
-
|
|
2215
|
+
return /* @__PURE__ */ s(se, { helpText: C, severity: r, children: /* @__PURE__ */ s(
|
|
2216
|
+
ae,
|
|
2196
2217
|
{
|
|
2197
2218
|
size: i,
|
|
2198
2219
|
severity: r,
|
|
@@ -2200,8 +2221,8 @@ const Vi = O((t) => {
|
|
|
2200
2221
|
labelId: e,
|
|
2201
2222
|
label: w,
|
|
2202
2223
|
image: o ? void 0 : a.image,
|
|
2203
|
-
children: /* @__PURE__ */ s(
|
|
2204
|
-
|
|
2224
|
+
children: /* @__PURE__ */ s(pe.Root, { accentColor: "base", variant: "surface", size: "sm", children: /* @__PURE__ */ s(
|
|
2225
|
+
pe.Field,
|
|
2205
2226
|
{
|
|
2206
2227
|
id: n,
|
|
2207
2228
|
name: y,
|
|
@@ -2219,14 +2240,14 @@ const Vi = O((t) => {
|
|
|
2219
2240
|
}
|
|
2220
2241
|
) });
|
|
2221
2242
|
});
|
|
2222
|
-
|
|
2223
|
-
const
|
|
2224
|
-
...
|
|
2243
|
+
Wi.displayName = "NumberInput";
|
|
2244
|
+
const ka = {
|
|
2245
|
+
...ee,
|
|
2225
2246
|
type: "number",
|
|
2226
2247
|
minimum: Number.MIN_SAFE_INTEGER,
|
|
2227
2248
|
maximum: Number.MAX_SAFE_INTEGER,
|
|
2228
2249
|
integers: !1
|
|
2229
|
-
},
|
|
2250
|
+
}, Un = (t) => "fields" in t, re = class re extends G {
|
|
2230
2251
|
constructor(e) {
|
|
2231
2252
|
const {
|
|
2232
2253
|
minimum: i = Number.MIN_SAFE_INTEGER,
|
|
@@ -2250,7 +2271,7 @@ const Ta = {
|
|
|
2250
2271
|
const i = e && `${e}.`;
|
|
2251
2272
|
return [
|
|
2252
2273
|
{
|
|
2253
|
-
field: new
|
|
2274
|
+
field: new re({
|
|
2254
2275
|
label: "Minimum",
|
|
2255
2276
|
description: "Minimum value",
|
|
2256
2277
|
integers: !0,
|
|
@@ -2261,7 +2282,7 @@ const Ta = {
|
|
|
2261
2282
|
showDirectly: !1
|
|
2262
2283
|
},
|
|
2263
2284
|
{
|
|
2264
|
-
field: new
|
|
2285
|
+
field: new re({
|
|
2265
2286
|
label: "Maximum",
|
|
2266
2287
|
description: "Maximum value",
|
|
2267
2288
|
integers: !0,
|
|
@@ -2272,7 +2293,7 @@ const Ta = {
|
|
|
2272
2293
|
showDirectly: !1
|
|
2273
2294
|
},
|
|
2274
2295
|
{
|
|
2275
|
-
field: new
|
|
2296
|
+
field: new Ge({
|
|
2276
2297
|
label: "Integers",
|
|
2277
2298
|
description: "Whole numbers only",
|
|
2278
2299
|
required: !1,
|
|
@@ -2306,22 +2327,22 @@ const Ta = {
|
|
|
2306
2327
|
}
|
|
2307
2328
|
static deserialize(e) {
|
|
2308
2329
|
if (e.type !== "number") throw new Error("Type mismatch.");
|
|
2309
|
-
return new
|
|
2330
|
+
return new re(e);
|
|
2310
2331
|
}
|
|
2311
2332
|
getInput(e) {
|
|
2312
|
-
return /* @__PURE__ */ s(
|
|
2333
|
+
return /* @__PURE__ */ s(Wi, { field: this, ...e });
|
|
2313
2334
|
}
|
|
2314
2335
|
};
|
|
2315
|
-
I(
|
|
2316
|
-
const o =
|
|
2336
|
+
I(re, "fieldTypeName", "Number"), I(re, "fieldTypeDescription", "Allows specifying a number within a given range."), I(re, "Icon", Cr), I(re, "_validateMin", (e) => (i, r) => {
|
|
2337
|
+
const o = Un(r) ? J(r, e) : r;
|
|
2317
2338
|
return typeof o.maximum == "number" && typeof i == "number" && o.maximum < i ? "Minimum cannot be greater than minimum." : null;
|
|
2318
|
-
}), I(
|
|
2319
|
-
const o =
|
|
2339
|
+
}), I(re, "_validateMax", (e) => (i, r) => {
|
|
2340
|
+
const o = Un(r) ? J(r, e) : r;
|
|
2320
2341
|
return typeof o.minimum == "number" && typeof i == "number" && o.minimum > i ? "Maximum cannot be less than minimum." : null;
|
|
2321
2342
|
});
|
|
2322
|
-
let
|
|
2323
|
-
const
|
|
2324
|
-
const [{ inputId: n, labelId: e, label: i, helpText: r, size: o, severity: a, showInputOnly: l, field: m, fieldProps: c }, d] =
|
|
2343
|
+
let Ee = re;
|
|
2344
|
+
const qi = O((t) => {
|
|
2345
|
+
const [{ inputId: n, labelId: e, label: i, helpText: r, size: o, severity: a, showInputOnly: l, field: m, fieldProps: c }, d] = Z(t), { name: u, onBlur: h, onChange: y, value: b } = c, [f, g] = $(!1), C = l ? null : r, w = l ? "" : i, v = N(
|
|
2325
2346
|
(L) => {
|
|
2326
2347
|
y(L), g(!1);
|
|
2327
2348
|
},
|
|
@@ -2334,8 +2355,8 @@ const Ui = O((t) => {
|
|
|
2334
2355
|
},
|
|
2335
2356
|
[h, b]
|
|
2336
2357
|
);
|
|
2337
|
-
return /* @__PURE__ */ s(
|
|
2338
|
-
|
|
2358
|
+
return /* @__PURE__ */ s(se, { helpText: C, severity: a, children: /* @__PURE__ */ x(
|
|
2359
|
+
ae,
|
|
2339
2360
|
{
|
|
2340
2361
|
size: o,
|
|
2341
2362
|
severity: a,
|
|
@@ -2346,9 +2367,9 @@ const Ui = O((t) => {
|
|
|
2346
2367
|
className: "flex-col items-start justify-start gap-2",
|
|
2347
2368
|
children: [
|
|
2348
2369
|
/* @__PURE__ */ x("div", { className: "flex w-max items-center gap-1", children: [
|
|
2349
|
-
/* @__PURE__ */ x(
|
|
2350
|
-
/* @__PURE__ */ s(
|
|
2351
|
-
|
|
2370
|
+
/* @__PURE__ */ x(dn, { open: f, onOpenChange: S, children: [
|
|
2371
|
+
/* @__PURE__ */ s(ya, { asChild: !0, children: /* @__PURE__ */ x(
|
|
2372
|
+
Q,
|
|
2352
2373
|
{
|
|
2353
2374
|
id: n,
|
|
2354
2375
|
name: u,
|
|
@@ -2363,17 +2384,17 @@ const Ui = O((t) => {
|
|
|
2363
2384
|
]
|
|
2364
2385
|
}
|
|
2365
2386
|
) }),
|
|
2366
|
-
/* @__PURE__ */ x(
|
|
2367
|
-
/* @__PURE__ */ s(
|
|
2368
|
-
/* @__PURE__ */ s(
|
|
2387
|
+
/* @__PURE__ */ x(un, { children: [
|
|
2388
|
+
/* @__PURE__ */ s(fn, { className: "light:bg-(--black-a6) fixed inset-0 dark:bg-(--black-a8)" }),
|
|
2389
|
+
/* @__PURE__ */ s(mn, { className: "fixed inset-0", children: /* @__PURE__ */ s(Hi, { onQrScan: v }) })
|
|
2369
2390
|
] })
|
|
2370
2391
|
] }),
|
|
2371
2392
|
b && /* @__PURE__ */ s(F, { icon: "RiCheckLine", className: "align-bottom text-(--primary-a11)" })
|
|
2372
2393
|
] }),
|
|
2373
|
-
!!b && /* @__PURE__ */ s(
|
|
2394
|
+
!!b && /* @__PURE__ */ s(He, { className: "max-w-full w-max", size: "sm", children: /* @__PURE__ */ x("div", { className: "max-w-full w-max flex justify-between gap-2", children: [
|
|
2374
2395
|
/* @__PURE__ */ s("code", { className: "bg-(--base-a3) truncate text-sm", children: b }),
|
|
2375
2396
|
/* @__PURE__ */ s(
|
|
2376
|
-
|
|
2397
|
+
V,
|
|
2377
2398
|
{
|
|
2378
2399
|
accentColor: "base",
|
|
2379
2400
|
variant: "ghost",
|
|
@@ -2388,12 +2409,12 @@ const Ui = O((t) => {
|
|
|
2388
2409
|
}
|
|
2389
2410
|
) });
|
|
2390
2411
|
});
|
|
2391
|
-
|
|
2392
|
-
const
|
|
2393
|
-
const { onQrScan: n } = t, e =
|
|
2394
|
-
return
|
|
2412
|
+
qi.displayName = "QrInput";
|
|
2413
|
+
const Hi = O((t) => {
|
|
2414
|
+
const { onQrScan: n } = t, e = me(null), [i, r] = $(!1);
|
|
2415
|
+
return K(() => {
|
|
2395
2416
|
if (!e.current) return;
|
|
2396
|
-
const o = new
|
|
2417
|
+
const o = new Pr(
|
|
2397
2418
|
e.current,
|
|
2398
2419
|
(a) => {
|
|
2399
2420
|
const l = a.data;
|
|
@@ -2409,18 +2430,18 @@ const ji = O((t) => {
|
|
|
2409
2430
|
r(!1);
|
|
2410
2431
|
});
|
|
2411
2432
|
}, [n]), /* @__PURE__ */ x("div", { className: "relative flex h-full w-full flex-col justify-center gap-2 bg-(--color-background)", children: [
|
|
2412
|
-
/* @__PURE__ */ s("div", { className: "absolute top-0 flex w-full p-2", children: /* @__PURE__ */ s(
|
|
2433
|
+
/* @__PURE__ */ s("div", { className: "absolute top-0 flex w-full p-2", children: /* @__PURE__ */ s(Oi, { asChild: !0, children: /* @__PURE__ */ s(V, { "aria-label": "close", variant: "soft", accentColor: "base", children: /* @__PURE__ */ s(F, { icon: "RiCloseLine" }) }) }) }),
|
|
2413
2434
|
/* @__PURE__ */ x("div", { className: "relative max-h-full max-w-full", children: [
|
|
2414
2435
|
/* @__PURE__ */ s("video", { className: "size-full", ref: e }),
|
|
2415
|
-
i && /* @__PURE__ */ s("div", { className: "absolute inset-0 flex items-center justify-center bg-(--color-background)", children: /* @__PURE__ */ s(
|
|
2436
|
+
i && /* @__PURE__ */ s("div", { className: "absolute inset-0 flex items-center justify-center bg-(--color-background)", children: /* @__PURE__ */ s(wt, {}) })
|
|
2416
2437
|
] })
|
|
2417
2438
|
] });
|
|
2418
2439
|
});
|
|
2419
|
-
|
|
2420
|
-
const
|
|
2421
|
-
...
|
|
2440
|
+
Hi.displayName = "QrScanner";
|
|
2441
|
+
const Ma = {
|
|
2442
|
+
...ee,
|
|
2422
2443
|
type: "qr"
|
|
2423
|
-
},
|
|
2444
|
+
}, ke = class ke extends G {
|
|
2424
2445
|
constructor(e) {
|
|
2425
2446
|
super({ ...e, type: "qr" });
|
|
2426
2447
|
I(this, "onlyValidateAfterTouched", !1);
|
|
@@ -2430,15 +2451,15 @@ const La = {
|
|
|
2430
2451
|
}
|
|
2431
2452
|
static deserialize(e) {
|
|
2432
2453
|
if (e.type !== "qr") throw new Error("Type mismatch.");
|
|
2433
|
-
return new
|
|
2454
|
+
return new ke(e);
|
|
2434
2455
|
}
|
|
2435
2456
|
getInput(e) {
|
|
2436
|
-
return /* @__PURE__ */ s(
|
|
2457
|
+
return /* @__PURE__ */ s(qi, { ...e, field: this });
|
|
2437
2458
|
}
|
|
2438
2459
|
};
|
|
2439
|
-
I(
|
|
2440
|
-
let
|
|
2441
|
-
class
|
|
2460
|
+
I(ke, "fieldTypeName", "QR"), I(ke, "fieldTypeDescription", "Used for scanning/reading QR codes."), I(ke, "Icon", Er);
|
|
2461
|
+
let $t = ke;
|
|
2462
|
+
class Gi extends G {
|
|
2442
2463
|
constructor(e) {
|
|
2443
2464
|
const { placeholder: i = "", ...r } = e;
|
|
2444
2465
|
super(r);
|
|
@@ -2463,7 +2484,7 @@ class Wi extends H {
|
|
|
2463
2484
|
const i = e && `${e}.`;
|
|
2464
2485
|
return [
|
|
2465
2486
|
{
|
|
2466
|
-
field: new
|
|
2487
|
+
field: new gt({
|
|
2467
2488
|
label: "Options",
|
|
2468
2489
|
description: "List possible options for the user to select from.",
|
|
2469
2490
|
required: !0,
|
|
@@ -2475,8 +2496,8 @@ class Wi extends H {
|
|
|
2475
2496
|
];
|
|
2476
2497
|
}
|
|
2477
2498
|
}
|
|
2478
|
-
const
|
|
2479
|
-
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: a, helpText: l, label: m, fieldProps: c }, d] =
|
|
2499
|
+
const za = (t) => t ? Array.isArray(t) ? t : [t] : [], Xi = O((t) => {
|
|
2500
|
+
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: a, helpText: l, label: m, fieldProps: c }, d] = Z(t), { name: u, onChange: h, onBlur: y } = c, b = o ? null : l, f = o ? "" : m, g = P(() => za(c.value), [c.value]), C = N(
|
|
2480
2501
|
(v) => {
|
|
2481
2502
|
h(v), y(v);
|
|
2482
2503
|
},
|
|
@@ -2487,8 +2508,8 @@ const Fa = (t) => t ? Array.isArray(t) ? t : [t] : [], qi = O((t) => {
|
|
|
2487
2508
|
},
|
|
2488
2509
|
[g, y]
|
|
2489
2510
|
);
|
|
2490
|
-
return /* @__PURE__ */ s(
|
|
2491
|
-
|
|
2511
|
+
return /* @__PURE__ */ s(se, { helpText: b, severity: r, children: /* @__PURE__ */ s(
|
|
2512
|
+
ae,
|
|
2492
2513
|
{
|
|
2493
2514
|
size: i,
|
|
2494
2515
|
severity: r,
|
|
@@ -2498,7 +2519,7 @@ const Fa = (t) => t ? Array.isArray(t) ? t : [t] : [], qi = O((t) => {
|
|
|
2498
2519
|
image: o ? void 0 : a.image,
|
|
2499
2520
|
children: /* @__PURE__ */ x(_.Root, { onOpenChange: w, align: "start", children: [
|
|
2500
2521
|
/* @__PURE__ */ s(_.ClickTrigger, { children: /* @__PURE__ */ x(
|
|
2501
|
-
|
|
2522
|
+
Q,
|
|
2502
2523
|
{
|
|
2503
2524
|
id: n,
|
|
2504
2525
|
name: u,
|
|
@@ -2528,12 +2549,12 @@ const Fa = (t) => t ? Array.isArray(t) ? t : [t] : [], qi = O((t) => {
|
|
|
2528
2549
|
}
|
|
2529
2550
|
) });
|
|
2530
2551
|
});
|
|
2531
|
-
|
|
2532
|
-
const
|
|
2533
|
-
...
|
|
2552
|
+
Xi.displayName = "MultiSelectInput";
|
|
2553
|
+
const _a = {
|
|
2554
|
+
...ee,
|
|
2534
2555
|
type: "multi-select",
|
|
2535
2556
|
options: []
|
|
2536
|
-
},
|
|
2557
|
+
}, Me = class Me extends Gi {
|
|
2537
2558
|
constructor(n) {
|
|
2538
2559
|
const { placeholder: e = "Select one or more...", ...i } = n;
|
|
2539
2560
|
super({ ...i, placeholder: e, type: "multi-select" });
|
|
@@ -2550,23 +2571,23 @@ const Aa = {
|
|
|
2550
2571
|
}
|
|
2551
2572
|
static deserialize(n) {
|
|
2552
2573
|
if (n.type !== "multi-select") throw new Error("Type mismatch.");
|
|
2553
|
-
return new
|
|
2574
|
+
return new Me(n);
|
|
2554
2575
|
}
|
|
2555
2576
|
getInput(n) {
|
|
2556
|
-
return /* @__PURE__ */ s(
|
|
2577
|
+
return /* @__PURE__ */ s(Xi, { field: this, ...n });
|
|
2557
2578
|
}
|
|
2558
2579
|
};
|
|
2559
|
-
I(
|
|
2560
|
-
let
|
|
2561
|
-
const
|
|
2562
|
-
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: a, helpText: l, label: m, fieldProps: c }, d] =
|
|
2580
|
+
I(Me, "fieldTypeName", "Multi-select"), I(Me, "fieldTypeDescription", "Allows the user to select a multiple options from a list of options."), I(Me, "Icon", Ir);
|
|
2581
|
+
let vt = Me;
|
|
2582
|
+
const Ki = O((t) => {
|
|
2583
|
+
const [{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: a, helpText: l, label: m, fieldProps: c }, d] = Z(t), { name: u, onChange: h, onBlur: y, value: b } = c, f = o ? null : l, g = o ? "" : m, C = N(
|
|
2563
2584
|
(v) => {
|
|
2564
2585
|
v && (h(v), y(v));
|
|
2565
2586
|
},
|
|
2566
2587
|
[y, h]
|
|
2567
2588
|
), w = P(() => a.options.find((v) => v.value === b), [a.options, b]);
|
|
2568
|
-
return /* @__PURE__ */ s(
|
|
2569
|
-
|
|
2589
|
+
return /* @__PURE__ */ s(se, { helpText: f, severity: r, children: /* @__PURE__ */ s(
|
|
2590
|
+
ae,
|
|
2570
2591
|
{
|
|
2571
2592
|
size: i,
|
|
2572
2593
|
severity: r,
|
|
@@ -2576,7 +2597,7 @@ const Hi = O((t) => {
|
|
|
2576
2597
|
image: o ? void 0 : a.image,
|
|
2577
2598
|
children: /* @__PURE__ */ x(_.Root, { align: "start", children: [
|
|
2578
2599
|
/* @__PURE__ */ s(_.ClickTrigger, { children: /* @__PURE__ */ x(
|
|
2579
|
-
|
|
2600
|
+
Q,
|
|
2580
2601
|
{
|
|
2581
2602
|
id: n,
|
|
2582
2603
|
name: u,
|
|
@@ -2600,12 +2621,12 @@ const Hi = O((t) => {
|
|
|
2600
2621
|
}
|
|
2601
2622
|
) });
|
|
2602
2623
|
});
|
|
2603
|
-
|
|
2604
|
-
const
|
|
2605
|
-
...
|
|
2624
|
+
Ki.displayName = "SelectInput";
|
|
2625
|
+
const Ba = {
|
|
2626
|
+
...ee,
|
|
2606
2627
|
type: "select",
|
|
2607
2628
|
options: []
|
|
2608
|
-
},
|
|
2629
|
+
}, ze = class ze extends Gi {
|
|
2609
2630
|
constructor(n) {
|
|
2610
2631
|
const { placeholder: e = "Select one...", ...i } = n;
|
|
2611
2632
|
super({ ...i, placeholder: e, type: "select" });
|
|
@@ -2618,23 +2639,23 @@ const Da = {
|
|
|
2618
2639
|
}
|
|
2619
2640
|
static deserialize(n) {
|
|
2620
2641
|
if (n.type !== "select") throw new Error("Type mismatch.");
|
|
2621
|
-
return new
|
|
2642
|
+
return new ze(n);
|
|
2622
2643
|
}
|
|
2623
2644
|
getInput(n) {
|
|
2624
|
-
return /* @__PURE__ */ s(
|
|
2645
|
+
return /* @__PURE__ */ s(Ki, { field: this, ...n });
|
|
2625
2646
|
}
|
|
2626
2647
|
};
|
|
2627
|
-
I(
|
|
2628
|
-
let
|
|
2629
|
-
const
|
|
2630
|
-
class
|
|
2648
|
+
I(ze, "fieldTypeName", "Dropdown"), I(ze, "fieldTypeDescription", "Allows the user to select a single option from a list of options."), I(ze, "Icon", Sr);
|
|
2649
|
+
let yt = ze;
|
|
2650
|
+
const jn = (t) => "fields" in t;
|
|
2651
|
+
class bt extends G {
|
|
2631
2652
|
constructor(e) {
|
|
2632
2653
|
const { minLength: i, maxLength: r, placeholder: o = "", ...a } = e;
|
|
2633
2654
|
super(a);
|
|
2634
2655
|
I(this, "minLength");
|
|
2635
2656
|
I(this, "maxLength");
|
|
2636
2657
|
I(this, "placeholder");
|
|
2637
|
-
this.minLength = i ? Math.max(i, 0) : void 0, this.maxLength = r ? Math.max(r, 0) :
|
|
2658
|
+
this.minLength = i ? Math.max(i, 0) : void 0, this.maxLength = r ? Math.max(r, 0) : Ue, this.placeholder = o;
|
|
2638
2659
|
}
|
|
2639
2660
|
static getFieldCreationSchema(e = "") {
|
|
2640
2661
|
const i = e && `${e}.`;
|
|
@@ -2642,7 +2663,7 @@ class vt extends H {
|
|
|
2642
2663
|
{
|
|
2643
2664
|
field: (
|
|
2644
2665
|
// min, max
|
|
2645
|
-
new
|
|
2666
|
+
new Ee({
|
|
2646
2667
|
label: "Minimum length",
|
|
2647
2668
|
description: "Minimum number of characters",
|
|
2648
2669
|
required: !1,
|
|
@@ -2656,13 +2677,13 @@ class vt extends H {
|
|
|
2656
2677
|
showDirectly: !1
|
|
2657
2678
|
},
|
|
2658
2679
|
{
|
|
2659
|
-
field: new
|
|
2680
|
+
field: new Ee({
|
|
2660
2681
|
label: "Maximum length",
|
|
2661
2682
|
description: "Maximum number of characters",
|
|
2662
2683
|
required: !1,
|
|
2663
2684
|
identifier: `${i}maximum_length`,
|
|
2664
2685
|
minimum: 1,
|
|
2665
|
-
maximum:
|
|
2686
|
+
maximum: Ue,
|
|
2666
2687
|
// TODO: depends on short vs long text
|
|
2667
2688
|
formValidators: [this._validateMax(e)],
|
|
2668
2689
|
// TODO: default: 500 (see: "Short text fields can hold up to 500 characters on a single line.")
|
|
@@ -2697,24 +2718,24 @@ class vt extends H {
|
|
|
2697
2718
|
* This function returns a function that validates that the value given for "minimum length" (when creating a new field) is less than or
|
|
2698
2719
|
* equal to the value given for "maximum length".
|
|
2699
2720
|
*/
|
|
2700
|
-
I(
|
|
2701
|
-
const o =
|
|
2721
|
+
I(bt, "_validateMin", (e) => (i, r) => {
|
|
2722
|
+
const o = jn(r) ? J(r, e) : r;
|
|
2702
2723
|
return typeof o.maximum_length == "number" && typeof i == "number" && o.maximum_length < i ? "Minimum cannot be greater than maximum." : null;
|
|
2703
2724
|
}), /**
|
|
2704
2725
|
* This function returns a function that validates that the value given for "maximum length" (when creating a new field) is greater than or
|
|
2705
2726
|
* equal to the value given for "minimum length".
|
|
2706
2727
|
*/
|
|
2707
|
-
I(
|
|
2728
|
+
I(bt, "_validateMax", (e) => (i, r) => {
|
|
2708
2729
|
if (typeof i != "number") return null;
|
|
2709
|
-
const { minimum_length: o } =
|
|
2730
|
+
const { minimum_length: o } = jn(r) ? J(r, e) : r;
|
|
2710
2731
|
return typeof o != "number" ? null : o > i ? "Maximum cannot be less than minimum." : null;
|
|
2711
2732
|
});
|
|
2712
|
-
const
|
|
2733
|
+
const Qi = O((t) => {
|
|
2713
2734
|
const [
|
|
2714
2735
|
{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: a, helpText: l, label: m, fieldProps: c, touched: d, helpers: u },
|
|
2715
2736
|
h
|
|
2716
|
-
] =
|
|
2717
|
-
|
|
2737
|
+
] = Z(t), { name: y, onBlur: b, onChange: f, value: g } = c, C = o ? null : l, w = o ? "" : m, [v, E] = $("");
|
|
2738
|
+
Kt(() => {
|
|
2718
2739
|
E(g);
|
|
2719
2740
|
}, [g]);
|
|
2720
2741
|
const S = N(
|
|
@@ -2725,8 +2746,8 @@ const Gi = O((t) => {
|
|
|
2725
2746
|
), L = N(() => {
|
|
2726
2747
|
f(v), b(v);
|
|
2727
2748
|
}, [v, b, f]);
|
|
2728
|
-
return /* @__PURE__ */ s(
|
|
2729
|
-
|
|
2749
|
+
return /* @__PURE__ */ s(se, { helpText: C, severity: r, children: /* @__PURE__ */ s(
|
|
2750
|
+
ae,
|
|
2730
2751
|
{
|
|
2731
2752
|
size: i,
|
|
2732
2753
|
severity: r,
|
|
@@ -2734,8 +2755,8 @@ const Gi = O((t) => {
|
|
|
2734
2755
|
labelId: e,
|
|
2735
2756
|
label: w,
|
|
2736
2757
|
image: o ? void 0 : a.image,
|
|
2737
|
-
children: /* @__PURE__ */ s(
|
|
2738
|
-
|
|
2758
|
+
children: /* @__PURE__ */ s(pe.Root, { accentColor: "base", variant: "surface", size: "sm", children: /* @__PURE__ */ s(
|
|
2759
|
+
pe.Field,
|
|
2739
2760
|
{
|
|
2740
2761
|
id: n,
|
|
2741
2762
|
name: y,
|
|
@@ -2750,15 +2771,15 @@ const Gi = O((t) => {
|
|
|
2750
2771
|
}
|
|
2751
2772
|
) });
|
|
2752
2773
|
});
|
|
2753
|
-
|
|
2754
|
-
const
|
|
2755
|
-
...
|
|
2774
|
+
Qi.displayName = "StringInput";
|
|
2775
|
+
const Va = {
|
|
2776
|
+
...ee,
|
|
2756
2777
|
type: "string",
|
|
2757
|
-
maximum_length:
|
|
2778
|
+
maximum_length: nt,
|
|
2758
2779
|
input_type: "text"
|
|
2759
|
-
},
|
|
2780
|
+
}, _e = class _e extends bt {
|
|
2760
2781
|
constructor(e) {
|
|
2761
|
-
const { inputType: i = "text", ...r } = e, o = e.maxLength ? Math.min(
|
|
2782
|
+
const { inputType: i = "text", ...r } = e, o = e.maxLength ? Math.min(nt, e.maxLength) : nt, a = e.minLength ? Math.min(e.minLength, o) : void 0;
|
|
2762
2783
|
super({ ...r, maxLength: o, minLength: a, type: "string" });
|
|
2763
2784
|
I(this, "inputType");
|
|
2764
2785
|
this.inputType = i;
|
|
@@ -2769,7 +2790,7 @@ const Oa = {
|
|
|
2769
2790
|
static deserialize(e) {
|
|
2770
2791
|
if (e.type !== "string") throw new Error("Type mismatch.");
|
|
2771
2792
|
const { maximum_length: i, minimum_length: r, input_type: o, ...a } = e;
|
|
2772
|
-
return new
|
|
2793
|
+
return new _e({
|
|
2773
2794
|
...a,
|
|
2774
2795
|
maxLength: i,
|
|
2775
2796
|
minLength: r,
|
|
@@ -2778,17 +2799,17 @@ const Oa = {
|
|
|
2778
2799
|
});
|
|
2779
2800
|
}
|
|
2780
2801
|
getInput(e) {
|
|
2781
|
-
return /* @__PURE__ */ s(
|
|
2802
|
+
return /* @__PURE__ */ s(Qi, { field: this, ...e });
|
|
2782
2803
|
}
|
|
2783
2804
|
};
|
|
2784
|
-
I(
|
|
2785
|
-
let
|
|
2786
|
-
const
|
|
2805
|
+
I(_e, "fieldTypeName", "Short Text"), I(_e, "fieldTypeDescription", `Short text fields can hold up to ${nt} characters on a single line.`), I(_e, "Icon", Rr);
|
|
2806
|
+
let Ut = _e;
|
|
2807
|
+
const Yi = O((t) => {
|
|
2787
2808
|
const [
|
|
2788
2809
|
{ inputId: n, labelId: e, size: i, severity: r, showInputOnly: o, field: a, helpText: l, label: m, fieldProps: c, touched: d, helpers: u },
|
|
2789
2810
|
h
|
|
2790
|
-
] =
|
|
2791
|
-
|
|
2811
|
+
] = Z(t), { name: y, onBlur: b, onChange: f, value: g } = c, C = o ? null : l, w = o ? "" : m, [v, E] = $("");
|
|
2812
|
+
Kt(() => {
|
|
2792
2813
|
E(g);
|
|
2793
2814
|
}, [g]);
|
|
2794
2815
|
const S = N(
|
|
@@ -2799,8 +2820,8 @@ const Xi = O((t) => {
|
|
|
2799
2820
|
), L = N(() => {
|
|
2800
2821
|
f(v), b(v);
|
|
2801
2822
|
}, [v, b, f]);
|
|
2802
|
-
return /* @__PURE__ */ s(
|
|
2803
|
-
|
|
2823
|
+
return /* @__PURE__ */ s(se, { helpText: C, severity: r, children: /* @__PURE__ */ s(
|
|
2824
|
+
ae,
|
|
2804
2825
|
{
|
|
2805
2826
|
size: i,
|
|
2806
2827
|
severity: r,
|
|
@@ -2809,7 +2830,7 @@ const Xi = O((t) => {
|
|
|
2809
2830
|
label: w,
|
|
2810
2831
|
image: o ? void 0 : a.image,
|
|
2811
2832
|
children: /* @__PURE__ */ s(
|
|
2812
|
-
|
|
2833
|
+
Hn,
|
|
2813
2834
|
{
|
|
2814
2835
|
id: n,
|
|
2815
2836
|
value: v,
|
|
@@ -2828,14 +2849,14 @@ const Xi = O((t) => {
|
|
|
2828
2849
|
}
|
|
2829
2850
|
) });
|
|
2830
2851
|
});
|
|
2831
|
-
|
|
2832
|
-
const
|
|
2833
|
-
...
|
|
2852
|
+
Yi.displayName = "TextInput";
|
|
2853
|
+
const $a = {
|
|
2854
|
+
...ee,
|
|
2834
2855
|
type: "text",
|
|
2835
|
-
maximum_length:
|
|
2836
|
-
},
|
|
2856
|
+
maximum_length: Ue
|
|
2857
|
+
}, Be = class Be extends bt {
|
|
2837
2858
|
constructor(n) {
|
|
2838
|
-
const e = n.maxLength ? Math.min(
|
|
2859
|
+
const e = n.maxLength ? Math.min(Ue, n.maxLength) : Ue, i = n.minLength ? Math.min(n.minLength, e) : void 0;
|
|
2839
2860
|
super({ ...n, maxLength: e, minLength: i, type: "text" });
|
|
2840
2861
|
}
|
|
2841
2862
|
serialize() {
|
|
@@ -2844,7 +2865,7 @@ const Pa = {
|
|
|
2844
2865
|
static deserialize(n) {
|
|
2845
2866
|
if (n.type !== "text") throw new Error("Type mismatch.");
|
|
2846
2867
|
const { maximum_length: e, minimum_length: i, ...r } = n;
|
|
2847
|
-
return new
|
|
2868
|
+
return new Be({
|
|
2848
2869
|
...r,
|
|
2849
2870
|
maxLength: e,
|
|
2850
2871
|
minLength: i,
|
|
@@ -2852,25 +2873,25 @@ const Pa = {
|
|
|
2852
2873
|
});
|
|
2853
2874
|
}
|
|
2854
2875
|
getInput(n) {
|
|
2855
|
-
return /* @__PURE__ */ s(
|
|
2876
|
+
return /* @__PURE__ */ s(Yi, { field: this, ...n });
|
|
2856
2877
|
}
|
|
2857
2878
|
};
|
|
2858
|
-
I(
|
|
2859
|
-
let
|
|
2860
|
-
const
|
|
2861
|
-
|
|
2879
|
+
I(Be, "fieldTypeName", "Paragraph"), I(Be, "fieldTypeDescription", `Paragraph fields can hold up to ${Ue} characters and can have multiple lines.`), I(Be, "Icon", Nr);
|
|
2880
|
+
let jt = Be;
|
|
2881
|
+
const Ua = O(
|
|
2882
|
+
Xe((t, n) => {
|
|
2862
2883
|
const { file: e, alt: i, error: r, rightSlot: o, className: a, ...l } = t;
|
|
2863
2884
|
return /* @__PURE__ */ x(
|
|
2864
2885
|
"div",
|
|
2865
2886
|
{
|
|
2866
|
-
className:
|
|
2887
|
+
className: qe(
|
|
2867
2888
|
a,
|
|
2868
2889
|
"relative flex h-[200px] w-full flex-col gap-0 overflow-hidden rounded-md border items-center border-(--base-a6)"
|
|
2869
2890
|
),
|
|
2870
2891
|
ref: n,
|
|
2871
2892
|
...l,
|
|
2872
2893
|
children: [
|
|
2873
|
-
!e && !r && /* @__PURE__ */ s("div", { className: "absolute flex h-full w-full flex-col items-center justify-center", children: /* @__PURE__ */ s(
|
|
2894
|
+
!e && !r && /* @__PURE__ */ s("div", { className: "absolute flex h-full w-full flex-col items-center justify-center", children: /* @__PURE__ */ s(wt, {}) }),
|
|
2874
2895
|
/* @__PURE__ */ s("div", { className: "-m-4 flex max-w-full grow items-center justify-center overflow-hidden bg-clip-padding", children: e && !r && /* @__PURE__ */ s(
|
|
2875
2896
|
"img",
|
|
2876
2897
|
{
|
|
@@ -2882,12 +2903,12 @@ const ka = O(
|
|
|
2882
2903
|
/* @__PURE__ */ x(
|
|
2883
2904
|
"div",
|
|
2884
2905
|
{
|
|
2885
|
-
className:
|
|
2906
|
+
className: qe("flex h-max w-full items-center gap-1 bg-(--base-2) px-2 py-1", {
|
|
2886
2907
|
"bg-transparent": !e
|
|
2887
2908
|
}),
|
|
2888
2909
|
children: [
|
|
2889
|
-
r ? /* @__PURE__ */ s(F, { icon: "RiFileWarningLine" }) : e && /* @__PURE__ */ s(
|
|
2890
|
-
/* @__PURE__ */ s(
|
|
2910
|
+
r ? /* @__PURE__ */ s(F, { icon: "RiFileWarningLine" }) : e && /* @__PURE__ */ s(nn, { fileType: e.type }),
|
|
2911
|
+
/* @__PURE__ */ s(ge, { className: "truncate", size: "sm", children: r ?? (e == null ? void 0 : e.name) }),
|
|
2891
2912
|
o
|
|
2892
2913
|
]
|
|
2893
2914
|
}
|
|
@@ -2896,7 +2917,7 @@ const ka = O(
|
|
|
2896
2917
|
}
|
|
2897
2918
|
);
|
|
2898
2919
|
})
|
|
2899
|
-
),
|
|
2920
|
+
), ja = (t) => {
|
|
2900
2921
|
const n = ["byte", "kilobyte", "megabyte"];
|
|
2901
2922
|
let e = t, i = 0;
|
|
2902
2923
|
for (; e > 1e3 && i < n.length - 1; )
|
|
@@ -2907,12 +2928,12 @@ const ka = O(
|
|
|
2907
2928
|
style: "unit",
|
|
2908
2929
|
unit: n[i]
|
|
2909
2930
|
}).format(e);
|
|
2910
|
-
},
|
|
2931
|
+
}, Ji = O((t) => {
|
|
2911
2932
|
var R;
|
|
2912
|
-
const [{ inputId: n, labelId: e, size: i, severity: r, helpText: o, showInputOnly: a, field: l, fieldProps: m }, c] =
|
|
2913
|
-
let [{ label: b }] =
|
|
2933
|
+
const [{ inputId: n, labelId: e, size: i, severity: r, helpText: o, showInputOnly: a, field: l, fieldProps: m }, c] = Z(t), { name: d, value: u, onChange: h, onBlur: y } = m;
|
|
2934
|
+
let [{ label: b }] = Z(t);
|
|
2914
2935
|
b = a ? "" : b;
|
|
2915
|
-
const f =
|
|
2936
|
+
const f = me(null), g = P(() => a ? null : o || (l.maxFileSize ? `Maximum file size: ${l.maxFileSize}MB` : null), [l.maxFileSize, o, a]), C = N(() => {
|
|
2916
2937
|
var T;
|
|
2917
2938
|
(T = f.current) == null || T.click();
|
|
2918
2939
|
}, []), w = N(() => {
|
|
@@ -2931,7 +2952,7 @@ const ka = O(
|
|
|
2931
2952
|
},
|
|
2932
2953
|
[u, h]
|
|
2933
2954
|
);
|
|
2934
|
-
|
|
2955
|
+
K(() => {
|
|
2935
2956
|
if (!f.current) return;
|
|
2936
2957
|
const T = new AbortController();
|
|
2937
2958
|
return f.current.addEventListener(
|
|
@@ -2948,8 +2969,8 @@ const ka = O(
|
|
|
2948
2969
|
}, [y, u]);
|
|
2949
2970
|
const E = u ? "Select new files" : "Select files", S = u ? "Select new file" : "Select a file", L = l.maxFiles > 1 ? E : S;
|
|
2950
2971
|
return /* @__PURE__ */ x("div", { className: "flex flex-col gap-2", children: [
|
|
2951
|
-
/* @__PURE__ */ s(
|
|
2952
|
-
|
|
2972
|
+
/* @__PURE__ */ s(se, { helpText: g, severity: r, children: /* @__PURE__ */ x(
|
|
2973
|
+
ae,
|
|
2953
2974
|
{
|
|
2954
2975
|
size: i,
|
|
2955
2976
|
severity: r,
|
|
@@ -2959,7 +2980,7 @@ const ka = O(
|
|
|
2959
2980
|
image: a ? void 0 : l.image,
|
|
2960
2981
|
children: [
|
|
2961
2982
|
/* @__PURE__ */ s("div", { className: "flex gap-2", children: /* @__PURE__ */ x(
|
|
2962
|
-
|
|
2983
|
+
Q,
|
|
2963
2984
|
{
|
|
2964
2985
|
className: "w-max",
|
|
2965
2986
|
size: "sm",
|
|
@@ -2994,7 +3015,7 @@ const ka = O(
|
|
|
2994
3015
|
}
|
|
2995
3016
|
) }),
|
|
2996
3017
|
Array.isArray(u) && u.length > 0 && /* @__PURE__ */ s("div", { className: "flex h-max flex-col gap-2", children: u.map((T, D) => /* @__PURE__ */ s(
|
|
2997
|
-
|
|
3018
|
+
Zi,
|
|
2998
3019
|
{
|
|
2999
3020
|
field: l,
|
|
3000
3021
|
file: T,
|
|
@@ -3007,13 +3028,13 @@ const ka = O(
|
|
|
3007
3028
|
)) })
|
|
3008
3029
|
] });
|
|
3009
3030
|
});
|
|
3010
|
-
|
|
3011
|
-
const
|
|
3012
|
-
const { file: n, field: e, onRemove: i, disabled: r } = t, [o, a] =
|
|
3031
|
+
Ji.displayName = "UploadInput";
|
|
3032
|
+
const Zi = O((t) => {
|
|
3033
|
+
const { file: n, field: e, onRemove: i, disabled: r } = t, [o, a] = $(null), l = rn(), m = P(() => o && e.getError([o]), [e, o]), { url: c, name: d } = P(() => {
|
|
3013
3034
|
let f = null, g, C;
|
|
3014
|
-
return o != null && o.type.startsWith("image/") && (f = URL.createObjectURL(o)), o ? (g = o.name, C =
|
|
3035
|
+
return o != null && o.type.startsWith("image/") && (f = URL.createObjectURL(o)), o ? (g = o.name, C = ja(o.size)) : (g = "Downloading...", C = "..."), { url: f, name: g, size: C };
|
|
3015
3036
|
}, [o]);
|
|
3016
|
-
|
|
3037
|
+
K(() => {
|
|
3017
3038
|
n instanceof Promise ? n.then(a).catch(console.error) : a(n);
|
|
3018
3039
|
}, [n]);
|
|
3019
3040
|
const u = N(
|
|
@@ -3021,7 +3042,7 @@ const Qi = O((t) => {
|
|
|
3021
3042
|
if (f.stopPropagation(), !o)
|
|
3022
3043
|
throw new Error("Cannot download a file that is not resolved.");
|
|
3023
3044
|
const g = new Blob([o]);
|
|
3024
|
-
|
|
3045
|
+
hn.saveAs(g, d);
|
|
3025
3046
|
},
|
|
3026
3047
|
[d, o]
|
|
3027
3048
|
), h = N(
|
|
@@ -3037,9 +3058,9 @@ const Qi = O((t) => {
|
|
|
3037
3058
|
}
|
|
3038
3059
|
}));
|
|
3039
3060
|
}, [r, i, l, o]), b = P(
|
|
3040
|
-
() => /* @__PURE__ */ x(
|
|
3061
|
+
() => /* @__PURE__ */ x(xt, { className: "flex grow justify-end", variant: "ghost", accentColor: "base", size: "sm", children: [
|
|
3041
3062
|
/* @__PURE__ */ s(
|
|
3042
|
-
|
|
3063
|
+
V,
|
|
3043
3064
|
{
|
|
3044
3065
|
"aria-label": `Download ${d}`,
|
|
3045
3066
|
type: "button",
|
|
@@ -3048,12 +3069,12 @@ const Qi = O((t) => {
|
|
|
3048
3069
|
children: /* @__PURE__ */ s(F, { icon: "RiDownload2Line" })
|
|
3049
3070
|
}
|
|
3050
3071
|
),
|
|
3051
|
-
!r && /* @__PURE__ */ s(
|
|
3072
|
+
!r && /* @__PURE__ */ s(V, { type: "button", "aria-label": `Remove ${d}`, disabled: r, onClick: h, children: /* @__PURE__ */ s(F, { icon: "RiDeleteBin7Fill" }) })
|
|
3052
3073
|
] }),
|
|
3053
3074
|
[r, h, u, d, o]
|
|
3054
3075
|
);
|
|
3055
3076
|
return c ? /* @__PURE__ */ s(
|
|
3056
|
-
|
|
3077
|
+
Ua,
|
|
3057
3078
|
{
|
|
3058
3079
|
className: "cursor-pointer",
|
|
3059
3080
|
onClick: y,
|
|
@@ -3061,16 +3082,16 @@ const Qi = O((t) => {
|
|
|
3061
3082
|
error: m ?? void 0,
|
|
3062
3083
|
rightSlot: b
|
|
3063
3084
|
}
|
|
3064
|
-
) : /* @__PURE__ */ s(
|
|
3085
|
+
) : /* @__PURE__ */ s(ei, { file: o, error: m ?? void 0, rightSlot: b });
|
|
3065
3086
|
});
|
|
3066
|
-
|
|
3067
|
-
const
|
|
3068
|
-
...
|
|
3087
|
+
Zi.displayName = "DisplayFile";
|
|
3088
|
+
const Wa = {
|
|
3089
|
+
...ee,
|
|
3069
3090
|
type: "upload",
|
|
3070
3091
|
extensions: [],
|
|
3071
3092
|
maximum_size: void 0,
|
|
3072
3093
|
maximum_files: 1
|
|
3073
|
-
},
|
|
3094
|
+
}, Ve = class Ve extends G {
|
|
3074
3095
|
constructor(e) {
|
|
3075
3096
|
const { extensions: i, maximum_files: r, maximum_size: o, ...a } = e;
|
|
3076
3097
|
super({ ...a, type: "upload" });
|
|
@@ -3090,7 +3111,7 @@ const za = {
|
|
|
3090
3111
|
const i = e && `${e}.`;
|
|
3091
3112
|
return [
|
|
3092
3113
|
{
|
|
3093
|
-
field: new
|
|
3114
|
+
field: new Ee({
|
|
3094
3115
|
label: "How many files can be uploaded?",
|
|
3095
3116
|
description: "By default, only one file can be uploaded.",
|
|
3096
3117
|
required: !1,
|
|
@@ -3102,20 +3123,20 @@ const za = {
|
|
|
3102
3123
|
showDirectly: !1
|
|
3103
3124
|
},
|
|
3104
3125
|
{
|
|
3105
|
-
field: new
|
|
3126
|
+
field: new Ee({
|
|
3106
3127
|
// TODO: Default value
|
|
3107
3128
|
label: "What is the maximum size of each file?",
|
|
3108
|
-
description: `Maximum file size in megabytes (between 1MB–${
|
|
3129
|
+
description: `Maximum file size in megabytes (between 1MB–${at}MB).`,
|
|
3109
3130
|
required: !1,
|
|
3110
3131
|
identifier: `${i}maximum_size`,
|
|
3111
3132
|
minimum: 1,
|
|
3112
|
-
maximum:
|
|
3133
|
+
maximum: at,
|
|
3113
3134
|
integers: !0
|
|
3114
3135
|
}),
|
|
3115
3136
|
showDirectly: !1
|
|
3116
3137
|
},
|
|
3117
3138
|
{
|
|
3118
|
-
field: new
|
|
3139
|
+
field: new vt({
|
|
3119
3140
|
label: "Accepted file types",
|
|
3120
3141
|
description: "Types of allowed files to upload. If left blank, all files will be accepted.",
|
|
3121
3142
|
required: !1,
|
|
@@ -3148,7 +3169,7 @@ const za = {
|
|
|
3148
3169
|
];
|
|
3149
3170
|
}
|
|
3150
3171
|
getFieldValidators() {
|
|
3151
|
-
const e = super.getFieldValidators(), i = this.maxFileSize ??
|
|
3172
|
+
const e = super.getFieldValidators(), i = this.maxFileSize ?? at, r = i * 1e3 * 1e3, o = this.maxFiles || 1;
|
|
3152
3173
|
return e.push((a) => {
|
|
3153
3174
|
if (a && a.some((l) => l.size > r))
|
|
3154
3175
|
return `Files must be at most ${i}MB.`;
|
|
@@ -3167,88 +3188,88 @@ const za = {
|
|
|
3167
3188
|
}
|
|
3168
3189
|
static deserialize(e) {
|
|
3169
3190
|
if (e.type !== "upload") throw new Error("Type mismatch.");
|
|
3170
|
-
return new
|
|
3191
|
+
return new Ve(e);
|
|
3171
3192
|
}
|
|
3172
3193
|
getInput(e) {
|
|
3173
|
-
return /* @__PURE__ */ s(
|
|
3194
|
+
return /* @__PURE__ */ s(Ji, { field: this, ...e });
|
|
3174
3195
|
}
|
|
3175
3196
|
};
|
|
3176
|
-
I(
|
|
3177
|
-
let
|
|
3178
|
-
const
|
|
3179
|
-
date:
|
|
3180
|
-
number:
|
|
3181
|
-
boolean:
|
|
3182
|
-
select:
|
|
3183
|
-
string:
|
|
3184
|
-
text:
|
|
3185
|
-
custom:
|
|
3186
|
-
upload:
|
|
3187
|
-
qr:
|
|
3197
|
+
I(Ve, "fieldTypeName", "Upload"), I(Ve, "fieldTypeDescription", "Allows a file to be uploaded."), I(Ve, "Icon", Tr);
|
|
3198
|
+
let Wt = Ve;
|
|
3199
|
+
const vn = {
|
|
3200
|
+
date: Bt,
|
|
3201
|
+
number: Ee,
|
|
3202
|
+
boolean: Ge,
|
|
3203
|
+
select: yt,
|
|
3204
|
+
string: Ut,
|
|
3205
|
+
text: jt,
|
|
3206
|
+
custom: ut,
|
|
3207
|
+
upload: Wt,
|
|
3208
|
+
qr: $t,
|
|
3188
3209
|
// TODO: Underscore
|
|
3189
|
-
"multi-string":
|
|
3190
|
-
"multi-select":
|
|
3191
|
-
},
|
|
3192
|
-
date:
|
|
3193
|
-
number:
|
|
3194
|
-
boolean:
|
|
3195
|
-
select:
|
|
3196
|
-
string:
|
|
3197
|
-
text:
|
|
3198
|
-
custom:
|
|
3199
|
-
upload:
|
|
3200
|
-
qr:
|
|
3210
|
+
"multi-string": gt,
|
|
3211
|
+
"multi-select": vt
|
|
3212
|
+
}, qa = {
|
|
3213
|
+
date: Ia,
|
|
3214
|
+
number: ka,
|
|
3215
|
+
boolean: Ea,
|
|
3216
|
+
select: Ba,
|
|
3217
|
+
string: Va,
|
|
3218
|
+
text: $a,
|
|
3219
|
+
custom: Sa,
|
|
3220
|
+
upload: Wa,
|
|
3221
|
+
qr: Ma,
|
|
3201
3222
|
// TODO: Underscore
|
|
3202
|
-
"multi-string":
|
|
3203
|
-
"multi-select":
|
|
3204
|
-
},
|
|
3223
|
+
"multi-string": Pa,
|
|
3224
|
+
"multi-select": _a
|
|
3225
|
+
}, at = 50, Ha = at * 1e3, Ga = Ha * 1e3, er = (t) => {
|
|
3205
3226
|
const n = t.type;
|
|
3206
|
-
return
|
|
3207
|
-
},
|
|
3208
|
-
function
|
|
3227
|
+
return vn[n].deserialize(t);
|
|
3228
|
+
}, yn = (t) => t.type === "section" ? H.deserialize(t) : er(t);
|
|
3229
|
+
function Xa(t, n = {}) {
|
|
3209
3230
|
const { readonly: e = !1 } = n;
|
|
3210
3231
|
return {
|
|
3211
3232
|
title: t.title,
|
|
3212
3233
|
description: t.description,
|
|
3213
|
-
fields: t.fields.map((i) =>
|
|
3234
|
+
fields: t.fields.map((i) => yn(i)),
|
|
3214
3235
|
meta: { readonly: e }
|
|
3215
3236
|
};
|
|
3216
3237
|
}
|
|
3217
|
-
function
|
|
3238
|
+
function tr(t) {
|
|
3218
3239
|
const n = [];
|
|
3219
3240
|
for (const e of t.fields)
|
|
3220
|
-
if (e instanceof
|
|
3241
|
+
if (e instanceof H)
|
|
3221
3242
|
for (const i of e.fields)
|
|
3222
3243
|
n.push(i);
|
|
3223
3244
|
else {
|
|
3224
|
-
if (!(e instanceof
|
|
3245
|
+
if (!(e instanceof G))
|
|
3225
3246
|
throw new Error(`Invalid field type: ${e.type}`);
|
|
3226
3247
|
n.push(e);
|
|
3227
3248
|
}
|
|
3228
3249
|
return n;
|
|
3229
3250
|
}
|
|
3230
|
-
function
|
|
3231
|
-
const e =
|
|
3251
|
+
function Es(t, n) {
|
|
3252
|
+
const e = tr(t), i = {};
|
|
3232
3253
|
for (const r of e) {
|
|
3233
3254
|
const o = n[r.identifier] ?? null;
|
|
3234
3255
|
o !== null ? i[r.identifier] = r.decodeJsonToValue(o) : i[r.identifier] = o;
|
|
3235
3256
|
}
|
|
3236
3257
|
return i;
|
|
3237
3258
|
}
|
|
3238
|
-
function
|
|
3239
|
-
const e =
|
|
3259
|
+
function Is(t, n) {
|
|
3260
|
+
const e = tr(t), i = {};
|
|
3240
3261
|
for (const r of e) {
|
|
3241
3262
|
const o = n[r.identifier];
|
|
3242
3263
|
i[r.identifier] = r.encodeValueToJson(o);
|
|
3243
3264
|
}
|
|
3244
3265
|
return i;
|
|
3245
3266
|
}
|
|
3246
|
-
function
|
|
3267
|
+
function qt(t) {
|
|
3247
3268
|
return Array.isArray(t) && t.some((n) => n instanceof File || n instanceof Promise);
|
|
3248
3269
|
}
|
|
3249
|
-
function
|
|
3270
|
+
function nr(t, n) {
|
|
3250
3271
|
if (!t) return !0;
|
|
3251
|
-
if (
|
|
3272
|
+
if (qt(n) || qt(t.value)) throw new Error("Conditions do not support file uploads");
|
|
3252
3273
|
const e = Array.isArray(n) ? n.map((r) => typeof r == "string" ? r : r.value) : n, i = Array.isArray(t.value) ? t.value.map((r) => typeof r == "string" ? r : r.value) : t.value;
|
|
3253
3274
|
if (Array.isArray(i) && Array.isArray(e)) {
|
|
3254
3275
|
for (const r of i)
|
|
@@ -3257,30 +3278,30 @@ function Zi(t, n) {
|
|
|
3257
3278
|
}
|
|
3258
3279
|
return i === n;
|
|
3259
3280
|
}
|
|
3260
|
-
const
|
|
3261
|
-
const { field: n, ...e } = t, { label: i, description: r, fields: o, condition: a } = n, { values: l, setFieldValue: m } =
|
|
3262
|
-
() => c === void 0 ||
|
|
3281
|
+
const ir = O((t) => {
|
|
3282
|
+
const { field: n, ...e } = t, { label: i, description: r, fields: o, condition: a } = n, { values: l, setFieldValue: m } = Ie(), c = a != null && a.identifier ? J(l, a.identifier) : void 0, d = P(
|
|
3283
|
+
() => c === void 0 || nr(a, c),
|
|
3263
3284
|
[a, c]
|
|
3264
3285
|
);
|
|
3265
|
-
|
|
3286
|
+
K(() => {
|
|
3266
3287
|
if (!d)
|
|
3267
3288
|
for (const h of o)
|
|
3268
3289
|
m(h.getId(), "").then();
|
|
3269
3290
|
}, [d, o, m]);
|
|
3270
|
-
const u =
|
|
3271
|
-
return d ? /* @__PURE__ */ s(
|
|
3272
|
-
(i || r) && /* @__PURE__ */ x(
|
|
3291
|
+
const u = ft(o, e);
|
|
3292
|
+
return d ? /* @__PURE__ */ s(He, { variant: "soft", children: /* @__PURE__ */ x("div", { className: "flex flex-col gap-4", children: [
|
|
3293
|
+
(i || r) && /* @__PURE__ */ x(be, { children: [
|
|
3273
3294
|
/* @__PURE__ */ x("div", { className: "flex flex-col", children: [
|
|
3274
|
-
/* @__PURE__ */ s(
|
|
3275
|
-
/* @__PURE__ */ s(
|
|
3295
|
+
/* @__PURE__ */ s(Gn, { size: "md", children: i }),
|
|
3296
|
+
/* @__PURE__ */ s(ge, { accentColor: "base", children: r })
|
|
3276
3297
|
] }),
|
|
3277
|
-
/* @__PURE__ */ s(
|
|
3298
|
+
/* @__PURE__ */ s(Xt, { size: "full" })
|
|
3278
3299
|
] }),
|
|
3279
3300
|
u
|
|
3280
3301
|
] }) }) : null;
|
|
3281
3302
|
});
|
|
3282
|
-
|
|
3283
|
-
const $e = class $e extends
|
|
3303
|
+
ir.displayName = "FieldSectionLayout";
|
|
3304
|
+
const $e = class $e extends ti {
|
|
3284
3305
|
constructor(e) {
|
|
3285
3306
|
const { label: i = null, fields: r, condition: o = null, conditional: a, ...l } = e;
|
|
3286
3307
|
super({ ...l, type: "section" });
|
|
@@ -3294,7 +3315,7 @@ const $e = class $e extends Jn {
|
|
|
3294
3315
|
const r = i && `${i}.`;
|
|
3295
3316
|
return [
|
|
3296
3317
|
{
|
|
3297
|
-
field: new
|
|
3318
|
+
field: new Ge({
|
|
3298
3319
|
label: "Conditionally render section",
|
|
3299
3320
|
identifier: `${r}conditional`,
|
|
3300
3321
|
required: !1
|
|
@@ -3315,7 +3336,7 @@ const $e = class $e extends Jn {
|
|
|
3315
3336
|
fields: [
|
|
3316
3337
|
// Declare a select field that will be used to select the field against which we will check the
|
|
3317
3338
|
// condition. This must be selected before the next field is rendered.
|
|
3318
|
-
new
|
|
3339
|
+
new yt({
|
|
3319
3340
|
label: "Field",
|
|
3320
3341
|
description: "The field to use for the condition.",
|
|
3321
3342
|
// The options (for the field against which we will check the condition) are all the labels of
|
|
@@ -3332,7 +3353,7 @@ const $e = class $e extends Jn {
|
|
|
3332
3353
|
// Declare a custom field that will be used to input a value for the condition. The value of the
|
|
3333
3354
|
// conditional field selected in the previous step must be equal to the value the user inputs into
|
|
3334
3355
|
// this field for the section to be rendered.
|
|
3335
|
-
new
|
|
3356
|
+
new Ra({
|
|
3336
3357
|
label: "Value",
|
|
3337
3358
|
identifier: `${r}condition.value`,
|
|
3338
3359
|
required: !0,
|
|
@@ -3360,7 +3381,7 @@ const $e = class $e extends Jn {
|
|
|
3360
3381
|
static deserialize(e) {
|
|
3361
3382
|
if (e.type !== "section") throw new Error("Invalid type");
|
|
3362
3383
|
if (!Array.isArray(e.fields)) throw new Error(`Invalid fields: ${e.fields} (not an array)`);
|
|
3363
|
-
const i = e.fields.map(
|
|
3384
|
+
const i = e.fields.map(er);
|
|
3364
3385
|
return new $e({ ...e, fields: i });
|
|
3365
3386
|
}
|
|
3366
3387
|
conditional() {
|
|
@@ -3378,51 +3399,51 @@ const $e = class $e extends Jn {
|
|
|
3378
3399
|
getErrors(e) {
|
|
3379
3400
|
const i = {};
|
|
3380
3401
|
for (const r of this.fields) {
|
|
3381
|
-
const o = r.getId(), a = r.getError(
|
|
3382
|
-
a &&
|
|
3402
|
+
const o = r.getId(), a = r.getError(J(e, o), e);
|
|
3403
|
+
a && Zt(i, r.getId(), a);
|
|
3383
3404
|
}
|
|
3384
3405
|
return i;
|
|
3385
3406
|
}
|
|
3386
3407
|
getInput(e) {
|
|
3387
|
-
return /* @__PURE__ */ s(
|
|
3408
|
+
return /* @__PURE__ */ s(ir, { field: this, ...e });
|
|
3388
3409
|
}
|
|
3389
3410
|
};
|
|
3390
3411
|
I($e, "fieldTypeName", "Section"), I($e, "fieldTypeDescription", "Sections can be useful for grouping fields together. They can also be conditionally shown or hidden.");
|
|
3391
|
-
let
|
|
3392
|
-
const
|
|
3412
|
+
let H = $e;
|
|
3413
|
+
const ye = (t) => Object.keys(t).length > 0, bn = (t, n) => {
|
|
3393
3414
|
const e = {};
|
|
3394
3415
|
for (const i of t.fields)
|
|
3395
|
-
if (i instanceof
|
|
3416
|
+
if (i instanceof H) {
|
|
3396
3417
|
if (i.condition) {
|
|
3397
3418
|
const { identifier: r } = i.condition;
|
|
3398
|
-
if (!
|
|
3419
|
+
if (!nr(i.condition, J(n, r)))
|
|
3399
3420
|
continue;
|
|
3400
3421
|
}
|
|
3401
3422
|
Object.assign(e, i.getErrors(n));
|
|
3402
3423
|
} else {
|
|
3403
|
-
if (!(i instanceof
|
|
3424
|
+
if (!(i instanceof G))
|
|
3404
3425
|
throw new Error("Invalid field type");
|
|
3405
|
-
const r = i.getId(), o = i.getError(
|
|
3406
|
-
o &&
|
|
3426
|
+
const r = i.getId(), o = i.getError(J(n, r), n);
|
|
3427
|
+
o && Zt(e, r, o);
|
|
3407
3428
|
}
|
|
3408
|
-
if (
|
|
3409
|
-
},
|
|
3410
|
-
(e, i) => i instanceof
|
|
3429
|
+
if (ye(e)) return e;
|
|
3430
|
+
}, Ka = [null, void 0], wn = (t, n) => t.reduce(
|
|
3431
|
+
(e, i) => i instanceof H ? { ...e, ...wn(i.fields, n) } : (Ka.includes(J(e, i.getId())) && Zt(e, i.getId(), ""), e),
|
|
3411
3432
|
// TODO: Had to do this because of this error:
|
|
3412
3433
|
// > Uncaught TypeError: can't define property "description":
|
|
3413
3434
|
// > Object is not extensible"
|
|
3414
3435
|
// This means that we can't mutate `acc` because it's frozen for some
|
|
3415
3436
|
// unknown reason.
|
|
3416
|
-
|
|
3417
|
-
),
|
|
3437
|
+
kr(n)
|
|
3438
|
+
), Qa = () => {
|
|
3418
3439
|
throw new Error("onSubmit must be provided if form is not readonly.");
|
|
3419
|
-
},
|
|
3420
|
-
|
|
3440
|
+
}, Ya = O(
|
|
3441
|
+
Xe((t, n) => {
|
|
3421
3442
|
const {
|
|
3422
3443
|
schema: e,
|
|
3423
3444
|
values: i = {},
|
|
3424
3445
|
onValuesChange: r,
|
|
3425
|
-
onSubmit: o =
|
|
3446
|
+
onSubmit: o = Qa,
|
|
3426
3447
|
submitText: a = "Submit",
|
|
3427
3448
|
cancelText: l,
|
|
3428
3449
|
onCancel: m,
|
|
@@ -3433,45 +3454,45 @@ const ve = (t) => Object.keys(t).length > 0, vn = (t, n) => {
|
|
|
3433
3454
|
hideDescription: h,
|
|
3434
3455
|
className: y,
|
|
3435
3456
|
buttonProps: b
|
|
3436
|
-
} = t, { readonly: f } = e.meta, g = P(() => crypto.randomUUID(), []), C =
|
|
3437
|
-
initialValues:
|
|
3457
|
+
} = t, { readonly: f } = e.meta, g = P(() => crypto.randomUUID(), []), C = Yt({
|
|
3458
|
+
initialValues: wn(e.fields, i),
|
|
3438
3459
|
onSubmit: o,
|
|
3439
|
-
validate: (R) =>
|
|
3460
|
+
validate: (R) => bn(e, R),
|
|
3440
3461
|
// only validate the entire form on submit
|
|
3441
3462
|
validateOnBlur: !1,
|
|
3442
3463
|
validateOnChange: !1
|
|
3443
3464
|
}), { dirty: w } = C, v = P(
|
|
3444
|
-
() => typeof e.title == "string" ? /* @__PURE__ */ s(
|
|
3465
|
+
() => typeof e.title == "string" ? /* @__PURE__ */ s(Gn, { size: "md", children: e.title }) : e.title,
|
|
3445
3466
|
[e.title]
|
|
3446
3467
|
), E = P(
|
|
3447
|
-
() => typeof e.description == "string" ? /* @__PURE__ */ s(
|
|
3468
|
+
() => typeof e.description == "string" ? /* @__PURE__ */ s(ge, { accentColor: "base", children: e.description }) : e.description,
|
|
3448
3469
|
[e.description]
|
|
3449
3470
|
), S = N(
|
|
3450
3471
|
(R, T) => {
|
|
3451
|
-
r == null || r({ [R]: T });
|
|
3472
|
+
r == null || r({ ...C.values, [R]: T }, { [R]: T });
|
|
3452
3473
|
},
|
|
3453
|
-
[r]
|
|
3454
|
-
), L =
|
|
3455
|
-
return
|
|
3474
|
+
[C.values, r]
|
|
3475
|
+
), L = ft(e.fields, { formId: g, disabled: f, onValuesChange: S });
|
|
3476
|
+
return K(() => {
|
|
3456
3477
|
w && c && c(), d && d(w);
|
|
3457
|
-
}, [w, c, d]), /* @__PURE__ */ s(
|
|
3478
|
+
}, [w, c, d]), /* @__PURE__ */ s(Jt, { value: C, children: /* @__PURE__ */ x(
|
|
3458
3479
|
"form",
|
|
3459
3480
|
{
|
|
3460
3481
|
id: g,
|
|
3461
3482
|
ref: n,
|
|
3462
|
-
className:
|
|
3483
|
+
className: qe(y, "flex flex-col gap-2"),
|
|
3463
3484
|
onSubmit: C.handleSubmit,
|
|
3464
3485
|
children: [
|
|
3465
|
-
!u && /* @__PURE__ */ s(
|
|
3486
|
+
!u && /* @__PURE__ */ s(He, { variant: "soft", children: /* @__PURE__ */ x("div", { className: "flex flex-col gap-1", children: [
|
|
3466
3487
|
v,
|
|
3467
3488
|
!h && E
|
|
3468
3489
|
] }) }),
|
|
3469
3490
|
L,
|
|
3470
3491
|
!f && /* @__PURE__ */ x("div", { className: "flex items-center justify-end gap-2", children: [
|
|
3471
3492
|
l && /* @__PURE__ */ x(
|
|
3472
|
-
|
|
3493
|
+
Q,
|
|
3473
3494
|
{
|
|
3474
|
-
accentColor:
|
|
3495
|
+
accentColor: we.danger,
|
|
3475
3496
|
...b,
|
|
3476
3497
|
type: "button",
|
|
3477
3498
|
onClick: m,
|
|
@@ -3481,7 +3502,7 @@ const ve = (t) => Object.keys(t).length > 0, vn = (t, n) => {
|
|
|
3481
3502
|
]
|
|
3482
3503
|
}
|
|
3483
3504
|
),
|
|
3484
|
-
/* @__PURE__ */ x(
|
|
3505
|
+
/* @__PURE__ */ x(Q, { ...b, type: "submit", disabled: !C.isValid, accentColor: "success", children: [
|
|
3485
3506
|
/* @__PURE__ */ s(F, { icon: "RiCheckLine" }),
|
|
3486
3507
|
a
|
|
3487
3508
|
] })
|
|
@@ -3490,8 +3511,8 @@ const ve = (t) => Object.keys(t).length > 0, vn = (t, n) => {
|
|
|
3490
3511
|
}
|
|
3491
3512
|
) });
|
|
3492
3513
|
})
|
|
3493
|
-
),
|
|
3494
|
-
const { name: n, render: e } = t, { submitForm: i } =
|
|
3514
|
+
), We = O((t) => {
|
|
3515
|
+
const { name: n, render: e } = t, { submitForm: i } = Ie(), [r, o, a] = Qt(n), l = P(() => {
|
|
3495
3516
|
const m = (c) => {
|
|
3496
3517
|
a.setValue(c, !1);
|
|
3497
3518
|
};
|
|
@@ -3504,12 +3525,12 @@ const ve = (t) => Object.keys(t).length > 0, vn = (t, n) => {
|
|
|
3504
3525
|
}
|
|
3505
3526
|
});
|
|
3506
3527
|
}, [e, r.value, o, i, a]);
|
|
3507
|
-
return /* @__PURE__ */ s(
|
|
3528
|
+
return /* @__PURE__ */ s(be, { children: l });
|
|
3508
3529
|
});
|
|
3509
|
-
|
|
3510
|
-
const
|
|
3511
|
-
|
|
3512
|
-
const { children: e, schema: i, values: r, onPatch: o, onError: a, requiresDiff: l = !0, onDirtyChange: m, ...c } = t, d = P(() =>
|
|
3530
|
+
We.displayName = "PatchField";
|
|
3531
|
+
const Ss = O(
|
|
3532
|
+
Xe((t, n) => {
|
|
3533
|
+
const { children: e, schema: i, values: r, onPatch: o, onError: a, requiresDiff: l = !0, onDirtyChange: m, ...c } = t, d = P(() => wn(i.fields, r), [i.fields, r]), u = N(
|
|
3513
3534
|
(w) => {
|
|
3514
3535
|
const v = {};
|
|
3515
3536
|
for (const E in w) {
|
|
@@ -3522,20 +3543,20 @@ const ys = O(
|
|
|
3522
3543
|
), h = N(
|
|
3523
3544
|
(w) => {
|
|
3524
3545
|
const v = u(w);
|
|
3525
|
-
l && !
|
|
3546
|
+
l && !ye(v) || o(v);
|
|
3526
3547
|
},
|
|
3527
3548
|
[u, o, l]
|
|
3528
3549
|
), y = N(
|
|
3529
3550
|
(w) => {
|
|
3530
|
-
const v =
|
|
3551
|
+
const v = bn(i, w);
|
|
3531
3552
|
if (v && a(v), m) {
|
|
3532
3553
|
const E = u(w);
|
|
3533
|
-
m(
|
|
3554
|
+
m(ye(E));
|
|
3534
3555
|
}
|
|
3535
3556
|
return v;
|
|
3536
3557
|
},
|
|
3537
3558
|
[i, m, a, u]
|
|
3538
|
-
), b =
|
|
3559
|
+
), b = Yt({
|
|
3539
3560
|
initialValues: d,
|
|
3540
3561
|
onSubmit: h,
|
|
3541
3562
|
validate: y,
|
|
@@ -3545,21 +3566,21 @@ const ys = O(
|
|
|
3545
3566
|
}), f = N(() => {
|
|
3546
3567
|
if (m) {
|
|
3547
3568
|
const w = u(b.values);
|
|
3548
|
-
|
|
3569
|
+
ye(w) && m(!0);
|
|
3549
3570
|
}
|
|
3550
3571
|
}, [b.values, u, m]), { errors: g, resetForm: C } = b;
|
|
3551
|
-
return
|
|
3552
|
-
|
|
3553
|
-
}, [g, d, C]), /* @__PURE__ */ s(
|
|
3572
|
+
return K(() => {
|
|
3573
|
+
ye(g) && C({ values: d, errors: {} });
|
|
3574
|
+
}, [g, d, C]), /* @__PURE__ */ s(Jt, { value: b, children: /* @__PURE__ */ s("form", { ...c, ref: n, onSubmit: b.handleSubmit, onChange: f, children: e }) });
|
|
3554
3575
|
})
|
|
3555
|
-
),
|
|
3576
|
+
), st = "form-builder", Ja = [
|
|
3556
3577
|
["string", "text"],
|
|
3557
3578
|
["select", "multi-select", "upload", "qr"],
|
|
3558
3579
|
["boolean", "date", "number", "multi-string"]
|
|
3559
|
-
],
|
|
3560
|
-
...
|
|
3561
|
-
section:
|
|
3562
|
-
},
|
|
3580
|
+
], Ht = {
|
|
3581
|
+
...vn,
|
|
3582
|
+
section: H
|
|
3583
|
+
}, Za = (t, n) => {
|
|
3563
3584
|
var i;
|
|
3564
3585
|
const e = { ...t };
|
|
3565
3586
|
switch (n.type) {
|
|
@@ -3574,7 +3595,7 @@ const ys = O(
|
|
|
3574
3595
|
case "update":
|
|
3575
3596
|
return n.state;
|
|
3576
3597
|
}
|
|
3577
|
-
},
|
|
3598
|
+
}, es = (t, n) => {
|
|
3578
3599
|
if (n)
|
|
3579
3600
|
for (let e = 0; e < t.length; e++) {
|
|
3580
3601
|
const i = t[e];
|
|
@@ -3583,7 +3604,7 @@ const ys = O(
|
|
|
3583
3604
|
if (r.identifier === n) return e;
|
|
3584
3605
|
}
|
|
3585
3606
|
}
|
|
3586
|
-
},
|
|
3607
|
+
}, Wn = (t) => {
|
|
3587
3608
|
var e, i, r;
|
|
3588
3609
|
const n = {};
|
|
3589
3610
|
for (let o = 0; o < t.length; o++) {
|
|
@@ -3593,32 +3614,32 @@ const ys = O(
|
|
|
3593
3614
|
(i = a.condition) != null && i.identifier && m.add(a.condition.identifier), n[a.identifier] = {
|
|
3594
3615
|
disabled: !1,
|
|
3595
3616
|
conditionFields: m,
|
|
3596
|
-
conditionIndex:
|
|
3617
|
+
conditionIndex: es(t, (r = a.condition) == null ? void 0 : r.identifier),
|
|
3597
3618
|
index: o,
|
|
3598
3619
|
label: a.label
|
|
3599
3620
|
};
|
|
3600
3621
|
}
|
|
3601
3622
|
return n;
|
|
3602
|
-
},
|
|
3623
|
+
}, xn = O((t) => {
|
|
3603
3624
|
const { index: n, type: e, sectionIndex: i, remove: r, duplicate: o, move: a, upload: l } = t;
|
|
3604
3625
|
if (e !== "section" && !l)
|
|
3605
3626
|
throw new Error("Upload function prop must be defined for non-section fields.");
|
|
3606
|
-
const { values: m } =
|
|
3627
|
+
const { values: m } = Ie(), c = me(null), d = P(() => {
|
|
3607
3628
|
const u = [
|
|
3608
3629
|
{
|
|
3609
|
-
Icon:
|
|
3630
|
+
Icon: Lr,
|
|
3610
3631
|
key: "duplicate",
|
|
3611
3632
|
text: "Duplicate",
|
|
3612
3633
|
buttonProps: { onClick: o }
|
|
3613
3634
|
}
|
|
3614
3635
|
];
|
|
3615
3636
|
return u.push({
|
|
3616
|
-
Icon:
|
|
3637
|
+
Icon: Fr,
|
|
3617
3638
|
key: "delete",
|
|
3618
3639
|
text: "Delete",
|
|
3619
3640
|
buttonProps: { onClick: r }
|
|
3620
3641
|
}), e !== "section" && u.unshift({
|
|
3621
|
-
Icon:
|
|
3642
|
+
Icon: Ar,
|
|
3622
3643
|
key: "upload",
|
|
3623
3644
|
text: "Upload image",
|
|
3624
3645
|
buttonProps: {
|
|
@@ -3628,7 +3649,7 @@ const ys = O(
|
|
|
3628
3649
|
}
|
|
3629
3650
|
}
|
|
3630
3651
|
}), (i === void 0 && n !== m.fields.length - 1 || i !== void 0 && (i < m.fields.length - 1 || n !== m.fields[i].fields.length - 1)) && u.unshift({
|
|
3631
|
-
Icon:
|
|
3652
|
+
Icon: Dr,
|
|
3632
3653
|
key: "moveDown",
|
|
3633
3654
|
text: "Move down",
|
|
3634
3655
|
buttonProps: {
|
|
@@ -3637,7 +3658,7 @@ const ys = O(
|
|
|
3637
3658
|
}
|
|
3638
3659
|
}
|
|
3639
3660
|
}), (i === void 0 && n !== 0 || i !== void 0 && (i !== 0 || n !== 0)) && u.unshift({
|
|
3640
|
-
Icon:
|
|
3661
|
+
Icon: Or,
|
|
3641
3662
|
key: "moveUp",
|
|
3642
3663
|
text: "Move up",
|
|
3643
3664
|
buttonProps: {
|
|
@@ -3647,9 +3668,9 @@ const ys = O(
|
|
|
3647
3668
|
}
|
|
3648
3669
|
}), u;
|
|
3649
3670
|
}, [o, n, a, r, i, e, m.fields]);
|
|
3650
|
-
return /* @__PURE__ */ x(
|
|
3651
|
-
/* @__PURE__ */ s(
|
|
3652
|
-
|
|
3671
|
+
return /* @__PURE__ */ x(be, { children: [
|
|
3672
|
+
/* @__PURE__ */ s(xt, { className: "mx-2 hidden flex-col gap-0.5 sm:flex", variant: "ghost", accentColor: "base", size: "sm", children: d.map((u) => /* @__PURE__ */ s(
|
|
3673
|
+
V,
|
|
3653
3674
|
{
|
|
3654
3675
|
type: "button",
|
|
3655
3676
|
"aria-label": u.text,
|
|
@@ -3660,7 +3681,7 @@ const ys = O(
|
|
|
3660
3681
|
)) }),
|
|
3661
3682
|
/* @__PURE__ */ s("div", { className: "sm:hidden", children: /* @__PURE__ */ x(_.Root, { children: [
|
|
3662
3683
|
/* @__PURE__ */ s(_.ClickTrigger, { children: /* @__PURE__ */ s(
|
|
3663
|
-
|
|
3684
|
+
V,
|
|
3664
3685
|
{
|
|
3665
3686
|
variant: "ghost",
|
|
3666
3687
|
accentColor: "base",
|
|
@@ -3681,19 +3702,19 @@ const ys = O(
|
|
|
3681
3702
|
e !== "section" && /* @__PURE__ */ s("input", { style: { display: "none" }, ref: c, type: "file", accept: "image/*", onChange: l })
|
|
3682
3703
|
] });
|
|
3683
3704
|
});
|
|
3684
|
-
|
|
3685
|
-
const
|
|
3705
|
+
xn.displayName = "FieldActions";
|
|
3706
|
+
const Gt = O((t) => {
|
|
3686
3707
|
const { popoverInputs: n, hasError: e, ...i } = t;
|
|
3687
|
-
return /* @__PURE__ */ x(
|
|
3688
|
-
/* @__PURE__ */ s(
|
|
3689
|
-
|
|
3708
|
+
return /* @__PURE__ */ x(le.Root, { children: [
|
|
3709
|
+
/* @__PURE__ */ s(le.Trigger, { asChild: !0, children: /* @__PURE__ */ x(
|
|
3710
|
+
Q,
|
|
3690
3711
|
{
|
|
3691
3712
|
variant: "soft",
|
|
3692
3713
|
type: "button",
|
|
3693
3714
|
size: "sm",
|
|
3694
3715
|
"aria-label": "settings",
|
|
3695
3716
|
accentColor: "base",
|
|
3696
|
-
...e && { color:
|
|
3717
|
+
...e && { color: we.danger },
|
|
3697
3718
|
children: [
|
|
3698
3719
|
/* @__PURE__ */ s(F, { icon: "RiSettings2Line" }),
|
|
3699
3720
|
/* @__PURE__ */ s("span", { children: "Settings" })
|
|
@@ -3701,12 +3722,12 @@ const qt = O((t) => {
|
|
|
3701
3722
|
},
|
|
3702
3723
|
"settings"
|
|
3703
3724
|
) }),
|
|
3704
|
-
/* @__PURE__ */ s(
|
|
3725
|
+
/* @__PURE__ */ s(le.Content, { size: "sm", ...i, children: /* @__PURE__ */ s("div", { className: "flex w-full max-w-[350px] flex-col", children: n }) })
|
|
3705
3726
|
] });
|
|
3706
3727
|
});
|
|
3707
|
-
|
|
3708
|
-
const
|
|
3709
|
-
const i =
|
|
3728
|
+
Gt.displayName = "FieldSettingsPopover";
|
|
3729
|
+
const rr = (t = () => null) => P(() => Ja.map((n) => n.map((e) => {
|
|
3730
|
+
const i = vn[e], r = i.Icon;
|
|
3710
3731
|
return {
|
|
3711
3732
|
children: i.fieldTypeName,
|
|
3712
3733
|
icon: /* @__PURE__ */ s(r, {}),
|
|
@@ -3715,114 +3736,114 @@ const tr = (t = () => null) => P(() => qa.map((n) => n.map((e) => {
|
|
|
3715
3736
|
t(e);
|
|
3716
3737
|
}
|
|
3717
3738
|
};
|
|
3718
|
-
})), [t]),
|
|
3719
|
-
var
|
|
3720
|
-
const { parentPath: n, index: e, initial: i, conditionalSourceFields: r } = t, { values: o, setFieldValue: a, errors: l } =
|
|
3739
|
+
})), [t]), Cn = O((t) => {
|
|
3740
|
+
var Re, St, En, In, Sn;
|
|
3741
|
+
const { parentPath: n, index: e, initial: i, conditionalSourceFields: r } = t, { values: o, setFieldValue: a, errors: l } = Ie(), m = rr(), c = rn(), d = me(null), u = 576, [h, y] = $(
|
|
3721
3742
|
d.current && d.current.getBoundingClientRect().width >= u
|
|
3722
3743
|
);
|
|
3723
|
-
|
|
3744
|
+
K(() => {
|
|
3724
3745
|
const A = d.current;
|
|
3725
3746
|
if (A) {
|
|
3726
|
-
const z = new ResizeObserver((
|
|
3727
|
-
|
|
3747
|
+
const z = new ResizeObserver((W) => {
|
|
3748
|
+
W[0] && y(W[0].contentRect.width >= u);
|
|
3728
3749
|
});
|
|
3729
3750
|
return z.observe(A), () => {
|
|
3730
3751
|
z.disconnect();
|
|
3731
3752
|
};
|
|
3732
3753
|
}
|
|
3733
3754
|
}, []);
|
|
3734
|
-
const [b, f] =
|
|
3735
|
-
|
|
3736
|
-
|
|
3755
|
+
const [b, f] = $(void 0);
|
|
3756
|
+
K(() => {
|
|
3757
|
+
ve(i) ? f(void 0) : i.image instanceof Promise ? i.image.then(f).catch(console.error) : f(i.image);
|
|
3737
3758
|
}, [i]);
|
|
3738
3759
|
const g = b ? URL.createObjectURL(b) : void 0, C = N(
|
|
3739
3760
|
(A) => {
|
|
3740
3761
|
A.stopPropagation();
|
|
3741
|
-
const { image: z, ...
|
|
3742
|
-
a(`${n}.${e}`,
|
|
3762
|
+
const { image: z, ...W } = i;
|
|
3763
|
+
a(`${n}.${e}`, W).then();
|
|
3743
3764
|
},
|
|
3744
3765
|
[e, i, n, a]
|
|
3745
3766
|
);
|
|
3746
|
-
|
|
3747
|
-
|
|
3767
|
+
K(() => {
|
|
3768
|
+
ve(i) && !i.conditional && a(`${n}.${e}.condition`, null).then();
|
|
3748
3769
|
}, [e, i, n, a]);
|
|
3749
3770
|
const w = P(
|
|
3750
3771
|
() => {
|
|
3751
3772
|
var A, z;
|
|
3752
|
-
return
|
|
3773
|
+
return ve(i) ? (z = $i(o.fields, (A = i.condition) == null ? void 0 : A.identifier)) == null ? void 0 : z.label : void 0;
|
|
3753
3774
|
},
|
|
3754
3775
|
[i, o.fields]
|
|
3755
|
-
), v =
|
|
3776
|
+
), v = ve(i) ? Array.isArray((Re = i.condition) == null ? void 0 : Re.value) ? "contains all of" : "equals" : void 0;
|
|
3756
3777
|
let E;
|
|
3757
|
-
if (
|
|
3758
|
-
if (
|
|
3778
|
+
if (ve(i)) {
|
|
3779
|
+
if (qt((St = i.condition) == null ? void 0 : St.value))
|
|
3759
3780
|
throw new Error("File values are not supported for conditions.");
|
|
3760
|
-
E = Array.isArray((
|
|
3781
|
+
E = Array.isArray((En = i.condition) == null ? void 0 : En.value) ? i.condition.value.map((A) => typeof A == "string" ? A : A.label).join(", ") : (Sn = (In = i.condition) == null ? void 0 : In.value) == null ? void 0 : Sn.toString();
|
|
3761
3782
|
}
|
|
3762
3783
|
const S = N((A) => {
|
|
3763
3784
|
A.target.parentNode instanceof HTMLElement && (A.target.parentNode.dataset.replicatedValue = A.target.value);
|
|
3764
3785
|
}, []), L = N((A) => {
|
|
3765
3786
|
A.target.parentNode instanceof HTMLElement && (A.target.parentNode.dataset.replicatedValue = A.target.value);
|
|
3766
|
-
}, []), R = i.type, T =
|
|
3787
|
+
}, []), R = i.type, T = Ht[R], [D, M] = P(() => {
|
|
3767
3788
|
let A = [], z = [];
|
|
3768
|
-
if (T ===
|
|
3789
|
+
if (T === H) {
|
|
3769
3790
|
if (r === void 0)
|
|
3770
3791
|
throw new Error("Conditional source fields must be provided when changing sections.");
|
|
3771
|
-
const
|
|
3792
|
+
const W = T.getFieldCreationSchema(r, `${n}.${e}`);
|
|
3772
3793
|
A = A.concat(
|
|
3773
|
-
|
|
3794
|
+
W.filter((U) => U.showDirectly).map((U) => U.field)
|
|
3774
3795
|
), z = z.concat(
|
|
3775
|
-
|
|
3796
|
+
W.filter((U) => !U.showDirectly).map((U) => U.field)
|
|
3776
3797
|
);
|
|
3777
3798
|
} else {
|
|
3778
|
-
if (!(T.prototype instanceof
|
|
3799
|
+
if (!(T.prototype instanceof G))
|
|
3779
3800
|
throw new Error(`Field must be an instance of BaseField. Got ${T.toString()}.`);
|
|
3780
|
-
const
|
|
3801
|
+
const W = T.getFieldCreationSchema(
|
|
3781
3802
|
`${n}.${e}`
|
|
3782
3803
|
);
|
|
3783
3804
|
h ? (A = [
|
|
3784
3805
|
...A,
|
|
3785
|
-
...
|
|
3806
|
+
...W.filter((U) => U.showDirectly).map((U) => U.field)
|
|
3786
3807
|
], z = [
|
|
3787
3808
|
...z,
|
|
3788
|
-
...
|
|
3789
|
-
]) : z = [...z, ...
|
|
3809
|
+
...W.filter((U) => !U.showDirectly).map((U) => U.field)
|
|
3810
|
+
]) : z = [...z, ...W.map((U) => U.field)];
|
|
3790
3811
|
}
|
|
3791
3812
|
return [A, z];
|
|
3792
|
-
}, [T, r, n, e, h]),
|
|
3793
|
-
formId:
|
|
3813
|
+
}, [T, r, n, e, h]), X = ft(D, {
|
|
3814
|
+
formId: st,
|
|
3794
3815
|
disabled: !1,
|
|
3795
|
-
...T ===
|
|
3796
|
-
}),
|
|
3797
|
-
formId:
|
|
3816
|
+
...T === H && { size: "sm" }
|
|
3817
|
+
}), ne = ft(M, {
|
|
3818
|
+
formId: st,
|
|
3798
3819
|
disabled: !1
|
|
3799
3820
|
});
|
|
3800
3821
|
let B = M.length > 0;
|
|
3801
|
-
|
|
3802
|
-
const
|
|
3803
|
-
const z =
|
|
3804
|
-
return z && (typeof z != "object" ||
|
|
3805
|
-
}), k =
|
|
3822
|
+
ve(i) && M.length > 0 && (B = i.conditional);
|
|
3823
|
+
const Y = M.some((A) => {
|
|
3824
|
+
const z = J(l, T === H ? `${n}.${e}.condition` : A.getId());
|
|
3825
|
+
return z && (typeof z != "object" || ye(z));
|
|
3826
|
+
}), k = Y ? we.danger : void 0, q = P(() => yn(i), [i]), de = Bi(q, { formId: st, showInputOnly: !1 }), ie = P(
|
|
3806
3827
|
() => m.flat().find((A) => A.value === R),
|
|
3807
3828
|
[m, R]
|
|
3808
|
-
),
|
|
3829
|
+
), ue = N(() => {
|
|
3809
3830
|
b && c(() => ({
|
|
3810
3831
|
file: b
|
|
3811
3832
|
}));
|
|
3812
3833
|
}, [c, b]);
|
|
3813
3834
|
return /* @__PURE__ */ s("div", { className: "flex grow items-center w-full", ref: d, children: /* @__PURE__ */ x("div", { className: "flex w-full flex-col gap-2", children: [
|
|
3814
|
-
T ===
|
|
3815
|
-
|
|
3835
|
+
T === H && (D.length > 0 || B) && /* @__PURE__ */ x("div", { className: "flex flex-col gap-2", children: [
|
|
3836
|
+
X,
|
|
3816
3837
|
B && /* @__PURE__ */ x("div", { className: "flex items-center gap-4", children: [
|
|
3817
3838
|
/* @__PURE__ */ s(
|
|
3818
|
-
|
|
3839
|
+
Gt,
|
|
3819
3840
|
{
|
|
3820
|
-
popoverInputs:
|
|
3821
|
-
hasError:
|
|
3841
|
+
popoverInputs: ne,
|
|
3842
|
+
hasError: Y,
|
|
3822
3843
|
align: "start"
|
|
3823
3844
|
}
|
|
3824
3845
|
),
|
|
3825
|
-
|
|
3846
|
+
ve(i) && i.conditional && /* @__PURE__ */ s("span", { className: "text-sm text-(--accent-a11)", "data-accent-color": k, children: /* @__PURE__ */ x("em", { children: [
|
|
3826
3847
|
"Display only if ",
|
|
3827
3848
|
/* @__PURE__ */ s("strong", { children: w }),
|
|
3828
3849
|
" ",
|
|
@@ -3832,28 +3853,28 @@ const tr = (t = () => null) => P(() => qa.map((n) => n.map((e) => {
|
|
|
3832
3853
|
] }) })
|
|
3833
3854
|
] })
|
|
3834
3855
|
] }),
|
|
3835
|
-
T !==
|
|
3856
|
+
T !== H && /* @__PURE__ */ x("div", { className: "flex gap-2 w-full justify-between", children: [
|
|
3836
3857
|
/* @__PURE__ */ x("div", { className: "flex gap-2 items-center", children: [
|
|
3837
|
-
/* @__PURE__ */ x(
|
|
3838
|
-
|
|
3839
|
-
|
|
3858
|
+
/* @__PURE__ */ x(kt, { accentColor: "base", variant: "soft", size: "sm", children: [
|
|
3859
|
+
ie == null ? void 0 : ie.icon,
|
|
3860
|
+
ie == null ? void 0 : ie.children
|
|
3840
3861
|
] }),
|
|
3841
3862
|
/* @__PURE__ */ s(
|
|
3842
|
-
|
|
3863
|
+
We,
|
|
3843
3864
|
{
|
|
3844
3865
|
name: `${n}.${e}.required`,
|
|
3845
3866
|
render: ({ setValue: A, value: z }) => /* @__PURE__ */ x("div", { className: "flex items-center gap-2", children: [
|
|
3846
|
-
/* @__PURE__ */ s(
|
|
3847
|
-
/* @__PURE__ */ s(
|
|
3867
|
+
/* @__PURE__ */ s(lt.Root, { checked: z, onCheckedChange: A, size: "sm", children: /* @__PURE__ */ s(lt.Indicator, { children: /* @__PURE__ */ s(F, { icon: "RiCheckLine" }) }) }),
|
|
3868
|
+
/* @__PURE__ */ s(ge, { size: "sm", accentColor: "base", children: "Required" })
|
|
3848
3869
|
] })
|
|
3849
3870
|
}
|
|
3850
3871
|
)
|
|
3851
3872
|
] }),
|
|
3852
3873
|
B && /* @__PURE__ */ s(
|
|
3853
|
-
|
|
3874
|
+
Gt,
|
|
3854
3875
|
{
|
|
3855
|
-
popoverInputs:
|
|
3856
|
-
hasError:
|
|
3876
|
+
popoverInputs: ne,
|
|
3877
|
+
hasError: Y,
|
|
3857
3878
|
align: "end"
|
|
3858
3879
|
}
|
|
3859
3880
|
)
|
|
@@ -3865,11 +3886,11 @@ const tr = (t = () => null) => P(() => qa.map((n) => n.map((e) => {
|
|
|
3865
3886
|
className: "h-[100px] w-full min-w-[300px] cursor-pointer rounded-md object-cover",
|
|
3866
3887
|
src: g,
|
|
3867
3888
|
alt: b.name,
|
|
3868
|
-
onClick:
|
|
3889
|
+
onClick: ue
|
|
3869
3890
|
}
|
|
3870
3891
|
),
|
|
3871
3892
|
/* @__PURE__ */ s(
|
|
3872
|
-
|
|
3893
|
+
V,
|
|
3873
3894
|
{
|
|
3874
3895
|
className: "absolute top-2 right-2 hidden group-hover:not-disabled:flex",
|
|
3875
3896
|
variant: "solid",
|
|
@@ -3882,7 +3903,7 @@ const tr = (t = () => null) => P(() => qa.map((n) => n.map((e) => {
|
|
|
3882
3903
|
)
|
|
3883
3904
|
] }),
|
|
3884
3905
|
/* @__PURE__ */ s(
|
|
3885
|
-
|
|
3906
|
+
We,
|
|
3886
3907
|
{
|
|
3887
3908
|
name: `${n}.${e}.label`,
|
|
3888
3909
|
render: ({ setValue: A, value: z }) => /* @__PURE__ */ s(
|
|
@@ -3891,8 +3912,8 @@ const tr = (t = () => null) => P(() => qa.map((n) => n.map((e) => {
|
|
|
3891
3912
|
className: "bg-transparent outline-none text-sm placeholder-(--base-a9)",
|
|
3892
3913
|
placeholder: R === "section" ? "Enter a section label (optional)" : "Enter your question",
|
|
3893
3914
|
value: z,
|
|
3894
|
-
onChange: (
|
|
3895
|
-
A(
|
|
3915
|
+
onChange: (W) => {
|
|
3916
|
+
A(W.target.value);
|
|
3896
3917
|
},
|
|
3897
3918
|
onInput: S,
|
|
3898
3919
|
maxLength: 200
|
|
@@ -3901,7 +3922,7 @@ const tr = (t = () => null) => P(() => qa.map((n) => n.map((e) => {
|
|
|
3901
3922
|
}
|
|
3902
3923
|
),
|
|
3903
3924
|
/* @__PURE__ */ s(
|
|
3904
|
-
|
|
3925
|
+
We,
|
|
3905
3926
|
{
|
|
3906
3927
|
name: `${n}.${e}.description`,
|
|
3907
3928
|
render: ({ setValue: A, value: z }) => /* @__PURE__ */ s(
|
|
@@ -3910,8 +3931,8 @@ const tr = (t = () => null) => P(() => qa.map((n) => n.map((e) => {
|
|
|
3910
3931
|
className: "bg-transparent outline-none text-sm field-sizing-content grow placeholder-(--base-a9)",
|
|
3911
3932
|
placeholder: `Enter a ${R === "section" ? "section" : "field"} description (optional)`,
|
|
3912
3933
|
value: z,
|
|
3913
|
-
onChange: (
|
|
3914
|
-
A(
|
|
3934
|
+
onChange: (W) => {
|
|
3935
|
+
A(W.target.value);
|
|
3915
3936
|
},
|
|
3916
3937
|
onInput: L,
|
|
3917
3938
|
maxLength: 1e3
|
|
@@ -3919,19 +3940,19 @@ const tr = (t = () => null) => P(() => qa.map((n) => n.map((e) => {
|
|
|
3919
3940
|
)
|
|
3920
3941
|
}
|
|
3921
3942
|
),
|
|
3922
|
-
T !==
|
|
3923
|
-
T !==
|
|
3924
|
-
/* @__PURE__ */ x(
|
|
3925
|
-
/* @__PURE__ */ s(
|
|
3926
|
-
/* @__PURE__ */ s(
|
|
3943
|
+
T !== H && D.length > 0 && /* @__PURE__ */ s("div", { className: "w-full", children: X }),
|
|
3944
|
+
T !== H && /* @__PURE__ */ x(He, { className: "flex gap-4 bg-(--accent-a2) items-center", children: [
|
|
3945
|
+
/* @__PURE__ */ x(Rt.Root, { children: [
|
|
3946
|
+
/* @__PURE__ */ s(Rt.Trigger, { asChild: !0, children: /* @__PURE__ */ s(kt, { icon: !0, size: "sm", variant: "soft", accentColor: "base", children: /* @__PURE__ */ s(F, { icon: "RiEyeLine" }) }) }),
|
|
3947
|
+
/* @__PURE__ */ s(Rt.Content, { className: "w-[225px]", size: "sm", align: "start", children: "This is a preview of the field as it will be rendered in the form." })
|
|
3927
3948
|
] }),
|
|
3928
|
-
/* @__PURE__ */ s("div", { className: "grow h-max", children:
|
|
3949
|
+
/* @__PURE__ */ s("div", { className: "grow h-max", children: de })
|
|
3929
3950
|
] })
|
|
3930
3951
|
] }) });
|
|
3931
3952
|
});
|
|
3932
|
-
|
|
3933
|
-
const
|
|
3934
|
-
const { field: n, index: e, sectionIndex: i, remove: r } = t, { setFieldValue: o, values: a } =
|
|
3953
|
+
Cn.displayName = "FieldBuilder";
|
|
3954
|
+
const or = O((t) => {
|
|
3955
|
+
const { field: n, index: e, sectionIndex: i, remove: r } = t, { setFieldValue: o, values: a } = Ie(), { reorderField: l } = gn(), { showInfo: m, showError: c } = Ct(), d = `fields.${i}.fields`, u = P(
|
|
3935
3956
|
() => ({
|
|
3936
3957
|
index: e,
|
|
3937
3958
|
parentPath: d,
|
|
@@ -3943,7 +3964,7 @@ const nr = O((t) => {
|
|
|
3943
3964
|
...n,
|
|
3944
3965
|
label: f
|
|
3945
3966
|
};
|
|
3946
|
-
|
|
3967
|
+
pt(d, e + 1, g, a, o), m({
|
|
3947
3968
|
title: "Field duplicated",
|
|
3948
3969
|
description: `The field "${f}" has been duplicated`
|
|
3949
3970
|
});
|
|
@@ -3970,7 +3991,7 @@ const nr = O((t) => {
|
|
|
3970
3991
|
if (!g || g.length !== 1) return;
|
|
3971
3992
|
const C = g.item(0);
|
|
3972
3993
|
if (C) {
|
|
3973
|
-
if (C.size >
|
|
3994
|
+
if (C.size > Ga) {
|
|
3974
3995
|
c({
|
|
3975
3996
|
title: "File upload error",
|
|
3976
3997
|
description: `The file ${C.name} exceeded the maximum file size`
|
|
@@ -3985,17 +4006,17 @@ const nr = O((t) => {
|
|
|
3985
4006
|
},
|
|
3986
4007
|
[n, e, d, o, c]
|
|
3987
4008
|
);
|
|
3988
|
-
return /* @__PURE__ */ s(
|
|
3989
|
-
|
|
4009
|
+
return /* @__PURE__ */ s(tn, { draggableId: n.identifier, index: e, children: (f) => /* @__PURE__ */ s(
|
|
4010
|
+
He,
|
|
3990
4011
|
{
|
|
3991
4012
|
ref: f.innerRef,
|
|
3992
4013
|
...f.draggableProps,
|
|
3993
4014
|
...f.dragHandleProps,
|
|
3994
4015
|
className: "mb-4",
|
|
3995
4016
|
children: /* @__PURE__ */ x("div", { className: "flex items-center justify-between gap-4 w-full", children: [
|
|
3996
|
-
/* @__PURE__ */ s(
|
|
4017
|
+
/* @__PURE__ */ s(Cn, { ...u }),
|
|
3997
4018
|
/* @__PURE__ */ s(
|
|
3998
|
-
|
|
4019
|
+
xn,
|
|
3999
4020
|
{
|
|
4000
4021
|
index: e,
|
|
4001
4022
|
type: n.type,
|
|
@@ -4010,10 +4031,10 @@ const nr = O((t) => {
|
|
|
4010
4031
|
}
|
|
4011
4032
|
) });
|
|
4012
4033
|
});
|
|
4013
|
-
|
|
4014
|
-
const
|
|
4034
|
+
or.displayName = "FieldWithActions";
|
|
4035
|
+
const ar = O((t) => {
|
|
4015
4036
|
var E;
|
|
4016
|
-
const { field: n, index: e, dropState: i, fieldsOnly: r } = t, o = (E = i[n.identifier]) == null ? void 0 : E.disabled, { setFieldValue: a, values: l } =
|
|
4037
|
+
const { field: n, index: e, dropState: i, fieldsOnly: r } = t, o = (E = i[n.identifier]) == null ? void 0 : E.disabled, { setFieldValue: a, values: l } = Ie(), m = ur(), { reorderSection: c } = gn(), { showInfo: d } = Ct(), u = N(
|
|
4017
4038
|
(S, L) => {
|
|
4018
4039
|
for (const R of S) {
|
|
4019
4040
|
const T = L.indexOf(R);
|
|
@@ -4032,7 +4053,7 @@ const ir = O((t) => {
|
|
|
4032
4053
|
return {
|
|
4033
4054
|
removing: L,
|
|
4034
4055
|
affectedSections: R,
|
|
4035
|
-
action: () => a(`fields.${e}.fields`,
|
|
4056
|
+
action: () => a(`fields.${e}.fields`, ht(n.fields, S))
|
|
4036
4057
|
};
|
|
4037
4058
|
},
|
|
4038
4059
|
[n.fields, l.fields, a, e]
|
|
@@ -4042,7 +4063,7 @@ const ir = O((t) => {
|
|
|
4042
4063
|
R().then(), u(L, l.fields);
|
|
4043
4064
|
};
|
|
4044
4065
|
if (L.length > 0) {
|
|
4045
|
-
const M = L.map((
|
|
4066
|
+
const M = L.map((X) => X.label).join(", ");
|
|
4046
4067
|
m({
|
|
4047
4068
|
title: "Remove condition?",
|
|
4048
4069
|
description: `${T.label} is being used as a condition, deleting it will remove the condition from the ${M} section(s).`,
|
|
@@ -4055,21 +4076,21 @@ const ir = O((t) => {
|
|
|
4055
4076
|
},
|
|
4056
4077
|
[h, u, l.fields, m]
|
|
4057
4078
|
), b = N(() => {
|
|
4058
|
-
const L = n.fields.map((B,
|
|
4079
|
+
const L = n.fields.map((B, Y) => h(Y)).flatMap((B) => B.affectedSections), R = L.length ? "Remove fields and conditions?" : "Remove fields?", T = n.fields.length, D = L.map((B) => B.label).join(", "), M = L.length ? `Deleting this section will remove the ${T} field(s) it contains and will remove the conditions from following sections: ${D}` : `Deleting this section will remove the ${T} field(s) it contains.`, X = ht(l.fields, e), ne = () => a("fields", X);
|
|
4059
4080
|
if (L.length > 0) {
|
|
4060
4081
|
m({
|
|
4061
4082
|
title: R,
|
|
4062
4083
|
description: M,
|
|
4063
4084
|
action: "Remove",
|
|
4064
4085
|
onAction: () => {
|
|
4065
|
-
|
|
4066
|
-
u(L,
|
|
4086
|
+
ne().then(() => {
|
|
4087
|
+
u(L, X);
|
|
4067
4088
|
});
|
|
4068
4089
|
}
|
|
4069
4090
|
});
|
|
4070
4091
|
return;
|
|
4071
4092
|
}
|
|
4072
|
-
|
|
4093
|
+
ne().then();
|
|
4073
4094
|
}, [
|
|
4074
4095
|
n.fields,
|
|
4075
4096
|
l.fields,
|
|
@@ -4089,32 +4110,32 @@ const ir = O((t) => {
|
|
|
4089
4110
|
index: e,
|
|
4090
4111
|
parentPath: "fields",
|
|
4091
4112
|
initial: n,
|
|
4092
|
-
conditionalSourceFields:
|
|
4113
|
+
conditionalSourceFields: Ui(l.fields, e)
|
|
4093
4114
|
}),
|
|
4094
4115
|
[n, e, l.fields]
|
|
4095
4116
|
), C = N(() => {
|
|
4096
4117
|
const S = n.label || "Untitled section", L = n.fields.map((T) => ({
|
|
4097
4118
|
...T,
|
|
4098
|
-
identifier:
|
|
4119
|
+
identifier: pn()
|
|
4099
4120
|
})), R = { ...n, label: S, fields: L };
|
|
4100
|
-
|
|
4121
|
+
pt("fields", e + 1, R, l, a), d({
|
|
4101
4122
|
title: "Section duplicated",
|
|
4102
4123
|
description: `The section "${S}" has been duplicated.`
|
|
4103
4124
|
});
|
|
4104
4125
|
}, [n, e, l, a, d]), w = N(
|
|
4105
4126
|
(S) => {
|
|
4106
|
-
|
|
4127
|
+
pt(
|
|
4107
4128
|
`fields.${e}.fields`,
|
|
4108
4129
|
n.fields.length,
|
|
4109
|
-
|
|
4130
|
+
qa[S],
|
|
4110
4131
|
l,
|
|
4111
4132
|
a
|
|
4112
4133
|
);
|
|
4113
4134
|
},
|
|
4114
4135
|
[e, n.fields.length, l, a]
|
|
4115
|
-
), v =
|
|
4116
|
-
return /* @__PURE__ */ s(
|
|
4117
|
-
|
|
4136
|
+
), v = rr(w);
|
|
4137
|
+
return /* @__PURE__ */ s(tn, { draggableId: n.identifier, index: e, children: (S) => /* @__PURE__ */ s(
|
|
4138
|
+
He,
|
|
4118
4139
|
{
|
|
4119
4140
|
ref: S.innerRef,
|
|
4120
4141
|
...S.draggableProps,
|
|
@@ -4123,9 +4144,9 @@ const ir = O((t) => {
|
|
|
4123
4144
|
className: "mb-4 w-full",
|
|
4124
4145
|
children: /* @__PURE__ */ x("div", { className: "flex items-center justify-between gap-3 w-full", children: [
|
|
4125
4146
|
/* @__PURE__ */ x("div", { className: "flex grow flex-col gap-2 w-full", children: [
|
|
4126
|
-
!r && /* @__PURE__ */ s(
|
|
4147
|
+
!r && /* @__PURE__ */ s(Cn, { ...g }),
|
|
4127
4148
|
/* @__PURE__ */ s(
|
|
4128
|
-
|
|
4149
|
+
en,
|
|
4129
4150
|
{
|
|
4130
4151
|
droppableId: n.identifier,
|
|
4131
4152
|
type: "SECTION",
|
|
@@ -4138,7 +4159,7 @@ const ir = O((t) => {
|
|
|
4138
4159
|
...L.droppableProps,
|
|
4139
4160
|
children: [
|
|
4140
4161
|
n.fields.map((R, T) => /* @__PURE__ */ s(
|
|
4141
|
-
|
|
4162
|
+
or,
|
|
4142
4163
|
{
|
|
4143
4164
|
field: R,
|
|
4144
4165
|
index: T,
|
|
@@ -4151,7 +4172,7 @@ const ir = O((t) => {
|
|
|
4151
4172
|
)),
|
|
4152
4173
|
L.placeholder,
|
|
4153
4174
|
/* @__PURE__ */ x(_.Root, { children: [
|
|
4154
|
-
/* @__PURE__ */ s(_.ClickTrigger, { children: /* @__PURE__ */ x(
|
|
4175
|
+
/* @__PURE__ */ s(_.ClickTrigger, { children: /* @__PURE__ */ x(Q, { type: "button", variant: "soft", size: "sm", children: [
|
|
4155
4176
|
/* @__PURE__ */ s(F, { icon: "RiAddLine" }),
|
|
4156
4177
|
" Add field"
|
|
4157
4178
|
] }) }),
|
|
@@ -4167,7 +4188,7 @@ const ir = O((t) => {
|
|
|
4167
4188
|
)
|
|
4168
4189
|
] }),
|
|
4169
4190
|
!r && /* @__PURE__ */ s(
|
|
4170
|
-
|
|
4191
|
+
xn,
|
|
4171
4192
|
{
|
|
4172
4193
|
index: e,
|
|
4173
4194
|
type: n.type,
|
|
@@ -4180,14 +4201,14 @@ const ir = O((t) => {
|
|
|
4180
4201
|
}
|
|
4181
4202
|
) });
|
|
4182
4203
|
});
|
|
4183
|
-
|
|
4184
|
-
const
|
|
4204
|
+
ar.displayName = "FieldSectionWithActions";
|
|
4205
|
+
const qn = (t, n) => {
|
|
4185
4206
|
for (const [e, i] of Object.entries(t))
|
|
4186
4207
|
if (i.identifier === n) return [i, e];
|
|
4187
|
-
},
|
|
4188
|
-
const { fieldsOnly: n } = t, { values: e, setFieldValue: i } =
|
|
4189
|
-
|
|
4190
|
-
o({ type: "update", state:
|
|
4208
|
+
}, sr = O((t) => {
|
|
4209
|
+
const { fieldsOnly: n } = t, { values: e, setFieldValue: i } = Ie(), [r, o] = gr(Za, e.fields, Wn), { reorderSection: a, reorderField: l } = gn();
|
|
4210
|
+
K(() => {
|
|
4211
|
+
o({ type: "update", state: Wn(e.fields) });
|
|
4191
4212
|
}, [o, e.fields]);
|
|
4192
4213
|
const m = N((u) => {
|
|
4193
4214
|
u.type === "SECTION" && o({ type: "hold", fieldId: u.draggableId });
|
|
@@ -4200,7 +4221,7 @@ const Un = (t, n) => {
|
|
|
4200
4221
|
return;
|
|
4201
4222
|
}
|
|
4202
4223
|
if (b !== "SECTION") throw new Error("Unexpected droppable type.");
|
|
4203
|
-
const [C, w] =
|
|
4224
|
+
const [C, w] = qn(e.fields, h.droppableId) ?? [], [v, E] = qn(e.fields, y.droppableId) ?? [];
|
|
4204
4225
|
l(
|
|
4205
4226
|
C,
|
|
4206
4227
|
w,
|
|
@@ -4214,20 +4235,20 @@ const Un = (t, n) => {
|
|
|
4214
4235
|
[e, l, i, a, r]
|
|
4215
4236
|
), d = N(
|
|
4216
4237
|
(u) => {
|
|
4217
|
-
|
|
4238
|
+
Oa(u + 1, e, i);
|
|
4218
4239
|
},
|
|
4219
4240
|
[e, i]
|
|
4220
4241
|
);
|
|
4221
|
-
return /* @__PURE__ */ s(
|
|
4242
|
+
return /* @__PURE__ */ s(Kn, { onDragStart: m, onDragEnd: c, children: /* @__PURE__ */ s(en, { droppableId: "droppable", type: "ROOT", children: (u) => /* @__PURE__ */ x(
|
|
4222
4243
|
"div",
|
|
4223
4244
|
{
|
|
4224
4245
|
className: "flex flex-col gap-0",
|
|
4225
4246
|
ref: u.innerRef,
|
|
4226
4247
|
...u.droppableProps,
|
|
4227
4248
|
children: [
|
|
4228
|
-
e.fields.map((h, y) => /* @__PURE__ */ x(
|
|
4249
|
+
e.fields.map((h, y) => /* @__PURE__ */ x(Xn, { children: [
|
|
4229
4250
|
/* @__PURE__ */ s(
|
|
4230
|
-
|
|
4251
|
+
ar,
|
|
4231
4252
|
{
|
|
4232
4253
|
field: h,
|
|
4233
4254
|
index: y,
|
|
@@ -4236,7 +4257,7 @@ const Un = (t, n) => {
|
|
|
4236
4257
|
}
|
|
4237
4258
|
),
|
|
4238
4259
|
!n && y !== e.fields.length - 1 && /* @__PURE__ */ x(
|
|
4239
|
-
|
|
4260
|
+
Q,
|
|
4240
4261
|
{
|
|
4241
4262
|
className: "mb-4",
|
|
4242
4263
|
type: "button",
|
|
@@ -4254,7 +4275,7 @@ const Un = (t, n) => {
|
|
|
4254
4275
|
)
|
|
4255
4276
|
] }, h.identifier)),
|
|
4256
4277
|
/* @__PURE__ */ x(
|
|
4257
|
-
|
|
4278
|
+
Q,
|
|
4258
4279
|
{
|
|
4259
4280
|
className: "mb-4",
|
|
4260
4281
|
type: "button",
|
|
@@ -4275,11 +4296,11 @@ const Un = (t, n) => {
|
|
|
4275
4296
|
}
|
|
4276
4297
|
) }) });
|
|
4277
4298
|
});
|
|
4278
|
-
|
|
4279
|
-
const
|
|
4299
|
+
sr.displayName = "FieldsEditor";
|
|
4300
|
+
const ts = () => {
|
|
4280
4301
|
alert("This is a form preview, your data will not be saved.");
|
|
4281
|
-
},
|
|
4282
|
-
|
|
4302
|
+
}, Rs = O(
|
|
4303
|
+
Xe((t, n) => {
|
|
4283
4304
|
const {
|
|
4284
4305
|
onCancel: e,
|
|
4285
4306
|
onSave: i,
|
|
@@ -4291,29 +4312,29 @@ const Xa = () => {
|
|
|
4291
4312
|
showTabs: c = !0,
|
|
4292
4313
|
tabsListClassName: d,
|
|
4293
4314
|
hydrateRevisionWithImages: u
|
|
4294
|
-
} = t, { showError: h } =
|
|
4315
|
+
} = t, { showError: h } = Ct(), y = N(
|
|
4295
4316
|
(w) => {
|
|
4296
4317
|
const v = {};
|
|
4297
4318
|
w.title || (v.title = "Title is required."), (!w.fields || w.fields.length === 0) && (v.fields = "At least one field is required.");
|
|
4298
4319
|
let E = [];
|
|
4299
4320
|
for (const [L, R] of w.fields.entries()) {
|
|
4300
|
-
const D =
|
|
4301
|
-
|
|
4321
|
+
const D = Ht.section.getFieldCreationSchema(
|
|
4322
|
+
Ui(w.fields, L),
|
|
4302
4323
|
`fields.${L}`
|
|
4303
4324
|
).map((M) => M.field);
|
|
4304
4325
|
E = [...E, ...D];
|
|
4305
|
-
for (const [M,
|
|
4306
|
-
const B =
|
|
4326
|
+
for (const [M, X] of R.fields.entries()) {
|
|
4327
|
+
const B = Ht[X.type].getFieldCreationSchema(`fields.${L}.fields.${M}`).map((Y) => Y.field);
|
|
4307
4328
|
E = [...E, ...B];
|
|
4308
4329
|
}
|
|
4309
4330
|
}
|
|
4310
|
-
const S =
|
|
4331
|
+
const S = bn(
|
|
4311
4332
|
{
|
|
4312
4333
|
fields: E
|
|
4313
4334
|
},
|
|
4314
4335
|
w
|
|
4315
4336
|
);
|
|
4316
|
-
if (S && (v.fields = S.fields),
|
|
4337
|
+
if (S && (v.fields = S.fields), ye(v))
|
|
4317
4338
|
return h({
|
|
4318
4339
|
title: "Some form settings are invalid",
|
|
4319
4340
|
description: "Please check settings highlighted in red."
|
|
@@ -4324,35 +4345,35 @@ const Xa = () => {
|
|
|
4324
4345
|
() => ({
|
|
4325
4346
|
title: o ?? "",
|
|
4326
4347
|
description: "",
|
|
4327
|
-
fields: [{ ...
|
|
4348
|
+
fields: [{ ...mt(pn()), label: "" }]
|
|
4328
4349
|
}),
|
|
4329
4350
|
[o]
|
|
4330
|
-
), f = r ? u(r) : void 0, g =
|
|
4331
|
-
initialValues:
|
|
4351
|
+
), f = r ? u(r) : void 0, g = Yt({
|
|
4352
|
+
initialValues: Da(f) ?? b,
|
|
4332
4353
|
validate: y,
|
|
4333
4354
|
onSubmit: i,
|
|
4334
4355
|
validateOnChange: !1,
|
|
4335
4356
|
validateOnBlur: !1
|
|
4336
|
-
}), C = P(() =>
|
|
4337
|
-
return /* @__PURE__ */ s(
|
|
4357
|
+
}), C = P(() => Xa(g.values), [g.values]);
|
|
4358
|
+
return /* @__PURE__ */ s(Te.Root, { ref: n, defaultValue: "edit", children: /* @__PURE__ */ x("div", { className: "flex flex-col gap-2", children: [
|
|
4338
4359
|
c && /* @__PURE__ */ x(
|
|
4339
|
-
|
|
4360
|
+
Te.List,
|
|
4340
4361
|
{
|
|
4341
|
-
className:
|
|
4362
|
+
className: qe("sticky top-0 z-[2000] flex bg-(--color-background)", d),
|
|
4342
4363
|
children: [
|
|
4343
|
-
/* @__PURE__ */ s(
|
|
4364
|
+
/* @__PURE__ */ s(Te.Trigger, { className: "grow", value: "edit", children: /* @__PURE__ */ x("div", { className: "flex items-center gap-2", children: [
|
|
4344
4365
|
/* @__PURE__ */ s(F, { icon: "RiPencilLine" }),
|
|
4345
4366
|
"Edit form"
|
|
4346
4367
|
] }) }),
|
|
4347
|
-
/* @__PURE__ */ s(
|
|
4368
|
+
/* @__PURE__ */ s(Te.Trigger, { className: "grow", value: "preview", children: /* @__PURE__ */ x("div", { className: "flex items-center gap-2", children: [
|
|
4348
4369
|
/* @__PURE__ */ s(F, { icon: "RiEyeLine" }),
|
|
4349
4370
|
"Preview form"
|
|
4350
4371
|
] }) })
|
|
4351
4372
|
]
|
|
4352
4373
|
}
|
|
4353
4374
|
),
|
|
4354
|
-
/* @__PURE__ */ x(
|
|
4355
|
-
a && /* @__PURE__ */ x(
|
|
4375
|
+
/* @__PURE__ */ x(Te.Content, { value: "edit", children: [
|
|
4376
|
+
a && /* @__PURE__ */ x(ge, { children: [
|
|
4356
4377
|
"Create your form using various field types. Sections can be",
|
|
4357
4378
|
" ",
|
|
4358
4379
|
/* @__PURE__ */ s("strong", { children: "conditionally rendered" }),
|
|
@@ -4360,21 +4381,21 @@ const Xa = () => {
|
|
|
4360
4381
|
" ",
|
|
4361
4382
|
/* @__PURE__ */ s("strong", { children: "answers to fields in preceding sections. " })
|
|
4362
4383
|
] }),
|
|
4363
|
-
/* @__PURE__ */ x("form", { className: "mt-3 flex flex-col gap-2", id:
|
|
4364
|
-
/* @__PURE__ */ x(
|
|
4365
|
-
l && /* @__PURE__ */ x(
|
|
4384
|
+
/* @__PURE__ */ x("form", { className: "mt-3 flex flex-col gap-2", id: st, onSubmit: g.handleSubmit, children: [
|
|
4385
|
+
/* @__PURE__ */ x(Jt, { value: g, children: [
|
|
4386
|
+
l && /* @__PURE__ */ x(be, { children: [
|
|
4366
4387
|
/* @__PURE__ */ s(
|
|
4367
|
-
|
|
4388
|
+
We,
|
|
4368
4389
|
{
|
|
4369
4390
|
name: "title",
|
|
4370
|
-
render: ({ setValue: w, value: v, meta: E }) => /* @__PURE__ */ s(
|
|
4371
|
-
|
|
4391
|
+
render: ({ setValue: w, value: v, meta: E }) => /* @__PURE__ */ s(ki, { severity: "danger", helpText: E.error ?? null, children: /* @__PURE__ */ s(
|
|
4392
|
+
pe.Root,
|
|
4372
4393
|
{
|
|
4373
4394
|
variant: "outline",
|
|
4374
4395
|
size: "md",
|
|
4375
|
-
accentColor: E.error ?
|
|
4396
|
+
accentColor: E.error ? we.danger : "primary",
|
|
4376
4397
|
children: /* @__PURE__ */ s(
|
|
4377
|
-
|
|
4398
|
+
pe.Field,
|
|
4378
4399
|
{
|
|
4379
4400
|
placeholder: "Form title",
|
|
4380
4401
|
value: v,
|
|
@@ -4389,11 +4410,11 @@ const Xa = () => {
|
|
|
4389
4410
|
}
|
|
4390
4411
|
),
|
|
4391
4412
|
/* @__PURE__ */ s(
|
|
4392
|
-
|
|
4413
|
+
We,
|
|
4393
4414
|
{
|
|
4394
4415
|
name: "description",
|
|
4395
4416
|
render: ({ setValue: w, value: v }) => /* @__PURE__ */ s(
|
|
4396
|
-
|
|
4417
|
+
Hn,
|
|
4397
4418
|
{
|
|
4398
4419
|
className: "field-sizing-content",
|
|
4399
4420
|
placeholder: "Explain the purpose of this form",
|
|
@@ -4409,46 +4430,46 @@ const Xa = () => {
|
|
|
4409
4430
|
}
|
|
4410
4431
|
)
|
|
4411
4432
|
] }),
|
|
4412
|
-
/* @__PURE__ */ s(
|
|
4433
|
+
/* @__PURE__ */ s(sr, { fieldsOnly: m }),
|
|
4413
4434
|
/* @__PURE__ */ s(
|
|
4414
4435
|
"span",
|
|
4415
4436
|
{
|
|
4416
|
-
"data-accent-color":
|
|
4437
|
+
"data-accent-color": we.danger,
|
|
4417
4438
|
className: "text-xs text-(--accent-a11)",
|
|
4418
4439
|
children: typeof g.errors.fields == "string" && g.errors.fields
|
|
4419
4440
|
}
|
|
4420
4441
|
)
|
|
4421
4442
|
] }),
|
|
4422
4443
|
/* @__PURE__ */ x("div", { className: "flex items-center justify-end gap-2", children: [
|
|
4423
|
-
e && /* @__PURE__ */ s(
|
|
4424
|
-
/* @__PURE__ */ s(
|
|
4444
|
+
e && /* @__PURE__ */ s(Q, { type: "button", variant: "solid", accentColor: "base", onClick: e, children: "Cancel" }),
|
|
4445
|
+
/* @__PURE__ */ s(Q, { type: "submit", children: "Save form" })
|
|
4425
4446
|
] })
|
|
4426
4447
|
] })
|
|
4427
4448
|
] }),
|
|
4428
|
-
/* @__PURE__ */ s(
|
|
4449
|
+
/* @__PURE__ */ s(Te.Content, { value: "preview", children: /* @__PURE__ */ s(Ya, { schema: C, onSubmit: ts, hideTitle: !l }) })
|
|
4429
4450
|
] }) });
|
|
4430
4451
|
})
|
|
4431
|
-
),
|
|
4432
|
-
async function
|
|
4433
|
-
const r = t.getContext("2d", {}), o = new Image(i.width, i.height), a = new Image(i.width, i.height), l = new
|
|
4452
|
+
), ns = Object.values(Qn), is = 1;
|
|
4453
|
+
async function rs(t, n, e, i) {
|
|
4454
|
+
const r = t.getContext("2d", {}), o = new Image(i.width, i.height), a = new Image(i.width, i.height), l = new Mr();
|
|
4434
4455
|
return o.onload = function() {
|
|
4435
4456
|
r.drawImage(o, 0, 0, i.width, i.height), a.src = URL.createObjectURL(e), a.onload = async function() {
|
|
4436
4457
|
r.drawImage(a, 0, 0, i.width, i.height);
|
|
4437
|
-
const m = t.toDataURL("image/jpeg",
|
|
4458
|
+
const m = t.toDataURL("image/jpeg", is), c = await Yn(m), d = new File([c], n.name, { type: "image/jpeg" });
|
|
4438
4459
|
l.resolve(d);
|
|
4439
4460
|
};
|
|
4440
4461
|
}, o.src = URL.createObjectURL(n), l;
|
|
4441
4462
|
}
|
|
4442
|
-
const
|
|
4463
|
+
const os = O((t) => {
|
|
4443
4464
|
const { file: n, onClose: e, onSave: i, onDelete: r, dirty: o, onDirty: a } = t;
|
|
4444
4465
|
n.objectURL || (n.objectURL = URL.createObjectURL(n));
|
|
4445
|
-
const l =
|
|
4446
|
-
|
|
4466
|
+
const l = me(null), m = me(null), [c, d] = $(Qn.red), [u, h] = $(null), [y, b] = $(!1), [f, g] = $(!1), C = me(null), w = fr(C);
|
|
4467
|
+
K(() => {
|
|
4447
4468
|
const B = new Image();
|
|
4448
4469
|
B.onload = function() {
|
|
4449
4470
|
h({ width: B.naturalWidth, height: B.naturalHeight });
|
|
4450
4471
|
}, B.src = URL.createObjectURL(n);
|
|
4451
|
-
}, [n]),
|
|
4472
|
+
}, [n]), K(() => {
|
|
4452
4473
|
!f && (w != null && w.width) && w.height && g(!0);
|
|
4453
4474
|
}, [w, f]);
|
|
4454
4475
|
const v = N(async () => {
|
|
@@ -4457,13 +4478,13 @@ const Ja = O((t) => {
|
|
|
4457
4478
|
if (!B) return;
|
|
4458
4479
|
if (!u)
|
|
4459
4480
|
throw new Error("Original image size not loaded yet");
|
|
4460
|
-
const
|
|
4481
|
+
const Y = await B.exportImage("png"), k = new Image(u.width, u.height);
|
|
4461
4482
|
k.onload = async function() {
|
|
4462
|
-
const
|
|
4463
|
-
|
|
4464
|
-
const
|
|
4465
|
-
await
|
|
4466
|
-
}, b(!0), k.src =
|
|
4483
|
+
const q = await Yn(Y), de = new File([q], n.name, { type: n.type }), ie = m.current, ue = await rs(ie, n, de, u);
|
|
4484
|
+
ue.objectURL = URL.createObjectURL(ue);
|
|
4485
|
+
const Re = await Rn(n);
|
|
4486
|
+
await Rn(ue) !== Re && i(ue), b(!1), e();
|
|
4487
|
+
}, b(!0), k.src = Y;
|
|
4467
4488
|
}, [o, n, e, i, u]), E = N(() => {
|
|
4468
4489
|
r(n);
|
|
4469
4490
|
}, [n, r]), S = N(() => {
|
|
@@ -4478,22 +4499,22 @@ const Ja = O((t) => {
|
|
|
4478
4499
|
l.current && (a(!1), l.current.clearCanvas());
|
|
4479
4500
|
}, [a]), M = N((B) => {
|
|
4480
4501
|
l.current && l.current.eraseMode(B);
|
|
4481
|
-
}, []),
|
|
4502
|
+
}, []), X = N(() => {
|
|
4482
4503
|
v();
|
|
4483
|
-
}, [v]),
|
|
4484
|
-
|
|
4504
|
+
}, [v]), ne = N(() => {
|
|
4505
|
+
hn.saveAs(n, n.name);
|
|
4485
4506
|
}, [n]);
|
|
4486
|
-
return /* @__PURE__ */ s(
|
|
4507
|
+
return /* @__PURE__ */ s(dn, { open: !0, onOpenChange: e, children: /* @__PURE__ */ x(un, { children: [
|
|
4487
4508
|
/* @__PURE__ */ s(
|
|
4488
|
-
|
|
4509
|
+
fn,
|
|
4489
4510
|
{
|
|
4490
4511
|
className: "bg-(--color-background) fixed inset-0 data-[state='open']:fade-in-0 data-[state='open']:zoom-in-95 data-[state='closed']:animate-out data-[state='closed']:fade-out-0 data-[state='closed']:zoom-out-95 data-[state='open']:animate-in",
|
|
4491
4512
|
"data-floating-content": ""
|
|
4492
4513
|
}
|
|
4493
4514
|
),
|
|
4494
|
-
/* @__PURE__ */ x(
|
|
4515
|
+
/* @__PURE__ */ x(mn, { className: "absolute inset-0 py-12", "data-floating-content": "", children: [
|
|
4495
4516
|
/* @__PURE__ */ s(
|
|
4496
|
-
|
|
4517
|
+
xt,
|
|
4497
4518
|
{
|
|
4498
4519
|
className: "flex w-full gap-2 items-center top-0 absolute right-0 p-2",
|
|
4499
4520
|
accentColor: "base",
|
|
@@ -4501,18 +4522,18 @@ const Ja = O((t) => {
|
|
|
4501
4522
|
variant: "soft",
|
|
4502
4523
|
children: /* @__PURE__ */ x("div", { className: "grid w-full grid-cols-3", children: [
|
|
4503
4524
|
/* @__PURE__ */ x("div", { className: "flex gap-2", children: [
|
|
4504
|
-
/* @__PURE__ */ s(
|
|
4505
|
-
/* @__PURE__ */ s(
|
|
4525
|
+
/* @__PURE__ */ s(V, { "aria-label": "close", onClick: S, children: /* @__PURE__ */ s(F, { icon: "RiCloseLine" }) }),
|
|
4526
|
+
/* @__PURE__ */ s(V, { "aria-label": `Download ${n.name}`, onClick: ne, children: /* @__PURE__ */ s(F, { icon: "RiDownload2Line" }) })
|
|
4506
4527
|
] }),
|
|
4507
4528
|
/* @__PURE__ */ x("div", { className: "flex items-center justify-center gap-2", children: [
|
|
4508
4529
|
/* @__PURE__ */ s(
|
|
4509
|
-
|
|
4530
|
+
Jn,
|
|
4510
4531
|
{
|
|
4511
4532
|
selectedColor: c,
|
|
4512
|
-
allColors:
|
|
4533
|
+
allColors: ns,
|
|
4513
4534
|
onFinish: d,
|
|
4514
4535
|
trigger: /* @__PURE__ */ s(
|
|
4515
|
-
|
|
4536
|
+
V,
|
|
4516
4537
|
{
|
|
4517
4538
|
"aria-label": "Markup color picker",
|
|
4518
4539
|
type: "button",
|
|
@@ -4526,7 +4547,7 @@ const Ja = O((t) => {
|
|
|
4526
4547
|
}
|
|
4527
4548
|
),
|
|
4528
4549
|
/* @__PURE__ */ s(
|
|
4529
|
-
|
|
4550
|
+
mr,
|
|
4530
4551
|
{
|
|
4531
4552
|
defaultPressed: !1,
|
|
4532
4553
|
"aria-label": "erase",
|
|
@@ -4534,14 +4555,14 @@ const Ja = O((t) => {
|
|
|
4534
4555
|
children: /* @__PURE__ */ s(F, { icon: "RiEraserFill" })
|
|
4535
4556
|
}
|
|
4536
4557
|
),
|
|
4537
|
-
/* @__PURE__ */ s(
|
|
4538
|
-
/* @__PURE__ */ s(
|
|
4539
|
-
/* @__PURE__ */ s(
|
|
4540
|
-
/* @__PURE__ */ s(
|
|
4558
|
+
/* @__PURE__ */ s(Xt, { orientation: "vertical", size: "full" }),
|
|
4559
|
+
/* @__PURE__ */ s(V, { "aria-label": "undo", onClick: T, children: /* @__PURE__ */ s(F, { icon: "RiArrowGoBackLine" }) }),
|
|
4560
|
+
/* @__PURE__ */ s(V, { "aria-label": "undo", onClick: R, children: /* @__PURE__ */ s(F, { icon: "RiArrowGoForwardLine" }) }),
|
|
4561
|
+
/* @__PURE__ */ s(V, { "aria-label": "undo all", onClick: D, children: /* @__PURE__ */ s(F, { icon: "RiLoopLeftLine" }) })
|
|
4541
4562
|
] }),
|
|
4542
4563
|
/* @__PURE__ */ x("div", { className: "flex justify-end gap-2", children: [
|
|
4543
|
-
/* @__PURE__ */ s(
|
|
4544
|
-
/* @__PURE__ */ s(
|
|
4564
|
+
/* @__PURE__ */ s(V, { "aria-label": "Save markup", accentColor: "primary", onClick: X, children: /* @__PURE__ */ s(F, { icon: "RiSaveLine" }) }),
|
|
4565
|
+
/* @__PURE__ */ s(V, { "aria-label": "Delete attachment", onClick: E, children: /* @__PURE__ */ s(F, { icon: "RiDeleteBin2Line" }) })
|
|
4545
4566
|
] })
|
|
4546
4567
|
] })
|
|
4547
4568
|
}
|
|
@@ -4566,8 +4587,8 @@ const Ja = O((t) => {
|
|
|
4566
4587
|
src: n.objectURL
|
|
4567
4588
|
}
|
|
4568
4589
|
),
|
|
4569
|
-
y ? /* @__PURE__ */ s(
|
|
4570
|
-
|
|
4590
|
+
y ? /* @__PURE__ */ s(wt, {}) : /* @__PURE__ */ s(
|
|
4591
|
+
zr,
|
|
4571
4592
|
{
|
|
4572
4593
|
className: "max-w-full max-h-full aspect-square",
|
|
4573
4594
|
backgroundImage: n.objectURL,
|
|
@@ -4581,70 +4602,70 @@ const Ja = O((t) => {
|
|
|
4581
4602
|
] })
|
|
4582
4603
|
] }) });
|
|
4583
4604
|
});
|
|
4584
|
-
|
|
4605
|
+
os.displayName = "AttachmentEditor";
|
|
4585
4606
|
export {
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4607
|
+
G as BaseField,
|
|
4608
|
+
ti as BaseFormElement,
|
|
4609
|
+
Ge as BooleanField,
|
|
4610
|
+
Mi as BooleanInput,
|
|
4611
|
+
Jn as ColorPicker,
|
|
4612
|
+
Bt as DateField,
|
|
4613
|
+
zi as DateInput,
|
|
4614
|
+
H as FieldSection,
|
|
4615
|
+
ei as FileCard,
|
|
4616
|
+
nn as FileIcon,
|
|
4617
|
+
Rs as FormBuilder,
|
|
4618
|
+
Ya as FormRenderer,
|
|
4619
|
+
Ua as ImageCard,
|
|
4620
|
+
os as ImageMarkup,
|
|
4621
|
+
Pi as ImageViewer,
|
|
4622
|
+
xa as ImageViewerProvider,
|
|
4623
|
+
ki as InputWithHelpText,
|
|
4624
|
+
ae as InputWithLabel,
|
|
4625
|
+
se as InputWithLabelAndHelpText,
|
|
4626
|
+
vt as MultiSelectField,
|
|
4627
|
+
Xi as MultiSelectInput,
|
|
4628
|
+
gt as MultiStringField,
|
|
4629
|
+
ji as MultiStringInput,
|
|
4630
|
+
Ee as NumberField,
|
|
4631
|
+
Wi as NumberInput,
|
|
4632
|
+
We as PatchField,
|
|
4633
|
+
Ss as PatchFormProvider,
|
|
4634
|
+
$t as QrField,
|
|
4635
|
+
qi as QrInput,
|
|
4636
|
+
Hi as QrScanner,
|
|
4637
|
+
Br as SUPPORTED_IMAGE_FILE_TYPES,
|
|
4638
|
+
$r as SUPPORTED_PDF_FILE_TYPES,
|
|
4639
|
+
Vr as SUPPORTED_SPREADSHEET_FILE_EXTENSIONS,
|
|
4640
|
+
yt as SelectField,
|
|
4641
|
+
Ki as SelectInput,
|
|
4642
|
+
Ut as StringField,
|
|
4643
|
+
Qi as StringInput,
|
|
4644
|
+
jt as TextField,
|
|
4645
|
+
Yi as TextInput,
|
|
4646
|
+
Es as decodeFormValues,
|
|
4647
|
+
yn as deserialize,
|
|
4648
|
+
er as deserializeField,
|
|
4649
|
+
ee as emptyBaseField,
|
|
4650
|
+
Ea as emptyBooleanField,
|
|
4651
|
+
Ia as emptyDateField,
|
|
4652
|
+
_a as emptyMultiSelectField,
|
|
4653
|
+
Pa as emptyMultiStringField,
|
|
4654
|
+
ka as emptyNumberField,
|
|
4655
|
+
Ma as emptyQrField,
|
|
4656
|
+
Ba as emptySelectField,
|
|
4657
|
+
Va as emptyStringField,
|
|
4658
|
+
$a as emptyTextField,
|
|
4659
|
+
Is as encodeFormValues,
|
|
4660
|
+
ws as fieldIcons,
|
|
4661
|
+
tr as flattenFields,
|
|
4662
|
+
Xa as formRevisionToSchema,
|
|
4663
|
+
wn as initialFormValues,
|
|
4664
|
+
nr as isConditionMet,
|
|
4665
|
+
Bi as useFieldInput,
|
|
4666
|
+
ft as useFieldInputs,
|
|
4667
|
+
Z as useFormikInput,
|
|
4668
|
+
rn as useImageViewer,
|
|
4669
|
+
bn as validateForm,
|
|
4670
|
+
qt as valueIsFile
|
|
4650
4671
|
};
|