@nxgt/material 2.19.0 → 2.20.0
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/CHANGELOG.md +21 -0
- package/dist/{_Uint8Array-B6RHzY7k.js → _Uint8Array-DGVY6NfN.js} +1 -1
- package/dist/{_overRest-Cs3RIAVd.js → _overRest-DCKNcrF0.js} +1 -1
- package/dist/{async-slice-CgbRYTRY.js → async-slice-DAVXvBm1.js} +3 -3
- package/dist/{blockDiagram-BEXU5L5S-D5ptXmBP.js → blockDiagram-BEXU5L5S-BrCVxVRd.js} +2 -2
- package/dist/{chunk-3FUC2YCW-al8CepY8.js → chunk-3FUC2YCW-DWaNSANO.js} +2 -2
- package/dist/{chunk-7M6MHVWA-BERAnmfo.js → chunk-7M6MHVWA-x-N4hnls.js} +1 -1
- package/dist/{chunk-GNY47TPC-DMMDhC9T.js → chunk-GNY47TPC-Dzk3o85s.js} +4 -4
- package/dist/{chunk-NETBCI7D-CsMBdu5o.js → chunk-NETBCI7D-WvAAUJne.js} +1 -1
- package/dist/{chunk-Z7XXMR3K-CLYmaWUD.js → chunk-Z7XXMR3K-DY6U0Uq4.js} +1 -1
- package/dist/{classDiagram-v2-NBCMYWYE-C-6ddqhF.js → classDiagram-v2-NBCMYWYE-QeFmLU9L.js} +2 -2
- package/dist/components/base-content.css +64 -4
- package/dist/{components-C5y9FL-6.js → components-DH5dpaU8.js} +20768 -20704
- package/dist/components.js +5 -5
- package/dist/{dagre-6A5THRUB-Ck8np52h.js → dagre-6A5THRUB-D-NdHe_L.js} +11 -11
- package/dist/{diagram-22UHCM2B-oIfSvE0L.js → diagram-22UHCM2B-DZ4jejn3.js} +2 -2
- package/dist/{diagram-3UASUU5V-CAG93Qkg.js → diagram-3UASUU5V-DRoFk6qc.js} +1 -1
- package/dist/dnd.js +1 -1
- package/dist/{elk-276RUBZZ-BfEvNh_f.js → elk-276RUBZZ-BG0kHR2f.js} +3 -3
- package/dist/{erDiagram-OPXOYQCR-B966QSkJ.js → erDiagram-OPXOYQCR-B6XRmJuU.js} +2 -2
- package/dist/{field-blur-B6VqkpE6.js → field-blur-B1VUvTws.js} +941 -927
- package/dist/{flowDiagram-KWPJA3E3-CzUHW7vw.js → flowDiagram-KWPJA3E3-BghxpN0G.js} +3 -3
- package/dist/{ganttDiagram-FUAMR5RP-B4JstFXN.js → ganttDiagram-FUAMR5RP-C3aoaoXQ.js} +1 -1
- package/dist/{graphlib-CORKO6lR.js → graphlib-Dc5Siwxn.js} +6 -6
- package/dist/hooks.js +2 -2
- package/dist/{i18n-provider-BC7MMAID.js → i18n-provider-Cq_VScPv.js} +1 -1
- package/dist/i18n.js +6 -6
- package/dist/{isArrayLikeObject-gzSxxbGJ.js → isArrayLikeObject-DeHDPOEB.js} +3 -3
- package/dist/{isEmpty-SD8ldTK-.js → isEmpty-Sic-RRp7.js} +3 -3
- package/dist/{journeyDiagram-ZHPQQLJL-DcgTl4Bw.js → journeyDiagram-ZHPQQLJL-DcUX0asi.js} +1 -1
- package/dist/lib/components/ui/collections/data-table/data-table-density.d.ts +15 -0
- package/dist/lib/components/ui/collections/data-table/data-table.d.ts +1 -1
- package/dist/lib/components/ui/collections/data-table/types.d.ts +7 -0
- package/dist/lib/components/ui/overlays/dialog/dialog-outside.d.ts +4 -2
- package/dist/lib/components/ui/overlays/dialog/dialog-parts.d.ts +7 -0
- package/dist/lib/components/ui/overlays/dialog/dialog.d.ts +2 -5
- package/dist/lib/components/ui/overlays/dialog/in-dialog.d.ts +13 -0
- package/dist/lib/components/ui/overlays/menubar/menubar-items.d.ts +18 -0
- package/dist/lib/components/ui/overlays/menubar/menubar-sub.d.ts +8 -0
- package/dist/lib/components/ui/overlays/menubar/menubar.d.ts +3 -21
- package/dist/lib/components/ui/overlays/sheet/sheet-parts.d.ts +7 -0
- package/dist/lib/components/ui/overlays/sheet/sheet.d.ts +2 -5
- package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-chips.d.ts +2 -0
- package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-popup.d.ts +2 -1
- package/dist/lib/components/ui/selection/combobox/combobox-content.d.ts +14 -0
- package/dist/lib/components/ui/selection/combobox/combobox.d.ts +1 -4
- package/dist/lib/i18n/resources/en/en.d.ts +1 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +1 -0
- package/dist/lib/i18n/resources/fr/fr.d.ts +1 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +1 -0
- package/dist/lib/i18n/resources/resources.d.ts +2 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib.js +2 -2
- package/dist/main.js +11 -11
- package/dist/map.js +8 -8
- package/dist/material.css +1 -1
- package/dist/{merge-Cek5eQP5.js → merge-VyOzRzYB.js} +4 -4
- package/dist/{mermaid.core-DZMjEtsT.js → mermaid.core-DLu6PrQ9.js} +21 -21
- package/dist/{mindmap-definition-NLK3R4M7-BWaJFjFb.js → mindmap-definition-NLK3R4M7-B7Y8Yx12.js} +2 -2
- package/dist/{pieDiagram-5QR66LMP-C8iomTeg.js → pieDiagram-5QR66LMP-Bv9VMy5P.js} +1 -1
- package/dist/print.js +2 -2
- package/dist/{quadrantDiagram-O4NWA36T-D529X2yn.js → quadrantDiagram-O4NWA36T-Dr2CLVD8.js} +1 -1
- package/dist/{requirementDiagram-PLB6GJNP-Cs5ieS_S.js → requirementDiagram-PLB6GJNP-XuNWo4K8.js} +2 -2
- package/dist/{sankeyDiagram-IPEJSGJF-BOIAba-k.js → sankeyDiagram-IPEJSGJF-DzXzUNs5.js} +1 -1
- package/dist/{sortable-provider-DNmv3XmW.js → sortable-provider-XneXCqY1.js} +1 -1
- package/dist/{stateDiagram-v2-GCMORJYK-CT46B5KK.js → stateDiagram-v2-GCMORJYK-BN2OBfZa.js} +2 -2
- package/dist/{stored-language-FHwsTPoM.js → stored-language-DqlfjXt8.js} +2 -0
- package/dist/{swimlanes-2SLR337P-C8TrgNLm.js → swimlanes-2SLR337P-Ma7iLhhV.js} +3 -3
- package/dist/{swimlanesDiagram-TC7HE7FX-Dii9S4bC.js → swimlanesDiagram-TC7HE7FX-DWBnIppx.js} +3 -3
- package/dist/{timeline-definition-EJHVYXUP-K00somtn.js → timeline-definition-EJHVYXUP-BBwvY1Xf.js} +1 -1
- package/dist/{translate-material-cZ6VSQ98.js → translate-material-B6HO6ykL.js} +2 -2
- package/dist/{translator-DX_ArUA5.js → translator-B_lmafJN.js} +1 -1
- package/dist/{use-heading-spy-DR1jat6E.js → use-heading-spy-D1Ifooi5.js} +2 -2
- package/dist/{use-material-translation-W6jOKCbO.js → use-material-translation-Bp4ECeT4.js} +2 -2
- package/dist/{usecaseDiagram-POWQR4AR-liF9q6mE.js → usecaseDiagram-POWQR4AR-B1HduAbh.js} +2 -2
- package/dist/{xychartDiagram-PMCCYNJV-B9Qx3wAO.js → xychartDiagram-PMCCYNJV-ByjPOY-5.js} +1 -1
- package/docs/components/data-table-filter-and-lists.md +3 -1
- package/docs/guides/forms.md +49 -0
- package/docs/guides/i18n.md +2 -1
- package/docs/troubleshooting.md +27 -0
- package/lib/components/base-content.css +64 -4
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { n as e } from "./rolldown-runtime-BFFgcFxR.js";
|
|
2
2
|
import { t } from "./utils-DC8bw9A_.js";
|
|
3
|
-
import { _t as n, a as r, at as i, ct as a, d as o, dt as s, et as c, g as l, h as u, ht as d, i as f, it as p, lt as m, m as h, mt as g, n as _, nt as v, o as y, ot as b, p as x, pt as S, r as C, rt as w, st as T, t as
|
|
4
|
-
import { t as
|
|
5
|
-
import { X as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import * as
|
|
8
|
-
import
|
|
9
|
-
import { getNonce as
|
|
10
|
-
import { inertOthers as
|
|
11
|
-
import { forwardEscape as
|
|
12
|
-
import { describedBy as
|
|
13
|
-
import { layerOf as
|
|
14
|
-
import { focusHandle as
|
|
3
|
+
import { _t as n, a as r, at as i, ct as a, d as o, dt as s, et as c, g as l, h as u, ht as d, i as f, it as p, lt as m, m as h, mt as g, n as _, nt as v, o as y, ot as b, p as x, pt as S, r as C, rt as w, st as T, t as E, tt as ee } from "./icon-button-B1nN3J6B.js";
|
|
4
|
+
import { t as te } from "./use-material-translation-Bp4ECeT4.js";
|
|
5
|
+
import { X as ne } from "lucide-react";
|
|
6
|
+
import { Fragment as re, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
7
|
+
import * as k from "react";
|
|
8
|
+
import A, { Activity as ie, Children as j, Fragment as ae, cloneElement as oe, createContext as se, isValidElement as ce, use as le, useCallback as M, useContext as ue, useEffect as de, useId as fe, useLayoutEffect as pe, useMemo as me, useRef as N, useState as he } from "react";
|
|
9
|
+
import { getNonce as ge } from "@nxgt/material-core/csp-nonce";
|
|
10
|
+
import { inertOthers as _e } from "@nxgt/material-core/inert-others";
|
|
11
|
+
import { forwardEscape as ve } from "@nxgt/material-core/escape-forward";
|
|
12
|
+
import { describedBy as ye } from "@nxgt/material-core/described-by";
|
|
13
|
+
import { layerOf as be, openerOf as xe } from "@nxgt/material-core/field-blur-layers";
|
|
14
|
+
import { focusHandle as Se } from "@nxgt/material-core/focus-control";
|
|
15
15
|
//#region ../../node_modules/@radix-ui/react-focus-scope/dist/index.mjs
|
|
16
|
-
var
|
|
16
|
+
var Ce = Object.defineProperty, P = (e, t) => Ce(e, "name", {
|
|
17
17
|
value: t,
|
|
18
18
|
configurable: !0
|
|
19
|
-
}),
|
|
19
|
+
}), we = "focusScope.autoFocusOnMount", Te = "focusScope.autoFocusOnUnmount", Ee = {
|
|
20
20
|
bubbles: !1,
|
|
21
21
|
cancelable: !0
|
|
22
|
-
},
|
|
23
|
-
let { loop: r = !1, trapped: i = !1, onMountAutoFocus: a, onUnmountAutoFocus: o, ...c } = e, [l, u] =
|
|
22
|
+
}, De = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ P(function(e, t) {
|
|
23
|
+
let { loop: r = !1, trapped: i = !1, onMountAutoFocus: a, onUnmountAutoFocus: o, ...c } = e, [l, u] = k.useState(null), d = w(a), f = w(o), p = k.useRef(null), m = n(t, u), h = k.useRef({
|
|
24
24
|
paused: !1,
|
|
25
25
|
pause() {
|
|
26
26
|
this.paused = !0;
|
|
@@ -29,20 +29,20 @@ var we = Object.defineProperty, N = (e, t) => we(e, "name", {
|
|
|
29
29
|
this.paused = !1;
|
|
30
30
|
}
|
|
31
31
|
}).current;
|
|
32
|
-
|
|
32
|
+
k.useEffect(() => {
|
|
33
33
|
if (i) {
|
|
34
34
|
let e = function(e) {
|
|
35
35
|
if (h.paused || !l) return;
|
|
36
36
|
let t = e.target;
|
|
37
|
-
l.contains(t) ? p.current = t :
|
|
37
|
+
l.contains(t) ? p.current = t : Pe(p.current, { select: !0 });
|
|
38
38
|
}, t = function(e) {
|
|
39
39
|
if (h.paused || !l) return;
|
|
40
40
|
let t = e.relatedTarget;
|
|
41
|
-
t !== null && (l.contains(t) ||
|
|
41
|
+
t !== null && (l.contains(t) || Pe(p.current, { select: !0 }));
|
|
42
42
|
}, n = function(e) {
|
|
43
|
-
if (document.activeElement === document.body) for (let t of e) t.removedNodes.length > 0 &&
|
|
43
|
+
if (document.activeElement === document.body) for (let t of e) t.removedNodes.length > 0 && Pe(l);
|
|
44
44
|
};
|
|
45
|
-
|
|
45
|
+
P(e, "handleFocusIn"), P(t, "handleFocusOut"), P(n, "handleMutations"), document.addEventListener("focusin", e), document.addEventListener("focusout", t);
|
|
46
46
|
let r = new MutationObserver(n);
|
|
47
47
|
return l && r.observe(l, {
|
|
48
48
|
childList: !0,
|
|
@@ -55,18 +55,18 @@ var we = Object.defineProperty, N = (e, t) => we(e, "name", {
|
|
|
55
55
|
i,
|
|
56
56
|
l,
|
|
57
57
|
h.paused
|
|
58
|
-
]),
|
|
58
|
+
]), k.useEffect(() => {
|
|
59
59
|
if (l) {
|
|
60
|
-
|
|
60
|
+
Fe.add(h);
|
|
61
61
|
let e = document.activeElement;
|
|
62
62
|
if (!l.contains(e)) {
|
|
63
|
-
let t = new CustomEvent(
|
|
64
|
-
l.addEventListener(
|
|
63
|
+
let t = new CustomEvent(we, Ee);
|
|
64
|
+
l.addEventListener(we, d), l.dispatchEvent(t), t.defaultPrevented || (Oe(Re(Ae(l)), { select: !0 }), document.activeElement === e && Pe(l));
|
|
65
65
|
}
|
|
66
66
|
return () => {
|
|
67
|
-
l.removeEventListener(
|
|
68
|
-
let t = new CustomEvent(
|
|
69
|
-
l.addEventListener(
|
|
67
|
+
l.removeEventListener(we, d), setTimeout(() => {
|
|
68
|
+
let t = new CustomEvent(Te, Ee);
|
|
69
|
+
l.addEventListener(Te, f), l.dispatchEvent(t), t.defaultPrevented || Pe(e ?? document.body, { select: !0 }), l.removeEventListener(Te, f), Fe.remove(h);
|
|
70
70
|
}, 0);
|
|
71
71
|
};
|
|
72
72
|
}
|
|
@@ -76,50 +76,50 @@ var we = Object.defineProperty, N = (e, t) => we(e, "name", {
|
|
|
76
76
|
f,
|
|
77
77
|
h
|
|
78
78
|
]);
|
|
79
|
-
let g =
|
|
79
|
+
let g = k.useCallback((e) => {
|
|
80
80
|
if (!r && !i || h.paused) return;
|
|
81
81
|
let t = e.key === "Tab" && !e.altKey && !e.ctrlKey && !e.metaKey, n = document.activeElement;
|
|
82
82
|
if (t && n) {
|
|
83
|
-
let t = e.currentTarget, [i, a] =
|
|
84
|
-
i && a ? !e.shiftKey && n === a ? (e.preventDefault(), r &&
|
|
83
|
+
let t = e.currentTarget, [i, a] = ke(t);
|
|
84
|
+
i && a ? !e.shiftKey && n === a ? (e.preventDefault(), r && Pe(i, { select: !0 })) : e.shiftKey && n === i && (e.preventDefault(), r && Pe(a, { select: !0 })) : n === t && e.preventDefault();
|
|
85
85
|
}
|
|
86
86
|
}, [
|
|
87
87
|
r,
|
|
88
88
|
i,
|
|
89
89
|
h.paused
|
|
90
90
|
]);
|
|
91
|
-
return /* @__PURE__ */
|
|
91
|
+
return /* @__PURE__ */ D(s.div, {
|
|
92
92
|
tabIndex: -1,
|
|
93
93
|
...c,
|
|
94
94
|
ref: m,
|
|
95
95
|
onKeyDown: g
|
|
96
96
|
});
|
|
97
97
|
}, "FocusScope"));
|
|
98
|
-
function
|
|
98
|
+
function Oe(e, { select: t = !1 } = {}) {
|
|
99
99
|
let n = document.activeElement;
|
|
100
|
-
for (let r of e) if (
|
|
100
|
+
for (let r of e) if (Pe(r, { select: t }), document.activeElement !== n) return;
|
|
101
101
|
}
|
|
102
|
-
|
|
103
|
-
function
|
|
104
|
-
let t =
|
|
105
|
-
return [
|
|
102
|
+
P(Oe, "focusFirst");
|
|
103
|
+
function ke(e) {
|
|
104
|
+
let t = Ae(e);
|
|
105
|
+
return [je(t, e), je(t.reverse(), e)];
|
|
106
106
|
}
|
|
107
|
-
|
|
108
|
-
function
|
|
109
|
-
let t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: /* @__PURE__ */
|
|
107
|
+
P(ke, "getTabbableEdges");
|
|
108
|
+
function Ae(e) {
|
|
109
|
+
let t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: /* @__PURE__ */ P((e) => {
|
|
110
110
|
let t = e.tagName === "INPUT" && e.type === "hidden";
|
|
111
111
|
return e.disabled || e.hidden || t ? NodeFilter.FILTER_SKIP : e.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
112
112
|
}, "acceptNode") });
|
|
113
113
|
for (; n.nextNode();) t.push(n.currentNode);
|
|
114
114
|
return t;
|
|
115
115
|
}
|
|
116
|
-
|
|
117
|
-
function
|
|
116
|
+
P(Ae, "getTabbableCandidates");
|
|
117
|
+
function je(e, t) {
|
|
118
118
|
let n = typeof t.checkVisibility == "function" && t.checkVisibility({ checkVisibilityCSS: !0 });
|
|
119
|
-
for (let r of e) if (!(n ? !r.checkVisibility({ checkVisibilityCSS: !0 }) :
|
|
119
|
+
for (let r of e) if (!(n ? !r.checkVisibility({ checkVisibilityCSS: !0 }) : Me(r, { upTo: t }))) return r;
|
|
120
120
|
}
|
|
121
|
-
|
|
122
|
-
function
|
|
121
|
+
P(je, "findVisible");
|
|
122
|
+
function Me(e, { upTo: t }) {
|
|
123
123
|
if (getComputedStyle(e).visibility === "hidden") return !0;
|
|
124
124
|
for (; e;) {
|
|
125
125
|
if (t !== void 0 && e === t) return !1;
|
|
@@ -128,102 +128,102 @@ function Ne(e, { upTo: t }) {
|
|
|
128
128
|
}
|
|
129
129
|
return !1;
|
|
130
130
|
}
|
|
131
|
-
|
|
132
|
-
function
|
|
131
|
+
P(Me, "isHidden");
|
|
132
|
+
function Ne(e) {
|
|
133
133
|
return e instanceof HTMLInputElement && "select" in e;
|
|
134
134
|
}
|
|
135
|
-
|
|
136
|
-
function
|
|
135
|
+
P(Ne, "isSelectableInput");
|
|
136
|
+
function Pe(e, { select: t = !1 } = {}) {
|
|
137
137
|
if (e && e.focus) {
|
|
138
138
|
let n = document.activeElement;
|
|
139
|
-
e.focus({ preventScroll: !0 }), e !== n &&
|
|
139
|
+
e.focus({ preventScroll: !0 }), e !== n && Ne(e) && t && e.select();
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
|
|
143
|
-
var
|
|
144
|
-
function
|
|
142
|
+
P(Pe, "focus");
|
|
143
|
+
var Fe = Ie();
|
|
144
|
+
function Ie() {
|
|
145
145
|
let e = [];
|
|
146
146
|
return {
|
|
147
147
|
add(t) {
|
|
148
148
|
let n = e[0];
|
|
149
|
-
t !== n && n?.pause(), e =
|
|
149
|
+
t !== n && n?.pause(), e = Le(e, t), e.unshift(t);
|
|
150
150
|
},
|
|
151
151
|
remove(t) {
|
|
152
|
-
e =
|
|
152
|
+
e = Le(e, t), e[0]?.resume();
|
|
153
153
|
}
|
|
154
154
|
};
|
|
155
155
|
}
|
|
156
|
-
|
|
157
|
-
function
|
|
156
|
+
P(Ie, "createFocusScopesStack");
|
|
157
|
+
function Le(e, t) {
|
|
158
158
|
let n = [...e], r = n.indexOf(t);
|
|
159
159
|
return r !== -1 && n.splice(r, 1), n;
|
|
160
160
|
}
|
|
161
|
-
|
|
162
|
-
function
|
|
161
|
+
P(Le, "arrayRemove");
|
|
162
|
+
function Re(e) {
|
|
163
163
|
return e.filter((e) => e.tagName !== "A");
|
|
164
164
|
}
|
|
165
|
-
|
|
165
|
+
P(Re, "removeLinks");
|
|
166
166
|
//#endregion
|
|
167
167
|
//#region ../../node_modules/@radix-ui/react-focus-guards/dist/index.mjs
|
|
168
|
-
var
|
|
168
|
+
var ze = Object.defineProperty, Be = (e, t) => ze(e, "name", {
|
|
169
169
|
value: t,
|
|
170
170
|
configurable: !0
|
|
171
|
-
}),
|
|
172
|
-
function
|
|
173
|
-
return
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
function
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
start:
|
|
180
|
-
end:
|
|
171
|
+
}), Ve = 0, He = null;
|
|
172
|
+
function Ue(e) {
|
|
173
|
+
return We(), e.children;
|
|
174
|
+
}
|
|
175
|
+
Be(Ue, "FocusGuards");
|
|
176
|
+
function We() {
|
|
177
|
+
k.useEffect(() => {
|
|
178
|
+
He ||= {
|
|
179
|
+
start: Ge(),
|
|
180
|
+
end: Ge()
|
|
181
181
|
};
|
|
182
|
-
let { start: e, end: t } =
|
|
183
|
-
return document.body.firstElementChild !== e && document.body.insertAdjacentElement("afterbegin", e), document.body.lastElementChild !== t && document.body.insertAdjacentElement("beforeend", t),
|
|
184
|
-
|
|
182
|
+
let { start: e, end: t } = He;
|
|
183
|
+
return document.body.firstElementChild !== e && document.body.insertAdjacentElement("afterbegin", e), document.body.lastElementChild !== t && document.body.insertAdjacentElement("beforeend", t), Ve++, () => {
|
|
184
|
+
Ve === 1 && (He?.start.remove(), He?.end.remove(), He = null), Ve = Math.max(0, Ve - 1);
|
|
185
185
|
};
|
|
186
186
|
}, []);
|
|
187
187
|
}
|
|
188
|
-
|
|
189
|
-
function
|
|
188
|
+
Be(We, "useFocusGuards");
|
|
189
|
+
function Ge() {
|
|
190
190
|
let e = document.createElement("span");
|
|
191
191
|
return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
|
|
192
192
|
}
|
|
193
|
-
|
|
193
|
+
Be(Ge, "createFocusGuard");
|
|
194
194
|
//#endregion
|
|
195
195
|
//#region ../../node_modules/tslib/tslib.es6.mjs
|
|
196
|
-
function
|
|
196
|
+
function Ke(e, t) {
|
|
197
197
|
var n = {};
|
|
198
198
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
199
199
|
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++) t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]);
|
|
200
200
|
return n;
|
|
201
201
|
}
|
|
202
|
-
function
|
|
202
|
+
function qe(e, t, n) {
|
|
203
203
|
if (n || arguments.length === 2) for (var r = 0, i = t.length, a; r < i; r++) (a || !(r in t)) && (a ||= Array.prototype.slice.call(t, 0, r), a[r] = t[r]);
|
|
204
204
|
return e.concat(a || Array.prototype.slice.call(t));
|
|
205
205
|
}
|
|
206
|
-
var
|
|
207
|
-
|
|
208
|
-
return
|
|
206
|
+
var F, Je = e((() => {
|
|
207
|
+
F = function() {
|
|
208
|
+
return F = Object.assign || function(e) {
|
|
209
209
|
for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
210
210
|
return e;
|
|
211
|
-
},
|
|
211
|
+
}, F.apply(this, arguments);
|
|
212
212
|
};
|
|
213
213
|
}));
|
|
214
214
|
//#endregion
|
|
215
215
|
//#region ../../node_modules/react-remove-scroll-bar/dist/es2015/constants.js
|
|
216
|
-
|
|
217
|
-
var
|
|
216
|
+
Je();
|
|
217
|
+
var Ye = "right-scroll-bar-position", Xe = "width-before-scroll-bar", Ze = "with-scroll-bars-hidden", Qe = "--removed-body-scroll-bar-size";
|
|
218
218
|
//#endregion
|
|
219
219
|
//#region ../../node_modules/use-callback-ref/dist/es2015/assignRef.js
|
|
220
|
-
function
|
|
220
|
+
function $e(e, t) {
|
|
221
221
|
return typeof e == "function" ? e(t) : e && (e.current = t), e;
|
|
222
222
|
}
|
|
223
223
|
//#endregion
|
|
224
224
|
//#region ../../node_modules/use-callback-ref/dist/es2015/useRef.js
|
|
225
|
-
function
|
|
226
|
-
var n =
|
|
225
|
+
function et(e, t) {
|
|
226
|
+
var n = he(function() {
|
|
227
227
|
return {
|
|
228
228
|
value: e,
|
|
229
229
|
callback: t,
|
|
@@ -242,33 +242,33 @@ function tt(e, t) {
|
|
|
242
242
|
}
|
|
243
243
|
//#endregion
|
|
244
244
|
//#region ../../node_modules/use-callback-ref/dist/es2015/useMergeRef.js
|
|
245
|
-
var
|
|
246
|
-
function
|
|
247
|
-
var n =
|
|
245
|
+
var tt = typeof window < "u" ? k.useLayoutEffect : k.useEffect, nt = /* @__PURE__ */ new WeakMap();
|
|
246
|
+
function rt(e, t) {
|
|
247
|
+
var n = et(t || null, function(t) {
|
|
248
248
|
return e.forEach(function(e) {
|
|
249
|
-
return
|
|
249
|
+
return $e(e, t);
|
|
250
250
|
});
|
|
251
251
|
});
|
|
252
|
-
return
|
|
253
|
-
var t =
|
|
252
|
+
return tt(function() {
|
|
253
|
+
var t = nt.get(n);
|
|
254
254
|
if (t) {
|
|
255
255
|
var r = new Set(t), i = new Set(e), a = n.current;
|
|
256
256
|
r.forEach(function(e) {
|
|
257
|
-
i.has(e) ||
|
|
257
|
+
i.has(e) || $e(e, null);
|
|
258
258
|
}), i.forEach(function(e) {
|
|
259
|
-
r.has(e) ||
|
|
259
|
+
r.has(e) || $e(e, a);
|
|
260
260
|
});
|
|
261
261
|
}
|
|
262
|
-
|
|
262
|
+
nt.set(n, e);
|
|
263
263
|
}, [e]), n;
|
|
264
264
|
}
|
|
265
265
|
//#endregion
|
|
266
266
|
//#region ../../node_modules/use-sidecar/dist/es2015/medium.js
|
|
267
|
-
function
|
|
267
|
+
function it(e) {
|
|
268
268
|
return e;
|
|
269
269
|
}
|
|
270
|
-
function
|
|
271
|
-
t === void 0 && (t =
|
|
270
|
+
function at(e, t) {
|
|
271
|
+
t === void 0 && (t = it);
|
|
272
272
|
var n = [], r = !1;
|
|
273
273
|
return {
|
|
274
274
|
read: function() {
|
|
@@ -321,40 +321,40 @@ function ot(e, t) {
|
|
|
321
321
|
}
|
|
322
322
|
};
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function ot(e) {
|
|
325
325
|
e === void 0 && (e = {});
|
|
326
|
-
var t =
|
|
327
|
-
return t.options =
|
|
326
|
+
var t = at(null);
|
|
327
|
+
return t.options = F({
|
|
328
328
|
async: !0,
|
|
329
329
|
ssr: !1
|
|
330
330
|
}, e), t;
|
|
331
331
|
}
|
|
332
332
|
//#endregion
|
|
333
333
|
//#region ../../node_modules/use-sidecar/dist/es2015/exports.js
|
|
334
|
-
|
|
335
|
-
var
|
|
336
|
-
var t = e.sideCar, n =
|
|
334
|
+
Je();
|
|
335
|
+
var st = function(e) {
|
|
336
|
+
var t = e.sideCar, n = Ke(e, ["sideCar"]);
|
|
337
337
|
if (!t) throw Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
338
338
|
var r = t.read();
|
|
339
339
|
if (!r) throw Error("Sidecar medium not found");
|
|
340
|
-
return
|
|
340
|
+
return k.createElement(r, F({}, n));
|
|
341
341
|
};
|
|
342
|
-
|
|
343
|
-
function
|
|
344
|
-
return e.useMedium(t),
|
|
342
|
+
st.isSideCarExport = !0;
|
|
343
|
+
function ct(e, t) {
|
|
344
|
+
return e.useMedium(t), st;
|
|
345
345
|
}
|
|
346
346
|
//#endregion
|
|
347
347
|
//#region ../../node_modules/react-remove-scroll/dist/es2015/medium.js
|
|
348
|
-
var
|
|
348
|
+
var lt = ot();
|
|
349
349
|
//#endregion
|
|
350
350
|
//#region ../../node_modules/react-remove-scroll/dist/es2015/UI.js
|
|
351
|
-
|
|
352
|
-
var
|
|
353
|
-
var n =
|
|
354
|
-
onScrollCapture:
|
|
355
|
-
onWheelCapture:
|
|
356
|
-
onTouchMoveCapture:
|
|
357
|
-
}), i = r[0], a = r[1], o = e.forwardProps, s = e.children, c = e.className, l = e.removeScrollBar, u = e.enabled, d = e.shards, f = e.sideCar, p = e.noRelative, m = e.noIsolation, h = e.inert, g = e.allowPinchZoom, _ = e.as, v = _ === void 0 ? "div" : _, y = e.gapMode, b =
|
|
351
|
+
Je();
|
|
352
|
+
var ut = function() {}, dt = k.forwardRef(function(e, t) {
|
|
353
|
+
var n = k.useRef(null), r = k.useState({
|
|
354
|
+
onScrollCapture: ut,
|
|
355
|
+
onWheelCapture: ut,
|
|
356
|
+
onTouchMoveCapture: ut
|
|
357
|
+
}), i = r[0], a = r[1], o = e.forwardProps, s = e.children, c = e.className, l = e.removeScrollBar, u = e.enabled, d = e.shards, f = e.sideCar, p = e.noRelative, m = e.noIsolation, h = e.inert, g = e.allowPinchZoom, _ = e.as, v = _ === void 0 ? "div" : _, y = e.gapMode, b = Ke(e, [
|
|
358
358
|
"forwardProps",
|
|
359
359
|
"children",
|
|
360
360
|
"className",
|
|
@@ -368,9 +368,9 @@ var dt = function() {}, ft = O.forwardRef(function(e, t) {
|
|
|
368
368
|
"allowPinchZoom",
|
|
369
369
|
"as",
|
|
370
370
|
"gapMode"
|
|
371
|
-
]), x = f, S =
|
|
372
|
-
return
|
|
373
|
-
sideCar:
|
|
371
|
+
]), x = f, S = rt([n, t]), C = F(F({}, b), i);
|
|
372
|
+
return k.createElement(k.Fragment, null, u && k.createElement(x, {
|
|
373
|
+
sideCar: lt,
|
|
374
374
|
removeScrollBar: l,
|
|
375
375
|
shards: d,
|
|
376
376
|
noRelative: p,
|
|
@@ -380,90 +380,90 @@ var dt = function() {}, ft = O.forwardRef(function(e, t) {
|
|
|
380
380
|
allowPinchZoom: !!g,
|
|
381
381
|
lockRef: n,
|
|
382
382
|
gapMode: y
|
|
383
|
-
}), o ?
|
|
383
|
+
}), o ? k.cloneElement(k.Children.only(s), F(F({}, C), { ref: S })) : k.createElement(v, F({}, C, {
|
|
384
384
|
className: c,
|
|
385
385
|
ref: S
|
|
386
386
|
}), s));
|
|
387
387
|
});
|
|
388
|
-
|
|
388
|
+
dt.defaultProps = {
|
|
389
389
|
enabled: !0,
|
|
390
390
|
removeScrollBar: !0,
|
|
391
391
|
inert: !1
|
|
392
|
-
},
|
|
393
|
-
fullWidth:
|
|
394
|
-
zeroRight:
|
|
392
|
+
}, dt.classNames = {
|
|
393
|
+
fullWidth: Xe,
|
|
394
|
+
zeroRight: Ye
|
|
395
395
|
};
|
|
396
396
|
//#endregion
|
|
397
397
|
//#region ../../node_modules/react-style-singleton/dist/es2015/singleton.js
|
|
398
|
-
function
|
|
398
|
+
function ft() {
|
|
399
399
|
if (!document) return null;
|
|
400
400
|
var e = document.createElement("style");
|
|
401
401
|
e.type = "text/css";
|
|
402
|
-
var t =
|
|
402
|
+
var t = ge();
|
|
403
403
|
return t && e.setAttribute("nonce", t), e;
|
|
404
404
|
}
|
|
405
|
-
function
|
|
405
|
+
function pt(e, t) {
|
|
406
406
|
e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function mt(e) {
|
|
409
409
|
(document.head || document.getElementsByTagName("head")[0]).appendChild(e);
|
|
410
410
|
}
|
|
411
|
-
var
|
|
411
|
+
var ht = function() {
|
|
412
412
|
var e = 0, t = null;
|
|
413
413
|
return {
|
|
414
414
|
add: function(n) {
|
|
415
|
-
e == 0 && (t =
|
|
415
|
+
e == 0 && (t = ft()) && (pt(t, n), mt(t)), e++;
|
|
416
416
|
},
|
|
417
417
|
remove: function() {
|
|
418
418
|
e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
|
|
419
419
|
}
|
|
420
420
|
};
|
|
421
|
-
},
|
|
422
|
-
var e =
|
|
421
|
+
}, gt = function() {
|
|
422
|
+
var e = ht();
|
|
423
423
|
return function(t, n) {
|
|
424
|
-
|
|
424
|
+
k.useEffect(function() {
|
|
425
425
|
return e.add(t), function() {
|
|
426
426
|
e.remove();
|
|
427
427
|
};
|
|
428
428
|
}, [t && n]);
|
|
429
429
|
};
|
|
430
|
-
},
|
|
431
|
-
var e =
|
|
430
|
+
}, _t = function() {
|
|
431
|
+
var e = gt();
|
|
432
432
|
return function(t) {
|
|
433
433
|
var n = t.styles, r = t.dynamic;
|
|
434
434
|
return e(n, r), null;
|
|
435
435
|
};
|
|
436
|
-
},
|
|
436
|
+
}, vt = {
|
|
437
437
|
left: 0,
|
|
438
438
|
top: 0,
|
|
439
439
|
right: 0,
|
|
440
440
|
gap: 0
|
|
441
|
-
},
|
|
441
|
+
}, yt = function(e) {
|
|
442
442
|
return parseInt(e || "", 10) || 0;
|
|
443
|
-
},
|
|
443
|
+
}, bt = function(e) {
|
|
444
444
|
var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], i = t[e === "padding" ? "paddingRight" : "marginRight"];
|
|
445
445
|
return [
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
446
|
+
yt(n),
|
|
447
|
+
yt(r),
|
|
448
|
+
yt(i)
|
|
449
449
|
];
|
|
450
|
-
},
|
|
451
|
-
if (e === void 0 && (e = "margin"), typeof window > "u") return
|
|
452
|
-
var t =
|
|
450
|
+
}, xt = function(e) {
|
|
451
|
+
if (e === void 0 && (e = "margin"), typeof window > "u") return vt;
|
|
452
|
+
var t = bt(e), n = document.documentElement.clientWidth, r = window.innerWidth;
|
|
453
453
|
return {
|
|
454
454
|
left: t[0],
|
|
455
455
|
top: t[1],
|
|
456
456
|
right: t[2],
|
|
457
457
|
gap: Math.max(0, r - n + t[2] - t[0])
|
|
458
458
|
};
|
|
459
|
-
},
|
|
459
|
+
}, St = _t(), Ct = "data-scroll-locked", wt = function(e, t, n, r) {
|
|
460
460
|
var i = e.left, a = e.top, o = e.right, s = e.gap;
|
|
461
461
|
return n === void 0 && (n = "margin"), `
|
|
462
|
-
.${
|
|
462
|
+
.${Ze} {
|
|
463
463
|
overflow: hidden ${r};
|
|
464
464
|
padding-right: ${s}px ${r};
|
|
465
465
|
}
|
|
466
|
-
body[${
|
|
466
|
+
body[${Ct}] {
|
|
467
467
|
overflow: hidden ${r};
|
|
468
468
|
overscroll-behavior: contain;
|
|
469
469
|
${[
|
|
@@ -480,96 +480,96 @@ var gt = function() {
|
|
|
480
480
|
].filter(Boolean).join("")}
|
|
481
481
|
}
|
|
482
482
|
|
|
483
|
-
.${
|
|
483
|
+
.${Ye} {
|
|
484
484
|
right: ${s}px ${r};
|
|
485
485
|
}
|
|
486
486
|
|
|
487
|
-
.${
|
|
487
|
+
.${Xe} {
|
|
488
488
|
margin-right: ${s}px ${r};
|
|
489
489
|
}
|
|
490
490
|
|
|
491
|
-
.${
|
|
491
|
+
.${Ye} .${Ye} {
|
|
492
492
|
right: 0 ${r};
|
|
493
493
|
}
|
|
494
494
|
|
|
495
|
-
.${
|
|
495
|
+
.${Xe} .${Xe} {
|
|
496
496
|
margin-right: 0 ${r};
|
|
497
497
|
}
|
|
498
498
|
|
|
499
|
-
body[${
|
|
500
|
-
${
|
|
499
|
+
body[${Ct}] {
|
|
500
|
+
${Qe}: ${s}px;
|
|
501
501
|
}
|
|
502
502
|
`;
|
|
503
|
-
},
|
|
503
|
+
}, Tt = function() {
|
|
504
504
|
var e = parseInt(document.body.getAttribute("data-scroll-locked") || "0", 10);
|
|
505
505
|
return isFinite(e) ? e : 0;
|
|
506
|
-
},
|
|
507
|
-
|
|
508
|
-
return document.body.setAttribute(
|
|
509
|
-
var e =
|
|
510
|
-
e <= 0 ? document.body.removeAttribute(
|
|
506
|
+
}, Et = function() {
|
|
507
|
+
k.useEffect(function() {
|
|
508
|
+
return document.body.setAttribute(Ct, (Tt() + 1).toString()), function() {
|
|
509
|
+
var e = Tt() - 1;
|
|
510
|
+
e <= 0 ? document.body.removeAttribute(Ct) : document.body.setAttribute(Ct, e.toString());
|
|
511
511
|
};
|
|
512
512
|
}, []);
|
|
513
|
-
},
|
|
513
|
+
}, Dt = function(e) {
|
|
514
514
|
var t = e.noRelative, n = e.noImportant, r = e.gapMode, i = r === void 0 ? "margin" : r;
|
|
515
|
-
|
|
516
|
-
var a =
|
|
517
|
-
return
|
|
515
|
+
Et();
|
|
516
|
+
var a = k.useMemo(function() {
|
|
517
|
+
return xt(i);
|
|
518
518
|
}, [i]);
|
|
519
|
-
return
|
|
520
|
-
},
|
|
519
|
+
return k.createElement(St, { styles: wt(a, !t, i, n ? "" : "!important") });
|
|
520
|
+
}, Ot = !1;
|
|
521
521
|
if (typeof window < "u") try {
|
|
522
|
-
var
|
|
523
|
-
return
|
|
522
|
+
var kt = Object.defineProperty({}, "passive", { get: function() {
|
|
523
|
+
return Ot = !0, !0;
|
|
524
524
|
} });
|
|
525
|
-
window.addEventListener("test",
|
|
525
|
+
window.addEventListener("test", kt, kt), window.removeEventListener("test", kt, kt);
|
|
526
526
|
} catch {
|
|
527
|
-
|
|
527
|
+
Ot = !1;
|
|
528
528
|
}
|
|
529
|
-
var
|
|
529
|
+
var At = Ot ? { passive: !1 } : !1, jt = function(e) {
|
|
530
530
|
return e.tagName === "TEXTAREA";
|
|
531
|
-
},
|
|
531
|
+
}, Mt = function(e, t) {
|
|
532
532
|
if (!(e instanceof Element)) return !1;
|
|
533
533
|
var n = window.getComputedStyle(e);
|
|
534
|
-
return n[t] !== "hidden" && !(n.overflowY === n.overflowX && !
|
|
534
|
+
return n[t] !== "hidden" && !(n.overflowY === n.overflowX && !jt(e) && n[t] === "visible");
|
|
535
|
+
}, Nt = function(e) {
|
|
536
|
+
return Mt(e, "overflowY");
|
|
535
537
|
}, Pt = function(e) {
|
|
536
|
-
return
|
|
537
|
-
}, Ft = function(e) {
|
|
538
|
-
return Nt(e, "overflowX");
|
|
539
|
-
}, It = function(e, t) {
|
|
538
|
+
return Mt(e, "overflowX");
|
|
539
|
+
}, Ft = function(e, t) {
|
|
540
540
|
var n = t.ownerDocument, r = t;
|
|
541
541
|
do {
|
|
542
|
-
if (typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host),
|
|
543
|
-
var i =
|
|
542
|
+
if (typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host), Rt(e, r)) {
|
|
543
|
+
var i = zt(e, r);
|
|
544
544
|
if (i[1] > i[2]) return !0;
|
|
545
545
|
}
|
|
546
546
|
r = r.parentNode;
|
|
547
547
|
} while (r && r !== n.body);
|
|
548
548
|
return !1;
|
|
549
|
-
},
|
|
549
|
+
}, It = function(e) {
|
|
550
550
|
return [
|
|
551
551
|
e.scrollTop,
|
|
552
552
|
e.scrollHeight,
|
|
553
553
|
e.clientHeight
|
|
554
554
|
];
|
|
555
|
-
},
|
|
555
|
+
}, Lt = function(e) {
|
|
556
556
|
return [
|
|
557
557
|
e.scrollLeft,
|
|
558
558
|
e.scrollWidth,
|
|
559
559
|
e.clientWidth
|
|
560
560
|
];
|
|
561
|
+
}, Rt = function(e, t) {
|
|
562
|
+
return e === "v" ? Nt(t) : Pt(t);
|
|
561
563
|
}, zt = function(e, t) {
|
|
562
|
-
return e === "v" ?
|
|
564
|
+
return e === "v" ? It(t) : Lt(t);
|
|
563
565
|
}, Bt = function(e, t) {
|
|
564
|
-
return e === "v" ? Lt(t) : Rt(t);
|
|
565
|
-
}, Vt = function(e, t) {
|
|
566
566
|
return e === "h" && t === "rtl" ? -1 : 1;
|
|
567
|
-
},
|
|
568
|
-
var a =
|
|
567
|
+
}, Vt = function(e, t, n, r, i) {
|
|
568
|
+
var a = Bt(e, window.getComputedStyle(t).direction), o = a * r, s = n.target, c = t.contains(s), l = !1, u = o > 0, d = 0, f = 0;
|
|
569
569
|
do {
|
|
570
570
|
if (!s) break;
|
|
571
|
-
var p =
|
|
572
|
-
(m || h) &&
|
|
571
|
+
var p = zt(e, s), m = p[0], h = p[1] - p[2] - a * m;
|
|
572
|
+
(m || h) && Rt(e, s) && (d += h, f += m);
|
|
573
573
|
var g = s.parentNode;
|
|
574
574
|
s = g && g.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? g.host : g;
|
|
575
575
|
} while (!c && s !== document.body || c && (t.contains(s) || t === s));
|
|
@@ -577,29 +577,29 @@ var jt = kt ? { passive: !1 } : !1, Mt = function(e) {
|
|
|
577
577
|
};
|
|
578
578
|
//#endregion
|
|
579
579
|
//#region ../../node_modules/react-remove-scroll/dist/es2015/SideEffect.js
|
|
580
|
-
|
|
581
|
-
var
|
|
580
|
+
Je();
|
|
581
|
+
var Ht = function(e) {
|
|
582
582
|
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
|
|
583
|
-
},
|
|
583
|
+
}, Ut = function(e) {
|
|
584
584
|
return [e.deltaX, e.deltaY];
|
|
585
|
-
},
|
|
585
|
+
}, Wt = function(e) {
|
|
586
586
|
return e && "current" in e ? e.current : e;
|
|
587
|
-
},
|
|
587
|
+
}, Gt = function(e, t) {
|
|
588
588
|
return e[0] === t[0] && e[1] === t[1];
|
|
589
|
-
},
|
|
589
|
+
}, Kt = function(e) {
|
|
590
590
|
return `
|
|
591
591
|
.block-interactivity-${e} {pointer-events: none;}
|
|
592
592
|
.allow-interactivity-${e} {pointer-events: all;}
|
|
593
593
|
`;
|
|
594
|
-
},
|
|
595
|
-
function
|
|
596
|
-
var t =
|
|
597
|
-
|
|
594
|
+
}, qt = 0, Jt = [];
|
|
595
|
+
function Yt(e) {
|
|
596
|
+
var t = k.useRef([]), n = k.useRef([0, 0]), r = k.useRef(), i = k.useState(qt++)[0], a = k.useState(_t)[0], o = k.useRef(e);
|
|
597
|
+
k.useEffect(function() {
|
|
598
598
|
o.current = e;
|
|
599
|
-
}, [e]),
|
|
599
|
+
}, [e]), k.useEffect(function() {
|
|
600
600
|
if (e.inert) {
|
|
601
601
|
document.body.classList.add(`block-interactivity-${i}`);
|
|
602
|
-
var t =
|
|
602
|
+
var t = qe([e.lockRef.current], (e.shards || []).map(Wt), !0).filter(Boolean);
|
|
603
603
|
return t.forEach(function(e) {
|
|
604
604
|
return e.classList.add(`allow-interactivity-${i}`);
|
|
605
605
|
}), function() {
|
|
@@ -613,107 +613,107 @@ function Xt(e) {
|
|
|
613
613
|
e.lockRef.current,
|
|
614
614
|
e.shards
|
|
615
615
|
]);
|
|
616
|
-
var s =
|
|
616
|
+
var s = k.useCallback(function(e, t) {
|
|
617
617
|
if ("touches" in e && e.touches.length === 2 || e.type === "wheel" && e.ctrlKey) return !o.current.allowPinchZoom;
|
|
618
|
-
var i =
|
|
618
|
+
var i = Ht(e), a = n.current, s = "deltaX" in e ? e.deltaX : a[0] - i[0], c = "deltaY" in e ? e.deltaY : a[1] - i[1], l, u = e.target, d = Math.abs(s) > Math.abs(c) ? "h" : "v";
|
|
619
619
|
if ("touches" in e && d === "h" && u.type === "range") return !1;
|
|
620
620
|
var f = window.getSelection(), p = f && f.anchorNode;
|
|
621
621
|
if (p && (p === u || p.contains(u))) return !1;
|
|
622
|
-
var m =
|
|
622
|
+
var m = Ft(d, u);
|
|
623
623
|
if (!m) return !0;
|
|
624
|
-
if (m ? l = d : (l = d === "v" ? "h" : "v", m =
|
|
624
|
+
if (m ? l = d : (l = d === "v" ? "h" : "v", m = Ft(d, u)), !m) return !1;
|
|
625
625
|
if (!r.current && "changedTouches" in e && (s || c) && (r.current = l), !l) return !0;
|
|
626
626
|
var h = r.current || l;
|
|
627
|
-
return
|
|
628
|
-
}, []), c =
|
|
627
|
+
return Vt(h, t, e, h === "h" ? s : c, !0);
|
|
628
|
+
}, []), c = k.useCallback(function(e) {
|
|
629
629
|
var n = e;
|
|
630
|
-
if (!(!
|
|
631
|
-
var r = "deltaY" in n ?
|
|
632
|
-
return e.name === n.type && (e.target === n.target || n.target === e.shadowParent) &&
|
|
630
|
+
if (!(!Jt.length || Jt[Jt.length - 1] !== a)) {
|
|
631
|
+
var r = "deltaY" in n ? Ut(n) : Ht(n), i = t.current.filter(function(e) {
|
|
632
|
+
return e.name === n.type && (e.target === n.target || n.target === e.shadowParent) && Gt(e.delta, r);
|
|
633
633
|
})[0];
|
|
634
634
|
if (i && i.should) {
|
|
635
635
|
n.cancelable && n.preventDefault();
|
|
636
636
|
return;
|
|
637
637
|
}
|
|
638
638
|
if (!i) {
|
|
639
|
-
var c = (o.current.shards || []).map(
|
|
639
|
+
var c = (o.current.shards || []).map(Wt).filter(Boolean).filter(function(e) {
|
|
640
640
|
return e.contains(n.target);
|
|
641
641
|
});
|
|
642
642
|
(c.length > 0 ? s(n, c[0]) : !o.current.noIsolation) && n.cancelable && n.preventDefault();
|
|
643
643
|
}
|
|
644
644
|
}
|
|
645
|
-
}, []), l =
|
|
645
|
+
}, []), l = k.useCallback(function(e, n, r, i) {
|
|
646
646
|
var a = {
|
|
647
647
|
name: e,
|
|
648
648
|
delta: n,
|
|
649
649
|
target: r,
|
|
650
650
|
should: i,
|
|
651
|
-
shadowParent:
|
|
651
|
+
shadowParent: Xt(r)
|
|
652
652
|
};
|
|
653
653
|
t.current.push(a), setTimeout(function() {
|
|
654
654
|
t.current = t.current.filter(function(e) {
|
|
655
655
|
return e !== a;
|
|
656
656
|
});
|
|
657
657
|
}, 1);
|
|
658
|
-
}, []), u =
|
|
659
|
-
n.current =
|
|
660
|
-
}, []), d =
|
|
661
|
-
l(t.type, Wt(t), t.target, s(t, e.lockRef.current));
|
|
662
|
-
}, []), f = O.useCallback(function(t) {
|
|
658
|
+
}, []), u = k.useCallback(function(e) {
|
|
659
|
+
n.current = Ht(e), r.current = void 0;
|
|
660
|
+
}, []), d = k.useCallback(function(t) {
|
|
663
661
|
l(t.type, Ut(t), t.target, s(t, e.lockRef.current));
|
|
662
|
+
}, []), f = k.useCallback(function(t) {
|
|
663
|
+
l(t.type, Ht(t), t.target, s(t, e.lockRef.current));
|
|
664
664
|
}, []);
|
|
665
|
-
|
|
666
|
-
return
|
|
665
|
+
k.useEffect(function() {
|
|
666
|
+
return Jt.push(a), e.setCallbacks({
|
|
667
667
|
onScrollCapture: d,
|
|
668
668
|
onWheelCapture: d,
|
|
669
669
|
onTouchMoveCapture: f
|
|
670
|
-
}), document.addEventListener("wheel", c,
|
|
671
|
-
|
|
670
|
+
}), document.addEventListener("wheel", c, At), document.addEventListener("touchmove", c, At), document.addEventListener("touchstart", u, At), function() {
|
|
671
|
+
Jt = Jt.filter(function(e) {
|
|
672
672
|
return e !== a;
|
|
673
|
-
}), document.removeEventListener("wheel", c,
|
|
673
|
+
}), document.removeEventListener("wheel", c, At), document.removeEventListener("touchmove", c, At), document.removeEventListener("touchstart", u, At);
|
|
674
674
|
};
|
|
675
675
|
}, []);
|
|
676
676
|
var p = e.removeScrollBar, m = e.inert;
|
|
677
|
-
return
|
|
677
|
+
return k.createElement(k.Fragment, null, m ? k.createElement(a, { styles: Kt(i) }) : null, p ? k.createElement(Dt, {
|
|
678
678
|
noRelative: e.noRelative,
|
|
679
679
|
gapMode: e.gapMode
|
|
680
680
|
}) : null);
|
|
681
681
|
}
|
|
682
|
-
function
|
|
682
|
+
function Xt(e) {
|
|
683
683
|
for (var t = null; e !== null;) e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
|
|
684
684
|
return t;
|
|
685
685
|
}
|
|
686
686
|
//#endregion
|
|
687
687
|
//#region ../../node_modules/react-remove-scroll/dist/es2015/sidecar.js
|
|
688
|
-
var
|
|
688
|
+
var Zt = ct(lt, Yt);
|
|
689
689
|
//#endregion
|
|
690
690
|
//#region ../../node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
691
|
-
|
|
692
|
-
var
|
|
693
|
-
return
|
|
691
|
+
Je();
|
|
692
|
+
var Qt = k.forwardRef(function(e, t) {
|
|
693
|
+
return k.createElement(dt, F({}, e, {
|
|
694
694
|
ref: t,
|
|
695
|
-
sideCar:
|
|
695
|
+
sideCar: Zt
|
|
696
696
|
}));
|
|
697
697
|
});
|
|
698
|
-
|
|
698
|
+
Qt.classNames = dt.classNames;
|
|
699
699
|
//#endregion
|
|
700
700
|
//#region ../../node_modules/aria-hidden/dist/es2015/index.js
|
|
701
|
-
var
|
|
701
|
+
var $t = function(e) {
|
|
702
702
|
return typeof document > "u" ? null : (Array.isArray(e) ? e[0] : e).ownerDocument.body;
|
|
703
|
-
},
|
|
704
|
-
return e && (e.host ||
|
|
705
|
-
},
|
|
703
|
+
}, en = /* @__PURE__ */ new WeakMap(), tn = /* @__PURE__ */ new WeakMap(), nn = {}, rn = 0, an = function(e) {
|
|
704
|
+
return e && (e.host || an(e.parentNode));
|
|
705
|
+
}, on = function(e, t) {
|
|
706
706
|
return t.map(function(t) {
|
|
707
707
|
if (e.contains(t)) return t;
|
|
708
|
-
var n =
|
|
708
|
+
var n = an(t);
|
|
709
709
|
return n && e.contains(n) ? n : (console.error("aria-hidden", t, "in not contained inside", e, ". Doing nothing"), null);
|
|
710
710
|
}).filter(function(e) {
|
|
711
711
|
return !!e;
|
|
712
712
|
});
|
|
713
|
-
},
|
|
714
|
-
var i =
|
|
715
|
-
|
|
716
|
-
var a =
|
|
713
|
+
}, sn = function(e, t, n, r) {
|
|
714
|
+
var i = on(t, Array.isArray(e) ? e : [e]);
|
|
715
|
+
nn[n] || (nn[n] = /* @__PURE__ */ new WeakMap());
|
|
716
|
+
var a = nn[n], o = [], s = /* @__PURE__ */ new Set(), c = new Set(i), l = function(e) {
|
|
717
717
|
!e || s.has(e) || (s.add(e), l(e.parentNode));
|
|
718
718
|
};
|
|
719
719
|
i.forEach(l);
|
|
@@ -721,36 +721,36 @@ var en = function(e) {
|
|
|
721
721
|
!e || c.has(e) || Array.prototype.forEach.call(e.children, function(e) {
|
|
722
722
|
if (s.has(e)) u(e);
|
|
723
723
|
else try {
|
|
724
|
-
var t = e.getAttribute(r), i = t !== null && t !== "false", c = (
|
|
725
|
-
|
|
724
|
+
var t = e.getAttribute(r), i = t !== null && t !== "false", c = (en.get(e) || 0) + 1, l = (a.get(e) || 0) + 1;
|
|
725
|
+
en.set(e, c), a.set(e, l), o.push(e), c === 1 && i && tn.set(e, !0), l === 1 && e.setAttribute(n, "true"), i || e.setAttribute(r, "true");
|
|
726
726
|
} catch (t) {
|
|
727
727
|
console.error("aria-hidden: cannot operate on ", e, t);
|
|
728
728
|
}
|
|
729
729
|
});
|
|
730
730
|
};
|
|
731
|
-
return u(t), s.clear(),
|
|
731
|
+
return u(t), s.clear(), rn++, function() {
|
|
732
732
|
o.forEach(function(e) {
|
|
733
|
-
var t =
|
|
734
|
-
|
|
735
|
-
}),
|
|
733
|
+
var t = en.get(e) - 1, i = a.get(e) - 1;
|
|
734
|
+
en.set(e, t), a.set(e, i), t || (tn.has(e) || e.removeAttribute(r), tn.delete(e)), i || e.removeAttribute(n);
|
|
735
|
+
}), rn--, rn || (en = /* @__PURE__ */ new WeakMap(), en = /* @__PURE__ */ new WeakMap(), tn = /* @__PURE__ */ new WeakMap(), nn = {});
|
|
736
736
|
};
|
|
737
|
-
},
|
|
737
|
+
}, cn = function(e, t, n) {
|
|
738
738
|
n === void 0 && (n = "data-aria-hidden");
|
|
739
|
-
var r = Array.from(Array.isArray(e) ? e : [e]), i = t ||
|
|
740
|
-
return i ? (r.push.apply(r, Array.from(i.querySelectorAll("[aria-live], script"))),
|
|
739
|
+
var r = Array.from(Array.isArray(e) ? e : [e]), i = t || $t(e);
|
|
740
|
+
return i ? (r.push.apply(r, Array.from(i.querySelectorAll("[aria-live], script"))), sn(r, i, n, "aria-hidden")) : function() {
|
|
741
741
|
return null;
|
|
742
742
|
};
|
|
743
|
-
},
|
|
743
|
+
}, ln = Object.defineProperty, I = (e, t) => ln(e, "name", {
|
|
744
744
|
value: t,
|
|
745
745
|
configurable: !0
|
|
746
|
-
}),
|
|
747
|
-
let { __scopeDialog: t, children: n, open: r, defaultOpen: i, onOpenChange: a, modal: o = !0 } = e, s =
|
|
746
|
+
}), un = "Dialog", [dn, fn] = m(un), [pn, L] = dn(un), mn = /* @__PURE__ */ I((e) => {
|
|
747
|
+
let { __scopeDialog: t, children: n, open: r, defaultOpen: i, onOpenChange: a, modal: o = !0 } = e, s = k.useRef(null), c = k.useRef(null), [l, u] = b({
|
|
748
748
|
prop: r,
|
|
749
749
|
defaultProp: i ?? !1,
|
|
750
750
|
onChange: a,
|
|
751
|
-
caller:
|
|
752
|
-
}), [d, f] =
|
|
753
|
-
return /* @__PURE__ */
|
|
751
|
+
caller: un
|
|
752
|
+
}), [d, f] = k.useState(0), [m, h] = k.useState(0);
|
|
753
|
+
return /* @__PURE__ */ D(pn, {
|
|
754
754
|
scope: t,
|
|
755
755
|
triggerRef: s,
|
|
756
756
|
contentRef: c,
|
|
@@ -763,53 +763,53 @@ var en = function(e) {
|
|
|
763
763
|
setDescriptionCount: h,
|
|
764
764
|
open: l,
|
|
765
765
|
onOpenChange: u,
|
|
766
|
-
onOpenToggle:
|
|
766
|
+
onOpenToggle: k.useCallback(() => u((e) => !e), [u]),
|
|
767
767
|
modal: o,
|
|
768
768
|
children: n
|
|
769
769
|
});
|
|
770
|
-
}, "Dialog"),
|
|
771
|
-
let { __scopeDialog: r, ...i } = e, o =
|
|
772
|
-
return /* @__PURE__ */
|
|
770
|
+
}, "Dialog"), hn = "DialogTrigger", gn = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ I(function(e, t) {
|
|
771
|
+
let { __scopeDialog: r, ...i } = e, o = L(hn, r), c = n(t, o.triggerRef);
|
|
772
|
+
return /* @__PURE__ */ D(s.button, {
|
|
773
773
|
type: "button",
|
|
774
774
|
"aria-haspopup": "dialog",
|
|
775
775
|
"aria-expanded": o.open,
|
|
776
776
|
"aria-controls": o.open ? o.contentId : void 0,
|
|
777
|
-
"data-state":
|
|
777
|
+
"data-state": In(o.open),
|
|
778
778
|
...i,
|
|
779
779
|
ref: c,
|
|
780
780
|
onClick: a(e.onClick, o.onOpenToggle)
|
|
781
781
|
});
|
|
782
|
-
}, "DialogTrigger")),
|
|
783
|
-
let { __scopeDialog: t, forceMount: n, children: r, container: a } = e, o =
|
|
784
|
-
return /* @__PURE__ */
|
|
782
|
+
}, "DialogTrigger")), _n = "DialogPortal", [vn, yn] = dn(_n, { forceMount: void 0 }), bn = /* @__PURE__ */ I((e) => {
|
|
783
|
+
let { __scopeDialog: t, forceMount: n, children: r, container: a } = e, o = L(_n, t);
|
|
784
|
+
return /* @__PURE__ */ D(vn, {
|
|
785
785
|
scope: t,
|
|
786
786
|
forceMount: n,
|
|
787
|
-
children:
|
|
787
|
+
children: k.Children.map(r, (e) => /* @__PURE__ */ D(i, {
|
|
788
788
|
present: n || o.open,
|
|
789
|
-
children: /* @__PURE__ */
|
|
789
|
+
children: /* @__PURE__ */ D(c, {
|
|
790
790
|
asChild: !0,
|
|
791
791
|
container: a,
|
|
792
792
|
children: e
|
|
793
793
|
})
|
|
794
794
|
}))
|
|
795
795
|
});
|
|
796
|
-
}, "DialogPortal"),
|
|
797
|
-
let n =
|
|
798
|
-
return o.modal ? /* @__PURE__ */
|
|
796
|
+
}, "DialogPortal"), xn = "DialogOverlay", Sn = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ I(function(e, t) {
|
|
797
|
+
let n = yn(xn, e.__scopeDialog), { forceMount: r = n.forceMount, ...a } = e, o = L(xn, e.__scopeDialog);
|
|
798
|
+
return o.modal ? /* @__PURE__ */ D(i, {
|
|
799
799
|
present: r || o.open,
|
|
800
|
-
children: /* @__PURE__ */
|
|
800
|
+
children: /* @__PURE__ */ D(wn, {
|
|
801
801
|
...a,
|
|
802
802
|
ref: t
|
|
803
803
|
})
|
|
804
804
|
}) : null;
|
|
805
|
-
}, "DialogOverlay")),
|
|
806
|
-
let { __scopeDialog: r, ...i } = e, a =
|
|
807
|
-
return /* @__PURE__ */
|
|
808
|
-
as:
|
|
805
|
+
}, "DialogOverlay")), Cn = d("DialogOverlay.RemoveScroll"), wn = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ I(function(e, t) {
|
|
806
|
+
let { __scopeDialog: r, ...i } = e, a = L(xn, r), o = n(t, v());
|
|
807
|
+
return /* @__PURE__ */ D(Qt, {
|
|
808
|
+
as: Cn,
|
|
809
809
|
allowPinchZoom: !0,
|
|
810
810
|
shards: [a.contentRef],
|
|
811
|
-
children: /* @__PURE__ */
|
|
812
|
-
"data-state":
|
|
811
|
+
children: /* @__PURE__ */ D(s.div, {
|
|
812
|
+
"data-state": In(a.open),
|
|
813
813
|
...i,
|
|
814
814
|
ref: o,
|
|
815
815
|
style: {
|
|
@@ -818,24 +818,24 @@ var en = function(e) {
|
|
|
818
818
|
}
|
|
819
819
|
})
|
|
820
820
|
});
|
|
821
|
-
}, "DialogOverlayImpl")),
|
|
822
|
-
let n =
|
|
823
|
-
return /* @__PURE__ */
|
|
821
|
+
}, "DialogOverlayImpl")), Tn = "DialogContent", En = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ I(function(e, t) {
|
|
822
|
+
let n = yn(Tn, e.__scopeDialog), { forceMount: r = n.forceMount, ...a } = e, o = L(Tn, e.__scopeDialog);
|
|
823
|
+
return /* @__PURE__ */ D(i, {
|
|
824
824
|
present: r || o.open,
|
|
825
|
-
children: o.modal ? /* @__PURE__ */
|
|
825
|
+
children: o.modal ? /* @__PURE__ */ D(Dn, {
|
|
826
826
|
...a,
|
|
827
827
|
ref: t
|
|
828
|
-
}) : /* @__PURE__ */
|
|
828
|
+
}) : /* @__PURE__ */ D(On, {
|
|
829
829
|
...a,
|
|
830
830
|
ref: t
|
|
831
831
|
})
|
|
832
832
|
});
|
|
833
|
-
}, "DialogContent")),
|
|
834
|
-
let r =
|
|
835
|
-
return
|
|
833
|
+
}, "DialogContent")), Dn = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ I(function(e, t) {
|
|
834
|
+
let r = L(Tn, e.__scopeDialog), i = k.useRef(null), o = n(t, r.contentRef, i);
|
|
835
|
+
return k.useEffect(() => {
|
|
836
836
|
let e = i.current;
|
|
837
|
-
if (e) return
|
|
838
|
-
}, []), /* @__PURE__ */
|
|
837
|
+
if (e) return cn(e);
|
|
838
|
+
}, []), /* @__PURE__ */ D(kn, {
|
|
839
839
|
...e,
|
|
840
840
|
ref: o,
|
|
841
841
|
trapFocus: r.open,
|
|
@@ -849,9 +849,9 @@ var en = function(e) {
|
|
|
849
849
|
}),
|
|
850
850
|
onFocusOutside: a(e.onFocusOutside, (e) => e.preventDefault())
|
|
851
851
|
});
|
|
852
|
-
}, "DialogContentModal")),
|
|
853
|
-
let n =
|
|
854
|
-
return /* @__PURE__ */
|
|
852
|
+
}, "DialogContentModal")), On = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ I(function(e, t) {
|
|
853
|
+
let n = L(Tn, e.__scopeDialog), r = k.useRef(!1), i = k.useRef(!1);
|
|
854
|
+
return /* @__PURE__ */ D(kn, {
|
|
855
855
|
...e,
|
|
856
856
|
ref: t,
|
|
857
857
|
trapFocus: !1,
|
|
@@ -865,83 +865,83 @@ var en = function(e) {
|
|
|
865
865
|
n.triggerRef.current?.contains(a) && t.preventDefault(), t.detail.originalEvent.type === "focusin" && i.current && t.preventDefault();
|
|
866
866
|
}
|
|
867
867
|
});
|
|
868
|
-
}, "DialogContentNonModal")),
|
|
869
|
-
let { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: i, onCloseAutoFocus: a, ...o } = e, s =
|
|
870
|
-
return
|
|
868
|
+
}, "DialogContentNonModal")), kn = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ I(function(e, t) {
|
|
869
|
+
let { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: i, onCloseAutoFocus: a, ...o } = e, s = L(Tn, n);
|
|
870
|
+
return We(), /* @__PURE__ */ D(re, { children: /* @__PURE__ */ D(De, {
|
|
871
871
|
asChild: !0,
|
|
872
872
|
loop: !0,
|
|
873
873
|
trapped: r,
|
|
874
874
|
onMountAutoFocus: i,
|
|
875
875
|
onUnmountAutoFocus: a,
|
|
876
|
-
children: /* @__PURE__ */
|
|
876
|
+
children: /* @__PURE__ */ D(ee, {
|
|
877
877
|
role: "dialog",
|
|
878
878
|
id: s.contentId,
|
|
879
879
|
"aria-describedby": s.descriptionPresent ? s.descriptionId : void 0,
|
|
880
880
|
"aria-labelledby": s.titlePresent ? s.titleId : void 0,
|
|
881
|
-
"data-state":
|
|
881
|
+
"data-state": In(s.open),
|
|
882
882
|
...o,
|
|
883
883
|
ref: t,
|
|
884
884
|
deferPointerDownOutside: !0,
|
|
885
885
|
onDismiss: () => s.onOpenChange(!1)
|
|
886
886
|
})
|
|
887
887
|
}) });
|
|
888
|
-
}, "DialogContentImpl")),
|
|
889
|
-
let { __scopeDialog: n, ...r } = e, i =
|
|
890
|
-
return T(() => (a((e) => e + 1), () => a((e) => e - 1)), [a]), /* @__PURE__ */
|
|
888
|
+
}, "DialogContentImpl")), An = "DialogTitle", jn = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ I(function(e, t) {
|
|
889
|
+
let { __scopeDialog: n, ...r } = e, i = L(An, n), { setTitleCount: a } = i;
|
|
890
|
+
return T(() => (a((e) => e + 1), () => a((e) => e - 1)), [a]), /* @__PURE__ */ D(s.h2, {
|
|
891
891
|
id: i.titleId,
|
|
892
892
|
...r,
|
|
893
893
|
ref: t
|
|
894
894
|
});
|
|
895
|
-
}, "DialogTitle")),
|
|
896
|
-
let { __scopeDialog: n, ...r } = e, i =
|
|
897
|
-
return T(() => (a((e) => e + 1), () => a((e) => e - 1)), [a]), /* @__PURE__ */
|
|
895
|
+
}, "DialogTitle")), Mn = "DialogDescription", Nn = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ I(function(e, t) {
|
|
896
|
+
let { __scopeDialog: n, ...r } = e, i = L(Mn, n), { setDescriptionCount: a } = i;
|
|
897
|
+
return T(() => (a((e) => e + 1), () => a((e) => e - 1)), [a]), /* @__PURE__ */ D(s.p, {
|
|
898
898
|
id: i.descriptionId,
|
|
899
899
|
...r,
|
|
900
900
|
ref: t
|
|
901
901
|
});
|
|
902
|
-
}, "DialogDescription")),
|
|
903
|
-
let { __scopeDialog: n, ...r } = e, i =
|
|
904
|
-
return /* @__PURE__ */
|
|
902
|
+
}, "DialogDescription")), Pn = "DialogClose", Fn = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ I(function(e, t) {
|
|
903
|
+
let { __scopeDialog: n, ...r } = e, i = L(Pn, n);
|
|
904
|
+
return /* @__PURE__ */ D(s.button, {
|
|
905
905
|
type: "button",
|
|
906
906
|
...r,
|
|
907
907
|
ref: t,
|
|
908
908
|
onClick: a(e.onClick, () => i.onOpenChange(!1))
|
|
909
909
|
});
|
|
910
910
|
}, "DialogClose"));
|
|
911
|
-
function
|
|
911
|
+
function In(e) {
|
|
912
912
|
return e ? "open" : "closed";
|
|
913
913
|
}
|
|
914
|
-
|
|
914
|
+
I(In, "getState");
|
|
915
915
|
//#endregion
|
|
916
916
|
//#region ../../node_modules/@radix-ui/react-label/dist/index.mjs
|
|
917
|
-
var
|
|
917
|
+
var Ln = Object.defineProperty, Rn = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ ((e, t) => Ln(e, "name", {
|
|
918
918
|
value: t,
|
|
919
919
|
configurable: !0
|
|
920
920
|
}))(function(e, t) {
|
|
921
|
-
return /* @__PURE__ */
|
|
921
|
+
return /* @__PURE__ */ D(s.label, {
|
|
922
922
|
...e,
|
|
923
923
|
ref: t,
|
|
924
924
|
onMouseDown: (t) => {
|
|
925
925
|
t.target.closest("button, input, select, textarea") || (e.onMouseDown?.(t), !t.defaultPrevented && t.detail > 1 && t.preventDefault());
|
|
926
926
|
}
|
|
927
927
|
});
|
|
928
|
-
}, "Label")),
|
|
928
|
+
}, "Label")), zn = Object.defineProperty, R = (e, t) => zn(e, "name", {
|
|
929
929
|
value: t,
|
|
930
930
|
configurable: !0
|
|
931
|
-
}),
|
|
932
|
-
let { __scopeHoverCard: t, children: n, open: r, defaultOpen: i, onOpenChange: a, openDelay: o = 700, closeDelay: s = 300 } = e, c =
|
|
931
|
+
}), Bn, Vn = "HoverCard", [Hn, Un] = m(Vn, [l]), Wn = l(), [Gn, Kn] = Hn(Vn), qn = /* @__PURE__ */ R((e) => {
|
|
932
|
+
let { __scopeHoverCard: t, children: n, open: r, defaultOpen: i, onOpenChange: a, openDelay: o = 700, closeDelay: s = 300 } = e, c = Wn(t), l = k.useRef(0), d = k.useRef(0), f = k.useRef(!1), p = k.useRef(!1), [m, h] = b({
|
|
933
933
|
prop: r,
|
|
934
934
|
defaultProp: i ?? !1,
|
|
935
935
|
onChange: a,
|
|
936
|
-
caller:
|
|
937
|
-
}), g =
|
|
936
|
+
caller: Vn
|
|
937
|
+
}), g = k.useCallback(() => {
|
|
938
938
|
clearTimeout(d.current), l.current = window.setTimeout(() => h(!0), o);
|
|
939
|
-
}, [o, h]), _ =
|
|
939
|
+
}, [o, h]), _ = k.useCallback(() => {
|
|
940
940
|
clearTimeout(l.current), !f.current && !p.current && (d.current = window.setTimeout(() => h(!1), s));
|
|
941
|
-
}, [s, h]), v =
|
|
942
|
-
return
|
|
941
|
+
}, [s, h]), v = k.useCallback(() => h(!1), [h]);
|
|
942
|
+
return k.useEffect(() => () => {
|
|
943
943
|
clearTimeout(l.current), clearTimeout(d.current);
|
|
944
|
-
}, []), /* @__PURE__ */
|
|
944
|
+
}, []), /* @__PURE__ */ D(Gn, {
|
|
945
945
|
scope: t,
|
|
946
946
|
open: m,
|
|
947
947
|
onOpenChange: h,
|
|
@@ -950,65 +950,65 @@ var Rn = Object.defineProperty, zn = /* @__PURE__ */ O.forwardRef(/* @__PURE__ *
|
|
|
950
950
|
onDismiss: v,
|
|
951
951
|
hasSelectionRef: f,
|
|
952
952
|
isPointerDownOnContentRef: p,
|
|
953
|
-
children: /* @__PURE__ */
|
|
953
|
+
children: /* @__PURE__ */ D(u, {
|
|
954
954
|
...c,
|
|
955
955
|
children: n
|
|
956
956
|
})
|
|
957
957
|
});
|
|
958
|
-
}, "HoverCard"),
|
|
959
|
-
let { __scopeHoverCard: n, ...r } = e, i =
|
|
960
|
-
return /* @__PURE__ */
|
|
958
|
+
}, "HoverCard"), Jn = "HoverCardTrigger", Yn = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ R(function(e, t) {
|
|
959
|
+
let { __scopeHoverCard: n, ...r } = e, i = Kn(Jn, n);
|
|
960
|
+
return /* @__PURE__ */ D(x, {
|
|
961
961
|
asChild: !0,
|
|
962
|
-
...
|
|
963
|
-
children: /* @__PURE__ */
|
|
962
|
+
...Wn(n),
|
|
963
|
+
children: /* @__PURE__ */ D(s.a, {
|
|
964
964
|
"data-state": i.open ? "open" : "closed",
|
|
965
965
|
...r,
|
|
966
966
|
ref: t,
|
|
967
|
-
onPointerEnter: a(e.onPointerEnter,
|
|
968
|
-
onPointerLeave: a(e.onPointerLeave,
|
|
967
|
+
onPointerEnter: a(e.onPointerEnter, rr(i.onOpen)),
|
|
968
|
+
onPointerLeave: a(e.onPointerLeave, rr(i.onClose)),
|
|
969
969
|
onFocus: a(e.onFocus, i.onOpen),
|
|
970
970
|
onBlur: a(e.onBlur, i.onClose),
|
|
971
971
|
onTouchStart: a(e.onTouchStart, (e) => e.preventDefault())
|
|
972
972
|
})
|
|
973
973
|
});
|
|
974
|
-
}, "HoverCardTrigger")),
|
|
975
|
-
let { __scopeHoverCard: t, forceMount: n, children: r, container: a } = e, o =
|
|
976
|
-
return /* @__PURE__ */
|
|
974
|
+
}, "HoverCardTrigger")), Xn = "HoverCardPortal", [Zn, Qn] = Hn(Xn, { forceMount: void 0 }), $n = /* @__PURE__ */ R((e) => {
|
|
975
|
+
let { __scopeHoverCard: t, forceMount: n, children: r, container: a } = e, o = Kn(Xn, t);
|
|
976
|
+
return /* @__PURE__ */ D(Zn, {
|
|
977
977
|
scope: t,
|
|
978
978
|
forceMount: n,
|
|
979
|
-
children: /* @__PURE__ */
|
|
979
|
+
children: /* @__PURE__ */ D(i, {
|
|
980
980
|
present: n || o.open,
|
|
981
|
-
children: /* @__PURE__ */
|
|
981
|
+
children: /* @__PURE__ */ D(c, {
|
|
982
982
|
asChild: !0,
|
|
983
983
|
container: a,
|
|
984
984
|
children: r
|
|
985
985
|
})
|
|
986
986
|
})
|
|
987
987
|
});
|
|
988
|
-
}, "HoverCardPortal"),
|
|
989
|
-
let n =
|
|
990
|
-
return /* @__PURE__ */
|
|
988
|
+
}, "HoverCardPortal"), er = "HoverCardContent", tr = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ R(function(e, t) {
|
|
989
|
+
let n = Qn(er, e.__scopeHoverCard), { forceMount: r = n.forceMount, ...o } = e, s = Kn(er, e.__scopeHoverCard);
|
|
990
|
+
return /* @__PURE__ */ D(i, {
|
|
991
991
|
present: r || s.open,
|
|
992
|
-
children: /* @__PURE__ */
|
|
992
|
+
children: /* @__PURE__ */ D(nr, {
|
|
993
993
|
"data-state": s.open ? "open" : "closed",
|
|
994
994
|
...o,
|
|
995
|
-
onPointerEnter: a(e.onPointerEnter,
|
|
996
|
-
onPointerLeave: a(e.onPointerLeave,
|
|
995
|
+
onPointerEnter: a(e.onPointerEnter, rr(s.onOpen)),
|
|
996
|
+
onPointerLeave: a(e.onPointerLeave, rr(s.onClose)),
|
|
997
997
|
ref: t
|
|
998
998
|
})
|
|
999
999
|
});
|
|
1000
|
-
}, "HoverCardContent")),
|
|
1001
|
-
let { __scopeHoverCard: r, onEscapeKeyDown: i, onPointerDownOutside: o, onFocusOutside: s, onInteractOutside: c, ...l } = e, u =
|
|
1002
|
-
return
|
|
1000
|
+
}, "HoverCardContent")), nr = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ R(function(e, t) {
|
|
1001
|
+
let { __scopeHoverCard: r, onEscapeKeyDown: i, onPointerDownOutside: o, onFocusOutside: s, onInteractOutside: c, ...l } = e, u = Kn(er, r), d = Wn(r), f = k.useRef(null), p = n(t, f), [m, g] = k.useState(!1);
|
|
1002
|
+
return k.useEffect(() => {
|
|
1003
1003
|
if (m) {
|
|
1004
1004
|
let e = document.body;
|
|
1005
|
-
return
|
|
1006
|
-
e.style.userSelect =
|
|
1005
|
+
return Bn = e.style.userSelect || e.style.webkitUserSelect, e.style.userSelect = "none", e.style.webkitUserSelect = "none", () => {
|
|
1006
|
+
e.style.userSelect = Bn, e.style.webkitUserSelect = Bn;
|
|
1007
1007
|
};
|
|
1008
1008
|
}
|
|
1009
|
-
}, [m]),
|
|
1009
|
+
}, [m]), k.useEffect(() => {
|
|
1010
1010
|
if (f.current) {
|
|
1011
|
-
let e = /* @__PURE__ */
|
|
1011
|
+
let e = /* @__PURE__ */ R(() => {
|
|
1012
1012
|
g(!1), u.isPointerDownOnContentRef.current = !1, setTimeout(() => {
|
|
1013
1013
|
document.getSelection()?.toString() !== "" && (u.hasSelectionRef.current = !0);
|
|
1014
1014
|
});
|
|
@@ -1017,9 +1017,9 @@ var Rn = Object.defineProperty, zn = /* @__PURE__ */ O.forwardRef(/* @__PURE__ *
|
|
|
1017
1017
|
document.removeEventListener("pointerup", e), u.hasSelectionRef.current = !1, u.isPointerDownOnContentRef.current = !1;
|
|
1018
1018
|
};
|
|
1019
1019
|
}
|
|
1020
|
-
}, [u.isPointerDownOnContentRef, u.hasSelectionRef]),
|
|
1021
|
-
f.current &&
|
|
1022
|
-
}), /* @__PURE__ */
|
|
1020
|
+
}, [u.isPointerDownOnContentRef, u.hasSelectionRef]), k.useEffect(() => {
|
|
1021
|
+
f.current && ir(f.current).forEach((e) => e.setAttribute("tabindex", "-1"));
|
|
1022
|
+
}), /* @__PURE__ */ D(ee, {
|
|
1023
1023
|
asChild: !0,
|
|
1024
1024
|
disableOutsidePointerEvents: !1,
|
|
1025
1025
|
onInteractOutside: c,
|
|
@@ -1029,7 +1029,7 @@ var Rn = Object.defineProperty, zn = /* @__PURE__ */ O.forwardRef(/* @__PURE__ *
|
|
|
1029
1029
|
e.preventDefault();
|
|
1030
1030
|
}),
|
|
1031
1031
|
onDismiss: u.onDismiss,
|
|
1032
|
-
children: /* @__PURE__ */
|
|
1032
|
+
children: /* @__PURE__ */ D(h, {
|
|
1033
1033
|
...d,
|
|
1034
1034
|
...l,
|
|
1035
1035
|
onPointerDown: a(l.onPointerDown, (e) => {
|
|
@@ -1049,17 +1049,17 @@ var Rn = Object.defineProperty, zn = /* @__PURE__ */ O.forwardRef(/* @__PURE__ *
|
|
|
1049
1049
|
})
|
|
1050
1050
|
});
|
|
1051
1051
|
}, "HoverCardContentImpl"));
|
|
1052
|
-
function
|
|
1052
|
+
function rr(e) {
|
|
1053
1053
|
return (t) => t.pointerType === "touch" ? void 0 : e();
|
|
1054
1054
|
}
|
|
1055
|
-
|
|
1056
|
-
function
|
|
1057
|
-
let t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: /* @__PURE__ */
|
|
1055
|
+
R(rr, "excludeTouch");
|
|
1056
|
+
function ir(e) {
|
|
1057
|
+
let t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: /* @__PURE__ */ R((e) => e.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP, "acceptNode") });
|
|
1058
1058
|
for (; n.nextNode();) t.push(n.currentNode);
|
|
1059
1059
|
return t;
|
|
1060
1060
|
}
|
|
1061
|
-
|
|
1062
|
-
var
|
|
1061
|
+
R(ir, "getTabbableNodes");
|
|
1062
|
+
var ar = qn, or = Yn, sr = $n, cr = tr, lr = o("transition-all duration-500", {
|
|
1063
1063
|
variants: {
|
|
1064
1064
|
variant: {
|
|
1065
1065
|
1: "",
|
|
@@ -1245,9 +1245,9 @@ var or = Jn, sr = Xn, cr = er, lr = nr, ur = o("transition-all duration-500", {
|
|
|
1245
1245
|
}
|
|
1246
1246
|
]
|
|
1247
1247
|
});
|
|
1248
|
-
function
|
|
1249
|
-
let { t: a } =
|
|
1250
|
-
return e === "4" ? /* @__PURE__ */
|
|
1248
|
+
function ur({ variant: e = "1", color: n, className: r, ...i }) {
|
|
1249
|
+
let { t: a } = te();
|
|
1250
|
+
return e === "4" ? /* @__PURE__ */ D("svg", {
|
|
1251
1251
|
viewBox: "0 0 800 800",
|
|
1252
1252
|
"data-slot": "spinner",
|
|
1253
1253
|
"data-variant": e,
|
|
@@ -1256,8 +1256,8 @@ function dr({ variant: e = "1", color: n, className: r, ...i }) {
|
|
|
1256
1256
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1257
1257
|
role: "img",
|
|
1258
1258
|
"aria-label": i["aria-label"] ?? a("material.spinner.loading", "Loading..."),
|
|
1259
|
-
children: /* @__PURE__ */
|
|
1260
|
-
className: t("spin2",
|
|
1259
|
+
children: /* @__PURE__ */ D("circle", {
|
|
1260
|
+
className: t("spin2", lr({
|
|
1261
1261
|
variant: e,
|
|
1262
1262
|
color: n
|
|
1263
1263
|
})),
|
|
@@ -1269,11 +1269,11 @@ function dr({ variant: e = "1", color: n, className: r, ...i }) {
|
|
|
1269
1269
|
strokeDasharray: "700 1400",
|
|
1270
1270
|
strokeLinecap: "round"
|
|
1271
1271
|
})
|
|
1272
|
-
}) : /* @__PURE__ */
|
|
1272
|
+
}) : /* @__PURE__ */ D("div", {
|
|
1273
1273
|
"data-slot": "spinner",
|
|
1274
1274
|
"data-variant": e,
|
|
1275
1275
|
"data-color": n,
|
|
1276
|
-
className: t("size-12 border-[2px] rounded-full animate-spin",
|
|
1276
|
+
className: t("size-12 border-[2px] rounded-full animate-spin", lr({
|
|
1277
1277
|
variant: e,
|
|
1278
1278
|
color: n,
|
|
1279
1279
|
className: r
|
|
@@ -1283,7 +1283,7 @@ function dr({ variant: e = "1", color: n, className: r, ...i }) {
|
|
|
1283
1283
|
}
|
|
1284
1284
|
//#endregion
|
|
1285
1285
|
//#region lib/components/ui/actions/button/busy-click-capture.ts
|
|
1286
|
-
function
|
|
1286
|
+
function dr(e, t, n) {
|
|
1287
1287
|
return (r) => {
|
|
1288
1288
|
if (e || t.isLocked()) {
|
|
1289
1289
|
r.preventDefault(), r.stopPropagation();
|
|
@@ -1294,7 +1294,7 @@ function fr(e, t, n) {
|
|
|
1294
1294
|
}
|
|
1295
1295
|
//#endregion
|
|
1296
1296
|
//#region lib/components/ui/actions/button/button.variants.ts
|
|
1297
|
-
var
|
|
1297
|
+
var fr = o("inline-flex center truncate **:truncate gap-2 h-min cursor-pointer whitespace-nowrap rounded-full text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 aria-busy:cursor-progress [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-error/20 dark:aria-invalid:ring-error/40 aria-invalid:border-error px-4 py-2 has-[>svg]:px-3", {
|
|
1298
1298
|
variants: {
|
|
1299
1299
|
variant: {
|
|
1300
1300
|
filled: "shadow-xs",
|
|
@@ -1469,108 +1469,114 @@ var pr = o("inline-flex center truncate **:truncate gap-2 h-min cursor-pointer w
|
|
|
1469
1469
|
class: `${f.default} ${C.default} hover:bg-foreground/10 active:bg-muted focus:bg-foreground/15`
|
|
1470
1470
|
}
|
|
1471
1471
|
]
|
|
1472
|
-
}),
|
|
1472
|
+
}), pr = {
|
|
1473
1473
|
xs: "min-h-6",
|
|
1474
1474
|
sm: "min-h-8",
|
|
1475
1475
|
default: "min-h-9",
|
|
1476
1476
|
lg: "min-h-10"
|
|
1477
1477
|
};
|
|
1478
|
-
function
|
|
1479
|
-
return !e || t?.startsWith("icon") ? !1 : `h-auto ${t ?
|
|
1478
|
+
function mr(e, t) {
|
|
1479
|
+
return !e || t?.startsWith("icon") ? !1 : `h-auto ${t ? pr[t] : ""} whitespace-normal **:whitespace-normal text-center`;
|
|
1480
1480
|
}
|
|
1481
1481
|
//#endregion
|
|
1482
1482
|
//#region lib/components/ui/actions/button/has-text-content.ts
|
|
1483
|
-
function
|
|
1484
|
-
return e == null || typeof e == "boolean" ? !1 : typeof e == "string" || typeof e == "number" || typeof e == "bigint" ? String(e).trim() !== "" : Array.isArray(e) ? e.some(
|
|
1483
|
+
function hr(e) {
|
|
1484
|
+
return e == null || typeof e == "boolean" ? !1 : typeof e == "string" || typeof e == "number" || typeof e == "bigint" ? String(e).trim() !== "" : Array.isArray(e) ? e.some(hr) : ce(e) ? !gr(e.props["aria-hidden"]) && hr(e.props.children) : !1;
|
|
1485
1485
|
}
|
|
1486
|
-
function
|
|
1486
|
+
function gr(e) {
|
|
1487
1487
|
return !!e && e !== "false";
|
|
1488
1488
|
}
|
|
1489
1489
|
//#endregion
|
|
1490
1490
|
//#region lib/components/ui/actions/button/label-text.tsx
|
|
1491
|
-
function
|
|
1491
|
+
function _r(e) {
|
|
1492
1492
|
let t = [], n = 0, r = [], i = () => {
|
|
1493
1493
|
if (r.length === 0) return;
|
|
1494
1494
|
let e = r.join("");
|
|
1495
|
-
r = [], e.trim() === "" ? t.push(e) : t.push(/* @__PURE__ */
|
|
1495
|
+
r = [], e.trim() === "" ? t.push(e) : t.push(/* @__PURE__ */ D("span", {
|
|
1496
1496
|
"data-slot": "button-label",
|
|
1497
1497
|
children: e
|
|
1498
1498
|
}, `label-${n++}`));
|
|
1499
1499
|
};
|
|
1500
|
-
for (let n of
|
|
1500
|
+
for (let n of j.toArray(e)) {
|
|
1501
1501
|
if (typeof n == "string" || typeof n == "number" || typeof n == "bigint") {
|
|
1502
1502
|
r.push(n);
|
|
1503
1503
|
continue;
|
|
1504
1504
|
}
|
|
1505
|
-
i(), t.push(
|
|
1505
|
+
i(), t.push(vr(n));
|
|
1506
1506
|
}
|
|
1507
1507
|
return i(), t;
|
|
1508
1508
|
}
|
|
1509
|
-
function
|
|
1510
|
-
return
|
|
1509
|
+
function vr(e) {
|
|
1510
|
+
return ce(e) && e.type === ae ? oe(e, void 0, _r(e.props.children)) : e;
|
|
1511
1511
|
}
|
|
1512
1512
|
//#endregion
|
|
1513
1513
|
//#region lib/components/ui/actions/button/use-click-lock.ts
|
|
1514
|
-
var
|
|
1515
|
-
function
|
|
1516
|
-
let n =
|
|
1514
|
+
var yr = 1e3;
|
|
1515
|
+
function br(e, t) {
|
|
1516
|
+
let n = N(!1), r = N(!1), i = N(void 0), [a, o] = he(!1), s = M(() => {
|
|
1517
1517
|
n.current = !1, r.current = !1, clearTimeout(i.current), o(!1);
|
|
1518
|
-
}, []), c =
|
|
1518
|
+
}, []), c = M(() => {
|
|
1519
1519
|
e && (n.current = !0, o(!0), clearTimeout(i.current), i.current = setTimeout(() => {
|
|
1520
1520
|
r.current || s();
|
|
1521
|
-
},
|
|
1521
|
+
}, yr));
|
|
1522
1522
|
}, [e, s]);
|
|
1523
|
-
return
|
|
1523
|
+
return de(() => {
|
|
1524
1524
|
n.current && (t ? r.current = !0 : r.current && s());
|
|
1525
|
-
}, [t, s]),
|
|
1525
|
+
}, [t, s]), de(() => () => clearTimeout(i.current), []), {
|
|
1526
1526
|
locked: a,
|
|
1527
1527
|
lock: c,
|
|
1528
|
-
isLocked:
|
|
1528
|
+
isLocked: M(() => n.current, [])
|
|
1529
1529
|
};
|
|
1530
1530
|
}
|
|
1531
1531
|
//#endregion
|
|
1532
1532
|
//#region lib/components/ui/actions/button/button.tsx
|
|
1533
|
-
function
|
|
1534
|
-
let _ = i ? S : "button", v =
|
|
1535
|
-
return /* @__PURE__ */
|
|
1533
|
+
function xr({ className: e, variant: n = "filled", asChild: i = !1, children: a, color: o, size: s, loading: c = !1, lockOnClick: l, spinnerVariant: u = "2", wrap: d, disabled: f, onClickCapture: p, type: m = "button", ...h }) {
|
|
1534
|
+
let _ = i ? S : "button", v = ue(r) || !!(h["aria-label"] || h["aria-labelledby"]) || hr(a), y = br(l, c), b = c || y.locked, x = dr(b, y, p);
|
|
1535
|
+
return /* @__PURE__ */ D(r, {
|
|
1536
1536
|
value: v,
|
|
1537
|
-
children: /* @__PURE__ */
|
|
1537
|
+
children: /* @__PURE__ */ O(_, {
|
|
1538
1538
|
"data-slot": "button",
|
|
1539
1539
|
"data-variant": n,
|
|
1540
1540
|
"data-color": o,
|
|
1541
|
-
className: t("w-fit max-w-full truncate justify-center line-clamp-1 text-ellipsis duration-500",
|
|
1541
|
+
className: t("w-fit max-w-full truncate justify-center line-clamp-1 text-ellipsis duration-500", fr({
|
|
1542
1542
|
variant: n,
|
|
1543
1543
|
color: o,
|
|
1544
1544
|
size: s
|
|
1545
|
-
}),
|
|
1545
|
+
}), mr(d, s), e),
|
|
1546
1546
|
type: i ? void 0 : m,
|
|
1547
1547
|
disabled: f,
|
|
1548
1548
|
...h,
|
|
1549
1549
|
"aria-disabled": b || h["aria-disabled"],
|
|
1550
1550
|
"aria-busy": b || h["aria-busy"],
|
|
1551
1551
|
onClickCapture: x,
|
|
1552
|
-
children: [b && /* @__PURE__ */
|
|
1552
|
+
children: [b && /* @__PURE__ */ D(ur, {
|
|
1553
1553
|
variant: u,
|
|
1554
1554
|
color: n === "filled" ? "light" : o,
|
|
1555
1555
|
className: t("starting:scale-0 duration-500", u === "4" ? "size-7.5" : "size-4.5")
|
|
1556
|
-
}), /* @__PURE__ */
|
|
1556
|
+
}), /* @__PURE__ */ D(g, { children: i ? a : _r(a) })]
|
|
1557
1557
|
})
|
|
1558
1558
|
});
|
|
1559
1559
|
}
|
|
1560
|
-
function
|
|
1561
|
-
return e ? /* @__PURE__ */
|
|
1560
|
+
function Sr({ tooltip: e, ...t }) {
|
|
1561
|
+
return e ? /* @__PURE__ */ D(y, {
|
|
1562
1562
|
content: e,
|
|
1563
|
-
children: /* @__PURE__ */
|
|
1564
|
-
}) : /* @__PURE__ */
|
|
1563
|
+
children: /* @__PURE__ */ D(xr, { ...t })
|
|
1564
|
+
}) : /* @__PURE__ */ D(xr, { ...t });
|
|
1565
|
+
}
|
|
1566
|
+
//#endregion
|
|
1567
|
+
//#region lib/components/ui/overlays/dialog/in-dialog.ts
|
|
1568
|
+
var Cr = se(!1);
|
|
1569
|
+
function wr() {
|
|
1570
|
+
return ue(Cr);
|
|
1565
1571
|
}
|
|
1566
1572
|
//#endregion
|
|
1567
1573
|
//#region lib/components/ui/overlays/dialog/use-inert-others.ts
|
|
1568
|
-
var
|
|
1569
|
-
function
|
|
1570
|
-
let [r, i] =
|
|
1571
|
-
return
|
|
1574
|
+
var Tr = se(void 0);
|
|
1575
|
+
function Er(e, t) {
|
|
1576
|
+
let [r, i] = he(null), [a, o] = Dr(r), s = N(null);
|
|
1577
|
+
return de(() => {
|
|
1572
1578
|
if (!e || !a || !r || r.getAttribute("data-state") === "closed") return;
|
|
1573
|
-
let t =
|
|
1579
|
+
let t = _e(r);
|
|
1574
1580
|
return s.current = t, () => {
|
|
1575
1581
|
s.current = null, t();
|
|
1576
1582
|
};
|
|
@@ -1578,13 +1584,13 @@ function Tr(e, t) {
|
|
|
1578
1584
|
e,
|
|
1579
1585
|
a,
|
|
1580
1586
|
r
|
|
1581
|
-
]),
|
|
1587
|
+
]), pe(() => {
|
|
1582
1588
|
!a || r?.getAttribute("data-state") !== "closed" || (s.current?.(), o(!1));
|
|
1583
1589
|
}), n(i, t);
|
|
1584
1590
|
}
|
|
1585
|
-
function
|
|
1586
|
-
let [t, n] =
|
|
1587
|
-
return
|
|
1591
|
+
function Dr(e) {
|
|
1592
|
+
let [t, n] = he(!0);
|
|
1593
|
+
return de(() => {
|
|
1588
1594
|
let t = e?.ownerDocument.defaultView?.MutationObserver;
|
|
1589
1595
|
if (!e || !t) return;
|
|
1590
1596
|
let r = () => n(e.getAttribute("data-state") !== "closed");
|
|
@@ -1593,28 +1599,28 @@ function Er(e) {
|
|
|
1593
1599
|
return i.observe(e, { attributeFilter: ["data-state"] }), () => i.disconnect();
|
|
1594
1600
|
}, [e]), [t, n];
|
|
1595
1601
|
}
|
|
1596
|
-
function
|
|
1597
|
-
return
|
|
1602
|
+
function Or(e, t) {
|
|
1603
|
+
return Er(ue(Tr) ?? e, t);
|
|
1598
1604
|
}
|
|
1599
1605
|
//#endregion
|
|
1600
1606
|
//#region ../../node_modules/react-use/esm/misc/util.js
|
|
1601
|
-
var
|
|
1602
|
-
function
|
|
1607
|
+
var kr = function() {};
|
|
1608
|
+
function Ar(e) {
|
|
1603
1609
|
var t = [...arguments].slice(1);
|
|
1604
1610
|
e && e.addEventListener && e.addEventListener.apply(e, t);
|
|
1605
1611
|
}
|
|
1606
|
-
function
|
|
1612
|
+
function jr(e) {
|
|
1607
1613
|
var t = [...arguments].slice(1);
|
|
1608
1614
|
e && e.removeEventListener && e.removeEventListener.apply(e, t);
|
|
1609
1615
|
}
|
|
1610
|
-
var
|
|
1616
|
+
var Mr = typeof window < "u", Nr = Mr ? window : null, Pr = function(e) {
|
|
1611
1617
|
return !!e.addEventListener;
|
|
1612
|
-
},
|
|
1618
|
+
}, Fr = function(e) {
|
|
1613
1619
|
return !!e.on;
|
|
1614
|
-
},
|
|
1615
|
-
n === void 0 && (n =
|
|
1616
|
-
if (t && n) return
|
|
1617
|
-
|
|
1620
|
+
}, Ir = function(e, t, n, r) {
|
|
1621
|
+
n === void 0 && (n = Nr), de(function() {
|
|
1622
|
+
if (t && n) return Pr(n) ? Ar(n, e, t, r) : Fr(n) && n.on(e, t, r), function() {
|
|
1623
|
+
Pr(n) ? jr(n, e, t, r) : Fr(n) && n.off(e, t, r);
|
|
1618
1624
|
};
|
|
1619
1625
|
}, [
|
|
1620
1626
|
e,
|
|
@@ -1622,10 +1628,10 @@ var jr = typeof window < "u", Mr = jr ? window : null, Nr = function(e) {
|
|
|
1622
1628
|
n,
|
|
1623
1629
|
JSON.stringify(r)
|
|
1624
1630
|
]);
|
|
1625
|
-
},
|
|
1626
|
-
var t =
|
|
1631
|
+
}, Lr = function(e) {
|
|
1632
|
+
var t = N(e);
|
|
1627
1633
|
return t.current = e, t;
|
|
1628
|
-
},
|
|
1634
|
+
}, Rr = o("in-[[data-state=selected]]:text-primary-foreground", {
|
|
1629
1635
|
variants: {
|
|
1630
1636
|
variant: {
|
|
1631
1637
|
normal: "text-sm",
|
|
@@ -1656,10 +1662,10 @@ var jr = typeof window < "u", Mr = jr ? window : null, Nr = function(e) {
|
|
|
1656
1662
|
tone: "default"
|
|
1657
1663
|
}
|
|
1658
1664
|
});
|
|
1659
|
-
function
|
|
1660
|
-
return /* @__PURE__ */
|
|
1665
|
+
function zr({ className: e, variant: n, tone: r, as: i = "div", asChild: a = !1, ...o }) {
|
|
1666
|
+
return /* @__PURE__ */ D(a ? S : i, {
|
|
1661
1667
|
"data-test": "typography",
|
|
1662
|
-
className: t(
|
|
1668
|
+
className: t(Rr({
|
|
1663
1669
|
variant: n,
|
|
1664
1670
|
tone: r,
|
|
1665
1671
|
className: e
|
|
@@ -1669,22 +1675,22 @@ function Rr({ className: e, variant: n, tone: r, as: i = "div", asChild: a = !1,
|
|
|
1669
1675
|
}
|
|
1670
1676
|
//#endregion
|
|
1671
1677
|
//#region lib/components/ui/forms/field-blur-context.ts
|
|
1672
|
-
var
|
|
1673
|
-
function
|
|
1674
|
-
return
|
|
1678
|
+
var Br = se(null);
|
|
1679
|
+
function Vr(e, t) {
|
|
1680
|
+
return me(() => e ? t ? (n) => {
|
|
1675
1681
|
let r = e(n), i = typeof t == "function" ? t(n) : void 0;
|
|
1676
1682
|
return typeof t != "function" && (t.current = n), () => {
|
|
1677
1683
|
r?.(), typeof i == "function" ? i() : typeof t == "function" ? t(null) : t.current = null;
|
|
1678
1684
|
};
|
|
1679
1685
|
} : e : t, [e, t]);
|
|
1680
1686
|
}
|
|
1681
|
-
function
|
|
1682
|
-
return
|
|
1687
|
+
function Hr(e) {
|
|
1688
|
+
return Vr(le(Br), e);
|
|
1683
1689
|
}
|
|
1684
1690
|
//#endregion
|
|
1685
1691
|
//#region lib/components/ui/primitives/helper-text/helper-text.tsx
|
|
1686
|
-
function
|
|
1687
|
-
return /* @__PURE__ */
|
|
1692
|
+
function Ur({ error: e, className: n, ...r }) {
|
|
1693
|
+
return /* @__PURE__ */ D(zr, {
|
|
1688
1694
|
"data-slot": "helper-text",
|
|
1689
1695
|
variant: "caption",
|
|
1690
1696
|
className: t("flex pl-0.5 truncate text-wrap", { "text-error-text": e }, n),
|
|
@@ -1693,8 +1699,8 @@ function Hr({ error: e, className: n, ...r }) {
|
|
|
1693
1699
|
}
|
|
1694
1700
|
//#endregion
|
|
1695
1701
|
//#region lib/components/ui/primitives/label/label.tsx
|
|
1696
|
-
function
|
|
1697
|
-
return /* @__PURE__ */
|
|
1702
|
+
function Wr() {
|
|
1703
|
+
return /* @__PURE__ */ D("svg", {
|
|
1698
1704
|
"data-slot": "label-required-mark",
|
|
1699
1705
|
"aria-hidden": "true",
|
|
1700
1706
|
focusable: "false",
|
|
@@ -1703,39 +1709,39 @@ function Ur() {
|
|
|
1703
1709
|
stroke: "currentColor",
|
|
1704
1710
|
strokeWidth: "1.75",
|
|
1705
1711
|
strokeLinecap: "round",
|
|
1706
|
-
children: /* @__PURE__ */
|
|
1712
|
+
children: /* @__PURE__ */ D("path", { d: "M5 1v8M1.5 3l7 4M8.5 3l-7 4" })
|
|
1707
1713
|
});
|
|
1708
1714
|
}
|
|
1709
|
-
function
|
|
1710
|
-
return /* @__PURE__ */
|
|
1715
|
+
function Gr({ className: e, withAsterisk: n, ...r }) {
|
|
1716
|
+
return /* @__PURE__ */ D(Rn, {
|
|
1711
1717
|
"data-slot": "label",
|
|
1712
1718
|
className: t("flex items-center pl-0.5 gap-2 text-sm leading-none font-semibold select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", e),
|
|
1713
1719
|
...r,
|
|
1714
|
-
children: n ? /* @__PURE__ */
|
|
1720
|
+
children: n ? /* @__PURE__ */ O("span", {
|
|
1715
1721
|
"data-slot": "label-text",
|
|
1716
1722
|
"data-required": "",
|
|
1717
1723
|
className: "inline-flex",
|
|
1718
|
-
children: [r.children, /* @__PURE__ */
|
|
1724
|
+
children: [r.children, /* @__PURE__ */ D(Wr, {})]
|
|
1719
1725
|
}) : r.children
|
|
1720
1726
|
});
|
|
1721
1727
|
}
|
|
1722
1728
|
//#endregion
|
|
1723
1729
|
//#region lib/components/ui/overlays/dialog/use-escape-forward.ts
|
|
1724
|
-
function
|
|
1725
|
-
let r =
|
|
1730
|
+
function Kr(e, t) {
|
|
1731
|
+
let r = N(null);
|
|
1726
1732
|
return {
|
|
1727
1733
|
ref: n(r, t),
|
|
1728
1734
|
onEscapeKeyDown(t) {
|
|
1729
|
-
e?.(t),
|
|
1735
|
+
e?.(t), ve(r.current, t);
|
|
1730
1736
|
}
|
|
1731
1737
|
};
|
|
1732
1738
|
}
|
|
1733
1739
|
//#endregion
|
|
1734
1740
|
//#region lib/components/ui/overlays/dialog/use-overlay-order.ts
|
|
1735
|
-
function
|
|
1736
|
-
let t =
|
|
1741
|
+
function qr(e) {
|
|
1742
|
+
let t = N(null);
|
|
1737
1743
|
return {
|
|
1738
|
-
overlayRef:
|
|
1744
|
+
overlayRef: M((e) => {
|
|
1739
1745
|
let n = t.current;
|
|
1740
1746
|
!e || !n?.isConnected || n.parentNode === e.parentNode && n.compareDocumentPosition(e) & Node.DOCUMENT_POSITION_FOLLOWING && n.before(e);
|
|
1741
1747
|
}, []),
|
|
@@ -1744,20 +1750,20 @@ function Kr(e) {
|
|
|
1744
1750
|
}
|
|
1745
1751
|
//#endregion
|
|
1746
1752
|
//#region lib/components/ui/overlays/dialog/use-modal-content.ts
|
|
1747
|
-
function
|
|
1748
|
-
let i =
|
|
1753
|
+
function Jr({ ref: e, onEscapeKeyDown: t, ...n }, r) {
|
|
1754
|
+
let i = ue(Tr) ?? !0, a = Kr(t, Er(r ?? i, e)), o = qr(a.ref);
|
|
1749
1755
|
return {
|
|
1750
1756
|
ref: o.contentRef,
|
|
1751
1757
|
overlayRef: o.overlayRef,
|
|
1752
1758
|
onEscapeKeyDown: a.onEscapeKeyDown,
|
|
1753
1759
|
outside: {
|
|
1754
|
-
onPointerDownOutside:
|
|
1755
|
-
onFocusOutside:
|
|
1756
|
-
onInteractOutside:
|
|
1760
|
+
onPointerDownOutside: Yr(n.onPointerDownOutside),
|
|
1761
|
+
onFocusOutside: Yr(n.onFocusOutside),
|
|
1762
|
+
onInteractOutside: Yr(n.onInteractOutside)
|
|
1757
1763
|
}
|
|
1758
1764
|
};
|
|
1759
1765
|
}
|
|
1760
|
-
function
|
|
1766
|
+
function Yr(e) {
|
|
1761
1767
|
return (t) => {
|
|
1762
1768
|
e?.(t);
|
|
1763
1769
|
let n = t.target;
|
|
@@ -1766,19 +1772,19 @@ function Jr(e) {
|
|
|
1766
1772
|
}
|
|
1767
1773
|
//#endregion
|
|
1768
1774
|
//#region lib/components/ui/overlays/dialog/use-return-focus.ts
|
|
1769
|
-
var
|
|
1770
|
-
function
|
|
1771
|
-
([...e.querySelectorAll(
|
|
1775
|
+
var Xr = "button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"]), [contenteditable=\"true\"]";
|
|
1776
|
+
function Zr(e) {
|
|
1777
|
+
([...e.querySelectorAll(Xr)].find((e) => e.tabIndex >= 0 && e.getClientRects().length > 0) ?? e).focus({ preventScroll: !0 });
|
|
1772
1778
|
}
|
|
1773
|
-
function
|
|
1774
|
-
let n =
|
|
1779
|
+
function Qr(e, { focusFallback: t = !1 } = {}) {
|
|
1780
|
+
let n = N(null);
|
|
1775
1781
|
return {
|
|
1776
1782
|
onOpenAutoFocus(r) {
|
|
1777
1783
|
let i = document.activeElement;
|
|
1778
1784
|
n.current = i instanceof HTMLElement && i !== document.body ? i : null, e.onOpenAutoFocus?.(r);
|
|
1779
1785
|
let a = r.target;
|
|
1780
1786
|
!t || r.defaultPrevented || !(a instanceof HTMLElement) || queueMicrotask(() => {
|
|
1781
|
-
a.isConnected && !a.contains(document.activeElement) &&
|
|
1787
|
+
a.isConnected && !a.contains(document.activeElement) && Zr(a);
|
|
1782
1788
|
});
|
|
1783
1789
|
},
|
|
1784
1790
|
onCloseAutoFocus(t) {
|
|
@@ -1792,7 +1798,7 @@ function Zr(e, { focusFallback: t = !1 } = {}) {
|
|
|
1792
1798
|
}
|
|
1793
1799
|
//#endregion
|
|
1794
1800
|
//#region lib/components/ui/primitives/input/input-box.ts
|
|
1795
|
-
var
|
|
1801
|
+
var $r = [
|
|
1796
1802
|
"inline-flex gap-2 items-center h-11 max-h-full w-full bg-muted/5 disabled:bg-transparent",
|
|
1797
1803
|
"file:text-muted-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground border-input",
|
|
1798
1804
|
"rounded border px-2 py-1 text-base shadow-xs transition-all outline-none file:inline-flex",
|
|
@@ -1800,27 +1806,27 @@ var Qr = [
|
|
|
1800
1806
|
"disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
1801
1807
|
"focus-visible:border-primary focus-visible:ring-primary/30 focus-visible:ring-[2px]",
|
|
1802
1808
|
"aria-invalid:ring-error/20 dark:aria-invalid:ring-error/40 aria-invalid:border-error"
|
|
1803
|
-
],
|
|
1804
|
-
function
|
|
1805
|
-
return /* @__PURE__ */
|
|
1809
|
+
], ei = [...$r, "not-placeholder-shown:bg-primary/10"];
|
|
1810
|
+
function ti({ className: e, type: n = "text", ...r }) {
|
|
1811
|
+
return /* @__PURE__ */ D("input", {
|
|
1806
1812
|
type: n,
|
|
1807
1813
|
"data-slot": "input",
|
|
1808
|
-
className: t(
|
|
1814
|
+
className: t(ei, e),
|
|
1809
1815
|
"data-pw": r.name ?? "input",
|
|
1810
1816
|
...r
|
|
1811
1817
|
});
|
|
1812
1818
|
}
|
|
1813
1819
|
//#endregion
|
|
1814
1820
|
//#region lib/components/ui/fields/text-field/text-field.tsx
|
|
1815
|
-
function
|
|
1816
|
-
let c =
|
|
1821
|
+
function ni({ error: e, helperText: n, label: r, className: i, leading: a, trailing: o, ...s }) {
|
|
1822
|
+
let c = Hr(), l = fe(), u = fe(), d = ye(s["aria-describedby"], !!n && u), f = /* @__PURE__ */ O("div", {
|
|
1817
1823
|
className: t("relative", {
|
|
1818
1824
|
"*:first:size-8 *:first:absolute *:first:top-[calc(50%-16px)] *:first:left-1.5 [&_input]:pl-10 *:first:bg-muted/80 *:first:text-muted-foreground": !!a,
|
|
1819
1825
|
"*:last:size-8 *:last:absolute *:last:top-[calc(50%-16px)] *:last:right-1.5 [&_input]:pr-.5 *:last:bg-muted/80 *:last:text-muted-foreground": !!o
|
|
1820
1826
|
}),
|
|
1821
1827
|
children: [
|
|
1822
1828
|
a && a,
|
|
1823
|
-
/* @__PURE__ */
|
|
1829
|
+
/* @__PURE__ */ D(ti, {
|
|
1824
1830
|
"aria-invalid": e,
|
|
1825
1831
|
...s,
|
|
1826
1832
|
id: s.id ?? l,
|
|
@@ -1830,17 +1836,17 @@ function ti({ error: e, helperText: n, label: r, className: i, leading: a, trail
|
|
|
1830
1836
|
o && o
|
|
1831
1837
|
]
|
|
1832
1838
|
});
|
|
1833
|
-
return /* @__PURE__ */
|
|
1839
|
+
return /* @__PURE__ */ O("div", {
|
|
1834
1840
|
ref: c,
|
|
1835
1841
|
"data-slot": "text-field",
|
|
1836
1842
|
className: t("grid w-full gap-1.5", i),
|
|
1837
|
-
children: [/* @__PURE__ */
|
|
1843
|
+
children: [/* @__PURE__ */ D(Gr, {
|
|
1838
1844
|
withAsterisk: s.required,
|
|
1839
1845
|
htmlFor: s.id ?? l,
|
|
1840
1846
|
children: r
|
|
1841
|
-
}), /* @__PURE__ */
|
|
1847
|
+
}), /* @__PURE__ */ O("div", {
|
|
1842
1848
|
className: "flex flex-col gap-0.5",
|
|
1843
|
-
children: [f, n ? /* @__PURE__ */
|
|
1849
|
+
children: [f, n ? /* @__PURE__ */ D(Ur, {
|
|
1844
1850
|
id: u,
|
|
1845
1851
|
error: e,
|
|
1846
1852
|
children: n
|
|
@@ -1850,50 +1856,80 @@ function ti({ error: e, helperText: n, label: r, className: i, leading: a, trail
|
|
|
1850
1856
|
}
|
|
1851
1857
|
//#endregion
|
|
1852
1858
|
//#region lib/components/ui/overlays/dialog/dialog-outside.ts
|
|
1853
|
-
function
|
|
1859
|
+
function ri(e) {
|
|
1854
1860
|
let t = e.target;
|
|
1855
1861
|
t instanceof Element && t.closest("[data-slot=\"combobox-content\"]") && e.preventDefault();
|
|
1856
1862
|
}
|
|
1857
|
-
function
|
|
1863
|
+
function ii(e) {
|
|
1858
1864
|
return (t) => {
|
|
1859
|
-
|
|
1865
|
+
ri(t), e?.(t);
|
|
1860
1866
|
};
|
|
1861
1867
|
}
|
|
1862
|
-
function
|
|
1868
|
+
function ai(e) {
|
|
1863
1869
|
return {
|
|
1864
1870
|
...e,
|
|
1865
|
-
onPointerDownOutside:
|
|
1866
|
-
onFocusOutside:
|
|
1867
|
-
onInteractOutside:
|
|
1871
|
+
onPointerDownOutside: ii(e.onPointerDownOutside),
|
|
1872
|
+
onFocusOutside: ii(e.onFocusOutside),
|
|
1873
|
+
onInteractOutside: ii(e.onInteractOutside)
|
|
1868
1874
|
};
|
|
1869
1875
|
}
|
|
1870
1876
|
//#endregion
|
|
1877
|
+
//#region lib/components/ui/overlays/dialog/dialog-parts.tsx
|
|
1878
|
+
function oi({ className: e, ...n }) {
|
|
1879
|
+
return /* @__PURE__ */ D("div", {
|
|
1880
|
+
"data-slot": "dialog-header",
|
|
1881
|
+
className: t("flex flex-col gap-2 text-center sm:text-left", e),
|
|
1882
|
+
...n
|
|
1883
|
+
});
|
|
1884
|
+
}
|
|
1885
|
+
function si({ className: e, ...n }) {
|
|
1886
|
+
return /* @__PURE__ */ D("div", {
|
|
1887
|
+
"data-slot": "dialog-footer",
|
|
1888
|
+
className: t("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", e),
|
|
1889
|
+
...n
|
|
1890
|
+
});
|
|
1891
|
+
}
|
|
1892
|
+
function ci({ className: e, ...n }) {
|
|
1893
|
+
return /* @__PURE__ */ D(jn, {
|
|
1894
|
+
"data-slot": "dialog-title",
|
|
1895
|
+
className: t("text-xl leading-none font-semibold", e),
|
|
1896
|
+
...n
|
|
1897
|
+
});
|
|
1898
|
+
}
|
|
1899
|
+
function li({ className: e, ...n }) {
|
|
1900
|
+
return /* @__PURE__ */ D(Nn, {
|
|
1901
|
+
"data-slot": "dialog-description",
|
|
1902
|
+
className: t("text-muted-foreground text-sm", e),
|
|
1903
|
+
...n
|
|
1904
|
+
});
|
|
1905
|
+
}
|
|
1906
|
+
//#endregion
|
|
1871
1907
|
//#region lib/components/ui/overlays/dialog/dialog.tsx
|
|
1872
|
-
function
|
|
1873
|
-
return /* @__PURE__ */
|
|
1908
|
+
function ui({ ...e }) {
|
|
1909
|
+
return /* @__PURE__ */ D(Tr, {
|
|
1874
1910
|
value: e.modal ?? !0,
|
|
1875
|
-
children: /* @__PURE__ */
|
|
1911
|
+
children: /* @__PURE__ */ D(mn, {
|
|
1876
1912
|
"data-slot": "dialog",
|
|
1877
1913
|
...e
|
|
1878
1914
|
})
|
|
1879
1915
|
});
|
|
1880
1916
|
}
|
|
1881
|
-
function
|
|
1882
|
-
return /* @__PURE__ */
|
|
1917
|
+
function di({ asChild: e = !0, ...t }) {
|
|
1918
|
+
return /* @__PURE__ */ D(gn, {
|
|
1883
1919
|
"data-slot": "dialog-trigger",
|
|
1884
1920
|
...t,
|
|
1885
1921
|
asChild: e
|
|
1886
1922
|
});
|
|
1887
1923
|
}
|
|
1888
|
-
function
|
|
1889
|
-
return /* @__PURE__ */
|
|
1924
|
+
function fi({ ...e }) {
|
|
1925
|
+
return /* @__PURE__ */ D(bn, {
|
|
1890
1926
|
"data-slot": "dialog-portal",
|
|
1891
1927
|
...e
|
|
1892
1928
|
});
|
|
1893
1929
|
}
|
|
1894
|
-
function
|
|
1895
|
-
let { t: s } =
|
|
1896
|
-
return /* @__PURE__ */
|
|
1930
|
+
function pi({ className: e, color: n, children: r, type: i = "button", variant: a = "ghost", ...o }) {
|
|
1931
|
+
let { t: s } = te();
|
|
1932
|
+
return /* @__PURE__ */ D(Fn, {
|
|
1897
1933
|
"aria-label": r ? void 0 : s("material.buttons.close", "Close"),
|
|
1898
1934
|
...o,
|
|
1899
1935
|
type: i,
|
|
@@ -1903,134 +1939,112 @@ function ci({ className: e, color: n, children: r, type: i = "button", variant:
|
|
|
1903
1939
|
className: e
|
|
1904
1940
|
})),
|
|
1905
1941
|
"data-slot": "dialog-close",
|
|
1906
|
-
children: r || /* @__PURE__ */
|
|
1942
|
+
children: r || /* @__PURE__ */ D(ne, { className: "size-4" })
|
|
1907
1943
|
});
|
|
1908
1944
|
}
|
|
1909
|
-
function
|
|
1910
|
-
return /* @__PURE__ */
|
|
1945
|
+
function mi({ className: e, ...n }) {
|
|
1946
|
+
return /* @__PURE__ */ D(Sn, {
|
|
1911
1947
|
"data-slot": "dialog-overlay",
|
|
1912
1948
|
className: t("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", e),
|
|
1913
1949
|
...n
|
|
1914
1950
|
});
|
|
1915
1951
|
}
|
|
1916
|
-
function
|
|
1917
|
-
let d =
|
|
1952
|
+
function hi({ className: e, children: n, onInteractOutside: r, onPointerDownOutside: i, onFocusOutside: a, onOpenAutoFocus: o, onCloseAutoFocus: s, onEscapeKeyDown: c, ref: l, ...u }) {
|
|
1953
|
+
let d = Qr({
|
|
1918
1954
|
onOpenAutoFocus: o,
|
|
1919
1955
|
onCloseAutoFocus: s
|
|
1920
|
-
}), f =
|
|
1956
|
+
}), f = Jr(ai({
|
|
1921
1957
|
ref: l,
|
|
1922
1958
|
onEscapeKeyDown: c,
|
|
1923
1959
|
onInteractOutside: r,
|
|
1924
1960
|
onPointerDownOutside: i,
|
|
1925
1961
|
onFocusOutside: a
|
|
1926
1962
|
}));
|
|
1927
|
-
return /* @__PURE__ */ D(
|
|
1928
|
-
|
|
1929
|
-
children:
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
}
|
|
1942
|
-
|
|
1943
|
-
return /* @__PURE__ */ E("div", {
|
|
1944
|
-
"data-slot": "dialog-header",
|
|
1945
|
-
className: t("flex flex-col gap-2 text-center sm:text-left", e),
|
|
1946
|
-
...n
|
|
1947
|
-
});
|
|
1948
|
-
}
|
|
1949
|
-
function fi({ className: e, ...n }) {
|
|
1950
|
-
return /* @__PURE__ */ E("div", {
|
|
1951
|
-
"data-slot": "dialog-footer",
|
|
1952
|
-
className: t("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", e),
|
|
1953
|
-
...n
|
|
1954
|
-
});
|
|
1955
|
-
}
|
|
1956
|
-
function pi({ className: e, ...n }) {
|
|
1957
|
-
return /* @__PURE__ */ E(Mn, {
|
|
1958
|
-
"data-slot": "dialog-title",
|
|
1959
|
-
className: t("text-xl leading-none font-semibold", e),
|
|
1960
|
-
...n
|
|
1961
|
-
});
|
|
1962
|
-
}
|
|
1963
|
-
function mi({ className: e, ...n }) {
|
|
1964
|
-
return /* @__PURE__ */ E(Pn, {
|
|
1965
|
-
"data-slot": "dialog-description",
|
|
1966
|
-
className: t("text-muted-foreground text-sm", e),
|
|
1967
|
-
...n
|
|
1963
|
+
return /* @__PURE__ */ D(Cr, {
|
|
1964
|
+
value: !0,
|
|
1965
|
+
children: /* @__PURE__ */ O(fi, {
|
|
1966
|
+
"data-slot": "dialog-portal",
|
|
1967
|
+
children: [/* @__PURE__ */ D(mi, { ref: f.overlayRef }), /* @__PURE__ */ D(En, {
|
|
1968
|
+
ref: f.ref,
|
|
1969
|
+
"data-slot": "dialog-content",
|
|
1970
|
+
className: t("bg-background rounded-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg max-h-[calc(100dvh-2rem)] supports-[not(height:100dvh)]:max-h-[calc(100vh-2rem)] overflow-y-auto", e),
|
|
1971
|
+
onOpenAutoFocus: d.onOpenAutoFocus,
|
|
1972
|
+
onCloseAutoFocus: d.onCloseAutoFocus,
|
|
1973
|
+
onEscapeKeyDown: f.onEscapeKeyDown,
|
|
1974
|
+
...u,
|
|
1975
|
+
...f.outside,
|
|
1976
|
+
children: n
|
|
1977
|
+
})]
|
|
1978
|
+
})
|
|
1968
1979
|
});
|
|
1969
1980
|
}
|
|
1970
1981
|
//#endregion
|
|
1971
1982
|
//#region lib/components/ui/actions/icon-button/icon-badge.tsx
|
|
1972
|
-
function
|
|
1983
|
+
function gi({ children: e, className: n, ...r }) {
|
|
1973
1984
|
let i = !!(r["aria-label"] || r["aria-labelledby"]);
|
|
1974
|
-
return /* @__PURE__ */ E
|
|
1985
|
+
return /* @__PURE__ */ D(E, {
|
|
1975
1986
|
"aria-hidden": i ? void 0 : "true",
|
|
1976
1987
|
role: i ? "img" : void 0,
|
|
1977
1988
|
...r,
|
|
1978
1989
|
asChild: !0,
|
|
1979
1990
|
className: t("cursor-default", n),
|
|
1980
|
-
children: /* @__PURE__ */
|
|
1991
|
+
children: /* @__PURE__ */ D("span", { children: e })
|
|
1981
1992
|
});
|
|
1982
1993
|
}
|
|
1983
1994
|
//#endregion
|
|
1984
1995
|
//#region lib/components/ui/primitives/activity/activity.tsx
|
|
1985
|
-
function
|
|
1986
|
-
return /* @__PURE__ */
|
|
1996
|
+
function _i({ visible: e = !1, ...t }) {
|
|
1997
|
+
return /* @__PURE__ */ D(ie, {
|
|
1987
1998
|
...t,
|
|
1988
1999
|
mode: e ? "visible" : "hidden"
|
|
1989
2000
|
});
|
|
1990
2001
|
}
|
|
1991
2002
|
//#endregion
|
|
1992
2003
|
//#region lib/components/ui/overlays/hover-card/hover-card.tsx
|
|
1993
|
-
function
|
|
1994
|
-
return /* @__PURE__ */
|
|
2004
|
+
function vi({ ...e }) {
|
|
2005
|
+
return /* @__PURE__ */ D(ar, {
|
|
1995
2006
|
"data-slot": "hover-card",
|
|
1996
2007
|
...e
|
|
1997
2008
|
});
|
|
1998
2009
|
}
|
|
1999
|
-
function
|
|
2000
|
-
return /* @__PURE__ */
|
|
2010
|
+
function yi({ ...e }) {
|
|
2011
|
+
return /* @__PURE__ */ D(or, {
|
|
2001
2012
|
"data-slot": "hover-card-trigger",
|
|
2002
2013
|
...e
|
|
2003
2014
|
});
|
|
2004
2015
|
}
|
|
2005
|
-
function
|
|
2006
|
-
return /* @__PURE__ */
|
|
2007
|
-
|
|
2008
|
-
children: /* @__PURE__ */
|
|
2009
|
-
"data-slot": "hover-card-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2016
|
+
function bi({ className: e, align: n = "center", sideOffset: r = 4, ...i }) {
|
|
2017
|
+
return /* @__PURE__ */ D(Cr, {
|
|
2018
|
+
value: !1,
|
|
2019
|
+
children: /* @__PURE__ */ D(sr, {
|
|
2020
|
+
"data-slot": "hover-card-portal",
|
|
2021
|
+
children: /* @__PURE__ */ D(cr, {
|
|
2022
|
+
"data-slot": "hover-card-content",
|
|
2023
|
+
align: n,
|
|
2024
|
+
sideOffset: r,
|
|
2025
|
+
className: t("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden", e),
|
|
2026
|
+
...i
|
|
2027
|
+
})
|
|
2014
2028
|
})
|
|
2015
2029
|
});
|
|
2016
2030
|
}
|
|
2017
2031
|
//#endregion
|
|
2018
2032
|
//#region ../../node_modules/react-hook-form/dist/index.esm.mjs
|
|
2019
|
-
var
|
|
2033
|
+
var xi = (e) => e.type === "checkbox", Si = (e) => e.type === "file", Ci = (e) => e instanceof Date, z = (e) => e == null, wi = (e) => typeof e == "object", B = (e) => !z(e) && !Array.isArray(e) && wi(e) && !Ci(e), Ti = (e) => B(e) && e.target ? xi(e.target) ? e.target.checked : Si(e.target) ? e.target.files : e.target.value : e, Ei = (e, t) => t.split(".").some((t, n, r) => !isNaN(Number(t)) && e.has(r.slice(0, n).join("."))), Di = (e) => {
|
|
2020
2034
|
let t = e.constructor && e.constructor.prototype;
|
|
2021
2035
|
return B(t) && t.hasOwnProperty("isPrototypeOf");
|
|
2022
|
-
},
|
|
2036
|
+
}, Oi = typeof window < "u" && window.HTMLElement !== void 0 && typeof document < "u";
|
|
2023
2037
|
function V(e) {
|
|
2024
2038
|
if (e instanceof Date) return new Date(e);
|
|
2025
2039
|
let t = typeof FileList < "u" && e instanceof FileList;
|
|
2026
|
-
if (
|
|
2040
|
+
if (Oi && (e instanceof Blob || t)) return e;
|
|
2027
2041
|
let n = Array.isArray(e);
|
|
2028
|
-
if (!n && !(B(e) &&
|
|
2042
|
+
if (!n && !(B(e) && Di(e))) return e;
|
|
2029
2043
|
let r = n ? [] : Object.create(Object.getPrototypeOf(e));
|
|
2030
2044
|
for (let t in e) Object.prototype.hasOwnProperty.call(e, t) && (r[t] = V(e[t]));
|
|
2031
2045
|
return r;
|
|
2032
2046
|
}
|
|
2033
|
-
var
|
|
2047
|
+
var ki = {
|
|
2034
2048
|
BLUR: "blur",
|
|
2035
2049
|
FOCUS_OUT: "focusout",
|
|
2036
2050
|
CHANGE: "change",
|
|
@@ -2051,44 +2065,44 @@ var Di = {
|
|
|
2051
2065
|
pattern: "pattern",
|
|
2052
2066
|
required: "required",
|
|
2053
2067
|
validate: "validate"
|
|
2054
|
-
},
|
|
2068
|
+
}, Ai = "root", ji = [
|
|
2055
2069
|
"__proto__",
|
|
2056
2070
|
"constructor",
|
|
2057
2071
|
"prototype"
|
|
2058
|
-
],
|
|
2072
|
+
], Mi = /^\w*$/, Ni = (e) => Mi.test(e), W = (e) => e === void 0, Pi = /[.[\]'"]/, Fi = (e) => e.split(Pi).filter(Boolean), G = (e, t, n) => {
|
|
2059
2073
|
if (!t || !B(e)) return n;
|
|
2060
|
-
let r =
|
|
2061
|
-
if (r.some((e) =>
|
|
2074
|
+
let r = Ni(t) ? [t] : Fi(t);
|
|
2075
|
+
if (r.some((e) => ji.includes(e))) return n;
|
|
2062
2076
|
let i = r.reduce((e, t) => z(e) ? void 0 : e[t], e);
|
|
2063
2077
|
return W(i) || i === e ? W(e[t]) ? n : e[t] : i;
|
|
2064
2078
|
}, K = (e) => typeof e == "boolean", q = (e) => typeof e == "function", J = (e, t, n) => {
|
|
2065
|
-
let r = -1, i =
|
|
2079
|
+
let r = -1, i = Ni(t) ? [t] : Fi(t), a = i.length, o = a - 1;
|
|
2066
2080
|
for (; ++r < a;) {
|
|
2067
2081
|
let t = i[r], a = n;
|
|
2068
2082
|
if (r !== o) {
|
|
2069
2083
|
let n = e[t];
|
|
2070
2084
|
a = B(n) || Array.isArray(n) ? n : isNaN(+i[r + 1]) ? {} : [];
|
|
2071
2085
|
}
|
|
2072
|
-
if (
|
|
2086
|
+
if (ji.includes(t)) return;
|
|
2073
2087
|
e[t] = a, e = e[t];
|
|
2074
2088
|
}
|
|
2075
|
-
},
|
|
2076
|
-
|
|
2077
|
-
var
|
|
2089
|
+
}, Ii = A.createContext(null);
|
|
2090
|
+
Ii.displayName = "HookFormControlContext";
|
|
2091
|
+
var Li = () => A.useContext(Ii), Ri = (e, t, n, r = !0) => {
|
|
2078
2092
|
let i = {};
|
|
2079
2093
|
for (let a in e) Object.defineProperty(i, a, { get: () => {
|
|
2080
2094
|
let i = a;
|
|
2081
2095
|
return t._proxyFormState[i] !== H.all && (t._proxyFormState[i] = !r || H.all), n && (n[i] = !0), e[i];
|
|
2082
2096
|
} });
|
|
2083
2097
|
return i;
|
|
2084
|
-
},
|
|
2098
|
+
}, zi = Oi ? A.useLayoutEffect : A.useEffect, Bi = (e) => z(e) || !wi(e), Vi = (e, t) => t.length === 0 && !Array.isArray(e) && !Di(e);
|
|
2085
2099
|
function Y(e, t, n = /* @__PURE__ */ new WeakMap()) {
|
|
2086
2100
|
if (e === t) return !0;
|
|
2087
|
-
if (
|
|
2088
|
-
if (
|
|
2101
|
+
if (Bi(e) || Bi(t)) return Object.is(e, t);
|
|
2102
|
+
if (Ci(e) && Ci(t)) return Object.is(e.getTime(), t.getTime());
|
|
2089
2103
|
let r = Object.keys(e), i = Object.keys(t);
|
|
2090
2104
|
if (r.length !== i.length) return !1;
|
|
2091
|
-
if (
|
|
2105
|
+
if (Vi(e, r) || Vi(t, i)) return Object.is(e, t);
|
|
2092
2106
|
if (!r.length && Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
2093
2107
|
let a = n.get(e);
|
|
2094
2108
|
if (a && a.has(t)) return !0;
|
|
@@ -2102,31 +2116,31 @@ function Y(e, t, n = /* @__PURE__ */ new WeakMap()) {
|
|
|
2102
2116
|
if (!(i in t)) return !1;
|
|
2103
2117
|
if (i !== "ref") {
|
|
2104
2118
|
let e = t[i];
|
|
2105
|
-
if (
|
|
2119
|
+
if (Ci(r) && Ci(e) || (B(r) || Array.isArray(r)) && (B(e) || Array.isArray(e)) ? !Y(r, e, n) : !Object.is(r, e)) return !1;
|
|
2106
2120
|
}
|
|
2107
2121
|
}
|
|
2108
2122
|
return !0;
|
|
2109
2123
|
}
|
|
2110
|
-
function
|
|
2111
|
-
let e =
|
|
2124
|
+
function Hi() {
|
|
2125
|
+
let e = A.useRef(!1), t = A.useRef(void 0);
|
|
2112
2126
|
return {
|
|
2113
|
-
resyncIfNeeded:
|
|
2127
|
+
resyncIfNeeded: A.useCallback((n, r, i) => {
|
|
2114
2128
|
if (n && e.current) {
|
|
2115
2129
|
let e = r();
|
|
2116
2130
|
Y(t.current, e) || i(e);
|
|
2117
2131
|
}
|
|
2118
2132
|
e.current = !0;
|
|
2119
2133
|
}, []),
|
|
2120
|
-
snapshot:
|
|
2134
|
+
snapshot: A.useCallback((e, n) => {
|
|
2121
2135
|
e && (t.current = V(n()));
|
|
2122
2136
|
}, [])
|
|
2123
2137
|
};
|
|
2124
2138
|
}
|
|
2125
|
-
function
|
|
2126
|
-
let t =
|
|
2139
|
+
function Ui(e) {
|
|
2140
|
+
let t = Li(), { control: n = t, disabled: r, name: i, exact: a } = e || {}, [o, s] = A.useState(() => ({
|
|
2127
2141
|
...n._formState,
|
|
2128
2142
|
defaultValues: n._defaultValues
|
|
2129
|
-
})), c =
|
|
2143
|
+
})), c = A.useRef({
|
|
2130
2144
|
isDirty: !1,
|
|
2131
2145
|
isLoading: !1,
|
|
2132
2146
|
dirtyFields: !1,
|
|
@@ -2135,8 +2149,8 @@ function Vi(e) {
|
|
|
2135
2149
|
isValidating: !1,
|
|
2136
2150
|
isValid: !1,
|
|
2137
2151
|
errors: !1
|
|
2138
|
-
}), { resyncIfNeeded: l, snapshot: u } =
|
|
2139
|
-
return
|
|
2152
|
+
}), { resyncIfNeeded: l, snapshot: u } = Hi();
|
|
2153
|
+
return zi(() => {
|
|
2140
2154
|
let e = () => ({
|
|
2141
2155
|
...n._formState,
|
|
2142
2156
|
defaultValues: n._defaultValues
|
|
@@ -2163,27 +2177,27 @@ function Vi(e) {
|
|
|
2163
2177
|
a,
|
|
2164
2178
|
l,
|
|
2165
2179
|
u
|
|
2166
|
-
]),
|
|
2180
|
+
]), A.useEffect(() => {
|
|
2167
2181
|
c.current.isValid && n._setValid(!0);
|
|
2168
|
-
}, [n]),
|
|
2182
|
+
}, [n]), A.useMemo(() => Ri(o, n, c.current, !1), [o, n]);
|
|
2169
2183
|
}
|
|
2170
|
-
var X = (e) => typeof e == "string",
|
|
2171
|
-
function
|
|
2172
|
-
let t =
|
|
2184
|
+
var X = (e) => typeof e == "string", Wi = (e, t, n, r, i) => X(e) ? (r && t.watch.add(e), G(n, e, i)) : Array.isArray(e) ? e.map((e) => (r && t.watch.add(e), G(n, e))) : (r && (t.watchAll = !0), n);
|
|
2185
|
+
function Gi(e) {
|
|
2186
|
+
let t = Li(), { control: n = t, name: r, defaultValue: i, disabled: a, exact: o, compute: s } = e || {}, c = A.useRef(i), l = A.useRef(s), u = A.useRef(void 0), d = A.useRef(n), f = A.useRef(r);
|
|
2173
2187
|
l.current = s;
|
|
2174
|
-
let [p, m] =
|
|
2188
|
+
let [p, m] = A.useState(() => {
|
|
2175
2189
|
let e = n._getWatch(r, c.current);
|
|
2176
2190
|
return l.current ? l.current(e) : e;
|
|
2177
|
-
}), h =
|
|
2178
|
-
let t =
|
|
2191
|
+
}), h = A.useCallback((e) => {
|
|
2192
|
+
let t = Wi(r, n._names, e || n._formValues, !1, c.current);
|
|
2179
2193
|
return l.current ? l.current(t) : t;
|
|
2180
2194
|
}, [
|
|
2181
2195
|
n._formValues,
|
|
2182
2196
|
n._names,
|
|
2183
2197
|
r
|
|
2184
|
-
]), g =
|
|
2198
|
+
]), g = A.useCallback((e) => {
|
|
2185
2199
|
if (!a) {
|
|
2186
|
-
let t =
|
|
2200
|
+
let t = Wi(r, n._names, e || n._formValues, !1, c.current);
|
|
2187
2201
|
if (l.current) {
|
|
2188
2202
|
let e = l.current(t);
|
|
2189
2203
|
Y(e, u.current) || (m(e), u.current = e);
|
|
@@ -2194,10 +2208,10 @@ function Ui(e) {
|
|
|
2194
2208
|
n._names,
|
|
2195
2209
|
a,
|
|
2196
2210
|
r
|
|
2197
|
-
]), { resyncIfNeeded: _, snapshot: v } =
|
|
2211
|
+
]), { resyncIfNeeded: _, snapshot: v } = Hi(), y = A.useRef(g);
|
|
2198
2212
|
y.current = g;
|
|
2199
|
-
let b =
|
|
2200
|
-
b.current = h,
|
|
2213
|
+
let b = A.useRef(h);
|
|
2214
|
+
b.current = h, zi(() => {
|
|
2201
2215
|
d.current !== n || !Y(f.current, r) ? (d.current = n, f.current = r, y.current()) : _(!a, () => b.current(), (e) => {
|
|
2202
2216
|
m(e), u.current = e;
|
|
2203
2217
|
});
|
|
@@ -2219,8 +2233,8 @@ function Ui(e) {
|
|
|
2219
2233
|
a,
|
|
2220
2234
|
_,
|
|
2221
2235
|
v
|
|
2222
|
-
]),
|
|
2223
|
-
let x = d.current !== n, S = f.current, C =
|
|
2236
|
+
]), A.useEffect(() => n._removeUnmounted());
|
|
2237
|
+
let x = d.current !== n, S = f.current, C = A.useMemo(() => {
|
|
2224
2238
|
if (a) return null;
|
|
2225
2239
|
let e = !x && !Y(S, r);
|
|
2226
2240
|
return x || e ? h() : null;
|
|
@@ -2233,27 +2247,27 @@ function Ui(e) {
|
|
|
2233
2247
|
]);
|
|
2234
2248
|
return C === null ? p : C;
|
|
2235
2249
|
}
|
|
2236
|
-
function
|
|
2237
|
-
let t =
|
|
2250
|
+
function Ki(e) {
|
|
2251
|
+
let t = Li(), { name: n, disabled: r, control: i = t, shouldUnregister: a, defaultValue: o, exact: s = !0 } = e, c = Ei(i._names.array, n), l = Gi({
|
|
2238
2252
|
control: i,
|
|
2239
2253
|
name: n,
|
|
2240
|
-
defaultValue:
|
|
2254
|
+
defaultValue: A.useMemo(() => G(i._formValues, n, G(i._defaultValues, n, o)), [
|
|
2241
2255
|
i,
|
|
2242
2256
|
n,
|
|
2243
2257
|
o
|
|
2244
2258
|
]),
|
|
2245
2259
|
exact: s
|
|
2246
|
-
}), u =
|
|
2260
|
+
}), u = Ui({
|
|
2247
2261
|
control: i,
|
|
2248
2262
|
name: n,
|
|
2249
2263
|
exact: s
|
|
2250
|
-
}), d =
|
|
2264
|
+
}), d = A.useRef(e), f = A.useRef(null), p = A.useRef(i.register(n, {
|
|
2251
2265
|
...e.rules,
|
|
2252
2266
|
value: l,
|
|
2253
2267
|
...K(e.disabled) ? { disabled: e.disabled } : {}
|
|
2254
2268
|
}));
|
|
2255
2269
|
d.current = e;
|
|
2256
|
-
let m =
|
|
2270
|
+
let m = A.useMemo(() => Object.defineProperties({}, {
|
|
2257
2271
|
invalid: {
|
|
2258
2272
|
enumerable: !0,
|
|
2259
2273
|
get: () => !!G(u.errors, n)
|
|
@@ -2274,25 +2288,25 @@ function Wi(e) {
|
|
|
2274
2288
|
enumerable: !0,
|
|
2275
2289
|
get: () => G(u.errors, n)
|
|
2276
2290
|
}
|
|
2277
|
-
}), [u, n]), h =
|
|
2278
|
-
let t =
|
|
2291
|
+
}), [u, n]), h = A.useCallback((e) => {
|
|
2292
|
+
let t = Ti(e);
|
|
2279
2293
|
return G(i._fields, n) || (p.current = i.register(n, {
|
|
2280
2294
|
...d.current.rules,
|
|
2281
2295
|
value: t
|
|
2282
2296
|
})), p.current.onChange({
|
|
2283
2297
|
target: {
|
|
2284
|
-
value:
|
|
2298
|
+
value: Ti(e),
|
|
2285
2299
|
name: n
|
|
2286
2300
|
},
|
|
2287
|
-
type:
|
|
2301
|
+
type: ki.CHANGE
|
|
2288
2302
|
});
|
|
2289
|
-
}, [n, i]), g =
|
|
2303
|
+
}, [n, i]), g = A.useCallback(() => p.current.onBlur({
|
|
2290
2304
|
target: {
|
|
2291
2305
|
value: G(i._formValues, n),
|
|
2292
2306
|
name: n
|
|
2293
2307
|
},
|
|
2294
|
-
type:
|
|
2295
|
-
}), [n, i._formValues]), _ =
|
|
2308
|
+
type: ki.BLUR
|
|
2309
|
+
}), [n, i._formValues]), _ = A.useCallback((e) => {
|
|
2296
2310
|
e && (f.current = {
|
|
2297
2311
|
focus: () => q(e.focus) && e.focus(),
|
|
2298
2312
|
select: () => q(e.select) && e.select(),
|
|
@@ -2301,7 +2315,7 @@ function Wi(e) {
|
|
|
2301
2315
|
});
|
|
2302
2316
|
let t = G(i._fields, n);
|
|
2303
2317
|
t && t._f && e && (t._f.ref = f.current);
|
|
2304
|
-
}, [i._fields, n]), v =
|
|
2318
|
+
}, [i._fields, n]), v = A.useMemo(() => ({
|
|
2305
2319
|
name: n,
|
|
2306
2320
|
value: l,
|
|
2307
2321
|
...K(r) || u.disabled ? { disabled: u.disabled || r } : {},
|
|
@@ -2317,7 +2331,7 @@ function Wi(e) {
|
|
|
2317
2331
|
_,
|
|
2318
2332
|
l
|
|
2319
2333
|
]);
|
|
2320
|
-
return
|
|
2334
|
+
return A.useEffect(() => {
|
|
2321
2335
|
let e = i._options.shouldUnregister || a;
|
|
2322
2336
|
p.current = i.register(n, {
|
|
2323
2337
|
...d.current.rules,
|
|
@@ -2343,7 +2357,7 @@ function Wi(e) {
|
|
|
2343
2357
|
i,
|
|
2344
2358
|
c,
|
|
2345
2359
|
a
|
|
2346
|
-
]),
|
|
2360
|
+
]), A.useEffect(() => {
|
|
2347
2361
|
i._setDisabledField({
|
|
2348
2362
|
disabled: r,
|
|
2349
2363
|
name: n
|
|
@@ -2352,7 +2366,7 @@ function Wi(e) {
|
|
|
2352
2366
|
r,
|
|
2353
2367
|
n,
|
|
2354
2368
|
i
|
|
2355
|
-
]),
|
|
2369
|
+
]), A.useMemo(() => ({
|
|
2356
2370
|
field: v,
|
|
2357
2371
|
formState: u,
|
|
2358
2372
|
fieldState: m
|
|
@@ -2362,25 +2376,25 @@ function Wi(e) {
|
|
|
2362
2376
|
m
|
|
2363
2377
|
]);
|
|
2364
2378
|
}
|
|
2365
|
-
var
|
|
2379
|
+
var qi = (e) => e.render(Ki(e)), Ji = () => {
|
|
2366
2380
|
if (typeof crypto < "u" && crypto.randomUUID) return crypto.randomUUID();
|
|
2367
2381
|
let e = typeof performance > "u" ? Date.now() : performance.now() * 1e3;
|
|
2368
2382
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => {
|
|
2369
2383
|
let n = (Math.random() * 16 + e) % 16 | 0;
|
|
2370
2384
|
return (t == "x" ? n : n & 3 | 8).toString(16);
|
|
2371
2385
|
});
|
|
2372
|
-
},
|
|
2386
|
+
}, Yi = (e, t, n = {}) => n.shouldFocus || W(n.shouldFocus) ? n.focusName || `${e}.${W(n.focusIndex) ? t : n.focusIndex}.` : "", Xi = (e) => ({
|
|
2373
2387
|
isOnSubmit: !e || e === H.onSubmit,
|
|
2374
2388
|
isOnBlur: e === H.onBlur,
|
|
2375
2389
|
isOnChange: e === H.onChange,
|
|
2376
2390
|
isOnAll: e === H.all,
|
|
2377
2391
|
isOnTouch: e === H.onTouched
|
|
2378
|
-
}),
|
|
2392
|
+
}), Zi = (e, t, n) => {
|
|
2379
2393
|
if (n) return !1;
|
|
2380
2394
|
if (t.watchAll || t.watch.has(e)) return !0;
|
|
2381
2395
|
for (let n of t.watch) if (e.startsWith(n) && e.charAt(n.length) === ".") return !0;
|
|
2382
2396
|
return !1;
|
|
2383
|
-
},
|
|
2397
|
+
}, Qi = (e, t, n, r) => {
|
|
2384
2398
|
for (let i of n || Object.keys(e)) {
|
|
2385
2399
|
if (i === "_f") continue;
|
|
2386
2400
|
let a = n ? G(e, i) : e[i];
|
|
@@ -2388,30 +2402,30 @@ var Gi = (e) => e.render(Wi(e)), Ki = () => {
|
|
|
2388
2402
|
let { _f: e } = a;
|
|
2389
2403
|
if (e) {
|
|
2390
2404
|
if (e.refs && e.refs[0] && t(e.refs[0], i) && !r || e.ref && t(e.ref, e.name) && !r) return !0;
|
|
2391
|
-
if (
|
|
2392
|
-
} else if ((B(a) || Array.isArray(a)) &&
|
|
2405
|
+
if (Qi(a, t)) break;
|
|
2406
|
+
} else if ((B(a) || Array.isArray(a)) && Qi(a, t)) break;
|
|
2393
2407
|
}
|
|
2394
2408
|
}
|
|
2395
|
-
},
|
|
2409
|
+
}, $i = (e, t, n) => {
|
|
2396
2410
|
let r = G(e, n), i = Array.isArray(r) ? r : [];
|
|
2397
|
-
return J(i,
|
|
2398
|
-
}, Z = (e) => B(e) && !Object.keys(e).length,
|
|
2399
|
-
if (!
|
|
2411
|
+
return J(i, Ai, t[n]), J(e, n, i), e;
|
|
2412
|
+
}, Z = (e) => B(e) && !Object.keys(e).length, ea = (e) => {
|
|
2413
|
+
if (!Oi) return !1;
|
|
2400
2414
|
let t = e ? e.ownerDocument : 0;
|
|
2401
2415
|
return e instanceof (t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement);
|
|
2402
|
-
},
|
|
2416
|
+
}, ta = (e) => e.type === "radio", na = (e) => e instanceof RegExp, ra = (e, t, n, r, i) => t ? {
|
|
2403
2417
|
...n[e],
|
|
2404
2418
|
types: {
|
|
2405
2419
|
...n[e] && n[e].types ? n[e].types : {},
|
|
2406
2420
|
[r]: i || !0
|
|
2407
2421
|
}
|
|
2408
|
-
} : {},
|
|
2422
|
+
} : {}, ia = {
|
|
2409
2423
|
value: !1,
|
|
2410
2424
|
isValid: !1
|
|
2411
|
-
},
|
|
2425
|
+
}, aa = {
|
|
2412
2426
|
value: !0,
|
|
2413
2427
|
isValid: !0
|
|
2414
|
-
},
|
|
2428
|
+
}, oa = (e) => {
|
|
2415
2429
|
if (Array.isArray(e)) {
|
|
2416
2430
|
if (e.length > 1) {
|
|
2417
2431
|
let t = e.filter((e) => e && e.checked && !e.disabled).map((e) => e.value);
|
|
@@ -2420,30 +2434,30 @@ var Gi = (e) => e.render(Wi(e)), Ki = () => {
|
|
|
2420
2434
|
isValid: !!t.length
|
|
2421
2435
|
};
|
|
2422
2436
|
}
|
|
2423
|
-
return e[0].checked && !e[0].disabled ? e[0].attributes && !W(e[0].attributes.value) ? W(e[0].value) || e[0].value === "" ?
|
|
2437
|
+
return e[0].checked && !e[0].disabled ? e[0].attributes && !W(e[0].attributes.value) ? W(e[0].value) || e[0].value === "" ? aa : {
|
|
2424
2438
|
value: e[0].value,
|
|
2425
2439
|
isValid: !0
|
|
2426
|
-
} :
|
|
2440
|
+
} : aa : ia;
|
|
2427
2441
|
}
|
|
2428
|
-
return
|
|
2429
|
-
},
|
|
2442
|
+
return ia;
|
|
2443
|
+
}, sa = {
|
|
2430
2444
|
isValid: !1,
|
|
2431
2445
|
value: null
|
|
2432
|
-
},
|
|
2446
|
+
}, ca = (e) => Array.isArray(e) ? e.reduce((e, t) => t && t.checked && !t.disabled ? {
|
|
2433
2447
|
isValid: !0,
|
|
2434
2448
|
value: t.value
|
|
2435
|
-
} : e,
|
|
2436
|
-
function
|
|
2449
|
+
} : e, sa) : sa;
|
|
2450
|
+
function la(e, t, n = "validate") {
|
|
2437
2451
|
if (X(e) || Array.isArray(e) && e.every(X) || K(e) && !e) return {
|
|
2438
2452
|
type: n,
|
|
2439
2453
|
message: X(e) ? e : "",
|
|
2440
2454
|
ref: t
|
|
2441
2455
|
};
|
|
2442
2456
|
}
|
|
2443
|
-
var
|
|
2457
|
+
var ua = (e) => B(e) && !na(e) ? e : {
|
|
2444
2458
|
value: e,
|
|
2445
2459
|
message: ""
|
|
2446
|
-
},
|
|
2460
|
+
}, da = async (e, t, n, r, i, a) => {
|
|
2447
2461
|
let { ref: o, refs: s, required: c, maxLength: l, minLength: u, min: d, max: f, pattern: p, validate: m, name: h, valueAsNumber: g, mount: _ } = e._f, v = G(n, h);
|
|
2448
2462
|
if (!_ || t.has(h)) return {};
|
|
2449
2463
|
let y = s ? s[0] : o, b = (e) => {
|
|
@@ -2451,66 +2465,66 @@ var ca = (e) => B(e) && !ea(e) ? e : {
|
|
|
2451
2465
|
let t = K(e) ? "" : e || "";
|
|
2452
2466
|
s ? s.forEach((e) => e.setCustomValidity(t)) : y.setCustomValidity(t), y.reportValidity();
|
|
2453
2467
|
}
|
|
2454
|
-
}, x = {}, S =
|
|
2468
|
+
}, x = {}, S = ta(o), C = xi(o), w = S || C, T = (g || Si(o)) && W(o.value) && W(v) || ea(o) && o.value === "" || v === "" || Array.isArray(v) && !v.length, E = ra.bind(null, h, r, x), ee = (e, t, n, r = U.maxLength, i = U.minLength) => {
|
|
2455
2469
|
let a = e ? t : n;
|
|
2456
2470
|
x[h] = {
|
|
2457
2471
|
type: e ? r : i,
|
|
2458
2472
|
message: a,
|
|
2459
2473
|
ref: o,
|
|
2460
|
-
...
|
|
2474
|
+
...E(e ? r : i, a)
|
|
2461
2475
|
};
|
|
2462
2476
|
};
|
|
2463
|
-
if (a ? !Array.isArray(v) || !v.length : c && (!w && (T || z(v)) || K(v) && !v || C && !
|
|
2477
|
+
if (a ? !Array.isArray(v) || !v.length : c && (!w && (T || z(v)) || K(v) && !v || C && !oa(s).isValid || S && !ca(s).isValid)) {
|
|
2464
2478
|
let { value: e, message: t } = X(c) ? {
|
|
2465
2479
|
value: !!c,
|
|
2466
2480
|
message: c
|
|
2467
|
-
} :
|
|
2481
|
+
} : ua(c);
|
|
2468
2482
|
if (e && (x[h] = {
|
|
2469
2483
|
type: U.required,
|
|
2470
2484
|
message: t,
|
|
2471
2485
|
ref: y,
|
|
2472
|
-
...
|
|
2486
|
+
...E(U.required, t)
|
|
2473
2487
|
}, !r)) return b(t), x;
|
|
2474
2488
|
}
|
|
2475
2489
|
if (!T && (!z(d) || !z(f))) {
|
|
2476
|
-
let e, t, n =
|
|
2477
|
-
if (!z(v) && !
|
|
2490
|
+
let e, t, n = ua(f), i = ua(d);
|
|
2491
|
+
if (!z(v) && !Ci(v) && !isNaN(v)) {
|
|
2478
2492
|
let r = o.valueAsNumber || v && +v;
|
|
2479
2493
|
z(n.value) || (e = r > n.value), z(i.value) || (t = r < i.value);
|
|
2480
2494
|
} else {
|
|
2481
2495
|
let r = o.valueAsDate || new Date(v), a = (e) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + e), s = o.type == "time", c = o.type == "week";
|
|
2482
2496
|
X(n.value) && v && (e = s ? a(v) > a(n.value) : c ? v > n.value : r > new Date(n.value)), X(i.value) && v && (t = s ? a(v) < a(i.value) : c ? v < i.value : r < new Date(i.value));
|
|
2483
2497
|
}
|
|
2484
|
-
if ((e || t) && (
|
|
2498
|
+
if ((e || t) && (ee(!!e, n.message, i.message, U.max, U.min), !r)) return b(x[h].message), x;
|
|
2485
2499
|
}
|
|
2486
2500
|
if ((l || u) && !T && (X(v) || a && Array.isArray(v))) {
|
|
2487
|
-
let e =
|
|
2488
|
-
if ((n || i) && (
|
|
2501
|
+
let e = ua(l), t = ua(u), n = !z(e.value) && v.length > +e.value, i = !z(t.value) && v.length < +t.value;
|
|
2502
|
+
if ((n || i) && (ee(n, e.message, t.message), !r)) return b(x[h].message), x;
|
|
2489
2503
|
}
|
|
2490
2504
|
if (p && !T && X(v)) {
|
|
2491
|
-
let { value: e, message: t } =
|
|
2492
|
-
if (
|
|
2505
|
+
let { value: e, message: t } = ua(p);
|
|
2506
|
+
if (na(e) && !v.match(e) && (x[h] = {
|
|
2493
2507
|
type: U.pattern,
|
|
2494
2508
|
message: t,
|
|
2495
2509
|
ref: o,
|
|
2496
|
-
...
|
|
2510
|
+
...E(U.pattern, t)
|
|
2497
2511
|
}, !r)) return b(t), x;
|
|
2498
2512
|
}
|
|
2499
2513
|
if (m) {
|
|
2500
2514
|
if (q(m)) {
|
|
2501
|
-
let e =
|
|
2515
|
+
let e = la(await m(v, n), y);
|
|
2502
2516
|
if (e && (x[h] = {
|
|
2503
2517
|
...e,
|
|
2504
|
-
...
|
|
2518
|
+
...E(U.validate, e.message)
|
|
2505
2519
|
}, !r)) return b(e.message), x;
|
|
2506
2520
|
} else if (B(m)) {
|
|
2507
2521
|
let e = {};
|
|
2508
2522
|
for (let t in m) {
|
|
2509
2523
|
if (!Z(e) && !r) break;
|
|
2510
|
-
let i =
|
|
2524
|
+
let i = la(await m[t](v, n), y, t);
|
|
2511
2525
|
i && (e = {
|
|
2512
2526
|
...i,
|
|
2513
|
-
...
|
|
2527
|
+
...E(t, i.message)
|
|
2514
2528
|
}, b(i.message), r && (x[h] = e));
|
|
2515
2529
|
}
|
|
2516
2530
|
if (!Z(e) && (x[h] = {
|
|
@@ -2520,24 +2534,24 @@ var ca = (e) => B(e) && !ea(e) ? e : {
|
|
|
2520
2534
|
}
|
|
2521
2535
|
}
|
|
2522
2536
|
return b(!0), x;
|
|
2523
|
-
}, Q = (e) => Array.isArray(e) ? e : [e],
|
|
2524
|
-
function
|
|
2537
|
+
}, Q = (e) => Array.isArray(e) ? e : [e], fa = (e, t) => [...e, ...Q(t)], pa = (e) => Array.isArray(e) ? e.map(() => void 0) : void 0;
|
|
2538
|
+
function ma(e, t, n) {
|
|
2525
2539
|
return [
|
|
2526
2540
|
...e.slice(0, t),
|
|
2527
2541
|
...Q(n),
|
|
2528
2542
|
...e.slice(t)
|
|
2529
2543
|
];
|
|
2530
2544
|
}
|
|
2531
|
-
var
|
|
2532
|
-
function
|
|
2545
|
+
var ha = (e, t, n) => Array.isArray(e) ? (W(e[n]) && (e[n] = void 0), e.splice(n, 0, e.splice(t, 1)[0]), e) : [], ga = (e, t) => [...Q(t), ...Q(e)], _a = (e) => Array.isArray(e) ? e.filter(Boolean) : [];
|
|
2546
|
+
function va(e, t) {
|
|
2533
2547
|
let n = 0, r = [...e];
|
|
2534
2548
|
for (let e of t) r.splice(e - n, 1), n++;
|
|
2535
|
-
return
|
|
2549
|
+
return _a(r).length ? r : [];
|
|
2536
2550
|
}
|
|
2537
|
-
var
|
|
2551
|
+
var ya = (e, t) => W(t) ? [] : va(e, Q(t).sort((e, t) => e - t)), ba = (e, t, n) => {
|
|
2538
2552
|
[e[t], e[n]] = [e[n], e[t]];
|
|
2539
2553
|
};
|
|
2540
|
-
function
|
|
2554
|
+
function xa(e, t) {
|
|
2541
2555
|
let n = t.length - 1, r = 0;
|
|
2542
2556
|
for (; r < n;) {
|
|
2543
2557
|
if (z(e)) {
|
|
@@ -2548,31 +2562,31 @@ function ya(e, t) {
|
|
|
2548
2562
|
}
|
|
2549
2563
|
return e;
|
|
2550
2564
|
}
|
|
2551
|
-
function
|
|
2565
|
+
function Sa(e) {
|
|
2552
2566
|
for (let t in e) if (e.hasOwnProperty(t) && !W(e[t])) return !1;
|
|
2553
2567
|
return !0;
|
|
2554
2568
|
}
|
|
2555
2569
|
function $(e, t) {
|
|
2556
2570
|
if (X(t) && Object.prototype.hasOwnProperty.call(e, t)) return delete e[t], e;
|
|
2557
|
-
let n = Array.isArray(t) ? t :
|
|
2558
|
-
if (n.some((e) =>
|
|
2559
|
-
let r = n.length === 1 ? e :
|
|
2560
|
-
return r && delete r[a], i !== 0 && (B(r) && Z(r) || Array.isArray(r) &&
|
|
2561
|
-
}
|
|
2562
|
-
var
|
|
2563
|
-
function
|
|
2564
|
-
let t =
|
|
2565
|
-
a || n._names.array.add(r),
|
|
2571
|
+
let n = Array.isArray(t) ? t : Ni(t) ? [t] : Fi(t);
|
|
2572
|
+
if (n.some((e) => ji.includes(String(e)))) return e;
|
|
2573
|
+
let r = n.length === 1 ? e : xa(e, n), i = n.length - 1, a = n[i];
|
|
2574
|
+
return r && delete r[a], i !== 0 && (B(r) && Z(r) || Array.isArray(r) && Sa(r)) && $(e, n.slice(0, -1)), e;
|
|
2575
|
+
}
|
|
2576
|
+
var Ca = (e, t, n) => (e[t] = n, e);
|
|
2577
|
+
function wa(e) {
|
|
2578
|
+
let t = Li(), { control: n = t, name: r, keyName: i = "id", disabled: a, shouldUnregister: o, rules: s } = e, [c, l] = A.useState(n._getFieldArray(r)), u = A.useRef(n._getFieldArray(r).map(Ji)), d = A.useRef(!1);
|
|
2579
|
+
a || n._names.array.add(r), A.useMemo(() => !a && s && c.length >= 0 && n.register(r, s), [
|
|
2566
2580
|
n,
|
|
2567
2581
|
r,
|
|
2568
2582
|
c.length,
|
|
2569
2583
|
s,
|
|
2570
2584
|
a
|
|
2571
|
-
]),
|
|
2585
|
+
]), zi(() => {
|
|
2572
2586
|
if (!a) return n._subjects.array.subscribe({ next: ({ values: e, name: t }) => {
|
|
2573
2587
|
if (t === r || !t) {
|
|
2574
2588
|
let n = G(e, r);
|
|
2575
|
-
Array.isArray(n) ? (l(n), u.current = n.map(
|
|
2589
|
+
Array.isArray(n) ? (l(n), u.current = n.map(Ji)) : t || (l([]), u.current = []);
|
|
2576
2590
|
}
|
|
2577
2591
|
} }).unsubscribe;
|
|
2578
2592
|
}, [
|
|
@@ -2580,29 +2594,29 @@ function Sa(e) {
|
|
|
2580
2594
|
r,
|
|
2581
2595
|
a
|
|
2582
2596
|
]);
|
|
2583
|
-
let f =
|
|
2597
|
+
let f = A.useCallback((e) => {
|
|
2584
2598
|
d.current = !0, n._setFieldArray(r, e);
|
|
2585
2599
|
}, [n, r]);
|
|
2586
|
-
return
|
|
2600
|
+
return A.useEffect(() => {
|
|
2587
2601
|
if (a) {
|
|
2588
2602
|
n._state.actionArrayLengths.delete(r);
|
|
2589
2603
|
return;
|
|
2590
2604
|
}
|
|
2591
|
-
n._state.action = !1, n._state.actionArrayLengths.delete(r),
|
|
2592
|
-
let e =
|
|
2593
|
-
if (d.current && (!e.isOnSubmit || n._formState.isSubmitted) && !
|
|
2605
|
+
n._state.action = !1, n._state.actionArrayLengths.delete(r), Zi(r, n._names) && n._subjects.state.next({ ...n._formState });
|
|
2606
|
+
let e = Xi(n._options.mode);
|
|
2607
|
+
if (d.current && (!e.isOnSubmit || n._formState.isSubmitted) && !Xi(n._options.reValidateMode).isOnSubmit && !e.isOnBlur) if (n._options.resolver) n._runSchema([r]).then((e) => {
|
|
2594
2608
|
n._updateIsValidating([r]);
|
|
2595
2609
|
let t = G(e.errors, r), i = G(n._formState.errors, r), a = i && (i.type || i.root?.type), o = i && (i.message || i.root?.message);
|
|
2596
|
-
(i ? !t && a || t && (a !== t.type || o !== t.message) : t && t.type) && (t ? B(t) && !Object.keys(t).some((e) => !Number.isNaN(+e)) ?
|
|
2610
|
+
(i ? !t && a || t && (a !== t.type || o !== t.message) : t && t.type) && (t ? B(t) && !Object.keys(t).some((e) => !Number.isNaN(+e)) ? $i(n._formState.errors, { [r]: t }, r) : J(n._formState.errors, r, t) : $(n._formState.errors, r), n._subjects.state.next({ errors: n._formState.errors }));
|
|
2597
2611
|
});
|
|
2598
2612
|
else {
|
|
2599
2613
|
let e = G(n._fields, r);
|
|
2600
|
-
e && e._f && !(
|
|
2614
|
+
e && e._f && !(Xi(n._options.reValidateMode).isOnSubmit && Xi(n._options.mode).isOnSubmit) && da(e, n._names.disabled, n._formValues, n._options.criteriaMode === H.all, n._options.shouldUseNativeValidation, !0).then((e) => !Z(e) && n._subjects.state.next({ errors: $i(n._formState.errors, e, r) }));
|
|
2601
2615
|
}
|
|
2602
2616
|
d.current && n._subjects.state.next({
|
|
2603
2617
|
name: r,
|
|
2604
2618
|
values: V(n._formValues)
|
|
2605
|
-
}), n._names.focus &&
|
|
2619
|
+
}), n._names.focus && Qi(n._fields, (e, t) => {
|
|
2606
2620
|
if (n._names.focus && t.startsWith(n._names.focus) && e.focus) return e.focus(), 1;
|
|
2607
2621
|
}), n._names.focus = "", n._setValid(), d.current = !1;
|
|
2608
2622
|
}, [
|
|
@@ -2610,7 +2624,7 @@ function Sa(e) {
|
|
|
2610
2624
|
r,
|
|
2611
2625
|
n,
|
|
2612
2626
|
a
|
|
2613
|
-
]),
|
|
2627
|
+
]), A.useEffect(() => (a || !G(n._formValues, r) && n._setFieldArray(r), () => {
|
|
2614
2628
|
if (n._state.actionArrayLengths.delete(r), a) return;
|
|
2615
2629
|
let e = !(n._options.shouldUnregister || o);
|
|
2616
2630
|
d.current && e && n._subjects.state.next({
|
|
@@ -2627,10 +2641,10 @@ function Sa(e) {
|
|
|
2627
2641
|
o,
|
|
2628
2642
|
a
|
|
2629
2643
|
]), {
|
|
2630
|
-
swap:
|
|
2644
|
+
swap: A.useCallback((e, t) => {
|
|
2631
2645
|
if (a) return;
|
|
2632
2646
|
let i = n._getFieldArray(r);
|
|
2633
|
-
|
|
2647
|
+
ba(i, e, t), ba(u.current, e, t), f(i), l(i), n._setFieldArray(r, i, ba, {
|
|
2634
2648
|
argA: e,
|
|
2635
2649
|
argB: t
|
|
2636
2650
|
}, !1);
|
|
@@ -2640,10 +2654,10 @@ function Sa(e) {
|
|
|
2640
2654
|
n,
|
|
2641
2655
|
a
|
|
2642
2656
|
]),
|
|
2643
|
-
move:
|
|
2657
|
+
move: A.useCallback((e, t) => {
|
|
2644
2658
|
if (a) return;
|
|
2645
2659
|
let i = n._getFieldArray(r);
|
|
2646
|
-
|
|
2660
|
+
ha(i, e, t), ha(u.current, e, t), f(i), l(i), n._setFieldArray(r, i, ha, {
|
|
2647
2661
|
argA: e,
|
|
2648
2662
|
argB: t
|
|
2649
2663
|
}, !1);
|
|
@@ -2653,42 +2667,42 @@ function Sa(e) {
|
|
|
2653
2667
|
n,
|
|
2654
2668
|
a
|
|
2655
2669
|
]),
|
|
2656
|
-
prepend:
|
|
2670
|
+
prepend: A.useCallback((e, t) => {
|
|
2657
2671
|
if (a) return;
|
|
2658
|
-
let i = Q(V(e)), o =
|
|
2659
|
-
n._names.focus =
|
|
2672
|
+
let i = Q(V(e)), o = ga(n._getFieldArray(r), i);
|
|
2673
|
+
n._names.focus = Yi(r, 0, t), u.current = ga(u.current, i.map(Ji)), f(o), l(o), n._setFieldArray(r, o, ga, { argA: pa(e) });
|
|
2660
2674
|
}, [
|
|
2661
2675
|
f,
|
|
2662
2676
|
r,
|
|
2663
2677
|
n,
|
|
2664
2678
|
a
|
|
2665
2679
|
]),
|
|
2666
|
-
append:
|
|
2680
|
+
append: A.useCallback((e, t) => {
|
|
2667
2681
|
if (a) return;
|
|
2668
|
-
let i = Q(V(e)), o =
|
|
2669
|
-
n._names.focus =
|
|
2682
|
+
let i = Q(V(e)), o = fa(n._getFieldArray(r), i);
|
|
2683
|
+
n._names.focus = Yi(r, o.length - 1, t), u.current = fa(u.current, i.map(Ji)), f(o), l(o), n._setFieldArray(r, o, fa, { argA: pa(e) });
|
|
2670
2684
|
}, [
|
|
2671
2685
|
f,
|
|
2672
2686
|
r,
|
|
2673
2687
|
n,
|
|
2674
2688
|
a
|
|
2675
2689
|
]),
|
|
2676
|
-
remove:
|
|
2690
|
+
remove: A.useCallback((e) => {
|
|
2677
2691
|
if (a) return;
|
|
2678
|
-
let t =
|
|
2679
|
-
u.current =
|
|
2692
|
+
let t = ya(n._getFieldArray(r), e);
|
|
2693
|
+
u.current = ya(u.current, e), f(t), l(t), !Array.isArray(G(n._fields, r)) && J(n._fields, r, void 0), n._setFieldArray(r, t, ya, { argA: e });
|
|
2680
2694
|
}, [
|
|
2681
2695
|
f,
|
|
2682
2696
|
r,
|
|
2683
2697
|
n,
|
|
2684
2698
|
a
|
|
2685
2699
|
]),
|
|
2686
|
-
insert:
|
|
2700
|
+
insert: A.useCallback((e, t, i) => {
|
|
2687
2701
|
if (a) return;
|
|
2688
|
-
let o = Q(V(t)), s =
|
|
2689
|
-
n._names.focus =
|
|
2702
|
+
let o = Q(V(t)), s = ma(n._getFieldArray(r), e, o);
|
|
2703
|
+
n._names.focus = Yi(r, e, i), u.current = ma(u.current, e, o.map(Ji)), f(s), l(s), n._setFieldArray(r, s, ma, {
|
|
2690
2704
|
argA: e,
|
|
2691
|
-
argB:
|
|
2705
|
+
argB: pa(t)
|
|
2692
2706
|
});
|
|
2693
2707
|
}, [
|
|
2694
2708
|
f,
|
|
@@ -2696,10 +2710,10 @@ function Sa(e) {
|
|
|
2696
2710
|
n,
|
|
2697
2711
|
a
|
|
2698
2712
|
]),
|
|
2699
|
-
update:
|
|
2713
|
+
update: A.useCallback((e, t) => {
|
|
2700
2714
|
if (a) return;
|
|
2701
|
-
let i = V(t), o =
|
|
2702
|
-
u.current = [...o].map((t, n) => !t || n === e ?
|
|
2715
|
+
let i = V(t), o = Ca(n._getFieldArray(r), e, i);
|
|
2716
|
+
u.current = [...o].map((t, n) => !t || n === e ? Ji() : u.current[n]), f(o), l([...o]), n._setFieldArray(r, o, Ca, {
|
|
2703
2717
|
argA: e,
|
|
2704
2718
|
argB: i
|
|
2705
2719
|
}, !0, !1);
|
|
@@ -2709,20 +2723,20 @@ function Sa(e) {
|
|
|
2709
2723
|
n,
|
|
2710
2724
|
a
|
|
2711
2725
|
]),
|
|
2712
|
-
replace:
|
|
2726
|
+
replace: A.useCallback((e) => {
|
|
2713
2727
|
if (a) return;
|
|
2714
2728
|
let t = Q(V(e));
|
|
2715
|
-
u.current = t.map(
|
|
2729
|
+
u.current = t.map(Ji), f([...t]), l([...t]), n._setFieldArray(r, [...t], (e) => e, {}, !0, !1);
|
|
2716
2730
|
}, [
|
|
2717
2731
|
f,
|
|
2718
2732
|
r,
|
|
2719
2733
|
n,
|
|
2720
2734
|
a
|
|
2721
2735
|
]),
|
|
2722
|
-
fields:
|
|
2736
|
+
fields: A.useMemo(() => c.map((e, t) => ({
|
|
2723
2737
|
...e,
|
|
2724
2738
|
...K(a) ? { disabled: a } : {},
|
|
2725
|
-
[i]: u.current[t] ||
|
|
2739
|
+
[i]: u.current[t] || Ji()
|
|
2726
2740
|
})), [
|
|
2727
2741
|
c,
|
|
2728
2742
|
i,
|
|
@@ -2730,16 +2744,16 @@ function Sa(e) {
|
|
|
2730
2744
|
])
|
|
2731
2745
|
};
|
|
2732
2746
|
}
|
|
2733
|
-
var
|
|
2747
|
+
var Ta = (e) => {
|
|
2734
2748
|
let t = {};
|
|
2735
|
-
for (let n of Object.keys(e)) if (
|
|
2736
|
-
let r =
|
|
2749
|
+
for (let n of Object.keys(e)) if (wi(e[n]) && e[n] !== null && !Ci(e[n])) {
|
|
2750
|
+
let r = Ta(e[n]);
|
|
2737
2751
|
for (let e of Object.keys(r)) t[`${n}.${e}`] = r[e];
|
|
2738
2752
|
} else t[n] = e[n];
|
|
2739
2753
|
return t;
|
|
2740
|
-
},
|
|
2741
|
-
|
|
2742
|
-
var
|
|
2754
|
+
}, Ea = A.createContext(null);
|
|
2755
|
+
Ea.displayName = "HookFormContext";
|
|
2756
|
+
var Da = () => {
|
|
2743
2757
|
let e = [];
|
|
2744
2758
|
return {
|
|
2745
2759
|
get observers() {
|
|
@@ -2756,65 +2770,65 @@ var Ta = () => {
|
|
|
2756
2770
|
}
|
|
2757
2771
|
};
|
|
2758
2772
|
};
|
|
2759
|
-
function
|
|
2773
|
+
function Oa(e, t) {
|
|
2760
2774
|
let n = {};
|
|
2761
2775
|
for (let r in e) if (e.hasOwnProperty(r)) {
|
|
2762
2776
|
let i = e[r], a = t[r];
|
|
2763
2777
|
if (i && B(i) && a) {
|
|
2764
|
-
let e =
|
|
2778
|
+
let e = Oa(i, a);
|
|
2765
2779
|
B(e) && (n[r] = e);
|
|
2766
2780
|
} else e[r] && (n[r] = a);
|
|
2767
2781
|
}
|
|
2768
2782
|
return n;
|
|
2769
2783
|
}
|
|
2770
|
-
var
|
|
2771
|
-
function
|
|
2784
|
+
var ka = (e) => e.type === "select-multiple", Aa = (e) => ta(e) || xi(e), ja = (e) => ea(e) && e.isConnected;
|
|
2785
|
+
function Ma(e) {
|
|
2772
2786
|
return Array.isArray(e) || B(e);
|
|
2773
2787
|
}
|
|
2774
|
-
function
|
|
2788
|
+
function Na(e, t, n = "", r = []) {
|
|
2775
2789
|
for (let i in e) {
|
|
2776
2790
|
let a = n ? `${n}.${i}` : i, o = e[i];
|
|
2777
|
-
|
|
2791
|
+
Ma(o) && Ma(G(t, a)) ? Na(o, t, a, r) : r.push(a);
|
|
2778
2792
|
}
|
|
2779
2793
|
return r;
|
|
2780
2794
|
}
|
|
2781
|
-
var
|
|
2795
|
+
var Pa = (e) => {
|
|
2782
2796
|
for (let t in e) if (q(e[t])) return !0;
|
|
2783
2797
|
return !1;
|
|
2784
2798
|
};
|
|
2785
|
-
function
|
|
2786
|
-
return Array.isArray(e) || B(e) && !
|
|
2799
|
+
function Fa(e) {
|
|
2800
|
+
return Array.isArray(e) || B(e) && !Pa(e);
|
|
2787
2801
|
}
|
|
2788
|
-
function
|
|
2802
|
+
function Ia(e) {
|
|
2789
2803
|
return !!(e && "_f" in e);
|
|
2790
2804
|
}
|
|
2791
|
-
function
|
|
2805
|
+
function La(e) {
|
|
2792
2806
|
return Array.isArray(e) ? !e.some((e) => !W(e)) : !Object.keys(e).length;
|
|
2793
2807
|
}
|
|
2794
|
-
function
|
|
2808
|
+
function Ra(e, t) {
|
|
2795
2809
|
Array.isArray(e) ? e[t] = void 0 : delete e[t];
|
|
2796
2810
|
}
|
|
2797
|
-
function
|
|
2811
|
+
function za(e, t = {}, n) {
|
|
2798
2812
|
for (let r in e) {
|
|
2799
2813
|
let i = e[r], a = n && n[r];
|
|
2800
|
-
|
|
2814
|
+
Fa(i) && (!Array.isArray(i) || !Ia(a)) ? (t[r] = Array.isArray(i) ? [] : {}, za(i, t[r], a), La(t[r]) && Ra(t, r)) : W(i) || (t[r] = !0);
|
|
2801
2815
|
}
|
|
2802
2816
|
return t;
|
|
2803
2817
|
}
|
|
2804
|
-
function
|
|
2805
|
-
n ||=
|
|
2818
|
+
function Ba(e, t, n, r) {
|
|
2819
|
+
n ||= za(t, {}, r);
|
|
2806
2820
|
for (let i in e) {
|
|
2807
2821
|
let a = e[i], o = r && r[i];
|
|
2808
|
-
|
|
2822
|
+
Fa(a) && (!Array.isArray(a) || !Ia(o)) ? (W(t) || Bi(n[i]) ? n[i] = za(a, Array.isArray(a) ? [] : {}, o) : Ba(a, z(t) ? {} : t[i], n[i], o), La(n[i]) && Ra(n, i)) : Y(a, t[i]) ? Ra(n, i) : n[i] = !0;
|
|
2809
2823
|
}
|
|
2810
2824
|
return n;
|
|
2811
2825
|
}
|
|
2812
|
-
var
|
|
2813
|
-
function
|
|
2826
|
+
var Va = (e, { valueAsNumber: t, valueAsDate: n, setValueAs: r }) => W(e) ? e : t ? e === "" ? NaN : e && +e : n && X(e) ? new Date(e) : r ? r(e) : e;
|
|
2827
|
+
function Ha(e) {
|
|
2814
2828
|
let t = e.ref;
|
|
2815
|
-
return
|
|
2829
|
+
return Si(t) ? t.files : ta(t) ? ca(e.refs).value : ka(t) ? [...t.selectedOptions].map(({ value: e }) => e) : xi(t) ? oa(e.refs).value : Va(t.value, e);
|
|
2816
2830
|
}
|
|
2817
|
-
var
|
|
2831
|
+
var Ua = (e, t, n, r) => {
|
|
2818
2832
|
let i = {};
|
|
2819
2833
|
for (let n of e) {
|
|
2820
2834
|
let e = G(t, n);
|
|
@@ -2826,17 +2840,17 @@ var Va = (e, t, n, r) => {
|
|
|
2826
2840
|
fields: i,
|
|
2827
2841
|
shouldUseNativeValidation: r
|
|
2828
2842
|
};
|
|
2829
|
-
},
|
|
2843
|
+
}, Wa = (e) => W(e) ? e : na(e) ? e.source : B(e) ? na(e.value) ? e.value.source : e.value : e, Ga = "AsyncFunction", Ka = (e) => {
|
|
2830
2844
|
if (!e || !e.validate) return !1;
|
|
2831
|
-
if (q(e.validate)) return e.validate.constructor.name ===
|
|
2845
|
+
if (q(e.validate)) return e.validate.constructor.name === Ga;
|
|
2832
2846
|
if (B(e.validate)) {
|
|
2833
|
-
for (let t in e.validate) if (e.validate[t].constructor.name ===
|
|
2847
|
+
for (let t in e.validate) if (e.validate[t].constructor.name === Ga) return !0;
|
|
2834
2848
|
}
|
|
2835
2849
|
return !1;
|
|
2836
|
-
},
|
|
2837
|
-
function
|
|
2850
|
+
}, qa = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
|
|
2851
|
+
function Ja(e, t, n) {
|
|
2838
2852
|
let r = G(e, n);
|
|
2839
|
-
if (r ||
|
|
2853
|
+
if (r || Ni(n)) return {
|
|
2840
2854
|
error: r,
|
|
2841
2855
|
name: n
|
|
2842
2856
|
};
|
|
@@ -2856,21 +2870,21 @@ function Ka(e, t, n) {
|
|
|
2856
2870
|
}
|
|
2857
2871
|
return { name: n };
|
|
2858
2872
|
}
|
|
2859
|
-
var
|
|
2873
|
+
var Ya = (e, t, n, r) => {
|
|
2860
2874
|
n(e);
|
|
2861
2875
|
let i = Object.keys(e).filter((e) => e !== "name");
|
|
2862
2876
|
return !i.length || r && i.length >= Object.keys(t).length || i.find((e) => t[e] === (!r || H.all));
|
|
2863
|
-
},
|
|
2877
|
+
}, Xa = (e, t, n) => !e || !t || e === t || Q(e).some((e) => e && (n ? e === t || e.startsWith(t + ".") : e.startsWith(t) || t.startsWith(e))), Za = (e, t, n, r, i) => i.isOnAll ? !1 : !n && i.isOnTouch ? !(t || e) : (n ? r.isOnBlur : i.isOnBlur) ? !e : (n ? r.isOnChange : i.isOnChange) ? e : !0, Qa = (e, t) => {
|
|
2864
2878
|
let n = G(e, t);
|
|
2865
|
-
!
|
|
2866
|
-
},
|
|
2879
|
+
!_a(n).length && !n?.root && $(e, t);
|
|
2880
|
+
}, $a = {
|
|
2867
2881
|
mode: H.onSubmit,
|
|
2868
2882
|
reValidateMode: H.onChange,
|
|
2869
2883
|
shouldFocusError: !0
|
|
2870
|
-
},
|
|
2884
|
+
}, eo = "form", to = (e, t) => {
|
|
2871
2885
|
for (let n in e) n in t || delete e[n];
|
|
2872
2886
|
Object.assign(e, t);
|
|
2873
|
-
},
|
|
2887
|
+
}, no = {
|
|
2874
2888
|
submitCount: 0,
|
|
2875
2889
|
isDirty: !1,
|
|
2876
2890
|
isReady: !1,
|
|
@@ -2883,12 +2897,12 @@ var qa = (e, t, n, r) => {
|
|
|
2883
2897
|
dirtyFields: {},
|
|
2884
2898
|
validatingFields: {}
|
|
2885
2899
|
};
|
|
2886
|
-
function
|
|
2900
|
+
function ro(e = {}) {
|
|
2887
2901
|
let t = {
|
|
2888
|
-
|
|
2902
|
+
...$a,
|
|
2889
2903
|
...e
|
|
2890
2904
|
}, n = {
|
|
2891
|
-
...V(
|
|
2905
|
+
...V(no),
|
|
2892
2906
|
isLoading: q(t.defaultValues),
|
|
2893
2907
|
errors: t.errors || {},
|
|
2894
2908
|
disabled: t.disabled || !1
|
|
@@ -2905,7 +2919,7 @@ function to(e = {}) {
|
|
|
2905
2919
|
array: /* @__PURE__ */ new Set(),
|
|
2906
2920
|
watch: /* @__PURE__ */ new Set(),
|
|
2907
2921
|
registerName: /* @__PURE__ */ new Set()
|
|
2908
|
-
}, c = {}, l = {}, u = 0, d =
|
|
2922
|
+
}, c = {}, l = {}, u = 0, d = Xi(t.mode), f = Xi(t.reValidateMode), p = {
|
|
2909
2923
|
isDirty: !1,
|
|
2910
2924
|
dirtyFields: !1,
|
|
2911
2925
|
validatingFields: !1,
|
|
@@ -2914,17 +2928,17 @@ function to(e = {}) {
|
|
|
2914
2928
|
isValid: !1,
|
|
2915
2929
|
errors: !1
|
|
2916
2930
|
}, m = { ...p }, h = { ...m }, g = {
|
|
2917
|
-
array:
|
|
2918
|
-
state:
|
|
2931
|
+
array: Da(),
|
|
2932
|
+
state: Da()
|
|
2919
2933
|
}, _ = 0, v = t.criteriaMode === H.all, y = (e, t) => (n) => {
|
|
2920
2934
|
clearTimeout(l[e]), l[e] = setTimeout(t, n);
|
|
2921
2935
|
}, b = async (e) => {
|
|
2922
2936
|
if (!o.keepIsValid && !t.disabled && (m.isValid || h.isValid || e)) {
|
|
2923
2937
|
let e = ++_, i;
|
|
2924
|
-
t.resolver ? (i = Z((await
|
|
2938
|
+
t.resolver ? (i = Z((await D()).errors), e === _ && x()) : i = await A({
|
|
2925
2939
|
fields: r,
|
|
2926
2940
|
onlyCheckValid: !0,
|
|
2927
|
-
eventType:
|
|
2941
|
+
eventType: ki.VALID
|
|
2928
2942
|
}), e === _ && i !== n.isValid && g.state.next({ isValid: i });
|
|
2929
2943
|
}
|
|
2930
2944
|
}, x = (e, r) => {
|
|
@@ -2935,7 +2949,7 @@ function to(e = {}) {
|
|
|
2935
2949
|
isValidating: !Z(n.validatingFields)
|
|
2936
2950
|
}));
|
|
2937
2951
|
}, S = () => {
|
|
2938
|
-
n.dirtyFields =
|
|
2952
|
+
n.dirtyFields = Ba(i, a, void 0, r);
|
|
2939
2953
|
}, C = (e, i = [], s, c, l = !0, u = !0) => {
|
|
2940
2954
|
if (c && s && !t.disabled) {
|
|
2941
2955
|
if (o.action = !0, !o.actionArrayLengths.has(e)) {
|
|
@@ -2948,7 +2962,7 @@ function to(e = {}) {
|
|
|
2948
2962
|
}
|
|
2949
2963
|
if (u && Array.isArray(G(n.errors, e))) {
|
|
2950
2964
|
let t = G(n.errors, e), r = t.root, i = s(t, c.argA, c.argB) || t;
|
|
2951
|
-
r && (i.root = r), l && J(n.errors, e, i),
|
|
2965
|
+
r && (i.root = r), l && J(n.errors, e, i), Qa(n.errors, e);
|
|
2952
2966
|
}
|
|
2953
2967
|
if ((m.touchedFields || h.touchedFields) && u && Array.isArray(G(n.touchedFields, e))) {
|
|
2954
2968
|
let t = s(G(n.touchedFields, e), c.argA, c.argB);
|
|
@@ -2956,7 +2970,7 @@ function to(e = {}) {
|
|
|
2956
2970
|
}
|
|
2957
2971
|
(m.dirtyFields || h.dirtyFields) && S(), g.state.next({
|
|
2958
2972
|
name: e,
|
|
2959
|
-
isDirty:
|
|
2973
|
+
isDirty: j(e, i),
|
|
2960
2974
|
dirtyFields: n.dirtyFields,
|
|
2961
2975
|
errors: n.errors,
|
|
2962
2976
|
isValid: n.isValid
|
|
@@ -2969,16 +2983,16 @@ function to(e = {}) {
|
|
|
2969
2983
|
errors: n.errors,
|
|
2970
2984
|
isValid: !1
|
|
2971
2985
|
});
|
|
2972
|
-
},
|
|
2973
|
-
let t =
|
|
2986
|
+
}, E = (e) => {
|
|
2987
|
+
let t = Ni(e) ? [e] : Fi(e), n = a, r = i;
|
|
2974
2988
|
for (let e = 0; e < t.length - 1; e++) {
|
|
2975
2989
|
let i = t[e];
|
|
2976
2990
|
if (n = z(n) ? n : n[i], r = z(r) ? r : r[i], n === null && r !== null) return !0;
|
|
2977
2991
|
}
|
|
2978
2992
|
return !1;
|
|
2979
|
-
},
|
|
2993
|
+
}, ee = (e) => {
|
|
2980
2994
|
if (!o.actionArrayLengths.size) return !1;
|
|
2981
|
-
let t =
|
|
2995
|
+
let t = Ni(e) ? [e] : Fi(e), n = a, r = "", i = -1, s = 0;
|
|
2982
2996
|
for (let e = 0; e < t.length; e++) {
|
|
2983
2997
|
if (z(n)) return !1;
|
|
2984
2998
|
let a = t[e];
|
|
@@ -2986,19 +3000,19 @@ function to(e = {}) {
|
|
|
2986
3000
|
o.actionArrayLengths.has(r) && (i = e + 1, s = o.actionArrayLengths.get(r)), n = n[a];
|
|
2987
3001
|
}
|
|
2988
3002
|
return !1;
|
|
2989
|
-
},
|
|
3003
|
+
}, te = (t, c, l, u) => {
|
|
2990
3004
|
let d = G(r, t);
|
|
2991
3005
|
if (d) {
|
|
2992
|
-
if (
|
|
3006
|
+
if (E(t) || ee(t)) return;
|
|
2993
3007
|
let r = W(G(a, t)), f = G(a, t, W(l) ? G(i, t) : l);
|
|
2994
|
-
W(f) || u && u.defaultChecked || c ? J(a, t, c ? f :
|
|
3008
|
+
W(f) || u && u.defaultChecked || c ? J(a, t, c ? f : Ha(d._f)) : se(t, f), o.mount && !o.action && (b(), r && n.isDirty && (m.isDirty || h.isDirty) && (j() || (n.isDirty = !1, g.state.next({ ...n }))), e.shouldUnregister && r && !W(G(a, t)) && Zi(t, s) && (o.watch = !0));
|
|
2995
3009
|
}
|
|
2996
|
-
},
|
|
3010
|
+
}, ne = (e, o, s, c, l) => {
|
|
2997
3011
|
let u = !1, d = !1, f = { name: e };
|
|
2998
3012
|
if (!t.disabled || c === !0) {
|
|
2999
3013
|
if (!s || c) {
|
|
3000
3014
|
let t = Y(G(i, e), o);
|
|
3001
|
-
(m.isDirty || h.isDirty) && (d = n.isDirty, n.isDirty = f.isDirty = !t ||
|
|
3015
|
+
(m.isDirty || h.isDirty) && (d = n.isDirty, n.isDirty = f.isDirty = !t || j(), u = d !== f.isDirty), d = !!G(n.dirtyFields, e), t === n.isDirty ? t ? $(n.dirtyFields, e) : J(n.dirtyFields, e, !0) : to(n.dirtyFields, Ba(i, a, void 0, r)), f.dirtyFields = n.dirtyFields, u ||= (m.dirtyFields || h.dirtyFields) && d !== !t;
|
|
3002
3016
|
}
|
|
3003
3017
|
if (s) {
|
|
3004
3018
|
let t = G(n.touchedFields, e);
|
|
@@ -3007,7 +3021,7 @@ function to(e = {}) {
|
|
|
3007
3021
|
u && l && g.state.next(f);
|
|
3008
3022
|
}
|
|
3009
3023
|
return u ? f : {};
|
|
3010
|
-
},
|
|
3024
|
+
}, re = (e, r, i, a) => {
|
|
3011
3025
|
let o = G(n.errors, e), s = (m.isValid || h.isValid) && K(r) && n.isValid !== r;
|
|
3012
3026
|
if (t.delayError && i ? (c[e] = y(e, () => w(e, i)), c[e](t.delayError)) : (clearTimeout(l[e]), delete c[e], i ? J(n.errors, e, i) : $(n.errors, e), n.errors = { ...n.errors }), (i ? !Y(o, i) : o) || !Z(a) || s) {
|
|
3013
3027
|
let t = {
|
|
@@ -3021,17 +3035,17 @@ function to(e = {}) {
|
|
|
3021
3035
|
...t
|
|
3022
3036
|
}, g.state.next(t);
|
|
3023
3037
|
}
|
|
3024
|
-
},
|
|
3025
|
-
let { errors: t } = await
|
|
3038
|
+
}, D = async (e) => (x(e, !0), await t.resolver(a, t.context, Ua(e || s.mount, r, t.criteriaMode, t.shouldUseNativeValidation))), O = async (e) => {
|
|
3039
|
+
let { errors: t } = await D(e);
|
|
3026
3040
|
if (x(e), e) {
|
|
3027
3041
|
for (let r of e) {
|
|
3028
3042
|
let e = G(t, r);
|
|
3029
|
-
e ? s.array.has(r) && B(e) && !Object.keys(e).some((e) => !Number.isNaN(Number(e))) ?
|
|
3043
|
+
e ? s.array.has(r) && B(e) && !Object.keys(e).some((e) => !Number.isNaN(Number(e))) ? $i(n.errors, { [r]: e }, r) : J(n.errors, r, e) : $(n.errors, r);
|
|
3030
3044
|
}
|
|
3031
3045
|
n.errors = { ...n.errors };
|
|
3032
3046
|
} else n.errors = t;
|
|
3033
3047
|
return t;
|
|
3034
|
-
},
|
|
3048
|
+
}, k = async ({ name: t, eventType: r }) => {
|
|
3035
3049
|
if (e.validate) {
|
|
3036
3050
|
let i = await e.validate({
|
|
3037
3051
|
formValues: a,
|
|
@@ -3041,23 +3055,23 @@ function to(e = {}) {
|
|
|
3041
3055
|
});
|
|
3042
3056
|
if (B(i)) for (let e in i) {
|
|
3043
3057
|
let t = i[e];
|
|
3044
|
-
t &&
|
|
3058
|
+
t && ge(`${eo}.${e}`, {
|
|
3045
3059
|
message: X(t.message) ? t.message : "",
|
|
3046
3060
|
type: t.type || U.validate
|
|
3047
3061
|
});
|
|
3048
3062
|
}
|
|
3049
|
-
else X(i) || !i ?
|
|
3063
|
+
else X(i) || !i ? ge(eo, {
|
|
3050
3064
|
message: i || "",
|
|
3051
3065
|
type: U.validate
|
|
3052
|
-
}) :
|
|
3066
|
+
}) : he(eo);
|
|
3053
3067
|
return i;
|
|
3054
3068
|
}
|
|
3055
3069
|
return !0;
|
|
3056
|
-
},
|
|
3070
|
+
}, A = async ({ fields: r, onlyCheckValid: i, name: o, eventType: c, context: l = {
|
|
3057
3071
|
valid: !0,
|
|
3058
3072
|
runRootValidation: !1
|
|
3059
3073
|
} }) => {
|
|
3060
|
-
if (e.validate && (l.runRootValidation = !0, !await
|
|
3074
|
+
if (e.validate && (l.runRootValidation = !0, !await k({
|
|
3061
3075
|
name: o,
|
|
3062
3076
|
eventType: c
|
|
3063
3077
|
}) && (l.valid = !1, i))) return l.valid;
|
|
@@ -3066,12 +3080,12 @@ function to(e = {}) {
|
|
|
3066
3080
|
if (u) {
|
|
3067
3081
|
let { _f: r, ...d } = u;
|
|
3068
3082
|
if (r) {
|
|
3069
|
-
let o = s.array.has(r.name), c = u._f &&
|
|
3083
|
+
let o = s.array.has(r.name), c = u._f && Ka(u._f), d = m.validatingFields || m.isValidating || h.validatingFields || h.isValidating;
|
|
3070
3084
|
c && d && x([r.name], !0);
|
|
3071
|
-
let f = await
|
|
3072
|
-
if (c && d && x([r.name]), f[r.name] && (l.valid = !1, i) || (!i && (G(f, r.name) ? o ?
|
|
3085
|
+
let f = await da(u, s.disabled, a, v, t.shouldUseNativeValidation && !i, o);
|
|
3086
|
+
if (c && d && x([r.name]), f[r.name] && (l.valid = !1, i) || (!i && (G(f, r.name) ? o ? $i(n.errors, f, r.name) : J(n.errors, r.name, f[r.name]) : $(n.errors, r.name)), e.shouldUseNativeValidation && f[r.name])) break;
|
|
3073
3087
|
}
|
|
3074
|
-
!Z(d) && await
|
|
3088
|
+
!Z(d) && await A({
|
|
3075
3089
|
context: l,
|
|
3076
3090
|
onlyCheckValid: i,
|
|
3077
3091
|
fields: d,
|
|
@@ -3081,25 +3095,25 @@ function to(e = {}) {
|
|
|
3081
3095
|
}
|
|
3082
3096
|
}
|
|
3083
3097
|
return l.valid;
|
|
3084
|
-
},
|
|
3098
|
+
}, ie = () => {
|
|
3085
3099
|
for (let e of s.unMount) {
|
|
3086
3100
|
let t = G(r, e);
|
|
3087
|
-
t && (t._f.refs ? t._f.refs.every((e) => !
|
|
3101
|
+
t && (t._f.refs ? t._f.refs.every((e) => !ja(e)) : !ja(t._f.ref)) && be(e);
|
|
3088
3102
|
}
|
|
3089
3103
|
s.unMount = /* @__PURE__ */ new Set();
|
|
3090
|
-
},
|
|
3104
|
+
}, j = (e, t) => (e && t && J(a, e, t), !Y(o.mount ? a : i, i)), ae = (e, t, n) => Wi(e, s, { ...o.mount ? a : W(t) || X(e) ? i : t }, n, t), oe = (e) => _a(G(o.mount ? a : i, e, t.shouldUnregister ? G(i, e, []) : [])), se = (e, t, n = {}, i = !1, o = !1, s = !1) => {
|
|
3091
3105
|
let c = G(r, e), l = t;
|
|
3092
3106
|
if (c) {
|
|
3093
3107
|
let n = c._f;
|
|
3094
|
-
n && (!n.disabled && J(a, e,
|
|
3108
|
+
n && (!n.disabled && J(a, e, Va(t, n)), l = ea(n.ref) && z(t) ? "" : t, ka(n.ref) ? [...n.ref.options].forEach((e) => e.selected = l.includes(e.value)) : n.refs ? xi(n.ref) ? n.refs.forEach((e) => {
|
|
3095
3109
|
(!e.defaultChecked || !e.disabled) && (Array.isArray(l) ? e.checked = !!l.find((t) => t === e.value) : e.checked = l === e.value || !!l);
|
|
3096
|
-
}) : n.refs.forEach((e) => e.checked = e.value === l) :
|
|
3110
|
+
}) : n.refs.forEach((e) => e.checked = e.value === l) : Si(n.ref) ? n.ref.value = "" : (n.ref.value = l, !n.ref.type && !o && !s && g.state.next({
|
|
3097
3111
|
name: e,
|
|
3098
3112
|
values: i ? a : V(a)
|
|
3099
3113
|
})));
|
|
3100
3114
|
}
|
|
3101
|
-
(n.shouldDirty || n.shouldTouch) &&
|
|
3102
|
-
},
|
|
3115
|
+
(n.shouldDirty || n.shouldTouch) && ne(e, l, n.shouldTouch, n.shouldDirty, !o), n.shouldValidate && pe(e, { delayError: n.delayError });
|
|
3116
|
+
}, ce = (e, t, n, i = !1, o = !1, c = !1) => {
|
|
3103
3117
|
s.array.has(e) && g.array.next({
|
|
3104
3118
|
name: e,
|
|
3105
3119
|
values: i ? a : V(a)
|
|
@@ -3107,9 +3121,9 @@ function to(e = {}) {
|
|
|
3107
3121
|
for (let a in t) {
|
|
3108
3122
|
if (!t.hasOwnProperty(a)) return;
|
|
3109
3123
|
let l = t[a], u = e + "." + a, d = G(r, u);
|
|
3110
|
-
(s.array.has(e) || B(l) || d && !d._f) && !
|
|
3124
|
+
(s.array.has(e) || B(l) || d && !d._f) && !Ci(l) ? ce(u, l, n, i, o, c) : se(u, l, n, i, o, c);
|
|
3111
3125
|
}
|
|
3112
|
-
},
|
|
3126
|
+
}, le = (e, t, i, c, l = !1) => {
|
|
3113
3127
|
let u = G(r, e), d = s.array.has(e), f = c ? t : V(t), p = Y(G(a, e), f);
|
|
3114
3128
|
if (p || J(a, e, f), d) g.array.next({
|
|
3115
3129
|
name: e,
|
|
@@ -3117,29 +3131,29 @@ function to(e = {}) {
|
|
|
3117
3131
|
}), (m.isDirty || m.dirtyFields || h.isDirty || h.dirtyFields) && i.shouldDirty && (S(), l || g.state.next({
|
|
3118
3132
|
name: e,
|
|
3119
3133
|
dirtyFields: n.dirtyFields,
|
|
3120
|
-
isDirty:
|
|
3134
|
+
isDirty: j(e, f)
|
|
3121
3135
|
}));
|
|
3122
3136
|
else {
|
|
3123
3137
|
let t = Array.isArray(f) && !f.length || Z(f), n = !p && !l;
|
|
3124
|
-
!u || u._f || z(f) || t ?
|
|
3138
|
+
!u || u._f || z(f) || t ? se(e, f, i, c, l, n) : ce(e, f, i, c, l, n);
|
|
3125
3139
|
}
|
|
3126
3140
|
if (!p && !l) {
|
|
3127
|
-
let t =
|
|
3141
|
+
let t = Zi(e, s), r = c ? a : V(a);
|
|
3128
3142
|
g.state.next({
|
|
3129
3143
|
...t && n,
|
|
3130
3144
|
name: o.mount || t ? e : void 0,
|
|
3131
3145
|
values: r
|
|
3132
3146
|
});
|
|
3133
3147
|
}
|
|
3134
|
-
},
|
|
3148
|
+
}, M = (e, t, n = {}) => le(e, t, n, !1), ue = (e, t = {}) => {
|
|
3135
3149
|
let r = q(e) ? e(a) : e;
|
|
3136
3150
|
if (!Y(a, r)) {
|
|
3137
3151
|
a = {
|
|
3138
3152
|
...a,
|
|
3139
3153
|
...r
|
|
3140
3154
|
};
|
|
3141
|
-
let e =
|
|
3142
|
-
for (let n of s.mount) n in e &&
|
|
3155
|
+
let e = Ta(r);
|
|
3156
|
+
for (let n of s.mount) n in e && le(n, e[n], t, !0, !0);
|
|
3143
3157
|
g.state.next({
|
|
3144
3158
|
...n,
|
|
3145
3159
|
name: void 0,
|
|
@@ -3147,13 +3161,13 @@ function to(e = {}) {
|
|
|
3147
3161
|
...u ? { values: a } : {}
|
|
3148
3162
|
}), t.shouldValidate && b();
|
|
3149
3163
|
}
|
|
3150
|
-
},
|
|
3164
|
+
}, de = async (i) => {
|
|
3151
3165
|
o.mount = !0;
|
|
3152
3166
|
let l = i.target, p = l.name, _ = !0, y = G(r, p), S = (e) => {
|
|
3153
|
-
_ = Number.isNaN(e) ||
|
|
3167
|
+
_ = Number.isNaN(e) || Ci(e) && isNaN(e.getTime()) || Y(e, G(a, p, e));
|
|
3154
3168
|
};
|
|
3155
3169
|
if (y) {
|
|
3156
|
-
let o, C, w = l.type ?
|
|
3170
|
+
let o, C, w = l.type ? Ha(y._f) : Ti(i), T = i.type === ki.BLUR || i.type === ki.FOCUS_OUT, E = !qa(y._f) && !e.validate && !t.resolver && !G(n.errors, p) && !y._f.deps, ee = E || Za(T, G(n.touchedFields, p), n.isSubmitted, f, d), te = Zi(p, s, T);
|
|
3157
3171
|
if (J(a, p, w), T) {
|
|
3158
3172
|
if (!l || !l.readOnly) {
|
|
3159
3173
|
y._f.onBlur && y._f.onBlur(i);
|
|
@@ -3161,51 +3175,51 @@ function to(e = {}) {
|
|
|
3161
3175
|
e && e(0);
|
|
3162
3176
|
}
|
|
3163
3177
|
} else y._f.onChange && y._f.onChange(i);
|
|
3164
|
-
let
|
|
3178
|
+
let O = ne(p, w, T), ie = !Z(O) || te;
|
|
3165
3179
|
if (!T && g.state.next({
|
|
3166
3180
|
name: p,
|
|
3167
3181
|
type: i.type,
|
|
3168
3182
|
...u ? { values: V(a) } : {}
|
|
3169
|
-
}),
|
|
3183
|
+
}), ee) return (!E || !n.isValid) && (m.isValid || h.isValid) && (t.mode === "onBlur" ? T && b() : T || b()), ie && g.state.next({
|
|
3170
3184
|
name: p,
|
|
3171
|
-
...
|
|
3185
|
+
...te ? {} : O
|
|
3172
3186
|
});
|
|
3173
|
-
if (!t.resolver && e.validate && await
|
|
3187
|
+
if (!t.resolver && e.validate && await k({
|
|
3174
3188
|
name: p,
|
|
3175
3189
|
eventType: i.type
|
|
3176
|
-
}), !T &&
|
|
3177
|
-
let { errors: e } = await
|
|
3190
|
+
}), !T && te && g.state.next({ ...n }), t.resolver) {
|
|
3191
|
+
let { errors: e } = await D([p]);
|
|
3178
3192
|
if (x([p]), S(w), !_) {
|
|
3179
|
-
!Z(
|
|
3193
|
+
!Z(O) && g.state.next(O);
|
|
3180
3194
|
return;
|
|
3181
3195
|
}
|
|
3182
|
-
let t =
|
|
3196
|
+
let t = Ja(n.errors, r, p), i = Ja(e, r, t.name || p);
|
|
3183
3197
|
o = i.error, p = i.name, C = Z(e);
|
|
3184
|
-
} else x([p], !0), o = (await
|
|
3198
|
+
} else x([p], !0), o = (await da(y, s.disabled, a, v, t.shouldUseNativeValidation))[p], x([p]), S(w), _ && (o ? C = !1 : (m.isValid || h.isValid) && (C = await A({
|
|
3185
3199
|
fields: r,
|
|
3186
3200
|
onlyCheckValid: !0,
|
|
3187
3201
|
name: p,
|
|
3188
3202
|
eventType: i.type
|
|
3189
3203
|
})));
|
|
3190
|
-
_ && (y._f.deps && (!Array.isArray(y._f.deps) || y._f.deps.length > 0) &&
|
|
3204
|
+
_ && (y._f.deps && (!Array.isArray(y._f.deps) || y._f.deps.length > 0) && pe(y._f.deps), re(p, C, o, O));
|
|
3191
3205
|
}
|
|
3192
|
-
},
|
|
3206
|
+
}, fe = (e, t) => {
|
|
3193
3207
|
if (G(n.errors, t) && e.focus) return e.focus(), 1;
|
|
3194
|
-
},
|
|
3208
|
+
}, pe = async (e, i = {}) => {
|
|
3195
3209
|
let a, o, u = Q(e);
|
|
3196
3210
|
if (t.resolver) {
|
|
3197
|
-
let t = await
|
|
3211
|
+
let t = await O(W(e) ? e : u);
|
|
3198
3212
|
a = Z(t), o = e ? !u.some((e) => G(t, e)) : a;
|
|
3199
3213
|
} else e ? (o = (await Promise.all(u.map(async (e) => {
|
|
3200
3214
|
let t = G(r, e);
|
|
3201
|
-
return await
|
|
3215
|
+
return await A({
|
|
3202
3216
|
fields: t && t._f ? { [e]: t } : t,
|
|
3203
|
-
eventType:
|
|
3217
|
+
eventType: ki.TRIGGER
|
|
3204
3218
|
});
|
|
3205
|
-
}))).every(Boolean), !(!o && !n.isValid) && b()) : o = a = await
|
|
3219
|
+
}))).every(Boolean), !(!o && !n.isValid) && b()) : o = a = await A({
|
|
3206
3220
|
fields: r,
|
|
3207
3221
|
name: e,
|
|
3208
|
-
eventType:
|
|
3222
|
+
eventType: ki.TRIGGER
|
|
3209
3223
|
});
|
|
3210
3224
|
if (i.delayError && t.delayError && X(e)) {
|
|
3211
3225
|
let r = G(n.errors, e);
|
|
@@ -3215,17 +3229,17 @@ function to(e = {}) {
|
|
|
3215
3229
|
...!X(e) || (m.isValid || h.isValid) && a !== n.isValid ? {} : { name: e },
|
|
3216
3230
|
...t.resolver || !e ? { isValid: a } : {},
|
|
3217
3231
|
errors: n.errors
|
|
3218
|
-
}), i.shouldFocus && !o &&
|
|
3219
|
-
},
|
|
3232
|
+
}), i.shouldFocus && !o && Qi(r, fe, e ? u : s.mount), o;
|
|
3233
|
+
}, me = (e, t) => {
|
|
3220
3234
|
let r = { ...o.mount ? a : i };
|
|
3221
|
-
return t && (r =
|
|
3222
|
-
},
|
|
3235
|
+
return t && (r = Oa(t.dirtyFields ? n.dirtyFields : n.touchedFields, r)), W(e) ? r : X(e) ? G(r, e) : e.map((e) => G(r, e));
|
|
3236
|
+
}, N = (e, t) => ({
|
|
3223
3237
|
invalid: !!G((t || n).errors, e),
|
|
3224
3238
|
isDirty: !!G((t || n).dirtyFields, e),
|
|
3225
3239
|
error: G((t || n).errors, e),
|
|
3226
3240
|
isValidating: !!G(n.validatingFields, e),
|
|
3227
3241
|
isTouched: !!G((t || n).touchedFields, e)
|
|
3228
|
-
}),
|
|
3242
|
+
}), he = (e) => {
|
|
3229
3243
|
let t = e ? Q(e) : void 0;
|
|
3230
3244
|
t?.forEach((e) => $(n.errors, e)), t ? t.forEach((e) => {
|
|
3231
3245
|
g.state.next({
|
|
@@ -3233,7 +3247,7 @@ function to(e = {}) {
|
|
|
3233
3247
|
errors: n.errors
|
|
3234
3248
|
});
|
|
3235
3249
|
}) : (n.errors = {}, g.state.next({ errors: n.errors }));
|
|
3236
|
-
},
|
|
3250
|
+
}, ge = (e, t, i) => {
|
|
3237
3251
|
let a = (G(r, e, { _f: {} })._f || {}).ref, { ref: o, message: s, type: c, ...l } = G(n.errors, e) || {};
|
|
3238
3252
|
J(n.errors, e, {
|
|
3239
3253
|
...l,
|
|
@@ -3244,20 +3258,20 @@ function to(e = {}) {
|
|
|
3244
3258
|
errors: n.errors,
|
|
3245
3259
|
isValid: !1
|
|
3246
3260
|
}), i && i.shouldFocus && a && a.focus && a.focus();
|
|
3247
|
-
},
|
|
3261
|
+
}, _e = (e, t) => {
|
|
3248
3262
|
if (q(e)) {
|
|
3249
3263
|
u++;
|
|
3250
|
-
let { unsubscribe: n } = g.state.subscribe({ next: (n) => "values" in n && e(n.values ||
|
|
3264
|
+
let { unsubscribe: n } = g.state.subscribe({ next: (n) => "values" in n && e(n.values || ae(void 0, t), n) }), r = !1;
|
|
3251
3265
|
return { unsubscribe: () => {
|
|
3252
3266
|
r || (r = !0, u--, n());
|
|
3253
3267
|
} };
|
|
3254
3268
|
}
|
|
3255
|
-
return
|
|
3256
|
-
},
|
|
3269
|
+
return ae(e, t, !0);
|
|
3270
|
+
}, ve = (e) => {
|
|
3257
3271
|
let t = !!e.formState?.values;
|
|
3258
3272
|
t && u++;
|
|
3259
3273
|
let { unsubscribe: r } = g.state.subscribe({ next: (t) => {
|
|
3260
|
-
if (
|
|
3274
|
+
if (Xa(e.name, t.name, e.exact) && Ya(t, e.formState || m, ke, e.reRenderRoot)) {
|
|
3261
3275
|
let r = { ...a };
|
|
3262
3276
|
e.callback({
|
|
3263
3277
|
values: r,
|
|
@@ -3272,27 +3286,27 @@ function to(e = {}) {
|
|
|
3272
3286
|
return () => {
|
|
3273
3287
|
o || (o = !0, u--, r());
|
|
3274
3288
|
};
|
|
3275
|
-
},
|
|
3289
|
+
}, ye = (e) => (o.mount = !0, h = {
|
|
3276
3290
|
...h,
|
|
3277
3291
|
...e.formState
|
|
3278
|
-
},
|
|
3292
|
+
}, ve({
|
|
3279
3293
|
...e,
|
|
3280
3294
|
formState: {
|
|
3281
3295
|
...p,
|
|
3282
3296
|
...e.formState
|
|
3283
3297
|
}
|
|
3284
|
-
})),
|
|
3298
|
+
})), be = (e, o = {}) => {
|
|
3285
3299
|
for (let c of e ? Q(e) : s.mount) s.mount.delete(c), s.array.delete(c), o.keepValue || ($(r, c), $(a, c)), !o.keepError && $(n.errors, c), !o.keepDirty && $(n.dirtyFields, c), !o.keepTouched && $(n.touchedFields, c), !o.keepIsValidating && $(n.validatingFields, c), !t.shouldUnregister && !o.keepDefaultValue && $(i, c);
|
|
3286
3300
|
g.state.next({ values: V(a) }), g.state.next({
|
|
3287
3301
|
...n,
|
|
3288
|
-
...o.keepDirty ? { isDirty:
|
|
3302
|
+
...o.keepDirty ? { isDirty: j() } : {}
|
|
3289
3303
|
}), !o.keepIsValid && b();
|
|
3290
|
-
},
|
|
3304
|
+
}, xe = ({ disabled: e, name: t }) => {
|
|
3291
3305
|
if (K(e) && o.mount || e || s.disabled.has(t)) {
|
|
3292
3306
|
let n = s.disabled.has(t) !== !!e;
|
|
3293
3307
|
e ? s.disabled.add(t) : s.disabled.delete(t), n && o.mount && !o.action && b();
|
|
3294
3308
|
}
|
|
3295
|
-
},
|
|
3309
|
+
}, Se = (e, n = {}) => {
|
|
3296
3310
|
let a = G(r, e), c = K(n.disabled) || K(t.disabled), l = !s.registerName.has(e) && a && a._f && !a._f.mount;
|
|
3297
3311
|
return J(r, e, {
|
|
3298
3312
|
...a || {},
|
|
@@ -3302,66 +3316,66 @@ function to(e = {}) {
|
|
|
3302
3316
|
mount: !0,
|
|
3303
3317
|
...n
|
|
3304
3318
|
}
|
|
3305
|
-
}), s.mount.add(e), a && !l ?
|
|
3319
|
+
}), s.mount.add(e), a && !l ? xe({
|
|
3306
3320
|
disabled: K(n.disabled) ? n.disabled : t.disabled,
|
|
3307
3321
|
name: e
|
|
3308
|
-
}) :
|
|
3322
|
+
}) : te(e, !0, n.value), {
|
|
3309
3323
|
...c ? { disabled: n.disabled || t.disabled } : {},
|
|
3310
3324
|
...t.progressive ? {
|
|
3311
3325
|
required: !!n.required,
|
|
3312
|
-
min:
|
|
3313
|
-
max:
|
|
3314
|
-
minLength:
|
|
3315
|
-
maxLength:
|
|
3316
|
-
pattern:
|
|
3326
|
+
min: Wa(n.min),
|
|
3327
|
+
max: Wa(n.max),
|
|
3328
|
+
minLength: Wa(n.minLength),
|
|
3329
|
+
maxLength: Wa(n.maxLength),
|
|
3330
|
+
pattern: Wa(n.pattern)
|
|
3317
3331
|
} : {},
|
|
3318
3332
|
name: e,
|
|
3319
|
-
onChange:
|
|
3320
|
-
onBlur:
|
|
3333
|
+
onChange: de,
|
|
3334
|
+
onBlur: de,
|
|
3321
3335
|
ref: (c) => {
|
|
3322
3336
|
if (c) {
|
|
3323
|
-
s.registerName.add(e),
|
|
3324
|
-
let t = W(c.value) && c.querySelectorAll && c.querySelectorAll("input,select,textarea")[0] || c, o =
|
|
3337
|
+
s.registerName.add(e), Se(e, n), s.registerName.delete(e), a = G(r, e);
|
|
3338
|
+
let t = W(c.value) && c.querySelectorAll && c.querySelectorAll("input,select,textarea")[0] || c, o = Aa(t), l = a._f.refs || [];
|
|
3325
3339
|
if (o ? l.find((e) => e === t) : t === a._f.ref) return;
|
|
3326
3340
|
let u = { ...a._f };
|
|
3327
3341
|
o ? (u.refs = [
|
|
3328
|
-
...l.filter(
|
|
3342
|
+
...l.filter(ja),
|
|
3329
3343
|
t,
|
|
3330
3344
|
...Array.isArray(G(i, e)) ? [{}] : []
|
|
3331
3345
|
], u.ref = {
|
|
3332
3346
|
type: t.type,
|
|
3333
3347
|
name: e
|
|
3334
|
-
}) : (u.ref = t, delete u.refs), J(r, e, { _f: u }),
|
|
3335
|
-
} else a = G(r, e, {}), a._f && (a._f.mount = !1), (t.shouldUnregister || n.shouldUnregister) && !(
|
|
3348
|
+
}) : (u.ref = t, delete u.refs), J(r, e, { _f: u }), te(e, !1, void 0, t);
|
|
3349
|
+
} else a = G(r, e, {}), a._f && (a._f.mount = !1), (t.shouldUnregister || n.shouldUnregister) && !(Ei(s.array, e) && o.action) && s.unMount.add(e);
|
|
3336
3350
|
}
|
|
3337
3351
|
};
|
|
3338
|
-
},
|
|
3339
|
-
K(e) && (g.state.next({ disabled: e }),
|
|
3352
|
+
}, Ce = () => t.shouldFocusError && !t.shouldUseNativeValidation && Qi(r, fe, s.mount), P = (e) => {
|
|
3353
|
+
K(e) && (g.state.next({ disabled: e }), Qi(r, (t, n) => {
|
|
3340
3354
|
let i = G(r, n);
|
|
3341
3355
|
i && (t.disabled = i._f.disabled || e, Array.isArray(i._f.refs) && i._f.refs.forEach((t) => {
|
|
3342
3356
|
t.disabled = i._f.disabled || e;
|
|
3343
3357
|
}));
|
|
3344
3358
|
}, 0, !1));
|
|
3345
|
-
},
|
|
3359
|
+
}, we = (e, i) => async (o) => {
|
|
3346
3360
|
let c, l;
|
|
3347
3361
|
o && (o.preventDefault && o.preventDefault(), o.persist && o.persist());
|
|
3348
3362
|
let u = V(a);
|
|
3349
3363
|
if (g.state.next({ isSubmitting: !0 }), t.resolver) {
|
|
3350
|
-
let { errors: e, values: t } = await
|
|
3364
|
+
let { errors: e, values: t } = await D();
|
|
3351
3365
|
x(), n.errors = e, u = V(t);
|
|
3352
|
-
} else await
|
|
3366
|
+
} else await A({
|
|
3353
3367
|
fields: r,
|
|
3354
|
-
eventType:
|
|
3368
|
+
eventType: ki.SUBMIT
|
|
3355
3369
|
});
|
|
3356
3370
|
if (s.disabled.size) for (let e of s.disabled) $(u, e);
|
|
3357
|
-
if ($(n.errors,
|
|
3371
|
+
if ($(n.errors, Ai), Z(n.errors)) {
|
|
3358
3372
|
g.state.next({ errors: {} });
|
|
3359
3373
|
try {
|
|
3360
3374
|
c = await e(u, o);
|
|
3361
3375
|
} catch (e) {
|
|
3362
3376
|
l = e;
|
|
3363
3377
|
}
|
|
3364
|
-
} else i && await i({ ...n.errors }, o),
|
|
3378
|
+
} else i && await i({ ...n.errors }, o), Ce(), setTimeout(Ce);
|
|
3365
3379
|
if (g.state.next({
|
|
3366
3380
|
isSubmitted: !0,
|
|
3367
3381
|
isSubmitting: !1,
|
|
@@ -3370,23 +3384,23 @@ function to(e = {}) {
|
|
|
3370
3384
|
errors: n.errors
|
|
3371
3385
|
}), l) throw l;
|
|
3372
3386
|
return c;
|
|
3373
|
-
},
|
|
3374
|
-
G(r, e) && (W(t.defaultValue) ?
|
|
3375
|
-
},
|
|
3387
|
+
}, Te = (e, t = {}) => {
|
|
3388
|
+
G(r, e) && (W(t.defaultValue) ? M(e, V(G(i, e))) : (M(e, t.defaultValue), J(i, e, V(t.defaultValue))), t.keepTouched || $(n.touchedFields, e), t.keepDirty || ($(n.dirtyFields, e), n.isDirty = t.defaultValue ? j(e, V(G(i, e))) : j()), t.keepError || ($(n.errors, e), m.isValid && b()), g.state.next({ ...n }));
|
|
3389
|
+
}, Ee = (e, c = {}) => {
|
|
3376
3390
|
let l = e ? V(e) : i, u = V(l), d = Z(e), f = u, p = r;
|
|
3377
3391
|
if (c.keepDefaultValues || (i = l), !c.keepValues) {
|
|
3378
3392
|
if (c.keepDirtyValues) {
|
|
3379
|
-
let e = /* @__PURE__ */ new Set([...s.mount, ...
|
|
3393
|
+
let e = /* @__PURE__ */ new Set([...s.mount, ...Na(Ba(i, a, void 0, p), n.dirtyFields)]);
|
|
3380
3394
|
for (let t of Array.from(e)) {
|
|
3381
3395
|
let e = G(n.dirtyFields, t), r = G(a, t), i = G(f, t);
|
|
3382
|
-
e && !W(r) ? J(f, t, r) : !e && !W(i) &&
|
|
3396
|
+
e && !W(r) ? J(f, t, r) : !e && !W(i) && M(t, i);
|
|
3383
3397
|
}
|
|
3384
3398
|
} else {
|
|
3385
|
-
if (
|
|
3399
|
+
if (Oi && W(e)) for (let e of s.mount) {
|
|
3386
3400
|
let t = G(r, e);
|
|
3387
3401
|
if (t && t._f) {
|
|
3388
3402
|
let e = Array.isArray(t._f.refs) ? t._f.refs[0] : t._f.ref;
|
|
3389
|
-
if (
|
|
3403
|
+
if (ea(e)) {
|
|
3390
3404
|
let t = e.closest("form");
|
|
3391
3405
|
if (t) {
|
|
3392
3406
|
t.reset();
|
|
@@ -3395,7 +3409,7 @@ function to(e = {}) {
|
|
|
3395
3409
|
}
|
|
3396
3410
|
}
|
|
3397
3411
|
}
|
|
3398
|
-
if (c.keepFieldsRef) for (let e of s.mount)
|
|
3412
|
+
if (c.keepFieldsRef) for (let e of s.mount) M(e, G(f, e));
|
|
3399
3413
|
else r = {};
|
|
3400
3414
|
}
|
|
3401
3415
|
if (t.shouldUnregister) {
|
|
@@ -3418,19 +3432,19 @@ function to(e = {}) {
|
|
|
3418
3432
|
focus: ""
|
|
3419
3433
|
}, o.mount = !m.isValid || !!c.keepIsValid || !!c.keepDirtyValues || !t.shouldUnregister && !Z(f), o.watch = !!t.shouldUnregister, o.keepIsValid = !!c.keepIsValid, o.action = !1, o.actionArrayLengths.clear(), c.keepErrors || (n.errors = {}), g.state.next({
|
|
3420
3434
|
submitCount: c.keepSubmitCount ? n.submitCount : 0,
|
|
3421
|
-
isDirty: d ? !1 : c.keepDirty ? n.isDirty : c.keepValues ?
|
|
3435
|
+
isDirty: d ? !1 : c.keepDirty ? n.isDirty : c.keepValues ? j() : !!(c.keepDefaultValues && !Y(e, i)),
|
|
3422
3436
|
isSubmitted: c.keepIsSubmitted ? n.isSubmitted : !1,
|
|
3423
|
-
dirtyFields: d ? {} : c.keepDirtyValues ? c.keepDefaultValues && a ?
|
|
3437
|
+
dirtyFields: d ? {} : c.keepDirtyValues ? c.keepDefaultValues && a ? Ba(i, a, void 0, p) : n.dirtyFields : c.keepDefaultValues && e ? Ba(i, e, void 0, p) : c.keepDirty ? n.dirtyFields : {},
|
|
3424
3438
|
touchedFields: c.keepTouched ? n.touchedFields : {},
|
|
3425
3439
|
errors: c.keepErrors ? n.errors : {},
|
|
3426
3440
|
isSubmitSuccessful: c.keepIsSubmitSuccessful ? n.isSubmitSuccessful : !1,
|
|
3427
3441
|
isSubmitting: !1,
|
|
3428
3442
|
defaultValues: i
|
|
3429
3443
|
});
|
|
3430
|
-
},
|
|
3444
|
+
}, De = (e, n) => Ee(q(e) ? e(a) : e, {
|
|
3431
3445
|
...t.resetOptions,
|
|
3432
3446
|
...n
|
|
3433
|
-
}),
|
|
3447
|
+
}), Oe = (e, t = {}) => {
|
|
3434
3448
|
let n = G(r, e), i = n && n._f;
|
|
3435
3449
|
if (i) {
|
|
3436
3450
|
let e = i.refs ? i.refs[0] : i.ref;
|
|
@@ -3438,38 +3452,38 @@ function to(e = {}) {
|
|
|
3438
3452
|
e.focus(), t.shouldSelect && q(e.select) && e.select();
|
|
3439
3453
|
});
|
|
3440
3454
|
}
|
|
3441
|
-
},
|
|
3455
|
+
}, ke = (e) => {
|
|
3442
3456
|
let { name: t, type: r, values: i, ...a } = e;
|
|
3443
3457
|
n = {
|
|
3444
3458
|
...n,
|
|
3445
3459
|
...a
|
|
3446
3460
|
};
|
|
3447
3461
|
};
|
|
3448
|
-
g.state.subscribe({ next:
|
|
3449
|
-
let
|
|
3462
|
+
g.state.subscribe({ next: ke });
|
|
3463
|
+
let Ae = {
|
|
3450
3464
|
control: {
|
|
3451
|
-
register:
|
|
3452
|
-
unregister:
|
|
3453
|
-
getFieldState:
|
|
3454
|
-
handleSubmit:
|
|
3455
|
-
setError:
|
|
3456
|
-
_subscribe:
|
|
3457
|
-
_runSchema:
|
|
3465
|
+
register: Se,
|
|
3466
|
+
unregister: be,
|
|
3467
|
+
getFieldState: N,
|
|
3468
|
+
handleSubmit: we,
|
|
3469
|
+
setError: ge,
|
|
3470
|
+
_subscribe: ve,
|
|
3471
|
+
_runSchema: D,
|
|
3458
3472
|
_updateIsValidating: x,
|
|
3459
|
-
_focusError:
|
|
3460
|
-
_getWatch:
|
|
3461
|
-
_getDirty:
|
|
3473
|
+
_focusError: Ce,
|
|
3474
|
+
_getWatch: ae,
|
|
3475
|
+
_getDirty: j,
|
|
3462
3476
|
_setValid: b,
|
|
3463
3477
|
_setFieldArray: C,
|
|
3464
|
-
_setDisabledField:
|
|
3478
|
+
_setDisabledField: xe,
|
|
3465
3479
|
_setErrors: T,
|
|
3466
|
-
_getFieldArray:
|
|
3467
|
-
_reset:
|
|
3480
|
+
_getFieldArray: oe,
|
|
3481
|
+
_reset: Ee,
|
|
3468
3482
|
_resetDefaultValues: () => q(t.defaultValues) && t.defaultValues().then((e) => {
|
|
3469
|
-
|
|
3483
|
+
De(e, t.resetOptions), g.state.next({ isLoading: !1 });
|
|
3470
3484
|
}),
|
|
3471
|
-
_removeUnmounted:
|
|
3472
|
-
_disableForm:
|
|
3485
|
+
_removeUnmounted: ie,
|
|
3486
|
+
_disableForm: P,
|
|
3473
3487
|
_subjects: g,
|
|
3474
3488
|
_proxyFormState: m,
|
|
3475
3489
|
get _fields() {
|
|
@@ -3503,22 +3517,22 @@ function to(e = {}) {
|
|
|
3503
3517
|
t = {
|
|
3504
3518
|
...t,
|
|
3505
3519
|
...e
|
|
3506
|
-
}, d =
|
|
3520
|
+
}, d = Xi(t.mode), f = Xi(t.reValidateMode);
|
|
3507
3521
|
}
|
|
3508
3522
|
},
|
|
3509
|
-
subscribe:
|
|
3510
|
-
trigger:
|
|
3511
|
-
register:
|
|
3512
|
-
handleSubmit:
|
|
3513
|
-
watch:
|
|
3514
|
-
setValue:
|
|
3515
|
-
setValues:
|
|
3516
|
-
getValues:
|
|
3517
|
-
reset:
|
|
3518
|
-
resetField:
|
|
3523
|
+
subscribe: ye,
|
|
3524
|
+
trigger: pe,
|
|
3525
|
+
register: Se,
|
|
3526
|
+
handleSubmit: we,
|
|
3527
|
+
watch: _e,
|
|
3528
|
+
setValue: M,
|
|
3529
|
+
setValues: ue,
|
|
3530
|
+
getValues: me,
|
|
3531
|
+
reset: De,
|
|
3532
|
+
resetField: Te,
|
|
3519
3533
|
resetDefaultValues: (e, t = {}) => {
|
|
3520
3534
|
if (i = V(e), !t.keepDirty) {
|
|
3521
|
-
let e =
|
|
3535
|
+
let e = Ba(i, a, void 0, r);
|
|
3522
3536
|
n.dirtyFields = e, n.isDirty = !Z(e);
|
|
3523
3537
|
}
|
|
3524
3538
|
t.keepIsValid || b(), g.state.next({
|
|
@@ -3526,20 +3540,20 @@ function to(e = {}) {
|
|
|
3526
3540
|
defaultValues: i
|
|
3527
3541
|
});
|
|
3528
3542
|
},
|
|
3529
|
-
clearErrors:
|
|
3530
|
-
unregister:
|
|
3531
|
-
setError:
|
|
3532
|
-
setFocus:
|
|
3533
|
-
getFieldState:
|
|
3543
|
+
clearErrors: he,
|
|
3544
|
+
unregister: be,
|
|
3545
|
+
setError: ge,
|
|
3546
|
+
setFocus: Oe,
|
|
3547
|
+
getFieldState: N
|
|
3534
3548
|
};
|
|
3535
3549
|
return {
|
|
3536
|
-
...
|
|
3537
|
-
formControl:
|
|
3550
|
+
...Ae,
|
|
3551
|
+
formControl: Ae
|
|
3538
3552
|
};
|
|
3539
3553
|
}
|
|
3540
|
-
function
|
|
3541
|
-
let t =
|
|
3542
|
-
...V(
|
|
3554
|
+
function io(e = {}) {
|
|
3555
|
+
let t = A.useRef(void 0), n = A.useRef(void 0), r = A.useRef(e.formControl), [i, a] = A.useState(() => ({
|
|
3556
|
+
...V(no),
|
|
3543
3557
|
isLoading: q(e.defaultValues),
|
|
3544
3558
|
errors: e.errors || {},
|
|
3545
3559
|
disabled: e.disabled || !1,
|
|
@@ -3550,7 +3564,7 @@ function no(e = {}) {
|
|
|
3550
3564
|
formState: i
|
|
3551
3565
|
}, e.defaultValues && !q(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
|
|
3552
3566
|
else {
|
|
3553
|
-
let { formControl: n, ...r } =
|
|
3567
|
+
let { formControl: n, ...r } = ro(e);
|
|
3554
3568
|
t.current = {
|
|
3555
3569
|
...r,
|
|
3556
3570
|
formState: i
|
|
@@ -3558,8 +3572,8 @@ function no(e = {}) {
|
|
|
3558
3572
|
}
|
|
3559
3573
|
let o = t.current.control;
|
|
3560
3574
|
o._options = e;
|
|
3561
|
-
let { resyncIfNeeded: s, snapshot: c } =
|
|
3562
|
-
return
|
|
3575
|
+
let { resyncIfNeeded: s, snapshot: c } = Hi();
|
|
3576
|
+
return zi(() => {
|
|
3563
3577
|
let e = () => ({
|
|
3564
3578
|
...o._formState,
|
|
3565
3579
|
defaultValues: o._defaultValues
|
|
@@ -3583,81 +3597,81 @@ function no(e = {}) {
|
|
|
3583
3597
|
o,
|
|
3584
3598
|
s,
|
|
3585
3599
|
c
|
|
3586
|
-
]),
|
|
3600
|
+
]), A.useEffect(() => o._disableForm(e.disabled), [o, e.disabled]), A.useEffect(() => {
|
|
3587
3601
|
e.mode && (o._options.mode = e.mode), e.reValidateMode && (o._options.reValidateMode = e.reValidateMode);
|
|
3588
3602
|
}, [
|
|
3589
3603
|
o,
|
|
3590
3604
|
e.mode,
|
|
3591
3605
|
e.reValidateMode
|
|
3592
|
-
]),
|
|
3606
|
+
]), A.useEffect(() => {
|
|
3593
3607
|
e.errors && (o._setErrors(e.errors), o._focusError());
|
|
3594
|
-
}, [o, e.errors]),
|
|
3608
|
+
}, [o, e.errors]), A.useEffect(() => {
|
|
3595
3609
|
e.shouldUnregister && o._subjects.state.next({ values: o._getWatch() });
|
|
3596
|
-
}, [o, e.shouldUnregister]),
|
|
3610
|
+
}, [o, e.shouldUnregister]), A.useEffect(() => {
|
|
3597
3611
|
if (o._proxyFormState.isDirty) {
|
|
3598
3612
|
let e = o._getDirty();
|
|
3599
3613
|
e !== i.isDirty && o._subjects.state.next({ isDirty: e });
|
|
3600
3614
|
}
|
|
3601
|
-
}, [o, i.isDirty]),
|
|
3615
|
+
}, [o, i.isDirty]), A.useEffect(() => {
|
|
3602
3616
|
e.values && !Y(e.values, n.current) ? (o._reset(e.values, {
|
|
3603
3617
|
keepFieldsRef: !0,
|
|
3604
3618
|
...o._options.resetOptions
|
|
3605
3619
|
}), o._options.resetOptions?.keepIsValid || o._setValid(), n.current = e.values, a((e) => ({ ...e }))) : o._resetDefaultValues();
|
|
3606
|
-
}, [o, e.values]),
|
|
3620
|
+
}, [o, e.values]), A.useEffect(() => {
|
|
3607
3621
|
o._state.mount || (o._setValid(), o._state.mount = !0), o._state.watch && (o._state.watch = !1, o._subjects.state.next({ ...o._formState })), o._removeUnmounted();
|
|
3608
|
-
}), t.current.formState =
|
|
3622
|
+
}), t.current.formState = A.useMemo(() => Ri(i, o), [o, i]), t.current;
|
|
3609
3623
|
}
|
|
3610
3624
|
//#endregion
|
|
3611
3625
|
//#region lib/components/ui/forms/use-field-blur.ts
|
|
3612
|
-
var
|
|
3626
|
+
var ao = typeof document > "u" ? null : document, oo = {
|
|
3613
3627
|
capture: !0,
|
|
3614
3628
|
passive: !0
|
|
3615
3629
|
};
|
|
3616
|
-
function
|
|
3630
|
+
function so(e, t) {
|
|
3617
3631
|
for (let t of e.roots) t.isConnected || e.roots.delete(t);
|
|
3618
3632
|
let n = [...e.roots];
|
|
3619
3633
|
if (!n.length) return !1;
|
|
3620
|
-
if (n.some((e) => e.contains(t))) return e.inside || (e.before = new Set(t.ownerDocument?.body.childNodes ?? []), e.home = new Set(n.map(
|
|
3634
|
+
if (n.some((e) => e.contains(t))) return e.inside || (e.before = new Set(t.ownerDocument?.body.childNodes ?? []), e.home = new Set(n.map(be)), e.opened = /* @__PURE__ */ new Set()), e.inside = !0, !1;
|
|
3621
3635
|
if (!e.inside) return !1;
|
|
3622
|
-
let r =
|
|
3636
|
+
let r = be(t);
|
|
3623
3637
|
if (e.home.has(r)) return !0;
|
|
3624
3638
|
if (!r || e.opened.has(r)) return !1;
|
|
3625
|
-
let i =
|
|
3639
|
+
let i = xe(n, e, r);
|
|
3626
3640
|
return i === "theirs" || !i && e.before.has(r) ? !0 : (e.opened.add(r), !1);
|
|
3627
3641
|
}
|
|
3628
|
-
function
|
|
3629
|
-
let n =
|
|
3642
|
+
function co(e, t) {
|
|
3643
|
+
let n = Lr(t), r = Lr(e), i = N({
|
|
3630
3644
|
roots: /* @__PURE__ */ new Set(),
|
|
3631
3645
|
inside: !1,
|
|
3632
3646
|
before: /* @__PURE__ */ new Set(),
|
|
3633
3647
|
home: /* @__PURE__ */ new Set(),
|
|
3634
3648
|
opened: /* @__PURE__ */ new Set()
|
|
3635
|
-
}).current, a =
|
|
3636
|
-
if (e) return i.roots.add(e), n.current?.(
|
|
3649
|
+
}).current, a = M((e) => {
|
|
3650
|
+
if (e) return i.roots.add(e), n.current?.(Se(i.roots)), () => {
|
|
3637
3651
|
i.roots.delete(e);
|
|
3638
3652
|
};
|
|
3639
|
-
}, [i, n]), o =
|
|
3653
|
+
}, [i, n]), o = M(() => {
|
|
3640
3654
|
i.inside = !1, r.current();
|
|
3641
|
-
}, [i, r]), s =
|
|
3655
|
+
}, [i, r]), s = M((e) => {
|
|
3642
3656
|
let t = e.target;
|
|
3643
|
-
t instanceof Node && (clearTimeout(i.settle),
|
|
3644
|
-
}, [i, o]), c =
|
|
3657
|
+
t instanceof Node && (clearTimeout(i.settle), so(i, t) && o());
|
|
3658
|
+
}, [i, o]), c = M((e) => {
|
|
3645
3659
|
!i.inside || e.relatedTarget || (clearTimeout(i.settle), i.settle = setTimeout(() => {
|
|
3646
3660
|
i.settle = setTimeout(() => {
|
|
3647
|
-
let e =
|
|
3648
|
-
i.inside && (!e || e ===
|
|
3661
|
+
let e = ao?.activeElement;
|
|
3662
|
+
i.inside && (!e || e === ao?.body) && o();
|
|
3649
3663
|
});
|
|
3650
3664
|
}));
|
|
3651
3665
|
}, [i, o]);
|
|
3652
|
-
return
|
|
3666
|
+
return Ir("focusin", s, ao, oo), Ir("focusout", c, ao, oo), de(() => () => clearTimeout(i.settle), [i]), a;
|
|
3653
3667
|
}
|
|
3654
3668
|
//#endregion
|
|
3655
3669
|
//#region lib/components/ui/forms/field-blur.tsx
|
|
3656
|
-
function
|
|
3657
|
-
return /* @__PURE__ */
|
|
3658
|
-
value:
|
|
3670
|
+
function lo({ onBlur: e, focusRef: t, children: n }) {
|
|
3671
|
+
return /* @__PURE__ */ D(Br, {
|
|
3672
|
+
value: co(e, t),
|
|
3659
3673
|
children: n
|
|
3660
3674
|
});
|
|
3661
3675
|
}
|
|
3662
3676
|
//#endregion
|
|
3663
|
-
export {
|
|
3677
|
+
export { fr as $, ei as A, Lr as B, li as C, ai as D, ci as E, Ur as F, Ar as G, Mr as H, Hr as I, Or as J, Tr as K, Vr as L, Qr as M, Jr as N, ni as O, Gr as P, hr as Q, zr as R, di as S, oi as T, kr as U, Ir as V, jr as W, wr as X, Cr as Y, Sr as Z, ui as _, G as a, Sn as at, mi as b, wa as c, gn as ct, Gi as d, Qt as dt, ur as et, vi as f, We as ft, gi as g, _i as h, ra as i, Nn as it, $r as j, ti as k, io as l, fn as lt, yi as m, co as n, Fn as nt, J as o, bn as ot, bi as p, De as pt, Er as q, qi as r, En as rt, Ki as s, jn as st, lo as t, mn as tt, Ui as u, cn as ut, pi as v, si as w, fi as x, hi as y, Rr as z };
|