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