react-hook-form-next-ui 2.1.1 → 3.0.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,65 +1,68 @@
1
- import c, { useState as j, useEffect as ne, useCallback as Z, useMemo as F } from "react";
2
- import { Table as Ne, TableHeader as Fe, TableColumn as Pe, TableBody as Se, TableRow as Ie, TableCell as Ze, Skeleton as Qe, Pagination as Xe, Button as Q, Input as He, Divider as Ve, Card as Ke, CardHeader as et, CardBody as tt, DatePicker as le, InputOtp as nt, Select as rt, SelectItem as at, TimeInput as ie, Textarea as st, Autocomplete as ot, AutocompleteItem as lt, RadioGroup as it, Radio as ct, Checkbox as Re, CheckboxGroup as ut, useDisclosure as mt, Modal as dt, ModalContent as ft, ModalHeader as ht, ModalBody as gt, ModalFooter as pt } from "@nextui-org/react";
3
- import { useFormContext as k, Controller as D, useWatch as X } from "react-hook-form";
4
- import { mixed as q } from "yup";
5
- const Mt = ({ size: e, columns: t }) => /* @__PURE__ */ c.createElement(Ne, { "aria-label": "Tabla de resultados" }, /* @__PURE__ */ c.createElement(Fe, null, t.map(
6
- (n) => /* @__PURE__ */ c.createElement(Pe, { ...t, key: n.key }, n.title)
1
+ import c, { useState as B, useEffect as ne, useCallback as R, useMemo as P } from "react";
2
+ import { Table as ke, TableHeader as Ne, TableColumn as Fe, TableBody as Se, TableRow as Ie, TableCell as Pe, Skeleton as Je, Pagination as Qe, Button as Q, Input as Ze, Divider as He, Card as Xe, CardHeader as Ke, CardBody as et, DatePicker as oe, InputOtp as tt, Select as nt, SelectItem as rt, TimeInput as le, Textarea as at, Autocomplete as st, AutocompleteItem as ot, RadioGroup as lt, Radio as it, Checkbox as Re, CheckboxGroup as ct, Modal as ut, ModalContent as mt, ModalHeader as dt, ModalBody as ft, ModalFooter as ht } from "@heroui/react";
3
+ import { useFormContext as I, Controller as C, useWatch as X } from "react-hook-form";
4
+ import { mixed as J } from "yup";
5
+ const gt = ({
6
+ size: e = 10,
7
+ columns: n = []
8
+ }) => /* @__PURE__ */ c.createElement(ke, { "aria-label": "Tabla de resultados" }, /* @__PURE__ */ c.createElement(Ne, null, n.map(
9
+ (t) => /* @__PURE__ */ c.createElement(Fe, { ...n, key: t.key }, t.title)
7
10
  )), /* @__PURE__ */ c.createElement(Se, null, Array.from(
8
- { length: e ?? 10 },
9
- (n, a) => /* @__PURE__ */ c.createElement(Ie, { key: a }, () => /* @__PURE__ */ c.createElement(Ze, null, /* @__PURE__ */ c.createElement(Qe, { className: "h-5 w-4/5 rounded-lg" })))
10
- ))), vt = (e, t) => {
11
- const [n, a] = j(e);
11
+ { length: e },
12
+ (t, r) => /* @__PURE__ */ c.createElement(Ie, { key: r }, () => /* @__PURE__ */ c.createElement(Pe, null, /* @__PURE__ */ c.createElement(Je, { className: "h-5 w-4/5 rounded-lg" })))
13
+ ))), pt = (e, n) => {
14
+ const [t, r] = B(e);
12
15
  return ne(() => {
13
- const r = setTimeout(() => {
14
- a(e);
15
- }, t);
16
+ const a = setTimeout(() => {
17
+ r(e);
18
+ }, n);
16
19
  return () => {
17
- clearTimeout(r);
20
+ clearTimeout(a);
18
21
  };
19
- }, [e, t]), n;
22
+ }, [e, n]), t;
20
23
  };
