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