@arkyn/components 3.0.1-beta.56 → 3.0.1-beta.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +436 -412
- package/dist/bundle.umd.cjs +11 -11
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/phoneInput/index.d.ts.map +1 -1
- package/dist/components/phoneInput/index.js +2 -2
- package/dist/components/phoneInput/phoneInputContainer/index.d.ts +0 -1
- package/dist/components/phoneInput/phoneInputContainer/index.d.ts.map +1 -1
- package/dist/components/phoneInput/phoneInputContainer/index.js +2 -2
- package/dist/components/phoneInput/phoneInputMask/index.d.ts +1 -0
- package/dist/components/phoneInput/phoneInputMask/index.d.ts.map +1 -1
- package/dist/components/phoneInput/phoneInputMask/index.js +3 -3
- package/dist/components/radio/radioBox/index.d.ts.map +1 -1
- package/dist/components/radio/radioBox/index.js +13 -4
- package/dist/components/radio/radioContext.d.ts +2 -0
- package/dist/components/radio/radioContext.d.ts.map +1 -1
- package/dist/components/radio/radioContext.js +2 -2
- package/dist/components/radio/radioGroup/index.d.ts +1 -0
- package/dist/components/radio/radioGroup/index.d.ts.map +1 -1
- package/dist/components/radio/radioGroup/index.js +2 -2
- package/dist/components/switch/index.js +1 -1
- package/dist/components/textarea/index.d.ts.map +1 -1
- package/dist/components/textarea/index.js +1 -1
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
import { jsx as f, jsxs as
|
1
|
+
import { jsx as f, jsxs as C, Fragment as Ce } from "react/jsx-runtime";
|
2
2
|
import * as ee from "react";
|
3
|
-
import Tr, { createContext as Se, useContext as Re, useState as
|
3
|
+
import Tr, { createContext as Se, useContext as Re, useState as T, useRef as ie, useEffect as be, cloneElement as $a, useId as Me, useSyncExternalStore as La, forwardRef as gn, Children as ja, useCallback as nt } from "react";
|
4
4
|
import { Info as Ba, AlertTriangle as za, XCircle as Ha, CheckCircle2 as Ga, Pause as Va, Play as Ua, Loader2 as Ae, RefreshCw as hn, Check as pn, X as yn, FileImage as qa, FileAudio as Wa, FileArchive as Ka, File as Xa, ChevronDown as Or, Search as Ya } from "lucide-react";
|
5
5
|
import { AnimatePresence as Pr, motion as dt } from "framer-motion";
|
6
6
|
import { InputMask as Ar } from "@react-input/mask";
|
@@ -47,7 +47,7 @@ function Qa(e) {
|
|
47
47
|
function t() {
|
48
48
|
return !e || e <= 0 ? 0 : e >= 100 ? 100 : e;
|
49
49
|
}
|
50
|
-
const [n, r] =
|
50
|
+
const [n, r] = T(t());
|
51
51
|
function a(s) {
|
52
52
|
return s <= 0 ? r(0) : s >= 100 ? r(100) : r(s);
|
53
53
|
}
|
@@ -61,20 +61,20 @@ function es(e) {
|
|
61
61
|
onDragging: a,
|
62
62
|
className: s = "",
|
63
63
|
...o
|
64
|
-
} = e, [i, c] =
|
64
|
+
} = e, [i, c] = T(!1), l = ie(null), u = () => c(!0), d = () => c(!1), _ = (k) => {
|
65
65
|
if (r || !i || !l.current) return;
|
66
|
-
const
|
66
|
+
const x = l.current.getBoundingClientRect(), v = k.clientX - x.left, w = Math.min(Math.max(v / x.width * 100, 0), 100);
|
67
67
|
t(w);
|
68
|
-
}, h = (
|
68
|
+
}, h = (k) => {
|
69
69
|
if (r || !l.current) return;
|
70
|
-
const
|
70
|
+
const x = l.current.getBoundingClientRect(), v = k.clientX - x.left, w = Math.min(Math.max(v / x.width * 100, 0), 100);
|
71
71
|
t(w);
|
72
72
|
};
|
73
73
|
be(() => (i ? (a && a(!0), document.addEventListener("mousemove", _), document.addEventListener("mouseup", d)) : (a && a(!1), document.removeEventListener("mousemove", _), document.removeEventListener("mouseup", d)), () => {
|
74
74
|
document.removeEventListener("mousemove", _), document.removeEventListener("mouseup", d);
|
75
75
|
}), [i]);
|
76
76
|
const y = `arkynSliderTrack ${i ? "isDragging" : "isNotDragging"} ${r ? "isDisabled" : "isEnabled"} ${s}`;
|
77
|
-
return /* @__PURE__ */
|
77
|
+
return /* @__PURE__ */ C(
|
78
78
|
"div",
|
79
79
|
{
|
80
80
|
...o,
|
@@ -90,19 +90,19 @@ function es(e) {
|
|
90
90
|
);
|
91
91
|
}
|
92
92
|
function ts(e) {
|
93
|
-
var
|
94
|
-
const { onPlayAudio: t, onPauseAudio: n, disabled: r, ...a } = e, [s, o] = Qa(0), [i, c] =
|
93
|
+
var A, N, j, I;
|
94
|
+
const { onPlayAudio: t, onPauseAudio: n, disabled: r, ...a } = e, [s, o] = Qa(0), [i, c] = T(!1), [l, u] = T(!1), d = ie(null), _ = (A = d.current) == null ? void 0 : A.currentTime, h = (N = d.current) == null ? void 0 : N.duration, m = k(_), g = k(h), y = {
|
95
95
|
totalTime: h,
|
96
96
|
currentTime: _,
|
97
97
|
formattedCurrentTime: m,
|
98
98
|
formattedTotalTime: g
|
99
99
|
};
|
100
|
-
function
|
100
|
+
function k(b) {
|
101
101
|
if (!b) return "00:00";
|
102
|
-
const O = Math.floor(b / 60), $ = Math.floor(b % 60),
|
103
|
-
return `${
|
102
|
+
const O = Math.floor(b / 60), $ = Math.floor(b % 60), R = String(O).padStart(2, "0"), B = String($).padStart(2, "0");
|
103
|
+
return `${R}:${B}`;
|
104
104
|
}
|
105
|
-
function
|
105
|
+
function x() {
|
106
106
|
const b = d.current;
|
107
107
|
b && (e.onPlayAudio && e.onPlayAudio(y), b.play(), c(!0));
|
108
108
|
}
|
@@ -111,25 +111,25 @@ function ts(e) {
|
|
111
111
|
b && (e.onPauseAudio && e.onPauseAudio(y), b.pause(), c(!1));
|
112
112
|
}
|
113
113
|
function w() {
|
114
|
-
i ? v() :
|
114
|
+
i ? v() : x();
|
115
115
|
}
|
116
116
|
function H(b) {
|
117
117
|
const O = d.current;
|
118
118
|
if (!O) return;
|
119
|
-
const $ = O.duration,
|
120
|
-
O.currentTime =
|
119
|
+
const $ = O.duration, R = b / 100 * $;
|
120
|
+
O.currentTime = R;
|
121
121
|
}
|
122
|
-
return l || !i ? (j = d.current) == null || j.pause() : i && ((
|
122
|
+
return l || !i ? (j = d.current) == null || j.pause() : i && ((I = d.current) == null || I.play()), be(() => {
|
123
123
|
const b = d.current;
|
124
124
|
if (!b) return;
|
125
125
|
const O = () => {
|
126
|
-
const $ = b.duration,
|
127
|
-
o(
|
126
|
+
const $ = b.duration, B = b.currentTime / $ * 100;
|
127
|
+
o(B);
|
128
128
|
};
|
129
129
|
return b.addEventListener("timeupdate", O), () => {
|
130
130
|
b.removeEventListener("timeupdate", O);
|
131
131
|
};
|
132
|
-
}, []), /* @__PURE__ */
|
132
|
+
}, []), /* @__PURE__ */ C("div", { className: "arkynAudioPlayer", children: [
|
133
133
|
/* @__PURE__ */ f(
|
134
134
|
"audio",
|
135
135
|
{
|
@@ -139,7 +139,7 @@ function ts(e) {
|
|
139
139
|
onEnded: v
|
140
140
|
}
|
141
141
|
),
|
142
|
-
/* @__PURE__ */
|
142
|
+
/* @__PURE__ */ C("button", { type: "button", disabled: r, onClick: w, children: [
|
143
143
|
i && /* @__PURE__ */ f(Va, {}),
|
144
144
|
!i && /* @__PURE__ */ f(Ua, {})
|
145
145
|
] }),
|
@@ -159,7 +159,7 @@ function ts(e) {
|
|
159
159
|
const Rr = Se({});
|
160
160
|
function bc(e) {
|
161
161
|
const { children: t, fieldErrors: n, form: r } = e;
|
162
|
-
return /* @__PURE__ */
|
162
|
+
return /* @__PURE__ */ C(Rr.Provider, { value: { fieldErrors: n }, children: [
|
163
163
|
!r && t,
|
164
164
|
r && $a(r, r.props, t)
|
165
165
|
] });
|
@@ -206,12 +206,12 @@ function st(e) {
|
|
206
206
|
children: u,
|
207
207
|
...d
|
208
208
|
} = e, h = { xs: 12, sm: 16, md: 20, lg: 24 }[s], y = `arkynButton ${t ? "loadingTrue" : "loadingFalse"} ${r} ${n} ${s} ${a ? "loadingTextTrue" : "loadingTextFalse"} ${l}`;
|
209
|
-
return /* @__PURE__ */
|
210
|
-
/* @__PURE__ */
|
209
|
+
return /* @__PURE__ */ C("button", { className: y, disabled: c || t, ...d, children: [
|
210
|
+
/* @__PURE__ */ C("div", { className: "arkynButtonSpinner", children: [
|
211
211
|
/* @__PURE__ */ f(Ae, { size: h, strokeWidth: 2.5 }),
|
212
212
|
a && a
|
213
213
|
] }),
|
214
|
-
/* @__PURE__ */
|
214
|
+
/* @__PURE__ */ C("div", { className: "arkynButtonContent", children: [
|
215
215
|
/* @__PURE__ */ f(K, { iconSize: h, icon: o }),
|
216
216
|
u,
|
217
217
|
/* @__PURE__ */ f(K, { iconSize: h, icon: i })
|
@@ -237,7 +237,7 @@ function kn(e) {
|
|
237
237
|
className: i = "",
|
238
238
|
...c
|
239
239
|
} = e, l = { xs: 12, sm: 16, md: 20, lg: 24 }, d = `arkynIconButton ${r} ${n} ${a} ${t ? "loadingTrue" : "loadingFalse"} ${i}`;
|
240
|
-
return /* @__PURE__ */
|
240
|
+
return /* @__PURE__ */ C(
|
241
241
|
"button",
|
242
242
|
{
|
243
243
|
disabled: o || t,
|
@@ -258,15 +258,15 @@ function Cn(e) {
|
|
258
258
|
orientation: a = "top",
|
259
259
|
className: s = "",
|
260
260
|
...o
|
261
|
-
} = e, i = Me(), c = ie(null), [l, u] =
|
261
|
+
} = e, i = Me(), c = ie(null), [l, u] = T(a);
|
262
262
|
be(() => {
|
263
263
|
const _ = () => {
|
264
264
|
if (!c.current) return;
|
265
265
|
const g = document.getElementById(i);
|
266
266
|
g && (u(a), requestAnimationFrame(() => {
|
267
|
-
const y = g.getBoundingClientRect(),
|
267
|
+
const y = g.getBoundingClientRect(), k = window.innerWidth, x = window.innerHeight;
|
268
268
|
let v = a;
|
269
|
-
a === "left" && y.left < 0 ? v = "right" : a === "right" && y.right >
|
269
|
+
a === "left" && y.left < 0 ? v = "right" : a === "right" && y.right > k ? v = "left" : a === "top" && y.top < 0 ? v = "bottom" : a === "bottom" && y.bottom > x && (v = "top"), v === "right" && y.right > k ? v = "left" : v === "left" && y.left < 0 ? v = "right" : v === "bottom" && y.bottom > x ? v = "top" : v === "top" && y.top < 0 && (v = "bottom"), u(v);
|
270
270
|
}));
|
271
271
|
}, h = c.current;
|
272
272
|
if (!h) return;
|
@@ -278,7 +278,7 @@ function Cn(e) {
|
|
278
278
|
};
|
279
279
|
}, [a, i]);
|
280
280
|
const d = `arkynTooltip ${n} ${l} ${s}`;
|
281
|
-
return /* @__PURE__ */
|
281
|
+
return /* @__PURE__ */ C("div", { className: d.trim(), ...o, ref: c, children: [
|
282
282
|
r,
|
283
283
|
/* @__PURE__ */ f(
|
284
284
|
"div",
|
@@ -309,10 +309,10 @@ function ns(e) {
|
|
309
309
|
d && a(d);
|
310
310
|
}, l.click();
|
311
311
|
}
|
312
|
-
return /* @__PURE__ */
|
312
|
+
return /* @__PURE__ */ C("div", { className: "arkynAudioUploadHasFileContentContainer", children: [
|
313
313
|
/* @__PURE__ */ f(ts, { src: t }),
|
314
314
|
/* @__PURE__ */ f(vn, {}),
|
315
|
-
/* @__PURE__ */
|
315
|
+
/* @__PURE__ */ C("div", { className: "arkynAudioUploadButtonsContainer", children: [
|
316
316
|
!!o && /* @__PURE__ */ f(Cn, { orientation: "bottom", text: "Reenviar áudio", children: /* @__PURE__ */ f(
|
317
317
|
kn,
|
318
318
|
{
|
@@ -366,7 +366,7 @@ function rs(e) {
|
|
366
366
|
d && a(d);
|
367
367
|
}, l.click();
|
368
368
|
}
|
369
|
-
return /* @__PURE__ */
|
369
|
+
return /* @__PURE__ */ C("div", { onDrop: i, className: "arkynAudioUploadNoFileContent", children: [
|
370
370
|
/* @__PURE__ */ f(
|
371
371
|
st,
|
372
372
|
{
|
@@ -398,56 +398,56 @@ function xc(e) {
|
|
398
398
|
defaultValue: _ = "",
|
399
399
|
showAsterisk: h = !1,
|
400
400
|
disabled: m = !1
|
401
|
-
} = e, { fieldErrors: g } = xe(), y = g == null ? void 0 : g[t], [
|
402
|
-
async function O(
|
401
|
+
} = e, { fieldErrors: g } = xe(), y = g == null ? void 0 : g[t], [k, x] = T(_), [v, w] = T(""), [H, A] = T(null), [N, j] = T(_), [I, b] = T(!1);
|
402
|
+
async function O(F) {
|
403
403
|
if (m) return;
|
404
|
-
b(!0),
|
404
|
+
b(!0), A(F), w("");
|
405
405
|
const Y = new FormData();
|
406
|
-
Y.append(r,
|
407
|
-
|
408
|
-
}).catch((
|
409
|
-
console.error(
|
406
|
+
Y.append(r, F), await fetch(d, { method: a, body: Y }).then(async (E) => await E.json()).then((E) => {
|
407
|
+
E != null && E.error ? w(E.error) : x(E == null ? void 0 : E[o]), s && s(E == null ? void 0 : E[o]);
|
408
|
+
}).catch((E) => {
|
409
|
+
console.error(E), w("Erro ao enviar audio");
|
410
410
|
}).finally(() => b(!1));
|
411
411
|
}
|
412
|
-
function $(
|
412
|
+
function $(F) {
|
413
413
|
if (!m) {
|
414
|
-
if (
|
414
|
+
if (F.type.indexOf("audio") === -1) {
|
415
415
|
w("O arquivo selecionado não é um arquivo de áudio");
|
416
416
|
return;
|
417
417
|
}
|
418
|
-
j(URL.createObjectURL(
|
418
|
+
j(URL.createObjectURL(F)), O(F);
|
419
419
|
}
|
420
420
|
}
|
421
|
-
const
|
422
|
-
return /* @__PURE__ */
|
421
|
+
const R = y || v;
|
422
|
+
return /* @__PURE__ */ C(ve, { children: [
|
423
423
|
n && /* @__PURE__ */ f(ye, { showAsterisk: h, children: n }),
|
424
|
-
/* @__PURE__ */
|
425
|
-
/* @__PURE__ */ f("input", { type: "hidden", name: t, value:
|
426
|
-
!
|
424
|
+
/* @__PURE__ */ C("div", { className: `arkynAudioUpload ${R ? "hasError" : "noHasError"} ${N ? "hasAudio" : "noHasAudio"}`, children: [
|
425
|
+
/* @__PURE__ */ f("input", { type: "hidden", name: t, value: k || "" }),
|
426
|
+
!N && /* @__PURE__ */ f(
|
427
427
|
rs,
|
428
428
|
{
|
429
429
|
disabled: m,
|
430
|
-
isLoading:
|
430
|
+
isLoading: I,
|
431
431
|
acceptAudio: u,
|
432
432
|
dropAudioText: c,
|
433
433
|
handleSelectFile: $,
|
434
434
|
selectAudioButtonText: i
|
435
435
|
}
|
436
436
|
),
|
437
|
-
|
437
|
+
N && /* @__PURE__ */ f(
|
438
438
|
ns,
|
439
439
|
{
|
440
|
-
filePath:
|
440
|
+
filePath: N,
|
441
441
|
acceptAudio: u,
|
442
442
|
changeAudioButtonText: l,
|
443
443
|
disabled: m,
|
444
444
|
handleSelectFile: $,
|
445
|
-
isLoading:
|
446
|
-
reSendAudio:
|
445
|
+
isLoading: I,
|
446
|
+
reSendAudio: R && H ? () => O(H) : void 0
|
447
447
|
}
|
448
448
|
)
|
449
449
|
] }),
|
450
|
-
|
450
|
+
R && /* @__PURE__ */ f(Ee, { children: R })
|
451
451
|
] });
|
452
452
|
}
|
453
453
|
function Ec(e) {
|
@@ -461,7 +461,7 @@ function Ec(e) {
|
|
461
461
|
children: i,
|
462
462
|
...c
|
463
463
|
} = e, u = { md: 12, lg: 14 }[r], d = `arkynBadge ${t} ${n} ${r} ${o}`;
|
464
|
-
return /* @__PURE__ */
|
464
|
+
return /* @__PURE__ */ C("div", { className: d.trim(), ...c, children: [
|
465
465
|
/* @__PURE__ */ f(K, { iconSize: u, icon: a }),
|
466
466
|
/* @__PURE__ */ f("p", { children: i }),
|
467
467
|
/* @__PURE__ */ f(K, { iconSize: u, icon: s })
|
@@ -506,7 +506,7 @@ function Nc(e) {
|
|
506
506
|
disabled: a = !1,
|
507
507
|
className: s,
|
508
508
|
...o
|
509
|
-
} = e, [i, c] =
|
509
|
+
} = e, [i, c] = T(r || ""), l = `arkynCardTabContainer ${s || ""}`;
|
510
510
|
function u(d) {
|
511
511
|
c(d), n && n(d);
|
512
512
|
}
|
@@ -534,19 +534,19 @@ function Fc(e) {
|
|
534
534
|
orientation: u = "horizontalReverse",
|
535
535
|
value: d,
|
536
536
|
..._
|
537
|
-
} = e, { fieldErrors: h } = xe(), m = ie(null), g = t || Me(), y = s || (h == null ? void 0 : h[n]),
|
537
|
+
} = e, { fieldErrors: h } = xe(), m = ie(null), g = t || Me(), y = s || (h == null ? void 0 : h[n]), k = !!y, [x, v] = T(o || !1), w = typeof c == "boolean" ? c : x, N = `arkynCheckbox ${a} ${k ? "errorTrue" : "errorFalse"} ${w ? "checkedTrue" : "checkedFalse"} ${r}`;
|
538
538
|
function j() {
|
539
|
-
const
|
540
|
-
v(!
|
539
|
+
const I = x;
|
540
|
+
v(!I), l && l(I ? "" : d || "checked");
|
541
541
|
}
|
542
|
-
return /* @__PURE__ */
|
543
|
-
i && /* @__PURE__ */ f(ye, { children: i }),
|
544
|
-
/* @__PURE__ */
|
542
|
+
return /* @__PURE__ */ C(ve, { orientation: u, children: [
|
543
|
+
i && /* @__PURE__ */ f(ye, { htmlFor: g, children: i }),
|
544
|
+
/* @__PURE__ */ C(
|
545
545
|
"button",
|
546
546
|
{
|
547
547
|
id: g,
|
548
548
|
type: "button",
|
549
|
-
className:
|
549
|
+
className: N,
|
550
550
|
onClick: j,
|
551
551
|
..._,
|
552
552
|
children: [
|
@@ -2596,21 +2596,21 @@ function Tc(e) {
|
|
2596
2596
|
suffix: m,
|
2597
2597
|
isLoading: g = !1,
|
2598
2598
|
leftIcon: y,
|
2599
|
-
readOnly:
|
2600
|
-
onFocus:
|
2599
|
+
readOnly: k,
|
2600
|
+
onFocus: x,
|
2601
2601
|
onBlur: v,
|
2602
2602
|
errorMessage: w,
|
2603
2603
|
showAsterisk: H,
|
2604
|
-
rightIcon:
|
2605
|
-
size:
|
2604
|
+
rightIcon: A,
|
2605
|
+
size: N = "md",
|
2606
2606
|
id: j,
|
2607
|
-
...
|
2608
|
-
} = e, { fieldErrors: b } = xe(), [O, $] =
|
2607
|
+
...I
|
2608
|
+
} = e, { fieldErrors: b } = xe(), [O, $] = T(!1), [R, B] = T("0"), M = ie(null), z = j || Me(), F = w || (b == null ? void 0 : b[t]), Y = !!F, E = n || g, X = { md: 20, lg: 20 }[N], Z = A ? "right" : "left", he = Z === "left" && g, ce = Z === "right" && g;
|
2609
2609
|
function se() {
|
2610
|
-
|
2610
|
+
E || !(M != null && M.current) || ($(!0), M.current.focus());
|
2611
2611
|
}
|
2612
2612
|
function te(ue) {
|
2613
|
-
$(!0),
|
2613
|
+
$(!0), x && x(ue);
|
2614
2614
|
}
|
2615
2615
|
function L(ue) {
|
2616
2616
|
$(!1), v && v(ue);
|
@@ -2620,7 +2620,7 @@ function Tc(e) {
|
|
2620
2620
|
ue,
|
2621
2621
|
d
|
2622
2622
|
);
|
2623
|
-
return !u || Le <= u ? (
|
2623
|
+
return !u || Le <= u ? (B(Ve), [Le, Ve]) : Yt(ue, d);
|
2624
2624
|
}, Te = (ue) => {
|
2625
2625
|
ue.preventDefault();
|
2626
2626
|
const [Le, Ve] = ne(ue.target.value);
|
@@ -2628,12 +2628,12 @@ function Tc(e) {
|
|
2628
2628
|
};
|
2629
2629
|
be(() => {
|
2630
2630
|
const ue = c || +l || void 0, [, Le] = Yt(ue, d);
|
2631
|
-
|
2631
|
+
B(Le);
|
2632
2632
|
}, [d, l, c]);
|
2633
|
-
const qt = `arkynCurrencyInput ${h ? "hasPrefix" : ""} ${m ? "hasSuffix" : ""} ${s} ${
|
2634
|
-
return /* @__PURE__ */
|
2635
|
-
o && /* @__PURE__ */ f(ye, { showAsterisk: H, htmlFor:
|
2636
|
-
/* @__PURE__ */
|
2633
|
+
const qt = `arkynCurrencyInput ${h ? "hasPrefix" : ""} ${m ? "hasSuffix" : ""} ${s} ${N} ${E || k || g ? "opacity" : ""} ${Y ? "errored" : ""} ${O ? "focused" : ""} ${i}`;
|
2634
|
+
return /* @__PURE__ */ C(ve, { children: [
|
2635
|
+
o && /* @__PURE__ */ f(ye, { showAsterisk: H, htmlFor: z, children: o }),
|
2636
|
+
/* @__PURE__ */ C(
|
2637
2637
|
"section",
|
2638
2638
|
{
|
2639
2639
|
title: r,
|
@@ -2655,16 +2655,16 @@ function Tc(e) {
|
|
2655
2655
|
/* @__PURE__ */ f(
|
2656
2656
|
"input",
|
2657
2657
|
{
|
2658
|
-
disabled:
|
2659
|
-
readOnly:
|
2660
|
-
ref:
|
2658
|
+
disabled: E,
|
2659
|
+
readOnly: k,
|
2660
|
+
ref: M,
|
2661
2661
|
onFocus: te,
|
2662
2662
|
onBlur: L,
|
2663
2663
|
onChange: Te,
|
2664
|
-
id:
|
2665
|
-
placeholder:
|
2666
|
-
value:
|
2667
|
-
...
|
2664
|
+
id: z,
|
2665
|
+
placeholder: E ? R : void 0,
|
2666
|
+
value: E ? void 0 : R,
|
2667
|
+
...I
|
2668
2668
|
}
|
2669
2669
|
),
|
2670
2670
|
/* @__PURE__ */ f(
|
@@ -2672,11 +2672,11 @@ function Tc(e) {
|
|
2672
2672
|
{
|
2673
2673
|
type: "hidden",
|
2674
2674
|
name: t,
|
2675
|
-
value: Dr(
|
2675
|
+
value: Dr(R),
|
2676
2676
|
readOnly: !0
|
2677
2677
|
}
|
2678
2678
|
),
|
2679
|
-
/* @__PURE__ */ f(K, { show: !g, icon:
|
2679
|
+
/* @__PURE__ */ f(K, { show: !g, icon: A, iconSize: X }),
|
2680
2680
|
/* @__PURE__ */ f(
|
2681
2681
|
K,
|
2682
2682
|
{
|
@@ -2690,7 +2690,7 @@ function Tc(e) {
|
|
2690
2690
|
]
|
2691
2691
|
}
|
2692
2692
|
),
|
2693
|
-
|
2693
|
+
F && /* @__PURE__ */ f(Ee, { children: F })
|
2694
2694
|
] });
|
2695
2695
|
}
|
2696
2696
|
function us() {
|
@@ -2728,7 +2728,7 @@ function Oc(e) {
|
|
2728
2728
|
} = e;
|
2729
2729
|
yt(t);
|
2730
2730
|
const i = r === "left" ? "-100%" : "100%", l = `arkynDrawerContainer ${r} ${t ? "visibleTrue" : "visibleFalse"} ${s}`;
|
2731
|
-
return /* @__PURE__ */ f(fs, { makeInvisible: n, children: /* @__PURE__ */ f(Pr, { children: t && /* @__PURE__ */
|
2731
|
+
return /* @__PURE__ */ f(fs, { makeInvisible: n, children: /* @__PURE__ */ f(Pr, { children: t && /* @__PURE__ */ C("aside", { className: l.trim(), ...o, children: [
|
2732
2732
|
/* @__PURE__ */ f(
|
2733
2733
|
dt.div,
|
2734
2734
|
{
|
@@ -2760,7 +2760,7 @@ function Pc(e) {
|
|
2760
2760
|
children: r,
|
2761
2761
|
...a
|
2762
2762
|
} = e, { makeInvisible: s } = ds(), o = `arkynDrawerHeader ${n}`;
|
2763
|
-
return /* @__PURE__ */
|
2763
|
+
return /* @__PURE__ */ C("header", { className: o.trim(), ...a, children: [
|
2764
2764
|
r,
|
2765
2765
|
t && /* @__PURE__ */ f(
|
2766
2766
|
"button",
|
@@ -2796,13 +2796,13 @@ function _s(e) {
|
|
2796
2796
|
function l() {
|
2797
2797
|
return n.type.startsWith("image/") ? /* @__PURE__ */ f(qa, {}) : n.type.startsWith("audio/") ? /* @__PURE__ */ f(Wa, {}) : n.type.startsWith("application/zip") ? /* @__PURE__ */ f(Ka, {}) : /* @__PURE__ */ f(Xa, {});
|
2798
2798
|
}
|
2799
|
-
return /* @__PURE__ */
|
2800
|
-
/* @__PURE__ */
|
2799
|
+
return /* @__PURE__ */ C("div", { className: "arkynFileUploadHasFileContent", children: [
|
2800
|
+
/* @__PURE__ */ C("section", { className: "arkynFileUploadFileContainer", children: [
|
2801
2801
|
/* @__PURE__ */ f(l, {}),
|
2802
2802
|
/* @__PURE__ */ f("p", { children: n.name })
|
2803
2803
|
] }),
|
2804
2804
|
/* @__PURE__ */ f(vn, {}),
|
2805
|
-
/* @__PURE__ */
|
2805
|
+
/* @__PURE__ */ C("div", { className: "arkynFileUploadButtonsContainer", children: [
|
2806
2806
|
!!i && /* @__PURE__ */ f(Cn, { orientation: "bottom", text: "Reenviar arquivo", children: /* @__PURE__ */ f(
|
2807
2807
|
kn,
|
2808
2808
|
{
|
@@ -2856,7 +2856,7 @@ function ms(e) {
|
|
2856
2856
|
d && a(d);
|
2857
2857
|
}, l.click();
|
2858
2858
|
}
|
2859
|
-
return /* @__PURE__ */
|
2859
|
+
return /* @__PURE__ */ C("div", { onDrop: i, className: "arkynFileUploadNoFileContent", children: [
|
2860
2860
|
/* @__PURE__ */ f(
|
2861
2861
|
st,
|
2862
2862
|
{
|
@@ -2887,33 +2887,33 @@ function Ac(e) {
|
|
2887
2887
|
dropFileText: d = "Ou arraste e solte o arquivo aqui",
|
2888
2888
|
onChange: _,
|
2889
2889
|
disabled: h = !1
|
2890
|
-
} = e, { fieldErrors: m } = xe(), g = m == null ? void 0 : m[t], [y,
|
2891
|
-
async function j(
|
2890
|
+
} = e, { fieldErrors: m } = xe(), g = m == null ? void 0 : m[t], [y, k] = T(""), [x, v] = T(""), [w, H] = T(null), [A, N] = T(!1);
|
2891
|
+
async function j(B) {
|
2892
2892
|
if (h) return;
|
2893
|
-
|
2894
|
-
const
|
2895
|
-
|
2896
|
-
|
2897
|
-
}).catch((
|
2898
|
-
console.error(
|
2899
|
-
}).finally(() =>
|
2900
|
-
}
|
2901
|
-
function
|
2902
|
-
h || j(
|
2903
|
-
}
|
2904
|
-
const b = g ||
|
2905
|
-
return /* @__PURE__ */
|
2893
|
+
N(!0), H(B), v("");
|
2894
|
+
const M = new FormData();
|
2895
|
+
M.append(s, B), await fetch(a, { method: o, body: M }).then(async (z) => await z.json()).then((z) => {
|
2896
|
+
z != null && z.error ? v(z.error) : k(z == null ? void 0 : z[c]), _ && _(z == null ? void 0 : z[c]);
|
2897
|
+
}).catch((z) => {
|
2898
|
+
console.error(z), v("Erro ao enviar o arquivo");
|
2899
|
+
}).finally(() => N(!1));
|
2900
|
+
}
|
2901
|
+
function I(B) {
|
2902
|
+
h || j(B);
|
2903
|
+
}
|
2904
|
+
const b = g || x;
|
2905
|
+
return /* @__PURE__ */ C(ve, { children: [
|
2906
2906
|
n && /* @__PURE__ */ f(ye, { showAsterisk: r, children: n }),
|
2907
|
-
/* @__PURE__ */
|
2907
|
+
/* @__PURE__ */ C("div", { className: `arkynFileUpload ${b ? "hasError" : "noHasError"} ${w ? "hasFile" : "noHasFile"}`, children: [
|
2908
2908
|
/* @__PURE__ */ f("input", { type: "hidden", name: t, value: y || "" }),
|
2909
2909
|
!w && /* @__PURE__ */ f(
|
2910
2910
|
ms,
|
2911
2911
|
{
|
2912
2912
|
disabled: h,
|
2913
|
-
isLoading:
|
2913
|
+
isLoading: A,
|
2914
2914
|
acceptFile: i,
|
2915
2915
|
dropFileText: d,
|
2916
|
-
handleSelectFile:
|
2916
|
+
handleSelectFile: I,
|
2917
2917
|
selectFileButtonText: u
|
2918
2918
|
}
|
2919
2919
|
),
|
@@ -2921,10 +2921,10 @@ function Ac(e) {
|
|
2921
2921
|
_s,
|
2922
2922
|
{
|
2923
2923
|
disabled: h,
|
2924
|
-
isLoading:
|
2924
|
+
isLoading: A,
|
2925
2925
|
acceptFile: i,
|
2926
2926
|
file: w,
|
2927
|
-
handleSelectFile:
|
2927
|
+
handleSelectFile: I,
|
2928
2928
|
changeFileButtonText: l,
|
2929
2929
|
reSendFile: b && w ? () => j(w) : void 0
|
2930
2930
|
}
|
@@ -2952,7 +2952,7 @@ function gs(e) {
|
|
2952
2952
|
d && o(d);
|
2953
2953
|
}, l.click();
|
2954
2954
|
}
|
2955
|
-
return /* @__PURE__ */
|
2955
|
+
return /* @__PURE__ */ C(
|
2956
2956
|
"div",
|
2957
2957
|
{
|
2958
2958
|
className: "arkynImageUploadHasFileContent",
|
@@ -3012,7 +3012,7 @@ function hs(e) {
|
|
3012
3012
|
d && a(d);
|
3013
3013
|
}, l.click();
|
3014
3014
|
}
|
3015
|
-
return /* @__PURE__ */
|
3015
|
+
return /* @__PURE__ */ C("div", { onDrop: i, className: "arkynImageUploadNoFileContent", children: [
|
3016
3016
|
/* @__PURE__ */ f(
|
3017
3017
|
st,
|
3018
3018
|
{
|
@@ -3044,50 +3044,50 @@ function Ic(e) {
|
|
3044
3044
|
dropImageText: _ = "Ou arraste e solte a imagem aqui",
|
3045
3045
|
onChange: h,
|
3046
3046
|
disabled: m = !1
|
3047
|
-
} = e, { fieldErrors: g } = xe(), y = g == null ? void 0 : g[t], [
|
3048
|
-
async function O(
|
3047
|
+
} = e, { fieldErrors: g } = xe(), y = g == null ? void 0 : g[t], [k, x] = T(n), [v, w] = T(""), [H, A] = T(null), [N, j] = T(n), [I, b] = T(!1);
|
3048
|
+
async function O(F) {
|
3049
3049
|
if (m) return;
|
3050
|
-
b(!0),
|
3050
|
+
b(!0), A(F), w("");
|
3051
3051
|
const Y = new FormData();
|
3052
|
-
Y.append(o,
|
3053
|
-
|
3054
|
-
}).catch((
|
3055
|
-
console.error(
|
3052
|
+
Y.append(o, F), await fetch(s, { method: i, body: Y }).then(async (E) => await E.json()).then((E) => {
|
3053
|
+
E != null && E.error ? w(E.error) : x(E == null ? void 0 : E[l]), h && h(E == null ? void 0 : E[l]);
|
3054
|
+
}).catch((E) => {
|
3055
|
+
console.error(E), w("Erro ao enviar imagem");
|
3056
3056
|
}).finally(() => b(!1));
|
3057
3057
|
}
|
3058
|
-
function $(
|
3059
|
-
m || (j(URL.createObjectURL(
|
3058
|
+
function $(F) {
|
3059
|
+
m || (j(URL.createObjectURL(F)), O(F));
|
3060
3060
|
}
|
3061
|
-
const
|
3062
|
-
return /* @__PURE__ */
|
3061
|
+
const R = y || v;
|
3062
|
+
return /* @__PURE__ */ C(ve, { children: [
|
3063
3063
|
r && /* @__PURE__ */ f(ye, { showAsterisk: a, children: r }),
|
3064
|
-
/* @__PURE__ */
|
3065
|
-
/* @__PURE__ */ f("input", { type: "hidden", name: t, value:
|
3066
|
-
!
|
3064
|
+
/* @__PURE__ */ C("div", { className: `arkynImageUpload ${R ? "hasError" : "noHasError"} ${N ? "hasImage" : "noHasImage"}`, children: [
|
3065
|
+
/* @__PURE__ */ f("input", { type: "hidden", name: t, value: k || "" }),
|
3066
|
+
!N && /* @__PURE__ */ f(
|
3067
3067
|
hs,
|
3068
3068
|
{
|
3069
3069
|
disabled: m,
|
3070
|
-
isLoading:
|
3070
|
+
isLoading: I,
|
3071
3071
|
acceptImage: c,
|
3072
3072
|
dropImageText: _,
|
3073
3073
|
handleSelectFile: $,
|
3074
3074
|
selectImageButtonText: d
|
3075
3075
|
}
|
3076
3076
|
),
|
3077
|
-
|
3077
|
+
N && /* @__PURE__ */ f(
|
3078
3078
|
gs,
|
3079
3079
|
{
|
3080
3080
|
disabled: m,
|
3081
|
-
isLoading:
|
3081
|
+
isLoading: I,
|
3082
3082
|
acceptImage: c,
|
3083
|
-
filePath:
|
3083
|
+
filePath: N,
|
3084
3084
|
handleSelectFile: $,
|
3085
3085
|
changeImageButtonText: u,
|
3086
|
-
reSendImage:
|
3086
|
+
reSendImage: R && H ? () => O(H) : void 0
|
3087
3087
|
}
|
3088
3088
|
)
|
3089
3089
|
] }),
|
3090
|
-
|
3090
|
+
R && /* @__PURE__ */ f(Ee, { children: R })
|
3091
3091
|
] });
|
3092
3092
|
}
|
3093
3093
|
function ps(e) {
|
@@ -3108,16 +3108,16 @@ function ps(e) {
|
|
3108
3108
|
onBlur: m,
|
3109
3109
|
errorMessage: g,
|
3110
3110
|
showAsterisk: y,
|
3111
|
-
rightIcon:
|
3112
|
-
type:
|
3111
|
+
rightIcon: k,
|
3112
|
+
type: x = "text",
|
3113
3113
|
size: v = "md",
|
3114
3114
|
id: w,
|
3115
3115
|
value: H,
|
3116
|
-
placeholder:
|
3117
|
-
...
|
3118
|
-
} = e, { fieldErrors: j } = xe(), [
|
3116
|
+
placeholder: A,
|
3117
|
+
...N
|
3118
|
+
} = e, { fieldErrors: j } = xe(), [I, b] = T(!1), O = ie(null), $ = w || Me(), R = g || (j == null ? void 0 : j[t]), B = !!R, M = n || u, F = { md: 20, lg: 20 }[v], Y = k ? "right" : "left", E = Y === "left" && u, _e = Y === "right" && u;
|
3119
3119
|
function X() {
|
3120
|
-
|
3120
|
+
M || !(O != null && O.current) || (b(!0), O.current.focus());
|
3121
3121
|
}
|
3122
3122
|
function Z(ke) {
|
3123
3123
|
b(!0), h && h(ke);
|
@@ -3125,7 +3125,7 @@ function ps(e) {
|
|
3125
3125
|
function he(ke) {
|
3126
3126
|
b(!1), m && m(ke);
|
3127
3127
|
}
|
3128
|
-
if (
|
3128
|
+
if (x === "hidden")
|
3129
3129
|
return /* @__PURE__ */ f(
|
3130
3130
|
"input",
|
3131
3131
|
{
|
@@ -3133,13 +3133,13 @@ function ps(e) {
|
|
3133
3133
|
readOnly: !0,
|
3134
3134
|
type: "text",
|
3135
3135
|
ref: O,
|
3136
|
-
...
|
3136
|
+
...N
|
3137
3137
|
}
|
3138
3138
|
);
|
3139
|
-
const De = `arkynInput ${c ? "hasPrefix" : ""} ${n ? "disabled" : ""} ${l ? "hasSuffix" : ""} ${s} ${v} ${
|
3140
|
-
return /* @__PURE__ */
|
3139
|
+
const De = `arkynInput ${c ? "hasPrefix" : ""} ${n ? "disabled" : ""} ${l ? "hasSuffix" : ""} ${s} ${v} ${M || _ || u ? "opacity" : ""} ${B ? "errored" : ""} ${I ? "focused" : ""} ${i}`;
|
3140
|
+
return /* @__PURE__ */ C(ve, { children: [
|
3141
3141
|
o && /* @__PURE__ */ f(ye, { showAsterisk: y, htmlFor: $, children: o }),
|
3142
|
-
/* @__PURE__ */
|
3142
|
+
/* @__PURE__ */ C(
|
3143
3143
|
"section",
|
3144
3144
|
{
|
3145
3145
|
title: r,
|
@@ -3147,48 +3147,48 @@ function ps(e) {
|
|
3147
3147
|
onClick: X,
|
3148
3148
|
className: De,
|
3149
3149
|
children: [
|
3150
|
-
/* @__PURE__ */ f(K, { iconSize:
|
3150
|
+
/* @__PURE__ */ f(K, { iconSize: F, icon: c, className: "prefix" }),
|
3151
3151
|
/* @__PURE__ */ f(
|
3152
3152
|
K,
|
3153
3153
|
{
|
3154
|
-
show:
|
3155
|
-
iconSize:
|
3154
|
+
show: E,
|
3155
|
+
iconSize: F,
|
3156
3156
|
className: "spinner",
|
3157
3157
|
icon: Ae
|
3158
3158
|
}
|
3159
3159
|
),
|
3160
|
-
/* @__PURE__ */ f(K, { show: !u, icon: d, iconSize:
|
3160
|
+
/* @__PURE__ */ f(K, { show: !u, icon: d, iconSize: F }),
|
3161
3161
|
/* @__PURE__ */ f(
|
3162
3162
|
"input",
|
3163
3163
|
{
|
3164
|
-
disabled:
|
3164
|
+
disabled: M,
|
3165
3165
|
readOnly: _,
|
3166
3166
|
ref: O,
|
3167
3167
|
onFocus: Z,
|
3168
3168
|
onBlur: he,
|
3169
|
-
type:
|
3169
|
+
type: x,
|
3170
3170
|
id: $,
|
3171
3171
|
name: t,
|
3172
|
-
placeholder:
|
3173
|
-
value:
|
3174
|
-
...
|
3172
|
+
placeholder: M && H || A,
|
3173
|
+
value: M ? void 0 : H,
|
3174
|
+
...N
|
3175
3175
|
}
|
3176
3176
|
),
|
3177
|
-
/* @__PURE__ */ f(K, { show: !u, icon:
|
3177
|
+
/* @__PURE__ */ f(K, { show: !u, icon: k, iconSize: F }),
|
3178
3178
|
/* @__PURE__ */ f(
|
3179
3179
|
K,
|
3180
3180
|
{
|
3181
3181
|
show: _e,
|
3182
|
-
iconSize:
|
3182
|
+
iconSize: F,
|
3183
3183
|
className: "spinner",
|
3184
3184
|
icon: Ae
|
3185
3185
|
}
|
3186
3186
|
),
|
3187
|
-
/* @__PURE__ */ f(K, { iconSize:
|
3187
|
+
/* @__PURE__ */ f(K, { iconSize: F, icon: l, className: "suffix" })
|
3188
3188
|
]
|
3189
3189
|
}
|
3190
3190
|
),
|
3191
|
-
|
3191
|
+
R && /* @__PURE__ */ f(Ee, { children: R })
|
3192
3192
|
] });
|
3193
3193
|
}
|
3194
3194
|
const ys = gn((e, t) => /* @__PURE__ */ f("input", { ref: t, ...e }));
|
@@ -3210,31 +3210,31 @@ function Rc(e) {
|
|
3210
3210
|
isLoading: m = !1,
|
3211
3211
|
leftIcon: g,
|
3212
3212
|
readOnly: y,
|
3213
|
-
onFocus:
|
3214
|
-
onBlur:
|
3213
|
+
onFocus: k,
|
3214
|
+
onBlur: x,
|
3215
3215
|
errorMessage: v,
|
3216
3216
|
defaultValue: w,
|
3217
3217
|
showAsterisk: H,
|
3218
|
-
rightIcon:
|
3219
|
-
size:
|
3218
|
+
rightIcon: A,
|
3219
|
+
size: N = "md",
|
3220
3220
|
id: j,
|
3221
|
-
value:
|
3221
|
+
value: I,
|
3222
3222
|
placeholder: b,
|
3223
3223
|
...O
|
3224
|
-
} = e, { fieldErrors: $ } = xe(), [
|
3224
|
+
} = e, { fieldErrors: $ } = xe(), [R, B] = T(!1), M = ie(null), z = j || Me(), F = v || ($ == null ? void 0 : $[t]), Y = !!F, E = n || m, X = { md: 20, lg: 20 }[N], Z = A ? "right" : "left", he = Z === "left" && m, ce = Z === "right" && m;
|
3225
3225
|
function se() {
|
3226
|
-
|
3226
|
+
E || !(M != null && M.current) || (B(!0), M.current.focus());
|
3227
3227
|
}
|
3228
3228
|
function te($e) {
|
3229
|
-
|
3229
|
+
B(!0), k && k($e);
|
3230
3230
|
}
|
3231
3231
|
function L($e) {
|
3232
|
-
|
3232
|
+
B(!1), x && x($e);
|
3233
3233
|
}
|
3234
|
-
const re = `arkynMaskedInput ${_ ? "hasPrefix" : ""} ${h ? "hasSuffix" : ""} ${s} ${
|
3235
|
-
return /* @__PURE__ */
|
3236
|
-
u && /* @__PURE__ */ f(ye, { showAsterisk: H, htmlFor:
|
3237
|
-
/* @__PURE__ */
|
3234
|
+
const re = `arkynMaskedInput ${_ ? "hasPrefix" : ""} ${h ? "hasSuffix" : ""} ${s} ${N} ${E || y || m ? "opacity" : ""} ${Y ? "errored" : ""} ${R ? "focused" : ""} ${d}`;
|
3235
|
+
return /* @__PURE__ */ C(ve, { children: [
|
3236
|
+
u && /* @__PURE__ */ f(ye, { showAsterisk: H, htmlFor: z, children: u }),
|
3237
|
+
/* @__PURE__ */ C(
|
3238
3238
|
"section",
|
3239
3239
|
{
|
3240
3240
|
title: r,
|
@@ -3261,19 +3261,19 @@ function Rc(e) {
|
|
3261
3261
|
replacement: l,
|
3262
3262
|
separate: o,
|
3263
3263
|
showMask: c,
|
3264
|
-
ref:
|
3264
|
+
ref: M,
|
3265
3265
|
onFocus: te,
|
3266
3266
|
onBlur: L,
|
3267
|
-
disabled:
|
3267
|
+
disabled: E,
|
3268
3268
|
readOnly: y,
|
3269
|
-
id:
|
3269
|
+
id: z,
|
3270
3270
|
name: t,
|
3271
|
-
placeholder:
|
3272
|
-
value:
|
3271
|
+
placeholder: E && I || b,
|
3272
|
+
value: E ? void 0 : I,
|
3273
3273
|
...O
|
3274
3274
|
}
|
3275
3275
|
),
|
3276
|
-
/* @__PURE__ */ f(K, { show: !m, icon:
|
3276
|
+
/* @__PURE__ */ f(K, { show: !m, icon: A, iconSize: X }),
|
3277
3277
|
/* @__PURE__ */ f(
|
3278
3278
|
K,
|
3279
3279
|
{
|
@@ -3287,7 +3287,7 @@ function Rc(e) {
|
|
3287
3287
|
]
|
3288
3288
|
}
|
3289
3289
|
),
|
3290
|
-
|
3290
|
+
F && /* @__PURE__ */ f(Ee, { children: F })
|
3291
3291
|
] });
|
3292
3292
|
}
|
3293
3293
|
const Lr = Se({});
|
@@ -3307,7 +3307,7 @@ function Mc(e) {
|
|
3307
3307
|
} = e;
|
3308
3308
|
yt(t);
|
3309
3309
|
const i = `arkynModalContainer ${t ? "visibleTrue" : "visibleFalse"} ${a}`;
|
3310
|
-
return /* @__PURE__ */ f(vs, { makeInvisible: n, children: /* @__PURE__ */ f(Pr, { children: t && /* @__PURE__ */
|
3310
|
+
return /* @__PURE__ */ f(vs, { makeInvisible: n, children: /* @__PURE__ */ f(Pr, { children: t && /* @__PURE__ */ C("aside", { className: i.trim(), ...s, children: [
|
3311
3311
|
/* @__PURE__ */ f(
|
3312
3312
|
dt.div,
|
3313
3313
|
{
|
@@ -3343,7 +3343,7 @@ function $c(e) {
|
|
3343
3343
|
children: r,
|
3344
3344
|
...a
|
3345
3345
|
} = e, { makeInvisible: s } = ks(), o = `arkynModalHeader ${n}`;
|
3346
|
-
return /* @__PURE__ */
|
3346
|
+
return /* @__PURE__ */ C("header", { className: o.trim(), ...a, children: [
|
3347
3347
|
r,
|
3348
3348
|
t && /* @__PURE__ */ f(
|
3349
3349
|
"button",
|
@@ -3392,7 +3392,7 @@ function xs(e) {
|
|
3392
3392
|
}
|
3393
3393
|
function Es(e) {
|
3394
3394
|
const { label: t, value: n, disabled: r, handleChangeValue: a } = e;
|
3395
|
-
return /* @__PURE__ */
|
3395
|
+
return /* @__PURE__ */ C("div", { className: "arkynMultiSelectMark", children: [
|
3396
3396
|
t,
|
3397
3397
|
/* @__PURE__ */ f(
|
3398
3398
|
"button",
|
@@ -3409,14 +3409,14 @@ function Es(e) {
|
|
3409
3409
|
}
|
3410
3410
|
function ws(e) {
|
3411
3411
|
const { label: t, optionHasSelected: n, handleChangeValue: r, value: a, size: s } = e, o = n(a) ? "active" : "", i = `arkynMultiSelectOption ${s} ${o}`;
|
3412
|
-
return /* @__PURE__ */
|
3412
|
+
return /* @__PURE__ */ C("div", { onClick: () => r(a), className: i, children: [
|
3413
3413
|
t,
|
3414
3414
|
" ",
|
3415
3415
|
/* @__PURE__ */ f(pn, {})
|
3416
3416
|
] });
|
3417
3417
|
}
|
3418
3418
|
function Ns(e) {
|
3419
|
-
const { children: t, isFocused: n, isSearchable: r, search: a, onSearch: s } = e, o = ie(null), [i, c] =
|
3419
|
+
const { children: t, isFocused: n, isSearchable: r, search: a, onSearch: s } = e, o = ie(null), [i, c] = T("bottom");
|
3420
3420
|
yt(n), be(() => {
|
3421
3421
|
if (!n) return;
|
3422
3422
|
(() => {
|
@@ -3430,7 +3430,7 @@ function Ns(e) {
|
|
3430
3430
|
function l(u) {
|
3431
3431
|
r && s(u.target.value);
|
3432
3432
|
}
|
3433
|
-
return n ? /* @__PURE__ */
|
3433
|
+
return n ? /* @__PURE__ */ C(
|
3434
3434
|
"div",
|
3435
3435
|
{
|
3436
3436
|
ref: o,
|
@@ -3485,16 +3485,16 @@ function Lc(e) {
|
|
3485
3485
|
showAsterisk: m,
|
3486
3486
|
leftIcon: g,
|
3487
3487
|
onSearch: y,
|
3488
|
-
onChange:
|
3489
|
-
onBlur:
|
3488
|
+
onChange: k,
|
3489
|
+
onBlur: x,
|
3490
3490
|
notFoundText: v = "Sem opções disponíveis",
|
3491
3491
|
onFocus: w,
|
3492
3492
|
disabled: H = !1,
|
3493
|
-
prefix:
|
3494
|
-
size:
|
3493
|
+
prefix: A,
|
3494
|
+
size: N = "md",
|
3495
3495
|
value: j,
|
3496
|
-
variant:
|
3497
|
-
} = e, { fieldErrors: b } = xe(), O = ie(null), $ = d || Me(),
|
3496
|
+
variant: I = "solid"
|
3497
|
+
} = e, { fieldErrors: b } = xe(), O = ie(null), $ = d || Me(), R = i || (b == null ? void 0 : b[t]), B = !!R, M = H || c || l, F = { md: 20, lg: 20 }[N], [Y, E] = T(""), [_e, X] = T(!1), [Z, he] = T(o), ce = j || Z;
|
3498
3498
|
function se(G) {
|
3499
3499
|
return ce.includes(G);
|
3500
3500
|
}
|
@@ -3503,33 +3503,33 @@ function Lc(e) {
|
|
3503
3503
|
return (re == null ? void 0 : re.label) || "";
|
3504
3504
|
}
|
3505
3505
|
function L() {
|
3506
|
-
|
3506
|
+
M || !(O != null && O.current) || _e || (X(!0), O.current.focus(), w && w());
|
3507
3507
|
}
|
3508
3508
|
function ne() {
|
3509
|
-
X(!1),
|
3509
|
+
X(!1), x && O.current && O.current.blur();
|
3510
3510
|
}
|
3511
3511
|
function Te(G) {
|
3512
|
-
|
3512
|
+
E(G), y && y(G);
|
3513
3513
|
}
|
3514
3514
|
function De(G) {
|
3515
|
-
se(G) ? (he(Z.filter((re) => re !== G)),
|
3515
|
+
se(G) ? (he(Z.filter((re) => re !== G)), k && k(Z.filter((re) => re !== G))) : (he([...Z, G]), k && k([...Z, G])), s && ne();
|
3516
3516
|
}
|
3517
3517
|
const ke = n.filter((G) => !!(e.onSearch || !e.isSearchable || G.label.toLowerCase().includes(Y.toLowerCase())));
|
3518
|
-
return /* @__PURE__ */
|
3518
|
+
return /* @__PURE__ */ C(ve, { children: [
|
3519
3519
|
_ && /* @__PURE__ */ f(ye, { showAsterisk: m, children: _ }),
|
3520
|
-
/* @__PURE__ */
|
3520
|
+
/* @__PURE__ */ C(
|
3521
3521
|
bs,
|
3522
3522
|
{
|
3523
3523
|
handleContainerFocus: L,
|
3524
|
-
disabled:
|
3525
|
-
isError:
|
3524
|
+
disabled: M,
|
3525
|
+
isError: B,
|
3526
3526
|
isFocused: _e,
|
3527
3527
|
isLoading: c,
|
3528
3528
|
readOnly: l,
|
3529
|
-
size:
|
3530
|
-
variant:
|
3529
|
+
size: N,
|
3530
|
+
variant: I,
|
3531
3531
|
className: r,
|
3532
|
-
prefixExists: !!
|
3532
|
+
prefixExists: !!A,
|
3533
3533
|
id: $,
|
3534
3534
|
children: [
|
3535
3535
|
/* @__PURE__ */ f(
|
@@ -3541,22 +3541,22 @@ function Lc(e) {
|
|
3541
3541
|
type: "hidden"
|
3542
3542
|
}
|
3543
3543
|
),
|
3544
|
-
/* @__PURE__ */ f(K, { iconSize:
|
3545
|
-
g && /* @__PURE__ */ f(g, { size:
|
3546
|
-
/* @__PURE__ */
|
3544
|
+
/* @__PURE__ */ f(K, { iconSize: F, icon: A, className: "prefix" }),
|
3545
|
+
g && /* @__PURE__ */ f(g, { size: F, strokeWidth: 2.5 }),
|
3546
|
+
/* @__PURE__ */ C(xs, { size: N, children: [
|
3547
3547
|
ce.map((G) => /* @__PURE__ */ f(
|
3548
3548
|
Es,
|
3549
3549
|
{
|
3550
3550
|
label: te(G),
|
3551
3551
|
value: G,
|
3552
3552
|
handleChangeValue: De,
|
3553
|
-
disabled:
|
3553
|
+
disabled: M
|
3554
3554
|
},
|
3555
3555
|
G
|
3556
3556
|
)),
|
3557
3557
|
ce.length <= 0 && /* @__PURE__ */ f("p", { children: a })
|
3558
3558
|
] }),
|
3559
|
-
/* @__PURE__ */
|
3559
|
+
/* @__PURE__ */ C(
|
3560
3560
|
Ns,
|
3561
3561
|
{
|
3562
3562
|
isFocused: _e,
|
@@ -3569,7 +3569,7 @@ function Lc(e) {
|
|
3569
3569
|
{
|
3570
3570
|
label: G,
|
3571
3571
|
value: re,
|
3572
|
-
size:
|
3572
|
+
size: N,
|
3573
3573
|
handleChangeValue: De,
|
3574
3574
|
optionHasSelected: se
|
3575
3575
|
},
|
@@ -3582,19 +3582,19 @@ function Lc(e) {
|
|
3582
3582
|
/* @__PURE__ */ f(
|
3583
3583
|
Cs,
|
3584
3584
|
{
|
3585
|
-
disabled:
|
3585
|
+
disabled: M,
|
3586
3586
|
isFocused: _e,
|
3587
3587
|
readOnly: l,
|
3588
|
-
iconSize:
|
3588
|
+
iconSize: F,
|
3589
3589
|
isLoading: c
|
3590
3590
|
}
|
3591
3591
|
),
|
3592
|
-
/* @__PURE__ */ f(Ss, { iconSize:
|
3592
|
+
/* @__PURE__ */ f(Ss, { iconSize: F, isLoading: c }),
|
3593
3593
|
/* @__PURE__ */ f(Fs, { handleBlur: ne, isFocused: _e })
|
3594
3594
|
]
|
3595
3595
|
}
|
3596
3596
|
),
|
3597
|
-
|
3597
|
+
R && /* @__PURE__ */ f(Ee, { children: R })
|
3598
3598
|
] });
|
3599
3599
|
}
|
3600
3600
|
function bn(e) {
|
@@ -3673,10 +3673,9 @@ function As(e) {
|
|
3673
3673
|
className: i = "",
|
3674
3674
|
readOnly: c,
|
3675
3675
|
variant: l,
|
3676
|
-
size: u
|
3677
|
-
|
3678
|
-
|
3679
|
-
return /* @__PURE__ */ f("section", { id: d, className: g.trim(), onClick: n, children: t });
|
3676
|
+
size: u
|
3677
|
+
} = e, m = `arkynPhoneInputContainer ${l} ${u} ${r || c || s ? "opacity" : ""} ${a ? "errored" : ""} ${o ? "focused" : ""} ${i}`;
|
3678
|
+
return /* @__PURE__ */ f("section", { className: m.trim(), onClick: n, children: t });
|
3680
3679
|
}
|
3681
3680
|
function Is(e) {
|
3682
3681
|
const { isOpen: t, onClick: n } = e;
|
@@ -3684,7 +3683,7 @@ function Is(e) {
|
|
3684
3683
|
}
|
3685
3684
|
function Rs(e) {
|
3686
3685
|
const { country: t, isActive: n, handleChangeValue: r, size: a } = e, o = `arkynPhoneInputCountryOption ${a} ${n ? "active" : ""}`;
|
3687
|
-
return /* @__PURE__ */
|
3686
|
+
return /* @__PURE__ */ C("div", { onClick: () => r(t), className: o, children: [
|
3688
3687
|
/* @__PURE__ */ f("img", { src: t.flag, alt: t.name, className: "flag" }),
|
3689
3688
|
t.name,
|
3690
3689
|
" ",
|
@@ -3693,7 +3692,7 @@ function Rs(e) {
|
|
3693
3692
|
] });
|
3694
3693
|
}
|
3695
3694
|
function Ms(e) {
|
3696
|
-
const { children: t, isOpen: n, onSearch: r, search: a, placeholder: s } = e, o = ie(null), [i, c] =
|
3695
|
+
const { children: t, isOpen: n, onSearch: r, search: a, placeholder: s } = e, o = ie(null), [i, c] = T("bottom");
|
3697
3696
|
function l(u) {
|
3698
3697
|
r(u.target.value);
|
3699
3698
|
}
|
@@ -3706,7 +3705,7 @@ function Ms(e) {
|
|
3706
3705
|
const _ = d.getBoundingClientRect(), h = window.innerHeight, m = 300;
|
3707
3706
|
h - _.bottom < m && _.top > m ? c("top") : c("bottom");
|
3708
3707
|
})();
|
3709
|
-
}, [n]), n ? /* @__PURE__ */
|
3708
|
+
}, [n]), n ? /* @__PURE__ */ C(
|
3710
3709
|
"div",
|
3711
3710
|
{
|
3712
3711
|
className: `arkynPhoneInputCountryOptionsContainer ${i}`,
|
@@ -3731,7 +3730,7 @@ function Ms(e) {
|
|
3731
3730
|
}
|
3732
3731
|
function Ds(e) {
|
3733
3732
|
const { currentCountry: t, onClick: n } = e;
|
3734
|
-
return /* @__PURE__ */
|
3733
|
+
return /* @__PURE__ */ C("div", { className: "phoneInputSelectCountry", onClick: n, children: [
|
3735
3734
|
/* @__PURE__ */ f(
|
3736
3735
|
"img",
|
3737
3736
|
{
|
@@ -3754,23 +3753,25 @@ const $s = gn((e, t) => /* @__PURE__ */ f("input", { ref: t, ...e })), Ls = gn(
|
|
3754
3753
|
onChange: o,
|
3755
3754
|
value: i,
|
3756
3755
|
currentCountry: c,
|
3757
|
-
disabled: l
|
3758
|
-
|
3756
|
+
disabled: l,
|
3757
|
+
id: u
|
3758
|
+
} = e, [d, _] = T(!1);
|
3759
3759
|
be(() => {
|
3760
|
-
|
3760
|
+
d ? o(c.mask) : _(!0);
|
3761
3761
|
}, [c]);
|
3762
|
-
const
|
3763
|
-
function
|
3764
|
-
let
|
3765
|
-
const
|
3766
|
-
|
3762
|
+
const h = `phoneInputMask ${s}`;
|
3763
|
+
function m(g) {
|
3764
|
+
let y = bn(g.target.value);
|
3765
|
+
const k = Br(y);
|
3766
|
+
y.length > zr || (y = jr(y, xn[k]), g.target.value = y, o(y));
|
3767
3767
|
}
|
3768
3768
|
return c.code === "+55" ? /* @__PURE__ */ f(
|
3769
3769
|
"input",
|
3770
3770
|
{
|
3771
|
+
id: u,
|
3771
3772
|
value: i,
|
3772
|
-
onChange:
|
3773
|
-
className:
|
3773
|
+
onChange: m,
|
3774
|
+
className: h,
|
3774
3775
|
onFocus: n,
|
3775
3776
|
onBlur: a,
|
3776
3777
|
disabled: l,
|
@@ -3779,10 +3780,11 @@ const $s = gn((e, t) => /* @__PURE__ */ f("input", { ref: t, ...e })), Ls = gn(
|
|
3779
3780
|
) : /* @__PURE__ */ f(
|
3780
3781
|
Ar,
|
3781
3782
|
{
|
3783
|
+
id: u,
|
3782
3784
|
value: i,
|
3783
3785
|
readOnly: r,
|
3784
|
-
onChange: (
|
3785
|
-
className:
|
3786
|
+
onChange: (g) => o(g.target.value),
|
3787
|
+
className: h,
|
3786
3788
|
component: $s,
|
3787
3789
|
onFocus: n,
|
3788
3790
|
onBlur: a,
|
@@ -3813,19 +3815,19 @@ function jc(e) {
|
|
3813
3815
|
searchCountryPlaceholder: m = "Pesquisar país",
|
3814
3816
|
notFoundCountryText: g = "Nenhum país encontrado",
|
3815
3817
|
id: y
|
3816
|
-
} = e,
|
3817
|
-
if (
|
3818
|
+
} = e, k = Ps(l), [x, v] = T(!1), [w, H] = T(""), [A, N] = T(!1), [j, I] = T(k.formattedNumber || ""), [b, O] = T(() => {
|
3819
|
+
if (k.country) return k.country;
|
3818
3820
|
const L = rt.find((ne) => ne.iso === t);
|
3819
3821
|
return L || rt[30];
|
3820
|
-
}), { fieldErrors: $ } = xe(),
|
3821
|
-
function
|
3822
|
-
|
3822
|
+
}), { fieldErrors: $ } = xe(), R = ie(null), B = y || Me(), M = s || ($ == null ? void 0 : $[_]), z = !!M, F = a || o, Y = ie(null);
|
3823
|
+
function E() {
|
3824
|
+
F || x || A || (v(!0), Y.current && Y.current.focus());
|
3823
3825
|
}
|
3824
3826
|
function _e() {
|
3825
|
-
|
3827
|
+
N(!0), v(!0);
|
3826
3828
|
}
|
3827
3829
|
function X() {
|
3828
|
-
|
3830
|
+
N(!1), v(!1);
|
3829
3831
|
}
|
3830
3832
|
function Z() {
|
3831
3833
|
v(!0);
|
@@ -3843,21 +3845,20 @@ function jc(e) {
|
|
3843
3845
|
let ne = b.code;
|
3844
3846
|
return b.prefix && (ne += `-${b.prefix}`), ne += " ", ne += se(L || j), ne;
|
3845
3847
|
}
|
3846
|
-
return /* @__PURE__ */
|
3847
|
-
n && /* @__PURE__ */ f(ye, { showAsterisk: d, children: n }),
|
3848
|
-
/* @__PURE__ */
|
3848
|
+
return /* @__PURE__ */ C(ve, { children: [
|
3849
|
+
n && /* @__PURE__ */ f(ye, { htmlFor: B, showAsterisk: d, children: n }),
|
3850
|
+
/* @__PURE__ */ C(
|
3849
3851
|
As,
|
3850
3852
|
{
|
3851
|
-
|
3852
|
-
|
3853
|
-
isError: B,
|
3853
|
+
disabled: F,
|
3854
|
+
isError: z,
|
3854
3855
|
isLoading: o,
|
3855
|
-
isFocused:
|
3856
|
+
isFocused: x,
|
3856
3857
|
readOnly: i,
|
3857
3858
|
size: c,
|
3858
3859
|
variant: u,
|
3859
3860
|
className: r,
|
3860
|
-
onFocus:
|
3861
|
+
onFocus: E,
|
3861
3862
|
children: [
|
3862
3863
|
/* @__PURE__ */ f(
|
3863
3864
|
Ds,
|
@@ -3867,10 +3868,10 @@ function jc(e) {
|
|
3867
3868
|
size: c
|
3868
3869
|
}
|
3869
3870
|
),
|
3870
|
-
/* @__PURE__ */
|
3871
|
+
/* @__PURE__ */ C(
|
3871
3872
|
Ms,
|
3872
3873
|
{
|
3873
|
-
isOpen:
|
3874
|
+
isOpen: F || i ? !1 : A,
|
3874
3875
|
search: w,
|
3875
3876
|
placeholder: m,
|
3876
3877
|
onSearch: H,
|
@@ -3880,7 +3881,7 @@ function jc(e) {
|
|
3880
3881
|
{
|
3881
3882
|
country: L,
|
3882
3883
|
handleChangeValue: () => {
|
3883
|
-
O(L),
|
3884
|
+
O(L), N(!1), I(L.mask);
|
3884
3885
|
},
|
3885
3886
|
isActive: L.iso === b.iso,
|
3886
3887
|
size: c
|
@@ -3894,30 +3895,31 @@ function jc(e) {
|
|
3894
3895
|
/* @__PURE__ */ f(
|
3895
3896
|
Is,
|
3896
3897
|
{
|
3897
|
-
isOpen:
|
3898
|
+
isOpen: F || i ? !1 : A,
|
3898
3899
|
onClick: X
|
3899
3900
|
}
|
3900
3901
|
),
|
3901
3902
|
/* @__PURE__ */ f(
|
3902
3903
|
Ls,
|
3903
3904
|
{
|
3905
|
+
id: B,
|
3904
3906
|
ref: Y,
|
3905
3907
|
readonly: i,
|
3906
3908
|
currentCountry: b,
|
3907
3909
|
value: j,
|
3908
|
-
disabled:
|
3910
|
+
disabled: F,
|
3909
3911
|
onBlur: he,
|
3910
3912
|
onFocus: Z,
|
3911
3913
|
size: c,
|
3912
3914
|
onChange: (L) => {
|
3913
|
-
|
3915
|
+
I(L), h && h(te(L));
|
3914
3916
|
}
|
3915
3917
|
}
|
3916
3918
|
),
|
3917
3919
|
/* @__PURE__ */ f(
|
3918
3920
|
"input",
|
3919
3921
|
{
|
3920
|
-
ref:
|
3922
|
+
ref: R,
|
3921
3923
|
type: "hidden",
|
3922
3924
|
name: _,
|
3923
3925
|
value: te()
|
@@ -3926,7 +3928,7 @@ function jc(e) {
|
|
3926
3928
|
]
|
3927
3929
|
}
|
3928
3930
|
),
|
3929
|
-
|
3931
|
+
M && /* @__PURE__ */ f(Ee, { children: M })
|
3930
3932
|
] });
|
3931
3933
|
}
|
3932
3934
|
function Bc(e) {
|
@@ -3936,11 +3938,11 @@ function Bc(e) {
|
|
3936
3938
|
closeOnClick: r,
|
3937
3939
|
className: a = "",
|
3938
3940
|
orientation: s = "bottomLeft"
|
3939
|
-
} = e, [o, i] =
|
3941
|
+
} = e, [o, i] = T(!1), l = `arkynPopover ${s} ${o ? "visibleTrue" : "visibleFalse"} ${a}`;
|
3940
3942
|
function u() {
|
3941
3943
|
o || i(!0);
|
3942
3944
|
}
|
3943
|
-
return yt(o), /* @__PURE__ */
|
3945
|
+
return yt(o), /* @__PURE__ */ C("div", { className: l, onClick: u, children: [
|
3944
3946
|
n,
|
3945
3947
|
/* @__PURE__ */ f(
|
3946
3948
|
dt.div,
|
@@ -3960,8 +3962,14 @@ function Bc(e) {
|
|
3960
3962
|
}
|
3961
3963
|
const Hr = Se({});
|
3962
3964
|
function js(e) {
|
3963
|
-
const { children: t, size: n, isError: r, handleChange: a, value: s } = e;
|
3964
|
-
return /* @__PURE__ */ f(
|
3965
|
+
const { children: t, size: n, isError: r, handleChange: a, value: s, disabled: o } = e;
|
3966
|
+
return /* @__PURE__ */ f(
|
3967
|
+
Hr.Provider,
|
3968
|
+
{
|
3969
|
+
value: { handleChange: a, value: s, size: n, isError: r, disabled: o },
|
3970
|
+
children: t
|
3971
|
+
}
|
3972
|
+
);
|
3965
3973
|
}
|
3966
3974
|
function Bs() {
|
3967
3975
|
return Re(Hr);
|
@@ -3973,17 +3981,31 @@ function zc(e) {
|
|
3973
3981
|
disabled: r,
|
3974
3982
|
children: a,
|
3975
3983
|
className: s = "",
|
3976
|
-
|
3977
|
-
|
3978
|
-
|
3984
|
+
onClick: o,
|
3985
|
+
onFocus: i,
|
3986
|
+
...c
|
3987
|
+
} = e, {
|
3988
|
+
handleChange: l,
|
3989
|
+
size: u,
|
3990
|
+
value: d,
|
3991
|
+
isError: _,
|
3992
|
+
disabled: h
|
3993
|
+
} = Bs(), m = d === t, g = n || u, y = r || h, w = `arkynRadioBox ${g} ${m ? "checkedTrue" : "checkedFalse"} ${_ ? "errorTrue" : "errorFalse"} ${y ? "disabledTrue" : "disabledFalse"} ${s}`;
|
3994
|
+
function H(N) {
|
3995
|
+
o && o(N), l(t);
|
3996
|
+
}
|
3997
|
+
function A(N) {
|
3998
|
+
i && i(N), l(t);
|
3999
|
+
}
|
4000
|
+
return /* @__PURE__ */ C("label", { className: w.trim(), children: [
|
3979
4001
|
/* @__PURE__ */ f(
|
3980
4002
|
"button",
|
3981
4003
|
{
|
3982
4004
|
type: "button",
|
3983
|
-
disabled:
|
3984
|
-
onClick:
|
3985
|
-
onFocus:
|
3986
|
-
...
|
4005
|
+
disabled: y,
|
4006
|
+
onClick: H,
|
4007
|
+
onFocus: A,
|
4008
|
+
...c
|
3987
4009
|
}
|
3988
4010
|
),
|
3989
4011
|
a
|
@@ -4000,21 +4022,23 @@ function Hc(e) {
|
|
4000
4022
|
onChange: i,
|
4001
4023
|
size: c = "md",
|
4002
4024
|
className: l = "",
|
4003
|
-
|
4004
|
-
|
4005
|
-
|
4006
|
-
|
4025
|
+
disabled: u = !1,
|
4026
|
+
...d
|
4027
|
+
} = e, [_, h] = T(t), { fieldErrors: m } = xe();
|
4028
|
+
function g(v) {
|
4029
|
+
h(v), i && i(v);
|
4007
4030
|
}
|
4008
|
-
const
|
4009
|
-
return /* @__PURE__ */
|
4031
|
+
const y = s || (m == null ? void 0 : m[n]), k = !!y, x = `arkynRadioGroup ${c} ${l}`;
|
4032
|
+
return /* @__PURE__ */ C(ve, { children: [
|
4010
4033
|
r && /* @__PURE__ */ f(ye, { showAsterisk: a, children: r }),
|
4011
|
-
/* @__PURE__ */
|
4034
|
+
/* @__PURE__ */ C(
|
4012
4035
|
js,
|
4013
4036
|
{
|
4014
|
-
isError:
|
4037
|
+
isError: k,
|
4015
4038
|
size: c,
|
4016
|
-
value: o ||
|
4017
|
-
handleChange:
|
4039
|
+
value: o || _,
|
4040
|
+
handleChange: g,
|
4041
|
+
disabled: u,
|
4018
4042
|
children: [
|
4019
4043
|
/* @__PURE__ */ f(
|
4020
4044
|
"input",
|
@@ -4023,14 +4047,14 @@ function Hc(e) {
|
|
4023
4047
|
type: "text",
|
4024
4048
|
readOnly: !0,
|
4025
4049
|
name: n,
|
4026
|
-
value: o ||
|
4050
|
+
value: o || _
|
4027
4051
|
}
|
4028
4052
|
),
|
4029
|
-
/* @__PURE__ */ f("div", { className:
|
4053
|
+
/* @__PURE__ */ f("div", { className: x.trim(), ...d })
|
4030
4054
|
]
|
4031
4055
|
}
|
4032
4056
|
),
|
4033
|
-
|
4057
|
+
y && /* @__PURE__ */ f(Ee, { children: y })
|
4034
4058
|
] });
|
4035
4059
|
}
|
4036
4060
|
function Gc(e) {
|
@@ -4047,18 +4071,18 @@ function Gc(e) {
|
|
4047
4071
|
id: u,
|
4048
4072
|
orientation: d = "horizontalReverse",
|
4049
4073
|
..._
|
4050
|
-
} = e, h = ie(null), m = u || Me(), [g, y] =
|
4051
|
-
function
|
4052
|
-
y(!g), l && l(
|
4074
|
+
} = e, h = ie(null), m = u || Me(), [g, y] = T(r), k = typeof a == "boolean" ? a : g;
|
4075
|
+
function x() {
|
4076
|
+
y(!g), l && l(k ? o : s || "checked");
|
4053
4077
|
}
|
4054
|
-
const w = `arkynSwitch ${
|
4055
|
-
return /* @__PURE__ */
|
4056
|
-
t && /* @__PURE__ */ f(ye, { children: t }),
|
4078
|
+
const w = `arkynSwitch ${k ? "checkedTrue" : "checkedFalse"} ${n} ${c}`;
|
4079
|
+
return /* @__PURE__ */ C(ve, { orientation: d, children: [
|
4080
|
+
t && /* @__PURE__ */ f(ye, { onClick: x, children: t }),
|
4057
4081
|
/* @__PURE__ */ f(
|
4058
4082
|
"button",
|
4059
4083
|
{
|
4060
4084
|
type: "button",
|
4061
|
-
onClick:
|
4085
|
+
onClick: x,
|
4062
4086
|
className: w,
|
4063
4087
|
..._,
|
4064
4088
|
children: /* @__PURE__ */ f(
|
@@ -4068,8 +4092,8 @@ function Gc(e) {
|
|
4068
4092
|
type: "hidden",
|
4069
4093
|
name: i,
|
4070
4094
|
ref: h,
|
4071
|
-
onClick:
|
4072
|
-
value:
|
4095
|
+
onClick: x,
|
4096
|
+
value: k ? s || "checked" : o
|
4073
4097
|
}
|
4074
4098
|
)
|
4075
4099
|
}
|
@@ -4115,7 +4139,7 @@ function Uc(e) {
|
|
4115
4139
|
disabled: a = !1,
|
4116
4140
|
className: s,
|
4117
4141
|
...o
|
4118
|
-
} = e, [i, c] =
|
4142
|
+
} = e, [i, c] = T(r || ""), l = `arkynTabContainer ${s || ""}`;
|
4119
4143
|
function u(d) {
|
4120
4144
|
c(d), n && n(d);
|
4121
4145
|
}
|
@@ -4148,14 +4172,14 @@ function Kc(e) {
|
|
4148
4172
|
}
|
4149
4173
|
function Xc(e) {
|
4150
4174
|
const { className: t, children: n, ...r } = e, a = `arkynTableFooter ${t}`;
|
4151
|
-
return /* @__PURE__ */
|
4175
|
+
return /* @__PURE__ */ C("tfoot", { className: a.trim(), ...r, children: [
|
4152
4176
|
/* @__PURE__ */ f("tr", { className: "spacingRow" }),
|
4153
4177
|
/* @__PURE__ */ f("tr", { children: /* @__PURE__ */ f("th", { colSpan: 100, children: /* @__PURE__ */ f("div", { className: "arkynTableFooterContent", children: n }) }) })
|
4154
4178
|
] });
|
4155
4179
|
}
|
4156
4180
|
function Yc(e) {
|
4157
4181
|
const { className: t, children: n, ...r } = e, a = `arkynTableHeader ${t}`;
|
4158
|
-
return /* @__PURE__ */
|
4182
|
+
return /* @__PURE__ */ C("thead", { className: a.trim(), ...r, children: [
|
4159
4183
|
/* @__PURE__ */ f("tr", { children: n }),
|
4160
4184
|
/* @__PURE__ */ f("tr", { className: "spacingRow" })
|
4161
4185
|
] });
|
@@ -4178,39 +4202,39 @@ function Zc(e) {
|
|
4178
4202
|
value: m,
|
4179
4203
|
defaultValue: g,
|
4180
4204
|
placeholder: y,
|
4181
|
-
id:
|
4182
|
-
...
|
4183
|
-
} = e, { fieldErrors: v } = xe(), [w, H] =
|
4184
|
-
function
|
4185
|
-
s || !(
|
4205
|
+
id: k,
|
4206
|
+
...x
|
4207
|
+
} = e, { fieldErrors: v } = xe(), [w, H] = T(!1), A = ie(null), N = k || Me(), j = a || (v == null ? void 0 : v[l]), R = `arkynTextarea ${t} ${n} ${s || o ? "opacityTrue" : "opacityFalse"} ${!!j ? "errorTrue" : "errorFalse"} ${w ? "focusedTrue" : "focusedFalse"} ${r}`;
|
4208
|
+
function B() {
|
4209
|
+
s || !(A != null && A.current) || (H(!0), A.current.focus());
|
4186
4210
|
}
|
4187
|
-
function
|
4188
|
-
H(!0), u && u(
|
4211
|
+
function M(F) {
|
4212
|
+
H(!0), u && u(F);
|
4189
4213
|
}
|
4190
|
-
function
|
4191
|
-
H(!1), d && d(
|
4214
|
+
function z(F) {
|
4215
|
+
H(!1), d && d(F);
|
4192
4216
|
}
|
4193
|
-
return /* @__PURE__ */
|
4194
|
-
i && /* @__PURE__ */ f(ye, { showAsterisk: c, children: i }),
|
4217
|
+
return /* @__PURE__ */ C(ve, { children: [
|
4218
|
+
i && /* @__PURE__ */ f(ye, { htmlFor: N, showAsterisk: c, children: i }),
|
4195
4219
|
/* @__PURE__ */ f(
|
4196
4220
|
"section",
|
4197
4221
|
{
|
4198
4222
|
title: _,
|
4199
4223
|
style: h,
|
4200
|
-
onClick:
|
4201
|
-
className:
|
4224
|
+
onClick: B,
|
4225
|
+
className: R,
|
4202
4226
|
children: /* @__PURE__ */ f(
|
4203
4227
|
"textarea",
|
4204
4228
|
{
|
4205
|
-
id:
|
4229
|
+
id: N,
|
4206
4230
|
disabled: s,
|
4207
4231
|
readOnly: o,
|
4208
|
-
ref:
|
4209
|
-
onFocus:
|
4210
|
-
onBlur:
|
4232
|
+
ref: A,
|
4233
|
+
onFocus: M,
|
4234
|
+
onBlur: z,
|
4211
4235
|
placeholder: s && m || y,
|
4212
4236
|
value: s ? void 0 : m,
|
4213
|
-
...
|
4237
|
+
...x
|
4214
4238
|
}
|
4215
4239
|
)
|
4216
4240
|
}
|
@@ -4220,7 +4244,7 @@ function Zc(e) {
|
|
4220
4244
|
}
|
4221
4245
|
const Vr = Se({});
|
4222
4246
|
function Jc(e) {
|
4223
|
-
const { children: t = !1 } = e, [n, r] =
|
4247
|
+
const { children: t = !1 } = e, [n, r] = T([]);
|
4224
4248
|
function a(c) {
|
4225
4249
|
return !!n.some((l) => l.key === c);
|
4226
4250
|
}
|
@@ -4260,7 +4284,7 @@ function Qc(e) {
|
|
4260
4284
|
}
|
4261
4285
|
const Ur = Se({});
|
4262
4286
|
function el(e) {
|
4263
|
-
const { children: t = !1 } = e, [n, r] =
|
4287
|
+
const { children: t = !1 } = e, [n, r] = T([]);
|
4264
4288
|
function a(l) {
|
4265
4289
|
return !!n.some((u) => u.key === l);
|
4266
4290
|
}
|
@@ -4419,7 +4443,7 @@ var Ys = (e) => typeof e == "function", St = (e, t) => Ys(e) ? e(t) : e, Zs = /*
|
|
4419
4443
|
}, Jr = (e) => Object.keys(Fe).forEach((t) => Zr(e, t)), Qs = (e) => Object.keys(Fe).find((t) => Fe[t].toasts.some((n) => n.id === e)), Rt = (e = En) => (t) => {
|
4420
4444
|
Zr(t, e);
|
4421
4445
|
}, eo = { blank: 4e3, error: 4e3, success: 2e3, loading: 1 / 0, custom: 4e3 }, to = (e = {}, t = En) => {
|
4422
|
-
let [n, r] =
|
4446
|
+
let [n, r] = T(Fe[t] || Yr), a = ie(Fe[t]);
|
4423
4447
|
be(() => (a.current !== Fe[t] && r(Fe[t]), Ft.push([t, r]), () => {
|
4424
4448
|
let o = Ft.findIndex(([i]) => i === t);
|
4425
4449
|
o > -1 && Ft.splice(o, 1);
|
@@ -4487,8 +4511,8 @@ var ro = 1e3, ao = (e, t = "default") => {
|
|
4487
4511
|
}, [o]), l = nt(() => {
|
4488
4512
|
r && o({ type: 6, time: Date.now() });
|
4489
4513
|
}, [r, o]), u = nt((d, _) => {
|
4490
|
-
let { reverseOrder: h = !1, gutter: m = 8, defaultPosition: g } = _ || {}, y = n.filter((v) => (v.position || g) === (d.position || g) && v.height),
|
4491
|
-
return y.filter((v) => v.visible).slice(...h ? [
|
4514
|
+
let { reverseOrder: h = !1, gutter: m = 8, defaultPosition: g } = _ || {}, y = n.filter((v) => (v.position || g) === (d.position || g) && v.height), k = y.findIndex((v) => v.id === d.id), x = y.filter((v, w) => w < k && v.visible).length;
|
4515
|
+
return y.filter((v) => v.visible).slice(...h ? [x + 1] : [0, x]).reduce((v, w) => v + (w.height || 0) + m, 0);
|
4492
4516
|
}, [n]);
|
4493
4517
|
return be(() => {
|
4494
4518
|
n.forEach((d) => {
|
@@ -4741,7 +4765,7 @@ function rl({ children: e }) {
|
|
4741
4765
|
});
|
4742
4766
|
}
|
4743
4767
|
}
|
4744
|
-
return /* @__PURE__ */
|
4768
|
+
return /* @__PURE__ */ C(Ao.Provider, { value: { showToast: t }, children: [
|
4745
4769
|
/* @__PURE__ */ f(
|
4746
4770
|
Po,
|
4747
4771
|
{
|
@@ -5458,11 +5482,11 @@ var qo = (e, t, n) => {
|
|
5458
5482
|
var {
|
5459
5483
|
path: r,
|
5460
5484
|
node: a
|
5461
|
-
} = n, s =
|
5485
|
+
} = n, s = S.parent(e, r), o = r[r.length - 1];
|
5462
5486
|
if (o > s.children.length)
|
5463
5487
|
throw new Error('Cannot apply an "insert_node" operation at path ['.concat(r, "] because the destination is past the end of the node."));
|
5464
5488
|
if (s.children.splice(o, 0, a), t)
|
5465
|
-
for (var [i, c] of
|
5489
|
+
for (var [i, c] of D.points(t))
|
5466
5490
|
t[c] = U.transform(i, n);
|
5467
5491
|
break;
|
5468
5492
|
}
|
@@ -5473,62 +5497,62 @@ var qo = (e, t, n) => {
|
|
5473
5497
|
text: d
|
5474
5498
|
} = n;
|
5475
5499
|
if (d.length === 0) break;
|
5476
|
-
var _ =
|
5500
|
+
var _ = S.leaf(e, l), h = _.text.slice(0, u), m = _.text.slice(u);
|
5477
5501
|
if (_.text = h + d + m, t)
|
5478
|
-
for (var [g, y] of
|
5502
|
+
for (var [g, y] of D.points(t))
|
5479
5503
|
t[y] = U.transform(g, n);
|
5480
5504
|
break;
|
5481
5505
|
}
|
5482
5506
|
case "merge_node": {
|
5483
5507
|
var {
|
5484
|
-
path:
|
5485
|
-
} = n,
|
5486
|
-
if (W.isText(
|
5487
|
-
w.text +=
|
5488
|
-
else if (!W.isText(
|
5489
|
-
w.children.push(...
|
5508
|
+
path: k
|
5509
|
+
} = n, x = S.get(e, k), v = p.previous(k), w = S.get(e, v), H = S.parent(e, k), A = k[k.length - 1];
|
5510
|
+
if (W.isText(x) && W.isText(w))
|
5511
|
+
w.text += x.text;
|
5512
|
+
else if (!W.isText(x) && !W.isText(w))
|
5513
|
+
w.children.push(...x.children);
|
5490
5514
|
else
|
5491
|
-
throw new Error('Cannot apply a "merge_node" operation at path ['.concat(
|
5492
|
-
if (H.children.splice(
|
5493
|
-
for (var [
|
5494
|
-
t[j] = U.transform(
|
5515
|
+
throw new Error('Cannot apply a "merge_node" operation at path ['.concat(k, "] to nodes of different interfaces: ").concat(Ne.stringify(x), " ").concat(Ne.stringify(w)));
|
5516
|
+
if (H.children.splice(A, 1), t)
|
5517
|
+
for (var [N, j] of D.points(t))
|
5518
|
+
t[j] = U.transform(N, n);
|
5495
5519
|
break;
|
5496
5520
|
}
|
5497
5521
|
case "move_node": {
|
5498
5522
|
var {
|
5499
|
-
path:
|
5523
|
+
path: I,
|
5500
5524
|
newPath: b
|
5501
5525
|
} = n;
|
5502
|
-
if (p.isAncestor(
|
5503
|
-
throw new Error("Cannot move a path [".concat(
|
5504
|
-
var O =
|
5505
|
-
$.children.splice(
|
5506
|
-
var
|
5507
|
-
if (
|
5508
|
-
for (var [
|
5509
|
-
t[Y] = U.transform(
|
5526
|
+
if (p.isAncestor(I, b))
|
5527
|
+
throw new Error("Cannot move a path [".concat(I, "] to new path [").concat(b, "] because the destination is inside itself."));
|
5528
|
+
var O = S.get(e, I), $ = S.parent(e, I), R = I[I.length - 1];
|
5529
|
+
$.children.splice(R, 1);
|
5530
|
+
var B = p.transform(I, n), M = S.get(e, p.parent(B)), z = B[B.length - 1];
|
5531
|
+
if (M.children.splice(z, 0, O), t)
|
5532
|
+
for (var [F, Y] of D.points(t))
|
5533
|
+
t[Y] = U.transform(F, n);
|
5510
5534
|
break;
|
5511
5535
|
}
|
5512
5536
|
case "remove_node": {
|
5513
5537
|
var {
|
5514
|
-
path:
|
5515
|
-
} = n, _e =
|
5538
|
+
path: E
|
5539
|
+
} = n, _e = E[E.length - 1], X = S.parent(e, E);
|
5516
5540
|
if (X.children.splice(_e, 1), t)
|
5517
|
-
for (var [Z, he] of
|
5541
|
+
for (var [Z, he] of D.points(t)) {
|
5518
5542
|
var ce = U.transform(Z, n);
|
5519
5543
|
if (t != null && ce != null)
|
5520
5544
|
t[he] = ce;
|
5521
5545
|
else {
|
5522
5546
|
var se = void 0, te = void 0;
|
5523
|
-
for (var [L, ne] of
|
5524
|
-
if (p.compare(ne,
|
5547
|
+
for (var [L, ne] of S.texts(e))
|
5548
|
+
if (p.compare(ne, E) === -1)
|
5525
5549
|
se = [L, ne];
|
5526
5550
|
else {
|
5527
5551
|
te = [L, ne];
|
5528
5552
|
break;
|
5529
5553
|
}
|
5530
5554
|
var Te = !1;
|
5531
|
-
se && te && (p.equals(te[1],
|
5555
|
+
se && te && (p.equals(te[1], E) ? Te = !p.hasPrevious(te[1]) : Te = p.common(se[1], E).length < p.common(te[1], E).length), se && !Te ? (Z.path = se[1], Z.offset = se[0].text.length) : te ? (Z.path = te[1], Z.offset = 0) : t = null;
|
5532
5556
|
}
|
5533
5557
|
}
|
5534
5558
|
break;
|
@@ -5540,9 +5564,9 @@ var qo = (e, t, n) => {
|
|
5540
5564
|
text: G
|
5541
5565
|
} = n;
|
5542
5566
|
if (G.length === 0) break;
|
5543
|
-
var re =
|
5567
|
+
var re = S.leaf(e, De), $e = re.text.slice(0, ke), qt = re.text.slice(ke + G.length);
|
5544
5568
|
if (re.text = $e + qt, t)
|
5545
|
-
for (var [ue, Le] of
|
5569
|
+
for (var [ue, Le] of D.points(t))
|
5546
5570
|
t[Le] = U.transform(ue, n);
|
5547
5571
|
break;
|
5548
5572
|
}
|
@@ -5554,7 +5578,7 @@ var qo = (e, t, n) => {
|
|
5554
5578
|
} = n;
|
5555
5579
|
if (Ve.length === 0)
|
5556
5580
|
throw new Error("Cannot set properties on the root node!");
|
5557
|
-
var Kt =
|
5581
|
+
var Kt = S.get(e, Ve);
|
5558
5582
|
for (var Qe in Wt) {
|
5559
5583
|
if (Qe === "children" || Qe === "text")
|
5560
5584
|
throw new Error('Cannot set the "'.concat(Qe, '" property of nodes!'));
|
@@ -5573,7 +5597,7 @@ var qo = (e, t, n) => {
|
|
5573
5597
|
t = Ue;
|
5574
5598
|
else {
|
5575
5599
|
if (t == null) {
|
5576
|
-
if (!
|
5600
|
+
if (!D.isRange(Ue))
|
5577
5601
|
throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(Ne.stringify(Ue), " when there is no current selection."));
|
5578
5602
|
t = it({}, Ue);
|
5579
5603
|
}
|
@@ -5597,7 +5621,7 @@ var qo = (e, t, n) => {
|
|
5597
5621
|
} = n;
|
5598
5622
|
if (tt.length === 0)
|
5599
5623
|
throw new Error('Cannot apply a "split_node" operation at path ['.concat(tt, "] because the root node cannot be split."));
|
5600
|
-
var qe =
|
5624
|
+
var qe = S.get(e, tt), Ta = S.parent(e, tt), Oa = tt[tt.length - 1], Xt;
|
5601
5625
|
if (W.isText(qe)) {
|
5602
5626
|
var Pa = qe.text.slice(0, kt), Aa = qe.text.slice(kt);
|
5603
5627
|
qe.text = Pa, Xt = it(it({}, Gn), {}, {
|
@@ -5610,7 +5634,7 @@ var qo = (e, t, n) => {
|
|
5610
5634
|
});
|
5611
5635
|
}
|
5612
5636
|
if (Ta.children.splice(Oa + 1, 0, Xt), t)
|
5613
|
-
for (var [Ma, Da] of
|
5637
|
+
for (var [Ma, Da] of D.points(t))
|
5614
5638
|
t[Da] = U.transform(Ma, n);
|
5615
5639
|
break;
|
5616
5640
|
}
|
@@ -5732,7 +5756,7 @@ function Jo(e) {
|
|
5732
5756
|
}
|
5733
5757
|
return e;
|
5734
5758
|
}
|
5735
|
-
var
|
5759
|
+
var D = {
|
5736
5760
|
edges(e) {
|
5737
5761
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, {
|
5738
5762
|
reverse: n = !1
|
@@ -5740,27 +5764,27 @@ var M = {
|
|
5740
5764
|
anchor: r,
|
5741
5765
|
focus: a
|
5742
5766
|
} = e;
|
5743
|
-
return
|
5767
|
+
return D.isBackward(e) === n ? [r, a] : [a, r];
|
5744
5768
|
},
|
5745
5769
|
end(e) {
|
5746
|
-
var [, t] =
|
5770
|
+
var [, t] = D.edges(e);
|
5747
5771
|
return t;
|
5748
5772
|
},
|
5749
5773
|
equals(e, t) {
|
5750
5774
|
return U.equals(e.anchor, t.anchor) && U.equals(e.focus, t.focus);
|
5751
5775
|
},
|
5752
5776
|
includes(e, t) {
|
5753
|
-
if (
|
5754
|
-
if (
|
5777
|
+
if (D.isRange(t)) {
|
5778
|
+
if (D.includes(e, t.anchor) || D.includes(e, t.focus))
|
5755
5779
|
return !0;
|
5756
|
-
var [n, r] =
|
5780
|
+
var [n, r] = D.edges(e), [a, s] = D.edges(t);
|
5757
5781
|
return U.isBefore(n, a) && U.isAfter(r, s);
|
5758
5782
|
}
|
5759
|
-
var [o, i] =
|
5783
|
+
var [o, i] = D.edges(e), c = !1, l = !1;
|
5760
5784
|
return U.isPoint(t) ? (c = U.compare(t, o) >= 0, l = U.compare(t, i) <= 0) : (c = p.compare(t, o.path) >= 0, l = p.compare(t, i.path) <= 0), c && l;
|
5761
5785
|
},
|
5762
5786
|
intersection(e, t) {
|
5763
|
-
var n = ht(e, Zo), [r, a] =
|
5787
|
+
var n = ht(e, Zo), [r, a] = D.edges(e), [s, o] = D.edges(t), i = U.isBefore(r, s) ? s : r, c = U.isBefore(a, o) ? a : o;
|
5764
5788
|
return U.isBefore(c, i) ? null : Jo({
|
5765
5789
|
anchor: i,
|
5766
5790
|
focus: c
|
@@ -5781,10 +5805,10 @@ var M = {
|
|
5781
5805
|
return U.equals(t, n);
|
5782
5806
|
},
|
5783
5807
|
isExpanded(e) {
|
5784
|
-
return !
|
5808
|
+
return !D.isCollapsed(e);
|
5785
5809
|
},
|
5786
5810
|
isForward(e) {
|
5787
|
-
return !
|
5811
|
+
return !D.isBackward(e);
|
5788
5812
|
},
|
5789
5813
|
isRange(e) {
|
5790
5814
|
return oe(e) && U.isPoint(e.anchor) && U.isPoint(e.focus);
|
@@ -5793,7 +5817,7 @@ var M = {
|
|
5793
5817
|
yield [e.anchor, "anchor"], yield [e.focus, "focus"];
|
5794
5818
|
},
|
5795
5819
|
start(e) {
|
5796
|
-
var [t] =
|
5820
|
+
var [t] = D.edges(e);
|
5797
5821
|
return t;
|
5798
5822
|
},
|
5799
5823
|
transform(e, t) {
|
@@ -5805,9 +5829,9 @@ var M = {
|
|
5805
5829
|
affinity: a = "inward"
|
5806
5830
|
} = n, s, o;
|
5807
5831
|
if (a === "inward") {
|
5808
|
-
var i =
|
5809
|
-
|
5810
|
-
} else a === "outward" ?
|
5832
|
+
var i = D.isCollapsed(r);
|
5833
|
+
D.isForward(r) ? (s = "forward", o = i ? s : "backward") : (s = "backward", o = i ? s : "forward");
|
5834
|
+
} else a === "outward" ? D.isForward(r) ? (s = "backward", o = "forward") : (s = "forward", o = "backward") : (s = a, o = a);
|
5811
5835
|
var c = U.transform(r.anchor, t, {
|
5812
5836
|
affinity: s
|
5813
5837
|
}), l = U.transform(r.focus, t, {
|
@@ -5818,9 +5842,9 @@ var M = {
|
|
5818
5842
|
r.anchor = c, r.focus = l;
|
5819
5843
|
});
|
5820
5844
|
}
|
5821
|
-
}, sr = (e) => oe(e) &&
|
5845
|
+
}, sr = (e) => oe(e) && S.isNodeList(e.children) && !pe.isEditor(e), je = {
|
5822
5846
|
isAncestor(e) {
|
5823
|
-
return oe(e) &&
|
5847
|
+
return oe(e) && S.isNodeList(e.children);
|
5824
5848
|
},
|
5825
5849
|
isElement: sr,
|
5826
5850
|
isElementList(e) {
|
@@ -5839,9 +5863,9 @@ var M = {
|
|
5839
5863
|
return !1;
|
5840
5864
|
return !0;
|
5841
5865
|
}
|
5842
|
-
}, Qo = ["children"], ei = ["text"], or = /* @__PURE__ */ new WeakMap(),
|
5866
|
+
}, Qo = ["children"], ei = ["text"], or = /* @__PURE__ */ new WeakMap(), S = {
|
5843
5867
|
ancestor(e, t) {
|
5844
|
-
var n =
|
5868
|
+
var n = S.get(e, t);
|
5845
5869
|
if (W.isText(n))
|
5846
5870
|
throw new Error("Cannot get the ancestor node at path [".concat(t, "] because it refers to a text node instead: ").concat(Ne.stringify(n)));
|
5847
5871
|
return n;
|
@@ -5850,7 +5874,7 @@ var M = {
|
|
5850
5874
|
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
5851
5875
|
return function* () {
|
5852
5876
|
for (var r of p.ancestors(t, n)) {
|
5853
|
-
var a =
|
5877
|
+
var a = S.ancestor(e, r), s = [a, r];
|
5854
5878
|
yield s;
|
5855
5879
|
}
|
5856
5880
|
}();
|
@@ -5868,20 +5892,20 @@ var M = {
|
|
5868
5892
|
return function* () {
|
5869
5893
|
for (var {
|
5870
5894
|
reverse: r = !1
|
5871
|
-
} = n, a =
|
5895
|
+
} = n, a = S.ancestor(e, t), {
|
5872
5896
|
children: s
|
5873
5897
|
} = a, o = r ? s.length - 1 : 0; r ? o >= 0 : o < s.length; ) {
|
5874
|
-
var i =
|
5898
|
+
var i = S.child(a, o), c = t.concat(o);
|
5875
5899
|
yield [i, c], o = r ? o - 1 : o + 1;
|
5876
5900
|
}
|
5877
5901
|
}();
|
5878
5902
|
},
|
5879
5903
|
common(e, t, n) {
|
5880
|
-
var r = p.common(t, n), a =
|
5904
|
+
var r = p.common(t, n), a = S.get(e, r);
|
5881
5905
|
return [a, r];
|
5882
5906
|
},
|
5883
5907
|
descendant(e, t) {
|
5884
|
-
var n =
|
5908
|
+
var n = S.get(e, t);
|
5885
5909
|
if (pe.isEditor(n))
|
5886
5910
|
throw new Error("Cannot get the descendant node at path [".concat(t, "] because it refers to the root editor node instead: ").concat(Ne.stringify(n)));
|
5887
5911
|
return n;
|
@@ -5889,14 +5913,14 @@ var M = {
|
|
5889
5913
|
descendants(e) {
|
5890
5914
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
5891
5915
|
return function* () {
|
5892
|
-
for (var [n, r] of
|
5916
|
+
for (var [n, r] of S.nodes(e, t))
|
5893
5917
|
r.length !== 0 && (yield [n, r]);
|
5894
5918
|
}();
|
5895
5919
|
},
|
5896
5920
|
elements(e) {
|
5897
5921
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
5898
5922
|
return function* () {
|
5899
|
-
for (var [n, r] of
|
5923
|
+
for (var [n, r] of S.nodes(e, t))
|
5900
5924
|
je.isElement(n) && (yield [n, r]);
|
5901
5925
|
}();
|
5902
5926
|
},
|
@@ -5910,7 +5934,7 @@ var M = {
|
|
5910
5934
|
}
|
5911
5935
|
},
|
5912
5936
|
first(e, t) {
|
5913
|
-
for (var n = t.slice(), r =
|
5937
|
+
for (var n = t.slice(), r = S.get(e, n); r && !(W.isText(r) || r.children.length === 0); )
|
5914
5938
|
r = r.children[0], n.push(0);
|
5915
5939
|
return [r, n];
|
5916
5940
|
},
|
@@ -5920,24 +5944,24 @@ var M = {
|
|
5920
5944
|
var n = Fn({
|
5921
5945
|
children: e.children
|
5922
5946
|
}, (r) => {
|
5923
|
-
var [a, s] =
|
5947
|
+
var [a, s] = D.edges(t), o = S.nodes(r, {
|
5924
5948
|
reverse: !0,
|
5925
5949
|
pass: (_) => {
|
5926
5950
|
var [, h] = _;
|
5927
|
-
return !
|
5951
|
+
return !D.includes(t, h);
|
5928
5952
|
}
|
5929
5953
|
});
|
5930
5954
|
for (var [, i] of o) {
|
5931
|
-
if (!
|
5932
|
-
var c =
|
5955
|
+
if (!D.includes(t, i)) {
|
5956
|
+
var c = S.parent(r, i), l = i[i.length - 1];
|
5933
5957
|
c.children.splice(l, 1);
|
5934
5958
|
}
|
5935
5959
|
if (p.equals(i, s.path)) {
|
5936
|
-
var u =
|
5960
|
+
var u = S.leaf(r, i);
|
5937
5961
|
u.text = u.text.slice(0, s.offset);
|
5938
5962
|
}
|
5939
5963
|
if (p.equals(i, a.path)) {
|
5940
|
-
var d =
|
5964
|
+
var d = S.leaf(r, i);
|
5941
5965
|
d.text = d.text.slice(a.offset);
|
5942
5966
|
}
|
5943
5967
|
}
|
@@ -5972,18 +5996,18 @@ var M = {
|
|
5972
5996
|
var t = or.get(e);
|
5973
5997
|
if (t !== void 0)
|
5974
5998
|
return t;
|
5975
|
-
var n = e.every((r) =>
|
5999
|
+
var n = e.every((r) => S.isNode(r));
|
5976
6000
|
return or.set(e, n), n;
|
5977
6001
|
},
|
5978
6002
|
last(e, t) {
|
5979
|
-
for (var n = t.slice(), r =
|
6003
|
+
for (var n = t.slice(), r = S.get(e, n); r && !(W.isText(r) || r.children.length === 0); ) {
|
5980
6004
|
var a = r.children.length - 1;
|
5981
6005
|
r = r.children[a], n.push(a);
|
5982
6006
|
}
|
5983
6007
|
return [r, n];
|
5984
6008
|
},
|
5985
6009
|
leaf(e, t) {
|
5986
|
-
var n =
|
6010
|
+
var n = S.get(e, t);
|
5987
6011
|
if (!W.isText(n))
|
5988
6012
|
throw new Error("Cannot get the leaf node at path [".concat(t, "] because it refers to a non-leaf node: ").concat(Ne.stringify(n)));
|
5989
6013
|
return n;
|
@@ -5992,7 +6016,7 @@ var M = {
|
|
5992
6016
|
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
5993
6017
|
return function* () {
|
5994
6018
|
for (var r of p.levels(t, n)) {
|
5995
|
-
var a =
|
6019
|
+
var a = S.get(e, r);
|
5996
6020
|
yield [a, r];
|
5997
6021
|
}
|
5998
6022
|
}();
|
@@ -6013,40 +6037,40 @@ var M = {
|
|
6013
6037
|
if (o.has(c) || (yield [c, i]), !o.has(c) && !W.isText(c) && c.children.length !== 0 && (n == null || n([c, i]) === !1)) {
|
6014
6038
|
o.add(c);
|
6015
6039
|
var l = r ? c.children.length - 1 : 0;
|
6016
|
-
p.isAncestor(i, a) && (l = a[i.length]), i = i.concat(l), c =
|
6040
|
+
p.isAncestor(i, a) && (l = a[i.length]), i = i.concat(l), c = S.get(e, i);
|
6017
6041
|
continue;
|
6018
6042
|
}
|
6019
6043
|
if (i.length === 0)
|
6020
6044
|
break;
|
6021
6045
|
if (!r) {
|
6022
6046
|
var u = p.next(i);
|
6023
|
-
if (
|
6024
|
-
i = u, c =
|
6047
|
+
if (S.has(e, u)) {
|
6048
|
+
i = u, c = S.get(e, i);
|
6025
6049
|
continue;
|
6026
6050
|
}
|
6027
6051
|
}
|
6028
6052
|
if (r && i[i.length - 1] !== 0) {
|
6029
6053
|
var d = p.previous(i);
|
6030
|
-
i = d, c =
|
6054
|
+
i = d, c = S.get(e, i);
|
6031
6055
|
continue;
|
6032
6056
|
}
|
6033
|
-
i = p.parent(i), c =
|
6057
|
+
i = p.parent(i), c = S.get(e, i), o.add(c);
|
6034
6058
|
}
|
6035
6059
|
}();
|
6036
6060
|
},
|
6037
6061
|
parent(e, t) {
|
6038
|
-
var n = p.parent(t), r =
|
6062
|
+
var n = p.parent(t), r = S.get(e, n);
|
6039
6063
|
if (W.isText(r))
|
6040
6064
|
throw new Error("Cannot get the parent of path [".concat(t, "] because it does not exist in the root."));
|
6041
6065
|
return r;
|
6042
6066
|
},
|
6043
6067
|
string(e) {
|
6044
|
-
return W.isText(e) ? e.text : e.children.map(
|
6068
|
+
return W.isText(e) ? e.text : e.children.map(S.string).join("");
|
6045
6069
|
},
|
6046
6070
|
texts(e) {
|
6047
6071
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
6048
6072
|
return function* () {
|
6049
|
-
for (var [n, r] of
|
6073
|
+
for (var [n, r] of S.nodes(e, t))
|
6050
6074
|
W.isText(n) && (yield [n, r]);
|
6051
6075
|
}();
|
6052
6076
|
}
|
@@ -6081,7 +6105,7 @@ var ct = {
|
|
6081
6105
|
return !1;
|
6082
6106
|
switch (e.type) {
|
6083
6107
|
case "insert_node":
|
6084
|
-
return p.isPath(e.path) &&
|
6108
|
+
return p.isPath(e.path) && S.isNode(e.node);
|
6085
6109
|
case "insert_text":
|
6086
6110
|
return typeof e.offset == "number" && typeof e.text == "string" && p.isPath(e.path);
|
6087
6111
|
case "merge_node":
|
@@ -6089,13 +6113,13 @@ var ct = {
|
|
6089
6113
|
case "move_node":
|
6090
6114
|
return p.isPath(e.path) && p.isPath(e.newPath);
|
6091
6115
|
case "remove_node":
|
6092
|
-
return p.isPath(e.path) &&
|
6116
|
+
return p.isPath(e.path) && S.isNode(e.node);
|
6093
6117
|
case "remove_text":
|
6094
6118
|
return typeof e.offset == "number" && typeof e.text == "string" && p.isPath(e.path);
|
6095
6119
|
case "set_node":
|
6096
6120
|
return p.isPath(e.path) && oe(e.properties) && oe(e.newProperties);
|
6097
6121
|
case "set_selection":
|
6098
|
-
return e.properties === null &&
|
6122
|
+
return e.properties === null && D.isRange(e.newProperties) || e.newProperties === null && D.isRange(e.properties) || oe(e.properties) && oe(e.newProperties);
|
6099
6123
|
case "split_node":
|
6100
6124
|
return p.isPath(e.path) && typeof e.position == "number" && oe(e.properties);
|
6101
6125
|
default:
|
@@ -6191,7 +6215,7 @@ var ct = {
|
|
6191
6215
|
return t;
|
6192
6216
|
if (!oe(e))
|
6193
6217
|
return !1;
|
6194
|
-
var n = typeof e.addMark == "function" && typeof e.apply == "function" && typeof e.deleteFragment == "function" && typeof e.insertBreak == "function" && typeof e.insertSoftBreak == "function" && typeof e.insertFragment == "function" && typeof e.insertNode == "function" && typeof e.insertText == "function" && typeof e.isElementReadOnly == "function" && typeof e.isInline == "function" && typeof e.isSelectable == "function" && typeof e.isVoid == "function" && typeof e.normalizeNode == "function" && typeof e.onChange == "function" && typeof e.removeMark == "function" && typeof e.getDirtyPaths == "function" && (e.marks === null || oe(e.marks)) && (e.selection === null ||
|
6218
|
+
var n = typeof e.addMark == "function" && typeof e.apply == "function" && typeof e.deleteFragment == "function" && typeof e.insertBreak == "function" && typeof e.insertSoftBreak == "function" && typeof e.insertFragment == "function" && typeof e.insertNode == "function" && typeof e.insertText == "function" && typeof e.isElementReadOnly == "function" && typeof e.isInline == "function" && typeof e.isSelectable == "function" && typeof e.isVoid == "function" && typeof e.normalizeNode == "function" && typeof e.onChange == "function" && typeof e.removeMark == "function" && typeof e.getDirtyPaths == "function" && (e.marks === null || oe(e.marks)) && (e.selection === null || D.isRange(e.selection)) && S.isNodeList(e.children) && ct.isOperationList(e.operations);
|
6195
6219
|
return cr.set(e, n), n;
|
6196
6220
|
}, pe = {
|
6197
6221
|
above(e, t) {
|
@@ -6525,7 +6549,7 @@ var W = {
|
|
6525
6549
|
decorations(e, t) {
|
6526
6550
|
var n = [Pe({}, e)];
|
6527
6551
|
for (var r of t) {
|
6528
|
-
var a = ht(r, ri), [s, o] =
|
6552
|
+
var a = ht(r, ri), [s, o] = D.edges(r), i = [], c = 0, l = s.offset, u = o.offset;
|
6529
6553
|
for (var d of n) {
|
6530
6554
|
var {
|
6531
6555
|
length: _
|
@@ -6540,19 +6564,19 @@ var W = {
|
|
6540
6564
|
}
|
6541
6565
|
var m = d, g = void 0, y = void 0;
|
6542
6566
|
if (u < c) {
|
6543
|
-
var
|
6567
|
+
var k = u - h;
|
6544
6568
|
y = Pe(Pe({}, m), {}, {
|
6545
|
-
text: m.text.slice(
|
6569
|
+
text: m.text.slice(k)
|
6546
6570
|
}), m = Pe(Pe({}, m), {}, {
|
6547
|
-
text: m.text.slice(0,
|
6571
|
+
text: m.text.slice(0, k)
|
6548
6572
|
});
|
6549
6573
|
}
|
6550
6574
|
if (l > h) {
|
6551
|
-
var
|
6575
|
+
var x = l - h;
|
6552
6576
|
g = Pe(Pe({}, m), {}, {
|
6553
|
-
text: m.text.slice(0,
|
6577
|
+
text: m.text.slice(0, x)
|
6554
6578
|
}), m = Pe(Pe({}, m), {}, {
|
6555
|
-
text: m.text.slice(
|
6579
|
+
text: m.text.slice(x)
|
6556
6580
|
});
|
6557
6581
|
}
|
6558
6582
|
Object.assign(m, a), g && i.push(g), i.push(m), y && i.push(y);
|
@@ -6581,16 +6605,16 @@ var si = {
|
|
6581
6605
|
} = n, {
|
6582
6606
|
at: a = ai(e)
|
6583
6607
|
} = n;
|
6584
|
-
if (p.isPath(a) && (a = pe.range(e, a)),
|
6585
|
-
if (
|
6608
|
+
if (p.isPath(a) && (a = pe.range(e, a)), D.isRange(a))
|
6609
|
+
if (D.isCollapsed(a))
|
6586
6610
|
a = a.anchor;
|
6587
6611
|
else {
|
6588
|
-
var s =
|
6612
|
+
var s = D.end(a);
|
6589
6613
|
if (!r && pe.void(e, {
|
6590
6614
|
at: s
|
6591
6615
|
}))
|
6592
6616
|
return;
|
6593
|
-
var o =
|
6617
|
+
var o = D.start(a), i = pe.pointRef(e, o), c = pe.pointRef(e, s);
|
6594
6618
|
mr.delete(e, {
|
6595
6619
|
at: a,
|
6596
6620
|
voids: r
|
@@ -8307,12 +8331,12 @@ var $n = {}, Ln = {}, Cr = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g, Ai = /\n/g, Ii = /
|
|
8307
8331
|
var m = s(), g = c(Ri);
|
8308
8332
|
if (g) {
|
8309
8333
|
if (d(), !c(Mi)) return i("property missing ':'");
|
8310
|
-
var y = c(Di),
|
8334
|
+
var y = c(Di), k = m({
|
8311
8335
|
type: zi,
|
8312
8336
|
property: Er(g[0].replace(Cr, Ke)),
|
8313
8337
|
value: y ? Er(y[0].replace(Cr, Ke)) : Ke
|
8314
8338
|
});
|
8315
|
-
return c($i),
|
8339
|
+
return c($i), k;
|
8316
8340
|
}
|
8317
8341
|
}
|
8318
8342
|
function h() {
|