21
- var je = /^([0-9]{4})-([0-1][0-9])(?:-([0-3][0-9]))?(?:[T ]?([0-2][0-9])(?::([0-5][0-9]))?(?::([0-5][0-9]))?)?(?:\.[0-9]+)?(Z|(?:\+|\-)[0-9]{2}:?[0-9]{2})?$/;
22
- function yt(e) {
23
- const t = e.match(je);
24
- if (t) {
25
- const n = Number(t[2]);
26
- if (n < 1 || n > 12)
24
+ var Ve = /^([0-9]{4})-([0-1][0-9])(?:-([0-3][0-9]))?(?:[T ]?([0-2][0-9])(?::([0-5][0-9]))?(?::([0-5][0-9]))?)?(?:\.[0-9]+)?(Z|(?:\+|\-)[0-9]{2}:?[0-9]{2})?$/;
25
+ function Mt(e) {
26
+ const n = e.match(Ve);
27
+ if (n) {
28
+ const t = Number(n[2]);
29
+ if (t < 1 || t > 12)
27
30
  return !1;
28
- if (typeof t[3] !== void 0) {
29
- const a = Number(t[3]);
30
- if (a < 1 || a > 31)
31
+ if (typeof n[3] !== void 0) {
32
+ const r = Number(n[3]);
33
+ if (r < 1 || r > 31)
31
34
  return !1;
32
35
  }
33
- if (typeof t[4] !== void 0) {
34
- const a = Number(t[4]);
35
- if (a < 0 || a > 23)
36
+ if (typeof n[4] !== void 0) {
37
+ const r = Number(n[4]);
38
+ if (r < 0 || r > 23)
36
39
  return !1;
37
40
  }
38
41
  return !0;
39
42
  }
40
43
  return !1;
41
44
  }
42
- function Et(e) {
43
- const t = e.match(je);
44
- return t && typeof t[4] > "u" ? e += "T00:00:00" : e;
45
+ function vt(e) {
46
+ const n = e.match(Ve);
47
+ return n && typeof n[4] > "u" ? e += "T00:00:00" : e;
45
48
  }
46
- function $(e) {
49
+ function T(e) {
47
50
  if (e || (e = /* @__PURE__ */ new Date()), e instanceof Date) {
48
- const t = new Date(e);
49
- return t.setMilliseconds(0), t;
51
+ const n = new Date(e);
52
+ return n.setMilliseconds(0), n;
50
53
  }
51
- if (e = e.trim(), yt(e))
52
- return new Date(Et(e));
54
+ if (e = e.trim(), Mt(e))
55
+ return new Date(vt(e));
53
56
  throw new Error(`Non ISO 8601 compliant date (${e}).`);
54
57
  }
55
- function wt(e) {
56
- const t = $(e);
57
- return t.setDate(1), t.setMonth(t.getMonth() + 1), t.setDate(0), t;
58
+ function Et(e) {
59
+ const n = T(e);
60
+ return n.setDate(1), n.setMonth(n.getMonth() + 1), n.setDate(0), n;
58
61
  }
59
- function Ae(e) {
60
- return wt(e).getDate();
62
+ function je(e) {
63
+ return Et(e).getDate();
61
64
  }
62
- var ce = "1999-03-04T02:05:01.000Z", se = /* @__PURE__ */ new Map(), ue = [
65
+ var ie = "1999-03-04T02:05:01.000Z", ae = /* @__PURE__ */ new Map(), ce = [
63
66
  ["YYYY", { year: "numeric" }],
64
67
  ["YY", { year: "2-digit" }],
65
68
  ["MMMM", { month: "long" }],
@@ -77,10 +80,10 @@ var ce = "1999-03-04T02:05:01.000Z", se = /* @__PURE__ */ new Map(), ue = [
77
80
  ["s", { second: "numeric" }],
78
81
  ["ZZ", { timeZoneName: "long" }],
79
82
  ["Z", { timeZoneName: "short" }]
80
- ], me = [
83
+ ], ue = [
81
84
  ["HH", { hour: "2-digit" }],
82
85
  ["H", { hour: "numeric" }]
83
- ], de = [
86
+ ], me = [
84
87
  ["hh", { hour: "2-digit" }],
85
88
  ["h", { hour: "numeric" }],
86
89
  ["a", { dayPeriod: "narrow" }],
@@ -102,19 +105,19 @@ function Le(e) {
102
105
  return 5;
103
106
  throw new Error("Invalid offset format");
104
107
  }
105
- var bt = ["MMMM", "MMM", "dddd", "ddd"], y = /* @__PURE__ */ new Map(
106
- /* @__PURE__ */ [...ue, ...me, ...de].map((e) => [e[0], e])
107
- ), $e = /* @__PURE__ */ new Map(), Ue = [
108
+ var wt = ["MMMM", "MMM", "dddd", "ddd"], v = /* @__PURE__ */ new Map(
109
+ /* @__PURE__ */ [...ce, ...ue, ...me].map((e) => [e[0], e])
110
+ ), xe = /* @__PURE__ */ new Map(), Ae = [
108
111
  "full",
109
112
  "long",
110
113
  "medium",
111
114
  "short"
112
- ], R = (e) => String(e).padStart(2, "0"), oe = (e) => String(e).padStart(2, "0");
113
- function H(e) {
115
+ ], L = (e) => String(e).padStart(2, "0"), se = (e) => String(e).padStart(2, "0");
116
+ function V(e) {
114
117
  return e.type === "literal" && (e.value = e.value.normalize("NFKC")), e;
115
118
  }
116
- function xt(e, t, n, a = !1, r = null) {
117
- const s = $t(e, t, n, a), i = $(e);
119
+ function yt(e, n, t, r = !1, a = null) {
120
+ const s = bt(e, n, t, r), i = T(e);
118
121
  function o({ partName: m, partValue: d, token: l }) {
119
122
  if (m === "literal")
120
123
  return d;
@@ -124,194 +127,194 @@ function xt(e, t, n, a = !1, r = null) {
124
127
  if (["mm", "ss", "MM"].includes(l) && u.length === 1)
125
128
  return `0${u}`;
126
129
  if (m === "dayPeriod") {
127
- const f = B(i.getUTCHours() < 12 ? "am" : "pm", n);
130
+ const f = z(i.getUTCHours() < 12 ? "am" : "pm", t);
128
131
  return l === "A" ? f.toUpperCase() : f.toLowerCase();
129
132
  }
130
- return m === "timeZoneName" ? r ?? We(-1 * i.getTimezoneOffset(), l) : u;
133
+ return m === "timeZoneName" ? a ?? Be(-1 * i.getTimezoneOffset(), l) : u;
131
134
  }
132
- return t.map((m) => ({
135
+ return n.map((m) => ({
133
136
  ...m,
134
137
  value: o(m)
135
138
  }));
136
139
  }
137
- function $t(e, t, n, a = !1) {
138
- const r = $(e), s = t.filter((l) => l.hour12), i = t.filter((l) => !l.hour12), o = [], m = [];
140
+ function bt(e, n, t, r = !1) {
141
+ const a = T(e), s = n.filter((l) => l.hour12), i = n.filter((l) => !l.hour12), o = [], m = [];
139
142
  function d(l, u = !1) {
140
- const f = `${n}-u-hc-${u ? "h12" : "h23"}`;
143
+ const f = `${t}-u-hc-${u ? "h12" : "h23"}`;
141
144
  if (o.push(
142
145
  ...new Intl.DateTimeFormat(
143
146
  f,
144
147
  l.reduce(
145
- (p, h) => h.partName === "literal" ? p : (a && bt.includes(h.token) && m.push(h), Object.assign(p, h.option)),
148
+ (h, p) => p.partName === "literal" ? h : (r && wt.includes(p.token) && m.push(p), Object.assign(h, p.option)),
146
149
  { timeZone: "UTC" }
147
150
  )
148
- ).formatToParts(r).map(H)
149
- ), a && m.length)
150
- for (const p of m) {
151
- let h = [];
152
- switch (p.token) {
151
+ ).formatToParts(a).map(V)
152
+ ), r && m.length)
153
+ for (const h of m) {
154
+ let p = [];
155
+ switch (h.token) {
153
156
  case "MMMM":
154
- h = new Intl.DateTimeFormat(f, {
157
+ p = new Intl.DateTimeFormat(f, {
155
158
  dateStyle: "long",
156
159
  timeZone: "UTC"
157
- }).formatToParts(r).map(H);
160
+ }).formatToParts(a).map(V);
158
161
  break;
159
162
  case "MMM":
160
- h = new Intl.DateTimeFormat(f, {
163
+ p = new Intl.DateTimeFormat(f, {
161
164
  dateStyle: "medium",
162
165
  timeZone: "UTC"
163
- }).formatToParts(r).map(H);
166
+ }).formatToParts(a).map(V);
164
167
  break;
165
168
  }
166
- const M = h.find(
167
- (v) => v.type === p.partName
168
- ), x = o.findIndex((v) => v.type === p.partName);
169
- M && x > -1 && (o[x] = M);
169
+ const w = p.find(
170
+ (M) => M.type === h.partName
171
+ ), k = o.findIndex((M) => M.type === h.partName);
172
+ w && k > -1 && (o[k] = w);
170
173
  }
171
174
  }
172
175
  return s.length && d(s, !0), i.length && d(i), o.reduce((l, u) => (l[u.type] = u.value, l), {});
173
176
  }
174
- function We(e, t = "Z") {
175
- const n = String(Math.floor(Math.abs(e / 60))).padStart(
177
+ function Be(e, n = "Z") {
178
+ const t = String(Math.floor(Math.abs(e / 60))).padStart(
176
179
  2,
177
180
  "0"
178
- ), a = String(Math.abs(e % 60)).padStart(2, "0"), r = e < 0 ? "-" : "+";
179
- return t === "ZZ" ? `${r}${n}${a}` : `${r}${n}:${a}`;
181
+ ), r = String(Math.abs(e % 60)).padStart(2, "0"), a = e < 0 ? "-" : "+";
182
+ return n === "ZZ" ? `${a}${t}${r}` : `${a}${t}:${r}`;
180
183
  }
181
- function Dt(e, t) {
182
- _e(e, t);
183
- const [n, a, r, s] = e.match(
184
+ function xt(e, n) {
185
+ Ue(e, n);
186
+ const [t, r, a, s] = e.match(
184
187
  /([+-])([0-3][0-9]):?([0-6][0-9])/
185
- ), i = Number(r) * 60 + Number(s);
186
- return a === "+" ? i : -i;
188
+ ), i = Number(a) * 60 + Number(s);
189
+ return r === "+" ? i : -i;
187
190
  }
188
- function _e(e, t = "Z") {
189
- if (!((a) => {
190
- switch (a) {
191
+ function Ue(e, n = "Z") {
192
+ if (!((r) => {
193
+ switch (r) {
191
194
  case "Z":
192
195
  return /^([+-])[0-3][0-9]:[0-6][0-9]$/.test(e);
193
196
  case "ZZ":
194
197
  return /^([+-])[0-3][0-9][0-6][0-9]$/.test(e);
195
198
  }
196
- })(t))
199
+ })(n))
197
200
  throw new Error(`Invalid offset: ${e}`);
198
201
  return e;
199
202
  }
200
- function Ct(e) {
201
- return ue.concat(me).concat(de).sort((t, n) => t[0].length > n[0].length ? 1 : -1).reduce((t, n) => t.replace(n[0], `\\${n[0]}`), e);
203
+ function $t(e) {
204
+ return ce.concat(ue).concat(me).sort((n, t) => n[0].length > t[0].length ? 1 : -1).reduce((n, t) => n.replace(t[0], `\\${t[0]}`), e);
202
205
  }
203
- function Tt(e) {
206
+ function Dt(e) {
204
207
  return ["numeric", "2-digit"].includes(e.partValue);
205
208
  }
206
- function Yt(e) {
207
- let t;
208
- for (const n of e) {
209
- if (n.partName === "literal" && !isNaN(parseFloat(n.partValue)))
210
- throw new Error(`Numbers in format (${n.partValue}).`);
211
- if (t && t.partName !== "literal" && n.partName !== "literal" && !(t.token in K) && !(n.token in K) && !(Tt(t) && n.token.toLowerCase() === "a"))
209
+ function Tt(e) {
210
+ let n;
211
+ for (const t of e) {
212
+ if (t.partName === "literal" && !isNaN(parseFloat(t.partValue)))
213
+ throw new Error(`Numbers in format (${t.partValue}).`);
214
+ if (n && n.partName !== "literal" && t.partName !== "literal" && !(n.token in K) && !(t.token in K) && !(Dt(n) && t.token.toLowerCase() === "a"))
212
215
  throw new Error(
213
- `Illegal adjacent tokens (${t.token}, ${n.token})`
216
+ `Illegal adjacent tokens (${n.token}, ${t.token})`
214
217
  );
215
- t = n;
218
+ n = t;
216
219
  }
217
220
  return e;
218
221
  }
219
- function kt(e) {
222
+ function Ct(e) {
220
223
  return typeof e == "string" ? e.includes("ZZ") ? "ZZ" : "Z" : "time" in e && e.time === "full" ? "Z" : "ZZ";
221
224
  }
222
- function B(e, t) {
223
- const n = $e.get(t);
224
- if (n && n[e])
225
- return n[e];
226
- const a = new Date(ce);
227
- a.setUTCHours(e === "am" ? 5 : 20);
228
- const s = new Intl.DateTimeFormat(t, {
225
+ function z(e, n) {
226
+ const t = xe.get(n);
227
+ if (t && t[e])
228
+ return t[e];
229
+ const r = new Date(ie);
230
+ r.setUTCHours(e === "am" ? 5 : 20);
231
+ const s = new Intl.DateTimeFormat(n, {
229
232
  timeStyle: "full",
230
233
  timeZone: "UTC",
231
234
  hour12: !0
232
- }).formatToParts(a).map(H).find((i) => i.type === "dayPeriod");
235
+ }).formatToParts(r).map(V).find((i) => i.type === "dayPeriod");
233
236
  if (s) {
234
- const i = n || {};
235
- return $e.set(
236
- t,
237
+ const i = t || {};
238
+ return xe.set(
239
+ n,
237
240
  Object.assign(i, { [e]: s.value })
238
241
  ), s.value;
239
242
  }
240
243
  return e;
241
244
  }
242
- function Nt(e, t = "+00:00") {
243
- const n = $(e), a = (() => {
244
- switch (Le(t)) {
245
+ function Yt(e, n = "+00:00") {
246
+ const t = T(e), r = (() => {
247
+ switch (Le(n)) {
245
248
  case 5:
246
249
  return "ZZ";
247
250
  case 6:
248
251
  return "Z";
249
252
  }
250
- })(), r = Dt(t, a);
251
- return new Date(n.getTime() + r * 1e3 * 60);
253
+ })(), a = xt(n, r);
254
+ return new Date(t.getTime() + a * 1e3 * 60);
252
255
  }
253
- function ze() {
256
+ function We() {
254
257
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
255
258
  }
256
- function De(e, t) {
257
- const n = new Intl.DateTimeFormat("en-US", {
259
+ function $e(e, n) {
260
+ const t = new Intl.DateTimeFormat("en-US", {
258
261
  year: "numeric",
259
262
  month: "2-digit",
260
263
  day: "2-digit",
261
264
  hour: "2-digit",
262
265
  minute: "2-digit",
263
266
  second: "2-digit",
264
- timeZone: t,
267
+ timeZone: n,
265
268
  hourCycle: "h23"
266
- }).formatToParts(e).map(H), a = {};
267
- return n.forEach((r) => {
268
- a[r.type] = r.value;
269
+ }).formatToParts(e).map(V), r = {};
270
+ return t.forEach((a) => {
271
+ r[a.type] = a.value;
269
272
  }), /* @__PURE__ */ new Date(
270
- `${a.year}-${a.month}-${a.day}T${a.hour}:${a.minute}:${a.second}Z`
273
+ `${r.year}-${r.month}-${r.day}T${r.hour}:${r.minute}:${r.second}Z`
271
274
  );
272
275
  }
273
- function Ce(e, t = "UTC", n = "device", a = "Z") {
274
- var r;
275
- n = n === "device" ? (r = ze()) != null ? r : "utc" : n;
276
- const s = $(e), i = De(s, t), o = De(s, n), m = Math.round(
276
+ function De(e, n = "UTC", t = "device", r = "Z") {
277
+ var a;
278
+ t = t === "device" ? (a = We()) != null ? a : "utc" : t;
279
+ const s = T(e), i = $e(s, n), o = $e(s, t), m = Math.round(
277
280
  (o.getTime() - i.getTime()) / 1e3 / 60
278
281
  );
279
- return We(m, a);
282
+ return Be(m, r);
280
283
  }
281
- function fe(e, t) {
282
- if (Ue.includes(e) || typeof e == "object")
283
- return Ft(e, t);
284
- let n = e, a = 0;
285
- const r = (l) => {
286
- if (l[2] || (l[2] = new RegExp(`(.)?(${l[0]})`, "g")), l[2].test(n)) {
284
+ function de(e, n) {
285
+ if (Ae.includes(e) || typeof e == "object")
286
+ return kt(e, n);
287
+ let t = e, r = 0;
288
+ const a = (l) => {
289
+ if (l[2] || (l[2] = new RegExp(`(.)?(${l[0]})`, "g")), l[2].test(t)) {
287
290
  let u = 0;
288
- return n = n.replace(l[2], (f, p, h) => p === "\\" ? h : `${typeof p == "string" ? p : ""}{!${u++ ? a : a++}!}`), !!u;
291
+ return t = t.replace(l[2], (f, h, p) => h === "\\" ? p : `${typeof h == "string" ? h : ""}{!${u++ ? r : r++}!}`), !!u;
289
292
  }
290
293
  return !1;
291
294
  };
292
295
  function s(l) {
293
- const u = l.map((p) => p.partName), f = new Set(u);
296
+ const u = l.map((h) => h.partName), f = new Set(u);
294
297
  if (u.length > f.size)
295
298
  throw new Error("Cannot reuse format tokens.");
296
299
  return l;
297
300
  }
298
- function i(l, [u, f, p]) {
299
- const h = Object.keys(f)[0], M = f[h];
301
+ function i(l, [u, f, h]) {
302
+ const p = Object.keys(f)[0], w = f[p];
300
303
  return {
301
304
  option: f,
302
- partName: h,
303
- partValue: M,
305
+ partName: p,
306
+ partValue: w,
304
307
  token: u,
305
- pattern: p,
308
+ pattern: h,
306
309
  hour12: l
307
310
  };
308
311
  }
309
- const o = ue.filter(r).concat(me.filter(r)).map(i.bind(null, !1)), m = s(
312
+ const o = ce.filter(a).concat(ue.filter(a)).map(i.bind(null, !1)), m = s(
310
313
  o.concat(
311
- de.filter(r).map(i.bind(null, !0))
314
+ me.filter(a).map(i.bind(null, !0))
312
315
  )
313
316
  ), d = /^\{!(\d+)!\}$/;
314
- return n.split(/(\{!\d+!\})/).map((l) => {
317
+ return t.split(/(\{!\d+!\})/).map((l) => {
315
318
  const u = l.match(d);
316
319
  return u ? m[Number(u[1])] : {
317
320
  option: { literal: l },
@@ -323,19 +326,19 @@ function fe(e, t) {
323
326
  };
324
327
  }).filter((l) => !(l.partName === "literal" && l.partValue === ""));
325
328
  }
326
- function Ft(e, t) {
327
- const n = {
329
+ function kt(e, n) {
330
+ const t = {
328
331
  timeZone: "UTC"
329
332
  };
330
- typeof e == "string" ? n.dateStyle = e : ("date" in e && (n.dateStyle = e.date), "time" in e && (n.timeStyle = e.time));
331
- const a = new Intl.DateTimeFormat(t, n), r = a.formatToParts(new Date(ce)).map(H), i = a.formatToParts(/* @__PURE__ */ new Date("1999-04-05T23:05:01.000Z")).map(H).find((m) => m.type === "hour"), o = i && i.value === "23" ? 24 : 12;
332
- return r.map((m) => {
333
- const d = m.type, l = Pt(
333
+ typeof e == "string" ? t.dateStyle = e : ("date" in e && (t.dateStyle = e.date), "time" in e && (t.timeStyle = e.time));
334
+ const r = new Intl.DateTimeFormat(n, t), a = r.formatToParts(new Date(ie)).map(V), i = r.formatToParts(/* @__PURE__ */ new Date("1999-04-05T23:05:01.000Z")).map(V).find((m) => m.type === "hour"), o = i && i.value === "23" ? 24 : 12;
335
+ return a.map((m) => {
336
+ const d = m.type, l = Nt(
334
337
  m.type,
335
338
  m.value,
336
- t,
339
+ n,
337
340
  m.type === "hour" ? o : void 0,
338
- n
341
+ t
339
342
  );
340
343
  if (l === void 0)
341
344
  return;
@@ -351,178 +354,178 @@ function Ft(e, t) {
351
354
  };
352
355
  }).filter((m) => !!m);
353
356
  }
354
- function Pt(e, t, n, a, r) {
355
- const s = t.length, i = !isNaN(Number(t));
357
+ function Nt(e, n, t, r, a) {
358
+ const s = n.length, i = !isNaN(Number(n));
356
359
  let o;
357
360
  switch (e) {
358
361
  case "year":
359
- return s === 2 ? y.get("YY") : y.get("YYYY");
362
+ return s === 2 ? v.get("YY") : v.get("YYYY");
360
363
  case "month":
361
364
  if (i)
362
- return s === 1 ? y.get("M") : y.get("MM");
363
- switch (o = Te(n, e, t), o) {
365
+ return s === 1 ? v.get("M") : v.get("MM");
366
+ switch (o = Te(t, e, n), o) {
364
367
  case "long":
365
- return y.get("MMMM");
368
+ return v.get("MMMM");
366
369
  default:
367
- return y.get("MMM");
370
+ return v.get("MMM");
368
371
  }
369
372
  case "day":
370
- return s === 1 ? y.get("D") : y.get("DD");
373
+ return s === 1 ? v.get("D") : v.get("DD");
371
374
  case "weekday":
372
- switch (o = Te(n, e, t), o) {
375
+ switch (o = Te(t, e, n), o) {
373
376
  case "narrow":
374
- return y.get("d");
377
+ return v.get("d");
375
378
  case "short":
376
- return y.get("ddd");
379
+ return v.get("ddd");
377
380
  default:
378
- return y.get("dddd");
381
+ return v.get("dddd");
379
382
  }
380
383
  case "hour":
381
- return a === 12 ? s === 1 ? y.get("h") : y.get("hh") : s === 1 ? y.get("H") : y.get("HH");
384
+ return r === 12 ? s === 1 ? v.get("h") : v.get("hh") : s === 1 ? v.get("H") : v.get("HH");
382
385
  case "minute":
383
- return s === 1 ? y.get("m") : y.get("mm");
386
+ return s === 1 ? v.get("m") : v.get("mm");
384
387
  case "second":
385
- return s === 1 ? y.get("s") : y.get("ss");
388
+ return s === 1 ? v.get("s") : v.get("ss");
386
389
  case "dayPeriod":
387
- return /^[A-Z]+$/u.test(t) ? y.get("A") : y.get("a");
390
+ return /^[A-Z]+$/u.test(n) ? v.get("A") : v.get("a");
388
391
  case "literal":
389
- return [t, { literal: t }, new RegExp("")];
392
+ return [n, { literal: n }, new RegExp("")];
390
393
  case "timeZoneName":
391
- return r.timeStyle === "full" ? y.get("Z") : y.get("ZZ");
394
+ return a.timeStyle === "full" ? v.get("Z") : v.get("ZZ");
392
395
  default:
393
396
  return;
394
397
  }
395
398
  }
396
- function Te(e, t, n) {
397
- if (!se.has(e)) {
398
- const r = new Date(ce), s = [3, 8, 9, 7, 6, 4, 3], i = ["weekday", "month", "dayPeriod"], o = ["long", "short", "narrow"], m = {};
399
+ function Te(e, n, t) {
400
+ if (!ae.has(e)) {
401
+ const a = new Date(ie), s = [3, 8, 9, 7, 6, 4, 3], i = ["weekday", "month", "dayPeriod"], o = ["long", "short", "narrow"], m = {};
399
402
  for (let d = 0; d < 12; d++) {
400
- r.setMonth(0 + d), d in s && r.setDate(s[d]), r.setUTCHours(8 + d);
403
+ a.setMonth(0 + d), d in s && a.setDate(s[d]), a.setUTCHours(8 + d);
401
404
  for (const l of o) {
402
405
  const u = new Intl.DateTimeFormat(
403
406
  e,
404
407
  i.reduce(
405
- (f, p) => Object.assign(f, { [p]: l }),
408
+ (f, h) => Object.assign(f, { [h]: l }),
406
409
  { hour12: !0, timeZone: "UTC" }
407
410
  )
408
- ).formatToParts(r).map(H);
411
+ ).formatToParts(a).map(V);
409
412
  if (l === "long" || l === "short") {
410
- const p = new Intl.DateTimeFormat(e, {
413
+ const h = new Intl.DateTimeFormat(e, {
411
414
  dateStyle: l === "short" ? "medium" : "long",
412
415
  timeZone: "UTC"
413
- }).formatToParts(r).map(H).find(
414
- (M) => M.type === "month"
415
- ), h = u.findIndex((M) => M.type === "month");
416
- h > -1 && p && (u[h] = p);
416
+ }).formatToParts(a).map(V).find(
417
+ (w) => w.type === "month"
418
+ ), p = u.findIndex((w) => w.type === "month");
419
+ p > -1 && h && (u[p] = h);
417
420
  }
418
421
  u.forEach((f) => {
419
422
  if (f.type === "literal")
420
423
  return;
421
- const p = f.type;
422
- m[p] = Object.assign(m[p] || {}, {
424
+ const h = f.type;
425
+ m[h] = Object.assign(m[h] || {}, {
423
426
  [f.value]: l
424
427
  });
425
428
  });
426
429
  }
427
430
  }
428
- se.set(e, m);
431
+ ae.set(e, m);
429
432
  }
430
- const a = se.get(e);
431
- return a ? a[t][n] : void 0;
433
+ const r = ae.get(e);
434
+ return r ? r[n][t] : void 0;
432
435
  }
433
- function St(e, t = "+00:00") {
434
- const n = t.slice(0, 1) === "+";
435
- return Nt(
436
+ function Ft(e, n = "+00:00") {
437
+ const t = n.slice(0, 1) === "+";
438
+ return Yt(
436
439
  e,
437
- t.replace(n ? "+" : "-", n ? "-" : "+")
440
+ n.replace(t ? "+" : "-", t ? "-" : "+")
438
441
  );
439
442
  }
440
- function It() {
443
+ function St() {
441
444
  return Intl.DateTimeFormat().resolvedOptions().locale;
442
445
  }
443
- function P(e, t = "long", n = "device", a = !1, r) {
446
+ function Z(e, n = "long", t = "device", r = !1, a) {
444
447
  let s, i;
445
448
  return typeof e == "object" && !(e instanceof Date) && ({
446
449
  date: e,
447
- format: t,
448
- locale: n,
449
- genitive: a,
450
- partFilter: r,
450
+ format: n,
451
+ locale: t,
452
+ genitive: r,
453
+ partFilter: a,
451
454
  tz: s
452
- } = e), t === "ISO8601" ? $(e).toISOString() : (s && (i = Ce(e, "utc", s, kt(t))), s ?? (s = ze()), (s == null ? void 0 : s.toLowerCase()) !== "utc" && (e = St(
455
+ } = e), n === "ISO8601" ? T(e).toISOString() : (s && (i = De(e, "utc", s, Ct(n))), s ?? (s = We()), (s == null ? void 0 : s.toLowerCase()) !== "utc" && (e = Ft(
453
456
  e,
454
- Ce(e, s, "utc")
455
- )), (!n || n === "device") && (n = It()), xt(
457
+ De(e, s, "utc")
458
+ )), (!t || t === "device") && (t = St()), yt(
456
459
  e,
457
- fe(t, n).filter(r ?? (() => !0)),
458
- n,
459
- a,
460
+ de(n, t).filter(a ?? (() => !0)),
461
+ t,
462
+ r,
460
463
  i
461
464
  ).map((o) => o.value).join(""));
462
465
  }
463
- function Zt(e, t = "en", n = !1, a = () => !0) {
464
- return fe(e, t).filter(a).reduce(
465
- (r, s) => r += n && s.partName === "literal" ? Ct(s.token) : s.token,
466
+ function It(e, n = "en", t = !1, r = () => !0) {
467
+ return de(e, n).filter(r).reduce(
468
+ (a, s) => a += t && s.partName === "literal" ? $t(s.token) : s.token,
466
469
  ""
467
470
  ).normalize("NFKC");
468
471
  }
469
- function Ht(e) {
470
- const t = (/* @__PURE__ */ new Date()).getFullYear(), n = t % 100, a = Math.floor(t / 100), r = Number(e);
471
- return (a + (r > n + 20 ? -1 : 0)) * 100 + r;
472
+ function Pt(e) {
473
+ const n = (/* @__PURE__ */ new Date()).getFullYear(), t = n % 100, r = Math.floor(n / 100), a = Number(e);
474
+ return (r + (a > t + 20 ? -1 : 0)) * 100 + a;
472
475
  }
473
- function Be(e, t = "en", n = !1) {
474
- const a = (r, s) => Array(r).fill("").map((i, o) => `${s(o)}`);
476
+ function _e(e, n = "en", t = !1) {
477
+ const r = (a, s) => Array(a).fill("").map((i, o) => `${s(o)}`);
475
478
  if (e === "M")
476
- return a(12, (r) => r + 1);
479
+ return r(12, (a) => a + 1);
477
480
  if (e === "MM")
478
- return a(12, (r) => {
479
- const s = r + 1;
481
+ return r(12, (a) => {
482
+ const s = a + 1;
480
483
  return s < 10 ? `0${s}` : s;
481
484
  });
482
485
  if (e.startsWith("M"))
483
- return Be("MM").map(
484
- (r) => P(`2000-${r}-05`, e, t, n)
486
+ return _e("MM").map(
487
+ (a) => Z(`2000-${a}-05`, e, n, t)
485
488
  );
486
489
  if (e.startsWith("d"))
487
- return a(7, (r) => `0${r + 2}`).map(
488
- (r) => P(`2022-10-${r}`, e, t)
490
+ return r(7, (a) => `0${a + 2}`).map(
491
+ (a) => Z(`2022-10-${a}`, e, n)
489
492
  );
490
493
  if (e === "a")
491
- return [B("am", t).toLowerCase(), B("pm", t).toLowerCase()];
494
+ return [z("am", n).toLowerCase(), z("pm", n).toLowerCase()];
492
495
  if (e === "A")
493
- return [B("am", t).toUpperCase(), B("pm", t).toUpperCase()];
496
+ return [z("am", n).toUpperCase(), z("pm", n).toUpperCase()];
494
497
  if (e.startsWith("Y")) {
495
- const r = (/* @__PURE__ */ new Date()).getFullYear();
496
- return a(120, (s) => s + 1).reduce(
497
- (s, i) => (i !== "120" && s.push(P(`${r + Number(i)}-06-06`, e, t)), s.unshift(P(`${r - Number(i)}-06-06`, e, t)), s),
498
- [P(`${r}-06-06`, e, t)]
498
+ const a = (/* @__PURE__ */ new Date()).getFullYear();
499
+ return r(120, (s) => s + 1).reduce(
500
+ (s, i) => (i !== "120" && s.push(Z(`${a + Number(i)}-06-06`, e, n)), s.unshift(Z(`${a - Number(i)}-06-06`, e, n)), s),
501
+ [Z(`${a}-06-06`, e, n)]
499
502
  );
500
503
  }
501
- return e.startsWith("D") ? a(31, (r) => `${e === "DD" && r < 9 ? "0" : ""}${r + 1}`) : e.startsWith("H") ? a(24, (r) => `${e === "HH" && r < 10 ? "0" : ""}${r}`) : e.startsWith("h") ? a(12, (r) => `${e === "hh" && r < 9 ? "0" : ""}${r + 1}`) : e.startsWith("m") || e.startsWith("s") ? a(60, (r) => `${e.length > 1 && r < 10 ? "0" : ""}${r}`) : [];
504
+ return e.startsWith("D") ? r(31, (a) => `${e === "DD" && a < 9 ? "0" : ""}${a + 1}`) : e.startsWith("H") ? r(24, (a) => `${e === "HH" && a < 10 ? "0" : ""}${a}`) : e.startsWith("h") ? r(12, (a) => `${e === "hh" && a < 9 ? "0" : ""}${a + 1}`) : e.startsWith("m") || e.startsWith("s") ? r(60, (a) => `${e.length > 1 && a < 10 ? "0" : ""}${a}`) : [];
502
505
  }
503
- function A(e, t = "ISO8601", n = "device") {
504
- let a = () => !0, r, s = "backward";
506
+ function A(e, n = "ISO8601", t = "device") {
507
+ let r = () => !0, a, s = "backward";
505
508
  if (typeof e == "object" ? {
506
- date: r,
507
- format: t = "ISO8601",
508
- locale: n = "device",
509
+ date: a,
510
+ format: n = "ISO8601",
511
+ locale: t = "device",
509
512
  dateOverflow: s = "backward",
510
- partFilter: a = () => !0
511
- } = e : r = e, !r)
513
+ partFilter: r = () => !0
514
+ } = e : a = e, !a)
512
515
  throw new Error("parse() requires a date string.");
513
516
  const i = () => {
514
517
  throw new Error(
515
- `Date (${r}) does not match format (${Zt(t, n)})`
518
+ `Date (${a}) does not match format (${It(n, t)})`
516
519
  );
517
520
  };
518
- if (t === "ISO8601")
519
- return $(r);
520
- const o = Ue.includes(t) || typeof t == "object", m = Yt(fe(t, n).filter(a));
521
+ if (n === "ISO8601")
522
+ return T(a);
523
+ const o = Ae.includes(n) || typeof n == "object", m = Tt(de(n, t).filter(r));
521
524
  if (!m.length)
522
525
  throw new Error("parse() requires a pattern.");
523
526
  let d;
524
527
  try {
525
- d = Vt(r, m);
528
+ d = Zt(a, m);
526
529
  } catch {
527
530
  return i();
528
531
  }
@@ -534,295 +537,297 @@ function A(e, t = "ISO8601", n = "device") {
534
537
  ["mm", 0],
535
538
  ["ss", 0]
536
539
  ]);
537
- let f = null, p = "";
538
- d.forEach((w) => {
539
- if (w.partName === "literal")
540
+ let f = null, h = "";
541
+ d.forEach((y) => {
542
+ if (y.partName === "literal")
540
543
  return;
541
- if (w.token === w.value)
544
+ if (y.token === y.value)
542
545
  return i();
543
- const W = Number(w.value);
544
- if (u.has(w.token))
545
- u.set(w.token, W);
546
- else if (w.token === "YY")
547
- u.set("YYYY", Ht(w.value));
546
+ const q = Number(y.value);
547
+ if (u.has(y.token))
548
+ u.set(y.token, q);
549
+ else if (y.token === "YY")
550
+ u.set("YYYY", Pt(y.value));
548
551
  else {
549
- const C = w.token;
550
- if (C.startsWith("d"))
552
+ const D = y.token;
553
+ if (D.startsWith("d"))
551
554
  return;
552
- if (C === "D")
553
- u.set("DD", W);
554
- else if (C === "H" || C.startsWith("h"))
555
- u.set("HH", W);
556
- else if (C === "M")
557
- u.set("MM", W);
558
- else if (C === "a" || C === "A")
559
- f = w.value.toLowerCase() === B("am", n).toLowerCase();
560
- else if (C === "Z" || C === "ZZ")
561
- p = _e(w.value, C);
555
+ if (D === "D")
556
+ u.set("DD", q);
557
+ else if (D === "H" || D.startsWith("h"))
558
+ u.set("HH", q);
559
+ else if (D === "M")
560
+ u.set("MM", q);
561
+ else if (D === "a" || D === "A")
562
+ f = y.value.toLowerCase() === z("am", t).toLowerCase();
563
+ else if (D === "Z" || D === "ZZ")
564
+ h = Ue(y.value, D);
562
565
  else {
563
- const J = Be(C, n, o).indexOf(w.value);
564
- if (J !== -1)
565
- switch (C) {
566
+ const W = _e(D, t, o).indexOf(y.value);
567
+ if (W !== -1)
568
+ switch (D) {
566
569
  case "MMM":
567
570
  case "MMMM":
568
- u.set("MM", J + 1);
571
+ u.set("MM", W + 1);
569
572
  break;
570
573
  }
571
574
  }
572
575
  }
573
576
  });
574
- let h = u.get("HH") || 0;
575
- f === !1 ? (h += h === 12 ? 0 : 12, u.set("HH", h === 24 ? 0 : h)) : f === !0 && h === 12 && u.set("HH", 0), u.set("MM", (u.get("MM") || 1) - 1);
576
- let [M, x, v, N, L, T] = Array.from(u.values());
577
- const I = Ae(/* @__PURE__ */ new Date(`${oe(M)}-${R(x + 1)}-10`));
578
- if (I < v && s === "throw")
579
- throw new Error(`Invalid date ${oe(M)}-${R(x + 1)}-${R(v)}`);
580
- v = s === "backward" ? Math.min(v, I) : v;
581
- const U = `${oe(M)}-${R(x + 1)}-${R(v)}T${R(N)}:${R(
582
- L
583
- )}:${R(T)}${p}`, G = new Date(U);
584
- return isFinite(+G) ? G : i();
577
+ let p = u.get("HH") || 0;
578
+ f === !1 ? (p += p === 12 ? 0 : 12, u.set("HH", p === 24 ? 0 : p)) : f === !0 && p === 12 && u.set("HH", 0), u.set("MM", (u.get("MM") || 1) - 1);
579
+ let [w, k, M, Y, x, $] = Array.from(u.values());
580
+ const N = je(/* @__PURE__ */ new Date(`${se(w)}-${L(k + 1)}-10`));
581
+ if (N < M && s === "throw")
582
+ throw new Error(`Invalid date ${se(w)}-${L(k + 1)}-${L(M)}`);
583
+ M = s === "backward" ? Math.min(M, N) : M;
584
+ const U = `${se(w)}-${L(k + 1)}-${L(M)}T${L(Y)}:${L(
585
+ x
586
+ )}:${L($)}${h}`, F = new Date(U);
587
+ return isFinite(+F) ? F : i();
585
588
  }
586
- function Vt(e, t) {
587
- let n = 0;
588
- const a = (o) => [
589
- o[n++],
590
- o[n]
589
+ function Zt(e, n) {
590
+ let t = 0;
591
+ const r = (o) => [
592
+ o[t++],
593
+ o[t]
591
594
  ];
592
- let r = 0;
595
+ let a = 0;
593
596
  const s = [];
594
597
  let i;
595
598
  do {
596
- const [o, m] = a(t);
599
+ const [o, m] = r(n);
597
600
  i = m;
598
601
  let d = 1;
599
602
  if (o.partName === "literal")
600
603
  d = o.partValue.length;
601
604
  else if (o.partName === "timeZoneName")
602
- d = Le(e.substring(r));
605
+ d = Le(e.substring(a));
603
606
  else if (o.token in K)
604
607
  d = K[o.token];
605
608
  else if (m)
606
609
  if (m.partName === "literal") {
607
- if (d = e.indexOf(m.partValue, r) - r, d < 0)
610
+ if (d = e.indexOf(m.partValue, a) - a, d < 0)
608
611
  throw new Error();
609
612
  } else if (m.partName === "dayPeriod") {
610
613
  for (let l = 1; l <= 4; l++)
611
- if (isNaN(Number(e.charAt(r + l)))) {
614
+ if (isNaN(Number(e.charAt(a + l)))) {
612
615
  d = l;
613
616
  break;
614
617
  }
615
618
  } else {
616
- const l = e.substring(r).search(/\d/);
617
- l !== -1 && (d = r + l);
619
+ const l = e.substring(a).search(/\d/);
620
+ l !== -1 && (d = a + l);
618
621
  }
619
622
  else
620
623
  d = e.length;
621
- s.push({ ...o, value: e.substring(r, r + d) }), r += d;
624
+ s.push({ ...o, value: e.substring(a, a + d) }), a += d;
622
625
  } while (i);
623
626
  return s;
624
627
  }
625
- function Rt(e, t) {
626
- const n = $(e), a = $(t);
627
- return +n > +a;
628
+ function Ht(e, n) {
629
+ const t = T(e), r = T(n);
630
+ return +t > +r;
628
631
  }
629
- function jt(e, t) {
630
- const n = $(e), a = $(t);
631
- return +n == +a;
632
+ function Rt(e, n) {
633
+ const t = T(e), r = T(n);
634
+ return +t == +r;
632
635
  }
633
- function he(e, t) {
634
- const n = $(e), a = $(t);
635
- return +n - +a;
636
+ function fe(e, n) {
637
+ const t = T(e), r = T(n);
638
+ return +t - +r;
636
639
  }
637
- function ge(e, t = "trunc") {
638
- const n = Math[t](e);
639
- return n == 0 ? 0 : n;
640
+ function he(e, n = "trunc") {
641
+ const t = Math[n](e);
642
+ return t == 0 ? 0 : t;
640
643
  }
641
- function At(e, t, n) {
642
- return ge(he(e, t) / 1e3, n);
644
+ function Vt(e, n, t) {
645
+ return he(fe(e, n) / 6e4, t);
643
646
  }
644
- function Lt(e, t, n) {
645
- return ge(
646
- he(e, t) / 36e5,
647
+ function jt(e, n, t) {
648
+ return he(
649
+ fe(e, n) / 36e5,
647
650
  // 1000 * 60 * 60
648
- n
651
+ t
649
652
  );
650
653
  }
651
- function Ut(e, t, n) {
652
- return ge(
653
- he(e, t) / 864e5,
654
+ function Lt(e, n, t) {
655
+ return he(
656
+ fe(e, n) / 864e5,
654
657
  // hour * 24
655
- n
658
+ t
656
659
  );
657
660
  }
658
- function pe(e, t) {
659
- const n = $(e), a = $(t);
660
- if (n < a) {
661
- const o = pe(a, n);
661
+ function ge(e, n) {
662
+ const t = T(e), r = T(n);
663
+ if (t < r) {
664
+ const o = ge(r, t);
662
665
  return o == 0 ? 0 : -o;
663
666
  }
664
- let r = (n.getFullYear() - a.getFullYear()) * 12 + (n.getMonth() - a.getMonth());
665
- const s = n.getDate(), i = a.getDate();
667
+ let a = (t.getFullYear() - r.getFullYear()) * 12 + (t.getMonth() - r.getMonth());
668
+ const s = t.getDate(), i = r.getDate();
666
669
  if (s < i) {
667
- const o = Ae(n);
668
- o == s && o < i || r--;
670
+ const o = je(t);
671
+ o == s && o < i || a--;
669
672
  }
670
- return r == 0 ? 0 : r;
673
+ return a == 0 ? 0 : a;
671
674
  }
672
- function Wt(e, t) {
673
- const n = Math.trunc(pe(e, t) / 12);
674
- return n == 0 ? 0 : n;
675
+ function At(e, n) {
676
+ const t = Math.trunc(ge(e, n) / 12);
677
+ return t == 0 ? 0 : t;
675
678
  }
676
- const Kt = ({
677
- rows: e,
678
- columns: t,
679
- showFilter: n = !0,
680
- loading: a = !1,
681
- keyRow: r = "id",
682
- defaultSelectedKeys: s = [],
683
- itemsName: i,
684
- selectionMode: o,
685
- inputSearch: m,
686
- showHandlePaginate: d = !0,
687
- extraTopContent: l,
688
- cellClass: u,
689
- onSelect: f,
690
- defaultPaginateNumber: p = 10,
691
- optionsPaginateNumber: h = [5, 10, 15],
692
- ...M
679
+ const Bt = () => /* @__PURE__ */ c.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "size-5" }, /* @__PURE__ */ c.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z" })), Xt = ({
680
+ hideFilterSearch: e,
681
+ loading: n,
682
+ isVirtualized: t,
683
+ onSelect: r,
684
+ selectionMode: a,
685
+ inputSearch: s,
686
+ hideRowsPerPageOptions: i,
687
+ extraTopContent: o,
688
+ cellClass: m,
689
+ rows: d = [],
690
+ columns: l = [],
691
+ keyRow: u = "id",
692
+ itemsName: f = "datos",
693
+ rowsPerPageOptions: h = { default: 10, options: [5, 10, 15] },
694
+ ...p
693
695
  }) => {
694
- const [x, v] = j(""), [N, L] = j(h.includes(p) ? p : h[0]), [T, I] = j(1), [U, G] = j(new Set(s)), [w, W] = j({ column: "", direction: "ascending" }), re = !!vt(x, 500), J = Z((g) => {
695
- if (G(g), !f || o === "none") return;
696
+ const [w, k] = B(""), [M, Y] = B(h.default), [x, $] = B(1), [N, U] = B(/* @__PURE__ */ new Set()), [F, y] = B({ column: "", direction: "ascending" });
697
+ ne(() => {
698
+ $(1), U(/* @__PURE__ */ new Set());
699
+ }, [d]);
700
+ const D = !!pt(w, 500), pe = R((g) => {
701
+ U(g);
696
702
  let b = [];
697
- return o === "single" ? b = e.find((E) => E[r] == [...g][0]) : g === "all" ? (b = e, G(new Set(e.map((E) => E[r])))) : b = e.filter((E) => [...g].includes(E[r])), f(b);
698
- }, [f, e, o, r]), ae = F(() => {
699
- let g = [...e];
700
- return re && (g = g.filter(
703
+ a === "single" ? b = d.find((E) => E[u] == [...g][0]) : g === "all" ? (b = d, U(new Set(d.map((E) => E[u])))) : b = d.filter((E) => [...g].includes(E[u])), r && r(b);
704
+ }, [r, d, a, u]), W = P(() => {
705
+ let g = [...d];
706
+ return D && (g = g.filter(
701
707
  (b) => Object.values(b).some(
702
- (E, Y) => {
703
- const S = Object.keys(b)[Y];
704
- return !t.map((V) => V.key).includes(S) || E == null || !E ? !1 : E.toString().toLowerCase().includes(x.toLowerCase());
708
+ (E, S) => {
709
+ const H = Object.keys(b)[S];
710
+ return !l.map((j) => j.key).includes(H) || E == null || !E ? !1 : E.toString().toLowerCase().includes(w.toLowerCase());
705
711
  }
706
712
  )
707
713
  )), g;
708
- }, [x, re, e, t]), _ = Math.ceil(ae.length / N) || 1, Me = F(() => [...ae].sort((g, b) => {
709
- const E = g[w.column], Y = b[w.column];
710
- let S = 0;
711
- if (!E && !Y && (S = 0), E || (S = -1), Y || (S = 1), typeof E == "number" && typeof Y == "number" && (S = E - Y), typeof E == "string" && typeof Y == "string") {
712
- const z = t.find((V) => V.key === w.column);
713
- if (E && Y && (z != null && z.dateFormat))
714
+ }, [w, D, d, l]), _ = Math.ceil(W.length / M) || 1, re = P(() => [...W].sort((g, b) => {
715
+ const E = g[F.column], S = b[F.column];
716
+ let H = 0;
717
+ if (!E && !S && (H = 0), E || (H = -1), S || (H = 1), typeof E == "number" && typeof S == "number" && (H = E - S), typeof E == "string" && typeof S == "string") {
718
+ const O = l.find((j) => j.key === F.column);
719
+ if (E && S && (O != null && O.dateFormat))
714
720
  try {
715
- const V = A(E, z.dateFormat), xe = A(Y, z.dateFormat);
716
- S = V > xe ? 1 : V < xe ? -1 : 0;
717
- } catch (V) {
718
- console.warn("date format is not correct", V);
721
+ const j = A(E, O.dateFormat), be = A(S, O.dateFormat);
722
+ H = j > be ? 1 : j < be ? -1 : 0;
723
+ } catch (j) {
724
+ console.warn("date format is not correct", j);
719
725
  }
720
726
  else
721
- S = E.localeCompare(Y);
727
+ H = E.localeCompare(S);
722
728
  }
723
- return w.direction === "descending" ? -S : S;
724
- }), [w, ae, t]), Oe = F(() => {
725
- const g = (T - 1) * N, b = g + N;
726
- return Me.slice(g, b);
727
- }, [Me, T, N]), ve = Z(() => {
728
- v(""), I(1);
729
- }, []), ye = Z(() => {
730
- T < _ && I(T + 1);
731
- }, [T, _]), Ee = Z(() => {
732
- T > 1 && I(T - 1);
733
- }, [T]), we = Z((g) => {
734
- L(Number(g.target.value)), I(1);
735
- }, []), be = Z((g) => {
736
- g ? (v(g), I(1)) : v("");
737
- }, []), Ge = Z((g, b) => {
738
- const E = t.find((Y) => Y.key === b);
729
+ return F.direction === "descending" ? -H : H;
730
+ }), [F, W, l]), Oe = P(() => {
731
+ if (t) return re;
732
+ const g = (x - 1) * M, b = g + M;
733
+ return re.slice(g, b);
734
+ }, [re, x, M, t]), Me = R(() => {
735
+ k(""), $(1);
736
+ }, []), ve = R(() => {
737
+ x < _ && $(x + 1);
738
+ }, [x, _]), Ee = R(() => {
739
+ x > 1 && $(x - 1);
740
+ }, [x]), we = R((g) => {
741
+ Y(Number(g.target.value)), $(1);
742
+ }, []), ye = R((g) => {
743
+ g ? (k(g), $(1)) : k("");
744
+ }, []), ze = R((g, b) => {
745
+ const E = l.find((S) => S.key === b);
739
746
  return E.format ? /* @__PURE__ */ c.createElement("div", null, E.format({
740
747
  value: g[b],
741
748
  row: g
742
749
  })) : /* @__PURE__ */ c.createElement("p", { title: g[b] }, g[b]);
743
- }, [t]), qe = F(() => /* @__PURE__ */ c.createElement("div", { className: "py-2 px-2 flex justify-between items-center" }, /* @__PURE__ */ c.createElement("span", { className: "w-[30%] text-small text-default-400" }, [...U].length > 0 && /* @__PURE__ */ c.createElement(c.Fragment, null, [...U].length, " ", [...U].length === 1 ? "fila seleccionada" : "filas seleccionadas")), /* @__PURE__ */ c.createElement(
744
- Xe,
750
+ }, [l]), Ge = P(() => /* @__PURE__ */ c.createElement("div", { className: "py-2 px-2 mt-2 flex justify-between items-center" }, /* @__PURE__ */ c.createElement("span", { className: "w-[30%] text-small text-default-400" }, [...N].length > 0 && /* @__PURE__ */ c.createElement(c.Fragment, null, [...N].length, " ", [...N].length === 1 ? "fila seleccionada" : "filas seleccionadas")), !t && /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement(
751
+ Qe,
745
752
  {
746
753
  isCompact: !0,
747
754
  showControls: !0,
748
755
  showShadow: !0,
749
- page: T,
756
+ page: x,
750
757
  total: _,
751
- onChange: I,
752
- color: M.color
758
+ onChange: $,
759
+ color: p.color
753
760
  }
754
- ), /* @__PURE__ */ c.createElement("div", { className: "hidden sm:flex w-[30%] justify-end gap-2" }, /* @__PURE__ */ c.createElement(Q, { isDisabled: _ === 1, size: "sm", variant: "flat", onPress: Ee }, "Atrás"), /* @__PURE__ */ c.createElement(Q, { isDisabled: _ === 1, size: "sm", variant: "flat", onPress: ye }, "Siguiente"))), [T, _, ye, Ee, U, M.color]), Je = F(() => /* @__PURE__ */ c.createElement("div", { className: "flex flex-col gap-4 relative" }, /* @__PURE__ */ c.createElement("div", { className: "flex justify-between gap-3 items-end" }, n && /* @__PURE__ */ c.createElement(
755
- He,
761
+ ), /* @__PURE__ */ c.createElement("div", { className: "hidden sm:flex w-[30%] justify-end gap-2" }, /* @__PURE__ */ c.createElement(Q, { isDisabled: _ === 1, size: "sm", variant: "flat", onPress: Ee }, "Atrás"), /* @__PURE__ */ c.createElement(Q, { isDisabled: _ === 1, size: "sm", variant: "flat", onPress: ve }, "Siguiente")))), [x, _, ve, Ee, N, p.color, t]), qe = P(() => /* @__PURE__ */ c.createElement("div", { className: "flex flex-col gap-4 relative pb-2" }, /* @__PURE__ */ c.createElement("div", { className: "flex justify-between gap-3 items-end" }, !e && /* @__PURE__ */ c.createElement(
762
+ Ze,
756
763
  {
757
- ...m,
758
- className: (m == null ? void 0 : m.className) ?? "w-full sm:max-w-[44%]",
759
- placeholder: (m == null ? void 0 : m.placeholder) ?? "Buscar...",
760
- value: x,
761
- onClear: () => ve(),
762
- onValueChange: be,
764
+ ...s,
765
+ className: (s == null ? void 0 : s.className) ?? "w-full sm:max-w-[44%]",
766
+ placeholder: (s == null ? void 0 : s.placeholder) ?? "Buscar...",
767
+ startContent: /* @__PURE__ */ c.createElement(Bt, null),
768
+ value: w,
769
+ onClear: () => Me(),
770
+ onValueChange: ye,
763
771
  isClearable: !0
764
772
  }
765
- ), l), /* @__PURE__ */ c.createElement("div", { className: "flex justify-between items-center" }, /* @__PURE__ */ c.createElement("span", { className: "text-default-400 text-small" }, "Total ", e.length, " ", i ?? "datos"), d && /* @__PURE__ */ c.createElement("label", { className: "flex items-center text-default-400 text-small" }, "Filas por página:", /* @__PURE__ */ c.createElement(
773
+ ), o), /* @__PURE__ */ c.createElement("div", { className: "flex justify-between items-center" }, /* @__PURE__ */ c.createElement("span", { className: "text-default-400 text-small" }, "Total ", d.length, " ", f), !i && !t && /* @__PURE__ */ c.createElement("label", { className: "flex items-center text-default-400 text-small" }, "Filas por página:", /* @__PURE__ */ c.createElement(
766
774
  "select",
767
775
  {
768
776
  className: "bg-transparent outline-none text-default-400 text-small",
769
777
  onChange: we,
770
- defaultValue: N
778
+ defaultValue: M
771
779
  },
772
- h.map(
780
+ h.options.map(
773
781
  (g) => /* @__PURE__ */ c.createElement("option", { key: g, value: g }, g)
774
782
  )
775
783
  )))), [
776
- x,
777
- e.length,
778
- ve,
784
+ w,
785
+ d.length,
786
+ Me,
779
787
  we,
780
- m,
781
- l,
782
- be,
783
- N,
784
- n,
785
- d,
788
+ s,
789
+ o,
790
+ ye,
791
+ M,
792
+ t,
793
+ e,
794
+ i,
786
795
  h,
787
- i
796
+ f
788
797
  ]);
789
- return /* @__PURE__ */ c.createElement(c.Fragment, null, a ? /* @__PURE__ */ c.createElement(Mt, { columns: t, size: N }) : /* @__PURE__ */ c.createElement(
790
- Ne,
798
+ return /* @__PURE__ */ c.createElement(c.Fragment, null, n ? /* @__PURE__ */ c.createElement(gt, { columns: l, size: M }) : /* @__PURE__ */ c.createElement(c.Fragment, null, qe, /* @__PURE__ */ c.createElement(
799
+ ke,
791
800
  {
792
- ...M,
793
- isHeaderSticky: !0,
794
- "aria-label": M["aria-label"] ?? "Tabla de resultados",
795
- bottomContent: e.length > 0 ? qe : void 0,
796
- bottomContentPlacement: "outside",
797
- topContentPlacement: "outside",
798
- topContent: e.length > 0 ? Je : void 0,
799
- sortDescriptor: w,
800
- onSortChange: W,
801
- selectedKeys: U,
802
- onSelectionChange: J,
803
- selectionMode: o
801
+ ...p,
802
+ "aria-label": "Tabla de datos",
803
+ isVirtualized: t,
804
+ sortDescriptor: F,
805
+ onSortChange: y,
806
+ selectedKeys: N,
807
+ onSelectionChange: pe,
808
+ selectionMode: a
804
809
  },
805
- /* @__PURE__ */ c.createElement(Fe, { columns: t }, (g) => /* @__PURE__ */ c.createElement(Pe, { ...g, children: void 0, key: g.key })),
806
- /* @__PURE__ */ c.createElement(Se, { emptyContent: "No hay datos.", items: Oe }, (g) => /* @__PURE__ */ c.createElement(Ie, { key: g[r] }, (b) => /* @__PURE__ */ c.createElement(Ze, { className: u }, Ge(g, b))))
807
- ));
808
- }, en = ({ children: e, title: t, color: n = "primary" }) => /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement("header", { className: `bg-${n} w-full text-center text-white py-5` }, /* @__PURE__ */ c.createElement("h1", { className: "font-bold text-lg" }, t)), /* @__PURE__ */ c.createElement(Ve, null), /* @__PURE__ */ c.createElement("main", { className: "p-5 2xl:px-16 2xl:py-5 mx-auto" }, e)), _t = () => /* @__PURE__ */ c.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "size-6" }, /* @__PURE__ */ c.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m4.5 18.75 7.5-7.5 7.5 7.5" }), /* @__PURE__ */ c.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m4.5 12.75 7.5-7.5 7.5 7.5" })), zt = () => /* @__PURE__ */ c.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "size-6" }, /* @__PURE__ */ c.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m4.5 5.25 7.5 7.5 7.5-7.5m-15 6 7.5 7.5 7.5-7.5" })), tn = ({ title: e, color: t = "default", children: n, collapse: a = !1 }) => {
809
- const [r, s] = j(!0);
810
- return /* @__PURE__ */ c.createElement(Ke, { className: "mb-5" }, /* @__PURE__ */ c.createElement(et, { className: `bg-${t} px-5 text-white flex justify-between` }, e, a && /* @__PURE__ */ c.createElement("div", { onClick: () => s(!r), className: "cursor-pointer" }, r ? /* @__PURE__ */ c.createElement(_t, null) : /* @__PURE__ */ c.createElement(zt, null))), /* @__PURE__ */ c.createElement(Ve, null), /* @__PURE__ */ c.createElement(tt, { className: `p-5 ${r ? "" : "hidden"}` }, n));
811
- }, nn = ({ name: e, rules: t, defaultValue: n = null, ...a }) => {
812
- const { control: r } = k();
810
+ /* @__PURE__ */ c.createElement(Ne, { columns: l }, (g) => /* @__PURE__ */ c.createElement(Fe, { ...g, children: void 0, key: g.key })),
811
+ /* @__PURE__ */ c.createElement(Se, { emptyContent: "No hay datos.", items: Oe }, (g) => /* @__PURE__ */ c.createElement(Ie, { key: g[u] }, (b) => /* @__PURE__ */ c.createElement(Pe, { className: m }, ze(g, b))))
812
+ ), Ge));
813
+ }, Kt = ({ children: e, title: n, color: t = "primary" }) => /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement("header", { className: `bg-${t} w-full text-center text-white py-5` }, /* @__PURE__ */ c.createElement("h1", { className: "font-bold text-lg" }, n)), /* @__PURE__ */ c.createElement(He, null), /* @__PURE__ */ c.createElement("main", { className: "p-5 2xl:px-16 2xl:py-5 mx-auto" }, e)), Ut = () => /* @__PURE__ */ c.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "size-6" }, /* @__PURE__ */ c.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m4.5 18.75 7.5-7.5 7.5 7.5" }), /* @__PURE__ */ c.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m4.5 12.75 7.5-7.5 7.5 7.5" })), Wt = () => /* @__PURE__ */ c.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "size-6" }, /* @__PURE__ */ c.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m4.5 5.25 7.5 7.5 7.5-7.5m-15 6 7.5 7.5 7.5-7.5" })), en = ({ title: e, color: n = "default", children: t, collapse: r = !1 }) => {
814
+ const [a, s] = B(!0);
815
+ return /* @__PURE__ */ c.createElement(Xe, { className: "mb-5" }, /* @__PURE__ */ c.createElement(Ke, { className: `bg-${n} px-5 text-white flex justify-between` }, e, r && /* @__PURE__ */ c.createElement("div", { onClick: () => s(!a), className: "cursor-pointer" }, a ? /* @__PURE__ */ c.createElement(Ut, null) : /* @__PURE__ */ c.createElement(Wt, null))), /* @__PURE__ */ c.createElement(He, null), /* @__PURE__ */ c.createElement(et, { className: `p-5 ${a ? "" : "hidden"}` }, t));
816
+ }, tn = ({ name: e, rules: n, defaultValue: t = null, ...r }) => {
817
+ const { control: a } = I();
813
818
  return /* @__PURE__ */ c.createElement(
814
- D,
819
+ C,
815
820
  {
816
- control: r,
821
+ control: a,
817
822
  name: e,
818
- rules: t,
819
- defaultValue: n,
823
+ rules: n,
824
+ defaultValue: t,
820
825
  render: ({ field: s, formState: { errors: i } }) => {
821
826
  var o;
822
827
  return /* @__PURE__ */ c.createElement(
823
- le,
828
+ oe,
824
829
  {
825
- ...a,
830
+ ...r,
826
831
  ...s,
827
832
  value: s.value,
828
833
  errorMessage: i[e] ? (o = i[e]) == null ? void 0 : o.message : "",
@@ -832,23 +837,23 @@ const Kt = ({
832
837
  }
833
838
  }
834
839
  );
835
- }, rn = ({ startDate: e, endDate: t }) => {
836
- const { control: n, trigger: a, getValues: r, formState: s } = k(), i = F(() => e.name, [e.name]), o = F(() => t.name, [t.name]), m = X({ control: n, name: [i] }), d = X({ control: n, name: [o] });
840
+ }, nn = ({ startDate: e, endDate: n }) => {
841
+ const { control: t, trigger: r, getValues: a, formState: s } = I(), i = P(() => e.name, [e.name]), o = P(() => n.name, [n.name]), m = X({ control: t, name: [i] }), d = X({ control: t, name: [o] });
837
842
  return ne(() => {
838
843
  if (!s.isSubmitted) return;
839
- const l = r();
840
- l[i] && l[o] && (a([i]), a([o]));
841
- }, [d, m, a, r, s.isSubmitted, o, i]), /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement(
842
- D,
844
+ const l = a();
845
+ l[i] && l[o] && (r([i]), r([o]));
846
+ }, [d, m, r, a, s.isSubmitted, o, i]), /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement(
847
+ C,
843
848
  {
844
- control: n,
849
+ control: t,
845
850
  name: i,
846
851
  rules: e.rules,
847
852
  defaultValue: e.defaultValue ?? null,
848
853
  render: ({ field: l, formState: { errors: u } }) => {
849
854
  var f;
850
855
  return /* @__PURE__ */ c.createElement(
851
- le,
856
+ oe,
852
857
  {
853
858
  ...e,
854
859
  ...l,
@@ -860,18 +865,18 @@ const Kt = ({
860
865
  }
861
866
  }
862
867
  ), /* @__PURE__ */ c.createElement(
863
- D,
868
+ C,
864
869
  {
865
- control: n,
870
+ control: t,
866
871
  name: o,
867
- rules: t.rules,
868
- defaultValue: t.defaultValue ?? null,
872
+ rules: n.rules,
873
+ defaultValue: n.defaultValue ?? null,
869
874
  render: ({ field: l, formState: { errors: u } }) => {
870
875
  var f;
871
876
  return /* @__PURE__ */ c.createElement(
872
- le,
877
+ oe,
873
878
  {
874
- ...t,
879
+ ...n,
875
880
  ...l,
876
881
  value: l.value,
877
882
  errorMessage: u[o] ? (f = u[o]) == null ? void 0 : f.message : "",
@@ -881,121 +886,128 @@ const Kt = ({
881
886
  }
882
887
  }
883
888
  ));
884
- }, an = ({ defaultValue: e = "", rules: t, name: n, classNames: a, ...r }) => {
885
- const { control: s } = k();
889
+ }, rn = ({ defaultValue: e = "", rules: n, name: t, classNames: r, ...a }) => {
890
+ const { control: s } = I();
886
891
  return /* @__PURE__ */ c.createElement(
887
- D,
892
+ C,
888
893
  {
889
894
  control: s,
890
895
  defaultValue: e,
891
- name: n,
892
- rules: t,
896
+ name: t,
897
+ rules: n,
893
898
  render: ({ field: i, formState: { errors: o } }) => {
894
899
  var m;
895
900
  return /* @__PURE__ */ c.createElement(
896
- He,
901
+ Ze,
897
902
  {
898
- ...r,
903
+ ...a,
899
904
  ...i,
900
- isInvalid: !!o[n],
901
- errorMessage: o[n] ? (m = o[n]) == null ? void 0 : m.message : "",
905
+ isInvalid: !!o[t],
906
+ errorMessage: o[t] ? (m = o[t]) == null ? void 0 : m.message : "",
902
907
  classNames: {
903
- ...a,
904
- input: `${(a == null ? void 0 : a.input) || ""} ${o[n] ? "placeholder:text-danger" : ""}`
908
+ ...r,
909
+ input: `${(r == null ? void 0 : r.input) || ""} ${o[t] ? "placeholder:text-danger" : ""}`
905
910
  }
906
911
  }
907
912
  );
908
913
  }
909
914
  }
910
915
  );
911
- }, sn = ({ defaultValue: e = "", rules: t, name: n, classNames: a, ...r }) => {
912
- const { control: s } = k();
916
+ }, an = ({ defaultValue: e = "", rules: n, name: t, classNames: r, ...a }) => {
917
+ const { control: s } = I();
913
918
  return /* @__PURE__ */ c.createElement(
914
- D,
919
+ C,
915
920
  {
916
921
  control: s,
917
922
  defaultValue: e,
918
- name: n,
919
- rules: t,
923
+ name: t,
924
+ rules: n,
920
925
  render: ({ field: i, formState: { errors: o } }) => {
921
926
  var m;
922
927
  return /* @__PURE__ */ c.createElement(
923
- nt,
928
+ tt,
924
929
  {
925
- ...r,
930
+ ...a,
926
931
  ...i,
927
- isInvalid: !!o[n],
928
- errorMessage: o[n] ? (m = o[n]) == null ? void 0 : m.message : "",
932
+ isInvalid: !!o[t],
933
+ errorMessage: o[t] ? (m = o[t]) == null ? void 0 : m.message : "",
929
934
  classNames: {
930
- ...a,
931
- input: `${(a == null ? void 0 : a.input) || ""} ${o[n] ? "placeholder:text-danger" : ""}`
935
+ ...r,
936
+ input: `${(r == null ? void 0 : r.input) || ""} ${o[t] ? "placeholder:text-danger" : ""}`
932
937
  }
933
938
  }
934
939
  );
935
940
  }
936
941
  }
937
942
  );
938
- }, on = ({ name: e, data: t, rules: n, defaultSelectedKeys: a, allOptions: r, allSelectText: s, onSelectionChange: i, ...o }) => {
939
- const { control: m, setValue: d } = k(), l = F(() => o.selectionMode === "multiple", [o.selectionMode]), u = F(
940
- () => r && l ? [
943
+ }, sn = ({ name: e, data: n, rules: t, defaultSelectedKeys: r, disabledKeys: a, renderValue: s, allOptions: i, allSelectText: o, onSelectionChange: m, selectionMode: d, ...l }) => {
944
+ const { control: u, setValue: f } = I(), h = P(() => d === "multiple", [d]), p = P(
945
+ () => i && h ? [
941
946
  {
942
947
  key: "all",
943
- children: r.children,
944
- textValue: r.textValue
948
+ children: i.children,
949
+ textValue: i.textValue
945
950
  },
946
- ...t
947
- ] : t,
948
- [t, r, l]
949
- ), f = Z((h) => {
951
+ ...n
952
+ ] : n,
953
+ [n, i, h]
954
+ ), w = R((M) => {
950
955
  setTimeout(() => {
951
- const M = new Set(h), x = M.has("all");
952
- let v = h;
953
- x && (M.size === t.length + 1 ? (d(e, ""), v = /* @__PURE__ */ new Set()) : (d(e, t.map((L) => L.key).filter((L) => L !== "all").toString()), v = "all"));
954
- const N = t.length === M.size ? "all" : v;
955
- i == null || i(N);
956
+ const Y = new Set(M), x = new Set(a), $ = Y.has("all");
957
+ let N = M;
958
+ if ($ && h)
959
+ if (Y.size - 1 === n.length)
960
+ f(e, ""), N = /* @__PURE__ */ new Set();
961
+ else {
962
+ const F = n.filter((y) => !x.has(y.key)).map((y) => y.key);
963
+ f(e, F.toString()), N = new Set(F);
964
+ }
965
+ m == null || m(N);
956
966
  }, 250);
957
- }, [t, e, i, d]), p = Z((h) => /* @__PURE__ */ c.createElement("span", null, h.length >= t.length ? s ?? "Todas las opciones" : h.filter((M) => M.key !== "all").map((M) => M.textValue).join(", ")), [s, t]);
967
+ }, [n, e, m, f, a, h]), k = R((M) => /* @__PURE__ */ c.createElement("span", null, M.length >= n.length ? o ?? "Todas las opciones" : M.filter((Y) => Y.key !== "all").map((Y) => Y.textValue).join(", ")), [o, n]);
958
968
  return /* @__PURE__ */ c.createElement(
959
- D,
969
+ C,
960
970
  {
961
- control: m,
962
- rules: n,
971
+ control: u,
972
+ rules: t,
963
973
  name: e,
964
- defaultValue: (a == null ? void 0 : a.toString()) ?? void 0,
965
- render: ({ field: h, formState: { errors: M } }) => {
974
+ defaultValue: (r == null ? void 0 : r.toString()) ?? void 0,
975
+ render: ({ field: M, formState: { errors: Y } }) => {
966
976
  var x;
967
977
  return /* @__PURE__ */ c.createElement(
968
- rt,
978
+ nt,
969
979
  {
970
- ...o,
971
- ...h,
972
- items: u,
973
- selectedKeys: h.value ? h.value.split(",") : [],
974
- errorMessage: ((x = M[e]) == null ? void 0 : x.message) || "",
975
- onSelectionChange: (v) => f(v),
976
- isInvalid: !!M[e],
977
- renderValue: l ? p : void 0
980
+ ...l,
981
+ ...M,
982
+ items: p,
983
+ selectedKeys: M.value ? M.value.split(",") : [],
984
+ errorMessage: ((x = Y[e]) == null ? void 0 : x.message) || "",
985
+ selectionMode: d,
986
+ onSelectionChange: ($) => w($),
987
+ isInvalid: !!Y[e],
988
+ renderValue: s ?? h ? k : void 0,
989
+ disabledKeys: a
978
990
  },
979
- (v) => /* @__PURE__ */ c.createElement(at, { ...v, key: v.key })
991
+ ($) => /* @__PURE__ */ c.createElement(rt, { ...$, key: $.key })
980
992
  );
981
993
  }
982
994
  }
983
995
  );
984
- }, ln = ({ name: e, rules: t, defaultValue: n, ...a }) => {
985
- const { control: r } = k();
996
+ }, on = ({ name: e, rules: n, defaultValue: t, ...r }) => {
997
+ const { control: a } = I();
986
998
  return /* @__PURE__ */ c.createElement(
987
- D,
999
+ C,
988
1000
  {
989
- control: r,
1001
+ control: a,
990
1002
  name: e,
991
- rules: t,
992
- defaultValue: n ?? null,
1003
+ rules: n,
1004
+ defaultValue: t ?? null,
993
1005
  render: ({ field: s, formState: { errors: i } }) => {
994
1006
  var o;
995
1007
  return /* @__PURE__ */ c.createElement(
996
- ie,
1008
+ le,
997
1009
  {
998
- ...a,
1010
+ ...r,
999
1011
  ...s,
1000
1012
  value: s.value,
1001
1013
  isInvalid: !!i[e],
@@ -1005,23 +1017,23 @@ const Kt = ({
1005
1017
  }
1006
1018
  }
1007
1019
  );
1008
- }, cn = ({ startTime: e, endTime: t }) => {
1009
- const { control: n, trigger: a, getValues: r, formState: s } = k(), i = F(() => e.name, [e.name]), o = F(() => t.name, [t.name]), m = X({ control: n, name: [i] }), d = X({ control: n, name: [o] });
1020
+ }, ln = ({ startTime: e, endTime: n }) => {
1021
+ const { control: t, trigger: r, getValues: a, formState: s } = I(), i = P(() => e.name, [e.name]), o = P(() => n.name, [n.name]), m = X({ control: t, name: [i] }), d = X({ control: t, name: [o] });
1010
1022
  return ne(() => {
1011
1023
  if (!s.isSubmitted) return;
1012
- const l = r();
1013
- l[i] && l[o] && (a([i]), a([o]));
1014
- }, [d, m, a, r, s.isSubmitted, o, i]), /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement(
1015
- D,
1024
+ const l = a();
1025
+ l[i] && l[o] && (r([i]), r([o]));
1026
+ }, [d, m, r, a, s.isSubmitted, o, i]), /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement(
1027
+ C,
1016
1028
  {
1017
- control: n,
1029
+ control: t,
1018
1030
  name: i,
1019
1031
  rules: e.rules,
1020
1032
  defaultValue: e.defaultValue ?? null,
1021
1033
  render: ({ field: l, formState: { errors: u } }) => {
1022
1034
  var f;
1023
1035
  return /* @__PURE__ */ c.createElement(
1024
- ie,
1036
+ le,
1025
1037
  {
1026
1038
  ...e,
1027
1039
  ...l,
@@ -1033,18 +1045,18 @@ const Kt = ({
1033
1045
  }
1034
1046
  }
1035
1047
  ), /* @__PURE__ */ c.createElement(
1036
- D,
1048
+ C,
1037
1049
  {
1038
- control: n,
1050
+ control: t,
1039
1051
  name: o,
1040
- rules: t.rules,
1041
- defaultValue: t.defaultValue ?? null,
1052
+ rules: n.rules,
1053
+ defaultValue: n.defaultValue ?? null,
1042
1054
  render: ({ field: l, formState: { errors: u } }) => {
1043
1055
  var f;
1044
1056
  return /* @__PURE__ */ c.createElement(
1045
- ie,
1057
+ le,
1046
1058
  {
1047
- ...t,
1059
+ ...n,
1048
1060
  ...l,
1049
1061
  value: l.value,
1050
1062
  isInvalid: !!u[o],
@@ -1054,258 +1066,231 @@ const Kt = ({
1054
1066
  }
1055
1067
  }
1056
1068
  ));
1057
- }, un = ({ defaultValue: e = "", rules: t, name: n, classNames: a, ...r }) => {
1058
- const { control: s } = k();
1069
+ }, cn = ({ defaultValue: e = "", rules: n, name: t, classNames: r, ...a }) => {
1070
+ const { control: s } = I();
1059
1071
  return /* @__PURE__ */ c.createElement(
1060
- D,
1072
+ C,
1061
1073
  {
1062
1074
  control: s,
1063
1075
  defaultValue: e,
1064
- name: n,
1065
- rules: t,
1076
+ name: t,
1077
+ rules: n,
1066
1078
  render: ({ field: i, formState: { errors: o } }) => {
1067
1079
  var m;
1068
1080
  return /* @__PURE__ */ c.createElement(
1069
- st,
1081
+ at,
1070
1082
  {
1071
- ...r,
1083
+ ...a,
1072
1084
  ...i,
1073
- isInvalid: !!o[n],
1074
- errorMessage: o[n] ? (m = o[n]) == null ? void 0 : m.message : "",
1085
+ isInvalid: !!o[t],
1086
+ errorMessage: o[t] ? (m = o[t]) == null ? void 0 : m.message : "",
1075
1087
  classNames: {
1076
- ...a,
1077
- input: `${(a == null ? void 0 : a.input) || ""} ${o[n] ? "placeholder:text-danger" : ""}`
1088
+ ...r,
1089
+ input: `${(r == null ? void 0 : r.input) || ""} ${o[t] ? "placeholder:text-danger" : ""}`
1078
1090
  }
1079
1091
  }
1080
1092
  );
1081
1093
  }
1082
1094
  }
1083
1095
  );
1084
- }, mn = ({ onSelectionChange: e, defaultSelectedKey: t, name: n, data: a, rules: r, ...s }) => {
1085
- const { control: i } = k(), o = (m) => {
1096
+ }, un = ({ onSelectionChange: e, defaultSelectedKey: n, name: t, data: r, rules: a, ...s }) => {
1097
+ const { control: i } = I(), o = (m) => {
1086
1098
  e && e(m);
1087
1099
  };
1088
1100
  return /* @__PURE__ */ c.createElement(
1089
- D,
1101
+ C,
1090
1102
  {
1091
1103
  control: i,
1092
- defaultValue: t,
1093
- name: n,
1094
- rules: r,
1104
+ defaultValue: n,
1105
+ name: t,
1106
+ rules: a,
1095
1107
  render: ({ field: m, formState: { errors: d } }) => {
1096
1108
  var l;
1097
1109
  return /* @__PURE__ */ c.createElement(
1098
- ot,
1110
+ st,
1099
1111
  {
1100
1112
  ...s,
1101
1113
  ...m,
1102
1114
  selectedKey: m.value ?? "",
1103
- defaultItems: a,
1115
+ defaultItems: r,
1104
1116
  onSelectionChange: (u) => {
1105
1117
  m.onChange(u), o(u);
1106
1118
  },
1107
- isInvalid: !!d[n],
1108
- errorMessage: d[n] ? (l = d[n]) == null ? void 0 : l.message : "",
1119
+ isInvalid: !!d[t],
1120
+ errorMessage: d[t] ? (l = d[t]) == null ? void 0 : l.message : "",
1109
1121
  inputProps: {
1110
1122
  classNames: {
1111
- input: d[n] ? "placeholder:text-danger" : ""
1123
+ input: d[t] ? "placeholder:text-danger" : ""
1112
1124
  }
1113
1125
  }
1114
1126
  },
1115
- a.map((u) => /* @__PURE__ */ c.createElement(lt, { ...u, key: u.key }))
1127
+ r.map((u) => /* @__PURE__ */ c.createElement(ot, { ...u, key: u.key }))
1116
1128
  );
1117
1129
  }
1118
1130
  }
1119
1131
  );
1120
- }, dn = ({ data: e, rules: t, name: n, defaultValue: a, ...r }) => {
1121
- const { control: s } = k();
1132
+ }, mn = ({ data: e, rules: n, name: t, defaultValue: r, ...a }) => {
1133
+ const { control: s } = I();
1122
1134
  return /* @__PURE__ */ c.createElement(
1123
- D,
1135
+ C,
1124
1136
  {
1125
1137
  control: s,
1126
- rules: t,
1127
- name: n,
1128
- defaultValue: a ?? "",
1138
+ rules: n,
1139
+ name: t,
1140
+ defaultValue: r ?? "",
1129
1141
  render: ({ field: i, formState: { errors: o } }) => {
1130
1142
  var m;
1131
1143
  return /* @__PURE__ */ c.createElement(
1132
- it,
1144
+ lt,
1133
1145
  {
1134
1146
  ...i,
1135
- ...r,
1136
- isInvalid: !!o[n],
1137
- errorMessage: o[n] ? (m = o[n]) == null ? void 0 : m.message : ""
1147
+ ...a,
1148
+ isInvalid: !!o[t],
1149
+ errorMessage: o[t] ? (m = o[t]) == null ? void 0 : m.message : ""
1138
1150
  },
1139
- e.map((d, l) => /* @__PURE__ */ c.createElement(ct, { ...d, key: l }))
1151
+ e.map((d, l) => /* @__PURE__ */ c.createElement(it, { ...d, key: l }))
1140
1152
  );
1141
1153
  }
1142
1154
  }
1143
1155
  );
1144
- }, fn = ({ rules: e, name: t, ...n }) => {
1145
- const { control: a } = k();
1156
+ }, dn = ({ rules: e, name: n, ...t }) => {
1157
+ const { control: r } = I();
1146
1158
  return /* @__PURE__ */ c.createElement(
1147
- D,
1159
+ C,
1148
1160
  {
1149
- control: a,
1161
+ control: r,
1150
1162
  rules: e,
1151
- name: t,
1152
- render: ({ field: r, formState: { errors: s } }) => /* @__PURE__ */ c.createElement(
1163
+ name: n,
1164
+ render: ({ field: a, formState: { errors: s } }) => /* @__PURE__ */ c.createElement(
1153
1165
  Re,
1154
1166
  {
1155
- ...r,
1156
- ...n,
1157
- isSelected: !!r.value,
1158
- isInvalid: !!s[t]
1167
+ ...a,
1168
+ ...t,
1169
+ isSelected: !!a.value,
1170
+ isInvalid: !!s[n]
1159
1171
  },
1160
- n.children
1172
+ t.children
1161
1173
  )
1162
1174
  }
1163
1175
  );
1164
- }, hn = ({ defaultValue: e, rules: t, name: n, data: a, ...r }) => {
1165
- const { control: s } = k();
1176
+ }, fn = ({ defaultValue: e, rules: n, name: t, data: r, ...a }) => {
1177
+ const { control: s } = I();
1166
1178
  return /* @__PURE__ */ c.createElement(
1167
- D,
1179
+ C,
1168
1180
  {
1169
1181
  control: s,
1170
- rules: t,
1171
- name: n,
1182
+ rules: n,
1183
+ name: t,
1172
1184
  defaultValue: e ?? [],
1173
1185
  render: ({ field: i, formState: { errors: o } }) => {
1174
1186
  var m;
1175
1187
  return /* @__PURE__ */ c.createElement(
1176
- ut,
1188
+ ct,
1177
1189
  {
1178
1190
  ...i,
1179
- ...r,
1180
- isInvalid: !!o[n]
1191
+ ...a,
1192
+ isInvalid: !!o[t]
1181
1193
  },
1182
- a.map((d) => /* @__PURE__ */ c.createElement(Re, { ...d, key: d.value }, d.children)),
1183
- !!o[n] && /* @__PURE__ */ c.createElement("div", { "data-slot": "error-message", className: "text-tiny text-danger w-full" }, o[n] ? (m = o[n]) == null ? void 0 : m.message : "")
1194
+ r.map((d) => /* @__PURE__ */ c.createElement(Re, { ...d, key: d.value }, d.children)),
1195
+ !!o[t] && /* @__PURE__ */ c.createElement("div", { "data-slot": "error-message", className: "text-tiny text-danger w-full" }, o[t] ? (m = o[t]) == null ? void 0 : m.message : "")
1184
1196
  );
1185
1197
  }
1186
1198
  }
1187
1199
  );
1188
1200
  };
1189
- function gn({
1201
+ function hn({
1190
1202
  display: e = !1,
1203
+ onClose: n,
1191
1204
  children: t,
1192
- title: n,
1193
- onCancel: a,
1194
- cancelButton: r,
1205
+ title: r = "",
1206
+ cancelButton: a,
1195
1207
  acceptButton: s,
1196
1208
  ...i
1197
1209
  }) {
1198
- const { isOpen: o, onOpen: m, onOpenChange: d } = mt(), [l, u] = j(!1);
1199
- ne(() => {
1200
- e && m();
1201
- }, [e, m]);
1202
- const f = () => {
1203
- d(), a();
1204
- }, p = async () => {
1205
- s != null && s.onClick && (u(!0), await s.onClick(), u(!1));
1206
- };
1207
- return /* @__PURE__ */ c.createElement(dt, { isOpen: o, onOpenChange: f, ...i }, /* @__PURE__ */ c.createElement(ft, null, (h) => /* @__PURE__ */ c.createElement(c.Fragment, null, n && /* @__PURE__ */ c.createElement(ht, { className: "flex flex-col gap-1" }, n), /* @__PURE__ */ c.createElement(gt, null, t), /* @__PURE__ */ c.createElement(pt, null, r && /* @__PURE__ */ c.createElement(
1208
- Q,
1209
- {
1210
- ...r,
1211
- isDisabled: l,
1212
- onPress: () => {
1213
- h(), a();
1214
- }
1215
- },
1216
- (r == null ? void 0 : r.name) ?? "Cerrar"
1217
- ), s && /* @__PURE__ */ c.createElement(
1218
- Q,
1219
- {
1220
- ...s,
1221
- isLoading: l,
1222
- onPress: () => p()
1223
- },
1224
- s.name ?? "Aceptar"
1225
- )))));
1210
+ return /* @__PURE__ */ c.createElement(ut, { isOpen: e, onOpenChange: n, ...i }, /* @__PURE__ */ c.createElement(mt, null, /* @__PURE__ */ c.createElement(dt, { className: "flex flex-col gap-1" }, r), /* @__PURE__ */ c.createElement(ft, null, t), /* @__PURE__ */ c.createElement(ht, null, a && /* @__PURE__ */ c.createElement(Q, { ...a, onPress: n }), s && /* @__PURE__ */ c.createElement(Q, { ...s }))));
1226
1211
  }
1227
- const Ye = ({ value: e, context: t, name: n, range: a, rangeDate: r, type: s }) => {
1228
- const i = t.parent[n];
1229
- if (!i || !e || !a || a === 0 || !r) return !0;
1212
+ const Ce = ({ value: e, context: n, name: t, range: r, rangeDate: a, type: s }) => {
1213
+ const i = n.parent[t];
1214
+ if (!i || !e || !r || r === 0 || !a) return !0;
1230
1215
  const o = A(s == "min" ? i.toString() : e.toString()), m = A(s == "max" ? i.toString() : e.toString());
1231
1216
  let d;
1232
- switch (r) {
1217
+ switch (a) {
1233
1218
  case "days":
1234
- d = Ut(o, m);
1219
+ d = Lt(o, m);
1235
1220
  break;
1236
1221
  case "months":
1237
- d = pe(o, m);
1222
+ d = ge(o, m);
1238
1223
  break;
1239
1224
  case "years":
1240
- d = Wt(o, m);
1225
+ d = At(o, m);
1241
1226
  break;
1242
1227
  default:
1243
1228
  d = 0;
1244
1229
  break;
1245
1230
  }
1246
- return d < a;
1247
- }, ee = ({ context: e, name: t, type: n, value: a }) => {
1248
- const r = e.parent[t];
1249
- if (!r || !a) return !0;
1250
- const s = a.compare(r);
1251
- return n == "max" ? s >= 0 : s <= 0;
1252
- }, O = ({ value: e, date: t, type: n }) => {
1253
- if (!e || !t) return !0;
1254
- let a, r;
1231
+ return d < r;
1232
+ }, ee = ({ context: e, name: n, type: t, value: r }) => {
1233
+ const a = e.parent[n];
1234
+ if (!a || !r) return !0;
1235
+ const s = r.compare(a);
1236
+ return t == "max" ? s >= 0 : s <= 0;
1237
+ }, G = ({ value: e, date: n, type: t }) => {
1238
+ if (!e || !n) return !0;
1239
+ let r, a;
1255
1240
  try {
1256
- a = A(t), r = A(e.toString());
1241
+ r = A(n), a = A(e.toString());
1257
1242
  } catch {
1258
1243
  return !1;
1259
1244
  }
1260
- if (jt(r, a)) return !0;
1261
- const s = Rt(r, a);
1262
- return n === "min" ? s : !s;
1263
- }, ke = ({ value: e, context: t, name: n, range: a, rangeDate: r, type: s }) => {
1264
- const i = t.parent[n];
1265
- if (!i || !e || !a || a === 0 || !r) return !0;
1245
+ if (Rt(a, r)) return !0;
1246
+ const s = Ht(a, r);
1247
+ return t === "min" ? s : !s;
1248
+ }, Ye = ({ value: e, context: n, name: t, range: r, rangeDate: a, type: s }) => {
1249
+ const i = n.parent[t];
1250
+ if (!i || !e || !r || r === 0 || !a) return !0;
1266
1251
  const o = e.toString(), m = i.toString(), d = A(s == "max" ? m : o, "HH:mm:ss"), l = A(s == "min" ? m : o, "HH:mm:ss");
1267
1252
  let u = 0;
1268
- return r === "hours" ? u = Lt(l, d) : u = At(l, d), u < a;
1269
- }, te = (e, t) => {
1253
+ return a === "hours" ? u = jt(l, d) : u = Vt(l, d), u < r;
1254
+ }, te = (e, n) => {
1270
1255
  switch (e) {
1271
1256
  case "days":
1272
- return t === 1 ? "El rango es de 1 dia" : `El rango es de ${t} dias`;
1257
+ return n === 1 ? "El rango es de 1 dia" : `El rango es de ${n} dias`;
1273
1258
  case "months":
1274
- return t === 1 ? "El rango es de 1 mes" : `El rango es de ${t} meses`;
1259
+ return n === 1 ? "El rango es de 1 mes" : `El rango es de ${n} meses`;
1275
1260
  case "years":
1276
- return t === 1 ? "El rango es de 1 año" : `El rango es de ${t} años`;
1261
+ return n === 1 ? "El rango es de 1 año" : `El rango es de ${n} años`;
1277
1262
  case "hours":
1278
- return t === 1 ? "El rango es de 1 hora" : `El rango es de ${t} horas`;
1263
+ return n === 1 ? "El rango es de 1 hora" : `El rango es de ${n} horas`;
1279
1264
  case "minutes":
1280
- return t === 1 ? "El rango es de 1 minuto" : `El rango es de ${t} minutos`;
1265
+ return n === 1 ? "El rango es de 1 minuto" : `El rango es de ${n} minutos`;
1281
1266
  default:
1282
1267
  return "Custom Test";
1283
1268
  }
1284
- }, Bt = ({
1269
+ }, _t = ({
1285
1270
  endDate: e,
1286
- startDate: t,
1287
- range: n = 0,
1288
- type: a,
1289
- maxEndDate: r,
1271
+ startDate: n,
1272
+ range: t = 0,
1273
+ type: r,
1274
+ maxEndDate: a,
1290
1275
  maxStartDate: s,
1291
1276
  minEndDate: i,
1292
1277
  minStartDate: o
1293
1278
  }) => {
1294
- const m = q().test(
1279
+ const m = J().test(
1295
1280
  "Menor",
1296
1281
  "Este campo debe ser menor a la fecha final",
1297
1282
  (l, u) => ee({ value: l, context: u, name: e, type: "min" })
1298
1283
  ).when([], {
1299
- is: n && n > 0 && a,
1284
+ is: t && t > 0 && r,
1300
1285
  then: (l) => l.test(
1301
1286
  "Rango de tiempo",
1302
- te(a, n),
1303
- (u, f) => Ye({
1287
+ te(r, t),
1288
+ (u, f) => Ce({
1304
1289
  context: f,
1305
1290
  value: u,
1306
- range: n,
1291
+ range: t,
1307
1292
  name: e,
1308
- rangeDate: a,
1293
+ rangeDate: r,
1309
1294
  type: "min"
1310
1295
  })
1311
1296
  )
@@ -1313,119 +1298,119 @@ const Ye = ({ value: e, context: t, name: n, range: a, rangeDate: r, type: s })
1313
1298
  is: s,
1314
1299
  then: (l) => l.test(
1315
1300
  "Max Date",
1316
- `Fecha maxima ${P(s, "DD/MM/YYYY")}`,
1317
- (u) => O({ value: u, date: s, type: "max" })
1301
+ `Fecha maxima ${Z(s, "DD/MM/YYYY")}`,
1302
+ (u) => G({ value: u, date: s, type: "max" })
1318
1303
  )
1319
1304
  }).when([], {
1320
1305
  is: o,
1321
1306
  then: (l) => l.test(
1322
1307
  "Min Date",
1323
- `Fecha minima ${P(o, "DD/MM/YYYY")}`,
1324
- (u) => O({ value: u, date: o, type: "min" })
1308
+ `Fecha minima ${Z(o, "DD/MM/YYYY")}`,
1309
+ (u) => G({ value: u, date: o, type: "min" })
1325
1310
  )
1326
- }), d = q().test(
1311
+ }), d = J().test(
1327
1312
  "Mayor",
1328
1313
  "Este campo debe ser mayor a la fecha inicial",
1329
- (l, u) => ee({ value: l, context: u, name: t, type: "max" })
1314
+ (l, u) => ee({ value: l, context: u, name: n, type: "max" })
1330
1315
  ).when([], {
1331
- is: n && n > 0 && a,
1316
+ is: t && t > 0 && r,
1332
1317
  then: (l) => l.test(
1333
1318
  "Rango de tiempo",
1334
- te(a, n),
1335
- (u, f) => Ye({
1319
+ te(r, t),
1320
+ (u, f) => Ce({
1336
1321
  context: f,
1337
1322
  value: u,
1338
- range: n,
1339
- name: t,
1340
- rangeDate: a,
1323
+ range: t,
1324
+ name: n,
1325
+ rangeDate: r,
1341
1326
  type: "max"
1342
1327
  })
1343
1328
  )
1344
1329
  }).when([], {
1345
- is: r,
1330
+ is: a,
1346
1331
  then: (l) => l.test(
1347
1332
  "Max Date",
1348
- `Fecha maxima ${P(r, "DD/MM/YYYY")}`,
1349
- (u) => O({ value: u, date: r, type: "max" })
1333
+ `Fecha maxima ${Z(a, "DD/MM/YYYY")}`,
1334
+ (u) => G({ value: u, date: a, type: "max" })
1350
1335
  )
1351
1336
  }).when([], {
1352
1337
  is: i,
1353
1338
  then: (l) => l.test(
1354
1339
  "Min Date",
1355
- `Fecha minima ${P(i, "DD/MM/YYYY")}`,
1356
- (u) => O({ value: u, date: i, type: "min" })
1340
+ `Fecha minima ${Z(i, "DD/MM/YYYY")}`,
1341
+ (u) => G({ value: u, date: i, type: "min" })
1357
1342
  )
1358
1343
  });
1359
1344
  return { startDateRule: m, endDateRule: d };
1360
- }, Ot = ({ minDate: e, maxDate: t }) => q().test(
1345
+ }, Ot = ({ minDate: e, maxDate: n }) => J().test(
1361
1346
  "Min Date",
1362
- `Fecha minima ${P(e, "DD/MM/YYYY")}`,
1363
- (n) => O({ value: n, date: e, type: "min" })
1347
+ `Fecha minima ${Z(e, "DD/MM/YYYY")}`,
1348
+ (t) => G({ value: t, date: e, type: "min" })
1364
1349
  ).test(
1365
1350
  "Max Date",
1366
- `Fecha maxima ${P(t, "DD/MM/YYYY")}`,
1367
- (n) => O({ value: n, date: t, type: "max" })
1368
- ), Gt = ({ endTime: e, startTime: t, range: n = 0, type: a }) => {
1369
- const r = q().test(
1351
+ `Fecha maxima ${Z(n, "DD/MM/YYYY")}`,
1352
+ (t) => G({ value: t, date: n, type: "max" })
1353
+ ), zt = ({ endTime: e, startTime: n, range: t = 0, type: r }) => {
1354
+ const a = J().test(
1370
1355
  "Menor",
1371
1356
  "Este campo debe ser menor a la hora final",
1372
1357
  (i, o) => ee({ value: i, context: o, name: e, type: "min" })
1373
1358
  ).when([], {
1374
- is: n && n > 0 && a,
1359
+ is: t && t > 0 && r,
1375
1360
  then: (i) => i.test(
1376
1361
  "Rango de tiempo",
1377
- te(a, n),
1378
- (o, m) => ke({
1362
+ te(r, t),
1363
+ (o, m) => Ye({
1379
1364
  value: o,
1380
1365
  context: m,
1381
1366
  name: e,
1382
1367
  type: "min",
1383
- range: n,
1384
- rangeDate: a
1368
+ range: t,
1369
+ rangeDate: r
1385
1370
  })
1386
1371
  )
1387
- }), s = q().test(
1372
+ }), s = J().test(
1388
1373
  "Mayor",
1389
1374
  "Este campo debe ser mayor a la hora inicial",
1390
- (i, o) => ee({ value: i, context: o, name: t, type: "max" })
1375
+ (i, o) => ee({ value: i, context: o, name: n, type: "max" })
1391
1376
  ).when([], {
1392
- is: n && n > 0 && a,
1377
+ is: t && t > 0 && r,
1393
1378
  then: (i) => i.test(
1394
1379
  "Rango de tiempo",
1395
- te(a, n),
1396
- (o, m) => ke({
1380
+ te(r, t),
1381
+ (o, m) => Ye({
1397
1382
  value: o,
1398
1383
  context: m,
1399
- name: t,
1384
+ name: n,
1400
1385
  type: "max",
1401
- range: n,
1402
- rangeDate: a
1386
+ range: t,
1387
+ rangeDate: r
1403
1388
  })
1404
1389
  )
1405
1390
  });
1406
- return { startTimeRule: r, endTimeRule: s };
1407
- }, pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1391
+ return { startTimeRule: a, endTimeRule: s };
1392
+ }, gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1408
1393
  __proto__: null,
1409
1394
  dateMinMaxValidate: Ot,
1410
- dualDateValidate: Bt,
1411
- dualTimeValidate: Gt
1395
+ dualDateValidate: _t,
1396
+ dualTimeValidate: zt
1412
1397
  }, Symbol.toStringTag, { value: "Module" }));
1413
1398
  export {
1414
- Kt as DataTable,
1415
- en as Layout,
1416
- gn as Modal,
1417
- tn as Panel,
1418
- mn as RHFAutocomplete,
1419
- fn as RHFCheckbox,
1420
- hn as RHFCheckboxGroup,
1421
- nn as RHFDate,
1422
- rn as RHFDualDate,
1423
- cn as RHFDualTime,
1424
- an as RHFInput,
1425
- sn as RHFInputOtp,
1426
- dn as RHFRadioGroup,
1427
- on as RHFSelect,
1428
- un as RHFTextArea,
1429
- ln as RHFTime,
1430
- pn as validation
1399
+ Xt as DataTable,
1400
+ Kt as Layout,
1401
+ hn as Modal,
1402
+ en as Panel,
1403
+ un as RHFAutocomplete,
1404
+ dn as RHFCheckbox,
1405
+ fn as RHFCheckboxGroup,
1406
+ tn as RHFDate,
1407
+ nn as RHFDualDate,
1408
+ ln as RHFDualTime,
1409
+ rn as RHFInput,
1410
+ an as RHFInputOtp,
1411
+ mn as RHFRadioGroup,
1412
+ sn as RHFSelect,
1413
+ cn as RHFTextArea,
1414
+ on as RHFTime,
1415
+ gn as validation
1431
1416
  };