@levo-so/studio 0.3.20 → 0.3.22
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-ioR7mSo5.js +249 -0
- package/BookingCard-DEkBXh7O.js +646 -0
- package/DateTimeWidget-B-dajfHj.js +253 -0
- package/{EntryCard-9yv0KJTB.js → EntryCard-CZfljZAY.js} +4 -4
- package/{KBChatWidget-D39Z3HIl.js → KBChatWidget-BXRRgelS.js} +1 -1
- package/{LoginCard-D9vEC_g0.js → LoginCard-BVjeN1J0.js} +3 -3
- package/{LoginForm-kI_b_7Tc.js → LoginForm-DQVwLQCx.js} +19 -19
- package/{LoginModal-C-9BhmoO.js → LoginModal-C6TdAh-0.js} +5 -6
- package/{MessageCard-Nsxr98n6.js → MessageCard-B5MbVDJ8.js} +2 -2
- package/{MessageFooter-K4Zd_eFO.js → MessageFooter-DrlKXE9a.js} +1 -2
- package/{PendingApprovalCard-CzoBgYNy.js → PendingApprovalCard-5iFAeE1s.js} +3 -3
- package/{PhoneWidget-BtMMfGLu.js → PhoneWidget-B4KHlFjT.js} +6 -7
- package/{Popover-Iis-qOn1.js → Popover-y8XkbYNh.js} +7 -7
- package/{PopupBody-BI-MJqmd-B3ltSYMP.js → PopupBody-DWM55Zh5-DuOPsCAn.js} +53 -55
- package/PopupDialog-DwAAJ8JS-9xm5jrXW.js +261 -0
- package/PopupRenderer-BVtV4b9I-BdPryfLY.js +208 -0
- package/{ProfileCard-Chg20HBa.js → ProfileCard-WgFT-T4U.js} +5 -5
- package/{RichTextWidget-C3Y-0pNy.js → RichTextWidget-DKYm1cSW.js} +120 -123
- package/{Spinner-D5spB_Mv.js → Spinner-LdYfm4S7.js} +1 -1
- package/{VerifyButton-BwTbzSwS.js → VerifyButton-CNq78zG4.js} +5 -7
- package/collection.d.ts +9 -1
- package/collection.js +1 -1
- package/dialog-CU5nHKc5.js +119 -0
- package/dist-IMRD6dob.js +3858 -0
- package/index.js +3280 -2848
- package/{inlineRteTheme-BOAno9MG.js → inlineRteTheme-DFg69bqP.js} +50 -37
- package/{kbChat-zXbn56Zb.js → kbChat-eFsau7hG.js} +2 -2
- package/package.json +42 -43
- package/{pillChrome-QDjBETmP.js → pillChrome-Dy3ApFI5.js} +5 -5
- package/price-BUDkN5Me.js +823 -0
- package/script.esm-uVCZU25S.js +62 -0
- package/studio.css +1 -1
- package/themeMapping-DH_NoXK8-H-EHXbBt.js +156 -0
- package/useCheckout-gscmzFLD.js +179 -0
- package/useLogin-BYVekOp9.js +237 -0
- package/AuthProvider-B5NfFwbG.js +0 -118
- package/BillingStep-BTDOMFHV.js +0 -181
- package/Button-DXLWW3dp.js +0 -504
- package/CollectionField-BZmxRB5D.js +0 -270
- package/CollectionInput-DyNbxIZ8.js +0 -147
- package/DateTimeWidget-Bt1UcCnx.js +0 -255
- package/Dialog-CPE8yUqK.js +0 -130
- package/ModalManager-CzH36UIk.js +0 -32
- package/PopupRenderer-D66Gx63H-ChI4WBer.js +0 -389
- package/RteThemeProvider-owl5oajj.js +0 -20
- package/ThemeProvider-CqPHzkW9.js +0 -116
- package/Tooltip-DHU1QD-n.js +0 -67
- package/authentication-BXQbxiPP.js +0 -36
- package/bookingCard-g0n3ksiC.js +0 -605
- package/createThemeExtension-C0PSYy0J.js +0 -15
- package/dialog-8LH_ihs4.js +0 -92
- package/dist-Dijjo-5m.js +0 -3794
- package/generateRadiusScale-RROt8ppa.js +0 -71
- package/inlineCollectionTheme-uhBXoF1F.js +0 -19
- package/popupState-JmpeKzgM-UECLsSbL.js +0 -100
- package/rteTheme.cssm-W4gTOijw.js +0 -4
- package/theme.cssm-Czj9sF4X.js +0 -4
- package/themeMapping-Bi9Rcr5G-C7UXWE6o.js +0 -61
- package/useCheckout-DFalmfEQ.js +0 -161
- package/useLogin-CfnGrLdO.js +0 -127
- package/usePopupRedirect-CAAdcpaW-DdME0F7f.js +0 -82
- /package/{Beams-WJN38XSv.js → Beams-KsU_ixpY.js} +0 -0
- /package/{Dots-DggLz5I7.js → Dots-C_ja_PPu.js} +0 -0
- /package/{Gradient-BSWJAu0a.js → Gradient-CDGFLaA-.js} +0 -0
- /package/{Grid-BFKl0MUt.js → Grid-C22rTkrs.js} +0 -0
- /package/{Waves-BPEgTYoO.js → Waves-Cl5rKcFJ.js} +0 -0
- /package/{card-5ooLmYSr.js → card-BIebVDA0.js} +0 -0
- /package/{cn-B6c1DjO_.js → cn-CzJDhklM.js} +0 -0
- /package/{fontSize-B-ba6pvx.js → fontSize-DowUyWe-.js} +0 -0
package/dist-IMRD6dob.js
ADDED
|
@@ -0,0 +1,3858 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { A as e, C as t, D as n, F as r, M as i, N as a, T as o, _ as s, a as c, b as l, c as u, g as d, h as f, i as p, j as m, k as h, n as g, o as _, r as v, t as y, u as b, v as x, w as S, x as C, y as w } from "./price-BUDkN5Me.js";
|
|
3
|
+
import { n as T, r as E, t as D } from "./VerifyButton-CNq78zG4.js";
|
|
4
|
+
import { c as O } from "react/compiler-runtime";
|
|
5
|
+
import { errorHandler as k, errorToast as A, successToast as j, useLevo as M } from "@levo-so/react";
|
|
6
|
+
import * as N from "react";
|
|
7
|
+
import P, { Suspense as F, createContext as I, lazy as L, useCallback as R, useDeferredValue as z, useEffect as B, useMemo as V, useRef as H, useState as U } from "react";
|
|
8
|
+
import { Fragment as W, jsx as G, jsxs as K } from "react/jsx-runtime";
|
|
9
|
+
import { FieldInterfaces as q, LevoError as J, MediaKindList as Y, defaultByKinds as X, getLevoError as ee, mediaMimetypeByKind as te, operatorsByKind as ne } from "@levo-so/core";
|
|
10
|
+
import Z from "clsx";
|
|
11
|
+
import re from "dayjs";
|
|
12
|
+
import { createRuntimeFn as ie } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
13
|
+
import { FormProvider as ae, get as oe, useController as Q, useFieldArray as se, useForm as ce, useFormContext as le, useWatch as ue } from "react-hook-form";
|
|
14
|
+
import "@theinternetfolks/snowflake";
|
|
15
|
+
import "react-phone-number-input";
|
|
16
|
+
import "yup";
|
|
17
|
+
import { Tabs as de } from "@base-ui/react/tabs";
|
|
18
|
+
import { IconArrowLeft as fe, IconCheck as pe, IconChevronLeft as me, IconChevronRight as he, IconChevronsLeft as ge, IconChevronsRight as _e, IconFile as ve, IconHash as ye, IconMail as be, IconPencil as xe, IconPlus as Se, IconTrash as Ce, IconUpload as we, IconX as Te } from "@tabler/icons-react";
|
|
19
|
+
import { Checkbox as Ee } from "@base-ui/react/checkbox";
|
|
20
|
+
import { NumericFormat as De } from "react-number-format";
|
|
21
|
+
import Oe from "react-select";
|
|
22
|
+
import ke from "react-select/async";
|
|
23
|
+
import { Radio as Ae } from "@base-ui/react/radio";
|
|
24
|
+
import { RadioGroup as je } from "@base-ui/react/radio-group";
|
|
25
|
+
import { Switch as Me } from "@base-ui/react/switch";
|
|
26
|
+
import { useDropzone as Ne } from "react-dropzone";
|
|
27
|
+
import { useDebouncedCallback as Pe } from "use-debounce";
|
|
28
|
+
//#region \0rolldown/runtime.js
|
|
29
|
+
var Fe = Object.defineProperty, Ie = (e, t) => {
|
|
30
|
+
let n = {};
|
|
31
|
+
for (var r in e) Fe(n, r, {
|
|
32
|
+
get: e[r],
|
|
33
|
+
enumerable: !0
|
|
34
|
+
});
|
|
35
|
+
return t || Fe(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
36
|
+
}, Le = (e) => e.combinator !== void 0, Re = (e) => e == null ? !0 : typeof e == "string" ? e === "" : Array.isArray(e) ? e.length === 0 : !1, ze = (e, t) => {
|
|
37
|
+
if (t == null) return t;
|
|
38
|
+
if (e === "date") {
|
|
39
|
+
if (t instanceof Date || typeof t == "string" || typeof t == "number") {
|
|
40
|
+
let e = re(t);
|
|
41
|
+
if (e.isValid()) return e.valueOf();
|
|
42
|
+
}
|
|
43
|
+
return NaN;
|
|
44
|
+
}
|
|
45
|
+
if (e === "number") {
|
|
46
|
+
if (typeof t == "number") return t;
|
|
47
|
+
if (typeof t == "string" && t !== "") {
|
|
48
|
+
let e = Number(t);
|
|
49
|
+
if (!Number.isNaN(e)) return e;
|
|
50
|
+
}
|
|
51
|
+
return NaN;
|
|
52
|
+
}
|
|
53
|
+
return t;
|
|
54
|
+
}, Be = (e, t) => e === "collection" && t && typeof t == "object" && !Array.isArray(t) && "_id" in t ? t._id : t, Ve = (e, t, n) => ze(e, Be(e, t)) === ze(e, Be(e, n)), He = (e, t) => e ? ne[e]?.includes(t) ?? !1 : !1, Ue = (e, t) => {
|
|
55
|
+
if (Le(e)) {
|
|
56
|
+
e.conditions.forEach((e) => {
|
|
57
|
+
Ue(e, t);
|
|
58
|
+
});
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
t.add(e.source);
|
|
62
|
+
}, We = (e, t) => {
|
|
63
|
+
let { fieldByKey: n } = Qe(e), r = {};
|
|
64
|
+
for (let e of $e(t)) {
|
|
65
|
+
let t = n.get(e);
|
|
66
|
+
t && (r[e] = t.kind);
|
|
67
|
+
}
|
|
68
|
+
return r;
|
|
69
|
+
}, Ge = (e, t) => Le(e) ? e.conditions.some((e) => Ge(e, t)) : t[e.source] === void 0, Ke = (e, t) => {
|
|
70
|
+
if (Le(e)) {
|
|
71
|
+
for (let n of e.conditions) {
|
|
72
|
+
let e = Ke(n, t);
|
|
73
|
+
if (e) return e;
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
return He(t[e.source], e.operator) ? null : e;
|
|
78
|
+
}, qe = (e, t, n) => {
|
|
79
|
+
let r = n[e.source], i = t[e.source];
|
|
80
|
+
switch (e.operator) {
|
|
81
|
+
case "is_empty": return Re(i);
|
|
82
|
+
case "is_not_empty": return !Re(i);
|
|
83
|
+
case "equals": return Ve(r, i, e.value);
|
|
84
|
+
case "not": return !Ve(r, i, e.value);
|
|
85
|
+
case "gt":
|
|
86
|
+
case "gte":
|
|
87
|
+
case "lt":
|
|
88
|
+
case "lte": {
|
|
89
|
+
let t = ze(r, i), n = ze(r, e.value);
|
|
90
|
+
if (typeof t != "number" || typeof n != "number" || Number.isNaN(t) || Number.isNaN(n)) return !1;
|
|
91
|
+
switch (e.operator) {
|
|
92
|
+
case "gt": return t > n;
|
|
93
|
+
case "gte": return t >= n;
|
|
94
|
+
case "lt": return t < n;
|
|
95
|
+
case "lte": return t <= n;
|
|
96
|
+
default: return !1;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
case "contains":
|
|
100
|
+
case "not_contains":
|
|
101
|
+
if (r === "array-string" || r === "array-number" || r === "collection") {
|
|
102
|
+
if (!Array.isArray(i)) return e.operator === "not_contains";
|
|
103
|
+
let t = i.some((t) => Ve(r, t, e.value));
|
|
104
|
+
return e.operator === "contains" ? t : !t;
|
|
105
|
+
}
|
|
106
|
+
if (typeof i == "string" && typeof e.value == "string") {
|
|
107
|
+
let t = i.includes(e.value);
|
|
108
|
+
return e.operator === "contains" ? t : !t;
|
|
109
|
+
}
|
|
110
|
+
return e.operator === "not_contains";
|
|
111
|
+
case "starts_with":
|
|
112
|
+
case "not_starts_with":
|
|
113
|
+
case "ends_with":
|
|
114
|
+
case "not_ends_with":
|
|
115
|
+
if (typeof i != "string" || typeof e.value != "string") return !1;
|
|
116
|
+
switch (e.operator) {
|
|
117
|
+
case "starts_with": return i.startsWith(e.value);
|
|
118
|
+
case "not_starts_with": return !i.startsWith(e.value);
|
|
119
|
+
case "ends_with": return i.endsWith(e.value);
|
|
120
|
+
case "not_ends_with": return !i.endsWith(e.value);
|
|
121
|
+
default: return !1;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}, Je = (e, t, n) => Le(e) ? e.conditions.length === 0 ? !1 : e.combinator === "AND" ? e.conditions.every((e) => Je(e, t, n)) : e.conditions.some((e) => Je(e, t, n)) : qe(e, t, n), Ye = ({ logic: e, formValues: t, sourceKinds: n }) => {
|
|
125
|
+
if (!e?.length) return { visible: !0 };
|
|
126
|
+
let r = !e.some((e) => e.action === "show");
|
|
127
|
+
for (let { action: r, when: i } of e) if (r && !Ge(i, n) && !Ke(i, n) && Je(i, t, n)) return { visible: r === "show" };
|
|
128
|
+
return { visible: r };
|
|
129
|
+
}, Xe = () => ({
|
|
130
|
+
active: /* @__PURE__ */ new Set(),
|
|
131
|
+
memo: /* @__PURE__ */ new Map(),
|
|
132
|
+
hitCycle: !1
|
|
133
|
+
}), Ze = /* @__PURE__ */ new WeakMap(), Qe = (e) => {
|
|
134
|
+
let t = Ze.get(e);
|
|
135
|
+
if (t) return t;
|
|
136
|
+
let n = {
|
|
137
|
+
fieldByKey: /* @__PURE__ */ new Map(),
|
|
138
|
+
sectionOfField: /* @__PURE__ */ new Map()
|
|
139
|
+
};
|
|
140
|
+
for (let t of e.sections ?? []) for (let e of t.fields ?? []) n.fieldByKey.set(e.key, e), n.sectionOfField.set(e.key, t);
|
|
141
|
+
return Ze.set(e, n), n;
|
|
142
|
+
}, $e = (e) => {
|
|
143
|
+
let t = /* @__PURE__ */ new Set();
|
|
144
|
+
for (let n of e ?? []) Ue(n.when, t);
|
|
145
|
+
return t;
|
|
146
|
+
}, et = (e, t, n, r) => {
|
|
147
|
+
let { fieldByKey: i } = Qe(e), a = { ...n };
|
|
148
|
+
for (let o of $e(t)) {
|
|
149
|
+
let t = i.get(o);
|
|
150
|
+
!t || t.hidden || rt(e, t, n, r) && (a[o] = void 0);
|
|
151
|
+
}
|
|
152
|
+
return a;
|
|
153
|
+
}, tt = (e, t, n, r) => {
|
|
154
|
+
let i = e.memo.get(t);
|
|
155
|
+
if (i !== void 0) return i;
|
|
156
|
+
if (e.active.has(t)) return e.hitCycle = !0, n;
|
|
157
|
+
let a = e.hitCycle;
|
|
158
|
+
e.hitCycle = !1, e.active.add(t);
|
|
159
|
+
try {
|
|
160
|
+
let n = r();
|
|
161
|
+
return e.hitCycle || e.memo.set(t, n), n;
|
|
162
|
+
} finally {
|
|
163
|
+
e.active.delete(t), e.hitCycle = e.hitCycle || a;
|
|
164
|
+
}
|
|
165
|
+
}, nt = (e, t, n, r) => ct(e, t) || !t.logic?.length ? !0 : tt(r, `section:${t.id}`, !0, () => {
|
|
166
|
+
let i = We(e, t.logic), a = et(e, t.logic, n, r);
|
|
167
|
+
return Ye({
|
|
168
|
+
logic: t.logic,
|
|
169
|
+
formValues: a,
|
|
170
|
+
sourceKinds: i
|
|
171
|
+
}).visible;
|
|
172
|
+
}), rt = (e, t, n, r) => t.hidden ? !0 : tt(r, t.key, !1, () => {
|
|
173
|
+
let i = Qe(e).sectionOfField.get(t.key);
|
|
174
|
+
if (i && !nt(e, i, n, r)) return !0;
|
|
175
|
+
if (!t.logic?.length) return !1;
|
|
176
|
+
let a = We(e, t.logic), o = et(e, t.logic, n, r);
|
|
177
|
+
return !Ye({
|
|
178
|
+
logic: t.logic,
|
|
179
|
+
formValues: o,
|
|
180
|
+
sourceKinds: a
|
|
181
|
+
}).visible;
|
|
182
|
+
}), it = (e, t, n) => t.hidden ? !0 : e ? rt(e, t, n, Xe()) : !1, at = (e, t) => {
|
|
183
|
+
let { fieldByKey: n, sectionOfField: r } = Qe(e), i = /* @__PURE__ */ new Set(), a = (t) => {
|
|
184
|
+
for (let o of $e(t)) {
|
|
185
|
+
if (i.has(o)) continue;
|
|
186
|
+
i.add(o);
|
|
187
|
+
let t = n.get(o);
|
|
188
|
+
if (!t) continue;
|
|
189
|
+
a(t.logic);
|
|
190
|
+
let s = r.get(o);
|
|
191
|
+
s && !ct(e, s) && a(s.logic);
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
return a(t), [...i];
|
|
195
|
+
}, ot = (e, t) => {
|
|
196
|
+
let n = Qe(e).sectionOfField.get(t.key);
|
|
197
|
+
return [...new Set([...at(e, t.logic), ...n ? st(e, n) : []])];
|
|
198
|
+
}, st = (e, t) => ct(e, t) ? [] : at(e, t.logic), ct = (e, t) => e?.sections?.[0]?.id === t.id, lt = (e, t, n) => {
|
|
199
|
+
let r = Xe();
|
|
200
|
+
return t.some((t) => !!t.field_interface && !!t.key && !(e ? rt(e, t, n, r) : t.hidden));
|
|
201
|
+
}, ut = (e, t) => {
|
|
202
|
+
let n = O(6), r;
|
|
203
|
+
n[0] !== t || n[1] !== e ? (r = (n) => {
|
|
204
|
+
let r = n ?? [], i = {};
|
|
205
|
+
return e.forEach((e, t) => {
|
|
206
|
+
i[e] = r[t];
|
|
207
|
+
}), t(i);
|
|
208
|
+
}, n[0] = t, n[1] = e, n[2] = r) : r = n[2];
|
|
209
|
+
let i;
|
|
210
|
+
return n[3] !== e || n[4] !== r ? (i = {
|
|
211
|
+
name: e,
|
|
212
|
+
exact: !0,
|
|
213
|
+
compute: r
|
|
214
|
+
}, n[3] = e, n[4] = r, n[5] = i) : i = n[5], ue(i);
|
|
215
|
+
}, dt = (e, t) => {
|
|
216
|
+
let n = O(9), r;
|
|
217
|
+
n[0] !== t || n[1] !== e ? (r = e ? ot(e, t) : [], n[0] = t, n[1] = e, n[2] = r) : r = n[2];
|
|
218
|
+
let i = r, a;
|
|
219
|
+
n[3] !== t || n[4] !== e ? (a = (n) => it(e, t, n), n[3] = t, n[4] = e, n[5] = a) : a = n[5];
|
|
220
|
+
let o = z(ut(i, a)), s;
|
|
221
|
+
return n[6] !== o || n[7] !== t ? (s = {
|
|
222
|
+
...t,
|
|
223
|
+
hidden: o
|
|
224
|
+
}, n[6] = o, n[7] = t, n[8] = s) : s = n[8], s;
|
|
225
|
+
}, ft = (e, t) => {
|
|
226
|
+
let n = O(11), r;
|
|
227
|
+
bb0: {
|
|
228
|
+
if (!e) {
|
|
229
|
+
let e;
|
|
230
|
+
n[0] === Symbol.for("react.memo_cache_sentinel") ? (e = [], n[0] = e) : e = n[0], r = e;
|
|
231
|
+
break bb0;
|
|
232
|
+
}
|
|
233
|
+
let i;
|
|
234
|
+
if (n[1] !== e || n[2] !== t.fields) {
|
|
235
|
+
let r;
|
|
236
|
+
n[4] === e ? r = n[5] : (r = (t) => ot(e, t), n[4] = e, n[5] = r), i = new Set((t.fields ?? []).flatMap(r)), n[1] = e, n[2] = t.fields, n[3] = i;
|
|
237
|
+
} else i = n[3];
|
|
238
|
+
let a;
|
|
239
|
+
n[6] === i ? a = n[7] : (a = [...i], n[6] = i, n[7] = a), r = a;
|
|
240
|
+
}
|
|
241
|
+
let i = r, a;
|
|
242
|
+
return n[8] !== e || n[9] !== t.fields ? (a = (n) => lt(e, t.fields ?? [], n), n[8] = e, n[9] = t.fields, n[10] = a) : a = n[10], z(ut(i, a));
|
|
243
|
+
}, pt = (e) => Array.isArray(e) ? e.map((e) => {
|
|
244
|
+
if (e && typeof e == "object") {
|
|
245
|
+
let t = e.value ?? e.label ?? "";
|
|
246
|
+
return {
|
|
247
|
+
value: String(t),
|
|
248
|
+
label: String(e.label ?? e.value ?? "")
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
return {
|
|
252
|
+
value: String(e),
|
|
253
|
+
label: String(e)
|
|
254
|
+
};
|
|
255
|
+
}) : [], mt = (e) => pt(e).map((e) => e.value), ht = (e) => {
|
|
256
|
+
let t = {};
|
|
257
|
+
for (let n of e) {
|
|
258
|
+
if (n.kind === "collection") {
|
|
259
|
+
let e = n.options?.current_have_many_connected, r = n.options?.connected_have_many_current;
|
|
260
|
+
e && r ? t[n.key] = X.collection.m2m : t[n.key] = X.collection.m2o;
|
|
261
|
+
} else t[n.key] = X?.[n?.kind];
|
|
262
|
+
n?.field_interface === q.RecordWidget && n?.fields?.length && (t[n.key] = ht(n.fields));
|
|
263
|
+
}
|
|
264
|
+
return t;
|
|
265
|
+
}, gt = (e) => e === void 0 ? null : e, _t = (e) => {
|
|
266
|
+
if (!e?.sections) return {};
|
|
267
|
+
let t = {};
|
|
268
|
+
for (let n of e.sections) {
|
|
269
|
+
let e = ht(n.fields ?? []);
|
|
270
|
+
for (let r of n.fields ?? []) {
|
|
271
|
+
let n = gt(r?.default_value);
|
|
272
|
+
if (n != null && vt(r)) {
|
|
273
|
+
let e = mt(r?.values);
|
|
274
|
+
Array.isArray(n) ? n = n.filter((t) => e.includes(t)) : typeof n == "string" && !e.includes(n) && (n = null);
|
|
275
|
+
}
|
|
276
|
+
t[r.key] = n ?? e[r.key];
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
return t;
|
|
280
|
+
}, vt = (e) => Array.isArray(e?.values) && e?.values?.length > 0 && !e?.options?.custom_input, yt = (e, t, n) => {
|
|
281
|
+
let r = n !== void 0;
|
|
282
|
+
if (!t) return {};
|
|
283
|
+
let i = (t?.sections ?? []).flatMap((e) => e?.fields ?? []), a = {};
|
|
284
|
+
for (let o of i) {
|
|
285
|
+
let i = r && it(t, o, e) ? n[o.key] : e?.[o.key];
|
|
286
|
+
o.field_interface === "CollectionWidget" ? i && typeof i == "object" ? a[o.key] = Array.isArray(i) ? i.map((e) => e && typeof e == "object" ? e._id : e).filter(Boolean) : i._id : typeof i == "string" && i ? a[o.key] = i : a[o.key] = ht([o])[o.key] : a[o.key] = i;
|
|
287
|
+
}
|
|
288
|
+
return a;
|
|
289
|
+
}, bt = "_1kzhxrs0", xt = "_1kzhxrs1", St = "_1kzhxrs2", Ct = "_1kzhxrs3", wt = "_1kzhxrs4", Tt = "_1kzhxrs5", Et = "_1kzhxrs6", Dt = "_1kzhxrs7", Ot = "_1kzhxrs8", kt = "_1kzhxrs9", At = "_1kzhxrsa", jt = "_1kzhxrsb", Mt = "ktjhuv0", Nt = ie({
|
|
290
|
+
defaultClassName: "ktjhuv1",
|
|
291
|
+
variantClassNames: { variant: {
|
|
292
|
+
default: "ktjhuv2",
|
|
293
|
+
line: "ktjhuv3"
|
|
294
|
+
} },
|
|
295
|
+
defaultVariants: { variant: "default" },
|
|
296
|
+
compoundVariants: []
|
|
297
|
+
}), Pt = "ktjhuv4", Ft = "ktjhuv5", It = "ktjhuv6", Lt = (e) => {
|
|
298
|
+
let t = O(10), n, r, i;
|
|
299
|
+
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);
|
|
300
|
+
let a = i === void 0 ? "horizontal" : i, o;
|
|
301
|
+
t[4] === n ? o = t[5] : (o = Z(Mt, n), t[4] = n, t[5] = o);
|
|
302
|
+
let s;
|
|
303
|
+
return t[6] !== a || t[7] !== r || t[8] !== o ? (s = /* @__PURE__ */ G(de.Root, {
|
|
304
|
+
"data-slot": "tabs",
|
|
305
|
+
"data-orientation": a,
|
|
306
|
+
className: o,
|
|
307
|
+
...r
|
|
308
|
+
}), t[6] = a, t[7] = r, t[8] = o, t[9] = s) : s = t[9], s;
|
|
309
|
+
}, Rt = (e) => {
|
|
310
|
+
let t = O(11), n, r, i;
|
|
311
|
+
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);
|
|
312
|
+
let a = i === void 0 ? "default" : i, o;
|
|
313
|
+
t[4] !== n || t[5] !== a ? (o = Z(Nt({ variant: a }), n), t[4] = n, t[5] = a, t[6] = o) : o = t[6];
|
|
314
|
+
let s;
|
|
315
|
+
return t[7] !== r || t[8] !== o || t[9] !== a ? (s = /* @__PURE__ */ G(de.List, {
|
|
316
|
+
"data-slot": "tabs-list",
|
|
317
|
+
"data-variant": a,
|
|
318
|
+
className: o,
|
|
319
|
+
...r
|
|
320
|
+
}), t[7] = r, t[8] = o, t[9] = a, t[10] = s) : s = t[10], s;
|
|
321
|
+
}, zt = (e) => {
|
|
322
|
+
let t = O(8), n, r;
|
|
323
|
+
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
324
|
+
let i;
|
|
325
|
+
t[3] === n ? i = t[4] : (i = Z(Pt, Ft, n), t[3] = n, t[4] = i);
|
|
326
|
+
let a;
|
|
327
|
+
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ G(de.Tab, {
|
|
328
|
+
"data-slot": "tabs-trigger",
|
|
329
|
+
className: i,
|
|
330
|
+
...r
|
|
331
|
+
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
332
|
+
}, Bt = (e) => {
|
|
333
|
+
let t = O(8), n, r;
|
|
334
|
+
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
335
|
+
let i;
|
|
336
|
+
t[3] === n ? i = t[4] : (i = Z(It, n), t[3] = n, t[4] = i);
|
|
337
|
+
let a;
|
|
338
|
+
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ G(de.Panel, {
|
|
339
|
+
"data-slot": "tabs-content",
|
|
340
|
+
className: i,
|
|
341
|
+
...r
|
|
342
|
+
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
343
|
+
}, Vt = (t) => {
|
|
344
|
+
let r = O(36), i, a, o;
|
|
345
|
+
r[0] === t ? (i = r[1], a = r[2], o = r[3]) : ({field: i, schema: o, ...a} = t, r[0] = t, r[1] = i, r[2] = a, r[3] = o);
|
|
346
|
+
let { key: s, label: c, field_interface: l, fields: u } = i, d = s === void 0 ? "" : s, f = c === void 0 ? "" : c, p = l === void 0 ? "" : l, m;
|
|
347
|
+
r[4] === u ? m = r[5] : (m = u === void 0 ? [] : u, r[4] = u, r[5] = m);
|
|
348
|
+
let g = m, [_, v] = U("0"), { formState: y } = le(), b;
|
|
349
|
+
r[6] === i ? b = r[7] : (b = h(i), r[6] = i, r[7] = b);
|
|
350
|
+
let x;
|
|
351
|
+
r[8] !== d || r[9] !== b ? (x = {
|
|
352
|
+
name: d,
|
|
353
|
+
rules: b
|
|
354
|
+
}, r[8] = d, r[9] = b, r[10] = x) : x = r[10];
|
|
355
|
+
let S = se(x), C, w;
|
|
356
|
+
r[11] === S ? (C = r[12], w = r[13]) : ({fields: w, ...C} = S, r[11] = S, r[12] = C, r[13] = w);
|
|
357
|
+
let T;
|
|
358
|
+
r[14] !== y.errors || r[15] !== d ? (T = oe(y.errors, d)?.root?.message, r[14] = y.errors, r[15] = d, r[16] = T) : T = r[16];
|
|
359
|
+
let E = T;
|
|
360
|
+
if (!p || !d) return null;
|
|
361
|
+
let D = i?.required, k;
|
|
362
|
+
r[17] !== f || r[18] !== D ? (k = /* @__PURE__ */ G(e, {
|
|
363
|
+
label: f,
|
|
364
|
+
isRequired: D
|
|
365
|
+
}), r[17] = f, r[18] = D, r[19] = k) : k = r[19];
|
|
366
|
+
let A;
|
|
367
|
+
r[20] !== C || r[21] !== i.id || r[22] !== i.key || r[23] !== w || r[24] !== g || r[25] !== d || r[26] !== a || r[27] !== o || r[28] !== _ ? (A = w && Array.isArray(w) ? /* @__PURE__ */ K(Lt, {
|
|
368
|
+
value: _,
|
|
369
|
+
onValueChange: v,
|
|
370
|
+
className: xt,
|
|
371
|
+
children: [/* @__PURE__ */ K("div", {
|
|
372
|
+
className: St,
|
|
373
|
+
children: [w.length ? /* @__PURE__ */ G(Rt, {
|
|
374
|
+
className: Ct,
|
|
375
|
+
children: w?.map((e, t) => /* @__PURE__ */ G(zt, {
|
|
376
|
+
id: `${i?.key}-${t}`,
|
|
377
|
+
value: t.toString(),
|
|
378
|
+
className: wt,
|
|
379
|
+
children: t + 1
|
|
380
|
+
}, `array-widget-tab-${i?.id}-${t}`))
|
|
381
|
+
}) : null, /* @__PURE__ */ K(n, {
|
|
382
|
+
variant: "ghost",
|
|
383
|
+
size: "xs",
|
|
384
|
+
className: Tt,
|
|
385
|
+
onClick: () => {
|
|
386
|
+
C.append(ht(g)), v((w?.length ?? 0).toString());
|
|
387
|
+
},
|
|
388
|
+
children: [/* @__PURE__ */ G(Se, { size: 14 }), "Add"]
|
|
389
|
+
})]
|
|
390
|
+
}), w?.map((e, t) => /* @__PURE__ */ K(Bt, {
|
|
391
|
+
className: Et,
|
|
392
|
+
value: t.toString(),
|
|
393
|
+
children: [/* @__PURE__ */ G("div", {
|
|
394
|
+
className: Dt,
|
|
395
|
+
children: g.map((e) => /* @__PURE__ */ G(Xr, {
|
|
396
|
+
field: {
|
|
397
|
+
...e,
|
|
398
|
+
key: `${d}.${t}.${e?.key}`
|
|
399
|
+
},
|
|
400
|
+
schema: o ?? null,
|
|
401
|
+
...a
|
|
402
|
+
}, `common-fields-${e?.id}`))
|
|
403
|
+
}), /* @__PURE__ */ K("div", {
|
|
404
|
+
className: Ot,
|
|
405
|
+
children: [
|
|
406
|
+
/* @__PURE__ */ G(n, {
|
|
407
|
+
onClick: () => {
|
|
408
|
+
v((t - 1).toString()), C.move(t, t - 1);
|
|
409
|
+
},
|
|
410
|
+
disabled: t === 0,
|
|
411
|
+
size: "icon",
|
|
412
|
+
className: kt,
|
|
413
|
+
children: /* @__PURE__ */ G(me, { size: 20 })
|
|
414
|
+
}),
|
|
415
|
+
/* @__PURE__ */ G(n, {
|
|
416
|
+
className: At,
|
|
417
|
+
variant: "link",
|
|
418
|
+
onClick: () => {
|
|
419
|
+
v(Math.max(0, t - 1).toString()), C.remove(t);
|
|
420
|
+
},
|
|
421
|
+
children: "Remove Item"
|
|
422
|
+
}),
|
|
423
|
+
/* @__PURE__ */ G(n, {
|
|
424
|
+
className: kt,
|
|
425
|
+
onClick: () => {
|
|
426
|
+
v((t + 1).toString()), C.move(t, t + 1);
|
|
427
|
+
},
|
|
428
|
+
disabled: t >= w.length - 1,
|
|
429
|
+
size: "icon",
|
|
430
|
+
children: /* @__PURE__ */ G(he, { size: 20 })
|
|
431
|
+
})
|
|
432
|
+
]
|
|
433
|
+
})]
|
|
434
|
+
}, `array-widget-tab-content-${i?.id}-${t}`))]
|
|
435
|
+
}) : /* @__PURE__ */ K(n, {
|
|
436
|
+
variant: "ghost",
|
|
437
|
+
size: "xs",
|
|
438
|
+
onClick: () => {
|
|
439
|
+
C.append(ht(g)), v("0");
|
|
440
|
+
},
|
|
441
|
+
children: [/* @__PURE__ */ G(Se, { size: 14 }), "Add"]
|
|
442
|
+
}), r[20] = C, r[21] = i.id, r[22] = i.key, r[23] = w, r[24] = g, r[25] = d, r[26] = a, r[27] = o, r[28] = _, r[29] = A) : A = r[29];
|
|
443
|
+
let j;
|
|
444
|
+
r[30] === E ? j = r[31] : (j = !!E && /* @__PURE__ */ G("div", {
|
|
445
|
+
className: "_1kzhxrsc",
|
|
446
|
+
children: /* @__PURE__ */ G("p", {
|
|
447
|
+
className: "_1ompjs13",
|
|
448
|
+
children: E
|
|
449
|
+
})
|
|
450
|
+
}), r[30] = E, r[31] = j);
|
|
451
|
+
let M;
|
|
452
|
+
return r[32] !== k || r[33] !== A || r[34] !== j ? (M = /* @__PURE__ */ K("div", {
|
|
453
|
+
className: bt,
|
|
454
|
+
children: [
|
|
455
|
+
k,
|
|
456
|
+
A,
|
|
457
|
+
j
|
|
458
|
+
]
|
|
459
|
+
}), r[32] = k, r[33] = A, r[34] = j, r[35] = M) : M = r[35], M;
|
|
460
|
+
}, Ht = "_8vx4f60 _1oiks600 _1ri7vba0", Ut = "_8vx4f61", Wt = "_8vx4f62", Gt = "_8vx4f63", Kt = "_8vx4f66", qt = "_8vx4f67", Jt = "_8vx4f68", Yt = "_8vx4f69", Xt = "_8vx4f6a", Zt = "_8vx4f6b", Qt = "_8vx4f6c", $t = "_8vx4f6d _6o7s4x0", en = "_8vx4f6e", tn = "_8vx4f6f", nn = "_8vx4f6g", rn = "_8vx4f6h", an = "_8vx4f6k", on = {
|
|
461
|
+
container: () => Ut,
|
|
462
|
+
control: ({ isFocused: e, isMulti: t, isDisabled: n }) => Z(Ht, t ? Gt : Wt, e && "_8vx4f64", n && "_8vx4f65"),
|
|
463
|
+
input: () => "",
|
|
464
|
+
valueContainer: () => Kt,
|
|
465
|
+
loadingMessage: () => Jt,
|
|
466
|
+
singleValue: () => "",
|
|
467
|
+
multiValue: () => Yt,
|
|
468
|
+
multiValueRemove: () => Xt,
|
|
469
|
+
indicatorsContainer: () => qt,
|
|
470
|
+
clearIndicator: () => Zt,
|
|
471
|
+
indicatorSeparator: () => "",
|
|
472
|
+
dropdownIndicator: () => Qt,
|
|
473
|
+
menu: () => $t,
|
|
474
|
+
groupHeading: () => tn,
|
|
475
|
+
placeholder: () => nn,
|
|
476
|
+
option: ({ isSelected: e, isFocused: t }) => Z(rn, t && "_8vx4f6i", e && "_8vx4f6j"),
|
|
477
|
+
noOptionsMessage: () => an,
|
|
478
|
+
menuPortal: () => en
|
|
479
|
+
}, sn = P.lazy(() => import("react-select-async-paginate").then((e) => ({ default: e.AsyncPaginate }))), cn = (e) => {
|
|
480
|
+
let { portalRef: n } = t();
|
|
481
|
+
return /* @__PURE__ */ G(sn, {
|
|
482
|
+
isClearable: !0,
|
|
483
|
+
menuPlacement: "auto",
|
|
484
|
+
isSearchable: !0,
|
|
485
|
+
unstyled: !0,
|
|
486
|
+
classNames: on,
|
|
487
|
+
styles: { menuPortal: (e) => ({
|
|
488
|
+
...e,
|
|
489
|
+
zIndex: 99999999
|
|
490
|
+
}) },
|
|
491
|
+
menuPosition: "fixed",
|
|
492
|
+
menuPortalTarget: n?.current,
|
|
493
|
+
loadingMessage: () => /* @__PURE__ */ G(E, { size: 16 }),
|
|
494
|
+
...e
|
|
495
|
+
});
|
|
496
|
+
}, ln = { OR: [{ _original: "" }, { _original: null }] }, un = (e) => e ? e.replace(/[-_]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()) : "", dn = "_1k5k6yj0", fn = ({ field: e }) => {
|
|
497
|
+
let { collection: t } = M(), [r, i] = U(!1), [a, s] = U(!1), [c, u] = U([]), [d, f] = U(1), [p, m] = U(5), [g, _] = U(0), [v, y] = U(0), { key: b = "", label: x = "", helper_text: S = "", readonly: T = !1 } = e, D = b, O = e?.options?.collection_key || "", A = e?.options?.label_field_key || "", { field: { value: j, onChange: N, ref: P }, fieldState: F } = Q({
|
|
498
|
+
name: D,
|
|
499
|
+
rules: h(e)
|
|
500
|
+
}), I = !!e?.required, L = F?.error?.message, R = async () => {
|
|
501
|
+
i(!0);
|
|
502
|
+
try {
|
|
503
|
+
let e = await t?.getCollectionContentList({
|
|
504
|
+
collection_key: O,
|
|
505
|
+
page: d,
|
|
506
|
+
limit: p,
|
|
507
|
+
where: { _id: { in: j } }
|
|
508
|
+
}), n = e?.content?.data ?? [], r = e?.content?.meta?.pages ?? 0;
|
|
509
|
+
_(e?.content?.meta?.total ?? 0), y(r), d > r && f(r), u(n);
|
|
510
|
+
} catch (e) {
|
|
511
|
+
k(e);
|
|
512
|
+
} finally {
|
|
513
|
+
i(!1);
|
|
514
|
+
}
|
|
515
|
+
};
|
|
516
|
+
return B(() => {
|
|
517
|
+
j?.length > 0 && R();
|
|
518
|
+
}, [
|
|
519
|
+
j,
|
|
520
|
+
d,
|
|
521
|
+
p
|
|
522
|
+
]), /* @__PURE__ */ K("div", {
|
|
523
|
+
className: dn,
|
|
524
|
+
children: [/* @__PURE__ */ G(o, {
|
|
525
|
+
ref: P,
|
|
526
|
+
error: L,
|
|
527
|
+
helperText: S,
|
|
528
|
+
readOnly: T,
|
|
529
|
+
label: x,
|
|
530
|
+
htmlFor: D,
|
|
531
|
+
isRequired: I,
|
|
532
|
+
children: /* @__PURE__ */ G(cn, {
|
|
533
|
+
id: D,
|
|
534
|
+
value: [],
|
|
535
|
+
onChange: (e) => {
|
|
536
|
+
e?.value?._id && N([...Array.isArray(j) ? j : [], e?.value?._id]);
|
|
537
|
+
},
|
|
538
|
+
placeholder: Array.isArray(j) && j?.length > 0 ? "Select more" : "Select",
|
|
539
|
+
filterOption: (e) => !Array.isArray(j) || !j.includes(e?.value?._id),
|
|
540
|
+
loadOptions: async (e, n, { page: r = 1 }) => {
|
|
541
|
+
s(!0);
|
|
542
|
+
try {
|
|
543
|
+
let n = Array.isArray(j) && j.length > 0 ? { AND: [{ _id: { not_in: j } }, ln] } : ln, i = (await t?.getCollectionContentList({
|
|
544
|
+
collection_key: O,
|
|
545
|
+
page: r,
|
|
546
|
+
search: e,
|
|
547
|
+
limit: 10,
|
|
548
|
+
where: n
|
|
549
|
+
}))?.content?.data, a = (i || []).map((e) => ({
|
|
550
|
+
value: {
|
|
551
|
+
_id: e?._id,
|
|
552
|
+
slug: e?.slug,
|
|
553
|
+
[A]: e?.[A]
|
|
554
|
+
},
|
|
555
|
+
label: e?.[A] ? e?.[A] : un(e?.slug ?? "")
|
|
556
|
+
}));
|
|
557
|
+
return {
|
|
558
|
+
options: Array.isArray(a) ? a : [],
|
|
559
|
+
hasMore: i && !(i?.length < 10),
|
|
560
|
+
additional: { page: r + 1 }
|
|
561
|
+
};
|
|
562
|
+
} catch {
|
|
563
|
+
return {
|
|
564
|
+
options: [],
|
|
565
|
+
hasMore: !1,
|
|
566
|
+
additional: { page: r }
|
|
567
|
+
};
|
|
568
|
+
} finally {
|
|
569
|
+
s(!1);
|
|
570
|
+
}
|
|
571
|
+
},
|
|
572
|
+
debounceTimeout: 500,
|
|
573
|
+
getOptionLabel: (e) => e?.label,
|
|
574
|
+
getOptionValue: (e) => e?.value?._id || e?.value?.slug,
|
|
575
|
+
isLoading: a,
|
|
576
|
+
additional: { page: 1 },
|
|
577
|
+
cacheUniqs: [O, j],
|
|
578
|
+
minMenuHeight: 250
|
|
579
|
+
})
|
|
580
|
+
}), Array.isArray(j) && j?.length > 0 && /* @__PURE__ */ K("div", {
|
|
581
|
+
className: "_1k5k6yj1",
|
|
582
|
+
children: [
|
|
583
|
+
/* @__PURE__ */ K("h4", {
|
|
584
|
+
className: "_1k5k6yj2",
|
|
585
|
+
children: [/* @__PURE__ */ G("span", { children: "Selected" }), r && c?.length > 0 && /* @__PURE__ */ G(E, { size: 16 })]
|
|
586
|
+
}),
|
|
587
|
+
/* @__PURE__ */ G("div", {
|
|
588
|
+
className: "_1k5k6yj4",
|
|
589
|
+
children: c.map((e) => /* @__PURE__ */ K("div", {
|
|
590
|
+
className: "_1k5k6yj5",
|
|
591
|
+
children: [/* @__PURE__ */ G("div", {
|
|
592
|
+
className: "_1k5k6yj6",
|
|
593
|
+
children: e?.[A] || un(e?.slug ?? "")
|
|
594
|
+
}), /* @__PURE__ */ G(n, {
|
|
595
|
+
disabled: r,
|
|
596
|
+
size: "icon-sm",
|
|
597
|
+
variant: "ghost",
|
|
598
|
+
onClick: () => {
|
|
599
|
+
N(j?.filter((t) => t !== e?._id));
|
|
600
|
+
},
|
|
601
|
+
children: /* @__PURE__ */ G(Te, { size: 16 })
|
|
602
|
+
})]
|
|
603
|
+
}, e?._id))
|
|
604
|
+
}),
|
|
605
|
+
r && c?.length === 0 && /* @__PURE__ */ G("div", {
|
|
606
|
+
className: "_1k5k6yj3",
|
|
607
|
+
children: /* @__PURE__ */ G(E, { size: 24 })
|
|
608
|
+
}),
|
|
609
|
+
j?.length > 5 && /* @__PURE__ */ K("div", {
|
|
610
|
+
className: "_1k5k6yj7",
|
|
611
|
+
children: [
|
|
612
|
+
/* @__PURE__ */ K("div", {
|
|
613
|
+
className: "_1k5k6yj8",
|
|
614
|
+
children: [
|
|
615
|
+
"Showing",
|
|
616
|
+
" ",
|
|
617
|
+
g ? /* @__PURE__ */ K(W, { children: [
|
|
618
|
+
p * (d - 1) + 1,
|
|
619
|
+
"-",
|
|
620
|
+
Math.min(p * d, g),
|
|
621
|
+
" of",
|
|
622
|
+
" "
|
|
623
|
+
] }) : null,
|
|
624
|
+
g,
|
|
625
|
+
" items"
|
|
626
|
+
]
|
|
627
|
+
}),
|
|
628
|
+
/* @__PURE__ */ K("select", {
|
|
629
|
+
className: "_1k5k6yjb",
|
|
630
|
+
value: p,
|
|
631
|
+
onChange: (e) => {
|
|
632
|
+
f(1), m(Number(e.target.value));
|
|
633
|
+
},
|
|
634
|
+
children: [
|
|
635
|
+
/* @__PURE__ */ G("option", {
|
|
636
|
+
value: 5,
|
|
637
|
+
children: "5"
|
|
638
|
+
}),
|
|
639
|
+
/* @__PURE__ */ G("option", {
|
|
640
|
+
value: 10,
|
|
641
|
+
children: "10"
|
|
642
|
+
}),
|
|
643
|
+
/* @__PURE__ */ G("option", {
|
|
644
|
+
value: 25,
|
|
645
|
+
children: "25"
|
|
646
|
+
}),
|
|
647
|
+
/* @__PURE__ */ G("option", {
|
|
648
|
+
value: 50,
|
|
649
|
+
children: "50"
|
|
650
|
+
})
|
|
651
|
+
]
|
|
652
|
+
}),
|
|
653
|
+
/* @__PURE__ */ G("div", {
|
|
654
|
+
className: "_1k5k6yj9",
|
|
655
|
+
children: /* @__PURE__ */ K("div", {
|
|
656
|
+
className: "_1k5k6yja",
|
|
657
|
+
children: [
|
|
658
|
+
/* @__PURE__ */ K(w, { children: [/* @__PURE__ */ G(l, {
|
|
659
|
+
variant: "ghost",
|
|
660
|
+
size: "icon-xs",
|
|
661
|
+
onClick: () => f(1),
|
|
662
|
+
disabled: d === 1,
|
|
663
|
+
children: /* @__PURE__ */ G(ge, { size: 14 })
|
|
664
|
+
}), /* @__PURE__ */ G(C, { children: "First page" })] }),
|
|
665
|
+
/* @__PURE__ */ K(w, { children: [/* @__PURE__ */ G(l, {
|
|
666
|
+
variant: "ghost",
|
|
667
|
+
size: "icon-xs",
|
|
668
|
+
disabled: d === 1,
|
|
669
|
+
onClick: () => f(d - 1),
|
|
670
|
+
children: /* @__PURE__ */ G(me, { size: 14 })
|
|
671
|
+
}), /* @__PURE__ */ G(C, { children: "Previous page" })] }),
|
|
672
|
+
/* @__PURE__ */ K(w, { children: [/* @__PURE__ */ G(l, {
|
|
673
|
+
variant: "ghost",
|
|
674
|
+
size: "icon-xs",
|
|
675
|
+
onClick: () => f(d + 1),
|
|
676
|
+
disabled: d === v,
|
|
677
|
+
children: /* @__PURE__ */ G(he, { size: 14 })
|
|
678
|
+
}), /* @__PURE__ */ G(C, { children: "Next page" })] }),
|
|
679
|
+
/* @__PURE__ */ K(w, { children: [/* @__PURE__ */ G(l, {
|
|
680
|
+
variant: "ghost",
|
|
681
|
+
size: "icon-xs",
|
|
682
|
+
onClick: () => f(v),
|
|
683
|
+
disabled: d === v,
|
|
684
|
+
children: /* @__PURE__ */ G(_e, { size: 14 })
|
|
685
|
+
}), /* @__PURE__ */ G(C, { children: "Last page" })] })
|
|
686
|
+
]
|
|
687
|
+
})
|
|
688
|
+
})
|
|
689
|
+
]
|
|
690
|
+
})
|
|
691
|
+
]
|
|
692
|
+
})]
|
|
693
|
+
});
|
|
694
|
+
}, pn = ({ field: e }) => {
|
|
695
|
+
let { collection: t, logger: n } = M(), [r, i] = U(!1), { key: a = "", label: s = "", helper_text: c = "", readonly: l = !1 } = e, u = a, d = e?.options?.collection_key || "", f = e?.options?.label_field_key || "", { field: { value: p, onBlur: m, onChange: g, ref: _, disabled: v, ...y }, fieldState: b } = Q({
|
|
696
|
+
name: u,
|
|
697
|
+
rules: h(e)
|
|
698
|
+
}), { setValue: x } = le(), S = !!e?.required, C = b?.error?.message, w = H(null);
|
|
699
|
+
B(() => {
|
|
700
|
+
typeof p != "string" || !p || w.current !== p && (w.current = p, i(!0), t?.getCollectionContentList({
|
|
701
|
+
collection_key: d,
|
|
702
|
+
where: { _id: p },
|
|
703
|
+
limit: 1
|
|
704
|
+
}).then((e) => {
|
|
705
|
+
let t = e?.content?.data?.[0];
|
|
706
|
+
t && x(u, {
|
|
707
|
+
_id: t._id,
|
|
708
|
+
slug: t.slug,
|
|
709
|
+
[f]: t[f]
|
|
710
|
+
}, { shouldDirty: !1 });
|
|
711
|
+
}).catch((e) => {
|
|
712
|
+
n?.error("Failed to resolve collection default value", e);
|
|
713
|
+
}).finally(() => {
|
|
714
|
+
i(!1);
|
|
715
|
+
}));
|
|
716
|
+
}, [
|
|
717
|
+
p,
|
|
718
|
+
t,
|
|
719
|
+
d,
|
|
720
|
+
f,
|
|
721
|
+
u
|
|
722
|
+
]);
|
|
723
|
+
let T = async (e, n, { page: r = 1 }) => {
|
|
724
|
+
i(!0);
|
|
725
|
+
try {
|
|
726
|
+
let n = (await t?.getCollectionContentList({
|
|
727
|
+
collection_key: d,
|
|
728
|
+
page: r,
|
|
729
|
+
search: e,
|
|
730
|
+
limit: 10,
|
|
731
|
+
where: ln
|
|
732
|
+
}))?.content?.data, i = (n || []).map((e) => {
|
|
733
|
+
let t = e?.[f] ? e?.[f] : un(e?.slug || "");
|
|
734
|
+
return {
|
|
735
|
+
value: {
|
|
736
|
+
_id: e?._id,
|
|
737
|
+
slug: e?.slug,
|
|
738
|
+
[f]: e?.[f]
|
|
739
|
+
},
|
|
740
|
+
label: t
|
|
741
|
+
};
|
|
742
|
+
});
|
|
743
|
+
return {
|
|
744
|
+
options: Array.isArray(i) ? i : [],
|
|
745
|
+
hasMore: n && !(n?.length < 10),
|
|
746
|
+
additional: { page: r + 1 }
|
|
747
|
+
};
|
|
748
|
+
} catch {
|
|
749
|
+
return {
|
|
750
|
+
options: [],
|
|
751
|
+
hasMore: !1,
|
|
752
|
+
additional: { page: r }
|
|
753
|
+
};
|
|
754
|
+
} finally {
|
|
755
|
+
i(!1);
|
|
756
|
+
}
|
|
757
|
+
};
|
|
758
|
+
return /* @__PURE__ */ G(o, {
|
|
759
|
+
ref: _,
|
|
760
|
+
error: C,
|
|
761
|
+
helperText: c,
|
|
762
|
+
readOnly: l,
|
|
763
|
+
label: s,
|
|
764
|
+
htmlFor: u,
|
|
765
|
+
isRequired: S,
|
|
766
|
+
children: /* @__PURE__ */ G(cn, {
|
|
767
|
+
id: u,
|
|
768
|
+
value: p && typeof p == "object" ? {
|
|
769
|
+
label: p?.[f] ? p?.[f] : p?.slug ? un(p?.slug || "") : "",
|
|
770
|
+
value: {
|
|
771
|
+
_id: p?._id,
|
|
772
|
+
slug: p?.slug,
|
|
773
|
+
[f]: p?.[f]
|
|
774
|
+
}
|
|
775
|
+
} : null,
|
|
776
|
+
onChange: (e) => {
|
|
777
|
+
g(e?.value || null);
|
|
778
|
+
},
|
|
779
|
+
onBlur: () => m(),
|
|
780
|
+
loadOptions: T,
|
|
781
|
+
debounceTimeout: 500,
|
|
782
|
+
getOptionLabel: (e) => e?.label,
|
|
783
|
+
getOptionValue: (e) => e?.value?._id || e?.value?.slug,
|
|
784
|
+
isLoading: r,
|
|
785
|
+
additional: { page: 1 },
|
|
786
|
+
cacheUniqs: [d],
|
|
787
|
+
minMenuHeight: 250,
|
|
788
|
+
isDisabled: v,
|
|
789
|
+
...y
|
|
790
|
+
})
|
|
791
|
+
});
|
|
792
|
+
}, mn = (e) => {
|
|
793
|
+
let t = O(4), { field: n } = e, { field_interface: r, key: i, options: a } = n, o = a === void 0 ? {} : a;
|
|
794
|
+
if (!r || !i) return null;
|
|
795
|
+
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;
|
|
796
|
+
if (o?.current_have_many_connected && !o?.connected_have_many_current) return console.error("[LevoCollection]: O2M is not supported"), null;
|
|
797
|
+
if (o?.current_have_many_connected && o?.connected_have_many_current) {
|
|
798
|
+
let n;
|
|
799
|
+
return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ G(fn, {
|
|
800
|
+
...e,
|
|
801
|
+
schema: null
|
|
802
|
+
}), t[0] = e, t[1] = n), n;
|
|
803
|
+
}
|
|
804
|
+
let s;
|
|
805
|
+
return t[2] === e ? s = t[3] : (s = /* @__PURE__ */ G(pn, {
|
|
806
|
+
...e,
|
|
807
|
+
schema: null
|
|
808
|
+
}), t[2] = e, t[3] = s), s;
|
|
809
|
+
}, $ = (e) => P.memo(e), hn = "_1vaa8ub0", gn = "_1vaa8ub2", _n = "_1vaa8ub3", vn = "_13kepqq0", yn = "_13kepqq1", bn = (e) => {
|
|
810
|
+
let t = O(9), n, r;
|
|
811
|
+
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
812
|
+
let i;
|
|
813
|
+
t[3] === n ? i = t[4] : (i = Z(vn, n), t[3] = n, t[4] = i);
|
|
814
|
+
let a;
|
|
815
|
+
t[5] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ G(Ee.Indicator, {
|
|
816
|
+
"data-slot": "checkbox-indicator",
|
|
817
|
+
className: yn,
|
|
818
|
+
children: /* @__PURE__ */ G(pe, {})
|
|
819
|
+
}), t[5] = a) : a = t[5];
|
|
820
|
+
let o;
|
|
821
|
+
return t[6] !== r || t[7] !== i ? (o = /* @__PURE__ */ G(Ee.Root, {
|
|
822
|
+
"data-slot": "checkbox",
|
|
823
|
+
className: i,
|
|
824
|
+
...r,
|
|
825
|
+
children: a
|
|
826
|
+
}), t[6] = r, t[7] = i, t[8] = o) : o = t[8], o;
|
|
827
|
+
}, xn = ({ field: e }) => {
|
|
828
|
+
let [t, n] = U(""), [r, i] = U(!1), { key: a = "", label: s = "", helper_text: c = "", readonly: l = !1, values: u = [], options: d = {} } = e, { field: { name: p, onBlur: g, onChange: _, value: v, ref: y, disabled: b }, fieldState: { error: x } } = Q({
|
|
829
|
+
name: a,
|
|
830
|
+
rules: h(e)
|
|
831
|
+
}), S = (e) => {
|
|
832
|
+
let t = Array.isArray(v || null) ? [...v] : [];
|
|
833
|
+
t.includes(e) ? t = t?.filter((t) => t !== e) : t.push(e), _(t);
|
|
834
|
+
}, C = !!d?.custom_input, w = V(() => pt(u), [u]), T = V(() => w.map((e) => e.value), [w]);
|
|
835
|
+
return B(() => {
|
|
836
|
+
if (C) {
|
|
837
|
+
let e = !1;
|
|
838
|
+
(v ?? []).forEach((t) => {
|
|
839
|
+
T.includes(t) || (e = !0, n(t));
|
|
840
|
+
}), i(!!e);
|
|
841
|
+
}
|
|
842
|
+
}, [
|
|
843
|
+
v,
|
|
844
|
+
T,
|
|
845
|
+
C
|
|
846
|
+
]), /* @__PURE__ */ K(o, {
|
|
847
|
+
error: x?.message,
|
|
848
|
+
helperText: c,
|
|
849
|
+
readOnly: l,
|
|
850
|
+
label: s,
|
|
851
|
+
htmlFor: p,
|
|
852
|
+
isRequired: e?.required,
|
|
853
|
+
children: [/* @__PURE__ */ G("div", {
|
|
854
|
+
ref: y,
|
|
855
|
+
className: Z(hn, l && "_1vaa8ub1"),
|
|
856
|
+
children: w.map((e, t) => /* @__PURE__ */ K("div", {
|
|
857
|
+
className: gn,
|
|
858
|
+
children: [/* @__PURE__ */ G(bn, {
|
|
859
|
+
id: `${p}-${e.value}-${t}`,
|
|
860
|
+
name: p,
|
|
861
|
+
checked: v ? v?.includes(e.value) : !1,
|
|
862
|
+
onCheckedChange: () => S(e.value),
|
|
863
|
+
onBlur: () => g(),
|
|
864
|
+
disabled: b
|
|
865
|
+
}), /* @__PURE__ */ G(m, {
|
|
866
|
+
htmlFor: `${p}-${e.value}-${t}`,
|
|
867
|
+
className: _n,
|
|
868
|
+
children: e.label
|
|
869
|
+
})]
|
|
870
|
+
}, `${e.value}-${t}`))
|
|
871
|
+
}), C && /* @__PURE__ */ K("div", {
|
|
872
|
+
className: "_1vaa8ub4",
|
|
873
|
+
children: [/* @__PURE__ */ K("div", {
|
|
874
|
+
className: "_1vaa8ub5",
|
|
875
|
+
children: [/* @__PURE__ */ G(bn, {
|
|
876
|
+
name: `${p}-other`,
|
|
877
|
+
id: `${p}-other`,
|
|
878
|
+
disabled: b,
|
|
879
|
+
checked: r,
|
|
880
|
+
onCheckedChange: (e) => {
|
|
881
|
+
i(!!e), e ? Array.isArray(v) ? _?.([...v, t]) : _?.([t]) : _?.((v ?? [])?.filter((e) => e !== t));
|
|
882
|
+
},
|
|
883
|
+
onBlur: () => g()
|
|
884
|
+
}), /* @__PURE__ */ K(m, {
|
|
885
|
+
htmlFor: `${p}-other`,
|
|
886
|
+
className: "_1vaa8ub3",
|
|
887
|
+
children: ["Other:", " "]
|
|
888
|
+
})]
|
|
889
|
+
}), /* @__PURE__ */ G(f, {
|
|
890
|
+
name: `other-checkbox-${p}`,
|
|
891
|
+
className: "_1vaa8ub6",
|
|
892
|
+
value: t,
|
|
893
|
+
onChange: (e) => {
|
|
894
|
+
let r = 0;
|
|
895
|
+
_?.(v?.map((n) => n === t && !r ? (r = 1, e.target.value) : n)), n(e.target.value);
|
|
896
|
+
},
|
|
897
|
+
disabled: !r || b,
|
|
898
|
+
placeholder: "Please specify"
|
|
899
|
+
})]
|
|
900
|
+
})]
|
|
901
|
+
});
|
|
902
|
+
}, Sn = (e) => {
|
|
903
|
+
let t = O(39), n, r;
|
|
904
|
+
t[0] === e ? (n = t[1], r = t[2]) : ({field: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
905
|
+
let { key: i, label: a, helper_text: c, readonly: l } = n, u = i === void 0 ? "" : i, d = a === void 0 ? "" : a, f = c === void 0 ? "" : c, p = l === void 0 ? !1 : l, m = u, g;
|
|
906
|
+
t[3] === n ? g = t[4] : (g = h(n), t[3] = n, t[4] = g);
|
|
907
|
+
let _;
|
|
908
|
+
t[5] !== m || t[6] !== g ? (_ = {
|
|
909
|
+
name: m,
|
|
910
|
+
rules: g
|
|
911
|
+
}, t[5] = m, t[6] = g, t[7] = _) : _ = t[7];
|
|
912
|
+
let { field: v, fieldState: y } = Q(_), b, S, C, w, T;
|
|
913
|
+
t[8] === v ? (b = t[9], S = t[10], C = t[11], w = t[12], T = t[13]) : ({value: T, onBlur: b, onChange: S, ref: C, ...w} = v, t[8] = v, t[9] = b, t[10] = S, t[11] = C, t[12] = w, t[13] = T);
|
|
914
|
+
let E = !!n?.required, D = y?.error?.message, k = n?.options?.currency_code, A = `${k || "$"} `, j = `${k || "$"} 0`, M = k === "₹" ? "lakh" : "thousand", N;
|
|
915
|
+
t[14] === S ? N = t[15] : (N = (e, t) => {
|
|
916
|
+
if (!t?.event) return;
|
|
917
|
+
let { value: n } = e;
|
|
918
|
+
S && S(n);
|
|
919
|
+
}, t[14] = S, t[15] = N);
|
|
920
|
+
let P;
|
|
921
|
+
t[16] === b ? P = t[17] : (P = () => {
|
|
922
|
+
b && b();
|
|
923
|
+
}, t[16] = b, t[17] = P);
|
|
924
|
+
let F;
|
|
925
|
+
t[18] === Symbol.for("react.memo_cache_sentinel") ? (F = Z(s, x), t[18] = F) : F = t[18];
|
|
926
|
+
let I;
|
|
927
|
+
t[19] !== m || t[20] !== r || t[21] !== p || t[22] !== C || t[23] !== w || t[24] !== M || t[25] !== N || t[26] !== P || t[27] !== A || t[28] !== j || t[29] !== T ? (I = /* @__PURE__ */ G(De, {
|
|
928
|
+
thousandSeparator: !0,
|
|
929
|
+
prefix: A,
|
|
930
|
+
placeholder: j,
|
|
931
|
+
thousandsGroupStyle: M,
|
|
932
|
+
suffix: "",
|
|
933
|
+
allowNegative: !1,
|
|
934
|
+
id: m,
|
|
935
|
+
getInputRef: C,
|
|
936
|
+
onValueChange: N,
|
|
937
|
+
onBlur: P,
|
|
938
|
+
value: T,
|
|
939
|
+
readOnly: p,
|
|
940
|
+
className: F,
|
|
941
|
+
...w,
|
|
942
|
+
...r
|
|
943
|
+
}), t[19] = m, t[20] = r, t[21] = p, t[22] = C, t[23] = w, t[24] = M, t[25] = N, t[26] = P, t[27] = A, t[28] = j, t[29] = T, t[30] = I) : I = t[30];
|
|
944
|
+
let L;
|
|
945
|
+
return t[31] !== D || t[32] !== f || t[33] !== E || t[34] !== d || t[35] !== m || t[36] !== p || t[37] !== I ? (L = /* @__PURE__ */ G(o, {
|
|
946
|
+
error: D,
|
|
947
|
+
helperText: f,
|
|
948
|
+
readOnly: p,
|
|
949
|
+
htmlFor: m,
|
|
950
|
+
isRequired: E,
|
|
951
|
+
label: d,
|
|
952
|
+
children: I
|
|
953
|
+
}), t[31] = D, t[32] = f, t[33] = E, t[34] = d, t[35] = m, t[36] = p, t[37] = I, t[38] = L) : L = t[38], L;
|
|
954
|
+
}, Cn = {
|
|
955
|
+
label: "Other",
|
|
956
|
+
value: "other_internal"
|
|
957
|
+
}, wn = ({ field: e, ...n }) => {
|
|
958
|
+
let { portalRef: r } = t(), [i, a] = U([]), { key: s = "", label: c = "", helper_text: l = "", readonly: u = !1, values: d = [], options: p = {} } = e, m = s, { field: { value: g, onBlur: _, onChange: v, disabled: y, ...b }, fieldState: x } = Q({
|
|
959
|
+
name: m,
|
|
960
|
+
rules: h(e)
|
|
961
|
+
}), [S, C] = U(""), [w, T] = U(!1), E = !!e?.required, D = x?.error?.message, O = !!p?.custom_input;
|
|
962
|
+
return B(() => {
|
|
963
|
+
if (d?.length) {
|
|
964
|
+
let e = [...pt(d)];
|
|
965
|
+
O && e.push(Cn), a(e);
|
|
966
|
+
}
|
|
967
|
+
}, [d, O]), B(() => {
|
|
968
|
+
!n?.isMulti && O && typeof g == "string" && g && (i.some((e) => e.value !== Cn.value && e.value === g) ? T(!1) : (T(!0), C(g)));
|
|
969
|
+
}, [
|
|
970
|
+
g,
|
|
971
|
+
i,
|
|
972
|
+
O
|
|
973
|
+
]), /* @__PURE__ */ K(o, {
|
|
974
|
+
error: D,
|
|
975
|
+
helperText: l,
|
|
976
|
+
readOnly: u,
|
|
977
|
+
label: c,
|
|
978
|
+
htmlFor: m,
|
|
979
|
+
isRequired: E,
|
|
980
|
+
children: [/* @__PURE__ */ G(Oe, {
|
|
981
|
+
id: m,
|
|
982
|
+
value: w ? Cn : g ? n?.isMulti ? i?.filter((e) => g?.includes(e?.value)) : i?.find((e) => e?.value === g) : null,
|
|
983
|
+
onChange: (e) => {
|
|
984
|
+
O && e?.value === Cn.value && e?.label === Cn.label ? (T(!0), C(""), v("")) : (T(!1), n?.isMulti ? v(e?.map((e) => e?.value)) : v(e?.value));
|
|
985
|
+
},
|
|
986
|
+
onBlur: () => _(),
|
|
987
|
+
options: i,
|
|
988
|
+
isDisabled: y,
|
|
989
|
+
menuPlacement: "auto",
|
|
990
|
+
isClearable: !0,
|
|
991
|
+
...b,
|
|
992
|
+
...n,
|
|
993
|
+
unstyled: !0,
|
|
994
|
+
classNames: on,
|
|
995
|
+
styles: { menuPortal: (e) => ({
|
|
996
|
+
...e,
|
|
997
|
+
zIndex: 99999999
|
|
998
|
+
}) },
|
|
999
|
+
menuPosition: "fixed",
|
|
1000
|
+
menuPortalTarget: r?.current
|
|
1001
|
+
}), w && /* @__PURE__ */ G("div", {
|
|
1002
|
+
className: "ldp9z20",
|
|
1003
|
+
children: /* @__PURE__ */ G(f, {
|
|
1004
|
+
name: `select-other-${m}`,
|
|
1005
|
+
value: S,
|
|
1006
|
+
onChange: (e) => {
|
|
1007
|
+
v?.(e.target.value), C(e.target.value);
|
|
1008
|
+
},
|
|
1009
|
+
placeholder: "Other, Please Specify"
|
|
1010
|
+
})
|
|
1011
|
+
})]
|
|
1012
|
+
});
|
|
1013
|
+
}, Tn = "eviv4t0", En = "eviv4t1", Dn = "eviv4t3", On = (e) => {
|
|
1014
|
+
let t = O(50), n, r, i;
|
|
1015
|
+
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);
|
|
1016
|
+
let { key: a, label: s, helper_text: c, readonly: l } = n, u = a === void 0 ? "" : a, d = s === void 0 ? "" : s, p = c === void 0 ? "" : c, m = l === void 0 ? !1 : l, g = u, _ = !!n.options?.verification && !!i?.enableVerification, [v, y] = U(null), [b, x] = U(!1), S;
|
|
1017
|
+
t[4] !== b || t[5] !== _ || t[6] !== v ? (S = (e) => b ? !0 : _ && (!v || v !== e) ? "Email verification required" : !0, t[4] = b, t[5] = _, t[6] = v, t[7] = S) : S = t[7];
|
|
1018
|
+
let C;
|
|
1019
|
+
t[8] !== n || t[9] !== S ? (C = h(n, S), t[8] = n, t[9] = S, t[10] = C) : C = t[10];
|
|
1020
|
+
let w = C, T;
|
|
1021
|
+
t[11] !== g || t[12] !== w ? (T = {
|
|
1022
|
+
name: g,
|
|
1023
|
+
rules: w
|
|
1024
|
+
}, t[11] = g, t[12] = w, t[13] = T) : T = t[13];
|
|
1025
|
+
let { field: E, fieldState: k } = Q(T), A, j, M, N;
|
|
1026
|
+
t[14] === E ? (A = t[15], j = t[16], M = t[17], N = t[18]) : ({value: N, onBlur: j, onChange: M, ...A} = E, t[14] = E, t[15] = A, t[16] = j, t[17] = M, t[18] = N);
|
|
1027
|
+
let P = !!n?.required, F = k?.error?.message, I = !!v && !!N && v === N?.trim()?.toLowerCase(), L;
|
|
1028
|
+
t[19] === M ? L = t[20] : (L = (e) => {
|
|
1029
|
+
y(e), M(e);
|
|
1030
|
+
}, t[19] = M, t[20] = L);
|
|
1031
|
+
let R = L, z;
|
|
1032
|
+
t[21] === Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ G(be, { size: 20 }), t[21] = z) : z = t[21];
|
|
1033
|
+
let B;
|
|
1034
|
+
t[22] === I ? B = t[23] : (B = I ? /* @__PURE__ */ G("button", {
|
|
1035
|
+
type: "button",
|
|
1036
|
+
onClick: () => y(null),
|
|
1037
|
+
className: Dn,
|
|
1038
|
+
title: "Change email",
|
|
1039
|
+
children: /* @__PURE__ */ G(xe, { size: 14 })
|
|
1040
|
+
}) : null, t[22] = I, t[23] = B);
|
|
1041
|
+
let V = N || "", H;
|
|
1042
|
+
t[24] === M ? H = t[25] : (H = (e) => M(e?.target?.value?.trim()?.toLocaleLowerCase()), t[24] = M, t[25] = H);
|
|
1043
|
+
let W = m || I, q;
|
|
1044
|
+
t[26] !== A || t[27] !== g || t[28] !== j || t[29] !== r || t[30] !== B || t[31] !== V || t[32] !== H || t[33] !== W ? (q = /* @__PURE__ */ G(f, {
|
|
1045
|
+
className: En,
|
|
1046
|
+
id: g,
|
|
1047
|
+
type: "email",
|
|
1048
|
+
leftIcon: z,
|
|
1049
|
+
rightIcon: B,
|
|
1050
|
+
value: V,
|
|
1051
|
+
onChange: H,
|
|
1052
|
+
onBlur: j,
|
|
1053
|
+
readOnly: W,
|
|
1054
|
+
...A,
|
|
1055
|
+
...r
|
|
1056
|
+
}), t[26] = A, t[27] = g, t[28] = j, t[29] = r, t[30] = B, t[31] = V, t[32] = H, t[33] = W, t[34] = q) : q = t[34];
|
|
1057
|
+
let J;
|
|
1058
|
+
t[35] !== R || t[36] !== I || t[37] !== _ || t[38] !== N ? (J = _ && /* @__PURE__ */ G("div", {
|
|
1059
|
+
className: "eviv4t2",
|
|
1060
|
+
children: /* @__PURE__ */ G(D, {
|
|
1061
|
+
value: N,
|
|
1062
|
+
type: "email",
|
|
1063
|
+
isVerified: I,
|
|
1064
|
+
onVerifySuccess: R,
|
|
1065
|
+
onStateChange: x
|
|
1066
|
+
})
|
|
1067
|
+
}), t[35] = R, t[36] = I, t[37] = _, t[38] = N, t[39] = J) : J = t[39];
|
|
1068
|
+
let Y;
|
|
1069
|
+
t[40] !== q || t[41] !== J ? (Y = /* @__PURE__ */ K("div", {
|
|
1070
|
+
className: Tn,
|
|
1071
|
+
children: [q, J]
|
|
1072
|
+
}), t[40] = q, t[41] = J, t[42] = Y) : Y = t[42];
|
|
1073
|
+
let X;
|
|
1074
|
+
return t[43] !== F || t[44] !== p || t[45] !== P || t[46] !== d || t[47] !== g || t[48] !== Y ? (X = /* @__PURE__ */ G(o, {
|
|
1075
|
+
error: F,
|
|
1076
|
+
helperText: p,
|
|
1077
|
+
label: d,
|
|
1078
|
+
htmlFor: g,
|
|
1079
|
+
isRequired: P,
|
|
1080
|
+
children: Y
|
|
1081
|
+
}), t[43] = F, t[44] = p, t[45] = P, t[46] = d, t[47] = g, t[48] = Y, t[49] = X) : X = t[49], X;
|
|
1082
|
+
}, kn = (e) => e ? {
|
|
1083
|
+
value: e,
|
|
1084
|
+
label: e?.place_name || e?.formatted_address || e?.name
|
|
1085
|
+
} : null, An = ({ field: e }) => {
|
|
1086
|
+
let { portalRef: n } = t(), [r, i] = U(!1), [a, s] = U(!1), c = M(), { key: l = "", label: u = "", helper_text: d = "", readonly: f = !1 } = e, { field: { value: p, onBlur: m, onChange: g, disabled: _, ...v }, fieldState: y } = Q({
|
|
1087
|
+
name: l,
|
|
1088
|
+
rules: h(e)
|
|
1089
|
+
}), b = !!e?.required, x = y?.error?.message, S = (e) => {
|
|
1090
|
+
e && e?.place_id !== p?.place_id ? (s(!0), c?.fetch.url(`/v1/bevy/content/location/${e?.place_id}/get-location-details`).get().json().then((e) => {
|
|
1091
|
+
g && g(e?.content?.data);
|
|
1092
|
+
}).catch((e) => {
|
|
1093
|
+
console.log("Could not fetch location details:", ee(e).message);
|
|
1094
|
+
}).finally(() => s(!1))) : g(null);
|
|
1095
|
+
}, C = (t, n) => {
|
|
1096
|
+
i(!0);
|
|
1097
|
+
let r = {};
|
|
1098
|
+
e?.options?.location_type && (r.location_type = e?.options?.location_type), e?.options?.country && (r.country = e?.options?.country), c?.fetch.url("/v1/bevy/content/location/search-location").post({
|
|
1099
|
+
search: t,
|
|
1100
|
+
where: r
|
|
1101
|
+
}).json().then((e) => {
|
|
1102
|
+
n(e?.content?.data?.map((e) => ({
|
|
1103
|
+
label: e?.description,
|
|
1104
|
+
value: e
|
|
1105
|
+
})));
|
|
1106
|
+
}).catch(() => {
|
|
1107
|
+
n([]);
|
|
1108
|
+
}).finally(() => i(!1));
|
|
1109
|
+
};
|
|
1110
|
+
return /* @__PURE__ */ G(o, {
|
|
1111
|
+
error: x,
|
|
1112
|
+
helperText: d,
|
|
1113
|
+
readOnly: f,
|
|
1114
|
+
label: u,
|
|
1115
|
+
htmlFor: l,
|
|
1116
|
+
isRequired: b,
|
|
1117
|
+
children: /* @__PURE__ */ G(ke, {
|
|
1118
|
+
id: l,
|
|
1119
|
+
value: kn(p),
|
|
1120
|
+
defaultOptions: p ? [kn(p)] : void 0,
|
|
1121
|
+
onChange: (e) => {
|
|
1122
|
+
S(e?.value);
|
|
1123
|
+
},
|
|
1124
|
+
onBlur: m,
|
|
1125
|
+
isDisabled: _ || a,
|
|
1126
|
+
menuPlacement: "auto",
|
|
1127
|
+
...v,
|
|
1128
|
+
unstyled: !0,
|
|
1129
|
+
classNames: on,
|
|
1130
|
+
styles: { menuPortal: (e) => ({
|
|
1131
|
+
...e,
|
|
1132
|
+
zIndex: 99999999
|
|
1133
|
+
}) },
|
|
1134
|
+
menuPosition: "fixed",
|
|
1135
|
+
menuPortalTarget: n?.current,
|
|
1136
|
+
loadOptions: C,
|
|
1137
|
+
isLoading: r || a,
|
|
1138
|
+
isClearable: !0,
|
|
1139
|
+
noOptionsMessage: ({ inputValue: e }) => e ? "No results found. Try searching something else" : "Start typing to search"
|
|
1140
|
+
})
|
|
1141
|
+
});
|
|
1142
|
+
}, jn = "xgv9uh0", Mn = "xgv9uh1", Nn = "xgv9uh2", Pn = "xgv9uh3", Fn = "xgv9uh4", In = "xgv9uh5", Ln = (e) => {
|
|
1143
|
+
let t = O(29), { field: r } = e, { key: i, label: a } = r, o = i === void 0 ? "" : i, s = a === void 0 ? "" : a, c;
|
|
1144
|
+
t[0] === o ? c = t[1] : (c = { name: o }, t[0] = o, t[1] = c);
|
|
1145
|
+
let l = se(c), u, d, f, p, h, g;
|
|
1146
|
+
if (t[2] !== r || t[3] !== o || t[4] !== s || t[5] !== l) {
|
|
1147
|
+
let { fields: e, ...i } = l;
|
|
1148
|
+
u = i, p = jn, h = o, t[12] !== o || t[13] !== s ? (g = s && /* @__PURE__ */ G(m, {
|
|
1149
|
+
htmlFor: o,
|
|
1150
|
+
className: "_1ompjs11",
|
|
1151
|
+
children: s
|
|
1152
|
+
}), t[12] = o, t[13] = s, t[14] = g) : g = t[14], d = Mn, f = e?.map((e, t) => /* @__PURE__ */ K("div", {
|
|
1153
|
+
className: Pn,
|
|
1154
|
+
children: [/* @__PURE__ */ G("div", {
|
|
1155
|
+
className: Fn,
|
|
1156
|
+
children: /* @__PURE__ */ G(An, { field: {
|
|
1157
|
+
...r,
|
|
1158
|
+
key: `${o}.${t}`,
|
|
1159
|
+
label: ""
|
|
1160
|
+
} })
|
|
1161
|
+
}), /* @__PURE__ */ G(n, {
|
|
1162
|
+
variant: "ghost",
|
|
1163
|
+
size: "icon-sm",
|
|
1164
|
+
className: In,
|
|
1165
|
+
onClick: () => u.remove(t),
|
|
1166
|
+
"aria-label": `Remove location ${t + 1}`,
|
|
1167
|
+
children: /* @__PURE__ */ G(Ce, { size: 14 })
|
|
1168
|
+
})]
|
|
1169
|
+
}, e.id)), t[2] = r, t[3] = o, t[4] = s, t[5] = l, t[6] = u, t[7] = d, t[8] = f, t[9] = p, t[10] = h, t[11] = g;
|
|
1170
|
+
} else u = t[6], d = t[7], f = t[8], p = t[9], h = t[10], g = t[11];
|
|
1171
|
+
let _;
|
|
1172
|
+
t[15] === u ? _ = t[16] : (_ = () => {
|
|
1173
|
+
u.append(null);
|
|
1174
|
+
}, t[15] = u, t[16] = _);
|
|
1175
|
+
let v;
|
|
1176
|
+
t[17] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ G(Se, { size: 14 }), t[17] = v) : v = t[17];
|
|
1177
|
+
let y;
|
|
1178
|
+
t[18] === _ ? y = t[19] : (y = /* @__PURE__ */ K(n, {
|
|
1179
|
+
variant: "ghost",
|
|
1180
|
+
size: "xs",
|
|
1181
|
+
className: Nn,
|
|
1182
|
+
onClick: _,
|
|
1183
|
+
children: [v, "Add"]
|
|
1184
|
+
}), t[18] = _, t[19] = y);
|
|
1185
|
+
let b;
|
|
1186
|
+
t[20] !== y || t[21] !== d || t[22] !== f ? (b = /* @__PURE__ */ K("div", {
|
|
1187
|
+
className: d,
|
|
1188
|
+
children: [f, y]
|
|
1189
|
+
}), t[20] = y, t[21] = d, t[22] = f, t[23] = b) : b = t[23];
|
|
1190
|
+
let x;
|
|
1191
|
+
return t[24] !== b || t[25] !== p || t[26] !== h || t[27] !== g ? (x = /* @__PURE__ */ K("div", {
|
|
1192
|
+
className: p,
|
|
1193
|
+
children: [g, b]
|
|
1194
|
+
}, h), t[24] = b, t[25] = p, t[26] = h, t[27] = g, t[28] = x) : x = t[28], x;
|
|
1195
|
+
}, Rn = "a22xph0", zn = "a22xph2", Bn = "a22xph3", Vn = "a22xph5", Hn = /[\n\t,]+/, Un = ({ field: e }) => {
|
|
1196
|
+
let { key: t = "", label: n = "", helper_text: r = "", readonly: i = !1 } = e, a = t, { field: { value: s, onChange: c, onBlur: l, ref: u }, fieldState: d } = Q({
|
|
1197
|
+
name: a,
|
|
1198
|
+
rules: h(e)
|
|
1199
|
+
}), f = !!e?.required, p = d?.error?.message, m = Array.isArray(s) ? s : [], [g, _] = U(""), [v, y] = U(-1), b = H(null), x = R((e) => {
|
|
1200
|
+
b.current = e, typeof u == "function" && u(e);
|
|
1201
|
+
}, [u]), S = R((e) => {
|
|
1202
|
+
c(m.filter((t, n) => n !== e));
|
|
1203
|
+
}, [m, c]), C = R(() => {
|
|
1204
|
+
if (!g.trim()) return;
|
|
1205
|
+
let e = g.split(Hn), t = [...m];
|
|
1206
|
+
for (let n of e) {
|
|
1207
|
+
let e = n.trim();
|
|
1208
|
+
e && !t.includes(e) && t.push(e);
|
|
1209
|
+
}
|
|
1210
|
+
c(t), _("");
|
|
1211
|
+
}, [
|
|
1212
|
+
g,
|
|
1213
|
+
m,
|
|
1214
|
+
c
|
|
1215
|
+
]), w = R((e) => {
|
|
1216
|
+
let t = e.currentTarget;
|
|
1217
|
+
switch (e.key) {
|
|
1218
|
+
case "Enter":
|
|
1219
|
+
g.trim() && (e.preventDefault(), C());
|
|
1220
|
+
break;
|
|
1221
|
+
case "Backspace":
|
|
1222
|
+
t.selectionStart === 0 && t.selectionEnd === 0 && m.length > 0 && (v >= 0 ? (S(v), y(v > 0 ? v - 1 : -1)) : y(m.length - 1));
|
|
1223
|
+
break;
|
|
1224
|
+
case "Delete":
|
|
1225
|
+
v >= 0 && v < m.length && (S(v), y(v < m.length - 1 ? v : -1));
|
|
1226
|
+
break;
|
|
1227
|
+
case "ArrowLeft":
|
|
1228
|
+
t.selectionStart === 0 && m.length > 0 && (e.preventDefault(), y(v > 0 ? v - 1 : v === -1 ? m.length - 1 : 0));
|
|
1229
|
+
break;
|
|
1230
|
+
case "ArrowRight":
|
|
1231
|
+
v >= 0 && (e.preventDefault(), v < m.length - 1 ? y(v + 1) : y(-1));
|
|
1232
|
+
break;
|
|
1233
|
+
case "Escape":
|
|
1234
|
+
y(-1);
|
|
1235
|
+
break;
|
|
1236
|
+
default:
|
|
1237
|
+
v >= 0 && y(-1);
|
|
1238
|
+
break;
|
|
1239
|
+
}
|
|
1240
|
+
}, [
|
|
1241
|
+
g,
|
|
1242
|
+
m,
|
|
1243
|
+
v,
|
|
1244
|
+
C,
|
|
1245
|
+
S
|
|
1246
|
+
]), T = R((e) => {
|
|
1247
|
+
let t = e.clipboardData.getData("text");
|
|
1248
|
+
if (Hn.test(t)) {
|
|
1249
|
+
e.preventDefault();
|
|
1250
|
+
let n = t.split(Hn), r = [...m];
|
|
1251
|
+
for (let e of n) {
|
|
1252
|
+
let t = e.trim();
|
|
1253
|
+
t && !r.includes(t) && r.push(t);
|
|
1254
|
+
}
|
|
1255
|
+
c(r), _("");
|
|
1256
|
+
}
|
|
1257
|
+
}, [m, c]), E = R(() => {
|
|
1258
|
+
b.current?.focus(), y(-1);
|
|
1259
|
+
}, []), D = R(() => {
|
|
1260
|
+
C(), y(-1), l();
|
|
1261
|
+
}, [C, l]);
|
|
1262
|
+
return /* @__PURE__ */ G(o, {
|
|
1263
|
+
error: p,
|
|
1264
|
+
helperText: r,
|
|
1265
|
+
label: n,
|
|
1266
|
+
htmlFor: a,
|
|
1267
|
+
isRequired: f,
|
|
1268
|
+
children: /* @__PURE__ */ K("div", {
|
|
1269
|
+
className: Rn,
|
|
1270
|
+
"data-readonly": i,
|
|
1271
|
+
onClick: E,
|
|
1272
|
+
children: [m.map((e, t) => /* @__PURE__ */ K("span", {
|
|
1273
|
+
className: zn,
|
|
1274
|
+
"data-active": v === t,
|
|
1275
|
+
children: [/* @__PURE__ */ G("span", {
|
|
1276
|
+
className: Bn,
|
|
1277
|
+
children: e
|
|
1278
|
+
}), !i && /* @__PURE__ */ G("button", {
|
|
1279
|
+
type: "button",
|
|
1280
|
+
className: "a22xph4",
|
|
1281
|
+
onClick: (e) => {
|
|
1282
|
+
e.stopPropagation(), S(t), b.current?.focus();
|
|
1283
|
+
},
|
|
1284
|
+
"aria-label": `Remove ${e}`,
|
|
1285
|
+
tabIndex: -1,
|
|
1286
|
+
children: /* @__PURE__ */ G(Te, { size: 12 })
|
|
1287
|
+
})]
|
|
1288
|
+
}, `${e}-${t}`)), /* @__PURE__ */ G("input", {
|
|
1289
|
+
ref: x,
|
|
1290
|
+
id: a,
|
|
1291
|
+
className: Vn,
|
|
1292
|
+
type: "text",
|
|
1293
|
+
value: g,
|
|
1294
|
+
onChange: (e) => _(e.target.value),
|
|
1295
|
+
onKeyDown: w,
|
|
1296
|
+
onPaste: T,
|
|
1297
|
+
onBlur: D,
|
|
1298
|
+
placeholder: m.length === 0 ? e.placeholder || "Type and press Enter" : "",
|
|
1299
|
+
readOnly: i,
|
|
1300
|
+
disabled: i,
|
|
1301
|
+
autoComplete: "off"
|
|
1302
|
+
})]
|
|
1303
|
+
})
|
|
1304
|
+
});
|
|
1305
|
+
}, Wn = "jqes4z0", Gn = "jqes4z2", Kn = "jqes4z3", qn = "_1mrsmih0", Jn = "_1mrsmih1", Yn = "_1mrsmih2", Xn = "_1mrsmih3", Zn = (e) => {
|
|
1306
|
+
let t = O(8), n, r;
|
|
1307
|
+
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1308
|
+
let i;
|
|
1309
|
+
t[3] === n ? i = t[4] : (i = Z(qn, n), t[3] = n, t[4] = i);
|
|
1310
|
+
let a;
|
|
1311
|
+
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ G(je, {
|
|
1312
|
+
"data-slot": "radio-group",
|
|
1313
|
+
className: i,
|
|
1314
|
+
...r
|
|
1315
|
+
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
1316
|
+
}, Qn = (e) => {
|
|
1317
|
+
let t = O(9), n, r;
|
|
1318
|
+
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
1319
|
+
let i;
|
|
1320
|
+
t[3] === n ? i = t[4] : (i = Z(Jn, n), t[3] = n, t[4] = i);
|
|
1321
|
+
let a;
|
|
1322
|
+
t[5] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ G(Ae.Indicator, {
|
|
1323
|
+
"data-slot": "radio-group-indicator",
|
|
1324
|
+
className: Yn,
|
|
1325
|
+
children: /* @__PURE__ */ G("span", { className: Xn })
|
|
1326
|
+
}), t[5] = a) : a = t[5];
|
|
1327
|
+
let o;
|
|
1328
|
+
return t[6] !== r || t[7] !== i ? (o = /* @__PURE__ */ G(Ae.Root, {
|
|
1329
|
+
"data-slot": "radio-group-item",
|
|
1330
|
+
className: i,
|
|
1331
|
+
...r,
|
|
1332
|
+
children: a
|
|
1333
|
+
}), t[6] = r, t[7] = i, t[8] = o) : o = t[8], o;
|
|
1334
|
+
}, $n = (e) => {
|
|
1335
|
+
let t = O(56), { field: n } = e, [r, i] = N.useState(""), [a, s] = N.useState(!1), { key: c, label: l, helper_text: u, readonly: d, values: p, options: g } = n, _ = c === void 0 ? "" : c, v = l === void 0 ? "" : l, y = u === void 0 ? "" : u, b = d === void 0 ? !1 : d, x;
|
|
1336
|
+
t[0] === p ? x = t[1] : (x = p === void 0 ? [] : p, t[0] = p, t[1] = x);
|
|
1337
|
+
let S = x, C;
|
|
1338
|
+
t[2] === g ? C = t[3] : (C = g === void 0 ? {} : g, t[2] = g, t[3] = C);
|
|
1339
|
+
let { custom_input: w } = C, T = _, E;
|
|
1340
|
+
t[4] === n ? E = t[5] : (E = h(n), t[4] = n, t[5] = E);
|
|
1341
|
+
let D;
|
|
1342
|
+
t[6] !== T || t[7] !== E ? (D = {
|
|
1343
|
+
name: T,
|
|
1344
|
+
rules: E
|
|
1345
|
+
}, t[6] = T, t[7] = E, t[8] = D) : D = t[8];
|
|
1346
|
+
let { field: k, fieldState: A } = Q(D), j, M, P, F;
|
|
1347
|
+
t[9] === k ? (j = t[10], M = t[11], P = t[12], F = t[13]) : ({value: F, onBlur: j, onChange: M, ...P} = k, t[9] = k, t[10] = j, t[11] = M, t[12] = P, t[13] = F);
|
|
1348
|
+
let I = !!n?.required, L = A?.error?.message, R;
|
|
1349
|
+
t[14] === S ? R = t[15] : (R = pt(S), t[14] = S, t[15] = R);
|
|
1350
|
+
let z = R, B, V;
|
|
1351
|
+
t[16] !== z || t[17] !== a || t[18] !== F ? (B = () => {
|
|
1352
|
+
a || F && z.findIndex((e) => e.value === F) === -1 && (s(!0), i(F));
|
|
1353
|
+
}, V = [
|
|
1354
|
+
F,
|
|
1355
|
+
z,
|
|
1356
|
+
a
|
|
1357
|
+
], t[16] = z, t[17] = a, t[18] = F, t[19] = B, t[20] = V) : (B = t[19], V = t[20]), N.useEffect(B, V);
|
|
1358
|
+
let H = b && "jqes4z1", U;
|
|
1359
|
+
t[21] === H ? U = t[22] : (U = Z(Wn, H), t[21] = H, t[22] = U);
|
|
1360
|
+
let W;
|
|
1361
|
+
t[23] !== M || t[24] !== r ? (W = (e) => {
|
|
1362
|
+
M && (e === "Other" ? (s(!0), M(r)) : (s(!1), M(e)));
|
|
1363
|
+
}, t[23] = M, t[24] = r, t[25] = W) : W = t[25];
|
|
1364
|
+
let q;
|
|
1365
|
+
t[26] === j ? q = t[27] : (q = () => j(), t[26] = j, t[27] = q);
|
|
1366
|
+
let J = a ? "Other" : F ?? "", Y;
|
|
1367
|
+
if (t[28] !== z || t[29] !== T) {
|
|
1368
|
+
let e;
|
|
1369
|
+
t[31] === T ? e = t[32] : (e = (e, t) => /* @__PURE__ */ K("div", {
|
|
1370
|
+
className: Gn,
|
|
1371
|
+
children: [/* @__PURE__ */ G(Qn, {
|
|
1372
|
+
id: `${T}-${e.value}-${t}`,
|
|
1373
|
+
value: e.value
|
|
1374
|
+
}), /* @__PURE__ */ G(m, {
|
|
1375
|
+
htmlFor: `${T}-${e.value}-${t}`,
|
|
1376
|
+
className: Kn,
|
|
1377
|
+
children: e.label
|
|
1378
|
+
})]
|
|
1379
|
+
}, `${e.value}-${t}`), t[31] = T, t[32] = e), Y = z.map(e), t[28] = z, t[29] = T, t[30] = Y;
|
|
1380
|
+
} else Y = t[30];
|
|
1381
|
+
let X;
|
|
1382
|
+
t[33] !== w || t[34] !== T || t[35] !== M || t[36] !== a || t[37] !== r ? (X = !!w && /* @__PURE__ */ K("div", {
|
|
1383
|
+
className: "jqes4z4",
|
|
1384
|
+
children: [
|
|
1385
|
+
/* @__PURE__ */ G(Qn, {
|
|
1386
|
+
id: `${T}-other`,
|
|
1387
|
+
value: "Other"
|
|
1388
|
+
}),
|
|
1389
|
+
/* @__PURE__ */ G(m, {
|
|
1390
|
+
className: "jqes4z3",
|
|
1391
|
+
htmlFor: `${T}-other`,
|
|
1392
|
+
children: "Other:"
|
|
1393
|
+
}),
|
|
1394
|
+
/* @__PURE__ */ G("div", {
|
|
1395
|
+
className: "jqes4z6",
|
|
1396
|
+
children: /* @__PURE__ */ G(f, {
|
|
1397
|
+
className: "jqes4z5",
|
|
1398
|
+
name: `radio-other-${T}`,
|
|
1399
|
+
value: r,
|
|
1400
|
+
onChange: (e) => {
|
|
1401
|
+
M?.(e?.target?.value), i(e.target.value);
|
|
1402
|
+
},
|
|
1403
|
+
disabled: !a,
|
|
1404
|
+
placeholder: "Please specify"
|
|
1405
|
+
})
|
|
1406
|
+
})
|
|
1407
|
+
]
|
|
1408
|
+
}), t[33] = w, t[34] = T, t[35] = M, t[36] = a, t[37] = r, t[38] = X) : X = t[38];
|
|
1409
|
+
let ee;
|
|
1410
|
+
t[39] !== T || t[40] !== P || t[41] !== U || t[42] !== W || t[43] !== q || t[44] !== J || t[45] !== Y || t[46] !== X ? (ee = /* @__PURE__ */ K(Zn, {
|
|
1411
|
+
id: T,
|
|
1412
|
+
className: U,
|
|
1413
|
+
onValueChange: W,
|
|
1414
|
+
onBlur: q,
|
|
1415
|
+
value: J,
|
|
1416
|
+
...P,
|
|
1417
|
+
children: [Y, X]
|
|
1418
|
+
}), t[39] = T, t[40] = P, t[41] = U, t[42] = W, t[43] = q, t[44] = J, t[45] = Y, t[46] = X, t[47] = ee) : ee = t[47];
|
|
1419
|
+
let te;
|
|
1420
|
+
return t[48] !== L || t[49] !== y || t[50] !== I || t[51] !== v || t[52] !== T || t[53] !== b || t[54] !== ee ? (te = /* @__PURE__ */ G(o, {
|
|
1421
|
+
error: L,
|
|
1422
|
+
helperText: y,
|
|
1423
|
+
readOnly: b,
|
|
1424
|
+
label: v,
|
|
1425
|
+
htmlFor: T,
|
|
1426
|
+
isRequired: I,
|
|
1427
|
+
children: ee
|
|
1428
|
+
}), t[48] = L, t[49] = y, t[50] = I, t[51] = v, t[52] = T, t[53] = b, t[54] = ee, t[55] = te) : te = t[55], te;
|
|
1429
|
+
}, er = "i9l98i0", tr = ie({
|
|
1430
|
+
defaultClassName: "_193nrs70",
|
|
1431
|
+
variantClassNames: { size: {
|
|
1432
|
+
default: "_193nrs71",
|
|
1433
|
+
sm: "_193nrs72"
|
|
1434
|
+
} },
|
|
1435
|
+
defaultVariants: { size: "default" },
|
|
1436
|
+
compoundVariants: []
|
|
1437
|
+
}), nr = "_193nrs73", rr = "_193nrs74", ir = "_193nrs75", ar = (e) => {
|
|
1438
|
+
let t = O(15), n, r, i;
|
|
1439
|
+
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);
|
|
1440
|
+
let a = i === void 0 ? "default" : i, o;
|
|
1441
|
+
t[4] !== n || t[5] !== a ? (o = Z(tr({ size: a }), n), t[4] = n, t[5] = a, t[6] = o) : o = t[6];
|
|
1442
|
+
let s = a === "sm" ? ir : rr, c;
|
|
1443
|
+
t[7] === s ? c = t[8] : (c = Z(nr, s), t[7] = s, t[8] = c);
|
|
1444
|
+
let l;
|
|
1445
|
+
t[9] === c ? l = t[10] : (l = /* @__PURE__ */ G(Me.Thumb, {
|
|
1446
|
+
"data-slot": "switch-thumb",
|
|
1447
|
+
className: c
|
|
1448
|
+
}), t[9] = c, t[10] = l);
|
|
1449
|
+
let u;
|
|
1450
|
+
return t[11] !== r || t[12] !== o || t[13] !== l ? (u = /* @__PURE__ */ G(Me.Root, {
|
|
1451
|
+
"data-slot": "switch",
|
|
1452
|
+
className: o,
|
|
1453
|
+
...r,
|
|
1454
|
+
children: l
|
|
1455
|
+
}), t[11] = r, t[12] = o, t[13] = l, t[14] = u) : u = t[14], u;
|
|
1456
|
+
}, or = (t) => {
|
|
1457
|
+
let n = O(32), { field: r } = t, { key: i, label: a, helper_text: s, readonly: c } = r, l = i === void 0 ? "" : i, u = a === void 0 ? "" : a, d = s === void 0 ? "" : s, f = c === void 0 ? !1 : c, p = l, m;
|
|
1458
|
+
n[0] === r ? m = n[1] : (m = h(r), n[0] = r, n[1] = m);
|
|
1459
|
+
let g;
|
|
1460
|
+
n[2] !== p || n[3] !== m ? (g = {
|
|
1461
|
+
name: p,
|
|
1462
|
+
rules: m
|
|
1463
|
+
}, n[2] = p, n[3] = m, n[4] = g) : g = n[4];
|
|
1464
|
+
let { field: _, fieldState: v } = Q(g), y, b, x, S;
|
|
1465
|
+
n[5] === _ ? (y = n[6], b = n[7], x = n[8], S = n[9]) : ({value: S, onBlur: y, onChange: b, ...x} = _, n[5] = _, n[6] = y, n[7] = b, n[8] = x, n[9] = S);
|
|
1466
|
+
let C = !!r?.required, w = v?.error?.message, T = !!S, E;
|
|
1467
|
+
n[10] === b ? E = n[11] : (E = (e) => b?.(e), n[10] = b, n[11] = E);
|
|
1468
|
+
let D;
|
|
1469
|
+
n[12] === y ? D = n[13] : (D = () => y?.(), n[12] = y, n[13] = D);
|
|
1470
|
+
let k;
|
|
1471
|
+
n[14] !== p || n[15] !== x || n[16] !== D || n[17] !== T || n[18] !== E ? (k = /* @__PURE__ */ G(ar, {
|
|
1472
|
+
id: p,
|
|
1473
|
+
checked: T,
|
|
1474
|
+
onCheckedChange: E,
|
|
1475
|
+
onBlur: D,
|
|
1476
|
+
...x
|
|
1477
|
+
}), n[14] = p, n[15] = x, n[16] = D, n[17] = T, n[18] = E, n[19] = k) : k = n[19];
|
|
1478
|
+
let A;
|
|
1479
|
+
n[20] !== C || n[21] !== u || n[22] !== p ? (A = /* @__PURE__ */ G(e, {
|
|
1480
|
+
label: u,
|
|
1481
|
+
isRequired: C,
|
|
1482
|
+
htmlFor: p
|
|
1483
|
+
}), n[20] = C, n[21] = u, n[22] = p, n[23] = A) : A = n[23];
|
|
1484
|
+
let j;
|
|
1485
|
+
n[24] !== k || n[25] !== A ? (j = /* @__PURE__ */ K("div", {
|
|
1486
|
+
className: er,
|
|
1487
|
+
children: [k, A]
|
|
1488
|
+
}), n[24] = k, n[25] = A, n[26] = j) : j = n[26];
|
|
1489
|
+
let M;
|
|
1490
|
+
return n[27] !== w || n[28] !== d || n[29] !== f || n[30] !== j ? (M = /* @__PURE__ */ G(o, {
|
|
1491
|
+
error: w,
|
|
1492
|
+
helperText: d,
|
|
1493
|
+
readOnly: f,
|
|
1494
|
+
children: j
|
|
1495
|
+
}), n[27] = w, n[28] = d, n[29] = f, n[30] = j, n[31] = M) : M = n[31], M;
|
|
1496
|
+
}, sr = "gaaqp00", cr = (e) => {
|
|
1497
|
+
let t = O(29), { field: n } = e, { key: r, label: i, helper_text: a, readonly: s } = n, c = r === void 0 ? "" : r, l = i === void 0 ? "" : i, u = a === void 0 ? "" : a, f = s === void 0 ? !1 : s, p = c, m = !!n?.required, g;
|
|
1498
|
+
t[0] === n ? g = t[1] : (g = h(n), t[0] = n, t[1] = g);
|
|
1499
|
+
let _;
|
|
1500
|
+
t[2] !== p || t[3] !== g ? (_ = {
|
|
1501
|
+
name: p,
|
|
1502
|
+
rules: g
|
|
1503
|
+
}, t[2] = p, t[3] = g, t[4] = _) : _ = t[4];
|
|
1504
|
+
let { field: v, fieldState: y } = Q(_), b, x, S, C, w, T;
|
|
1505
|
+
t[5] === v ? (b = t[6], x = t[7], S = t[8], C = t[9], w = t[10], T = t[11]) : ({value: T, onBlur: x, onChange: S, ref: C, disabled: b, ...w} = v, t[5] = v, t[6] = b, t[7] = x, t[8] = S, t[9] = C, t[10] = w, t[11] = T);
|
|
1506
|
+
let E = y?.error?.message, D;
|
|
1507
|
+
t[12] === Symbol.for("react.memo_cache_sentinel") ? (D = Z(sr), t[12] = D) : D = t[12];
|
|
1508
|
+
let k = T || "", A;
|
|
1509
|
+
t[13] !== b || t[14] !== p || t[15] !== x || t[16] !== S || t[17] !== f || t[18] !== C || t[19] !== w || t[20] !== k ? (A = /* @__PURE__ */ G(d, {
|
|
1510
|
+
id: p,
|
|
1511
|
+
className: D,
|
|
1512
|
+
readOnly: f,
|
|
1513
|
+
value: k,
|
|
1514
|
+
onChange: S,
|
|
1515
|
+
onBlur: x,
|
|
1516
|
+
ref: C,
|
|
1517
|
+
disabled: b,
|
|
1518
|
+
...w
|
|
1519
|
+
}), t[13] = b, t[14] = p, t[15] = x, t[16] = S, t[17] = f, t[18] = C, t[19] = w, t[20] = k, t[21] = A) : A = t[21];
|
|
1520
|
+
let j;
|
|
1521
|
+
return t[22] !== E || t[23] !== u || t[24] !== m || t[25] !== l || t[26] !== p || t[27] !== A ? (j = /* @__PURE__ */ G(o, {
|
|
1522
|
+
error: E,
|
|
1523
|
+
helperText: u,
|
|
1524
|
+
label: l,
|
|
1525
|
+
htmlFor: p,
|
|
1526
|
+
isRequired: m,
|
|
1527
|
+
children: A
|
|
1528
|
+
}), t[22] = E, t[23] = u, t[24] = m, t[25] = l, t[26] = p, t[27] = A, t[28] = j) : j = t[28], j;
|
|
1529
|
+
}, lr = (e) => {
|
|
1530
|
+
let t = O(36), n, r, i;
|
|
1531
|
+
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);
|
|
1532
|
+
let { key: a, label: s, helper_text: c, readonly: l } = n, u = a === void 0 ? "" : a, d = s === void 0 ? "" : s, p = c === void 0 ? "" : c, m = l === void 0 ? !1 : l, g = u, _ = !!n?.required, v;
|
|
1533
|
+
t[4] === n ? v = t[5] : (v = h(n), t[4] = n, t[5] = v);
|
|
1534
|
+
let y;
|
|
1535
|
+
t[6] !== g || t[7] !== v ? (y = {
|
|
1536
|
+
name: g,
|
|
1537
|
+
rules: v
|
|
1538
|
+
}, t[6] = g, t[7] = v, t[8] = y) : y = t[8];
|
|
1539
|
+
let { field: b, fieldState: x } = Q(y), S, C, w, T, E, D;
|
|
1540
|
+
t[9] === b ? (S = t[10], C = t[11], w = t[12], T = t[13], E = t[14], D = t[15]) : ({value: D, onBlur: C, onChange: w, ref: T, disabled: S, ...E} = b, t[9] = b, t[10] = S, t[11] = C, t[12] = w, t[13] = T, t[14] = E, t[15] = D);
|
|
1541
|
+
let k = x?.error?.message, A;
|
|
1542
|
+
t[16] === i ? A = t[17] : (A = Z(i), t[16] = i, t[17] = A);
|
|
1543
|
+
let j = D || "", M;
|
|
1544
|
+
t[18] !== S || t[19] !== r || t[20] !== g || t[21] !== C || t[22] !== w || t[23] !== m || t[24] !== T || t[25] !== E || t[26] !== A || t[27] !== j ? (M = /* @__PURE__ */ G(f, {
|
|
1545
|
+
id: g,
|
|
1546
|
+
className: A,
|
|
1547
|
+
readOnly: m,
|
|
1548
|
+
value: j,
|
|
1549
|
+
onChange: w,
|
|
1550
|
+
onBlur: C,
|
|
1551
|
+
ref: T,
|
|
1552
|
+
disabled: S,
|
|
1553
|
+
...E,
|
|
1554
|
+
...r
|
|
1555
|
+
}), t[18] = S, t[19] = r, t[20] = g, t[21] = C, t[22] = w, t[23] = m, t[24] = T, t[25] = E, t[26] = A, t[27] = j, t[28] = M) : M = t[28];
|
|
1556
|
+
let N;
|
|
1557
|
+
return t[29] !== k || t[30] !== p || t[31] !== _ || t[32] !== d || t[33] !== g || t[34] !== M ? (N = /* @__PURE__ */ G(o, {
|
|
1558
|
+
error: k,
|
|
1559
|
+
helperText: p,
|
|
1560
|
+
label: d,
|
|
1561
|
+
htmlFor: g,
|
|
1562
|
+
isRequired: _,
|
|
1563
|
+
children: M
|
|
1564
|
+
}), t[29] = k, t[30] = p, t[31] = _, t[32] = d, t[33] = g, t[34] = M, t[35] = N) : N = t[35], N;
|
|
1565
|
+
}, ur = (e) => {
|
|
1566
|
+
let t = O(27), { field: n } = e, { key: r, label: i, helper_text: a, readonly: s } = n, c = r === void 0 ? "" : r, l = i === void 0 ? "" : i, u = a === void 0 ? "" : a, d = s === void 0 ? !1 : s, p = c, m;
|
|
1567
|
+
t[0] === n ? m = t[1] : (m = h(n), t[0] = n, t[1] = m);
|
|
1568
|
+
let g;
|
|
1569
|
+
t[2] !== p || t[3] !== m ? (g = {
|
|
1570
|
+
name: p,
|
|
1571
|
+
rules: m
|
|
1572
|
+
}, t[2] = p, t[3] = m, t[4] = g) : g = t[4];
|
|
1573
|
+
let { field: _, fieldState: v } = Q(g), { value: y, onBlur: b, onChange: x, ref: S } = _, C = !!n?.required, w = v?.error?.message, T = y || "", E;
|
|
1574
|
+
t[5] === x ? E = t[6] : (E = (e) => x(e.target.value || null), t[5] = x, t[6] = E);
|
|
1575
|
+
let D;
|
|
1576
|
+
t[7] !== x || t[8] !== d || t[9] !== y ? (D = y && !d ? /* @__PURE__ */ G("button", {
|
|
1577
|
+
type: "button",
|
|
1578
|
+
onClick: (e) => {
|
|
1579
|
+
e.preventDefault(), e.stopPropagation(), x(null);
|
|
1580
|
+
},
|
|
1581
|
+
style: {
|
|
1582
|
+
background: "none",
|
|
1583
|
+
border: "none",
|
|
1584
|
+
cursor: "pointer",
|
|
1585
|
+
display: "flex",
|
|
1586
|
+
padding: 0
|
|
1587
|
+
},
|
|
1588
|
+
"aria-label": "Clear time",
|
|
1589
|
+
children: /* @__PURE__ */ G(Te, { size: 16 })
|
|
1590
|
+
}) : void 0, t[7] = x, t[8] = d, t[9] = y, t[10] = D) : D = t[10];
|
|
1591
|
+
let k;
|
|
1592
|
+
t[11] !== p || t[12] !== b || t[13] !== d || t[14] !== S || t[15] !== D || t[16] !== T || t[17] !== E ? (k = /* @__PURE__ */ G(f, {
|
|
1593
|
+
id: p,
|
|
1594
|
+
ref: S,
|
|
1595
|
+
type: "time",
|
|
1596
|
+
value: T,
|
|
1597
|
+
onChange: E,
|
|
1598
|
+
onBlur: b,
|
|
1599
|
+
readOnly: d,
|
|
1600
|
+
rightIcon: D
|
|
1601
|
+
}), t[11] = p, t[12] = b, t[13] = d, t[14] = S, t[15] = D, t[16] = T, t[17] = E, t[18] = k) : k = t[18];
|
|
1602
|
+
let A;
|
|
1603
|
+
return t[19] !== w || t[20] !== u || t[21] !== C || t[22] !== l || t[23] !== p || t[24] !== d || t[25] !== k ? (A = /* @__PURE__ */ G(o, {
|
|
1604
|
+
helperText: u,
|
|
1605
|
+
readOnly: d,
|
|
1606
|
+
error: w,
|
|
1607
|
+
htmlFor: p,
|
|
1608
|
+
isRequired: C,
|
|
1609
|
+
label: l,
|
|
1610
|
+
children: k
|
|
1611
|
+
}), t[19] = w, t[20] = u, t[21] = C, t[22] = l, t[23] = p, t[24] = d, t[25] = k, t[26] = A) : A = t[26], A;
|
|
1612
|
+
}, dr = "_3j2y9l0", fr = (e) => {
|
|
1613
|
+
let t = O(28), { field: n } = e, { key: r, label: i, helper_text: a, readonly: s } = n, c = r === void 0 ? "" : r, l = i === void 0 ? "" : i, u = a === void 0 ? "" : a, d = s === void 0 ? !1 : s, f;
|
|
1614
|
+
t[0] === n ? f = t[1] : (f = h(n), t[0] = n, t[1] = f);
|
|
1615
|
+
let p;
|
|
1616
|
+
t[2] !== c || t[3] !== f ? (p = {
|
|
1617
|
+
name: c,
|
|
1618
|
+
rules: f
|
|
1619
|
+
}, t[2] = c, t[3] = f, t[4] = p) : p = t[4];
|
|
1620
|
+
let { field: g, fieldState: _ } = Q(p), { name: v, onBlur: y, onChange: b, ref: x, value: S, disabled: C } = g, { error: w } = _, T = w?.message, E = !!S, D;
|
|
1621
|
+
t[5] === b ? D = t[6] : (D = (e) => b(e), t[5] = b, t[6] = D);
|
|
1622
|
+
let k;
|
|
1623
|
+
t[7] === y ? k = t[8] : (k = () => y(), t[7] = y, t[8] = k);
|
|
1624
|
+
let A;
|
|
1625
|
+
t[9] !== C || t[10] !== v || t[11] !== E || t[12] !== D || t[13] !== k ? (A = /* @__PURE__ */ G(bn, {
|
|
1626
|
+
id: v,
|
|
1627
|
+
name: v,
|
|
1628
|
+
checked: E,
|
|
1629
|
+
onCheckedChange: D,
|
|
1630
|
+
onBlur: k,
|
|
1631
|
+
disabled: C
|
|
1632
|
+
}), t[9] = C, t[10] = v, t[11] = E, t[12] = D, t[13] = k, t[14] = A) : A = t[14];
|
|
1633
|
+
let j;
|
|
1634
|
+
t[15] !== n.required || t[16] !== l || t[17] !== v ? (j = l && /* @__PURE__ */ K(m, {
|
|
1635
|
+
htmlFor: v,
|
|
1636
|
+
className: "_3j2y9l1",
|
|
1637
|
+
children: [l, n?.required && /* @__PURE__ */ G("span", {
|
|
1638
|
+
className: "_1ompjs10",
|
|
1639
|
+
children: "*"
|
|
1640
|
+
})]
|
|
1641
|
+
}), t[15] = n.required, t[16] = l, t[17] = v, t[18] = j) : j = t[18];
|
|
1642
|
+
let M;
|
|
1643
|
+
t[19] !== x || t[20] !== A || t[21] !== j ? (M = /* @__PURE__ */ K("div", {
|
|
1644
|
+
className: dr,
|
|
1645
|
+
ref: x,
|
|
1646
|
+
children: [A, j]
|
|
1647
|
+
}), t[19] = x, t[20] = A, t[21] = j, t[22] = M) : M = t[22];
|
|
1648
|
+
let N;
|
|
1649
|
+
return t[23] !== u || t[24] !== d || t[25] !== M || t[26] !== T ? (N = /* @__PURE__ */ G(o, {
|
|
1650
|
+
error: T,
|
|
1651
|
+
helperText: u,
|
|
1652
|
+
readOnly: d,
|
|
1653
|
+
children: M
|
|
1654
|
+
}), t[23] = u, t[24] = d, t[25] = M, t[26] = T, t[27] = N) : N = t[27], N;
|
|
1655
|
+
}, pr = [
|
|
1656
|
+
"pdf",
|
|
1657
|
+
"xls",
|
|
1658
|
+
"xlsx",
|
|
1659
|
+
"doc",
|
|
1660
|
+
"docx",
|
|
1661
|
+
"csv"
|
|
1662
|
+
], mr = [
|
|
1663
|
+
"svg",
|
|
1664
|
+
"png",
|
|
1665
|
+
"jpg",
|
|
1666
|
+
"jpeg",
|
|
1667
|
+
"webp",
|
|
1668
|
+
"gif",
|
|
1669
|
+
"avif"
|
|
1670
|
+
], hr = ["mpeg", "mp4"], gr = [
|
|
1671
|
+
"mp3",
|
|
1672
|
+
"ogg",
|
|
1673
|
+
"oga"
|
|
1674
|
+
], _r = {
|
|
1675
|
+
audio: {
|
|
1676
|
+
"audio/mpeg": [".mp3"],
|
|
1677
|
+
"audio/ogg": [".oga"]
|
|
1678
|
+
},
|
|
1679
|
+
document: {
|
|
1680
|
+
"application/pdf": [".pdf"],
|
|
1681
|
+
"application/msword": [".doc"],
|
|
1682
|
+
"application/vnd.ms-excel": [".xls"],
|
|
1683
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": [".xlsx"],
|
|
1684
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": [".docx"],
|
|
1685
|
+
"text/csv": [".csv"]
|
|
1686
|
+
},
|
|
1687
|
+
image: {
|
|
1688
|
+
"image/jpeg": [".jpeg", ".jpg"],
|
|
1689
|
+
"image/png": [".png"],
|
|
1690
|
+
"image/gif": [".gif"],
|
|
1691
|
+
"image/svg+xml": [".svg"],
|
|
1692
|
+
"image/webp": [".webp"],
|
|
1693
|
+
"image/avif": [".avif"]
|
|
1694
|
+
},
|
|
1695
|
+
video: {
|
|
1696
|
+
"video/mp4": [".mp4"],
|
|
1697
|
+
"video/mpeg": [".mpeg"]
|
|
1698
|
+
}
|
|
1699
|
+
}, vr = {
|
|
1700
|
+
audio: gr,
|
|
1701
|
+
document: pr,
|
|
1702
|
+
image: mr,
|
|
1703
|
+
video: hr
|
|
1704
|
+
};
|
|
1705
|
+
[
|
|
1706
|
+
...vr.audio,
|
|
1707
|
+
...vr.document,
|
|
1708
|
+
...vr.image,
|
|
1709
|
+
...vr.video
|
|
1710
|
+
], {
|
|
1711
|
+
..._r.audio,
|
|
1712
|
+
..._r.document,
|
|
1713
|
+
..._r.image,
|
|
1714
|
+
..._r.video
|
|
1715
|
+
};
|
|
1716
|
+
//#endregion
|
|
1717
|
+
//#region ../../libraries/react-collection/dist/widgets/uploadWidget/MediaCard.cssm.js
|
|
1718
|
+
var yr = "_11lzwkh0", br = "_11lzwkh2", xr = "_11lzwkh3", Sr = "_11lzwkh4", Cr = "_11lzwkh5", wr = "_11lzwkh9", Tr = "_11lzwkha", Er = (e) => {
|
|
1719
|
+
let t = O(31), { file: r, onDelete: i, onClick: a, showCheckbox: o, isSelected: s, showDelete: c } = e, l = o === void 0 ? !1 : o, u = s === void 0 ? !1 : s, d = c === void 0 ? !0 : c, f;
|
|
1720
|
+
t[0] !== r || t[1] !== i ? (f = (e) => {
|
|
1721
|
+
e.stopPropagation(), e.preventDefault(), i?.(r.id);
|
|
1722
|
+
}, t[0] = r, t[1] = i, t[2] = f) : f = t[2];
|
|
1723
|
+
let p = f, m;
|
|
1724
|
+
t[3] !== r || t[4] !== a ? (m = (e) => {
|
|
1725
|
+
if (a) {
|
|
1726
|
+
e.preventDefault(), a(r);
|
|
1727
|
+
return;
|
|
1728
|
+
}
|
|
1729
|
+
r?.location || e.preventDefault();
|
|
1730
|
+
}, t[3] = r, t[4] = a, t[5] = m) : m = t[5];
|
|
1731
|
+
let h = m, g;
|
|
1732
|
+
t[6] !== r?.filename || t[7] !== r?.location ? (g = r?.filename || r?.location?.split("/")?.[r?.location?.split("/").length - 1], t[6] = r?.filename, t[7] = r?.location, t[8] = g) : g = t[8];
|
|
1733
|
+
let _ = g, v = r?.location || void 0, y = u && "_11lzwkh1", b;
|
|
1734
|
+
t[9] === y ? b = t[10] : (b = Z(yr, y), t[9] = y, t[10] = b);
|
|
1735
|
+
let x;
|
|
1736
|
+
t[11] !== r?.kind || t[12] !== r?.location ? (x = r?.kind === "image" ? /* @__PURE__ */ G("img", {
|
|
1737
|
+
alt: "uploaded-file-icon",
|
|
1738
|
+
className: Sr,
|
|
1739
|
+
src: r?.location
|
|
1740
|
+
}) : /* @__PURE__ */ G("div", {
|
|
1741
|
+
className: br,
|
|
1742
|
+
children: /* @__PURE__ */ G(ve, {
|
|
1743
|
+
size: 60,
|
|
1744
|
+
className: xr
|
|
1745
|
+
})
|
|
1746
|
+
}), t[11] = r?.kind, t[12] = r?.location, t[13] = x) : x = t[13];
|
|
1747
|
+
let S;
|
|
1748
|
+
t[14] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ G("div", { className: Cr }), t[14] = S) : S = t[14];
|
|
1749
|
+
let C;
|
|
1750
|
+
t[15] !== u || t[16] !== l ? (C = l && /* @__PURE__ */ G("div", {
|
|
1751
|
+
className: "_11lzwkh8",
|
|
1752
|
+
onClick: Dr,
|
|
1753
|
+
children: /* @__PURE__ */ G(bn, { checked: u })
|
|
1754
|
+
}), t[15] = u, t[16] = l, t[17] = C) : C = t[17];
|
|
1755
|
+
let w;
|
|
1756
|
+
t[18] !== p || t[19] !== d ? (w = d && /* @__PURE__ */ G(n, {
|
|
1757
|
+
className: "_11lzwkh6",
|
|
1758
|
+
size: "sm",
|
|
1759
|
+
variant: "secondary",
|
|
1760
|
+
onClick: p,
|
|
1761
|
+
children: /* @__PURE__ */ G(Te, { className: "_11lzwkh7" })
|
|
1762
|
+
}), t[18] = p, t[19] = d, t[20] = w) : w = t[20];
|
|
1763
|
+
let T;
|
|
1764
|
+
t[21] === _ ? T = t[22] : (T = /* @__PURE__ */ G("div", {
|
|
1765
|
+
className: wr,
|
|
1766
|
+
children: /* @__PURE__ */ G("p", {
|
|
1767
|
+
className: Tr,
|
|
1768
|
+
children: _
|
|
1769
|
+
})
|
|
1770
|
+
}), t[21] = _, t[22] = T);
|
|
1771
|
+
let E;
|
|
1772
|
+
return t[23] !== h || t[24] !== x || t[25] !== C || t[26] !== w || t[27] !== T || t[28] !== v || t[29] !== b ? (E = /* @__PURE__ */ K("a", {
|
|
1773
|
+
href: v,
|
|
1774
|
+
target: "_blank",
|
|
1775
|
+
rel: "noopener noreferrer",
|
|
1776
|
+
className: b,
|
|
1777
|
+
onClick: h,
|
|
1778
|
+
children: [
|
|
1779
|
+
x,
|
|
1780
|
+
S,
|
|
1781
|
+
C,
|
|
1782
|
+
w,
|
|
1783
|
+
T
|
|
1784
|
+
]
|
|
1785
|
+
}), 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;
|
|
1786
|
+
};
|
|
1787
|
+
function Dr(e) {
|
|
1788
|
+
e.preventDefault(), e.stopPropagation();
|
|
1789
|
+
}
|
|
1790
|
+
//#endregion
|
|
1791
|
+
//#region ../../libraries/react-collection/dist/widgets/uploadWidget/modal/FileUploadModal.cssm.js
|
|
1792
|
+
var Or = "vwpjhx0", kr = "vwpjhx1", Ar = "vwpjhx2", jr = "vwpjhx5", Mr = "vwpjhx6", Nr = "vwpjhxb", Pr = (e) => {
|
|
1793
|
+
let t = O(57), { isOpen: r, setIsOpen: i, files: a, kind: o, allowedExtensions: s, isMultiple: l, isLoading: d, handleUploadFiles: f, handleChange: p } = e, m;
|
|
1794
|
+
t[0] === i ? m = t[1] : (m = () => i(!1), t[0] = i, t[1] = m);
|
|
1795
|
+
let h = m, g = a.length, v;
|
|
1796
|
+
bb0: {
|
|
1797
|
+
let e;
|
|
1798
|
+
if (t[2] !== s || t[3] !== o) {
|
|
1799
|
+
let n = o.reduce(Fr, {});
|
|
1800
|
+
if (!s || s.length === 0) {
|
|
1801
|
+
v = n;
|
|
1802
|
+
break bb0;
|
|
1803
|
+
}
|
|
1804
|
+
let r = s.map(Ir);
|
|
1805
|
+
e = {};
|
|
1806
|
+
for (let [t, i] of Object.entries(n)) {
|
|
1807
|
+
let n = i.filter((e) => r.includes(e));
|
|
1808
|
+
n.length > 0 && (e[t] = n);
|
|
1809
|
+
}
|
|
1810
|
+
t[2] = s, t[3] = o, t[4] = e, t[5] = v;
|
|
1811
|
+
} else e = t[4], v = t[5];
|
|
1812
|
+
v = e;
|
|
1813
|
+
}
|
|
1814
|
+
let y = v, x;
|
|
1815
|
+
t[6] === f ? x = t[7] : (x = (e) => {
|
|
1816
|
+
if (e.length === 0) {
|
|
1817
|
+
A("No file selected. Please select one file.");
|
|
1818
|
+
return;
|
|
1819
|
+
}
|
|
1820
|
+
f(e);
|
|
1821
|
+
}, t[6] = f, t[7] = x);
|
|
1822
|
+
let S = x, C;
|
|
1823
|
+
t[8] !== y || t[9] !== d || t[10] !== l || t[11] !== S ? (C = {
|
|
1824
|
+
onDrop: S,
|
|
1825
|
+
accept: y,
|
|
1826
|
+
multiple: l,
|
|
1827
|
+
maxSize: 26214400,
|
|
1828
|
+
disabled: d,
|
|
1829
|
+
onDropRejected: Rr
|
|
1830
|
+
}, t[8] = y, t[9] = d, t[10] = l, t[11] = S, t[12] = C) : C = t[12];
|
|
1831
|
+
let { getRootProps: w, getInputProps: D, isDragActive: k } = Ne(C), j;
|
|
1832
|
+
t[13] === Symbol.for("react.memo_cache_sentinel") ? (j = Z(Or, T), t[13] = j) : j = t[13];
|
|
1833
|
+
let M = o?.length > 1 ? "Upload file" : `Upload ${o?.[0]}`, N;
|
|
1834
|
+
t[14] === M ? N = t[15] : (N = /* @__PURE__ */ G(c, { children: /* @__PURE__ */ G(u, { children: M }) }), t[14] = M, t[15] = N);
|
|
1835
|
+
let P = d && "vwpjhx3", F;
|
|
1836
|
+
t[16] === P ? F = t[17] : (F = Z(Ar, P), t[16] = P, t[17] = F);
|
|
1837
|
+
let I;
|
|
1838
|
+
t[18] === w ? I = t[19] : (I = w(), t[18] = w, t[19] = I);
|
|
1839
|
+
let L;
|
|
1840
|
+
t[20] === d ? L = t[21] : (L = d && /* @__PURE__ */ G("div", {
|
|
1841
|
+
className: "vwpjhx4",
|
|
1842
|
+
children: /* @__PURE__ */ G(E, {})
|
|
1843
|
+
}), t[20] = d, t[21] = L);
|
|
1844
|
+
let R = k ? "Drop your files here..." : l && a.length > 0 ? "Drag & Drop here to upload more!" : a?.length > 0 ? "Drag & Drop here to upload another file!" : "Drag & Drop here to upload file!", z;
|
|
1845
|
+
t[22] === R ? z = t[23] : (z = /* @__PURE__ */ G("p", {
|
|
1846
|
+
className: jr,
|
|
1847
|
+
children: R
|
|
1848
|
+
}), t[22] = R, t[23] = z);
|
|
1849
|
+
let B = d && "vwpjhx7", V;
|
|
1850
|
+
t[24] === B ? V = t[25] : (V = Z(Mr, B), t[24] = B, t[25] = V);
|
|
1851
|
+
let H;
|
|
1852
|
+
t[26] === D ? H = t[27] : (H = D(), t[26] = D, t[27] = H);
|
|
1853
|
+
let U;
|
|
1854
|
+
t[28] === H ? U = t[29] : (U = /* @__PURE__ */ G("input", { ...H }), t[28] = H, t[29] = U);
|
|
1855
|
+
let W;
|
|
1856
|
+
t[30] === Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ G(we, { size: 14 }), t[30] = W) : W = t[30];
|
|
1857
|
+
let q;
|
|
1858
|
+
t[31] === U ? q = t[32] : (q = /* @__PURE__ */ K(n, {
|
|
1859
|
+
variant: "ghost",
|
|
1860
|
+
size: "sm",
|
|
1861
|
+
children: [
|
|
1862
|
+
U,
|
|
1863
|
+
W,
|
|
1864
|
+
"Click to upload"
|
|
1865
|
+
]
|
|
1866
|
+
}), t[31] = U, t[32] = q);
|
|
1867
|
+
let J;
|
|
1868
|
+
t[33] !== V || t[34] !== q ? (J = /* @__PURE__ */ G("div", {
|
|
1869
|
+
className: V,
|
|
1870
|
+
children: q
|
|
1871
|
+
}), t[33] = V, t[34] = q, t[35] = J) : J = t[35];
|
|
1872
|
+
let Y;
|
|
1873
|
+
t[36] !== I || t[37] !== L || t[38] !== z || t[39] !== J || t[40] !== F ? (Y = /* @__PURE__ */ G("div", {
|
|
1874
|
+
className: kr,
|
|
1875
|
+
children: /* @__PURE__ */ K("div", {
|
|
1876
|
+
className: F,
|
|
1877
|
+
...I,
|
|
1878
|
+
children: [
|
|
1879
|
+
L,
|
|
1880
|
+
z,
|
|
1881
|
+
J
|
|
1882
|
+
]
|
|
1883
|
+
})
|
|
1884
|
+
}), t[36] = I, t[37] = L, t[38] = z, t[39] = J, t[40] = F, t[41] = Y) : Y = t[41];
|
|
1885
|
+
let X;
|
|
1886
|
+
t[42] !== a || t[43] !== p ? (X = a.length > 0 && /* @__PURE__ */ K("div", {
|
|
1887
|
+
className: "vwpjhx8",
|
|
1888
|
+
children: [/* @__PURE__ */ G("h3", {
|
|
1889
|
+
className: "vwpjhx9",
|
|
1890
|
+
children: "Selected Files"
|
|
1891
|
+
}), /* @__PURE__ */ G("div", {
|
|
1892
|
+
className: "vwpjhxa",
|
|
1893
|
+
children: a.map((e) => /* @__PURE__ */ G(Er, {
|
|
1894
|
+
file: e,
|
|
1895
|
+
onDelete: (e) => {
|
|
1896
|
+
p(a.filter((t) => t.id !== e));
|
|
1897
|
+
}
|
|
1898
|
+
}, e.id))
|
|
1899
|
+
})]
|
|
1900
|
+
}), t[42] = a, t[43] = p, t[44] = X) : X = t[44];
|
|
1901
|
+
let ee = g === 1 ? `${g} file` : `${g} files`, te;
|
|
1902
|
+
t[45] !== h || t[46] !== ee ? (te = /* @__PURE__ */ G("div", {
|
|
1903
|
+
className: Nr,
|
|
1904
|
+
children: /* @__PURE__ */ K(n, {
|
|
1905
|
+
variant: "default",
|
|
1906
|
+
onClick: h,
|
|
1907
|
+
children: ["Save\xA0", ee]
|
|
1908
|
+
})
|
|
1909
|
+
}), t[45] = h, t[46] = ee, t[47] = te) : te = t[47];
|
|
1910
|
+
let ne;
|
|
1911
|
+
t[48] !== Y || t[49] !== X || t[50] !== te || t[51] !== N ? (ne = /* @__PURE__ */ K(_, {
|
|
1912
|
+
className: j,
|
|
1913
|
+
children: [
|
|
1914
|
+
N,
|
|
1915
|
+
Y,
|
|
1916
|
+
X,
|
|
1917
|
+
te
|
|
1918
|
+
]
|
|
1919
|
+
}), t[48] = Y, t[49] = X, t[50] = te, t[51] = N, t[52] = ne) : ne = t[52];
|
|
1920
|
+
let re;
|
|
1921
|
+
return t[53] !== r || t[54] !== i || t[55] !== ne ? (re = /* @__PURE__ */ G(b, {
|
|
1922
|
+
open: r,
|
|
1923
|
+
onOpenChange: i,
|
|
1924
|
+
children: ne
|
|
1925
|
+
}), t[53] = r, t[54] = i, t[55] = ne, t[56] = re) : re = t[56], re;
|
|
1926
|
+
};
|
|
1927
|
+
function Fr(e, t) {
|
|
1928
|
+
return {
|
|
1929
|
+
...e,
|
|
1930
|
+
...te[t]
|
|
1931
|
+
};
|
|
1932
|
+
}
|
|
1933
|
+
function Ir(e) {
|
|
1934
|
+
return `.${e}`;
|
|
1935
|
+
}
|
|
1936
|
+
function Lr(e) {
|
|
1937
|
+
e.errors.forEach((t) => {
|
|
1938
|
+
t.code === "file-too-large" && A(`${e.file.name} is bigger than 25MB`);
|
|
1939
|
+
});
|
|
1940
|
+
}
|
|
1941
|
+
function Rr(e) {
|
|
1942
|
+
e.forEach(Lr);
|
|
1943
|
+
}
|
|
1944
|
+
//#endregion
|
|
1945
|
+
//#region ../../libraries/react-collection/dist/widgets/uploadWidget/UploadWidget.cssm.js
|
|
1946
|
+
var zr = "_156u72w0", Br = "_156u72w1", Vr = (e) => Array.isArray(e) && e.every((e) => typeof e == "object" && !!e && "location" in e), Hr = ({ field: e, schema: t, kind: r = Y, isMultiple: i, uploadContext: a }) => {
|
|
1947
|
+
let s = e.options?.allowed_upload_types, c = s && s.length > 0 ? r.filter((e) => s.includes(e)) : null, l = c && c.length > 0 ? c : r, [u, d] = U(!1), [p, m] = U(!1), { media: g } = M(), { field: { onChange: _, value: v, onBlur: y, disabled: b, ref: x }, fieldState: S } = Q({
|
|
1948
|
+
name: e?.key || "",
|
|
1949
|
+
rules: h(e)
|
|
1950
|
+
}), C = e.options?.allowed_extensions, w = V(() => {
|
|
1951
|
+
let e = l.flatMap((e) => vr[e]);
|
|
1952
|
+
return C && C.length > 0 ? e.filter((e) => C.includes(e)) : e;
|
|
1953
|
+
}, [l, C]), T = Array.isArray(v) ? v : v ? [v] : [], D = a ?? (t?.key ? {
|
|
1954
|
+
module: "collection",
|
|
1955
|
+
identifier: t.key
|
|
1956
|
+
} : void 0), O = D ? {
|
|
1957
|
+
...D,
|
|
1958
|
+
field_key: e.key || void 0,
|
|
1959
|
+
field_label: e.label || void 0
|
|
1960
|
+
} : void 0, A = (e) => {
|
|
1961
|
+
_(i ? e : e?.[0]);
|
|
1962
|
+
}, j = async (e) => {
|
|
1963
|
+
let t = new FormData(), n = i ? e : e.slice(0, 1);
|
|
1964
|
+
if (n.length !== 0) {
|
|
1965
|
+
n.forEach((e) => {
|
|
1966
|
+
let n = e.name.split(".").pop()?.toLowerCase();
|
|
1967
|
+
n && w.includes(n) && t.append("media", e);
|
|
1968
|
+
}), m(!0);
|
|
1969
|
+
try {
|
|
1970
|
+
let e = await g?.mediaBulkUpload(t, {}, O);
|
|
1971
|
+
if (e?.content?.data && Vr(e.content.data)) {
|
|
1972
|
+
let t = e.content.data;
|
|
1973
|
+
A(i ? [...T, ...t] : t);
|
|
1974
|
+
}
|
|
1975
|
+
} catch (e) {
|
|
1976
|
+
k(e);
|
|
1977
|
+
} finally {
|
|
1978
|
+
m(!1);
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
}, { label: N = "", helper_text: P = "", readonly: F = !1 } = e;
|
|
1982
|
+
return /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ K(o, {
|
|
1983
|
+
error: S?.error?.message,
|
|
1984
|
+
helperText: P,
|
|
1985
|
+
readOnly: F,
|
|
1986
|
+
htmlFor: e.key,
|
|
1987
|
+
isRequired: e?.required,
|
|
1988
|
+
label: N,
|
|
1989
|
+
children: [/* @__PURE__ */ K("div", {
|
|
1990
|
+
className: zr,
|
|
1991
|
+
ref: x,
|
|
1992
|
+
children: [/* @__PURE__ */ G(n, {
|
|
1993
|
+
size: "icon",
|
|
1994
|
+
variant: "outline",
|
|
1995
|
+
disabled: b || F,
|
|
1996
|
+
onClick: () => d(!0),
|
|
1997
|
+
className: Br,
|
|
1998
|
+
children: /* @__PURE__ */ G(we, { size: 15 })
|
|
1999
|
+
}), /* @__PURE__ */ G(f, {
|
|
2000
|
+
name: "pasteUrl",
|
|
2001
|
+
placeholder: "Paste your files here...",
|
|
2002
|
+
onBlur: () => y(),
|
|
2003
|
+
onPaste: (e) => {
|
|
2004
|
+
let t = [];
|
|
2005
|
+
Array.from(e.clipboardData.items).forEach((e) => {
|
|
2006
|
+
if (e?.kind === "file") {
|
|
2007
|
+
let n = e?.getAsFile();
|
|
2008
|
+
n && t.push(n);
|
|
2009
|
+
}
|
|
2010
|
+
}), t.length > 0 && j(t);
|
|
2011
|
+
},
|
|
2012
|
+
disabled: b,
|
|
2013
|
+
readOnly: F,
|
|
2014
|
+
rightIcon: p ? /* @__PURE__ */ G(E, { size: 16 }) : void 0
|
|
2015
|
+
})]
|
|
2016
|
+
}), T.length > 0 && /* @__PURE__ */ G("div", {
|
|
2017
|
+
className: "_156u72w2",
|
|
2018
|
+
children: /* @__PURE__ */ G("div", {
|
|
2019
|
+
className: "_156u72w3",
|
|
2020
|
+
children: T.map((e) => /* @__PURE__ */ G(Er, {
|
|
2021
|
+
file: e,
|
|
2022
|
+
onDelete: (e) => {
|
|
2023
|
+
A(T.filter((t) => t.id !== e));
|
|
2024
|
+
}
|
|
2025
|
+
}, e.id))
|
|
2026
|
+
})
|
|
2027
|
+
})]
|
|
2028
|
+
}), /* @__PURE__ */ G(Pr, {
|
|
2029
|
+
isOpen: u,
|
|
2030
|
+
setIsOpen: d,
|
|
2031
|
+
files: T,
|
|
2032
|
+
kind: l,
|
|
2033
|
+
allowedExtensions: C,
|
|
2034
|
+
isMultiple: i,
|
|
2035
|
+
isLoading: p,
|
|
2036
|
+
handleUploadFiles: j,
|
|
2037
|
+
handleChange: A
|
|
2038
|
+
})] });
|
|
2039
|
+
}, Ur = (e) => {
|
|
2040
|
+
let t = O(3), n;
|
|
2041
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ G(ye, { size: 20 }), t[0] = n) : n = t[0];
|
|
2042
|
+
let r;
|
|
2043
|
+
return t[1] === e ? r = t[2] : (r = /* @__PURE__ */ G(lr, {
|
|
2044
|
+
leftIcon: n,
|
|
2045
|
+
...e
|
|
2046
|
+
}), t[1] = e, t[2] = r), r;
|
|
2047
|
+
}, Wr = L(() => import("./DateTimeWidget-B-dajfHj.js")), Gr = L(() => import("./PhoneWidget-B4KHlFjT.js")), Kr = L(() => import("./RichTextWidget-DKYm1cSW.js")), qr = {
|
|
2048
|
+
TextWidget: $((e) => /* @__PURE__ */ G(lr, { ...e })),
|
|
2049
|
+
NumberWidget: $((e) => /* @__PURE__ */ G(lr, {
|
|
2050
|
+
type: "number",
|
|
2051
|
+
step: "any",
|
|
2052
|
+
...e
|
|
2053
|
+
})),
|
|
2054
|
+
CurrencyWidget: $((e) => /* @__PURE__ */ G(Sn, { ...e })),
|
|
2055
|
+
MultiTextWidget: $((e) => /* @__PURE__ */ G(Un, { ...e })),
|
|
2056
|
+
TextareaWidget: $((e) => /* @__PURE__ */ G(cr, { ...e })),
|
|
2057
|
+
RichTextWidget: $((e) => /* @__PURE__ */ G(Kr, { ...e })),
|
|
2058
|
+
EmailWidget: $((e) => /* @__PURE__ */ G(On, { ...e })),
|
|
2059
|
+
PhoneWidget: $((e) => /* @__PURE__ */ G(Gr, { ...e })),
|
|
2060
|
+
URLWidget: $((e) => /* @__PURE__ */ G(Ur, { ...e })),
|
|
2061
|
+
DropdownWidget: $((e) => /* @__PURE__ */ G(wn, {
|
|
2062
|
+
isMulti: !1,
|
|
2063
|
+
...e
|
|
2064
|
+
})),
|
|
2065
|
+
MultiDropdownWidget: $((e) => /* @__PURE__ */ G(wn, {
|
|
2066
|
+
isMulti: !0,
|
|
2067
|
+
...e
|
|
2068
|
+
})),
|
|
2069
|
+
RadioWidget: $((e) => /* @__PURE__ */ G($n, { ...e })),
|
|
2070
|
+
CheckboxWidget: $((e) => /* @__PURE__ */ G(xn, { ...e })),
|
|
2071
|
+
ToggleCheckboxWidget: $((e) => /* @__PURE__ */ G(fr, { ...e })),
|
|
2072
|
+
SwitchWidget: $((e) => /* @__PURE__ */ G(or, { ...e })),
|
|
2073
|
+
DateTimeWidget: $((e) => /* @__PURE__ */ G(Wr, { ...e })),
|
|
2074
|
+
DateWidget: $((e) => /* @__PURE__ */ G(Wr, { ...e })),
|
|
2075
|
+
TimeWidget: $((e) => /* @__PURE__ */ G(ur, { ...e })),
|
|
2076
|
+
GeocoderWidget: $((e) => /* @__PURE__ */ G(An, { ...e })),
|
|
2077
|
+
MultiGeocoderWidget: $((e) => /* @__PURE__ */ G(Ln, { ...e })),
|
|
2078
|
+
ImageUploadWidget: $((e) => /* @__PURE__ */ G(Hr, {
|
|
2079
|
+
kind: ["image"],
|
|
2080
|
+
isMultiple: !1,
|
|
2081
|
+
...e
|
|
2082
|
+
})),
|
|
2083
|
+
MultiImageUploadWidget: $((e) => /* @__PURE__ */ G(Hr, {
|
|
2084
|
+
kind: ["image"],
|
|
2085
|
+
isMultiple: !0,
|
|
2086
|
+
...e
|
|
2087
|
+
})),
|
|
2088
|
+
FileUploadWidget: $((e) => /* @__PURE__ */ G(Hr, {
|
|
2089
|
+
kind: [
|
|
2090
|
+
"audio",
|
|
2091
|
+
"video",
|
|
2092
|
+
"image",
|
|
2093
|
+
"document"
|
|
2094
|
+
],
|
|
2095
|
+
isMultiple: !1,
|
|
2096
|
+
...e
|
|
2097
|
+
})),
|
|
2098
|
+
MultiFileUploadWidget: $((e) => /* @__PURE__ */ G(Hr, {
|
|
2099
|
+
kind: [
|
|
2100
|
+
"audio",
|
|
2101
|
+
"video",
|
|
2102
|
+
"image",
|
|
2103
|
+
"document"
|
|
2104
|
+
],
|
|
2105
|
+
isMultiple: !0,
|
|
2106
|
+
...e
|
|
2107
|
+
}))
|
|
2108
|
+
}, Jr = (e) => {
|
|
2109
|
+
let t = O(9), n, r;
|
|
2110
|
+
t[0] === e ? (n = t[1], r = t[2]) : ({widgets: r, ...n} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
2111
|
+
let { field: i } = n, { field_interface: a, key: o } = i;
|
|
2112
|
+
if (!a || !o) return null;
|
|
2113
|
+
if (r) {
|
|
2114
|
+
let e = r[a];
|
|
2115
|
+
if (e) {
|
|
2116
|
+
let r;
|
|
2117
|
+
return t[3] !== e || t[4] !== n ? (r = /* @__PURE__ */ G(e, { ...n }), t[3] = e, t[4] = n, t[5] = r) : r = t[5], r;
|
|
2118
|
+
}
|
|
2119
|
+
}
|
|
2120
|
+
let s = qr[a];
|
|
2121
|
+
if (s) {
|
|
2122
|
+
let e;
|
|
2123
|
+
return t[6] !== s || t[7] !== n ? (e = /* @__PURE__ */ G(s, { ...n }), t[6] = s, t[7] = n, t[8] = e) : e = t[8], e;
|
|
2124
|
+
}
|
|
2125
|
+
return null;
|
|
2126
|
+
}, Yr = (t) => {
|
|
2127
|
+
let n = O(25), r, i, a;
|
|
2128
|
+
n[0] === t ? (r = n[1], i = n[2], a = n[3]) : ({field: r, schema: a, ...i} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a);
|
|
2129
|
+
let { key: o, label: s, field_interface: c, fields: l } = r, u = o === void 0 ? "" : o, d = s === void 0 ? "" : s, f = c === void 0 ? "" : c, p;
|
|
2130
|
+
n[4] === l ? p = n[5] : (p = l === void 0 ? [] : l, n[4] = l, n[5] = p);
|
|
2131
|
+
let m = p;
|
|
2132
|
+
if (!f || !u) return null;
|
|
2133
|
+
let h = r?.required, g;
|
|
2134
|
+
n[6] !== d || n[7] !== h ? (g = /* @__PURE__ */ G(e, {
|
|
2135
|
+
label: d,
|
|
2136
|
+
isRequired: h
|
|
2137
|
+
}), n[6] = d, n[7] = h, n[8] = g) : g = n[8];
|
|
2138
|
+
let _;
|
|
2139
|
+
if (n[9] !== r.id || n[10] !== m || n[11] !== u || n[12] !== i || n[13] !== a) {
|
|
2140
|
+
let e;
|
|
2141
|
+
n[15] !== r.id || n[16] !== u || n[17] !== i || n[18] !== a ? (e = (e) => /* @__PURE__ */ G(Xr, {
|
|
2142
|
+
field: {
|
|
2143
|
+
...e,
|
|
2144
|
+
key: `${u}.${e?.key}`
|
|
2145
|
+
},
|
|
2146
|
+
schema: a,
|
|
2147
|
+
...i
|
|
2148
|
+
}, `common-fields-${r?.id}-${e?.id}`), n[15] = r.id, n[16] = u, n[17] = i, n[18] = a, n[19] = e) : e = n[19], _ = m.map(e), n[9] = r.id, n[10] = m, n[11] = u, n[12] = i, n[13] = a, n[14] = _;
|
|
2149
|
+
} else _ = n[14];
|
|
2150
|
+
let v;
|
|
2151
|
+
n[20] === _ ? v = n[21] : (v = /* @__PURE__ */ G("div", {
|
|
2152
|
+
className: jt,
|
|
2153
|
+
children: _
|
|
2154
|
+
}), n[20] = _, n[21] = v);
|
|
2155
|
+
let y;
|
|
2156
|
+
return n[22] !== g || n[23] !== v ? (y = /* @__PURE__ */ K("div", {
|
|
2157
|
+
className: bt,
|
|
2158
|
+
children: [g, v]
|
|
2159
|
+
}), n[22] = g, n[23] = v, n[24] = y) : y = n[24], y;
|
|
2160
|
+
}, Xr = (e) => {
|
|
2161
|
+
let t = O(16), n, r;
|
|
2162
|
+
t[0] === e ? (n = t[1], r = t[2]) : ({widgets: r, ...n} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
2163
|
+
let i = dt(n.schema, n.field), { field_interface: a, key: o, hidden: s } = i, c = a === void 0 ? "" : a;
|
|
2164
|
+
if (!c || !(o !== void 0 && o) || s) return null;
|
|
2165
|
+
switch (c) {
|
|
2166
|
+
case q.ArrayWidget: {
|
|
2167
|
+
let e;
|
|
2168
|
+
return t[3] !== i || t[4] !== n ? (e = /* @__PURE__ */ G(Vt, {
|
|
2169
|
+
...n,
|
|
2170
|
+
field: i
|
|
2171
|
+
}), t[3] = i, t[4] = n, t[5] = e) : e = t[5], e;
|
|
2172
|
+
}
|
|
2173
|
+
case q.RecordWidget: {
|
|
2174
|
+
let e;
|
|
2175
|
+
return t[6] !== i || t[7] !== n ? (e = /* @__PURE__ */ G(Yr, {
|
|
2176
|
+
...n,
|
|
2177
|
+
field: i
|
|
2178
|
+
}), t[6] = i, t[7] = n, t[8] = e) : e = t[8], e;
|
|
2179
|
+
}
|
|
2180
|
+
case q.CollectionWidget: {
|
|
2181
|
+
let e;
|
|
2182
|
+
return t[9] !== i || t[10] !== n ? (e = /* @__PURE__ */ G(mn, {
|
|
2183
|
+
...n,
|
|
2184
|
+
field: i
|
|
2185
|
+
}), t[9] = i, t[10] = n, t[11] = e) : e = t[11], e;
|
|
2186
|
+
}
|
|
2187
|
+
default: {
|
|
2188
|
+
let e;
|
|
2189
|
+
return t[12] !== i || t[13] !== n || t[14] !== r ? (e = /* @__PURE__ */ G(Jr, {
|
|
2190
|
+
widgets: r,
|
|
2191
|
+
...n,
|
|
2192
|
+
field: i
|
|
2193
|
+
}), t[12] = i, t[13] = n, t[14] = r, t[15] = e) : e = t[15], e;
|
|
2194
|
+
}
|
|
2195
|
+
}
|
|
2196
|
+
};
|
|
2197
|
+
a(r.radius);
|
|
2198
|
+
//#endregion
|
|
2199
|
+
//#region ../../libraries/levocn/dist/utils/deep-merge.js
|
|
2200
|
+
function Zr(e) {
|
|
2201
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
2202
|
+
}
|
|
2203
|
+
function Qr(e, t) {
|
|
2204
|
+
if (!Zr(e) || !Zr(t)) return t;
|
|
2205
|
+
let n = { ...e };
|
|
2206
|
+
return Object.keys(t).forEach((r) => {
|
|
2207
|
+
let i = r, a = e[i], o = t[i];
|
|
2208
|
+
Zr(a) && Zr(o) ? n[i] = Qr(a, o) : n[i] = o;
|
|
2209
|
+
}), n;
|
|
2210
|
+
}
|
|
2211
|
+
//#endregion
|
|
2212
|
+
//#region ../../libraries/levocn/dist/theme/utils/defineTheme.js
|
|
2213
|
+
var $r = ((e) => (t) => t ? Qr(e, t) : e)({
|
|
2214
|
+
form: {
|
|
2215
|
+
maxWidth: "100%",
|
|
2216
|
+
gap: "1.5rem",
|
|
2217
|
+
borderRadius: "6px",
|
|
2218
|
+
labelFontSize: "0.875rem",
|
|
2219
|
+
helpFontSize: "0.75rem"
|
|
2220
|
+
},
|
|
2221
|
+
input: {
|
|
2222
|
+
fontSize: "0.875rem",
|
|
2223
|
+
height: "2.25rem",
|
|
2224
|
+
borderRadius: "6px"
|
|
2225
|
+
},
|
|
2226
|
+
checkbox: { labelFontSize: "0.875rem" }
|
|
2227
|
+
}), ei = "_1g8bxz40", ti = "r6cfdr0", ni = I({ themeClass: "" }), ri = v($r({
|
|
2228
|
+
form: {
|
|
2229
|
+
maxWidth: "800px",
|
|
2230
|
+
labelFontSize: "1.5rem",
|
|
2231
|
+
helpFontSize: "1rem",
|
|
2232
|
+
borderRadius: "4px"
|
|
2233
|
+
},
|
|
2234
|
+
input: {
|
|
2235
|
+
fontSize: "1.125rem",
|
|
2236
|
+
height: "3.5rem",
|
|
2237
|
+
borderRadius: "4px"
|
|
2238
|
+
},
|
|
2239
|
+
checkbox: { labelFontSize: "1.125rem" }
|
|
2240
|
+
})), ii = (e) => {
|
|
2241
|
+
let t = O(30), n, r, a, o, s, c, l;
|
|
2242
|
+
t[0] === e ? (n = t[1], r = t[2], a = t[3], o = t[4], s = t[5], c = t[6], l = t[7]) : ({children: n, className: r, style: c, cssReset: a, variant: l, portalToThemeRoot: o, ...s} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = a, t[4] = o, t[5] = s, t[6] = c, t[7] = l);
|
|
2243
|
+
let u = l === "single-field" || l === "steps-2", d;
|
|
2244
|
+
t[8] === r ? d = t[9] : (d = Z(i, ei, r), t[8] = r, t[9] = d);
|
|
2245
|
+
let f = d, p;
|
|
2246
|
+
t[10] !== u || t[11] !== c ? (p = u ? {
|
|
2247
|
+
...ri,
|
|
2248
|
+
...c
|
|
2249
|
+
} : c, t[10] = u, t[11] = c, t[12] = p) : p = t[12];
|
|
2250
|
+
let m = p, h;
|
|
2251
|
+
t[13] !== f || t[14] !== m || t[15] !== a ? (h = {
|
|
2252
|
+
themeClass: f,
|
|
2253
|
+
style: m,
|
|
2254
|
+
cssReset: a
|
|
2255
|
+
}, t[13] = f, t[14] = m, t[15] = a, t[16] = h) : h = t[16];
|
|
2256
|
+
let g;
|
|
2257
|
+
t[17] !== n || t[18] !== u ? (g = u ? /* @__PURE__ */ G("div", {
|
|
2258
|
+
className: ti,
|
|
2259
|
+
children: n
|
|
2260
|
+
}) : n, t[17] = n, t[18] = u, t[19] = g) : g = t[19];
|
|
2261
|
+
let _;
|
|
2262
|
+
t[20] !== h || t[21] !== g ? (_ = /* @__PURE__ */ G(ni.Provider, {
|
|
2263
|
+
value: h,
|
|
2264
|
+
children: g
|
|
2265
|
+
}), t[20] = h, t[21] = g, t[22] = _) : _ = t[22];
|
|
2266
|
+
let v;
|
|
2267
|
+
return t[23] !== f || t[24] !== m || t[25] !== a || t[26] !== o || t[27] !== s || t[28] !== _ ? (v = /* @__PURE__ */ G(S, {
|
|
2268
|
+
...s,
|
|
2269
|
+
className: f,
|
|
2270
|
+
cssReset: a,
|
|
2271
|
+
style: m,
|
|
2272
|
+
portalToThemeRoot: o,
|
|
2273
|
+
children: _
|
|
2274
|
+
}), t[23] = f, t[24] = m, t[25] = a, t[26] = o, t[27] = s, t[28] = _, t[29] = v) : v = t[29], v;
|
|
2275
|
+
}, ai = (e, t) => e?.map((e) => ({
|
|
2276
|
+
...e,
|
|
2277
|
+
hidden: e.hidden || t.includes(e.key) || t.includes(e.id) || e.allow_public_view === !1 || e.allow_public_submit === !1,
|
|
2278
|
+
fields: ai(e.fields, t)
|
|
2279
|
+
})), oi = (e, t = []) => ({
|
|
2280
|
+
...e,
|
|
2281
|
+
sections: e.sections?.map((e) => ({
|
|
2282
|
+
...e,
|
|
2283
|
+
fields: ai(e.fields, t) ?? []
|
|
2284
|
+
}))
|
|
2285
|
+
}), si = "_1dzarb20", ci = "_1dzarb21", li = "_1dzarb23", ui = "_1dzarb24", di = "_1dzarb25", fi = "_1dzarb26", pi = (e) => {
|
|
2286
|
+
let t = O(54), { hiddenFields: r, isLoading: i, initialValues: a, onSubmit: o, schema: s, uiConfig: c, submitButtonConfig: l, containerStyles: u, isDisabled: d, theme: f, enableVerification: p } = e, m = p === void 0 ? !0 : p, h;
|
|
2287
|
+
t[0] !== r || t[1] !== s ? (h = s ? oi(s, r) : null, t[0] = r, t[1] = s, t[2] = h) : h = t[2];
|
|
2288
|
+
let g = h, _, v;
|
|
2289
|
+
t[3] === Symbol.for("react.memo_cache_sentinel") ? (_ = {}, v = { keepErrors: !0 }, t[3] = _, t[4] = v) : (_ = t[3], v = t[4]);
|
|
2290
|
+
let y;
|
|
2291
|
+
t[5] === d ? y = t[6] : (y = {
|
|
2292
|
+
mode: "onTouched",
|
|
2293
|
+
disabled: d,
|
|
2294
|
+
defaultValues: _,
|
|
2295
|
+
resetOptions: v
|
|
2296
|
+
}, t[5] = d, t[6] = y);
|
|
2297
|
+
let b = ce(y), { formState: x } = b, { isSubmitting: S } = x, C;
|
|
2298
|
+
t[7] === o ? C = t[8] : (C = (e) => {
|
|
2299
|
+
o && o(e);
|
|
2300
|
+
}, t[7] = o, t[8] = C);
|
|
2301
|
+
let w = C, T;
|
|
2302
|
+
t[9] !== a || t[10] !== b || t[11] !== s || t[12] !== g ? (T = () => {
|
|
2303
|
+
if (g) {
|
|
2304
|
+
let e = {
|
|
2305
|
+
...s ? _t(s) : {},
|
|
2306
|
+
...a
|
|
2307
|
+
};
|
|
2308
|
+
b.reset(e);
|
|
2309
|
+
}
|
|
2310
|
+
}, t[9] = a, t[10] = b, t[11] = s, t[12] = g, t[13] = T) : T = t[13];
|
|
2311
|
+
let E;
|
|
2312
|
+
t[14] === g ? E = t[15] : (E = [g], t[14] = g, t[15] = E), B(T, E);
|
|
2313
|
+
let D = i || S;
|
|
2314
|
+
if (!g) return null;
|
|
2315
|
+
let k;
|
|
2316
|
+
t[16] === f ? k = t[17] : (k = f || {}, t[16] = f, t[17] = k);
|
|
2317
|
+
let A;
|
|
2318
|
+
t[18] === c?.hideFormHeading ? A = t[19] : (A = c?.hideFormHeading ? null : /* @__PURE__ */ G("h1", {
|
|
2319
|
+
className: Z(ci),
|
|
2320
|
+
children: "Create new"
|
|
2321
|
+
}), t[18] = c?.hideFormHeading, t[19] = A);
|
|
2322
|
+
let j;
|
|
2323
|
+
t[20] === u ? j = t[21] : (j = Z(li, u), t[20] = u, t[21] = j);
|
|
2324
|
+
let M = i && "_1dzarb27", N;
|
|
2325
|
+
t[22] === M ? N = t[23] : (N = Z(ui, M), t[22] = M, t[23] = N);
|
|
2326
|
+
let P;
|
|
2327
|
+
t[24] !== w || t[25] !== b ? (P = b.handleSubmit(w), t[24] = w, t[25] = b, t[26] = P) : P = t[26];
|
|
2328
|
+
let F;
|
|
2329
|
+
t[27] !== m || t[28] !== s || t[29] !== c?.hideSectionHeadings ? (F = s?.sections?.map((e) => /* @__PURE__ */ G(mi, {
|
|
2330
|
+
schema: s,
|
|
2331
|
+
section: e,
|
|
2332
|
+
hideHeading: !!c?.hideSectionHeadings,
|
|
2333
|
+
enableVerification: m
|
|
2334
|
+
}, e.id)), t[27] = m, t[28] = s, t[29] = c?.hideSectionHeadings, t[30] = F) : F = t[30];
|
|
2335
|
+
let I;
|
|
2336
|
+
t[31] !== D || t[32] !== d || t[33] !== l?.show || t[34] !== l?.styles || t[35] !== l?.text ? (I = l?.show && /* @__PURE__ */ G("div", {
|
|
2337
|
+
className: "_1dzarb29",
|
|
2338
|
+
children: /* @__PURE__ */ G(n, {
|
|
2339
|
+
className: l?.styles,
|
|
2340
|
+
disabled: d || D,
|
|
2341
|
+
type: "submit",
|
|
2342
|
+
children: D ? "Saving" : l?.text || "Save"
|
|
2343
|
+
})
|
|
2344
|
+
}), t[31] = D, t[32] = d, t[33] = l?.show, t[34] = l?.styles, t[35] = l?.text, t[36] = I) : I = t[36];
|
|
2345
|
+
let L;
|
|
2346
|
+
t[37] !== N || t[38] !== P || t[39] !== F || t[40] !== I ? (L = /* @__PURE__ */ K("form", {
|
|
2347
|
+
className: N,
|
|
2348
|
+
id: "collection-form",
|
|
2349
|
+
onSubmit: P,
|
|
2350
|
+
children: [F, I]
|
|
2351
|
+
}), t[37] = N, t[38] = P, t[39] = F, t[40] = I, t[41] = L) : L = t[41];
|
|
2352
|
+
let R;
|
|
2353
|
+
t[42] !== j || t[43] !== L ? (R = /* @__PURE__ */ G("div", {
|
|
2354
|
+
className: j,
|
|
2355
|
+
children: L
|
|
2356
|
+
}), t[42] = j, t[43] = L, t[44] = R) : R = t[44];
|
|
2357
|
+
let z;
|
|
2358
|
+
t[45] !== A || t[46] !== R ? (z = /* @__PURE__ */ K("div", {
|
|
2359
|
+
className: si,
|
|
2360
|
+
children: [A, R]
|
|
2361
|
+
}), t[45] = A, t[46] = R, t[47] = z) : z = t[47];
|
|
2362
|
+
let V;
|
|
2363
|
+
t[48] !== k || t[49] !== z ? (V = /* @__PURE__ */ G(ii, {
|
|
2364
|
+
...k,
|
|
2365
|
+
children: z
|
|
2366
|
+
}), t[48] = k, t[49] = z, t[50] = V) : V = t[50];
|
|
2367
|
+
let H;
|
|
2368
|
+
return t[51] !== b || t[52] !== V ? (H = /* @__PURE__ */ G(ae, {
|
|
2369
|
+
...b,
|
|
2370
|
+
children: V
|
|
2371
|
+
}), t[51] = b, t[52] = V, t[53] = H) : H = t[53], H;
|
|
2372
|
+
}, mi = (e) => {
|
|
2373
|
+
let t = O(12), { schema: n, section: r, hideHeading: i, enableVerification: a } = e;
|
|
2374
|
+
if (!ft(n, r)) return null;
|
|
2375
|
+
let o;
|
|
2376
|
+
t[0] !== i || t[1] !== r?.label ? (o = !i && /* @__PURE__ */ G("p", {
|
|
2377
|
+
className: "_1dzarb28",
|
|
2378
|
+
children: r?.label
|
|
2379
|
+
}), t[0] = i, t[1] = r?.label, t[2] = o) : o = t[2];
|
|
2380
|
+
let s;
|
|
2381
|
+
t[3] !== a || t[4] !== n || t[5] !== r?.fields ? (s = r?.fields?.map((e) => /* @__PURE__ */ G(Xr, {
|
|
2382
|
+
field: e,
|
|
2383
|
+
schema: n,
|
|
2384
|
+
settings: { enableVerification: a }
|
|
2385
|
+
}, e?.key)), t[3] = a, t[4] = n, t[5] = r?.fields, t[6] = s) : s = t[6];
|
|
2386
|
+
let c;
|
|
2387
|
+
t[7] === s ? c = t[8] : (c = /* @__PURE__ */ G("div", {
|
|
2388
|
+
className: fi,
|
|
2389
|
+
children: s
|
|
2390
|
+
}), t[7] = s, t[8] = c);
|
|
2391
|
+
let l;
|
|
2392
|
+
return t[9] !== o || t[10] !== c ? (l = /* @__PURE__ */ K("div", {
|
|
2393
|
+
className: di,
|
|
2394
|
+
children: [o, c]
|
|
2395
|
+
}), t[9] = o, t[10] = c, t[11] = l) : l = t[11], l;
|
|
2396
|
+
}, hi = P.createContext({
|
|
2397
|
+
schema: null,
|
|
2398
|
+
submitButtonConfig: { show: !0 }
|
|
2399
|
+
}), gi = (e) => {
|
|
2400
|
+
let t = O(14), n, r, i, a;
|
|
2401
|
+
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);
|
|
2402
|
+
let o;
|
|
2403
|
+
t[5] === r ? o = t[6] : (o = { ...r }, t[5] = r, t[6] = o);
|
|
2404
|
+
let s;
|
|
2405
|
+
t[7] !== n || t[8] !== i || t[9] !== a ? (s = /* @__PURE__ */ G(ii, {
|
|
2406
|
+
...i,
|
|
2407
|
+
variant: a,
|
|
2408
|
+
children: n
|
|
2409
|
+
}), t[7] = n, t[8] = i, t[9] = a, t[10] = s) : s = t[10];
|
|
2410
|
+
let c;
|
|
2411
|
+
return t[11] !== o || t[12] !== s ? (c = /* @__PURE__ */ G(hi.Provider, {
|
|
2412
|
+
value: o,
|
|
2413
|
+
children: s
|
|
2414
|
+
}), t[11] = o, t[12] = s, t[13] = c) : c = t[13], c;
|
|
2415
|
+
}, _i = () => P.useContext(hi), vi = (e, t) => {
|
|
2416
|
+
if (Array.isArray(e) && e.length > 0) {
|
|
2417
|
+
let n = 0;
|
|
2418
|
+
for (let r of e) n += 1, r?.param && t && t(r?.param, {
|
|
2419
|
+
type: "server_error",
|
|
2420
|
+
message: r?.message
|
|
2421
|
+
}, { shouldFocus: n === 0 });
|
|
2422
|
+
}
|
|
2423
|
+
}, yi = {
|
|
2424
|
+
FORM_DIRTY: "form-dirty",
|
|
2425
|
+
FORM_VALUES: "form-values"
|
|
2426
|
+
}, bi = (e) => {
|
|
2427
|
+
let t = localStorage.getItem(`${e}-${yi.FORM_VALUES}`);
|
|
2428
|
+
return t ? JSON.parse(t) : {};
|
|
2429
|
+
}, xi = (e, t) => {
|
|
2430
|
+
localStorage.setItem(`${e}-${yi.FORM_VALUES}`, JSON.stringify(t));
|
|
2431
|
+
}, Si = (e) => {
|
|
2432
|
+
localStorage.removeItem(`${e}-${yi.FORM_VALUES}`);
|
|
2433
|
+
}, Ci = ({ schema: e, originalSchema: t, onSubmitSuccess: n, onSubmitError: r, onInit: i, setFormErrorAfterSubmit: a = !0 }) => {
|
|
2434
|
+
let o = V(() => e, [e]), s = V(() => t || o, [t, o]), c = M(), { toastConfig: l, onSuccess: u, onError: d, isLoggedIn: f, isDisabled: p, externalInitialValues: m = {}, account: h, preview: g, uiConfig: _ } = _i(), [v, y] = U({
|
|
2435
|
+
contentId: null,
|
|
2436
|
+
publishedId: null
|
|
2437
|
+
}), [b, x] = U(!1), [S, C] = U(!1), [w, T] = U(!1), E = H({}), D = H({}), O = (e) => {
|
|
2438
|
+
if (!o?.sections) return null;
|
|
2439
|
+
for (let t of o.sections) for (let n of t?.fields ?? []) if (n?.key === e) return n?.kind ?? null;
|
|
2440
|
+
return null;
|
|
2441
|
+
}, A = () => {
|
|
2442
|
+
let e = {};
|
|
2443
|
+
try {
|
|
2444
|
+
if (typeof window < "u") {
|
|
2445
|
+
let t = new URLSearchParams(window?.location?.search);
|
|
2446
|
+
for (let [n, r] of t.entries()) {
|
|
2447
|
+
let [t, i] = n.split("-");
|
|
2448
|
+
if (t === "lf" && i && r) try {
|
|
2449
|
+
let t = JSON.parse(r), n = O(i);
|
|
2450
|
+
e[i] = typeof t == "number" && !(n === "number" || n === "currency") ? r : t;
|
|
2451
|
+
} catch {
|
|
2452
|
+
e[i] = r;
|
|
2453
|
+
}
|
|
2454
|
+
}
|
|
2455
|
+
}
|
|
2456
|
+
} catch {}
|
|
2457
|
+
let t = o ? _t(o) : {}, n = {};
|
|
2458
|
+
h && o && (o.email_field && h.email && (n[o.email_field] = h.email), o.mobile_field && h.mobile && (n[o.mobile_field] = h.mobile));
|
|
2459
|
+
let r = {
|
|
2460
|
+
...m || {},
|
|
2461
|
+
...n,
|
|
2462
|
+
...e
|
|
2463
|
+
};
|
|
2464
|
+
E.current = {
|
|
2465
|
+
...t,
|
|
2466
|
+
...r,
|
|
2467
|
+
...E.current
|
|
2468
|
+
};
|
|
2469
|
+
}, N = ce({
|
|
2470
|
+
mode: "onTouched",
|
|
2471
|
+
disabled: p
|
|
2472
|
+
}), { formState: P } = N, F = (e) => {
|
|
2473
|
+
E.current = {
|
|
2474
|
+
...E.current || {},
|
|
2475
|
+
...e
|
|
2476
|
+
};
|
|
2477
|
+
};
|
|
2478
|
+
return B(() => {
|
|
2479
|
+
if (o && c?.collection) {
|
|
2480
|
+
if (A(), !v.contentId && !v.publishedId && !g) {
|
|
2481
|
+
let e = o?.allow_multiple === !1;
|
|
2482
|
+
if (o?.allow_draft) {
|
|
2483
|
+
if (f) {
|
|
2484
|
+
x(!0), c?.collection?.getDraftEntry(o?.key).then((t) => {
|
|
2485
|
+
let n = t?.content?.data;
|
|
2486
|
+
if (n === null) {
|
|
2487
|
+
C(!0);
|
|
2488
|
+
return;
|
|
2489
|
+
}
|
|
2490
|
+
C(!1);
|
|
2491
|
+
let r = e && Array.isArray(n) && n?.find((e) => e?._status === "published") || null;
|
|
2492
|
+
if (r?._id) E.current = {
|
|
2493
|
+
...E.current || {},
|
|
2494
|
+
...r
|
|
2495
|
+
}, y({
|
|
2496
|
+
contentId: null,
|
|
2497
|
+
publishedId: r._id
|
|
2498
|
+
});
|
|
2499
|
+
else {
|
|
2500
|
+
let e = Array.isArray(n) ? n?.filter((e) => e?._status === "draft") : [], t = e?.[e.length - 1] || null;
|
|
2501
|
+
t?._id && (E.current = {
|
|
2502
|
+
...E.current || {},
|
|
2503
|
+
...t
|
|
2504
|
+
}, y({
|
|
2505
|
+
contentId: t._id,
|
|
2506
|
+
publishedId: null
|
|
2507
|
+
}));
|
|
2508
|
+
}
|
|
2509
|
+
}).catch((e) => (c?.logger?.error("Failed to get draft entry", { exception: e }), null)).finally(() => {
|
|
2510
|
+
D.current = { ...E.current }, N.reset({ ...E?.current }), i?.(E.current), x(!1);
|
|
2511
|
+
});
|
|
2512
|
+
return;
|
|
2513
|
+
}
|
|
2514
|
+
let t = bi(o?.key);
|
|
2515
|
+
t && (E.current = {
|
|
2516
|
+
...E.current || {},
|
|
2517
|
+
...t
|
|
2518
|
+
});
|
|
2519
|
+
}
|
|
2520
|
+
}
|
|
2521
|
+
D.current = { ...E.current }, N.reset({ ...E?.current }), i?.(E.current);
|
|
2522
|
+
}
|
|
2523
|
+
}, [o, f]), B(() => {
|
|
2524
|
+
let { isSubmitSuccessful: e, isValid: t } = P;
|
|
2525
|
+
e && t && (D.current = { ...E.current }, N.reset({
|
|
2526
|
+
...E?.current,
|
|
2527
|
+
__captcha: "verified"
|
|
2528
|
+
}), i?.(E.current));
|
|
2529
|
+
}, [P]), B(() => {
|
|
2530
|
+
o && (v.contentId || v.publishedId) && Si(o?.key);
|
|
2531
|
+
}, [v]), {
|
|
2532
|
+
methods: N,
|
|
2533
|
+
isLoading: b,
|
|
2534
|
+
isError: S,
|
|
2535
|
+
contentId: v.contentId,
|
|
2536
|
+
publishedId: v.publishedId,
|
|
2537
|
+
allFormValues: E.current,
|
|
2538
|
+
handleContentId: (e) => {
|
|
2539
|
+
e && e !== v.contentId && !v.publishedId && y({
|
|
2540
|
+
contentId: e,
|
|
2541
|
+
publishedId: null
|
|
2542
|
+
});
|
|
2543
|
+
},
|
|
2544
|
+
appendFormValues: F,
|
|
2545
|
+
submitToRemote: async (e) => {
|
|
2546
|
+
if (F(e), !(g || !c?.collection || !s)) try {
|
|
2547
|
+
let e = yt(E?.current, s, D.current), t = null;
|
|
2548
|
+
if (t = v.publishedId ? await c?.collection?.editDraftEntry(s?.key, v.publishedId, e) : v.contentId ? await c?.collection?.submitDraftEntry(s?.key, e) : await c?.collection?.saveCollectionData({
|
|
2549
|
+
collection_id: s?.id,
|
|
2550
|
+
data: e
|
|
2551
|
+
}), t?.content?.data) {
|
|
2552
|
+
let e = t?.content?.meta?.booking_config?.enabled;
|
|
2553
|
+
l?.showSuccessToast && !(l?.suppressOnBooking && e) && j(l.successToastText || "Form submitted successfully."), E.current = {}, A(), Si(s?.key), y({
|
|
2554
|
+
contentId: null,
|
|
2555
|
+
publishedId: null
|
|
2556
|
+
}), _?.hideSuccessScreen || T(!0);
|
|
2557
|
+
try {
|
|
2558
|
+
u && u({
|
|
2559
|
+
schemaId: s?.id,
|
|
2560
|
+
response: t?.content?.data,
|
|
2561
|
+
meta: t?.content?.meta
|
|
2562
|
+
}), n && n();
|
|
2563
|
+
} catch (e) {
|
|
2564
|
+
c?.logger?.error("Form success callback threw after a saved entry", { exception: ee(e) });
|
|
2565
|
+
}
|
|
2566
|
+
return;
|
|
2567
|
+
}
|
|
2568
|
+
throw Error("Failed to save form details, API response invalid");
|
|
2569
|
+
} catch (e) {
|
|
2570
|
+
k(e), e instanceof J ? (e?.hasFieldErrors && a && vi(e?.fieldErrors, N.setError), r && r(e.fieldErrors || []), d && d(e)) : d && d(e?.response?.data || e);
|
|
2571
|
+
}
|
|
2572
|
+
},
|
|
2573
|
+
showSuccessOverlay: w,
|
|
2574
|
+
dismissSuccessOverlay: () => T(!1)
|
|
2575
|
+
};
|
|
2576
|
+
}, wi = "_1jed92w2", Ti = "_1jed92w3 _1jed92w1", Ei = "_1jed92w4 _1jed92w1", Di = "_1jed92w5 _1jed92w1", Oi = "_1jed92w6 _1jed92w1", ki = () => {
|
|
2577
|
+
let e = O(1), t;
|
|
2578
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ K("div", {
|
|
2579
|
+
className: wi,
|
|
2580
|
+
children: [
|
|
2581
|
+
/* @__PURE__ */ K("div", { children: [/* @__PURE__ */ G("div", { className: Ti }), /* @__PURE__ */ G("div", { className: Di })] }),
|
|
2582
|
+
/* @__PURE__ */ K("div", { children: [/* @__PURE__ */ G("div", { className: Ei }), /* @__PURE__ */ G("div", { className: Di })] }),
|
|
2583
|
+
/* @__PURE__ */ G("div", { className: Oi })
|
|
2584
|
+
]
|
|
2585
|
+
}), e[0] = t) : t = e[0], t;
|
|
2586
|
+
}, Ai = "a2n8870", ji = "a2n8871", Mi = "a2n8872", Ni = "a2n8873", Pi = "a2n8874", Fi = "a2n8875", Ii = "a2n8876", Li = "https://static.levocdn.com/WLZ1TXTD/Levo-Logo-moxa93IxlVi0W.webp", Ri = L(() => import("altcha").then(() => ({ default: function({ widgetRef: e, client: t, onStateChange: n }) {
|
|
2587
|
+
return B(() => {
|
|
2588
|
+
let { current: t } = e;
|
|
2589
|
+
if (t) return t.addEventListener("statechange", n), () => t.removeEventListener("statechange", n);
|
|
2590
|
+
}, [n]), /* @__PURE__ */ G("altcha-widget", {
|
|
2591
|
+
ref: e,
|
|
2592
|
+
style: {
|
|
2593
|
+
"--altcha-max-width": "100%",
|
|
2594
|
+
"--altcha-border-width": "1px",
|
|
2595
|
+
"--altcha-border-radius": p.input.borderRadius,
|
|
2596
|
+
"--altcha-color-base": r.colors.input,
|
|
2597
|
+
"--altcha-color-border": r.colors.border,
|
|
2598
|
+
"--altcha-color-border-focus": r.colors.ring,
|
|
2599
|
+
"--altcha-color-text": r.colors.inputForeground
|
|
2600
|
+
},
|
|
2601
|
+
hidelogo: !0,
|
|
2602
|
+
auto: "onfocus",
|
|
2603
|
+
hidefooter: !0,
|
|
2604
|
+
challengeurl: `${t.apiUrl}/v1/identity/captcha/create-challenge`,
|
|
2605
|
+
verifyurl: `${t.apiUrl}/v1/identity/captcha/verify-challenge`
|
|
2606
|
+
});
|
|
2607
|
+
} }))), zi = () => {
|
|
2608
|
+
let e = O(1), t;
|
|
2609
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ K("div", {
|
|
2610
|
+
className: Mi,
|
|
2611
|
+
children: [/* @__PURE__ */ G("img", {
|
|
2612
|
+
alt: "Levo",
|
|
2613
|
+
src: Li,
|
|
2614
|
+
width: 16,
|
|
2615
|
+
height: 16,
|
|
2616
|
+
className: Ni
|
|
2617
|
+
}), /* @__PURE__ */ G("span", {
|
|
2618
|
+
className: Pi,
|
|
2619
|
+
children: "Levo CAPTCHA"
|
|
2620
|
+
})]
|
|
2621
|
+
}), e[0] = t) : t = e[0], t;
|
|
2622
|
+
}, Bi = () => {
|
|
2623
|
+
let e = O(1), t;
|
|
2624
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ G("div", {
|
|
2625
|
+
className: Fi,
|
|
2626
|
+
children: /* @__PURE__ */ G("span", {
|
|
2627
|
+
className: Ii,
|
|
2628
|
+
children: "Loading verification..."
|
|
2629
|
+
})
|
|
2630
|
+
}), e[0] = t) : t = e[0], t;
|
|
2631
|
+
}, Vi = () => {
|
|
2632
|
+
let e = O(19), { disableCaptcha: t } = _i(), n = M(), [r, i] = U(!1), a = H(null), s = t ? !1 : "Verification is required", c;
|
|
2633
|
+
e[0] === s ? c = e[1] : (c = {
|
|
2634
|
+
name: "__captcha",
|
|
2635
|
+
rules: { required: s }
|
|
2636
|
+
}, e[0] = s, e[1] = c);
|
|
2637
|
+
let { field: l, fieldState: u } = Q(c), { onChange: d } = l, { error: f } = u, p, m;
|
|
2638
|
+
e[2] === Symbol.for("react.memo_cache_sentinel") ? (p = () => {
|
|
2639
|
+
i(!0);
|
|
2640
|
+
}, m = [], e[2] = p, e[3] = m) : (p = e[2], m = e[3]), B(p, m);
|
|
2641
|
+
let h;
|
|
2642
|
+
e[4] === d ? h = e[5] : (h = (e) => {
|
|
2643
|
+
"detail" in e && d(e.detail.state || null);
|
|
2644
|
+
}, e[4] = d, e[5] = h);
|
|
2645
|
+
let g = h;
|
|
2646
|
+
if (!r) {
|
|
2647
|
+
let t = f?.message, n;
|
|
2648
|
+
e[6] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ K("div", {
|
|
2649
|
+
className: ji,
|
|
2650
|
+
children: [/* @__PURE__ */ G(Bi, {}), /* @__PURE__ */ G(zi, {})]
|
|
2651
|
+
}), e[6] = n) : n = e[6];
|
|
2652
|
+
let r;
|
|
2653
|
+
return e[7] === t ? r = e[8] : (r = /* @__PURE__ */ G(o, {
|
|
2654
|
+
error: t,
|
|
2655
|
+
className: Ai,
|
|
2656
|
+
children: n
|
|
2657
|
+
}), e[7] = t, e[8] = r), r;
|
|
2658
|
+
}
|
|
2659
|
+
let _ = f?.message, v;
|
|
2660
|
+
e[9] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ G(Bi, {}), e[9] = v) : v = e[9];
|
|
2661
|
+
let y;
|
|
2662
|
+
e[10] !== n || e[11] !== g ? (y = /* @__PURE__ */ G(F, {
|
|
2663
|
+
fallback: v,
|
|
2664
|
+
children: /* @__PURE__ */ G(Ri, {
|
|
2665
|
+
widgetRef: a,
|
|
2666
|
+
client: n,
|
|
2667
|
+
onStateChange: g
|
|
2668
|
+
})
|
|
2669
|
+
}), e[10] = n, e[11] = g, e[12] = y) : y = e[12];
|
|
2670
|
+
let b;
|
|
2671
|
+
e[13] === Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ G(zi, {}), e[13] = b) : b = e[13];
|
|
2672
|
+
let x;
|
|
2673
|
+
e[14] === y ? x = e[15] : (x = /* @__PURE__ */ K("div", {
|
|
2674
|
+
className: ji,
|
|
2675
|
+
children: [y, b]
|
|
2676
|
+
}), e[14] = y, e[15] = x);
|
|
2677
|
+
let S;
|
|
2678
|
+
return e[16] !== x || e[17] !== _ ? (S = /* @__PURE__ */ G(o, {
|
|
2679
|
+
error: _,
|
|
2680
|
+
className: Ai,
|
|
2681
|
+
children: x
|
|
2682
|
+
}), e[16] = x, e[17] = _, e[18] = S) : S = e[18], S;
|
|
2683
|
+
}, Hi = {
|
|
2684
|
+
errors: {},
|
|
2685
|
+
isValid: !0,
|
|
2686
|
+
isDirty: !1,
|
|
2687
|
+
isSubmitted: !1,
|
|
2688
|
+
submitCount: 0,
|
|
2689
|
+
dirtyFields: {}
|
|
2690
|
+
}, Ui = () => {
|
|
2691
|
+
let e = O(22), t = ue(), n = le(), [r, i] = U(Hi), a, o;
|
|
2692
|
+
e[0] === n ? (a = e[1], o = e[2]) : (a = () => {
|
|
2693
|
+
if (n?.subscribe) return n.subscribe({
|
|
2694
|
+
formState: {
|
|
2695
|
+
errors: !0,
|
|
2696
|
+
isValid: !0,
|
|
2697
|
+
isDirty: !0,
|
|
2698
|
+
dirtyFields: !0,
|
|
2699
|
+
touchedFields: !0
|
|
2700
|
+
},
|
|
2701
|
+
callback: (e) => {
|
|
2702
|
+
i({
|
|
2703
|
+
errors: e.errors ?? {},
|
|
2704
|
+
isValid: !!e.isValid,
|
|
2705
|
+
isDirty: !!e.isDirty,
|
|
2706
|
+
isSubmitted: !!e.isSubmitted,
|
|
2707
|
+
submitCount: e.submitCount ?? 0,
|
|
2708
|
+
dirtyFields: e.dirtyFields ?? {}
|
|
2709
|
+
});
|
|
2710
|
+
}
|
|
2711
|
+
});
|
|
2712
|
+
}, o = [n], e[0] = n, e[1] = a, e[2] = o), B(a, o);
|
|
2713
|
+
let { errors: s, isValid: c, isDirty: l, isSubmitted: u, submitCount: d, dirtyFields: f } = r, [p, m] = U(!0), h;
|
|
2714
|
+
e[3] === s ? h = e[4] : (h = Object.entries(s).map(Ki), e[3] = s, e[4] = h);
|
|
2715
|
+
let g = h, _;
|
|
2716
|
+
e[5] === Symbol.for("react.memo_cache_sentinel") ? (_ = {
|
|
2717
|
+
position: "fixed",
|
|
2718
|
+
right: 12,
|
|
2719
|
+
bottom: 12,
|
|
2720
|
+
zIndex: 9999,
|
|
2721
|
+
width: 360,
|
|
2722
|
+
maxHeight: "60vh",
|
|
2723
|
+
background: "#0b1020",
|
|
2724
|
+
color: "#e4e7ef",
|
|
2725
|
+
border: "1px solid #2a3148",
|
|
2726
|
+
borderRadius: 8,
|
|
2727
|
+
fontFamily: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",
|
|
2728
|
+
fontSize: 11,
|
|
2729
|
+
boxShadow: "0 12px 32px rgba(0,0,0,0.35)",
|
|
2730
|
+
overflow: "hidden",
|
|
2731
|
+
display: "flex",
|
|
2732
|
+
flexDirection: "column"
|
|
2733
|
+
}, e[5] = _) : _ = e[5];
|
|
2734
|
+
let v, y;
|
|
2735
|
+
e[6] === Symbol.for("react.memo_cache_sentinel") ? (v = () => {
|
|
2736
|
+
m(qi);
|
|
2737
|
+
}, y = {
|
|
2738
|
+
padding: "8px 12px",
|
|
2739
|
+
background: "#141b33",
|
|
2740
|
+
color: "#e4e7ef",
|
|
2741
|
+
border: "none",
|
|
2742
|
+
borderBottom: "1px solid #2a3148",
|
|
2743
|
+
cursor: "pointer",
|
|
2744
|
+
textAlign: "left",
|
|
2745
|
+
fontSize: 11,
|
|
2746
|
+
fontWeight: 600,
|
|
2747
|
+
letterSpacing: .5,
|
|
2748
|
+
textTransform: "uppercase"
|
|
2749
|
+
}, e[6] = v, e[7] = y) : (v = e[6], y = e[7]);
|
|
2750
|
+
let b = p ? "▾" : "▸", x = String(c), S = String(l), C = String(u), w;
|
|
2751
|
+
e[8] !== d || e[9] !== b || e[10] !== x || e[11] !== S || e[12] !== C ? (w = /* @__PURE__ */ K("button", {
|
|
2752
|
+
type: "button",
|
|
2753
|
+
onClick: v,
|
|
2754
|
+
style: y,
|
|
2755
|
+
children: [
|
|
2756
|
+
"RHF Debug ",
|
|
2757
|
+
b,
|
|
2758
|
+
" · valid=",
|
|
2759
|
+
x,
|
|
2760
|
+
" · dirty=",
|
|
2761
|
+
S,
|
|
2762
|
+
" · submitted=",
|
|
2763
|
+
C,
|
|
2764
|
+
" · submits=",
|
|
2765
|
+
d
|
|
2766
|
+
]
|
|
2767
|
+
}), e[8] = d, e[9] = b, e[10] = x, e[11] = S, e[12] = C, e[13] = w) : w = e[13];
|
|
2768
|
+
let T;
|
|
2769
|
+
e[14] !== f || e[15] !== g || e[16] !== p || e[17] !== t ? (T = p && /* @__PURE__ */ K("div", {
|
|
2770
|
+
style: {
|
|
2771
|
+
overflow: "auto",
|
|
2772
|
+
padding: 10,
|
|
2773
|
+
display: "grid",
|
|
2774
|
+
gap: 10
|
|
2775
|
+
},
|
|
2776
|
+
children: [
|
|
2777
|
+
/* @__PURE__ */ G(Gi, {
|
|
2778
|
+
title: `Errors (${g.length})`,
|
|
2779
|
+
accent: "#ff6b6b",
|
|
2780
|
+
children: g.length === 0 ? /* @__PURE__ */ G("div", {
|
|
2781
|
+
style: { opacity: .6 },
|
|
2782
|
+
children: "none"
|
|
2783
|
+
}) : g.map(Ji)
|
|
2784
|
+
}),
|
|
2785
|
+
/* @__PURE__ */ G(Gi, {
|
|
2786
|
+
title: "Values",
|
|
2787
|
+
accent: "#7ce5b1",
|
|
2788
|
+
children: /* @__PURE__ */ G("pre", {
|
|
2789
|
+
style: Wi,
|
|
2790
|
+
children: JSON.stringify(t ?? {}, null, 2)
|
|
2791
|
+
})
|
|
2792
|
+
}),
|
|
2793
|
+
/* @__PURE__ */ G(Gi, {
|
|
2794
|
+
title: "Dirty fields",
|
|
2795
|
+
accent: "#7cb1e5",
|
|
2796
|
+
children: /* @__PURE__ */ G("pre", {
|
|
2797
|
+
style: Wi,
|
|
2798
|
+
children: JSON.stringify(f ?? {}, null, 2)
|
|
2799
|
+
})
|
|
2800
|
+
})
|
|
2801
|
+
]
|
|
2802
|
+
}), e[14] = f, e[15] = g, e[16] = p, e[17] = t, e[18] = T) : T = e[18];
|
|
2803
|
+
let E;
|
|
2804
|
+
return e[19] !== w || e[20] !== T ? (E = /* @__PURE__ */ K("div", {
|
|
2805
|
+
style: _,
|
|
2806
|
+
children: [w, T]
|
|
2807
|
+
}), e[19] = w, e[20] = T, e[21] = E) : E = e[21], E;
|
|
2808
|
+
}, Wi = {
|
|
2809
|
+
margin: 0,
|
|
2810
|
+
whiteSpace: "pre-wrap",
|
|
2811
|
+
wordBreak: "break-word",
|
|
2812
|
+
fontFamily: "inherit",
|
|
2813
|
+
fontSize: 11,
|
|
2814
|
+
lineHeight: 1.45
|
|
2815
|
+
}, Gi = (e) => {
|
|
2816
|
+
let t = O(11), { title: n, accent: r, children: i } = e, a;
|
|
2817
|
+
t[0] === r ? a = t[1] : (a = {
|
|
2818
|
+
fontSize: 10,
|
|
2819
|
+
textTransform: "uppercase",
|
|
2820
|
+
letterSpacing: .6,
|
|
2821
|
+
color: r,
|
|
2822
|
+
marginBottom: 4,
|
|
2823
|
+
fontWeight: 700
|
|
2824
|
+
}, t[0] = r, t[1] = a);
|
|
2825
|
+
let o;
|
|
2826
|
+
t[2] !== a || t[3] !== n ? (o = /* @__PURE__ */ G("div", {
|
|
2827
|
+
style: a,
|
|
2828
|
+
children: n
|
|
2829
|
+
}), t[2] = a, t[3] = n, t[4] = o) : o = t[4];
|
|
2830
|
+
let s;
|
|
2831
|
+
t[5] === Symbol.for("react.memo_cache_sentinel") ? (s = {
|
|
2832
|
+
background: "#070b1a",
|
|
2833
|
+
border: "1px solid #1c2340",
|
|
2834
|
+
borderRadius: 6,
|
|
2835
|
+
padding: 8
|
|
2836
|
+
}, t[5] = s) : s = t[5];
|
|
2837
|
+
let c;
|
|
2838
|
+
t[6] === i ? c = t[7] : (c = /* @__PURE__ */ G("div", {
|
|
2839
|
+
style: s,
|
|
2840
|
+
children: i
|
|
2841
|
+
}), t[6] = i, t[7] = c);
|
|
2842
|
+
let l;
|
|
2843
|
+
return t[8] !== o || t[9] !== c ? (l = /* @__PURE__ */ K("div", { children: [o, c] }), t[8] = o, t[9] = c, t[10] = l) : l = t[10], l;
|
|
2844
|
+
};
|
|
2845
|
+
function Ki(e) {
|
|
2846
|
+
let [t, n] = e;
|
|
2847
|
+
return {
|
|
2848
|
+
key: t,
|
|
2849
|
+
message: n?.message ?? "(no message)",
|
|
2850
|
+
type: n?.type ?? "—"
|
|
2851
|
+
};
|
|
2852
|
+
}
|
|
2853
|
+
function qi(e) {
|
|
2854
|
+
return !e;
|
|
2855
|
+
}
|
|
2856
|
+
function Ji(e) {
|
|
2857
|
+
return /* @__PURE__ */ K("div", {
|
|
2858
|
+
style: { marginBottom: 4 },
|
|
2859
|
+
children: [
|
|
2860
|
+
/* @__PURE__ */ G("span", {
|
|
2861
|
+
style: { color: "#ffb86b" },
|
|
2862
|
+
children: e.key
|
|
2863
|
+
}),
|
|
2864
|
+
" ",
|
|
2865
|
+
/* @__PURE__ */ K("span", {
|
|
2866
|
+
style: { opacity: .7 },
|
|
2867
|
+
children: [
|
|
2868
|
+
"[",
|
|
2869
|
+
e.type,
|
|
2870
|
+
"]"
|
|
2871
|
+
]
|
|
2872
|
+
}),
|
|
2873
|
+
/* @__PURE__ */ G("div", {
|
|
2874
|
+
style: {
|
|
2875
|
+
paddingLeft: 8,
|
|
2876
|
+
opacity: .85
|
|
2877
|
+
},
|
|
2878
|
+
children: e.message
|
|
2879
|
+
})
|
|
2880
|
+
]
|
|
2881
|
+
}, e.key);
|
|
2882
|
+
}
|
|
2883
|
+
//#endregion
|
|
2884
|
+
//#region ../../libraries/react-collection/dist/lib/components/FormHeader/FormHeader.cssm.js
|
|
2885
|
+
var Yi = "_1vist8m0", Xi = (e) => {
|
|
2886
|
+
let t = O(4), { className: n } = e, { uiConfig: r } = _i();
|
|
2887
|
+
if (r?.hideFormHeading) return null;
|
|
2888
|
+
let i;
|
|
2889
|
+
t[0] === n ? i = t[1] : (i = Z(Yi, n), t[0] = n, t[1] = i);
|
|
2890
|
+
let a;
|
|
2891
|
+
return t[2] === i ? a = t[3] : (a = /* @__PURE__ */ G("h1", {
|
|
2892
|
+
className: i,
|
|
2893
|
+
children: "Create new"
|
|
2894
|
+
}), t[2] = i, t[3] = a), a;
|
|
2895
|
+
}, Zi = "zx38wb0", Qi = (e) => {
|
|
2896
|
+
let t = O(5), { children: n, className: r } = e, { uiConfig: i } = _i();
|
|
2897
|
+
if (i?.hideSectionHeadings) return null;
|
|
2898
|
+
let a;
|
|
2899
|
+
t[0] === r ? a = t[1] : (a = Z(Zi, r), t[0] = r, t[1] = a);
|
|
2900
|
+
let o;
|
|
2901
|
+
return t[2] !== n || t[3] !== a ? (o = /* @__PURE__ */ G("h3", {
|
|
2902
|
+
className: a,
|
|
2903
|
+
children: n
|
|
2904
|
+
}), t[2] = n, t[3] = a, t[4] = o) : o = t[4], o;
|
|
2905
|
+
}, $i = "q22d794", ea = "q22d795", ta = "q22d796", na = "q22d797", ra = "q22d798", ia = 5, aa = "Thank you!", oa = "Your response has been submitted successfully.", sa = () => {
|
|
2906
|
+
let e = O(1), t;
|
|
2907
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ K("svg", {
|
|
2908
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2909
|
+
viewBox: "0 0 24 24",
|
|
2910
|
+
fill: "none",
|
|
2911
|
+
stroke: "currentColor",
|
|
2912
|
+
strokeWidth: "2.5",
|
|
2913
|
+
strokeLinecap: "round",
|
|
2914
|
+
strokeLinejoin: "round",
|
|
2915
|
+
children: [/* @__PURE__ */ G("title", { children: "Check Icon" }), /* @__PURE__ */ G("path", { d: "M20 6 9 17l-5-5" })]
|
|
2916
|
+
}), e[0] = t) : t = e[0], t;
|
|
2917
|
+
}, ca = ({ onDismiss: e }) => {
|
|
2918
|
+
let { successConfig: t, schema: r } = _i(), i = r?.settings?.success_message, [a, o] = U(ia), s = (e) => !e || e.replace(/<[^>]*>/g, "").trim() === "", c = t?.title || i?.title || aa, l = t?.message || i?.message, u = s(l) ? oa : l, d = t?.action || i?.action, f = d?.type ?? "none", p = f === "redirect" ? d?.value : void 0, m = (() => {
|
|
2919
|
+
let e = p?.trim();
|
|
2920
|
+
if (e && !e.startsWith("//")) {
|
|
2921
|
+
if (e.startsWith("/")) return e;
|
|
2922
|
+
try {
|
|
2923
|
+
let t = new URL(e);
|
|
2924
|
+
if (t.protocol === "http:" || t.protocol === "https:") return e;
|
|
2925
|
+
} catch {}
|
|
2926
|
+
}
|
|
2927
|
+
})();
|
|
2928
|
+
B(() => {
|
|
2929
|
+
if (!m) return;
|
|
2930
|
+
let e = setInterval(() => {
|
|
2931
|
+
o((t) => t <= 1 ? (clearInterval(e), window.location.href = m, 0) : t - 1);
|
|
2932
|
+
}, 1e3);
|
|
2933
|
+
return () => clearInterval(e);
|
|
2934
|
+
}, [m]);
|
|
2935
|
+
let h = R(() => {
|
|
2936
|
+
m && (window.location.href = m);
|
|
2937
|
+
}, [m]);
|
|
2938
|
+
return /* @__PURE__ */ G("div", {
|
|
2939
|
+
className: $i,
|
|
2940
|
+
children: /* @__PURE__ */ K("div", {
|
|
2941
|
+
className: ea,
|
|
2942
|
+
children: [
|
|
2943
|
+
/* @__PURE__ */ G("div", {
|
|
2944
|
+
className: ta,
|
|
2945
|
+
children: /* @__PURE__ */ G(sa, {})
|
|
2946
|
+
}),
|
|
2947
|
+
/* @__PURE__ */ G("h2", {
|
|
2948
|
+
className: na,
|
|
2949
|
+
children: c
|
|
2950
|
+
}),
|
|
2951
|
+
/* @__PURE__ */ G("div", {
|
|
2952
|
+
className: ra,
|
|
2953
|
+
dangerouslySetInnerHTML: { __html: u }
|
|
2954
|
+
}),
|
|
2955
|
+
f === "submit_another" && /* @__PURE__ */ G("div", {
|
|
2956
|
+
className: "q22d799",
|
|
2957
|
+
children: /* @__PURE__ */ G(n, {
|
|
2958
|
+
variant: "default",
|
|
2959
|
+
size: "sm",
|
|
2960
|
+
onClick: e,
|
|
2961
|
+
children: "Submit Another"
|
|
2962
|
+
})
|
|
2963
|
+
}),
|
|
2964
|
+
f === "redirect" && m && /* @__PURE__ */ K("div", {
|
|
2965
|
+
className: "q22d799",
|
|
2966
|
+
children: [/* @__PURE__ */ G(n, {
|
|
2967
|
+
variant: "default",
|
|
2968
|
+
size: "sm",
|
|
2969
|
+
onClick: h,
|
|
2970
|
+
children: "Continue"
|
|
2971
|
+
}), /* @__PURE__ */ K("span", {
|
|
2972
|
+
className: "q22d79a",
|
|
2973
|
+
children: [
|
|
2974
|
+
"Redirecting in ",
|
|
2975
|
+
a,
|
|
2976
|
+
"s…"
|
|
2977
|
+
]
|
|
2978
|
+
})]
|
|
2979
|
+
})
|
|
2980
|
+
]
|
|
2981
|
+
})
|
|
2982
|
+
});
|
|
2983
|
+
}, la = (e) => {
|
|
2984
|
+
let t = O(29), { isError: n, contentId: r, publishedId: i, getContentId: a, allFormValues: o } = e, { collection: s } = M(), { schema: c, isLoggedIn: l, preview: u } = _i(), { formState: d } = le(), f = ue(), p;
|
|
2985
|
+
t[0] !== s || t[1] !== r || t[2] !== a || t[3] !== n || t[4] !== l || t[5] !== u || t[6] !== i || t[7] !== c?.allow_draft || t[8] !== c?.key ? (p = (e) => {
|
|
2986
|
+
u || i || c?.key && !n && c?.allow_draft && (l ? r ? s.editDraftEntry(c?.key, r, e).then((e) => {
|
|
2987
|
+
e?.content?.data?._id && a(e?.content?.data?._id);
|
|
2988
|
+
}).catch(ua) : s.saveDraftEntry(c?.key, e).then((e) => {
|
|
2989
|
+
e?.content?.data?._id && a(e?.content?.data?._id);
|
|
2990
|
+
}).catch(da) : xi(c?.key, e));
|
|
2991
|
+
}, t[0] = s, t[1] = r, t[2] = a, t[3] = n, t[4] = l, t[5] = u, t[6] = i, t[7] = c?.allow_draft, t[8] = c?.key, t[9] = p) : p = t[9];
|
|
2992
|
+
let m = Pe(p, 100), { isDirty: h, isSubmitting: g, isSubmitSuccessful: _ } = d, v;
|
|
2993
|
+
t[10] !== o || t[11] !== m || t[12] !== f || t[13] !== h || t[14] !== n || t[15] !== _ || t[16] !== g || t[17] !== u ? (v = () => {
|
|
2994
|
+
if (!u) {
|
|
2995
|
+
if (g || _) {
|
|
2996
|
+
m.cancel();
|
|
2997
|
+
return;
|
|
2998
|
+
}
|
|
2999
|
+
n || h && Object?.keys(f || {})?.length > 0 && (m.cancel(), m({
|
|
3000
|
+
...o || {},
|
|
3001
|
+
...f
|
|
3002
|
+
}));
|
|
3003
|
+
}
|
|
3004
|
+
}, t[10] = o, t[11] = m, t[12] = f, t[13] = h, t[14] = n, t[15] = _, t[16] = g, t[17] = u, t[18] = v) : v = t[18];
|
|
3005
|
+
let y;
|
|
3006
|
+
return t[19] !== r || t[20] !== f || t[21] !== h || t[22] !== n || t[23] !== l || t[24] !== _ || t[25] !== g || t[26] !== u || t[27] !== i ? (y = [
|
|
3007
|
+
h,
|
|
3008
|
+
r,
|
|
3009
|
+
i,
|
|
3010
|
+
n,
|
|
3011
|
+
l,
|
|
3012
|
+
f,
|
|
3013
|
+
g,
|
|
3014
|
+
_,
|
|
3015
|
+
u
|
|
3016
|
+
], t[19] = r, t[20] = f, t[21] = h, t[22] = n, t[23] = l, t[24] = _, t[25] = g, t[26] = u, t[27] = i, t[28] = y) : y = t[28], B(v, y), null;
|
|
3017
|
+
};
|
|
3018
|
+
function ua() {
|
|
3019
|
+
console.error("saving entry failed");
|
|
3020
|
+
}
|
|
3021
|
+
function da() {
|
|
3022
|
+
console.error("saving entry failed");
|
|
3023
|
+
}
|
|
3024
|
+
//#endregion
|
|
3025
|
+
//#region ../../libraries/react-collection/dist/lib/variants/DefaultFormVariant/DefaultFormVariant.cssm.js
|
|
3026
|
+
var fa = "fil1ri0", pa = "fil1ri1", ma = "fil1ri2", ha = "fil1ri5", ga = () => {
|
|
3027
|
+
let e = O(51), { schema: t, containerStyles: r, submitButtonConfig: i, isDisabled: a, widgets: o, disableCaptcha: s, debug: c, enableVerification: l } = _i(), u;
|
|
3028
|
+
e[0] === t ? u = e[1] : (u = { schema: t }, e[0] = t, e[1] = u);
|
|
3029
|
+
let { methods: d, isError: f, isLoading: p, contentId: m, publishedId: h, handleContentId: g, submitToRemote: _, allFormValues: v, showSuccessOverlay: y, dismissSuccessOverlay: b } = Ci(u), { handleSubmit: x, watch: S, formState: C } = d, { isSubmitting: w } = C, T;
|
|
3030
|
+
e[2] === S ? T = e[3] : (T = S("__captcha"), e[2] = S, e[3] = T);
|
|
3031
|
+
let E = T, D;
|
|
3032
|
+
e[4] === _ ? D = e[5] : (D = async (e) => {
|
|
3033
|
+
await _(e);
|
|
3034
|
+
}, e[4] = _, e[5] = D);
|
|
3035
|
+
let k;
|
|
3036
|
+
e[6] !== x || e[7] !== D ? (k = x(D), e[6] = x, e[7] = D, e[8] = k) : k = e[8];
|
|
3037
|
+
let A = k;
|
|
3038
|
+
if (y) {
|
|
3039
|
+
let t;
|
|
3040
|
+
return e[9] === b ? t = e[10] : (t = /* @__PURE__ */ G(ca, { onDismiss: b }), e[9] = b, e[10] = t), t;
|
|
3041
|
+
}
|
|
3042
|
+
let j;
|
|
3043
|
+
e[11] === c ? j = e[12] : (j = c && /* @__PURE__ */ G(Ui, {}), e[11] = c, e[12] = j);
|
|
3044
|
+
let M = m || "", N = h || "", P;
|
|
3045
|
+
e[13] !== v || e[14] !== g || e[15] !== f || e[16] !== M || e[17] !== N ? (P = /* @__PURE__ */ G(la, {
|
|
3046
|
+
getContentId: g,
|
|
3047
|
+
isError: f,
|
|
3048
|
+
contentId: M,
|
|
3049
|
+
publishedId: N,
|
|
3050
|
+
allFormValues: v
|
|
3051
|
+
}), e[13] = v, e[14] = g, e[15] = f, e[16] = M, e[17] = N, e[18] = P) : P = e[18];
|
|
3052
|
+
let F;
|
|
3053
|
+
e[19] === r ? F = e[20] : (F = Z(fa, r), e[19] = r, e[20] = F);
|
|
3054
|
+
let I;
|
|
3055
|
+
e[21] === Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ G(Xi, {}), e[21] = I) : I = e[21];
|
|
3056
|
+
let L = p && "fil1ri3", R;
|
|
3057
|
+
e[22] === L ? R = e[23] : (R = Z(pa, L), e[22] = L, e[23] = R);
|
|
3058
|
+
let z;
|
|
3059
|
+
e[24] !== l || e[25] !== t || e[26] !== o ? (z = t?.sections?.map((e) => /* @__PURE__ */ G(_a, {
|
|
3060
|
+
schema: t,
|
|
3061
|
+
section: e,
|
|
3062
|
+
widgets: o,
|
|
3063
|
+
enableVerification: l
|
|
3064
|
+
}, e.id)), e[24] = l, e[25] = t, e[26] = o, e[27] = z) : z = e[27];
|
|
3065
|
+
let B;
|
|
3066
|
+
e[28] === s ? B = e[29] : (B = !s && /* @__PURE__ */ G(Vi, {}), e[28] = s, e[29] = B);
|
|
3067
|
+
let V;
|
|
3068
|
+
e[30] !== E || e[31] !== a || e[32] !== w || e[33] !== i?.show || e[34] !== i?.styles || e[35] !== i?.text ? (V = i?.show && /* @__PURE__ */ G("div", {
|
|
3069
|
+
className: "fil1ri4",
|
|
3070
|
+
children: /* @__PURE__ */ G(n, {
|
|
3071
|
+
className: i?.styles,
|
|
3072
|
+
disabled: a || w,
|
|
3073
|
+
type: "submit",
|
|
3074
|
+
children: w ? "Saving..." : E === "verifying" ? "Verifying..." : i?.text || "Save"
|
|
3075
|
+
})
|
|
3076
|
+
}), e[30] = E, e[31] = a, e[32] = w, e[33] = i?.show, e[34] = i?.styles, e[35] = i?.text, e[36] = V) : V = e[36];
|
|
3077
|
+
let H;
|
|
3078
|
+
e[37] !== A || e[38] !== R || e[39] !== z || e[40] !== B || e[41] !== V ? (H = /* @__PURE__ */ K("form", {
|
|
3079
|
+
className: R,
|
|
3080
|
+
id: "collection-form",
|
|
3081
|
+
onSubmit: A,
|
|
3082
|
+
children: [
|
|
3083
|
+
z,
|
|
3084
|
+
B,
|
|
3085
|
+
V
|
|
3086
|
+
]
|
|
3087
|
+
}), e[37] = A, e[38] = R, e[39] = z, e[40] = B, e[41] = V, e[42] = H) : H = e[42];
|
|
3088
|
+
let U;
|
|
3089
|
+
e[43] !== H || e[44] !== F ? (U = /* @__PURE__ */ K("div", {
|
|
3090
|
+
className: F,
|
|
3091
|
+
children: [I, H]
|
|
3092
|
+
}), e[43] = H, e[44] = F, e[45] = U) : U = e[45];
|
|
3093
|
+
let W;
|
|
3094
|
+
return e[46] !== d || e[47] !== U || e[48] !== j || e[49] !== P ? (W = /* @__PURE__ */ K(ae, {
|
|
3095
|
+
...d,
|
|
3096
|
+
children: [
|
|
3097
|
+
j,
|
|
3098
|
+
P,
|
|
3099
|
+
U
|
|
3100
|
+
]
|
|
3101
|
+
}), e[46] = d, e[47] = U, e[48] = j, e[49] = P, e[50] = W) : W = e[50], W;
|
|
3102
|
+
}, _a = (e) => {
|
|
3103
|
+
let t = O(12), { schema: n, section: r, widgets: i, enableVerification: a } = e;
|
|
3104
|
+
if (!ft(n, r)) return null;
|
|
3105
|
+
let o;
|
|
3106
|
+
t[0] === r ? o = t[1] : (o = r?.label && /* @__PURE__ */ G(Qi, { children: r.label }), t[0] = r, t[1] = o);
|
|
3107
|
+
let s;
|
|
3108
|
+
t[2] !== a || t[3] !== n || t[4] !== r?.fields || t[5] !== i ? (s = r?.fields?.map((e) => /* @__PURE__ */ G(Xr, {
|
|
3109
|
+
field: e,
|
|
3110
|
+
widgets: i,
|
|
3111
|
+
schema: n,
|
|
3112
|
+
settings: { enableVerification: a }
|
|
3113
|
+
}, e?.key)), t[2] = a, t[3] = n, t[4] = r?.fields, t[5] = i, t[6] = s) : s = t[6];
|
|
3114
|
+
let c;
|
|
3115
|
+
t[7] === s ? c = t[8] : (c = /* @__PURE__ */ G("div", {
|
|
3116
|
+
className: ha,
|
|
3117
|
+
children: s
|
|
3118
|
+
}), t[7] = s, t[8] = c);
|
|
3119
|
+
let l;
|
|
3120
|
+
return t[9] !== o || t[10] !== c ? (l = /* @__PURE__ */ K("div", {
|
|
3121
|
+
className: ma,
|
|
3122
|
+
children: [o, c]
|
|
3123
|
+
}), t[9] = o, t[10] = c, t[11] = l) : l = t[11], l;
|
|
3124
|
+
}, va = "_1kah2gz0", ya = "_1kah2gz1", ba = "_1kah2gz3", xa = (e) => {
|
|
3125
|
+
let t = O(12), { totalSteps: n, currentStepIndex: r, hasLevoErrors: i } = e, { formState: a } = le(), { errors: o } = a, s = Object.keys(o || {}).length > 0 || i, c = Math.floor((r + 1) * 100 / n), l = s && "_1kah2gz2", u;
|
|
3126
|
+
t[0] === l ? u = t[1] : (u = Z(ya, l), t[0] = l, t[1] = u);
|
|
3127
|
+
let d = s && "_1kah2gz4", f;
|
|
3128
|
+
t[2] === d ? f = t[3] : (f = Z(ba, d), t[2] = d, t[3] = f);
|
|
3129
|
+
let p = `${c}%`, m;
|
|
3130
|
+
t[4] === p ? m = t[5] : (m = { width: p }, t[4] = p, t[5] = m);
|
|
3131
|
+
let h;
|
|
3132
|
+
t[6] !== f || t[7] !== m ? (h = /* @__PURE__ */ G("div", {
|
|
3133
|
+
className: f,
|
|
3134
|
+
style: m
|
|
3135
|
+
}), t[6] = f, t[7] = m, t[8] = h) : h = t[8];
|
|
3136
|
+
let g;
|
|
3137
|
+
return t[9] !== u || t[10] !== h ? (g = /* @__PURE__ */ G("div", {
|
|
3138
|
+
className: va,
|
|
3139
|
+
children: /* @__PURE__ */ G("div", {
|
|
3140
|
+
className: u,
|
|
3141
|
+
children: h
|
|
3142
|
+
})
|
|
3143
|
+
}), t[9] = u, t[10] = h, t[11] = g) : g = t[11], g;
|
|
3144
|
+
}, Sa = "_1ypxmcv0", Ca = "_1ypxmcv1", wa = "_1ypxmcvb", Ta = "_1ypxmcvc", Ea = (e, t) => e?.sections?.flatMap((n) => (n.fields || []).filter((n) => !it(e, n, t)).map((e) => ({
|
|
3145
|
+
id: e.key,
|
|
3146
|
+
content: e,
|
|
3147
|
+
sectionId: n.id || "",
|
|
3148
|
+
sectionLabel: n.label
|
|
3149
|
+
}))) ?? [], Da = () => {
|
|
3150
|
+
let e = O(82), { disableCaptcha: t, schema: r, widgets: i, submitButtonConfig: a, containerStyles: o, enableVerification: s } = _i(), c;
|
|
3151
|
+
e[0] === r ? c = e[1] : (c = () => Ea(r, {}), e[0] = r, e[1] = c);
|
|
3152
|
+
let [l, u] = U(c), [d, f] = U(0), [p, m] = U(0), h;
|
|
3153
|
+
e[2] === Symbol.for("react.memo_cache_sentinel") ? (h = {
|
|
3154
|
+
state: "entered",
|
|
3155
|
+
direction: "next"
|
|
3156
|
+
}, e[2] = h) : h = e[2];
|
|
3157
|
+
let [g, _] = U(h), v;
|
|
3158
|
+
e[3] === Symbol.for("react.memo_cache_sentinel") ? (v = [], e[3] = v) : v = e[3];
|
|
3159
|
+
let [y, b] = U(v), x = g.state === "exiting" ? d : p, S = p === l.length - 1, C = l[x], w;
|
|
3160
|
+
e[4] === r ? w = e[5] : (w = (e) => u(Ea(r, e)), e[4] = r, e[5] = w);
|
|
3161
|
+
let T;
|
|
3162
|
+
e[6] === Symbol.for("react.memo_cache_sentinel") ? (T = () => {
|
|
3163
|
+
b([]), m(0), _({
|
|
3164
|
+
state: "exiting",
|
|
3165
|
+
direction: "next"
|
|
3166
|
+
});
|
|
3167
|
+
}, e[6] = T) : T = e[6];
|
|
3168
|
+
let E;
|
|
3169
|
+
e[7] !== p || e[8] !== l ? (E = (e) => {
|
|
3170
|
+
b(e);
|
|
3171
|
+
let t = l.findIndex((t) => e.some((e) => e.param === t.content.key));
|
|
3172
|
+
t !== -1 && t !== p && (m(t), _({
|
|
3173
|
+
state: "exiting",
|
|
3174
|
+
direction: "next"
|
|
3175
|
+
}));
|
|
3176
|
+
}, e[7] = p, e[8] = l, e[9] = E) : E = e[9];
|
|
3177
|
+
let D;
|
|
3178
|
+
e[10] !== r || e[11] !== w || e[12] !== E ? (D = {
|
|
3179
|
+
schema: r,
|
|
3180
|
+
setFormErrorAfterSubmit: !1,
|
|
3181
|
+
onInit: w,
|
|
3182
|
+
onSubmitSuccess: T,
|
|
3183
|
+
onSubmitError: E
|
|
3184
|
+
}, e[10] = r, e[11] = w, e[12] = E, e[13] = D) : D = e[13];
|
|
3185
|
+
let { methods: k, submitToRemote: A, appendFormValues: j, handleContentId: M, isError: N, allFormValues: P, contentId: F, publishedId: I, isLoading: L, showSuccessOverlay: R, dismissSuccessOverlay: z } = Ci(D), { handleSubmit: V, setFocus: H, setError: W, formState: q } = k, { isSubmitting: J } = q, Y;
|
|
3186
|
+
e[14] !== j || e[15] !== C?.content?.key || e[16] !== C?.id || e[17] !== r || e[18] !== A ? (Y = async (e) => {
|
|
3187
|
+
b((e) => e.filter((e) => e?.param !== C?.content?.key));
|
|
3188
|
+
let t = Ea(r, e), n = t.findIndex((e) => e.id === C?.id);
|
|
3189
|
+
n !== -1 && n + 1 < t.length ? (u(t), j(e), m(n + 1), _({
|
|
3190
|
+
state: "exiting",
|
|
3191
|
+
direction: "next"
|
|
3192
|
+
})) : await A(e);
|
|
3193
|
+
}, e[14] = j, e[15] = C?.content?.key, e[16] = C?.id, e[17] = r, e[18] = A, e[19] = Y) : Y = e[19];
|
|
3194
|
+
let X;
|
|
3195
|
+
e[20] !== V || e[21] !== Y ? (X = V(Y), e[20] = V, e[21] = Y, e[22] = X) : X = e[22];
|
|
3196
|
+
let ee = X, te;
|
|
3197
|
+
e[23] !== g.state || e[24] !== p ? (te = () => {
|
|
3198
|
+
g.state === "entered" && (p <= 0 || (m(Oa), _({
|
|
3199
|
+
state: "exiting",
|
|
3200
|
+
direction: "prev"
|
|
3201
|
+
})));
|
|
3202
|
+
}, e[23] = g.state, e[24] = p, e[25] = te) : te = e[25];
|
|
3203
|
+
let ne = te, re;
|
|
3204
|
+
e[26] !== g.direction || e[27] !== g.state || e[28] !== C || e[29] !== p || e[30] !== H ? (re = () => {
|
|
3205
|
+
g.state === "exiting" ? (f(p), _({
|
|
3206
|
+
state: "entering",
|
|
3207
|
+
direction: g.direction
|
|
3208
|
+
})) : g.state === "entering" && (_({
|
|
3209
|
+
state: "entered",
|
|
3210
|
+
direction: g.direction
|
|
3211
|
+
}), C?.content?.key && H(C.content.key));
|
|
3212
|
+
}, e[26] = g.direction, e[27] = g.state, e[28] = C, e[29] = p, e[30] = H, e[31] = re) : re = e[31];
|
|
3213
|
+
let ie = re, oe, Q;
|
|
3214
|
+
if (e[32] !== C || e[33] !== y || e[34] !== W ? (oe = () => {
|
|
3215
|
+
if (C && y?.length > 0) {
|
|
3216
|
+
let e = y?.find((e) => e?.param === C?.content?.key);
|
|
3217
|
+
e && W(e?.param, {
|
|
3218
|
+
type: "server_error",
|
|
3219
|
+
message: e?.message
|
|
3220
|
+
});
|
|
3221
|
+
}
|
|
3222
|
+
}, Q = [
|
|
3223
|
+
C,
|
|
3224
|
+
y,
|
|
3225
|
+
W
|
|
3226
|
+
], e[32] = C, e[33] = y, e[34] = W, e[35] = oe, e[36] = Q) : (oe = e[35], Q = e[36]), B(oe, Q), !r || l.length === 0) return null;
|
|
3227
|
+
if (R) {
|
|
3228
|
+
let t;
|
|
3229
|
+
return e[37] === z ? t = e[38] : (t = /* @__PURE__ */ G(ca, { onDismiss: z }), e[37] = z, e[38] = t), t;
|
|
3230
|
+
}
|
|
3231
|
+
let se = J || L, ce = F || "", le = I || "", ue;
|
|
3232
|
+
e[39] !== P || e[40] !== M || e[41] !== N || e[42] !== ce || e[43] !== le ? (ue = /* @__PURE__ */ G(la, {
|
|
3233
|
+
getContentId: M,
|
|
3234
|
+
isError: N,
|
|
3235
|
+
contentId: ce,
|
|
3236
|
+
publishedId: le,
|
|
3237
|
+
allFormValues: P
|
|
3238
|
+
}), e[39] = P, e[40] = M, e[41] = N, e[42] = ce, e[43] = le, e[44] = ue) : ue = e[44];
|
|
3239
|
+
let de;
|
|
3240
|
+
e[45] === Symbol.for("react.memo_cache_sentinel") ? (de = /* @__PURE__ */ G(Xi, { className: Ta }), e[45] = de) : de = e[45];
|
|
3241
|
+
let pe = C?.sectionLabel, me;
|
|
3242
|
+
e[46] === pe ? me = e[47] : (me = /* @__PURE__ */ G(Qi, {
|
|
3243
|
+
className: wa,
|
|
3244
|
+
children: pe
|
|
3245
|
+
}), e[46] = pe, e[47] = me);
|
|
3246
|
+
let he = l?.length || 1, ge = Array.isArray(y) && y?.length > 0, _e;
|
|
3247
|
+
e[48] !== p || e[49] !== he || e[50] !== ge ? (_e = /* @__PURE__ */ G(xa, {
|
|
3248
|
+
currentStepIndex: p,
|
|
3249
|
+
totalSteps: he,
|
|
3250
|
+
hasLevoErrors: ge
|
|
3251
|
+
}), e[48] = p, e[49] = he, e[50] = ge, e[51] = _e) : _e = e[51];
|
|
3252
|
+
let ve;
|
|
3253
|
+
e[52] !== me || e[53] !== _e ? (ve = /* @__PURE__ */ K("div", {
|
|
3254
|
+
className: Sa,
|
|
3255
|
+
children: [
|
|
3256
|
+
de,
|
|
3257
|
+
me,
|
|
3258
|
+
_e
|
|
3259
|
+
]
|
|
3260
|
+
}), e[52] = me, e[53] = _e, e[54] = ve) : ve = e[54];
|
|
3261
|
+
let ye;
|
|
3262
|
+
e[55] === o ? ye = e[56] : (ye = Z(Ca, o), e[55] = o, e[56] = ye);
|
|
3263
|
+
let be;
|
|
3264
|
+
e[57] !== g.direction || e[58] !== g.state || e[59] !== C || e[60] !== t || e[61] !== s || e[62] !== ie || e[63] !== ne || e[64] !== se || e[65] !== S || e[66] !== p || e[67] !== ee || e[68] !== r || e[69] !== a?.show || e[70] !== a?.styles || e[71] !== a?.text || e[72] !== i ? (be = C && /* @__PURE__ */ G("div", {
|
|
3265
|
+
className: "_1ypxmcv6",
|
|
3266
|
+
"data-state": g.state,
|
|
3267
|
+
"data-direction": g.direction,
|
|
3268
|
+
onAnimationEnd: ie,
|
|
3269
|
+
children: /* @__PURE__ */ K("form", {
|
|
3270
|
+
onSubmit: ee,
|
|
3271
|
+
className: "_1ypxmcv7",
|
|
3272
|
+
children: [
|
|
3273
|
+
/* @__PURE__ */ G(Xr, {
|
|
3274
|
+
field: C.content,
|
|
3275
|
+
schema: r,
|
|
3276
|
+
widgets: i,
|
|
3277
|
+
settings: { enableVerification: s }
|
|
3278
|
+
}),
|
|
3279
|
+
!t && S && /* @__PURE__ */ G(Vi, {}),
|
|
3280
|
+
/* @__PURE__ */ K("div", {
|
|
3281
|
+
className: "_1ypxmcv8",
|
|
3282
|
+
children: [/* @__PURE__ */ G("div", { className: "_1ypxmcv9" }), /* @__PURE__ */ K("div", {
|
|
3283
|
+
className: "_1ypxmcva",
|
|
3284
|
+
children: [/* @__PURE__ */ K(n, {
|
|
3285
|
+
type: "button",
|
|
3286
|
+
onClick: ne,
|
|
3287
|
+
size: "lg",
|
|
3288
|
+
disabled: p === 0 || se || g.state !== "entered",
|
|
3289
|
+
variant: "ghost",
|
|
3290
|
+
children: [/* @__PURE__ */ G(fe, {
|
|
3291
|
+
size: 18,
|
|
3292
|
+
className: "mr-2"
|
|
3293
|
+
}), "Prev"]
|
|
3294
|
+
}), (!S || a?.show !== !1) && /* @__PURE__ */ G(n, {
|
|
3295
|
+
type: "submit",
|
|
3296
|
+
size: "lg",
|
|
3297
|
+
className: a?.styles,
|
|
3298
|
+
disabled: se || g.state !== "entered",
|
|
3299
|
+
children: se ? "Saving..." : S ? a?.text || "Submit" : "Next"
|
|
3300
|
+
})]
|
|
3301
|
+
})]
|
|
3302
|
+
})
|
|
3303
|
+
]
|
|
3304
|
+
})
|
|
3305
|
+
}, C.id), e[57] = g.direction, e[58] = g.state, e[59] = C, e[60] = t, e[61] = s, e[62] = ie, e[63] = ne, e[64] = se, e[65] = S, e[66] = p, e[67] = ee, e[68] = r, e[69] = a?.show, e[70] = a?.styles, e[71] = a?.text, e[72] = i, e[73] = be) : be = e[73];
|
|
3306
|
+
let xe;
|
|
3307
|
+
e[74] !== ye || e[75] !== be ? (xe = /* @__PURE__ */ G("div", {
|
|
3308
|
+
className: ye,
|
|
3309
|
+
children: be
|
|
3310
|
+
}), e[74] = ye, e[75] = be, e[76] = xe) : xe = e[76];
|
|
3311
|
+
let Se;
|
|
3312
|
+
return e[77] !== k || e[78] !== ue || e[79] !== ve || e[80] !== xe ? (Se = /* @__PURE__ */ K(ae, {
|
|
3313
|
+
...k,
|
|
3314
|
+
children: [
|
|
3315
|
+
ue,
|
|
3316
|
+
ve,
|
|
3317
|
+
xe
|
|
3318
|
+
]
|
|
3319
|
+
}), e[77] = k, e[78] = ue, e[79] = ve, e[80] = xe, e[81] = Se) : Se = e[81], Se;
|
|
3320
|
+
};
|
|
3321
|
+
function Oa(e) {
|
|
3322
|
+
return Math.max(e - 1, 0);
|
|
3323
|
+
}
|
|
3324
|
+
//#endregion
|
|
3325
|
+
//#region ../../libraries/react-collection/dist/lib/variants/StepFormVariant2/StepFormVariant2.cssm.js
|
|
3326
|
+
var ka = "zlgzzn0", Aa = "zlgzzn1", ja = "zlgzznb", Ma = "zlgzznc", Na = (e, t) => e?.sections ? e.sections.filter((n) => lt(e, n.fields || [], t)) : [], Pa = () => {
|
|
3327
|
+
let e = O(99), { disableCaptcha: t, schema: r, widgets: i, submitButtonConfig: a, containerStyles: o, enableVerification: s } = _i(), c;
|
|
3328
|
+
e[0] === r ? c = e[1] : (c = () => Na(r, {}), e[0] = r, e[1] = c);
|
|
3329
|
+
let [l, u] = U(c), [d, f] = U(0), [p, m] = U(0), h;
|
|
3330
|
+
e[2] === Symbol.for("react.memo_cache_sentinel") ? (h = {
|
|
3331
|
+
state: "entered",
|
|
3332
|
+
direction: "next"
|
|
3333
|
+
}, e[2] = h) : h = e[2];
|
|
3334
|
+
let [g, _] = U(h), v;
|
|
3335
|
+
e[3] === Symbol.for("react.memo_cache_sentinel") ? (v = [], e[3] = v) : v = e[3];
|
|
3336
|
+
let [y, b] = U(v), x = g.state === "exiting" ? d : p, S = l[x], C = p === l.length - 1, w;
|
|
3337
|
+
bb0: {
|
|
3338
|
+
if (r) {
|
|
3339
|
+
let t;
|
|
3340
|
+
if (e[4] !== S || e[5] !== r) {
|
|
3341
|
+
if (t = { ...r }, S && t) {
|
|
3342
|
+
let n;
|
|
3343
|
+
e[7] === S ? n = e[8] : (n = [S], e[7] = S, e[8] = n), t.sections = n;
|
|
3344
|
+
}
|
|
3345
|
+
e[4] = S, e[5] = r, e[6] = t;
|
|
3346
|
+
} else t = e[6];
|
|
3347
|
+
w = t;
|
|
3348
|
+
break bb0;
|
|
3349
|
+
}
|
|
3350
|
+
w = null;
|
|
3351
|
+
}
|
|
3352
|
+
let T = w, E;
|
|
3353
|
+
e[9] === r ? E = e[10] : (E = (e) => u(Na(r, e)), e[9] = r, e[10] = E);
|
|
3354
|
+
let D;
|
|
3355
|
+
e[11] === Symbol.for("react.memo_cache_sentinel") ? (D = () => {
|
|
3356
|
+
b([]), m(0), _({
|
|
3357
|
+
state: "exiting",
|
|
3358
|
+
direction: "next"
|
|
3359
|
+
});
|
|
3360
|
+
}, e[11] = D) : D = e[11];
|
|
3361
|
+
let k;
|
|
3362
|
+
e[12] !== p || e[13] !== l ? (k = (e) => {
|
|
3363
|
+
if (b(e), Array.isArray(e) && e.length > 0) {
|
|
3364
|
+
let t = l.findIndex((t) => t.fields?.some((t) => e.some((e) => e.param === t.key)));
|
|
3365
|
+
t !== -1 && t !== p && (m(t), _({
|
|
3366
|
+
state: "exiting",
|
|
3367
|
+
direction: "next"
|
|
3368
|
+
}));
|
|
3369
|
+
}
|
|
3370
|
+
}, e[12] = p, e[13] = l, e[14] = k) : k = e[14];
|
|
3371
|
+
let A;
|
|
3372
|
+
e[15] !== r || e[16] !== T || e[17] !== E || e[18] !== k ? (A = {
|
|
3373
|
+
schema: T,
|
|
3374
|
+
originalSchema: r,
|
|
3375
|
+
setFormErrorAfterSubmit: !1,
|
|
3376
|
+
onInit: E,
|
|
3377
|
+
onSubmitSuccess: D,
|
|
3378
|
+
onSubmitError: k
|
|
3379
|
+
}, e[15] = r, e[16] = T, e[17] = E, e[18] = k, e[19] = A) : A = e[19];
|
|
3380
|
+
let { methods: j, submitToRemote: M, appendFormValues: N, handleContentId: P, isError: F, allFormValues: I, contentId: L, publishedId: R, isLoading: z, showSuccessOverlay: V, dismissSuccessOverlay: H } = Ci(A), { handleSubmit: W, setFocus: q, setError: J, watch: Y, formState: X } = j, { isSubmitting: ee } = X, te;
|
|
3381
|
+
e[20] === Y ? te = e[21] : (te = Y("__captcha"), e[20] = Y, e[21] = te);
|
|
3382
|
+
let ne = te, re;
|
|
3383
|
+
e[22] !== I || e[23] !== g.state || e[24] !== N || e[25] !== S?.fields || e[26] !== p || e[27] !== r || e[28] !== M ? (re = async (e) => {
|
|
3384
|
+
b((e) => {
|
|
3385
|
+
let t = S?.fields?.map(Fa) || [];
|
|
3386
|
+
return e.filter((e) => !t.includes(e.param));
|
|
3387
|
+
});
|
|
3388
|
+
let t = Na(r, {
|
|
3389
|
+
...I || {},
|
|
3390
|
+
...e
|
|
3391
|
+
});
|
|
3392
|
+
p >= t.length - 1 ? await M(e) : (N(e), u(t), g.state === "entered" && (m(Math.min(p + 1, t.length - 1)), _({
|
|
3393
|
+
state: "exiting",
|
|
3394
|
+
direction: "next"
|
|
3395
|
+
})));
|
|
3396
|
+
}, e[22] = I, e[23] = g.state, e[24] = N, e[25] = S?.fields, e[26] = p, e[27] = r, e[28] = M, e[29] = re) : re = e[29];
|
|
3397
|
+
let ie;
|
|
3398
|
+
e[30] !== W || e[31] !== re ? (ie = W(re), e[30] = W, e[31] = re, e[32] = ie) : ie = e[32];
|
|
3399
|
+
let oe = ie, Q;
|
|
3400
|
+
e[33] !== g.state || e[34] !== p ? (Q = () => {
|
|
3401
|
+
g.state === "entered" && (p <= 0 || (m(Ia), _({
|
|
3402
|
+
state: "exiting",
|
|
3403
|
+
direction: "prev"
|
|
3404
|
+
})));
|
|
3405
|
+
}, e[33] = g.state, e[34] = p, e[35] = Q) : Q = e[35];
|
|
3406
|
+
let se = Q, ce;
|
|
3407
|
+
e[36] !== g.direction || e[37] !== g.state || e[38] !== S || e[39] !== p || e[40] !== q ? (ce = () => {
|
|
3408
|
+
g.state === "exiting" ? (f(p), _({
|
|
3409
|
+
state: "entering",
|
|
3410
|
+
direction: g.direction
|
|
3411
|
+
})) : g.state === "entering" && (_({
|
|
3412
|
+
state: "entered",
|
|
3413
|
+
direction: g.direction
|
|
3414
|
+
}), S?.fields?.[0]?.key && q(S.fields[0].key));
|
|
3415
|
+
}, e[36] = g.direction, e[37] = g.state, e[38] = S, e[39] = p, e[40] = q, e[41] = ce) : ce = e[41];
|
|
3416
|
+
let le = ce, ue;
|
|
3417
|
+
e[42] !== g.state || e[43] !== S || e[44] !== y || e[45] !== J ? (ue = () => {
|
|
3418
|
+
y?.length > 0 && S?.fields && g?.state === "entered" && y.forEach((e) => {
|
|
3419
|
+
S.fields?.some((t) => t.key === e.param) && J(e?.param, {
|
|
3420
|
+
type: "server_error",
|
|
3421
|
+
message: e?.message
|
|
3422
|
+
});
|
|
3423
|
+
});
|
|
3424
|
+
}, e[42] = g.state, e[43] = S, e[44] = y, e[45] = J, e[46] = ue) : ue = e[46];
|
|
3425
|
+
let de;
|
|
3426
|
+
if (e[47] !== g || e[48] !== S || e[49] !== y || e[50] !== J ? (de = [
|
|
3427
|
+
y,
|
|
3428
|
+
J,
|
|
3429
|
+
S,
|
|
3430
|
+
g
|
|
3431
|
+
], e[47] = g, e[48] = S, e[49] = y, e[50] = J, e[51] = de) : de = e[51], B(ue, de), !r || l.length === 0) return null;
|
|
3432
|
+
if (V) {
|
|
3433
|
+
let t;
|
|
3434
|
+
return e[52] === H ? t = e[53] : (t = /* @__PURE__ */ G(ca, { onDismiss: H }), e[52] = H, e[53] = t), t;
|
|
3435
|
+
}
|
|
3436
|
+
let pe = ee || z || ne === "verifying" && C, me = L || "", he = R || "", ge;
|
|
3437
|
+
e[54] !== I || e[55] !== P || e[56] !== F || e[57] !== me || e[58] !== he ? (ge = /* @__PURE__ */ G(la, {
|
|
3438
|
+
getContentId: P,
|
|
3439
|
+
isError: F,
|
|
3440
|
+
contentId: me,
|
|
3441
|
+
publishedId: he,
|
|
3442
|
+
allFormValues: I
|
|
3443
|
+
}), e[54] = I, e[55] = P, e[56] = F, e[57] = me, e[58] = he, e[59] = ge) : ge = e[59];
|
|
3444
|
+
let _e;
|
|
3445
|
+
e[60] === Symbol.for("react.memo_cache_sentinel") ? (_e = /* @__PURE__ */ G(Xi, { className: Ma }), e[60] = _e) : _e = e[60];
|
|
3446
|
+
let ve = S?.label, ye;
|
|
3447
|
+
e[61] === ve ? ye = e[62] : (ye = /* @__PURE__ */ G(Qi, {
|
|
3448
|
+
className: ja,
|
|
3449
|
+
children: ve
|
|
3450
|
+
}), e[61] = ve, e[62] = ye);
|
|
3451
|
+
let be = l?.length || 1, xe = Array.isArray(y) && y?.length > 0, Se;
|
|
3452
|
+
e[63] !== p || e[64] !== be || e[65] !== xe ? (Se = /* @__PURE__ */ G(xa, {
|
|
3453
|
+
currentStepIndex: p,
|
|
3454
|
+
totalSteps: be,
|
|
3455
|
+
hasLevoErrors: xe
|
|
3456
|
+
}), e[63] = p, e[64] = be, e[65] = xe, e[66] = Se) : Se = e[66];
|
|
3457
|
+
let Ce;
|
|
3458
|
+
e[67] !== ye || e[68] !== Se ? (Ce = /* @__PURE__ */ K("div", {
|
|
3459
|
+
className: ka,
|
|
3460
|
+
children: [
|
|
3461
|
+
_e,
|
|
3462
|
+
ye,
|
|
3463
|
+
Se
|
|
3464
|
+
]
|
|
3465
|
+
}), e[67] = ye, e[68] = Se, e[69] = Ce) : Ce = e[69];
|
|
3466
|
+
let we;
|
|
3467
|
+
e[70] === o ? we = e[71] : (we = Z(Aa, o), e[70] = o, e[71] = we);
|
|
3468
|
+
let Te;
|
|
3469
|
+
e[72] !== g.direction || e[73] !== g.state || e[74] !== ne || e[75] !== S || e[76] !== t || e[77] !== x || e[78] !== s || e[79] !== le || e[80] !== se || e[81] !== pe || e[82] !== C || e[83] !== p || e[84] !== oe || e[85] !== r || e[86] !== a?.show || e[87] !== a?.styles || e[88] !== a?.text || e[89] !== i ? (Te = S && /* @__PURE__ */ G("div", {
|
|
3470
|
+
className: "zlgzzn6",
|
|
3471
|
+
"data-state": g.state,
|
|
3472
|
+
"data-direction": g.direction,
|
|
3473
|
+
onAnimationEnd: le,
|
|
3474
|
+
children: /* @__PURE__ */ K("form", {
|
|
3475
|
+
onSubmit: oe,
|
|
3476
|
+
className: "zlgzzn7",
|
|
3477
|
+
children: [
|
|
3478
|
+
S.fields?.map((e) => e.hidden ? null : /* @__PURE__ */ G(Xr, {
|
|
3479
|
+
field: e,
|
|
3480
|
+
schema: r,
|
|
3481
|
+
widgets: i,
|
|
3482
|
+
settings: { enableVerification: s }
|
|
3483
|
+
}, e.key)),
|
|
3484
|
+
!t && C && /* @__PURE__ */ G(Vi, {}),
|
|
3485
|
+
/* @__PURE__ */ K("div", {
|
|
3486
|
+
className: "zlgzzn8",
|
|
3487
|
+
children: [/* @__PURE__ */ G("div", { className: "zlgzzn9" }), /* @__PURE__ */ K("div", {
|
|
3488
|
+
className: "zlgzzna",
|
|
3489
|
+
children: [/* @__PURE__ */ K(n, {
|
|
3490
|
+
type: "button",
|
|
3491
|
+
onClick: se,
|
|
3492
|
+
size: "lg",
|
|
3493
|
+
disabled: p === 0 || pe || g.state !== "entered",
|
|
3494
|
+
variant: "ghost",
|
|
3495
|
+
children: [/* @__PURE__ */ G(fe, {
|
|
3496
|
+
size: 18,
|
|
3497
|
+
className: "mr-2"
|
|
3498
|
+
}), "Prev"]
|
|
3499
|
+
}), (!C || a?.show !== !1) && /* @__PURE__ */ G(n, {
|
|
3500
|
+
type: "submit",
|
|
3501
|
+
size: "lg",
|
|
3502
|
+
className: a?.styles,
|
|
3503
|
+
disabled: pe || g.state !== "entered",
|
|
3504
|
+
children: pe ? ne === "verifying" ? "Verifying..." : "Saving..." : C ? a?.text || "Save" : "Next"
|
|
3505
|
+
})]
|
|
3506
|
+
})]
|
|
3507
|
+
})
|
|
3508
|
+
]
|
|
3509
|
+
})
|
|
3510
|
+
}, S.id || x), e[72] = g.direction, e[73] = g.state, e[74] = ne, e[75] = S, e[76] = t, e[77] = x, e[78] = s, e[79] = le, e[80] = se, e[81] = pe, e[82] = C, e[83] = p, e[84] = oe, e[85] = r, e[86] = a?.show, e[87] = a?.styles, e[88] = a?.text, e[89] = i, e[90] = Te) : Te = e[90];
|
|
3511
|
+
let Ee;
|
|
3512
|
+
e[91] !== we || e[92] !== Te ? (Ee = /* @__PURE__ */ G("div", {
|
|
3513
|
+
className: we,
|
|
3514
|
+
children: Te
|
|
3515
|
+
}), e[91] = we, e[92] = Te, e[93] = Ee) : Ee = e[93];
|
|
3516
|
+
let De;
|
|
3517
|
+
return e[94] !== j || e[95] !== ge || e[96] !== Ce || e[97] !== Ee ? (De = /* @__PURE__ */ K(ae, {
|
|
3518
|
+
...j,
|
|
3519
|
+
children: [
|
|
3520
|
+
ge,
|
|
3521
|
+
Ce,
|
|
3522
|
+
Ee
|
|
3523
|
+
]
|
|
3524
|
+
}), e[94] = j, e[95] = ge, e[96] = Ce, e[97] = Ee, e[98] = De) : De = e[98], De;
|
|
3525
|
+
};
|
|
3526
|
+
function Fa(e) {
|
|
3527
|
+
return e.key;
|
|
3528
|
+
}
|
|
3529
|
+
function Ia(e) {
|
|
3530
|
+
return Math.max(e - 1, 0);
|
|
3531
|
+
}
|
|
3532
|
+
//#endregion
|
|
3533
|
+
//#region ../../libraries/react-collection/dist/lib/variants/StepsFormVariant/StepsFormVariant.cssm.js
|
|
3534
|
+
var La = "_1f3ynb50", Ra = "_1f3ynb54", za = "_1f3ynb55", Ba = (e, t) => e?.sections ? e.sections.filter((n) => lt(e, n.fields || [], t)) : [], Va = () => {
|
|
3535
|
+
let e = O(15), { schema: t, containerStyles: n } = _i(), r;
|
|
3536
|
+
e[0] === t ? r = e[1] : (r = () => Ba(t, {}), e[0] = t, e[1] = r);
|
|
3537
|
+
let [i, a] = U(r), [o, s] = U(0), c;
|
|
3538
|
+
e[2] === Symbol.for("react.memo_cache_sentinel") ? (c = () => {
|
|
3539
|
+
s(Ua);
|
|
3540
|
+
}, e[2] = c) : c = e[2];
|
|
3541
|
+
let l = c, u;
|
|
3542
|
+
e[3] === Symbol.for("react.memo_cache_sentinel") ? (u = () => {
|
|
3543
|
+
s(Wa);
|
|
3544
|
+
}, e[3] = u) : u = e[3];
|
|
3545
|
+
let d = u, f;
|
|
3546
|
+
e[4] === Symbol.for("react.memo_cache_sentinel") ? (f = (e) => {
|
|
3547
|
+
s(e);
|
|
3548
|
+
}, e[4] = f) : f = e[4];
|
|
3549
|
+
let p = f, m;
|
|
3550
|
+
e[5] === t ? m = e[6] : (m = (e) => {
|
|
3551
|
+
a(Ba(t, e)), d();
|
|
3552
|
+
}, e[5] = t, e[6] = m);
|
|
3553
|
+
let h;
|
|
3554
|
+
e[7] === t ? h = e[8] : (h = (e) => {
|
|
3555
|
+
a(Ba(t, e));
|
|
3556
|
+
}, e[7] = t, e[8] = h);
|
|
3557
|
+
let g;
|
|
3558
|
+
return e[9] !== n || e[10] !== o || e[11] !== m || e[12] !== h || e[13] !== i ? (g = /* @__PURE__ */ G(Ha, {
|
|
3559
|
+
currentSectionIndex: o,
|
|
3560
|
+
visibleSections: i,
|
|
3561
|
+
onAdvanceWithValues: m,
|
|
3562
|
+
handlePrev: l,
|
|
3563
|
+
goToIndex: p,
|
|
3564
|
+
onInit: h,
|
|
3565
|
+
containerStyles: n
|
|
3566
|
+
}), e[9] = n, e[10] = o, e[11] = m, e[12] = h, e[13] = i, e[14] = g) : g = e[14], g;
|
|
3567
|
+
}, Ha = (e) => {
|
|
3568
|
+
let t = O(82), { containerStyles: r, currentSectionIndex: i, visibleSections: a, onAdvanceWithValues: o, handlePrev: s, goToIndex: c, onInit: l } = e, { schema: u, disableCaptcha: d, isDisabled: f, submitButtonConfig: p, widgets: m, enableVerification: h } = _i(), g;
|
|
3569
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (g = [], t[0] = g) : g = t[0];
|
|
3570
|
+
let [_, v] = U(g), y = a?.[i], b;
|
|
3571
|
+
bb0: {
|
|
3572
|
+
if (u) {
|
|
3573
|
+
let e;
|
|
3574
|
+
if (t[1] !== y || t[2] !== u) {
|
|
3575
|
+
if (e = { ...u }, y && e) {
|
|
3576
|
+
let n;
|
|
3577
|
+
t[4] === y ? n = t[5] : (n = [y], t[4] = y, t[5] = n), e.sections = n;
|
|
3578
|
+
}
|
|
3579
|
+
t[1] = y, t[2] = u, t[3] = e;
|
|
3580
|
+
} else e = t[3];
|
|
3581
|
+
b = e;
|
|
3582
|
+
break bb0;
|
|
3583
|
+
}
|
|
3584
|
+
b = null;
|
|
3585
|
+
}
|
|
3586
|
+
let x = b, S = i === Number(a?.length) - 1, C;
|
|
3587
|
+
t[6] === c ? C = t[7] : (C = () => {
|
|
3588
|
+
v([]), c(0);
|
|
3589
|
+
}, t[6] = c, t[7] = C);
|
|
3590
|
+
let w;
|
|
3591
|
+
t[8] !== c || t[9] !== a ? (w = (e) => {
|
|
3592
|
+
if (v(e), Array.isArray(e) && e.length > 0) {
|
|
3593
|
+
let t = a.findIndex((t) => t.fields?.some((t) => e.some((e) => e.param === t.key)));
|
|
3594
|
+
t !== -1 && c(t);
|
|
3595
|
+
}
|
|
3596
|
+
}, t[8] = c, t[9] = a, t[10] = w) : w = t[10];
|
|
3597
|
+
let T;
|
|
3598
|
+
t[11] !== l || t[12] !== u || t[13] !== x || t[14] !== C || t[15] !== w ? (T = {
|
|
3599
|
+
schema: x,
|
|
3600
|
+
originalSchema: u,
|
|
3601
|
+
setFormErrorAfterSubmit: !1,
|
|
3602
|
+
onInit: l,
|
|
3603
|
+
onSubmitSuccess: C,
|
|
3604
|
+
onSubmitError: w
|
|
3605
|
+
}, t[11] = l, t[12] = u, t[13] = x, t[14] = C, t[15] = w, t[16] = T) : T = t[16];
|
|
3606
|
+
let { methods: E, submitToRemote: D, appendFormValues: k, isLoading: A, handleContentId: j, isError: M, contentId: N, publishedId: P, allFormValues: F, showSuccessOverlay: I, dismissSuccessOverlay: L } = Ci(T), { handleSubmit: R, setError: z, watch: V, formState: H } = E, { isSubmitting: W } = H, q;
|
|
3607
|
+
t[17] === V ? q = t[18] : (q = V("__captcha"), t[17] = V, t[18] = q);
|
|
3608
|
+
let J = q, Y;
|
|
3609
|
+
t[19] !== F || t[20] !== k || t[21] !== y?.fields || t[22] !== i || t[23] !== o || t[24] !== u || t[25] !== D ? (Y = async (e) => {
|
|
3610
|
+
v((e) => {
|
|
3611
|
+
let t = y?.fields?.map(Ga) || [];
|
|
3612
|
+
return e.filter((e) => !t.includes(e.param));
|
|
3613
|
+
});
|
|
3614
|
+
let t = {
|
|
3615
|
+
...F || {},
|
|
3616
|
+
...e
|
|
3617
|
+
};
|
|
3618
|
+
i >= Ba(u, t).length - 1 ? await D(e) : (k(e), o(t));
|
|
3619
|
+
}, t[19] = F, t[20] = k, t[21] = y?.fields, t[22] = i, t[23] = o, t[24] = u, t[25] = D, t[26] = Y) : Y = t[26];
|
|
3620
|
+
let X;
|
|
3621
|
+
t[27] !== R || t[28] !== Y ? (X = R(Y), t[27] = R, t[28] = Y, t[29] = X) : X = t[29];
|
|
3622
|
+
let ee = X, te, ne;
|
|
3623
|
+
if (t[30] !== y || t[31] !== _ || t[32] !== z ? (ne = () => {
|
|
3624
|
+
_?.length > 0 && y?.fields && _.forEach((e) => {
|
|
3625
|
+
y.fields?.some((t) => t.key === e.param) && z(e?.param, {
|
|
3626
|
+
type: "server_error",
|
|
3627
|
+
message: e?.message
|
|
3628
|
+
});
|
|
3629
|
+
});
|
|
3630
|
+
}, te = [
|
|
3631
|
+
_,
|
|
3632
|
+
z,
|
|
3633
|
+
y
|
|
3634
|
+
], t[30] = y, t[31] = _, t[32] = z, t[33] = te, t[34] = ne) : (te = t[33], ne = t[34]), B(ne, te), I) {
|
|
3635
|
+
let e;
|
|
3636
|
+
return t[35] === L ? e = t[36] : (e = /* @__PURE__ */ G(ca, { onDismiss: L }), t[35] = L, t[36] = e), e;
|
|
3637
|
+
}
|
|
3638
|
+
let re = W || J === "verifying" && S, ie = N || "", oe = P || "", Q;
|
|
3639
|
+
t[37] !== F || t[38] !== j || t[39] !== M || t[40] !== ie || t[41] !== oe ? (Q = /* @__PURE__ */ G(la, {
|
|
3640
|
+
getContentId: j,
|
|
3641
|
+
isError: M,
|
|
3642
|
+
contentId: ie,
|
|
3643
|
+
publishedId: oe,
|
|
3644
|
+
allFormValues: F
|
|
3645
|
+
}), t[37] = F, t[38] = j, t[39] = M, t[40] = ie, t[41] = oe, t[42] = Q) : Q = t[42];
|
|
3646
|
+
let se = A && "_1f3ynb51", ce;
|
|
3647
|
+
t[43] !== r || t[44] !== se ? (ce = Z(La, r, se), t[43] = r, t[44] = se, t[45] = ce) : ce = t[45];
|
|
3648
|
+
let le;
|
|
3649
|
+
t[46] === Symbol.for("react.memo_cache_sentinel") ? (le = /* @__PURE__ */ G(Xi, {}), t[46] = le) : le = t[46];
|
|
3650
|
+
let ue = y?.label || "Details", de;
|
|
3651
|
+
t[47] === ue ? de = t[48] : (de = /* @__PURE__ */ G(Qi, { children: /* @__PURE__ */ G("span", { children: ue }) }), t[47] = ue, t[48] = de);
|
|
3652
|
+
let fe;
|
|
3653
|
+
t[49] !== y?.fields || t[50] !== h || t[51] !== u || t[52] !== m ? (fe = y?.fields?.map((e) => e && !e.hidden ? /* @__PURE__ */ G(Xr, {
|
|
3654
|
+
field: e,
|
|
3655
|
+
widgets: m,
|
|
3656
|
+
schema: u,
|
|
3657
|
+
settings: { enableVerification: h }
|
|
3658
|
+
}, e?.key) : null), t[49] = y?.fields, t[50] = h, t[51] = u, t[52] = m, t[53] = fe) : fe = t[53];
|
|
3659
|
+
let pe;
|
|
3660
|
+
t[54] !== d || t[55] !== S ? (pe = !d && S && /* @__PURE__ */ G(Vi, {}), t[54] = d, t[55] = S, t[56] = pe) : pe = t[56];
|
|
3661
|
+
let me;
|
|
3662
|
+
t[57] !== J || t[58] !== i || t[59] !== s || t[60] !== S ? (me = i === 0 ? /* @__PURE__ */ G("div", {}) : /* @__PURE__ */ G(n, {
|
|
3663
|
+
type: "button",
|
|
3664
|
+
size: "sm",
|
|
3665
|
+
variant: "secondary",
|
|
3666
|
+
disabled: J === "verifying" && S,
|
|
3667
|
+
onClick: () => {
|
|
3668
|
+
s();
|
|
3669
|
+
},
|
|
3670
|
+
children: "Prev"
|
|
3671
|
+
}), t[57] = J, t[58] = i, t[59] = s, t[60] = S, t[61] = me) : me = t[61];
|
|
3672
|
+
let he = f || re, ge = p?.styles, _e = re ? J === "verifying" ? "Verifying..." : "Saving..." : S ? p?.text || "Save" : "Next", ve;
|
|
3673
|
+
t[62] !== he || t[63] !== ge || t[64] !== _e ? (ve = /* @__PURE__ */ G(n, {
|
|
3674
|
+
type: "submit",
|
|
3675
|
+
size: "sm",
|
|
3676
|
+
disabled: he,
|
|
3677
|
+
className: ge,
|
|
3678
|
+
children: _e
|
|
3679
|
+
}), t[62] = he, t[63] = ge, t[64] = _e, t[65] = ve) : ve = t[65];
|
|
3680
|
+
let ye;
|
|
3681
|
+
t[66] !== me || t[67] !== ve ? (ye = /* @__PURE__ */ K("div", {
|
|
3682
|
+
className: Ra,
|
|
3683
|
+
children: [me, ve]
|
|
3684
|
+
}), t[66] = me, t[67] = ve, t[68] = ye) : ye = t[68];
|
|
3685
|
+
let be;
|
|
3686
|
+
t[69] !== fe || t[70] !== pe || t[71] !== ye ? (be = /* @__PURE__ */ K("div", {
|
|
3687
|
+
className: za,
|
|
3688
|
+
children: [
|
|
3689
|
+
fe,
|
|
3690
|
+
pe,
|
|
3691
|
+
ye
|
|
3692
|
+
]
|
|
3693
|
+
}), t[69] = fe, t[70] = pe, t[71] = ye, t[72] = be) : be = t[72];
|
|
3694
|
+
let xe;
|
|
3695
|
+
t[73] !== ee || t[74] !== ce || t[75] !== de || t[76] !== be ? (xe = /* @__PURE__ */ K("form", {
|
|
3696
|
+
className: ce,
|
|
3697
|
+
id: "collection-form",
|
|
3698
|
+
onSubmit: ee,
|
|
3699
|
+
children: [
|
|
3700
|
+
le,
|
|
3701
|
+
de,
|
|
3702
|
+
be
|
|
3703
|
+
]
|
|
3704
|
+
}), t[73] = ee, t[74] = ce, t[75] = de, t[76] = be, t[77] = xe) : xe = t[77];
|
|
3705
|
+
let Se;
|
|
3706
|
+
return t[78] !== E || t[79] !== Q || t[80] !== xe ? (Se = /* @__PURE__ */ K(ae, {
|
|
3707
|
+
...E,
|
|
3708
|
+
children: [Q, xe]
|
|
3709
|
+
}), t[78] = E, t[79] = Q, t[80] = xe, t[81] = Se) : Se = t[81], Se;
|
|
3710
|
+
};
|
|
3711
|
+
function Ua(e) {
|
|
3712
|
+
return Math.max(e - 1, 0);
|
|
3713
|
+
}
|
|
3714
|
+
function Wa(e) {
|
|
3715
|
+
return e + 1;
|
|
3716
|
+
}
|
|
3717
|
+
function Ga(e) {
|
|
3718
|
+
return e.key;
|
|
3719
|
+
}
|
|
3720
|
+
//#endregion
|
|
3721
|
+
//#region ../../libraries/react-collection/dist/lib/FormBuilder/index.js
|
|
3722
|
+
var Ka = (e) => {
|
|
3723
|
+
let t = O(12), n, r, i;
|
|
3724
|
+
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);
|
|
3725
|
+
let a = i === void 0 ? !0 : i, o;
|
|
3726
|
+
t[4] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ G(ki, {}), t[4] = o) : o = t[4];
|
|
3727
|
+
let s;
|
|
3728
|
+
t[5] === n ? s = t[6] : (s = /* @__PURE__ */ G(F, {
|
|
3729
|
+
fallback: o,
|
|
3730
|
+
children: G(n === "single-field" ? Da : n === "steps" ? Va : n === "steps-2" ? Pa : ga, {})
|
|
3731
|
+
}), t[5] = n, t[6] = s);
|
|
3732
|
+
let c;
|
|
3733
|
+
return t[7] !== a || t[8] !== n || t[9] !== r || t[10] !== s ? (c = /* @__PURE__ */ G(gi, {
|
|
3734
|
+
...r,
|
|
3735
|
+
enableVerification: a,
|
|
3736
|
+
variant: n,
|
|
3737
|
+
children: s
|
|
3738
|
+
}), t[7] = a, t[8] = n, t[9] = r, t[10] = s, t[11] = c) : c = t[11], c;
|
|
3739
|
+
}, qa = (e) => {
|
|
3740
|
+
let t = O(17), n, r, i, a;
|
|
3741
|
+
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);
|
|
3742
|
+
let o = a === void 0 ? !0 : a, { collection: s } = M(), [c, l] = U(!0), [u, d] = U(null), f;
|
|
3743
|
+
t[5] !== s || t[6] !== n || t[7] !== r || t[8] !== i ? (f = () => {
|
|
3744
|
+
n ? s?.getCollectionByIDExpanded(n, { headers: { "Levo-Workspace": i.workspace_id } }).then((e) => {
|
|
3745
|
+
let t = e?.content?.data;
|
|
3746
|
+
if (t) d(oi(t, r));
|
|
3747
|
+
else throw Error(`API response invalid: ${t}`);
|
|
3748
|
+
}).catch(Ja).finally(() => {
|
|
3749
|
+
l(!1);
|
|
3750
|
+
}) : (console.error("[CollectionFormBuilder] Collection ID or Workspace ID is missing."), l(!1));
|
|
3751
|
+
}, t[5] = s, t[6] = n, t[7] = r, t[8] = i, t[9] = f) : f = t[9];
|
|
3752
|
+
let p;
|
|
3753
|
+
t[10] === n ? p = t[11] : (p = [n], t[10] = n, t[11] = p), B(f, p);
|
|
3754
|
+
let m;
|
|
3755
|
+
return t[12] !== o || t[13] !== c || t[14] !== i || t[15] !== u ? (m = c ? /* @__PURE__ */ G(ki, {}) : u ? /* @__PURE__ */ G(Ka, {
|
|
3756
|
+
schema: u,
|
|
3757
|
+
enableVerification: o,
|
|
3758
|
+
...i
|
|
3759
|
+
}) : null, t[12] = o, t[13] = c, t[14] = i, t[15] = u, t[16] = m) : m = t[16], m;
|
|
3760
|
+
};
|
|
3761
|
+
function Ja(e) {
|
|
3762
|
+
console.error("Error fetching schema", e);
|
|
3763
|
+
}
|
|
3764
|
+
//#endregion
|
|
3765
|
+
//#region ../../libraries/react-collection/dist/lib/CollectionFormRenderer/CollectionFormRenderer.cssm.js
|
|
3766
|
+
var Ya = "_165z1im3", Xa = "_165z1im4", Za = L(() => import("./BillingStep-ioR7mSo5.js").then((e) => ({ default: e.BillingStep }))), Qa = L(() => import("./BookingCard-DEkBXh7O.js").then((e) => ({ default: e.BookingCard }))), $a = "We couldn't start your booking. Please try again.", eo = ({ hiddenFields: e, fetchedSchema: t, isLoading: n, enableVerification: r = !0, workspace_id: i, workspace_name: a, onBookingComplete: o, onSuccess: s, ...c }) => {
|
|
3767
|
+
let { fetch: l, collection: u, logger: d } = M(), [f, p] = U({ name: "form" }), [m, h] = U(null), [_, v] = U(null), b = V(() => t ? oi(t, e) : null, [t, e]), x = b?.settings?.booking_config ?? {}, S = async (e) => {
|
|
3768
|
+
let t = e?.meta?.booking_config;
|
|
3769
|
+
if (t?.enabled && e?.response?._id && await y({
|
|
3770
|
+
config: {
|
|
3771
|
+
...x,
|
|
3772
|
+
...t
|
|
3773
|
+
},
|
|
3774
|
+
entry: e.response,
|
|
3775
|
+
collection: u
|
|
3776
|
+
})) {
|
|
3777
|
+
v(e), p({
|
|
3778
|
+
name: "billing",
|
|
3779
|
+
entry: e.response
|
|
3780
|
+
});
|
|
3781
|
+
return;
|
|
3782
|
+
}
|
|
3783
|
+
s?.(e);
|
|
3784
|
+
}, C = () => {
|
|
3785
|
+
p({ name: "form" }), h(null), _ && s?.(_), v(null);
|
|
3786
|
+
}, w = async (e) => {
|
|
3787
|
+
if (f.name !== "billing") return;
|
|
3788
|
+
let { entry: t } = f;
|
|
3789
|
+
h(e), p({ name: "creating" });
|
|
3790
|
+
try {
|
|
3791
|
+
let e = (await l?.url("/v1/payment/booking/create")?.options(g(i))?.post({
|
|
3792
|
+
content_id: t._id,
|
|
3793
|
+
collection_key: b?.key
|
|
3794
|
+
}).json())?.content?.data;
|
|
3795
|
+
if (e) {
|
|
3796
|
+
p({
|
|
3797
|
+
name: "card",
|
|
3798
|
+
summary: e
|
|
3799
|
+
});
|
|
3800
|
+
return;
|
|
3801
|
+
}
|
|
3802
|
+
p({
|
|
3803
|
+
name: "billing",
|
|
3804
|
+
entry: t,
|
|
3805
|
+
error: $a
|
|
3806
|
+
});
|
|
3807
|
+
} catch (e) {
|
|
3808
|
+
let n = ee(e);
|
|
3809
|
+
d?.error("Failed to create booking", { exception: n }), p({
|
|
3810
|
+
name: "billing",
|
|
3811
|
+
entry: t,
|
|
3812
|
+
error: n?.message || $a
|
|
3813
|
+
});
|
|
3814
|
+
}
|
|
3815
|
+
}, T = () => {
|
|
3816
|
+
C(), o?.();
|
|
3817
|
+
}, E = (e) => /* @__PURE__ */ G(ii, {
|
|
3818
|
+
...c.theme,
|
|
3819
|
+
children: e
|
|
3820
|
+
});
|
|
3821
|
+
return n ? /* @__PURE__ */ G(ki, {}) : f.name === "creating" ? E(/* @__PURE__ */ G("div", {
|
|
3822
|
+
className: Ya,
|
|
3823
|
+
children: /* @__PURE__ */ G("div", { className: Xa })
|
|
3824
|
+
})) : f.name === "billing" ? E(/* @__PURE__ */ G(F, {
|
|
3825
|
+
fallback: /* @__PURE__ */ G("div", {}),
|
|
3826
|
+
children: /* @__PURE__ */ G(Za, {
|
|
3827
|
+
onSubmit: w,
|
|
3828
|
+
prefillName: m && !m.tax_id ? m.name : f.entry?.name,
|
|
3829
|
+
prefillData: m,
|
|
3830
|
+
error: f.error
|
|
3831
|
+
})
|
|
3832
|
+
})) : f.name === "card" ? E(/* @__PURE__ */ G(F, {
|
|
3833
|
+
fallback: /* @__PURE__ */ G("div", {}),
|
|
3834
|
+
children: /* @__PURE__ */ G(Qa, {
|
|
3835
|
+
summary: f.summary,
|
|
3836
|
+
billingDetails: m,
|
|
3837
|
+
onBillingEdit: h,
|
|
3838
|
+
onComplete: T,
|
|
3839
|
+
workspaceId: i,
|
|
3840
|
+
workspaceName: a
|
|
3841
|
+
})
|
|
3842
|
+
})) : b ? /* @__PURE__ */ G(Ka, {
|
|
3843
|
+
schema: b,
|
|
3844
|
+
enableVerification: r,
|
|
3845
|
+
onSuccess: S,
|
|
3846
|
+
...c
|
|
3847
|
+
}) : null;
|
|
3848
|
+
}, to = /* @__PURE__ */ Ie({
|
|
3849
|
+
CollectionForm: () => pi,
|
|
3850
|
+
CollectionFormBuilder: () => qa,
|
|
3851
|
+
CollectionFormRenderer: () => eo,
|
|
3852
|
+
FormBuilder: () => Ka,
|
|
3853
|
+
LevoFormProvider: () => gi,
|
|
3854
|
+
useLevoForm: () => Ci,
|
|
3855
|
+
useLevoFormContext: () => _i
|
|
3856
|
+
});
|
|
3857
|
+
//#endregion
|
|
3858
|
+
export { Ci as a, pi as c, Ka as i, _t as l, eo as n, gi as o, qa as r, _i as s, to as t };
|