@mvr-ui/components 1.0.100 → 1.0.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/page.js +1 -1
- package/dist/page.mjs +1 -1
- package/package.json +1 -1
package/dist/page.js
CHANGED
|
@@ -29,7 +29,7 @@ Pode me ajudar?
|
|
|
29
29
|
`,n=`https://wa.me/${e}?text=${encodeURIComponent(r)}`;window.open(n,"_blank");};var We=vr.createContext(void 0),lr=({children:e,licenseKey:t})=>{let[r,n]=vr.useState(!1),[o,a]=vr.useState(null),[i,s]=vr.useState(!0),l=f=>{if(a(null),!f)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let c="chave-secreta-123";if(f!==c)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");n(!0);};return vr.useEffect(()=>{if(t){s(!0);try{l(t);}catch(f){a(f instanceof Error?f.message:"Erro desconhecido na valida\xE7\xE3o da licen\xE7a");}finally{s(!1);}}else a("\u{1F512} Licen\xE7a n\xE3o informada"),s(!1);},[t]),i?null:jsxRuntime.jsx(We.Provider,{value:{isLicenseValid:r,validateLicense:l,licenseError:o},children:r?e:jsxRuntime.jsx(Ue,{badge:"Licen\xE7a necess\xE1ria",title:"Erro de Licen\xE7a",message:o||"Licen\xE7a inv\xE1lida",description:"Sua aplica\xE7\xE3o precisa de uma licen\xE7a v\xE1lida para continuar.",actions:[{label:"Tentar novamente",onClick:()=>window.location.reload()},{label:"Falar no WhatsApp",variant:"secondary",onClick:()=>Ke("5544998204407",o)},{label:"Enviar e-mail",variant:"secondary",onClick:()=>qe("marcos.vinicius.engsof@gmail.com",o)}]})})},Xe=()=>{let e=vr.useContext(We);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var Je=({message:e="Component locked - Please validate your license"})=>jsxRuntime.jsxs("div",{className:"flex items-start p-4 bg-red-50 border border-red-500 text-red-700 rounded-md gap-2",children:[jsxRuntime.jsx("span",{children:" \u274C Component locked - Please validate your license"}),jsxRuntime.jsx("span",{children:e})]});var g=({children:e})=>{let{isLicenseValid:t}=Xe();return t?jsxRuntime.jsx(jsxRuntime.Fragment,{children:e}):jsxRuntime.jsx(Je,{})};var Ye=({items:e,type:t="single",defaultValue:r,value:n,onValueChange:o,className:a=""})=>{let i=c=>c===void 0?[]:Array.isArray(c)?c:[c],[s,l]=vr.useState(i(n??r));vr.useEffect(()=>{n!==void 0&&l(i(n));},[n]);let f=vr.useCallback(c=>{l(h=>{let p;return t==="single"?p=h.includes(c)?[]:[c]:p=h.includes(c)?h.filter(d=>d!==c):[...h,c],o?.(t==="single"?p[0]??"":p),p});},[t,o]);return jsxRuntime.jsx("div",{className:`space-y-2 ${a}`,children:e.map(c=>jsxRuntime.jsx(fr,{...c,isOpen:s.includes(c.id),onToggle:()=>f(c.id)},c.id))})},fr=({title:e,content:t,disabled:r=!1,isOpen:n,onToggle:o})=>jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"border border-border rounded-md overflow-hidden",children:[jsxRuntime.jsx("button",{onClick:o,disabled:r,className:`w-full px-4 py-3 text-left font-medium transition-colors
|
|
30
30
|
${r?"opacity-50 cursor-not-allowed":"hover:bg-accent hover:text-accent-foreground"}
|
|
31
31
|
${n?"bg-accent text-accent-foreground":"bg-background text-foreground"}
|
|
32
|
-
`,children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{children:e}),jsxRuntime.jsx("svg",{className:`w-5 h-5 transition-transform ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}),n&&jsxRuntime.jsx("div",{className:"px-4 py-3 bg-background border-t border-border",children:t})]})});Ye.displayName="Accordion";var lo=Ye;function v(...e){return tailwindMerge.twMerge(Zr.clsx(e))}var Qe=vr__default.default.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:a,loading:i=!1,loadingContent:s,...l},f)=>{let c="inline-flex items-center justify-center rounded-lg font-medium cursor-pointer active:translate-y-1 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",h={primary:"bg-blue-600 text-white hover:bg-blue-700 shadow-md focus-visible:ring-blue-500",secondary:"bg-gray-600 text-white hover:bg-gray-700 shadow-sm focus-visible:ring-gray-500",tertiary:"bg-purple-600 text-white hover:bg-purple-700 shadow-sm focus-visible:ring-purple-500",destructive:"bg-red-600 text-white hover:bg-red-700 shadow-sm focus-visible:ring-red-500",success:"bg-green-600 text-white hover:bg-green-700 shadow-sm focus-visible:ring-green-500",warning:"bg-amber-500 text-white hover:bg-amber-600 shadow-sm focus-visible:ring-amber-500",info:"bg-cyan-600 text-white hover:bg-cyan-700 shadow-sm focus-visible:ring-cyan-500",accent:"bg-violet-600 text-white hover:bg-violet-700 shadow-sm focus-visible:ring-violet-500",outline:"border border-gray-300 bg-transparent text-gray-700 hover:bg-gray-50 shadow-sm focus-visible:ring-gray-500",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus-visible:ring-gray-500",link:"text-blue-600 underline-offset-4 hover:underline bg-transparent p-0 h-auto shadow-none",gradient:"bg-gradient-to-r from-blue-600 to-purple-600 text-white hover:from-blue-700 hover:to-purple-700 shadow-md focus-visible:ring-blue-500",glass:"bg-white/10 backdrop-blur-md border border-white/20 text-black hover:bg-white/20 shadow-sm focus-visible:ring-white/50",soft:"bg-blue-100 text-blue-700 hover:bg-blue-200 shadow-sm focus-visible:ring-blue-500",dark:"bg-gray-900 text-white hover:bg-gray-800 shadow-md focus-visible:ring-gray-500",light:"bg-gray-100 text-gray-900 hover:bg-gray-200 shadow-sm focus-visible:ring-gray-500",obsidian:"bg-black text-white hover:bg-gray-900 shadow-md border border-gray-800 focus-visible:ring-gray-700",polar:"bg-white text-gray-900 hover:bg-gray-50 shadow-md border border-gray-300 focus-visible:ring-gray-400"},p={xs:"h-7 px-2 text-xs min-w-16",sm:"h-9 px-3 text-sm min-w-20",md:"h-10 px-4 py-2 text-base min-w-24",lg:"h-11 px-6 text-lg min-w-28",xl:"h-12 px-8 text-xl min-w-32"},d=t?e:v(c,h[r],p[n],e);return o?jsxRuntime.jsx(g,{children:jsxRuntime.jsx("a",{href:o,className:d,ref:f,children:i&&s?s:a})}):jsxRuntime.jsx(g,{children:jsxRuntime.jsx("button",{className:d,ref:f,...l,children:i&&s?s:a})})});Qe.displayName="Button";var xo=Qe;var et=vr.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:v("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r})}));et.displayName="Card";var tt=vr.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:v("flex flex-col space-y-1.5 p-6",e),...n,children:r})}));tt.displayName="CardHeader";var rt=vr.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("h3",{ref:o,className:t?e:v("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r})}));rt.displayName="CardTitle";var nt=vr.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("p",{ref:o,className:t?e:v("text-sm text-muted-foreground",e),...n,children:r})}));nt.displayName="CardDescription";var ot=vr.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:v("p-6 pt-0",e),...n,children:r})}));ot.displayName="CardContent";var at=vr.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:v("flex items-center p-6 pt-0",e),...n,children:r})}));at.displayName="CardFooter";var Ro=et,wo=tt,No=rt,ko=nt,Eo=ot,Mo=at;var ge=vr.createContext(void 0),st=vr.forwardRef(({children:e,className:t,...r},n)=>{let[o,a]=vr.useState(!1);return jsxRuntime.jsx(g,{children:jsxRuntime.jsx(ge.Provider,{value:{isOpen:o,setIsOpen:a},children:jsxRuntime.jsx("div",{ref:n,className:v("relative inline-block",t),...r,children:e})})})});st.displayName="DropdownMenu";var lt=({children:e,asChild:t})=>{let r=vr.useContext(ge);if(!r)throw new Error("DropdownMenuTrigger must be used within DropdownMenu");let n=()=>r.setIsOpen(!r.isOpen);if(t){let o=e;return vr.cloneElement(o,{onClick:a=>{o.props.onClick?.(a),n();}})}return jsxRuntime.jsx(g,{children:jsxRuntime.jsx("button",{onClick:n,children:e})})};lt.displayName="DropdownMenuTrigger";var ct=vr.forwardRef(({children:e,align:t="end",className:r,...n},o)=>{let a=vr.useContext(ge),i=vr.useRef(null);return vr.useEffect(()=>{o&&(typeof o=="function"?o(i.current):o.current=i.current);},[o]),vr.useEffect(()=>{let l=f=>{i.current&&!i.current.contains(f.target)&&a?.setIsOpen(!1);};return a?.isOpen&&document.addEventListener("mousedown",l),()=>{document.removeEventListener("mousedown",l);}},[a?.isOpen]),a?.isOpen?jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:i,className:v("absolute z-50 mt-2 min-w-32 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md",{start:"left-0",center:"left-1/2 -translate-x-1/2",end:"right-0"}[t],r),...n,children:e})}):null});ct.displayName="DropdownMenuContent";var dt=vr.forwardRef(({children:e,onClick:t,destructive:r,className:n,...o},a)=>{let i=vr.useContext(ge);return jsxRuntime.jsx(g,{children:jsxRuntime.jsx("button",{ref:a,onClick:l=>{t?.(l),i?.setIsOpen(!1);},className:v("w-full text-left px-4 py-2 text-sm hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none",r&&"text-red-600 hover:bg-red-50 hover:text-red-700 focus:bg-red-50 focus:text-red-700",n),...o,children:e})})});dt.displayName="DropdownMenuItem";var pt=vr.forwardRef(({className:e,...t},r)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:r,className:v("-mx-1 my-1 h-px bg-border",e),...t})}));pt.displayName="DropdownMenuSeparator";var mt=vr.forwardRef(({children:e,className:t,...r},n)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:n,className:v("px-2 py-1.5 text-sm font-semibold",t),...r,children:e})}));mt.displayName="DropdownMenuLabel";var So=st,$o=lt,Oo=ct,Bo=dt,Go=pt,Uo=mt;var Tr=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx(g,{children:jsxRuntime.jsx("p",{className:r?t:v("text-sm text-muted-foreground",t),children:e})})},D=Tr;var Lr=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("label",{...o,className:n?r:v("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),children:e}),t&&jsxRuntime.jsx("span",{className:"text-red-600",children:"*"})]})}),N=Lr;var Rr=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx(g,{children:jsxRuntime.jsx("p",{className:r?t:v("text-sm text-red-600 dark:text-red-400",t),children:e})})},A=Rr;var gt=vr.forwardRef(({label:e,required:t,option:r,description:n,icon:o,orientation:a="left",className:i,overrideClassName:s=!1,helperText:l,error:f,...c},h)=>{let p=vr.useId(),d=v("h-4 w-4 rounded border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",f&&"border-destructive",i);return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"space-y-2 w-fit",children:[e&&jsxRuntime.jsx(N,{required:t,children:e}),jsxRuntime.jsxs("div",{className:`flex items-center ${a=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsxRuntime.jsx("input",{id:p,type:"checkbox",className:s?i:d,ref:h,...c}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{children:o&&o}),jsxRuntime.jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsxRuntime.jsx(N,{htmlFor:p,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsxRuntime.jsx(N,{id:`${p}-description`,htmlFor:p,className:"text-xs text-muted-foreground",children:n})]})]})]}),f&&jsxRuntime.jsx(A,{children:f}),!f&&l&&jsxRuntime.jsx(D,{children:l})]})})});gt.displayName="CheckBox";var ca=gt;function Mr(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:a,labelKey:i,valueKey:s,options:l,alignment:f="vertical",className:c,overrideClassName:h=!1,helperText:p,error:d,label:R,name:L,required:C,...b}=e,k=vr.useId(),P=vr.useMemo(()=>new Map(l.map(y=>[String(y[s]),y])),[l,s]),F=vr.useMemo(()=>o==null?[]:r==="field"?n?o.map(y=>String(y)):[String(o)]:n?o.map(y=>String(y[s])):[String(o[s])],[o,r,n,s]),S=(y,w)=>{if(!a)return;let m;if(r==="field")if(n)m=y.map(T=>{let I=P.get(T);return I?I[s]:T});else {let u=y[0];if(!u)m=void 0;else {let T=P.get(u);m=T?T[s]:u;}}else n?m=y.map(T=>P.get(T)).filter(T=>T!==void 0):m=P.get(y[0]??"")??void 0;a({target:{name:L,value:m,type:"checkboxgroup",checked:w}});},$=y=>{let w;n?w=F.includes(y)?F.filter(m=>m!==y):[...F,y]:w=F[0]===y?[]:[y],S(w,w.includes(y));},E=f==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",O=v("h-4 w-4 rounded border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",d&&"border-destructive");return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:v("flex flex-col gap-3",c),children:[R&&jsxRuntime.jsx(N,{required:C,children:R}),jsxRuntime.jsx("div",{className:E,children:l.map((y,w)=>{let m=String(y[s]),u=F.includes(m),T=`${k}-${m}-${w}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...b,id:T,ref:t,type:"checkbox",name:L,checked:u,onChange:()=>$(m),className:h?c:O}),jsxRuntime.jsx(N,{htmlFor:T,children:String(y[i])})]},T)})}),!!d&&jsxRuntime.jsx(A,{children:String(d)}),!d&&p&&jsxRuntime.jsx(D,{children:p})]})})}function Fr(){let e=vr.forwardRef(Mr);return e.displayName="CheckBoxGroup",e}var Ir=Fr(),Ca=Ir;var Ar=["#000000","#ffffff","#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ffa500","#800080","#ffc0cb","#a52a2a","#808080","#000080","#008000"],ht=vr__default.default.forwardRef(({label:e,required:t,onChange:r,disabled:n=!1,presetColors:o=Ar,showPresets:a=!0,className:i,error:s,helperText:l,name:f},c)=>{let h=vr.useId(),p=vr.useRef(null),[d,R]=vr.useState(!1),[L,C]=vr.useState("COLOR"),[b,k]=vr.useState("HEX"),[P,F]=vr.useState("#000000"),[S,$]=vr.useState(0),[E,O]=vr.useState(0),[y,w]=vr.useState(0),[m,u]=vr.useState(1),[T,I]=vr.useState("#000000"),[V,_]=vr.useState("#ffffff"),[j,ue]=vr.useState(90),[ye,ne]=vr.useState("linear-gradient(90deg, #000000, #ffffff)"),Te=(x,H,ce)=>Math.min(ce,Math.max(H,x)),Le=x=>{let H=x.replace("#","");return {r:parseInt(H.slice(0,2),16),g:parseInt(H.slice(2,4),16),b:parseInt(H.slice(4,6),16)}},B=x=>{r?.({target:{value:x,name:f}});};vr.useEffect(()=>{let x=H=>{p.current&&!p.current.contains(H.target)&&R(!1);};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[]),vr.useEffect(()=>{if(/^#[0-9A-F]{6}$/i.test(P)){let x=Le(P);$(x.r),O(x.g),w(x.b);}},[P]),vr.useEffect(()=>{let x=`linear-gradient(${j}deg, ${T}, ${V})`;ne(x),L==="GRADIENT"&&B(x);},[T,V,j]);let G=()=>{if(m>=1){if(b==="HEX")return P;if(b==="RGB")return `rgb(${S}, ${E}, ${y})`}return `rgba(${S}, ${E}, ${y}, ${Number(m.toFixed(2))})`},Z=L==="GRADIENT"?ye:G();return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${i??""}`,children:[e&&jsxRuntime.jsx(N,{htmlFor:h,required:t,children:e}),jsxRuntime.jsxs("div",{ref:p,className:"relative",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>!n&&R(!d),className:"flex items-center gap-2 px-3 py-2 border rounded-md bg-background w-full",children:[jsxRuntime.jsx("div",{className:"w-6 h-6 rounded border",style:{background:Z}}),jsxRuntime.jsx("span",{className:"text-xs font-mono truncate",children:Z})]}),d&&jsxRuntime.jsxs("div",{className:"absolute z-50 mt-1 w-85 bg-popover border rounded-md p-4 space-y-3 shadow-lg",children:[jsxRuntime.jsx("div",{className:"flex gap-2",children:["COLOR","GRADIENT"].map(x=>jsxRuntime.jsx("button",{type:"button",onClick:()=>C(x),className:`px-2 py-1 text-xs rounded ${L===x?"bg-primary text-white":"border"}`,children:x==="COLOR"?"Cor":"Gradiente"},x))}),jsxRuntime.jsx("div",{className:"w-full h-10 rounded border",style:{background:Z}}),L==="COLOR"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("input",{ref:c,type:"color",value:P,onChange:x=>{F(x.target.value.toUpperCase()),B(G());},className:"w-full h-10 rounded"}),jsxRuntime.jsxs("div",{className:"flex gap-2 items-center",children:[jsxRuntime.jsxs("select",{value:b,onChange:x=>k(x.target.value),className:"px-2 py-1 text-xs border rounded",children:[jsxRuntime.jsx("option",{value:"HEX",children:"HEX"}),jsxRuntime.jsx("option",{value:"RGB",children:"RGB"}),jsxRuntime.jsx("option",{value:"RGBA",children:"RGBA"})]}),b==="HEX"&&jsxRuntime.jsx("input",{value:P,onChange:x=>{let H=x.target.value.toUpperCase().replace(/[^0-9A-F#]/g,"");H.startsWith("#")||(H="#"+H),H="#"+H.slice(1,7),F(H),/^#[0-9A-F]{6}$/.test(H)&&B(H);},className:"flex-1 px-2 py-1 text-xs font-mono border rounded",placeholder:"#000000"}),(b==="RGB"||b==="RGBA")&&jsxRuntime.jsx("div",{className:"flex gap-2",children:[{l:"R",v:S,s:$},{l:"G",v:E,s:O},{l:"B",v:y,s:w}].map(({l:x,v:H,s:ce})=>jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"text-xs font-semibold",children:x}),jsxRuntime.jsx("input",{type:"number",min:0,max:255,value:H,onChange:or=>{ce(Te(+or.target.value,0,255)),B(G());},className:"w-14 px-1 py-1 text-xs border rounded"})]},x))})]}),b==="RGBA"&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs font-semibold",children:"A"}),jsxRuntime.jsx("input",{type:"range",min:0,max:1,step:.01,value:m,onChange:x=>{u(+x.target.value),B(G());},className:"flex-1"}),jsxRuntime.jsxs("span",{className:"text-xs w-10 text-right",children:[Math.round(m*100),"%"]})]}),a&&jsxRuntime.jsx("div",{className:"grid grid-cols-5 gap-1",children:o.map(x=>jsxRuntime.jsx("button",{type:"button",onClick:()=>{F(x),u(1),B(x);},className:"w-8 h-8 rounded border",style:{background:x}},x))})]}),L==="GRADIENT"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex gap-2 items-center",children:[jsxRuntime.jsx("input",{type:"color",value:T,onChange:x=>I(x.target.value)}),jsxRuntime.jsx("span",{className:"text-xs",children:"\u2192"}),jsxRuntime.jsx("input",{type:"color",value:V,onChange:x=>_(x.target.value)})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs",children:"\xC2ngulo"}),jsxRuntime.jsx("input",{type:"range",min:0,max:360,value:j,onChange:x=>ue(+x.target.value),className:"flex-1"}),jsxRuntime.jsxs("span",{className:"text-xs w-10 text-right",children:[j,"\xB0"]})]})]})]})]}),s&&jsxRuntime.jsx(A,{children:s}),!s&&l&&jsxRuntime.jsx(D,{children:l})]})})});ht.displayName="ColorPicker";var ka=ht;var Sr=({...e})=>jsxRuntime.jsx("svg",{...e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),ve=Sr;var Or=(e,t)=>{vr.useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},yt=Or;function ke({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:a,typeSet:i,name:s}){let[l,f]=vr.useState([]),c=vr.useMemo(()=>new Map(e.map(C=>[String(C[r]),C])),[e,r]),h=vr.useCallback(()=>l.map(C=>c.get(C)).filter(C=>!!C),[l,c]),p=vr.useCallback(C=>{if(!o)return;let b;if(i==="field"?n?b=C:b=C[0]??void 0:n?b=C.map(P=>c.get(P)).filter(P=>P!==void 0):b=c.get(C[0]??"")??void 0,a&&!n){let k=c.get(C[0]??"");k&&a(String(k[t]));}o({target:{name:s,value:b,type:"combobox"}});},[n,o,c,s,i,a,t]),d=vr.useCallback(C=>{let b=String(C[r]),k=n?l.includes(b)?l.filter(P=>P!==b):[...l,b]:[b];f(k),p(k);},[n,l,p,r]),R=vr.useCallback(C=>{let b=l.filter(k=>k!==C);f(b),p(b);},[l,p]),L=vr.useCallback(()=>{f([]),a?.("");let C;i==="field"?C=n?[]:"":C=n?[]:void 0,o?.({target:{name:s,value:C,type:"combobox"}});},[n,o,s,a,i]);return {selectedValues:l,handleSelect:d,handleRemove:R,handleClear:L,getSelectedOptions:h}}function Ee(e,t,r){return vr.useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var Lt=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:a,filteredOptions:i,highlightedIndex:s,setHighlightedIndex:l,handleSelect:f,handleRemove:c})=>{let h=vr.useCallback(d=>{if(i.length===0){l(-1);return}l(R=>R<0?d>0?0:i.length-1:(R+d+i.length)%i.length);},[i,l]);return vr.useCallback(d=>{if(!e){if(d.key==="Enter"||d.key==="ArrowDown"){t(!0),l(0),d.preventDefault();return}r&&d.key==="Backspace"&&n===""&&a.length>0&&(d.preventDefault(),c(a[a.length-1]));return}switch(d.key){case"ArrowDown":d.preventDefault(),h(1);break;case"ArrowUp":d.preventDefault(),h(-1);break;case"Enter":d.preventDefault();let R=s>=0?s:0,L=i[R];L&&f(L),r&&o&&o(""),r||(t(!1),l(-1));break;case"Escape":d.preventDefault(),t(!1),l(-1),r||o("");break;case"Tab":t(!1),l(-1);break;case"Home":d.preventDefault(),i.length>0&&l(0);break;case"End":d.preventDefault(),i.length>0&&l(i.length-1);break;case"Backspace":r&&n===""&&a.length>0&&(d.preventDefault(),c(a[a.length-1]));break}},[e,r,n,a,i,s,t,o,l,f,c,h])};function Pt({option:e,labelKey:t,valueKey:r,onRemove:n}){let o=String(e[t]),a=String(e[r]);return jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded",children:[o,jsxRuntime.jsx("button",{type:"button",onMouseDown:i=>i.preventDefault(),onClick:()=>n(a),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${o}`,children:"\u2715"})]},a)}function _r(e,t){let{label:r,required:n=!1,name:o,placeholder:a="Buscar...",labelKey:i,valueKey:s,options:l,value:f,onChange:c,mode:h="single",typeSet:p="field",disabled:d=!1,ClearEnabled:R=!0,helperText:L,error:C=!1,className:b="",...k}=e,P=h==="multiple",[F,S]=vr.useState(!1),[$,E]=vr.useState(""),O=vr.useRef(null),y=vr.useRef(null),w=vr.useRef(null);vr.useImperativeHandle(t,()=>w.current),yt(y,()=>S(!1));let m=Ee(l,i,$),[u,T]=vr.useState(-1),{selectedValues:I,handleSelect:V,handleRemove:_,handleClear:j,getSelectedOptions:ue}=ke({options:l,labelKey:i,valueKey:s,value:f,multiple:P,onChange:c,typeSet:p,name:o,setSearchTerm:E}),ye=Lt({isOpen:F,setIsOpen:S,multiple:P,searchTerm:$,setSearchTerm:E,selectedValues:I,filteredOptions:m,highlightedIndex:u,setHighlightedIndex:T,handleSelect:V,handleRemove:_}),ne=vr.useId(),Te="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",Le=v("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",C?"border-red-500":"border-gray-300 dark:border-gray-600",d?"opacity-50 cursor-not-allowed":"cursor-text","focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500");return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${b}`,children:[r&&jsxRuntime.jsx(N,{htmlFor:ne,required:n,children:r}),jsxRuntime.jsxs("div",{ref:O,className:"relative",children:[jsxRuntime.jsxs("div",{className:Le,children:[P&&ue().length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:ue().map((B,G)=>jsxRuntime.jsx(Pt,{option:B,labelKey:i,valueKey:s,onRemove:_},String(B[s]??G)))}),jsxRuntime.jsx("input",{ref:w,...k,name:o,type:"text",placeholder:a,value:$,onChange:B=>{let G=B.target.value;E(G),!F&&G.trim()!==""&&S(!0);},onKeyDown:ye,onMouseDown:B=>{document.activeElement===w.current&&(B.preventDefault(),S(G=>{let Z=!G;return Z&&T(0),Z}));},onFocus:()=>{S(!0),T(0);},disabled:d,className:Te,role:"combobox","aria-expanded":F,"aria-controls":ne,"aria-activedescendant":u>=0?`${ne}-opt-${u}`:void 0}),R&&!!I.length&&jsxRuntime.jsx("button",{type:"button",onMouseDown:B=>B.preventDefault(),onClick:j,className:"absolute right-2 top-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700",title:"Limpar sele\xE7\xE3o",children:jsxRuntime.jsx(ve,{width:12,height:12})})]}),F&&jsxRuntime.jsx("div",{ref:y,id:ne,className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",role:"listbox","aria-multiselectable":P||void 0,children:m.length===0?jsxRuntime.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):m.map((B,G)=>{let Z=String(B[s]),x=I.includes(Z),H=G===u;return jsxRuntime.jsx("button",{id:`${ne}-opt-${G}`,"data-index":G,role:"option","aria-selected":x,type:"button",onMouseDown:ce=>ce.preventDefault(),onClick:()=>V(B),className:v("w-full px-3 py-2 text-left text-sm transition-colors",H&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!H&&x&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!x&&!H&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsxRuntime.jsx("span",{children:String(B[i])})},Z)})})]}),C&&jsxRuntime.jsx(A,{children:C}),!C&&L&&jsxRuntime.jsx(D,{children:L})]})})}function Jr(){let e=vr.forwardRef(_r);return e.displayName="ComboBox",e}var jr=Jr(),ni=jr;var Yr=({children:e,before:t,after:r,className:n})=>{let a=Zr__default.default("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},n);return jsxRuntime.jsx("div",{className:a,children:jsxRuntime.jsx("span",{children:e})})},Ve=Yr;var Qr=({children:e})=>jsxRuntime.jsx("div",{className:"absolute px-2",children:jsxRuntime.jsx("span",{children:e})}),Nt=Qr;var en=({children:e})=>jsxRuntime.jsx("div",{className:"absolute right-0 px-2",children:jsxRuntime.jsx("span",{children:e})}),Et=en;function Mt(e){e.currentTarget.maxLength=9;let t=e.currentTarget.value;return t=t.replace(/\D/g,""),t=t.replace(/^(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function Ft(e){let t=e.currentTarget.value;t=t.replace(/\D/g,""),t=t.padStart(3,"0");let r=t.slice(0,-2),n=t.slice(-2),i=`${(r.replace(/^0+/,"")||"0").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")},${n}`;return e.currentTarget.value=i,e}function It(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value;return t.match(/^(\d{3}).(\d{3}).(\d{3})-(\d{2})$/)||(t=t.replace(/\D/g,""),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2"),e.currentTarget.value=t),e}function Vt(e){e.currentTarget.maxLength=15;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function Ht(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{4})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function Dt(e){let t=e.currentTarget.value.replace(/\D/g,"");return t.length<=11?(e.currentTarget.maxLength=14,t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2")):(e.currentTarget.maxLength=18,t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2")),e.currentTarget.value=t,e}function At(e){e.currentTarget.maxLength=12;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{1})$/,"$1-$2"),e.currentTarget.value=t,e}function St(e){e.currentTarget.maxLength=18;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2"),e.currentTarget.value=t,e}var tn=({e,mask:t})=>{switch(t){case"money":return Ft(e);case"mobile":return Vt(e);case"phone":return Ht(e);case"cpfCnpj":return Dt(e);case"cpf":return It(e);case"rg":return At(e);case"cnpj":return St(e);case"cep":return Mt(e);default:return e}},$t=tn;var on=({mask:e,initialValue:t=""})=>{let[r,n]=vr.useState(t);vr.useEffect(()=>{t!==r&&n(t);},[t]);let o=vr.useCallback(i=>{let l=$t({e:i,mask:e})?.currentTarget?.value??i.currentTarget.value;n(l);},[e]),a=vr.useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:a}},Bt=on;var Gt=vr.forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:a,addonBefore:i,addonBeforeClassName:s,addonAfter:l,addonAfterClassName:f,ClearEnabled:c=!0,className:h,overrideClassName:p=!1,error:d,helperText:R,value:L=void 0,onChange:C,...b},k)=>{let P=vr.useId(),{handleChange:F,handleClear:S,setValue:$}=Bt({mask:r,initialValue:L}),E=v("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",d&&"border-destructive focus-visible:ring-destructive",!o&&!a&&"px-3",o&&!a&&"pl-10 pr-3",a&&!o&&"pl-3 pr-10",o&&a&&"pl-10 pr-10",i&&"rounded-l-none border-l-0",l&&"rounded-r-none border-r-0",h),O=w=>{F(w),C?.(w);},y=()=>{S(),$(""),C?.({target:{name:n||"",value:""}});};return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsxRuntime.jsx(N,{htmlFor:P,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative flex",children:[i&&jsxRuntime.jsx(Ve,{before:!0,className:s,children:i}),jsxRuntime.jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsxRuntime.jsx(Nt,{children:o}),jsxRuntime.jsx("input",{id:P,ref:k,name:n,onChange:O,className:p?h:E,...b}),c&&L&&jsxRuntime.jsx(ve,{onClick:y,width:12,height:12,className:v("absolute right-2 cursor-pointer",a&&"right-8")}),a&&jsxRuntime.jsx(Et,{children:a})]}),l&&jsxRuntime.jsx(Ve,{after:!0,className:f,children:l})]}),d&&jsxRuntime.jsx(A,{children:d}),!d&&R&&jsxRuntime.jsx(D,{children:R})]})})});Gt.displayName="Input";var Mi=Gt;var qt=vr.forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:a=!1,helperText:i,error:s,onChange:l,onBlur:f,className:c,charType:h="numeric",customPattern:p,caseMode:d="none",...R},L)=>{let C=vr.useId(),b=vr.useRef([]),k=m=>{switch(d){case"upper":return m.toUpperCase();case"lower":case"visual-upper":return m.toLowerCase();case"visual-lower":return m.toUpperCase();default:return m}},P=m=>{if(!m)return "";let u=m.slice(0,1);switch(u=k(u),h){case"numeric":return /\d/.test(u)?u:"";case"alpha":return /[A-Za-z]/.test(u)?u:"";case"alphanumeric":return /[A-Za-z0-9]/.test(u)?u:"";case"custom":return p?.test(u)?u:"";default:return u}},F=()=>(r!=null?String(r):"").split("").map(P).slice(0,e),S=F().concat(Array(e).fill(" ")).slice(0,e),$=m=>{let u=m.split("").map(P).join("").slice(0,e),T=u===""?void 0:typeof r=="number"?Number(u):u;l?.({target:{name:n,value:T}});},E=(m,u)=>{let T=P(u),I=F();if(T===""){I[m]="",$(I.join(""));return}if(u.length>1){let V=u.split("").map(P).join("").slice(0,e);$(V),b.current[Math.min(V.length-1,e-1)]?.focus();return}T&&(I[m]=T,$(I.join("")),m<e-1&&b.current[m+1]?.focus());},O=m=>{let u=F();!u[m]&&m>0?u[m-1]="":u[m]="",$(u.join("")),m>0&&b.current[m-1]?.focus();},y=m=>{m.preventDefault();let T=m.clipboardData.getData("text").split("").map(P).join("").slice(0,e);T&&($(T),b.current[Math.min(T.length-1,e-1)]?.focus());},w=m=>{switch(d){case"upper":case"visual-upper":return m.toUpperCase();case"lower":case"visual-lower":return m.toLowerCase();default:return m}};return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsxRuntime.jsx(N,{htmlFor:C,required:a,children:o}),jsxRuntime.jsx("div",{className:v("flex gap-3 items-center",s&&"text-red-500",c),...R,children:S.map((m,u)=>{let T=t&&u>0&&u%t===0;return jsxRuntime.jsxs(vr__default.default.Fragment,{children:[T&&jsxRuntime.jsx("span",{className:"flex items-center justify-center text-xl font-bold select-none",children:"-"}),jsxRuntime.jsx("input",{id:C,type:"text",maxLength:1,inputMode:h==="numeric"?"numeric":"text",value:w(m).trim(),ref:I=>{b.current[u]=I,u===0&&L&&(typeof L=="function"?L(I):typeof L=="object"&&(L.current=I));},onPaste:y,onChange:I=>E(u,I.target.value),onKeyDown:I=>I.key==="Backspace"&&O(u),onBlur:f,className:v("h-14 w-12 text-center text-2xl rounded-md border border-input bg-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s&&"border-red-500")})]},u)})}),s&&jsxRuntime.jsx(A,{children:s}),!s&&i&&jsxRuntime.jsx(D,{children:i})]})})});qt.displayName="OtpInput";var Oi=qt;var Kt=vr.forwardRef(({label:e,required:t,option:r,description:n,icon:o,className:a,overrideClassName:i,helperText:s,error:l,...f},c)=>{let h=vr.useId(),p=v("h-4 w-4 border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",l&&"border-destructive",a);return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"space-y-3",children:[e&&jsxRuntime.jsx(N,{required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{id:h,type:"radio",className:i?a:p,ref:c,...f}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{children:o&&o}),jsxRuntime.jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsxRuntime.jsx(N,{htmlFor:h,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsxRuntime.jsx(N,{id:`${h}-description`,htmlFor:h,className:"text-xs text-muted-foreground",children:n})]})]})]}),l&&jsxRuntime.jsx(A,{children:l}),!l&&s&&jsxRuntime.jsx(D,{children:s})]})})});Kt.displayName="Radio";var _i=Kt;function bn(e,t){let{label:r,required:n,name:o,labelKey:a,valueKey:i,options:s,alignment:l="vertical",className:f,overrideClassName:c=!1,helperText:h,error:p,typeSet:d="field",value:R,onChange:L,...C}=e,b=vr.useId(),k=vr.useMemo(()=>new Map(s.map(E=>[String(E[i]),E])),[s,i]),P=vr.useMemo(()=>R==null?"":String(d==="field"?R:R[i]),[R,d,i]),F=E=>{if(!L)return;let O;if(d==="field"){let y=k.get(E);if(y)O=y[i];else {let w=Number(E);O=Number.isNaN(w)?E:w;}}else O=k.get(E)??void 0;L({target:{name:o,value:O,type:"radiogroup",checked:!0}});},S=l==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",$=v("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",p&&"border-destructive");return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:v("flex flex-col gap-3",f),children:[r&&jsxRuntime.jsx(N,{required:n,children:r}),jsxRuntime.jsx("div",{className:S,children:s.map((E,O)=>{let y=String(E[i]),w=`${b}-${y}-${O}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...C,id:w,ref:t,name:o,type:"radio",checked:P===y,onChange:()=>F(y),className:c?f:$}),jsxRuntime.jsx(N,{htmlFor:w,children:String(E[a])})]},w)})}),p&&jsxRuntime.jsx(A,{children:String(p)}),!p&&h&&jsxRuntime.jsx(D,{children:h})]})})}function vn(){let e=vr.forwardRef(bn);return e.displayName="RadioGroup",e}var xn=vn(),as=xn;function yn({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:a,error:i,helperText:s,className:l,...f},c){let h=vr.useId(),p=v("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",i&&"border-red-500 focus-visible:ring-red-500",l);return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(N,{htmlFor:h,required:t,children:e}),jsxRuntime.jsxs("select",{id:h,ref:c,className:p,...f,children:[a&&jsxRuntime.jsx("option",{value:"",disabled:!0,children:a}),r.map((d,R)=>jsxRuntime.jsx("option",{value:String(d[o]),children:String(d[n])},R))]}),i&&jsxRuntime.jsx(A,{children:i}),!i&&s&&jsxRuntime.jsx(D,{children:s})]})})}function Tn(){let e=vr.forwardRef(yn);return e.displayName="Select",e}var Ln=Tn(),bs=Ln;var _t=vr.forwardRef(({label:e,required:t,option:r,description:n,icon:o,checked:a=!1,className:i,overrideClassName:s,error:l,name:f,...c},h)=>{let p=vr.useId();return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[e&&jsxRuntime.jsx(N,{required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:p,name:f,checked:a,className:"peer sr-only",ref:h,...c}),jsxRuntime.jsx("label",{htmlFor:p,className:v("relative flex items-center h-6 w-11 cursor-pointer rounded-full bg-input transition-colors duration-200","peer-checked:bg-primary peer-focus:ring-2 peer-focus:ring-ring peer-focus:ring-offset-2 peer-focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",i),children:jsxRuntime.jsx("span",{className:v("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",a?"translate-x-5":"translate-x-1")})}),jsxRuntime.jsx("span",{children:o&&o}),(r||n)&&jsxRuntime.jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[e&&jsxRuntime.jsx(N,{id:`${p}-label`,htmlFor:p,className:"text-sm font-medium leading-none",children:r}),n&&jsxRuntime.jsx(N,{id:`${p}-description`,htmlFor:p,className:"text-xs text-muted-foreground",children:n})]})]})]})})});_t.displayName="Switch";var Ps=_t;var Jt=vr__default.default.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:a=!1,error:i,helperText:s,...l},f)=>{let c=vr.useId(),[h,p]=vr.useState(0),d=v("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",i&&"border-red-500 focus-visible:ring-red-500",o);return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(N,{htmlFor:c,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("textarea",{id:c,className:a?o:d,maxLength:n,onInput:R=>p(R.currentTarget.textLength),ref:f,...l}),r&&jsxRuntime.jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[h,n?` / ${n}`:""]})]}),i&&jsxRuntime.jsx(A,{children:i}),!i&&s&&jsxRuntime.jsx(D,{children:s})]})})});Jt.displayName="TextArea";var Vs=Jt;var En=({files:e,removeFile:t})=>jsxRuntime.jsx("div",{className:"space-y-2",children:e?.length>0&&e?.map((r,n)=>jsxRuntime.jsxs("div",{className:"flex items-center justify-between p-2 bg-secondary rounded",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm truncate",children:r.name}),jsxRuntime.jsxs("p",{className:"text-xs text-muted-foreground",children:[(r?.size/1024).toFixed(1)," KB"]})]}),jsxRuntime.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),t(n);},className:"ml-2 p-1 hover:bg-destructive/20 rounded",children:"\u2715"})]},`${r?.name}-${n}`))}),jt=En;var Mn=({accept:e,maxSize:t})=>jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("svg",{className:"w-8 h-8 mx-auto text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm text-foreground",children:"Clique para selecionar ou arraste arquivos aqui"}),jsxRuntime.jsxs("p",{className:"text-xs text-muted-foreground",children:[e&&`Tipos aceitos: ${e}`,t&&` \u2022 Tamanho m\xE1ximo: ${t}MB`]})]})]}),Zt=Mn;var Yt=({files:e,setFiles:t,multiple:r=!1,disabled:n=!1,filterFiles:o=a=>a})=>{let a=vr.useRef(null),[i,s]=vr.useState(!1),l=vr.useCallback(p=>{p.preventDefault(),!n&&s(!0);},[n]),f=vr.useCallback(()=>{s(!1);},[]),c=vr.useCallback(p=>{if(p.preventDefault(),n||!a.current)return;s(!1);let d=Array.from(p.dataTransfer.files);if(!r&&!e||!r&&d.length>1)return;let R=o(d),L=r?R:R.slice(0,1);t(L);let C=new DataTransfer;L.forEach(b=>C.items.add(b)),a.current.files=C.files,a.current.dispatchEvent(new Event("change",{bubbles:!0}));},[n,r,e,o]),h=vr.useCallback(()=>{t([]),a.current&&(a.current.value="");},[]);return {files:e,setFiles:t,clearFiles:h,inputRef:a,isDragOver:i,setIsDragOver:s,handleDrop:c,handleDragOver:l,handleDragLeave:f}};var Qt=({files:e,setFiles:t,inputRef:r})=>({removeFile:vr.useCallback(o=>{if(!r.current)return;let a=e?.filter((s,l)=>l!==o);t(a);let i=new DataTransfer;a?.forEach(s=>i.items.add(s)),r.current.files=i.files,r.current.dispatchEvent(new Event("change",{bubbles:!0}));},[e,t,r])});var Dn=({previews:e,onRemove:t})=>{let[r,n]=vr.useState(0),o=()=>n(i=>i===0?e?.length-1:i-1),a=()=>n(i=>i===e?.length-1?0:i+1);return jsxRuntime.jsxs("div",{className:"relative w-full h-56 rounded-lg overflow-hidden bg-black/5",children:[jsxRuntime.jsx("img",{src:e[r].url,alt:e[r].file.name,className:"w-full h-full object-cover"}),e.length>1&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",onClick:o,className:"absolute left-2 top-1/2 -translate-y-1/2 bg-black/50 text-white px-2 py-1 rounded",children:"\u2039"}),jsxRuntime.jsx("button",{type:"button",onClick:a,className:"absolute right-2 top-1/2 -translate-y-1/2 bg-black/50 text-white px-2 py-1 rounded",children:"\u203A"})]}),jsxRuntime.jsx("button",{type:"button",onClick:()=>t(r),className:"absolute top-2 right-2 bg-red-500 text-white rounded px-2 py-1",children:"\u2715"})]})},tr=Dn;var nr=vr.forwardRef(({label:e,required:t,accept:r,renderFiles:n,preview:o=!1,multiple:a=!1,maxSize:i=10,disabled:s=!1,error:l=!1,helperText:f,className:c,name:h,onChange:p,onBlur:d,...R},L)=>{let C=vr.useId(),[b,k]=vr.useState([]),P=1024*1024,F=V=>V.filter(_=>(!i||_.size<=i*P)&&(!r||_.type.match(r))),{inputRef:S,isDragOver:$,handleDrop:E,handleDragOver:O,handleDragLeave:y}=Yt({files:b,setFiles:k,multiple:a,filterFiles:F}),{removeFile:w}=Qt({files:b,setFiles:k,inputRef:S}),m=V=>{S.current=V,typeof L=="function"?L(V):L&&(L.current=V);},u=V=>{let _=Array.from(V.target.files??[]);if(!_.length)return;let j=F(_);k(a?j:j.slice(0,1)),p?.(V);},T=vr.useMemo(()=>!o||!b||!b.length?[]:b.filter(V=>V.type.startsWith("image/")).map(V=>({file:V,url:URL.createObjectURL(V)})),[b,o]);vr.useEffect(()=>()=>T.forEach(V=>URL.revokeObjectURL(V.url)),[T]);let I=o&&T.length>0;return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${c}`,children:[e&&jsxRuntime.jsx(N,{htmlFor:C,required:t,children:e}),jsxRuntime.jsxs("div",{onDrop:E,onDragOver:O,onDragLeave:y,onClick:()=>{!s&&!I&&S.current?.click();},className:`
|
|
32
|
+
`,children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{children:e}),jsxRuntime.jsx("svg",{className:`w-5 h-5 transition-transform ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}),n&&jsxRuntime.jsx("div",{className:"px-4 py-3 bg-background border-t border-border",children:t})]})});Ye.displayName="Accordion";var lo=Ye;function v(...e){return tailwindMerge.twMerge(Zr.clsx(e))}var Qe=vr__default.default.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:a,loading:i=!1,loadingContent:s,...l},f)=>{let c="inline-flex items-center justify-center rounded-lg font-medium cursor-pointer active:translate-y-1 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",h={primary:"bg-blue-600 text-white hover:bg-blue-700 shadow-md focus-visible:ring-blue-500",secondary:"bg-gray-600 text-white hover:bg-gray-700 shadow-sm focus-visible:ring-gray-500",tertiary:"bg-purple-600 text-white hover:bg-purple-700 shadow-sm focus-visible:ring-purple-500",destructive:"bg-red-600 text-white hover:bg-red-700 shadow-sm focus-visible:ring-red-500",success:"bg-green-600 text-white hover:bg-green-700 shadow-sm focus-visible:ring-green-500",warning:"bg-amber-500 text-white hover:bg-amber-600 shadow-sm focus-visible:ring-amber-500",info:"bg-cyan-600 text-white hover:bg-cyan-700 shadow-sm focus-visible:ring-cyan-500",accent:"bg-violet-600 text-white hover:bg-violet-700 shadow-sm focus-visible:ring-violet-500",outline:"border border-gray-300 bg-transparent text-gray-700 hover:bg-gray-50 shadow-sm focus-visible:ring-gray-500",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus-visible:ring-gray-500",link:"text-blue-600 underline-offset-4 hover:underline bg-transparent p-0 h-auto shadow-none",gradient:"bg-gradient-to-r from-blue-600 to-purple-600 text-white hover:from-blue-700 hover:to-purple-700 shadow-md focus-visible:ring-blue-500",glass:"bg-white/10 backdrop-blur-md border border-white/20 text-black hover:bg-white/20 shadow-sm focus-visible:ring-white/50",soft:"bg-blue-100 text-blue-700 hover:bg-blue-200 shadow-sm focus-visible:ring-blue-500",dark:"bg-gray-900 text-white hover:bg-gray-800 shadow-md focus-visible:ring-gray-500",light:"bg-gray-100 text-gray-900 hover:bg-gray-200 shadow-sm focus-visible:ring-gray-500",obsidian:"bg-black text-white hover:bg-gray-900 shadow-md border border-gray-800 focus-visible:ring-gray-700",polar:"bg-white text-gray-900 hover:bg-gray-50 shadow-md border border-gray-300 focus-visible:ring-gray-400"},p={xs:"h-7 px-2 text-xs min-w-16",sm:"h-9 px-3 text-sm min-w-20",md:"h-10 px-4 py-2 text-base min-w-24",lg:"h-11 px-6 text-lg min-w-28",xl:"h-12 px-8 text-xl min-w-32"},d=t?e:v(c,h[r],p[n],e);return o?jsxRuntime.jsx(g,{children:jsxRuntime.jsx("a",{href:o,className:d,ref:f,children:i&&s?s:a})}):jsxRuntime.jsx(g,{children:jsxRuntime.jsx("button",{className:d,ref:f,...l,children:i&&s?s:a})})});Qe.displayName="Button";var xo=Qe;var et=vr.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:v("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r})}));et.displayName="Card";var tt=vr.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:v("flex flex-col space-y-1.5 p-6",e),...n,children:r})}));tt.displayName="CardHeader";var rt=vr.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("h3",{ref:o,className:t?e:v("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r})}));rt.displayName="CardTitle";var nt=vr.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("p",{ref:o,className:t?e:v("text-sm text-muted-foreground",e),...n,children:r})}));nt.displayName="CardDescription";var ot=vr.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:v("p-6 pt-0",e),...n,children:r})}));ot.displayName="CardContent";var at=vr.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:v("flex items-center p-6 pt-0",e),...n,children:r})}));at.displayName="CardFooter";var Ro=et,wo=tt,No=rt,ko=nt,Eo=ot,Mo=at;var ge=vr.createContext(void 0),st=vr.forwardRef(({children:e,className:t,...r},n)=>{let[o,a]=vr.useState(!1);return jsxRuntime.jsx(g,{children:jsxRuntime.jsx(ge.Provider,{value:{isOpen:o,setIsOpen:a},children:jsxRuntime.jsx("div",{ref:n,className:v("relative inline-block",t),...r,children:e})})})});st.displayName="DropdownMenu";var lt=({children:e,asChild:t})=>{let r=vr.useContext(ge);if(!r)throw new Error("DropdownMenuTrigger must be used within DropdownMenu");let n=()=>r.setIsOpen(!r.isOpen);if(t){let o=e;return vr.cloneElement(o,{onClick:a=>{o.props.onClick?.(a),n();}})}return jsxRuntime.jsx(g,{children:jsxRuntime.jsx("button",{onClick:n,children:e})})};lt.displayName="DropdownMenuTrigger";var ct=vr.forwardRef(({children:e,align:t="end",className:r,...n},o)=>{let a=vr.useContext(ge),i=vr.useRef(null);return vr.useEffect(()=>{o&&(typeof o=="function"?o(i.current):o.current=i.current);},[o]),vr.useEffect(()=>{let l=f=>{i.current&&!i.current.contains(f.target)&&a?.setIsOpen(!1);};return a?.isOpen&&document.addEventListener("mousedown",l),()=>{document.removeEventListener("mousedown",l);}},[a?.isOpen]),a?.isOpen?jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:i,className:v("absolute z-50 mt-2 min-w-32 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md",{start:"left-0",center:"left-1/2 -translate-x-1/2",end:"right-0"}[t],r),...n,children:e})}):null});ct.displayName="DropdownMenuContent";var dt=vr.forwardRef(({children:e,onClick:t,destructive:r,className:n,...o},a)=>{let i=vr.useContext(ge);return jsxRuntime.jsx(g,{children:jsxRuntime.jsx("button",{ref:a,onClick:l=>{t?.(l),i?.setIsOpen(!1);},className:v("w-full text-left px-4 py-2 text-sm hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none",r&&"text-red-600 hover:bg-red-50 hover:text-red-700 focus:bg-red-50 focus:text-red-700",n),...o,children:e})})});dt.displayName="DropdownMenuItem";var pt=vr.forwardRef(({className:e,...t},r)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:r,className:v("-mx-1 my-1 h-px bg-border",e),...t})}));pt.displayName="DropdownMenuSeparator";var mt=vr.forwardRef(({children:e,className:t,...r},n)=>jsxRuntime.jsx(g,{children:jsxRuntime.jsx("div",{ref:n,className:v("px-2 py-1.5 text-sm font-semibold",t),...r,children:e})}));mt.displayName="DropdownMenuLabel";var So=st,$o=lt,Oo=ct,Bo=dt,Go=pt,Uo=mt;var Tr=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx(g,{children:jsxRuntime.jsx("p",{className:r?t:v("text-sm text-muted-foreground",t),children:e})})},D=Tr;var Lr=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("label",{...o,className:n?r:v("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),children:e}),t&&jsxRuntime.jsx("span",{className:"text-red-600",children:"*"})]})}),N=Lr;var Rr=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx(g,{children:jsxRuntime.jsx("p",{className:r?t:v("text-sm text-red-600 dark:text-red-400",t),children:e})})},A=Rr;var gt=vr.forwardRef(({label:e,required:t,option:r,description:n,icon:o,orientation:a="left",className:i,overrideClassName:s=!1,helperText:l,error:f,...c},h)=>{let p=vr.useId(),d=v("h-4 w-4 rounded border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",f&&"border-destructive",i);return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"space-y-2 w-fit",children:[e&&jsxRuntime.jsx(N,{required:t,children:e}),jsxRuntime.jsxs("div",{className:`flex items-center ${a=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsxRuntime.jsx("input",{id:p,type:"checkbox",className:s?i:d,ref:h,...c}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{children:o&&o}),jsxRuntime.jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsxRuntime.jsx(N,{htmlFor:p,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsxRuntime.jsx(N,{id:`${p}-description`,htmlFor:p,className:"text-xs text-muted-foreground",children:n})]})]})]}),f&&jsxRuntime.jsx(A,{children:f}),!f&&l&&jsxRuntime.jsx(D,{children:l})]})})});gt.displayName="CheckBox";var ca=gt;function Mr(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:a,labelKey:i,valueKey:s,options:l,alignment:f="vertical",className:c,overrideClassName:h=!1,helperText:p,error:d,label:R,name:L,required:C,...b}=e,k=vr.useId(),P=vr.useMemo(()=>new Map(l.map(y=>[String(y[s]),y])),[l,s]),F=vr.useMemo(()=>o==null?[]:r==="field"?n?o.map(y=>String(y)):[String(o)]:n?o.map(y=>String(y[s])):[String(o[s])],[o,r,n,s]),S=(y,w)=>{if(!a)return;let m;if(r==="field")if(n)m=y.map(T=>{let I=P.get(T);return I?I[s]:T});else {let u=y[0];if(!u)m=void 0;else {let T=P.get(u);m=T?T[s]:u;}}else n?m=y.map(T=>P.get(T)).filter(T=>T!==void 0):m=P.get(y[0]??"")??void 0;a({target:{name:L,value:m,type:"checkboxgroup",checked:w}});},$=y=>{let w;n?w=F.includes(y)?F.filter(m=>m!==y):[...F,y]:w=F[0]===y?[]:[y],S(w,w.includes(y));},E=f==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",O=v("h-4 w-4 rounded border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",d&&"border-destructive");return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:v("flex flex-col gap-3",c),children:[R&&jsxRuntime.jsx(N,{required:C,children:R}),jsxRuntime.jsx("div",{className:E,children:l.map((y,w)=>{let m=String(y[s]),u=F.includes(m),T=`${k}-${m}-${w}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...b,id:T,ref:t,type:"checkbox",name:L,checked:u,onChange:()=>$(m),className:h?c:O}),jsxRuntime.jsx(N,{htmlFor:T,children:String(y[i])})]},T)})}),!!d&&jsxRuntime.jsx(A,{children:String(d)}),!d&&p&&jsxRuntime.jsx(D,{children:p})]})})}function Fr(){let e=vr.forwardRef(Mr);return e.displayName="CheckBoxGroup",e}var Ir=Fr(),Ca=Ir;var Ar=["#000000","#ffffff","#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ffa500","#800080","#ffc0cb","#a52a2a","#808080","#000080","#008000"],ht=vr__default.default.forwardRef(({label:e,required:t,onChange:r,disabled:n=!1,presetColors:o=Ar,showPresets:a=!0,className:i,error:s,helperText:l,name:f},c)=>{let h=vr.useId(),p=vr.useRef(null),[d,R]=vr.useState(!1),[L,C]=vr.useState("COLOR"),[b,k]=vr.useState("HEX"),[P,F]=vr.useState("#000000"),[S,$]=vr.useState(0),[E,O]=vr.useState(0),[y,w]=vr.useState(0),[m,u]=vr.useState(1),[T,I]=vr.useState("#000000"),[V,_]=vr.useState("#ffffff"),[j,ue]=vr.useState(90),[ye,ne]=vr.useState("linear-gradient(90deg, #000000, #ffffff)"),Te=(x,H,ce)=>Math.min(ce,Math.max(H,x)),Le=x=>{let H=x.replace("#","");return {r:parseInt(H.slice(0,2),16),g:parseInt(H.slice(2,4),16),b:parseInt(H.slice(4,6),16)}},B=x=>{r?.({target:{value:x,name:f}});};vr.useEffect(()=>{let x=H=>{p.current&&!p.current.contains(H.target)&&R(!1);};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[]),vr.useEffect(()=>{if(/^#[0-9A-F]{6}$/i.test(P)){let x=Le(P);$(x.r),O(x.g),w(x.b);}},[P]),vr.useEffect(()=>{let x=`linear-gradient(${j}deg, ${T}, ${V})`;ne(x),L==="GRADIENT"&&B(x);},[T,V,j]);let G=()=>{if(m>=1){if(b==="HEX")return P;if(b==="RGB")return `rgb(${S}, ${E}, ${y})`}return `rgba(${S}, ${E}, ${y}, ${Number(m.toFixed(2))})`},Z=L==="GRADIENT"?ye:G();return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${i??""}`,children:[e&&jsxRuntime.jsx(N,{htmlFor:h,required:t,children:e}),jsxRuntime.jsxs("div",{ref:p,className:"relative",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>!n&&R(!d),className:"flex items-center gap-2 px-3 py-2 border rounded-md bg-background w-full",children:[jsxRuntime.jsx("div",{className:"w-6 h-6 rounded border",style:{background:Z}}),jsxRuntime.jsx("span",{className:"text-xs font-mono truncate",children:Z})]}),d&&jsxRuntime.jsxs("div",{className:"absolute z-50 mt-1 w-85 bg-popover border rounded-md p-4 space-y-3 shadow-lg",children:[jsxRuntime.jsx("div",{className:"flex gap-2",children:["COLOR","GRADIENT"].map(x=>jsxRuntime.jsx("button",{type:"button",onClick:()=>C(x),className:`px-2 py-1 text-xs rounded ${L===x?"bg-primary text-white":"border"}`,children:x==="COLOR"?"Cor":"Gradiente"},x))}),jsxRuntime.jsx("div",{className:"w-full h-10 rounded border",style:{background:Z}}),L==="COLOR"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("input",{ref:c,type:"color",value:P,onChange:x=>{F(x.target.value.toUpperCase()),B(G());},className:"w-full h-10 rounded"}),jsxRuntime.jsxs("div",{className:"flex gap-2 items-center",children:[jsxRuntime.jsxs("select",{value:b,onChange:x=>k(x.target.value),className:"px-2 py-1 text-xs border rounded",children:[jsxRuntime.jsx("option",{value:"HEX",children:"HEX"}),jsxRuntime.jsx("option",{value:"RGB",children:"RGB"}),jsxRuntime.jsx("option",{value:"RGBA",children:"RGBA"})]}),b==="HEX"&&jsxRuntime.jsx("input",{value:P,onChange:x=>{let H=x.target.value.toUpperCase().replace(/[^0-9A-F#]/g,"");H.startsWith("#")||(H="#"+H),H="#"+H.slice(1,7),F(H),/^#[0-9A-F]{6}$/.test(H)&&B(H);},className:"flex-1 px-2 py-1 text-xs font-mono border rounded",placeholder:"#000000"}),(b==="RGB"||b==="RGBA")&&jsxRuntime.jsx("div",{className:"flex gap-2",children:[{l:"R",v:S,s:$},{l:"G",v:E,s:O},{l:"B",v:y,s:w}].map(({l:x,v:H,s:ce})=>jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"text-xs font-semibold",children:x}),jsxRuntime.jsx("input",{type:"number",min:0,max:255,value:H,onChange:or=>{ce(Te(+or.target.value,0,255)),B(G());},className:"w-14 px-1 py-1 text-xs border rounded"})]},x))})]}),b==="RGBA"&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs font-semibold",children:"A"}),jsxRuntime.jsx("input",{type:"range",min:0,max:1,step:.01,value:m,onChange:x=>{u(+x.target.value),B(G());},className:"flex-1"}),jsxRuntime.jsxs("span",{className:"text-xs w-10 text-right",children:[Math.round(m*100),"%"]})]}),a&&jsxRuntime.jsx("div",{className:"grid grid-cols-5 gap-1",children:o.map(x=>jsxRuntime.jsx("button",{type:"button",onClick:()=>{F(x),u(1),B(x);},className:"w-8 h-8 rounded border",style:{background:x}},x))})]}),L==="GRADIENT"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex gap-2 items-center",children:[jsxRuntime.jsx("input",{type:"color",value:T,onChange:x=>I(x.target.value)}),jsxRuntime.jsx("span",{className:"text-xs",children:"\u2192"}),jsxRuntime.jsx("input",{type:"color",value:V,onChange:x=>_(x.target.value)})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs",children:"\xC2ngulo"}),jsxRuntime.jsx("input",{type:"range",min:0,max:360,value:j,onChange:x=>ue(+x.target.value),className:"flex-1"}),jsxRuntime.jsxs("span",{className:"text-xs w-10 text-right",children:[j,"\xB0"]})]})]})]})]}),s&&jsxRuntime.jsx(A,{children:s}),!s&&l&&jsxRuntime.jsx(D,{children:l})]})})});ht.displayName="ColorPicker";var ka=ht;var Sr=({...e})=>jsxRuntime.jsx("svg",{...e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),ve=Sr;var Or=(e,t)=>{vr.useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},yt=Or;function ke({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:a,typeSet:i,name:s}){let[l,f]=vr.useState([]),c=vr.useMemo(()=>new Map(e.map(C=>[String(C[r]),C])),[e,r]),h=vr.useCallback(()=>l.map(C=>c.get(C)).filter(C=>!!C),[l,c]),p=vr.useCallback(C=>{if(!o)return;let b;if(i==="field"?n?b=C:b=C[0]??void 0:n?b=C.map(P=>c.get(P)).filter(P=>P!==void 0):b=c.get(C[0]??"")??void 0,a&&!n){let k=c.get(C[0]??"");k&&a(String(k[t]));}o({target:{name:s,value:b,type:"combobox"}});},[n,o,c,s,i,a,t]),d=vr.useCallback(C=>{let b=String(C[r]),k=n?l.includes(b)?l.filter(P=>P!==b):[...l,b]:[b];f(k),p(k);},[n,l,p,r]),R=vr.useCallback(C=>{let b=l.filter(k=>k!==C);f(b),p(b);},[l,p]),L=vr.useCallback(()=>{f([]),a?.("");let C;i==="field"?C=n?[]:"":C=n?[]:void 0,o?.({target:{name:s,value:C,type:"combobox"}});},[n,o,s,a,i]);return {selectedValues:l,handleSelect:d,handleRemove:R,handleClear:L,getSelectedOptions:h}}function Ee(e,t,r){return vr.useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var Lt=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:a,filteredOptions:i,highlightedIndex:s,setHighlightedIndex:l,handleSelect:f,handleRemove:c})=>{let h=vr.useCallback(d=>{if(i.length===0){l(-1);return}l(R=>R<0?d>0?0:i.length-1:(R+d+i.length)%i.length);},[i,l]);return vr.useCallback(d=>{if(!e){if(d.key==="Enter"||d.key==="ArrowDown"){t(!0),l(0),d.preventDefault();return}r&&d.key==="Backspace"&&n===""&&a.length>0&&(d.preventDefault(),c(a[a.length-1]));return}switch(d.key){case"ArrowDown":d.preventDefault(),h(1);break;case"ArrowUp":d.preventDefault(),h(-1);break;case"Enter":d.preventDefault();let R=s>=0?s:0,L=i[R];L&&f(L),r&&o&&o(""),r||(t(!1),l(-1));break;case"Escape":d.preventDefault(),t(!1),l(-1),r||o("");break;case"Tab":t(!1),l(-1);break;case"Home":d.preventDefault(),i.length>0&&l(0);break;case"End":d.preventDefault(),i.length>0&&l(i.length-1);break;case"Backspace":r&&n===""&&a.length>0&&(d.preventDefault(),c(a[a.length-1]));break}},[e,r,n,a,i,s,t,o,l,f,c,h])};function Pt({option:e,labelKey:t,valueKey:r,onRemove:n}){let o=String(e[t]),a=String(e[r]);return jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded",children:[o,jsxRuntime.jsx("button",{type:"button",onMouseDown:i=>i.preventDefault(),onClick:()=>n(a),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${o}`,children:"\u2715"})]},a)}function _r(e,t){let{label:r,required:n=!1,name:o,placeholder:a="Buscar...",labelKey:i,valueKey:s,options:l,value:f,onChange:c,mode:h="single",typeSet:p="field",disabled:d=!1,ClearEnabled:R=!0,helperText:L,error:C=!1,className:b="",...k}=e,P=h==="multiple",[F,S]=vr.useState(!1),[$,E]=vr.useState(""),O=vr.useRef(null),y=vr.useRef(null),w=vr.useRef(null);vr.useImperativeHandle(t,()=>w.current),yt(y,()=>S(!1));let m=Ee(l,i,$),[u,T]=vr.useState(-1),{selectedValues:I,handleSelect:V,handleRemove:_,handleClear:j,getSelectedOptions:ue}=ke({options:l,labelKey:i,valueKey:s,value:f,multiple:P,onChange:c,typeSet:p,name:o,setSearchTerm:E}),ye=Lt({isOpen:F,setIsOpen:S,multiple:P,searchTerm:$,setSearchTerm:E,selectedValues:I,filteredOptions:m,highlightedIndex:u,setHighlightedIndex:T,handleSelect:V,handleRemove:_}),ne=vr.useId(),Te="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",Le=v("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",C?"border-red-500":"border-gray-300 dark:border-gray-600",d?"opacity-50 cursor-not-allowed":"cursor-text","focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500");return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${b}`,children:[r&&jsxRuntime.jsx(N,{htmlFor:ne,required:n,children:r}),jsxRuntime.jsxs("div",{ref:O,className:"relative",children:[jsxRuntime.jsxs("div",{className:Le,children:[P&&ue().length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:ue().map((B,G)=>jsxRuntime.jsx(Pt,{option:B,labelKey:i,valueKey:s,onRemove:_},String(B[s]??G)))}),jsxRuntime.jsx("input",{ref:w,...k,name:o,type:"text",placeholder:a,value:$,onChange:B=>{let G=B.target.value;E(G),!F&&G.trim()!==""&&S(!0);},onKeyDown:ye,onMouseDown:B=>{document.activeElement===w.current&&(B.preventDefault(),S(G=>{let Z=!G;return Z&&T(0),Z}));},onFocus:()=>{S(!0),T(0);},disabled:d,className:Te,role:"combobox","aria-expanded":F,"aria-controls":ne,"aria-activedescendant":u>=0?`${ne}-opt-${u}`:void 0}),R&&!!I.length&&jsxRuntime.jsx("button",{type:"button",onMouseDown:B=>B.preventDefault(),onClick:j,className:"absolute right-2 top-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700",title:"Limpar sele\xE7\xE3o",children:jsxRuntime.jsx(ve,{width:12,height:12})})]}),F&&jsxRuntime.jsx("div",{ref:y,id:ne,className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",role:"listbox","aria-multiselectable":P||void 0,children:m.length===0?jsxRuntime.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):m.map((B,G)=>{let Z=String(B[s]),x=I.includes(Z),H=G===u;return jsxRuntime.jsx("button",{id:`${ne}-opt-${G}`,"data-index":G,role:"option","aria-selected":x,type:"button",onMouseDown:ce=>ce.preventDefault(),onClick:()=>V(B),className:v("w-full px-3 py-2 text-left text-sm transition-colors",H&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!H&&x&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!x&&!H&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsxRuntime.jsx("span",{children:String(B[i])})},Z)})})]}),C&&jsxRuntime.jsx(A,{children:C}),!C&&L&&jsxRuntime.jsx(D,{children:L})]})})}function Jr(){let e=vr.forwardRef(_r);return e.displayName="ComboBox",e}var jr=Jr(),ni=jr;var Yr=({children:e,before:t,after:r,className:n})=>{let a=Zr__default.default("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},n);return jsxRuntime.jsx("div",{className:a,children:jsxRuntime.jsx("span",{children:e})})},Ve=Yr;var Qr=({children:e})=>jsxRuntime.jsx("div",{className:"absolute px-2",children:jsxRuntime.jsx("span",{children:e})}),Nt=Qr;var en=({children:e})=>jsxRuntime.jsx("div",{className:"absolute right-0 px-2",children:jsxRuntime.jsx("span",{children:e})}),Et=en;function Mt(e){e.currentTarget.maxLength=9;let t=e.currentTarget.value;return t=t.replace(/\D/g,""),t=t.replace(/^(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function Ft(e){let t=e.currentTarget.value;t=t.replace(/\D/g,""),t=t.padStart(3,"0");let r=t.slice(0,-2),n=t.slice(-2),i=`${(r.replace(/^0+/,"")||"0").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")},${n}`;return e.currentTarget.value=i,e}function It(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value;return t.match(/^(\d{3}).(\d{3}).(\d{3})-(\d{2})$/)||(t=t.replace(/\D/g,""),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2"),e.currentTarget.value=t),e}function Vt(e){e.currentTarget.maxLength=15;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function Ht(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{4})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function Dt(e){let t=e.currentTarget.value.replace(/\D/g,"");return t.length<=11?(e.currentTarget.maxLength=14,t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2")):(e.currentTarget.maxLength=18,t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2")),e.currentTarget.value=t,e}function At(e){e.currentTarget.maxLength=12;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{1})$/,"$1-$2"),e.currentTarget.value=t,e}function St(e){e.currentTarget.maxLength=18;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2"),e.currentTarget.value=t,e}var tn=({e,mask:t})=>{switch(t){case"money":return Ft(e);case"mobile":return Vt(e);case"phone":return Ht(e);case"cpfCnpj":return Dt(e);case"cpf":return It(e);case"rg":return At(e);case"cnpj":return St(e);case"cep":return Mt(e);default:return e}},$t=tn;var on=({mask:e,initialValue:t=""})=>{let[r,n]=vr.useState(t);vr.useEffect(()=>{t!==r&&n(t);},[t]);let o=vr.useCallback(i=>{let l=$t({e:i,mask:e})?.currentTarget?.value??i.currentTarget.value;n(l);},[e]),a=vr.useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:a}},Bt=on;var Gt=vr.forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:a,addonBefore:i,addonBeforeClassName:s,addonAfter:l,addonAfterClassName:f,ClearEnabled:c=!0,className:h,overrideClassName:p=!1,error:d,helperText:R,value:L=void 0,onChange:C,...b},k)=>{let P=vr.useId(),{handleChange:F,handleClear:S,setValue:$}=Bt({mask:r,initialValue:L}),E=v("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",d&&"border-destructive focus-visible:ring-destructive",!o&&!a&&"px-3",o&&!a&&"pl-10 pr-3",a&&!o&&"pl-3 pr-10",o&&a&&"pl-10 pr-10",i&&"rounded-l-none border-l-0",l&&"rounded-r-none border-r-0",h),O=w=>{F(w),C?.(w);},y=()=>{S(),$(""),C?.({target:{name:n||"",value:""}});};return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsxRuntime.jsx(N,{htmlFor:P,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative flex",children:[i&&jsxRuntime.jsx(Ve,{before:!0,className:s,children:i}),jsxRuntime.jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsxRuntime.jsx(Nt,{children:o}),jsxRuntime.jsx("input",{id:P,ref:k,name:n,onChange:O,className:p?h:E,...b}),c&&L&&jsxRuntime.jsx(ve,{onClick:y,width:12,height:12,className:v("absolute right-2 cursor-pointer",a&&"right-8")}),a&&jsxRuntime.jsx(Et,{children:a})]}),l&&jsxRuntime.jsx(Ve,{after:!0,className:f,children:l})]}),d&&jsxRuntime.jsx(A,{children:d}),!d&&R&&jsxRuntime.jsx(D,{children:R})]})})});Gt.displayName="Input";var Mi=Gt;var qt=vr.forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:a=!1,helperText:i,error:s,onChange:l,onBlur:f,className:c,charType:h="numeric",customPattern:p,caseMode:d="none",...R},L)=>{let C=vr.useId(),b=vr.useRef([]),k=m=>{switch(d){case"upper":return m.toUpperCase();case"lower":case"visual-upper":return m.toLowerCase();case"visual-lower":return m.toUpperCase();default:return m}},P=m=>{if(!m)return "";let u=m.slice(0,1);switch(u=k(u),h){case"numeric":return /\d/.test(u)?u:"";case"alpha":return /[A-Za-z]/.test(u)?u:"";case"alphanumeric":return /[A-Za-z0-9]/.test(u)?u:"";case"custom":return p?.test(u)?u:"";default:return u}},F=()=>(r!=null?String(r):"").split("").map(P).slice(0,e),S=F().concat(Array(e).fill(" ")).slice(0,e),$=m=>{let u=m.split("").map(P).join("").slice(0,e),T=u===""?void 0:typeof r=="number"?Number(u):u;l?.({target:{name:n,value:T}});},E=(m,u)=>{let T=P(u),I=F();if(T===""){I[m]="",$(I.join(""));return}if(u.length>1){let V=u.split("").map(P).join("").slice(0,e);$(V),b.current[Math.min(V.length-1,e-1)]?.focus();return}T&&(I[m]=T,$(I.join("")),m<e-1&&b.current[m+1]?.focus());},O=m=>{let u=F();!u[m]&&m>0?u[m-1]="":u[m]="",$(u.join("")),m>0&&b.current[m-1]?.focus();},y=m=>{m.preventDefault();let T=m.clipboardData.getData("text").split("").map(P).join("").slice(0,e);T&&($(T),b.current[Math.min(T.length-1,e-1)]?.focus());},w=m=>{switch(d){case"upper":case"visual-upper":return m.toUpperCase();case"lower":case"visual-lower":return m.toLowerCase();default:return m}};return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsxRuntime.jsx(N,{htmlFor:C,required:a,children:o}),jsxRuntime.jsx("div",{className:v("flex gap-3 items-center",s&&"text-red-500",c),...R,children:S.map((m,u)=>{let T=t&&u>0&&u%t===0;return jsxRuntime.jsxs(vr__default.default.Fragment,{children:[T&&jsxRuntime.jsx("span",{className:"flex items-center justify-center text-xl font-bold select-none",children:"-"}),jsxRuntime.jsx("input",{id:C,type:"text",maxLength:1,inputMode:h==="numeric"?"numeric":"text",value:w(m).trim(),ref:I=>{b.current[u]=I,u===0&&L&&(typeof L=="function"?L(I):typeof L=="object"&&(L.current=I));},onPaste:y,onChange:I=>E(u,I.target.value),onKeyDown:I=>I.key==="Backspace"&&O(u),onBlur:f,className:v("h-14 w-12 text-center text-2xl rounded-md border border-input bg-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s&&"border-red-500")})]},u)})}),s&&jsxRuntime.jsx(A,{children:s}),!s&&i&&jsxRuntime.jsx(D,{children:i})]})})});qt.displayName="OtpInput";var Oi=qt;var Kt=vr.forwardRef(({label:e,required:t,option:r,description:n,icon:o,className:a,overrideClassName:i,helperText:s,error:l,...f},c)=>{let h=vr.useId(),p=v("h-4 w-4 border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",l&&"border-destructive",a);return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"space-y-3",children:[e&&jsxRuntime.jsx(N,{required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{id:h,type:"radio",className:i?a:p,ref:c,...f}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{children:o&&o}),jsxRuntime.jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsxRuntime.jsx(N,{htmlFor:h,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsxRuntime.jsx(N,{id:`${h}-description`,htmlFor:h,className:"text-xs text-muted-foreground",children:n})]})]})]}),l&&jsxRuntime.jsx(A,{children:l}),!l&&s&&jsxRuntime.jsx(D,{children:s})]})})});Kt.displayName="Radio";var _i=Kt;function bn(e,t){let{label:r,required:n,name:o,labelKey:a,valueKey:i,options:s,alignment:l="vertical",className:f,overrideClassName:c=!1,helperText:h,error:p,typeSet:d="field",value:R,onChange:L,...C}=e,b=vr.useId(),k=vr.useMemo(()=>new Map(s.map(E=>[String(E[i]),E])),[s,i]),P=vr.useMemo(()=>R==null?"":String(d==="field"?R:R[i]),[R,d,i]),F=E=>{if(!L)return;let O;if(d==="field"){let y=k.get(E);if(y)O=y[i];else {let w=Number(E);O=Number.isNaN(w)?E:w;}}else O=k.get(E)??void 0;L({target:{name:o,value:O,type:"radiogroup",checked:!0}});},S=l==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",$=v("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",p&&"border-destructive");return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:v("flex flex-col gap-3",f),children:[r&&jsxRuntime.jsx(N,{required:n,children:r}),jsxRuntime.jsx("div",{className:S,children:s.map((E,O)=>{let y=String(E[i]),w=`${b}-${y}-${O}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...C,id:w,ref:t,name:o,type:"radio",checked:P===y,onChange:()=>F(y),className:c?f:$}),jsxRuntime.jsx(N,{htmlFor:w,children:String(E[a])})]},w)})}),p&&jsxRuntime.jsx(A,{children:String(p)}),!p&&h&&jsxRuntime.jsx(D,{children:h})]})})}function vn(){let e=vr.forwardRef(bn);return e.displayName="RadioGroup",e}var xn=vn(),as=xn;function yn({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:a,error:i,helperText:s,className:l,...f},c){let h=vr.useId(),p=v("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",i&&"border-red-500 focus-visible:ring-red-500",l);return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(N,{htmlFor:h,required:t,children:e}),jsxRuntime.jsxs("select",{id:h,ref:c,className:p,...f,children:[a&&jsxRuntime.jsx("option",{value:"",disabled:!0,children:a}),r.map((d,R)=>jsxRuntime.jsx("option",{value:String(d[o]),children:String(d[n])},R))]}),i&&jsxRuntime.jsx(A,{children:i}),!i&&s&&jsxRuntime.jsx(D,{children:s})]})})}function Tn(){let e=vr.forwardRef(yn);return e.displayName="Select",e}var Ln=Tn(),bs=Ln;var _t=vr.forwardRef(({label:e,required:t,option:r,description:n,icon:o,checked:a=!1,className:i,overrideClassName:s,error:l,name:f,...c},h)=>{let p=vr.useId();return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[e&&jsxRuntime.jsx(N,{required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:p,name:f,checked:a,className:"peer sr-only",ref:h,...c}),jsxRuntime.jsx("label",{htmlFor:p,className:v("relative flex items-center h-6 w-11 cursor-pointer rounded-full bg-input transition-colors duration-200","peer-checked:bg-primary peer-focus:ring-2 peer-focus:ring-ring peer-focus:ring-offset-2 peer-focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",i),children:jsxRuntime.jsx("span",{className:v("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",a?"translate-x-5":"translate-x-1")})}),jsxRuntime.jsx("span",{children:o&&o}),(r||n)&&jsxRuntime.jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[e&&jsxRuntime.jsx(N,{id:`${p}-label`,htmlFor:p,className:"text-sm font-medium leading-none",children:r}),n&&jsxRuntime.jsx(N,{id:`${p}-description`,htmlFor:p,className:"text-xs text-muted-foreground",children:n})]})]})]})})});_t.displayName="Switch";var Ps=_t;var Jt=vr__default.default.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:a=!1,error:i,helperText:s,...l},f)=>{let c=vr.useId(),[h,p]=vr.useState(0),d=v("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",i&&"border-red-500 focus-visible:ring-red-500",o);return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(N,{htmlFor:c,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("textarea",{id:c,className:a?o:d,maxLength:n,onInput:R=>p(R.currentTarget.textLength),ref:f,...l}),r&&jsxRuntime.jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[h,n?` / ${n}`:""]})]}),i&&jsxRuntime.jsx(A,{children:i}),!i&&s&&jsxRuntime.jsx(D,{children:s})]})})});Jt.displayName="TextArea";var Vs=Jt;var En=({files:e,removeFile:t})=>jsxRuntime.jsx("div",{className:"space-y-2",children:e?.length>0&&e?.map((r,n)=>jsxRuntime.jsxs("div",{className:"flex items-center justify-between p-2 bg-secondary rounded",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm truncate",children:r.name}),jsxRuntime.jsxs("p",{className:"text-xs text-muted-foreground",children:[(r?.size/1024).toFixed(1)," KB"]})]}),jsxRuntime.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),t(n);},className:"ml-2 p-1 hover:bg-destructive/20 rounded",children:"\u2715"})]},`${r?.name}-${n}`))}),jt=En;var Mn=({accept:e,maxSize:t})=>jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("svg",{className:"w-8 h-8 mx-auto text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm text-foreground",children:"Clique para selecionar ou arraste arquivos aqui"}),jsxRuntime.jsxs("p",{className:"text-xs text-muted-foreground",children:[e&&`Tipos aceitos: ${e}`,t&&` \u2022 Tamanho m\xE1ximo: ${t}MB`]})]})]}),Zt=Mn;var Yt=({files:e,setFiles:t,multiple:r=!1,disabled:n=!1,filterFiles:o=a=>a})=>{let a=vr.useRef(null),[i,s]=vr.useState(!1),l=vr.useCallback(p=>{p.preventDefault(),!n&&s(!0);},[n]),f=vr.useCallback(()=>{s(!1);},[]),c=vr.useCallback(p=>{if(p.preventDefault(),n||!a.current)return;s(!1);let d=Array.from(p.dataTransfer.files);if(!r&&!e||!r&&d.length>1)return;let R=o(d),L=r?R:R.slice(0,1);t(L);let C=new DataTransfer;L.forEach(b=>C.items.add(b)),a.current.files=C.files,a.current.dispatchEvent(new Event("change",{bubbles:!0}));},[n,r,e,o]),h=vr.useCallback(()=>{t([]),a.current&&(a.current.value="");},[]);return {files:e,setFiles:t,clearFiles:h,inputRef:a,isDragOver:i,setIsDragOver:s,handleDrop:c,handleDragOver:l,handleDragLeave:f}};var Qt=({files:e,setFiles:t,inputRef:r})=>({removeFile:vr.useCallback(o=>{if(!r.current)return;let a=e?.filter((s,l)=>l!==o);t(a);let i=new DataTransfer;a?.forEach(s=>i.items.add(s)),r.current.files=i.files,r.current.dispatchEvent(new Event("change",{bubbles:!0}));},[e,t,r])});var Dn=({previews:e,onRemove:t})=>{let[r,n]=vr.useState(0),o=()=>n(i=>i===0?e?.length-1:i-1),a=()=>n(i=>i===e?.length-1?0:i+1);return jsxRuntime.jsxs("div",{className:"relative w-full h-56 rounded-lg overflow-hidden bg-black/5",children:[jsxRuntime.jsx("img",{src:e[r]?.url,alt:e[r]?.file?.name,className:"w-full h-full object-cover"}),e.length>1&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",onClick:o,className:"absolute left-2 top-1/2 -translate-y-1/2 bg-black/50 text-white px-2 py-1 rounded",children:"\u2039"}),jsxRuntime.jsx("button",{type:"button",onClick:a,className:"absolute right-2 top-1/2 -translate-y-1/2 bg-black/50 text-white px-2 py-1 rounded",children:"\u203A"})]}),jsxRuntime.jsx("button",{type:"button",onClick:()=>t(r),className:"absolute top-2 right-2 bg-red-500 text-white rounded px-2 py-1",children:"\u2715"})]})},tr=Dn;var nr=vr.forwardRef(({label:e,required:t,accept:r,renderFiles:n,preview:o=!1,multiple:a=!1,maxSize:i=10,disabled:s=!1,error:l=!1,helperText:f,className:c,name:h,onChange:p,onBlur:d,...R},L)=>{let C=vr.useId(),[b,k]=vr.useState([]),P=1024*1024,F=V=>V.filter(_=>(!i||_.size<=i*P)&&(!r||_.type.match(r))),{inputRef:S,isDragOver:$,handleDrop:E,handleDragOver:O,handleDragLeave:y}=Yt({files:b,setFiles:k,multiple:a,filterFiles:F}),{removeFile:w}=Qt({files:b,setFiles:k,inputRef:S}),m=V=>{S.current=V,typeof L=="function"?L(V):L&&(L.current=V);},u=V=>{let _=Array.from(V.target.files??[]);if(!_.length)return;let j=F(_);k(a?j:j.slice(0,1)),p?.(V);},T=vr.useMemo(()=>!o||!b||!b.length?[]:b.filter(V=>V.type.startsWith("image/")).map(V=>({file:V,url:URL.createObjectURL(V)})),[b,o]);vr.useEffect(()=>()=>T.forEach(V=>URL.revokeObjectURL(V.url)),[T]);let I=o&&T.length>0;return jsxRuntime.jsx(g,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${c}`,children:[e&&jsxRuntime.jsx(N,{htmlFor:C,required:t,children:e}),jsxRuntime.jsxs("div",{onDrop:E,onDragOver:O,onDragLeave:y,onClick:()=>{!s&&!I&&S.current?.click();},className:`
|
|
33
33
|
border-2 border-dashed rounded-lg p-6 text-center cursor-pointer
|
|
34
34
|
transition-colors
|
|
35
35
|
${$?"border-primary bg-primary/5":"border-border"}
|
package/dist/page.mjs
CHANGED
|
@@ -22,7 +22,7 @@ Pode me ajudar?
|
|
|
22
22
|
`,n=`https://wa.me/${e}?text=${encodeURIComponent(r)}`;window.open(n,"_blank");};var We=createContext(void 0),lr=({children:e,licenseKey:t})=>{let[r,n]=useState(!1),[o,a]=useState(null),[i,s]=useState(!0),l=f=>{if(a(null),!f)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let c="chave-secreta-123";if(f!==c)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");n(!0);};return useEffect(()=>{if(t){s(!0);try{l(t);}catch(f){a(f instanceof Error?f.message:"Erro desconhecido na valida\xE7\xE3o da licen\xE7a");}finally{s(!1);}}else a("\u{1F512} Licen\xE7a n\xE3o informada"),s(!1);},[t]),i?null:jsx(We.Provider,{value:{isLicenseValid:r,validateLicense:l,licenseError:o},children:r?e:jsx(Ue,{badge:"Licen\xE7a necess\xE1ria",title:"Erro de Licen\xE7a",message:o||"Licen\xE7a inv\xE1lida",description:"Sua aplica\xE7\xE3o precisa de uma licen\xE7a v\xE1lida para continuar.",actions:[{label:"Tentar novamente",onClick:()=>window.location.reload()},{label:"Falar no WhatsApp",variant:"secondary",onClick:()=>Ke("5544998204407",o)},{label:"Enviar e-mail",variant:"secondary",onClick:()=>qe("marcos.vinicius.engsof@gmail.com",o)}]})})},Xe=()=>{let e=useContext(We);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var Je=({message:e="Component locked - Please validate your license"})=>jsxs("div",{className:"flex items-start p-4 bg-red-50 border border-red-500 text-red-700 rounded-md gap-2",children:[jsx("span",{children:" \u274C Component locked - Please validate your license"}),jsx("span",{children:e})]});var g=({children:e})=>{let{isLicenseValid:t}=Xe();return t?jsx(Fragment,{children:e}):jsx(Je,{})};var Ye=({items:e,type:t="single",defaultValue:r,value:n,onValueChange:o,className:a=""})=>{let i=c=>c===void 0?[]:Array.isArray(c)?c:[c],[s,l]=useState(i(n??r));useEffect(()=>{n!==void 0&&l(i(n));},[n]);let f=useCallback(c=>{l(h=>{let p;return t==="single"?p=h.includes(c)?[]:[c]:p=h.includes(c)?h.filter(d=>d!==c):[...h,c],o?.(t==="single"?p[0]??"":p),p});},[t,o]);return jsx("div",{className:`space-y-2 ${a}`,children:e.map(c=>jsx(fr,{...c,isOpen:s.includes(c.id),onToggle:()=>f(c.id)},c.id))})},fr=({title:e,content:t,disabled:r=!1,isOpen:n,onToggle:o})=>jsx(g,{children:jsxs("div",{className:"border border-border rounded-md overflow-hidden",children:[jsx("button",{onClick:o,disabled:r,className:`w-full px-4 py-3 text-left font-medium transition-colors
|
|
23
23
|
${r?"opacity-50 cursor-not-allowed":"hover:bg-accent hover:text-accent-foreground"}
|
|
24
24
|
${n?"bg-accent text-accent-foreground":"bg-background text-foreground"}
|
|
25
|
-
`,children:jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{children:e}),jsx("svg",{className:`w-5 h-5 transition-transform ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}),n&&jsx("div",{className:"px-4 py-3 bg-background border-t border-border",children:t})]})});Ye.displayName="Accordion";var lo=Ye;function v(...e){return twMerge(clsx(e))}var Qe=vr.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:a,loading:i=!1,loadingContent:s,...l},f)=>{let c="inline-flex items-center justify-center rounded-lg font-medium cursor-pointer active:translate-y-1 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",h={primary:"bg-blue-600 text-white hover:bg-blue-700 shadow-md focus-visible:ring-blue-500",secondary:"bg-gray-600 text-white hover:bg-gray-700 shadow-sm focus-visible:ring-gray-500",tertiary:"bg-purple-600 text-white hover:bg-purple-700 shadow-sm focus-visible:ring-purple-500",destructive:"bg-red-600 text-white hover:bg-red-700 shadow-sm focus-visible:ring-red-500",success:"bg-green-600 text-white hover:bg-green-700 shadow-sm focus-visible:ring-green-500",warning:"bg-amber-500 text-white hover:bg-amber-600 shadow-sm focus-visible:ring-amber-500",info:"bg-cyan-600 text-white hover:bg-cyan-700 shadow-sm focus-visible:ring-cyan-500",accent:"bg-violet-600 text-white hover:bg-violet-700 shadow-sm focus-visible:ring-violet-500",outline:"border border-gray-300 bg-transparent text-gray-700 hover:bg-gray-50 shadow-sm focus-visible:ring-gray-500",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus-visible:ring-gray-500",link:"text-blue-600 underline-offset-4 hover:underline bg-transparent p-0 h-auto shadow-none",gradient:"bg-gradient-to-r from-blue-600 to-purple-600 text-white hover:from-blue-700 hover:to-purple-700 shadow-md focus-visible:ring-blue-500",glass:"bg-white/10 backdrop-blur-md border border-white/20 text-black hover:bg-white/20 shadow-sm focus-visible:ring-white/50",soft:"bg-blue-100 text-blue-700 hover:bg-blue-200 shadow-sm focus-visible:ring-blue-500",dark:"bg-gray-900 text-white hover:bg-gray-800 shadow-md focus-visible:ring-gray-500",light:"bg-gray-100 text-gray-900 hover:bg-gray-200 shadow-sm focus-visible:ring-gray-500",obsidian:"bg-black text-white hover:bg-gray-900 shadow-md border border-gray-800 focus-visible:ring-gray-700",polar:"bg-white text-gray-900 hover:bg-gray-50 shadow-md border border-gray-300 focus-visible:ring-gray-400"},p={xs:"h-7 px-2 text-xs min-w-16",sm:"h-9 px-3 text-sm min-w-20",md:"h-10 px-4 py-2 text-base min-w-24",lg:"h-11 px-6 text-lg min-w-28",xl:"h-12 px-8 text-xl min-w-32"},d=t?e:v(c,h[r],p[n],e);return o?jsx(g,{children:jsx("a",{href:o,className:d,ref:f,children:i&&s?s:a})}):jsx(g,{children:jsx("button",{className:d,ref:f,...l,children:i&&s?s:a})})});Qe.displayName="Button";var xo=Qe;var et=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("div",{ref:o,className:t?e:v("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r})}));et.displayName="Card";var tt=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("div",{ref:o,className:t?e:v("flex flex-col space-y-1.5 p-6",e),...n,children:r})}));tt.displayName="CardHeader";var rt=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("h3",{ref:o,className:t?e:v("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r})}));rt.displayName="CardTitle";var nt=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("p",{ref:o,className:t?e:v("text-sm text-muted-foreground",e),...n,children:r})}));nt.displayName="CardDescription";var ot=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("div",{ref:o,className:t?e:v("p-6 pt-0",e),...n,children:r})}));ot.displayName="CardContent";var at=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("div",{ref:o,className:t?e:v("flex items-center p-6 pt-0",e),...n,children:r})}));at.displayName="CardFooter";var Ro=et,wo=tt,No=rt,ko=nt,Eo=ot,Mo=at;var ge=createContext(void 0),st=forwardRef(({children:e,className:t,...r},n)=>{let[o,a]=useState(!1);return jsx(g,{children:jsx(ge.Provider,{value:{isOpen:o,setIsOpen:a},children:jsx("div",{ref:n,className:v("relative inline-block",t),...r,children:e})})})});st.displayName="DropdownMenu";var lt=({children:e,asChild:t})=>{let r=useContext(ge);if(!r)throw new Error("DropdownMenuTrigger must be used within DropdownMenu");let n=()=>r.setIsOpen(!r.isOpen);if(t){let o=e;return cloneElement(o,{onClick:a=>{o.props.onClick?.(a),n();}})}return jsx(g,{children:jsx("button",{onClick:n,children:e})})};lt.displayName="DropdownMenuTrigger";var ct=forwardRef(({children:e,align:t="end",className:r,...n},o)=>{let a=useContext(ge),i=useRef(null);return useEffect(()=>{o&&(typeof o=="function"?o(i.current):o.current=i.current);},[o]),useEffect(()=>{let l=f=>{i.current&&!i.current.contains(f.target)&&a?.setIsOpen(!1);};return a?.isOpen&&document.addEventListener("mousedown",l),()=>{document.removeEventListener("mousedown",l);}},[a?.isOpen]),a?.isOpen?jsx(g,{children:jsx("div",{ref:i,className:v("absolute z-50 mt-2 min-w-32 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md",{start:"left-0",center:"left-1/2 -translate-x-1/2",end:"right-0"}[t],r),...n,children:e})}):null});ct.displayName="DropdownMenuContent";var dt=forwardRef(({children:e,onClick:t,destructive:r,className:n,...o},a)=>{let i=useContext(ge);return jsx(g,{children:jsx("button",{ref:a,onClick:l=>{t?.(l),i?.setIsOpen(!1);},className:v("w-full text-left px-4 py-2 text-sm hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none",r&&"text-red-600 hover:bg-red-50 hover:text-red-700 focus:bg-red-50 focus:text-red-700",n),...o,children:e})})});dt.displayName="DropdownMenuItem";var pt=forwardRef(({className:e,...t},r)=>jsx(g,{children:jsx("div",{ref:r,className:v("-mx-1 my-1 h-px bg-border",e),...t})}));pt.displayName="DropdownMenuSeparator";var mt=forwardRef(({children:e,className:t,...r},n)=>jsx(g,{children:jsx("div",{ref:n,className:v("px-2 py-1.5 text-sm font-semibold",t),...r,children:e})}));mt.displayName="DropdownMenuLabel";var So=st,$o=lt,Oo=ct,Bo=dt,Go=pt,Uo=mt;var Tr=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx(g,{children:jsx("p",{className:r?t:v("text-sm text-muted-foreground",t),children:e})})},D=Tr;var Lr=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsx(g,{children:jsxs("div",{className:"flex items-center gap-1",children:[jsx("label",{...o,className:n?r:v("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),children:e}),t&&jsx("span",{className:"text-red-600",children:"*"})]})}),N=Lr;var Rr=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx(g,{children:jsx("p",{className:r?t:v("text-sm text-red-600 dark:text-red-400",t),children:e})})},A=Rr;var gt=forwardRef(({label:e,required:t,option:r,description:n,icon:o,orientation:a="left",className:i,overrideClassName:s=!1,helperText:l,error:f,...c},h)=>{let p=useId(),d=v("h-4 w-4 rounded border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",f&&"border-destructive",i);return jsx(g,{children:jsxs("div",{className:"space-y-2 w-fit",children:[e&&jsx(N,{required:t,children:e}),jsxs("div",{className:`flex items-center ${a=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsx("input",{id:p,type:"checkbox",className:s?i:d,ref:h,...c}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{children:o&&o}),jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsx(N,{htmlFor:p,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsx(N,{id:`${p}-description`,htmlFor:p,className:"text-xs text-muted-foreground",children:n})]})]})]}),f&&jsx(A,{children:f}),!f&&l&&jsx(D,{children:l})]})})});gt.displayName="CheckBox";var ca=gt;function Mr(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:a,labelKey:i,valueKey:s,options:l,alignment:f="vertical",className:c,overrideClassName:h=!1,helperText:p,error:d,label:R,name:L,required:C,...b}=e,k=useId(),P=useMemo(()=>new Map(l.map(y=>[String(y[s]),y])),[l,s]),F=useMemo(()=>o==null?[]:r==="field"?n?o.map(y=>String(y)):[String(o)]:n?o.map(y=>String(y[s])):[String(o[s])],[o,r,n,s]),S=(y,w)=>{if(!a)return;let m;if(r==="field")if(n)m=y.map(T=>{let I=P.get(T);return I?I[s]:T});else {let u=y[0];if(!u)m=void 0;else {let T=P.get(u);m=T?T[s]:u;}}else n?m=y.map(T=>P.get(T)).filter(T=>T!==void 0):m=P.get(y[0]??"")??void 0;a({target:{name:L,value:m,type:"checkboxgroup",checked:w}});},$=y=>{let w;n?w=F.includes(y)?F.filter(m=>m!==y):[...F,y]:w=F[0]===y?[]:[y],S(w,w.includes(y));},E=f==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",O=v("h-4 w-4 rounded border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",d&&"border-destructive");return jsx(g,{children:jsxs("div",{className:v("flex flex-col gap-3",c),children:[R&&jsx(N,{required:C,children:R}),jsx("div",{className:E,children:l.map((y,w)=>{let m=String(y[s]),u=F.includes(m),T=`${k}-${m}-${w}`;return jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{...b,id:T,ref:t,type:"checkbox",name:L,checked:u,onChange:()=>$(m),className:h?c:O}),jsx(N,{htmlFor:T,children:String(y[i])})]},T)})}),!!d&&jsx(A,{children:String(d)}),!d&&p&&jsx(D,{children:p})]})})}function Fr(){let e=forwardRef(Mr);return e.displayName="CheckBoxGroup",e}var Ir=Fr(),Ca=Ir;var Ar=["#000000","#ffffff","#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ffa500","#800080","#ffc0cb","#a52a2a","#808080","#000080","#008000"],ht=vr.forwardRef(({label:e,required:t,onChange:r,disabled:n=!1,presetColors:o=Ar,showPresets:a=!0,className:i,error:s,helperText:l,name:f},c)=>{let h=useId(),p=useRef(null),[d,R]=useState(!1),[L,C]=useState("COLOR"),[b,k]=useState("HEX"),[P,F]=useState("#000000"),[S,$]=useState(0),[E,O]=useState(0),[y,w]=useState(0),[m,u]=useState(1),[T,I]=useState("#000000"),[V,_]=useState("#ffffff"),[j,ue]=useState(90),[ye,ne]=useState("linear-gradient(90deg, #000000, #ffffff)"),Te=(x,H,ce)=>Math.min(ce,Math.max(H,x)),Le=x=>{let H=x.replace("#","");return {r:parseInt(H.slice(0,2),16),g:parseInt(H.slice(2,4),16),b:parseInt(H.slice(4,6),16)}},B=x=>{r?.({target:{value:x,name:f}});};useEffect(()=>{let x=H=>{p.current&&!p.current.contains(H.target)&&R(!1);};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[]),useEffect(()=>{if(/^#[0-9A-F]{6}$/i.test(P)){let x=Le(P);$(x.r),O(x.g),w(x.b);}},[P]),useEffect(()=>{let x=`linear-gradient(${j}deg, ${T}, ${V})`;ne(x),L==="GRADIENT"&&B(x);},[T,V,j]);let G=()=>{if(m>=1){if(b==="HEX")return P;if(b==="RGB")return `rgb(${S}, ${E}, ${y})`}return `rgba(${S}, ${E}, ${y}, ${Number(m.toFixed(2))})`},Z=L==="GRADIENT"?ye:G();return jsx(g,{children:jsxs("div",{className:`space-y-2 ${i??""}`,children:[e&&jsx(N,{htmlFor:h,required:t,children:e}),jsxs("div",{ref:p,className:"relative",children:[jsxs("button",{type:"button",onClick:()=>!n&&R(!d),className:"flex items-center gap-2 px-3 py-2 border rounded-md bg-background w-full",children:[jsx("div",{className:"w-6 h-6 rounded border",style:{background:Z}}),jsx("span",{className:"text-xs font-mono truncate",children:Z})]}),d&&jsxs("div",{className:"absolute z-50 mt-1 w-85 bg-popover border rounded-md p-4 space-y-3 shadow-lg",children:[jsx("div",{className:"flex gap-2",children:["COLOR","GRADIENT"].map(x=>jsx("button",{type:"button",onClick:()=>C(x),className:`px-2 py-1 text-xs rounded ${L===x?"bg-primary text-white":"border"}`,children:x==="COLOR"?"Cor":"Gradiente"},x))}),jsx("div",{className:"w-full h-10 rounded border",style:{background:Z}}),L==="COLOR"&&jsxs(Fragment,{children:[jsx("input",{ref:c,type:"color",value:P,onChange:x=>{F(x.target.value.toUpperCase()),B(G());},className:"w-full h-10 rounded"}),jsxs("div",{className:"flex gap-2 items-center",children:[jsxs("select",{value:b,onChange:x=>k(x.target.value),className:"px-2 py-1 text-xs border rounded",children:[jsx("option",{value:"HEX",children:"HEX"}),jsx("option",{value:"RGB",children:"RGB"}),jsx("option",{value:"RGBA",children:"RGBA"})]}),b==="HEX"&&jsx("input",{value:P,onChange:x=>{let H=x.target.value.toUpperCase().replace(/[^0-9A-F#]/g,"");H.startsWith("#")||(H="#"+H),H="#"+H.slice(1,7),F(H),/^#[0-9A-F]{6}$/.test(H)&&B(H);},className:"flex-1 px-2 py-1 text-xs font-mono border rounded",placeholder:"#000000"}),(b==="RGB"||b==="RGBA")&&jsx("div",{className:"flex gap-2",children:[{l:"R",v:S,s:$},{l:"G",v:E,s:O},{l:"B",v:y,s:w}].map(({l:x,v:H,s:ce})=>jsxs("div",{className:"flex items-center gap-1",children:[jsx("span",{className:"text-xs font-semibold",children:x}),jsx("input",{type:"number",min:0,max:255,value:H,onChange:or=>{ce(Te(+or.target.value,0,255)),B(G());},className:"w-14 px-1 py-1 text-xs border rounded"})]},x))})]}),b==="RGBA"&&jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-xs font-semibold",children:"A"}),jsx("input",{type:"range",min:0,max:1,step:.01,value:m,onChange:x=>{u(+x.target.value),B(G());},className:"flex-1"}),jsxs("span",{className:"text-xs w-10 text-right",children:[Math.round(m*100),"%"]})]}),a&&jsx("div",{className:"grid grid-cols-5 gap-1",children:o.map(x=>jsx("button",{type:"button",onClick:()=>{F(x),u(1),B(x);},className:"w-8 h-8 rounded border",style:{background:x}},x))})]}),L==="GRADIENT"&&jsxs(Fragment,{children:[jsxs("div",{className:"flex gap-2 items-center",children:[jsx("input",{type:"color",value:T,onChange:x=>I(x.target.value)}),jsx("span",{className:"text-xs",children:"\u2192"}),jsx("input",{type:"color",value:V,onChange:x=>_(x.target.value)})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-xs",children:"\xC2ngulo"}),jsx("input",{type:"range",min:0,max:360,value:j,onChange:x=>ue(+x.target.value),className:"flex-1"}),jsxs("span",{className:"text-xs w-10 text-right",children:[j,"\xB0"]})]})]})]})]}),s&&jsx(A,{children:s}),!s&&l&&jsx(D,{children:l})]})})});ht.displayName="ColorPicker";var ka=ht;var Sr=({...e})=>jsx("svg",{...e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),ve=Sr;var Or=(e,t)=>{useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},yt=Or;function ke({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:a,typeSet:i,name:s}){let[l,f]=useState([]),c=useMemo(()=>new Map(e.map(C=>[String(C[r]),C])),[e,r]),h=useCallback(()=>l.map(C=>c.get(C)).filter(C=>!!C),[l,c]),p=useCallback(C=>{if(!o)return;let b;if(i==="field"?n?b=C:b=C[0]??void 0:n?b=C.map(P=>c.get(P)).filter(P=>P!==void 0):b=c.get(C[0]??"")??void 0,a&&!n){let k=c.get(C[0]??"");k&&a(String(k[t]));}o({target:{name:s,value:b,type:"combobox"}});},[n,o,c,s,i,a,t]),d=useCallback(C=>{let b=String(C[r]),k=n?l.includes(b)?l.filter(P=>P!==b):[...l,b]:[b];f(k),p(k);},[n,l,p,r]),R=useCallback(C=>{let b=l.filter(k=>k!==C);f(b),p(b);},[l,p]),L=useCallback(()=>{f([]),a?.("");let C;i==="field"?C=n?[]:"":C=n?[]:void 0,o?.({target:{name:s,value:C,type:"combobox"}});},[n,o,s,a,i]);return {selectedValues:l,handleSelect:d,handleRemove:R,handleClear:L,getSelectedOptions:h}}function Ee(e,t,r){return useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var Lt=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:a,filteredOptions:i,highlightedIndex:s,setHighlightedIndex:l,handleSelect:f,handleRemove:c})=>{let h=useCallback(d=>{if(i.length===0){l(-1);return}l(R=>R<0?d>0?0:i.length-1:(R+d+i.length)%i.length);},[i,l]);return useCallback(d=>{if(!e){if(d.key==="Enter"||d.key==="ArrowDown"){t(!0),l(0),d.preventDefault();return}r&&d.key==="Backspace"&&n===""&&a.length>0&&(d.preventDefault(),c(a[a.length-1]));return}switch(d.key){case"ArrowDown":d.preventDefault(),h(1);break;case"ArrowUp":d.preventDefault(),h(-1);break;case"Enter":d.preventDefault();let R=s>=0?s:0,L=i[R];L&&f(L),r&&o&&o(""),r||(t(!1),l(-1));break;case"Escape":d.preventDefault(),t(!1),l(-1),r||o("");break;case"Tab":t(!1),l(-1);break;case"Home":d.preventDefault(),i.length>0&&l(0);break;case"End":d.preventDefault(),i.length>0&&l(i.length-1);break;case"Backspace":r&&n===""&&a.length>0&&(d.preventDefault(),c(a[a.length-1]));break}},[e,r,n,a,i,s,t,o,l,f,c,h])};function Pt({option:e,labelKey:t,valueKey:r,onRemove:n}){let o=String(e[t]),a=String(e[r]);return jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded",children:[o,jsx("button",{type:"button",onMouseDown:i=>i.preventDefault(),onClick:()=>n(a),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${o}`,children:"\u2715"})]},a)}function _r(e,t){let{label:r,required:n=!1,name:o,placeholder:a="Buscar...",labelKey:i,valueKey:s,options:l,value:f,onChange:c,mode:h="single",typeSet:p="field",disabled:d=!1,ClearEnabled:R=!0,helperText:L,error:C=!1,className:b="",...k}=e,P=h==="multiple",[F,S]=useState(!1),[$,E]=useState(""),O=useRef(null),y=useRef(null),w=useRef(null);useImperativeHandle(t,()=>w.current),yt(y,()=>S(!1));let m=Ee(l,i,$),[u,T]=useState(-1),{selectedValues:I,handleSelect:V,handleRemove:_,handleClear:j,getSelectedOptions:ue}=ke({options:l,labelKey:i,valueKey:s,value:f,multiple:P,onChange:c,typeSet:p,name:o,setSearchTerm:E}),ye=Lt({isOpen:F,setIsOpen:S,multiple:P,searchTerm:$,setSearchTerm:E,selectedValues:I,filteredOptions:m,highlightedIndex:u,setHighlightedIndex:T,handleSelect:V,handleRemove:_}),ne=useId(),Te="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",Le=v("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",C?"border-red-500":"border-gray-300 dark:border-gray-600",d?"opacity-50 cursor-not-allowed":"cursor-text","focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500");return jsx(g,{children:jsxs("div",{className:`space-y-2 ${b}`,children:[r&&jsx(N,{htmlFor:ne,required:n,children:r}),jsxs("div",{ref:O,className:"relative",children:[jsxs("div",{className:Le,children:[P&&ue().length>0&&jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:ue().map((B,G)=>jsx(Pt,{option:B,labelKey:i,valueKey:s,onRemove:_},String(B[s]??G)))}),jsx("input",{ref:w,...k,name:o,type:"text",placeholder:a,value:$,onChange:B=>{let G=B.target.value;E(G),!F&&G.trim()!==""&&S(!0);},onKeyDown:ye,onMouseDown:B=>{document.activeElement===w.current&&(B.preventDefault(),S(G=>{let Z=!G;return Z&&T(0),Z}));},onFocus:()=>{S(!0),T(0);},disabled:d,className:Te,role:"combobox","aria-expanded":F,"aria-controls":ne,"aria-activedescendant":u>=0?`${ne}-opt-${u}`:void 0}),R&&!!I.length&&jsx("button",{type:"button",onMouseDown:B=>B.preventDefault(),onClick:j,className:"absolute right-2 top-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700",title:"Limpar sele\xE7\xE3o",children:jsx(ve,{width:12,height:12})})]}),F&&jsx("div",{ref:y,id:ne,className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",role:"listbox","aria-multiselectable":P||void 0,children:m.length===0?jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):m.map((B,G)=>{let Z=String(B[s]),x=I.includes(Z),H=G===u;return jsx("button",{id:`${ne}-opt-${G}`,"data-index":G,role:"option","aria-selected":x,type:"button",onMouseDown:ce=>ce.preventDefault(),onClick:()=>V(B),className:v("w-full px-3 py-2 text-left text-sm transition-colors",H&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!H&&x&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!x&&!H&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsx("span",{children:String(B[i])})},Z)})})]}),C&&jsx(A,{children:C}),!C&&L&&jsx(D,{children:L})]})})}function Jr(){let e=forwardRef(_r);return e.displayName="ComboBox",e}var jr=Jr(),ni=jr;var Yr=({children:e,before:t,after:r,className:n})=>{let a=Zr("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},n);return jsx("div",{className:a,children:jsx("span",{children:e})})},Ve=Yr;var Qr=({children:e})=>jsx("div",{className:"absolute px-2",children:jsx("span",{children:e})}),Nt=Qr;var en=({children:e})=>jsx("div",{className:"absolute right-0 px-2",children:jsx("span",{children:e})}),Et=en;function Mt(e){e.currentTarget.maxLength=9;let t=e.currentTarget.value;return t=t.replace(/\D/g,""),t=t.replace(/^(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function Ft(e){let t=e.currentTarget.value;t=t.replace(/\D/g,""),t=t.padStart(3,"0");let r=t.slice(0,-2),n=t.slice(-2),i=`${(r.replace(/^0+/,"")||"0").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")},${n}`;return e.currentTarget.value=i,e}function It(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value;return t.match(/^(\d{3}).(\d{3}).(\d{3})-(\d{2})$/)||(t=t.replace(/\D/g,""),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2"),e.currentTarget.value=t),e}function Vt(e){e.currentTarget.maxLength=15;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function Ht(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{4})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function Dt(e){let t=e.currentTarget.value.replace(/\D/g,"");return t.length<=11?(e.currentTarget.maxLength=14,t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2")):(e.currentTarget.maxLength=18,t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2")),e.currentTarget.value=t,e}function At(e){e.currentTarget.maxLength=12;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{1})$/,"$1-$2"),e.currentTarget.value=t,e}function St(e){e.currentTarget.maxLength=18;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2"),e.currentTarget.value=t,e}var tn=({e,mask:t})=>{switch(t){case"money":return Ft(e);case"mobile":return Vt(e);case"phone":return Ht(e);case"cpfCnpj":return Dt(e);case"cpf":return It(e);case"rg":return At(e);case"cnpj":return St(e);case"cep":return Mt(e);default:return e}},$t=tn;var on=({mask:e,initialValue:t=""})=>{let[r,n]=useState(t);useEffect(()=>{t!==r&&n(t);},[t]);let o=useCallback(i=>{let l=$t({e:i,mask:e})?.currentTarget?.value??i.currentTarget.value;n(l);},[e]),a=useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:a}},Bt=on;var Gt=forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:a,addonBefore:i,addonBeforeClassName:s,addonAfter:l,addonAfterClassName:f,ClearEnabled:c=!0,className:h,overrideClassName:p=!1,error:d,helperText:R,value:L=void 0,onChange:C,...b},k)=>{let P=useId(),{handleChange:F,handleClear:S,setValue:$}=Bt({mask:r,initialValue:L}),E=v("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",d&&"border-destructive focus-visible:ring-destructive",!o&&!a&&"px-3",o&&!a&&"pl-10 pr-3",a&&!o&&"pl-3 pr-10",o&&a&&"pl-10 pr-10",i&&"rounded-l-none border-l-0",l&&"rounded-r-none border-r-0",h),O=w=>{F(w),C?.(w);},y=()=>{S(),$(""),C?.({target:{name:n||"",value:""}});};return jsx(g,{children:jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsx(N,{htmlFor:P,required:t,children:e}),jsxs("div",{className:"relative flex",children:[i&&jsx(Ve,{before:!0,className:s,children:i}),jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsx(Nt,{children:o}),jsx("input",{id:P,ref:k,name:n,onChange:O,className:p?h:E,...b}),c&&L&&jsx(ve,{onClick:y,width:12,height:12,className:v("absolute right-2 cursor-pointer",a&&"right-8")}),a&&jsx(Et,{children:a})]}),l&&jsx(Ve,{after:!0,className:f,children:l})]}),d&&jsx(A,{children:d}),!d&&R&&jsx(D,{children:R})]})})});Gt.displayName="Input";var Mi=Gt;var qt=forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:a=!1,helperText:i,error:s,onChange:l,onBlur:f,className:c,charType:h="numeric",customPattern:p,caseMode:d="none",...R},L)=>{let C=useId(),b=useRef([]),k=m=>{switch(d){case"upper":return m.toUpperCase();case"lower":case"visual-upper":return m.toLowerCase();case"visual-lower":return m.toUpperCase();default:return m}},P=m=>{if(!m)return "";let u=m.slice(0,1);switch(u=k(u),h){case"numeric":return /\d/.test(u)?u:"";case"alpha":return /[A-Za-z]/.test(u)?u:"";case"alphanumeric":return /[A-Za-z0-9]/.test(u)?u:"";case"custom":return p?.test(u)?u:"";default:return u}},F=()=>(r!=null?String(r):"").split("").map(P).slice(0,e),S=F().concat(Array(e).fill(" ")).slice(0,e),$=m=>{let u=m.split("").map(P).join("").slice(0,e),T=u===""?void 0:typeof r=="number"?Number(u):u;l?.({target:{name:n,value:T}});},E=(m,u)=>{let T=P(u),I=F();if(T===""){I[m]="",$(I.join(""));return}if(u.length>1){let V=u.split("").map(P).join("").slice(0,e);$(V),b.current[Math.min(V.length-1,e-1)]?.focus();return}T&&(I[m]=T,$(I.join("")),m<e-1&&b.current[m+1]?.focus());},O=m=>{let u=F();!u[m]&&m>0?u[m-1]="":u[m]="",$(u.join("")),m>0&&b.current[m-1]?.focus();},y=m=>{m.preventDefault();let T=m.clipboardData.getData("text").split("").map(P).join("").slice(0,e);T&&($(T),b.current[Math.min(T.length-1,e-1)]?.focus());},w=m=>{switch(d){case"upper":case"visual-upper":return m.toUpperCase();case"lower":case"visual-lower":return m.toLowerCase();default:return m}};return jsx(g,{children:jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsx(N,{htmlFor:C,required:a,children:o}),jsx("div",{className:v("flex gap-3 items-center",s&&"text-red-500",c),...R,children:S.map((m,u)=>{let T=t&&u>0&&u%t===0;return jsxs(vr.Fragment,{children:[T&&jsx("span",{className:"flex items-center justify-center text-xl font-bold select-none",children:"-"}),jsx("input",{id:C,type:"text",maxLength:1,inputMode:h==="numeric"?"numeric":"text",value:w(m).trim(),ref:I=>{b.current[u]=I,u===0&&L&&(typeof L=="function"?L(I):typeof L=="object"&&(L.current=I));},onPaste:y,onChange:I=>E(u,I.target.value),onKeyDown:I=>I.key==="Backspace"&&O(u),onBlur:f,className:v("h-14 w-12 text-center text-2xl rounded-md border border-input bg-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s&&"border-red-500")})]},u)})}),s&&jsx(A,{children:s}),!s&&i&&jsx(D,{children:i})]})})});qt.displayName="OtpInput";var Oi=qt;var Kt=forwardRef(({label:e,required:t,option:r,description:n,icon:o,className:a,overrideClassName:i,helperText:s,error:l,...f},c)=>{let h=useId(),p=v("h-4 w-4 border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",l&&"border-destructive",a);return jsx(g,{children:jsxs("div",{className:"space-y-3",children:[e&&jsx(N,{required:t,children:e}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{id:h,type:"radio",className:i?a:p,ref:c,...f}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{children:o&&o}),jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsx(N,{htmlFor:h,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsx(N,{id:`${h}-description`,htmlFor:h,className:"text-xs text-muted-foreground",children:n})]})]})]}),l&&jsx(A,{children:l}),!l&&s&&jsx(D,{children:s})]})})});Kt.displayName="Radio";var _i=Kt;function bn(e,t){let{label:r,required:n,name:o,labelKey:a,valueKey:i,options:s,alignment:l="vertical",className:f,overrideClassName:c=!1,helperText:h,error:p,typeSet:d="field",value:R,onChange:L,...C}=e,b=useId(),k=useMemo(()=>new Map(s.map(E=>[String(E[i]),E])),[s,i]),P=useMemo(()=>R==null?"":String(d==="field"?R:R[i]),[R,d,i]),F=E=>{if(!L)return;let O;if(d==="field"){let y=k.get(E);if(y)O=y[i];else {let w=Number(E);O=Number.isNaN(w)?E:w;}}else O=k.get(E)??void 0;L({target:{name:o,value:O,type:"radiogroup",checked:!0}});},S=l==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",$=v("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",p&&"border-destructive");return jsx(g,{children:jsxs("div",{className:v("flex flex-col gap-3",f),children:[r&&jsx(N,{required:n,children:r}),jsx("div",{className:S,children:s.map((E,O)=>{let y=String(E[i]),w=`${b}-${y}-${O}`;return jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{...C,id:w,ref:t,name:o,type:"radio",checked:P===y,onChange:()=>F(y),className:c?f:$}),jsx(N,{htmlFor:w,children:String(E[a])})]},w)})}),p&&jsx(A,{children:String(p)}),!p&&h&&jsx(D,{children:h})]})})}function vn(){let e=forwardRef(bn);return e.displayName="RadioGroup",e}var xn=vn(),as=xn;function yn({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:a,error:i,helperText:s,className:l,...f},c){let h=useId(),p=v("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",i&&"border-red-500 focus-visible:ring-red-500",l);return jsx(g,{children:jsxs("div",{className:"space-y-2",children:[e&&jsx(N,{htmlFor:h,required:t,children:e}),jsxs("select",{id:h,ref:c,className:p,...f,children:[a&&jsx("option",{value:"",disabled:!0,children:a}),r.map((d,R)=>jsx("option",{value:String(d[o]),children:String(d[n])},R))]}),i&&jsx(A,{children:i}),!i&&s&&jsx(D,{children:s})]})})}function Tn(){let e=forwardRef(yn);return e.displayName="Select",e}var Ln=Tn(),bs=Ln;var _t=forwardRef(({label:e,required:t,option:r,description:n,icon:o,checked:a=!1,className:i,overrideClassName:s,error:l,name:f,...c},h)=>{let p=useId();return jsx(g,{children:jsxs("div",{className:"flex flex-col gap-2",children:[e&&jsx(N,{required:t,children:e}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:p,name:f,checked:a,className:"peer sr-only",ref:h,...c}),jsx("label",{htmlFor:p,className:v("relative flex items-center h-6 w-11 cursor-pointer rounded-full bg-input transition-colors duration-200","peer-checked:bg-primary peer-focus:ring-2 peer-focus:ring-ring peer-focus:ring-offset-2 peer-focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",i),children:jsx("span",{className:v("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",a?"translate-x-5":"translate-x-1")})}),jsx("span",{children:o&&o}),(r||n)&&jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[e&&jsx(N,{id:`${p}-label`,htmlFor:p,className:"text-sm font-medium leading-none",children:r}),n&&jsx(N,{id:`${p}-description`,htmlFor:p,className:"text-xs text-muted-foreground",children:n})]})]})]})})});_t.displayName="Switch";var Ps=_t;var Jt=vr.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:a=!1,error:i,helperText:s,...l},f)=>{let c=useId(),[h,p]=useState(0),d=v("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",i&&"border-red-500 focus-visible:ring-red-500",o);return jsx(g,{children:jsxs("div",{className:"space-y-2",children:[e&&jsx(N,{htmlFor:c,required:t,children:e}),jsxs("div",{className:"relative",children:[jsx("textarea",{id:c,className:a?o:d,maxLength:n,onInput:R=>p(R.currentTarget.textLength),ref:f,...l}),r&&jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[h,n?` / ${n}`:""]})]}),i&&jsx(A,{children:i}),!i&&s&&jsx(D,{children:s})]})})});Jt.displayName="TextArea";var Vs=Jt;var En=({files:e,removeFile:t})=>jsx("div",{className:"space-y-2",children:e?.length>0&&e?.map((r,n)=>jsxs("div",{className:"flex items-center justify-between p-2 bg-secondary rounded",children:[jsxs("div",{children:[jsx("p",{className:"text-sm truncate",children:r.name}),jsxs("p",{className:"text-xs text-muted-foreground",children:[(r?.size/1024).toFixed(1)," KB"]})]}),jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),t(n);},className:"ml-2 p-1 hover:bg-destructive/20 rounded",children:"\u2715"})]},`${r?.name}-${n}`))}),jt=En;var Mn=({accept:e,maxSize:t})=>jsxs("div",{className:"space-y-2",children:[jsx("svg",{className:"w-8 h-8 mx-auto text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),jsxs("div",{children:[jsx("p",{className:"text-sm text-foreground",children:"Clique para selecionar ou arraste arquivos aqui"}),jsxs("p",{className:"text-xs text-muted-foreground",children:[e&&`Tipos aceitos: ${e}`,t&&` \u2022 Tamanho m\xE1ximo: ${t}MB`]})]})]}),Zt=Mn;var Yt=({files:e,setFiles:t,multiple:r=!1,disabled:n=!1,filterFiles:o=a=>a})=>{let a=useRef(null),[i,s]=useState(!1),l=useCallback(p=>{p.preventDefault(),!n&&s(!0);},[n]),f=useCallback(()=>{s(!1);},[]),c=useCallback(p=>{if(p.preventDefault(),n||!a.current)return;s(!1);let d=Array.from(p.dataTransfer.files);if(!r&&!e||!r&&d.length>1)return;let R=o(d),L=r?R:R.slice(0,1);t(L);let C=new DataTransfer;L.forEach(b=>C.items.add(b)),a.current.files=C.files,a.current.dispatchEvent(new Event("change",{bubbles:!0}));},[n,r,e,o]),h=useCallback(()=>{t([]),a.current&&(a.current.value="");},[]);return {files:e,setFiles:t,clearFiles:h,inputRef:a,isDragOver:i,setIsDragOver:s,handleDrop:c,handleDragOver:l,handleDragLeave:f}};var Qt=({files:e,setFiles:t,inputRef:r})=>({removeFile:useCallback(o=>{if(!r.current)return;let a=e?.filter((s,l)=>l!==o);t(a);let i=new DataTransfer;a?.forEach(s=>i.items.add(s)),r.current.files=i.files,r.current.dispatchEvent(new Event("change",{bubbles:!0}));},[e,t,r])});var Dn=({previews:e,onRemove:t})=>{let[r,n]=useState(0),o=()=>n(i=>i===0?e?.length-1:i-1),a=()=>n(i=>i===e?.length-1?0:i+1);return jsxs("div",{className:"relative w-full h-56 rounded-lg overflow-hidden bg-black/5",children:[jsx("img",{src:e[r].url,alt:e[r].file.name,className:"w-full h-full object-cover"}),e.length>1&&jsxs(Fragment,{children:[jsx("button",{type:"button",onClick:o,className:"absolute left-2 top-1/2 -translate-y-1/2 bg-black/50 text-white px-2 py-1 rounded",children:"\u2039"}),jsx("button",{type:"button",onClick:a,className:"absolute right-2 top-1/2 -translate-y-1/2 bg-black/50 text-white px-2 py-1 rounded",children:"\u203A"})]}),jsx("button",{type:"button",onClick:()=>t(r),className:"absolute top-2 right-2 bg-red-500 text-white rounded px-2 py-1",children:"\u2715"})]})},tr=Dn;var nr=forwardRef(({label:e,required:t,accept:r,renderFiles:n,preview:o=!1,multiple:a=!1,maxSize:i=10,disabled:s=!1,error:l=!1,helperText:f,className:c,name:h,onChange:p,onBlur:d,...R},L)=>{let C=useId(),[b,k]=useState([]),P=1024*1024,F=V=>V.filter(_=>(!i||_.size<=i*P)&&(!r||_.type.match(r))),{inputRef:S,isDragOver:$,handleDrop:E,handleDragOver:O,handleDragLeave:y}=Yt({files:b,setFiles:k,multiple:a,filterFiles:F}),{removeFile:w}=Qt({files:b,setFiles:k,inputRef:S}),m=V=>{S.current=V,typeof L=="function"?L(V):L&&(L.current=V);},u=V=>{let _=Array.from(V.target.files??[]);if(!_.length)return;let j=F(_);k(a?j:j.slice(0,1)),p?.(V);},T=useMemo(()=>!o||!b||!b.length?[]:b.filter(V=>V.type.startsWith("image/")).map(V=>({file:V,url:URL.createObjectURL(V)})),[b,o]);useEffect(()=>()=>T.forEach(V=>URL.revokeObjectURL(V.url)),[T]);let I=o&&T.length>0;return jsx(g,{children:jsxs("div",{className:`space-y-2 ${c}`,children:[e&&jsx(N,{htmlFor:C,required:t,children:e}),jsxs("div",{onDrop:E,onDragOver:O,onDragLeave:y,onClick:()=>{!s&&!I&&S.current?.click();},className:`
|
|
25
|
+
`,children:jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{children:e}),jsx("svg",{className:`w-5 h-5 transition-transform ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}),n&&jsx("div",{className:"px-4 py-3 bg-background border-t border-border",children:t})]})});Ye.displayName="Accordion";var lo=Ye;function v(...e){return twMerge(clsx(e))}var Qe=vr.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:a,loading:i=!1,loadingContent:s,...l},f)=>{let c="inline-flex items-center justify-center rounded-lg font-medium cursor-pointer active:translate-y-1 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",h={primary:"bg-blue-600 text-white hover:bg-blue-700 shadow-md focus-visible:ring-blue-500",secondary:"bg-gray-600 text-white hover:bg-gray-700 shadow-sm focus-visible:ring-gray-500",tertiary:"bg-purple-600 text-white hover:bg-purple-700 shadow-sm focus-visible:ring-purple-500",destructive:"bg-red-600 text-white hover:bg-red-700 shadow-sm focus-visible:ring-red-500",success:"bg-green-600 text-white hover:bg-green-700 shadow-sm focus-visible:ring-green-500",warning:"bg-amber-500 text-white hover:bg-amber-600 shadow-sm focus-visible:ring-amber-500",info:"bg-cyan-600 text-white hover:bg-cyan-700 shadow-sm focus-visible:ring-cyan-500",accent:"bg-violet-600 text-white hover:bg-violet-700 shadow-sm focus-visible:ring-violet-500",outline:"border border-gray-300 bg-transparent text-gray-700 hover:bg-gray-50 shadow-sm focus-visible:ring-gray-500",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus-visible:ring-gray-500",link:"text-blue-600 underline-offset-4 hover:underline bg-transparent p-0 h-auto shadow-none",gradient:"bg-gradient-to-r from-blue-600 to-purple-600 text-white hover:from-blue-700 hover:to-purple-700 shadow-md focus-visible:ring-blue-500",glass:"bg-white/10 backdrop-blur-md border border-white/20 text-black hover:bg-white/20 shadow-sm focus-visible:ring-white/50",soft:"bg-blue-100 text-blue-700 hover:bg-blue-200 shadow-sm focus-visible:ring-blue-500",dark:"bg-gray-900 text-white hover:bg-gray-800 shadow-md focus-visible:ring-gray-500",light:"bg-gray-100 text-gray-900 hover:bg-gray-200 shadow-sm focus-visible:ring-gray-500",obsidian:"bg-black text-white hover:bg-gray-900 shadow-md border border-gray-800 focus-visible:ring-gray-700",polar:"bg-white text-gray-900 hover:bg-gray-50 shadow-md border border-gray-300 focus-visible:ring-gray-400"},p={xs:"h-7 px-2 text-xs min-w-16",sm:"h-9 px-3 text-sm min-w-20",md:"h-10 px-4 py-2 text-base min-w-24",lg:"h-11 px-6 text-lg min-w-28",xl:"h-12 px-8 text-xl min-w-32"},d=t?e:v(c,h[r],p[n],e);return o?jsx(g,{children:jsx("a",{href:o,className:d,ref:f,children:i&&s?s:a})}):jsx(g,{children:jsx("button",{className:d,ref:f,...l,children:i&&s?s:a})})});Qe.displayName="Button";var xo=Qe;var et=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("div",{ref:o,className:t?e:v("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r})}));et.displayName="Card";var tt=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("div",{ref:o,className:t?e:v("flex flex-col space-y-1.5 p-6",e),...n,children:r})}));tt.displayName="CardHeader";var rt=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("h3",{ref:o,className:t?e:v("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r})}));rt.displayName="CardTitle";var nt=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("p",{ref:o,className:t?e:v("text-sm text-muted-foreground",e),...n,children:r})}));nt.displayName="CardDescription";var ot=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("div",{ref:o,className:t?e:v("p-6 pt-0",e),...n,children:r})}));ot.displayName="CardContent";var at=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(g,{children:jsx("div",{ref:o,className:t?e:v("flex items-center p-6 pt-0",e),...n,children:r})}));at.displayName="CardFooter";var Ro=et,wo=tt,No=rt,ko=nt,Eo=ot,Mo=at;var ge=createContext(void 0),st=forwardRef(({children:e,className:t,...r},n)=>{let[o,a]=useState(!1);return jsx(g,{children:jsx(ge.Provider,{value:{isOpen:o,setIsOpen:a},children:jsx("div",{ref:n,className:v("relative inline-block",t),...r,children:e})})})});st.displayName="DropdownMenu";var lt=({children:e,asChild:t})=>{let r=useContext(ge);if(!r)throw new Error("DropdownMenuTrigger must be used within DropdownMenu");let n=()=>r.setIsOpen(!r.isOpen);if(t){let o=e;return cloneElement(o,{onClick:a=>{o.props.onClick?.(a),n();}})}return jsx(g,{children:jsx("button",{onClick:n,children:e})})};lt.displayName="DropdownMenuTrigger";var ct=forwardRef(({children:e,align:t="end",className:r,...n},o)=>{let a=useContext(ge),i=useRef(null);return useEffect(()=>{o&&(typeof o=="function"?o(i.current):o.current=i.current);},[o]),useEffect(()=>{let l=f=>{i.current&&!i.current.contains(f.target)&&a?.setIsOpen(!1);};return a?.isOpen&&document.addEventListener("mousedown",l),()=>{document.removeEventListener("mousedown",l);}},[a?.isOpen]),a?.isOpen?jsx(g,{children:jsx("div",{ref:i,className:v("absolute z-50 mt-2 min-w-32 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md",{start:"left-0",center:"left-1/2 -translate-x-1/2",end:"right-0"}[t],r),...n,children:e})}):null});ct.displayName="DropdownMenuContent";var dt=forwardRef(({children:e,onClick:t,destructive:r,className:n,...o},a)=>{let i=useContext(ge);return jsx(g,{children:jsx("button",{ref:a,onClick:l=>{t?.(l),i?.setIsOpen(!1);},className:v("w-full text-left px-4 py-2 text-sm hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none",r&&"text-red-600 hover:bg-red-50 hover:text-red-700 focus:bg-red-50 focus:text-red-700",n),...o,children:e})})});dt.displayName="DropdownMenuItem";var pt=forwardRef(({className:e,...t},r)=>jsx(g,{children:jsx("div",{ref:r,className:v("-mx-1 my-1 h-px bg-border",e),...t})}));pt.displayName="DropdownMenuSeparator";var mt=forwardRef(({children:e,className:t,...r},n)=>jsx(g,{children:jsx("div",{ref:n,className:v("px-2 py-1.5 text-sm font-semibold",t),...r,children:e})}));mt.displayName="DropdownMenuLabel";var So=st,$o=lt,Oo=ct,Bo=dt,Go=pt,Uo=mt;var Tr=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx(g,{children:jsx("p",{className:r?t:v("text-sm text-muted-foreground",t),children:e})})},D=Tr;var Lr=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsx(g,{children:jsxs("div",{className:"flex items-center gap-1",children:[jsx("label",{...o,className:n?r:v("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),children:e}),t&&jsx("span",{className:"text-red-600",children:"*"})]})}),N=Lr;var Rr=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx(g,{children:jsx("p",{className:r?t:v("text-sm text-red-600 dark:text-red-400",t),children:e})})},A=Rr;var gt=forwardRef(({label:e,required:t,option:r,description:n,icon:o,orientation:a="left",className:i,overrideClassName:s=!1,helperText:l,error:f,...c},h)=>{let p=useId(),d=v("h-4 w-4 rounded border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",f&&"border-destructive",i);return jsx(g,{children:jsxs("div",{className:"space-y-2 w-fit",children:[e&&jsx(N,{required:t,children:e}),jsxs("div",{className:`flex items-center ${a=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsx("input",{id:p,type:"checkbox",className:s?i:d,ref:h,...c}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{children:o&&o}),jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsx(N,{htmlFor:p,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsx(N,{id:`${p}-description`,htmlFor:p,className:"text-xs text-muted-foreground",children:n})]})]})]}),f&&jsx(A,{children:f}),!f&&l&&jsx(D,{children:l})]})})});gt.displayName="CheckBox";var ca=gt;function Mr(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:a,labelKey:i,valueKey:s,options:l,alignment:f="vertical",className:c,overrideClassName:h=!1,helperText:p,error:d,label:R,name:L,required:C,...b}=e,k=useId(),P=useMemo(()=>new Map(l.map(y=>[String(y[s]),y])),[l,s]),F=useMemo(()=>o==null?[]:r==="field"?n?o.map(y=>String(y)):[String(o)]:n?o.map(y=>String(y[s])):[String(o[s])],[o,r,n,s]),S=(y,w)=>{if(!a)return;let m;if(r==="field")if(n)m=y.map(T=>{let I=P.get(T);return I?I[s]:T});else {let u=y[0];if(!u)m=void 0;else {let T=P.get(u);m=T?T[s]:u;}}else n?m=y.map(T=>P.get(T)).filter(T=>T!==void 0):m=P.get(y[0]??"")??void 0;a({target:{name:L,value:m,type:"checkboxgroup",checked:w}});},$=y=>{let w;n?w=F.includes(y)?F.filter(m=>m!==y):[...F,y]:w=F[0]===y?[]:[y],S(w,w.includes(y));},E=f==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",O=v("h-4 w-4 rounded border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",d&&"border-destructive");return jsx(g,{children:jsxs("div",{className:v("flex flex-col gap-3",c),children:[R&&jsx(N,{required:C,children:R}),jsx("div",{className:E,children:l.map((y,w)=>{let m=String(y[s]),u=F.includes(m),T=`${k}-${m}-${w}`;return jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{...b,id:T,ref:t,type:"checkbox",name:L,checked:u,onChange:()=>$(m),className:h?c:O}),jsx(N,{htmlFor:T,children:String(y[i])})]},T)})}),!!d&&jsx(A,{children:String(d)}),!d&&p&&jsx(D,{children:p})]})})}function Fr(){let e=forwardRef(Mr);return e.displayName="CheckBoxGroup",e}var Ir=Fr(),Ca=Ir;var Ar=["#000000","#ffffff","#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ffa500","#800080","#ffc0cb","#a52a2a","#808080","#000080","#008000"],ht=vr.forwardRef(({label:e,required:t,onChange:r,disabled:n=!1,presetColors:o=Ar,showPresets:a=!0,className:i,error:s,helperText:l,name:f},c)=>{let h=useId(),p=useRef(null),[d,R]=useState(!1),[L,C]=useState("COLOR"),[b,k]=useState("HEX"),[P,F]=useState("#000000"),[S,$]=useState(0),[E,O]=useState(0),[y,w]=useState(0),[m,u]=useState(1),[T,I]=useState("#000000"),[V,_]=useState("#ffffff"),[j,ue]=useState(90),[ye,ne]=useState("linear-gradient(90deg, #000000, #ffffff)"),Te=(x,H,ce)=>Math.min(ce,Math.max(H,x)),Le=x=>{let H=x.replace("#","");return {r:parseInt(H.slice(0,2),16),g:parseInt(H.slice(2,4),16),b:parseInt(H.slice(4,6),16)}},B=x=>{r?.({target:{value:x,name:f}});};useEffect(()=>{let x=H=>{p.current&&!p.current.contains(H.target)&&R(!1);};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[]),useEffect(()=>{if(/^#[0-9A-F]{6}$/i.test(P)){let x=Le(P);$(x.r),O(x.g),w(x.b);}},[P]),useEffect(()=>{let x=`linear-gradient(${j}deg, ${T}, ${V})`;ne(x),L==="GRADIENT"&&B(x);},[T,V,j]);let G=()=>{if(m>=1){if(b==="HEX")return P;if(b==="RGB")return `rgb(${S}, ${E}, ${y})`}return `rgba(${S}, ${E}, ${y}, ${Number(m.toFixed(2))})`},Z=L==="GRADIENT"?ye:G();return jsx(g,{children:jsxs("div",{className:`space-y-2 ${i??""}`,children:[e&&jsx(N,{htmlFor:h,required:t,children:e}),jsxs("div",{ref:p,className:"relative",children:[jsxs("button",{type:"button",onClick:()=>!n&&R(!d),className:"flex items-center gap-2 px-3 py-2 border rounded-md bg-background w-full",children:[jsx("div",{className:"w-6 h-6 rounded border",style:{background:Z}}),jsx("span",{className:"text-xs font-mono truncate",children:Z})]}),d&&jsxs("div",{className:"absolute z-50 mt-1 w-85 bg-popover border rounded-md p-4 space-y-3 shadow-lg",children:[jsx("div",{className:"flex gap-2",children:["COLOR","GRADIENT"].map(x=>jsx("button",{type:"button",onClick:()=>C(x),className:`px-2 py-1 text-xs rounded ${L===x?"bg-primary text-white":"border"}`,children:x==="COLOR"?"Cor":"Gradiente"},x))}),jsx("div",{className:"w-full h-10 rounded border",style:{background:Z}}),L==="COLOR"&&jsxs(Fragment,{children:[jsx("input",{ref:c,type:"color",value:P,onChange:x=>{F(x.target.value.toUpperCase()),B(G());},className:"w-full h-10 rounded"}),jsxs("div",{className:"flex gap-2 items-center",children:[jsxs("select",{value:b,onChange:x=>k(x.target.value),className:"px-2 py-1 text-xs border rounded",children:[jsx("option",{value:"HEX",children:"HEX"}),jsx("option",{value:"RGB",children:"RGB"}),jsx("option",{value:"RGBA",children:"RGBA"})]}),b==="HEX"&&jsx("input",{value:P,onChange:x=>{let H=x.target.value.toUpperCase().replace(/[^0-9A-F#]/g,"");H.startsWith("#")||(H="#"+H),H="#"+H.slice(1,7),F(H),/^#[0-9A-F]{6}$/.test(H)&&B(H);},className:"flex-1 px-2 py-1 text-xs font-mono border rounded",placeholder:"#000000"}),(b==="RGB"||b==="RGBA")&&jsx("div",{className:"flex gap-2",children:[{l:"R",v:S,s:$},{l:"G",v:E,s:O},{l:"B",v:y,s:w}].map(({l:x,v:H,s:ce})=>jsxs("div",{className:"flex items-center gap-1",children:[jsx("span",{className:"text-xs font-semibold",children:x}),jsx("input",{type:"number",min:0,max:255,value:H,onChange:or=>{ce(Te(+or.target.value,0,255)),B(G());},className:"w-14 px-1 py-1 text-xs border rounded"})]},x))})]}),b==="RGBA"&&jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-xs font-semibold",children:"A"}),jsx("input",{type:"range",min:0,max:1,step:.01,value:m,onChange:x=>{u(+x.target.value),B(G());},className:"flex-1"}),jsxs("span",{className:"text-xs w-10 text-right",children:[Math.round(m*100),"%"]})]}),a&&jsx("div",{className:"grid grid-cols-5 gap-1",children:o.map(x=>jsx("button",{type:"button",onClick:()=>{F(x),u(1),B(x);},className:"w-8 h-8 rounded border",style:{background:x}},x))})]}),L==="GRADIENT"&&jsxs(Fragment,{children:[jsxs("div",{className:"flex gap-2 items-center",children:[jsx("input",{type:"color",value:T,onChange:x=>I(x.target.value)}),jsx("span",{className:"text-xs",children:"\u2192"}),jsx("input",{type:"color",value:V,onChange:x=>_(x.target.value)})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-xs",children:"\xC2ngulo"}),jsx("input",{type:"range",min:0,max:360,value:j,onChange:x=>ue(+x.target.value),className:"flex-1"}),jsxs("span",{className:"text-xs w-10 text-right",children:[j,"\xB0"]})]})]})]})]}),s&&jsx(A,{children:s}),!s&&l&&jsx(D,{children:l})]})})});ht.displayName="ColorPicker";var ka=ht;var Sr=({...e})=>jsx("svg",{...e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),ve=Sr;var Or=(e,t)=>{useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},yt=Or;function ke({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:a,typeSet:i,name:s}){let[l,f]=useState([]),c=useMemo(()=>new Map(e.map(C=>[String(C[r]),C])),[e,r]),h=useCallback(()=>l.map(C=>c.get(C)).filter(C=>!!C),[l,c]),p=useCallback(C=>{if(!o)return;let b;if(i==="field"?n?b=C:b=C[0]??void 0:n?b=C.map(P=>c.get(P)).filter(P=>P!==void 0):b=c.get(C[0]??"")??void 0,a&&!n){let k=c.get(C[0]??"");k&&a(String(k[t]));}o({target:{name:s,value:b,type:"combobox"}});},[n,o,c,s,i,a,t]),d=useCallback(C=>{let b=String(C[r]),k=n?l.includes(b)?l.filter(P=>P!==b):[...l,b]:[b];f(k),p(k);},[n,l,p,r]),R=useCallback(C=>{let b=l.filter(k=>k!==C);f(b),p(b);},[l,p]),L=useCallback(()=>{f([]),a?.("");let C;i==="field"?C=n?[]:"":C=n?[]:void 0,o?.({target:{name:s,value:C,type:"combobox"}});},[n,o,s,a,i]);return {selectedValues:l,handleSelect:d,handleRemove:R,handleClear:L,getSelectedOptions:h}}function Ee(e,t,r){return useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var Lt=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:a,filteredOptions:i,highlightedIndex:s,setHighlightedIndex:l,handleSelect:f,handleRemove:c})=>{let h=useCallback(d=>{if(i.length===0){l(-1);return}l(R=>R<0?d>0?0:i.length-1:(R+d+i.length)%i.length);},[i,l]);return useCallback(d=>{if(!e){if(d.key==="Enter"||d.key==="ArrowDown"){t(!0),l(0),d.preventDefault();return}r&&d.key==="Backspace"&&n===""&&a.length>0&&(d.preventDefault(),c(a[a.length-1]));return}switch(d.key){case"ArrowDown":d.preventDefault(),h(1);break;case"ArrowUp":d.preventDefault(),h(-1);break;case"Enter":d.preventDefault();let R=s>=0?s:0,L=i[R];L&&f(L),r&&o&&o(""),r||(t(!1),l(-1));break;case"Escape":d.preventDefault(),t(!1),l(-1),r||o("");break;case"Tab":t(!1),l(-1);break;case"Home":d.preventDefault(),i.length>0&&l(0);break;case"End":d.preventDefault(),i.length>0&&l(i.length-1);break;case"Backspace":r&&n===""&&a.length>0&&(d.preventDefault(),c(a[a.length-1]));break}},[e,r,n,a,i,s,t,o,l,f,c,h])};function Pt({option:e,labelKey:t,valueKey:r,onRemove:n}){let o=String(e[t]),a=String(e[r]);return jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded",children:[o,jsx("button",{type:"button",onMouseDown:i=>i.preventDefault(),onClick:()=>n(a),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${o}`,children:"\u2715"})]},a)}function _r(e,t){let{label:r,required:n=!1,name:o,placeholder:a="Buscar...",labelKey:i,valueKey:s,options:l,value:f,onChange:c,mode:h="single",typeSet:p="field",disabled:d=!1,ClearEnabled:R=!0,helperText:L,error:C=!1,className:b="",...k}=e,P=h==="multiple",[F,S]=useState(!1),[$,E]=useState(""),O=useRef(null),y=useRef(null),w=useRef(null);useImperativeHandle(t,()=>w.current),yt(y,()=>S(!1));let m=Ee(l,i,$),[u,T]=useState(-1),{selectedValues:I,handleSelect:V,handleRemove:_,handleClear:j,getSelectedOptions:ue}=ke({options:l,labelKey:i,valueKey:s,value:f,multiple:P,onChange:c,typeSet:p,name:o,setSearchTerm:E}),ye=Lt({isOpen:F,setIsOpen:S,multiple:P,searchTerm:$,setSearchTerm:E,selectedValues:I,filteredOptions:m,highlightedIndex:u,setHighlightedIndex:T,handleSelect:V,handleRemove:_}),ne=useId(),Te="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",Le=v("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",C?"border-red-500":"border-gray-300 dark:border-gray-600",d?"opacity-50 cursor-not-allowed":"cursor-text","focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500");return jsx(g,{children:jsxs("div",{className:`space-y-2 ${b}`,children:[r&&jsx(N,{htmlFor:ne,required:n,children:r}),jsxs("div",{ref:O,className:"relative",children:[jsxs("div",{className:Le,children:[P&&ue().length>0&&jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:ue().map((B,G)=>jsx(Pt,{option:B,labelKey:i,valueKey:s,onRemove:_},String(B[s]??G)))}),jsx("input",{ref:w,...k,name:o,type:"text",placeholder:a,value:$,onChange:B=>{let G=B.target.value;E(G),!F&&G.trim()!==""&&S(!0);},onKeyDown:ye,onMouseDown:B=>{document.activeElement===w.current&&(B.preventDefault(),S(G=>{let Z=!G;return Z&&T(0),Z}));},onFocus:()=>{S(!0),T(0);},disabled:d,className:Te,role:"combobox","aria-expanded":F,"aria-controls":ne,"aria-activedescendant":u>=0?`${ne}-opt-${u}`:void 0}),R&&!!I.length&&jsx("button",{type:"button",onMouseDown:B=>B.preventDefault(),onClick:j,className:"absolute right-2 top-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700",title:"Limpar sele\xE7\xE3o",children:jsx(ve,{width:12,height:12})})]}),F&&jsx("div",{ref:y,id:ne,className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",role:"listbox","aria-multiselectable":P||void 0,children:m.length===0?jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):m.map((B,G)=>{let Z=String(B[s]),x=I.includes(Z),H=G===u;return jsx("button",{id:`${ne}-opt-${G}`,"data-index":G,role:"option","aria-selected":x,type:"button",onMouseDown:ce=>ce.preventDefault(),onClick:()=>V(B),className:v("w-full px-3 py-2 text-left text-sm transition-colors",H&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!H&&x&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!x&&!H&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsx("span",{children:String(B[i])})},Z)})})]}),C&&jsx(A,{children:C}),!C&&L&&jsx(D,{children:L})]})})}function Jr(){let e=forwardRef(_r);return e.displayName="ComboBox",e}var jr=Jr(),ni=jr;var Yr=({children:e,before:t,after:r,className:n})=>{let a=Zr("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},n);return jsx("div",{className:a,children:jsx("span",{children:e})})},Ve=Yr;var Qr=({children:e})=>jsx("div",{className:"absolute px-2",children:jsx("span",{children:e})}),Nt=Qr;var en=({children:e})=>jsx("div",{className:"absolute right-0 px-2",children:jsx("span",{children:e})}),Et=en;function Mt(e){e.currentTarget.maxLength=9;let t=e.currentTarget.value;return t=t.replace(/\D/g,""),t=t.replace(/^(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function Ft(e){let t=e.currentTarget.value;t=t.replace(/\D/g,""),t=t.padStart(3,"0");let r=t.slice(0,-2),n=t.slice(-2),i=`${(r.replace(/^0+/,"")||"0").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")},${n}`;return e.currentTarget.value=i,e}function It(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value;return t.match(/^(\d{3}).(\d{3}).(\d{3})-(\d{2})$/)||(t=t.replace(/\D/g,""),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2"),e.currentTarget.value=t),e}function Vt(e){e.currentTarget.maxLength=15;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function Ht(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{4})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function Dt(e){let t=e.currentTarget.value.replace(/\D/g,"");return t.length<=11?(e.currentTarget.maxLength=14,t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2")):(e.currentTarget.maxLength=18,t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2")),e.currentTarget.value=t,e}function At(e){e.currentTarget.maxLength=12;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{1})$/,"$1-$2"),e.currentTarget.value=t,e}function St(e){e.currentTarget.maxLength=18;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2"),e.currentTarget.value=t,e}var tn=({e,mask:t})=>{switch(t){case"money":return Ft(e);case"mobile":return Vt(e);case"phone":return Ht(e);case"cpfCnpj":return Dt(e);case"cpf":return It(e);case"rg":return At(e);case"cnpj":return St(e);case"cep":return Mt(e);default:return e}},$t=tn;var on=({mask:e,initialValue:t=""})=>{let[r,n]=useState(t);useEffect(()=>{t!==r&&n(t);},[t]);let o=useCallback(i=>{let l=$t({e:i,mask:e})?.currentTarget?.value??i.currentTarget.value;n(l);},[e]),a=useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:a}},Bt=on;var Gt=forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:a,addonBefore:i,addonBeforeClassName:s,addonAfter:l,addonAfterClassName:f,ClearEnabled:c=!0,className:h,overrideClassName:p=!1,error:d,helperText:R,value:L=void 0,onChange:C,...b},k)=>{let P=useId(),{handleChange:F,handleClear:S,setValue:$}=Bt({mask:r,initialValue:L}),E=v("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",d&&"border-destructive focus-visible:ring-destructive",!o&&!a&&"px-3",o&&!a&&"pl-10 pr-3",a&&!o&&"pl-3 pr-10",o&&a&&"pl-10 pr-10",i&&"rounded-l-none border-l-0",l&&"rounded-r-none border-r-0",h),O=w=>{F(w),C?.(w);},y=()=>{S(),$(""),C?.({target:{name:n||"",value:""}});};return jsx(g,{children:jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsx(N,{htmlFor:P,required:t,children:e}),jsxs("div",{className:"relative flex",children:[i&&jsx(Ve,{before:!0,className:s,children:i}),jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsx(Nt,{children:o}),jsx("input",{id:P,ref:k,name:n,onChange:O,className:p?h:E,...b}),c&&L&&jsx(ve,{onClick:y,width:12,height:12,className:v("absolute right-2 cursor-pointer",a&&"right-8")}),a&&jsx(Et,{children:a})]}),l&&jsx(Ve,{after:!0,className:f,children:l})]}),d&&jsx(A,{children:d}),!d&&R&&jsx(D,{children:R})]})})});Gt.displayName="Input";var Mi=Gt;var qt=forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:a=!1,helperText:i,error:s,onChange:l,onBlur:f,className:c,charType:h="numeric",customPattern:p,caseMode:d="none",...R},L)=>{let C=useId(),b=useRef([]),k=m=>{switch(d){case"upper":return m.toUpperCase();case"lower":case"visual-upper":return m.toLowerCase();case"visual-lower":return m.toUpperCase();default:return m}},P=m=>{if(!m)return "";let u=m.slice(0,1);switch(u=k(u),h){case"numeric":return /\d/.test(u)?u:"";case"alpha":return /[A-Za-z]/.test(u)?u:"";case"alphanumeric":return /[A-Za-z0-9]/.test(u)?u:"";case"custom":return p?.test(u)?u:"";default:return u}},F=()=>(r!=null?String(r):"").split("").map(P).slice(0,e),S=F().concat(Array(e).fill(" ")).slice(0,e),$=m=>{let u=m.split("").map(P).join("").slice(0,e),T=u===""?void 0:typeof r=="number"?Number(u):u;l?.({target:{name:n,value:T}});},E=(m,u)=>{let T=P(u),I=F();if(T===""){I[m]="",$(I.join(""));return}if(u.length>1){let V=u.split("").map(P).join("").slice(0,e);$(V),b.current[Math.min(V.length-1,e-1)]?.focus();return}T&&(I[m]=T,$(I.join("")),m<e-1&&b.current[m+1]?.focus());},O=m=>{let u=F();!u[m]&&m>0?u[m-1]="":u[m]="",$(u.join("")),m>0&&b.current[m-1]?.focus();},y=m=>{m.preventDefault();let T=m.clipboardData.getData("text").split("").map(P).join("").slice(0,e);T&&($(T),b.current[Math.min(T.length-1,e-1)]?.focus());},w=m=>{switch(d){case"upper":case"visual-upper":return m.toUpperCase();case"lower":case"visual-lower":return m.toLowerCase();default:return m}};return jsx(g,{children:jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsx(N,{htmlFor:C,required:a,children:o}),jsx("div",{className:v("flex gap-3 items-center",s&&"text-red-500",c),...R,children:S.map((m,u)=>{let T=t&&u>0&&u%t===0;return jsxs(vr.Fragment,{children:[T&&jsx("span",{className:"flex items-center justify-center text-xl font-bold select-none",children:"-"}),jsx("input",{id:C,type:"text",maxLength:1,inputMode:h==="numeric"?"numeric":"text",value:w(m).trim(),ref:I=>{b.current[u]=I,u===0&&L&&(typeof L=="function"?L(I):typeof L=="object"&&(L.current=I));},onPaste:y,onChange:I=>E(u,I.target.value),onKeyDown:I=>I.key==="Backspace"&&O(u),onBlur:f,className:v("h-14 w-12 text-center text-2xl rounded-md border border-input bg-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s&&"border-red-500")})]},u)})}),s&&jsx(A,{children:s}),!s&&i&&jsx(D,{children:i})]})})});qt.displayName="OtpInput";var Oi=qt;var Kt=forwardRef(({label:e,required:t,option:r,description:n,icon:o,className:a,overrideClassName:i,helperText:s,error:l,...f},c)=>{let h=useId(),p=v("h-4 w-4 border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",l&&"border-destructive",a);return jsx(g,{children:jsxs("div",{className:"space-y-3",children:[e&&jsx(N,{required:t,children:e}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{id:h,type:"radio",className:i?a:p,ref:c,...f}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{children:o&&o}),jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsx(N,{htmlFor:h,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsx(N,{id:`${h}-description`,htmlFor:h,className:"text-xs text-muted-foreground",children:n})]})]})]}),l&&jsx(A,{children:l}),!l&&s&&jsx(D,{children:s})]})})});Kt.displayName="Radio";var _i=Kt;function bn(e,t){let{label:r,required:n,name:o,labelKey:a,valueKey:i,options:s,alignment:l="vertical",className:f,overrideClassName:c=!1,helperText:h,error:p,typeSet:d="field",value:R,onChange:L,...C}=e,b=useId(),k=useMemo(()=>new Map(s.map(E=>[String(E[i]),E])),[s,i]),P=useMemo(()=>R==null?"":String(d==="field"?R:R[i]),[R,d,i]),F=E=>{if(!L)return;let O;if(d==="field"){let y=k.get(E);if(y)O=y[i];else {let w=Number(E);O=Number.isNaN(w)?E:w;}}else O=k.get(E)??void 0;L({target:{name:o,value:O,type:"radiogroup",checked:!0}});},S=l==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",$=v("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",p&&"border-destructive");return jsx(g,{children:jsxs("div",{className:v("flex flex-col gap-3",f),children:[r&&jsx(N,{required:n,children:r}),jsx("div",{className:S,children:s.map((E,O)=>{let y=String(E[i]),w=`${b}-${y}-${O}`;return jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{...C,id:w,ref:t,name:o,type:"radio",checked:P===y,onChange:()=>F(y),className:c?f:$}),jsx(N,{htmlFor:w,children:String(E[a])})]},w)})}),p&&jsx(A,{children:String(p)}),!p&&h&&jsx(D,{children:h})]})})}function vn(){let e=forwardRef(bn);return e.displayName="RadioGroup",e}var xn=vn(),as=xn;function yn({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:a,error:i,helperText:s,className:l,...f},c){let h=useId(),p=v("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",i&&"border-red-500 focus-visible:ring-red-500",l);return jsx(g,{children:jsxs("div",{className:"space-y-2",children:[e&&jsx(N,{htmlFor:h,required:t,children:e}),jsxs("select",{id:h,ref:c,className:p,...f,children:[a&&jsx("option",{value:"",disabled:!0,children:a}),r.map((d,R)=>jsx("option",{value:String(d[o]),children:String(d[n])},R))]}),i&&jsx(A,{children:i}),!i&&s&&jsx(D,{children:s})]})})}function Tn(){let e=forwardRef(yn);return e.displayName="Select",e}var Ln=Tn(),bs=Ln;var _t=forwardRef(({label:e,required:t,option:r,description:n,icon:o,checked:a=!1,className:i,overrideClassName:s,error:l,name:f,...c},h)=>{let p=useId();return jsx(g,{children:jsxs("div",{className:"flex flex-col gap-2",children:[e&&jsx(N,{required:t,children:e}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:p,name:f,checked:a,className:"peer sr-only",ref:h,...c}),jsx("label",{htmlFor:p,className:v("relative flex items-center h-6 w-11 cursor-pointer rounded-full bg-input transition-colors duration-200","peer-checked:bg-primary peer-focus:ring-2 peer-focus:ring-ring peer-focus:ring-offset-2 peer-focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",i),children:jsx("span",{className:v("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",a?"translate-x-5":"translate-x-1")})}),jsx("span",{children:o&&o}),(r||n)&&jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[e&&jsx(N,{id:`${p}-label`,htmlFor:p,className:"text-sm font-medium leading-none",children:r}),n&&jsx(N,{id:`${p}-description`,htmlFor:p,className:"text-xs text-muted-foreground",children:n})]})]})]})})});_t.displayName="Switch";var Ps=_t;var Jt=vr.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:a=!1,error:i,helperText:s,...l},f)=>{let c=useId(),[h,p]=useState(0),d=v("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",i&&"border-red-500 focus-visible:ring-red-500",o);return jsx(g,{children:jsxs("div",{className:"space-y-2",children:[e&&jsx(N,{htmlFor:c,required:t,children:e}),jsxs("div",{className:"relative",children:[jsx("textarea",{id:c,className:a?o:d,maxLength:n,onInput:R=>p(R.currentTarget.textLength),ref:f,...l}),r&&jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[h,n?` / ${n}`:""]})]}),i&&jsx(A,{children:i}),!i&&s&&jsx(D,{children:s})]})})});Jt.displayName="TextArea";var Vs=Jt;var En=({files:e,removeFile:t})=>jsx("div",{className:"space-y-2",children:e?.length>0&&e?.map((r,n)=>jsxs("div",{className:"flex items-center justify-between p-2 bg-secondary rounded",children:[jsxs("div",{children:[jsx("p",{className:"text-sm truncate",children:r.name}),jsxs("p",{className:"text-xs text-muted-foreground",children:[(r?.size/1024).toFixed(1)," KB"]})]}),jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),t(n);},className:"ml-2 p-1 hover:bg-destructive/20 rounded",children:"\u2715"})]},`${r?.name}-${n}`))}),jt=En;var Mn=({accept:e,maxSize:t})=>jsxs("div",{className:"space-y-2",children:[jsx("svg",{className:"w-8 h-8 mx-auto text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),jsxs("div",{children:[jsx("p",{className:"text-sm text-foreground",children:"Clique para selecionar ou arraste arquivos aqui"}),jsxs("p",{className:"text-xs text-muted-foreground",children:[e&&`Tipos aceitos: ${e}`,t&&` \u2022 Tamanho m\xE1ximo: ${t}MB`]})]})]}),Zt=Mn;var Yt=({files:e,setFiles:t,multiple:r=!1,disabled:n=!1,filterFiles:o=a=>a})=>{let a=useRef(null),[i,s]=useState(!1),l=useCallback(p=>{p.preventDefault(),!n&&s(!0);},[n]),f=useCallback(()=>{s(!1);},[]),c=useCallback(p=>{if(p.preventDefault(),n||!a.current)return;s(!1);let d=Array.from(p.dataTransfer.files);if(!r&&!e||!r&&d.length>1)return;let R=o(d),L=r?R:R.slice(0,1);t(L);let C=new DataTransfer;L.forEach(b=>C.items.add(b)),a.current.files=C.files,a.current.dispatchEvent(new Event("change",{bubbles:!0}));},[n,r,e,o]),h=useCallback(()=>{t([]),a.current&&(a.current.value="");},[]);return {files:e,setFiles:t,clearFiles:h,inputRef:a,isDragOver:i,setIsDragOver:s,handleDrop:c,handleDragOver:l,handleDragLeave:f}};var Qt=({files:e,setFiles:t,inputRef:r})=>({removeFile:useCallback(o=>{if(!r.current)return;let a=e?.filter((s,l)=>l!==o);t(a);let i=new DataTransfer;a?.forEach(s=>i.items.add(s)),r.current.files=i.files,r.current.dispatchEvent(new Event("change",{bubbles:!0}));},[e,t,r])});var Dn=({previews:e,onRemove:t})=>{let[r,n]=useState(0),o=()=>n(i=>i===0?e?.length-1:i-1),a=()=>n(i=>i===e?.length-1?0:i+1);return jsxs("div",{className:"relative w-full h-56 rounded-lg overflow-hidden bg-black/5",children:[jsx("img",{src:e[r]?.url,alt:e[r]?.file?.name,className:"w-full h-full object-cover"}),e.length>1&&jsxs(Fragment,{children:[jsx("button",{type:"button",onClick:o,className:"absolute left-2 top-1/2 -translate-y-1/2 bg-black/50 text-white px-2 py-1 rounded",children:"\u2039"}),jsx("button",{type:"button",onClick:a,className:"absolute right-2 top-1/2 -translate-y-1/2 bg-black/50 text-white px-2 py-1 rounded",children:"\u203A"})]}),jsx("button",{type:"button",onClick:()=>t(r),className:"absolute top-2 right-2 bg-red-500 text-white rounded px-2 py-1",children:"\u2715"})]})},tr=Dn;var nr=forwardRef(({label:e,required:t,accept:r,renderFiles:n,preview:o=!1,multiple:a=!1,maxSize:i=10,disabled:s=!1,error:l=!1,helperText:f,className:c,name:h,onChange:p,onBlur:d,...R},L)=>{let C=useId(),[b,k]=useState([]),P=1024*1024,F=V=>V.filter(_=>(!i||_.size<=i*P)&&(!r||_.type.match(r))),{inputRef:S,isDragOver:$,handleDrop:E,handleDragOver:O,handleDragLeave:y}=Yt({files:b,setFiles:k,multiple:a,filterFiles:F}),{removeFile:w}=Qt({files:b,setFiles:k,inputRef:S}),m=V=>{S.current=V,typeof L=="function"?L(V):L&&(L.current=V);},u=V=>{let _=Array.from(V.target.files??[]);if(!_.length)return;let j=F(_);k(a?j:j.slice(0,1)),p?.(V);},T=useMemo(()=>!o||!b||!b.length?[]:b.filter(V=>V.type.startsWith("image/")).map(V=>({file:V,url:URL.createObjectURL(V)})),[b,o]);useEffect(()=>()=>T.forEach(V=>URL.revokeObjectURL(V.url)),[T]);let I=o&&T.length>0;return jsx(g,{children:jsxs("div",{className:`space-y-2 ${c}`,children:[e&&jsx(N,{htmlFor:C,required:t,children:e}),jsxs("div",{onDrop:E,onDragOver:O,onDragLeave:y,onClick:()=>{!s&&!I&&S.current?.click();},className:`
|
|
26
26
|
border-2 border-dashed rounded-lg p-6 text-center cursor-pointer
|
|
27
27
|
transition-colors
|
|
28
28
|
${$?"border-primary bg-primary/5":"border-border"}
|