@levo-so/studio 0.1.95 → 0.1.98
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/{BillingStep-BLwl9IDQ.js → BillingStep-C3jJkLXQ.js} +1 -1
- package/{Button-C6BOkG_z.js → Button-CwN6jTXH.js} +1 -1
- package/CollectionField-DnbpB0Z5.js +254 -0
- package/CollectionInput-BoNAc4sq.js +132 -0
- package/DateTimeWidget-IRleQI-3.js +255 -0
- package/{EntryCard-B-feJvrB.js → EntryCard-xpo36vUc.js} +3 -3
- package/{LoginCard-CF9JbU-y.js → LoginCard-DG8NAN0B.js} +3 -3
- package/{LoginForm-CdpNCQJa.js → LoginForm-CPMtCyMF.js} +4 -0
- package/{LoginModal-ngTHCyli.js → LoginModal-BPI5tOIZ.js} +3 -3
- package/{MessageCard-D2uja800.js → MessageCard-BYxgc9dl.js} +2 -2
- package/{ModalManager-B7pCzvK1.js → ModalManager-BaIL6HG-.js} +1 -1
- package/{PendingApprovalCard-Dut-Xiw1.js → PendingApprovalCard-DID1FhwF.js} +3 -3
- package/PhoneWidget-CjhHfwuG.js +100 -0
- package/Popover-DHVZdJuv.js +56 -0
- package/RichTextWidget-CgT1_zC3.js +1135 -0
- package/Tooltip-ByJRyayB.js +78 -0
- package/VerifyButton-DFKzKYxC.js +283 -0
- package/{bookingCard-BU_MdmS9.js → bookingCard-Bw4tvDYh.js} +3 -3
- package/collection.d.ts +81 -46
- package/collection.js +8 -5
- package/dist-B7TPxn7o.js +3180 -0
- package/getFieldValidations-qVzuq6mv.js +195 -0
- package/index.d.ts +5 -5
- package/index.js +1229 -1434
- package/nodeAlignment-CG3qmAuQ.js +180 -0
- package/package.json +3 -4
- package/studio.css +1 -1
- package/theme.cssm-De_pl52g.js +4 -0
- package/{utils-KqbqLlMF.js → utils-F6eBcsyI.js} +1 -1
- package/widgets-Dvyv5_uj.js +215 -0
- package/dist-DDKHTnIW.js +0 -3653
- package/widgets-B84lq4lO.js +0 -351
- /package/{Beams-CCNNOvfW.js → Beams-Blr-zwvz.js} +0 -0
- /package/{Dots-89WGkd-z.js → Dots-DeBKuibU.js} +0 -0
- /package/{Gradient-vTa_uWCj.js → Gradient-DGFxOjft.js} +0 -0
- /package/{Grid-CrtztrxK.js → Grid-A7HRCQ0T.js} +0 -0
- /package/{MessageFooter-Bu-jyPkJ.js → MessageFooter-C6DivT4m.js} +0 -0
- /package/{StripePaymentModal-CajqohNM.js → StripePaymentModal-BcePXzmC.js} +0 -0
- /package/{Waves-BhA6CLEI.js → Waves-CIT6Ngng.js} +0 -0
- /package/{card-DCbhJCO9.js → card-izMd2DvE.js} +0 -0
- /package/{dialog-CILIXExr.js → dialog-CCWrvmHd.js} +0 -0
package/dist-B7TPxn7o.js
ADDED
|
@@ -0,0 +1,3180 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { a as e, n as t, r as n, t as r } from "./Tooltip-ByJRyayB.js";
|
|
3
|
+
import { a as i, i as a, n as o, t as s } from "./getFieldValidations-qVzuq6mv.js";
|
|
4
|
+
import { t as c } from "./theme.cssm-De_pl52g.js";
|
|
5
|
+
import { f as l, l as u, t as d, u as f } from "./CollectionField-DnbpB0Z5.js";
|
|
6
|
+
import { d as p, f as m, n as h, o as g, p as _, r as v, t as y } from "./widgets-Dvyv5_uj.js";
|
|
7
|
+
import { a as b, i as x, n as S, o as C, r as w, s as T, t as E } from "./VerifyButton-DFKzKYxC.js";
|
|
8
|
+
import { n as D, r as O, t as k } from "./CollectionInput-BoNAc4sq.js";
|
|
9
|
+
import * as A from "react";
|
|
10
|
+
import j, { Suspense as M, createContext as N, lazy as P, useCallback as F, useContext as I, useEffect as L, useMemo as R, useRef as z, useState as B } from "react";
|
|
11
|
+
import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
|
|
12
|
+
import { FieldInterfaces as W, LevoError as G, MediaKindList as K, getLevoError as q } from "@levo-so/core";
|
|
13
|
+
import { errorHandler as J, errorToast as Y, mediaMimetypeByKind as X, successToast as ee, useLevo as Z } from "@levo-so/react";
|
|
14
|
+
import { c as Q } from "react/compiler-runtime";
|
|
15
|
+
import $ from "clsx";
|
|
16
|
+
import { createRuntimeFn as te } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
17
|
+
import { useDebouncedCallback as ne } from "use-debounce";
|
|
18
|
+
import { IconArrowLeft as re, IconCheck as ie, IconChevronLeft as ae, IconChevronRight as oe, IconChevronsLeft as se, IconChevronsRight as ce, IconFile as le, IconHash as ue, IconMail as de, IconPencil as fe, IconPlus as pe, IconTrash as me, IconUpload as he, IconX as ge } from "@tabler/icons-react";
|
|
19
|
+
import _e from "react-select";
|
|
20
|
+
import { FormProvider as ve, get as ye, useController as be, useFieldArray as xe, useForm as Se, useFormContext as Ce, useWatch as we } from "react-hook-form";
|
|
21
|
+
import { Tabs as Te } from "@base-ui/react/tabs";
|
|
22
|
+
import { Checkbox as Ee } from "@base-ui/react/checkbox";
|
|
23
|
+
import { NumericFormat as De } from "react-number-format";
|
|
24
|
+
import Oe from "react-select/async";
|
|
25
|
+
import { Radio as ke } from "@base-ui/react/radio";
|
|
26
|
+
import { RadioGroup as Ae } from "@base-ui/react/radio-group";
|
|
27
|
+
import { Switch as je } from "@base-ui/react/switch";
|
|
28
|
+
import { useDropzone as Me } from "react-dropzone";
|
|
29
|
+
//#region \0rolldown/runtime.js
|
|
30
|
+
var Ne = Object.defineProperty, Pe = (e, t) => {
|
|
31
|
+
let n = {};
|
|
32
|
+
for (var r in e) Ne(n, r, {
|
|
33
|
+
get: e[r],
|
|
34
|
+
enumerable: !0
|
|
35
|
+
});
|
|
36
|
+
return t || Ne(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
37
|
+
}, Fe = {
|
|
38
|
+
colors: {
|
|
39
|
+
background: "var(--_1i5egzy0)",
|
|
40
|
+
foreground: "var(--_1i5egzy1)",
|
|
41
|
+
text: "var(--_1i5egzy2)",
|
|
42
|
+
heading: "var(--_1i5egzy3)",
|
|
43
|
+
card: "var(--_1i5egzy4)",
|
|
44
|
+
cardForeground: "var(--_1i5egzy5)",
|
|
45
|
+
popover: "var(--_1i5egzy6)",
|
|
46
|
+
popoverForeground: "var(--_1i5egzy7)",
|
|
47
|
+
primary: "var(--_1i5egzy8)",
|
|
48
|
+
primaryForeground: "var(--_1i5egzy9)",
|
|
49
|
+
secondary: "var(--_1i5egzya)",
|
|
50
|
+
secondaryForeground: "var(--_1i5egzyb)",
|
|
51
|
+
muted: "var(--_1i5egzyc)",
|
|
52
|
+
mutedForeground: "var(--_1i5egzyd)",
|
|
53
|
+
accent: "var(--_1i5egzye)",
|
|
54
|
+
accentForeground: "var(--_1i5egzyf)",
|
|
55
|
+
destructive: "var(--_1i5egzyg)",
|
|
56
|
+
border: "var(--_1i5egzyh)",
|
|
57
|
+
input: "var(--_1i5egzyi)",
|
|
58
|
+
ring: "var(--_1i5egzyj)"
|
|
59
|
+
},
|
|
60
|
+
radius: "var(--_1i5egzyk)",
|
|
61
|
+
radiusScale: {
|
|
62
|
+
sm: "var(--_1i5egzyl)",
|
|
63
|
+
md: "var(--_1i5egzym)",
|
|
64
|
+
lg: "var(--_1i5egzyn)",
|
|
65
|
+
xl: "var(--_1i5egzyo)",
|
|
66
|
+
xl2: "var(--_1i5egzyp)",
|
|
67
|
+
xl3: "var(--_1i5egzyq)",
|
|
68
|
+
xl4: "var(--_1i5egzyr)"
|
|
69
|
+
},
|
|
70
|
+
baseFontSize: "var(--_1i5egzys)",
|
|
71
|
+
fonts: {
|
|
72
|
+
body: "var(--_1i5egzyt)",
|
|
73
|
+
heading: "var(--_1i5egzyu)"
|
|
74
|
+
},
|
|
75
|
+
shadow: {
|
|
76
|
+
xs: "var(--_1i5egzyv)",
|
|
77
|
+
sm: "var(--_1i5egzyw)",
|
|
78
|
+
md: "var(--_1i5egzyx)",
|
|
79
|
+
lg: "var(--_1i5egzyy)",
|
|
80
|
+
xl: "var(--_1i5egzyz)",
|
|
81
|
+
inner: "var(--_1i5egzy10)"
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
`${Fe.radius}`, `${Fe.radius}`, Fe.radius, `${Fe.radius}`, `${Fe.radius}`, `${Fe.radius}`, `${Fe.radius}`;
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region ../../libraries/levocn/dist/utils/deep-merge.js
|
|
87
|
+
function Ie(e) {
|
|
88
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
89
|
+
}
|
|
90
|
+
function Le(e, t) {
|
|
91
|
+
if (!Ie(e) || !Ie(t)) return t;
|
|
92
|
+
let n = { ...e };
|
|
93
|
+
return Object.keys(t).forEach((r) => {
|
|
94
|
+
let i = r, a = e[i], o = t[i];
|
|
95
|
+
Ie(a) && Ie(o) ? n[i] = Le(a, o) : n[i] = o;
|
|
96
|
+
}), n;
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region ../../libraries/levocn/dist/theme/utils/defineTheme.js
|
|
100
|
+
var Re = (e) => (t) => t ? Le(e, t) : e, ze = "_1kzhxrs0", Be = "_1kzhxrs1", Ve = "_1kzhxrs2", He = "_1kzhxrs3", Ue = "_1kzhxrs4", We = "_1kzhxrs5", Ge = "_1kzhxrs6", Ke = "_1kzhxrs7", qe = "_1kzhxrs8", Je = "_1kzhxrs9", Ye = "_1kzhxrsa", Xe = "_1kzhxrsb", Ze = "ktjhuv0", Qe = te({
|
|
101
|
+
defaultClassName: "ktjhuv1",
|
|
102
|
+
variantClassNames: { variant: {
|
|
103
|
+
default: "ktjhuv2",
|
|
104
|
+
line: "ktjhuv3"
|
|
105
|
+
} },
|
|
106
|
+
defaultVariants: { variant: "default" },
|
|
107
|
+
compoundVariants: []
|
|
108
|
+
}), $e = "ktjhuv4", et = "ktjhuv5", tt = "ktjhuv6", nt = (e) => {
|
|
109
|
+
let t = Q(10), n, r, i;
|
|
110
|
+
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({className: n, orientation: i, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
111
|
+
let a = i === void 0 ? "horizontal" : i, o;
|
|
112
|
+
t[4] === n ? o = t[5] : (o = $(Ze, n), t[4] = n, t[5] = o);
|
|
113
|
+
let s;
|
|
114
|
+
return t[6] !== a || t[7] !== r || t[8] !== o ? (s = /* @__PURE__ */ H(Te.Root, {
|
|
115
|
+
"data-slot": "tabs",
|
|
116
|
+
"data-orientation": a,
|
|
117
|
+
className: o,
|
|
118
|
+
...r
|
|
119
|
+
}), t[6] = a, t[7] = r, t[8] = o, t[9] = s) : s = t[9], s;
|
|
120
|
+
}, rt = (e) => {
|
|
121
|
+
let t = Q(11), n, r, i;
|
|
122
|
+
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({className: n, variant: i, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
123
|
+
let a = i === void 0 ? "default" : i, o;
|
|
124
|
+
t[4] !== n || t[5] !== a ? (o = $(Qe({ variant: a }), n), t[4] = n, t[5] = a, t[6] = o) : o = t[6];
|
|
125
|
+
let s;
|
|
126
|
+
return t[7] !== r || t[8] !== o || t[9] !== a ? (s = /* @__PURE__ */ H(Te.List, {
|
|
127
|
+
"data-slot": "tabs-list",
|
|
128
|
+
"data-variant": a,
|
|
129
|
+
className: o,
|
|
130
|
+
...r
|
|
131
|
+
}), t[7] = r, t[8] = o, t[9] = a, t[10] = s) : s = t[10], s;
|
|
132
|
+
}, it = (e) => {
|
|
133
|
+
let t = Q(8), n, r;
|
|
134
|
+
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
135
|
+
let i;
|
|
136
|
+
t[3] === n ? i = t[4] : (i = $($e, et, n), t[3] = n, t[4] = i);
|
|
137
|
+
let a;
|
|
138
|
+
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ H(Te.Tab, {
|
|
139
|
+
"data-slot": "tabs-trigger",
|
|
140
|
+
className: i,
|
|
141
|
+
...r
|
|
142
|
+
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
143
|
+
}, at = (e) => {
|
|
144
|
+
let t = Q(8), n, r;
|
|
145
|
+
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
146
|
+
let i;
|
|
147
|
+
t[3] === n ? i = t[4] : (i = $(tt, n), t[3] = n, t[4] = i);
|
|
148
|
+
let a;
|
|
149
|
+
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ H(Te.Panel, {
|
|
150
|
+
"data-slot": "tabs-content",
|
|
151
|
+
className: i,
|
|
152
|
+
...r
|
|
153
|
+
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
154
|
+
}, ot = (e) => {
|
|
155
|
+
let t = Q(36), n, r, i;
|
|
156
|
+
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({field: n, schema: i, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
157
|
+
let { key: a, label: c, field_interface: l, fields: d } = n, f = a === void 0 ? "" : a, p = c === void 0 ? "" : c, m = l === void 0 ? "" : l, h;
|
|
158
|
+
t[4] === d ? h = t[5] : (h = d === void 0 ? [] : d, t[4] = d, t[5] = h);
|
|
159
|
+
let _ = h, [v, y] = B("0"), { formState: b } = Ce(), x;
|
|
160
|
+
t[6] === n ? x = t[7] : (x = s(n), t[6] = n, t[7] = x);
|
|
161
|
+
let S;
|
|
162
|
+
t[8] !== f || t[9] !== x ? (S = {
|
|
163
|
+
name: f,
|
|
164
|
+
rules: x
|
|
165
|
+
}, t[8] = f, t[9] = x, t[10] = S) : S = t[10];
|
|
166
|
+
let C = xe(S), w, T;
|
|
167
|
+
t[11] === C ? (w = t[12], T = t[13]) : ({fields: T, ...w} = C, t[11] = C, t[12] = w, t[13] = T);
|
|
168
|
+
let E;
|
|
169
|
+
t[14] !== b.errors || t[15] !== f ? (E = ye(b.errors, f)?.root?.message, t[14] = b.errors, t[15] = f, t[16] = E) : E = t[16];
|
|
170
|
+
let D = E;
|
|
171
|
+
if (!m || !f) return null;
|
|
172
|
+
let O = n?.required, k;
|
|
173
|
+
t[17] !== p || t[18] !== O ? (k = /* @__PURE__ */ H(u, {
|
|
174
|
+
label: p,
|
|
175
|
+
isRequired: O
|
|
176
|
+
}), t[17] = p, t[18] = O, t[19] = k) : k = t[19];
|
|
177
|
+
let A;
|
|
178
|
+
t[20] !== w || t[21] !== n.id || t[22] !== n.key || t[23] !== T || t[24] !== _ || t[25] !== f || t[26] !== r || t[27] !== i || t[28] !== v ? (A = T && Array.isArray(T) ? /* @__PURE__ */ U(nt, {
|
|
179
|
+
value: v,
|
|
180
|
+
onValueChange: y,
|
|
181
|
+
className: Be,
|
|
182
|
+
children: [/* @__PURE__ */ U("div", {
|
|
183
|
+
className: Ve,
|
|
184
|
+
children: [T.length ? /* @__PURE__ */ H(rt, {
|
|
185
|
+
className: He,
|
|
186
|
+
children: T?.map((e, t) => /* @__PURE__ */ H(it, {
|
|
187
|
+
id: `${n?.key}-${t}`,
|
|
188
|
+
value: t.toString(),
|
|
189
|
+
className: Ue,
|
|
190
|
+
children: t + 1
|
|
191
|
+
}, `array-widget-tab-${n?.id}-${t}`))
|
|
192
|
+
}) : null, /* @__PURE__ */ U(o, {
|
|
193
|
+
variant: "ghost",
|
|
194
|
+
size: "xs",
|
|
195
|
+
className: We,
|
|
196
|
+
onClick: () => {
|
|
197
|
+
w.append(g(_)), y((T?.length ?? 0).toString());
|
|
198
|
+
},
|
|
199
|
+
children: [/* @__PURE__ */ H(pe, { size: 14 }), "Add"]
|
|
200
|
+
})]
|
|
201
|
+
}), T?.map((e, t) => /* @__PURE__ */ U(at, {
|
|
202
|
+
className: Ge,
|
|
203
|
+
value: t.toString(),
|
|
204
|
+
children: [/* @__PURE__ */ H("div", {
|
|
205
|
+
className: Ke,
|
|
206
|
+
children: _.map((e) => /* @__PURE__ */ H(cr, {
|
|
207
|
+
field: {
|
|
208
|
+
...e,
|
|
209
|
+
key: `${f}.${t}.${e?.key}`
|
|
210
|
+
},
|
|
211
|
+
schema: i ?? null,
|
|
212
|
+
...r
|
|
213
|
+
}, `common-fields-${e?.id}`))
|
|
214
|
+
}), /* @__PURE__ */ U("div", {
|
|
215
|
+
className: qe,
|
|
216
|
+
children: [
|
|
217
|
+
/* @__PURE__ */ H(o, {
|
|
218
|
+
onClick: () => {
|
|
219
|
+
y((t - 1).toString()), w.move(t, t - 1);
|
|
220
|
+
},
|
|
221
|
+
disabled: t === 0,
|
|
222
|
+
size: "icon",
|
|
223
|
+
className: Je,
|
|
224
|
+
children: /* @__PURE__ */ H(ae, { size: 20 })
|
|
225
|
+
}),
|
|
226
|
+
/* @__PURE__ */ H(o, {
|
|
227
|
+
className: Ye,
|
|
228
|
+
variant: "link",
|
|
229
|
+
onClick: () => {
|
|
230
|
+
y(Math.max(0, t - 1).toString()), w.remove(t);
|
|
231
|
+
},
|
|
232
|
+
children: "Remove Item"
|
|
233
|
+
}),
|
|
234
|
+
/* @__PURE__ */ H(o, {
|
|
235
|
+
className: Je,
|
|
236
|
+
onClick: () => {
|
|
237
|
+
y((t + 1).toString()), w.move(t, t + 1);
|
|
238
|
+
},
|
|
239
|
+
disabled: t >= T.length - 1,
|
|
240
|
+
size: "icon",
|
|
241
|
+
children: /* @__PURE__ */ H(oe, { size: 20 })
|
|
242
|
+
})
|
|
243
|
+
]
|
|
244
|
+
})]
|
|
245
|
+
}, `array-widget-tab-content-${n?.id}-${t}`))]
|
|
246
|
+
}) : /* @__PURE__ */ U(o, {
|
|
247
|
+
variant: "ghost",
|
|
248
|
+
size: "xs",
|
|
249
|
+
onClick: () => {
|
|
250
|
+
w.append(g(_)), y("0");
|
|
251
|
+
},
|
|
252
|
+
children: [/* @__PURE__ */ H(pe, { size: 14 }), "Add"]
|
|
253
|
+
}), t[20] = w, t[21] = n.id, t[22] = n.key, t[23] = T, t[24] = _, t[25] = f, t[26] = r, t[27] = i, t[28] = v, t[29] = A) : A = t[29];
|
|
254
|
+
let j;
|
|
255
|
+
t[30] === D ? j = t[31] : (j = !!D && /* @__PURE__ */ H("div", {
|
|
256
|
+
className: "_1kzhxrsc",
|
|
257
|
+
children: /* @__PURE__ */ H("p", {
|
|
258
|
+
className: "_1ompjs13",
|
|
259
|
+
children: D
|
|
260
|
+
})
|
|
261
|
+
}), t[30] = D, t[31] = j);
|
|
262
|
+
let M;
|
|
263
|
+
return t[32] !== k || t[33] !== A || t[34] !== j ? (M = /* @__PURE__ */ U("div", {
|
|
264
|
+
className: ze,
|
|
265
|
+
children: [
|
|
266
|
+
k,
|
|
267
|
+
A,
|
|
268
|
+
j
|
|
269
|
+
]
|
|
270
|
+
}), t[32] = k, t[33] = A, t[34] = j, t[35] = M) : M = t[35], M;
|
|
271
|
+
}, st = "_8vx4f60 _1oiks600 _1ri7vba0", ct = "_8vx4f61", lt = "_8vx4f62", ut = "_8vx4f63", dt = "_8vx4f66", ft = "_8vx4f67", pt = "_8vx4f68", mt = "_8vx4f69", ht = "_8vx4f6a", gt = "_8vx4f6b", _t = "_8vx4f6c", vt = "_8vx4f6d _6o7s4x0", yt = "_8vx4f6e", bt = "_8vx4f6f", xt = "_8vx4f6g", St = "_8vx4f6h", Ct = "_8vx4f6k _6o7s4x1", wt = {
|
|
272
|
+
container: () => ct,
|
|
273
|
+
control: ({ isFocused: e, isMulti: t, isDisabled: n }) => $(st, t ? ut : lt, e && "_8vx4f64", n && "_8vx4f65"),
|
|
274
|
+
input: () => "",
|
|
275
|
+
valueContainer: () => dt,
|
|
276
|
+
loadingMessage: () => pt,
|
|
277
|
+
singleValue: () => "",
|
|
278
|
+
multiValue: () => mt,
|
|
279
|
+
multiValueRemove: () => ht,
|
|
280
|
+
indicatorsContainer: () => ft,
|
|
281
|
+
clearIndicator: () => gt,
|
|
282
|
+
indicatorSeparator: () => "",
|
|
283
|
+
dropdownIndicator: () => _t,
|
|
284
|
+
menu: () => vt,
|
|
285
|
+
groupHeading: () => bt,
|
|
286
|
+
placeholder: () => xt,
|
|
287
|
+
option: ({ isSelected: e, isFocused: t }) => $(St, t && "_8vx4f6i", e && "_8vx4f6j"),
|
|
288
|
+
noOptionsMessage: () => Ct,
|
|
289
|
+
menuPortal: () => yt
|
|
290
|
+
}, Tt = j.lazy(() => import("react-select-async-paginate").then((e) => ({ default: e.AsyncPaginate }))), Et = (e) => {
|
|
291
|
+
let { portalRef: t } = a();
|
|
292
|
+
return /* @__PURE__ */ H(Tt, {
|
|
293
|
+
isClearable: !0,
|
|
294
|
+
menuPlacement: "auto",
|
|
295
|
+
isSearchable: !0,
|
|
296
|
+
unstyled: !0,
|
|
297
|
+
classNames: wt,
|
|
298
|
+
styles: { menuPortal: (e) => ({
|
|
299
|
+
...e,
|
|
300
|
+
zIndex: 99999999
|
|
301
|
+
}) },
|
|
302
|
+
menuPosition: "fixed",
|
|
303
|
+
menuPortalTarget: t?.current,
|
|
304
|
+
loadingMessage: () => /* @__PURE__ */ H(T, { size: 16 }),
|
|
305
|
+
...e
|
|
306
|
+
});
|
|
307
|
+
}, Dt = (e) => e ? e.replace(/[-_]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()) : "", Ot = "_1k5k6yj0", kt = ({ field: e }) => {
|
|
308
|
+
let { collection: i } = Z(), [a, c] = B(!1), [l, u] = B(!1), [f, p] = B([]), [m, h] = B(1), [g, _] = B(5), [v, y] = B(0), [b, x] = B(0), { key: S = "", label: C = "", helper_text: w = "", readonly: E = !1 } = e, D = S, O = e?.options?.collection_key || "", k = e?.options?.label_field_key || "", { field: { value: A, onChange: j, ref: M }, fieldState: N } = be({
|
|
309
|
+
name: D,
|
|
310
|
+
rules: s(e)
|
|
311
|
+
}), P = !!e?.required, F = N?.error?.message, I = async () => {
|
|
312
|
+
c(!0);
|
|
313
|
+
try {
|
|
314
|
+
let e = await i?.getCollectionContentList({
|
|
315
|
+
collection_key: O,
|
|
316
|
+
page: m,
|
|
317
|
+
limit: g,
|
|
318
|
+
where: { _id: { in: A } }
|
|
319
|
+
}), t = e?.content?.data ?? [], n = e?.content?.meta?.pages ?? 0;
|
|
320
|
+
y(e?.content?.meta?.total ?? 0), x(n), m > n && h(n), p(t);
|
|
321
|
+
} catch (e) {
|
|
322
|
+
J(e);
|
|
323
|
+
} finally {
|
|
324
|
+
c(!1);
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
return L(() => {
|
|
328
|
+
A?.length > 0 && I();
|
|
329
|
+
}, [
|
|
330
|
+
A,
|
|
331
|
+
m,
|
|
332
|
+
g
|
|
333
|
+
]), /* @__PURE__ */ U("div", {
|
|
334
|
+
className: Ot,
|
|
335
|
+
children: [/* @__PURE__ */ H(d, {
|
|
336
|
+
ref: M,
|
|
337
|
+
error: F,
|
|
338
|
+
helperText: w,
|
|
339
|
+
readOnly: E,
|
|
340
|
+
label: C,
|
|
341
|
+
htmlFor: D,
|
|
342
|
+
isRequired: P,
|
|
343
|
+
children: /* @__PURE__ */ H(Et, {
|
|
344
|
+
id: D,
|
|
345
|
+
value: [],
|
|
346
|
+
onChange: (e) => {
|
|
347
|
+
e?.value?._id && j([...Array.isArray(A) ? A : [], e?.value?._id]);
|
|
348
|
+
},
|
|
349
|
+
placeholder: Array.isArray(A) && A?.length > 0 ? "Select more" : "Select",
|
|
350
|
+
filterOption: (e) => !Array.isArray(A) || !A.includes(e?.value?._id),
|
|
351
|
+
loadOptions: async (e, t, { page: n = 1 }) => {
|
|
352
|
+
u(!0);
|
|
353
|
+
try {
|
|
354
|
+
let t = Array.isArray(A) && A.length > 0 ? { _id: { not_in: A } } : void 0, r = (await i?.getCollectionContentList({
|
|
355
|
+
collection_key: O,
|
|
356
|
+
page: n,
|
|
357
|
+
search: e,
|
|
358
|
+
limit: 10,
|
|
359
|
+
...t && { where: t }
|
|
360
|
+
}))?.content?.data, a = (r || []).map((e) => ({
|
|
361
|
+
value: {
|
|
362
|
+
_id: e?._id,
|
|
363
|
+
slug: e?.slug,
|
|
364
|
+
[k]: e?.[k]
|
|
365
|
+
},
|
|
366
|
+
label: e?.[k] ? e?.[k] : Dt(e?.slug ?? "")
|
|
367
|
+
}));
|
|
368
|
+
return {
|
|
369
|
+
options: Array.isArray(a) ? a : [],
|
|
370
|
+
hasMore: r && !(r?.length < 10),
|
|
371
|
+
additional: { page: n + 1 }
|
|
372
|
+
};
|
|
373
|
+
} catch {
|
|
374
|
+
return {
|
|
375
|
+
options: [],
|
|
376
|
+
hasMore: !1,
|
|
377
|
+
additional: { page: n }
|
|
378
|
+
};
|
|
379
|
+
} finally {
|
|
380
|
+
u(!1);
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
debounceTimeout: 500,
|
|
384
|
+
getOptionLabel: (e) => e?.label,
|
|
385
|
+
getOptionValue: (e) => e?.value?._id || e?.value?.slug,
|
|
386
|
+
isLoading: l,
|
|
387
|
+
additional: { page: 1 },
|
|
388
|
+
cacheUniqs: [O],
|
|
389
|
+
minMenuHeight: 250
|
|
390
|
+
})
|
|
391
|
+
}), Array.isArray(A) && A?.length > 0 && /* @__PURE__ */ U("div", {
|
|
392
|
+
className: "_1k5k6yj1",
|
|
393
|
+
children: [
|
|
394
|
+
/* @__PURE__ */ U("h4", {
|
|
395
|
+
className: "_1k5k6yj2",
|
|
396
|
+
children: [/* @__PURE__ */ H("span", { children: "Selected" }), a && f?.length > 0 && /* @__PURE__ */ H(T, { size: 16 })]
|
|
397
|
+
}),
|
|
398
|
+
/* @__PURE__ */ H("div", {
|
|
399
|
+
className: "_1k5k6yj4",
|
|
400
|
+
children: f.map((e) => /* @__PURE__ */ U("div", {
|
|
401
|
+
className: "_1k5k6yj5",
|
|
402
|
+
children: [/* @__PURE__ */ H("div", {
|
|
403
|
+
className: "_1k5k6yj6",
|
|
404
|
+
children: e?.[k] || Dt(e?.slug ?? "")
|
|
405
|
+
}), /* @__PURE__ */ H(o, {
|
|
406
|
+
disabled: a,
|
|
407
|
+
size: "icon-sm",
|
|
408
|
+
variant: "ghost",
|
|
409
|
+
onClick: () => {
|
|
410
|
+
j(A?.filter((t) => t !== e?._id));
|
|
411
|
+
},
|
|
412
|
+
children: /* @__PURE__ */ H(ge, { size: 16 })
|
|
413
|
+
})]
|
|
414
|
+
}, e?._id))
|
|
415
|
+
}),
|
|
416
|
+
a && f?.length === 0 && /* @__PURE__ */ H("div", {
|
|
417
|
+
className: "_1k5k6yj3",
|
|
418
|
+
children: /* @__PURE__ */ H(T, { size: 24 })
|
|
419
|
+
}),
|
|
420
|
+
A?.length > 5 && /* @__PURE__ */ U("div", {
|
|
421
|
+
className: "_1k5k6yj7",
|
|
422
|
+
children: [
|
|
423
|
+
/* @__PURE__ */ U("div", {
|
|
424
|
+
className: "_1k5k6yj8",
|
|
425
|
+
children: [
|
|
426
|
+
"Showing",
|
|
427
|
+
" ",
|
|
428
|
+
v ? /* @__PURE__ */ U(V, { children: [
|
|
429
|
+
g * (m - 1) + 1,
|
|
430
|
+
"-",
|
|
431
|
+
Math.min(g * m, v),
|
|
432
|
+
" of",
|
|
433
|
+
" "
|
|
434
|
+
] }) : null,
|
|
435
|
+
v,
|
|
436
|
+
" items"
|
|
437
|
+
]
|
|
438
|
+
}),
|
|
439
|
+
/* @__PURE__ */ U("select", {
|
|
440
|
+
className: "_1k5k6yjb",
|
|
441
|
+
value: g,
|
|
442
|
+
onChange: (e) => {
|
|
443
|
+
h(1), _(Number(e.target.value));
|
|
444
|
+
},
|
|
445
|
+
children: [
|
|
446
|
+
/* @__PURE__ */ H("option", {
|
|
447
|
+
value: 5,
|
|
448
|
+
children: "5"
|
|
449
|
+
}),
|
|
450
|
+
/* @__PURE__ */ H("option", {
|
|
451
|
+
value: 10,
|
|
452
|
+
children: "10"
|
|
453
|
+
}),
|
|
454
|
+
/* @__PURE__ */ H("option", {
|
|
455
|
+
value: 25,
|
|
456
|
+
children: "25"
|
|
457
|
+
}),
|
|
458
|
+
/* @__PURE__ */ H("option", {
|
|
459
|
+
value: 50,
|
|
460
|
+
children: "50"
|
|
461
|
+
})
|
|
462
|
+
]
|
|
463
|
+
}),
|
|
464
|
+
/* @__PURE__ */ H("div", {
|
|
465
|
+
className: "_1k5k6yj9",
|
|
466
|
+
children: /* @__PURE__ */ U("div", {
|
|
467
|
+
className: "_1k5k6yja",
|
|
468
|
+
children: [
|
|
469
|
+
/* @__PURE__ */ U(r, { children: [/* @__PURE__ */ H(t, {
|
|
470
|
+
variant: "ghost",
|
|
471
|
+
size: "icon-xs",
|
|
472
|
+
onClick: () => h(1),
|
|
473
|
+
disabled: m === 1,
|
|
474
|
+
children: /* @__PURE__ */ H(se, { size: 14 })
|
|
475
|
+
}), /* @__PURE__ */ H(n, { children: "First page" })] }),
|
|
476
|
+
/* @__PURE__ */ U(r, { children: [/* @__PURE__ */ H(t, {
|
|
477
|
+
variant: "ghost",
|
|
478
|
+
size: "icon-xs",
|
|
479
|
+
disabled: m === 1,
|
|
480
|
+
onClick: () => h(m - 1),
|
|
481
|
+
children: /* @__PURE__ */ H(ae, { size: 14 })
|
|
482
|
+
}), /* @__PURE__ */ H(n, { children: "Previous page" })] }),
|
|
483
|
+
/* @__PURE__ */ U(r, { children: [/* @__PURE__ */ H(t, {
|
|
484
|
+
variant: "ghost",
|
|
485
|
+
size: "icon-xs",
|
|
486
|
+
onClick: () => h(m + 1),
|
|
487
|
+
disabled: m === b,
|
|
488
|
+
children: /* @__PURE__ */ H(oe, { size: 14 })
|
|
489
|
+
}), /* @__PURE__ */ H(n, { children: "Next page" })] }),
|
|
490
|
+
/* @__PURE__ */ U(r, { children: [/* @__PURE__ */ H(t, {
|
|
491
|
+
variant: "ghost",
|
|
492
|
+
size: "icon-xs",
|
|
493
|
+
onClick: () => h(b),
|
|
494
|
+
disabled: m === b,
|
|
495
|
+
children: /* @__PURE__ */ H(ce, { size: 14 })
|
|
496
|
+
}), /* @__PURE__ */ H(n, { children: "Last page" })] })
|
|
497
|
+
]
|
|
498
|
+
})
|
|
499
|
+
})
|
|
500
|
+
]
|
|
501
|
+
})
|
|
502
|
+
]
|
|
503
|
+
})]
|
|
504
|
+
});
|
|
505
|
+
}, At = ({ field: e }) => {
|
|
506
|
+
let { collection: t } = Z(), [n, r] = B(!1), { key: i = "", label: a = "", helper_text: o = "", readonly: c = !1 } = e, l = i, u = e?.options?.collection_key || "", f = e?.options?.label_field_key || "", { field: { value: p, onBlur: m, onChange: h, ref: g, disabled: _, ...v }, fieldState: y } = be({
|
|
507
|
+
name: l,
|
|
508
|
+
rules: s(e)
|
|
509
|
+
}), b = !!e?.required, x = y?.error?.message, S = async (e, n, { page: i = 1 }) => {
|
|
510
|
+
r(!0);
|
|
511
|
+
try {
|
|
512
|
+
let n = (await t?.getCollectionContentList({
|
|
513
|
+
collection_key: u,
|
|
514
|
+
page: i,
|
|
515
|
+
search: e,
|
|
516
|
+
limit: 10
|
|
517
|
+
}))?.content?.data, r = (n || []).map((e) => {
|
|
518
|
+
let t = e?.[f] ? e?.[f] : Dt(e?.slug || "");
|
|
519
|
+
return {
|
|
520
|
+
value: {
|
|
521
|
+
_id: e?._id,
|
|
522
|
+
slug: e?.slug,
|
|
523
|
+
[f]: e?.[f]
|
|
524
|
+
},
|
|
525
|
+
label: t
|
|
526
|
+
};
|
|
527
|
+
});
|
|
528
|
+
return {
|
|
529
|
+
options: Array.isArray(r) ? r : [],
|
|
530
|
+
hasMore: n && !(n?.length < 10),
|
|
531
|
+
additional: { page: i + 1 }
|
|
532
|
+
};
|
|
533
|
+
} catch {
|
|
534
|
+
return {
|
|
535
|
+
options: [],
|
|
536
|
+
hasMore: !1,
|
|
537
|
+
additional: { page: i }
|
|
538
|
+
};
|
|
539
|
+
} finally {
|
|
540
|
+
r(!1);
|
|
541
|
+
}
|
|
542
|
+
};
|
|
543
|
+
return /* @__PURE__ */ H(d, {
|
|
544
|
+
ref: g,
|
|
545
|
+
error: x,
|
|
546
|
+
helperText: o,
|
|
547
|
+
readOnly: c,
|
|
548
|
+
label: a,
|
|
549
|
+
htmlFor: l,
|
|
550
|
+
isRequired: b,
|
|
551
|
+
children: /* @__PURE__ */ H(Et, {
|
|
552
|
+
id: l,
|
|
553
|
+
value: p ? {
|
|
554
|
+
label: p?.[f] ? p?.[f] : p?.slug ? Dt(p?.slug || "") : "",
|
|
555
|
+
value: {
|
|
556
|
+
_id: p?._id,
|
|
557
|
+
slug: p?.slug,
|
|
558
|
+
[f]: p?.[f]
|
|
559
|
+
}
|
|
560
|
+
} : null,
|
|
561
|
+
onChange: (e) => {
|
|
562
|
+
h(e?.value || null);
|
|
563
|
+
},
|
|
564
|
+
onBlur: () => m(),
|
|
565
|
+
loadOptions: S,
|
|
566
|
+
debounceTimeout: 500,
|
|
567
|
+
getOptionLabel: (e) => e?.label,
|
|
568
|
+
getOptionValue: (e) => e?.value?._id || e?.value?.slug,
|
|
569
|
+
isLoading: n,
|
|
570
|
+
additional: { page: 1 },
|
|
571
|
+
cacheUniqs: [u],
|
|
572
|
+
minMenuHeight: 250,
|
|
573
|
+
isDisabled: _,
|
|
574
|
+
...v
|
|
575
|
+
})
|
|
576
|
+
});
|
|
577
|
+
}, jt = (e) => {
|
|
578
|
+
let t = Q(4), { field: n } = e, { field_interface: r, key: i, options: a } = n, o = a === void 0 ? {} : a;
|
|
579
|
+
if (!r || !i) return null;
|
|
580
|
+
if (!o?.collection_key || !o?.label_field_key) return console.error("[LevoCollection]: Error while rendering collection widget. Collection key of label field key is required."), null;
|
|
581
|
+
if (o?.current_have_many_connected && !o?.connected_have_many_current) return console.error("[LevoCollection]: O2M is not supported"), null;
|
|
582
|
+
if (o?.current_have_many_connected && o?.connected_have_many_current) {
|
|
583
|
+
let n;
|
|
584
|
+
return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ H(kt, {
|
|
585
|
+
...e,
|
|
586
|
+
schema: null
|
|
587
|
+
}), t[0] = e, t[1] = n), n;
|
|
588
|
+
}
|
|
589
|
+
let s;
|
|
590
|
+
return t[2] === e ? s = t[3] : (s = /* @__PURE__ */ H(At, {
|
|
591
|
+
...e,
|
|
592
|
+
schema: null
|
|
593
|
+
}), t[2] = e, t[3] = s), s;
|
|
594
|
+
}, Mt = "_1vaa8ub0", Nt = "_1vaa8ub2", Pt = "_1vaa8ub3", Ft = "_13kepqq0", It = "_13kepqq1", Lt = (e) => {
|
|
595
|
+
let t = Q(9), n, r;
|
|
596
|
+
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
597
|
+
let i;
|
|
598
|
+
t[3] === n ? i = t[4] : (i = $(Ft, n), t[3] = n, t[4] = i);
|
|
599
|
+
let a;
|
|
600
|
+
t[5] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ H(Ee.Indicator, {
|
|
601
|
+
"data-slot": "checkbox-indicator",
|
|
602
|
+
className: It,
|
|
603
|
+
children: /* @__PURE__ */ H(ie, {})
|
|
604
|
+
}), t[5] = a) : a = t[5];
|
|
605
|
+
let o;
|
|
606
|
+
return t[6] !== r || t[7] !== i ? (o = /* @__PURE__ */ H(Ee.Root, {
|
|
607
|
+
"data-slot": "checkbox",
|
|
608
|
+
className: i,
|
|
609
|
+
...r,
|
|
610
|
+
children: a
|
|
611
|
+
}), t[6] = r, t[7] = i, t[8] = o) : o = t[8], o;
|
|
612
|
+
}, Rt = (e) => {
|
|
613
|
+
let t = Q(48), { field: n } = e, [r, i] = B(""), [a, o] = B(!1), { key: c, label: l, helper_text: u, readonly: p, values: m, options: h } = n, g = c === void 0 ? "" : c, _ = l === void 0 ? "" : l, v = u === void 0 ? "" : u, y = p === void 0 ? !1 : p, b;
|
|
614
|
+
t[0] === m ? b = t[1] : (b = m === void 0 ? [] : m, t[0] = m, t[1] = b);
|
|
615
|
+
let x = b, S = h === void 0 ? {} : h, C;
|
|
616
|
+
t[2] === n ? C = t[3] : (C = s(n), t[2] = n, t[3] = C);
|
|
617
|
+
let w;
|
|
618
|
+
t[4] !== g || t[5] !== C ? (w = {
|
|
619
|
+
name: g,
|
|
620
|
+
rules: C
|
|
621
|
+
}, t[4] = g, t[5] = C, t[6] = w) : w = t[6];
|
|
622
|
+
let { field: T, fieldState: E } = be(w), { name: D, onBlur: O, onChange: A, value: j, ref: M, disabled: N } = T, { error: P } = E, F;
|
|
623
|
+
t[7] !== A || t[8] !== j ? (F = (e) => {
|
|
624
|
+
let t = Array.isArray(j || null) ? [...j] : [];
|
|
625
|
+
t.includes(e) ? t = t?.filter((t) => t !== e) : t.push(e), A(t);
|
|
626
|
+
}, t[7] = A, t[8] = j, t[9] = F) : F = t[9];
|
|
627
|
+
let I = F, R = !!S?.custom_input, z;
|
|
628
|
+
t[10] !== R || t[11] !== j || t[12] !== x ? (z = () => {
|
|
629
|
+
if (R) {
|
|
630
|
+
let e = !1;
|
|
631
|
+
(j ?? []).forEach((t) => {
|
|
632
|
+
x.includes(t) || (e = !0, i(t));
|
|
633
|
+
}), o(!!e);
|
|
634
|
+
}
|
|
635
|
+
}, t[10] = R, t[11] = j, t[12] = x, t[13] = z) : z = t[13];
|
|
636
|
+
let V;
|
|
637
|
+
t[14] !== j || t[15] !== x ? (V = [j, x], t[14] = j, t[15] = x, t[16] = V) : V = t[16], L(z, V);
|
|
638
|
+
let W = P?.message, G = n?.required, K = y && "_1vaa8ub1", q;
|
|
639
|
+
t[17] === K ? q = t[18] : (q = $(Mt, K), t[17] = K, t[18] = q);
|
|
640
|
+
let J;
|
|
641
|
+
t[19] !== N || t[20] !== I || t[21] !== D || t[22] !== O || t[23] !== j || t[24] !== x ? (J = x?.map((e, t) => /* @__PURE__ */ U("div", {
|
|
642
|
+
className: Nt,
|
|
643
|
+
children: [/* @__PURE__ */ H(Lt, {
|
|
644
|
+
id: `${D}-${e}-${t}`,
|
|
645
|
+
name: D,
|
|
646
|
+
checked: j ? j?.includes(e) : !1,
|
|
647
|
+
onCheckedChange: () => I(e),
|
|
648
|
+
onBlur: () => O(),
|
|
649
|
+
disabled: N
|
|
650
|
+
}), /* @__PURE__ */ H(f, {
|
|
651
|
+
htmlFor: `${D}-${e}-${t}`,
|
|
652
|
+
className: Pt,
|
|
653
|
+
children: e
|
|
654
|
+
})]
|
|
655
|
+
}, `${e}-${t}`)), t[19] = N, t[20] = I, t[21] = D, t[22] = O, t[23] = j, t[24] = x, t[25] = J) : J = t[25];
|
|
656
|
+
let Y;
|
|
657
|
+
t[26] !== M || t[27] !== q || t[28] !== J ? (Y = /* @__PURE__ */ H("div", {
|
|
658
|
+
ref: M,
|
|
659
|
+
className: q,
|
|
660
|
+
children: J
|
|
661
|
+
}), t[26] = M, t[27] = q, t[28] = J, t[29] = Y) : Y = t[29];
|
|
662
|
+
let X;
|
|
663
|
+
t[30] !== N || t[31] !== R || t[32] !== D || t[33] !== O || t[34] !== A || t[35] !== a || t[36] !== r || t[37] !== j ? (X = R && /* @__PURE__ */ U("div", {
|
|
664
|
+
className: "_1vaa8ub4",
|
|
665
|
+
children: [/* @__PURE__ */ U("div", {
|
|
666
|
+
className: "_1vaa8ub5",
|
|
667
|
+
children: [/* @__PURE__ */ H(Lt, {
|
|
668
|
+
name: `${D}-other`,
|
|
669
|
+
id: `${D}-other`,
|
|
670
|
+
disabled: N,
|
|
671
|
+
checked: a,
|
|
672
|
+
onCheckedChange: (e) => {
|
|
673
|
+
o(!!e), e ? Array.isArray(j) ? A?.([...j, r]) : A?.([r]) : A?.((j ?? [])?.filter((e) => e !== r));
|
|
674
|
+
},
|
|
675
|
+
onBlur: () => O()
|
|
676
|
+
}), /* @__PURE__ */ U(f, {
|
|
677
|
+
htmlFor: `${D}-other`,
|
|
678
|
+
className: "_1vaa8ub3",
|
|
679
|
+
children: ["Other:", " "]
|
|
680
|
+
})]
|
|
681
|
+
}), /* @__PURE__ */ H(k, {
|
|
682
|
+
name: `other-checkbox-${D}`,
|
|
683
|
+
className: "_1vaa8ub6",
|
|
684
|
+
value: r,
|
|
685
|
+
onChange: (e) => {
|
|
686
|
+
let t = 0;
|
|
687
|
+
A?.(j?.map((n) => n === r && !t ? (t = 1, e.target.value) : n)), i(e.target.value);
|
|
688
|
+
},
|
|
689
|
+
disabled: !a || N,
|
|
690
|
+
placeholder: "Please specify"
|
|
691
|
+
})]
|
|
692
|
+
}), t[30] = N, t[31] = R, t[32] = D, t[33] = O, t[34] = A, t[35] = a, t[36] = r, t[37] = j, t[38] = X) : X = t[38];
|
|
693
|
+
let ee;
|
|
694
|
+
return t[39] !== v || t[40] !== _ || t[41] !== D || t[42] !== y || t[43] !== W || t[44] !== G || t[45] !== Y || t[46] !== X ? (ee = /* @__PURE__ */ U(d, {
|
|
695
|
+
error: W,
|
|
696
|
+
helperText: v,
|
|
697
|
+
readOnly: y,
|
|
698
|
+
label: _,
|
|
699
|
+
htmlFor: D,
|
|
700
|
+
isRequired: G,
|
|
701
|
+
children: [Y, X]
|
|
702
|
+
}), t[39] = v, t[40] = _, t[41] = D, t[42] = y, t[43] = W, t[44] = G, t[45] = Y, t[46] = X, t[47] = ee) : ee = t[47], ee;
|
|
703
|
+
}, zt = (e) => {
|
|
704
|
+
let t = Q(38), n, r;
|
|
705
|
+
t[0] === e ? (n = t[1], r = t[2]) : ({field: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
706
|
+
let { key: i, label: a, helper_text: o, readonly: c } = n, u = i === void 0 ? "" : i, f = a === void 0 ? "" : a, p = o === void 0 ? "" : o, m = c === void 0 ? !1 : c, h = u, g;
|
|
707
|
+
t[3] === n ? g = t[4] : (g = s(n), t[3] = n, t[4] = g);
|
|
708
|
+
let _;
|
|
709
|
+
t[5] !== h || t[6] !== g ? (_ = {
|
|
710
|
+
name: h,
|
|
711
|
+
rules: g
|
|
712
|
+
}, t[5] = h, t[6] = g, t[7] = _) : _ = t[7];
|
|
713
|
+
let { field: v, fieldState: y } = be(_), b, x, S, C, w;
|
|
714
|
+
t[8] === v ? (b = t[9], x = t[10], S = t[11], C = t[12], w = t[13]) : ({value: w, onBlur: b, onChange: x, ref: S, ...C} = v, t[8] = v, t[9] = b, t[10] = x, t[11] = S, t[12] = C, t[13] = w);
|
|
715
|
+
let T = !!n?.required, E = y?.error?.message, D = n?.options?.currency_code, k = D || "$", A = D === "₹" ? "lakh" : "thousand", j;
|
|
716
|
+
t[14] === x ? j = t[15] : (j = (e) => {
|
|
717
|
+
let { value: t } = e;
|
|
718
|
+
x && x(t);
|
|
719
|
+
}, t[14] = x, t[15] = j);
|
|
720
|
+
let M;
|
|
721
|
+
t[16] === b ? M = t[17] : (M = () => {
|
|
722
|
+
b && b();
|
|
723
|
+
}, t[16] = b, t[17] = M);
|
|
724
|
+
let N;
|
|
725
|
+
t[18] === Symbol.for("react.memo_cache_sentinel") ? (N = $(l, O), t[18] = N) : N = t[18];
|
|
726
|
+
let P;
|
|
727
|
+
t[19] !== h || t[20] !== r || t[21] !== m || t[22] !== S || t[23] !== C || t[24] !== j || t[25] !== M || t[26] !== k || t[27] !== A || t[28] !== w ? (P = /* @__PURE__ */ H(De, {
|
|
728
|
+
thousandSeparator: !0,
|
|
729
|
+
prefix: k,
|
|
730
|
+
thousandsGroupStyle: A,
|
|
731
|
+
suffix: "",
|
|
732
|
+
allowNegative: !1,
|
|
733
|
+
id: h,
|
|
734
|
+
getInputRef: S,
|
|
735
|
+
onValueChange: j,
|
|
736
|
+
onBlur: M,
|
|
737
|
+
value: w,
|
|
738
|
+
readOnly: m,
|
|
739
|
+
className: N,
|
|
740
|
+
...C,
|
|
741
|
+
...r
|
|
742
|
+
}), t[19] = h, t[20] = r, t[21] = m, t[22] = S, t[23] = C, t[24] = j, t[25] = M, t[26] = k, t[27] = A, t[28] = w, t[29] = P) : P = t[29];
|
|
743
|
+
let F;
|
|
744
|
+
return t[30] !== E || t[31] !== p || t[32] !== T || t[33] !== f || t[34] !== h || t[35] !== m || t[36] !== P ? (F = /* @__PURE__ */ H(d, {
|
|
745
|
+
error: E,
|
|
746
|
+
helperText: p,
|
|
747
|
+
readOnly: m,
|
|
748
|
+
htmlFor: h,
|
|
749
|
+
isRequired: T,
|
|
750
|
+
label: f,
|
|
751
|
+
children: P
|
|
752
|
+
}), t[30] = E, t[31] = p, t[32] = T, t[33] = f, t[34] = h, t[35] = m, t[36] = P, t[37] = F) : F = t[37], F;
|
|
753
|
+
}, Bt = {
|
|
754
|
+
label: "Other",
|
|
755
|
+
value: "other_internal"
|
|
756
|
+
}, Vt = ({ field: e, ...t }) => {
|
|
757
|
+
let { portalRef: n } = a(), [r, i] = B([]), { key: o = "", label: c = "", helper_text: l = "", readonly: u = !1, values: f = [], options: p = {} } = e, m = o, { field: { value: h, onBlur: g, onChange: _, disabled: v, ...y }, fieldState: b } = be({
|
|
758
|
+
name: m,
|
|
759
|
+
rules: s(e)
|
|
760
|
+
}), [x, S] = B(""), [C, w] = B(!1), T = !!e?.required, E = b?.error?.message, D = !!p?.custom_input;
|
|
761
|
+
return L(() => {
|
|
762
|
+
if (f?.length) {
|
|
763
|
+
let e = [...f?.map((e) => ({
|
|
764
|
+
label: e,
|
|
765
|
+
value: e
|
|
766
|
+
}))];
|
|
767
|
+
D && e.push(Bt), i(e);
|
|
768
|
+
}
|
|
769
|
+
}, [f, D]), L(() => {
|
|
770
|
+
!t?.isMulti && D && typeof h == "string" && h && (r.some((e) => e.value !== Bt.value && e.value === h) ? w(!1) : (w(!0), S(h)));
|
|
771
|
+
}, [
|
|
772
|
+
h,
|
|
773
|
+
r,
|
|
774
|
+
D
|
|
775
|
+
]), /* @__PURE__ */ U(d, {
|
|
776
|
+
error: E,
|
|
777
|
+
helperText: l,
|
|
778
|
+
readOnly: u,
|
|
779
|
+
label: c,
|
|
780
|
+
htmlFor: m,
|
|
781
|
+
isRequired: T,
|
|
782
|
+
children: [/* @__PURE__ */ H(_e, {
|
|
783
|
+
id: m,
|
|
784
|
+
value: C ? Bt : h ? t?.isMulti ? r?.filter((e) => h?.includes(e?.value)) : r?.find((e) => e?.value === h) : null,
|
|
785
|
+
onChange: (e) => {
|
|
786
|
+
D && e?.value === Bt.value && e?.label === Bt.label ? (w(!0), S(""), _("")) : (w(!1), t?.isMulti ? _(e?.map((e) => e?.value)) : _(e?.value));
|
|
787
|
+
},
|
|
788
|
+
onBlur: () => g(),
|
|
789
|
+
options: r,
|
|
790
|
+
isDisabled: v,
|
|
791
|
+
menuPlacement: "auto",
|
|
792
|
+
isClearable: !0,
|
|
793
|
+
...y,
|
|
794
|
+
...t,
|
|
795
|
+
unstyled: !0,
|
|
796
|
+
classNames: wt,
|
|
797
|
+
styles: { menuPortal: (e) => ({
|
|
798
|
+
...e,
|
|
799
|
+
zIndex: 99999999
|
|
800
|
+
}) },
|
|
801
|
+
menuPosition: "fixed",
|
|
802
|
+
menuPortalTarget: n?.current
|
|
803
|
+
}), C && /* @__PURE__ */ H("div", {
|
|
804
|
+
className: "ldp9z20",
|
|
805
|
+
children: /* @__PURE__ */ H(k, {
|
|
806
|
+
name: `select-other-${m}`,
|
|
807
|
+
value: x,
|
|
808
|
+
onChange: (e) => {
|
|
809
|
+
_?.(e.target.value), S(e.target.value);
|
|
810
|
+
},
|
|
811
|
+
placeholder: "Other, Please Specify"
|
|
812
|
+
})
|
|
813
|
+
})]
|
|
814
|
+
});
|
|
815
|
+
}, Ht = "eviv4t0", Ut = "eviv4t1", Wt = "eviv4t3", Gt = (e) => {
|
|
816
|
+
let t = Q(50), n, r, i;
|
|
817
|
+
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({field: n, settings: i, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
818
|
+
let { key: a, label: o, helper_text: c, readonly: l } = n, u = a === void 0 ? "" : a, f = o === void 0 ? "" : o, p = c === void 0 ? "" : c, m = l === void 0 ? !1 : l, h = u, g = !!n.options?.verification && !!i?.enableVerification, [_, v] = B(null), [y, b] = B(!1), x;
|
|
819
|
+
t[4] !== y || t[5] !== g || t[6] !== _ ? (x = (e) => y ? !0 : g && (!_ || _ !== e) ? "Email verification required" : !0, t[4] = y, t[5] = g, t[6] = _, t[7] = x) : x = t[7];
|
|
820
|
+
let S;
|
|
821
|
+
t[8] !== n || t[9] !== x ? (S = s(n, x), t[8] = n, t[9] = x, t[10] = S) : S = t[10];
|
|
822
|
+
let C = S, w;
|
|
823
|
+
t[11] !== h || t[12] !== C ? (w = {
|
|
824
|
+
name: h,
|
|
825
|
+
rules: C
|
|
826
|
+
}, t[11] = h, t[12] = C, t[13] = w) : w = t[13];
|
|
827
|
+
let { field: T, fieldState: D } = be(w), O, A, j, M;
|
|
828
|
+
t[14] === T ? (O = t[15], A = t[16], j = t[17], M = t[18]) : ({value: M, onBlur: A, onChange: j, ...O} = T, t[14] = T, t[15] = O, t[16] = A, t[17] = j, t[18] = M);
|
|
829
|
+
let N = !!n?.required, P = D?.error?.message, F = !!_ && !!M && _ === M?.trim()?.toLowerCase(), I;
|
|
830
|
+
t[19] === j ? I = t[20] : (I = (e) => {
|
|
831
|
+
v(e), j(e);
|
|
832
|
+
}, t[19] = j, t[20] = I);
|
|
833
|
+
let L = I, R;
|
|
834
|
+
t[21] === Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ H(de, { size: 20 }), t[21] = R) : R = t[21];
|
|
835
|
+
let z;
|
|
836
|
+
t[22] === F ? z = t[23] : (z = F ? /* @__PURE__ */ H("button", {
|
|
837
|
+
type: "button",
|
|
838
|
+
onClick: () => v(null),
|
|
839
|
+
className: Wt,
|
|
840
|
+
title: "Change email",
|
|
841
|
+
children: /* @__PURE__ */ H(fe, { size: 14 })
|
|
842
|
+
}) : null, t[22] = F, t[23] = z);
|
|
843
|
+
let V = M || "", W;
|
|
844
|
+
t[24] === j ? W = t[25] : (W = (e) => j(e?.target?.value?.trim()?.toLocaleLowerCase()), t[24] = j, t[25] = W);
|
|
845
|
+
let G = m || F, K;
|
|
846
|
+
t[26] !== O || t[27] !== h || t[28] !== A || t[29] !== r || t[30] !== z || t[31] !== V || t[32] !== W || t[33] !== G ? (K = /* @__PURE__ */ H(k, {
|
|
847
|
+
className: Ut,
|
|
848
|
+
id: h,
|
|
849
|
+
type: "email",
|
|
850
|
+
leftIcon: R,
|
|
851
|
+
rightIcon: z,
|
|
852
|
+
value: V,
|
|
853
|
+
onChange: W,
|
|
854
|
+
onBlur: A,
|
|
855
|
+
readOnly: G,
|
|
856
|
+
...O,
|
|
857
|
+
...r
|
|
858
|
+
}), t[26] = O, t[27] = h, t[28] = A, t[29] = r, t[30] = z, t[31] = V, t[32] = W, t[33] = G, t[34] = K) : K = t[34];
|
|
859
|
+
let q;
|
|
860
|
+
t[35] !== L || t[36] !== F || t[37] !== g || t[38] !== M ? (q = g && /* @__PURE__ */ H("div", {
|
|
861
|
+
className: "eviv4t2",
|
|
862
|
+
children: /* @__PURE__ */ H(E, {
|
|
863
|
+
value: M,
|
|
864
|
+
type: "email",
|
|
865
|
+
isVerified: F,
|
|
866
|
+
onVerifySuccess: L,
|
|
867
|
+
onStateChange: b
|
|
868
|
+
})
|
|
869
|
+
}), t[35] = L, t[36] = F, t[37] = g, t[38] = M, t[39] = q) : q = t[39];
|
|
870
|
+
let J;
|
|
871
|
+
t[40] !== K || t[41] !== q ? (J = /* @__PURE__ */ U("div", {
|
|
872
|
+
className: Ht,
|
|
873
|
+
children: [K, q]
|
|
874
|
+
}), t[40] = K, t[41] = q, t[42] = J) : J = t[42];
|
|
875
|
+
let Y;
|
|
876
|
+
return t[43] !== P || t[44] !== p || t[45] !== N || t[46] !== f || t[47] !== h || t[48] !== J ? (Y = /* @__PURE__ */ H(d, {
|
|
877
|
+
error: P,
|
|
878
|
+
helperText: p,
|
|
879
|
+
label: f,
|
|
880
|
+
htmlFor: h,
|
|
881
|
+
isRequired: N,
|
|
882
|
+
children: J
|
|
883
|
+
}), t[43] = P, t[44] = p, t[45] = N, t[46] = f, t[47] = h, t[48] = J, t[49] = Y) : Y = t[49], Y;
|
|
884
|
+
}, Kt = (e) => e ? {
|
|
885
|
+
value: e,
|
|
886
|
+
label: e?.place_name || e?.formatted_address || e?.name
|
|
887
|
+
} : null, qt = ({ field: e }) => {
|
|
888
|
+
let { portalRef: t } = a(), [n, r] = B(!1), [i, o] = B(!1), c = Z(), { key: l = "", label: u = "", helper_text: f = "", readonly: p = !1 } = e, { field: { value: m, onBlur: h, onChange: g, disabled: _, ...v }, fieldState: y } = be({
|
|
889
|
+
name: l,
|
|
890
|
+
rules: s(e)
|
|
891
|
+
}), b = !!e?.required, x = y?.error?.message, S = (e) => {
|
|
892
|
+
e && e?.place_id !== m?.place_id ? (o(!0), c?.fetch.url(`/v1/bevy/content/location/${e?.place_id}/get-location-details`).get().json().then((e) => {
|
|
893
|
+
g && g(e?.content?.data);
|
|
894
|
+
}).catch((e) => {
|
|
895
|
+
console.log("Could not fetch location details:", q(e).message);
|
|
896
|
+
}).finally(() => o(!1))) : g(null);
|
|
897
|
+
}, C = (t, n) => {
|
|
898
|
+
r(!0);
|
|
899
|
+
let i = {};
|
|
900
|
+
e?.options?.location_type && (i.location_type = e?.options?.location_type), e?.options?.country && (i.country = e?.options?.country), c?.fetch.url("/v1/bevy/content/location/search-location").post({
|
|
901
|
+
search: t,
|
|
902
|
+
where: i
|
|
903
|
+
}).json().then((e) => {
|
|
904
|
+
n(e?.content?.data?.map((e) => ({
|
|
905
|
+
label: e?.description,
|
|
906
|
+
value: e
|
|
907
|
+
})));
|
|
908
|
+
}).catch(() => {
|
|
909
|
+
n([]);
|
|
910
|
+
}).finally(() => r(!1));
|
|
911
|
+
};
|
|
912
|
+
return /* @__PURE__ */ H(d, {
|
|
913
|
+
error: x,
|
|
914
|
+
helperText: f,
|
|
915
|
+
readOnly: p,
|
|
916
|
+
label: u,
|
|
917
|
+
htmlFor: l,
|
|
918
|
+
isRequired: b,
|
|
919
|
+
children: /* @__PURE__ */ H(Oe, {
|
|
920
|
+
id: l,
|
|
921
|
+
value: Kt(m),
|
|
922
|
+
defaultOptions: m ? [Kt(m)] : void 0,
|
|
923
|
+
onChange: (e) => {
|
|
924
|
+
S(e?.value);
|
|
925
|
+
},
|
|
926
|
+
onBlur: h,
|
|
927
|
+
isDisabled: _ || i,
|
|
928
|
+
menuPlacement: "auto",
|
|
929
|
+
...v,
|
|
930
|
+
unstyled: !0,
|
|
931
|
+
classNames: wt,
|
|
932
|
+
styles: { menuPortal: (e) => ({
|
|
933
|
+
...e,
|
|
934
|
+
zIndex: 99999999
|
|
935
|
+
}) },
|
|
936
|
+
menuPosition: "fixed",
|
|
937
|
+
menuPortalTarget: t?.current,
|
|
938
|
+
loadOptions: C,
|
|
939
|
+
isLoading: n || i,
|
|
940
|
+
isClearable: !0,
|
|
941
|
+
noOptionsMessage: ({ inputValue: e }) => e ? "No results found. Try searching something else" : "Start typing to search"
|
|
942
|
+
})
|
|
943
|
+
});
|
|
944
|
+
}, Jt = "xgv9uh0", Yt = "xgv9uh1", Xt = "xgv9uh2", Zt = "xgv9uh3", Qt = "xgv9uh4", $t = "xgv9uh5", en = (e) => {
|
|
945
|
+
let t = Q(29), { field: n } = e, { key: r, label: i } = n, a = r === void 0 ? "" : r, s = i === void 0 ? "" : i, c;
|
|
946
|
+
t[0] === a ? c = t[1] : (c = { name: a }, t[0] = a, t[1] = c);
|
|
947
|
+
let l = xe(c), u, d, p, m, h, g;
|
|
948
|
+
if (t[2] !== n || t[3] !== a || t[4] !== s || t[5] !== l) {
|
|
949
|
+
let { fields: e, ...r } = l;
|
|
950
|
+
u = r, m = Jt, h = a, t[12] !== a || t[13] !== s ? (g = s && /* @__PURE__ */ H(f, {
|
|
951
|
+
htmlFor: a,
|
|
952
|
+
className: "_1ompjs11",
|
|
953
|
+
children: s
|
|
954
|
+
}), t[12] = a, t[13] = s, t[14] = g) : g = t[14], d = Yt, p = e?.map((e, t) => /* @__PURE__ */ U("div", {
|
|
955
|
+
className: Zt,
|
|
956
|
+
children: [/* @__PURE__ */ H("div", {
|
|
957
|
+
className: Qt,
|
|
958
|
+
children: /* @__PURE__ */ H(qt, { field: {
|
|
959
|
+
...n,
|
|
960
|
+
key: `${a}.${t}`,
|
|
961
|
+
label: ""
|
|
962
|
+
} })
|
|
963
|
+
}), /* @__PURE__ */ H(o, {
|
|
964
|
+
variant: "ghost",
|
|
965
|
+
size: "icon-sm",
|
|
966
|
+
className: $t,
|
|
967
|
+
onClick: () => u.remove(t),
|
|
968
|
+
"aria-label": `Remove location ${t + 1}`,
|
|
969
|
+
children: /* @__PURE__ */ H(me, { size: 14 })
|
|
970
|
+
})]
|
|
971
|
+
}, e.id)), t[2] = n, t[3] = a, t[4] = s, t[5] = l, t[6] = u, t[7] = d, t[8] = p, t[9] = m, t[10] = h, t[11] = g;
|
|
972
|
+
} else u = t[6], d = t[7], p = t[8], m = t[9], h = t[10], g = t[11];
|
|
973
|
+
let _;
|
|
974
|
+
t[15] === u ? _ = t[16] : (_ = () => {
|
|
975
|
+
u.append(null);
|
|
976
|
+
}, t[15] = u, t[16] = _);
|
|
977
|
+
let v;
|
|
978
|
+
t[17] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ H(pe, { size: 14 }), t[17] = v) : v = t[17];
|
|
979
|
+
let y;
|
|
980
|
+
t[18] === _ ? y = t[19] : (y = /* @__PURE__ */ U(o, {
|
|
981
|
+
variant: "ghost",
|
|
982
|
+
size: "xs",
|
|
983
|
+
className: Xt,
|
|
984
|
+
onClick: _,
|
|
985
|
+
children: [v, "Add"]
|
|
986
|
+
}), t[18] = _, t[19] = y);
|
|
987
|
+
let b;
|
|
988
|
+
t[20] !== y || t[21] !== d || t[22] !== p ? (b = /* @__PURE__ */ U("div", {
|
|
989
|
+
className: d,
|
|
990
|
+
children: [p, y]
|
|
991
|
+
}), t[20] = y, t[21] = d, t[22] = p, t[23] = b) : b = t[23];
|
|
992
|
+
let x;
|
|
993
|
+
return t[24] !== b || t[25] !== m || t[26] !== h || t[27] !== g ? (x = /* @__PURE__ */ U("div", {
|
|
994
|
+
className: m,
|
|
995
|
+
children: [g, b]
|
|
996
|
+
}, h), t[24] = b, t[25] = m, t[26] = h, t[27] = g, t[28] = x) : x = t[28], x;
|
|
997
|
+
}, tn = "a22xph0", nn = "a22xph2", rn = "a22xph3", an = "a22xph5", on = /[\n\t,]+/, sn = ({ field: e }) => {
|
|
998
|
+
let { key: t = "", label: n = "", helper_text: r = "", readonly: i = !1 } = e, a = t, { field: { value: o, onChange: c, onBlur: l, ref: u }, fieldState: f } = be({
|
|
999
|
+
name: a,
|
|
1000
|
+
rules: s(e)
|
|
1001
|
+
}), p = !!e?.required, m = f?.error?.message, h = Array.isArray(o) ? o : [], [g, _] = B(""), [v, y] = B(-1), b = z(null), x = F((e) => {
|
|
1002
|
+
b.current = e, typeof u == "function" && u(e);
|
|
1003
|
+
}, [u]), S = F((e) => {
|
|
1004
|
+
c(h.filter((t, n) => n !== e));
|
|
1005
|
+
}, [h, c]), C = F(() => {
|
|
1006
|
+
if (!g.trim()) return;
|
|
1007
|
+
let e = g.split(on), t = [...h];
|
|
1008
|
+
for (let n of e) {
|
|
1009
|
+
let e = n.trim();
|
|
1010
|
+
e && !t.includes(e) && t.push(e);
|
|
1011
|
+
}
|
|
1012
|
+
c(t), _("");
|
|
1013
|
+
}, [
|
|
1014
|
+
g,
|
|
1015
|
+
h,
|
|
1016
|
+
c
|
|
1017
|
+
]), w = F((e) => {
|
|
1018
|
+
let t = e.currentTarget;
|
|
1019
|
+
switch (e.key) {
|
|
1020
|
+
case "Enter":
|
|
1021
|
+
g.trim() && (e.preventDefault(), C());
|
|
1022
|
+
break;
|
|
1023
|
+
case "Backspace":
|
|
1024
|
+
t.selectionStart === 0 && t.selectionEnd === 0 && h.length > 0 && (v >= 0 ? (S(v), y(v > 0 ? v - 1 : -1)) : y(h.length - 1));
|
|
1025
|
+
break;
|
|
1026
|
+
case "Delete":
|
|
1027
|
+
v >= 0 && v < h.length && (S(v), y(v < h.length - 1 ? v : -1));
|
|
1028
|
+
break;
|
|
1029
|
+
case "ArrowLeft":
|
|
1030
|
+
t.selectionStart === 0 && h.length > 0 && (e.preventDefault(), y(v > 0 ? v - 1 : v === -1 ? h.length - 1 : 0));
|
|
1031
|
+
break;
|
|
1032
|
+
case "ArrowRight":
|
|
1033
|
+
v >= 0 && (e.preventDefault(), v < h.length - 1 ? y(v + 1) : y(-1));
|
|
1034
|
+
break;
|
|
1035
|
+
case "Escape":
|
|
1036
|
+
y(-1);
|
|
1037
|
+
break;
|
|
1038
|
+
default:
|
|
1039
|
+
v >= 0 && y(-1);
|
|
1040
|
+
break;
|
|
1041
|
+
}
|
|
1042
|
+
}, [
|
|
1043
|
+
g,
|
|
1044
|
+
h,
|
|
1045
|
+
v,
|
|
1046
|
+
C,
|
|
1047
|
+
S
|
|
1048
|
+
]), T = F((e) => {
|
|
1049
|
+
let t = e.clipboardData.getData("text");
|
|
1050
|
+
if (on.test(t)) {
|
|
1051
|
+
e.preventDefault();
|
|
1052
|
+
let n = t.split(on), r = [...h];
|
|
1053
|
+
for (let e of n) {
|
|
1054
|
+
let t = e.trim();
|
|
1055
|
+
t && !r.includes(t) && r.push(t);
|
|
1056
|
+
}
|
|
1057
|
+
c(r), _("");
|
|
1058
|
+
}
|
|
1059
|
+
}, [h, c]), E = F(() => {
|
|
1060
|
+
b.current?.focus(), y(-1);
|
|
1061
|
+
}, []), D = F(() => {
|
|
1062
|
+
C(), y(-1), l();
|
|
1063
|
+
}, [C, l]);
|
|
1064
|
+
return /* @__PURE__ */ H(d, {
|
|
1065
|
+
error: m,
|
|
1066
|
+
helperText: r,
|
|
1067
|
+
label: n,
|
|
1068
|
+
htmlFor: a,
|
|
1069
|
+
isRequired: p,
|
|
1070
|
+
children: /* @__PURE__ */ U("div", {
|
|
1071
|
+
className: tn,
|
|
1072
|
+
"data-readonly": i,
|
|
1073
|
+
onClick: E,
|
|
1074
|
+
children: [h.map((e, t) => /* @__PURE__ */ U("span", {
|
|
1075
|
+
className: nn,
|
|
1076
|
+
"data-active": v === t,
|
|
1077
|
+
children: [/* @__PURE__ */ H("span", {
|
|
1078
|
+
className: rn,
|
|
1079
|
+
children: e
|
|
1080
|
+
}), !i && /* @__PURE__ */ H("button", {
|
|
1081
|
+
type: "button",
|
|
1082
|
+
className: "a22xph4",
|
|
1083
|
+
onClick: (e) => {
|
|
1084
|
+
e.stopPropagation(), S(t), b.current?.focus();
|
|
1085
|
+
},
|
|
1086
|
+
"aria-label": `Remove ${e}`,
|
|
1087
|
+
tabIndex: -1,
|
|
1088
|
+
children: /* @__PURE__ */ H(ge, { size: 12 })
|
|
1089
|
+
})]
|
|
1090
|
+
}, `${e}-${t}`)), /* @__PURE__ */ H("input", {
|
|
1091
|
+
ref: x,
|
|
1092
|
+
id: a,
|
|
1093
|
+
className: an,
|
|
1094
|
+
type: "text",
|
|
1095
|
+
value: g,
|
|
1096
|
+
onChange: (e) => _(e.target.value),
|
|
1097
|
+
onKeyDown: w,
|
|
1098
|
+
onPaste: T,
|
|
1099
|
+
onBlur: D,
|
|
1100
|
+
placeholder: h.length === 0 ? e.placeholder || "Type and press Enter" : "",
|
|
1101
|
+
readOnly: i,
|
|
1102
|
+
disabled: i,
|
|
1103
|
+
autoComplete: "off"
|
|
1104
|
+
})]
|
|
1105
|
+
})
|
|
1106
|
+
});
|
|
1107
|
+
}, cn = "jqes4z0", ln = "jqes4z2", un = "jqes4z3", dn = "_1mrsmih0", fn = "_1mrsmih1", pn = "_1mrsmih2", mn = "_1mrsmih3", hn = (e) => {
|
|
1108
|
+
let t = Q(8), n, r;
|
|
1109
|
+
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1110
|
+
let i;
|
|
1111
|
+
t[3] === n ? i = t[4] : (i = $(dn, n), t[3] = n, t[4] = i);
|
|
1112
|
+
let a;
|
|
1113
|
+
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ H(Ae, {
|
|
1114
|
+
"data-slot": "radio-group",
|
|
1115
|
+
className: i,
|
|
1116
|
+
...r
|
|
1117
|
+
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1118
|
+
}, gn = (e) => {
|
|
1119
|
+
let t = Q(9), n, r;
|
|
1120
|
+
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1121
|
+
let i;
|
|
1122
|
+
t[3] === n ? i = t[4] : (i = $(fn, n), t[3] = n, t[4] = i);
|
|
1123
|
+
let a;
|
|
1124
|
+
t[5] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ H(ke.Indicator, {
|
|
1125
|
+
"data-slot": "radio-group-indicator",
|
|
1126
|
+
className: pn,
|
|
1127
|
+
children: /* @__PURE__ */ H("span", { className: mn })
|
|
1128
|
+
}), t[5] = a) : a = t[5];
|
|
1129
|
+
let o;
|
|
1130
|
+
return t[6] !== r || t[7] !== i ? (o = /* @__PURE__ */ H(ke.Root, {
|
|
1131
|
+
"data-slot": "radio-group-item",
|
|
1132
|
+
className: i,
|
|
1133
|
+
...r,
|
|
1134
|
+
children: a
|
|
1135
|
+
}), t[6] = r, t[7] = i, t[8] = o) : o = t[8], o;
|
|
1136
|
+
}, _n = (e) => {
|
|
1137
|
+
let t = Q(53), { field: n } = e, [r, i] = A.useState(""), [a, o] = A.useState(!1), { key: c, label: l, helper_text: u, readonly: p, values: m, options: h } = n, g = c === void 0 ? "" : c, _ = l === void 0 ? "" : l, v = u === void 0 ? "" : u, y = p === void 0 ? !1 : p, b;
|
|
1138
|
+
t[0] === m ? b = t[1] : (b = m === void 0 ? [] : m, t[0] = m, t[1] = b);
|
|
1139
|
+
let x = b, S;
|
|
1140
|
+
t[2] === h ? S = t[3] : (S = h === void 0 ? {} : h, t[2] = h, t[3] = S);
|
|
1141
|
+
let { custom_input: C } = S, w = g, T;
|
|
1142
|
+
t[4] === n ? T = t[5] : (T = s(n), t[4] = n, t[5] = T);
|
|
1143
|
+
let E;
|
|
1144
|
+
t[6] !== w || t[7] !== T ? (E = {
|
|
1145
|
+
name: w,
|
|
1146
|
+
rules: T
|
|
1147
|
+
}, t[6] = w, t[7] = T, t[8] = E) : E = t[8];
|
|
1148
|
+
let { field: D, fieldState: O } = be(E), j, M, N, P;
|
|
1149
|
+
t[9] === D ? (j = t[10], M = t[11], N = t[12], P = t[13]) : ({value: P, onBlur: j, onChange: M, ...N} = D, t[9] = D, t[10] = j, t[11] = M, t[12] = N, t[13] = P);
|
|
1150
|
+
let F = !!n?.required, I = O?.error?.message, L;
|
|
1151
|
+
t[14] !== a || t[15] !== P || t[16] !== x ? (L = () => {
|
|
1152
|
+
a || P && x?.findIndex((e) => e === P) === -1 && (o(!0), i(P));
|
|
1153
|
+
}, t[14] = a, t[15] = P, t[16] = x, t[17] = L) : L = t[17];
|
|
1154
|
+
let R;
|
|
1155
|
+
t[18] === P ? R = t[19] : (R = [P], t[18] = P, t[19] = R), A.useEffect(L, R);
|
|
1156
|
+
let z = y && "jqes4z1", B;
|
|
1157
|
+
t[20] === z ? B = t[21] : (B = $(cn, z), t[20] = z, t[21] = B);
|
|
1158
|
+
let V;
|
|
1159
|
+
t[22] !== M || t[23] !== r ? (V = (e) => {
|
|
1160
|
+
M && (e === "Other" ? (o(!0), M(r)) : (o(!1), M(e)));
|
|
1161
|
+
}, t[22] = M, t[23] = r, t[24] = V) : V = t[24];
|
|
1162
|
+
let W;
|
|
1163
|
+
t[25] === j ? W = t[26] : (W = () => j(), t[25] = j, t[26] = W);
|
|
1164
|
+
let G = a ? "Other" : P ?? "", K;
|
|
1165
|
+
t[27] !== w || t[28] !== x ? (K = x?.map((e, t) => /* @__PURE__ */ U("div", {
|
|
1166
|
+
className: ln,
|
|
1167
|
+
children: [/* @__PURE__ */ H(gn, {
|
|
1168
|
+
id: `${w}-${e}-${t}`,
|
|
1169
|
+
value: e
|
|
1170
|
+
}), /* @__PURE__ */ H(f, {
|
|
1171
|
+
htmlFor: `${w}-${e}-${t}`,
|
|
1172
|
+
className: un,
|
|
1173
|
+
children: e
|
|
1174
|
+
})]
|
|
1175
|
+
}, `${e}-${t}`)), t[27] = w, t[28] = x, t[29] = K) : K = t[29];
|
|
1176
|
+
let q;
|
|
1177
|
+
t[30] !== C || t[31] !== w || t[32] !== M || t[33] !== a || t[34] !== r ? (q = !!C && /* @__PURE__ */ U("div", {
|
|
1178
|
+
className: "jqes4z4",
|
|
1179
|
+
children: [
|
|
1180
|
+
/* @__PURE__ */ H(gn, {
|
|
1181
|
+
id: `${w}-other`,
|
|
1182
|
+
value: "Other"
|
|
1183
|
+
}),
|
|
1184
|
+
/* @__PURE__ */ H(f, {
|
|
1185
|
+
className: "jqes4z3",
|
|
1186
|
+
htmlFor: `${w}-other`,
|
|
1187
|
+
children: "Other:"
|
|
1188
|
+
}),
|
|
1189
|
+
/* @__PURE__ */ H("div", {
|
|
1190
|
+
className: "jqes4z6",
|
|
1191
|
+
children: /* @__PURE__ */ H(k, {
|
|
1192
|
+
className: "jqes4z5",
|
|
1193
|
+
name: `radio-other-${w}`,
|
|
1194
|
+
value: r,
|
|
1195
|
+
onChange: (e) => {
|
|
1196
|
+
M?.(e?.target?.value), i(e.target.value);
|
|
1197
|
+
},
|
|
1198
|
+
disabled: !a,
|
|
1199
|
+
placeholder: "Please specify"
|
|
1200
|
+
})
|
|
1201
|
+
})
|
|
1202
|
+
]
|
|
1203
|
+
}), t[30] = C, t[31] = w, t[32] = M, t[33] = a, t[34] = r, t[35] = q) : q = t[35];
|
|
1204
|
+
let J;
|
|
1205
|
+
t[36] !== w || t[37] !== N || t[38] !== B || t[39] !== V || t[40] !== W || t[41] !== G || t[42] !== K || t[43] !== q ? (J = /* @__PURE__ */ U(hn, {
|
|
1206
|
+
id: w,
|
|
1207
|
+
className: B,
|
|
1208
|
+
onValueChange: V,
|
|
1209
|
+
onBlur: W,
|
|
1210
|
+
value: G,
|
|
1211
|
+
...N,
|
|
1212
|
+
children: [K, q]
|
|
1213
|
+
}), t[36] = w, t[37] = N, t[38] = B, t[39] = V, t[40] = W, t[41] = G, t[42] = K, t[43] = q, t[44] = J) : J = t[44];
|
|
1214
|
+
let Y;
|
|
1215
|
+
return t[45] !== I || t[46] !== v || t[47] !== F || t[48] !== _ || t[49] !== w || t[50] !== y || t[51] !== J ? (Y = /* @__PURE__ */ H(d, {
|
|
1216
|
+
error: I,
|
|
1217
|
+
helperText: v,
|
|
1218
|
+
readOnly: y,
|
|
1219
|
+
label: _,
|
|
1220
|
+
htmlFor: w,
|
|
1221
|
+
isRequired: F,
|
|
1222
|
+
children: J
|
|
1223
|
+
}), t[45] = I, t[46] = v, t[47] = F, t[48] = _, t[49] = w, t[50] = y, t[51] = J, t[52] = Y) : Y = t[52], Y;
|
|
1224
|
+
}, vn = "i9l98i0", yn = te({
|
|
1225
|
+
defaultClassName: "_193nrs70",
|
|
1226
|
+
variantClassNames: { size: {
|
|
1227
|
+
default: "_193nrs71",
|
|
1228
|
+
sm: "_193nrs72"
|
|
1229
|
+
} },
|
|
1230
|
+
defaultVariants: { size: "default" },
|
|
1231
|
+
compoundVariants: []
|
|
1232
|
+
}), bn = "_193nrs73", xn = "_193nrs74", Sn = "_193nrs75", Cn = (e) => {
|
|
1233
|
+
let t = Q(15), n, r, i;
|
|
1234
|
+
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({className: n, size: i, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
1235
|
+
let a = i === void 0 ? "default" : i, o;
|
|
1236
|
+
t[4] !== n || t[5] !== a ? (o = $(yn({ size: a }), n), t[4] = n, t[5] = a, t[6] = o) : o = t[6];
|
|
1237
|
+
let s = a === "sm" ? Sn : xn, c;
|
|
1238
|
+
t[7] === s ? c = t[8] : (c = $(bn, s), t[7] = s, t[8] = c);
|
|
1239
|
+
let l;
|
|
1240
|
+
t[9] === c ? l = t[10] : (l = /* @__PURE__ */ H(je.Thumb, {
|
|
1241
|
+
"data-slot": "switch-thumb",
|
|
1242
|
+
className: c
|
|
1243
|
+
}), t[9] = c, t[10] = l);
|
|
1244
|
+
let u;
|
|
1245
|
+
return t[11] !== r || t[12] !== o || t[13] !== l ? (u = /* @__PURE__ */ H(je.Root, {
|
|
1246
|
+
"data-slot": "switch",
|
|
1247
|
+
className: o,
|
|
1248
|
+
...r,
|
|
1249
|
+
children: l
|
|
1250
|
+
}), t[11] = r, t[12] = o, t[13] = l, t[14] = u) : u = t[14], u;
|
|
1251
|
+
}, wn = (e) => {
|
|
1252
|
+
let t = Q(32), { field: n } = e, { key: r, label: i, helper_text: a, readonly: o } = n, c = r === void 0 ? "" : r, l = i === void 0 ? "" : i, f = a === void 0 ? "" : a, p = o === void 0 ? !1 : o, m = c, h;
|
|
1253
|
+
t[0] === n ? h = t[1] : (h = s(n), t[0] = n, t[1] = h);
|
|
1254
|
+
let g;
|
|
1255
|
+
t[2] !== m || t[3] !== h ? (g = {
|
|
1256
|
+
name: m,
|
|
1257
|
+
rules: h
|
|
1258
|
+
}, t[2] = m, t[3] = h, t[4] = g) : g = t[4];
|
|
1259
|
+
let { field: _, fieldState: v } = be(g), y, b, x, S;
|
|
1260
|
+
t[5] === _ ? (y = t[6], b = t[7], x = t[8], S = t[9]) : ({value: S, onBlur: y, onChange: b, ...x} = _, t[5] = _, t[6] = y, t[7] = b, t[8] = x, t[9] = S);
|
|
1261
|
+
let C = !!n?.required, w = v?.error?.message, T = !!S, E;
|
|
1262
|
+
t[10] === b ? E = t[11] : (E = (e) => b?.(e), t[10] = b, t[11] = E);
|
|
1263
|
+
let D;
|
|
1264
|
+
t[12] === y ? D = t[13] : (D = () => y?.(), t[12] = y, t[13] = D);
|
|
1265
|
+
let O;
|
|
1266
|
+
t[14] !== m || t[15] !== x || t[16] !== D || t[17] !== T || t[18] !== E ? (O = /* @__PURE__ */ H(Cn, {
|
|
1267
|
+
id: m,
|
|
1268
|
+
checked: T,
|
|
1269
|
+
onCheckedChange: E,
|
|
1270
|
+
onBlur: D,
|
|
1271
|
+
...x
|
|
1272
|
+
}), t[14] = m, t[15] = x, t[16] = D, t[17] = T, t[18] = E, t[19] = O) : O = t[19];
|
|
1273
|
+
let k;
|
|
1274
|
+
t[20] !== C || t[21] !== l || t[22] !== m ? (k = /* @__PURE__ */ H(u, {
|
|
1275
|
+
label: l,
|
|
1276
|
+
isRequired: C,
|
|
1277
|
+
htmlFor: m
|
|
1278
|
+
}), t[20] = C, t[21] = l, t[22] = m, t[23] = k) : k = t[23];
|
|
1279
|
+
let A;
|
|
1280
|
+
t[24] !== O || t[25] !== k ? (A = /* @__PURE__ */ U("div", {
|
|
1281
|
+
className: vn,
|
|
1282
|
+
children: [O, k]
|
|
1283
|
+
}), t[24] = O, t[25] = k, t[26] = A) : A = t[26];
|
|
1284
|
+
let j;
|
|
1285
|
+
return t[27] !== w || t[28] !== f || t[29] !== p || t[30] !== A ? (j = /* @__PURE__ */ H(d, {
|
|
1286
|
+
error: w,
|
|
1287
|
+
helperText: f,
|
|
1288
|
+
readOnly: p,
|
|
1289
|
+
children: A
|
|
1290
|
+
}), t[27] = w, t[28] = f, t[29] = p, t[30] = A, t[31] = j) : j = t[31], j;
|
|
1291
|
+
}, Tn = "gaaqp00", En = (e) => {
|
|
1292
|
+
let t = Q(29), { field: n } = e, { key: r, label: i, helper_text: a, readonly: o } = n, c = r === void 0 ? "" : r, l = i === void 0 ? "" : i, u = a === void 0 ? "" : a, f = o === void 0 ? !1 : o, p = c, m = !!n?.required, h;
|
|
1293
|
+
t[0] === n ? h = t[1] : (h = s(n), t[0] = n, t[1] = h);
|
|
1294
|
+
let g;
|
|
1295
|
+
t[2] !== p || t[3] !== h ? (g = {
|
|
1296
|
+
name: p,
|
|
1297
|
+
rules: h
|
|
1298
|
+
}, t[2] = p, t[3] = h, t[4] = g) : g = t[4];
|
|
1299
|
+
let { field: _, fieldState: v } = be(g), y, b, x, S, C, w;
|
|
1300
|
+
t[5] === _ ? (y = t[6], b = t[7], x = t[8], S = t[9], C = t[10], w = t[11]) : ({value: w, onBlur: b, onChange: x, ref: S, disabled: y, ...C} = _, t[5] = _, t[6] = y, t[7] = b, t[8] = x, t[9] = S, t[10] = C, t[11] = w);
|
|
1301
|
+
let T = v?.error?.message, E;
|
|
1302
|
+
t[12] === Symbol.for("react.memo_cache_sentinel") ? (E = $(Tn), t[12] = E) : E = t[12];
|
|
1303
|
+
let O = w || "", k;
|
|
1304
|
+
t[13] !== y || t[14] !== p || t[15] !== b || t[16] !== x || t[17] !== f || t[18] !== S || t[19] !== C || t[20] !== O ? (k = /* @__PURE__ */ H(D, {
|
|
1305
|
+
id: p,
|
|
1306
|
+
className: E,
|
|
1307
|
+
readOnly: f,
|
|
1308
|
+
value: O,
|
|
1309
|
+
onChange: x,
|
|
1310
|
+
onBlur: b,
|
|
1311
|
+
ref: S,
|
|
1312
|
+
disabled: y,
|
|
1313
|
+
...C
|
|
1314
|
+
}), t[13] = y, t[14] = p, t[15] = b, t[16] = x, t[17] = f, t[18] = S, t[19] = C, t[20] = O, t[21] = k) : k = t[21];
|
|
1315
|
+
let A;
|
|
1316
|
+
return t[22] !== T || t[23] !== u || t[24] !== m || t[25] !== l || t[26] !== p || t[27] !== k ? (A = /* @__PURE__ */ H(d, {
|
|
1317
|
+
error: T,
|
|
1318
|
+
helperText: u,
|
|
1319
|
+
label: l,
|
|
1320
|
+
htmlFor: p,
|
|
1321
|
+
isRequired: m,
|
|
1322
|
+
children: k
|
|
1323
|
+
}), t[22] = T, t[23] = u, t[24] = m, t[25] = l, t[26] = p, t[27] = k, t[28] = A) : A = t[28], A;
|
|
1324
|
+
}, Dn = (e) => {
|
|
1325
|
+
let t = Q(36), n, r, i;
|
|
1326
|
+
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({field: n, inputStyles: i, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
1327
|
+
let { key: a, label: o, helper_text: c, readonly: l } = n, u = a === void 0 ? "" : a, f = o === void 0 ? "" : o, p = c === void 0 ? "" : c, m = l === void 0 ? !1 : l, h = u, g = !!n?.required, _;
|
|
1328
|
+
t[4] === n ? _ = t[5] : (_ = s(n), t[4] = n, t[5] = _);
|
|
1329
|
+
let v;
|
|
1330
|
+
t[6] !== h || t[7] !== _ ? (v = {
|
|
1331
|
+
name: h,
|
|
1332
|
+
rules: _
|
|
1333
|
+
}, t[6] = h, t[7] = _, t[8] = v) : v = t[8];
|
|
1334
|
+
let { field: y, fieldState: b } = be(v), x, S, C, w, T, E;
|
|
1335
|
+
t[9] === y ? (x = t[10], S = t[11], C = t[12], w = t[13], T = t[14], E = t[15]) : ({value: E, onBlur: S, onChange: C, ref: w, disabled: x, ...T} = y, t[9] = y, t[10] = x, t[11] = S, t[12] = C, t[13] = w, t[14] = T, t[15] = E);
|
|
1336
|
+
let D = b?.error?.message, O;
|
|
1337
|
+
t[16] === i ? O = t[17] : (O = $(i), t[16] = i, t[17] = O);
|
|
1338
|
+
let A = E || "", j;
|
|
1339
|
+
t[18] !== x || t[19] !== r || t[20] !== h || t[21] !== S || t[22] !== C || t[23] !== m || t[24] !== w || t[25] !== T || t[26] !== O || t[27] !== A ? (j = /* @__PURE__ */ H(k, {
|
|
1340
|
+
id: h,
|
|
1341
|
+
className: O,
|
|
1342
|
+
readOnly: m,
|
|
1343
|
+
value: A,
|
|
1344
|
+
onChange: C,
|
|
1345
|
+
onBlur: S,
|
|
1346
|
+
ref: w,
|
|
1347
|
+
disabled: x,
|
|
1348
|
+
...T,
|
|
1349
|
+
...r
|
|
1350
|
+
}), t[18] = x, t[19] = r, t[20] = h, t[21] = S, t[22] = C, t[23] = m, t[24] = w, t[25] = T, t[26] = O, t[27] = A, t[28] = j) : j = t[28];
|
|
1351
|
+
let M;
|
|
1352
|
+
return t[29] !== D || t[30] !== p || t[31] !== g || t[32] !== f || t[33] !== h || t[34] !== j ? (M = /* @__PURE__ */ H(d, {
|
|
1353
|
+
error: D,
|
|
1354
|
+
helperText: p,
|
|
1355
|
+
label: f,
|
|
1356
|
+
htmlFor: h,
|
|
1357
|
+
isRequired: g,
|
|
1358
|
+
children: j
|
|
1359
|
+
}), t[29] = D, t[30] = p, t[31] = g, t[32] = f, t[33] = h, t[34] = j, t[35] = M) : M = t[35], M;
|
|
1360
|
+
}, On = (e) => {
|
|
1361
|
+
let t = Q(27), { field: n } = e, { key: r, label: i, helper_text: a, readonly: o } = n, c = r === void 0 ? "" : r, l = i === void 0 ? "" : i, u = a === void 0 ? "" : a, f = o === void 0 ? !1 : o, p = c, m;
|
|
1362
|
+
t[0] === n ? m = t[1] : (m = s(n), t[0] = n, t[1] = m);
|
|
1363
|
+
let h;
|
|
1364
|
+
t[2] !== p || t[3] !== m ? (h = {
|
|
1365
|
+
name: p,
|
|
1366
|
+
rules: m
|
|
1367
|
+
}, t[2] = p, t[3] = m, t[4] = h) : h = t[4];
|
|
1368
|
+
let { field: g, fieldState: _ } = be(h), { value: v, onBlur: y, onChange: b, ref: x } = g, S = !!n?.required, C = _?.error?.message, w = v || "", T;
|
|
1369
|
+
t[5] === b ? T = t[6] : (T = (e) => b(e.target.value || null), t[5] = b, t[6] = T);
|
|
1370
|
+
let E;
|
|
1371
|
+
t[7] !== b || t[8] !== f || t[9] !== v ? (E = v && !f ? /* @__PURE__ */ H("button", {
|
|
1372
|
+
type: "button",
|
|
1373
|
+
onClick: (e) => {
|
|
1374
|
+
e.preventDefault(), e.stopPropagation(), b(null);
|
|
1375
|
+
},
|
|
1376
|
+
style: {
|
|
1377
|
+
background: "none",
|
|
1378
|
+
border: "none",
|
|
1379
|
+
cursor: "pointer",
|
|
1380
|
+
display: "flex",
|
|
1381
|
+
padding: 0
|
|
1382
|
+
},
|
|
1383
|
+
"aria-label": "Clear time",
|
|
1384
|
+
children: /* @__PURE__ */ H(ge, { size: 16 })
|
|
1385
|
+
}) : void 0, t[7] = b, t[8] = f, t[9] = v, t[10] = E) : E = t[10];
|
|
1386
|
+
let D;
|
|
1387
|
+
t[11] !== p || t[12] !== y || t[13] !== f || t[14] !== x || t[15] !== E || t[16] !== w || t[17] !== T ? (D = /* @__PURE__ */ H(k, {
|
|
1388
|
+
id: p,
|
|
1389
|
+
ref: x,
|
|
1390
|
+
type: "time",
|
|
1391
|
+
value: w,
|
|
1392
|
+
onChange: T,
|
|
1393
|
+
onBlur: y,
|
|
1394
|
+
readOnly: f,
|
|
1395
|
+
rightIcon: E
|
|
1396
|
+
}), t[11] = p, t[12] = y, t[13] = f, t[14] = x, t[15] = E, t[16] = w, t[17] = T, t[18] = D) : D = t[18];
|
|
1397
|
+
let O;
|
|
1398
|
+
return t[19] !== C || t[20] !== u || t[21] !== S || t[22] !== l || t[23] !== p || t[24] !== f || t[25] !== D ? (O = /* @__PURE__ */ H(d, {
|
|
1399
|
+
helperText: u,
|
|
1400
|
+
readOnly: f,
|
|
1401
|
+
error: C,
|
|
1402
|
+
htmlFor: p,
|
|
1403
|
+
isRequired: S,
|
|
1404
|
+
label: l,
|
|
1405
|
+
children: D
|
|
1406
|
+
}), t[19] = C, t[20] = u, t[21] = S, t[22] = l, t[23] = p, t[24] = f, t[25] = D, t[26] = O) : O = t[26], O;
|
|
1407
|
+
}, kn = "_3j2y9l0", An = (e) => {
|
|
1408
|
+
let t = Q(28), { field: n } = e, { key: r, label: i, helper_text: a, readonly: o } = n, c = r === void 0 ? "" : r, l = i === void 0 ? "" : i, u = a === void 0 ? "" : a, p = o === void 0 ? !1 : o, m;
|
|
1409
|
+
t[0] === n ? m = t[1] : (m = s(n), t[0] = n, t[1] = m);
|
|
1410
|
+
let h;
|
|
1411
|
+
t[2] !== c || t[3] !== m ? (h = {
|
|
1412
|
+
name: c,
|
|
1413
|
+
rules: m
|
|
1414
|
+
}, t[2] = c, t[3] = m, t[4] = h) : h = t[4];
|
|
1415
|
+
let { field: g, fieldState: _ } = be(h), { name: v, onBlur: y, onChange: b, ref: x, value: S, disabled: C } = g, { error: w } = _, T = w?.message, E = !!S, D;
|
|
1416
|
+
t[5] === b ? D = t[6] : (D = (e) => b(e), t[5] = b, t[6] = D);
|
|
1417
|
+
let O;
|
|
1418
|
+
t[7] === y ? O = t[8] : (O = () => y(), t[7] = y, t[8] = O);
|
|
1419
|
+
let k;
|
|
1420
|
+
t[9] !== C || t[10] !== v || t[11] !== E || t[12] !== D || t[13] !== O ? (k = /* @__PURE__ */ H(Lt, {
|
|
1421
|
+
id: v,
|
|
1422
|
+
name: v,
|
|
1423
|
+
checked: E,
|
|
1424
|
+
onCheckedChange: D,
|
|
1425
|
+
onBlur: O,
|
|
1426
|
+
disabled: C
|
|
1427
|
+
}), t[9] = C, t[10] = v, t[11] = E, t[12] = D, t[13] = O, t[14] = k) : k = t[14];
|
|
1428
|
+
let A;
|
|
1429
|
+
t[15] !== n.required || t[16] !== l || t[17] !== v ? (A = l && /* @__PURE__ */ U(f, {
|
|
1430
|
+
htmlFor: v,
|
|
1431
|
+
className: "_3j2y9l1",
|
|
1432
|
+
children: [l, n?.required && /* @__PURE__ */ H("span", {
|
|
1433
|
+
className: "_1ompjs10",
|
|
1434
|
+
children: "*"
|
|
1435
|
+
})]
|
|
1436
|
+
}), t[15] = n.required, t[16] = l, t[17] = v, t[18] = A) : A = t[18];
|
|
1437
|
+
let j;
|
|
1438
|
+
t[19] !== x || t[20] !== k || t[21] !== A ? (j = /* @__PURE__ */ U("div", {
|
|
1439
|
+
className: kn,
|
|
1440
|
+
ref: x,
|
|
1441
|
+
children: [k, A]
|
|
1442
|
+
}), t[19] = x, t[20] = k, t[21] = A, t[22] = j) : j = t[22];
|
|
1443
|
+
let M;
|
|
1444
|
+
return t[23] !== u || t[24] !== p || t[25] !== j || t[26] !== T ? (M = /* @__PURE__ */ H(d, {
|
|
1445
|
+
error: T,
|
|
1446
|
+
helperText: u,
|
|
1447
|
+
readOnly: p,
|
|
1448
|
+
children: j
|
|
1449
|
+
}), t[23] = u, t[24] = p, t[25] = j, t[26] = T, t[27] = M) : M = t[27], M;
|
|
1450
|
+
}, jn = "_11lzwkh0", Mn = "_11lzwkh2", Nn = "_11lzwkh3", Pn = "_11lzwkh4", Fn = "_11lzwkh5", In = "_11lzwkh9", Ln = "_11lzwkha", Rn = (e) => {
|
|
1451
|
+
let t = Q(31), { file: n, onDelete: r, onClick: i, showCheckbox: a, isSelected: s, showDelete: c } = e, l = a === void 0 ? !1 : a, u = s === void 0 ? !1 : s, d = c === void 0 ? !0 : c, f;
|
|
1452
|
+
t[0] !== n || t[1] !== r ? (f = (e) => {
|
|
1453
|
+
e.stopPropagation(), e.preventDefault(), r?.(n.id);
|
|
1454
|
+
}, t[0] = n, t[1] = r, t[2] = f) : f = t[2];
|
|
1455
|
+
let p = f, m;
|
|
1456
|
+
t[3] !== n || t[4] !== i ? (m = (e) => {
|
|
1457
|
+
if (i) {
|
|
1458
|
+
e.preventDefault(), i(n);
|
|
1459
|
+
return;
|
|
1460
|
+
}
|
|
1461
|
+
n?.location || e.preventDefault();
|
|
1462
|
+
}, t[3] = n, t[4] = i, t[5] = m) : m = t[5];
|
|
1463
|
+
let h = m, g;
|
|
1464
|
+
t[6] !== n?.filename || t[7] !== n?.location ? (g = n?.filename || n?.location?.split("/")?.[n?.location?.split("/").length - 1], t[6] = n?.filename, t[7] = n?.location, t[8] = g) : g = t[8];
|
|
1465
|
+
let _ = g, v = n?.location || void 0, y = u && "_11lzwkh1", b;
|
|
1466
|
+
t[9] === y ? b = t[10] : (b = $(jn, y), t[9] = y, t[10] = b);
|
|
1467
|
+
let x;
|
|
1468
|
+
t[11] !== n?.kind || t[12] !== n?.location ? (x = n?.kind === "image" ? /* @__PURE__ */ H("img", {
|
|
1469
|
+
alt: "uploaded-file-icon",
|
|
1470
|
+
className: Pn,
|
|
1471
|
+
src: n?.location
|
|
1472
|
+
}) : /* @__PURE__ */ H("div", {
|
|
1473
|
+
className: Mn,
|
|
1474
|
+
children: /* @__PURE__ */ H(le, {
|
|
1475
|
+
size: 60,
|
|
1476
|
+
className: Nn
|
|
1477
|
+
})
|
|
1478
|
+
}), t[11] = n?.kind, t[12] = n?.location, t[13] = x) : x = t[13];
|
|
1479
|
+
let S;
|
|
1480
|
+
t[14] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ H("div", { className: Fn }), t[14] = S) : S = t[14];
|
|
1481
|
+
let C;
|
|
1482
|
+
t[15] !== u || t[16] !== l ? (C = l && /* @__PURE__ */ H("div", {
|
|
1483
|
+
className: "_11lzwkh8",
|
|
1484
|
+
onClick: zn,
|
|
1485
|
+
children: /* @__PURE__ */ H(Lt, { checked: u })
|
|
1486
|
+
}), t[15] = u, t[16] = l, t[17] = C) : C = t[17];
|
|
1487
|
+
let w;
|
|
1488
|
+
t[18] !== p || t[19] !== d ? (w = d && /* @__PURE__ */ H(o, {
|
|
1489
|
+
className: "_11lzwkh6",
|
|
1490
|
+
size: "sm",
|
|
1491
|
+
variant: "secondary",
|
|
1492
|
+
onClick: p,
|
|
1493
|
+
children: /* @__PURE__ */ H(ge, { className: "_11lzwkh7" })
|
|
1494
|
+
}), t[18] = p, t[19] = d, t[20] = w) : w = t[20];
|
|
1495
|
+
let T;
|
|
1496
|
+
t[21] === _ ? T = t[22] : (T = /* @__PURE__ */ H("div", {
|
|
1497
|
+
className: In,
|
|
1498
|
+
children: /* @__PURE__ */ H("p", {
|
|
1499
|
+
className: Ln,
|
|
1500
|
+
children: _
|
|
1501
|
+
})
|
|
1502
|
+
}), t[21] = _, t[22] = T);
|
|
1503
|
+
let E;
|
|
1504
|
+
return t[23] !== h || t[24] !== x || t[25] !== C || t[26] !== w || t[27] !== T || t[28] !== v || t[29] !== b ? (E = /* @__PURE__ */ U("a", {
|
|
1505
|
+
href: v,
|
|
1506
|
+
target: "_blank",
|
|
1507
|
+
rel: "noopener noreferrer",
|
|
1508
|
+
className: b,
|
|
1509
|
+
onClick: h,
|
|
1510
|
+
children: [
|
|
1511
|
+
x,
|
|
1512
|
+
S,
|
|
1513
|
+
C,
|
|
1514
|
+
w,
|
|
1515
|
+
T
|
|
1516
|
+
]
|
|
1517
|
+
}), t[23] = h, t[24] = x, t[25] = C, t[26] = w, t[27] = T, t[28] = v, t[29] = b, t[30] = E) : E = t[30], E;
|
|
1518
|
+
};
|
|
1519
|
+
function zn(e) {
|
|
1520
|
+
e.preventDefault(), e.stopPropagation();
|
|
1521
|
+
}
|
|
1522
|
+
//#endregion
|
|
1523
|
+
//#region ../../libraries/react-collection/dist/widgets/uploadWidget/modal/FileUploadModal.cssm.js
|
|
1524
|
+
var Bn = "vwpjhx0", Vn = "vwpjhx1", Hn = "vwpjhx2", Un = "vwpjhx5", Wn = "vwpjhx6", Gn = "vwpjhxb", Kn = (e) => {
|
|
1525
|
+
let t = Q(56), { isOpen: n, setIsOpen: r, files: i, kind: a, allowedExtensions: s, isMultiple: c, isLoading: l, handleUploadFiles: u, handleChange: d } = e, f;
|
|
1526
|
+
t[0] === r ? f = t[1] : (f = () => r(!1), t[0] = r, t[1] = f);
|
|
1527
|
+
let p = f, m = i.length, h;
|
|
1528
|
+
bb0: {
|
|
1529
|
+
let e;
|
|
1530
|
+
if (t[2] !== s || t[3] !== a) {
|
|
1531
|
+
let n = a.reduce(qn, {});
|
|
1532
|
+
if (!s || s.length === 0) {
|
|
1533
|
+
h = n;
|
|
1534
|
+
break bb0;
|
|
1535
|
+
}
|
|
1536
|
+
let r = s.map(Jn);
|
|
1537
|
+
e = {};
|
|
1538
|
+
for (let [t, i] of Object.entries(n)) {
|
|
1539
|
+
let n = i.filter((e) => r.includes(e));
|
|
1540
|
+
n.length > 0 && (e[t] = n);
|
|
1541
|
+
}
|
|
1542
|
+
t[2] = s, t[3] = a, t[4] = e, t[5] = h;
|
|
1543
|
+
} else e = t[4], h = t[5];
|
|
1544
|
+
h = e;
|
|
1545
|
+
}
|
|
1546
|
+
let g = h, _;
|
|
1547
|
+
t[6] === u ? _ = t[7] : (_ = (e) => {
|
|
1548
|
+
if (e.length === 0) {
|
|
1549
|
+
Y("No file selected. Please select one file.");
|
|
1550
|
+
return;
|
|
1551
|
+
}
|
|
1552
|
+
u(e);
|
|
1553
|
+
}, t[6] = u, t[7] = _);
|
|
1554
|
+
let v = _, y;
|
|
1555
|
+
t[8] !== g || t[9] !== l || t[10] !== c || t[11] !== v ? (y = {
|
|
1556
|
+
onDrop: v,
|
|
1557
|
+
accept: g,
|
|
1558
|
+
multiple: c,
|
|
1559
|
+
maxSize: 26214400,
|
|
1560
|
+
disabled: l,
|
|
1561
|
+
onDropRejected: Xn
|
|
1562
|
+
}, t[8] = g, t[9] = l, t[10] = c, t[11] = v, t[12] = y) : y = t[12];
|
|
1563
|
+
let { getRootProps: E, getInputProps: D, isDragActive: O } = Me(y), k = a?.length > 1 ? "Upload file" : `Upload ${a?.[0]}`, A;
|
|
1564
|
+
t[13] === k ? A = t[14] : (A = /* @__PURE__ */ H(S, { children: /* @__PURE__ */ H(x, { children: k }) }), t[13] = k, t[14] = A);
|
|
1565
|
+
let j = l && "vwpjhx3", M;
|
|
1566
|
+
t[15] === j ? M = t[16] : (M = $(Hn, j), t[15] = j, t[16] = M);
|
|
1567
|
+
let N;
|
|
1568
|
+
t[17] === E ? N = t[18] : (N = E(), t[17] = E, t[18] = N);
|
|
1569
|
+
let P;
|
|
1570
|
+
t[19] === l ? P = t[20] : (P = l && /* @__PURE__ */ H("div", {
|
|
1571
|
+
className: "vwpjhx4",
|
|
1572
|
+
children: /* @__PURE__ */ H(T, {})
|
|
1573
|
+
}), t[19] = l, t[20] = P);
|
|
1574
|
+
let F = O ? "Drop your files here..." : c && i.length > 0 ? "Drag & Drop here to upload more!" : i?.length > 0 ? "Drag & Drop here to upload another file!" : "Drag & Drop here to upload file!", I;
|
|
1575
|
+
t[21] === F ? I = t[22] : (I = /* @__PURE__ */ H("p", {
|
|
1576
|
+
className: Un,
|
|
1577
|
+
children: F
|
|
1578
|
+
}), t[21] = F, t[22] = I);
|
|
1579
|
+
let L = l && "vwpjhx7", R;
|
|
1580
|
+
t[23] === L ? R = t[24] : (R = $(Wn, L), t[23] = L, t[24] = R);
|
|
1581
|
+
let z;
|
|
1582
|
+
t[25] === D ? z = t[26] : (z = D(), t[25] = D, t[26] = z);
|
|
1583
|
+
let B;
|
|
1584
|
+
t[27] === z ? B = t[28] : (B = /* @__PURE__ */ H("input", { ...z }), t[27] = z, t[28] = B);
|
|
1585
|
+
let V;
|
|
1586
|
+
t[29] === Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ H(he, { size: 14 }), t[29] = V) : V = t[29];
|
|
1587
|
+
let W;
|
|
1588
|
+
t[30] === B ? W = t[31] : (W = /* @__PURE__ */ U(o, {
|
|
1589
|
+
variant: "ghost",
|
|
1590
|
+
size: "sm",
|
|
1591
|
+
children: [
|
|
1592
|
+
B,
|
|
1593
|
+
V,
|
|
1594
|
+
"Click to upload"
|
|
1595
|
+
]
|
|
1596
|
+
}), t[30] = B, t[31] = W);
|
|
1597
|
+
let G;
|
|
1598
|
+
t[32] !== R || t[33] !== W ? (G = /* @__PURE__ */ H("div", {
|
|
1599
|
+
className: R,
|
|
1600
|
+
children: W
|
|
1601
|
+
}), t[32] = R, t[33] = W, t[34] = G) : G = t[34];
|
|
1602
|
+
let K;
|
|
1603
|
+
t[35] !== P || t[36] !== I || t[37] !== G || t[38] !== M || t[39] !== N ? (K = /* @__PURE__ */ H("div", {
|
|
1604
|
+
className: Vn,
|
|
1605
|
+
children: /* @__PURE__ */ U("div", {
|
|
1606
|
+
className: M,
|
|
1607
|
+
...N,
|
|
1608
|
+
children: [
|
|
1609
|
+
P,
|
|
1610
|
+
I,
|
|
1611
|
+
G
|
|
1612
|
+
]
|
|
1613
|
+
})
|
|
1614
|
+
}), t[35] = P, t[36] = I, t[37] = G, t[38] = M, t[39] = N, t[40] = K) : K = t[40];
|
|
1615
|
+
let q;
|
|
1616
|
+
t[41] !== i || t[42] !== d ? (q = i.length > 0 && /* @__PURE__ */ U("div", {
|
|
1617
|
+
className: "vwpjhx8",
|
|
1618
|
+
children: [/* @__PURE__ */ H("h3", {
|
|
1619
|
+
className: "vwpjhx9",
|
|
1620
|
+
children: "Selected Files"
|
|
1621
|
+
}), /* @__PURE__ */ H("div", {
|
|
1622
|
+
className: "vwpjhxa",
|
|
1623
|
+
children: i.map((e) => /* @__PURE__ */ H(Rn, {
|
|
1624
|
+
file: e,
|
|
1625
|
+
onDelete: (e) => {
|
|
1626
|
+
d(i.filter((t) => t.id !== e));
|
|
1627
|
+
}
|
|
1628
|
+
}, e.id))
|
|
1629
|
+
})]
|
|
1630
|
+
}), t[41] = i, t[42] = d, t[43] = q) : q = t[43];
|
|
1631
|
+
let J = m === 1 ? `${m} file` : `${m} files`, X;
|
|
1632
|
+
t[44] !== p || t[45] !== J ? (X = /* @__PURE__ */ H("div", {
|
|
1633
|
+
className: Gn,
|
|
1634
|
+
children: /* @__PURE__ */ H(b, { children: /* @__PURE__ */ U(o, {
|
|
1635
|
+
variant: "default",
|
|
1636
|
+
onClick: p,
|
|
1637
|
+
children: ["Save\xA0", J]
|
|
1638
|
+
}) })
|
|
1639
|
+
}), t[44] = p, t[45] = J, t[46] = X) : X = t[46];
|
|
1640
|
+
let ee;
|
|
1641
|
+
t[47] !== K || t[48] !== q || t[49] !== X || t[50] !== A ? (ee = /* @__PURE__ */ U(w, {
|
|
1642
|
+
className: Bn,
|
|
1643
|
+
children: [
|
|
1644
|
+
A,
|
|
1645
|
+
K,
|
|
1646
|
+
q,
|
|
1647
|
+
X
|
|
1648
|
+
]
|
|
1649
|
+
}), t[47] = K, t[48] = q, t[49] = X, t[50] = A, t[51] = ee) : ee = t[51];
|
|
1650
|
+
let Z;
|
|
1651
|
+
return t[52] !== n || t[53] !== r || t[54] !== ee ? (Z = /* @__PURE__ */ H(C, {
|
|
1652
|
+
open: n,
|
|
1653
|
+
onOpenChange: r,
|
|
1654
|
+
children: ee
|
|
1655
|
+
}), t[52] = n, t[53] = r, t[54] = ee, t[55] = Z) : Z = t[55], Z;
|
|
1656
|
+
};
|
|
1657
|
+
function qn(e, t) {
|
|
1658
|
+
return {
|
|
1659
|
+
...e,
|
|
1660
|
+
...X[t]
|
|
1661
|
+
};
|
|
1662
|
+
}
|
|
1663
|
+
function Jn(e) {
|
|
1664
|
+
return `.${e}`;
|
|
1665
|
+
}
|
|
1666
|
+
function Yn(e) {
|
|
1667
|
+
e.errors.forEach((t) => {
|
|
1668
|
+
t.code === "file-too-large" && Y(`${e.file.name} is bigger than 25MB`);
|
|
1669
|
+
});
|
|
1670
|
+
}
|
|
1671
|
+
function Xn(e) {
|
|
1672
|
+
e.forEach(Yn);
|
|
1673
|
+
}
|
|
1674
|
+
//#endregion
|
|
1675
|
+
//#region ../../libraries/react-collection/dist/widgets/uploadWidget/UploadWidget.cssm.js
|
|
1676
|
+
var Zn = "_156u72w0", Qn = "_156u72w1", $n = (e) => Array.isArray(e) && e.every((e) => typeof e == "object" && !!e && "location" in e), er = ({ field: e, schema: t, kind: n = K, isMultiple: r, uploadContext: i }) => {
|
|
1677
|
+
let a = e.options?.allowed_upload_types, c = a && a.length > 0 ? n.filter((e) => a.includes(e)) : null, l = c && c.length > 0 ? c : n, [u, f] = B(!1), [p, m] = B(!1), { media: h } = Z(), { field: { onChange: g, value: v, onBlur: y, disabled: b, ref: x }, fieldState: S } = be({
|
|
1678
|
+
name: e?.key || "",
|
|
1679
|
+
rules: s(e)
|
|
1680
|
+
}), C = e.options?.allowed_extensions, w = R(() => {
|
|
1681
|
+
let e = l.flatMap((e) => _[e]);
|
|
1682
|
+
return C && C.length > 0 ? e.filter((e) => C.includes(e)) : e;
|
|
1683
|
+
}, [l, C]), E = Array.isArray(v) ? v : v ? [v] : [], D = i ?? (t?.key ? {
|
|
1684
|
+
module: "collection",
|
|
1685
|
+
identifier: t.key
|
|
1686
|
+
} : void 0), O = D ? {
|
|
1687
|
+
...D,
|
|
1688
|
+
field_key: e.key || void 0,
|
|
1689
|
+
field_label: e.label || void 0
|
|
1690
|
+
} : void 0, A = (e) => {
|
|
1691
|
+
g(r ? e : e?.[0]);
|
|
1692
|
+
}, j = async (e) => {
|
|
1693
|
+
let t = new FormData(), n = r ? e : e.slice(0, 1);
|
|
1694
|
+
if (n.length !== 0) {
|
|
1695
|
+
n.forEach((e) => {
|
|
1696
|
+
let n = e.name.split(".").pop()?.toLowerCase();
|
|
1697
|
+
n && w.includes(n) && t.append("media", e);
|
|
1698
|
+
}), m(!0);
|
|
1699
|
+
try {
|
|
1700
|
+
let e = await h?.mediaBulkUpload(t, {}, O);
|
|
1701
|
+
if (e?.content?.data && $n(e.content.data)) {
|
|
1702
|
+
let t = e.content.data;
|
|
1703
|
+
A(r ? [...E, ...t] : t);
|
|
1704
|
+
}
|
|
1705
|
+
} catch (e) {
|
|
1706
|
+
J(e);
|
|
1707
|
+
} finally {
|
|
1708
|
+
m(!1);
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
}, { label: M = "", helper_text: N = "", readonly: P = !1 } = e;
|
|
1712
|
+
return /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ U(d, {
|
|
1713
|
+
error: S?.error?.message,
|
|
1714
|
+
helperText: N,
|
|
1715
|
+
readOnly: P,
|
|
1716
|
+
htmlFor: e.key,
|
|
1717
|
+
isRequired: e?.required,
|
|
1718
|
+
label: M,
|
|
1719
|
+
children: [/* @__PURE__ */ U("div", {
|
|
1720
|
+
className: Zn,
|
|
1721
|
+
ref: x,
|
|
1722
|
+
children: [/* @__PURE__ */ H(o, {
|
|
1723
|
+
size: "icon",
|
|
1724
|
+
variant: "outline",
|
|
1725
|
+
disabled: b || P,
|
|
1726
|
+
onClick: () => f(!0),
|
|
1727
|
+
className: Qn,
|
|
1728
|
+
children: /* @__PURE__ */ H(he, { size: 15 })
|
|
1729
|
+
}), /* @__PURE__ */ H(k, {
|
|
1730
|
+
name: "pasteUrl",
|
|
1731
|
+
placeholder: "Paste your files here...",
|
|
1732
|
+
onBlur: () => y(),
|
|
1733
|
+
onPaste: (e) => {
|
|
1734
|
+
let t = [];
|
|
1735
|
+
Array.from(e.clipboardData.items).forEach((e) => {
|
|
1736
|
+
if (e?.kind === "file") {
|
|
1737
|
+
let n = e?.getAsFile();
|
|
1738
|
+
n && t.push(n);
|
|
1739
|
+
}
|
|
1740
|
+
}), t.length > 0 && j(t);
|
|
1741
|
+
},
|
|
1742
|
+
disabled: b,
|
|
1743
|
+
readOnly: P,
|
|
1744
|
+
rightIcon: p ? /* @__PURE__ */ H(T, { size: 16 }) : void 0
|
|
1745
|
+
})]
|
|
1746
|
+
}), E.length > 0 && /* @__PURE__ */ H("div", {
|
|
1747
|
+
className: "_156u72w2",
|
|
1748
|
+
children: /* @__PURE__ */ H("div", {
|
|
1749
|
+
className: "_156u72w3",
|
|
1750
|
+
children: E.map((e) => /* @__PURE__ */ H(Rn, {
|
|
1751
|
+
file: e,
|
|
1752
|
+
onDelete: (e) => {
|
|
1753
|
+
A(E.filter((t) => t.id !== e));
|
|
1754
|
+
}
|
|
1755
|
+
}, e.id))
|
|
1756
|
+
})
|
|
1757
|
+
})]
|
|
1758
|
+
}), /* @__PURE__ */ H(Kn, {
|
|
1759
|
+
isOpen: u,
|
|
1760
|
+
setIsOpen: f,
|
|
1761
|
+
files: E,
|
|
1762
|
+
kind: l,
|
|
1763
|
+
allowedExtensions: C,
|
|
1764
|
+
isMultiple: r,
|
|
1765
|
+
isLoading: p,
|
|
1766
|
+
handleUploadFiles: j,
|
|
1767
|
+
handleChange: A
|
|
1768
|
+
})] });
|
|
1769
|
+
}, tr = (e) => {
|
|
1770
|
+
let t = Q(3), n;
|
|
1771
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ H(ue, { size: 20 }), t[0] = n) : n = t[0];
|
|
1772
|
+
let r;
|
|
1773
|
+
return t[1] === e ? r = t[2] : (r = /* @__PURE__ */ H(Dn, {
|
|
1774
|
+
leftIcon: n,
|
|
1775
|
+
...e
|
|
1776
|
+
}), t[1] = e, t[2] = r), r;
|
|
1777
|
+
}, nr = P(() => import("./DateTimeWidget-IRleQI-3.js")), rr = P(() => import("./PhoneWidget-CjhHfwuG.js")), ir = P(() => import("./RichTextWidget-CgT1_zC3.js")), ar = {
|
|
1778
|
+
TextWidget: y((e) => /* @__PURE__ */ H(Dn, { ...e })),
|
|
1779
|
+
NumberWidget: y((e) => /* @__PURE__ */ H(Dn, {
|
|
1780
|
+
type: "number",
|
|
1781
|
+
step: "any",
|
|
1782
|
+
...e
|
|
1783
|
+
})),
|
|
1784
|
+
CurrencyWidget: y((e) => /* @__PURE__ */ H(zt, { ...e })),
|
|
1785
|
+
MultiTextWidget: y((e) => /* @__PURE__ */ H(sn, { ...e })),
|
|
1786
|
+
TextareaWidget: y((e) => /* @__PURE__ */ H(En, { ...e })),
|
|
1787
|
+
RichTextWidget: y((e) => /* @__PURE__ */ H(ir, { ...e })),
|
|
1788
|
+
EmailWidget: y((e) => /* @__PURE__ */ H(Gt, { ...e })),
|
|
1789
|
+
PhoneWidget: y((e) => /* @__PURE__ */ H(rr, { ...e })),
|
|
1790
|
+
URLWidget: y((e) => /* @__PURE__ */ H(tr, { ...e })),
|
|
1791
|
+
DropdownWidget: y((e) => /* @__PURE__ */ H(Vt, {
|
|
1792
|
+
isMulti: !1,
|
|
1793
|
+
...e
|
|
1794
|
+
})),
|
|
1795
|
+
MultiDropdownWidget: y((e) => /* @__PURE__ */ H(Vt, {
|
|
1796
|
+
isMulti: !0,
|
|
1797
|
+
...e
|
|
1798
|
+
})),
|
|
1799
|
+
RadioWidget: y((e) => /* @__PURE__ */ H(_n, { ...e })),
|
|
1800
|
+
CheckboxWidget: y((e) => /* @__PURE__ */ H(Rt, { ...e })),
|
|
1801
|
+
ToggleCheckboxWidget: y((e) => /* @__PURE__ */ H(An, { ...e })),
|
|
1802
|
+
SwitchWidget: y((e) => /* @__PURE__ */ H(wn, { ...e })),
|
|
1803
|
+
DateTimeWidget: y((e) => /* @__PURE__ */ H(nr, { ...e })),
|
|
1804
|
+
DateWidget: y((e) => /* @__PURE__ */ H(nr, { ...e })),
|
|
1805
|
+
TimeWidget: y((e) => /* @__PURE__ */ H(On, { ...e })),
|
|
1806
|
+
GeocoderWidget: y((e) => /* @__PURE__ */ H(qt, { ...e })),
|
|
1807
|
+
MultiGeocoderWidget: y((e) => /* @__PURE__ */ H(en, { ...e })),
|
|
1808
|
+
ImageUploadWidget: y((e) => /* @__PURE__ */ H(er, {
|
|
1809
|
+
kind: ["image"],
|
|
1810
|
+
isMultiple: !1,
|
|
1811
|
+
...e
|
|
1812
|
+
})),
|
|
1813
|
+
MultiImageUploadWidget: y((e) => /* @__PURE__ */ H(er, {
|
|
1814
|
+
kind: ["image"],
|
|
1815
|
+
isMultiple: !0,
|
|
1816
|
+
...e
|
|
1817
|
+
})),
|
|
1818
|
+
FileUploadWidget: y((e) => /* @__PURE__ */ H(er, {
|
|
1819
|
+
kind: [
|
|
1820
|
+
"audio",
|
|
1821
|
+
"video",
|
|
1822
|
+
"image",
|
|
1823
|
+
"document"
|
|
1824
|
+
],
|
|
1825
|
+
isMultiple: !1,
|
|
1826
|
+
...e
|
|
1827
|
+
})),
|
|
1828
|
+
MultiFileUploadWidget: y((e) => /* @__PURE__ */ H(er, {
|
|
1829
|
+
kind: [
|
|
1830
|
+
"audio",
|
|
1831
|
+
"video",
|
|
1832
|
+
"image",
|
|
1833
|
+
"document"
|
|
1834
|
+
],
|
|
1835
|
+
isMultiple: !0,
|
|
1836
|
+
...e
|
|
1837
|
+
}))
|
|
1838
|
+
}, or = (e) => {
|
|
1839
|
+
let t = Q(9), n, r;
|
|
1840
|
+
t[0] === e ? (n = t[1], r = t[2]) : ({widgets: r, ...n} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1841
|
+
let { field: i } = n, { field_interface: a, key: o } = i;
|
|
1842
|
+
if (!a || !o) return null;
|
|
1843
|
+
if (r) {
|
|
1844
|
+
let e = r[a];
|
|
1845
|
+
if (e) {
|
|
1846
|
+
let r;
|
|
1847
|
+
return t[3] !== e || t[4] !== n ? (r = /* @__PURE__ */ H(e, { ...n }), t[3] = e, t[4] = n, t[5] = r) : r = t[5], r;
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
let s = ar[a];
|
|
1851
|
+
if (s) {
|
|
1852
|
+
let e;
|
|
1853
|
+
return t[6] !== s || t[7] !== n ? (e = /* @__PURE__ */ H(s, { ...n }), t[6] = s, t[7] = n, t[8] = e) : e = t[8], e;
|
|
1854
|
+
}
|
|
1855
|
+
return null;
|
|
1856
|
+
}, sr = (e) => {
|
|
1857
|
+
let t = Q(25), n, r, i;
|
|
1858
|
+
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({field: n, schema: i, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
1859
|
+
let { key: a, label: o, field_interface: s, fields: c } = n, l = a === void 0 ? "" : a, d = o === void 0 ? "" : o, f = s === void 0 ? "" : s, p;
|
|
1860
|
+
t[4] === c ? p = t[5] : (p = c === void 0 ? [] : c, t[4] = c, t[5] = p);
|
|
1861
|
+
let m = p;
|
|
1862
|
+
if (!f || !l) return null;
|
|
1863
|
+
let h = n?.required, g;
|
|
1864
|
+
t[6] !== d || t[7] !== h ? (g = /* @__PURE__ */ H(u, {
|
|
1865
|
+
label: d,
|
|
1866
|
+
isRequired: h
|
|
1867
|
+
}), t[6] = d, t[7] = h, t[8] = g) : g = t[8];
|
|
1868
|
+
let _;
|
|
1869
|
+
if (t[9] !== n.id || t[10] !== m || t[11] !== l || t[12] !== r || t[13] !== i) {
|
|
1870
|
+
let e;
|
|
1871
|
+
t[15] !== n.id || t[16] !== l || t[17] !== r || t[18] !== i ? (e = (e) => /* @__PURE__ */ H(cr, {
|
|
1872
|
+
field: {
|
|
1873
|
+
...e,
|
|
1874
|
+
key: `${l}.${e?.key}`
|
|
1875
|
+
},
|
|
1876
|
+
schema: i,
|
|
1877
|
+
...r
|
|
1878
|
+
}, `common-fields-${n?.id}-${e?.id}`), t[15] = n.id, t[16] = l, t[17] = r, t[18] = i, t[19] = e) : e = t[19], _ = m.map(e), t[9] = n.id, t[10] = m, t[11] = l, t[12] = r, t[13] = i, t[14] = _;
|
|
1879
|
+
} else _ = t[14];
|
|
1880
|
+
let v;
|
|
1881
|
+
t[20] === _ ? v = t[21] : (v = /* @__PURE__ */ H("div", {
|
|
1882
|
+
className: Xe,
|
|
1883
|
+
children: _
|
|
1884
|
+
}), t[20] = _, t[21] = v);
|
|
1885
|
+
let y;
|
|
1886
|
+
return t[22] !== g || t[23] !== v ? (y = /* @__PURE__ */ U("div", {
|
|
1887
|
+
className: ze,
|
|
1888
|
+
children: [g, v]
|
|
1889
|
+
}), t[22] = g, t[23] = v, t[24] = y) : y = t[24], y;
|
|
1890
|
+
}, cr = (e) => {
|
|
1891
|
+
let t = Q(12), n, r;
|
|
1892
|
+
t[0] === e ? (n = t[1], r = t[2]) : ({widgets: r, ...n} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1893
|
+
let { field_interface: i, key: a, hidden: o } = n.field, s = i === void 0 ? "" : i;
|
|
1894
|
+
if (!s || !(a !== void 0 && a) || o) return null;
|
|
1895
|
+
switch (s) {
|
|
1896
|
+
case W.ArrayWidget: {
|
|
1897
|
+
let e;
|
|
1898
|
+
return t[3] === n ? e = t[4] : (e = /* @__PURE__ */ H(ot, { ...n }), t[3] = n, t[4] = e), e;
|
|
1899
|
+
}
|
|
1900
|
+
case W.RecordWidget: {
|
|
1901
|
+
let e;
|
|
1902
|
+
return t[5] === n ? e = t[6] : (e = /* @__PURE__ */ H(sr, { ...n }), t[5] = n, t[6] = e), e;
|
|
1903
|
+
}
|
|
1904
|
+
case W.CollectionWidget: {
|
|
1905
|
+
let e;
|
|
1906
|
+
return t[7] === n ? e = t[8] : (e = /* @__PURE__ */ H(jt, { ...n }), t[7] = n, t[8] = e), e;
|
|
1907
|
+
}
|
|
1908
|
+
default: {
|
|
1909
|
+
let e;
|
|
1910
|
+
return t[9] !== n || t[10] !== r ? (e = /* @__PURE__ */ H(or, {
|
|
1911
|
+
widgets: r,
|
|
1912
|
+
...n
|
|
1913
|
+
}), t[9] = n, t[10] = r, t[11] = e) : e = t[11], e;
|
|
1914
|
+
}
|
|
1915
|
+
}
|
|
1916
|
+
}, lr = Re({
|
|
1917
|
+
form: {
|
|
1918
|
+
maxWidth: "100%",
|
|
1919
|
+
gap: "1.5rem",
|
|
1920
|
+
borderRadius: "6px",
|
|
1921
|
+
labelFontSize: "0.875rem",
|
|
1922
|
+
helpFontSize: "0.75rem",
|
|
1923
|
+
textColor: Fe.colors.text,
|
|
1924
|
+
helperTextColor: Fe.colors.mutedForeground
|
|
1925
|
+
},
|
|
1926
|
+
input: {
|
|
1927
|
+
fontSize: "0.875rem",
|
|
1928
|
+
height: "2.25rem",
|
|
1929
|
+
borderRadius: "6px"
|
|
1930
|
+
},
|
|
1931
|
+
checkbox: { labelFontSize: "0.875rem" },
|
|
1932
|
+
button: {
|
|
1933
|
+
fontSize: "0.875rem",
|
|
1934
|
+
padding: "0.5rem 1rem",
|
|
1935
|
+
borderRadius: "6px"
|
|
1936
|
+
}
|
|
1937
|
+
}), ur = "_1g8bxz40", dr = {
|
|
1938
|
+
form: {
|
|
1939
|
+
maxWidth: "var(--_1092q7b0)",
|
|
1940
|
+
gap: "var(--_1092q7b1)",
|
|
1941
|
+
borderRadius: "var(--_1092q7b2)",
|
|
1942
|
+
labelFontSize: "var(--_1092q7b3)",
|
|
1943
|
+
helpFontSize: "var(--_1092q7b4)",
|
|
1944
|
+
textColor: "var(--_1092q7b5)",
|
|
1945
|
+
helperTextColor: "var(--_1092q7b6)"
|
|
1946
|
+
},
|
|
1947
|
+
input: {
|
|
1948
|
+
fontSize: "var(--_1092q7b7)",
|
|
1949
|
+
height: "var(--_1092q7b8)",
|
|
1950
|
+
borderRadius: "var(--_1092q7b9)"
|
|
1951
|
+
},
|
|
1952
|
+
checkbox: { labelFontSize: "var(--_1092q7ba)" },
|
|
1953
|
+
button: {
|
|
1954
|
+
fontSize: "var(--_1092q7bb)",
|
|
1955
|
+
padding: "var(--_1092q7bc)",
|
|
1956
|
+
borderRadius: "var(--_1092q7bd)"
|
|
1957
|
+
}
|
|
1958
|
+
}, fr = e(dr), pr = "r6cfdr0", mr = N({ themeClass: "" }), hr = fr(lr({
|
|
1959
|
+
form: {
|
|
1960
|
+
maxWidth: "800px",
|
|
1961
|
+
labelFontSize: "1.5rem",
|
|
1962
|
+
helpFontSize: "1rem",
|
|
1963
|
+
borderRadius: "4px"
|
|
1964
|
+
},
|
|
1965
|
+
input: {
|
|
1966
|
+
fontSize: "1.125rem",
|
|
1967
|
+
height: "3.5rem",
|
|
1968
|
+
borderRadius: "4px"
|
|
1969
|
+
},
|
|
1970
|
+
checkbox: { labelFontSize: "1.125rem" },
|
|
1971
|
+
button: { borderRadius: "4px" }
|
|
1972
|
+
})), gr = (e) => {
|
|
1973
|
+
let t = Q(20), { children: n, className: r, style: a, cssReset: o, variant: s } = e, l = s === "single-field" || s === "steps-2", u;
|
|
1974
|
+
t[0] === r ? u = t[1] : (u = $(c, ur, r), t[0] = r, t[1] = u);
|
|
1975
|
+
let d = u, f;
|
|
1976
|
+
t[2] !== l || t[3] !== a ? (f = l ? {
|
|
1977
|
+
...hr,
|
|
1978
|
+
...a
|
|
1979
|
+
} : a, t[2] = l, t[3] = a, t[4] = f) : f = t[4];
|
|
1980
|
+
let p = f, m;
|
|
1981
|
+
t[5] !== d || t[6] !== p || t[7] !== o ? (m = {
|
|
1982
|
+
themeClass: d,
|
|
1983
|
+
style: p,
|
|
1984
|
+
cssReset: o
|
|
1985
|
+
}, t[5] = d, t[6] = p, t[7] = o, t[8] = m) : m = t[8];
|
|
1986
|
+
let h;
|
|
1987
|
+
t[9] !== n || t[10] !== l ? (h = l ? /* @__PURE__ */ H("div", {
|
|
1988
|
+
className: pr,
|
|
1989
|
+
children: n
|
|
1990
|
+
}) : n, t[9] = n, t[10] = l, t[11] = h) : h = t[11];
|
|
1991
|
+
let g;
|
|
1992
|
+
t[12] !== m || t[13] !== h ? (g = /* @__PURE__ */ H(mr.Provider, {
|
|
1993
|
+
value: m,
|
|
1994
|
+
children: h
|
|
1995
|
+
}), t[12] = m, t[13] = h, t[14] = g) : g = t[14];
|
|
1996
|
+
let _;
|
|
1997
|
+
return t[15] !== d || t[16] !== p || t[17] !== o || t[18] !== g ? (_ = /* @__PURE__ */ H(i, {
|
|
1998
|
+
className: d,
|
|
1999
|
+
cssReset: o,
|
|
2000
|
+
style: p,
|
|
2001
|
+
children: g
|
|
2002
|
+
}), t[15] = d, t[16] = p, t[17] = o, t[18] = g, t[19] = _) : _ = t[19], _;
|
|
2003
|
+
}, _r = () => {
|
|
2004
|
+
try {
|
|
2005
|
+
return I(mr);
|
|
2006
|
+
} catch {
|
|
2007
|
+
return null;
|
|
2008
|
+
}
|
|
2009
|
+
}, vr = "_1dzarb20", yr = "_1dzarb21", br = "_1dzarb23", xr = "_1dzarb24", Sr = "_1dzarb25", Cr = "_1dzarb26", wr = ({ hiddenFields: e, isLoading: t, initialValues: n, onSubmit: r, schema: i, uiConfig: a, submitButtonConfig: s, containerStyles: c, isDisabled: l, theme: u, enableVerification: d = !0 }) => {
|
|
2010
|
+
let f = R(() => {
|
|
2011
|
+
if (i) {
|
|
2012
|
+
let t = { ...i };
|
|
2013
|
+
return t.sections = t?.sections?.map((t) => (t.fields = t?.fields?.map((t) => ((e?.includes(t?.key) || e?.includes(t?.id)) && (t.hidden = !0), t)), t)), t;
|
|
2014
|
+
}
|
|
2015
|
+
return null;
|
|
2016
|
+
}, [i]), h = Se({
|
|
2017
|
+
mode: "onTouched",
|
|
2018
|
+
disabled: l,
|
|
2019
|
+
defaultValues: {},
|
|
2020
|
+
resetOptions: { keepErrors: !0 }
|
|
2021
|
+
}), { formState: { isSubmitting: g } } = h, _ = (e) => {
|
|
2022
|
+
r && r(e);
|
|
2023
|
+
};
|
|
2024
|
+
L(() => {
|
|
2025
|
+
if (f) {
|
|
2026
|
+
let e = {
|
|
2027
|
+
...p(i),
|
|
2028
|
+
...n
|
|
2029
|
+
};
|
|
2030
|
+
h.reset(e);
|
|
2031
|
+
}
|
|
2032
|
+
}, [f]);
|
|
2033
|
+
let v = t || g;
|
|
2034
|
+
return f ? /* @__PURE__ */ H(ve, {
|
|
2035
|
+
...h,
|
|
2036
|
+
children: /* @__PURE__ */ H(gr, {
|
|
2037
|
+
...u || {},
|
|
2038
|
+
children: /* @__PURE__ */ U("div", {
|
|
2039
|
+
className: vr,
|
|
2040
|
+
children: [a?.hideFormHeading ? null : /* @__PURE__ */ H("h1", {
|
|
2041
|
+
className: $(yr),
|
|
2042
|
+
children: "Create new"
|
|
2043
|
+
}), /* @__PURE__ */ H("div", {
|
|
2044
|
+
className: $(br, c),
|
|
2045
|
+
children: /* @__PURE__ */ U("form", {
|
|
2046
|
+
className: $(xr, t && "_1dzarb27"),
|
|
2047
|
+
id: "collection-form",
|
|
2048
|
+
onSubmit: h.handleSubmit(_),
|
|
2049
|
+
children: [i?.sections?.map((e) => m(e?.fields || []) ? null : /* @__PURE__ */ U("div", {
|
|
2050
|
+
className: Sr,
|
|
2051
|
+
children: [!a?.hideSectionHeadings && /* @__PURE__ */ H("p", {
|
|
2052
|
+
className: "_1dzarb28",
|
|
2053
|
+
children: e?.label
|
|
2054
|
+
}), /* @__PURE__ */ H("div", {
|
|
2055
|
+
className: Cr,
|
|
2056
|
+
children: e?.fields?.map((e) => /* @__PURE__ */ H(cr, {
|
|
2057
|
+
field: e,
|
|
2058
|
+
schema: i,
|
|
2059
|
+
settings: { enableVerification: d }
|
|
2060
|
+
}, e?.key))
|
|
2061
|
+
})]
|
|
2062
|
+
}, e.id)), s?.show && /* @__PURE__ */ H("div", {
|
|
2063
|
+
className: "_1dzarb29",
|
|
2064
|
+
children: /* @__PURE__ */ H(o, {
|
|
2065
|
+
className: s?.styles,
|
|
2066
|
+
disabled: l || v,
|
|
2067
|
+
type: "submit",
|
|
2068
|
+
children: v ? "Saving" : s?.text || "Save"
|
|
2069
|
+
})
|
|
2070
|
+
})]
|
|
2071
|
+
})
|
|
2072
|
+
})]
|
|
2073
|
+
})
|
|
2074
|
+
})
|
|
2075
|
+
}) : null;
|
|
2076
|
+
}, Tr = j.createContext({
|
|
2077
|
+
schema: null,
|
|
2078
|
+
submitButtonConfig: { show: !0 }
|
|
2079
|
+
}), Er = (e) => {
|
|
2080
|
+
let t = Q(14), n, r, i, a;
|
|
2081
|
+
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4]) : ({children: n, theme: i, variant: a, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a);
|
|
2082
|
+
let o;
|
|
2083
|
+
t[5] === r ? o = t[6] : (o = { ...r }, t[5] = r, t[6] = o);
|
|
2084
|
+
let s;
|
|
2085
|
+
t[7] !== n || t[8] !== i || t[9] !== a ? (s = /* @__PURE__ */ H(gr, {
|
|
2086
|
+
...i,
|
|
2087
|
+
variant: a,
|
|
2088
|
+
children: n
|
|
2089
|
+
}), t[7] = n, t[8] = i, t[9] = a, t[10] = s) : s = t[10];
|
|
2090
|
+
let c;
|
|
2091
|
+
return t[11] !== o || t[12] !== s ? (c = /* @__PURE__ */ H(Tr.Provider, {
|
|
2092
|
+
value: o,
|
|
2093
|
+
children: s
|
|
2094
|
+
}), t[11] = o, t[12] = s, t[13] = c) : c = t[13], c;
|
|
2095
|
+
}, Dr = () => j.useContext(Tr), Or = {
|
|
2096
|
+
FORM_DIRTY: "form-dirty",
|
|
2097
|
+
FORM_VALUES: "form-values"
|
|
2098
|
+
}, kr = (e) => {
|
|
2099
|
+
let t = localStorage.getItem(`${e}-${Or.FORM_VALUES}`);
|
|
2100
|
+
return t ? JSON.parse(t) : {};
|
|
2101
|
+
}, Ar = (e, t) => {
|
|
2102
|
+
localStorage.setItem(`${e}-${Or.FORM_VALUES}`, JSON.stringify(t));
|
|
2103
|
+
}, jr = (e) => {
|
|
2104
|
+
localStorage.removeItem(`${e}-${Or.FORM_VALUES}`);
|
|
2105
|
+
}, Mr = ({ schema: e, originalSchema: t, saveToRemote: n, onSubmit: r, onSubmitSuccess: i, onSubmitError: a, setFormErrorAfterSubmit: o = !0 }) => {
|
|
2106
|
+
let s = R(() => e, [e]), c = R(() => t || s, [t]), l = Z(), { toastConfig: u, onSuccess: d, onError: f, isLoggedIn: m, isDisabled: g, externalInitialValues: _ = {}, account: y, preview: b } = Dr(), [x, S] = B(null), [C, w] = B(!1), [T, E] = B(!1), [D, O] = B(!1), k = z({}), A = (e) => {
|
|
2107
|
+
if (!s?.sections) return null;
|
|
2108
|
+
for (let t of s.sections) for (let n of t?.fields ?? []) if (n?.key === e) return n?.kind ?? null;
|
|
2109
|
+
return null;
|
|
2110
|
+
}, j = () => {
|
|
2111
|
+
let e = {};
|
|
2112
|
+
try {
|
|
2113
|
+
if (typeof window < "u") {
|
|
2114
|
+
let t = new URLSearchParams(window?.location?.search);
|
|
2115
|
+
for (let [n, r] of t.entries()) {
|
|
2116
|
+
let [t, i] = n.split("-");
|
|
2117
|
+
if (t === "lf" && i && r) try {
|
|
2118
|
+
let t = JSON.parse(r), n = A(i);
|
|
2119
|
+
e[i] = typeof t == "number" && !(n === "number" || n === "currency") ? r : t;
|
|
2120
|
+
} catch {
|
|
2121
|
+
e[i] = r;
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
}
|
|
2125
|
+
} catch {}
|
|
2126
|
+
let t = p(s), n = {};
|
|
2127
|
+
y && s && (s.email_field && y.email && (n[s.email_field] = y.email), s.mobile_field && y.mobile && (n[s.mobile_field] = y.mobile)), k.current = {
|
|
2128
|
+
...t,
|
|
2129
|
+
..._ || {},
|
|
2130
|
+
...n,
|
|
2131
|
+
...e,
|
|
2132
|
+
...k.current
|
|
2133
|
+
};
|
|
2134
|
+
}, M = Se({
|
|
2135
|
+
mode: "onTouched",
|
|
2136
|
+
disabled: g
|
|
2137
|
+
}), { formState: N } = M, P = M.handleSubmit(async (e) => {
|
|
2138
|
+
if (k.current = {
|
|
2139
|
+
...k.current || {},
|
|
2140
|
+
...e
|
|
2141
|
+
}, n && !b && l?.collection) {
|
|
2142
|
+
if (c) try {
|
|
2143
|
+
let e = v(k?.current, c), t = null;
|
|
2144
|
+
if (t = x ? await l?.collection?.submitDraftEntry(c?.key, e) : await l?.collection?.saveCollectionData({
|
|
2145
|
+
collection_id: c?.id,
|
|
2146
|
+
data: e
|
|
2147
|
+
}), t?.content?.data) {
|
|
2148
|
+
let e = t?.content?.meta?.booking_config?.enabled;
|
|
2149
|
+
u?.showSuccessToast && !(u?.suppressOnBooking && e) && ee(u.successToastText || "Form submitted successfully."), k.current = {}, j(), jr(c?.key), S(null), O(!0), d && d({
|
|
2150
|
+
schemaId: c?.id,
|
|
2151
|
+
response: t?.content?.data,
|
|
2152
|
+
meta: t?.content?.meta
|
|
2153
|
+
}), i && i();
|
|
2154
|
+
return;
|
|
2155
|
+
}
|
|
2156
|
+
throw Error("Failed to save form details, API response invalid");
|
|
2157
|
+
} catch (e) {
|
|
2158
|
+
J(e), e instanceof G ? (e?.hasFieldErrors && o && h(e?.fieldErrors, M.setError), a && a(e.fieldErrors || []), f && f(e)) : f && f(e?.response?.data || e);
|
|
2159
|
+
}
|
|
2160
|
+
return;
|
|
2161
|
+
}
|
|
2162
|
+
e && r && r(e);
|
|
2163
|
+
});
|
|
2164
|
+
return L(() => {
|
|
2165
|
+
if (s && l?.collection) {
|
|
2166
|
+
if (j(), !x && !b && s?.allow_draft) {
|
|
2167
|
+
if (m) {
|
|
2168
|
+
w(!0), l?.collection?.getDraftEntry(s?.key).then((e) => {
|
|
2169
|
+
let t = e?.content?.data;
|
|
2170
|
+
if (t === null) {
|
|
2171
|
+
E(!0);
|
|
2172
|
+
return;
|
|
2173
|
+
}
|
|
2174
|
+
E(!1);
|
|
2175
|
+
let n = Array.isArray(t) ? t?.filter((e) => e?._status === "draft") : [];
|
|
2176
|
+
if (n?.length > 0) {
|
|
2177
|
+
let e = n?.[n.length - 1] || null;
|
|
2178
|
+
e?._id && (k.current = {
|
|
2179
|
+
...k.current || {},
|
|
2180
|
+
...e
|
|
2181
|
+
}, S(e?._id));
|
|
2182
|
+
}
|
|
2183
|
+
}).catch((e) => (l?.logger?.error("Failed to get draft entry", e), null)).finally(() => {
|
|
2184
|
+
M.reset({ ...k?.current }), w(!1);
|
|
2185
|
+
});
|
|
2186
|
+
return;
|
|
2187
|
+
}
|
|
2188
|
+
let e = kr(s?.key);
|
|
2189
|
+
e && (k.current = {
|
|
2190
|
+
...k.current || {},
|
|
2191
|
+
...e
|
|
2192
|
+
});
|
|
2193
|
+
}
|
|
2194
|
+
M.reset({ ...k?.current });
|
|
2195
|
+
}
|
|
2196
|
+
}, [s]), L(() => {
|
|
2197
|
+
let { isSubmitSuccessful: e, isValid: t } = N;
|
|
2198
|
+
e && t && M.reset({
|
|
2199
|
+
...k?.current,
|
|
2200
|
+
__captcha: "verified"
|
|
2201
|
+
});
|
|
2202
|
+
}, [N]), L(() => {
|
|
2203
|
+
s && x && jr(s?.key);
|
|
2204
|
+
}, [x]), {
|
|
2205
|
+
methods: M,
|
|
2206
|
+
isLoading: C,
|
|
2207
|
+
isError: T,
|
|
2208
|
+
contentId: x,
|
|
2209
|
+
allFormValues: k.current,
|
|
2210
|
+
handleContentId: (e) => {
|
|
2211
|
+
e && e !== x && S(e);
|
|
2212
|
+
},
|
|
2213
|
+
handleSubmit: P,
|
|
2214
|
+
showSuccessOverlay: D,
|
|
2215
|
+
dismissSuccessOverlay: () => O(!1)
|
|
2216
|
+
};
|
|
2217
|
+
}, Nr = "a2n8870", Pr = "a2n8871", Fr = "a2n8872", Ir = P(() => import("altcha").then(() => ({ default: function({ widgetRef: e, client: t, onStateChange: n }) {
|
|
2218
|
+
return L(() => {
|
|
2219
|
+
let { current: t } = e;
|
|
2220
|
+
if (t) return t.addEventListener("statechange", n), () => t.removeEventListener("statechange", n);
|
|
2221
|
+
}, [n]), /* @__PURE__ */ H("altcha-widget", {
|
|
2222
|
+
ref: e,
|
|
2223
|
+
style: {
|
|
2224
|
+
"--altcha-max-width": "100%",
|
|
2225
|
+
"--altcha-border-width": "1px",
|
|
2226
|
+
"--altcha-border-radius": dr.form.borderRadius,
|
|
2227
|
+
"--altcha-color-base": Fe.colors.background,
|
|
2228
|
+
"--altcha-color-border": Fe.colors.input,
|
|
2229
|
+
"--altcha-color-border-focus": Fe.colors.ring,
|
|
2230
|
+
"--altcha-color-text": Fe.colors.foreground
|
|
2231
|
+
},
|
|
2232
|
+
hidelogo: !0,
|
|
2233
|
+
auto: "onfocus",
|
|
2234
|
+
hidefooter: !0,
|
|
2235
|
+
challengeurl: `${t.apiUrl}/v1/identity/captcha/create-challenge`,
|
|
2236
|
+
verifyurl: `${t.apiUrl}/v1/identity/captcha/verify-challenge`
|
|
2237
|
+
});
|
|
2238
|
+
} }))), Lr = () => {
|
|
2239
|
+
let e = Q(1), t;
|
|
2240
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ H("div", {
|
|
2241
|
+
className: Pr,
|
|
2242
|
+
children: /* @__PURE__ */ H("span", {
|
|
2243
|
+
className: Fr,
|
|
2244
|
+
children: "Loading verification..."
|
|
2245
|
+
})
|
|
2246
|
+
}), e[0] = t) : t = e[0], t;
|
|
2247
|
+
}, Rr = () => {
|
|
2248
|
+
let e = Q(16), { disableCaptcha: t } = Dr(), n = Z(), [r, i] = B(!1), a = z(null), o = t ? !1 : "Verification is required", s;
|
|
2249
|
+
e[0] === o ? s = e[1] : (s = {
|
|
2250
|
+
name: "__captcha",
|
|
2251
|
+
rules: { required: o }
|
|
2252
|
+
}, e[0] = o, e[1] = s);
|
|
2253
|
+
let { field: c, fieldState: l } = be(s), { onChange: u } = c, { error: f } = l, p, m;
|
|
2254
|
+
e[2] === Symbol.for("react.memo_cache_sentinel") ? (p = () => {
|
|
2255
|
+
i(!0);
|
|
2256
|
+
}, m = [], e[2] = p, e[3] = m) : (p = e[2], m = e[3]), L(p, m);
|
|
2257
|
+
let h;
|
|
2258
|
+
e[4] === u ? h = e[5] : (h = (e) => {
|
|
2259
|
+
"detail" in e && u(e.detail.state || null);
|
|
2260
|
+
}, e[4] = u, e[5] = h);
|
|
2261
|
+
let g = h;
|
|
2262
|
+
if (!r) {
|
|
2263
|
+
let t = f?.message, n;
|
|
2264
|
+
e[6] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ H(Lr, {}), e[6] = n) : n = e[6];
|
|
2265
|
+
let r;
|
|
2266
|
+
return e[7] === t ? r = e[8] : (r = /* @__PURE__ */ H(d, {
|
|
2267
|
+
error: t,
|
|
2268
|
+
className: Nr,
|
|
2269
|
+
children: n
|
|
2270
|
+
}), e[7] = t, e[8] = r), r;
|
|
2271
|
+
}
|
|
2272
|
+
let _ = f?.message, v;
|
|
2273
|
+
e[9] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ H(Lr, {}), e[9] = v) : v = e[9];
|
|
2274
|
+
let y;
|
|
2275
|
+
e[10] !== n || e[11] !== g ? (y = /* @__PURE__ */ H(M, {
|
|
2276
|
+
fallback: v,
|
|
2277
|
+
children: /* @__PURE__ */ H(Ir, {
|
|
2278
|
+
widgetRef: a,
|
|
2279
|
+
client: n,
|
|
2280
|
+
onStateChange: g
|
|
2281
|
+
})
|
|
2282
|
+
}), e[10] = n, e[11] = g, e[12] = y) : y = e[12];
|
|
2283
|
+
let b;
|
|
2284
|
+
return e[13] !== _ || e[14] !== y ? (b = /* @__PURE__ */ H(d, {
|
|
2285
|
+
error: _,
|
|
2286
|
+
className: Nr,
|
|
2287
|
+
children: y
|
|
2288
|
+
}), e[13] = _, e[14] = y, e[15] = b) : b = e[15], b;
|
|
2289
|
+
}, zr = () => {
|
|
2290
|
+
let e = Q(4), t = we(), { formState: n } = Ce(), r, i;
|
|
2291
|
+
return e[0] !== n || e[1] !== t ? (r = () => {
|
|
2292
|
+
console.log({
|
|
2293
|
+
values: t,
|
|
2294
|
+
formState: n
|
|
2295
|
+
});
|
|
2296
|
+
}, i = [t, n], e[0] = n, e[1] = t, e[2] = r, e[3] = i) : (r = e[2], i = e[3]), L(r, i), null;
|
|
2297
|
+
}, Br = "_1vist8m0", Vr = (e) => {
|
|
2298
|
+
let t = Q(4), { className: n } = e, { uiConfig: r } = Dr();
|
|
2299
|
+
if (r?.hideFormHeading) return null;
|
|
2300
|
+
let i;
|
|
2301
|
+
t[0] === n ? i = t[1] : (i = $(Br, n), t[0] = n, t[1] = i);
|
|
2302
|
+
let a;
|
|
2303
|
+
return t[2] === i ? a = t[3] : (a = /* @__PURE__ */ H("h1", {
|
|
2304
|
+
className: i,
|
|
2305
|
+
children: "Create new"
|
|
2306
|
+
}), t[2] = i, t[3] = a), a;
|
|
2307
|
+
}, Hr = "zx38wb0", Ur = (e) => {
|
|
2308
|
+
let t = Q(5), { children: n, className: r } = e, { uiConfig: i } = Dr();
|
|
2309
|
+
if (i?.hideSectionHeadings) return null;
|
|
2310
|
+
let a;
|
|
2311
|
+
t[0] === r ? a = t[1] : (a = $(Hr, r), t[0] = r, t[1] = a);
|
|
2312
|
+
let o;
|
|
2313
|
+
return t[2] !== n || t[3] !== a ? (o = /* @__PURE__ */ H("h3", {
|
|
2314
|
+
className: a,
|
|
2315
|
+
children: n
|
|
2316
|
+
}), t[2] = n, t[3] = a, t[4] = o) : o = t[4], o;
|
|
2317
|
+
}, Wr = "q22d794", Gr = "q22d795", Kr = "q22d796", qr = "q22d797", Jr = "q22d798", Yr = 5, Xr = "Thank you!", Zr = "Your response has been submitted successfully.", Qr = () => {
|
|
2318
|
+
let e = Q(1), t;
|
|
2319
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ U("svg", {
|
|
2320
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2321
|
+
viewBox: "0 0 24 24",
|
|
2322
|
+
fill: "none",
|
|
2323
|
+
stroke: "currentColor",
|
|
2324
|
+
strokeWidth: "2.5",
|
|
2325
|
+
strokeLinecap: "round",
|
|
2326
|
+
strokeLinejoin: "round",
|
|
2327
|
+
children: [/* @__PURE__ */ H("title", { children: "Check Icon" }), /* @__PURE__ */ H("path", { d: "M20 6 9 17l-5-5" })]
|
|
2328
|
+
}), e[0] = t) : t = e[0], t;
|
|
2329
|
+
}, $r = ({ onDismiss: e }) => {
|
|
2330
|
+
let { successConfig: t, schema: n } = Dr(), r = n?.settings?.success_message, [i, a] = B(Yr), s = (e) => !e || e.replace(/<[^>]*>/g, "").trim() === "", c = t?.title || r?.title || Xr, l = t?.message || r?.message, u = s(l) ? Zr : l, d = t?.action || r?.action, f = d?.type ?? "none", p = f === "redirect" ? d?.value : void 0, m = (() => {
|
|
2331
|
+
if (p) {
|
|
2332
|
+
if (p.startsWith("/")) return p;
|
|
2333
|
+
try {
|
|
2334
|
+
let e = new URL(p);
|
|
2335
|
+
if (e.protocol === "http:" || e.protocol === "https:") return p;
|
|
2336
|
+
} catch {}
|
|
2337
|
+
}
|
|
2338
|
+
})();
|
|
2339
|
+
L(() => {
|
|
2340
|
+
if (!m) return;
|
|
2341
|
+
let e = setInterval(() => {
|
|
2342
|
+
a((t) => t <= 1 ? (clearInterval(e), window.location.href = m, 0) : t - 1);
|
|
2343
|
+
}, 1e3);
|
|
2344
|
+
return () => clearInterval(e);
|
|
2345
|
+
}, [m]);
|
|
2346
|
+
let h = F(() => {
|
|
2347
|
+
m && (window.location.href = m);
|
|
2348
|
+
}, [m]);
|
|
2349
|
+
return /* @__PURE__ */ H("div", {
|
|
2350
|
+
className: Wr,
|
|
2351
|
+
children: /* @__PURE__ */ U("div", {
|
|
2352
|
+
className: Gr,
|
|
2353
|
+
children: [
|
|
2354
|
+
/* @__PURE__ */ H("div", {
|
|
2355
|
+
className: Kr,
|
|
2356
|
+
children: /* @__PURE__ */ H(Qr, {})
|
|
2357
|
+
}),
|
|
2358
|
+
/* @__PURE__ */ H("h2", {
|
|
2359
|
+
className: qr,
|
|
2360
|
+
children: c
|
|
2361
|
+
}),
|
|
2362
|
+
/* @__PURE__ */ H("div", {
|
|
2363
|
+
className: Jr,
|
|
2364
|
+
dangerouslySetInnerHTML: { __html: u }
|
|
2365
|
+
}),
|
|
2366
|
+
f === "submit_another" && /* @__PURE__ */ H("div", {
|
|
2367
|
+
className: "q22d799",
|
|
2368
|
+
children: /* @__PURE__ */ H(o, {
|
|
2369
|
+
variant: "default",
|
|
2370
|
+
size: "sm",
|
|
2371
|
+
onClick: e,
|
|
2372
|
+
children: "Submit Another"
|
|
2373
|
+
})
|
|
2374
|
+
}),
|
|
2375
|
+
f === "redirect" && m && /* @__PURE__ */ U("div", {
|
|
2376
|
+
className: "q22d799",
|
|
2377
|
+
children: [/* @__PURE__ */ H(o, {
|
|
2378
|
+
variant: "default",
|
|
2379
|
+
size: "sm",
|
|
2380
|
+
onClick: h,
|
|
2381
|
+
children: "Continue"
|
|
2382
|
+
}), /* @__PURE__ */ U("span", {
|
|
2383
|
+
className: "q22d79a",
|
|
2384
|
+
children: [
|
|
2385
|
+
"Redirecting in ",
|
|
2386
|
+
i,
|
|
2387
|
+
"s…"
|
|
2388
|
+
]
|
|
2389
|
+
})]
|
|
2390
|
+
})
|
|
2391
|
+
]
|
|
2392
|
+
})
|
|
2393
|
+
});
|
|
2394
|
+
}, ei = (e) => {
|
|
2395
|
+
let t = Q(27), { isError: n, contentId: r, getContentId: i, allFormValues: a } = e, { collection: o } = Z(), { schema: s, isLoggedIn: c, preview: l } = Dr(), { formState: u } = Ce(), d = we(), f;
|
|
2396
|
+
t[0] !== o || t[1] !== r || t[2] !== i || t[3] !== n || t[4] !== c || t[5] !== l || t[6] !== s?.allow_draft || t[7] !== s?.key ? (f = (e) => {
|
|
2397
|
+
l || s?.key && !n && s?.allow_draft && (c ? r ? o.editDraftEntry(s?.key, r, e).then((e) => {
|
|
2398
|
+
e?.content?.data?._id && i(e?.content?.data?._id);
|
|
2399
|
+
}).catch(ti) : o.saveDraftEntry(s?.key, e).then((e) => {
|
|
2400
|
+
e?.content?.data?._id && i(e?.content?.data?._id);
|
|
2401
|
+
}).catch(ni) : Ar(s?.key, e));
|
|
2402
|
+
}, t[0] = o, t[1] = r, t[2] = i, t[3] = n, t[4] = c, t[5] = l, t[6] = s?.allow_draft, t[7] = s?.key, t[8] = f) : f = t[8];
|
|
2403
|
+
let p = ne(f, 100), { isDirty: m, isSubmitting: h, isSubmitSuccessful: g } = u, _;
|
|
2404
|
+
t[9] !== a || t[10] !== p || t[11] !== d || t[12] !== m || t[13] !== n || t[14] !== g || t[15] !== h || t[16] !== l ? (_ = () => {
|
|
2405
|
+
if (!l) {
|
|
2406
|
+
if (h || g) {
|
|
2407
|
+
p.cancel();
|
|
2408
|
+
return;
|
|
2409
|
+
}
|
|
2410
|
+
n || m && Object?.keys(d || {})?.length > 0 && (p.cancel(), p({
|
|
2411
|
+
...a || {},
|
|
2412
|
+
...d
|
|
2413
|
+
}));
|
|
2414
|
+
}
|
|
2415
|
+
}, t[9] = a, t[10] = p, t[11] = d, t[12] = m, t[13] = n, t[14] = g, t[15] = h, t[16] = l, t[17] = _) : _ = t[17];
|
|
2416
|
+
let v;
|
|
2417
|
+
return t[18] !== r || t[19] !== d || t[20] !== m || t[21] !== n || t[22] !== c || t[23] !== g || t[24] !== h || t[25] !== l ? (v = [
|
|
2418
|
+
m,
|
|
2419
|
+
r,
|
|
2420
|
+
n,
|
|
2421
|
+
c,
|
|
2422
|
+
d,
|
|
2423
|
+
h,
|
|
2424
|
+
g,
|
|
2425
|
+
l
|
|
2426
|
+
], t[18] = r, t[19] = d, t[20] = m, t[21] = n, t[22] = c, t[23] = g, t[24] = h, t[25] = l, t[26] = v) : v = t[26], L(_, v), null;
|
|
2427
|
+
};
|
|
2428
|
+
function ti() {
|
|
2429
|
+
console.error("saving entry failed");
|
|
2430
|
+
}
|
|
2431
|
+
function ni() {
|
|
2432
|
+
console.error("saving entry failed");
|
|
2433
|
+
}
|
|
2434
|
+
//#endregion
|
|
2435
|
+
//#region ../../libraries/react-collection/dist/lib/variants/DefaultFormVariant/DefaultFormVariant.cssm.js
|
|
2436
|
+
var ri = "fil1ri0", ii = "fil1ri1", ai = "fil1ri2", oi = "fil1ri5", si = () => {
|
|
2437
|
+
let e = Q(46), { schema: t, containerStyles: n, submitButtonConfig: r, isDisabled: i, widgets: a, disableCaptcha: s, debug: c, enableVerification: l, preview: u } = Dr(), d;
|
|
2438
|
+
e[0] === t ? d = e[1] : (d = {
|
|
2439
|
+
schema: t,
|
|
2440
|
+
saveToRemote: !0
|
|
2441
|
+
}, e[0] = t, e[1] = d);
|
|
2442
|
+
let { methods: f, isError: p, isLoading: h, contentId: g, handleContentId: _, handleSubmit: v, allFormValues: y, showSuccessOverlay: b, dismissSuccessOverlay: x } = Mr(d), { formState: S } = f, { isSubmitting: C } = S, w;
|
|
2443
|
+
e[2] === f ? w = e[3] : (w = f.watch("__captcha"), e[2] = f, e[3] = w);
|
|
2444
|
+
let T = w;
|
|
2445
|
+
if (b) {
|
|
2446
|
+
let t;
|
|
2447
|
+
return e[4] === x ? t = e[5] : (t = /* @__PURE__ */ H($r, { onDismiss: x }), e[4] = x, e[5] = t), t;
|
|
2448
|
+
}
|
|
2449
|
+
let E;
|
|
2450
|
+
e[6] === c ? E = e[7] : (E = c && /* @__PURE__ */ H(zr, {}), e[6] = c, e[7] = E);
|
|
2451
|
+
let D = g || "", O;
|
|
2452
|
+
e[8] !== y || e[9] !== _ || e[10] !== p || e[11] !== D ? (O = /* @__PURE__ */ H(ei, {
|
|
2453
|
+
getContentId: _,
|
|
2454
|
+
isError: p,
|
|
2455
|
+
contentId: D,
|
|
2456
|
+
allFormValues: y
|
|
2457
|
+
}), e[8] = y, e[9] = _, e[10] = p, e[11] = D, e[12] = O) : O = e[12];
|
|
2458
|
+
let k;
|
|
2459
|
+
e[13] === n ? k = e[14] : (k = $(ri, n), e[13] = n, e[14] = k);
|
|
2460
|
+
let A;
|
|
2461
|
+
e[15] === Symbol.for("react.memo_cache_sentinel") ? (A = /* @__PURE__ */ H(Vr, {}), e[15] = A) : A = e[15];
|
|
2462
|
+
let j = h && "fil1ri3", M;
|
|
2463
|
+
e[16] === j ? M = e[17] : (M = $(ii, j), e[16] = j, e[17] = M);
|
|
2464
|
+
let N;
|
|
2465
|
+
e[18] !== l || e[19] !== t || e[20] !== a ? (N = t?.sections?.map((e) => m(e?.fields || []) ? null : /* @__PURE__ */ U("div", {
|
|
2466
|
+
className: ai,
|
|
2467
|
+
children: [e?.label && /* @__PURE__ */ H(Ur, { children: e.label }), /* @__PURE__ */ H("div", {
|
|
2468
|
+
className: oi,
|
|
2469
|
+
children: e?.fields?.map((e) => /* @__PURE__ */ H(cr, {
|
|
2470
|
+
field: e,
|
|
2471
|
+
widgets: a,
|
|
2472
|
+
schema: t,
|
|
2473
|
+
settings: { enableVerification: l }
|
|
2474
|
+
}, e?.key))
|
|
2475
|
+
})]
|
|
2476
|
+
}, e.id)), e[18] = l, e[19] = t, e[20] = a, e[21] = N) : N = e[21];
|
|
2477
|
+
let P;
|
|
2478
|
+
e[22] !== s || e[23] !== u ? (P = !s && !u && /* @__PURE__ */ H(Rr, {}), e[22] = s, e[23] = u, e[24] = P) : P = e[24];
|
|
2479
|
+
let F;
|
|
2480
|
+
e[25] !== T || e[26] !== i || e[27] !== C || e[28] !== r?.show || e[29] !== r?.styles || e[30] !== r?.text ? (F = r?.show && /* @__PURE__ */ H("div", {
|
|
2481
|
+
className: "fil1ri4",
|
|
2482
|
+
children: /* @__PURE__ */ H(o, {
|
|
2483
|
+
className: r?.styles,
|
|
2484
|
+
disabled: i || C,
|
|
2485
|
+
type: "submit",
|
|
2486
|
+
children: C ? "Saving..." : T === "verifying" ? "Verifying..." : r?.text || "Save"
|
|
2487
|
+
})
|
|
2488
|
+
}), e[25] = T, e[26] = i, e[27] = C, e[28] = r?.show, e[29] = r?.styles, e[30] = r?.text, e[31] = F) : F = e[31];
|
|
2489
|
+
let I;
|
|
2490
|
+
e[32] !== v || e[33] !== N || e[34] !== P || e[35] !== F || e[36] !== M ? (I = /* @__PURE__ */ U("form", {
|
|
2491
|
+
className: M,
|
|
2492
|
+
id: "collection-form",
|
|
2493
|
+
onSubmit: v,
|
|
2494
|
+
children: [
|
|
2495
|
+
N,
|
|
2496
|
+
P,
|
|
2497
|
+
F
|
|
2498
|
+
]
|
|
2499
|
+
}), e[32] = v, e[33] = N, e[34] = P, e[35] = F, e[36] = M, e[37] = I) : I = e[37];
|
|
2500
|
+
let L;
|
|
2501
|
+
e[38] !== I || e[39] !== k ? (L = /* @__PURE__ */ U("div", {
|
|
2502
|
+
className: k,
|
|
2503
|
+
children: [A, I]
|
|
2504
|
+
}), e[38] = I, e[39] = k, e[40] = L) : L = e[40];
|
|
2505
|
+
let R;
|
|
2506
|
+
return e[41] !== f || e[42] !== L || e[43] !== E || e[44] !== O ? (R = /* @__PURE__ */ U(ve, {
|
|
2507
|
+
...f,
|
|
2508
|
+
children: [
|
|
2509
|
+
E,
|
|
2510
|
+
O,
|
|
2511
|
+
L
|
|
2512
|
+
]
|
|
2513
|
+
}), e[41] = f, e[42] = L, e[43] = E, e[44] = O, e[45] = R) : R = e[45], R;
|
|
2514
|
+
}, ci = "_1kah2gz0", li = "_1kah2gz1", ui = "_1kah2gz3", di = (e) => {
|
|
2515
|
+
let t = Q(12), { totalSteps: n, currentStepIndex: r, hasLevoErrors: i } = e, { formState: a } = Ce(), { errors: o } = a, s = Object.keys(o || {}).length > 0 || i, c = Math.floor((r + 1) * 100 / n), l = s && "_1kah2gz2", u;
|
|
2516
|
+
t[0] === l ? u = t[1] : (u = $(li, l), t[0] = l, t[1] = u);
|
|
2517
|
+
let d = s && "_1kah2gz4", f;
|
|
2518
|
+
t[2] === d ? f = t[3] : (f = $(ui, d), t[2] = d, t[3] = f);
|
|
2519
|
+
let p = `${c}%`, m;
|
|
2520
|
+
t[4] === p ? m = t[5] : (m = { width: p }, t[4] = p, t[5] = m);
|
|
2521
|
+
let h;
|
|
2522
|
+
t[6] !== f || t[7] !== m ? (h = /* @__PURE__ */ H("div", {
|
|
2523
|
+
className: f,
|
|
2524
|
+
style: m
|
|
2525
|
+
}), t[6] = f, t[7] = m, t[8] = h) : h = t[8];
|
|
2526
|
+
let g;
|
|
2527
|
+
return t[9] !== u || t[10] !== h ? (g = /* @__PURE__ */ H("div", {
|
|
2528
|
+
className: ci,
|
|
2529
|
+
children: /* @__PURE__ */ H("div", {
|
|
2530
|
+
className: u,
|
|
2531
|
+
children: h
|
|
2532
|
+
})
|
|
2533
|
+
}), t[9] = u, t[10] = h, t[11] = g) : g = t[11], g;
|
|
2534
|
+
}, fi = "_1ypxmcv0", pi = "_1ypxmcv1", mi = "_1ypxmcvb", hi = "_1ypxmcvc", gi = () => {
|
|
2535
|
+
let e = Q(74), { disableCaptcha: t, schema: n, widgets: r, submitButtonConfig: i, containerStyles: a, enableVerification: s, preview: c } = Dr(), l;
|
|
2536
|
+
bb0: {
|
|
2537
|
+
if (!n?.sections) {
|
|
2538
|
+
let t;
|
|
2539
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = [], e[0] = t) : t = e[0], l = t;
|
|
2540
|
+
break bb0;
|
|
2541
|
+
}
|
|
2542
|
+
let t;
|
|
2543
|
+
e[1] === n.sections ? t = e[2] : (t = n.sections.flatMap(vi), e[1] = n.sections, e[2] = t), l = t;
|
|
2544
|
+
}
|
|
2545
|
+
let u = l, [d, f] = B(0), [p, m] = B(0), h;
|
|
2546
|
+
e[3] === Symbol.for("react.memo_cache_sentinel") ? (h = {
|
|
2547
|
+
state: "entered",
|
|
2548
|
+
direction: "next"
|
|
2549
|
+
}, e[3] = h) : h = e[3];
|
|
2550
|
+
let [g, _] = B(h), v;
|
|
2551
|
+
e[4] === Symbol.for("react.memo_cache_sentinel") ? (v = [], e[4] = v) : v = e[4];
|
|
2552
|
+
let [y, b] = B(v), x = g.state === "exiting" ? d : p, S = p === u.length - 1, C = u[x], w;
|
|
2553
|
+
e[5] === Symbol.for("react.memo_cache_sentinel") ? (w = () => {
|
|
2554
|
+
b([]), m(0), _({
|
|
2555
|
+
state: "exiting",
|
|
2556
|
+
direction: "next"
|
|
2557
|
+
});
|
|
2558
|
+
}, e[5] = w) : w = e[5];
|
|
2559
|
+
let T;
|
|
2560
|
+
e[6] !== p || e[7] !== u ? (T = (e) => {
|
|
2561
|
+
b(e);
|
|
2562
|
+
let t = u.findIndex((t) => e.some((e) => e.param === t.content.key));
|
|
2563
|
+
t !== -1 && t !== p && (m(t), _({
|
|
2564
|
+
state: "exiting",
|
|
2565
|
+
direction: "next"
|
|
2566
|
+
}));
|
|
2567
|
+
}, e[6] = p, e[7] = u, e[8] = T) : T = e[8];
|
|
2568
|
+
let { methods: E, handleContentId: D, isError: O, allFormValues: k, contentId: A, isLoading: j, handleSubmit: M, showSuccessOverlay: N, dismissSuccessOverlay: P } = Mr({
|
|
2569
|
+
schema: n,
|
|
2570
|
+
saveToRemote: S,
|
|
2571
|
+
setFormErrorAfterSubmit: !1,
|
|
2572
|
+
onSubmitSuccess: w,
|
|
2573
|
+
onSubmit: () => {
|
|
2574
|
+
b((e) => e.filter((e) => e?.param !== C?.content?.key)), W();
|
|
2575
|
+
},
|
|
2576
|
+
onSubmitError: T
|
|
2577
|
+
}), { setFocus: F, setError: I, formState: R } = E, { isSubmitting: z } = R, V;
|
|
2578
|
+
e[9] !== g.state || e[10] !== S || e[11] !== u.length ? (V = () => {
|
|
2579
|
+
g.state === "entered" && (S || (m((e) => Math.min(e + 1, u.length - 1)), _({
|
|
2580
|
+
state: "exiting",
|
|
2581
|
+
direction: "next"
|
|
2582
|
+
})));
|
|
2583
|
+
}, e[9] = g.state, e[10] = S, e[11] = u.length, e[12] = V) : V = e[12];
|
|
2584
|
+
let W = V, G;
|
|
2585
|
+
e[13] !== g.state || e[14] !== p ? (G = () => {
|
|
2586
|
+
g.state === "entered" && (p <= 0 || (m(yi), _({
|
|
2587
|
+
state: "exiting",
|
|
2588
|
+
direction: "prev"
|
|
2589
|
+
})));
|
|
2590
|
+
}, e[13] = g.state, e[14] = p, e[15] = G) : G = e[15];
|
|
2591
|
+
let K = G, q;
|
|
2592
|
+
e[16] !== g.direction || e[17] !== g.state || e[18] !== C || e[19] !== p || e[20] !== F ? (q = () => {
|
|
2593
|
+
g.state === "exiting" ? (f(p), _({
|
|
2594
|
+
state: "entering",
|
|
2595
|
+
direction: g.direction
|
|
2596
|
+
})) : g.state === "entering" && (_({
|
|
2597
|
+
state: "entered",
|
|
2598
|
+
direction: g.direction
|
|
2599
|
+
}), C?.content?.key && F(C.content.key));
|
|
2600
|
+
}, e[16] = g.direction, e[17] = g.state, e[18] = C, e[19] = p, e[20] = F, e[21] = q) : q = e[21];
|
|
2601
|
+
let J = q, Y;
|
|
2602
|
+
e[22] !== C || e[23] !== y || e[24] !== I ? (Y = () => {
|
|
2603
|
+
if (C && y?.length > 0) {
|
|
2604
|
+
let e = y?.find((e) => e?.param === C?.content?.key);
|
|
2605
|
+
e && I(e?.param, {
|
|
2606
|
+
type: "server_error",
|
|
2607
|
+
message: e?.message
|
|
2608
|
+
});
|
|
2609
|
+
}
|
|
2610
|
+
}, e[22] = C, e[23] = y, e[24] = I, e[25] = Y) : Y = e[25];
|
|
2611
|
+
let X;
|
|
2612
|
+
if (e[26] !== C || e[27] !== y ? (X = [C, y], e[26] = C, e[27] = y, e[28] = X) : X = e[28], L(Y, X), !n || u.length === 0) return null;
|
|
2613
|
+
if (N) {
|
|
2614
|
+
let t;
|
|
2615
|
+
return e[29] === P ? t = e[30] : (t = /* @__PURE__ */ H($r, { onDismiss: P }), e[29] = P, e[30] = t), t;
|
|
2616
|
+
}
|
|
2617
|
+
let ee = z || j, Z = A || "", te;
|
|
2618
|
+
e[31] !== k || e[32] !== D || e[33] !== O || e[34] !== Z ? (te = /* @__PURE__ */ H(ei, {
|
|
2619
|
+
getContentId: D,
|
|
2620
|
+
isError: O,
|
|
2621
|
+
contentId: Z,
|
|
2622
|
+
allFormValues: k
|
|
2623
|
+
}), e[31] = k, e[32] = D, e[33] = O, e[34] = Z, e[35] = te) : te = e[35];
|
|
2624
|
+
let ne;
|
|
2625
|
+
e[36] === Symbol.for("react.memo_cache_sentinel") ? (ne = /* @__PURE__ */ H(Vr, { className: hi }), e[36] = ne) : ne = e[36];
|
|
2626
|
+
let ie = C?.sectionLabel, ae;
|
|
2627
|
+
e[37] === ie ? ae = e[38] : (ae = /* @__PURE__ */ H(Ur, {
|
|
2628
|
+
className: mi,
|
|
2629
|
+
children: ie
|
|
2630
|
+
}), e[37] = ie, e[38] = ae);
|
|
2631
|
+
let oe = u?.length || 1, se = Array.isArray(y) && y?.length > 0, ce;
|
|
2632
|
+
e[39] !== p || e[40] !== oe || e[41] !== se ? (ce = /* @__PURE__ */ H(di, {
|
|
2633
|
+
currentStepIndex: p,
|
|
2634
|
+
totalSteps: oe,
|
|
2635
|
+
hasLevoErrors: se
|
|
2636
|
+
}), e[39] = p, e[40] = oe, e[41] = se, e[42] = ce) : ce = e[42];
|
|
2637
|
+
let le;
|
|
2638
|
+
e[43] !== ae || e[44] !== ce ? (le = /* @__PURE__ */ U("div", {
|
|
2639
|
+
className: fi,
|
|
2640
|
+
children: [
|
|
2641
|
+
ne,
|
|
2642
|
+
ae,
|
|
2643
|
+
ce
|
|
2644
|
+
]
|
|
2645
|
+
}), e[43] = ae, e[44] = ce, e[45] = le) : le = e[45];
|
|
2646
|
+
let ue;
|
|
2647
|
+
e[46] === a ? ue = e[47] : (ue = $(pi, a), e[46] = a, e[47] = ue);
|
|
2648
|
+
let de;
|
|
2649
|
+
e[48] !== g.direction || e[49] !== g.state || e[50] !== C || e[51] !== t || e[52] !== s || e[53] !== J || e[54] !== K || e[55] !== M || e[56] !== ee || e[57] !== S || e[58] !== p || e[59] !== c || e[60] !== n || e[61] !== i?.show || e[62] !== i?.styles || e[63] !== i?.text || e[64] !== r ? (de = C && /* @__PURE__ */ H("div", {
|
|
2650
|
+
className: "_1ypxmcv6",
|
|
2651
|
+
"data-state": g.state,
|
|
2652
|
+
"data-direction": g.direction,
|
|
2653
|
+
onAnimationEnd: J,
|
|
2654
|
+
children: /* @__PURE__ */ U("form", {
|
|
2655
|
+
onSubmit: M,
|
|
2656
|
+
className: "_1ypxmcv7",
|
|
2657
|
+
children: [
|
|
2658
|
+
/* @__PURE__ */ H(cr, {
|
|
2659
|
+
field: C.content,
|
|
2660
|
+
schema: n,
|
|
2661
|
+
widgets: r,
|
|
2662
|
+
settings: { enableVerification: s }
|
|
2663
|
+
}),
|
|
2664
|
+
!t && !c && S && /* @__PURE__ */ H(Rr, {}),
|
|
2665
|
+
/* @__PURE__ */ U("div", {
|
|
2666
|
+
className: "_1ypxmcv8",
|
|
2667
|
+
children: [/* @__PURE__ */ H("div", { className: "_1ypxmcv9" }), /* @__PURE__ */ U("div", {
|
|
2668
|
+
className: "_1ypxmcva",
|
|
2669
|
+
children: [/* @__PURE__ */ U(o, {
|
|
2670
|
+
type: "button",
|
|
2671
|
+
onClick: K,
|
|
2672
|
+
size: "lg",
|
|
2673
|
+
disabled: p === 0 || ee || g.state !== "entered",
|
|
2674
|
+
variant: "ghost",
|
|
2675
|
+
children: [/* @__PURE__ */ H(re, {
|
|
2676
|
+
size: 18,
|
|
2677
|
+
className: "mr-2"
|
|
2678
|
+
}), "Prev"]
|
|
2679
|
+
}), (!S || i?.show !== !1) && /* @__PURE__ */ H(o, {
|
|
2680
|
+
type: "submit",
|
|
2681
|
+
size: "lg",
|
|
2682
|
+
className: i?.styles,
|
|
2683
|
+
disabled: ee || g.state !== "entered",
|
|
2684
|
+
children: ee ? "Saving..." : S ? i?.text || "Submit" : "Next"
|
|
2685
|
+
})]
|
|
2686
|
+
})]
|
|
2687
|
+
})
|
|
2688
|
+
]
|
|
2689
|
+
})
|
|
2690
|
+
}, C.id), e[48] = g.direction, e[49] = g.state, e[50] = C, e[51] = t, e[52] = s, e[53] = J, e[54] = K, e[55] = M, e[56] = ee, e[57] = S, e[58] = p, e[59] = c, e[60] = n, e[61] = i?.show, e[62] = i?.styles, e[63] = i?.text, e[64] = r, e[65] = de) : de = e[65];
|
|
2691
|
+
let fe;
|
|
2692
|
+
e[66] !== ue || e[67] !== de ? (fe = /* @__PURE__ */ H("div", {
|
|
2693
|
+
className: ue,
|
|
2694
|
+
children: de
|
|
2695
|
+
}), e[66] = ue, e[67] = de, e[68] = fe) : fe = e[68];
|
|
2696
|
+
let pe;
|
|
2697
|
+
return e[69] !== E || e[70] !== te || e[71] !== le || e[72] !== fe ? (pe = /* @__PURE__ */ U(ve, {
|
|
2698
|
+
...E,
|
|
2699
|
+
children: [
|
|
2700
|
+
te,
|
|
2701
|
+
le,
|
|
2702
|
+
fe
|
|
2703
|
+
]
|
|
2704
|
+
}), e[69] = E, e[70] = te, e[71] = le, e[72] = fe, e[73] = pe) : pe = e[73], pe;
|
|
2705
|
+
};
|
|
2706
|
+
function _i(e) {
|
|
2707
|
+
return !e.hidden;
|
|
2708
|
+
}
|
|
2709
|
+
function vi(e) {
|
|
2710
|
+
return (e.fields?.filter(_i) || []).map((t) => ({
|
|
2711
|
+
id: t.key,
|
|
2712
|
+
content: t,
|
|
2713
|
+
sectionId: e.id || "",
|
|
2714
|
+
sectionLabel: e.label
|
|
2715
|
+
}));
|
|
2716
|
+
}
|
|
2717
|
+
function yi(e) {
|
|
2718
|
+
return Math.max(e - 1, 0);
|
|
2719
|
+
}
|
|
2720
|
+
//#endregion
|
|
2721
|
+
//#region ../../libraries/react-collection/dist/lib/variants/StepFormVariant2/StepFormVariant2.cssm.js
|
|
2722
|
+
var bi = "zlgzzn0", xi = "zlgzzn1", Si = "zlgzznb", Ci = "zlgzznc", wi = () => {
|
|
2723
|
+
let e = Q(85), { disableCaptcha: t, schema: n, widgets: r, submitButtonConfig: i, containerStyles: a, enableVerification: s, preview: c } = Dr();
|
|
2724
|
+
n?.sections;
|
|
2725
|
+
let l;
|
|
2726
|
+
e[0] === n?.sections ? l = e[1] : (l = n?.sections?.filter(Ti) || [], e[0] = n?.sections, e[1] = l);
|
|
2727
|
+
let u = l, [d, f] = B(0), [p, m] = B(0), h;
|
|
2728
|
+
e[2] === Symbol.for("react.memo_cache_sentinel") ? (h = {
|
|
2729
|
+
state: "entered",
|
|
2730
|
+
direction: "next"
|
|
2731
|
+
}, e[2] = h) : h = e[2];
|
|
2732
|
+
let [g, _] = B(h), v;
|
|
2733
|
+
e[3] === Symbol.for("react.memo_cache_sentinel") ? (v = [], e[3] = v) : v = e[3];
|
|
2734
|
+
let [y, b] = B(v), x = g.state === "exiting" ? d : p, S = u[x], C = p === u.length - 1, w;
|
|
2735
|
+
bb0: {
|
|
2736
|
+
if (n) {
|
|
2737
|
+
let t;
|
|
2738
|
+
if (e[4] !== S || e[5] !== n) {
|
|
2739
|
+
if (t = { ...n }, S && t) {
|
|
2740
|
+
let n;
|
|
2741
|
+
e[7] === S ? n = e[8] : (n = [S], e[7] = S, e[8] = n), t.sections = n;
|
|
2742
|
+
}
|
|
2743
|
+
e[4] = S, e[5] = n, e[6] = t;
|
|
2744
|
+
} else t = e[6];
|
|
2745
|
+
w = t;
|
|
2746
|
+
break bb0;
|
|
2747
|
+
}
|
|
2748
|
+
w = null;
|
|
2749
|
+
}
|
|
2750
|
+
let T = w, E;
|
|
2751
|
+
e[9] === Symbol.for("react.memo_cache_sentinel") ? (E = () => {
|
|
2752
|
+
b([]), m(0), _({
|
|
2753
|
+
state: "exiting",
|
|
2754
|
+
direction: "next"
|
|
2755
|
+
});
|
|
2756
|
+
}, e[9] = E) : E = e[9];
|
|
2757
|
+
let D;
|
|
2758
|
+
e[10] !== p || e[11] !== u ? (D = (e) => {
|
|
2759
|
+
if (b(e), Array.isArray(e) && e.length > 0) {
|
|
2760
|
+
let t = u.findIndex((t) => t.fields?.some((t) => e.some((e) => e.param === t.key)));
|
|
2761
|
+
t !== -1 && t !== p && (m(t), _({
|
|
2762
|
+
state: "exiting",
|
|
2763
|
+
direction: "next"
|
|
2764
|
+
}));
|
|
2765
|
+
}
|
|
2766
|
+
}, e[10] = p, e[11] = u, e[12] = D) : D = e[12];
|
|
2767
|
+
let { methods: O, handleContentId: k, isError: A, allFormValues: j, contentId: M, isLoading: N, handleSubmit: P, showSuccessOverlay: F, dismissSuccessOverlay: I } = Mr({
|
|
2768
|
+
schema: T,
|
|
2769
|
+
originalSchema: n,
|
|
2770
|
+
saveToRemote: C,
|
|
2771
|
+
setFormErrorAfterSubmit: !1,
|
|
2772
|
+
onSubmitSuccess: E,
|
|
2773
|
+
onSubmit: () => {
|
|
2774
|
+
b((e) => {
|
|
2775
|
+
let t = S?.fields?.map(Ei) || [];
|
|
2776
|
+
return e.filter((e) => !t.includes(e.param));
|
|
2777
|
+
}), J();
|
|
2778
|
+
},
|
|
2779
|
+
onSubmitError: D
|
|
2780
|
+
}), { setFocus: R, setError: z, formState: V } = O, { isSubmitting: W } = V, G;
|
|
2781
|
+
e[13] === O ? G = e[14] : (G = O.watch("__captcha"), e[13] = O, e[14] = G);
|
|
2782
|
+
let K = G, q;
|
|
2783
|
+
e[15] !== g.state || e[16] !== C || e[17] !== u.length ? (q = () => {
|
|
2784
|
+
g.state === "entered" && (C || (m((e) => Math.min(e + 1, u.length - 1)), _({
|
|
2785
|
+
state: "exiting",
|
|
2786
|
+
direction: "next"
|
|
2787
|
+
})));
|
|
2788
|
+
}, e[15] = g.state, e[16] = C, e[17] = u.length, e[18] = q) : q = e[18];
|
|
2789
|
+
let J = q, Y;
|
|
2790
|
+
e[19] !== g.state || e[20] !== p ? (Y = () => {
|
|
2791
|
+
g.state === "entered" && (p <= 0 || (m(Di), _({
|
|
2792
|
+
state: "exiting",
|
|
2793
|
+
direction: "prev"
|
|
2794
|
+
})));
|
|
2795
|
+
}, e[19] = g.state, e[20] = p, e[21] = Y) : Y = e[21];
|
|
2796
|
+
let X = Y, ee;
|
|
2797
|
+
e[22] !== g.direction || e[23] !== g.state || e[24] !== S || e[25] !== p || e[26] !== R ? (ee = () => {
|
|
2798
|
+
g.state === "exiting" ? (f(p), _({
|
|
2799
|
+
state: "entering",
|
|
2800
|
+
direction: g.direction
|
|
2801
|
+
})) : g.state === "entering" && (_({
|
|
2802
|
+
state: "entered",
|
|
2803
|
+
direction: g.direction
|
|
2804
|
+
}), S?.fields?.[0]?.key && R(S.fields[0].key));
|
|
2805
|
+
}, e[22] = g.direction, e[23] = g.state, e[24] = S, e[25] = p, e[26] = R, e[27] = ee) : ee = e[27];
|
|
2806
|
+
let Z = ee, te;
|
|
2807
|
+
e[28] !== g.state || e[29] !== S || e[30] !== y || e[31] !== z ? (te = () => {
|
|
2808
|
+
y?.length > 0 && S?.fields && g?.state === "entered" && y.forEach((e) => {
|
|
2809
|
+
S.fields?.some((t) => t.key === e.param) && z(e?.param, {
|
|
2810
|
+
type: "server_error",
|
|
2811
|
+
message: e?.message
|
|
2812
|
+
});
|
|
2813
|
+
});
|
|
2814
|
+
}, e[28] = g.state, e[29] = S, e[30] = y, e[31] = z, e[32] = te) : te = e[32];
|
|
2815
|
+
let ne;
|
|
2816
|
+
if (e[33] !== g || e[34] !== S || e[35] !== y || e[36] !== z ? (ne = [
|
|
2817
|
+
y,
|
|
2818
|
+
z,
|
|
2819
|
+
S,
|
|
2820
|
+
g
|
|
2821
|
+
], e[33] = g, e[34] = S, e[35] = y, e[36] = z, e[37] = ne) : ne = e[37], L(te, ne), !n || u.length === 0) return null;
|
|
2822
|
+
if (F) {
|
|
2823
|
+
let t;
|
|
2824
|
+
return e[38] === I ? t = e[39] : (t = /* @__PURE__ */ H($r, { onDismiss: I }), e[38] = I, e[39] = t), t;
|
|
2825
|
+
}
|
|
2826
|
+
let ie = W || N || K === "verifying" && C, ae = M || "", oe;
|
|
2827
|
+
e[40] !== j || e[41] !== k || e[42] !== A || e[43] !== ae ? (oe = /* @__PURE__ */ H(ei, {
|
|
2828
|
+
getContentId: k,
|
|
2829
|
+
isError: A,
|
|
2830
|
+
contentId: ae,
|
|
2831
|
+
allFormValues: j
|
|
2832
|
+
}), e[40] = j, e[41] = k, e[42] = A, e[43] = ae, e[44] = oe) : oe = e[44];
|
|
2833
|
+
let se;
|
|
2834
|
+
e[45] === Symbol.for("react.memo_cache_sentinel") ? (se = /* @__PURE__ */ H(Vr, { className: Ci }), e[45] = se) : se = e[45];
|
|
2835
|
+
let ce = S?.label, le;
|
|
2836
|
+
e[46] === ce ? le = e[47] : (le = /* @__PURE__ */ H(Ur, {
|
|
2837
|
+
className: Si,
|
|
2838
|
+
children: ce
|
|
2839
|
+
}), e[46] = ce, e[47] = le);
|
|
2840
|
+
let ue = u?.length || 1, de = Array.isArray(y) && y?.length > 0, fe;
|
|
2841
|
+
e[48] !== p || e[49] !== ue || e[50] !== de ? (fe = /* @__PURE__ */ H(di, {
|
|
2842
|
+
currentStepIndex: p,
|
|
2843
|
+
totalSteps: ue,
|
|
2844
|
+
hasLevoErrors: de
|
|
2845
|
+
}), e[48] = p, e[49] = ue, e[50] = de, e[51] = fe) : fe = e[51];
|
|
2846
|
+
let pe;
|
|
2847
|
+
e[52] !== le || e[53] !== fe ? (pe = /* @__PURE__ */ U("div", {
|
|
2848
|
+
className: bi,
|
|
2849
|
+
children: [
|
|
2850
|
+
se,
|
|
2851
|
+
le,
|
|
2852
|
+
fe
|
|
2853
|
+
]
|
|
2854
|
+
}), e[52] = le, e[53] = fe, e[54] = pe) : pe = e[54];
|
|
2855
|
+
let me;
|
|
2856
|
+
e[55] === a ? me = e[56] : (me = $(xi, a), e[55] = a, e[56] = me);
|
|
2857
|
+
let he;
|
|
2858
|
+
e[57] !== g.direction || e[58] !== g.state || e[59] !== K || e[60] !== S || e[61] !== t || e[62] !== x || e[63] !== s || e[64] !== Z || e[65] !== X || e[66] !== P || e[67] !== ie || e[68] !== C || e[69] !== p || e[70] !== c || e[71] !== n || e[72] !== i?.show || e[73] !== i?.styles || e[74] !== i?.text || e[75] !== r ? (he = S && /* @__PURE__ */ H("div", {
|
|
2859
|
+
className: "zlgzzn6",
|
|
2860
|
+
"data-state": g.state,
|
|
2861
|
+
"data-direction": g.direction,
|
|
2862
|
+
onAnimationEnd: Z,
|
|
2863
|
+
children: /* @__PURE__ */ U("form", {
|
|
2864
|
+
onSubmit: P,
|
|
2865
|
+
className: "zlgzzn7",
|
|
2866
|
+
children: [
|
|
2867
|
+
S.fields?.map((e) => e.hidden ? null : /* @__PURE__ */ H(cr, {
|
|
2868
|
+
field: e,
|
|
2869
|
+
schema: n,
|
|
2870
|
+
widgets: r,
|
|
2871
|
+
settings: { enableVerification: s }
|
|
2872
|
+
}, e.key)),
|
|
2873
|
+
!t && !c && C && /* @__PURE__ */ H(Rr, {}),
|
|
2874
|
+
/* @__PURE__ */ U("div", {
|
|
2875
|
+
className: "zlgzzn8",
|
|
2876
|
+
children: [/* @__PURE__ */ H("div", { className: "zlgzzn9" }), /* @__PURE__ */ U("div", {
|
|
2877
|
+
className: "zlgzzna",
|
|
2878
|
+
children: [/* @__PURE__ */ U(o, {
|
|
2879
|
+
type: "button",
|
|
2880
|
+
onClick: X,
|
|
2881
|
+
size: "lg",
|
|
2882
|
+
disabled: p === 0 || ie || g.state !== "entered",
|
|
2883
|
+
variant: "ghost",
|
|
2884
|
+
children: [/* @__PURE__ */ H(re, {
|
|
2885
|
+
size: 18,
|
|
2886
|
+
className: "mr-2"
|
|
2887
|
+
}), "Prev"]
|
|
2888
|
+
}), (!C || i?.show !== !1) && /* @__PURE__ */ H(o, {
|
|
2889
|
+
type: "submit",
|
|
2890
|
+
size: "lg",
|
|
2891
|
+
className: i?.styles,
|
|
2892
|
+
disabled: ie || g.state !== "entered",
|
|
2893
|
+
children: ie ? K === "verifying" ? "Verifying..." : "Saving..." : C ? i?.text || "Save" : "Next"
|
|
2894
|
+
})]
|
|
2895
|
+
})]
|
|
2896
|
+
})
|
|
2897
|
+
]
|
|
2898
|
+
})
|
|
2899
|
+
}, S.id || x), e[57] = g.direction, e[58] = g.state, e[59] = K, e[60] = S, e[61] = t, e[62] = x, e[63] = s, e[64] = Z, e[65] = X, e[66] = P, e[67] = ie, e[68] = C, e[69] = p, e[70] = c, e[71] = n, e[72] = i?.show, e[73] = i?.styles, e[74] = i?.text, e[75] = r, e[76] = he) : he = e[76];
|
|
2900
|
+
let ge;
|
|
2901
|
+
e[77] !== me || e[78] !== he ? (ge = /* @__PURE__ */ H("div", {
|
|
2902
|
+
className: me,
|
|
2903
|
+
children: he
|
|
2904
|
+
}), e[77] = me, e[78] = he, e[79] = ge) : ge = e[79];
|
|
2905
|
+
let _e;
|
|
2906
|
+
return e[80] !== O || e[81] !== oe || e[82] !== pe || e[83] !== ge ? (_e = /* @__PURE__ */ U(ve, {
|
|
2907
|
+
...O,
|
|
2908
|
+
children: [
|
|
2909
|
+
oe,
|
|
2910
|
+
pe,
|
|
2911
|
+
ge
|
|
2912
|
+
]
|
|
2913
|
+
}), e[80] = O, e[81] = oe, e[82] = pe, e[83] = ge, e[84] = _e) : _e = e[84], _e;
|
|
2914
|
+
};
|
|
2915
|
+
function Ti(e) {
|
|
2916
|
+
return !m(e?.fields || []);
|
|
2917
|
+
}
|
|
2918
|
+
function Ei(e) {
|
|
2919
|
+
return e.key;
|
|
2920
|
+
}
|
|
2921
|
+
function Di(e) {
|
|
2922
|
+
return Math.max(e - 1, 0);
|
|
2923
|
+
}
|
|
2924
|
+
//#endregion
|
|
2925
|
+
//#region ../../libraries/react-collection/dist/lib/variants/StepsFormVariant/StepsFormVariant.cssm.js
|
|
2926
|
+
var Oi = "_1f3ynb50", ki = "_1f3ynb54", Ai = "_1f3ynb55", ji = () => {
|
|
2927
|
+
let e = Q(6), [t, n] = B(0), { containerStyles: r } = Dr(), i;
|
|
2928
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (i = () => {
|
|
2929
|
+
n(Ni);
|
|
2930
|
+
}, e[0] = i) : i = e[0];
|
|
2931
|
+
let a = i, o;
|
|
2932
|
+
e[1] === Symbol.for("react.memo_cache_sentinel") ? (o = () => {
|
|
2933
|
+
n(Pi);
|
|
2934
|
+
}, e[1] = o) : o = e[1];
|
|
2935
|
+
let s = o, c;
|
|
2936
|
+
e[2] === Symbol.for("react.memo_cache_sentinel") ? (c = (e) => {
|
|
2937
|
+
n(e);
|
|
2938
|
+
}, e[2] = c) : c = e[2];
|
|
2939
|
+
let l = c, u;
|
|
2940
|
+
return e[3] !== r || e[4] !== t ? (u = /* @__PURE__ */ H(Mi, {
|
|
2941
|
+
currentSectionIndex: t,
|
|
2942
|
+
handleNext: s,
|
|
2943
|
+
handlePrev: a,
|
|
2944
|
+
goToIndex: l,
|
|
2945
|
+
containerStyles: r
|
|
2946
|
+
}), e[3] = r, e[4] = t, e[5] = u) : u = e[5], u;
|
|
2947
|
+
}, Mi = (e) => {
|
|
2948
|
+
let t = Q(83), { containerStyles: n, currentSectionIndex: r, handleNext: i, handlePrev: a, goToIndex: s } = e, { schema: c, disableCaptcha: l, isDisabled: u, submitButtonConfig: d, widgets: f, enableVerification: p, preview: m } = Dr(), h;
|
|
2949
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (h = [], t[0] = h) : h = t[0];
|
|
2950
|
+
let [g, _] = B(h);
|
|
2951
|
+
c?.sections;
|
|
2952
|
+
let v;
|
|
2953
|
+
t[1] === c?.sections ? v = t[2] : (v = c?.sections?.filter(Fi) || [], t[1] = c?.sections, t[2] = v);
|
|
2954
|
+
let y = v, b = y?.[r], x;
|
|
2955
|
+
bb0: {
|
|
2956
|
+
if (c) {
|
|
2957
|
+
let e;
|
|
2958
|
+
if (t[3] !== b || t[4] !== c) {
|
|
2959
|
+
if (e = { ...c }, b && e) {
|
|
2960
|
+
let n;
|
|
2961
|
+
t[6] === b ? n = t[7] : (n = [b], t[6] = b, t[7] = n), e.sections = n;
|
|
2962
|
+
}
|
|
2963
|
+
t[3] = b, t[4] = c, t[5] = e;
|
|
2964
|
+
} else e = t[5];
|
|
2965
|
+
x = e;
|
|
2966
|
+
break bb0;
|
|
2967
|
+
}
|
|
2968
|
+
x = null;
|
|
2969
|
+
}
|
|
2970
|
+
let S = x, C = r === Number(y?.length) - 1, w;
|
|
2971
|
+
t[8] !== b?.fields || t[9] !== i ? (w = () => {
|
|
2972
|
+
_((e) => {
|
|
2973
|
+
let t = b?.fields?.map(Ii) || [];
|
|
2974
|
+
return e.filter((e) => !t.includes(e.param));
|
|
2975
|
+
}), i();
|
|
2976
|
+
}, t[8] = b?.fields, t[9] = i, t[10] = w) : w = t[10];
|
|
2977
|
+
let T;
|
|
2978
|
+
t[11] === s ? T = t[12] : (T = () => {
|
|
2979
|
+
_([]), s(0);
|
|
2980
|
+
}, t[11] = s, t[12] = T);
|
|
2981
|
+
let E;
|
|
2982
|
+
t[13] !== s || t[14] !== y ? (E = (e) => {
|
|
2983
|
+
if (_(e), Array.isArray(e) && e.length > 0) {
|
|
2984
|
+
let t = y.findIndex((t) => t.fields?.some((t) => e.some((e) => e.param === t.key)));
|
|
2985
|
+
t !== -1 && s(t);
|
|
2986
|
+
}
|
|
2987
|
+
}, t[13] = s, t[14] = y, t[15] = E) : E = t[15];
|
|
2988
|
+
let D;
|
|
2989
|
+
t[16] !== C || t[17] !== c || t[18] !== S || t[19] !== w || t[20] !== T || t[21] !== E ? (D = {
|
|
2990
|
+
schema: S,
|
|
2991
|
+
originalSchema: c,
|
|
2992
|
+
saveToRemote: C,
|
|
2993
|
+
setFormErrorAfterSubmit: !1,
|
|
2994
|
+
onSubmit: w,
|
|
2995
|
+
onSubmitSuccess: T,
|
|
2996
|
+
onSubmitError: E
|
|
2997
|
+
}, t[16] = C, t[17] = c, t[18] = S, t[19] = w, t[20] = T, t[21] = E, t[22] = D) : D = t[22];
|
|
2998
|
+
let { methods: O, handleSubmit: k, isLoading: A, handleContentId: j, isError: M, contentId: N, allFormValues: P, showSuccessOverlay: F, dismissSuccessOverlay: I } = Mr(D), { setError: R, formState: z } = O, { isSubmitting: V } = z, W;
|
|
2999
|
+
t[23] === O ? W = t[24] : (W = O.watch("__captcha"), t[23] = O, t[24] = W);
|
|
3000
|
+
let G = W, K, q;
|
|
3001
|
+
if (t[25] !== b || t[26] !== g || t[27] !== R ? (K = () => {
|
|
3002
|
+
g?.length > 0 && b?.fields && g.forEach((e) => {
|
|
3003
|
+
b.fields?.some((t) => t.key === e.param) && R(e?.param, {
|
|
3004
|
+
type: "server_error",
|
|
3005
|
+
message: e?.message
|
|
3006
|
+
});
|
|
3007
|
+
});
|
|
3008
|
+
}, q = [
|
|
3009
|
+
g,
|
|
3010
|
+
R,
|
|
3011
|
+
b
|
|
3012
|
+
], t[25] = b, t[26] = g, t[27] = R, t[28] = K, t[29] = q) : (K = t[28], q = t[29]), L(K, q), F) {
|
|
3013
|
+
let e;
|
|
3014
|
+
return t[30] === I ? e = t[31] : (e = /* @__PURE__ */ H($r, { onDismiss: I }), t[30] = I, t[31] = e), e;
|
|
3015
|
+
}
|
|
3016
|
+
let J = V || G === "verifying" && C, Y = N || "", X;
|
|
3017
|
+
t[32] !== P || t[33] !== j || t[34] !== M || t[35] !== Y ? (X = /* @__PURE__ */ H(ei, {
|
|
3018
|
+
getContentId: j,
|
|
3019
|
+
isError: M,
|
|
3020
|
+
contentId: Y,
|
|
3021
|
+
allFormValues: P
|
|
3022
|
+
}), t[32] = P, t[33] = j, t[34] = M, t[35] = Y, t[36] = X) : X = t[36];
|
|
3023
|
+
let ee = A && "_1f3ynb51", Z;
|
|
3024
|
+
t[37] !== n || t[38] !== ee ? (Z = $(Oi, n, ee), t[37] = n, t[38] = ee, t[39] = Z) : Z = t[39];
|
|
3025
|
+
let te;
|
|
3026
|
+
t[40] === Symbol.for("react.memo_cache_sentinel") ? (te = /* @__PURE__ */ H(Vr, {}), t[40] = te) : te = t[40];
|
|
3027
|
+
let ne = b?.label || "Details", re;
|
|
3028
|
+
t[41] === ne ? re = t[42] : (re = /* @__PURE__ */ H("span", { children: ne }), t[41] = ne, t[42] = re);
|
|
3029
|
+
let ie = r + 1, ae = y?.length || 1, oe;
|
|
3030
|
+
t[43] !== ie || t[44] !== ae ? (oe = /* @__PURE__ */ U("span", { children: [
|
|
3031
|
+
"Step ",
|
|
3032
|
+
ie,
|
|
3033
|
+
"/",
|
|
3034
|
+
ae
|
|
3035
|
+
] }), t[43] = ie, t[44] = ae, t[45] = oe) : oe = t[45];
|
|
3036
|
+
let se;
|
|
3037
|
+
t[46] !== re || t[47] !== oe ? (se = /* @__PURE__ */ U(Ur, { children: [re, oe] }), t[46] = re, t[47] = oe, t[48] = se) : se = t[48];
|
|
3038
|
+
let ce;
|
|
3039
|
+
t[49] !== b?.fields || t[50] !== p || t[51] !== c || t[52] !== f ? (ce = b?.fields?.map((e) => e && !e.hidden ? /* @__PURE__ */ H(cr, {
|
|
3040
|
+
field: e,
|
|
3041
|
+
widgets: f,
|
|
3042
|
+
schema: c,
|
|
3043
|
+
settings: { enableVerification: p }
|
|
3044
|
+
}, e?.key) : null), t[49] = b?.fields, t[50] = p, t[51] = c, t[52] = f, t[53] = ce) : ce = t[53];
|
|
3045
|
+
let le;
|
|
3046
|
+
t[54] !== l || t[55] !== C || t[56] !== m ? (le = !l && !m && C && /* @__PURE__ */ H(Rr, {}), t[54] = l, t[55] = C, t[56] = m, t[57] = le) : le = t[57];
|
|
3047
|
+
let ue;
|
|
3048
|
+
t[58] !== G || t[59] !== r || t[60] !== a || t[61] !== C ? (ue = r === 0 ? /* @__PURE__ */ H("div", {}) : /* @__PURE__ */ H(o, {
|
|
3049
|
+
type: "button",
|
|
3050
|
+
size: "sm",
|
|
3051
|
+
variant: "secondary",
|
|
3052
|
+
disabled: G === "verifying" && C,
|
|
3053
|
+
onClick: () => {
|
|
3054
|
+
a();
|
|
3055
|
+
},
|
|
3056
|
+
children: "Prev"
|
|
3057
|
+
}), t[58] = G, t[59] = r, t[60] = a, t[61] = C, t[62] = ue) : ue = t[62];
|
|
3058
|
+
let de = u || J, fe = d?.styles, pe = J ? G === "verifying" ? "Verifying..." : "Saving..." : C ? d?.text || "Save" : "Next", me;
|
|
3059
|
+
t[63] !== de || t[64] !== fe || t[65] !== pe ? (me = /* @__PURE__ */ H(o, {
|
|
3060
|
+
type: "submit",
|
|
3061
|
+
size: "sm",
|
|
3062
|
+
disabled: de,
|
|
3063
|
+
className: fe,
|
|
3064
|
+
children: pe
|
|
3065
|
+
}), t[63] = de, t[64] = fe, t[65] = pe, t[66] = me) : me = t[66];
|
|
3066
|
+
let he;
|
|
3067
|
+
t[67] !== ue || t[68] !== me ? (he = /* @__PURE__ */ U("div", {
|
|
3068
|
+
className: ki,
|
|
3069
|
+
children: [ue, me]
|
|
3070
|
+
}), t[67] = ue, t[68] = me, t[69] = he) : he = t[69];
|
|
3071
|
+
let ge;
|
|
3072
|
+
t[70] !== ce || t[71] !== le || t[72] !== he ? (ge = /* @__PURE__ */ U("div", {
|
|
3073
|
+
className: Ai,
|
|
3074
|
+
children: [
|
|
3075
|
+
ce,
|
|
3076
|
+
le,
|
|
3077
|
+
he
|
|
3078
|
+
]
|
|
3079
|
+
}), t[70] = ce, t[71] = le, t[72] = he, t[73] = ge) : ge = t[73];
|
|
3080
|
+
let _e;
|
|
3081
|
+
t[74] !== k || t[75] !== Z || t[76] !== se || t[77] !== ge ? (_e = /* @__PURE__ */ U("form", {
|
|
3082
|
+
className: Z,
|
|
3083
|
+
id: "collection-form",
|
|
3084
|
+
onSubmit: k,
|
|
3085
|
+
children: [
|
|
3086
|
+
te,
|
|
3087
|
+
se,
|
|
3088
|
+
ge
|
|
3089
|
+
]
|
|
3090
|
+
}), t[74] = k, t[75] = Z, t[76] = se, t[77] = ge, t[78] = _e) : _e = t[78];
|
|
3091
|
+
let ye;
|
|
3092
|
+
return t[79] !== O || t[80] !== X || t[81] !== _e ? (ye = /* @__PURE__ */ U(ve, {
|
|
3093
|
+
...O,
|
|
3094
|
+
children: [X, _e]
|
|
3095
|
+
}), t[79] = O, t[80] = X, t[81] = _e, t[82] = ye) : ye = t[82], ye;
|
|
3096
|
+
};
|
|
3097
|
+
function Ni(e) {
|
|
3098
|
+
return e - 1;
|
|
3099
|
+
}
|
|
3100
|
+
function Pi(e) {
|
|
3101
|
+
return e + 1;
|
|
3102
|
+
}
|
|
3103
|
+
function Fi(e) {
|
|
3104
|
+
return !m(e?.fields || []);
|
|
3105
|
+
}
|
|
3106
|
+
function Ii(e) {
|
|
3107
|
+
return e.key;
|
|
3108
|
+
}
|
|
3109
|
+
//#endregion
|
|
3110
|
+
//#region ../../libraries/react-collection/dist/lib/FormBuilder/index.js
|
|
3111
|
+
var Li = (e) => {
|
|
3112
|
+
let t = Q(11), n, r, i;
|
|
3113
|
+
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({formVariant: n, enableVerification: i, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
3114
|
+
let a = i === void 0 ? !0 : i, o;
|
|
3115
|
+
t[4] === n ? o = t[5] : (o = H(n === "single-field" ? gi : n === "steps" ? ji : n === "steps-2" ? wi : si, {}), t[4] = n, t[5] = o);
|
|
3116
|
+
let s;
|
|
3117
|
+
return t[6] !== a || t[7] !== n || t[8] !== r || t[9] !== o ? (s = /* @__PURE__ */ H(Er, {
|
|
3118
|
+
...r,
|
|
3119
|
+
enableVerification: a,
|
|
3120
|
+
variant: n,
|
|
3121
|
+
children: o
|
|
3122
|
+
}), t[6] = a, t[7] = n, t[8] = r, t[9] = o, t[10] = s) : s = t[10], s;
|
|
3123
|
+
}, Ri = "_1jed92w2", zi = "_1jed92w3 _1jed92w1", Bi = "_1jed92w4 _1jed92w1", Vi = "_1jed92w5 _1jed92w1", Hi = "_1jed92w6 _1jed92w1", Ui = () => {
|
|
3124
|
+
let e = Q(1), t;
|
|
3125
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ U("div", {
|
|
3126
|
+
className: Ri,
|
|
3127
|
+
children: [
|
|
3128
|
+
/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("div", { className: zi }), /* @__PURE__ */ H("div", { className: Vi })] }),
|
|
3129
|
+
/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("div", { className: Bi }), /* @__PURE__ */ H("div", { className: Vi })] }),
|
|
3130
|
+
/* @__PURE__ */ H("div", { className: Hi })
|
|
3131
|
+
]
|
|
3132
|
+
}), e[0] = t) : t = e[0], t;
|
|
3133
|
+
}, Wi = (e) => {
|
|
3134
|
+
let t = Q(17), n, r, i, a;
|
|
3135
|
+
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4]) : ({collection_id: n, hiddenFields: r, enableVerification: a, ...i} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a);
|
|
3136
|
+
let o = a === void 0 ? !0 : a, { collection: s } = Z(), [c, l] = B(!0), [u, d] = B(null), f;
|
|
3137
|
+
t[5] !== s || t[6] !== n || t[7] !== r || t[8] !== i?.workspace_id ? (f = () => {
|
|
3138
|
+
n ? s?.getCollectionByIDExpanded(n, { headers: { "Levo-Workspace": i?.workspace_id } }).then((e) => {
|
|
3139
|
+
let t = e?.content?.data;
|
|
3140
|
+
if (t) t.sections = t?.sections?.map((e) => (e.fields = e?.fields?.map((e) => (r?.includes(e?.key) && (e.hidden = !0), e)), e)), d(t);
|
|
3141
|
+
else throw Error(`API response invalid: ${t}`);
|
|
3142
|
+
}).catch(Gi).finally(() => {
|
|
3143
|
+
l(!1);
|
|
3144
|
+
}) : (console.error("[CollectionFormBuilder] Collection ID or Workspace ID is missing."), l(!1));
|
|
3145
|
+
}, t[5] = s, t[6] = n, t[7] = r, t[8] = i?.workspace_id, t[9] = f) : f = t[9];
|
|
3146
|
+
let p;
|
|
3147
|
+
t[10] === n ? p = t[11] : (p = [n], t[10] = n, t[11] = p), L(f, p);
|
|
3148
|
+
let m;
|
|
3149
|
+
return t[12] !== o || t[13] !== c || t[14] !== i || t[15] !== u ? (m = c ? /* @__PURE__ */ H(Ui, {}) : u ? /* @__PURE__ */ H(Li, {
|
|
3150
|
+
schema: u,
|
|
3151
|
+
enableVerification: o,
|
|
3152
|
+
...i
|
|
3153
|
+
}) : null, t[12] = o, t[13] = c, t[14] = i, t[15] = u, t[16] = m) : m = t[16], m;
|
|
3154
|
+
};
|
|
3155
|
+
function Gi(e) {
|
|
3156
|
+
console.error("Error fetching schema", e);
|
|
3157
|
+
}
|
|
3158
|
+
//#endregion
|
|
3159
|
+
//#region ../../libraries/react-collection/dist/lib/CollectionFormRenderer/index.js
|
|
3160
|
+
var Ki = ({ hiddenFields: e, fetchedSchema: t, isLoading: n, enableVerification: r = !0, ...i }) => {
|
|
3161
|
+
let a = R(() => {
|
|
3162
|
+
let n = { ...t };
|
|
3163
|
+
return n.sections = n?.sections?.map((t) => (t.fields = t?.fields?.map((t) => ((e?.includes(t?.key) || e?.includes(t?.id)) && (t.hidden = !0), t)), t)), n;
|
|
3164
|
+
}, [t]);
|
|
3165
|
+
return n ? /* @__PURE__ */ H(Ui, {}) : a ? /* @__PURE__ */ H(Li, {
|
|
3166
|
+
schema: a,
|
|
3167
|
+
enableVerification: r,
|
|
3168
|
+
...i
|
|
3169
|
+
}) : null;
|
|
3170
|
+
}, qi = /* @__PURE__ */ Pe({
|
|
3171
|
+
CollectionForm: () => wr,
|
|
3172
|
+
CollectionFormBuilder: () => Wi,
|
|
3173
|
+
CollectionFormRenderer: () => Ki,
|
|
3174
|
+
FormBuilder: () => Li,
|
|
3175
|
+
LevoFormProvider: () => Er,
|
|
3176
|
+
useLevoForm: () => Mr,
|
|
3177
|
+
useLevoFormContext: () => Dr
|
|
3178
|
+
});
|
|
3179
|
+
//#endregion
|
|
3180
|
+
export { Mr as a, wr as c, cr as d, ar as f, Li as i, _r as l, Ki as n, Er as o, Et as p, Wi as r, Dr as s, qi as t, gr as u };
|