rharuow-ds 1.7.2 → 1.8.2

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.
@@ -1,136 +1,136 @@
1
1
  import * as e from "react";
2
- import i, { useState as ue, useRef as pe, useEffect as Be } from "react";
3
- import { useFormContext as ie, useWatch as ce } from "react-hook-form";
4
- import { createPortal as ve } from "react-dom";
5
- function he(t) {
2
+ import o, { useState as le, useRef as pe, useEffect as be } from "react";
3
+ import { useFormContext as ce, useWatch as de } from "react-hook-form";
4
+ import { createPortal as he } from "react-dom";
5
+ function xe(t) {
6
6
  var n, r, a = "";
7
7
  if (typeof t == "string" || typeof t == "number") a += t;
8
8
  else if (typeof t == "object") if (Array.isArray(t)) {
9
- var s = t.length;
10
- for (n = 0; n < s; n++) t[n] && (r = he(t[n])) && (a && (a += " "), a += r);
9
+ var l = t.length;
10
+ for (n = 0; n < l; n++) t[n] && (r = xe(t[n])) && (a && (a += " "), a += r);
11
11
  } else for (r in t) t[r] && (a && (a += " "), a += r);
12
12
  return a;
13
13
  }
14
- function Pe() {
15
- for (var t, n, r = 0, a = "", s = arguments.length; r < s; r++) (t = arguments[r]) && (n = he(t)) && (a && (a += " "), a += n);
14
+ function Ae() {
15
+ for (var t, n, r = 0, a = "", l = arguments.length; r < l; r++) (t = arguments[r]) && (n = xe(t)) && (a && (a += " "), a += n);
16
16
  return a;
17
17
  }
18
18
  function d(...t) {
19
- return Pe(...t);
19
+ return Ae(...t);
20
20
  }
21
- const Ge = ({
21
+ const Xe = ({
22
22
  children: t,
23
23
  variant: n = "default",
24
24
  className: r = "",
25
25
  ...a
26
26
  }) => {
27
- const s = "px-4 py-2 rounded font-medium transition", x = {
27
+ const l = "px-4 py-2 rounded font-medium transition", w = {
28
28
  default: "bg-[var(--primary,#2563eb)] text-[var(--primary-text,#fff)] hover:bg-[var(--primary-hover,#1d4ed8)]",
29
29
  outline: "border border-[var(--primary,#2563eb)] text-[var(--primary,#2563eb)] bg-white hover:bg-[var(--primary-hover,#e0e7ff)]",
30
30
  secondary: "bg-[var(--secondary,#fbbf24)] text-[var(--secondary-text,#222)] hover:bg-[var(--secondary-hover,#f59e42)]"
31
31
  };
32
- return /* @__PURE__ */ i.createElement("button", { className: d(s, x[n], r), ...a }, t);
33
- }, xe = (t) => t.replace(/\D/g, ""), _e = (t) => {
34
- const r = xe(t).slice(0, 11);
32
+ return /* @__PURE__ */ o.createElement("button", { className: d(l, w[n], r), ...a }, t);
33
+ }, we = (t) => t.replace(/\D/g, ""), Te = (t) => {
34
+ const r = we(t).slice(0, 11);
35
35
  return r.length <= 3 ? r : r.length <= 6 ? `${r.slice(0, 3)}.${r.slice(3)}` : r.length <= 9 ? `${r.slice(0, 3)}.${r.slice(3, 6)}.${r.slice(6)}` : `${r.slice(0, 3)}.${r.slice(3, 6)}.${r.slice(6, 9)}-${r.slice(9, 11)}`;
36
- }, ge = (t) => {
37
- const n = xe(t);
36
+ }, ve = (t) => {
37
+ const n = we(t);
38
38
  if (n.length !== 11 || /^(\d)\1{10}$/.test(n))
39
39
  return !1;
40
40
  let r = 0;
41
- for (let s = 0; s < 9; s++)
42
- r += parseInt(n.charAt(s)) * (10 - s);
41
+ for (let l = 0; l < 9; l++)
42
+ r += parseInt(n.charAt(l)) * (10 - l);
43
43
  let a = r * 10 % 11;
44
44
  if ((a === 10 || a === 11) && (a = 0), a !== parseInt(n.charAt(9)))
45
45
  return !1;
46
46
  r = 0;
47
- for (let s = 0; s < 10; s++)
48
- r += parseInt(n.charAt(s)) * (11 - s);
47
+ for (let l = 0; l < 10; l++)
48
+ r += parseInt(n.charAt(l)) * (11 - l);
49
49
  return a = r * 10 % 11, (a === 10 || a === 11) && (a = 0), a === parseInt(n.charAt(10));
50
- }, Ie = e.forwardRef(
50
+ }, $e = e.forwardRef(
51
51
  ({
52
52
  name: t,
53
53
  className: n,
54
54
  type: r = "text",
55
55
  label: a,
56
- onFocus: s,
57
- onBlur: x,
56
+ onFocus: l,
57
+ onBlur: w,
58
58
  onChange: b,
59
- Icon: B,
60
- iconClassName: _,
61
- iconAction: S,
62
- containerClassName: w,
63
- cpf: y = !1,
64
- ...u
65
- }, L) => {
66
- var I, P, q;
67
- const [k, R] = e.useState(!1), [g, v] = e.useState(!1), [h, E] = e.useState(null), l = ie(), C = l == null ? void 0 : l.control, N = l == null ? void 0 : l.register, M = C && t ? ce({ control: C, name: t }) : void 0, m = u.value ?? M ?? "", V = ((q = (P = (I = l == null ? void 0 : l.formState) == null ? void 0 : I.errors) == null ? void 0 : P[t]) == null ? void 0 : q.message) || h, F = ["date", "datetime-local", "time", "month", "week"].includes(r), J = k || !!m || F, Z = r === "password" ? g ? "text" : "password" : r, G = () => /* @__PURE__ */ e.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ e.createElement(
59
+ Icon: M,
60
+ iconClassName: N,
61
+ iconAction: y,
62
+ containerClassName: f,
63
+ cpf: x = !1,
64
+ ...c
65
+ }, I) => {
66
+ var _, P, q;
67
+ const [k, S] = e.useState(!1), [v, h] = e.useState(!1), [E, C] = e.useState(null), i = ce(), R = i == null ? void 0 : i.control, F = i == null ? void 0 : i.register, B = R && t ? de({ control: R, name: t }) : void 0, p = c.value ?? B ?? "", V = ((q = (P = (_ = i == null ? void 0 : i.formState) == null ? void 0 : _.errors) == null ? void 0 : P[t]) == null ? void 0 : q.message) || E, L = ["date", "datetime-local", "time", "month", "week"].includes(r), J = k || !!p || L, Z = r === "password" ? v ? "text" : "password" : r, G = () => /* @__PURE__ */ e.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ e.createElement(
68
68
  "path",
69
69
  {
70
70
  d: "M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z",
71
71
  fill: "currentColor"
72
72
  }
73
- )), O = () => /* @__PURE__ */ e.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ e.createElement(
73
+ )), W = () => /* @__PURE__ */ e.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ e.createElement(
74
74
  "path",
75
75
  {
76
76
  d: "M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z",
77
77
  fill: "currentColor"
78
78
  }
79
- )), A = () => {
80
- v(!g);
79
+ )), $ = () => {
80
+ h(!v);
81
81
  }, X = (z) => {
82
- if (y) {
83
- const Y = z.target.value, j = _e(Y);
84
- z.target.value = j, j.length === 14 ? ge(j) ? E(null) : E("CPF inválido") : E(null);
82
+ if (x) {
83
+ const Y = z.target.value, j = Te(Y);
84
+ z.target.value = j, j.length === 14 ? ve(j) ? C(null) : C("CPF inválido") : C(null);
85
85
  }
86
86
  b && b(z);
87
87
  };
88
- return /* @__PURE__ */ e.createElement("div", { className: d("relative", w) }, /* @__PURE__ */ e.createElement(
88
+ return /* @__PURE__ */ e.createElement("div", { className: d("relative", f) }, /* @__PURE__ */ e.createElement(
89
89
  "input",
90
90
  {
91
- id: u.id || t,
91
+ id: c.id || t,
92
92
  type: Z,
93
93
  className: d(
94
94
  "peer flex h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 pt-6 pb-2 text-sm placeholder-transparent transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50",
95
- r === "password" || B ? "pr-12" : "",
95
+ r === "password" || M ? "pr-12" : "",
96
96
  // espaço extra para qualquer ícone (password ou customizado)
97
97
  V ? "border-red-500" : "",
98
98
  n
99
99
  ),
100
100
  onFocus: (z) => {
101
- R(!0), s && s(z);
101
+ S(!0), l && l(z);
102
102
  },
103
- maxLength: y ? 14 : u.maxLength,
104
- inputMode: y ? "numeric" : u.inputMode,
105
- ...l && t ? (() => {
106
- const z = N(t, y ? {
107
- validate: (D) => D ? D.length < 14 ? "CPF incompleto" : ge(D) ? !0 : "CPF inválido" : "CPF é obrigatório"
103
+ maxLength: x ? 14 : c.maxLength,
104
+ inputMode: x ? "numeric" : c.inputMode,
105
+ ...i && t ? (() => {
106
+ const z = F(t, x ? {
107
+ validate: (D) => D ? D.length < 14 ? "CPF incompleto" : ve(D) ? !0 : "CPF inválido" : "CPF é obrigatório"
108
108
  } : void 0), Y = z.onBlur, j = z.onChange;
109
109
  return {
110
110
  ...z,
111
111
  ref: (D) => {
112
- typeof L == "function" ? L(D) : L && (L.current = D), z.ref && z.ref(D);
112
+ typeof I == "function" ? I(D) : I && (I.current = D), z.ref && z.ref(D);
113
113
  },
114
114
  onBlur: (D) => {
115
- R(!1), x && x(D), Y && Y(D);
115
+ S(!1), w && w(D), Y && Y(D);
116
116
  },
117
117
  onChange: (D) => {
118
118
  X(D), j && j(D);
119
119
  }
120
120
  };
121
121
  })() : {
122
- ref: L,
122
+ ref: I,
123
123
  onBlur: (z) => {
124
- R(!1), x && x(z);
124
+ S(!1), w && w(z);
125
125
  },
126
126
  onChange: X
127
127
  },
128
- ...u
128
+ ...c
129
129
  }
130
130
  ), a && /* @__PURE__ */ e.createElement(
131
131
  "label",
132
132
  {
133
- htmlFor: u.id || t,
133
+ htmlFor: c.id || t,
134
134
  className: d(
135
135
  "absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
136
136
  J ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
@@ -142,107 +142,107 @@ const Ge = ({
142
142
  {
143
143
  type: "button",
144
144
  className: "absolute top-1/2 right-3 -translate-y-1/2 text-gray-400 hover:text-[var(--primary,#2563eb)] transition-colors duration-200 focus:outline-none focus:text-[var(--primary,#2563eb)]",
145
- onClick: A,
146
- "aria-label": g ? "Esconder senha" : "Mostrar senha",
145
+ onClick: $,
146
+ "aria-label": v ? "Esconder senha" : "Mostrar senha",
147
147
  tabIndex: -1
148
148
  },
149
- g ? /* @__PURE__ */ e.createElement(O, null) : /* @__PURE__ */ e.createElement(G, null)
150
- ), B && r !== "password" && /* @__PURE__ */ e.createElement(
149
+ v ? /* @__PURE__ */ e.createElement(W, null) : /* @__PURE__ */ e.createElement(G, null)
150
+ ), M && r !== "password" && /* @__PURE__ */ e.createElement(
151
151
  "div",
152
152
  {
153
153
  className: d(
154
154
  "absolute top-1/2 right-3 -translate-y-1/2 text-gray-400 cursor-pointer hover:text-[var(--primary,#2563eb)] transition-colors duration-200",
155
- _
155
+ N
156
156
  ),
157
- onClick: S
157
+ onClick: y
158
158
  },
159
- /* @__PURE__ */ e.createElement(B, null)
159
+ /* @__PURE__ */ e.createElement(M, null)
160
160
  ), V && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, V));
161
161
  }
162
162
  );
163
- Ie.displayName = "Input";
164
- const Te = e.forwardRef(
163
+ $e.displayName = "Input";
164
+ const ze = e.forwardRef(
165
165
  ({
166
166
  name: t,
167
167
  label: n,
168
168
  options: r,
169
169
  className: a,
170
- containerClassName: s,
171
- isClearable: x,
170
+ containerClassName: l,
171
+ isClearable: w,
172
172
  searchable: b = !1,
173
- filterPlaceholder: B = "Digite para filtrar...",
174
- caseSensitive: _ = !1,
175
- filterFunction: S,
176
- onFocus: w,
177
- onBlur: y,
178
- ...u
179
- }, L) => {
180
- var re, ne, c, $;
181
- const [k, R] = e.useState(!1), [g, v] = e.useState(!1), [h, E] = e.useState(""), [l, C] = e.useState({
173
+ filterPlaceholder: M = "Digite para filtrar...",
174
+ caseSensitive: N = !1,
175
+ filterFunction: y,
176
+ onFocus: f,
177
+ onBlur: x,
178
+ ...c
179
+ }, I) => {
180
+ var re, ne, u, T;
181
+ const [k, S] = e.useState(!1), [v, h] = e.useState(!1), [E, C] = e.useState(""), [i, R] = e.useState({
182
182
  top: 0,
183
183
  left: 0,
184
184
  width: 0
185
- }), N = e.useRef(null), M = e.useRef(null), m = ie(), V = m == null ? void 0 : m.control, U = V && t ? ce({ control: V, name: t }) : void 0, F = u.value ?? U ?? "", J = (c = (ne = (re = m == null ? void 0 : m.formState) == null ? void 0 : re.errors) == null ? void 0 : ne[t]) == null ? void 0 : c.message, G = S || ((o, W) => {
186
- const K = _ ? o.label : o.label.toLowerCase(), te = _ ? W : W.toLowerCase();
185
+ }), F = e.useRef(null), B = e.useRef(null), p = ce(), V = p == null ? void 0 : p.control, U = V && t ? de({ control: V, name: t }) : void 0, L = c.value ?? U ?? "", J = (u = (ne = (re = p == null ? void 0 : p.formState) == null ? void 0 : re.errors) == null ? void 0 : ne[t]) == null ? void 0 : u.message, G = y || ((s, O) => {
186
+ const K = N ? s.label : s.label.toLowerCase(), te = N ? O : O.toLowerCase();
187
187
  return K.includes(te);
188
- }), O = h.trim() ? r.filter((o) => G(o, h.trim())) : r, A = r.find((o) => o.value === F), X = b && g ? h : (A == null ? void 0 : A.label) || "", I = k || !!F || b && !!h, P = e.useCallback(() => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 768, []), q = e.useCallback(() => {
189
- if (N.current && g) {
190
- const o = N.current.getBoundingClientRect(), W = P(), K = window.innerHeight, te = window.innerWidth, Q = 152;
191
- let p = o.bottom + 4, H = o.left;
192
- if (W) {
193
- const ae = K - o.bottom, f = o.top;
194
- ae < Q && f > Q && (p = o.top - Q - 4);
195
- const T = 16, ee = te - o.width - T;
196
- H = Math.min(Math.max(H, T), ee);
188
+ }), W = E.trim() ? r.filter((s) => G(s, E.trim())) : r, $ = r.find((s) => s.value === L), X = b && v ? E : ($ == null ? void 0 : $.label) || "", _ = k || !!L || b && !!E, P = e.useCallback(() => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 768, []), q = e.useCallback(() => {
189
+ if (F.current && v) {
190
+ const s = F.current.getBoundingClientRect(), O = P(), K = window.innerHeight, te = window.innerWidth, Q = 152;
191
+ let g = s.bottom + 4, H = s.left;
192
+ if (O) {
193
+ const ae = K - s.bottom, m = s.top;
194
+ ae < Q && m > Q && (g = s.top - Q - 4);
195
+ const A = 16, ee = te - s.width - A;
196
+ H = Math.min(Math.max(H, A), ee);
197
197
  } else
198
- K - o.bottom < Q && (p = o.top - Q - 4);
199
- C({
200
- top: p,
198
+ K - s.bottom < Q && (g = s.top - Q - 4);
199
+ R({
200
+ top: g,
201
201
  left: H,
202
- width: o.width
202
+ width: s.width
203
203
  });
204
204
  }
205
- }, [g, P]);
205
+ }, [v, P]);
206
206
  e.useEffect(() => {
207
- if (q(), g) {
208
- const o = () => q(), W = () => q();
209
- return window.addEventListener("resize", o), window.addEventListener("scroll", W, !0), () => {
210
- window.removeEventListener("resize", o), window.removeEventListener("scroll", W, !0);
207
+ if (q(), v) {
208
+ const s = () => q(), O = () => q();
209
+ return window.addEventListener("resize", s), window.addEventListener("scroll", O, !0), () => {
210
+ window.removeEventListener("resize", s), window.removeEventListener("scroll", O, !0);
211
211
  };
212
212
  }
213
- }, [g, q]), e.useEffect(() => {
214
- const o = (W) => {
215
- N.current && !N.current.contains(W.target) && (v(!1), R(!1));
213
+ }, [v, q]), e.useEffect(() => {
214
+ const s = (O) => {
215
+ F.current && !F.current.contains(O.target) && (h(!1), S(!1));
216
216
  };
217
- return document.addEventListener("mousedown", o), () => {
218
- document.removeEventListener("mousedown", o);
217
+ return document.addEventListener("mousedown", s), () => {
218
+ document.removeEventListener("mousedown", s);
219
219
  };
220
220
  }, []);
221
221
  const z = () => {
222
- v((o) => !o), R(!0);
223
- }, Y = (o) => {
224
- R(!0), w && w(o);
225
- }, j = (o) => {
226
- y && y(o);
227
- }, D = (o) => {
228
- E(o.target.value);
229
- }, oe = (o) => {
230
- if (m && t && m.setValue(t, o), u.onChange) {
231
- const W = {
232
- target: { value: o }
222
+ h((s) => !s), S(!0);
223
+ }, Y = (s) => {
224
+ S(!0), f && f(s);
225
+ }, j = (s) => {
226
+ x && x(s);
227
+ }, D = (s) => {
228
+ C(s.target.value);
229
+ }, oe = (s) => {
230
+ if (p && t && p.setValue(t, s), c.onChange) {
231
+ const O = {
232
+ target: { value: s }
233
233
  };
234
- u.onChange(W);
234
+ c.onChange(O);
235
235
  }
236
- v(!1), R(!1), E("");
236
+ h(!1), S(!1), C("");
237
237
  };
238
- return /* @__PURE__ */ e.createElement("div", { className: d("relative", s), ref: N }, /* @__PURE__ */ e.createElement(
238
+ return /* @__PURE__ */ e.createElement("div", { className: d("relative", l), ref: F }, /* @__PURE__ */ e.createElement(
239
239
  "div",
240
240
  {
241
- id: u.id || t,
241
+ id: c.id || t,
242
242
  tabIndex: 0,
243
243
  role: "button",
244
244
  "aria-haspopup": "listbox",
245
- "aria-expanded": g,
245
+ "aria-expanded": v,
246
246
  className: d(
247
247
  "peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",
248
248
  a
@@ -250,43 +250,43 @@ const Te = e.forwardRef(
250
250
  onClick: b ? void 0 : z,
251
251
  onFocus: b ? void 0 : Y,
252
252
  onBlur: b ? void 0 : j,
253
- ref: L
253
+ ref: I
254
254
  },
255
255
  b ? /* @__PURE__ */ e.createElement(
256
256
  "input",
257
257
  {
258
- ref: M,
258
+ ref: B,
259
259
  type: "text",
260
260
  value: X,
261
261
  onChange: D,
262
- onFocus: b ? (o) => {
263
- R(!0), v(!0), w && w(o);
262
+ onFocus: b ? (s) => {
263
+ S(!0), h(!0), f && f(s);
264
264
  } : void 0,
265
- onBlur: b ? (o) => {
266
- y && y(o);
265
+ onBlur: b ? (s) => {
266
+ x && x(s);
267
267
  } : void 0,
268
- placeholder: n ? "" : B || "Selecione...",
268
+ placeholder: n ? "" : M || "Selecione...",
269
269
  className: d(
270
270
  "w-full bg-transparent border-none outline-none text-sm",
271
- !F && !h && "text-gray-400"
271
+ !L && !E && "text-gray-400"
272
272
  )
273
273
  }
274
- ) : /* @__PURE__ */ e.createElement("span", { className: d("block truncate", !F && "text-gray-400") }, (($ = r.find((o) => o.value === F)) == null ? void 0 : $.label) || !n && "Selecione..."),
275
- x && F && /* @__PURE__ */ e.createElement(
274
+ ) : /* @__PURE__ */ e.createElement("span", { className: d("block truncate", !L && "text-gray-400") }, ((T = r.find((s) => s.value === L)) == null ? void 0 : T.label) || !n && "Selecione..."),
275
+ w && L && /* @__PURE__ */ e.createElement(
276
276
  "button",
277
277
  {
278
278
  type: "button",
279
279
  tabIndex: -1,
280
280
  "aria-label": "Limpar seleção",
281
281
  className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",
282
- onClick: (o) => {
283
- if (o.stopPropagation(), m && t && m.setValue(t, ""), u.onChange) {
284
- const W = {
282
+ onClick: (s) => {
283
+ if (s.stopPropagation(), p && t && p.setValue(t, ""), c.onChange) {
284
+ const O = {
285
285
  target: { value: "" }
286
286
  };
287
- u.onChange(W);
287
+ c.onChange(O);
288
288
  }
289
- v(!1), R(!1);
289
+ h(!1), S(!1);
290
290
  }
291
291
  },
292
292
  "✕"
@@ -294,10 +294,10 @@ const Te = e.forwardRef(
294
294
  ), n && /* @__PURE__ */ e.createElement(
295
295
  "label",
296
296
  {
297
- htmlFor: u.id || t,
297
+ htmlFor: c.id || t,
298
298
  className: d(
299
299
  "absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
300
- I ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
300
+ _ ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
301
301
  )
302
302
  },
303
303
  n
@@ -307,264 +307,264 @@ const Te = e.forwardRef(
307
307
  className: d(
308
308
  "absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden",
309
309
  "bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",
310
- g ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
310
+ v ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
311
311
  ),
312
312
  style: {
313
- maxHeight: g ? "9.5rem" : "0",
313
+ maxHeight: v ? "9.5rem" : "0",
314
314
  // 3 options * 2.5rem + padding
315
315
  overflowY: r.length > 3 ? "auto" : "hidden",
316
316
  position: "fixed",
317
317
  // Use fixed positioning to escape container overflow
318
- top: g ? `${l.top}px` : "auto",
319
- left: g ? `${l.left}px` : "auto",
320
- width: g ? `${l.width}px` : "auto",
318
+ top: v ? `${i.top}px` : "auto",
319
+ left: v ? `${i.left}px` : "auto",
320
+ width: v ? `${i.width}px` : "auto",
321
321
  zIndex: 9999,
322
- boxShadow: g ? "var(--select-dropdown-shadow)" : "none"
322
+ boxShadow: v ? "var(--select-dropdown-shadow)" : "none"
323
323
  }
324
324
  },
325
- O.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, "Nenhuma opção encontrada") : O.map((o) => /* @__PURE__ */ e.createElement(
325
+ W.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, "Nenhuma opção encontrada") : W.map((s) => /* @__PURE__ */ e.createElement(
326
326
  "div",
327
327
  {
328
- key: o.value,
328
+ key: s.value,
329
329
  className: d(
330
330
  "px-3 py-2 cursor-pointer text-sm transition-colors duration-150",
331
331
  "hover:bg-[var(--select-dropdown-hover)]",
332
- F === o.value && "bg-[var(--select-dropdown-selected)]"
332
+ L === s.value && "bg-[var(--select-dropdown-selected)]"
333
333
  ),
334
- onMouseDown: () => oe(o.value)
334
+ onMouseDown: () => oe(s.value)
335
335
  },
336
- o.label
336
+ s.label
337
337
  ))
338
338
  ), J && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, J));
339
339
  }
340
340
  );
341
- Te.displayName = "Select";
342
- const $e = e.forwardRef(
341
+ ze.displayName = "Select";
342
+ const Oe = e.forwardRef(
343
343
  ({
344
344
  name: t,
345
345
  className: n,
346
346
  label: r,
347
347
  onFocus: a,
348
- onBlur: s,
349
- Icon: x,
348
+ onBlur: l,
349
+ Icon: w,
350
350
  iconClassName: b,
351
- iconAction: B,
352
- containerClassName: _,
353
- rows: S = 4,
354
- ...w
355
- }, y) => {
356
- var C, N, M;
357
- const [u, L] = e.useState(!1), k = ie(), R = k == null ? void 0 : k.control, g = k == null ? void 0 : k.register, v = R && t ? ce({ control: R, name: t }) : void 0, h = w.value ?? v ?? "", E = (M = (N = (C = k == null ? void 0 : k.formState) == null ? void 0 : C.errors) == null ? void 0 : N[t]) == null ? void 0 : M.message, l = u || !!h;
358
- return /* @__PURE__ */ e.createElement("div", { className: d("relative", _) }, /* @__PURE__ */ e.createElement(
351
+ iconAction: M,
352
+ containerClassName: N,
353
+ rows: y = 4,
354
+ ...f
355
+ }, x) => {
356
+ var R, F, B;
357
+ const [c, I] = e.useState(!1), k = ce(), S = k == null ? void 0 : k.control, v = k == null ? void 0 : k.register, h = S && t ? de({ control: S, name: t }) : void 0, E = f.value ?? h ?? "", C = (B = (F = (R = k == null ? void 0 : k.formState) == null ? void 0 : R.errors) == null ? void 0 : F[t]) == null ? void 0 : B.message, i = c || !!E;
358
+ return /* @__PURE__ */ e.createElement("div", { className: d("relative", N) }, /* @__PURE__ */ e.createElement(
359
359
  "textarea",
360
360
  {
361
- id: w.id || t,
362
- rows: S,
361
+ id: f.id || t,
362
+ rows: y,
363
363
  className: d(
364
364
  "peer flex min-h-[80px] w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 pt-6 pb-2 text-sm placeholder-transparent transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 resize-vertical",
365
- x ? "pr-12" : "",
365
+ w ? "pr-12" : "",
366
366
  // espaço extra para ícone customizado
367
367
  n
368
368
  ),
369
- onFocus: (m) => {
370
- L(!0), a && a(m);
369
+ onFocus: (p) => {
370
+ I(!0), a && a(p);
371
371
  },
372
372
  ...k && t ? (() => {
373
- const m = g(t), V = m.onBlur;
373
+ const p = v(t), V = p.onBlur;
374
374
  return {
375
- ...m,
375
+ ...p,
376
376
  ref: (U) => {
377
- typeof y == "function" ? y(U) : y && (y.current = U), m.ref && m.ref(U);
377
+ typeof x == "function" ? x(U) : x && (x.current = U), p.ref && p.ref(U);
378
378
  },
379
379
  onBlur: (U) => {
380
- L(!1), s && s(U), V && V(U);
380
+ I(!1), l && l(U), V && V(U);
381
381
  }
382
382
  };
383
383
  })() : {
384
- ref: y,
385
- onBlur: (m) => {
386
- L(!1), s && s(m);
384
+ ref: x,
385
+ onBlur: (p) => {
386
+ I(!1), l && l(p);
387
387
  }
388
388
  },
389
- ...w
389
+ ...f
390
390
  }
391
391
  ), r && /* @__PURE__ */ e.createElement(
392
392
  "label",
393
393
  {
394
- htmlFor: w.id || t,
394
+ htmlFor: f.id || t,
395
395
  className: d(
396
396
  "absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
397
- l ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
397
+ i ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
398
398
  )
399
399
  },
400
400
  r
401
- ), x && /* @__PURE__ */ e.createElement(
401
+ ), w && /* @__PURE__ */ e.createElement(
402
402
  "div",
403
403
  {
404
404
  className: d(
405
405
  "absolute top-3 right-3 text-gray-400 cursor-pointer hover:text-[var(--primary,#2563eb)] transition-colors duration-200",
406
406
  b
407
407
  ),
408
- onClick: B
408
+ onClick: M
409
409
  },
410
- /* @__PURE__ */ e.createElement(x, null)
411
- ), E && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, E));
410
+ /* @__PURE__ */ e.createElement(w, null)
411
+ ), C && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, C));
412
412
  }
413
413
  );
414
- $e.displayName = "Textarea";
415
- const Ae = e.forwardRef(
414
+ Oe.displayName = "Textarea";
415
+ const We = e.forwardRef(
416
416
  ({
417
417
  name: t,
418
418
  label: n,
419
419
  loadOptions: r,
420
420
  className: a,
421
- containerClassName: s,
422
- isClearable: x,
421
+ containerClassName: l,
422
+ isClearable: w,
423
423
  defaultOptions: b = !1,
424
- loadingMessage: B = "Carregando...",
425
- noOptionsMessage: _ = "Nenhuma opção encontrada",
426
- searchable: S = !1,
427
- debounceMs: w = 300,
428
- onFocus: y,
429
- onBlur: u,
430
- ...L
424
+ loadingMessage: M = "Carregando...",
425
+ noOptionsMessage: N = "Nenhuma opção encontrada",
426
+ searchable: y = !1,
427
+ debounceMs: f = 300,
428
+ onFocus: x,
429
+ onBlur: c,
430
+ ...I
431
431
  }, k) => {
432
432
  var K, te, Q;
433
- const [R, g] = e.useState(!1), [v, h] = e.useState(!1), [E, l] = e.useState([]), [C, N] = e.useState(!1), [M, m] = e.useState(""), [V, U] = e.useState(""), [F, J] = e.useState({
433
+ const [S, v] = e.useState(!1), [h, E] = e.useState(!1), [C, i] = e.useState([]), [R, F] = e.useState(!1), [B, p] = e.useState(""), [V, U] = e.useState(""), [L, J] = e.useState({
434
434
  top: 0,
435
435
  left: 0,
436
436
  width: 0
437
- }), Z = e.useRef(null), G = e.useRef(null), O = ie(), A = O == null ? void 0 : O.control, X = A && t ? ce({ control: A, name: t }) : void 0, I = L.value ?? X ?? "", P = (Q = (te = (K = O == null ? void 0 : O.formState) == null ? void 0 : K.errors) == null ? void 0 : te[t]) == null ? void 0 : Q.message, q = R || !!I, z = e.useCallback(() => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 768, []), Y = e.useCallback(() => {
438
- if (Z.current && v) {
439
- const p = Z.current.getBoundingClientRect(), H = z(), ae = window.innerHeight, f = window.innerWidth, T = 152;
440
- let ee = p.bottom + 4, se = p.left;
437
+ }), Z = e.useRef(null), G = e.useRef(null), W = ce(), $ = W == null ? void 0 : W.control, X = $ && t ? de({ control: $, name: t }) : void 0, _ = I.value ?? X ?? "", P = (Q = (te = (K = W == null ? void 0 : W.formState) == null ? void 0 : K.errors) == null ? void 0 : te[t]) == null ? void 0 : Q.message, q = S || !!_, z = e.useCallback(() => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 768, []), Y = e.useCallback(() => {
438
+ if (Z.current && h) {
439
+ const g = Z.current.getBoundingClientRect(), H = z(), ae = window.innerHeight, m = window.innerWidth, A = 152;
440
+ let ee = g.bottom + 4, ie = g.left;
441
441
  if (H) {
442
- const le = ae - p.bottom, fe = p.top;
443
- le < T && fe > T && (ee = p.top - T - 4);
444
- const de = 16, me = f - p.width - de;
445
- se = Math.min(Math.max(se, de), me);
442
+ const se = ae - g.bottom, fe = g.top;
443
+ se < A && fe > A && (ee = g.top - A - 4);
444
+ const ue = 16, me = m - g.width - ue;
445
+ ie = Math.min(Math.max(ie, ue), me);
446
446
  } else
447
- ae - p.bottom < T && (ee = p.top - T - 4);
447
+ ae - g.bottom < A && (ee = g.top - A - 4);
448
448
  J({
449
449
  top: ee,
450
- left: se,
451
- width: p.width
450
+ left: ie,
451
+ width: g.width
452
452
  });
453
453
  }
454
- }, [v, z]);
454
+ }, [h, z]);
455
455
  e.useEffect(() => {
456
- if (Y(), v) {
457
- const p = () => Y(), H = () => Y();
458
- return window.addEventListener("resize", p), window.addEventListener("scroll", H, !0), () => {
459
- window.removeEventListener("resize", p), window.removeEventListener("scroll", H, !0);
456
+ if (Y(), h) {
457
+ const g = () => Y(), H = () => Y();
458
+ return window.addEventListener("resize", g), window.addEventListener("scroll", H, !0), () => {
459
+ window.removeEventListener("resize", g), window.removeEventListener("scroll", H, !0);
460
460
  };
461
461
  }
462
- }, [v, Y]), e.useEffect(() => {
463
- const p = setTimeout(() => {
464
- U(M);
465
- }, w);
466
- return () => clearTimeout(p);
467
- }, [M, w]), e.useEffect(() => {
468
- (v || b && E.length === 0) && j(S ? V : void 0);
469
- }, [V, v]), e.useEffect(() => {
470
- b === !0 ? j() : Array.isArray(b) && l(b);
462
+ }, [h, Y]), e.useEffect(() => {
463
+ const g = setTimeout(() => {
464
+ U(B);
465
+ }, f);
466
+ return () => clearTimeout(g);
467
+ }, [B, f]), e.useEffect(() => {
468
+ (h || b && C.length === 0) && j(y ? V : void 0);
469
+ }, [V, h]), e.useEffect(() => {
470
+ b === !0 ? j() : Array.isArray(b) && i(b);
471
471
  }, []);
472
- const j = async (p) => {
472
+ const j = async (g) => {
473
473
  try {
474
- N(!0);
475
- const H = await r(p);
476
- l(H);
474
+ F(!0);
475
+ const H = await r(g);
476
+ i(H);
477
477
  } catch (H) {
478
- console.error("Error loading options:", H), l([]);
478
+ console.error("Error loading options:", H), i([]);
479
479
  } finally {
480
- N(!1);
480
+ F(!1);
481
481
  }
482
482
  };
483
483
  e.useEffect(() => {
484
- const p = (H) => {
485
- Z.current && !Z.current.contains(H.target) && (h(!1), g(!1), m(""));
484
+ const g = (H) => {
485
+ Z.current && !Z.current.contains(H.target) && (E(!1), v(!1), p(""));
486
486
  };
487
- return document.addEventListener("mousedown", p), () => {
488
- document.removeEventListener("mousedown", p);
487
+ return document.addEventListener("mousedown", g), () => {
488
+ document.removeEventListener("mousedown", g);
489
489
  };
490
490
  }, []);
491
491
  const D = () => {
492
- v || (h(!0), g(!0), S && G.current && setTimeout(() => {
493
- var p;
494
- return (p = G.current) == null ? void 0 : p.focus();
492
+ h || (E(!0), v(!0), y && G.current && setTimeout(() => {
493
+ var g;
494
+ return (g = G.current) == null ? void 0 : g.focus();
495
495
  }, 0));
496
- }, oe = (p) => {
497
- g(!0), y && y(p);
498
- }, re = (p) => {
499
- u && u(p);
500
- }, ne = (p) => {
501
- m(p.target.value);
502
- }, c = (p) => {
503
- if (O && t && O.setValue(t, p), L.onChange) {
496
+ }, oe = (g) => {
497
+ v(!0), x && x(g);
498
+ }, re = (g) => {
499
+ c && c(g);
500
+ }, ne = (g) => {
501
+ p(g.target.value);
502
+ }, u = (g) => {
503
+ if (W && t && W.setValue(t, g), I.onChange) {
504
504
  const H = {
505
- target: { value: p }
505
+ target: { value: g }
506
506
  };
507
- L.onChange(H);
507
+ I.onChange(H);
508
508
  }
509
- h(!1), g(!1), m("");
510
- }, $ = (p) => {
511
- if (p.stopPropagation(), O && t && O.setValue(t, ""), L.onChange) {
509
+ E(!1), v(!1), p("");
510
+ }, T = (g) => {
511
+ if (g.stopPropagation(), W && t && W.setValue(t, ""), I.onChange) {
512
512
  const H = {
513
513
  target: { value: "" }
514
514
  };
515
- L.onChange(H);
515
+ I.onChange(H);
516
516
  }
517
- h(!1), g(!1), m("");
518
- }, o = E.find((p) => p.value === I), W = S && v ? M : (o == null ? void 0 : o.label) || "";
519
- return /* @__PURE__ */ e.createElement("div", { className: d("relative", s), ref: Z }, /* @__PURE__ */ e.createElement(
517
+ E(!1), v(!1), p("");
518
+ }, s = C.find((g) => g.value === _), O = y && h ? B : (s == null ? void 0 : s.label) || "";
519
+ return /* @__PURE__ */ e.createElement("div", { className: d("relative", l), ref: Z }, /* @__PURE__ */ e.createElement(
520
520
  "div",
521
521
  {
522
- id: L.id || t,
523
- tabIndex: S ? -1 : 0,
522
+ id: I.id || t,
523
+ tabIndex: y ? -1 : 0,
524
524
  role: "button",
525
525
  "aria-haspopup": "listbox",
526
- "aria-expanded": v,
526
+ "aria-expanded": h,
527
527
  className: d(
528
528
  "peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",
529
529
  a
530
530
  ),
531
531
  onClick: D,
532
- onFocus: S ? void 0 : oe,
533
- onBlur: S ? void 0 : re,
532
+ onFocus: y ? void 0 : oe,
533
+ onBlur: y ? void 0 : re,
534
534
  ref: k
535
535
  },
536
- S ? /* @__PURE__ */ e.createElement(
536
+ y ? /* @__PURE__ */ e.createElement(
537
537
  "input",
538
538
  {
539
539
  ref: G,
540
540
  type: "text",
541
- value: W,
541
+ value: O,
542
542
  onChange: ne,
543
543
  onFocus: oe,
544
544
  onBlur: re,
545
545
  placeholder: n ? "" : "Selecione...",
546
546
  className: d(
547
547
  "w-full bg-transparent border-none outline-none text-sm",
548
- !I && !M && "text-gray-400"
548
+ !_ && !B && "text-gray-400"
549
549
  )
550
550
  }
551
- ) : /* @__PURE__ */ e.createElement("span", { className: d("block truncate", !I && "text-gray-400") }, (o == null ? void 0 : o.label) || !n && "Selecione..."),
552
- C && /* @__PURE__ */ e.createElement("div", { className: "absolute right-8 top-1/2 -translate-y-1/2" }, /* @__PURE__ */ e.createElement("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]" })),
553
- x && I && !C && /* @__PURE__ */ e.createElement(
551
+ ) : /* @__PURE__ */ e.createElement("span", { className: d("block truncate", !_ && "text-gray-400") }, (s == null ? void 0 : s.label) || !n && "Selecione..."),
552
+ R && /* @__PURE__ */ e.createElement("div", { className: "absolute right-8 top-1/2 -translate-y-1/2" }, /* @__PURE__ */ e.createElement("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]" })),
553
+ w && _ && !R && /* @__PURE__ */ e.createElement(
554
554
  "button",
555
555
  {
556
556
  type: "button",
557
557
  tabIndex: -1,
558
558
  "aria-label": "Limpar seleção",
559
559
  className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",
560
- onClick: $
560
+ onClick: T
561
561
  },
562
562
  "✕"
563
563
  )
564
564
  ), n && /* @__PURE__ */ e.createElement(
565
565
  "label",
566
566
  {
567
- htmlFor: L.id || t,
567
+ htmlFor: I.id || t,
568
568
  className: d(
569
569
  "absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
570
570
  q ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
@@ -577,122 +577,122 @@ const Ae = e.forwardRef(
577
577
  className: d(
578
578
  "absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden",
579
579
  "bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",
580
- v ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
580
+ h ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
581
581
  ),
582
582
  style: {
583
- maxHeight: v ? "9.5rem" : "0",
584
- overflowY: E.length > 3 ? "auto" : "hidden",
583
+ maxHeight: h ? "9.5rem" : "0",
584
+ overflowY: C.length > 3 ? "auto" : "hidden",
585
585
  position: "fixed",
586
586
  // Use fixed positioning to escape container overflow
587
- top: v ? `${F.top}px` : "auto",
588
- left: v ? `${F.left}px` : "auto",
589
- width: v ? `${F.width}px` : "auto",
587
+ top: h ? `${L.top}px` : "auto",
588
+ left: h ? `${L.left}px` : "auto",
589
+ width: h ? `${L.width}px` : "auto",
590
590
  zIndex: 9999,
591
- boxShadow: v ? "var(--select-dropdown-shadow)" : "none"
591
+ boxShadow: h ? "var(--select-dropdown-shadow)" : "none"
592
592
  }
593
593
  },
594
- C ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, B) : E.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, _) : E.map((p) => /* @__PURE__ */ e.createElement(
594
+ R ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, M) : C.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, N) : C.map((g) => /* @__PURE__ */ e.createElement(
595
595
  "div",
596
596
  {
597
- key: p.value,
597
+ key: g.value,
598
598
  className: d(
599
599
  "px-3 py-2 cursor-pointer text-sm transition-colors duration-150",
600
600
  "hover:bg-[var(--select-dropdown-hover)]",
601
- I === p.value && "bg-[var(--select-dropdown-selected)]"
601
+ _ === g.value && "bg-[var(--select-dropdown-selected)]"
602
602
  ),
603
- onMouseDown: () => c(p.value)
603
+ onMouseDown: () => u(g.value)
604
604
  },
605
- p.label
605
+ g.label
606
606
  ))
607
607
  ), P && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, P));
608
608
  }
609
609
  );
610
- Ae.displayName = "AsyncSelect";
611
- const ze = e.forwardRef(
610
+ We.displayName = "AsyncSelect";
611
+ const Ve = e.forwardRef(
612
612
  ({
613
613
  name: t,
614
614
  label: n,
615
615
  options: r,
616
616
  className: a,
617
- containerClassName: s,
618
- isClearable: x,
617
+ containerClassName: l,
618
+ isClearable: w,
619
619
  searchable: b = !1,
620
- filterPlaceholder: B = "Digite para filtrar...",
621
- caseSensitive: _ = !1,
622
- filterFunction: S,
623
- onFocus: w,
624
- onBlur: y,
625
- ...u
626
- }, L) => {
620
+ filterPlaceholder: M = "Digite para filtrar...",
621
+ caseSensitive: N = !1,
622
+ filterFunction: y,
623
+ onFocus: f,
624
+ onBlur: x,
625
+ ...c
626
+ }, I) => {
627
627
  var oe, re, ne;
628
- const [k, R] = e.useState(!1), [g, v] = e.useState(!1), [h, E] = e.useState(""), [l, C] = e.useState({
628
+ const [k, S] = e.useState(!1), [v, h] = e.useState(!1), [E, C] = e.useState(""), [i, R] = e.useState({
629
629
  top: 0,
630
630
  left: 0,
631
631
  width: 0
632
- }), N = e.useRef(null), M = e.useRef(null), m = ie(), V = m == null ? void 0 : m.control, U = V && t ? ce({ control: V, name: t }) : void 0, F = u.value ?? U ?? [], J = (ne = (re = (oe = m == null ? void 0 : m.formState) == null ? void 0 : oe.errors) == null ? void 0 : re[t]) == null ? void 0 : ne.message, G = S || ((c, $) => {
633
- const o = _ ? c.label : c.label.toLowerCase(), W = _ ? $ : $.toLowerCase();
634
- return o.includes(W);
635
- }), O = h.trim() ? r.filter((c) => G(c, h.trim())) : r, A = k || F && F.length > 0 || b && !!h, X = e.useCallback(() => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 768, []), I = e.useCallback(() => {
636
- if (N.current && g) {
637
- const c = N.current.getBoundingClientRect(), $ = X(), o = window.innerHeight, W = window.innerWidth, K = 152;
638
- let te = c.bottom + 4, Q = c.left;
639
- if ($) {
640
- const p = o - c.bottom, H = c.top;
641
- p < K && H > K && (te = c.top - K - 4);
642
- const ae = 16, f = W - c.width - ae;
643
- Q = Math.min(Math.max(Q, ae), f);
632
+ }), F = e.useRef(null), B = e.useRef(null), p = ce(), V = p == null ? void 0 : p.control, U = V && t ? de({ control: V, name: t }) : void 0, L = c.value ?? U ?? [], J = (ne = (re = (oe = p == null ? void 0 : p.formState) == null ? void 0 : oe.errors) == null ? void 0 : re[t]) == null ? void 0 : ne.message, G = y || ((u, T) => {
633
+ const s = N ? u.label : u.label.toLowerCase(), O = N ? T : T.toLowerCase();
634
+ return s.includes(O);
635
+ }), W = E.trim() ? r.filter((u) => G(u, E.trim())) : r, $ = k || L && L.length > 0 || b && !!E, X = e.useCallback(() => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 768, []), _ = e.useCallback(() => {
636
+ if (F.current && v) {
637
+ const u = F.current.getBoundingClientRect(), T = X(), s = window.innerHeight, O = window.innerWidth, K = 152;
638
+ let te = u.bottom + 4, Q = u.left;
639
+ if (T) {
640
+ const g = s - u.bottom, H = u.top;
641
+ g < K && H > K && (te = u.top - K - 4);
642
+ const ae = 16, m = O - u.width - ae;
643
+ Q = Math.min(Math.max(Q, ae), m);
644
644
  } else
645
- o - c.bottom < K && (te = c.top - K - 4);
646
- C({
645
+ s - u.bottom < K && (te = u.top - K - 4);
646
+ R({
647
647
  top: te,
648
648
  left: Q,
649
- width: c.width
649
+ width: u.width
650
650
  });
651
651
  }
652
- }, [g, X]);
652
+ }, [v, X]);
653
653
  e.useEffect(() => {
654
- if (I(), g) {
655
- const c = () => I(), $ = () => I();
656
- return window.addEventListener("resize", c), window.addEventListener("scroll", $, !0), () => {
657
- window.removeEventListener("resize", c), window.removeEventListener("scroll", $, !0);
654
+ if (_(), v) {
655
+ const u = () => _(), T = () => _();
656
+ return window.addEventListener("resize", u), window.addEventListener("scroll", T, !0), () => {
657
+ window.removeEventListener("resize", u), window.removeEventListener("scroll", T, !0);
658
658
  };
659
659
  }
660
- }, [g, I]), e.useEffect(() => {
661
- const c = ($) => {
662
- N.current && !N.current.contains($.target) && (v(!1), R(!1));
660
+ }, [v, _]), e.useEffect(() => {
661
+ const u = (T) => {
662
+ F.current && !F.current.contains(T.target) && (h(!1), S(!1));
663
663
  };
664
- return document.addEventListener("mousedown", c), () => {
665
- document.removeEventListener("mousedown", c);
664
+ return document.addEventListener("mousedown", u), () => {
665
+ document.removeEventListener("mousedown", u);
666
666
  };
667
667
  }, []);
668
668
  const P = () => {
669
- v((c) => !c), R(!0);
670
- }, q = (c) => {
671
- R(!0), w && w(c);
672
- }, z = (c) => {
673
- y && y(c);
674
- }, Y = (c) => {
675
- var o;
676
- let $;
677
- F.includes(c) ? $ = F.filter((W) => W !== c) : $ = [...F, c], m && t && m.setValue(t, $), u.onChange && ((o = u.onChange) == null || o.call(u, {
678
- target: { value: $ }
679
- })), R(!0);
680
- }, j = (c) => {
681
- var $;
682
- c.stopPropagation(), m && t && m.setValue(t, []), u.onChange && (($ = u.onChange) == null || $.call(u, {
669
+ h((u) => !u), S(!0);
670
+ }, q = (u) => {
671
+ S(!0), f && f(u);
672
+ }, z = (u) => {
673
+ x && x(u);
674
+ }, Y = (u) => {
675
+ var s;
676
+ let T;
677
+ L.includes(u) ? T = L.filter((O) => O !== u) : T = [...L, u], p && t && p.setValue(t, T), c.onChange && ((s = c.onChange) == null || s.call(c, {
678
+ target: { value: T }
679
+ })), S(!0);
680
+ }, j = (u) => {
681
+ var T;
682
+ u.stopPropagation(), p && t && p.setValue(t, []), c.onChange && ((T = c.onChange) == null || T.call(c, {
683
683
  target: { value: [] }
684
- })), v(!1), R(!1);
685
- }, D = (c) => {
686
- E(c.target.value);
684
+ })), h(!1), S(!1);
685
+ }, D = (u) => {
686
+ C(u.target.value);
687
687
  };
688
- return /* @__PURE__ */ e.createElement("div", { className: d("relative", s), ref: N }, /* @__PURE__ */ e.createElement(
688
+ return /* @__PURE__ */ e.createElement("div", { className: d("relative", l), ref: F }, /* @__PURE__ */ e.createElement(
689
689
  "div",
690
690
  {
691
- id: u.id || t,
691
+ id: c.id || t,
692
692
  tabIndex: 0,
693
693
  role: "button",
694
694
  "aria-haspopup": "listbox",
695
- "aria-expanded": g,
695
+ "aria-expanded": v,
696
696
  className: d(
697
697
  "peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",
698
698
  a
@@ -700,7 +700,7 @@ const ze = e.forwardRef(
700
700
  onClick: b ? void 0 : P,
701
701
  onFocus: b ? void 0 : q,
702
702
  onBlur: b ? void 0 : z,
703
- ref: L
703
+ ref: I
704
704
  },
705
705
  /* @__PURE__ */ e.createElement(
706
706
  "div",
@@ -708,26 +708,26 @@ const ze = e.forwardRef(
708
708
  className: "flex flex-nowrap gap-1 items-center min-h-[1.5rem] w-full overflow-x-auto",
709
709
  style: { scrollbarWidth: "none" }
710
710
  },
711
- F && F.length > 0 ? r.filter((c) => F.includes(c.value)).map((c) => /* @__PURE__ */ e.createElement(
711
+ L && L.length > 0 ? r.filter((u) => L.includes(u.value)).map((u) => /* @__PURE__ */ e.createElement(
712
712
  "span",
713
713
  {
714
- key: c.value,
714
+ key: u.value,
715
715
  className: "flex items-center border border-blue-200 bg-blue-50 text-blue-700 rounded-2xl px-3 py-1 text-xs shadow-sm mr-1 gap-2",
716
716
  style: { maxWidth: "140px" }
717
717
  },
718
- /* @__PURE__ */ e.createElement("span", { className: "truncate", title: c.label }, c.label),
718
+ /* @__PURE__ */ e.createElement("span", { className: "truncate", title: u.label }, u.label),
719
719
  /* @__PURE__ */ e.createElement(
720
720
  "button",
721
721
  {
722
722
  type: "button",
723
723
  className: "ml-1 text-[var(--primary,#2563eb)] hover:text-red-500 focus:outline-none w-4 h-4 flex items-center justify-center rounded-full transition-colors duration-150",
724
- "aria-label": `Remover ${c.label}`,
724
+ "aria-label": `Remover ${u.label}`,
725
725
  tabIndex: -1,
726
- onClick: ($) => {
727
- $.stopPropagation();
728
- const o = F.filter((W) => W !== c.value);
729
- m && t && m.setValue(t, o), u.onChange && u.onChange({
730
- target: { value: o }
726
+ onClick: (T) => {
727
+ T.stopPropagation();
728
+ const s = L.filter((O) => O !== u.value);
729
+ p && t && p.setValue(t, s), c.onChange && c.onChange({
730
+ target: { value: s }
731
731
  });
732
732
  }
733
733
  },
@@ -755,22 +755,22 @@ const ze = e.forwardRef(
755
755
  b && /* @__PURE__ */ e.createElement(
756
756
  "input",
757
757
  {
758
- ref: M,
758
+ ref: B,
759
759
  type: "text",
760
- value: h,
760
+ value: E,
761
761
  onChange: D,
762
- onFocus: (c) => {
763
- R(!0), v(!0), w && w(c);
762
+ onFocus: (u) => {
763
+ S(!0), h(!0), f && f(u);
764
764
  },
765
- onBlur: (c) => {
766
- y && y(c);
765
+ onBlur: (u) => {
766
+ x && x(u);
767
767
  },
768
- placeholder: n ? F && F.length > 0 ? "" : B : B || "Selecione...",
768
+ placeholder: n ? L && L.length > 0 ? "" : M : M || "Selecione...",
769
769
  className: "flex-1 bg-transparent border-none outline-none text-sm min-w-[100px]"
770
770
  }
771
771
  )
772
772
  ),
773
- x && F && F.length > 0 && /* @__PURE__ */ e.createElement(
773
+ w && L && L.length > 0 && /* @__PURE__ */ e.createElement(
774
774
  "button",
775
775
  {
776
776
  type: "button",
@@ -784,10 +784,10 @@ const ze = e.forwardRef(
784
784
  ), n && /* @__PURE__ */ e.createElement(
785
785
  "label",
786
786
  {
787
- htmlFor: u.id || t,
787
+ htmlFor: c.id || t,
788
788
  className: d(
789
789
  "absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
790
- A ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
790
+ $ ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
791
791
  )
792
792
  },
793
793
  n
@@ -797,183 +797,183 @@ const ze = e.forwardRef(
797
797
  className: d(
798
798
  "absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden",
799
799
  "bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",
800
- g ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
800
+ v ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
801
801
  ),
802
802
  style: {
803
- maxHeight: g ? "9.5rem" : "0",
803
+ maxHeight: v ? "9.5rem" : "0",
804
804
  overflowY: r.length > 3 ? "auto" : "hidden",
805
805
  position: "fixed",
806
806
  // Use fixed positioning to escape container overflow
807
- top: g ? `${l.top}px` : "auto",
808
- left: g ? `${l.left}px` : "auto",
809
- width: g ? `${l.width}px` : "auto",
807
+ top: v ? `${i.top}px` : "auto",
808
+ left: v ? `${i.left}px` : "auto",
809
+ width: v ? `${i.width}px` : "auto",
810
810
  zIndex: 9999,
811
- boxShadow: g ? "var(--select-dropdown-shadow)" : "none"
811
+ boxShadow: v ? "var(--select-dropdown-shadow)" : "none"
812
812
  }
813
813
  },
814
- O.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, "Nenhuma opção encontrada") : O.map((c) => /* @__PURE__ */ e.createElement(
814
+ W.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, "Nenhuma opção encontrada") : W.map((u) => /* @__PURE__ */ e.createElement(
815
815
  "div",
816
816
  {
817
- key: c.value,
817
+ key: u.value,
818
818
  className: d(
819
819
  "px-3 py-2 cursor-pointer text-sm flex items-center gap-2 transition-colors duration-150",
820
820
  "hover:bg-[var(--select-dropdown-hover)]",
821
- F.includes(c.value) && "bg-[var(--select-dropdown-selected)] font-semibold"
821
+ L.includes(u.value) && "bg-[var(--select-dropdown-selected)] font-semibold"
822
822
  ),
823
- onMouseDown: () => Y(c.value)
823
+ onMouseDown: () => Y(u.value)
824
824
  },
825
825
  /* @__PURE__ */ e.createElement(
826
826
  "input",
827
827
  {
828
828
  type: "checkbox",
829
- checked: F.includes(c.value),
829
+ checked: L.includes(u.value),
830
830
  readOnly: !0,
831
831
  className: "accent-blue-500"
832
832
  }
833
833
  ),
834
- c.label
834
+ u.label
835
835
  ))
836
836
  ), J && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, J));
837
837
  }
838
838
  );
839
- ze.displayName = "MultiSelect";
840
- const We = e.forwardRef(
839
+ Ve.displayName = "MultiSelect";
840
+ const He = e.forwardRef(
841
841
  ({
842
842
  name: t,
843
843
  label: n,
844
844
  loadOptions: r,
845
845
  className: a,
846
- containerClassName: s,
847
- isClearable: x,
846
+ containerClassName: l,
847
+ isClearable: w,
848
848
  defaultOptions: b = !1,
849
- loadingMessage: B = "Carregando...",
850
- noOptionsMessage: _ = "Nenhuma opção encontrada",
851
- searchable: S = !1,
852
- debounceMs: w = 300,
853
- maxSelectedDisplay: y = 3,
854
- onFocus: u,
855
- onBlur: L,
849
+ loadingMessage: M = "Carregando...",
850
+ noOptionsMessage: N = "Nenhuma opção encontrada",
851
+ searchable: y = !1,
852
+ debounceMs: f = 300,
853
+ maxSelectedDisplay: x = 3,
854
+ onFocus: c,
855
+ onBlur: I,
856
856
  ...k
857
- }, R) => {
858
- var p, H, ae;
859
- const [g, v] = e.useState(!1), [h, E] = e.useState(!1), [l, C] = e.useState([]), [N, M] = e.useState(!1), [m, V] = e.useState(""), [U, F] = e.useState(""), [J, Z] = e.useState({
857
+ }, S) => {
858
+ var g, H, ae;
859
+ const [v, h] = e.useState(!1), [E, C] = e.useState(!1), [i, R] = e.useState([]), [F, B] = e.useState(!1), [p, V] = e.useState(""), [U, L] = e.useState(""), [J, Z] = e.useState({
860
860
  top: 0,
861
861
  left: 0,
862
862
  width: 0
863
- }), G = e.useRef(null), O = e.useRef(null), A = ie(), X = A == null ? void 0 : A.control, I = X && t ? ce({ control: X, name: t }) : void 0, P = k.value ?? I ?? [], q = (ae = (H = (p = A == null ? void 0 : A.formState) == null ? void 0 : p.errors) == null ? void 0 : H[t]) == null ? void 0 : ae.message, z = g || P && P.length > 0, Y = e.useCallback(() => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 768, []), j = e.useCallback(() => {
864
- if (G.current && h) {
865
- const f = G.current.getBoundingClientRect(), T = Y(), ee = window.innerHeight, se = window.innerWidth, le = 152;
866
- let fe = f.bottom + 4, de = f.left;
867
- if (T) {
868
- const me = ee - f.bottom, Le = f.top;
869
- me < le && Le > le && (fe = f.top - le - 4);
870
- const be = 16, Me = se - f.width - be;
871
- de = Math.min(Math.max(de, be), Me);
863
+ }), G = e.useRef(null), W = e.useRef(null), $ = ce(), X = $ == null ? void 0 : $.control, _ = X && t ? de({ control: X, name: t }) : void 0, P = k.value ?? _ ?? [], q = (ae = (H = (g = $ == null ? void 0 : $.formState) == null ? void 0 : g.errors) == null ? void 0 : H[t]) == null ? void 0 : ae.message, z = v || P && P.length > 0, Y = e.useCallback(() => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 768, []), j = e.useCallback(() => {
864
+ if (G.current && E) {
865
+ const m = G.current.getBoundingClientRect(), A = Y(), ee = window.innerHeight, ie = window.innerWidth, se = 152;
866
+ let fe = m.bottom + 4, ue = m.left;
867
+ if (A) {
868
+ const me = ee - m.bottom, Pe = m.top;
869
+ me < se && Pe > se && (fe = m.top - se - 4);
870
+ const ge = 16, _e = ie - m.width - ge;
871
+ ue = Math.min(Math.max(ue, ge), _e);
872
872
  } else
873
- ee - f.bottom < le && (fe = f.top - le - 4);
873
+ ee - m.bottom < se && (fe = m.top - se - 4);
874
874
  Z({
875
875
  top: fe,
876
- left: de,
877
- width: f.width
876
+ left: ue,
877
+ width: m.width
878
878
  });
879
879
  }
880
- }, [h, Y]);
880
+ }, [E, Y]);
881
881
  e.useEffect(() => {
882
- if (j(), h) {
883
- const f = () => j(), T = () => j();
884
- return window.addEventListener("resize", f), window.addEventListener("scroll", T, !0), () => {
885
- window.removeEventListener("resize", f), window.removeEventListener("scroll", T, !0);
882
+ if (j(), E) {
883
+ const m = () => j(), A = () => j();
884
+ return window.addEventListener("resize", m), window.addEventListener("scroll", A, !0), () => {
885
+ window.removeEventListener("resize", m), window.removeEventListener("scroll", A, !0);
886
886
  };
887
887
  }
888
- }, [h, j]), e.useEffect(() => {
889
- const f = setTimeout(() => {
890
- F(m);
891
- }, w);
892
- return () => clearTimeout(f);
893
- }, [m, w]), e.useEffect(() => {
894
- (h || b && l.length === 0) && D(S ? U : void 0);
895
- }, [U, h]), e.useEffect(() => {
896
- b === !0 ? D() : Array.isArray(b) && C(b);
888
+ }, [E, j]), e.useEffect(() => {
889
+ const m = setTimeout(() => {
890
+ L(p);
891
+ }, f);
892
+ return () => clearTimeout(m);
893
+ }, [p, f]), e.useEffect(() => {
894
+ (E || b && i.length === 0) && D(y ? U : void 0);
895
+ }, [U, E]), e.useEffect(() => {
896
+ b === !0 ? D() : Array.isArray(b) && R(b);
897
897
  }, []);
898
- const D = async (f) => {
898
+ const D = async (m) => {
899
899
  try {
900
- M(!0);
901
- const T = await r(f);
902
- C(T);
903
- } catch (T) {
904
- console.error("Error loading options:", T), C([]);
900
+ B(!0);
901
+ const A = await r(m);
902
+ R(A);
903
+ } catch (A) {
904
+ console.error("Error loading options:", A), R([]);
905
905
  } finally {
906
- M(!1);
906
+ B(!1);
907
907
  }
908
908
  };
909
909
  e.useEffect(() => {
910
- const f = (T) => {
911
- G.current && !G.current.contains(T.target) && (E(!1), v(!1), V(""));
910
+ const m = (A) => {
911
+ G.current && !G.current.contains(A.target) && (C(!1), h(!1), V(""));
912
912
  };
913
- return document.addEventListener("mousedown", f), () => {
914
- document.removeEventListener("mousedown", f);
913
+ return document.addEventListener("mousedown", m), () => {
914
+ document.removeEventListener("mousedown", m);
915
915
  };
916
916
  }, []);
917
917
  const oe = () => {
918
- h || (E(!0), v(!0), S && O.current && setTimeout(() => {
919
- var f;
920
- return (f = O.current) == null ? void 0 : f.focus();
918
+ E || (C(!0), h(!0), y && W.current && setTimeout(() => {
919
+ var m;
920
+ return (m = W.current) == null ? void 0 : m.focus();
921
921
  }, 0));
922
- }, re = (f) => {
923
- v(!0), u && u(f);
924
- }, ne = (f) => {
925
- L && L(f);
926
- }, c = (f) => {
927
- V(f.target.value);
928
- }, $ = (f) => {
929
- let T;
930
- P.includes(f) ? T = P.filter((ee) => ee !== f) : T = [...P, f], A && t && A.setValue(t, T), k.onChange && k.onChange({
931
- target: { value: T }
932
- }), v(!0);
933
- }, o = (f, T) => {
934
- T.stopPropagation();
935
- const ee = P.filter((se) => se !== f);
936
- A && t && A.setValue(t, ee), k.onChange && k.onChange({
922
+ }, re = (m) => {
923
+ h(!0), c && c(m);
924
+ }, ne = (m) => {
925
+ I && I(m);
926
+ }, u = (m) => {
927
+ V(m.target.value);
928
+ }, T = (m) => {
929
+ let A;
930
+ P.includes(m) ? A = P.filter((ee) => ee !== m) : A = [...P, m], $ && t && $.setValue(t, A), k.onChange && k.onChange({
931
+ target: { value: A }
932
+ }), h(!0);
933
+ }, s = (m, A) => {
934
+ A.stopPropagation();
935
+ const ee = P.filter((ie) => ie !== m);
936
+ $ && t && $.setValue(t, ee), k.onChange && k.onChange({
937
937
  target: { value: ee }
938
938
  });
939
- }, W = (f) => {
940
- f.stopPropagation(), A && t && A.setValue(t, []), k.onChange && k.onChange({
939
+ }, O = (m) => {
940
+ m.stopPropagation(), $ && t && $.setValue(t, []), k.onChange && k.onChange({
941
941
  target: { value: [] }
942
- }), E(!1), v(!1), V("");
943
- }, K = l.filter((f) => P.includes(f.value)), te = K.slice(0, y), Q = K.length - y;
944
- return /* @__PURE__ */ e.createElement("div", { className: d("relative", s), ref: G }, /* @__PURE__ */ e.createElement(
942
+ }), C(!1), h(!1), V("");
943
+ }, K = i.filter((m) => P.includes(m.value)), te = K.slice(0, x), Q = K.length - x;
944
+ return /* @__PURE__ */ e.createElement("div", { className: d("relative", l), ref: G }, /* @__PURE__ */ e.createElement(
945
945
  "div",
946
946
  {
947
947
  id: k.id || t,
948
- tabIndex: S ? -1 : 0,
948
+ tabIndex: y ? -1 : 0,
949
949
  role: "button",
950
950
  "aria-haspopup": "listbox",
951
- "aria-expanded": h,
951
+ "aria-expanded": E,
952
952
  className: d(
953
953
  "peer flex items-center min-h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-2 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",
954
954
  a
955
955
  ),
956
956
  onClick: oe,
957
- onFocus: S ? void 0 : re,
958
- onBlur: S ? void 0 : ne,
959
- ref: R
957
+ onFocus: y ? void 0 : re,
958
+ onBlur: y ? void 0 : ne,
959
+ ref: S
960
960
  },
961
- /* @__PURE__ */ e.createElement("div", { className: "flex flex-wrap gap-1 items-center min-h-[1.5rem] w-full" }, te.map((f) => /* @__PURE__ */ e.createElement(
961
+ /* @__PURE__ */ e.createElement("div", { className: "flex flex-wrap gap-1 items-center min-h-[1.5rem] w-full" }, te.map((m) => /* @__PURE__ */ e.createElement(
962
962
  "span",
963
963
  {
964
- key: f.value,
964
+ key: m.value,
965
965
  className: "flex items-center border border-blue-200 bg-blue-50 text-blue-700 rounded-2xl px-3 py-1 text-xs shadow-sm gap-2",
966
966
  style: { maxWidth: "140px" }
967
967
  },
968
- /* @__PURE__ */ e.createElement("span", { className: "truncate", title: f.label }, f.label),
968
+ /* @__PURE__ */ e.createElement("span", { className: "truncate", title: m.label }, m.label),
969
969
  /* @__PURE__ */ e.createElement(
970
970
  "button",
971
971
  {
972
972
  type: "button",
973
973
  className: "ml-1 text-[var(--primary,#2563eb)] hover:text-red-500 focus:outline-none w-4 h-4 flex items-center justify-center rounded-full transition-colors duration-150",
974
- "aria-label": `Remover ${f.label}`,
974
+ "aria-label": `Remover ${m.label}`,
975
975
  tabIndex: -1,
976
- onClick: (T) => o(f.value, T)
976
+ onClick: (A) => s(m.value, A)
977
977
  },
978
978
  /* @__PURE__ */ e.createElement(
979
979
  "svg",
@@ -995,28 +995,28 @@ const We = e.forwardRef(
995
995
  )
996
996
  )
997
997
  )
998
- )), Q > 0 && /* @__PURE__ */ e.createElement("span", { className: "flex items-center border border-gray-200 bg-gray-100 text-gray-600 rounded-2xl px-3 py-1 text-xs" }, "+", Q, " mais"), S ? /* @__PURE__ */ e.createElement(
998
+ )), Q > 0 && /* @__PURE__ */ e.createElement("span", { className: "flex items-center border border-gray-200 bg-gray-100 text-gray-600 rounded-2xl px-3 py-1 text-xs" }, "+", Q, " mais"), y ? /* @__PURE__ */ e.createElement(
999
999
  "input",
1000
1000
  {
1001
- ref: O,
1001
+ ref: W,
1002
1002
  type: "text",
1003
- value: m,
1004
- onChange: c,
1003
+ value: p,
1004
+ onChange: u,
1005
1005
  onFocus: re,
1006
1006
  onBlur: ne,
1007
1007
  placeholder: P.length === 0 && !n ? "Selecione..." : "",
1008
1008
  className: "flex-1 min-w-[120px] bg-transparent border-none outline-none text-sm"
1009
1009
  }
1010
1010
  ) : P.length === 0 && !n && /* @__PURE__ */ e.createElement("span", { className: "text-gray-400 text-sm" }, "Selecione...")),
1011
- N && /* @__PURE__ */ e.createElement("div", { className: "absolute right-8 top-1/2 -translate-y-1/2" }, /* @__PURE__ */ e.createElement("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]" })),
1012
- x && P && P.length > 0 && !N && /* @__PURE__ */ e.createElement(
1011
+ F && /* @__PURE__ */ e.createElement("div", { className: "absolute right-8 top-1/2 -translate-y-1/2" }, /* @__PURE__ */ e.createElement("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]" })),
1012
+ w && P && P.length > 0 && !F && /* @__PURE__ */ e.createElement(
1013
1013
  "button",
1014
1014
  {
1015
1015
  type: "button",
1016
1016
  tabIndex: -1,
1017
1017
  "aria-label": "Limpar seleção",
1018
1018
  className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",
1019
- onClick: W
1019
+ onClick: O
1020
1020
  },
1021
1021
  "✕"
1022
1022
  )
@@ -1036,69 +1036,69 @@ const We = e.forwardRef(
1036
1036
  className: d(
1037
1037
  "absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden",
1038
1038
  "bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",
1039
- h ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
1039
+ E ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
1040
1040
  ),
1041
1041
  style: {
1042
- maxHeight: h ? "9.5rem" : "0",
1043
- overflowY: l.length > 3 ? "auto" : "hidden",
1042
+ maxHeight: E ? "9.5rem" : "0",
1043
+ overflowY: i.length > 3 ? "auto" : "hidden",
1044
1044
  position: "fixed",
1045
1045
  // Use fixed positioning to escape container overflow
1046
- top: h ? `${J.top}px` : "auto",
1047
- left: h ? `${J.left}px` : "auto",
1048
- width: h ? `${J.width}px` : "auto",
1046
+ top: E ? `${J.top}px` : "auto",
1047
+ left: E ? `${J.left}px` : "auto",
1048
+ width: E ? `${J.width}px` : "auto",
1049
1049
  zIndex: 9999,
1050
- boxShadow: h ? "var(--select-dropdown-shadow)" : "none"
1050
+ boxShadow: E ? "var(--select-dropdown-shadow)" : "none"
1051
1051
  }
1052
1052
  },
1053
- N ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, B) : l.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, _) : l.map((f) => /* @__PURE__ */ e.createElement(
1053
+ F ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, M) : i.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, N) : i.map((m) => /* @__PURE__ */ e.createElement(
1054
1054
  "div",
1055
1055
  {
1056
- key: f.value,
1056
+ key: m.value,
1057
1057
  className: d(
1058
1058
  "px-3 py-2 cursor-pointer text-sm flex items-center gap-2 transition-colors duration-150",
1059
1059
  "hover:bg-[var(--select-dropdown-hover)]",
1060
- P.includes(f.value) && "bg-[var(--select-dropdown-selected)] font-semibold"
1060
+ P.includes(m.value) && "bg-[var(--select-dropdown-selected)] font-semibold"
1061
1061
  ),
1062
- onMouseDown: () => $(f.value)
1062
+ onMouseDown: () => T(m.value)
1063
1063
  },
1064
1064
  /* @__PURE__ */ e.createElement(
1065
1065
  "input",
1066
1066
  {
1067
1067
  type: "checkbox",
1068
- checked: P.includes(f.value),
1068
+ checked: P.includes(m.value),
1069
1069
  readOnly: !0,
1070
1070
  className: "accent-blue-500"
1071
1071
  }
1072
1072
  ),
1073
- f.label
1073
+ m.label
1074
1074
  ))
1075
1075
  ), q && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, q));
1076
1076
  }
1077
1077
  );
1078
- We.displayName = "MultiAsyncSelect";
1079
- const Oe = {
1078
+ He.displayName = "MultiAsyncSelect";
1079
+ const De = {
1080
1080
  sm: "h-10 text-sm px-3",
1081
1081
  md: "h-12 text-base px-4",
1082
1082
  lg: "h-16 text-lg px-6"
1083
- }, Ve = e.forwardRef(
1083
+ }, je = e.forwardRef(
1084
1084
  ({
1085
1085
  name: t,
1086
1086
  label: n,
1087
1087
  options: r,
1088
1088
  className: a,
1089
- containerClassName: s,
1090
- optionClassName: x,
1089
+ containerClassName: l,
1090
+ optionClassName: w,
1091
1091
  direction: b = "row",
1092
- size: B = "md",
1093
- onFocus: _,
1094
- onBlur: S,
1095
- ...w
1096
- }, y) => {
1097
- var h, E, l;
1098
- const u = ie(), L = u == null ? void 0 : u.control, k = L && t ? ce({ control: L, name: t }) : void 0, R = w.value ?? k ?? "", g = (l = (E = (h = u == null ? void 0 : u.formState) == null ? void 0 : h.errors) == null ? void 0 : E[t]) == null ? void 0 : l.message, v = (C) => {
1099
- u && t && u.setValue(t, C), w.onChange && w.onChange({ target: { value: C } });
1092
+ size: M = "md",
1093
+ onFocus: N,
1094
+ onBlur: y,
1095
+ ...f
1096
+ }, x) => {
1097
+ var E, C, i;
1098
+ const c = ce(), I = c == null ? void 0 : c.control, k = I && t ? de({ control: I, name: t }) : void 0, S = f.value ?? k ?? "", v = (i = (C = (E = c == null ? void 0 : c.formState) == null ? void 0 : E.errors) == null ? void 0 : C[t]) == null ? void 0 : i.message, h = (R) => {
1099
+ c && t && c.setValue(t, R), f.onChange && f.onChange({ target: { value: R } });
1100
1100
  };
1101
- return /* @__PURE__ */ e.createElement("div", { className: d("relative", s), ref: y }, n && /* @__PURE__ */ e.createElement(
1101
+ return /* @__PURE__ */ e.createElement("div", { className: d("relative", l), ref: x }, n && /* @__PURE__ */ e.createElement(
1102
1102
  "label",
1103
1103
  {
1104
1104
  htmlFor: t,
@@ -1119,42 +1119,42 @@ const Oe = {
1119
1119
  ),
1120
1120
  "aria-label": n,
1121
1121
  tabIndex: -1,
1122
- onFocus: _,
1123
- onBlur: S
1122
+ onFocus: N,
1123
+ onBlur: y
1124
1124
  },
1125
- r.map((C) => /* @__PURE__ */ e.createElement(
1125
+ r.map((R) => /* @__PURE__ */ e.createElement(
1126
1126
  "button",
1127
1127
  {
1128
- key: C.value,
1128
+ key: R.value,
1129
1129
  type: "button",
1130
1130
  className: d(
1131
1131
  "relative flex items-center justify-center border rounded-lg transition-all duration-200 shadow-sm px-4 focus:outline-none focus:ring-2 focus:ring-[var(--primary-hover,#dbeafe)]",
1132
- Oe[B],
1133
- R === C.value ? "border-[var(--primary,#2563eb)] bg-[var(--primary-hover,#dbeafe)] text-[var(--primary,#2563eb)] ring-2 ring-[var(--primary-hover,#dbeafe)] shadow-md transform scale-[1.02]" : "border-gray-200 bg-white text-gray-600 hover:border-[var(--primary,#2563eb)] hover:bg-[var(--primary-hover,#dbeafe)] hover:text-[var(--primary,#2563eb)] hover:shadow-md",
1134
- x
1132
+ De[M],
1133
+ S === R.value ? "border-[var(--primary,#2563eb)] bg-[var(--primary-hover,#dbeafe)] text-[var(--primary,#2563eb)] ring-2 ring-[var(--primary-hover,#dbeafe)] shadow-md transform scale-[1.02]" : "border-gray-200 bg-white text-gray-600 hover:border-[var(--primary,#2563eb)] hover:bg-[var(--primary-hover,#dbeafe)] hover:text-[var(--primary,#2563eb)] hover:shadow-md",
1134
+ w
1135
1135
  ),
1136
- "aria-pressed": R === C.value,
1137
- "data-selected": R === C.value,
1136
+ "aria-pressed": S === R.value,
1137
+ "data-selected": S === R.value,
1138
1138
  tabIndex: 0,
1139
- onClick: () => v(C.value),
1140
- onKeyDown: (N) => {
1141
- (N.key === "Enter" || N.key === " ") && (N.preventDefault(), v(C.value));
1139
+ onClick: () => h(R.value),
1140
+ onKeyDown: (F) => {
1141
+ (F.key === "Enter" || F.key === " ") && (F.preventDefault(), h(R.value));
1142
1142
  }
1143
1143
  },
1144
- C.icon && /* @__PURE__ */ e.createElement("span", { className: "mr-2 text-lg flex items-center" }, C.icon),
1145
- /* @__PURE__ */ e.createElement("span", { className: "truncate font-medium" }, C.label)
1144
+ R.icon && /* @__PURE__ */ e.createElement("span", { className: "mr-2 text-lg flex items-center" }, R.icon),
1145
+ /* @__PURE__ */ e.createElement("span", { className: "truncate font-medium" }, R.label)
1146
1146
  ))
1147
- ), g && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, g));
1147
+ ), v && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, v));
1148
1148
  }
1149
1149
  );
1150
- Ve.displayName = "RadioGroup";
1151
- const we = i.forwardRef(
1152
- ({ children: t, className: n, as: r = "div", ...a }, s) => /* @__PURE__ */ i.createElement(
1150
+ je.displayName = "RadioGroup";
1151
+ const ye = o.forwardRef(
1152
+ ({ children: t, className: n, as: r = "div", ...a }, l) => /* @__PURE__ */ o.createElement(
1153
1153
  r,
1154
1154
  {
1155
- ref: s,
1155
+ ref: l,
1156
1156
  className: d(
1157
- "px-6 py-4 border-b",
1157
+ "px-2 py-1 sm:px-4 sm:py-2 lg:px-6 lg:py-4 border-b",
1158
1158
  "bg-[var(--card-header-bg,rgba(249,250,251,0.5))]",
1159
1159
  "border-[var(--card-header-border,#e5e7eb)]",
1160
1160
  "text-[var(--card-text,#111827)]",
@@ -1165,14 +1165,14 @@ const we = i.forwardRef(
1165
1165
  t
1166
1166
  )
1167
1167
  );
1168
- we.displayName = "CardHeader";
1169
- const ye = i.forwardRef(
1170
- ({ children: t, className: n, as: r = "div", ...a }, s) => /* @__PURE__ */ i.createElement(
1168
+ ye.displayName = "CardHeader";
1169
+ const Ee = o.forwardRef(
1170
+ ({ children: t, className: n, as: r = "div", ...a }, l) => /* @__PURE__ */ o.createElement(
1171
1171
  r,
1172
1172
  {
1173
- ref: s,
1173
+ ref: l,
1174
1174
  className: d(
1175
- "px-6 py-4",
1175
+ "px-2 py-1 sm:px-4 sm:py-2 lg:px-6 lg:py-4",
1176
1176
  "flex-1",
1177
1177
  // Para ocupar o espaço disponível
1178
1178
  "bg-[var(--card-bg,#ffffff)]",
@@ -1184,12 +1184,12 @@ const ye = i.forwardRef(
1184
1184
  t
1185
1185
  )
1186
1186
  );
1187
- ye.displayName = "CardBody";
1188
- const Ee = i.forwardRef(
1189
- ({ children: t, className: n, as: r = "div", ...a }, s) => /* @__PURE__ */ i.createElement(
1187
+ Ee.displayName = "CardBody";
1188
+ const Ce = o.forwardRef(
1189
+ ({ children: t, className: n, as: r = "div", ...a }, l) => /* @__PURE__ */ o.createElement(
1190
1190
  r,
1191
1191
  {
1192
- ref: s,
1192
+ ref: l,
1193
1193
  className: d(
1194
1194
  "px-6 py-4 border-t",
1195
1195
  "bg-[var(--card-footer-bg,rgba(249,250,251,0.5))]",
@@ -1202,79 +1202,79 @@ const Ee = i.forwardRef(
1202
1202
  t
1203
1203
  )
1204
1204
  );
1205
- Ee.displayName = "CardFooter";
1206
- const He = i.forwardRef(
1205
+ Ce.displayName = "CardFooter";
1206
+ const Ue = o.forwardRef(
1207
1207
  ({
1208
1208
  children: t,
1209
1209
  className: n,
1210
1210
  variant: r = "default",
1211
1211
  size: a = "md",
1212
- padding: s = "none",
1212
+ padding: l = "none",
1213
1213
  // none pois cada seção tem seu próprio padding
1214
- rounded: x = "lg",
1214
+ rounded: w = "lg",
1215
1215
  constrainWidth: b = !1,
1216
1216
  // Por padrão, não aplicar max-width
1217
- allowOverflow: B = !1,
1217
+ allowOverflow: M = !1,
1218
1218
  // Por padrão, aplicar overflow hidden para interface limpa
1219
- ..._
1220
- }, S) => {
1221
- const w = {
1219
+ ...N
1220
+ }, y) => {
1221
+ const f = {
1222
1222
  default: "bg-[var(--card-bg,#ffffff)] border border-[var(--card-border,#e5e7eb)] shadow-[var(--card-shadow-sm,0_1px_2px_0_rgb(0_0_0_/_0.05))]",
1223
1223
  outlined: "bg-[var(--card-bg,#ffffff)] border-2 border-[var(--primary,#2563eb)]",
1224
1224
  elevated: "bg-[var(--card-bg,#ffffff)] border border-[var(--card-border,#e5e7eb)] shadow-[var(--card-shadow-lg,0_10px_15px_-3px_rgb(0_0_0_/_0.1),_0_4px_6px_-4px_rgb(0_0_0_/_0.1))]",
1225
1225
  flat: "bg-[var(--card-bg,#ffffff)] border-0"
1226
- }, y = {
1226
+ }, x = {
1227
1227
  sm: "max-w-sm",
1228
1228
  md: "max-w-md",
1229
1229
  lg: "max-w-lg"
1230
- }, u = {
1230
+ }, c = {
1231
1231
  none: "",
1232
1232
  sm: "p-3",
1233
1233
  md: "p-4",
1234
1234
  lg: "p-6"
1235
- }, L = {
1235
+ }, I = {
1236
1236
  none: "rounded-none",
1237
1237
  sm: "rounded-sm",
1238
1238
  md: "rounded-md",
1239
1239
  lg: "rounded-lg",
1240
1240
  xl: "rounded-xl"
1241
1241
  };
1242
- return /* @__PURE__ */ i.createElement(
1242
+ return /* @__PURE__ */ o.createElement(
1243
1243
  "div",
1244
1244
  {
1245
- ref: S,
1245
+ ref: y,
1246
1246
  className: d(
1247
1247
  "flex flex-col",
1248
1248
  // Flex column para organizar header, body, footer
1249
- !B && "overflow-hidden",
1249
+ !M && "overflow-hidden",
1250
1250
  // Overflow hidden por padrão para bordas limpas
1251
- w[r],
1252
- b && y[a],
1251
+ f[r],
1252
+ b && x[a],
1253
1253
  // Aplicar max-width apenas se constrainWidth for true
1254
- u[s],
1255
- L[x],
1254
+ c[l],
1255
+ I[w],
1256
1256
  n
1257
1257
  ),
1258
- ..._
1258
+ ...N
1259
1259
  },
1260
1260
  t
1261
1261
  );
1262
1262
  }
1263
- ), qe = Object.assign(He, {
1264
- Header: we,
1265
- Body: ye,
1266
- Footer: Ee
1267
- }), Ce = i.forwardRef(
1263
+ ), Ze = Object.assign(Ue, {
1264
+ Header: ye,
1265
+ Body: Ee,
1266
+ Footer: Ce
1267
+ }), Ne = o.forwardRef(
1268
1268
  ({
1269
1269
  children: t,
1270
1270
  className: n,
1271
1271
  variant: r = "default",
1272
1272
  size: a = "md",
1273
- responsive: s = !1,
1274
- stickyHeader: x = !1,
1273
+ responsive: l = !1,
1274
+ stickyHeader: w = !1,
1275
1275
  ...b
1276
- }, B) => {
1277
- const _ = d(
1276
+ }, M) => {
1277
+ const N = d(
1278
1278
  // Base styles
1279
1279
  "w-full border-collapse bg-[var(--table-bg)] text-[var(--table-text)]",
1280
1280
  // Variant styles
@@ -1288,27 +1288,27 @@ const He = i.forwardRef(
1288
1288
  "text-lg": a === "lg"
1289
1289
  },
1290
1290
  n
1291
- ), S = d(
1291
+ ), y = d(
1292
1292
  {
1293
- "overflow-x-auto": s,
1294
- "max-h-96 overflow-y-auto": x
1293
+ "overflow-x-auto": l,
1294
+ "max-h-96 overflow-y-auto": w
1295
1295
  }
1296
- ), w = /* @__PURE__ */ i.createElement(
1296
+ ), f = /* @__PURE__ */ o.createElement(
1297
1297
  "table",
1298
1298
  {
1299
- ref: B,
1300
- className: _,
1299
+ ref: M,
1300
+ className: N,
1301
1301
  ...b
1302
1302
  },
1303
1303
  t
1304
1304
  );
1305
- return s || x ? /* @__PURE__ */ i.createElement("div", { className: S }, w) : w;
1305
+ return l || w ? /* @__PURE__ */ o.createElement("div", { className: y }, f) : f;
1306
1306
  }
1307
- ), Ne = i.forwardRef(
1308
- ({ children: t, className: n, as: r = "thead", ...a }, s) => /* @__PURE__ */ i.createElement(
1307
+ ), ke = o.forwardRef(
1308
+ ({ children: t, className: n, as: r = "thead", ...a }, l) => /* @__PURE__ */ o.createElement(
1309
1309
  r,
1310
1310
  {
1311
- ref: s,
1311
+ ref: l,
1312
1312
  className: d(
1313
1313
  "border-b border-[var(--table-border)] bg-[var(--table-header-bg)]",
1314
1314
  {
@@ -1320,11 +1320,11 @@ const He = i.forwardRef(
1320
1320
  },
1321
1321
  t
1322
1322
  )
1323
- ), ke = i.forwardRef(
1324
- ({ children: t, className: n, as: r = "tbody", ...a }, s) => /* @__PURE__ */ i.createElement(
1323
+ ), Se = o.forwardRef(
1324
+ ({ children: t, className: n, as: r = "tbody", ...a }, l) => /* @__PURE__ */ o.createElement(
1325
1325
  r,
1326
1326
  {
1327
- ref: s,
1327
+ ref: l,
1328
1328
  className: d(
1329
1329
  "[&_tr:nth-child(odd)]:bg-[var(--table-row-odd)]",
1330
1330
  "[&_tr:nth-child(even)]:bg-[var(--table-row-even)]",
@@ -1334,11 +1334,11 @@ const He = i.forwardRef(
1334
1334
  },
1335
1335
  t
1336
1336
  )
1337
- ), Se = i.forwardRef(
1338
- ({ children: t, className: n, as: r = "tfoot", ...a }, s) => /* @__PURE__ */ i.createElement(
1337
+ ), Re = o.forwardRef(
1338
+ ({ children: t, className: n, as: r = "tfoot", ...a }, l) => /* @__PURE__ */ o.createElement(
1339
1339
  r,
1340
1340
  {
1341
- ref: s,
1341
+ ref: l,
1342
1342
  className: d(
1343
1343
  "border-t border-[var(--table-border)] bg-[var(--table-header-bg)] font-medium",
1344
1344
  n
@@ -1347,11 +1347,11 @@ const He = i.forwardRef(
1347
1347
  },
1348
1348
  t
1349
1349
  )
1350
- ), Re = i.forwardRef(
1351
- ({ children: t, className: n, variant: r = "default", ...a }, s) => /* @__PURE__ */ i.createElement(
1350
+ ), Fe = o.forwardRef(
1351
+ ({ children: t, className: n, variant: r = "default", ...a }, l) => /* @__PURE__ */ o.createElement(
1352
1352
  "tr",
1353
1353
  {
1354
- ref: s,
1354
+ ref: l,
1355
1355
  className: d(
1356
1356
  "border-b border-[var(--table-border)] transition-colors",
1357
1357
  {
@@ -1364,22 +1364,22 @@ const He = i.forwardRef(
1364
1364
  },
1365
1365
  t
1366
1366
  )
1367
- ), Fe = i.forwardRef(
1367
+ ), Ie = o.forwardRef(
1368
1368
  ({
1369
1369
  children: t,
1370
1370
  className: n,
1371
1371
  as: r = "td",
1372
1372
  align: a = "left",
1373
- scope: s,
1374
- colSpan: x,
1373
+ scope: l,
1374
+ colSpan: w,
1375
1375
  rowSpan: b,
1376
- ...B
1377
- }, _) => /* @__PURE__ */ i.createElement(
1376
+ ...M
1377
+ }, N) => /* @__PURE__ */ o.createElement(
1378
1378
  r,
1379
1379
  {
1380
- ref: _,
1381
- scope: r === "th" ? s : void 0,
1382
- colSpan: x,
1380
+ ref: N,
1381
+ scope: r === "th" ? l : void 0,
1382
+ colSpan: w,
1383
1383
  rowSpan: b,
1384
1384
  className: d(
1385
1385
  "px-4 py-3 text-left",
@@ -1391,116 +1391,116 @@ const He = i.forwardRef(
1391
1391
  },
1392
1392
  n
1393
1393
  ),
1394
- ...B
1394
+ ...M
1395
1395
  },
1396
1396
  t
1397
1397
  )
1398
1398
  );
1399
- Ce.displayName = "Table";
1400
- Ne.displayName = "TableHeader";
1401
- ke.displayName = "TableBody";
1402
- Se.displayName = "TableFooter";
1403
- Re.displayName = "TableRow";
1404
- Fe.displayName = "TableCell";
1405
- const Ke = Object.assign(Ce, {
1406
- Header: Ne,
1407
- Body: ke,
1408
- Footer: Se,
1409
- Row: Re,
1410
- Cell: Fe
1411
- }), Je = ({
1399
+ Ne.displayName = "Table";
1400
+ ke.displayName = "TableHeader";
1401
+ Se.displayName = "TableBody";
1402
+ Re.displayName = "TableFooter";
1403
+ Fe.displayName = "TableRow";
1404
+ Ie.displayName = "TableCell";
1405
+ const et = Object.assign(Ne, {
1406
+ Header: ke,
1407
+ Body: Se,
1408
+ Footer: Re,
1409
+ Row: Fe,
1410
+ Cell: Ie
1411
+ }), tt = ({
1412
1412
  content: t,
1413
1413
  children: n,
1414
1414
  position: r = "top",
1415
1415
  className: a = "",
1416
- disabled: s = !1
1416
+ disabled: l = !1
1417
1417
  }) => {
1418
- const [x, b] = ue(!1), [B, _] = ue(r), [S, w] = ue({}), y = pe(null), u = pe(null);
1419
- Be(() => {
1420
- if (!x || !u.current) return;
1421
- const l = u.current.getBoundingClientRect();
1422
- let C = r, N = 0, M = 0;
1418
+ const [w, b] = le(!1), [M, N] = le(r), [y, f] = le({}), x = pe(null), c = pe(null);
1419
+ be(() => {
1420
+ if (!w || !c.current) return;
1421
+ const i = c.current.getBoundingClientRect();
1422
+ let R = r, F = 0, B = 0;
1423
1423
  switch (r) {
1424
1424
  case "top":
1425
- N = l.top - 8, M = l.left + l.width / 2;
1425
+ F = i.top - 8, B = i.left + i.width / 2;
1426
1426
  break;
1427
1427
  case "bottom":
1428
- N = l.bottom + 8, M = l.left + l.width / 2;
1428
+ F = i.bottom + 8, B = i.left + i.width / 2;
1429
1429
  break;
1430
1430
  case "left":
1431
- N = l.top + l.height / 2, M = l.left - 8;
1431
+ F = i.top + i.height / 2, B = i.left - 8;
1432
1432
  break;
1433
1433
  case "right":
1434
- N = l.top + l.height / 2, M = l.right + 8;
1434
+ F = i.top + i.height / 2, B = i.right + 8;
1435
1435
  break;
1436
1436
  }
1437
- if (y.current) {
1438
- const m = y.current.getBoundingClientRect(), V = window.innerWidth, U = window.innerHeight;
1439
- r === "top" && l.top < m.height + 16 ? (C = "bottom", N = l.bottom + 8) : r === "bottom" && l.bottom + m.height + 16 > U ? (C = "top", N = l.top - 8) : r === "left" && l.left < m.width + 16 ? (C = "right", M = l.right + 8) : r === "right" && l.right + m.width + 16 > V && (C = "left", M = l.left - 8);
1437
+ if (x.current) {
1438
+ const p = x.current.getBoundingClientRect(), V = window.innerWidth, U = window.innerHeight;
1439
+ r === "top" && i.top < p.height + 16 ? (R = "bottom", F = i.bottom + 8) : r === "bottom" && i.bottom + p.height + 16 > U ? (R = "top", F = i.top - 8) : r === "left" && i.left < p.width + 16 ? (R = "right", B = i.right + 8) : r === "right" && i.right + p.width + 16 > V && (R = "left", B = i.left - 8);
1440
1440
  }
1441
- _(C), w({
1441
+ N(R), f({
1442
1442
  position: "fixed",
1443
- top: `${N}px`,
1444
- left: `${M}px`,
1443
+ top: `${F}px`,
1444
+ left: `${B}px`,
1445
1445
  zIndex: 9999
1446
1446
  });
1447
- }, [x, r]);
1448
- const L = () => {
1449
- s || b(!0);
1447
+ }, [w, r]);
1448
+ const I = () => {
1449
+ l || b(!0);
1450
1450
  }, k = () => {
1451
1451
  b(!1);
1452
- }, R = () => {
1453
- s || b(!0);
1454
- }, g = () => {
1455
- b(!1);
1452
+ }, S = () => {
1453
+ l || b(!0);
1456
1454
  }, v = () => {
1457
- const E = "pointer-events-none";
1458
- switch (B) {
1455
+ b(!1);
1456
+ }, h = () => {
1457
+ const C = "pointer-events-none";
1458
+ switch (M) {
1459
1459
  case "top":
1460
- return `${E} transform -translate-x-1/2 -translate-y-full`;
1460
+ return `${C} transform -translate-x-1/2 -translate-y-full`;
1461
1461
  case "bottom":
1462
- return `${E} transform -translate-x-1/2`;
1462
+ return `${C} transform -translate-x-1/2`;
1463
1463
  case "left":
1464
- return `${E} transform -translate-x-full -translate-y-1/2`;
1464
+ return `${C} transform -translate-x-full -translate-y-1/2`;
1465
1465
  case "right":
1466
- return `${E} transform -translate-y-1/2`;
1466
+ return `${C} transform -translate-y-1/2`;
1467
1467
  default:
1468
- return `${E} transform -translate-x-1/2 -translate-y-full`;
1468
+ return `${C} transform -translate-x-1/2 -translate-y-full`;
1469
1469
  }
1470
- }, h = () => {
1471
- const E = "absolute w-2 h-2 bg-[var(--tooltip-bg,#374151)] transform rotate-45";
1472
- switch (B) {
1470
+ }, E = () => {
1471
+ const C = "absolute w-2 h-2 bg-[var(--tooltip-bg,#374151)] transform rotate-45";
1472
+ switch (M) {
1473
1473
  case "top":
1474
- return `${E} top-full left-1/2 -translate-x-1/2 -translate-y-1/2`;
1474
+ return `${C} top-full left-1/2 -translate-x-1/2 -translate-y-1/2`;
1475
1475
  case "bottom":
1476
- return `${E} bottom-full left-1/2 -translate-x-1/2 translate-y-1/2`;
1476
+ return `${C} bottom-full left-1/2 -translate-x-1/2 translate-y-1/2`;
1477
1477
  case "left":
1478
- return `${E} left-full top-1/2 -translate-y-1/2 -translate-x-1/2`;
1478
+ return `${C} left-full top-1/2 -translate-y-1/2 -translate-x-1/2`;
1479
1479
  case "right":
1480
- return `${E} right-full top-1/2 -translate-y-1/2 translate-x-1/2`;
1480
+ return `${C} right-full top-1/2 -translate-y-1/2 translate-x-1/2`;
1481
1481
  default:
1482
- return `${E} top-full left-1/2 -translate-x-1/2 -translate-y-1/2`;
1482
+ return `${C} top-full left-1/2 -translate-x-1/2 -translate-y-1/2`;
1483
1483
  }
1484
1484
  };
1485
- return s || !t ? /* @__PURE__ */ i.createElement(i.Fragment, null, n) : /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement(
1485
+ return l || !t ? /* @__PURE__ */ o.createElement(o.Fragment, null, n) : /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
1486
1486
  "div",
1487
1487
  {
1488
1488
  className: "relative inline-block",
1489
- ref: u,
1490
- onMouseEnter: L,
1489
+ ref: c,
1490
+ onMouseEnter: I,
1491
1491
  onMouseLeave: k,
1492
- onFocus: R,
1493
- onBlur: g
1492
+ onFocus: S,
1493
+ onBlur: v
1494
1494
  },
1495
1495
  n
1496
- ), x && typeof document < "u" && ve(
1497
- /* @__PURE__ */ i.createElement(
1496
+ ), w && typeof document < "u" && he(
1497
+ /* @__PURE__ */ o.createElement(
1498
1498
  "div",
1499
1499
  {
1500
- ref: y,
1501
- style: S,
1500
+ ref: x,
1501
+ style: y,
1502
1502
  className: d(
1503
- v(),
1503
+ h(),
1504
1504
  "px-2 py-1 text-sm rounded whitespace-nowrap",
1505
1505
  "bg-[var(--tooltip-bg,#374151)] text-[var(--tooltip-text,#fff)]",
1506
1506
  "shadow-[var(--tooltip-shadow,0_10px_15px_-3px_rgb(0_0_0_/_0.1),_0_4px_6px_-4px_rgb(0_0_0_/_0.1))]",
@@ -1508,24 +1508,24 @@ const Ke = Object.assign(Ce, {
1508
1508
  a
1509
1509
  ),
1510
1510
  role: "tooltip",
1511
- "aria-hidden": !x
1511
+ "aria-hidden": !w
1512
1512
  },
1513
1513
  t,
1514
- /* @__PURE__ */ i.createElement("div", { className: h() })
1514
+ /* @__PURE__ */ o.createElement("div", { className: E() })
1515
1515
  ),
1516
1516
  document.body
1517
1517
  ));
1518
- }, De = ({
1518
+ }, Ye = ({
1519
1519
  open: t,
1520
1520
  onClose: n,
1521
1521
  side: r = "right",
1522
1522
  size: a = "md",
1523
- closeOnOverlayClick: s = !0,
1524
- children: x,
1523
+ closeOnOverlayClick: l = !0,
1524
+ children: w,
1525
1525
  className: b = "",
1526
- ...B
1526
+ ...M
1527
1527
  }) => {
1528
- const _ = typeof document < "u" ? document.body : null, S = a === "sm" ? "w-64" : a === "md" ? "w-96" : a === "lg" ? "w-[36rem]" : void 0, w = typeof a == "string" && !["sm", "md", "lg"].includes(a) ? { width: a } : void 0, y = /* @__PURE__ */ i.createElement(
1528
+ const N = typeof document < "u" ? document.body : null, y = a === "sm" ? "w-64" : a === "md" ? "w-96" : a === "lg" ? "w-[36rem]" : void 0, f = typeof a == "string" && !["sm", "md", "lg"].includes(a) ? { width: a } : void 0, x = /* @__PURE__ */ o.createElement(
1529
1529
  "div",
1530
1530
  {
1531
1531
  "aria-hidden": !t,
@@ -1534,19 +1534,19 @@ const Ke = Object.assign(Ce, {
1534
1534
  t ? "pointer-events-auto" : "pointer-events-none"
1535
1535
  )
1536
1536
  },
1537
- /* @__PURE__ */ i.createElement(
1537
+ /* @__PURE__ */ o.createElement(
1538
1538
  "div",
1539
1539
  {
1540
1540
  className: d(
1541
1541
  "absolute inset-0 bg-black/40 transition-opacity duration-200",
1542
1542
  t ? "opacity-100" : "opacity-0"
1543
1543
  ),
1544
- onMouseDown: (u) => {
1545
- s && u.target === u.currentTarget && n();
1544
+ onMouseDown: (c) => {
1545
+ l && c.target === c.currentTarget && n();
1546
1546
  }
1547
1547
  }
1548
1548
  ),
1549
- /* @__PURE__ */ i.createElement(
1549
+ /* @__PURE__ */ o.createElement(
1550
1550
  "div",
1551
1551
  {
1552
1552
  className: d(
@@ -1555,9 +1555,9 @@ const Ke = Object.assign(Ce, {
1555
1555
  // ensure the sheet doesn't shrink
1556
1556
  "flex-shrink-0"
1557
1557
  ),
1558
- style: w
1558
+ style: f
1559
1559
  },
1560
- /* @__PURE__ */ i.createElement(
1560
+ /* @__PURE__ */ o.createElement(
1561
1561
  "aside",
1562
1562
  {
1563
1563
  role: "dialog",
@@ -1565,90 +1565,90 @@ const Ke = Object.assign(Ce, {
1565
1565
  className: d(
1566
1566
  "h-full bg-white shadow-xl border-l border-gray-100 overflow-auto transition-transform duration-300",
1567
1567
  r === "right" ? t ? "translate-x-0" : "translate-x-full" : t ? "translate-x-0" : "-translate-x-full",
1568
- S,
1568
+ y,
1569
1569
  b
1570
1570
  ),
1571
- style: w,
1572
- ...B
1571
+ style: f,
1572
+ ...M
1573
1573
  },
1574
- x
1574
+ w
1575
1575
  )
1576
1576
  )
1577
1577
  );
1578
- return _ ? ve(y, _) : null;
1578
+ return N ? he(x, N) : null;
1579
1579
  };
1580
- De.displayName = "AsideSheet";
1581
- const Qe = ({
1580
+ Ye.displayName = "AsideSheet";
1581
+ const rt = ({
1582
1582
  avatar: t = !1,
1583
1583
  value: n,
1584
1584
  onUpload: r,
1585
1585
  onRemove: a,
1586
- accept: s = "image/*",
1587
- maxSize: x,
1586
+ accept: l = "image/*",
1587
+ maxSize: w,
1588
1588
  placeholder: b = "Selecionar imagem",
1589
- loading: B = !1,
1590
- size: _ = "md",
1591
- label: S,
1592
- error: w,
1593
- disabled: y,
1594
- className: u,
1595
- ...L
1589
+ loading: M = !1,
1590
+ size: N = "md",
1591
+ label: y,
1592
+ error: f,
1593
+ disabled: x,
1594
+ className: c,
1595
+ ...I
1596
1596
  }) => {
1597
- const [k, R] = ue(null), [g, v] = ue(""), [h, E] = ue(!1), l = pe(null), C = !!n, N = !!k, M = C || N, m = B || h, V = {
1597
+ const [k, S] = le(null), [v, h] = le(""), [E, C] = le(!1), i = pe(null), R = !!n, F = !!k, B = R || F, p = M || E, V = {
1598
1598
  sm: t ? "w-16 h-16" : "w-24 h-16",
1599
1599
  md: t ? "w-24 h-24" : "w-32 h-24",
1600
1600
  lg: t ? "w-32 h-32" : "w-40 h-32"
1601
- }, F = b || (t ? "Adicionar foto" : "Selecionar imagem"), J = (I) => {
1601
+ }, L = b || (t ? "Adicionar foto" : "Selecionar imagem"), J = (_) => {
1602
1602
  var z;
1603
- const P = (z = I.target.files) == null ? void 0 : z[0];
1603
+ const P = (z = _.target.files) == null ? void 0 : z[0];
1604
1604
  if (!P) return;
1605
- if (x && P.size > x) {
1606
- alert(`Arquivo muito grande. Tamanho máximo: ${(x / 1024 / 1024).toFixed(1)}MB`);
1605
+ if (w && P.size > w) {
1606
+ alert(`Arquivo muito grande. Tamanho máximo: ${(w / 1024 / 1024).toFixed(1)}MB`);
1607
1607
  return;
1608
1608
  }
1609
1609
  const q = new FileReader();
1610
1610
  q.onload = (Y) => {
1611
1611
  var j;
1612
- v((j = Y.target) == null ? void 0 : j.result), R(P);
1612
+ h((j = Y.target) == null ? void 0 : j.result), S(P);
1613
1613
  }, q.readAsDataURL(P);
1614
1614
  }, Z = async () => {
1615
1615
  if (!(!k || !r))
1616
1616
  try {
1617
- E(!0);
1618
- const I = await r(k);
1619
- R(null), v(""), l.current && (l.current.value = "");
1620
- } catch (I) {
1621
- console.error("Erro ao fazer upload:", I), alert("Erro ao fazer upload da imagem");
1617
+ C(!0);
1618
+ const _ = await r(k);
1619
+ S(null), h(""), i.current && (i.current.value = "");
1620
+ } catch (_) {
1621
+ console.error("Erro ao fazer upload:", _), alert("Erro ao fazer upload da imagem");
1622
1622
  } finally {
1623
- E(!1);
1623
+ C(!1);
1624
1624
  }
1625
1625
  }, G = () => {
1626
- R(null), v(""), l.current && (l.current.value = "");
1627
- }, O = async () => {
1626
+ S(null), h(""), i.current && (i.current.value = "");
1627
+ }, W = async () => {
1628
1628
  try {
1629
- a && await a(n), R(null), v(""), l.current && (l.current.value = "");
1630
- } catch (I) {
1631
- console.error("Erro ao remover imagem:", I), alert("Erro ao remover imagem");
1629
+ a && await a(n), S(null), h(""), i.current && (i.current.value = "");
1630
+ } catch (_) {
1631
+ console.error("Erro ao remover imagem:", _), alert("Erro ao remover imagem");
1632
1632
  }
1633
- }, A = () => {
1634
- var I;
1635
- y || m || (I = l.current) == null || I.click();
1636
- }, X = g || n;
1637
- return /* @__PURE__ */ i.createElement("div", { className: d("flex flex-col space-y-2", u) }, S && /* @__PURE__ */ i.createElement("label", { className: "text-sm font-medium text-gray-700" }, S), /* @__PURE__ */ i.createElement("div", { className: "relative flex flex-col items-center" }, /* @__PURE__ */ i.createElement(
1633
+ }, $ = () => {
1634
+ var _;
1635
+ x || p || (_ = i.current) == null || _.click();
1636
+ }, X = v || n;
1637
+ return /* @__PURE__ */ o.createElement("div", { className: d("flex flex-col space-y-2", c) }, y && /* @__PURE__ */ o.createElement("label", { className: "text-sm font-medium text-gray-700" }, y), /* @__PURE__ */ o.createElement("div", { className: "relative flex flex-col items-center" }, /* @__PURE__ */ o.createElement(
1638
1638
  "input",
1639
1639
  {
1640
- ref: l,
1640
+ ref: i,
1641
1641
  type: "file",
1642
- accept: s,
1642
+ accept: l,
1643
1643
  onChange: J,
1644
- disabled: y || m,
1644
+ disabled: x || p,
1645
1645
  className: "hidden",
1646
- ...L
1646
+ ...I
1647
1647
  }
1648
- ), /* @__PURE__ */ i.createElement(
1648
+ ), /* @__PURE__ */ o.createElement(
1649
1649
  "div",
1650
1650
  {
1651
- onClick: A,
1651
+ onClick: $,
1652
1652
  className: d(
1653
1653
  // Base styles
1654
1654
  "relative border-2 border-dashed border-gray-300 transition-colors cursor-pointer",
@@ -1656,19 +1656,19 @@ const Qe = ({
1656
1656
  // Shape
1657
1657
  t ? "rounded-full" : "rounded-lg",
1658
1658
  // Size
1659
- V[_],
1659
+ V[N],
1660
1660
  // States
1661
- y && "opacity-50 cursor-not-allowed",
1662
- m && "cursor-wait",
1663
- w && "border-red-300",
1661
+ x && "opacity-50 cursor-not-allowed",
1662
+ p && "cursor-wait",
1663
+ f && "border-red-300",
1664
1664
  // Background
1665
- !M && "bg-gray-50 hover:bg-gray-100",
1666
- M && "border-solid border-gray-200"
1665
+ !B && "bg-gray-50 hover:bg-gray-100",
1666
+ B && "border-solid border-gray-200"
1667
1667
  )
1668
1668
  },
1669
- M ? (
1669
+ B ? (
1670
1670
  // Preview da imagem
1671
- /* @__PURE__ */ i.createElement(
1671
+ /* @__PURE__ */ o.createElement(
1672
1672
  "img",
1673
1673
  {
1674
1674
  src: X,
@@ -1681,9 +1681,9 @@ const Qe = ({
1681
1681
  )
1682
1682
  ) : (
1683
1683
  // Estado vazio
1684
- /* @__PURE__ */ i.createElement("div", { className: "flex flex-col items-center justify-center h-full text-gray-500 text-sm" }, t ? (
1684
+ /* @__PURE__ */ o.createElement("div", { className: "flex flex-col items-center justify-center h-full text-gray-500 text-sm" }, t ? (
1685
1685
  // Ícone de usuário para avatar
1686
- /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement(
1686
+ /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
1687
1687
  "svg",
1688
1688
  {
1689
1689
  className: "w-8 h-8 mb-1",
@@ -1691,7 +1691,7 @@ const Qe = ({
1691
1691
  stroke: "currentColor",
1692
1692
  viewBox: "0 0 24 24"
1693
1693
  },
1694
- /* @__PURE__ */ i.createElement(
1694
+ /* @__PURE__ */ o.createElement(
1695
1695
  "path",
1696
1696
  {
1697
1697
  strokeLinecap: "round",
@@ -1700,10 +1700,10 @@ const Qe = ({
1700
1700
  d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"
1701
1701
  }
1702
1702
  )
1703
- ), /* @__PURE__ */ i.createElement("span", { className: "text-center px-2 text-xs" }, F))
1703
+ ), /* @__PURE__ */ o.createElement("span", { className: "text-center px-2 text-xs" }, L))
1704
1704
  ) : (
1705
1705
  // Ícone de adicionar imagem genérica
1706
- /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement(
1706
+ /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
1707
1707
  "svg",
1708
1708
  {
1709
1709
  className: "w-6 h-6 mb-1",
@@ -1711,7 +1711,7 @@ const Qe = ({
1711
1711
  stroke: "currentColor",
1712
1712
  viewBox: "0 0 24 24"
1713
1713
  },
1714
- /* @__PURE__ */ i.createElement(
1714
+ /* @__PURE__ */ o.createElement(
1715
1715
  "path",
1716
1716
  {
1717
1717
  strokeLinecap: "round",
@@ -1720,16 +1720,16 @@ const Qe = ({
1720
1720
  d: "M12 6v6m0 0v6m0-6h6m-6 0H6"
1721
1721
  }
1722
1722
  )
1723
- ), /* @__PURE__ */ i.createElement("span", { className: "text-center px-2" }, F))
1723
+ ), /* @__PURE__ */ o.createElement("span", { className: "text-center px-2" }, L))
1724
1724
  ))
1725
1725
  ),
1726
- m && /* @__PURE__ */ i.createElement("div", { className: d(
1726
+ p && /* @__PURE__ */ o.createElement("div", { className: d(
1727
1727
  "absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center",
1728
1728
  t ? "rounded-full" : "rounded-lg"
1729
- ) }, /* @__PURE__ */ i.createElement("div", { className: "w-6 h-6 border-2 border-white border-t-transparent rounded-full animate-spin" }))
1730
- ), M && !m && /* @__PURE__ */ i.createElement("div", { className: "flex justify-center space-x-2 mt-3" }, N ? (
1729
+ ) }, /* @__PURE__ */ o.createElement("div", { className: "w-6 h-6 border-2 border-white border-t-transparent rounded-full animate-spin" }))
1730
+ ), B && !p && /* @__PURE__ */ o.createElement("div", { className: "flex justify-center space-x-2 mt-3" }, F ? (
1731
1731
  // Ações para arquivo selecionado (não salvo ainda)
1732
- /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement(
1732
+ /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
1733
1733
  "button",
1734
1734
  {
1735
1735
  onClick: Z,
@@ -1737,7 +1737,7 @@ const Qe = ({
1737
1737
  className: "px-3 py-1 bg-blue-600 text-white text-sm rounded hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed"
1738
1738
  },
1739
1739
  "Confirmar"
1740
- ), /* @__PURE__ */ i.createElement(
1740
+ ), /* @__PURE__ */ o.createElement(
1741
1741
  "button",
1742
1742
  {
1743
1743
  onClick: G,
@@ -1747,37 +1747,175 @@ const Qe = ({
1747
1747
  ))
1748
1748
  ) : (
1749
1749
  // Ações para imagem já salva
1750
- /* @__PURE__ */ i.createElement(
1750
+ /* @__PURE__ */ o.createElement(
1751
1751
  "button",
1752
1752
  {
1753
- onClick: O,
1753
+ onClick: W,
1754
1754
  disabled: !a,
1755
1755
  className: "px-3 py-1 bg-red-600 text-white text-sm rounded hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed"
1756
1756
  },
1757
1757
  "Remover"
1758
1758
  )
1759
- ))), w && /* @__PURE__ */ i.createElement("p", { className: "text-sm text-red-600" }, w), x && !M && /* @__PURE__ */ i.createElement("p", { className: "text-xs text-gray-500" }, "Tamanho máximo: ", (x / 1024 / 1024).toFixed(1), "MB"), t && !M && /* @__PURE__ */ i.createElement("p", { className: "text-xs text-gray-500 text-center" }, "Use uma foto com seu rosto centralizado e bem visível"));
1759
+ ))), f && /* @__PURE__ */ o.createElement("p", { className: "text-sm text-red-600" }, f), w && !B && /* @__PURE__ */ o.createElement("p", { className: "text-xs text-gray-500" }, "Tamanho máximo: ", (w / 1024 / 1024).toFixed(1), "MB"), t && !B && /* @__PURE__ */ o.createElement("p", { className: "text-xs text-gray-500 text-center" }, "Use uma foto com seu rosto centralizado e bem visível"));
1760
+ }, Me = o.createContext(null), Ge = () => {
1761
+ const t = o.useContext(Me);
1762
+ if (!t)
1763
+ throw new Error("AccordionItem must be used within an Accordion");
1764
+ return t;
1765
+ };
1766
+ let Le = 0;
1767
+ const Be = ({
1768
+ title: t,
1769
+ children: n,
1770
+ defaultOpen: r = !1,
1771
+ disabled: a = !1,
1772
+ className: l,
1773
+ headerClassName: w,
1774
+ contentClassName: b,
1775
+ icon: M
1776
+ }) => {
1777
+ const { openItems: N, toggleItem: y, variant: f } = Ge(), [x] = le(() => Le++), c = N.has(x), I = pe(null), [k, S] = le(r ? void 0 : 0);
1778
+ be(() => {
1779
+ if (c) {
1780
+ const C = I.current;
1781
+ C && S(C.scrollHeight);
1782
+ } else
1783
+ S(0);
1784
+ }, [c]);
1785
+ const v = () => {
1786
+ a || y(x);
1787
+ }, E = {
1788
+ default: {
1789
+ item: "border-b border-[var(--accordion-border,#e5e7eb)] last:border-b-0",
1790
+ header: "",
1791
+ content: ""
1792
+ },
1793
+ bordered: {
1794
+ item: "border border-[var(--accordion-border,#e5e7eb)] rounded-md mb-2",
1795
+ header: "border-b border-[var(--accordion-border,#e5e7eb)]",
1796
+ content: ""
1797
+ },
1798
+ separated: {
1799
+ item: "border border-[var(--accordion-border,#e5e7eb)] rounded-md mb-3 shadow-sm",
1800
+ header: "",
1801
+ content: ""
1802
+ }
1803
+ }[f];
1804
+ return /* @__PURE__ */ o.createElement("div", { className: d(E.item, l) }, /* @__PURE__ */ o.createElement(
1805
+ "button",
1806
+ {
1807
+ type: "button",
1808
+ onClick: v,
1809
+ disabled: a,
1810
+ "aria-expanded": c,
1811
+ className: d(
1812
+ "w-full flex items-center justify-between px-4 py-3 text-left transition-colors",
1813
+ "bg-[var(--accordion-header-bg,transparent)]",
1814
+ "hover:bg-[var(--accordion-header-hover,rgba(0,0,0,0.05))]",
1815
+ "text-[var(--accordion-text,#111827)]",
1816
+ "font-medium",
1817
+ a && "opacity-50 cursor-not-allowed",
1818
+ c && f !== "default" && E.header,
1819
+ w
1820
+ )
1821
+ },
1822
+ /* @__PURE__ */ o.createElement("span", { className: "flex items-center gap-2" }, M && /* @__PURE__ */ o.createElement("span", { className: "flex-shrink-0" }, M), t),
1823
+ /* @__PURE__ */ o.createElement(
1824
+ "svg",
1825
+ {
1826
+ className: d(
1827
+ "w-5 h-5 transition-transform duration-200 flex-shrink-0",
1828
+ "text-[var(--accordion-icon,#6b7280)]",
1829
+ c && "rotate-180"
1830
+ ),
1831
+ fill: "none",
1832
+ strokeWidth: "2",
1833
+ stroke: "currentColor",
1834
+ viewBox: "0 0 24 24"
1835
+ },
1836
+ /* @__PURE__ */ o.createElement("path", { d: "M19 9l-7 7-7-7" })
1837
+ )
1838
+ ), /* @__PURE__ */ o.createElement(
1839
+ "div",
1840
+ {
1841
+ style: {
1842
+ height: k,
1843
+ overflow: "hidden",
1844
+ transition: "height 0.3s ease-in-out"
1845
+ }
1846
+ },
1847
+ /* @__PURE__ */ o.createElement(
1848
+ "div",
1849
+ {
1850
+ ref: I,
1851
+ className: d(
1852
+ "px-4 py-3",
1853
+ "text-[var(--accordion-content-text,#374151)]",
1854
+ "bg-[var(--accordion-content-bg,transparent)]",
1855
+ b
1856
+ )
1857
+ },
1858
+ n
1859
+ )
1860
+ ));
1861
+ };
1862
+ Be.displayName = "AccordionItem";
1863
+ const qe = ({
1864
+ children: t,
1865
+ type: n = "single",
1866
+ className: r,
1867
+ variant: a = "default",
1868
+ collapsible: l = !0
1869
+ }) => {
1870
+ const [w, b] = le(/* @__PURE__ */ new Set());
1871
+ be(() => {
1872
+ Le = 0;
1873
+ const N = o.Children.toArray(t), y = /* @__PURE__ */ new Set();
1874
+ if (N.forEach((f, x) => {
1875
+ o.isValidElement(f) && f.props.defaultOpen && y.add(x);
1876
+ }), n === "single" && y.size > 1) {
1877
+ const f = Array.from(y)[0];
1878
+ b(/* @__PURE__ */ new Set([f]));
1879
+ } else
1880
+ b(y);
1881
+ }, [t, n]);
1882
+ const M = (N) => {
1883
+ b((y) => {
1884
+ const f = new Set(y);
1885
+ return n === "single" ? f.has(N) ? l && f.clear() : (f.clear(), f.add(N)) : f.has(N) ? f.delete(N) : f.add(N), f;
1886
+ });
1887
+ };
1888
+ return /* @__PURE__ */ o.createElement(
1889
+ Me.Provider,
1890
+ {
1891
+ value: { type: n, openItems: w, toggleItem: M, collapsible: l, variant: a }
1892
+ },
1893
+ /* @__PURE__ */ o.createElement("div", { className: d("w-full", r) }, t)
1894
+ );
1760
1895
  };
1896
+ qe.Item = Be;
1761
1897
  export {
1762
- De as AsideSheet,
1763
- Ae as AsyncSelect,
1764
- Ge as Button,
1765
- qe as Card,
1766
- ye as CardBody,
1767
- Ee as CardFooter,
1768
- we as CardHeader,
1769
- Qe as ImageInput,
1770
- Ie as Input,
1771
- We as MultiAsyncSelect,
1772
- ze as MultiSelect,
1773
- Ve as RadioGroup,
1774
- Te as Select,
1775
- Ke as Table,
1776
- ke as TableBody,
1777
- Fe as TableCell,
1778
- Se as TableFooter,
1779
- Ne as TableHeader,
1780
- Re as TableRow,
1781
- $e as Textarea,
1782
- Je as Tooltip
1898
+ qe as Accordion,
1899
+ Be as AccordionItem,
1900
+ Ye as AsideSheet,
1901
+ We as AsyncSelect,
1902
+ Xe as Button,
1903
+ Ze as Card,
1904
+ Ee as CardBody,
1905
+ Ce as CardFooter,
1906
+ ye as CardHeader,
1907
+ rt as ImageInput,
1908
+ $e as Input,
1909
+ He as MultiAsyncSelect,
1910
+ Ve as MultiSelect,
1911
+ je as RadioGroup,
1912
+ ze as Select,
1913
+ et as Table,
1914
+ Se as TableBody,
1915
+ Ie as TableCell,
1916
+ Re as TableFooter,
1917
+ ke as TableHeader,
1918
+ Fe as TableRow,
1919
+ Oe as Textarea,
1920
+ tt as Tooltip
1783
1921
  };