rharuow-ds 1.8.2 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),Z=require("react-hook-form"),Ce=require("react-dom");function ze(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return n.default=t,Object.freeze(n)}const e=ze(a);function Ne(t){var n,r,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var l=t.length;for(n=0;n<l;n++)t[n]&&(r=Ne(t[n]))&&(o&&(o+=" "),o+=r)}else for(r in t)t[r]&&(o&&(o+=" "),o+=r);return o}function He(){for(var t,n,r=0,o="",l=arguments.length;r<l;r++)(t=arguments[r])&&(n=Ne(t))&&(o&&(o+=" "),o+=n);return o}function d(...t){return He(...t)}const Ve=({children:t,variant:n="default",className:r="",...o})=>{const l="px-4 py-2 rounded font-medium transition",w={default:"bg-[var(--primary,#2563eb)] text-[var(--primary-text,#fff)] hover:bg-[var(--primary-hover,#1d4ed8)]",outline:"border border-[var(--primary,#2563eb)] text-[var(--primary,#2563eb)] bg-white hover:bg-[var(--primary-hover,#e0e7ff)]",secondary:"bg-[var(--secondary,#fbbf24)] text-[var(--secondary-text,#222)] hover:bg-[var(--secondary-hover,#f59e42)]"};return a.createElement("button",{className:d(l,w[n],r),...o},t)},ke=t=>t.replace(/\D/g,""),De=t=>{const r=ke(t).slice(0,11);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)}`},Ee=t=>{const n=ke(t);if(n.length!==11||/^(\d)\1{10}$/.test(n))return!1;let r=0;for(let l=0;l<9;l++)r+=parseInt(n.charAt(l))*(10-l);let o=r*10%11;if((o===10||o===11)&&(o=0),o!==parseInt(n.charAt(9)))return!1;r=0;for(let l=0;l<10;l++)r+=parseInt(n.charAt(l))*(11-l);return o=r*10%11,(o===10||o===11)&&(o=0),o===parseInt(n.charAt(10))},Se=e.forwardRef(({name:t,className:n,type:r="text",label:o,onFocus:l,onBlur:w,onChange:b,Icon:M,iconClassName:N,iconAction:y,containerClassName:f,cpf:x=!1,...c},I)=>{var A,P,G;const[k,S]=e.useState(!1),[h,v]=e.useState(!1),[E,C]=e.useState(null),i=Z.useFormContext(),F=i==null?void 0:i.control,R=i==null?void 0:i.register,L=F&&t?Z.useWatch({control:F,name:t}):void 0,p=c.value??L??"",H=((G=(P=(A=i==null?void 0:i.formState)==null?void 0:A.errors)==null?void 0:P[t])==null?void 0:G.message)||E,B=["date","datetime-local","time","month","week"].includes(r),J=k||!!p||B,ee=r==="password"?h?"text":"password":r,Y=()=>e.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{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",fill:"currentColor"})),z=()=>e.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{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",fill:"currentColor"})),O=()=>{v(!h)},X=$=>{if(x){const q=$.target.value,j=De(q);$.target.value=j,j.length===14?Ee(j)?C(null):C("CPF inválido"):C(null)}b&&b($)};return e.createElement("div",{className:d("relative",f)},e.createElement("input",{id:c.id||t,type:ee,className:d("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",r==="password"||M?"pr-12":"",H?"border-red-500":"",n),onFocus:$=>{S(!0),l&&l($)},maxLength:x?14:c.maxLength,inputMode:x?"numeric":c.inputMode,...i&&t?(()=>{const $=R(t,x?{validate:D=>D?D.length<14?"CPF incompleto":Ee(D)?!0:"CPF inválido":"CPF é obrigatório"}:void 0),q=$.onBlur,j=$.onChange;return{...$,ref:D=>{typeof I=="function"?I(D):I&&(I.current=D),$.ref&&$.ref(D)},onBlur:D=>{S(!1),w&&w(D),q&&q(D)},onChange:D=>{X(D),j&&j(D)}}})():{ref:I,onBlur:$=>{S(!1),w&&w($)},onChange:X},...c}),o&&e.createElement("label",{htmlFor:c.id||t,className:d("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",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")},o),r==="password"&&e.createElement("button",{type:"button",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)]",onClick:O,"aria-label":h?"Esconder senha":"Mostrar senha",tabIndex:-1},h?e.createElement(z,null):e.createElement(Y,null)),M&&r!=="password"&&e.createElement("div",{className:d("absolute top-1/2 right-3 -translate-y-1/2 text-gray-400 cursor-pointer hover:text-[var(--primary,#2563eb)] transition-colors duration-200",N),onClick:y},e.createElement(M,null)),H&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},H))});Se.displayName="Input";const Fe=e.forwardRef(({name:t,label:n,options:r,className:o,containerClassName:l,isClearable:w,searchable:b=!1,filterPlaceholder:M="Digite para filtrar...",caseSensitive:N=!1,filterFunction:y,onFocus:f,onBlur:x,...c},I)=>{var ae,oe,u,T;const[k,S]=e.useState(!1),[h,v]=e.useState(!1),[E,C]=e.useState(""),[i,F]=e.useState({top:0,left:0,width:0}),R=e.useRef(null),L=e.useRef(null),p=Z.useFormContext(),H=p==null?void 0:p.control,U=H&&t?Z.useWatch({control:H,name:t}):void 0,B=c.value??U??"",J=(u=(oe=(ae=p==null?void 0:p.formState)==null?void 0:ae.errors)==null?void 0:oe[t])==null?void 0:u.message,Y=y||((s,W)=>{const K=N?s.label:s.label.toLowerCase(),re=N?W:W.toLowerCase();return K.includes(re)}),z=E.trim()?r.filter(s=>Y(s,E.trim())):r,O=r.find(s=>s.value===B),X=b&&h?E:(O==null?void 0:O.label)||"",A=k||!!B||b&&!!E,P=e.useCallback(()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=768,[]),G=e.useCallback(()=>{if(R.current&&h){const s=R.current.getBoundingClientRect(),W=P(),K=window.innerHeight,re=window.innerWidth,Q=152;let g=s.bottom+4,V=s.left;if(W){const ne=K-s.bottom,m=s.top;ne<Q&&m>Q&&(g=s.top-Q-4);const _=16,te=re-s.width-_;V=Math.min(Math.max(V,_),te)}else K-s.bottom<Q&&(g=s.top-Q-4);F({top:g,left:V,width:s.width})}},[h,P]);e.useEffect(()=>{if(G(),h){const s=()=>G(),W=()=>G();return window.addEventListener("resize",s),window.addEventListener("scroll",W,!0),()=>{window.removeEventListener("resize",s),window.removeEventListener("scroll",W,!0)}}},[h,G]),e.useEffect(()=>{const s=W=>{R.current&&!R.current.contains(W.target)&&(v(!1),S(!1))};return document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s)}},[]);const $=()=>{v(s=>!s),S(!0)},q=s=>{S(!0),f&&f(s)},j=s=>{x&&x(s)},D=s=>{C(s.target.value)},le=s=>{if(p&&t&&p.setValue(t,s),c.onChange){const W={target:{value:s}};c.onChange(W)}v(!1),S(!1),C("")};return e.createElement("div",{className:d("relative",l),ref:R},e.createElement("div",{id:c.id||t,tabIndex:0,role:"button","aria-haspopup":"listbox","aria-expanded":h,className:d("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",o),onClick:b?void 0:$,onFocus:b?void 0:q,onBlur:b?void 0:j,ref:I},b?e.createElement("input",{ref:L,type:"text",value:X,onChange:D,onFocus:b?s=>{S(!0),v(!0),f&&f(s)}:void 0,onBlur:b?s=>{x&&x(s)}:void 0,placeholder:n?"":M||"Selecione...",className:d("w-full bg-transparent border-none outline-none text-sm",!B&&!E&&"text-gray-400")}):e.createElement("span",{className:d("block truncate",!B&&"text-gray-400")},((T=r.find(s=>s.value===B))==null?void 0:T.label)||!n&&"Selecione..."),w&&B&&e.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",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",onClick:s=>{if(s.stopPropagation(),p&&t&&p.setValue(t,""),c.onChange){const W={target:{value:""}};c.onChange(W)}v(!1),S(!1)}},"✕")),n&&e.createElement("label",{htmlFor:c.id||t,className:d("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",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")},n),e.createElement("div",{className:d("absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden","bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",h?"border max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:h?"9.5rem":"0",overflowY:r.length>3?"auto":"hidden",position:"fixed",top:h?`${i.top}px`:"auto",left:h?`${i.left}px`:"auto",width:h?`${i.width}px`:"auto",zIndex:9999,boxShadow:h?"var(--select-dropdown-shadow)":"none"}},z.length===0?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},"Nenhuma opção encontrada"):z.map(s=>e.createElement("div",{key:s.value,className:d("px-3 py-2 cursor-pointer text-sm transition-colors duration-150","hover:bg-[var(--select-dropdown-hover)]",B===s.value&&"bg-[var(--select-dropdown-selected)]"),onMouseDown:()=>le(s.value)},s.label))),J&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},J))});Fe.displayName="Select";const Re=e.forwardRef(({name:t,className:n,label:r,onFocus:o,onBlur:l,Icon:w,iconClassName:b,iconAction:M,containerClassName:N,rows:y=4,...f},x)=>{var F,R,L;const[c,I]=e.useState(!1),k=Z.useFormContext(),S=k==null?void 0:k.control,h=k==null?void 0:k.register,v=S&&t?Z.useWatch({control:S,name:t}):void 0,E=f.value??v??"",C=(L=(R=(F=k==null?void 0:k.formState)==null?void 0:F.errors)==null?void 0:R[t])==null?void 0:L.message,i=c||!!E;return e.createElement("div",{className:d("relative",N)},e.createElement("textarea",{id:f.id||t,rows:y,className:d("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",w?"pr-12":"",n),onFocus:p=>{I(!0),o&&o(p)},...k&&t?(()=>{const p=h(t),H=p.onBlur;return{...p,ref:U=>{typeof x=="function"?x(U):x&&(x.current=U),p.ref&&p.ref(U)},onBlur:U=>{I(!1),l&&l(U),H&&H(U)}}})():{ref:x,onBlur:p=>{I(!1),l&&l(p)}},...f}),r&&e.createElement("label",{htmlFor:f.id||t,className:d("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",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")},r),w&&e.createElement("div",{className:d("absolute top-3 right-3 text-gray-400 cursor-pointer hover:text-[var(--primary,#2563eb)] transition-colors duration-200",b),onClick:M},e.createElement(w,null)),C&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},C))});Re.displayName="Textarea";const Ie=e.forwardRef(({name:t,label:n,loadOptions:r,className:o,containerClassName:l,isClearable:w,defaultOptions:b=!1,loadingMessage:M="Carregando...",noOptionsMessage:N="Nenhuma opção encontrada",searchable:y=!1,debounceMs:f=300,onFocus:x,onBlur:c,...I},k)=>{var K,re,Q;const[S,h]=e.useState(!1),[v,E]=e.useState(!1),[C,i]=e.useState([]),[F,R]=e.useState(!1),[L,p]=e.useState(""),[H,U]=e.useState(""),[B,J]=e.useState({top:0,left:0,width:0}),ee=e.useRef(null),Y=e.useRef(null),z=Z.useFormContext(),O=z==null?void 0:z.control,X=O&&t?Z.useWatch({control:O,name:t}):void 0,A=I.value??X??"",P=(Q=(re=(K=z==null?void 0:z.formState)==null?void 0:K.errors)==null?void 0:re[t])==null?void 0:Q.message,G=S||!!A,$=e.useCallback(()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=768,[]),q=e.useCallback(()=>{if(ee.current&&v){const g=ee.current.getBoundingClientRect(),V=$(),ne=window.innerHeight,m=window.innerWidth,_=152;let te=g.bottom+4,ie=g.left;if(V){const se=ne-g.bottom,de=g.top;se<_&&de>_&&(te=g.top-_-4);const ce=16,ue=m-g.width-ce;ie=Math.min(Math.max(ie,ce),ue)}else ne-g.bottom<_&&(te=g.top-_-4);J({top:te,left:ie,width:g.width})}},[v,$]);e.useEffect(()=>{if(q(),v){const g=()=>q(),V=()=>q();return window.addEventListener("resize",g),window.addEventListener("scroll",V,!0),()=>{window.removeEventListener("resize",g),window.removeEventListener("scroll",V,!0)}}},[v,q]),e.useEffect(()=>{const g=setTimeout(()=>{U(L)},f);return()=>clearTimeout(g)},[L,f]),e.useEffect(()=>{(v||b&&C.length===0)&&j(y?H:void 0)},[H,v]),e.useEffect(()=>{b===!0?j():Array.isArray(b)&&i(b)},[]);const j=async g=>{try{R(!0);const V=await r(g);i(V)}catch(V){console.error("Error loading options:",V),i([])}finally{R(!1)}};e.useEffect(()=>{const g=V=>{ee.current&&!ee.current.contains(V.target)&&(E(!1),h(!1),p(""))};return document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)}},[]);const D=()=>{v||(E(!0),h(!0),y&&Y.current&&setTimeout(()=>{var g;return(g=Y.current)==null?void 0:g.focus()},0))},le=g=>{h(!0),x&&x(g)},ae=g=>{c&&c(g)},oe=g=>{p(g.target.value)},u=g=>{if(z&&t&&z.setValue(t,g),I.onChange){const V={target:{value:g}};I.onChange(V)}E(!1),h(!1),p("")},T=g=>{if(g.stopPropagation(),z&&t&&z.setValue(t,""),I.onChange){const V={target:{value:""}};I.onChange(V)}E(!1),h(!1),p("")},s=C.find(g=>g.value===A),W=y&&v?L:(s==null?void 0:s.label)||"";return e.createElement("div",{className:d("relative",l),ref:ee},e.createElement("div",{id:I.id||t,tabIndex:y?-1:0,role:"button","aria-haspopup":"listbox","aria-expanded":v,className:d("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",o),onClick:D,onFocus:y?void 0:le,onBlur:y?void 0:ae,ref:k},y?e.createElement("input",{ref:Y,type:"text",value:W,onChange:oe,onFocus:le,onBlur:ae,placeholder:n?"":"Selecione...",className:d("w-full bg-transparent border-none outline-none text-sm",!A&&!L&&"text-gray-400")}):e.createElement("span",{className:d("block truncate",!A&&"text-gray-400")},(s==null?void 0:s.label)||!n&&"Selecione..."),F&&e.createElement("div",{className:"absolute right-8 top-1/2 -translate-y-1/2"},e.createElement("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]"})),w&&A&&!F&&e.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",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",onClick:T},"✕")),n&&e.createElement("label",{htmlFor:I.id||t,className:d("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",G?"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")},n),e.createElement("div",{className:d("absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden","bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",v?"border max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:v?"9.5rem":"0",overflowY:C.length>3?"auto":"hidden",position:"fixed",top:v?`${B.top}px`:"auto",left:v?`${B.left}px`:"auto",width:v?`${B.width}px`:"auto",zIndex:9999,boxShadow:v?"var(--select-dropdown-shadow)":"none"}},F?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},M):C.length===0?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},N):C.map(g=>e.createElement("div",{key:g.value,className:d("px-3 py-2 cursor-pointer text-sm transition-colors duration-150","hover:bg-[var(--select-dropdown-hover)]",A===g.value&&"bg-[var(--select-dropdown-selected)]"),onMouseDown:()=>u(g.value)},g.label))),P&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},P))});Ie.displayName="AsyncSelect";const Me=e.forwardRef(({name:t,label:n,options:r,className:o,containerClassName:l,isClearable:w,searchable:b=!1,filterPlaceholder:M="Digite para filtrar...",caseSensitive:N=!1,filterFunction:y,onFocus:f,onBlur:x,...c},I)=>{var le,ae,oe;const[k,S]=e.useState(!1),[h,v]=e.useState(!1),[E,C]=e.useState(""),[i,F]=e.useState({top:0,left:0,width:0}),R=e.useRef(null),L=e.useRef(null),p=Z.useFormContext(),H=p==null?void 0:p.control,U=H&&t?Z.useWatch({control:H,name:t}):void 0,B=c.value??U??[],J=(oe=(ae=(le=p==null?void 0:p.formState)==null?void 0:le.errors)==null?void 0:ae[t])==null?void 0:oe.message,Y=y||((u,T)=>{const s=N?u.label:u.label.toLowerCase(),W=N?T:T.toLowerCase();return s.includes(W)}),z=E.trim()?r.filter(u=>Y(u,E.trim())):r,O=k||B&&B.length>0||b&&!!E,X=e.useCallback(()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=768,[]),A=e.useCallback(()=>{if(R.current&&h){const u=R.current.getBoundingClientRect(),T=X(),s=window.innerHeight,W=window.innerWidth,K=152;let re=u.bottom+4,Q=u.left;if(T){const g=s-u.bottom,V=u.top;g<K&&V>K&&(re=u.top-K-4);const ne=16,m=W-u.width-ne;Q=Math.min(Math.max(Q,ne),m)}else s-u.bottom<K&&(re=u.top-K-4);F({top:re,left:Q,width:u.width})}},[h,X]);e.useEffect(()=>{if(A(),h){const u=()=>A(),T=()=>A();return window.addEventListener("resize",u),window.addEventListener("scroll",T,!0),()=>{window.removeEventListener("resize",u),window.removeEventListener("scroll",T,!0)}}},[h,A]),e.useEffect(()=>{const u=T=>{R.current&&!R.current.contains(T.target)&&(v(!1),S(!1))};return document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}},[]);const P=()=>{v(u=>!u),S(!0)},G=u=>{S(!0),f&&f(u)},$=u=>{x&&x(u)},q=u=>{var s;let T;B.includes(u)?T=B.filter(W=>W!==u):T=[...B,u],p&&t&&p.setValue(t,T),c.onChange&&((s=c.onChange)==null||s.call(c,{target:{value:T}})),S(!0)},j=u=>{var T;u.stopPropagation(),p&&t&&p.setValue(t,[]),c.onChange&&((T=c.onChange)==null||T.call(c,{target:{value:[]}})),v(!1),S(!1)},D=u=>{C(u.target.value)};return e.createElement("div",{className:d("relative",l),ref:R},e.createElement("div",{id:c.id||t,tabIndex:0,role:"button","aria-haspopup":"listbox","aria-expanded":h,className:d("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",o),onClick:b?void 0:P,onFocus:b?void 0:G,onBlur:b?void 0:$,ref:I},e.createElement("div",{className:"flex flex-nowrap gap-1 items-center min-h-[1.5rem] w-full overflow-x-auto",style:{scrollbarWidth:"none"}},B&&B.length>0?r.filter(u=>B.includes(u.value)).map(u=>e.createElement("span",{key:u.value,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",style:{maxWidth:"140px"}},e.createElement("span",{className:"truncate",title:u.label},u.label),e.createElement("button",{type:"button",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","aria-label":`Remover ${u.label}`,tabIndex:-1,onClick:T=>{T.stopPropagation();const s=B.filter(W=>W!==u.value);p&&t&&p.setValue(t,s),c.onChange&&c.onChange({target:{value:s}})}},e.createElement("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M3 3L9 9M9 3L3 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}))))):!n&&!b&&e.createElement("span",{className:"text-gray-400 text-sm"},"Selecione..."),b&&e.createElement("input",{ref:L,type:"text",value:E,onChange:D,onFocus:u=>{S(!0),v(!0),f&&f(u)},onBlur:u=>{x&&x(u)},placeholder:n?B&&B.length>0?"":M:M||"Selecione...",className:"flex-1 bg-transparent border-none outline-none text-sm min-w-[100px]"})),w&&B&&B.length>0&&e.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",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",onClick:j},"✕")),n&&e.createElement("label",{htmlFor:c.id||t,className:d("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",O?"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")},n),e.createElement("div",{className:d("absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden","bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",h?"border max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:h?"9.5rem":"0",overflowY:r.length>3?"auto":"hidden",position:"fixed",top:h?`${i.top}px`:"auto",left:h?`${i.left}px`:"auto",width:h?`${i.width}px`:"auto",zIndex:9999,boxShadow:h?"var(--select-dropdown-shadow)":"none"}},z.length===0?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},"Nenhuma opção encontrada"):z.map(u=>e.createElement("div",{key:u.value,className:d("px-3 py-2 cursor-pointer text-sm flex items-center gap-2 transition-colors duration-150","hover:bg-[var(--select-dropdown-hover)]",B.includes(u.value)&&"bg-[var(--select-dropdown-selected)] font-semibold"),onMouseDown:()=>q(u.value)},e.createElement("input",{type:"checkbox",checked:B.includes(u.value),readOnly:!0,className:"accent-blue-500"}),u.label))),J&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},J))});Me.displayName="MultiSelect";const Be=e.forwardRef(({name:t,label:n,loadOptions:r,className:o,containerClassName:l,isClearable:w,defaultOptions:b=!1,loadingMessage:M="Carregando...",noOptionsMessage:N="Nenhuma opção encontrada",searchable:y=!1,debounceMs:f=300,maxSelectedDisplay:x=3,onFocus:c,onBlur:I,...k},S)=>{var g,V,ne;const[h,v]=e.useState(!1),[E,C]=e.useState(!1),[i,F]=e.useState([]),[R,L]=e.useState(!1),[p,H]=e.useState(""),[U,B]=e.useState(""),[J,ee]=e.useState({top:0,left:0,width:0}),Y=e.useRef(null),z=e.useRef(null),O=Z.useFormContext(),X=O==null?void 0:O.control,A=X&&t?Z.useWatch({control:X,name:t}):void 0,P=k.value??A??[],G=(ne=(V=(g=O==null?void 0:O.formState)==null?void 0:g.errors)==null?void 0:V[t])==null?void 0:ne.message,$=h||P&&P.length>0,q=e.useCallback(()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=768,[]),j=e.useCallback(()=>{if(Y.current&&E){const m=Y.current.getBoundingClientRect(),_=q(),te=window.innerHeight,ie=window.innerWidth,se=152;let de=m.bottom+4,ce=m.left;if(_){const ue=te-m.bottom,$e=m.top;ue<se&&$e>se&&(de=m.top-se-4);const ye=16,We=ie-m.width-ye;ce=Math.min(Math.max(ce,ye),We)}else te-m.bottom<se&&(de=m.top-se-4);ee({top:de,left:ce,width:m.width})}},[E,q]);e.useEffect(()=>{if(j(),E){const m=()=>j(),_=()=>j();return window.addEventListener("resize",m),window.addEventListener("scroll",_,!0),()=>{window.removeEventListener("resize",m),window.removeEventListener("scroll",_,!0)}}},[E,j]),e.useEffect(()=>{const m=setTimeout(()=>{B(p)},f);return()=>clearTimeout(m)},[p,f]),e.useEffect(()=>{(E||b&&i.length===0)&&D(y?U:void 0)},[U,E]),e.useEffect(()=>{b===!0?D():Array.isArray(b)&&F(b)},[]);const D=async m=>{try{L(!0);const _=await r(m);F(_)}catch(_){console.error("Error loading options:",_),F([])}finally{L(!1)}};e.useEffect(()=>{const m=_=>{Y.current&&!Y.current.contains(_.target)&&(C(!1),v(!1),H(""))};return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[]);const le=()=>{E||(C(!0),v(!0),y&&z.current&&setTimeout(()=>{var m;return(m=z.current)==null?void 0:m.focus()},0))},ae=m=>{v(!0),c&&c(m)},oe=m=>{I&&I(m)},u=m=>{H(m.target.value)},T=m=>{let _;P.includes(m)?_=P.filter(te=>te!==m):_=[...P,m],O&&t&&O.setValue(t,_),k.onChange&&k.onChange({target:{value:_}}),v(!0)},s=(m,_)=>{_.stopPropagation();const te=P.filter(ie=>ie!==m);O&&t&&O.setValue(t,te),k.onChange&&k.onChange({target:{value:te}})},W=m=>{m.stopPropagation(),O&&t&&O.setValue(t,[]),k.onChange&&k.onChange({target:{value:[]}}),C(!1),v(!1),H("")},K=i.filter(m=>P.includes(m.value)),re=K.slice(0,x),Q=K.length-x;return e.createElement("div",{className:d("relative",l),ref:Y},e.createElement("div",{id:k.id||t,tabIndex:y?-1:0,role:"button","aria-haspopup":"listbox","aria-expanded":E,className:d("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",o),onClick:le,onFocus:y?void 0:ae,onBlur:y?void 0:oe,ref:S},e.createElement("div",{className:"flex flex-wrap gap-1 items-center min-h-[1.5rem] w-full"},re.map(m=>e.createElement("span",{key:m.value,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",style:{maxWidth:"140px"}},e.createElement("span",{className:"truncate",title:m.label},m.label),e.createElement("button",{type:"button",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","aria-label":`Remover ${m.label}`,tabIndex:-1,onClick:_=>s(m.value,_)},e.createElement("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M3 3L9 9M9 3L3 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}))))),Q>0&&e.createElement("span",{className:"flex items-center border border-gray-200 bg-gray-100 text-gray-600 rounded-2xl px-3 py-1 text-xs"},"+",Q," mais"),y?e.createElement("input",{ref:z,type:"text",value:p,onChange:u,onFocus:ae,onBlur:oe,placeholder:P.length===0&&!n?"Selecione...":"",className:"flex-1 min-w-[120px] bg-transparent border-none outline-none text-sm"}):P.length===0&&!n&&e.createElement("span",{className:"text-gray-400 text-sm"},"Selecione...")),R&&e.createElement("div",{className:"absolute right-8 top-1/2 -translate-y-1/2"},e.createElement("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]"})),w&&P&&P.length>0&&!R&&e.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",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",onClick:W},"✕")),n&&e.createElement("label",{htmlFor:k.id||t,className:d("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",$?"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")},n),e.createElement("div",{className:d("absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden","bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",E?"border max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:E?"9.5rem":"0",overflowY:i.length>3?"auto":"hidden",position:"fixed",top:E?`${J.top}px`:"auto",left:E?`${J.left}px`:"auto",width:E?`${J.width}px`:"auto",zIndex:9999,boxShadow:E?"var(--select-dropdown-shadow)":"none"}},R?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},M):i.length===0?e.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},N):i.map(m=>e.createElement("div",{key:m.value,className:d("px-3 py-2 cursor-pointer text-sm flex items-center gap-2 transition-colors duration-150","hover:bg-[var(--select-dropdown-hover)]",P.includes(m.value)&&"bg-[var(--select-dropdown-selected)] font-semibold"),onMouseDown:()=>T(m.value)},e.createElement("input",{type:"checkbox",checked:P.includes(m.value),readOnly:!0,className:"accent-blue-500"}),m.label))),G&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},G))});Be.displayName="MultiAsyncSelect";const je={sm:"h-10 text-sm px-3",md:"h-12 text-base px-4",lg:"h-16 text-lg px-6"},Le=e.forwardRef(({name:t,label:n,options:r,className:o,containerClassName:l,optionClassName:w,direction:b="row",size:M="md",onFocus:N,onBlur:y,...f},x)=>{var E,C,i;const c=Z.useFormContext(),I=c==null?void 0:c.control,k=I&&t?Z.useWatch({control:I,name:t}):void 0,S=f.value??k??"",h=(i=(C=(E=c==null?void 0:c.formState)==null?void 0:E.errors)==null?void 0:C[t])==null?void 0:i.message,v=F=>{c&&t&&c.setValue(t,F),f.onChange&&f.onChange({target:{value:F}})};return e.createElement("div",{className:d("relative",l),ref:x},n&&e.createElement("label",{htmlFor:t,className:d("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm transition-all duration-200","top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white")},n),e.createElement("div",{className:d("flex gap-2 w-full pt-6",b==="row"?"flex-row":"flex-col",o),"aria-label":n,tabIndex:-1,onFocus:N,onBlur:y},r.map(F=>e.createElement("button",{key:F.value,type:"button",className:d("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)]",je[M],S===F.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",w),"aria-pressed":S===F.value,"data-selected":S===F.value,tabIndex:0,onClick:()=>v(F.value),onKeyDown:R=>{(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),v(F.value))}},F.icon&&e.createElement("span",{className:"mr-2 text-lg flex items-center"},F.icon),e.createElement("span",{className:"truncate font-medium"},F.label)))),h&&e.createElement("span",{className:"text-red-500 text-xs mt-1 block"},h))});Le.displayName="RadioGroup";const fe=a.forwardRef(({children:t,className:n,as:r="div",...o},l)=>a.createElement(r,{ref:l,className:d("px-2 py-1 sm:px-4 sm:py-2 lg:px-6 lg:py-4 border-b","bg-[var(--card-header-bg,rgba(249,250,251,0.5))]","border-[var(--card-header-border,#e5e7eb)]","text-[var(--card-text,#111827)]",n),...o},t));fe.displayName="CardHeader";const me=a.forwardRef(({children:t,className:n,as:r="div",...o},l)=>a.createElement(r,{ref:l,className:d("px-2 py-1 sm:px-4 sm:py-2 lg:px-6 lg:py-4","flex-1","bg-[var(--card-bg,#ffffff)]","text-[var(--card-text,#111827)]",n),...o},t));me.displayName="CardBody";const pe=a.forwardRef(({children:t,className:n,as:r="div",...o},l)=>a.createElement(r,{ref:l,className:d("px-6 py-4 border-t","bg-[var(--card-footer-bg,rgba(249,250,251,0.5))]","border-[var(--card-footer-border,#e5e7eb)]","text-[var(--card-text,#111827)]",n),...o},t));pe.displayName="CardFooter";const Ue=a.forwardRef(({children:t,className:n,variant:r="default",size:o="md",padding:l="none",rounded:w="lg",constrainWidth:b=!1,allowOverflow:M=!1,...N},y)=>{const f={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))]",outlined:"bg-[var(--card-bg,#ffffff)] border-2 border-[var(--primary,#2563eb)]",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))]",flat:"bg-[var(--card-bg,#ffffff)] border-0"},x={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"},c={none:"",sm:"p-3",md:"p-4",lg:"p-6"},I={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"};return a.createElement("div",{ref:y,className:d("flex flex-col",!M&&"overflow-hidden",f[r],b&&x[o],c[l],I[w],n),...N},t)}),qe=Object.assign(Ue,{Header:fe,Body:me,Footer:pe}),Pe=a.forwardRef(({children:t,className:n,variant:r="default",size:o="md",responsive:l=!1,stickyHeader:w=!1,...b},M)=>{const N=d("w-full border-collapse bg-[var(--table-bg)] text-[var(--table-text)]",{"border border-[var(--table-border)]":r==="bordered"},{"text-sm":o==="sm","text-base":o==="md","text-lg":o==="lg"},n),y=d({"overflow-x-auto":l,"max-h-96 overflow-y-auto":w}),f=a.createElement("table",{ref:M,className:N,...b},t);return l||w?a.createElement("div",{className:y},f):f}),be=a.forwardRef(({children:t,className:n,as:r="thead",...o},l)=>a.createElement(r,{ref:l,className:d("border-b border-[var(--table-border)] bg-[var(--table-header-bg)]",{"sticky top-0 z-10":r==="thead"},n),...o},t)),ge=a.forwardRef(({children:t,className:n,as:r="tbody",...o},l)=>a.createElement(r,{ref:l,className:d("[&_tr:nth-child(odd)]:bg-[var(--table-row-odd)]","[&_tr:nth-child(even)]:bg-[var(--table-row-even)]",n),...o},t)),he=a.forwardRef(({children:t,className:n,as:r="tfoot",...o},l)=>a.createElement(r,{ref:l,className:d("border-t border-[var(--table-border)] bg-[var(--table-header-bg)] font-medium",n),...o},t)),ve=a.forwardRef(({children:t,className:n,variant:r="default",...o},l)=>a.createElement("tr",{ref:l,className:d("border-b border-[var(--table-border)] transition-colors",{"hover:bg-[var(--table-row-hover)]":r==="hover","bg-[var(--table-row-selected)]":r==="selected"},n),...o},t)),xe=a.forwardRef(({children:t,className:n,as:r="td",align:o="left",scope:l,colSpan:w,rowSpan:b,...M},N)=>a.createElement(r,{ref:N,scope:r==="th"?l:void 0,colSpan:w,rowSpan:b,className:d("px-4 py-3 text-left",{"font-semibold":r==="th","text-sm":r==="td","text-center":o==="center","text-right":o==="right"},n),...M},t));Pe.displayName="Table";be.displayName="TableHeader";ge.displayName="TableBody";he.displayName="TableFooter";ve.displayName="TableRow";xe.displayName="TableCell";const Ye=Object.assign(Pe,{Header:be,Body:ge,Footer:he,Row:ve,Cell:xe}),Ge=({content:t,children:n,position:r="top",className:o="",disabled:l=!1})=>{const[w,b]=a.useState(!1),[M,N]=a.useState(r),[y,f]=a.useState({}),x=a.useRef(null),c=a.useRef(null);a.useEffect(()=>{if(!w||!c.current)return;const i=c.current.getBoundingClientRect();let F=r,R=0,L=0;switch(r){case"top":R=i.top-8,L=i.left+i.width/2;break;case"bottom":R=i.bottom+8,L=i.left+i.width/2;break;case"left":R=i.top+i.height/2,L=i.left-8;break;case"right":R=i.top+i.height/2,L=i.right+8;break}if(x.current){const p=x.current.getBoundingClientRect(),H=window.innerWidth,U=window.innerHeight;r==="top"&&i.top<p.height+16?(F="bottom",R=i.bottom+8):r==="bottom"&&i.bottom+p.height+16>U?(F="top",R=i.top-8):r==="left"&&i.left<p.width+16?(F="right",L=i.right+8):r==="right"&&i.right+p.width+16>H&&(F="left",L=i.left-8)}N(F),f({position:"fixed",top:`${R}px`,left:`${L}px`,zIndex:9999})},[w,r]);const I=()=>{l||b(!0)},k=()=>{b(!1)},S=()=>{l||b(!0)},h=()=>{b(!1)},v=()=>{const C="pointer-events-none";switch(M){case"top":return`${C} transform -translate-x-1/2 -translate-y-full`;case"bottom":return`${C} transform -translate-x-1/2`;case"left":return`${C} transform -translate-x-full -translate-y-1/2`;case"right":return`${C} transform -translate-y-1/2`;default:return`${C} transform -translate-x-1/2 -translate-y-full`}},E=()=>{const C="absolute w-2 h-2 bg-[var(--tooltip-bg,#374151)] transform rotate-45";switch(M){case"top":return`${C} top-full left-1/2 -translate-x-1/2 -translate-y-1/2`;case"bottom":return`${C} bottom-full left-1/2 -translate-x-1/2 translate-y-1/2`;case"left":return`${C} left-full top-1/2 -translate-y-1/2 -translate-x-1/2`;case"right":return`${C} right-full top-1/2 -translate-y-1/2 translate-x-1/2`;default:return`${C} top-full left-1/2 -translate-x-1/2 -translate-y-1/2`}};return l||!t?a.createElement(a.Fragment,null,n):a.createElement(a.Fragment,null,a.createElement("div",{className:"relative inline-block",ref:c,onMouseEnter:I,onMouseLeave:k,onFocus:S,onBlur:h},n),w&&typeof document<"u"&&Ce.createPortal(a.createElement("div",{ref:x,style:y,className:d(v(),"px-2 py-1 text-sm rounded whitespace-nowrap","bg-[var(--tooltip-bg,#374151)] text-[var(--tooltip-text,#fff)]","shadow-[var(--tooltip-shadow,0_10px_15px_-3px_rgb(0_0_0_/_0.1),_0_4px_6px_-4px_rgb(0_0_0_/_0.1))]","transition-opacity duration-200 ease-in-out",o),role:"tooltip","aria-hidden":!w},t,a.createElement("div",{className:E()})),document.body))},Ae=({open:t,onClose:n,side:r="right",size:o="md",closeOnOverlayClick:l=!0,children:w,className:b="",...M})=>{const N=typeof document<"u"?document.body:null,y=o==="sm"?"w-64":o==="md"?"w-96":o==="lg"?"w-[36rem]":void 0,f=typeof o=="string"&&!["sm","md","lg"].includes(o)?{width:o}:void 0,x=a.createElement("div",{"aria-hidden":!t,className:d("fixed inset-0 z-50 flex",t?"pointer-events-auto":"pointer-events-none")},a.createElement("div",{className:d("absolute inset-0 bg-black/40 transition-opacity duration-200",t?"opacity-100":"opacity-0"),onMouseDown:c=>{l&&c.target===c.currentTarget&&n()}}),a.createElement("div",{className:d("relative h-full",r==="right"?"ml-auto":"mr-auto","flex-shrink-0"),style:f},a.createElement("aside",{role:"dialog","aria-modal":!0,className:d("h-full bg-white shadow-xl border-l border-gray-100 overflow-auto transition-transform duration-300",r==="right"?t?"translate-x-0":"translate-x-full":t?"translate-x-0":"-translate-x-full",y,b),style:f,...M},w)));return N?Ce.createPortal(x,N):null};Ae.displayName="AsideSheet";const Ke=({avatar:t=!1,value:n,onUpload:r,onRemove:o,accept:l="image/*",maxSize:w,placeholder:b="Selecionar imagem",loading:M=!1,size:N="md",label:y,error:f,disabled:x,className:c,...I})=>{const[k,S]=a.useState(null),[h,v]=a.useState(""),[E,C]=a.useState(!1),i=a.useRef(null),F=!!n,R=!!k,L=F||R,p=M||E,H={sm:t?"w-16 h-16":"w-24 h-16",md:t?"w-24 h-24":"w-32 h-24",lg:t?"w-32 h-32":"w-40 h-32"},B=b||(t?"Adicionar foto":"Selecionar imagem"),J=A=>{var $;const P=($=A.target.files)==null?void 0:$[0];if(!P)return;if(w&&P.size>w){alert(`Arquivo muito grande. Tamanho máximo: ${(w/1024/1024).toFixed(1)}MB`);return}const G=new FileReader;G.onload=q=>{var j;v((j=q.target)==null?void 0:j.result),S(P)},G.readAsDataURL(P)},ee=async()=>{if(!(!k||!r))try{C(!0);const A=await r(k);S(null),v(""),i.current&&(i.current.value="")}catch(A){console.error("Erro ao fazer upload:",A),alert("Erro ao fazer upload da imagem")}finally{C(!1)}},Y=()=>{S(null),v(""),i.current&&(i.current.value="")},z=async()=>{try{o&&await o(n),S(null),v(""),i.current&&(i.current.value="")}catch(A){console.error("Erro ao remover imagem:",A),alert("Erro ao remover imagem")}},O=()=>{var A;x||p||(A=i.current)==null||A.click()},X=h||n;return a.createElement("div",{className:d("flex flex-col space-y-2",c)},y&&a.createElement("label",{className:"text-sm font-medium text-gray-700"},y),a.createElement("div",{className:"relative flex flex-col items-center"},a.createElement("input",{ref:i,type:"file",accept:l,onChange:J,disabled:x||p,className:"hidden",...I}),a.createElement("div",{onClick:O,className:d("relative border-2 border-dashed border-gray-300 transition-colors cursor-pointer","hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",t?"rounded-full":"rounded-lg",H[N],x&&"opacity-50 cursor-not-allowed",p&&"cursor-wait",f&&"border-red-300",!L&&"bg-gray-50 hover:bg-gray-100",L&&"border-solid border-gray-200")},L?a.createElement("img",{src:X,alt:"Preview",className:d("w-full h-full object-cover",t?"rounded-full":"rounded-lg")}):a.createElement("div",{className:"flex flex-col items-center justify-center h-full text-gray-500 text-sm"},t?a.createElement(a.Fragment,null,a.createElement("svg",{className:"w-8 h-8 mb-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})),a.createElement("span",{className:"text-center px-2 text-xs"},B)):a.createElement(a.Fragment,null,a.createElement("svg",{className:"w-6 h-6 mb-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})),a.createElement("span",{className:"text-center px-2"},B))),p&&a.createElement("div",{className:d("absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center",t?"rounded-full":"rounded-lg")},a.createElement("div",{className:"w-6 h-6 border-2 border-white border-t-transparent rounded-full animate-spin"}))),L&&!p&&a.createElement("div",{className:"flex justify-center space-x-2 mt-3"},R?a.createElement(a.Fragment,null,a.createElement("button",{onClick:ee,disabled:!r,className:"px-3 py-1 bg-blue-600 text-white text-sm rounded hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed"},"Confirmar"),a.createElement("button",{onClick:Y,className:"px-3 py-1 bg-gray-600 text-white text-sm rounded hover:bg-gray-700"},"Cancelar")):a.createElement("button",{onClick:z,disabled:!o,className:"px-3 py-1 bg-red-600 text-white text-sm rounded hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed"},"Remover"))),f&&a.createElement("p",{className:"text-sm text-red-600"},f),w&&!L&&a.createElement("p",{className:"text-xs text-gray-500"},"Tamanho máximo: ",(w/1024/1024).toFixed(1),"MB"),t&&!L&&a.createElement("p",{className:"text-xs text-gray-500 text-center"},"Use uma foto com seu rosto centralizado e bem visível"))},_e=a.createContext(null),Je=()=>{const t=a.useContext(_e);if(!t)throw new Error("AccordionItem must be used within an Accordion");return t};let Te=0;const we=({title:t,children:n,defaultOpen:r=!1,disabled:o=!1,className:l,headerClassName:w,contentClassName:b,icon:M})=>{const{openItems:N,toggleItem:y,variant:f}=Je(),[x]=a.useState(()=>Te++),c=N.has(x),I=a.useRef(null),[k,S]=a.useState(r?void 0:0);a.useEffect(()=>{if(c){const C=I.current;C&&S(C.scrollHeight)}else S(0)},[c]);const h=()=>{o||y(x)},E={default:{item:"border-b border-[var(--accordion-border,#e5e7eb)] last:border-b-0",header:"",content:""},bordered:{item:"border border-[var(--accordion-border,#e5e7eb)] rounded-md mb-2",header:"border-b border-[var(--accordion-border,#e5e7eb)]",content:""},separated:{item:"border border-[var(--accordion-border,#e5e7eb)] rounded-md mb-3 shadow-sm",header:"",content:""}}[f];return a.createElement("div",{className:d(E.item,l)},a.createElement("button",{type:"button",onClick:h,disabled:o,"aria-expanded":c,className:d("w-full flex items-center justify-between px-4 py-3 text-left transition-colors","bg-[var(--accordion-header-bg,transparent)]","hover:bg-[var(--accordion-header-hover,rgba(0,0,0,0.05))]","text-[var(--accordion-text,#111827)]","font-medium",o&&"opacity-50 cursor-not-allowed",c&&f!=="default"&&E.header,w)},a.createElement("span",{className:"flex items-center gap-2"},M&&a.createElement("span",{className:"flex-shrink-0"},M),t),a.createElement("svg",{className:d("w-5 h-5 transition-transform duration-200 flex-shrink-0","text-[var(--accordion-icon,#6b7280)]",c&&"rotate-180"),fill:"none",strokeWidth:"2",stroke:"currentColor",viewBox:"0 0 24 24"},a.createElement("path",{d:"M19 9l-7 7-7-7"}))),a.createElement("div",{style:{height:k,overflow:"hidden",transition:"height 0.3s ease-in-out"}},a.createElement("div",{ref:I,className:d("px-4 py-3","text-[var(--accordion-content-text,#374151)]","bg-[var(--accordion-content-bg,transparent)]",b)},n)))};we.displayName="AccordionItem";const Oe=({children:t,type:n="single",className:r,variant:o="default",collapsible:l=!0})=>{const[w,b]=a.useState(new Set);a.useEffect(()=>{Te=0;const N=a.Children.toArray(t),y=new Set;if(N.forEach((f,x)=>{a.isValidElement(f)&&f.props.defaultOpen&&y.add(x)}),n==="single"&&y.size>1){const f=Array.from(y)[0];b(new Set([f]))}else b(y)},[t,n]);const M=N=>{b(y=>{const f=new Set(y);return n==="single"?f.has(N)?l&&f.clear():(f.clear(),f.add(N)):f.has(N)?f.delete(N):f.add(N),f})};return a.createElement(_e.Provider,{value:{type:n,openItems:w,toggleItem:M,collapsible:l,variant:o}},a.createElement("div",{className:d("w-full",r)},t))};Oe.Item=we;exports.Accordion=Oe;exports.AccordionItem=we;exports.AsideSheet=Ae;exports.AsyncSelect=Ie;exports.Button=Ve;exports.Card=qe;exports.CardBody=me;exports.CardFooter=pe;exports.CardHeader=fe;exports.ImageInput=Ke;exports.Input=Se;exports.MultiAsyncSelect=Be;exports.MultiSelect=Me;exports.RadioGroup=Le;exports.Select=Fe;exports.Table=Ye;exports.TableBody=ge;exports.TableCell=xe;exports.TableFooter=he;exports.TableHeader=be;exports.TableRow=ve;exports.Textarea=Re;exports.Tooltip=Ge;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),Z=require("react-hook-form"),me=require("react-dom");function je(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const t=je(a);function ke(e){var n,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(n=0;n<l;n++)e[n]&&(r=ke(e[n]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function De(){for(var e,n,r=0,o="",l=arguments.length;r<l;r++)(e=arguments[r])&&(n=ke(e))&&(o&&(o+=" "),o+=n);return o}function i(...e){return De(...e)}const Ue=({children:e,variant:n="default",className:r="",...o})=>{const l="px-4 py-2 rounded font-medium transition",h={default:"bg-[var(--primary,#2563eb)] text-[var(--primary-text,#fff)] hover:bg-[var(--primary-hover,#1d4ed8)]",outline:"border border-[var(--primary,#2563eb)] text-[var(--primary,#2563eb)] bg-white hover:bg-[var(--primary-hover,#e0e7ff)]",secondary:"bg-[var(--secondary,#fbbf24)] text-[var(--secondary-text,#222)] hover:bg-[var(--secondary-hover,#f59e42)]"};return a.createElement("button",{className:i(l,h[n],r),...o},e)},Se=e=>e.replace(/\D/g,""),qe=e=>{const r=Se(e).slice(0,11);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)}`},Ne=e=>{const n=Se(e);if(n.length!==11||/^(\d)\1{10}$/.test(n))return!1;let r=0;for(let l=0;l<9;l++)r+=parseInt(n.charAt(l))*(10-l);let o=r*10%11;if((o===10||o===11)&&(o=0),o!==parseInt(n.charAt(9)))return!1;r=0;for(let l=0;l<10;l++)r+=parseInt(n.charAt(l))*(11-l);return o=r*10%11,(o===10||o===11)&&(o=0),o===parseInt(n.charAt(10))},Me=t.forwardRef(({name:e,className:n,type:r="text",label:o,onFocus:l,onBlur:h,onChange:d,Icon:k,iconClassName:v,iconAction:g,containerClassName:u,cpf:x=!1,...s},S)=>{var P,I,G;const[M,L]=t.useState(!1),[y,E]=t.useState(!1),[C,N]=t.useState(null),m=Z.useFormContext(),F=m==null?void 0:m.control,R=m==null?void 0:m.register,B=F&&e?Z.useWatch({control:F,name:e}):void 0,b=s.value??B??"",H=((G=(I=(P=m==null?void 0:m.formState)==null?void 0:P.errors)==null?void 0:I[e])==null?void 0:G.message)||C,T=["date","datetime-local","time","month","week"].includes(r),J=M||!!b||T,ee=r==="password"?y?"text":"password":r,Y=()=>t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{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",fill:"currentColor"})),O=()=>t.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{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",fill:"currentColor"})),W=()=>{E(!y)},X=z=>{if(x){const q=z.target.value,D=qe(q);z.target.value=D,D.length===14?Ne(D)?N(null):N("CPF inválido"):N(null)}d&&d(z)};return t.createElement("div",{className:i("relative",u)},t.createElement("input",{id:s.id||e,type:ee,className:i("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",r==="password"||k?"pr-12":"",H?"border-red-500":"",n),onFocus:z=>{L(!0),l&&l(z)},maxLength:x?14:s.maxLength,inputMode:x?"numeric":s.inputMode,...m&&e?(()=>{const z=R(e,x?{validate:j=>j?j.length<14?"CPF incompleto":Ne(j)?!0:"CPF inválido":"CPF é obrigatório"}:void 0),q=z.onBlur,D=z.onChange;return{...z,ref:j=>{typeof S=="function"?S(j):S&&(S.current=j),z.ref&&z.ref(j)},onBlur:j=>{L(!1),h&&h(j),q&&q(j)},onChange:j=>{X(j),D&&D(j)}}})():{ref:S,onBlur:z=>{L(!1),h&&h(z)},onChange:X},...s}),o&&t.createElement("label",{htmlFor:s.id||e,className:i("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",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")},o),r==="password"&&t.createElement("button",{type:"button",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)]",onClick:W,"aria-label":y?"Esconder senha":"Mostrar senha",tabIndex:-1},y?t.createElement(O,null):t.createElement(Y,null)),k&&r!=="password"&&t.createElement("div",{className:i("absolute top-1/2 right-3 -translate-y-1/2 text-gray-400 cursor-pointer hover:text-[var(--primary,#2563eb)] transition-colors duration-200",v),onClick:g},t.createElement(k,null)),H&&t.createElement("span",{className:"text-red-500 text-xs mt-1 block"},H))});Me.displayName="Input";const Le=t.forwardRef(({name:e,label:n,options:r,className:o,containerClassName:l,isClearable:h,searchable:d=!1,filterPlaceholder:k="Digite para filtrar...",caseSensitive:v=!1,filterFunction:g,onFocus:u,onBlur:x,...s},S)=>{var ae,oe,f,_;const[M,L]=t.useState(!1),[y,E]=t.useState(!1),[C,N]=t.useState(""),[m,F]=t.useState({top:0,left:0,width:0}),R=t.useRef(null),B=t.useRef(null),b=Z.useFormContext(),H=b==null?void 0:b.control,U=H&&e?Z.useWatch({control:H,name:e}):void 0,T=s.value??U??"",J=(f=(oe=(ae=b==null?void 0:b.formState)==null?void 0:ae.errors)==null?void 0:oe[e])==null?void 0:f.message,Y=g||((c,$)=>{const K=v?c.label:c.label.toLowerCase(),re=v?$:$.toLowerCase();return K.includes(re)}),O=C.trim()?r.filter(c=>Y(c,C.trim())):r,W=r.find(c=>c.value===T),X=d&&y?C:(W==null?void 0:W.label)||"",P=M||!!T||d&&!!C,I=t.useCallback(()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=768,[]),G=t.useCallback(()=>{if(R.current&&y){const c=R.current.getBoundingClientRect(),$=I(),K=window.innerHeight,re=window.innerWidth,Q=152;let w=c.bottom+4,V=c.left;if($){const ne=K-c.bottom,p=c.top;ne<Q&&p>Q&&(w=c.top-Q-4);const A=16,te=re-c.width-A;V=Math.min(Math.max(V,A),te)}else K-c.bottom<Q&&(w=c.top-Q-4);F({top:w,left:V,width:c.width})}},[y,I]);t.useEffect(()=>{if(G(),y){const c=()=>G(),$=()=>G();return window.addEventListener("resize",c),window.addEventListener("scroll",$,!0),()=>{window.removeEventListener("resize",c),window.removeEventListener("scroll",$,!0)}}},[y,G]),t.useEffect(()=>{const c=$=>{R.current&&!R.current.contains($.target)&&(E(!1),L(!1))};return document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}},[]);const z=()=>{E(c=>!c),L(!0)},q=c=>{L(!0),u&&u(c)},D=c=>{x&&x(c)},j=c=>{N(c.target.value)},le=c=>{if(b&&e&&b.setValue(e,c),s.onChange){const $={target:{value:c}};s.onChange($)}E(!1),L(!1),N("")};return t.createElement("div",{className:i("relative",l),ref:R},t.createElement("div",{id:s.id||e,tabIndex:0,role:"button","aria-haspopup":"listbox","aria-expanded":y,className:i("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",o),onClick:d?void 0:z,onFocus:d?void 0:q,onBlur:d?void 0:D,ref:S},d?t.createElement("input",{ref:B,type:"text",value:X,onChange:j,onFocus:d?c=>{L(!0),E(!0),u&&u(c)}:void 0,onBlur:d?c=>{x&&x(c)}:void 0,placeholder:n?"":k||"Selecione...",className:i("w-full bg-transparent border-none outline-none text-sm",!T&&!C&&"text-gray-400")}):t.createElement("span",{className:i("block truncate",!T&&"text-gray-400")},((_=r.find(c=>c.value===T))==null?void 0:_.label)||!n&&"Selecione..."),h&&T&&t.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",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",onClick:c=>{if(c.stopPropagation(),b&&e&&b.setValue(e,""),s.onChange){const $={target:{value:""}};s.onChange($)}E(!1),L(!1)}},"✕")),n&&t.createElement("label",{htmlFor:s.id||e,className:i("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",P?"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")},n),t.createElement("div",{className:i("absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden","bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",y?"border max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:y?"9.5rem":"0",overflowY:r.length>3?"auto":"hidden",position:"fixed",top:y?`${m.top}px`:"auto",left:y?`${m.left}px`:"auto",width:y?`${m.width}px`:"auto",zIndex:9999,boxShadow:y?"var(--select-dropdown-shadow)":"none"}},O.length===0?t.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},"Nenhuma opção encontrada"):O.map(c=>t.createElement("div",{key:c.value,className:i("px-3 py-2 cursor-pointer text-sm transition-colors duration-150","hover:bg-[var(--select-dropdown-hover)]",T===c.value&&"bg-[var(--select-dropdown-selected)]"),onMouseDown:()=>le(c.value)},c.label))),J&&t.createElement("span",{className:"text-red-500 text-xs mt-1 block"},J))});Le.displayName="Select";const Fe=t.forwardRef(({name:e,className:n,label:r,onFocus:o,onBlur:l,Icon:h,iconClassName:d,iconAction:k,containerClassName:v,rows:g=4,...u},x)=>{var F,R,B;const[s,S]=t.useState(!1),M=Z.useFormContext(),L=M==null?void 0:M.control,y=M==null?void 0:M.register,E=L&&e?Z.useWatch({control:L,name:e}):void 0,C=u.value??E??"",N=(B=(R=(F=M==null?void 0:M.formState)==null?void 0:F.errors)==null?void 0:R[e])==null?void 0:B.message,m=s||!!C;return t.createElement("div",{className:i("relative",v)},t.createElement("textarea",{id:u.id||e,rows:g,className:i("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",h?"pr-12":"",n),onFocus:b=>{S(!0),o&&o(b)},...M&&e?(()=>{const b=y(e),H=b.onBlur;return{...b,ref:U=>{typeof x=="function"?x(U):x&&(x.current=U),b.ref&&b.ref(U)},onBlur:U=>{S(!1),l&&l(U),H&&H(U)}}})():{ref:x,onBlur:b=>{S(!1),l&&l(b)}},...u}),r&&t.createElement("label",{htmlFor:u.id||e,className:i("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",m?"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")},r),h&&t.createElement("div",{className:i("absolute top-3 right-3 text-gray-400 cursor-pointer hover:text-[var(--primary,#2563eb)] transition-colors duration-200",d),onClick:k},t.createElement(h,null)),N&&t.createElement("span",{className:"text-red-500 text-xs mt-1 block"},N))});Fe.displayName="Textarea";const Re=t.forwardRef(({name:e,label:n,loadOptions:r,className:o,containerClassName:l,isClearable:h,defaultOptions:d=!1,loadingMessage:k="Carregando...",noOptionsMessage:v="Nenhuma opção encontrada",searchable:g=!1,debounceMs:u=300,onFocus:x,onBlur:s,...S},M)=>{var K,re,Q;const[L,y]=t.useState(!1),[E,C]=t.useState(!1),[N,m]=t.useState([]),[F,R]=t.useState(!1),[B,b]=t.useState(""),[H,U]=t.useState(""),[T,J]=t.useState({top:0,left:0,width:0}),ee=t.useRef(null),Y=t.useRef(null),O=Z.useFormContext(),W=O==null?void 0:O.control,X=W&&e?Z.useWatch({control:W,name:e}):void 0,P=S.value??X??"",I=(Q=(re=(K=O==null?void 0:O.formState)==null?void 0:K.errors)==null?void 0:re[e])==null?void 0:Q.message,G=L||!!P,z=t.useCallback(()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=768,[]),q=t.useCallback(()=>{if(ee.current&&E){const w=ee.current.getBoundingClientRect(),V=z(),ne=window.innerHeight,p=window.innerWidth,A=152;let te=w.bottom+4,ie=w.left;if(V){const se=ne-w.bottom,de=w.top;se<A&&de>A&&(te=w.top-A-4);const ce=16,ue=p-w.width-ce;ie=Math.min(Math.max(ie,ce),ue)}else ne-w.bottom<A&&(te=w.top-A-4);J({top:te,left:ie,width:w.width})}},[E,z]);t.useEffect(()=>{if(q(),E){const w=()=>q(),V=()=>q();return window.addEventListener("resize",w),window.addEventListener("scroll",V,!0),()=>{window.removeEventListener("resize",w),window.removeEventListener("scroll",V,!0)}}},[E,q]),t.useEffect(()=>{const w=setTimeout(()=>{U(B)},u);return()=>clearTimeout(w)},[B,u]),t.useEffect(()=>{(E||d&&N.length===0)&&D(g?H:void 0)},[H,E]),t.useEffect(()=>{d===!0?D():Array.isArray(d)&&m(d)},[]);const D=async w=>{try{R(!0);const V=await r(w);m(V)}catch(V){console.error("Error loading options:",V),m([])}finally{R(!1)}};t.useEffect(()=>{const w=V=>{ee.current&&!ee.current.contains(V.target)&&(C(!1),y(!1),b(""))};return document.addEventListener("mousedown",w),()=>{document.removeEventListener("mousedown",w)}},[]);const j=()=>{E||(C(!0),y(!0),g&&Y.current&&setTimeout(()=>{var w;return(w=Y.current)==null?void 0:w.focus()},0))},le=w=>{y(!0),x&&x(w)},ae=w=>{s&&s(w)},oe=w=>{b(w.target.value)},f=w=>{if(O&&e&&O.setValue(e,w),S.onChange){const V={target:{value:w}};S.onChange(V)}C(!1),y(!1),b("")},_=w=>{if(w.stopPropagation(),O&&e&&O.setValue(e,""),S.onChange){const V={target:{value:""}};S.onChange(V)}C(!1),y(!1),b("")},c=N.find(w=>w.value===P),$=g&&E?B:(c==null?void 0:c.label)||"";return t.createElement("div",{className:i("relative",l),ref:ee},t.createElement("div",{id:S.id||e,tabIndex:g?-1:0,role:"button","aria-haspopup":"listbox","aria-expanded":E,className:i("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",o),onClick:j,onFocus:g?void 0:le,onBlur:g?void 0:ae,ref:M},g?t.createElement("input",{ref:Y,type:"text",value:$,onChange:oe,onFocus:le,onBlur:ae,placeholder:n?"":"Selecione...",className:i("w-full bg-transparent border-none outline-none text-sm",!P&&!B&&"text-gray-400")}):t.createElement("span",{className:i("block truncate",!P&&"text-gray-400")},(c==null?void 0:c.label)||!n&&"Selecione..."),F&&t.createElement("div",{className:"absolute right-8 top-1/2 -translate-y-1/2"},t.createElement("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]"})),h&&P&&!F&&t.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",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",onClick:_},"✕")),n&&t.createElement("label",{htmlFor:S.id||e,className:i("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",G?"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")},n),t.createElement("div",{className:i("absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden","bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",E?"border max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:E?"9.5rem":"0",overflowY:N.length>3?"auto":"hidden",position:"fixed",top:E?`${T.top}px`:"auto",left:E?`${T.left}px`:"auto",width:E?`${T.width}px`:"auto",zIndex:9999,boxShadow:E?"var(--select-dropdown-shadow)":"none"}},F?t.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},k):N.length===0?t.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},v):N.map(w=>t.createElement("div",{key:w.value,className:i("px-3 py-2 cursor-pointer text-sm transition-colors duration-150","hover:bg-[var(--select-dropdown-hover)]",P===w.value&&"bg-[var(--select-dropdown-selected)]"),onMouseDown:()=>f(w.value)},w.label))),I&&t.createElement("span",{className:"text-red-500 text-xs mt-1 block"},I))});Re.displayName="AsyncSelect";const Te=t.forwardRef(({name:e,label:n,options:r,className:o,containerClassName:l,isClearable:h,searchable:d=!1,filterPlaceholder:k="Digite para filtrar...",caseSensitive:v=!1,filterFunction:g,onFocus:u,onBlur:x,...s},S)=>{var le,ae,oe;const[M,L]=t.useState(!1),[y,E]=t.useState(!1),[C,N]=t.useState(""),[m,F]=t.useState({top:0,left:0,width:0}),R=t.useRef(null),B=t.useRef(null),b=Z.useFormContext(),H=b==null?void 0:b.control,U=H&&e?Z.useWatch({control:H,name:e}):void 0,T=s.value??U??[],J=(oe=(ae=(le=b==null?void 0:b.formState)==null?void 0:le.errors)==null?void 0:ae[e])==null?void 0:oe.message,Y=g||((f,_)=>{const c=v?f.label:f.label.toLowerCase(),$=v?_:_.toLowerCase();return c.includes($)}),O=C.trim()?r.filter(f=>Y(f,C.trim())):r,W=M||T&&T.length>0||d&&!!C,X=t.useCallback(()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=768,[]),P=t.useCallback(()=>{if(R.current&&y){const f=R.current.getBoundingClientRect(),_=X(),c=window.innerHeight,$=window.innerWidth,K=152;let re=f.bottom+4,Q=f.left;if(_){const w=c-f.bottom,V=f.top;w<K&&V>K&&(re=f.top-K-4);const ne=16,p=$-f.width-ne;Q=Math.min(Math.max(Q,ne),p)}else c-f.bottom<K&&(re=f.top-K-4);F({top:re,left:Q,width:f.width})}},[y,X]);t.useEffect(()=>{if(P(),y){const f=()=>P(),_=()=>P();return window.addEventListener("resize",f),window.addEventListener("scroll",_,!0),()=>{window.removeEventListener("resize",f),window.removeEventListener("scroll",_,!0)}}},[y,P]),t.useEffect(()=>{const f=_=>{R.current&&!R.current.contains(_.target)&&(E(!1),L(!1))};return document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[]);const I=()=>{E(f=>!f),L(!0)},G=f=>{L(!0),u&&u(f)},z=f=>{x&&x(f)},q=f=>{var c;let _;T.includes(f)?_=T.filter($=>$!==f):_=[...T,f],b&&e&&b.setValue(e,_),s.onChange&&((c=s.onChange)==null||c.call(s,{target:{value:_}})),L(!0)},D=f=>{var _;f.stopPropagation(),b&&e&&b.setValue(e,[]),s.onChange&&((_=s.onChange)==null||_.call(s,{target:{value:[]}})),E(!1),L(!1)},j=f=>{N(f.target.value)};return t.createElement("div",{className:i("relative",l),ref:R},t.createElement("div",{id:s.id||e,tabIndex:0,role:"button","aria-haspopup":"listbox","aria-expanded":y,className:i("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",o),onClick:d?void 0:I,onFocus:d?void 0:G,onBlur:d?void 0:z,ref:S},t.createElement("div",{className:"flex flex-nowrap gap-1 items-center min-h-[1.5rem] w-full overflow-x-auto",style:{scrollbarWidth:"none"}},T&&T.length>0?r.filter(f=>T.includes(f.value)).map(f=>t.createElement("span",{key:f.value,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",style:{maxWidth:"140px"}},t.createElement("span",{className:"truncate",title:f.label},f.label),t.createElement("button",{type:"button",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","aria-label":`Remover ${f.label}`,tabIndex:-1,onClick:_=>{_.stopPropagation();const c=T.filter($=>$!==f.value);b&&e&&b.setValue(e,c),s.onChange&&s.onChange({target:{value:c}})}},t.createElement("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M3 3L9 9M9 3L3 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}))))):!n&&!d&&t.createElement("span",{className:"text-gray-400 text-sm"},"Selecione..."),d&&t.createElement("input",{ref:B,type:"text",value:C,onChange:j,onFocus:f=>{L(!0),E(!0),u&&u(f)},onBlur:f=>{x&&x(f)},placeholder:n?T&&T.length>0?"":k:k||"Selecione...",className:"flex-1 bg-transparent border-none outline-none text-sm min-w-[100px]"})),h&&T&&T.length>0&&t.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",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",onClick:D},"✕")),n&&t.createElement("label",{htmlFor:s.id||e,className:i("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",W?"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")},n),t.createElement("div",{className:i("absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden","bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",y?"border max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:y?"9.5rem":"0",overflowY:r.length>3?"auto":"hidden",position:"fixed",top:y?`${m.top}px`:"auto",left:y?`${m.left}px`:"auto",width:y?`${m.width}px`:"auto",zIndex:9999,boxShadow:y?"var(--select-dropdown-shadow)":"none"}},O.length===0?t.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},"Nenhuma opção encontrada"):O.map(f=>t.createElement("div",{key:f.value,className:i("px-3 py-2 cursor-pointer text-sm flex items-center gap-2 transition-colors duration-150","hover:bg-[var(--select-dropdown-hover)]",T.includes(f.value)&&"bg-[var(--select-dropdown-selected)] font-semibold"),onMouseDown:()=>q(f.value)},t.createElement("input",{type:"checkbox",checked:T.includes(f.value),readOnly:!0,className:"accent-blue-500"}),f.label))),J&&t.createElement("span",{className:"text-red-500 text-xs mt-1 block"},J))});Te.displayName="MultiSelect";const Be=t.forwardRef(({name:e,label:n,loadOptions:r,className:o,containerClassName:l,isClearable:h,defaultOptions:d=!1,loadingMessage:k="Carregando...",noOptionsMessage:v="Nenhuma opção encontrada",searchable:g=!1,debounceMs:u=300,maxSelectedDisplay:x=3,onFocus:s,onBlur:S,...M},L)=>{var w,V,ne;const[y,E]=t.useState(!1),[C,N]=t.useState(!1),[m,F]=t.useState([]),[R,B]=t.useState(!1),[b,H]=t.useState(""),[U,T]=t.useState(""),[J,ee]=t.useState({top:0,left:0,width:0}),Y=t.useRef(null),O=t.useRef(null),W=Z.useFormContext(),X=W==null?void 0:W.control,P=X&&e?Z.useWatch({control:X,name:e}):void 0,I=M.value??P??[],G=(ne=(V=(w=W==null?void 0:W.formState)==null?void 0:w.errors)==null?void 0:V[e])==null?void 0:ne.message,z=y||I&&I.length>0,q=t.useCallback(()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=768,[]),D=t.useCallback(()=>{if(Y.current&&C){const p=Y.current.getBoundingClientRect(),A=q(),te=window.innerHeight,ie=window.innerWidth,se=152;let de=p.bottom+4,ce=p.left;if(A){const ue=te-p.bottom,He=p.top;ue<se&&He>se&&(de=p.top-se-4);const Ce=16,Ve=ie-p.width-Ce;ce=Math.min(Math.max(ce,Ce),Ve)}else te-p.bottom<se&&(de=p.top-se-4);ee({top:de,left:ce,width:p.width})}},[C,q]);t.useEffect(()=>{if(D(),C){const p=()=>D(),A=()=>D();return window.addEventListener("resize",p),window.addEventListener("scroll",A,!0),()=>{window.removeEventListener("resize",p),window.removeEventListener("scroll",A,!0)}}},[C,D]),t.useEffect(()=>{const p=setTimeout(()=>{T(b)},u);return()=>clearTimeout(p)},[b,u]),t.useEffect(()=>{(C||d&&m.length===0)&&j(g?U:void 0)},[U,C]),t.useEffect(()=>{d===!0?j():Array.isArray(d)&&F(d)},[]);const j=async p=>{try{B(!0);const A=await r(p);F(A)}catch(A){console.error("Error loading options:",A),F([])}finally{B(!1)}};t.useEffect(()=>{const p=A=>{Y.current&&!Y.current.contains(A.target)&&(N(!1),E(!1),H(""))};return document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}},[]);const le=()=>{C||(N(!0),E(!0),g&&O.current&&setTimeout(()=>{var p;return(p=O.current)==null?void 0:p.focus()},0))},ae=p=>{E(!0),s&&s(p)},oe=p=>{S&&S(p)},f=p=>{H(p.target.value)},_=p=>{let A;I.includes(p)?A=I.filter(te=>te!==p):A=[...I,p],W&&e&&W.setValue(e,A),M.onChange&&M.onChange({target:{value:A}}),E(!0)},c=(p,A)=>{A.stopPropagation();const te=I.filter(ie=>ie!==p);W&&e&&W.setValue(e,te),M.onChange&&M.onChange({target:{value:te}})},$=p=>{p.stopPropagation(),W&&e&&W.setValue(e,[]),M.onChange&&M.onChange({target:{value:[]}}),N(!1),E(!1),H("")},K=m.filter(p=>I.includes(p.value)),re=K.slice(0,x),Q=K.length-x;return t.createElement("div",{className:i("relative",l),ref:Y},t.createElement("div",{id:M.id||e,tabIndex:g?-1:0,role:"button","aria-haspopup":"listbox","aria-expanded":C,className:i("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",o),onClick:le,onFocus:g?void 0:ae,onBlur:g?void 0:oe,ref:L},t.createElement("div",{className:"flex flex-wrap gap-1 items-center min-h-[1.5rem] w-full"},re.map(p=>t.createElement("span",{key:p.value,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",style:{maxWidth:"140px"}},t.createElement("span",{className:"truncate",title:p.label},p.label),t.createElement("button",{type:"button",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","aria-label":`Remover ${p.label}`,tabIndex:-1,onClick:A=>c(p.value,A)},t.createElement("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M3 3L9 9M9 3L3 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}))))),Q>0&&t.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"),g?t.createElement("input",{ref:O,type:"text",value:b,onChange:f,onFocus:ae,onBlur:oe,placeholder:I.length===0&&!n?"Selecione...":"",className:"flex-1 min-w-[120px] bg-transparent border-none outline-none text-sm"}):I.length===0&&!n&&t.createElement("span",{className:"text-gray-400 text-sm"},"Selecione...")),R&&t.createElement("div",{className:"absolute right-8 top-1/2 -translate-y-1/2"},t.createElement("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]"})),h&&I&&I.length>0&&!R&&t.createElement("button",{type:"button",tabIndex:-1,"aria-label":"Limpar seleção",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",onClick:$},"✕")),n&&t.createElement("label",{htmlFor:M.id||e,className:i("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",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")},n),t.createElement("div",{className:i("absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden","bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",C?"border max-h-36 opacity-100 scale-100":"max-h-0 opacity-0 scale-95 pointer-events-none"),style:{maxHeight:C?"9.5rem":"0",overflowY:m.length>3?"auto":"hidden",position:"fixed",top:C?`${J.top}px`:"auto",left:C?`${J.left}px`:"auto",width:C?`${J.width}px`:"auto",zIndex:9999,boxShadow:C?"var(--select-dropdown-shadow)":"none"}},R?t.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},k):m.length===0?t.createElement("div",{className:"px-3 py-2 text-sm text-gray-500 text-center"},v):m.map(p=>t.createElement("div",{key:p.value,className:i("px-3 py-2 cursor-pointer text-sm flex items-center gap-2 transition-colors duration-150","hover:bg-[var(--select-dropdown-hover)]",I.includes(p.value)&&"bg-[var(--select-dropdown-selected)] font-semibold"),onMouseDown:()=>_(p.value)},t.createElement("input",{type:"checkbox",checked:I.includes(p.value),readOnly:!0,className:"accent-blue-500"}),p.label))),G&&t.createElement("span",{className:"text-red-500 text-xs mt-1 block"},G))});Be.displayName="MultiAsyncSelect";const Ye={sm:"h-10 text-sm px-3",md:"h-12 text-base px-4",lg:"h-16 text-lg px-6"},Ie=t.forwardRef(({name:e,label:n,options:r,className:o,containerClassName:l,optionClassName:h,direction:d="row",size:k="md",onFocus:v,onBlur:g,...u},x)=>{var C,N,m;const s=Z.useFormContext(),S=s==null?void 0:s.control,M=S&&e?Z.useWatch({control:S,name:e}):void 0,L=u.value??M??"",y=(m=(N=(C=s==null?void 0:s.formState)==null?void 0:C.errors)==null?void 0:N[e])==null?void 0:m.message,E=F=>{s&&e&&s.setValue(e,F),u.onChange&&u.onChange({target:{value:F}})};return t.createElement("div",{className:i("relative",l),ref:x},n&&t.createElement("label",{htmlFor:e,className:i("absolute left-3 z-10 origin-[0] cursor-text select-none text-sm transition-all duration-200","top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white")},n),t.createElement("div",{className:i("flex gap-2 w-full pt-6",d==="row"?"flex-row":"flex-col",o),"aria-label":n,tabIndex:-1,onFocus:v,onBlur:g},r.map(F=>t.createElement("button",{key:F.value,type:"button",className:i("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)]",Ye[k],L===F.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",h),"aria-pressed":L===F.value,"data-selected":L===F.value,tabIndex:0,onClick:()=>E(F.value),onKeyDown:R=>{(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),E(F.value))}},F.icon&&t.createElement("span",{className:"mr-2 text-lg flex items-center"},F.icon),t.createElement("span",{className:"truncate font-medium"},F.label)))),y&&t.createElement("span",{className:"text-red-500 text-xs mt-1 block"},y))});Ie.displayName="RadioGroup";const pe=a.forwardRef(({children:e,className:n,as:r="div",...o},l)=>a.createElement(r,{ref:l,className:i("px-2 py-1 sm:px-4 sm:py-2 lg:px-6 lg:py-4 border-b","bg-[var(--card-header-bg,rgba(249,250,251,0.5))]","border-[var(--card-header-border,#e5e7eb)]","text-[var(--card-text,#111827)]",n),...o},e));pe.displayName="CardHeader";const be=a.forwardRef(({children:e,className:n,as:r="div",...o},l)=>a.createElement(r,{ref:l,className:i("px-2 py-1 sm:px-4 sm:py-2 lg:px-6 lg:py-4","flex-1","bg-[var(--card-bg,#ffffff)]","text-[var(--card-text,#111827)]",n),...o},e));be.displayName="CardBody";const ge=a.forwardRef(({children:e,className:n,as:r="div",...o},l)=>a.createElement(r,{ref:l,className:i("px-6 py-4 border-t","bg-[var(--card-footer-bg,rgba(249,250,251,0.5))]","border-[var(--card-footer-border,#e5e7eb)]","text-[var(--card-text,#111827)]",n),...o},e));ge.displayName="CardFooter";const Ge=a.forwardRef(({children:e,className:n,variant:r="default",size:o="md",padding:l="none",rounded:h="lg",constrainWidth:d=!1,allowOverflow:k=!1,...v},g)=>{const u={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))]",outlined:"bg-[var(--card-bg,#ffffff)] border-2 border-[var(--primary,#2563eb)]",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))]",flat:"bg-[var(--card-bg,#ffffff)] border-0"},x={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"},s={none:"",sm:"p-3",md:"p-4",lg:"p-6"},S={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"};return a.createElement("div",{ref:g,className:i("flex flex-col",!k&&"overflow-hidden",u[r],d&&x[o],s[l],S[h],n),...v},e)}),Ke=Object.assign(Ge,{Header:pe,Body:be,Footer:ge}),Pe=a.forwardRef(({children:e,className:n,variant:r="default",size:o="md",responsive:l=!1,stickyHeader:h=!1,...d},k)=>{const v=i("w-full border-collapse bg-[var(--table-bg)] text-[var(--table-text)]",{"border border-[var(--table-border)]":r==="bordered"},{"text-sm":o==="sm","text-base":o==="md","text-lg":o==="lg"},n),g=i({"overflow-x-auto":l,"max-h-96 overflow-y-auto":h}),u=a.createElement("table",{ref:k,className:v,...d},e);return l||h?a.createElement("div",{className:g},u):u}),he=a.forwardRef(({children:e,className:n,as:r="thead",...o},l)=>a.createElement(r,{ref:l,className:i("border-b border-[var(--table-border)] bg-[var(--table-header-bg)]",{"sticky top-0 z-10":r==="thead"},n),...o},e)),ve=a.forwardRef(({children:e,className:n,as:r="tbody",...o},l)=>a.createElement(r,{ref:l,className:i("[&_tr:nth-child(odd)]:bg-[var(--table-row-odd)]","[&_tr:nth-child(even)]:bg-[var(--table-row-even)]",n),...o},e)),xe=a.forwardRef(({children:e,className:n,as:r="tfoot",...o},l)=>a.createElement(r,{ref:l,className:i("border-t border-[var(--table-border)] bg-[var(--table-header-bg)] font-medium",n),...o},e)),we=a.forwardRef(({children:e,className:n,variant:r="default",...o},l)=>a.createElement("tr",{ref:l,className:i("border-b border-[var(--table-border)] transition-colors",{"hover:bg-[var(--table-row-hover)]":r==="hover","bg-[var(--table-row-selected)]":r==="selected"},n),...o},e)),ye=a.forwardRef(({children:e,className:n,as:r="td",align:o="left",scope:l,colSpan:h,rowSpan:d,...k},v)=>a.createElement(r,{ref:v,scope:r==="th"?l:void 0,colSpan:h,rowSpan:d,className:i("px-4 py-3 text-left",{"font-semibold":r==="th","text-sm":r==="td","text-center":o==="center","text-right":o==="right"},n),...k},e));Pe.displayName="Table";he.displayName="TableHeader";ve.displayName="TableBody";xe.displayName="TableFooter";we.displayName="TableRow";ye.displayName="TableCell";const Je=Object.assign(Pe,{Header:he,Body:ve,Footer:xe,Row:we,Cell:ye}),Qe=({content:e,children:n,position:r="top",className:o="",disabled:l=!1})=>{const[h,d]=a.useState(!1),[k,v]=a.useState(r),[g,u]=a.useState({}),x=a.useRef(null),s=a.useRef(null);a.useEffect(()=>{if(!h||!s.current)return;const m=s.current.getBoundingClientRect();let F=r,R=0,B=0;switch(r){case"top":R=m.top-8,B=m.left+m.width/2;break;case"bottom":R=m.bottom+8,B=m.left+m.width/2;break;case"left":R=m.top+m.height/2,B=m.left-8;break;case"right":R=m.top+m.height/2,B=m.right+8;break}if(x.current){const b=x.current.getBoundingClientRect(),H=window.innerWidth,U=window.innerHeight;r==="top"&&m.top<b.height+16?(F="bottom",R=m.bottom+8):r==="bottom"&&m.bottom+b.height+16>U?(F="top",R=m.top-8):r==="left"&&m.left<b.width+16?(F="right",B=m.right+8):r==="right"&&m.right+b.width+16>H&&(F="left",B=m.left-8)}v(F),u({position:"fixed",top:`${R}px`,left:`${B}px`,zIndex:9999})},[h,r]);const S=()=>{l||d(!0)},M=()=>{d(!1)},L=()=>{l||d(!0)},y=()=>{d(!1)},E=()=>{const N="pointer-events-none";switch(k){case"top":return`${N} transform -translate-x-1/2 -translate-y-full`;case"bottom":return`${N} transform -translate-x-1/2`;case"left":return`${N} transform -translate-x-full -translate-y-1/2`;case"right":return`${N} transform -translate-y-1/2`;default:return`${N} transform -translate-x-1/2 -translate-y-full`}},C=()=>{const N="absolute w-2 h-2 bg-[var(--tooltip-bg,#374151)] transform rotate-45";switch(k){case"top":return`${N} top-full left-1/2 -translate-x-1/2 -translate-y-1/2`;case"bottom":return`${N} bottom-full left-1/2 -translate-x-1/2 translate-y-1/2`;case"left":return`${N} left-full top-1/2 -translate-y-1/2 -translate-x-1/2`;case"right":return`${N} right-full top-1/2 -translate-y-1/2 translate-x-1/2`;default:return`${N} top-full left-1/2 -translate-x-1/2 -translate-y-1/2`}};return l||!e?a.createElement(a.Fragment,null,n):a.createElement(a.Fragment,null,a.createElement("div",{className:"relative inline-block",ref:s,onMouseEnter:S,onMouseLeave:M,onFocus:L,onBlur:y},n),h&&typeof document<"u"&&me.createPortal(a.createElement("div",{ref:x,style:g,className:i(E(),"px-2 py-1 text-sm rounded whitespace-nowrap","bg-[var(--tooltip-bg,#374151)] text-[var(--tooltip-text,#fff)]","shadow-[var(--tooltip-shadow,0_10px_15px_-3px_rgb(0_0_0_/_0.1),_0_4px_6px_-4px_rgb(0_0_0_/_0.1))]","transition-opacity duration-200 ease-in-out",o),role:"tooltip","aria-hidden":!h},e,a.createElement("div",{className:C()})),document.body))},Ae=({open:e,onClose:n,side:r="right",size:o="md",closeOnOverlayClick:l=!0,children:h,className:d="",...k})=>{const v=typeof document<"u"?document.body:null,g=o==="sm"?"w-64":o==="md"?"w-96":o==="lg"?"w-[36rem]":void 0,u=typeof o=="string"&&!["sm","md","lg"].includes(o)?{width:o}:void 0,x=a.createElement("div",{"aria-hidden":!e,className:i("fixed inset-0 z-50 flex",e?"pointer-events-auto":"pointer-events-none")},a.createElement("div",{className:i("absolute inset-0 bg-black/40 transition-opacity duration-200",e?"opacity-100":"opacity-0"),onMouseDown:s=>{l&&s.target===s.currentTarget&&n()}}),a.createElement("div",{className:i("relative h-full",r==="right"?"ml-auto":"mr-auto","flex-shrink-0"),style:u},a.createElement("aside",{role:"dialog","aria-modal":!0,className:i("h-full bg-white shadow-xl border-l border-gray-100 overflow-auto transition-transform duration-300",r==="right"?e?"translate-x-0":"translate-x-full":e?"translate-x-0":"-translate-x-full",g,d),style:u,...k},h)));return v?me.createPortal(x,v):null};Ae.displayName="AsideSheet";const Xe=({avatar:e=!1,value:n,onUpload:r,onRemove:o,accept:l="image/*",maxSize:h,placeholder:d="Selecionar imagem",loading:k=!1,size:v="md",label:g,error:u,disabled:x,className:s,...S})=>{const[M,L]=a.useState(null),[y,E]=a.useState(""),[C,N]=a.useState(!1),m=a.useRef(null),F=!!n,R=!!M,B=F||R,b=k||C,H={sm:e?"w-16 h-16":"w-24 h-16",md:e?"w-24 h-24":"w-32 h-24",lg:e?"w-32 h-32":"w-40 h-32"},T=d||(e?"Adicionar foto":"Selecionar imagem"),J=P=>{var z;const I=(z=P.target.files)==null?void 0:z[0];if(!I)return;if(h&&I.size>h){alert(`Arquivo muito grande. Tamanho máximo: ${(h/1024/1024).toFixed(1)}MB`);return}const G=new FileReader;G.onload=q=>{var D;E((D=q.target)==null?void 0:D.result),L(I)},G.readAsDataURL(I)},ee=async()=>{if(!(!M||!r))try{N(!0);const P=await r(M);L(null),E(""),m.current&&(m.current.value="")}catch(P){console.error("Erro ao fazer upload:",P),alert("Erro ao fazer upload da imagem")}finally{N(!1)}},Y=()=>{L(null),E(""),m.current&&(m.current.value="")},O=async()=>{try{o&&await o(n),L(null),E(""),m.current&&(m.current.value="")}catch(P){console.error("Erro ao remover imagem:",P),alert("Erro ao remover imagem")}},W=()=>{var P;x||b||(P=m.current)==null||P.click()},X=y||n;return a.createElement("div",{className:i("flex flex-col space-y-2",s)},g&&a.createElement("label",{className:"text-sm font-medium text-gray-700"},g),a.createElement("div",{className:"relative flex flex-col items-center"},a.createElement("input",{ref:m,type:"file",accept:l,onChange:J,disabled:x||b,className:"hidden",...S}),a.createElement("div",{onClick:W,className:i("relative border-2 border-dashed border-gray-300 transition-colors cursor-pointer","hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",e?"rounded-full":"rounded-lg",H[v],x&&"opacity-50 cursor-not-allowed",b&&"cursor-wait",u&&"border-red-300",!B&&"bg-gray-50 hover:bg-gray-100",B&&"border-solid border-gray-200")},B?a.createElement("img",{src:X,alt:"Preview",className:i("w-full h-full object-cover",e?"rounded-full":"rounded-lg")}):a.createElement("div",{className:"flex flex-col items-center justify-center h-full text-gray-500 text-sm"},e?a.createElement(a.Fragment,null,a.createElement("svg",{className:"w-8 h-8 mb-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})),a.createElement("span",{className:"text-center px-2 text-xs"},T)):a.createElement(a.Fragment,null,a.createElement("svg",{className:"w-6 h-6 mb-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})),a.createElement("span",{className:"text-center px-2"},T))),b&&a.createElement("div",{className:i("absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center",e?"rounded-full":"rounded-lg")},a.createElement("div",{className:"w-6 h-6 border-2 border-white border-t-transparent rounded-full animate-spin"}))),B&&!b&&a.createElement("div",{className:"flex justify-center space-x-2 mt-3"},R?a.createElement(a.Fragment,null,a.createElement("button",{onClick:ee,disabled:!r,className:"px-3 py-1 bg-blue-600 text-white text-sm rounded hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed"},"Confirmar"),a.createElement("button",{onClick:Y,className:"px-3 py-1 bg-gray-600 text-white text-sm rounded hover:bg-gray-700"},"Cancelar")):a.createElement("button",{onClick:O,disabled:!o,className:"px-3 py-1 bg-red-600 text-white text-sm rounded hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed"},"Remover"))),u&&a.createElement("p",{className:"text-sm text-red-600"},u),h&&!B&&a.createElement("p",{className:"text-xs text-gray-500"},"Tamanho máximo: ",(h/1024/1024).toFixed(1),"MB"),e&&!B&&a.createElement("p",{className:"text-xs text-gray-500 text-center"},"Use uma foto com seu rosto centralizado e bem visível"))},_e=a.createContext(null),Ze=()=>{const e=a.useContext(_e);if(!e)throw new Error("AccordionItem must be used within an Accordion");return e};let We=0;const Ee=({title:e,children:n,defaultOpen:r=!1,disabled:o=!1,className:l,headerClassName:h,contentClassName:d,icon:k})=>{const{openItems:v,toggleItem:g,variant:u}=Ze(),[x]=a.useState(()=>We++),s=v.has(x),S=a.useRef(null),[M,L]=a.useState(r?void 0:0);a.useEffect(()=>{if(s){const N=S.current;N&&L(N.scrollHeight)}else L(0)},[s]);const y=()=>{o||g(x)},C={default:{item:"border-b border-[var(--accordion-border,#e5e7eb)] last:border-b-0",header:"",content:""},bordered:{item:"border border-[var(--accordion-border,#e5e7eb)] rounded-md mb-2",header:"border-b border-[var(--accordion-border,#e5e7eb)]",content:""},separated:{item:"border border-[var(--accordion-border,#e5e7eb)] rounded-md mb-3 shadow-sm",header:"",content:""}}[u];return a.createElement("div",{className:i(C.item,l)},a.createElement("button",{type:"button",onClick:y,disabled:o,"aria-expanded":s,className:i("w-full flex items-center justify-between px-4 py-3 text-left transition-colors","bg-[var(--accordion-header-bg,transparent)]","hover:bg-[var(--accordion-header-hover,rgba(0,0,0,0.05))]","text-[var(--accordion-text,#111827)]","font-medium",o&&"opacity-50 cursor-not-allowed",s&&u!=="default"&&C.header,h)},a.createElement("span",{className:"flex items-center gap-2"},k&&a.createElement("span",{className:"flex-shrink-0"},k),e),a.createElement("svg",{className:i("w-5 h-5 transition-transform duration-200 flex-shrink-0","text-[var(--accordion-icon,#6b7280)]",s&&"rotate-180"),fill:"none",strokeWidth:"2",stroke:"currentColor",viewBox:"0 0 24 24"},a.createElement("path",{d:"M19 9l-7 7-7-7"}))),a.createElement("div",{style:{height:M,overflow:"hidden",transition:"height 0.3s ease-in-out"}},a.createElement("div",{ref:S,className:i("px-4 py-3","text-[var(--accordion-content-text,#374151)]","bg-[var(--accordion-content-bg,transparent)]",d)},n)))};Ee.displayName="AccordionItem";const ze=({children:e,type:n="single",className:r,variant:o="default",collapsible:l=!0})=>{const[h,d]=a.useState(new Set);a.useEffect(()=>{We=0;const v=a.Children.toArray(e),g=new Set;if(v.forEach((u,x)=>{a.isValidElement(u)&&u.props.defaultOpen&&g.add(x)}),n==="single"&&g.size>1){const u=Array.from(g)[0];d(new Set([u]))}else d(g)},[e,n]);const k=v=>{d(g=>{const u=new Set(g);return n==="single"?u.has(v)?l&&u.clear():(u.clear(),u.add(v)):u.has(v)?u.delete(v):u.add(v),u})};return a.createElement(_e.Provider,{value:{type:n,openItems:h,toggleItem:k,collapsible:l,variant:o}},a.createElement("div",{className:i("w-full",r)},e))};ze.Item=Ee;const fe=({open:e,onClose:n,size:r="md",closeOnOverlayClick:o=!0,closeOnEscape:l=!0,showCloseButton:h=!0,children:d,className:k="",...v})=>{const g=typeof document<"u"?document.body:null;a.useEffect(()=>{if(!e||!l)return;const s=S=>{S.key==="Escape"&&n()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e,l,n]),a.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]);const u={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-full mx-4"};if(!g||!e)return null;const x=a.createElement("div",{className:i("fixed inset-0 z-50 flex items-center justify-center p-4",e?"pointer-events-auto":"pointer-events-none")},a.createElement("div",{className:i("absolute inset-0 bg-black/50 transition-opacity duration-200",e?"opacity-100":"opacity-0"),onClick:s=>{o&&s.target===s.currentTarget&&n()}}),a.createElement("div",{role:"dialog","aria-modal":!0,className:i("relative bg-white rounded-lg shadow-xl w-full transition-all duration-200",u[r],e?"scale-100 opacity-100":"scale-95 opacity-0",k),...v},h&&a.createElement("button",{onClick:n,className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600 transition-colors","aria-label":"Fechar modal"},a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}))),a.createElement("div",{className:"p-6"},d)));return me.createPortal(x,g)};fe.Header=function({children:n,className:r="",...o}){return a.createElement("div",{className:i("mb-4 pr-8",r),...o},n)};fe.Body=function({children:n,className:r="",...o}){return a.createElement("div",{className:i("mb-4",r),...o},n)};fe.Footer=function({children:n,className:r="",...o}){return a.createElement("div",{className:i("flex justify-end gap-2 mt-6 pt-4 border-t border-gray-200",r),...o},n)};const $e=a.createContext(null),et=({children:e,position:n="top-right",maxToasts:r=5})=>{const[o,l]=a.useState([]),h=a.useCallback(v=>{const g=`toast-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,u={...v,id:g};if(l(x=>[...x,u].slice(-r)),v.duration!==0){const x=v.duration||5e3;setTimeout(()=>{var s;d(g),(s=v.onClose)==null||s.call(v)},x)}return g},[r]),d=a.useCallback(v=>{l(g=>g.filter(u=>u.id!==v))},[]),k=a.useCallback(()=>{l([])},[]);return a.createElement($e.Provider,{value:{toasts:o,addToast:h,removeToast:d,clearAll:k}},e,a.createElement(rt,{toasts:o,position:n,onClose:d}))},Oe=()=>{const e=a.useContext($e);if(!e)throw new Error("useToaster must be used within ToasterProvider");return e},tt=()=>{const{addToast:e}=Oe();return{toast:(n,r)=>e({message:n,...r}),success:(n,r)=>e({message:n,variant:"success",duration:r}),error:(n,r)=>e({message:n,variant:"error",duration:r}),warning:(n,r)=>e({message:n,variant:"warning",duration:r}),info:(n,r)=>e({message:n,variant:"info",duration:r})}},rt=({toasts:e,position:n,onClose:r})=>{const o=typeof document<"u"?document.body:null;if(!o||e.length===0)return null;const l={"top-left":"top-4 left-4 items-start","top-center":"top-4 left-1/2 -translate-x-1/2 items-center","top-right":"top-4 right-4 items-end","bottom-left":"bottom-4 left-4 items-start","bottom-center":"bottom-4 left-1/2 -translate-x-1/2 items-center","bottom-right":"bottom-4 right-4 items-end"},h=a.createElement("div",{className:i("fixed z-[100] flex flex-col gap-2 pointer-events-none",l[n]),style:{maxWidth:"calc(100vw - 2rem)"}},e.map(d=>a.createElement(at,{key:d.id,toast:d,onClose:r})));return me.createPortal(h,o)},at=({toast:e,onClose:n})=>{const[r,o]=a.useState(!1),l=()=>{o(!0),setTimeout(()=>{var v;n(e.id),(v=e.onClose)==null||v.call(e)},200)},h={success:"bg-green-50 text-green-800 border-green-200",error:"bg-red-50 text-red-800 border-red-200",warning:"bg-yellow-50 text-yellow-800 border-yellow-200",info:"bg-blue-50 text-blue-800 border-blue-200",default:"bg-white text-gray-800 border-gray-200"},d={success:a.createElement("svg",{className:"w-5 h-5 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})),error:a.createElement("svg",{className:"w-5 h-5 text-red-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})),warning:a.createElement("svg",{className:"w-5 h-5 text-yellow-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})),info:a.createElement("svg",{className:"w-5 h-5 text-blue-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})),default:a.createElement("svg",{className:"w-5 h-5 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))},k=e.variant||"default";return a.createElement("div",{role:"alert",className:i("pointer-events-auto flex items-start gap-3 px-4 py-3 rounded-lg border shadow-lg min-w-[300px] max-w-[500px]","transition-all duration-200 ease-in-out",r?"opacity-0 scale-95 translate-x-4":"opacity-100 scale-100 translate-x-0",h[k])},a.createElement("div",{className:"flex-shrink-0 mt-0.5"},d[k]),a.createElement("p",{className:"flex-1 text-sm font-medium leading-relaxed"},e.message),a.createElement("button",{onClick:l,className:"flex-shrink-0 text-current opacity-60 hover:opacity-100 transition-opacity","aria-label":"Fechar notificação"},a.createElement("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}))))};exports.Accordion=ze;exports.AccordionItem=Ee;exports.AsideSheet=Ae;exports.AsyncSelect=Re;exports.Button=Ue;exports.Card=Ke;exports.CardBody=be;exports.CardFooter=ge;exports.CardHeader=pe;exports.ImageInput=Xe;exports.Input=Me;exports.Modal=fe;exports.MultiAsyncSelect=Be;exports.MultiSelect=Te;exports.RadioGroup=Ie;exports.Select=Le;exports.Table=Je;exports.TableBody=ve;exports.TableCell=ye;exports.TableFooter=xe;exports.TableHeader=he;exports.TableRow=we;exports.Textarea=Fe;exports.ToasterProvider=et;exports.Tooltip=Qe;exports.useToast=tt;exports.useToaster=Oe;