@openway/ui 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,10 @@
1
1
  "use client";
2
- import{a as C,b as un,c as Ne,d as Oe,e as Un,f as ys,g as ws,h as Cs,i as Mc,j as _f,k as Xf,l as qf,m as Zf,n as Fc,o as Ec,p as $c,q as jn,r as Ii,s as Mi,t as Fi,u as Ei,v as $i}from"./chunk-X4LIYOS5.js";var Li={xs:{button:"h-6 px-2.5 text-[11px] gap-1",iconOnly:"size-6 p-0",icon:"size-3"},sm:{button:"h-8 px-3 text-xs gap-1.5",iconOnly:"size-8 p-0",icon:"size-3.5"},md:{button:"h-10 px-4 text-sm gap-2",iconOnly:"size-10 p-0",icon:"size-4"},lg:{button:"h-12 px-5 text-base gap-2.5",iconOnly:"size-12 p-0",icon:"size-5"},xl:{button:"h-14 px-6 text-lg gap-3",iconOnly:"size-14 p-0",icon:"size-6"}},Bi={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Hi={filled:{primary:"bg-primary-500 text-neutral-white border-transparent hover:bg-primary-600 active:bg-primary-700 focus-visible:ring-primary-700",secondary:"bg-secondary-500 text-neutral-white border-transparent hover:bg-secondary-600 active:bg-secondary-700 focus-visible:ring-secondary-700",neutral:"bg-neutral-800 text-neutral-white border-transparent hover:bg-neutral-900 active:bg-neutral-950 focus-visible:ring-neutral-700",error:"bg-error-500 text-neutral-white border-transparent hover:bg-error-600 active:bg-error-700 focus-visible:ring-error-700",success:"bg-success-500 text-neutral-white border-transparent hover:bg-success-600 active:bg-success-700 focus-visible:ring-success-700",warning:"bg-warning-500 text-neutral-white border-transparent hover:bg-warning-600 active:bg-warning-700 focus-visible:ring-warning-700",info:"bg-info-500 text-neutral-white border-transparent hover:bg-info-600 active:bg-info-700 focus-visible:ring-info-700"},soft:{primary:"bg-primary-100 text-primary-800 border-primary-200 hover:bg-primary-200 hover:text-primary-900 active:bg-primary-300 focus-visible:ring-primary-700",secondary:"bg-secondary-100 text-secondary-800 border-secondary-200 hover:bg-secondary-200 hover:text-secondary-900 active:bg-secondary-300 focus-visible:ring-secondary-700",neutral:"bg-neutral-100 text-neutral-800 border-neutral-200 hover:bg-neutral-200 hover:text-neutral-900 active:bg-neutral-300 focus-visible:ring-neutral-700",error:"bg-error-100 text-error-800 border-error-200 hover:bg-error-200 hover:text-error-900 active:bg-error-300 focus-visible:ring-error-700",success:"bg-success-100 text-success-800 border-success-200 hover:bg-success-200 hover:text-success-900 active:bg-success-300 focus-visible:ring-success-700",warning:"bg-warning-100 text-warning-800 border-warning-200 hover:bg-warning-200 hover:text-warning-900 active:bg-warning-300 focus-visible:ring-warning-700",info:"bg-info-100 text-info-800 border-info-200 hover:bg-info-200 hover:text-info-900 active:bg-info-300 focus-visible:ring-info-700"},ghost:{primary:"bg-transparent text-primary-700 border-transparent hover:bg-primary-100 hover:text-primary-900 active:bg-primary-200 focus-visible:ring-primary-700",secondary:"bg-transparent text-secondary-700 border-transparent hover:bg-secondary-100 hover:text-secondary-900 active:bg-secondary-200 focus-visible:ring-secondary-700",neutral:"bg-transparent text-neutral-700 border-transparent hover:bg-neutral-100 hover:text-neutral-900 active:bg-neutral-200 focus-visible:ring-neutral-700",error:"bg-transparent text-error-700 border-transparent hover:bg-error-100 hover:text-error-900 active:bg-error-200 focus-visible:ring-error-700",success:"bg-transparent text-success-700 border-transparent hover:bg-success-100 hover:text-success-900 active:bg-success-200 focus-visible:ring-success-700",warning:"bg-transparent text-warning-700 border-transparent hover:bg-warning-100 hover:text-warning-900 active:bg-warning-200 focus-visible:ring-warning-700",info:"bg-transparent text-info-700 border-transparent hover:bg-info-100 hover:text-info-900 active:bg-info-200 focus-visible:ring-info-700"},text:{primary:"bg-transparent text-primary-500 border-transparent px-1 hover:text-primary-600 active:text-primary-700 focus-visible:ring-primary-700",secondary:"bg-transparent text-secondary-500 border-transparent px-1 hover:text-secondary-600 active:text-secondary-700 focus-visible:ring-secondary-700",neutral:"bg-transparent text-neutral-700 border-transparent px-1 hover:text-neutral-800 active:text-neutral-900 focus-visible:ring-neutral-700",error:"bg-transparent text-error-500 border-transparent px-1 hover:text-error-600 active:text-error-700 focus-visible:ring-error-700",success:"bg-transparent text-success-500 border-transparent px-1 hover:text-success-600 active:text-success-700 focus-visible:ring-success-700",warning:"bg-transparent text-warning-500 border-transparent px-1 hover:text-warning-600 active:text-warning-700 focus-visible:ring-warning-700",info:"bg-transparent text-info-500 border-transparent px-1 hover:text-info-600 active:text-info-700 focus-visible:ring-info-700"},outline:{primary:"bg-transparent text-primary-700 border-2 border-primary-400 hover:bg-primary-50 hover:border-primary-500 hover:text-primary-900 active:bg-primary-100 focus-visible:ring-primary-700",secondary:"bg-transparent text-secondary-700 border-2 border-secondary-400 hover:bg-secondary-50 hover:border-secondary-500 hover:text-secondary-900 active:bg-secondary-100 focus-visible:ring-secondary-700",neutral:"bg-transparent text-neutral-700 border-2 border-neutral-300 hover:bg-neutral-50 hover:border-neutral-400 hover:text-neutral-900 active:bg-neutral-100 focus-visible:ring-neutral-700",error:"bg-transparent text-error-700 border-2 border-error-400 hover:bg-error-50 hover:border-error-500 hover:text-error-900 active:bg-error-100 focus-visible:ring-error-700",success:"bg-transparent text-success-700 border-2 border-success-400 hover:bg-success-50 hover:border-success-500 hover:text-success-900 active:bg-success-100 focus-visible:ring-success-700",warning:"bg-transparent text-warning-700 border-2 border-warning-400 hover:bg-warning-50 hover:border-warning-500 hover:text-warning-900 active:bg-warning-100 focus-visible:ring-warning-700",info:"bg-transparent text-info-700 border-2 border-info-400 hover:bg-info-50 hover:border-info-500 hover:text-info-900 active:bg-info-100 focus-visible:ring-info-700"}};import{jsx as ks,jsxs as Jf}from"react/jsx-runtime";function Ut({size:e,variant:t,color:r,radius:n,leftIcon:o,rightIcon:i,isLoading:a=!1,showSpinner:s=!1,loadingText:l,isFullWidth:h=!1,disabled:d=!1,type:w="button",className:p="",children:m,ref:x,...y}){let b=C(e,Li,"md"),k=t==="other"?"":C(r,C(t,Hi,"filled"),"primary"),T=C(n,Bi,"lg"),v=["inline-flex items-center justify-center font-medium leading-none border transition-colors duration-150 cursor-pointer select-none whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:pointer-events-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 active:scale-[0.98] transition-transform",b.button,T,k,h?"w-full":"",d?"opacity-50":"",p].filter(Boolean).join(" "),u=g=>ks("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${b.icon}`,"aria-hidden":"true",children:g}),c=a&&l?l:m;return Jf("button",{ref:x,type:w,disabled:d||a,"aria-busy":a,"aria-disabled":d||a,className:v,...y,children:[a&&s&&u(ks(Ne,{})),(!a||!s)&&o&&u(o),c&&ks("span",{className:"leading-none",children:c}),!a&&i&&u(i)]})}import{jsx as Ss}from"react/jsx-runtime";function fr({icon:e,size:t,variant:r,color:n,radius:o,isLoading:i=!1,showSpinner:a=!1,disabled:s=!1,type:l="button",className:h="",ref:d,...w}){let p=C(t,Li,"md"),m=r==="other"?"":C(n,C(r,Hi,"filled"),"primary"),x=C(o,Bi,"full"),y=["inline-flex items-center justify-center font-medium leading-none border transition-colors duration-150 active:scale-[0.98] transition-transform cursor-pointer select-none whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:pointer-events-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",p.iconOnly,x,m,s?"opacity-50":"",h].filter(Boolean).join(" "),b=k=>Ss("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${p.icon}`,"aria-hidden":"true",children:k});return Ss("button",{ref:d,type:l,disabled:s||i,"aria-busy":i,"aria-disabled":s||i,className:y,...w,children:b(i&&a?Ss(Ne,{}):e)})}var Lc={xs:{badge:"h-5 px-2 text-[11px] gap-1",icon:"size-3",dot:"size-1.5",deleteIcon:"size-3"},sm:{badge:"h-6 px-2.5 text-xs gap-1.5",icon:"size-3.5",dot:"size-1.5",deleteIcon:"size-3.5"},md:{badge:"h-7 px-3 text-xs font-medium gap-1.5",icon:"size-3.5",dot:"w-2 h-2",deleteIcon:"size-3.5"},lg:{badge:"h-8 px-3.5 text-sm font-medium gap-2",icon:"size-4",dot:"size-2.5",deleteIcon:"size-4"},xl:{badge:"h-9 px-4 text-sm font-semibold gap-2",icon:"size-4.5",dot:"size-2.5",deleteIcon:"size-4.5"}},Bc={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Hc={primary:"bg-primary-500",secondary:"bg-secondary-500",error:"bg-error-500",success:"bg-success-500",warning:"bg-warning-500",info:"bg-info-500",neutral:"bg-neutral-500"},Vc={soft:{primary:"bg-primary-100 text-primary-800 border-primary-200 hover:bg-primary-200",secondary:"bg-secondary-100 text-secondary-800 border-secondary-200 hover:bg-secondary-200",error:"bg-error-100 text-error-800 border-error-200 hover:bg-error-200",success:"bg-success-100 text-success-800 border-success-200 hover:bg-success-200",warning:"bg-warning-100 text-warning-800 border-warning-200 hover:bg-warning-200",info:"bg-info-100 text-info-800 border-info-200 hover:bg-info-200",neutral:"bg-neutral-100 text-neutral-800 border-neutral-200 hover:bg-neutral-200"},filled:{primary:"bg-primary-500 text-neutral-white border-transparent hover:bg-primary-600 active:bg-primary-700",secondary:"bg-secondary-500 text-neutral-white border-transparent hover:bg-secondary-600 active:bg-secondary-700",error:"bg-error-500 text-neutral-white border-transparent hover:bg-error-600 active:bg-error-700",success:"bg-success-500 text-neutral-white border-transparent hover:bg-success-600 active:bg-success-700",warning:"bg-warning-500 text-neutral-950 border-transparent hover:bg-warning-600 active:bg-warning-700",info:"bg-info-500 text-neutral-white border-transparent hover:bg-info-600 active:bg-info-700",neutral:"bg-neutral-800 text-neutral-white border-transparent hover:bg-neutral-900 active:bg-neutral-950"},outline:{primary:"bg-transparent text-primary-700 border-2 border-primary-400 hover:bg-primary-50/70",secondary:"bg-transparent text-secondary-800 border-2 border-secondary-400 hover:bg-secondary-50/70",error:"bg-transparent text-error-700 border-2 border-error-400 hover:bg-error-50/70",success:"bg-transparent text-success-700 border-2 border-success-400 hover:bg-success-50/70",warning:"bg-transparent text-warning-800 border-2 border-warning-400 hover:bg-warning-50/70",info:"bg-transparent text-info-800 border-2 border-info-400 hover:bg-info-50/70",neutral:"bg-transparent text-neutral-700 border-2 border-neutral-300 hover:bg-neutral-100/70"},ghost:{primary:"bg-transparent text-primary-700 border-transparent hover:bg-primary-50",secondary:"bg-transparent text-secondary-800 border-transparent hover:bg-secondary-50",error:"bg-transparent text-error-700 border-transparent hover:bg-error-50",success:"bg-transparent text-success-700 border-transparent hover:bg-success-50",warning:"bg-transparent text-warning-800 border-transparent hover:bg-warning-50",info:"bg-transparent text-info-800 border-transparent hover:bg-info-50",neutral:"bg-transparent text-neutral-700 border-transparent hover:bg-neutral-50"}};import{jsx as Fo,jsxs as Qf}from"react/jsx-runtime";function $t({size:e="md",variant:t="soft",color:r="primary",radius:n="full",dot:o=!1,dotPing:i=!1,leftIcon:a,rightIcon:s,onDelete:l,deleteAriaLabel:h="Remove",className:d="",children:w,onClick:p,ref:m,...x}){let y=C(e,Lc,"md"),b=t==="other"?"":C(r,C(t,Vc,"soft"),"primary"),k=C(r,Hc,"primary"),T=C(n,Bc,"full"),v=["inline-flex items-center justify-center font-medium leading-none border transition-colors duration-150 whitespace-nowrap",y.badge,T,b,p?"cursor-pointer select-none active:scale-[0.98] transition-transform duration-100":"",d].filter(Boolean).join(" "),u=c=>Fo("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${y.icon}`,"aria-hidden":"true",children:c});return Qf("span",{ref:m,role:p?"button":void 0,tabIndex:p?0:void 0,className:v,onClick:p,...x,children:[o&&Fo("span",{className:`relative inline-block shrink-0 rounded-full ${i?"animate-pulse":""} ${y.dot} ${k}`,"aria-hidden":"true"}),a&&u(a),w&&Fo("span",{className:"leading-none",children:w}),s&&!l&&u(s),l&&Fo("button",{type:"button",onClick:c=>{c.stopPropagation(),l()},"aria-label":h,className:`inline-flex items-center justify-center shrink-0 rounded-full hover:bg-black/10 active:bg-black/20 transition-colors p-0.5 -mr-0.5 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current ${y.deleteIcon}`,children:Fo(Oe,{className:"size-full"})})]})}import{useId as tp,useState as rp,useRef as np}from"react";import{useMergeRefs as op}from"@floating-ui/react";var Vi={xs:{wrapper:"h-6 text-[11px]",input:"px-2 py-0.5 text-[11px] leading-tight",icon:"size-3",iconPaddingLeft:"pl-6",iconPaddingRight:"pr-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{wrapper:"h-8 text-xs",input:"px-2.5 py-1 text-xs leading-normal",icon:"size-3.5",iconPaddingLeft:"pl-7.5",iconPaddingRight:"pr-7.5",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{wrapper:"h-10 text-sm",input:"px-3.5 py-2 text-sm leading-normal",icon:"size-[18px]",iconPaddingLeft:"pl-9",iconPaddingRight:"pr-9",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{wrapper:"h-12 text-base",input:"px-4 py-2.5 text-base leading-normal",icon:"size-5",iconPaddingLeft:"pl-11",iconPaddingRight:"pr-11",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{wrapper:"h-14 text-lg",input:"px-5 py-3 text-lg leading-normal",icon:"size-6",iconPaddingLeft:"pl-13",iconPaddingRight:"pr-13",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},Yn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Ac={none:"none",sm:"sm",md:"md",lg:"lg",xl:"xl",full:"full"},Oc={xs:{wrapper:"min-h-6 text-[11px] px-1.5 py-0.5",input:"text-[11px] leading-tight min-w-[50px]",gap:"gap-1",badgeSize:"xs",icon:"size-3",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{wrapper:"min-h-8 text-xs px-2 py-1",input:"text-xs leading-normal min-w-[60px]",gap:"gap-1",badgeSize:"xs",icon:"size-3.5",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{wrapper:"min-h-10 text-sm px-2.5 py-1.5",input:"text-sm leading-normal min-w-[70px]",gap:"gap-1.5",badgeSize:"sm",icon:"size-[18px]",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{wrapper:"min-h-12 text-base px-3 py-2",input:"text-base leading-normal min-w-[80px]",gap:"gap-1.5",badgeSize:"md",icon:"size-5",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{wrapper:"min-h-14 text-lg px-3.5 py-2.5",input:"text-lg leading-normal min-w-[90px]",gap:"gap-2",badgeSize:"lg",icon:"size-6",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},Wn={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}};var Gc={xs:{slot:"size-6 min-w-6",text:"text-xs",gap:"gap-1",label:"text-[11px] mb-1",helper:"text-[9px] mt-0.5"},sm:{slot:"size-8 min-w-8",text:"text-sm",gap:"gap-1.5",label:"text-xs mb-1",helper:"text-[10px] mt-0.5"},md:{slot:"size-10 min-w-10",text:"text-base font-semibold",gap:"gap-2",label:"text-sm mb-1.5",helper:"text-[11px] mt-1"},lg:{slot:"size-12 min-w-12",text:"text-lg font-semibold",gap:"gap-2.5",label:"text-base mb-1.5",helper:"text-xs mt-1"},xl:{slot:"size-14 min-w-14",text:"text-xl font-bold",gap:"gap-3",label:"text-lg mb-2",helper:"text-sm mt-1"}};import{useEffect as ep,useState as Ts}from"react";function Ds(e,t={}){let{exitDuration:r=250}=t,[n,o]=Ts(e),[i,a]=Ts(!1),[s,l]=Ts(e);return e!==s&&(l(e),e?(o(e),a(!1)):a(!0)),ep(()=>{if(!i)return;let h=setTimeout(()=>{o(void 0),a(!1)},r);return()=>clearTimeout(h)},[r,i]),{displayedError:n,isExiting:i}}import{jsx as Rs}from"react/jsx-runtime";function $e({id:e,helperText:t,errorMessage:r,sizeClassName:n="text-xs",className:o=""}){let{displayedError:i,isExiting:a}=Ds(r),s=i||t,l=!!(i||t),h=!!i;return Rs("div",{className:`grid transition-[grid-template-rows,opacity,margin] duration-200 ease-out overflow-hidden ${l?"grid-rows-[1fr] opacity-100 mt-1":"grid-rows-[0fr] opacity-0 mt-0 pointer-events-none"}`,"aria-live":"polite",children:Rs("div",{className:"overflow-hidden",children:Rs("div",{id:e,role:h?"alert":"status",className:`leading-tight transition-colors duration-200 font-normal ${n} ${h?a?"text-error-600 animate-error-out":"text-error-600 animate-error-in":"text-neutral-500 dark:text-neutral-400"} ${o}`,children:s||"\xA0"})})})}import{jsx as jc,jsxs as Yc}from"react/jsx-runtime";var Ns={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600",neutral:"text-neutral-500 group-focus-within/field:text-neutral-600"},Uc={xs:{label:"text-[11px] mb-1",floatingLabel:"text-[10px]"},sm:{label:"text-xs mb-1",floatingLabel:"text-[10px]"},md:{label:"text-sm mb-1.5",floatingLabel:"text-[11px]"},lg:{label:"text-base mb-1.5",floatingLabel:"text-xs"},xl:{label:"text-lg mb-2",floatingLabel:"text-xs"}};function at({label:e,children:t,htmlFor:r,id:n,isRequired:o=!1,isFloating:i,placement:a,size:s="md",sizeClassName:l,color:h="primary",hasError:d=!1,isInvalid:w=!1,cursor:p,className:m="",colorConfig:x=Ns}){let y=e??t;if(!y)return null;let b=i??a==="floating",k=!!(d||w),T=k?"error":h,v=k?"text-error-600 font-bold":x[T]||Ns[T]||Ns.primary,u=Uc[s]||Uc.md,c=l||(b?u.floatingLabel:u.label),g=p?`cursor-${p}`:b?"cursor-text":"";return b?Yc("label",{htmlFor:r,id:n,className:`absolute top-0 -translate-y-1/2 left-3 px-1.5 rounded-sm select-none z-10 font-bold bg-neutral-white transition-colors duration-150 ${g} ${c} ${v} ${m}`,children:[y,o&&jc("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):Yc("label",{htmlFor:r,id:n,className:`inline-flex items-center font-bold transition-colors duration-150 ${g} ${c} ${v} ${m}`,children:[y,o&&jc("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})}import{jsx as jt,jsxs as Ai}from"react/jsx-runtime";function Ct({size:e,variant:t,color:r,radius:n,label:o,labelPlacement:i="floating",config:a,helperText:s,errorMessage:l,leftIcon:h,leftAddon:d,rightIcon:w,rightAddon:p,onClear:m,wrapperClassName:x="",inputWrapperClassName:y="",labelClassName:b="",helperClassName:k="",id:T,value:v,defaultValue:u,onChange:c,disabled:g=!1,readOnly:f=!1,className:S="",type:D="text",placeholder:R,ref:P,...I}){let{isRequired:E=!1,isInvalid:N=!1,isLoading:M=!1,showSpinner:z=!1,isClearable:H=!1,isFullWidth:V=!1}=a??{},Y=tp(),$=T||Y,F=`${$}-error-helper`,G=np(null),A=op([G,P]),U=v!==void 0,[B,X]=rp(u),le=U?v:B,ne=ye=>{U||X(ye.target.value),c?.(ye)},ue=()=>{U||X(""),m?.()},ie=le!=null?String(le).length>0:!1,Q=!!(N||l),q=Q?"error":r,ge=C(e,Vi,"md"),ke=C(n,Yn,"md"),L=t==="other"?"":C(q,C(t,Wn,"outline"),"primary"),te=ye=>jt("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${ge.icon}`,"aria-hidden":"true",children:ye}),Z=i==="floating",he=()=>jt(at,{htmlFor:$,label:o,isRequired:E,isFloating:Z,size:e,color:q,hasError:Q,className:b}),ae=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2",ge.wrapper,ke,L,g?"opacity-50":"",V?"w-full":"w-auto",y].filter(Boolean).join(" "),ve=["w-full h-full bg-transparent outline-none border-none text-neutral-900 placeholder:text-neutral-400 disabled:cursor-not-allowed",ge.input,h?"pl-1.5":"",w||H||M?"pr-1.5":"",S].filter(Boolean).join(" ");return Ai("div",{className:`group/field flex ${i==="left"?"flex-row items-center gap-3":"flex-col"} ${V?"w-full":"inline-flex"} ${x}`,children:[!Z&&he(),Ai("div",{className:`flex flex-col ${V?"w-full":""}`,children:[Ai("div",{className:"flex items-stretch",children:[d&&jt("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-r-0 border-neutral-300 text-sm font-medium ${ke?`${ke} rounded-r-none`:""}`,children:d}),Ai("div",{className:`${ae} ${d?"rounded-l-none!":""} ${p?"rounded-r-none!":""}`,children:[Z&&he(),h&&jt("div",{className:"flex items-center justify-center pl-3 shrink-0",children:te(h)}),jt("input",{ref:A,id:$,type:D,value:le,onChange:ne,disabled:g||M,readOnly:f,"aria-invalid":Q,"aria-required":E,"aria-describedby":l||s?F:void 0,"aria-errormessage":l?F:void 0,"aria-busy":M,"aria-disabled":g||M,placeholder:R,className:ve,...I}),M&&z&&jt("div",{className:"flex items-center justify-center pr-3 shrink-0",children:te(jt(Ne,{}))}),!M&&H&&!g&&!f&&jt("button",{type:"button",onClick:ue,"aria-label":"X\xF3a n\u1ED9i dung",tabIndex:ie?0:-1,"aria-hidden":!ie,className:`inline-flex items-center justify-center mr-2 shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${ge.icon} ${ie?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:jt(Oe,{className:"size-full"})}),!M&&w&&jt("div",{className:"flex items-center justify-center pr-3 shrink-0",children:te(w)})]}),p&&jt("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-l-0 border-neutral-300 text-sm font-medium ${ke?`${ke} rounded-l-none`:""}`,children:p})]}),jt($e,{id:F,helperText:s,errorMessage:l,sizeClassName:ge.helper,className:k})]})]})}import{useState as ip}from"react";import{jsx as Kn,jsxs as Kc}from"react/jsx-runtime";function Ps({width:e=16,height:t=16,className:r="",...n}){return Kc("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Kn("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),Kn("circle",{cx:"12",cy:"12",r:"3"})]})}function Wc({width:e=16,height:t=16,className:r="",...n}){return Kc("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Kn("path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24"}),Kn("path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"}),Kn("path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"}),Kn("line",{x1:"2",x2:"22",y1:"2",y2:"22"})]})}var Lr=Ps;import{jsx as Oi}from"react/jsx-runtime";function zs({defaultVisible:e=!1,toggleAriaLabel:t="Hi\u1EC3n th\u1ECB/\u1EA9n m\u1EADt kh\u1EA9u",onVisibilityChange:r,rightIcon:n,disabled:o,readOnly:i,...a}){let[s,l]=ip(e);return Oi(Ct,{type:s?"text":"password",disabled:o,readOnly:i,rightIcon:n||Oi("button",{type:"button",onClick:()=>{if(o||i)return;let w=!s;l(w),r?.(w)},disabled:o||i,"aria-label":t,className:"inline-flex items-center justify-center size-full p-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-colors cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded",children:s?Oi(Wc,{className:"size-full"}):Oi(Ps,{className:"size-full"})}),...a})}import{useState as ap}from"react";function Br(e,t){if(e==null||e==="")return"";let r=t?.thousandSeparator??".",n=t?.decimalSeparator??",",o=t?.maxDecimalDigits??0,i=t?.min,a=t?.max,s=t?.clampMin??!1,l=t?.allowNegative??(i===void 0||i<0),h=String(e).trim();if(!h)return"";let d=l&&h.startsWith("-");if(d&&h==="-")return"-";if(o>0&&h.includes(n)){let b=h.split(n),k=b[0]?.replace(/\D/g,"")??"",T=b.slice(1).join("").replace(/\D/g,"").slice(0,o);if(k||T){let c=parseFloat(`${k||"0"}.${T||"0"}`);if(d&&(c=-c),a!==void 0&&!isNaN(c)&&c>a)return Br(a,{...t,max:void 0,min:void 0});if(i!==void 0&&!isNaN(c)&&c<i&&(s||d&&i<0))return Br(i,{...t,max:void 0,min:void 0})}let v=k?parseInt(k,10).toString().replace(/\B(?=(\d{3})+(?!\d))/g,r):"",u=d?"-":"";return b.length>1&&b[1]===""&&T===""?`${u}${v||"0"}${n}`:T.length>0?`${u}${v||"0"}${n}${T}`:`${u}${v}`}let w=h.replace(/\D/g,"");if(!w)return d?"-":"";let p=parseInt(w,10);if(isNaN(p))return"";d&&(p=-p),a!==void 0&&p>a&&(p=a),i!==void 0&&p<i&&(s||d&&i<0)&&(p=i);let m=p<0?"-":"",x=Math.abs(p).toString().replace(/\B(?=(\d{3})+(?!\d))/g,r);return`${m}${x}`}function _c(e,t){let r=t?.thousandSeparator??".";return e.split(r).join("")}function Hr(e,t){if(!e)return;let r=t?.thousandSeparator??".",n=t?.decimalSeparator??",",o=e.split(r).join("");if(n!=="."&&(o=o.split(n).join(".")),o=o.replace(/[^\d.-]/g,""),!o||o==="."||o==="-")return;let i=parseFloat(o);return isNaN(i)?void 0:i}function Is(e,t,r,n){let o=n?.decimalSeparator??",",i=0;for(let l=0;l<r&&l<e.length;l++){let h=e.charAt(l);(/\d/.test(h)||h===o||h==="-")&&i++}if(i===0)return 0;let a=t.length,s=0;for(let l=0;l<t.length;l++){let h=t.charAt(l);if((/\d/.test(h)||h===o||h==="-")&&s++,s===i){a=l+1;break}}return Math.min(a,t.length)}function Gi(e,t="numeric"){return t==="numeric"?/^\d$/.test(e):t==="alphanumeric"?/^[a-zA-Z0-9]$/.test(e):!0}function Ui(e,t="numeric"){return t==="numeric"?e.replace(/\D/g,""):t==="alphanumeric"?e.replace(/[^a-zA-Z0-9]/g,""):e}function ji(e,t=/[\r\n,;\t]+/,r=!0){return e?e.split(t).map(n=>r?n.trim():n).filter(Boolean):[]}import{jsx as sp}from"react/jsx-runtime";function dn({value:e,defaultValue:t,min:r,max:n,thousandSeparator:o=".",decimalSeparator:i=",",maxDecimalDigits:a=0,allowNegative:s,onChange:l,onClear:h,onBlur:d,ref:w,...p}){let m={max:n,min:r,thousandSeparator:o,decimalSeparator:i,maxDecimalDigits:a,allowNegative:s},x=e!==void 0,[y,b]=ap(t),k=x?e:y,T=Br(k,m),v=()=>{x||b(""),h?.()},u=g=>{let f=g.target,S=f.value,D=f.selectionStart||0,R=Br(S,m),P=Is(S,R,D,{decimalSeparator:i});if(x||b(R),f.value=R,l){let I={...g,target:f,currentTarget:f};l(I)}requestAnimationFrame(()=>{f&&f.setSelectionRange&&f.setSelectionRange(P,P)})},c=g=>{if(r!==void 0&&k!==void 0&&k!==null&&k!==""){let f=Hr(String(k),{thousandSeparator:o,decimalSeparator:i});if(f!==void 0&&f<r){let S=Br(r,{...m,clampMin:!0});if(x||b(S),l){g.target.value=S;let D={...g,target:g.target,currentTarget:g.target};l(D)}}}d?.(g)};return sp(Ct,{ref:w,type:"text",inputMode:a>0?"decimal":"numeric",value:T,onChange:u,onBlur:c,onClear:v,...p})}import{useId as lp,useState as cp,useEffect as up,useRef as dp,useImperativeHandle as fp}from"react";import{jsx as fn,jsxs as Eo}from"react/jsx-runtime";function Ms({ref:e,config:t,id:r,name:n,length:o=6,value:i,defaultValue:a="",onChange:s,onComplete:l,type:h="numeric",mask:d=!1,size:w="md",variant:p="outline",color:m="primary",radius:x,autoFocus:y=!1,disabled:b=!1,readOnly:k=!1,groupSize:T,separator:v="-",ariaLabel:u="One-time password",getSlotAriaLabel:c,allowOneTimeCode:g=!0,label:f,labelPlacement:S="top",helperText:D,errorMessage:R,className:P="",slotClassName:I="",wrapperClassName:E="",labelClassName:N="",helperClassName:M=""}){let{isRequired:z=!1,isInvalid:H=!1,isLoading:V=!1,showSpinner:Y=!1}=t??{},$=lp(),F=r||$,G=`${F}-slot-0`,A=`${F}-error-helper`,[U,B]=cp(()=>{let J=(i!==void 0?i:a).split("");return Array.from({length:o},(O,W)=>J[W]||"")}),X=dp([]),le=i!==void 0,ne=le?Array.from({length:o},(J,O)=>i&&i[O]!==void 0?i[O]:""):U,ue=!!(H||R),ie=ue?"error":m;up(()=>{if(y&&!b&&!k){let J=ne.findIndex(W=>!W),O=J!==-1?J:0;X.current[O]?.focus()}},[y,ne,b,k]),fp(e,()=>({getValue:()=>ne.join(""),clear:()=>{let J=Array(o).fill("");le||B(J),s?.(""),!b&&!k&&X.current[0]?.focus()},focus:(J=0)=>{let O=Math.max(0,Math.min(J,o-1));X.current[O]?.focus()}}),[ne,o,le,s,b,k]);let Q=J=>{le||B(J);let O=J.join("");s?.(O),J.every(W=>W.length>0)&&J.length===o&&l?.(O)},q=(J,O)=>{let W=Ui(J,h);if(!W)return;let we=[...ne],fe=W.length>=o?0:O,se=W.slice(0,o-fe).split("");se.forEach((De,xe)=>{fe+xe<o&&(we[fe+xe]=De)}),Q(we);let me=Math.min(fe+se.length,o-1);X.current[me]?.focus()},ge=(J,O)=>{if(b||k||V)return;let W=J.target.value;if(!W){let fe=[...ne];fe[O]="",Q(fe);return}if(W.length>1){q(W,O);return}let we=W.slice(-1);if(Gi(we,h)){let fe=[...ne];fe[O]=we,Q(fe),O<o-1&&X.current[O+1]?.focus()}},ke=(J,O)=>{if(!(b||k||V)){if(J.key==="Backspace"){J.preventDefault();let W=[...ne];ne[O]?(W[O]="",Q(W)):O>0&&(W[O-1]="",Q(W),X.current[O-1]?.focus())}else if(J.key==="Delete"){J.preventDefault();let W=[...ne];W[O]="",Q(W)}else if(J.key==="ArrowLeft")J.preventDefault(),O>0&&X.current[O-1]?.focus();else if(J.key==="ArrowRight")J.preventDefault(),O<o-1&&X.current[O+1]?.focus();else if((J.ctrlKey||J.metaKey)&&J.key.toLowerCase()==="c"){let W=ne.join("");W&&navigator.clipboard?.writeText(W)}else if((J.ctrlKey||J.metaKey)&&J.key.toLowerCase()==="x"){J.preventDefault();let W=ne.join("");W&&navigator.clipboard?.writeText(W);let we=Array(o).fill("");Q(we),X.current[0]?.focus()}}},L=(J,O)=>{if(b||k||V)return;J.preventDefault();let W=J.clipboardData.getData("text/plain");q(W,O)},te=C(w,Gc,"md"),Z=C(w,Vi,"md"),he=C(x,Yn,"md"),ae=p==="other"?"":C(ie,C(p,Wn,"outline"),"primary"),ve=b?"opacity-50":"",Se=()=>f?Eo("label",{htmlFor:G,className:`block font-medium text-neutral-700 select-none ${te.label} ${N}`,children:[f,z&&fn("span",{className:"text-error-500 ml-0.5",children:"*"})]}):null;return Eo("div",{className:`group/otp flex ${S==="left"?"flex-row items-start gap-3":"flex-col"} ${E}`,children:[Se(),Eo("div",{className:"flex flex-col",children:[Eo("div",{role:"group","aria-label":u,"aria-describedby":R||D?A:void 0,className:`inline-flex items-center ${te.gap} ${P}`,children:[Array.from({length:o}).map((J,O)=>{let W=!!(d||h==="password"),we=c?c(O,o):`K\xFD t\u1EF1 ${O+1} tr\xEAn ${o}`,fe=!!(T&&T>0)&&(O+1)%(T||1)===0&&O<o-1;return Eo("div",{className:"inline-flex items-center gap-1.5",children:[fn("input",{id:`${F}-slot-${O}`,ref:se=>{X.current[O]=se},type:W?"password":"text",inputMode:h==="numeric"?"numeric":"text",pattern:h==="numeric"?"[0-9]*":void 0,maxLength:1,value:ne[O]||"",onFocus:se=>se.target.select(),onChange:se=>ge(se,O),onKeyDown:se=>ke(se,O),onPaste:se=>L(se,O),disabled:b||V,readOnly:k,"aria-label":we,"aria-invalid":ue,"aria-required":z,"aria-busy":V,"aria-disabled":b||V,autoComplete:g?"one-time-code":"off",autoCorrect:"off",autoCapitalize:"none",spellCheck:!1,"data-1p-ignore":"true","data-lpignore":"true","data-form-type":"other",className:`border-2 text-center p-0 outline-none transition-all duration-150 ease-in-out text-neutral-900 ${te.slot} ${te.text} ${he} ${ae} ${ve} ${I}`}),fe&&fn("span",{"aria-hidden":"true",className:"inline-flex items-center justify-center text-neutral-400 select-none font-bold shrink-0",children:v})]},`${F}-slot-${O}`)}),V&&Y&&fn("div",{role:"status","aria-label":"\u0110ang t\u1EA3i",className:"inline-flex items-center justify-center pl-1.5 shrink-0 text-neutral-400",children:fn(Ne,{className:`animate-spin ${Z.icon}`})})]}),fn($e,{id:A,helperText:D,errorMessage:R,sizeClassName:te.helper,className:M}),n&&fn("input",{type:"hidden",name:n,value:ne.join(""),disabled:b||V})]})]})}import{useId as gp,useState as Fs,useRef as mp}from"react";import{useMergeRefs as bp}from"@floating-ui/react";import{jsx as Xc,jsxs as pp}from"react/jsx-runtime";function pr({width:e=14,height:t=14,className:r="",...n}){return pp("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Xc("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),Xc("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}import{Fragment as hp,jsx as st,jsxs as pn}from"react/jsx-runtime";function Es({size:e,variant:t,color:r,radius:n,label:o,labelPlacement:i="floating",config:a,helperText:s,errorMessage:l,leftIcon:h,leftAddon:d,rightIcon:w,rightAddon:p,onClear:m,wrapperClassName:x="",inputWrapperClassName:y="",labelClassName:b="",helperClassName:k="",id:T,name:v,value:u,defaultValue:c=[],onChange:g,inputValue:f,onInputValueChange:S,delimiters:D=["Enter"],showAddButton:R=!1,renderAddButton:P,addOnBlur:I=!1,addOnPaste:E=!0,pasteSplitRegex:N=/[\r\n,;\t]+/,trimValues:M=!0,allowDuplicates:z=!1,onDuplicate:H,maxTags:V,onMaxTagsReached:Y,maxTagLength:$,validateTag:F,onValidateError:G,maxTagCount:A,renderTag:U,tagVariant:B,tagColor:X,tagRadius:le,tagSize:ne,tagClassName:ue="",addButtonClassName:ie="",disabled:Q=!1,readOnly:q=!1,className:ge="",placeholder:ke="Nh\u1EADp v\xE0 nh\u1EA5n Enter...",autoFocus:L=!1,ref:te}){let{isRequired:Z=!1,isInvalid:he=!1,isLoading:ae=!1,showSpinner:ve=!1,isClearable:Se=!1,isFullWidth:ye=!1}=a??{},J=gp(),O=T||J,W=`${O}-error-helper`,we=o?`${O}-label`:void 0,fe=mp(null),se=bp([fe,te]),me=u!==void 0,[De,xe]=Fs(c),re=me?u||[]:De,de=f!==void 0,[ce,ee]=Fs(""),j=de?f||"":ce,[Ce,Ee]=Fs(""),Fe=Ie=>{de||ee(Ie),S?.(Ie)},oe=Ie=>{me||xe(Ie),g?.(Ie)},Te=Ie=>{if(Q||q||ae)return!1;let Ae=M?Ie.trim():Ie;if(!Ae)return!1;if($&&$>0&&Ae.length>$&&(Ae=Ae.slice(0,$)),V!==void 0&&re.length>=V)return Y?.(Ae),Ee(`Maximum limit of ${V} tags reached`),!1;if(!z&&re.includes(Ae))return H?.(Ae),Ee(`Tag "${Ae}" already exists`),!1;if(F){let pt=F(Ae);if(pt===!1||typeof pt=="string")return G?.(Ae,typeof pt=="string"?pt:void 0),Ee(`Tag "${Ae}" is invalid`),!1}let ut=[...re,Ae];return oe(ut),Fe(""),Ee(`Added tag "${Ae}"`),!0},Pe=Ie=>{if(Q||q||ae)return;let Ae=[...re],ut=new Set(re),pt=0;for(let Tr of Ie){let Et=M?Tr.trim():Tr;if(Et){if($&&$>0&&Et.length>$&&(Et=Et.slice(0,$)),V!==void 0&&Ae.length>=V){Y?.(Et);break}if(!z&&ut.has(Et)){H?.(Et);continue}if(F){let Gn=F(Et);if(Gn===!1||typeof Gn=="string"){G?.(Et,typeof Gn=="string"?Gn:void 0);continue}}Ae.push(Et),ut.add(Et),pt++}}oe(Ae),Fe(""),pt>0&&Ee(`Added ${pt} tags`)},_e=Ie=>{if(Q||q||ae)return;let Ae=re[Ie],ut=re.filter((pt,Tr)=>Tr!==Ie);oe(ut),Ae&&Ee(`Removed tag "${Ae}"`)},Ue=Ie=>{Ie?.stopPropagation(),!(Q||q||ae)&&(oe([]),Fe(""),Ee("Removed all tags"),m?.(),fe.current?.focus())},Le=Ie=>{if(Q||q||ae)return;D.includes(Ie.key)||D.includes("Enter")&&Ie.key==="Enter"||D.includes("Comma")&&(Ie.key===","||Ie.key==="Comma")||D.includes("Tab")&&Ie.key==="Tab"||D.includes("Space")&&(Ie.key===" "||Ie.key==="Space")?j&&(Ie.preventDefault(),Te(j)):Ie.key==="Backspace"&&j===""&&re.length>0&&(Ie.preventDefault(),_e(re.length-1))},Be=Ie=>{if(!(Q||q||ae)&&E){let Ae=Ie.clipboardData.getData("text");if(Ae){let ut=ji(Ae,N,M);(ut.length>1||N.test(Ae))&&(Ie.preventDefault(),Pe(ut))}}},Ke=()=>{I&&j.trim()&&Te(j)},K=re.length>0||j.length>0,_=!!(he||l),ze=_?"error":r,pe=C(e,Oc,"md"),Me=C(n,Yn,"md"),Xe=le||C(n,Ac,"md"),He=ne||pe.badgeSize||"sm",Ze=X||r,qe=B||t,Re=t==="other"?"":C(ze,C(t,Wn,"outline"),"primary"),Ye=i==="floating",be=Ie=>st("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${pe.icon}`,"aria-hidden":"true",children:Ie}),Ve=()=>st(at,{id:we,htmlFor:O,label:o,isRequired:Z,isFloating:Ye,size:e,color:ze,hasError:_,className:b}),rt=A&&A>0?re.slice(0,A):re,Je=A&&A>0?Math.max(0,re.length-A):0,Tt=Q?"opacity-50 cursor-not-allowed pointer-events-none":"cursor-text",Ft=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2",pe.wrapper,Me,Re,Tt,ye?"w-full":"w-auto min-w-[200px]",y].filter(Boolean).join(" "),ot=i==="left",Dt=V===void 0||re.length<V,cn=R&&!Q&&!q;return pn("div",{role:"group","aria-labelledby":we,className:`group/field flex ${ot?"flex-row items-center gap-3":"flex-col"} ${ye?"w-full":"inline-flex"} ${x}`,children:[st("span",{className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true",children:Ce}),!Ye&&Ve(),pn("div",{className:`flex flex-col ${ye?"w-full":""}`,children:[pn("div",{className:"flex items-stretch",children:[d&&st("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-r-0 border-neutral-300 text-sm font-medium ${Me?`${Me} rounded-r-none`:""}`,children:d}),pn("div",{className:`${Ft} ${d?"rounded-l-none!":""} ${p?"rounded-r-none!":""}`,children:[Ye&&Ve(),h&&st("div",{className:"flex items-center justify-center pl-1 pr-1.5 shrink-0",children:be(h)}),pn("div",{className:`flex flex-wrap items-center flex-1 min-w-0 ${pe.gap}`,children:[(()=>{let Ie=new Map;return rt.map((Ae,ut)=>{let pt=(Ie.get(Ae)??0)+1;Ie.set(Ae,pt);let Tr=`${Ae}_${pt}`;return U?st("span",{className:"inline-flex shrink-0",children:U({value:Ae,index:ut,onRemove:()=>_e(ut),disabled:Q,readOnly:q})},Tr):st("span",{className:"inline-flex shrink-0",children:st($t,{size:He,variant:qe,color:Ze,radius:Xe,deleteAriaLabel:`Remove tag ${Ae}`,onDelete:!Q&&!q?()=>_e(ut):void 0,className:`shrink-0 max-w-full truncate select-none ${ue}`,children:Ae})},Tr)})})(),Je>0&&st("span",{className:"inline-flex shrink-0",children:pn($t,{size:He,variant:"filled",color:"neutral",radius:Xe,className:"shrink-0 font-medium select-none",children:["+",Je]})}),Dt?st("input",{ref:se,id:O,type:"text",value:j,onChange:Ie=>Fe(Ie.target.value),onKeyDown:Le,onPaste:Be,onBlur:Ke,disabled:Q||ae,readOnly:q,autoFocus:L,"aria-invalid":_,"aria-required":Z,"aria-describedby":l||s?W:void 0,"aria-errormessage":l?W:void 0,"aria-busy":ae,"aria-disabled":Q||ae,"aria-autocomplete":"none",placeholder:re.length===0?ke:"",className:`flex-1 bg-transparent outline-none border-none text-neutral-900 placeholder:text-neutral-400 disabled:cursor-not-allowed ${pe.input} ${ge}`}):null]}),cn&&st("div",{className:"flex items-center justify-center pl-1.5 shrink-0",children:P?P({onAdd:()=>Te(j),disabled:!j.trim()||!Dt}):st("button",{type:"button",onClick:Ie=>{Ie.stopPropagation(),j.trim()&&Dt?Te(j):fe.current?.focus()},disabled:!j.trim()||!Dt,"aria-label":"Th\xEAm th\u1EBB",className:`inline-flex items-center justify-center p-1 rounded hover:bg-neutral-200 active:scale-95 disabled:opacity-40 disabled:pointer-events-none transition-all cursor-pointer text-neutral-600 hover:text-neutral-900 ${ie}`,children:st(pr,{className:pe.icon})})}),ae&&ve&&st("div",{className:"flex items-center justify-center pl-1.5 shrink-0",role:"status","aria-label":"\u0110ang t\u1EA3i",children:be(st(Ne,{}))}),!ae&&Se&&!Q&&!q&&st("button",{type:"button",onClick:Ue,"aria-label":"X\xF3a t\u1EA5t c\u1EA3 c\xE1c th\u1EBB",tabIndex:K?0:-1,"aria-hidden":!K,className:`inline-flex items-center justify-center pl-1.5 shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${pe.icon} ${K?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:st(Oe,{className:"size-full"})}),!ae&&w&&st("div",{className:"flex items-center justify-center pl-1.5 shrink-0",children:be(w)})]}),p&&st("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-l-0 border-neutral-300 text-sm font-medium ${Me?`${Me} rounded-l-none`:""}`,children:p})]}),st($e,{id:W,helperText:s,errorMessage:l,sizeClassName:pe.helper,className:k}),v&&(()=>{let Ie=new Map;return pn(hp,{children:[re.map(Ae=>{let ut=(Ie.get(Ae)??0)+1;Ie.set(Ae,ut);let pt=`${Ae}_${ut}`;return st("input",{type:"hidden",name:`${v}[]`,value:Ae,disabled:Q||ae},`hidden_${pt}`)}),re.length===0&&st("input",{type:"hidden",name:v,value:"",disabled:Q||ae})]})})()]})]})}import{useId as xp,useState as vp,useRef as yp}from"react";import wp from"react-textarea-autosize";import{useMergeRefs as Cp}from"@floating-ui/react";var qc={xs:{textarea:"text-[11px] px-2 py-1 leading-tight",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{textarea:"text-xs px-2.5 py-1.5 leading-normal",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{textarea:"text-sm px-3.5 py-2 leading-normal",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{textarea:"text-base px-4 py-2.5 leading-normal",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{textarea:"text-lg px-5 py-3 leading-normal",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},Zc={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Jc={none:"resize-none",vertical:"resize-y",horizontal:"resize-x",both:"resize"},Qc={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-error-50/60 border border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-50/60 border border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},ghost:{primary:"bg-transparent border border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-transparent border border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-transparent border border-transparent hover:bg-neutral-100/50 focus-within:bg-neutral-100/50 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"}};import{jsx as Vr,jsxs as Yi}from"react/jsx-runtime";function $s({size:e,variant:t,color:r,radius:n,label:o,labelPlacement:i="floating",config:a,helperText:s,errorMessage:l,onClear:h,minRows:d=3,maxRows:w,onHeightChange:p,cacheMeasurements:m,resize:x="none",wrapperClassName:y="",textareaWrapperClassName:b="",labelClassName:k="",helperClassName:T="",countClassName:v="",id:u,value:c,defaultValue:g,onChange:f,disabled:S=!1,readOnly:D=!1,className:R="",placeholder:P,maxLength:I,ref:E,style:N,...M}){let{isRequired:z=!1,isInvalid:H=!1,isLoading:V=!1,showSpinner:Y=!1,isClearable:$=!1,showCount:F=!1,isFullWidth:G=!1,autoResize:A=!0}=a??{},U=xp(),B=u||U,X=`${B}-error-helper`,le=yp(null),[ne,ue]=vp(g),ie=Cp([le,E]),Q=c!==void 0,q=Q?c:ne,ge=!!(H||l),ke=ge?"error":r,L=C(e,qc,"md"),te=C(n,Zc,"md"),Z=A?"resize-none":C(x,Jc,"none"),he=t==="other"?"":C(ke,C(t,Qc,"outline"),"primary"),ae=q!=null?String(q).length:0,ve=ae>0,Se=De=>{let xe=De.target.value;I!==void 0&&xe.length>I&&(xe=xe.slice(0,I),De.target.value=xe),Q||ue(xe),f?.(De)},ye=()=>{Q||ue(""),h?.()},J=i==="floating",O=()=>Vr(at,{htmlFor:B,label:o,isRequired:z,isFloating:J,size:e,color:ke,hasError:ge,className:k}),W=["group/textarea relative flex flex-col transition-all duration-150 ease-in-out border-2",te,he,S?"opacity-50":"",G?"w-full":"w-auto",b].filter(Boolean).join(" "),we=$||V&&Y,fe=["w-full bg-transparent outline-none border-none text-neutral-900 placeholder:text-neutral-400 disabled:cursor-not-allowed ui-scrollbar",L.textarea,we?"pr-8":"",F?"pb-6":"",Z,R].filter(Boolean).join(" "),se=i==="left",me={id:B,value:q,onChange:Se,disabled:S||V,readOnly:D,maxLength:I,"aria-invalid":ge,"aria-required":z,"aria-describedby":l||s?X:void 0,"aria-errormessage":l?X:void 0,"aria-busy":V,"aria-disabled":S||V,placeholder:P,className:fe,style:N,...M};return Yi("div",{className:`group/field flex ${se?"flex-row items-start gap-3":"flex-col"} ${J?"pt-2":""} ${G?"w-full":"inline-flex"} ${y}`,children:[!J&&O(),Yi("div",{className:`flex flex-col ${G?"w-full":""}`,children:[Yi("div",{className:W,children:[J&&O(),A?Vr(wp,{ref:ie,minRows:d,maxRows:w,onHeightChange:p,cacheMeasurements:m,...me}):Vr("textarea",{ref:ie,rows:d,...me}),V&&Y&&Vr("div",{className:"absolute top-2.5 right-2.5 text-neutral-400 size-4 select-none pointer-events-none",children:Vr(Ne,{className:"size-full animate-spin"})}),!V&&$&&!S&&!D&&Vr("button",{type:"button",onClick:ye,"aria-label":"X\xF3a n\u1ED9i dung",tabIndex:ve?0:-1,"aria-hidden":!ve,className:`absolute top-2.5 right-2.5 inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full size-4 ${ve?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:Vr(Oe,{className:"size-full"})}),F&&Yi("div",{className:`absolute bottom-2 right-2.5 text-[11px] font-mono select-none pointer-events-none z-10 text-neutral-400 ${v}`,children:[ae,I!==void 0&&`/${I}`]})]}),Vr($e,{id:X,helperText:s,errorMessage:l,sizeClassName:L.helper,className:T})]})]})}import{useId as kp,useState as Sp}from"react";var Wi={xs:{box:"size-3.5",icon:"size-2.5",label:"text-xs leading-4",gap:"gap-1.5",helper:"text-[10px]"},sm:{box:"size-4",icon:"size-3",label:"text-sm leading-4",gap:"gap-2",helper:"text-[11px]"},md:{box:"size-5",icon:"size-3.5",label:"text-sm leading-5",gap:"gap-2.5",helper:"text-xs"},lg:{box:"size-6",icon:"size-4",label:"text-base leading-6",gap:"gap-3",helper:"text-xs"},xl:{box:"size-7",icon:"size-5",label:"text-lg leading-7",gap:"gap-3.5",helper:"text-sm"}},eu={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},tu={filled:{primary:"bg-primary-600 text-neutral-white border-primary-600 dark:bg-primary-500 dark:border-primary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-600 text-neutral-white border-secondary-600 dark:bg-secondary-500 dark:border-secondary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-600 text-neutral-white border-error-600 dark:bg-error-500 dark:border-error-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-600 text-neutral-white border-success-600 dark:bg-success-500 dark:border-success-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-500 text-neutral-950 border-warning-500 dark:bg-warning-400 dark:border-warning-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-600 text-neutral-white border-info-600 dark:bg-info-500 dark:border-info-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-800 text-neutral-white border-neutral-800 dark:bg-neutral-200 dark:text-neutral-900 dark:border-neutral-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},outline:{primary:"bg-transparent text-primary-600 border-2 border-primary-600 hover:bg-primary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-transparent text-secondary-600 border-2 border-secondary-600 hover:bg-secondary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-transparent text-error-600 border-2 border-error-600 hover:bg-error-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-transparent text-success-600 border-2 border-success-600 hover:bg-success-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-transparent text-warning-700 border-2 border-warning-500 hover:bg-warning-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-transparent text-info-600 border-2 border-info-600 hover:bg-info-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-transparent text-neutral-800 border-2 border-neutral-800 hover:bg-neutral-100/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},soft:{primary:"bg-primary-100 text-primary-800 border-primary-300 hover:bg-primary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-100 text-secondary-800 border-secondary-300 hover:bg-secondary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-100 text-error-800 border-error-300 hover:bg-error-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-100 text-success-800 border-success-300 hover:bg-success-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-100 text-warning-900 border-warning-300 hover:bg-warning-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-100 text-info-800 border-info-300 hover:bg-info-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-100 text-neutral-800 border-neutral-300 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"}},ru={horizontal:"flex flex-row flex-wrap gap-4 items-center",vertical:"flex flex-col gap-2.5"},nu={xs:"sm",sm:"sm",md:"md",lg:"md",xl:"lg"};import{jsx as ou}from"react/jsx-runtime";function Ar({width:e=14,height:t=14,className:r="",...n}){return ou("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:ou("polyline",{points:"20 6 9 17 4 12"})})}import{jsx as iu}from"react/jsx-runtime";function Ki({width:e=14,height:t=14,className:r="",...n}){return iu("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:iu("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})}import{jsx as gr,jsxs as Ls}from"react/jsx-runtime";function mr({size:e="md",variant:t="filled",color:r="primary",radius:n,config:o,label:i,children:a,helperText:s,errorMessage:l,labelPlacement:h="right",icon:d,indeterminateIcon:w,wrapperClassName:p="",boxClassName:m="",labelClassName:x="",helperClassName:y="",className:b="",checked:k,defaultChecked:T,disabled:v=!1,readOnly:u=!1,onChange:c,value:g,id:f,name:S,ref:D,...R}){let{isRequired:P=!1,isInvalid:I=!1,isLoading:E=!1,showSpinner:N=!1,indeterminate:M=!1}=o??{},z=i||a,H=kp(),V=f||H,Y=`${V}-helper`,$=!!(I??!!l),F=k!==void 0,[G,A]=Sp(T??!1),U=F?k:G,B=Z=>{v||u||E||(F||A(Z.target.checked),c?.(Z))},X=C(e,Wi,"md"),le=C(n,eu,"md"),ne=U||M,ue=C(t==="other"?"filled":t,tu,"filled"),ie;t==="other"?ie="":ne?ie=C(r,ue,"primary"):ie="bg-neutral-white border-neutral-300 hover:border-neutral-400 dark:bg-neutral-900 dark:border-neutral-700 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",$&&(ie=ne?C("error",ue,"primary"):"bg-neutral-white border-error-500 hover:border-error-600 text-error-600 dark:bg-neutral-900 dark:border-error-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500");let Q=["inline-flex items-center justify-center shrink-0 border transition-all duration-150 select-none",X.box,le,ie,!v&&!u&&!E?"active:scale-95":"",m].filter(Boolean).join(" "),q=["select-none font-medium text-neutral-900 dark:text-neutral-100 transition-colors",X.label,v?"opacity-60":"",x].filter(Boolean).join(" "),ge=["group inline-flex relative",h==="left"?"flex-row-reverse justify-between":"flex-row",X.gap,v?"opacity-50":"cursor-pointer",p,b].filter(Boolean).join(" "),ke=()=>E&&N?gr("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${X.icon}`,"aria-hidden":"true",children:gr(Ne,{className:"size-full animate-spin"})}):M?gr("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${X.icon}`,"aria-hidden":"true",children:w||gr(Ki,{className:"size-full"})}):U?gr("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${X.icon}`,"aria-hidden":"true",children:d||gr(Ar,{className:"size-full"})}):null,L=!!z,te=Z=>{(v||u||E)&&Z.preventDefault()};return Ls("div",{className:`inline-flex flex-col ${b}`.trim(),children:[Ls("label",{className:ge,onClick:te,children:[gr("input",{ref:D,type:"checkbox",id:V,name:S,value:g,checked:U,disabled:v||E,readOnly:u,required:P,"aria-checked":M?"mixed":U,"aria-invalid":$,"aria-required":P,"aria-busy":E,"aria-disabled":v||E,"aria-describedby":l||s?Y:void 0,onChange:B,className:"sr-only peer",...R}),gr("span",{className:Q,"aria-hidden":"true",children:ke()}),L&&Ls("span",{className:q,children:[z,P&&gr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})]}),gr($e,{id:Y,helperText:s,errorMessage:l,sizeClassName:X.helper,className:y})]})}import{useState as $o,useId as Rp,useMemo as uu,useCallback as Np}from"react";var Qe={BASE:0,STICKY:10,DROPDOWN:50,POPOVER:50,SELECT:50,PICKER:50,TOOLTIP:60,SELECT_FILTER:100,MAX:99999};import{useRef as au,useEffect as su,useCallback as lu}from"react";function gn(e,t=300){let r=au(e),n=au(null);su(()=>{r.current=e},[e]);let o=lu(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return su(()=>o,[o]),{debounced:lu((...a)=>{o(),n.current=setTimeout(()=>{r.current(...a)},t)},[o,t]),cancel:o}}import{jsx as cu,jsxs as Dp}from"react/jsx-runtime";function Tp({width:e=16,height:t=16,className:r="",...n}){return Dp("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[cu("circle",{cx:"11",cy:"11",r:"8"}),cu("line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"})]})}var mn=Tp;import{jsx as Dr,jsxs as du}from"react/jsx-runtime";var Pp=[],zp=[];function bn({value:e,defaultValue:t=zp,onChange:r,size:n="md",color:o="primary",variant:i="filled",radius:a,disabled:s=!1,label:l,helperText:h,errorMessage:d,orientation:w="vertical",labelPlacement:p="right",className:m="",wrapperClassName:x="",labelClassName:y="",helperClassName:b="",options:k=Pp,config:T,searchMode:v="client",searchPlaceholder:u="T\xECm ki\u1EBFm...",searchValue:c,defaultSearchValue:g="",onSearchChange:f,searchClassName:S="",searchField:D="label",filterFn:R,onSearch:P,debounceMs:I=300,emptyText:E="Kh\xF4ng t\xECm th\u1EA5y k\u1EBFt qu\u1EA3",children:N,ref:M,...z}){let{isRequired:H=!1,isInvalid:V,isLoading:Y=!1,showSpinner:$=!1,isReadOnly:F=!1,searchable:G=!1,preserveSelected:A=!0,isSearching:U}=T??{},B=Rp(),X=`${B}-label`,le=`${B}-helper`,ne=`${B}-search`,ue=e!==void 0,[ie,Q]=$o(t),q=ue?e:ie,ge=!!(V??!!d),ke=c!==void 0,[L,te]=$o(g),Z=ke?c:L,[he,ae]=$o(null),[ve,Se]=$o(!1),ye=!!(U??ve),[J,O]=$o(()=>{let ee=new Map;return k.forEach(j=>{ee.set(String(j.value),j)}),ee}),{debounced:W}=gn(async ee=>{if(!(v!=="server"||!P))try{Se(!0);let j=await P(ee);Array.isArray(j)&&ae(j)}catch(j){console.error("Error fetching search options:",j)}finally{Se(!1)}},I),we=ee=>{let j=ee.target.value;ke||te(j),f?.(j),v==="server"&&W(j)},fe=()=>{ke||te(""),f?.(""),v==="server"&&W("")},se=uu(()=>{let ee=Z.trim(),j=v==="server"&&he?he:k;if(!G||!ee)return j;let Ce;if(v==="server"?Ce=j:R?Ce=j.filter(oe=>R(oe,ee)):Ce=un(j,ee,D),!A)return Ce;let Ee=new Set(Ce.map(oe=>String(oe.value))),Fe=[];for(let oe of q)if(!Ee.has(oe)){let Te=J.get(oe);Te?Fe.push(Te):Fe.push({value:oe,label:oe})}return[...Fe,...Ce]},[G,Z,v,he,k,R,D,A,q,J]),me=Np((ee,j)=>{if(s||F||Y)return;if(j){let Fe=(v==="server"&&he?he:k).find(oe=>String(oe.value)===ee);Fe&&O(oe=>{if(oe.has(ee))return oe;let Te=new Map(oe);return Te.set(ee,Fe),Te})}let Ce;j?Ce=[...q,ee]:Ce=q.filter(Ee=>Ee!==ee),ue||Q(Ce),r?.(Ce)},[s,F,Y,q,ue,r,k,v,he]),De=C(w,ru,"vertical"),xe=["text-sm font-semibold text-neutral-900 dark:text-neutral-100 mb-1.5 select-none",s?"opacity-60":"",y].filter(Boolean).join(" "),re=C(n,Wi,"md"),de=C(n,nu,"md"),ce=uu(()=>new Set(q.map(String)),[q]);return du("div",{ref:M,role:"group","aria-labelledby":l?X:void 0,"aria-describedby":d||h?le:void 0,"aria-disabled":s||Y?"true":void 0,"aria-busy":Y||ye?"true":void 0,className:`inline-flex flex-col ${x}`,...z,children:[l&&du("span",{id:X,className:xe,children:[l,H&&Dr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),G&&Dr("div",{className:`mb-2.5 ${S}`,children:Dr(Ct,{id:ne,variant:"outline",size:de,color:o,value:Z,onChange:we,placeholder:u,disabled:s,leftIcon:Dr(mn,{className:"size-4 text-neutral-400"}),rightIcon:ye?Dr(Ne,{className:"size-4 animate-spin text-neutral-400"}):void 0,onClear:fe,"aria-label":typeof l=="string"?`T\xECm ki\u1EBFm ${l}`:"T\xECm ki\u1EBFm",config:{isClearable:!ye,isFullWidth:!0}})}),Dr("div",{className:`${De} ${m}`,children:N||(se.length>0?se.map(ee=>{let j=String(ee.value),Ce=ce.has(j);return Dr(mr,{value:ee.value,label:ee.label,helperText:ee.description,disabled:s||!!ee.disabled,readOnly:F||!!ee.isReadOnly,size:n,color:o,variant:i,radius:a,labelPlacement:p,checked:Ce,onChange:Ee=>me(j,Ee.target.checked),config:{indeterminate:ee.indeterminate,isLoading:Y,showSpinner:$,isInvalid:ge,isRequired:H}},ee.value)}):Dr("div",{className:"py-2 text-xs text-neutral-500 dark:text-neutral-400 italic",children:!Z.trim()&&v==="server"?"Nh\u1EADp t\u1EEB kh\xF3a \u0111\u1EC3 t\xECm ki\u1EBFm...":E}))}),Dr($e,{id:le,helperText:h,errorMessage:d,sizeClassName:re.helper,className:b})]})}import{useId as Ip,useState as Mp}from"react";var Xi={xs:{box:"size-3.5",dot:"size-1.5",label:"text-xs leading-4",gap:"gap-1.5",helper:"text-[10px]"},sm:{box:"size-4",dot:"size-2",label:"text-sm leading-4",gap:"gap-2",helper:"text-[11px]"},md:{box:"size-5",dot:"size-2.5",label:"text-sm leading-5",gap:"gap-2.5",helper:"text-xs"},lg:{box:"size-6",dot:"size-3",label:"text-base leading-6",gap:"gap-3",helper:"text-xs"},xl:{box:"size-7",dot:"size-3.5",label:"text-lg leading-7",gap:"gap-3.5",helper:"text-sm"}},qi={filled:{primary:"bg-primary-600 text-neutral-white border-primary-600 dark:bg-primary-500 dark:border-primary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-600 text-neutral-white border-secondary-600 dark:bg-secondary-500 dark:border-secondary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-600 text-neutral-white border-error-600 dark:bg-error-500 dark:border-error-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-600 text-neutral-white border-success-600 dark:bg-success-500 dark:border-success-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-500 text-neutral-950 border-warning-500 dark:bg-warning-400 dark:border-warning-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-600 text-neutral-white border-info-600 dark:bg-info-500 dark:border-info-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-800 text-neutral-white border-neutral-800 dark:bg-neutral-200 dark:text-neutral-900 dark:border-neutral-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},outline:{primary:"bg-transparent text-primary-600 border-2 border-primary-600 hover:bg-primary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-transparent text-secondary-600 border-2 border-secondary-600 hover:bg-secondary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-transparent text-error-600 border-2 border-error-600 hover:bg-error-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-transparent text-success-600 border-2 border-success-600 hover:bg-success-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-transparent text-warning-700 border-2 border-warning-500 hover:bg-warning-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-transparent text-info-600 border-2 border-info-600 hover:bg-info-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-transparent text-neutral-800 border-2 border-neutral-800 hover:bg-neutral-100/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},soft:{primary:"bg-primary-100 text-primary-800 border-primary-300 hover:bg-primary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-100 text-secondary-800 border-secondary-300 hover:bg-secondary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-100 text-error-800 border-error-300 hover:bg-error-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-100 text-success-800 border-success-300 hover:bg-success-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-100 text-warning-900 border-warning-300 hover:bg-warning-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-100 text-info-800 border-info-300 hover:bg-info-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-100 text-neutral-800 border-neutral-300 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"}},fu={horizontal:"flex flex-row flex-wrap gap-4 items-center",vertical:"flex flex-col gap-2.5"},pu={xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"xl"};import{jsx as gu}from"react/jsx-runtime";function Zi({className:e}){return gu("svg",{viewBox:"0 0 10 10",className:e,fill:"currentColor","aria-hidden":"true",children:gu("circle",{cx:"5",cy:"5",r:"5"})})}import{jsx as Or,jsxs as Bs}from"react/jsx-runtime";function Lo({size:e="md",variant:t="filled",color:r="primary",disabled:n=!1,readOnly:o=!1,config:i,labelPlacement:a="right",label:s,helperText:l,errorMessage:h,dotIcon:d,wrapperClassName:w="",boxClassName:p="",labelClassName:m="",helperClassName:x="",className:y="",checked:b,defaultChecked:k=!1,onChange:T,value:v,id:u,name:c,ref:g,...f}){let{isRequired:S=!1,isInvalid:D=!1,isLoading:R=!1}=i??{},P=Ip(),I=u||P,E=`${I}-helper`,N=b!==void 0,[M,z]=Mp(k),H=N?b:M,V=!!(D||h),Y=ie=>{n||o||R||(N||z(ie.target.checked),T?.(ie))},$=C(e,Xi,"md"),F=t==="other"?"":C(r,C(t,qi,"filled"),"primary"),G=V?qi[t==="other"?"filled":t]?.error||qi.filled.error:H?F:"bg-neutral-white border-neutral-300 hover:border-neutral-400 dark:bg-neutral-900 dark:border-neutral-700 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",A=["inline-flex items-center justify-center shrink-0 border rounded-full transition-all duration-150 select-none",$.box,G,!n&&!o&&!R?"active:scale-95":"",p].filter(Boolean).join(" "),U=["select-none font-medium text-neutral-900 dark:text-neutral-100 transition-colors",$.label,n?"opacity-60":"",m].filter(Boolean).join(" "),B=["group inline-flex relative",a==="left"?"flex-row-reverse justify-between":"flex-row",$.gap,n?"cursor-not-allowed opacity-60":"cursor-pointer",w,y].filter(Boolean).join(" "),X=()=>R?Or("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${$.dot}`,"aria-hidden":"true",children:Or(Ne,{className:"size-full animate-spin"})}):H?Or("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${$.dot}`,"aria-hidden":"true",children:d||Or(Zi,{className:"size-full"})}):null,le=!!s;return Bs("div",{className:"inline-flex flex-col",children:[Bs("label",{className:B,onClick:ie=>{(n||o||R)&&ie.preventDefault()},children:[Or("input",{ref:g,type:"radio",id:I,name:c,value:v,checked:H,disabled:n||R,readOnly:o,required:S,"aria-busy":R,"aria-disabled":n||R,"aria-describedby":h||l?E:void 0,onChange:Y,onClick:ie=>{if(n||o||R){ie.preventDefault();return}f.onClick?.(ie)},className:"sr-only peer",...f}),Or("span",{className:A,"aria-hidden":"true",children:X()}),le&&Bs("span",{className:U,children:[s,S&&Or("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})]}),Or($e,{id:E,helperText:l,errorMessage:h,sizeClassName:$.helper,className:x})]})}import{useState as Bo,useId as mu,useMemo as Fp,useCallback as Ep}from"react";import{jsx as Rr,jsxs as bu}from"react/jsx-runtime";var $p=[];function Hs({options:e=$p,value:t,defaultValue:r=null,onChange:n,size:o="md",color:i="primary",variant:a="filled",disabled:s=!1,label:l,helperText:h,errorMessage:d,orientation:w="vertical",labelPlacement:p="right",className:m="",wrapperClassName:x="",labelClassName:y="",helperClassName:b="",config:k,searchPlaceholder:T="T\xECm ki\u1EBFm...",searchValue:v,onSearchChange:u,searchMode:c="client",searchField:g="label",filterFn:f,onSearch:S,debounceMs:D=300,emptyText:R="Kh\xF4ng t\xECm th\u1EA5y k\u1EBFt qu\u1EA3",searchClassName:P="",searchInputSize:I,ref:E,...N}){let{isRequired:M=!1,isInvalid:z,isLoading:H=!1,isReadOnly:V=!1,searchable:Y=!1,preserveSelected:$=!0,isSearching:F}=k??{},G=mu(),A=`${G}-label`,U=`${G}-helper`,B=`${G}-search`,X=mu(),le=t!==void 0,[ne,ue]=Bo(r??null),ie=le?t:ne,Q=!!(z||d),q=v!==void 0,[ge,ke]=Bo(""),L=q?v:ge,[te,Z]=Bo(!1),he=F??te,[ae,ve]=Bo(null),[Se,ye]=Bo(()=>{let re=new Map;return e.forEach(de=>{re.set(String(de.value),de)}),re}),{debounced:J}=gn(async re=>{if(!(c!=="server"||!S))try{Z(!0);let de=await S(re);Array.isArray(de)&&ve(de)}catch(de){console.error("Error fetching radio search options:",de)}finally{Z(!1)}},D),O=re=>{let de=re.target.value;q||ke(de),u?.(de),c==="server"&&J(de)},W=()=>{q||ke(""),u?.(""),c==="server"&&ve(null)},we=Fp(()=>{let re=L.trim(),de=c==="server"&&ae?ae:e;if(!Y||!re)return de;let ce;if(c==="server"?ce=de:f?ce=de.filter(Ce=>f(Ce,re)):ce=un(de,re,g),!$||ie===null||ie===void 0)return ce;let ee=String(ie);if(!ce.some(Ce=>String(Ce.value)===ee)){let Ce=Se.get(ee);return Ce?[Ce,...ce]:[{value:ee,label:ee},...ce]}return ce},[Y,L,c,ae,e,f,g,$,ie,Se]),fe=Ep(re=>{if(s||V||H)return;let ce=(c==="server"&&ae?ae:e).find(ee=>String(ee.value)===re);ce&&ye(ee=>{if(ee.has(re))return ee;let j=new Map(ee);return j.set(re,ce),j}),le||ue(re),n?.(re)},[s,V,H,le,n,e,c,ae]),se=C(w,fu,"vertical"),me=C(o,Xi,"md"),De=I??C(o,pu,"md"),xe=["text-sm font-semibold text-neutral-900 dark:text-neutral-100 mb-1.5 select-none",s?"opacity-60":"",y].filter(Boolean).join(" ");return bu("div",{ref:E,role:"radiogroup","aria-labelledby":l?A:void 0,"aria-describedby":d||h?U:void 0,"aria-errormessage":d?U:void 0,"aria-orientation":w,"aria-required":M?"true":void 0,"aria-invalid":Q?"true":void 0,"aria-disabled":s?"true":void 0,"aria-readonly":V?"true":void 0,"aria-busy":H?"true":void 0,className:`inline-flex flex-col ${x}`,...N,children:[l&&bu("span",{id:A,className:xe,children:[l,M&&Rr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),Y&&Rr("div",{className:`mb-2.5 ${P}`,children:Rr(Ct,{id:B,variant:"outline",size:De,color:i,value:L,onChange:O,placeholder:T,disabled:s||H,leftIcon:Rr(mn,{className:"size-4 text-neutral-400"}),rightIcon:he?Rr(Ne,{className:"size-4 animate-spin text-neutral-400"}):void 0,onClear:W,"aria-label":typeof l=="string"?`T\xECm ki\u1EBFm ${l}`:"T\xECm ki\u1EBFm",config:{isClearable:!he,isFullWidth:!0}})}),Rr("div",{className:`${se} ${m}`,children:we.length>0?we.map(re=>{let de=String(re.value),ce=ie!=null&&String(ie)===de;return Rr(Lo,{name:X,value:re.value,checked:ce,onChange:()=>fe(de),label:re.label,helperText:re.description,disabled:s||!!re.disabled,readOnly:V||!!re.isReadOnly,size:o,color:i,variant:a,labelPlacement:p,config:{isLoading:H,isInvalid:Q,isRequired:M}},re.value)}):Rr("div",{className:"py-3 text-center text-sm text-neutral-400 select-none",children:!L.trim()&&c==="server"?"Nh\u1EADp t\u1EEB kh\xF3a \u0111\u1EC3 t\xECm ki\u1EBFm s\u1EA3n ph\u1EA9m...":R})}),Rr($e,{id:U,helperText:h,errorMessage:d,sizeClassName:me.helper,className:b})]})}import{useId as Lp,useState as Bp,useRef as Hp}from"react";import{useMergeRefs as Vp}from"@floating-ui/react";var hu={xs:{track:"w-7 h-4 p-0.5",thumb:"size-3",translate:"translate-x-3",icon:"size-2",content:"text-[9px]",label:"text-xs leading-4",gap:"gap-1.5",helper:"text-[10px]"},sm:{track:"w-9 h-5 p-0.5",thumb:"size-4",translate:"translate-x-4",icon:"size-2.5",content:"text-[10px]",label:"text-sm leading-4",gap:"gap-2",helper:"text-[11px]"},md:{track:"w-11 h-6 p-0.5",thumb:"size-5",translate:"translate-x-5",icon:"size-3",content:"text-xs",label:"text-sm leading-5",gap:"gap-2.5",helper:"text-xs"},lg:{track:"w-13 h-7 p-0.5",thumb:"size-6",translate:"translate-x-6",icon:"size-3.5",content:"text-xs",label:"text-base leading-6",gap:"gap-3",helper:"text-xs"},xl:{track:"w-16 h-9 p-1",thumb:"size-7",translate:"translate-x-7",icon:"size-4",content:"text-sm",label:"text-lg leading-7",gap:"gap-3.5",helper:"text-sm"}},Vs={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},xu={filled:{primary:{checked:{track:"bg-primary-600 dark:bg-primary-500 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-white text-primary-600 dark:text-primary-500 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},secondary:{checked:{track:"bg-secondary-600 dark:bg-secondary-500 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-white text-secondary-600 dark:text-secondary-500 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},error:{checked:{track:"bg-error-600 dark:bg-error-500 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-white text-error-600 dark:text-error-500 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},success:{checked:{track:"bg-success-600 dark:bg-success-500 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-white text-success-600 dark:text-success-500 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},warning:{checked:{track:"bg-warning-500 dark:bg-warning-400 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-white text-warning-500 dark:bg-neutral-900 dark:text-warning-400 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},info:{checked:{track:"bg-info-600 dark:bg-info-500 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-white text-info-600 dark:text-info-500 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},neutral:{checked:{track:"bg-neutral-800 dark:bg-neutral-200 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-white text-neutral-800 dark:bg-neutral-900 dark:text-neutral-200 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}}},outline:{primary:{checked:{track:"bg-primary-50 dark:bg-primary-950/40 border-2 border-primary-600 dark:border-primary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-primary-600 dark:bg-primary-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},secondary:{checked:{track:"bg-secondary-50 dark:bg-secondary-950/40 border-2 border-secondary-600 dark:border-secondary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-secondary-600 dark:bg-secondary-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},error:{checked:{track:"bg-error-50 dark:bg-error-950/40 border-2 border-error-600 dark:border-error-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-error-600 dark:bg-error-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},success:{checked:{track:"bg-success-50 dark:bg-success-950/40 border-2 border-success-600 dark:border-success-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-success-600 dark:bg-success-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},warning:{checked:{track:"bg-warning-50 dark:bg-warning-950/40 border-2 border-warning-500 dark:border-warning-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-warning-500 dark:bg-warning-400 text-neutral-950 shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},info:{checked:{track:"bg-info-50 dark:bg-info-950/40 border-2 border-info-600 dark:border-info-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-info-600 dark:bg-info-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},neutral:{checked:{track:"bg-neutral-100 dark:bg-neutral-800 border-2 border-neutral-800 dark:border-neutral-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-800 dark:bg-neutral-200 text-neutral-white dark:text-neutral-900 shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}}},soft:{primary:{checked:{track:"bg-primary-100 dark:bg-primary-900/50 border border-primary-200 dark:border-primary-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-primary-600 dark:bg-primary-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},secondary:{checked:{track:"bg-secondary-100 dark:bg-secondary-900/50 border border-secondary-200 dark:border-secondary-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-secondary-600 dark:bg-secondary-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},error:{checked:{track:"bg-error-100 dark:bg-error-900/50 border border-error-200 dark:border-error-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-error-600 dark:bg-error-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},success:{checked:{track:"bg-success-100 dark:bg-success-900/50 border border-success-200 dark:border-success-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-success-600 dark:bg-success-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},warning:{checked:{track:"bg-warning-100 dark:bg-warning-900/50 border border-warning-200 dark:border-warning-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-warning-500 dark:bg-warning-400 text-neutral-950 shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},info:{checked:{track:"bg-info-100 dark:bg-info-900/50 border border-info-200 dark:border-info-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-info-600 dark:bg-info-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},neutral:{checked:{track:"bg-neutral-200 dark:bg-neutral-700 border border-neutral-300 dark:border-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-800 dark:bg-neutral-200 text-neutral-white dark:text-neutral-900 shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}}}};import{jsx as Nr,jsxs as Ji}from"react/jsx-runtime";function As({size:e,variant:t,color:r,radius:n,thumbRadius:o,config:i,label:a,helperText:s,errorMessage:l,labelPlacement:h="right",thumbIcon:d,startContent:w,endContent:p,wrapperClassName:m="",trackClassName:x="",thumbClassName:y="",labelClassName:b="",helperClassName:k="",className:T="",checked:v,defaultChecked:u,disabled:c=!1,readOnly:g=!1,onChange:f,onClick:S,value:D,id:R,name:P,ref:I,...E}){let{isRequired:N=!1,isInvalid:M=!1,isLoading:z=!1,showSpinner:H=!1}=i??{},V=Lp(),Y=R||V,$=`${Y}-error-helper`,F=Hp(null),G=Vp([F,I]),A=v!==void 0,[U,B]=Bp(u??!1),X=A?!!v:U,le=W=>{c||g||z||(A||B(W.target.checked),f?.(W))},ne=W=>{if(c||g||z){W.preventDefault();return}S?.(W)},ue=W=>{(c||g||z)&&W.preventDefault()},ie=!!(M||l),Q=ie?"error":r,q=C(e,hu,"md"),ge=C(n,Vs,"full"),ke=C(o,Vs,"full"),L=t==="other"?void 0:C(Q,C(t,xu,"filled"),"primary"),te=L?X?L.checked.track:L.unchecked.track:"",Z=L?X?L.checked.thumb:L.unchecked.thumb:"",he=["relative inline-flex items-center shrink-0 border box-border transition-colors duration-200 ease-in-out cursor-pointer select-none",q.track,ge,te,c?"opacity-50":"",x].filter(Boolean).join(" "),ae=["pointer-events-none inline-flex items-center justify-center transition-transform duration-200 ease-in-out select-none",q.thumb,ke,Z,X?q.translate:"translate-x-0",y].filter(Boolean).join(" "),ve=["select-none font-medium text-neutral-900 dark:text-neutral-100 transition-colors",q.label,c?"opacity-50":"",b].filter(Boolean).join(" "),ye=["group inline-flex items-center relative",h==="left"?"flex-row-reverse justify-between":"flex-row",q.gap,c?"cursor-not-allowed opacity-60":"cursor-pointer",m,T].filter(Boolean).join(" "),J=()=>z&&H?Nr("span",{className:`inline-flex items-center justify-center ${q.icon}`,"aria-hidden":"true",children:Nr(Ne,{className:"size-full animate-spin"})}):typeof d=="function"?d({isChecked:X,className:q.icon}):d?Nr("span",{className:`inline-flex items-center justify-center ${q.icon}`,"aria-hidden":"true",children:d}):null,O=()=>a?Ji("span",{className:ve,children:[a,N&&Nr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):null;return Ji("div",{className:"inline-flex flex-col",children:[Ji("label",{className:ye,onClick:ue,children:[Nr("input",{ref:G,type:"checkbox",role:"switch",id:Y,name:P,value:D,checked:X,onChange:le,onClick:ne,disabled:c||z,readOnly:g,required:N,"aria-checked":X,"aria-invalid":ie,"aria-required":N,"aria-describedby":l||s?$:void 0,"aria-errormessage":l?$:void 0,"aria-busy":z,"aria-disabled":c||z,className:"sr-only peer",...E}),Ji("span",{className:he,"aria-hidden":"true",children:[w&&Nr("span",{className:`absolute left-1.5 inline-flex items-center justify-center select-none font-medium transition-opacity duration-200 ${q.content} ${X?"opacity-100":"opacity-0"}`,children:w}),Nr("span",{className:ae,children:J()}),p&&Nr("span",{className:`absolute right-1.5 inline-flex items-center justify-center select-none font-medium transition-opacity duration-200 ${q.content} ${X?"opacity-0":"opacity-100"}`,children:p})]}),O()]}),Nr($e,{id:$,helperText:s,errorMessage:l,sizeClassName:q.helper,className:k})]})}import{jsx as vu}from"react/jsx-runtime";function lt({width:e=16,height:t=16,className:r="",...n}){return vu("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:vu("path",{d:"m6 9 6 6 6-6"})})}import{jsx as yu}from"react/jsx-runtime";function Yt({width:e=16,height:t=16,className:r="",...n}){return yu("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:yu("path",{d:"m15 18-6-6 6-6"})})}import{jsx as wu}from"react/jsx-runtime";function Wt({width:e=16,height:t=16,className:r="",...n}){return wu("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:wu("path",{d:"m9 18 6-6-6-6"})})}import{jsx as Qi,jsxs as Ap}from"react/jsx-runtime";function Cu({width:e=16,height:t=16,className:r="",...n}){return Ap("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Qi("path",{d:"M8 2v4"}),Qi("path",{d:"M16 2v4"}),Qi("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),Qi("path",{d:"M3 10h18"})]})}import{jsx as ku,jsxs as Op}from"react/jsx-runtime";function Su({width:e=16,height:t=16,className:r="",...n}){return Op("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[ku("circle",{cx:"12",cy:"12",r:"10"}),ku("polyline",{points:"12 6 12 12 16 14"})]})}import{jsx as Tu,jsxs as Gp}from"react/jsx-runtime";function Gr({width:e=16,height:t=16,className:r="",...n}){return Gp("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Tu("path",{d:"m11 17-5-5 5-5"}),Tu("path",{d:"m18 17-5-5 5-5"})]})}import{jsx as Du,jsxs as Up}from"react/jsx-runtime";function Ur({width:e=16,height:t=16,className:r="",...n}){return Up("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Du("path",{d:"m6 17 5-5-5-5"}),Du("path",{d:"m13 17 5-5-5-5"})]})}import{jsx as or,jsxs as Yp}from"react/jsx-runtime";function jp(e){return Yp("svg",{viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[or("ellipse",{cx:"48",cy:"80",rx:"36",ry:"8",className:"fill-neutral-200/60 dark:fill-neutral-800/60"}),or("ellipse",{cx:"48",cy:"80",rx:"22",ry:"4.5",className:"fill-neutral-300/50 dark:fill-neutral-700/50"}),or("path",{d:"M24 38L16 32L40 22L48 28L24 38Z",className:"fill-primary-100/80 dark:fill-primary-950/70 stroke-primary-300 dark:stroke-primary-700",strokeWidth:"1.5",strokeLinejoin:"round"}),or("path",{d:"M72 38L80 32L56 22L48 28L72 38Z",className:"fill-primary-100/80 dark:fill-primary-950/70 stroke-primary-300 dark:stroke-primary-700",strokeWidth:"1.5",strokeLinejoin:"round"}),or("path",{d:"M24 38L48 28V52L24 62V38Z",className:"fill-primary-300/80 dark:fill-primary-900/80 stroke-primary-300/40 dark:stroke-primary-700/40",strokeWidth:"1",strokeLinejoin:"round"}),or("path",{d:"M72 38L48 28V52L72 62V38Z",className:"fill-primary-300/60 dark:fill-primary-900/60 stroke-primary-300/40 dark:stroke-primary-700/40",strokeWidth:"1",strokeLinejoin:"round"}),or("path",{d:"M48 52L72 62L48 72L24 62L48 52Z",className:"fill-primary-400/40 dark:fill-primary-950/90 stroke-primary-400/30 dark:stroke-primary-700/30",strokeWidth:"1",strokeLinejoin:"round"}),or("path",{d:"M24 38V64L48 76V50L24 38Z",className:"fill-primary-100 dark:fill-primary-900/50 stroke-primary-400 dark:stroke-primary-600",strokeWidth:"1.8",strokeLinejoin:"round"}),or("path",{d:"M72 38V64L48 76V50L72 38Z",className:"fill-primary-200/90 dark:fill-primary-800/60 stroke-primary-400 dark:stroke-primary-600",strokeWidth:"1.8",strokeLinejoin:"round"}),or("path",{d:"M24 38L48 50L38 60L14 48L24 38Z",className:"fill-primary-50 dark:fill-primary-950/90 stroke-primary-300 dark:stroke-primary-700",strokeWidth:"1.5",strokeLinejoin:"round"}),or("path",{d:"M72 38L48 50L58 60L82 48L72 38Z",className:"fill-primary-100/90 dark:fill-primary-900/80 stroke-primary-300 dark:stroke-primary-700",strokeWidth:"1.5",strokeLinejoin:"round"})]})}var Os=jp;import{jsx as Pr,jsxs as Ru}from"react/jsx-runtime";function Wp(e){return Ru("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[Pr("ellipse",{cx:"60",cy:"100",rx:"42",ry:"10",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),Pr("rect",{x:"32",y:"24",width:"44",height:"56",rx:"6",className:"fill-white dark:fill-neutral-900 stroke-neutral-300 dark:stroke-neutral-700",strokeWidth:"2"}),Pr("line",{x1:"42",y1:"36",x2:"66",y2:"36",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2.5",strokeLinecap:"round"}),Pr("line",{x1:"42",y1:"44",x2:"60",y2:"44",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2.5",strokeLinecap:"round"}),Pr("line",{x1:"42",y1:"52",x2:"52",y2:"52",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2.5",strokeLinecap:"round"}),Ru("g",{transform:"translate(48, 38)",children:[Pr("circle",{cx:"28",cy:"28",r:"20",className:"fill-primary-50/80 dark:fill-primary-950/70 stroke-primary-500",strokeWidth:"3"}),Pr("path",{d:"M18 20A14 14 0 0 1 34 16",className:"stroke-primary-300",strokeWidth:"2",strokeLinecap:"round"}),Pr("path",{d:"M24 24L32 32M32 24L24 32",className:"stroke-neutral-400 dark:stroke-neutral-500",strokeWidth:"2",strokeLinecap:"round"}),Pr("path",{d:"M42 42L58 58",className:"stroke-primary-700 dark:stroke-primary-400",strokeWidth:"5",strokeLinecap:"round"})]})]})}var Gs=Wp;import{jsx as hn,jsxs as _p}from"react/jsx-runtime";function Kp(e){return _p("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[hn("ellipse",{cx:"60",cy:"100",rx:"42",ry:"10",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),hn("circle",{cx:"60",cy:"52",r:"32",className:"fill-error-50 dark:fill-error-950/40 stroke-error-200 dark:stroke-error-800",strokeWidth:"2"}),hn("path",{d:"M60 30L78 64H42L60 30Z",className:"fill-error-100 dark:fill-error-900/60 stroke-error-500",strokeWidth:"2.5",strokeLinejoin:"round"}),hn("line",{x1:"60",y1:"42",x2:"60",y2:"52",className:"stroke-error-600",strokeWidth:"2.5",strokeLinecap:"round"}),hn("circle",{cx:"60",cy:"58",r:"1.5",className:"fill-error-600"}),hn("path",{d:"M22 66L32 60",className:"stroke-neutral-300 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"3 3"}),hn("path",{d:"M98 66L88 60",className:"stroke-neutral-300 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"3 3"})]})}var Us=Kp;import{jsx as _n,jsxs as qp}from"react/jsx-runtime";function Xp(e){return qp("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[_n("ellipse",{cx:"60",cy:"98",rx:"42",ry:"10",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),_n("path",{d:"M24 40C24 36.69 26.69 34 30 34H48L56 42H90C93.31 42 96 44.69 96 48V78C96 81.31 93.31 84 90 84H30C26.69 84 24 81.31 24 78V40Z",className:"fill-primary-200/70 dark:fill-primary-900/60 stroke-primary-300 dark:stroke-primary-700",strokeWidth:"2"}),_n("rect",{x:"36",y:"30",width:"48",height:"40",rx:"4",className:"fill-white dark:fill-neutral-900 stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"1.5"}),_n("line",{x1:"44",y1:"40",x2:"68",y2:"40",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round"}),_n("line",{x1:"44",y1:"48",x2:"60",y2:"48",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round"}),_n("path",{d:"M24 52H96V80C96 83.31 93.31 86 90 86H30C26.69 86 24 83.31 24 80V52Z",className:"fill-primary-300/80 dark:fill-primary-800/70 stroke-primary-400 dark:stroke-primary-600",strokeWidth:"2"})]})}var js=Xp;import{jsx as ea,jsxs as Jp}from"react/jsx-runtime";function Zp(e){return Jp("svg",{viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[ea("ellipse",{cx:"32",cy:"54",rx:"24",ry:"5",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),ea("path",{d:"M12 24L32 14L52 24L32 34L12 24Z",className:"fill-neutral-100 dark:fill-neutral-800 stroke-neutral-400 dark:stroke-neutral-500",strokeWidth:"2",strokeLinejoin:"round"}),ea("path",{d:"M12 24V40L32 50V34L12 24Z",className:"fill-neutral-200 dark:fill-neutral-700 stroke-neutral-400 dark:stroke-neutral-500",strokeWidth:"2",strokeLinejoin:"round"}),ea("path",{d:"M52 24V40L32 50V34L52 24Z",className:"fill-neutral-300 dark:fill-neutral-600 stroke-neutral-400 dark:stroke-neutral-500",strokeWidth:"2",strokeLinejoin:"round"})]})}var Ys=Zp;import{jsx as ta,jsxs as Qp}from"react/jsx-runtime";function Xn({width:e=20,height:t=20,className:r="",...n}){return Qp("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[ta("circle",{cx:"11",cy:"11",r:"8"}),ta("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),ta("line",{x1:"11",y1:"8",x2:"11",y2:"14"}),ta("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}import{jsx as Ws,jsxs as eg}from"react/jsx-runtime";function qn({width:e=20,height:t=20,className:r="",...n}){return eg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Ws("circle",{cx:"11",cy:"11",r:"8"}),Ws("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),Ws("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}import{jsx as Nu,jsxs as tg}from"react/jsx-runtime";function jr({width:e=20,height:t=20,className:r="",...n}){return tg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Nu("path",{d:"M21 2v6h-6"}),Nu("path",{d:"M21 8A10 10 0 1 0 22 13"})]})}import{jsx as Pu,jsxs as rg}from"react/jsx-runtime";function Zn({width:e=20,height:t=20,className:r="",...n}){return rg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Pu("path",{d:"M3 2v6h6"}),Pu("path",{d:"M3 8a10 10 0 1 1-1 5"})]})}import{jsx as Jn,jsxs as ng}from"react/jsx-runtime";function Qn({width:e=20,height:t=20,className:r="",...n}){return ng("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Jn("path",{d:"m3 7 5 5-5 5V7z"}),Jn("path",{d:"m21 7-5 5 5 5V7z"}),Jn("path",{d:"M12 20v2"}),Jn("path",{d:"M12 14v2"}),Jn("path",{d:"M12 8v2"}),Jn("path",{d:"M12 2v2"})]})}import{jsx as Ks,jsxs as og}from"react/jsx-runtime";function br({width:e=20,height:t=20,className:r="",...n}){return og("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Ks("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),Ks("polyline",{points:"7 10 12 15 17 10"}),Ks("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}import{jsx as zu,jsxs as ig}from"react/jsx-runtime";function Lt({width:e=20,height:t=20,className:r="",...n}){return ig("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[zu("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),zu("path",{d:"M3 3v5h5"})]})}import{jsx as _s,jsxs as ag}from"react/jsx-runtime";function ra({width:e=20,height:t=20,className:r="",...n}){return ag("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[_s("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),_s("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),_s("polyline",{points:"21 15 16 10 5 21"})]})}import{jsx as Iu,jsxs as sg}from"react/jsx-runtime";function na({width:e=16,height:t=16,className:r="",...n}){return sg("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Iu("path",{d:"M6 2v14a2 2 0 0 0 2 2h14"}),Iu("path",{d:"M18 22V8a2 2 0 0 0-2-2H2"})]})}import{jsx as oa,jsxs as lg}from"react/jsx-runtime";function ir({width:e=16,height:t=16,className:r="",...n}){return lg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[oa("polyline",{points:"3 6 5 6 21 6"}),oa("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),oa("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),oa("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}import{jsx as Mu}from"react/jsx-runtime";function Nt({width:e=24,height:t=24,className:r="",...n}){return Mu("svg",{width:e,height:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:r,...n,children:Mu("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95C8.08 7.14 9.94 6 12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11c1.56.1 2.78 1.41 2.78 2.96 0 1.65-1.35 3-3 3M8 13h2.55v3h2.9v-3H16l-4-4z"})})}import{jsx as ia,jsxs as cg}from"react/jsx-runtime";function aa({width:e=24,height:t=24,variant:r="solid",className:n="",...o}){return r==="outline"?cg("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:n,...o,children:[ia("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),ia("circle",{cx:"12",cy:"7",r:"4"})]}):ia("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:n,...o,children:ia("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.5 6a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM3.751 20.105a8.25 8.25 0 0 1 16.498 0 .75.75 0 0 1-.437.695A18.683 18.683 0 0 1 12 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 0 1-.437-.695Z"})})}import{jsx as Fu,jsxs as ug}from"react/jsx-runtime";function sa({width:e=16,height:t=16,className:r="",...n}){return ug("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Fu("path",{d:"m7 15 5 5 5-5"}),Fu("path",{d:"m7 9 5-5 5 5"})]})}import{jsx as Eu,jsxs as dg}from"react/jsx-runtime";function la({width:e=16,height:t=16,className:r="",...n}){return dg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Eu("path",{d:"m5 12 7-7 7 7"}),Eu("path",{d:"M12 19V5"})]})}import{jsx as $u,jsxs as fg}from"react/jsx-runtime";function ca({width:e=16,height:t=16,className:r="",...n}){return fg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[$u("path",{d:"M12 5v14"}),$u("path",{d:"m19 12-7 7-7-7"})]})}import{jsx as zr,jsxs as pg}from"react/jsx-runtime";function ua({width:e=16,height:t=16,className:r="",...n}){return pg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[zr("line",{x1:"21",x2:"14",y1:"4",y2:"4"}),zr("line",{x1:"10",x2:"3",y1:"4",y2:"4"}),zr("line",{x1:"21",x2:"12",y1:"12",y2:"12"}),zr("line",{x1:"8",x2:"3",y1:"12",y2:"12"}),zr("line",{x1:"21",x2:"16",y1:"20",y2:"20"}),zr("line",{x1:"12",x2:"3",y1:"20",y2:"20"}),zr("line",{x1:"14",x2:"14",y1:"2",y2:"6"}),zr("line",{x1:"8",x2:"8",y1:"10",y2:"14"}),zr("line",{x1:"16",x2:"16",y1:"18",y2:"22"})]})}import{cloneElement as mg,isValidElement as Xs,useState as Au}from"react";import{useFloating as bg,autoUpdate as hg,offset as xg,flip as vg,shift as yg,arrow as wg,useHover as Cg,useFocus as kg,useDismiss as Sg,useRole as Tg,useInteractions as Dg,useMergeRefs as Rg,FloatingPortal as Ng,FloatingArrow as Pg}from"@floating-ui/react";import{useTransitionStyles as gg}from"@floating-ui/react";function et(e,t={}){let{duration:r=150,offset:n=4,scale:o=.96,animated:i=!0}=t;return gg(e,{duration:i?r:0,initial:({side:a})=>({opacity:0,transform:a==="top"?`translateY(${n}px) scale(${o})`:a==="bottom"?`translateY(-${n}px) scale(${o})`:a==="left"?`translateX(${n}px) scale(${o})`:`translateX(-${n}px) scale(${o})`}),open:{opacity:1,transform:"translate(0px, 0px) scale(1)"},close:({side:a})=>({opacity:0,transform:a==="top"?`translateY(${n}px) scale(${o})`:a==="bottom"?`translateY(-${n}px) scale(${o})`:a==="left"?`translateX(${n}px) scale(${o})`:`translateX(-${n}px) scale(${o})`})})}var Lu={xs:{box:"px-2 py-0.5 text-[11px] leading-tight font-medium",arrowWidth:8,arrowHeight:4},sm:{box:"px-2.5 py-1 text-xs leading-tight font-medium",arrowWidth:10,arrowHeight:5},md:{box:"px-3 py-1.5 text-xs leading-normal font-medium",arrowWidth:12,arrowHeight:6},lg:{box:"px-3.5 py-2 text-sm leading-normal font-medium",arrowWidth:14,arrowHeight:7},xl:{box:"px-4 py-2.5 text-base leading-normal font-semibold",arrowWidth:16,arrowHeight:8}},Bu={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Hu={filled:{primary:"bg-primary-500 text-neutral-white border border-transparent shadow-md",secondary:"bg-secondary-500 text-neutral-white border border-transparent shadow-md",error:"bg-error-500 text-neutral-white border border-transparent shadow-md",success:"bg-success-500 text-neutral-white border border-transparent shadow-md",warning:"bg-warning-500 text-neutral-950 border border-transparent shadow-md",info:"bg-info-500 text-neutral-white border border-transparent shadow-md",neutral:"bg-neutral-800 text-neutral-white border border-transparent shadow-md"},soft:{primary:"bg-primary-100 text-primary-800 border border-primary-200 shadow-sm",secondary:"bg-secondary-100 text-secondary-800 border border-secondary-200 shadow-sm",error:"bg-error-100 text-error-800 border border-error-200 shadow-sm",success:"bg-success-100 text-success-800 border border-success-200 shadow-sm",warning:"bg-warning-100 text-warning-800 border border-warning-200 shadow-sm",info:"bg-info-100 text-info-800 border border-info-200 shadow-sm",neutral:"bg-neutral-100 text-neutral-800 border border-neutral-200 shadow-sm"},outline:{primary:"bg-neutral-white text-primary-700 border border-primary-400 shadow-md",secondary:"bg-neutral-white text-secondary-800 border border-secondary-400 shadow-md",error:"bg-neutral-white text-error-700 border border-error-400 shadow-md",success:"bg-neutral-white text-success-700 border border-success-400 shadow-md",warning:"bg-neutral-white text-warning-800 border border-warning-400 shadow-md",info:"bg-neutral-white text-info-800 border border-info-400 shadow-md",neutral:"bg-neutral-white text-neutral-800 border border-neutral-300 shadow-md"}},Vu={filled:{primary:"fill-primary-500",secondary:"fill-secondary-500",error:"fill-error-500",success:"fill-success-500",warning:"fill-warning-500",info:"fill-info-500",neutral:"fill-neutral-800"},soft:{primary:"fill-primary-100 stroke-primary-200",secondary:"fill-secondary-100 stroke-secondary-200",error:"fill-error-100 stroke-error-200",success:"fill-success-100 stroke-success-200",warning:"fill-warning-100 stroke-warning-200",info:"fill-info-100 stroke-info-200",neutral:"fill-neutral-100 stroke-neutral-200"},outline:{primary:"fill-neutral-white stroke-primary-400",secondary:"fill-neutral-white stroke-secondary-400",error:"fill-neutral-white stroke-error-400",success:"fill-neutral-white stroke-success-400",warning:"fill-neutral-white stroke-warning-400",info:"fill-neutral-white stroke-info-400",neutral:"fill-neutral-white stroke-neutral-300"}};import{Fragment as Ig,jsx as da,jsxs as Ou}from"react/jsx-runtime";function zg({children:e,ref:t,disabled:r,className:n="",...o}){let i=Xs(e)?e.props?.ref:void 0,a=Rg([t,i]);if(!Xs(e))return null;let s=e.props||{};return mg(e,{...o,...s,ref:a,disabled:r?!0:s.disabled,className:[s.className,n].filter(Boolean).join(" ")})}function Ho({content:e,children:t,placement:r="top",variant:n,color:o,size:i,radius:a,hasArrow:s=!0,offset:l=8,flip:h=!0,shift:d=!0,delay:w={open:200,close:150},disabled:p=!1,animated:m=!0,animationDuration:x=150,open:y,defaultOpen:b=!1,onOpenChange:k,className:T="",arrowClassName:v="",zIndex:u=Qe.TOOLTIP}){let[c,g]=Au(b),[f,S]=Au(null),D=y!==void 0,R=D?y:c,P=q=>{D||g(q),k?.(q)},I=[xg(l),h?vg():void 0,d?yg({padding:8}):void 0,s?wg({element:f}):void 0].filter(Boolean),{refs:{setReference:E,setFloating:N},floatingStyles:M,context:z,placement:H}=bg({placement:r,open:R&&!p,onOpenChange:P,whileElementsMounted:hg,transform:!1,middleware:I}),V=Cg(z,{move:!1,delay:w,enabled:!p}),Y=kg(z,{enabled:!p}),$=Sg(z),F=Tg(z,{role:"tooltip"}),{getReferenceProps:G,getFloatingProps:A}=Dg([V,Y,$,F]),{isMounted:U,styles:B}=et(z,{duration:x,animated:m}),X=C(i,Lu,"md"),le=C(a,Bu,"md"),ne=n==="other"?"":C(o,C(n,Hu,"filled"),"neutral"),ue=n==="other"?"":C(o,C(n,Vu,"filled"),"neutral"),ie=["select-none pointer-events-none max-w-xs break-words",X.box,le,ne,T].filter(Boolean).join(" "),Q=G();return Ou(Ig,{children:[Xs(t)?da(zg,{ref:E,disabled:p,...Q,children:t}):da("span",{ref:E,...Q,children:t}),da(Ng,{children:U&&!p&&e&&Ou("div",{ref:N,style:{...M,...m?B:{},zIndex:u},className:ie,"data-state":R?"open":"closed","data-placement":H,...A(),children:[e,s&&da(Pg,{ref:S,context:z,width:X.arrowWidth,height:X.arrowHeight,strokeWidth:n==="outline"||n==="soft"?1:0,className:[ue,v].filter(Boolean).join(" ")})]})})]})}import{useId as Fg,useState as Eg}from"react";import*as eo from"@radix-ui/react-slider";var xn={xs:{trackHorizontal:"h-1",trackVertical:"w-1",thumb:"w-3 h-3",thumbSizePx:12,label:"text-xs font-medium",value:"text-xs font-semibold",helper:"text-[11px]",markText:"text-[10px]",gap:"gap-1",stepDot:"w-1 h-1",tooltipSize:"xs"},sm:{trackHorizontal:"h-1.5",trackVertical:"w-1.5",thumb:"w-4 h-4",thumbSizePx:16,label:"text-xs font-medium",value:"text-xs font-semibold",helper:"text-xs",markText:"text-[11px]",gap:"gap-1.5",stepDot:"w-1.5 h-1.5",tooltipSize:"xs"},md:{trackHorizontal:"h-2",trackVertical:"w-2",thumb:"w-5 h-5",thumbSizePx:20,label:"text-sm font-medium",value:"text-sm font-semibold",helper:"text-xs",markText:"text-xs",gap:"gap-2",stepDot:"w-2 h-2",tooltipSize:"sm"},lg:{trackHorizontal:"h-2.5",trackVertical:"w-2.5",thumb:"w-6 h-6",thumbSizePx:24,label:"text-base font-medium",value:"text-base font-semibold",helper:"text-sm",markText:"text-xs",gap:"gap-2.5",stepDot:"w-2.5 h-2.5",tooltipSize:"md"},xl:{trackHorizontal:"h-3",trackVertical:"w-3",thumb:"w-7 h-7",thumbSizePx:28,label:"text-lg font-medium",value:"text-lg font-semibold",helper:"text-sm",markText:"text-sm",gap:"gap-3",stepDot:"w-3 h-3",tooltipSize:"md"}},qs={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Gu={filled:{primary:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-primary-500 dark:bg-primary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-primary-500 text-primary-600 focus-visible:ring-2 focus-visible:ring-primary-500/50 shadow-sm"},secondary:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-secondary-500 dark:bg-secondary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-secondary-500 text-secondary-600 focus-visible:ring-2 focus-visible:ring-secondary-500/50 shadow-sm"},error:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-error-500 dark:bg-error-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-error-500 text-error-600 focus-visible:ring-2 focus-visible:ring-error-500/50 shadow-sm"},success:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-success-500 dark:bg-success-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-success-500 text-success-600 focus-visible:ring-2 focus-visible:ring-success-500/50 shadow-sm"},warning:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-warning-500 dark:bg-warning-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-warning-500 text-warning-600 focus-visible:ring-2 focus-visible:ring-warning-500/50 shadow-sm"},info:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-info-500 dark:bg-info-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-info-500 text-info-600 focus-visible:ring-2 focus-visible:ring-info-500/50 shadow-sm"},neutral:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-neutral-800 dark:bg-neutral-200",thumb:"bg-white dark:bg-neutral-900 border-2 border-neutral-800 dark:border-neutral-200 text-neutral-800 dark:text-neutral-200 focus-visible:ring-2 focus-visible:ring-neutral-500/50 shadow-sm"}},soft:{primary:{track:"bg-primary-100 dark:bg-primary-950/40",filler:"bg-primary-400 dark:bg-primary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-primary-400 text-primary-500 focus-visible:ring-2 focus-visible:ring-primary-400/50 shadow-sm"},secondary:{track:"bg-secondary-100 dark:bg-secondary-950/40",filler:"bg-secondary-400 dark:bg-secondary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-secondary-400 text-secondary-500 focus-visible:ring-2 focus-visible:ring-secondary-400/50 shadow-sm"},error:{track:"bg-error-100 dark:bg-error-950/40",filler:"bg-error-400 dark:bg-error-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-error-400 text-error-500 focus-visible:ring-2 focus-visible:ring-error-400/50 shadow-sm"},success:{track:"bg-success-100 dark:bg-success-950/40",filler:"bg-success-400 dark:bg-success-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-success-400 text-success-500 focus-visible:ring-2 focus-visible:ring-success-400/50 shadow-sm"},warning:{track:"bg-warning-100 dark:bg-warning-950/40",filler:"bg-warning-400 dark:bg-warning-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-warning-400 text-warning-500 focus-visible:ring-2 focus-visible:ring-warning-400/50 shadow-sm"},info:{track:"bg-info-100 dark:bg-info-950/40",filler:"bg-info-400 dark:bg-info-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-info-400 text-info-500 focus-visible:ring-2 focus-visible:ring-info-400/50 shadow-sm"},neutral:{track:"bg-neutral-200 dark:bg-neutral-800",filler:"bg-neutral-600 dark:bg-neutral-400",thumb:"bg-white dark:bg-neutral-900 border-2 border-neutral-600 dark:border-neutral-400 text-neutral-600 focus-visible:ring-2 focus-visible:ring-neutral-400/50 shadow-sm"}},outline:{primary:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-primary-500 dark:bg-primary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-primary-500 text-primary-600 focus-visible:ring-2 focus-visible:ring-primary-500/50 shadow-sm"},secondary:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-secondary-500 dark:bg-secondary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-secondary-500 text-secondary-600 focus-visible:ring-2 focus-visible:ring-secondary-500/50 shadow-sm"},error:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-error-500 dark:bg-error-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-error-500 text-error-600 focus-visible:ring-2 focus-visible:ring-error-500/50 shadow-sm"},success:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-success-500 dark:bg-success-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-success-500 text-success-600 focus-visible:ring-2 focus-visible:ring-success-500/50 shadow-sm"},warning:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-warning-500 dark:bg-warning-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-warning-500 text-warning-600 focus-visible:ring-2 focus-visible:ring-warning-500/50 shadow-sm"},info:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-info-500 dark:bg-info-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-info-500 text-info-600 focus-visible:ring-2 focus-visible:ring-info-500/50 shadow-sm"},neutral:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-neutral-800 dark:bg-neutral-200",thumb:"bg-white dark:bg-neutral-900 border-2 border-neutral-800 dark:border-neutral-200 text-neutral-800 dark:text-neutral-200 focus-visible:ring-2 focus-visible:ring-neutral-500/50 shadow-sm"}},other:{primary:{track:"",filler:"",thumb:""},secondary:{track:"",filler:"",thumb:""},error:{track:"",filler:"",thumb:""},success:{track:"",filler:"",thumb:""},warning:{track:"",filler:"",thumb:""},info:{track:"",filler:"",thumb:""},neutral:{track:"",filler:"",thumb:""}}};import{useState as Zs}from"react";import*as Uu from"@radix-ui/react-slider";import{jsx as fa}from"react/jsx-runtime";function Vo({id:e,thumbIdx:t,value:r,orientation:n,size:o,thumbRadiusClass:i,thumbThemeStyles:a,thumbClassName:s="",tooltipClassName:l="",state:h,label:d,helperId:w,tooltipMode:p="none",tooltipPlacement:m,formatTooltip:x}){let{isLoading:y=!1,showSpinner:b=!1,disabled:k=!1,readOnly:T=!1,isRequired:v=!1,isInvalid:u=!1,isRange:c=!1,hasDescription:g=!1}=h??{},f=C(o,xn,"md"),[S,D]=Zs(!1),[R,P]=Zs(!1),[I,E]=Zs(!1),N;p==="always"?N=!0:p==="active"?N=I||R:p==="hover"?N=S||I||R:p==="none"&&(N=!1);let M=m||(n==="vertical"?"right":"top"),z=x?x(r):r.toString(),H=typeof z=="string"||typeof z=="number"?String(z):void 0,V=fa(Uu.Thumb,{id:`${e}-thumb-${t}`,tabIndex:k||y?-1:0,"aria-busy":y,"aria-disabled":k||y,"aria-readonly":T,"aria-required":v,"aria-invalid":u,"aria-errormessage":u?w:void 0,"aria-describedby":g?w:void 0,"aria-valuetext":H,"aria-orientation":n,"aria-label":typeof d=="string"?`${d} ${c?t===0?"minimum":"maximum":""}`:`Slider ${c?t===0?"min":"max":""}`,onFocus:()=>P(!0),onBlur:()=>P(!1),onPointerEnter:()=>D(!0),onPointerLeave:()=>D(!1),onPointerDown:()=>E(!0),onPointerUp:()=>E(!1),className:`block relative z-10 select-none outline-none transition-transform duration-100 ease-out ${k||T?"cursor-not-allowed opacity-60 shadow-none":"cursor-grab active:cursor-grabbing hover:scale-105"} ${f.thumb} ${i} ${a} ${I&&!k&&!y?"scale-110 ring-4 ring-primary-500/20":""} ${s}`,children:y&&b&&fa("div",{className:"absolute inset-0 flex items-center justify-center p-0.5","aria-hidden":"true",children:fa(Ne,{className:"size-full animate-spin text-current"})})});return p!=="none"?fa(Ho,{content:z,placement:M,open:N,size:f.tooltipSize,className:l,disabled:k||y,children:V}):V}function Js(e,t,r){return Math.min(Math.max(e,t),r)}function Ao(e,t,r){return r<=t?0:Js((e-t)/(r-t)*100,0,100)}import{Fragment as Mg,jsx as pa}from"react/jsx-runtime";function ga({marks:e,min:t,max:r,step:n,orientation:o,size:i,markClassName:a=""}){if(!e)return null;let s=[];if(Array.isArray(e))s=e;else if(e===!0&&n>0){let h=Math.floor((r-t)/n);if(h<=20)for(let d=0;d<=h;d++){let w=t+d*n;s.push({value:w,label:w.toString()})}}if(!s.length)return null;let l=C(i,xn,"md");return pa("div",{className:`relative w-full ${o==="vertical"?"h-full":"mt-2"}`,"aria-hidden":"true",children:s.map(h=>{let d=Ao(h.value,t,r);return pa("div",{className:`absolute flex items-center justify-center select-none text-neutral-500 dark:text-neutral-400 ${l.markText} ${a}`,style:o==="vertical"?{bottom:`${d}%`,left:"100%",transform:"translateY(50%) translateX(6px)"}:{left:`${d}%`,transform:"translateX(-50%)"},children:h.label??h.value},h.value)})})}function ma({showSteps:e,min:t,max:r,step:n,orientation:o,size:i,isRange:a,currentValues:s}){if(!e||n<=0)return null;let l=Math.floor((r-t)/n);if(l>100)return null;let h=C(i,xn,"md"),d=[];for(let w=0;w<=l;w++){let p=t+w*n,m=Ao(p,t,r),x=a?p>=(s[0]??t)&&p<=(s[1]??r):p<=(s[0]??t);d.push(pa("span",{"aria-hidden":"true",className:`absolute rounded-full -translate-x-1/2 -translate-y-1/2 pointer-events-none transition-colors duration-150 ${h.stepDot} ${x?"bg-white/80 dark:bg-neutral-900/80":"bg-neutral-400/60 dark:bg-neutral-500/60"}`,style:o==="vertical"?{bottom:`${m}%`,left:"50%"}:{left:`${m}%`,top:"50%"}},`step-dot-${p}`))}return pa(Mg,{children:d})}import{Fragment as ju,jsx as Bt,jsxs as vn}from"react/jsx-runtime";function Oo({config:e,value:t,defaultValue:r,min:n=0,max:o=100,step:i=1,minStepsBetweenThumbs:a=0,inverted:s=!1,size:l,variant:h,color:d,radius:w,thumbRadius:p,orientation:m="horizontal",label:x,labelPlacement:y="top",formatValue:b,showTooltip:k="none",tooltipPlacement:T,formatTooltip:v,marks:u=!1,startContent:c,endContent:g,disabled:f=!1,readOnly:S=!1,helperText:D,errorMessage:R,name:P,id:I,onChange:E,onChangeEnd:N,className:M="",wrapperClassName:z="",trackWrapperClassName:H="",trackClassName:V="",fillerClassName:Y="",thumbClassName:$="",labelClassName:F="",valueClassName:G="",helperClassName:A="",tooltipClassName:U="",markClassName:B="",ref:X}){let{isRequired:le=!1,isInvalid:ne=!1,isLoading:ue=!1,showSpinner:ie=!1,showSteps:Q=!1,showValue:q=!1,isFullWidth:ge=!0}=e??{},ke=Fg(),L=I||ke,te=`${L}-helper`,Z=!!(ne||R),he=Z?"error":d,ae=Array.isArray(t??r),ve=t!==void 0,[Se,ye]=Eg(()=>r!==void 0?Array.isArray(r)?r:[r]:ae?[n,o]:[n]),J=ve?Array.isArray(t)?t:t!==void 0?[t]:void 0:void 0,O=ve?Array.isArray(t)?[t[0]??n,t[1]??o]:[t??n,0]:ae?[Se[0]??n,Se[1]??o]:[Se[0]??n,0],W=j=>{if(f||S||ue)return;ve||ye(j);let Ce=ae?[j[0]??n,j[1]??o]:j[0]??n;E?.(Ce)},we=j=>{if(f||S||ue)return;let Ce=ae?[j[0]??n,j[1]??o]:j[0]??n;N?.(Ce)},fe=C(l,xn,"md"),se=C(w,qs,"full"),me=C(p,qs,"full"),De=h==="other"?{track:"",filler:"",thumb:""}:C(he,C(h,Gu,"filled"),"primary"),xe=De.track,re=De.filler,de=De.thumb,ce=()=>{if(!x&&!q)return null;let j="";b?j=b(ae?O:O[0]):ae?j=`${O[0]} - ${O[1]}`:j=`${O[0]}`;let Ce=Z?"text-error-600 font-medium":"text-neutral-900 dark:text-neutral-100";return vn("div",{className:"flex items-center justify-between gap-2 mb-1.5 select-none",children:[x&&vn("label",{htmlFor:`${L}-thumb-0`,className:`font-medium ${Ce} ${fe.label} ${f?"opacity-60 cursor-not-allowed":"cursor-pointer"} ${F}`,children:[x,le&&Bt("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),q&&Bt("span",{className:`select-none text-neutral-700 dark:text-neutral-300 ${fe.value} ${G}`,"aria-hidden":"true",children:j})]})},ee=ae?[O[0],O[1]]:[O[0]];return vn("div",{ref:X,className:`group/field flex flex-col ${ge?"w-full":"inline-flex"} ${f?"opacity-60 cursor-not-allowed":""} ${z||M}`,children:[y==="top"&&ce(),vn("div",{className:`flex items-center ${fe.gap} ${m==="vertical"?"flex-col h-48":"flex-row w-full"} ${H}`,children:[y==="left"&&ce(),c&&Bt("div",{className:"inline-flex shrink-0 items-center justify-center select-none text-neutral-500 dark:text-neutral-400","aria-hidden":"true",children:c}),vn(eo.Root,{min:n,max:o,step:i,minStepsBetweenThumbs:a,inverted:s,orientation:m,disabled:f||ue||S,value:J,defaultValue:r!==void 0?Array.isArray(r)?r:[r]:void 0,onValueChange:W,onValueCommit:we,className:`relative flex items-center select-none touch-none ${m==="vertical"?"flex-col h-full w-auto justify-center":"w-full h-auto justify-center"} ${f||S?"cursor-not-allowed":"cursor-pointer"}`,children:[vn(eo.Track,{className:`relative overflow-hidden ${m==="vertical"?`${fe.trackVertical} h-full`:`${fe.trackHorizontal} w-full`} ${se} ${xe} ${V}`,children:[Bt(ma,{showSteps:Q,min:n,max:o,step:i,orientation:m,size:l||"md",isRange:ae,currentValues:O}),Bt(eo.Range,{className:`absolute ${re} ${se} ${Y}`})]}),ee.map((j,Ce)=>{let Ee=ae?Ce===0?`${L}-thumb-min`:`${L}-thumb-max`:`${L}-thumb-single`;return Bt(Vo,{id:L,thumbIdx:Ce,value:j,orientation:m,size:l||"md",thumbRadiusClass:me,thumbThemeStyles:de,thumbClassName:$,tooltipClassName:U,state:{isLoading:ue,showSpinner:ie,disabled:f,readOnly:S,isRequired:le,isInvalid:Z,isRange:ae,hasDescription:!!(Z||D)},label:x,helperId:te,tooltipMode:k,tooltipPlacement:T,formatTooltip:v},Ee)})]}),g&&Bt("div",{className:"inline-flex shrink-0 items-center justify-center select-none text-neutral-500 dark:text-neutral-400","aria-hidden":"true",children:g}),y==="right"&&ce()]}),Bt(ga,{marks:u,min:n,max:o,step:i,orientation:m,size:l||"md",markClassName:B}),Bt($e,{id:te,helperText:D,errorMessage:R,sizeClassName:fe.helper,className:A}),P&&Bt(ju,{children:ae?vn(ju,{children:[Bt("input",{type:"hidden",name:`${P}[0]`,value:O[0],disabled:f}),Bt("input",{type:"hidden",name:`${P}[1]`,value:O[1],disabled:f})]}):Bt("input",{type:"hidden",name:P,value:O[0],disabled:f})})]})}import{useState as $g,useMemo as Zu,useCallback as Lg}from"react";var ba={sm:{header:"py-2.5 px-3.5 text-sm",content:"px-3.5 pb-3 text-sm text-neutral-600",title:"font-medium leading-snug",description:"text-xs text-neutral-500 mt-0.5",icon:"size-4",startIcon:"size-4",gap:"gap-2.5"},md:{header:"py-3.5 px-4 text-base",content:"px-4 pb-4 text-sm text-neutral-600",title:"font-semibold leading-snug",description:"text-xs text-neutral-500 mt-1",icon:"size-4.5",startIcon:"size-4.5",gap:"gap-3"},lg:{header:"py-4.5 px-5 text-lg",content:"px-5 pb-5 text-base text-neutral-600",title:"font-semibold leading-snug",description:"text-sm text-neutral-500 mt-1",icon:"size-5",startIcon:"size-5",gap:"gap-3.5"}},ha={none:"rounded-none",sm:"rounded-md",md:"rounded-xl",lg:"rounded-2xl",xl:"rounded-3xl",full:"rounded-3xl"},Yu={outlined:{primary:"border border-primary-200 bg-white divide-y divide-primary-100 overflow-hidden",secondary:"border border-secondary-200 bg-white divide-y divide-secondary-100 overflow-hidden",neutral:"border border-neutral-200 bg-white divide-y divide-neutral-200 overflow-hidden",error:"border border-error-200 bg-white divide-y divide-error-100 overflow-hidden",success:"border border-success-200 bg-white divide-y divide-success-100 overflow-hidden",warning:"border border-warning-200 bg-white divide-y divide-warning-100 overflow-hidden",info:"border border-info-200 bg-white divide-y divide-info-100 overflow-hidden"},filled:{primary:"bg-primary-50/40 border border-primary-100 divide-y divide-primary-100/80 overflow-hidden",secondary:"bg-secondary-50/40 border border-secondary-100 divide-y divide-secondary-100/80 overflow-hidden",neutral:"bg-neutral-50 border border-neutral-200/60 divide-y divide-neutral-200/60 overflow-hidden",error:"bg-error-50/40 border border-error-100 divide-y divide-error-100/80 overflow-hidden",success:"bg-success-50/40 border border-success-100 divide-y divide-success-100/80 overflow-hidden",warning:"bg-warning-50/40 border border-warning-100 divide-y divide-warning-100/80 overflow-hidden",info:"bg-info-50/40 border border-info-100 divide-y divide-info-100/80 overflow-hidden"},separated:{primary:"bg-transparent border-0 space-y-3",secondary:"bg-transparent border-0 space-y-3",neutral:"bg-transparent border-0 space-y-3",error:"bg-transparent border-0 space-y-3",success:"bg-transparent border-0 space-y-3",warning:"bg-transparent border-0 space-y-3",info:"bg-transparent border-0 space-y-3"},ghost:{primary:"bg-transparent border-0 divide-y divide-neutral-200/70",secondary:"bg-transparent border-0 divide-y divide-neutral-200/70",neutral:"bg-transparent border-0 divide-y divide-neutral-200/70",error:"bg-transparent border-0 divide-y divide-neutral-200/70",success:"bg-transparent border-0 divide-y divide-neutral-200/70",warning:"bg-transparent border-0 divide-y divide-neutral-200/70",info:"bg-transparent border-0 divide-y divide-neutral-200/70"}},Wu={outlined:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""},filled:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""},ghost:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""},separated:{primary:"bg-white border border-primary-200 shadow-xs overflow-hidden",secondary:"bg-white border border-secondary-200 shadow-xs overflow-hidden",neutral:"bg-white border border-neutral-200 shadow-xs overflow-hidden",error:"bg-white border border-error-200 shadow-xs overflow-hidden",success:"bg-white border border-success-200 shadow-xs overflow-hidden",warning:"bg-white border border-warning-200 shadow-xs overflow-hidden",info:"bg-white border border-info-200 shadow-xs overflow-hidden"}},Ku={outlined:{primary:"bg-primary-50/40",secondary:"bg-secondary-50/40",neutral:"bg-neutral-50/80",error:"bg-error-50/40",success:"bg-success-50/40",warning:"bg-warning-50/40",info:"bg-info-50/40"},filled:{primary:"bg-primary-50/80",secondary:"bg-secondary-50/80",neutral:"bg-neutral-100/70",error:"bg-error-50/80",success:"bg-success-50/80",warning:"bg-warning-50/80",info:"bg-info-50/80"},separated:{primary:"bg-primary-50/40",secondary:"bg-secondary-50/40",neutral:"bg-neutral-50/80",error:"bg-error-50/40",success:"bg-success-50/40",warning:"bg-warning-50/40",info:"bg-info-50/40"},ghost:{primary:"bg-transparent",secondary:"bg-transparent",neutral:"bg-transparent",error:"bg-transparent",success:"bg-transparent",warning:"bg-transparent",info:"bg-transparent"}},_u={primary:{focusRing:"focus-visible:ring-primary-500",title:"text-primary-700",activeIndicator:"text-primary-600"},secondary:{focusRing:"focus-visible:ring-secondary-500",title:"text-secondary-700",activeIndicator:"text-secondary-600"},neutral:{focusRing:"focus-visible:ring-neutral-500",title:"text-neutral-900",activeIndicator:"text-neutral-700"},error:{focusRing:"focus-visible:ring-error-500",title:"text-error-700",activeIndicator:"text-error-600"},success:{focusRing:"focus-visible:ring-success-500",title:"text-success-700",activeIndicator:"text-success-600"},warning:{focusRing:"focus-visible:ring-warning-500",title:"text-warning-700",activeIndicator:"text-warning-600"},info:{focusRing:"focus-visible:ring-info-500",title:"text-info-700",activeIndicator:"text-info-600"}};import{createContext as Xu,useContext as qu}from"react";var Qs=Xu(null),el=Xu(null);function Yr(){let e=qu(Qs);if(!e)throw new Error("Collapse compound components must be rendered within a <Collapse> provider");return e}function to(){let e=qu(el);if(!e)throw new Error("Collapse subcomponents (CollapseHeader, CollapseContent) must be rendered within a <CollapsePanel>");return e}import{jsx as Qu}from"react/jsx-runtime";function Ju(e){return e==null?[]:Array.isArray(e)?e:[e]}function tl({activeKey:e,defaultActiveKey:t,onChange:r,accordion:n=!1,size:o="md",variant:i="outlined",color:a="primary",radius:s="md",expandIconPosition:l="right",expandIcon:h,destroyInactivePanel:d=!1,className:w="",style:p,children:m,ref:x,...y}){let b=e!==void 0,[k,T]=$g(()=>Ju(t)),v=Zu(()=>new Set(b?Ju(e):k),[b,e,k]),u=Lg(D=>{let R,P=v.has(D);if(n)R=P?[]:[D];else{let I=Array.from(v);P?R=I.filter(E=>E!==D):R=[...I,D]}b||T(R),r?.(n?R[0]??"":R)},[n,v,b,r]),c=i==="other"?"":C(a,C(i,Yu,"outlined"),"primary"),g=i!=="separated"&&i!=="ghost"?C(s,ha,"md"):"",f=["w-full transition-colors",c,g,w].filter(Boolean).join(" "),S=Zu(()=>({activeKeys:v,handleToggle:u,accordion:n,size:o,variant:i,color:a,radius:s,expandIconPosition:l,expandIcon:h,destroyInactivePanel:d}),[v,u,n,o,i,a,s,l,h,d]);return Qu(Qs.Provider,{value:S,children:Qu("div",{ref:x,className:f,style:p,...y,children:m})})}import{useId as Bg,useMemo as Hg}from"react";import{jsx as yn,jsxs as Go}from"react/jsx-runtime";function Uo({startIcon:e,description:t,extra:r,showArrow:n=!0,children:o,className:i="",ref:a,onClick:s,onKeyDown:l,...h}){let{size:d,variant:w,color:p,expandIconPosition:m,expandIcon:x}=Yr(),{isActive:y,disabled:b,headerId:k,panelId:T,onToggle:v}=to(),u=C(d,ba,"md"),c=C(p,_u,"primary"),g=w==="other"?"":C(p,C(w,Ku,"outlined"),"primary"),f=n&&m!=="none",S=()=>f?typeof x=="function"?yn("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${y?"rotate-180":"rotate-0"}`,"aria-hidden":"true",children:x({isActive:y,disabled:b})}):x?yn("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${y?"rotate-180":"rotate-0"}`,"aria-hidden":"true",children:x}):yn("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${y?"rotate-180 text-neutral-700":"rotate-0"}`,"aria-hidden":"true",children:yn(lt,{className:u.icon})}):null,D=["w-full flex items-center justify-between transition-colors duration-150 select-none",u.header,u.gap,b?"cursor-not-allowed opacity-60":g,i].filter(Boolean).join(" "),R=["flex items-center flex-1 min-w-0 text-left outline-none cursor-pointer bg-transparent border-0 p-0",u.gap,b?"cursor-not-allowed pointer-events-none":`${c.focusRing} focus-visible:ring-2 focus-visible:ring-offset-1 rounded-lg`].filter(Boolean).join(" ");return Go("div",{className:D,children:[Go("button",{ref:a,id:k,type:"button","aria-expanded":y,"aria-controls":T,"aria-disabled":b?!0:void 0,disabled:b,onClick:P=>{v(),s?.(P)},onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),v()),l?.(P)},className:R,...h,children:[m==="left"&&S(),Go("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e&&yn("span",{className:`inline-flex items-center justify-center shrink-0 ${c.activeIndicator} ${u.startIcon}`,"aria-hidden":"true",children:e}),Go("div",{className:"flex flex-col min-w-0 flex-1",children:[yn("span",{className:`truncate ${u.title} ${c.title}`,children:o}),t&&yn("span",{className:`line-clamp-2 ${u.description}`,children:t})]})]}),m==="right"&&!r&&S()]}),r&&Go("div",{className:"inline-flex items-center gap-2.5 shrink-0 ml-3",children:[r,m==="right"&&S()]})]})}import{jsx as rl}from"react/jsx-runtime";function jo({destroyInactivePanel:e,children:t,className:r="",style:n,ref:o,...i}){let{size:a,destroyInactivePanel:s}=Yr(),{isActive:l,headerId:h,panelId:d}=to(),w=C(a,ba,"md");return rl("div",{ref:o,id:d,role:"region","aria-labelledby":h,"aria-hidden":!l,"data-state":l?"open":"closed",className:`grid transition-[grid-template-rows] duration-200 ease-in-out ${l?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,style:n,...i,children:rl("div",{className:"overflow-hidden",children:(!(e??s)||l)&&rl("div",{className:`${w.content} ${r}`,children:t})})})}import{Fragment as Vg,jsx as xa,jsxs as Ag}from"react/jsx-runtime";function nl({value:e,label:t,description:r,startIcon:n,extra:o,disabled:i=!1,showArrow:a=!0,headerClassName:s="",contentClassName:l="",destroyInactivePanel:h,className:d="",children:w,ref:p,...m}){let x=Bg(),{activeKeys:y,handleToggle:b,variant:k,color:T,radius:v}=Yr(),u=y.has(e),c=`collapse-header-${e??x}`,g=`collapse-panel-${e??x}`,f=Hg(()=>({value:e,isActive:u,disabled:i,headerId:c,panelId:g,onToggle:()=>!i&&b(e)}),[e,u,i,c,g,b]),S=k==="separated"?C(v,ha,"md"):"",R=["group",k==="other"?"":C(T,C(k,Wu,"outlined"),"primary"),S,i?"opacity-50 cursor-not-allowed":"",d].filter(Boolean).join(" ");return xa(el.Provider,{value:f,children:xa("div",{ref:p,className:R,"data-state":u?"open":"closed",...m,children:t!==void 0?Ag(Vg,{children:[xa(Uo,{startIcon:n,description:r,extra:o,showArrow:a,className:s,children:t}),xa(jo,{destroyInactivePanel:h,className:l,children:w})]}):w})})}import{useId as Og,useState as Gg}from"react";import{jsx as ed}from"react/jsx-runtime";function ol({open:e,defaultOpen:t=!1,destroyInactivePanel:r=!1,className:n="",children:o,ref:i,...a}){let s=Og(),l=e!==void 0,[h]=Gg(t),d=l?e:h;return ed("div",{ref:i,id:s,role:"region","aria-hidden":!d,"data-state":d?"open":"closed",className:`grid transition-[grid-template-rows] duration-200 ease-in-out ${d?"grid-rows-[1fr]":"grid-rows-[0fr]"} ${n}`,...a,children:ed("div",{className:"overflow-hidden",children:(!r||d)&&o})})}import{useState as Yg,useMemo as Wg,useCallback as td}from"react";import{createContext as Ug,useContext as jg}from"react";var il=Ug(null);function Wr(){let e=jg(il);if(!e)throw new Error("Tabs compound components must be used within <Tabs>");return e}import{jsx as rd}from"react/jsx-runtime";function wn({activeKey:e,defaultActiveKey:t,onChange:r,onClose:n,size:o="md",variant:i="line",color:a="primary",radius:s="md",orientation:l="horizontal",placement:h="top",fullWidth:d=!1,disabled:w=!1,destroyInactiveTabPane:p=!1,className:m="",children:x,ref:y,...b}){let k=e!==void 0,[T,v]=Yg(t),u=k?e:T,c=td(P=>{k||v(P),r?.(P)},[k,r]),g=td(P=>{n?.(P)},[n]),f=Wg(()=>({activeKey:u,setActiveKey:c,size:o,variant:i,color:a,radius:s,orientation:l,placement:h,fullWidth:d,disabled:w,destroyInactiveTabPane:p,onCloseTab:g}),[u,c,o,i,a,s,l,h,d,w,p,g]),S=l==="vertical",D;S?D=h==="right"?"flex flex-row-reverse gap-4 items-start":"flex flex-row gap-4 items-start":D=h==="bottom"?"flex flex-col-reverse gap-3":"flex flex-col gap-3";let R=["w-full",D,m].filter(Boolean).join(" ");return rd("div",{ref:y,className:R,...b,children:rd(il.Provider,{value:f,children:x})})}import{useMergeRefs as qg}from"@floating-ui/react";var nd={sm:{tab:"px-3 py-1.5 text-xs font-medium",icon:"size-3.5",gap:"gap-1.5",badge:"text-[10px] px-1.5 py-0.5 min-w-4 h-4",closeBtn:"size-3.5 -mr-1 p-0.5"},md:{tab:"px-4 py-2 text-sm font-medium",icon:"size-4",gap:"gap-2",badge:"text-xs px-2 py-0.5 min-w-5 h-5",closeBtn:"size-4 -mr-1 p-0.5"},lg:{tab:"px-5 py-2.5 text-base font-medium",icon:"size-5",gap:"gap-2.5",badge:"text-xs px-2.5 py-0.5 min-w-5.5 h-5.5",closeBtn:"size-4.5 -mr-1.5 p-0.5"}},va={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},od={line:(e,t)=>e==="vertical"?t==="right"?"border-l border-neutral-200 dark:border-neutral-800 gap-1":"border-r border-neutral-200 dark:border-neutral-800 gap-1":t==="bottom"?"border-t border-neutral-200 dark:border-neutral-800 gap-2":"border-b border-neutral-200 dark:border-neutral-800 gap-2",solid:()=>"bg-neutral-100 dark:bg-neutral-800/80 p-1 gap-1",bordered:()=>"border border-neutral-200 dark:border-neutral-700/80 p-1 gap-1 bg-neutral-50/50 dark:bg-neutral-900/50",flat:()=>"bg-neutral-100/60 dark:bg-neutral-800/40 p-1 gap-1"},id={primary:{line:{active:"text-primary-700 dark:text-primary-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-primary-600 dark:hover:text-primary-300"},solid:{active:"text-primary-700 dark:text-primary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-primary-700 dark:text-primary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-primary-700 dark:text-primary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-primary-700 dark:hover:text-primary-300"}},secondary:{line:{active:"text-secondary-700 dark:text-secondary-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-secondary-600 dark:hover:text-secondary-300"},solid:{active:"text-secondary-700 dark:text-secondary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-secondary-700 dark:text-secondary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-secondary-700 dark:text-secondary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-secondary-700 dark:hover:text-secondary-300"}},neutral:{line:{active:"text-neutral-950 dark:text-neutral-50 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-950 dark:hover:text-neutral-100"},solid:{active:"text-neutral-950 dark:text-neutral-50 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-neutral-950 dark:text-neutral-50 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-neutral-950 dark:text-neutral-50 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-100"}},error:{line:{active:"text-error-700 dark:text-error-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-error-600 dark:hover:text-error-300"},solid:{active:"text-error-700 dark:text-error-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-error-700 dark:text-error-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-error-700 dark:text-error-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-error-700 dark:hover:text-error-300"}},success:{line:{active:"text-success-700 dark:text-success-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-success-600 dark:hover:text-success-300"},solid:{active:"text-success-700 dark:text-success-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-success-700 dark:text-success-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-success-700 dark:text-success-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-success-700 dark:hover:text-success-300"}},warning:{line:{active:"text-warning-700 dark:text-warning-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-warning-600 dark:hover:text-warning-300"},solid:{active:"text-warning-700 dark:text-warning-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-warning-700 dark:text-warning-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-warning-700 dark:text-warning-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-warning-700 dark:hover:text-warning-300"}},info:{line:{active:"text-info-700 dark:text-info-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-info-600 dark:hover:text-info-300"},solid:{active:"text-info-700 dark:text-info-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-info-700 dark:text-info-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-info-700 dark:text-info-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-info-700 dark:hover:text-info-300"}}},ad={line:{primary:"bg-primary-600 dark:bg-primary-400",secondary:"bg-secondary-600 dark:bg-secondary-400",neutral:"bg-neutral-900 dark:bg-neutral-100",error:"bg-error-600 dark:bg-error-400",success:"bg-success-600 dark:bg-success-400",warning:"bg-warning-600 dark:bg-warning-400",info:"bg-info-600 dark:bg-info-400"},solid:{primary:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",secondary:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",neutral:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",error:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",success:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",warning:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",info:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70"},bordered:{primary:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",secondary:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",neutral:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",error:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",success:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",warning:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",info:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs"},flat:{primary:"bg-primary-100/90 dark:bg-primary-950/80",secondary:"bg-secondary-100/90 dark:bg-secondary-950/80",neutral:"bg-neutral-200/90 dark:bg-neutral-800",error:"bg-error-100/90 dark:bg-error-950/80",success:"bg-success-100/90 dark:bg-success-950/80",warning:"bg-warning-100/90 dark:bg-warning-950/80",info:"bg-info-100/90 dark:bg-info-950/80"}};import{useCallback as sd,useEffect as Kg,useLayoutEffect as _g,useRef as Xg,useState as al}from"react";var ld=typeof window<"u"?_g:Kg;function cd({activeKey:e,orientation:t="horizontal",placement:r="top",variant:n="line",color:o="primary",radius:i="md"}={}){let a=Xg(null),[s,l]=al({opacity:0}),[h,d]=al(!1),[w,p]=al(!1),m=sd(()=>{if(!a.current||t==="vertical"){d(!1),p(!1);return}let{scrollLeft:T,scrollWidth:v,clientWidth:u}=a.current,c=v-u;d(T>1),p(T<c-1)},[t]),x=sd(()=>{if(!a.current)return;m();let T=a.current.querySelector('[role="tab"][aria-selected="true"]');if(!T){l(S=>({...S,opacity:0}));return}let v=T.closest("[data-tab-wrapper]")||T;v.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"});let{offsetLeft:u,offsetTop:c,offsetWidth:g,offsetHeight:f}=v;l(n==="line"?t==="vertical"?{transform:`translate3d(0, ${c}px, 0)`,height:`${f}px`,width:"2px",top:0,left:r==="right"?0:void 0,right:r!=="right"?0:void 0,opacity:1}:{transform:`translate3d(${u}px, 0, 0)`,width:`${g}px`,height:"2px",left:0,top:r==="bottom"?0:void 0,bottom:r!=="bottom"?0:void 0,opacity:1}:{transform:`translate3d(${u}px, ${c}px, 0)`,width:`${g}px`,height:`${f}px`,top:0,left:0,opacity:1})},[m,t,r,n]);return ld(()=>{x()},[x,e,n,t,r,o,i]),ld(()=>{x();let T=requestAnimationFrame(x),v=new ResizeObserver(x);if(a.current){v.observe(a.current);let c=a.current.querySelectorAll("[data-tab-wrapper], [role='tab']");for(let g of c)v.observe(g)}let u=()=>x();return window.addEventListener("resize",u),()=>{cancelAnimationFrame(T),v.disconnect(),window.removeEventListener("resize",u)}},[x]),{listRef:a,indicatorStyle:s,canScrollLeft:h,canScrollRight:w,checkScroll:m,handleScrollLeft:()=>{a.current&&a.current.scrollBy({left:-200,behavior:"smooth"})},handleScrollRight:()=>{a.current&&a.current.scrollBy({left:200,behavior:"smooth"})},handleKeyDown:T=>{if(!a.current)return;let v=Array.from(a.current.querySelectorAll('[role="tab"]:not([disabled])'));if(!v.length)return;let u=v.findIndex(D=>D===document.activeElement||D.getAttribute("aria-selected")==="true"),c=-1,g=t==="horizontal",f=g?"ArrowRight":"ArrowDown",S=g?"ArrowLeft":"ArrowUp";T.key===f?(T.preventDefault(),c=(u+1)%v.length):T.key===S?(T.preventDefault(),c=(u-1+v.length)%v.length):T.key==="Home"?(T.preventDefault(),c=0):T.key==="End"&&(T.preventDefault(),c=v.length-1),c>=0&&v[c]&&(v[c]?.focus(),v[c]?.click())}}}import{jsx as ro,jsxs as ud}from"react/jsx-runtime";function Cn({children:e,className:t="",extra:r,centered:n=!1,ref:o,...i}){let{activeKey:a,orientation:s="horizontal",placement:l="top",variant:h="line",color:d="primary",radius:w="md",fullWidth:p=!1}=Wr(),{listRef:m,indicatorStyle:x,canScrollLeft:y,canScrollRight:b,checkScroll:k,handleScrollLeft:T,handleScrollRight:v,handleKeyDown:u}=cd({activeKey:a,orientation:s,placement:l,variant:h,color:d,radius:w}),c=qg([m,o]),g=C(w,va,"md"),f=h==="other"?"":C(h,od,"line"),S=typeof f=="function"?f(s,l):"",D=h==="other"?"":C(d,C(h,ad,"line"),"primary"),R=s==="vertical",P=y||b,E=["relative flex-1 min-w-0",R?"flex flex-col items-stretch justify-start w-full":`flex flex-row items-center overflow-x-auto overflow-y-hidden [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden scroll-smooth ${p?"w-full":""}`,n&&!R?"justify-center":"",h!=="line"?g:"",S,t].filter(Boolean).join(" "),N=["absolute pointer-events-none z-0 transition-all duration-300 ease-out",h!=="line"?g:"",D].filter(Boolean).join(" ");return ud("div",{className:R?"flex flex-col items-start gap-2 shrink-0 min-w-44":"flex items-center justify-between gap-1 w-full min-w-0",children:[!R&&P&&ro("button",{type:"button","aria-label":"Scroll tabs left",disabled:!y,onClick:T,className:"shrink-0 flex items-center justify-center size-7 rounded-md text-neutral-500 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100 hover:bg-neutral-100 dark:hover:bg-neutral-800 disabled:opacity-20 disabled:pointer-events-none transition-colors cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500",children:ro(Yt,{className:"size-4"})}),ud("div",{ref:c,role:"tablist","aria-orientation":s,onKeyDown:u,onScroll:k,className:E,...i,children:[ro("div",{"aria-hidden":"true",className:N,style:x}),e]}),!R&&P&&ro("button",{type:"button","aria-label":"Scroll tabs right",disabled:!b,onClick:v,className:"shrink-0 flex items-center justify-center size-7 rounded-md text-neutral-500 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100 hover:bg-neutral-100 dark:hover:bg-neutral-800 disabled:opacity-20 disabled:pointer-events-none transition-colors cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500",children:ro(Wt,{className:"size-4"})}),r&&ro("div",{className:R?"w-full mt-1":"shrink-0 ml-auto pl-1",children:r})]})}import{useRef as Zg}from"react";import{useMergeRefs as Jg}from"@floating-ui/react";import{jsx as no,jsxs as dd}from"react/jsx-runtime";function kn({value:e,label:t,startIcon:r,endIcon:n,badge:o,disabled:i=!1,closable:a=!1,onClose:s,className:l="",children:h,onClick:d,onKeyDown:w,ref:p,...m}){let{activeKey:x,setActiveKey:y,size:b,variant:k,color:T,radius:v,orientation:u,fullWidth:c,disabled:g,onCloseTab:f}=Wr(),S=Zg(null),D=Jg([S,p]),R=g||i,P=x===e,I=B=>{R||(y(e),d?.(B))},E=B=>{B.stopPropagation(),!R&&(s?.(B),f?.(e))},N=C(b,nd,"md"),M=C(v,va,"md"),z=C(T,id,"primary"),H=k==="other"?{active:"",inactive:""}:C(k,z,"line"),V=`tab-${e}`,Y=`tabpanel-${e}`,$=P?H.active:H.inactive,F=u==="vertical",G=["group relative z-10 inline-flex items-center select-none",F?"justify-start text-left w-full":"justify-center text-center",k!=="line"?M:"",c&&!F?"flex-1 text-center":"",R?"opacity-40 cursor-not-allowed pointer-events-none":"",l].filter(Boolean).join(" "),A=["inline-flex items-center cursor-pointer select-none bg-transparent",F?"justify-start text-left w-full":"justify-center text-center","transition-colors duration-200 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2",k!=="line"?M:"",N.tab,N.gap,a?"pr-1.5":"",c&&!F?"flex-1 text-center":"",$,R?"opacity-40 cursor-not-allowed pointer-events-none":""].filter(Boolean).join(" ");return dd("div",{"data-tab-wrapper":!0,className:G,children:[dd("button",{ref:D,id:V,type:"button",role:"tab","aria-selected":P,"aria-controls":Y,"aria-disabled":R?"true":void 0,tabIndex:P?0:-1,disabled:R,onClick:I,onKeyDown:B=>{if(a&&(B.key==="Delete"||B.key==="Backspace")){if(B.preventDefault(),B.stopPropagation(),R)return;s?.(B),f?.(e)}w?.(B)},className:A,...m,children:[r&&no("span",{className:`shrink-0 inline-flex items-center justify-center transition-colors duration-200 ${N.icon}`,"aria-hidden":"true",children:r}),no("span",{className:`truncate ${F?"flex-1 text-left":""}`,children:t||h}),o!=null&&no("span",{className:`inline-flex items-center justify-center font-medium rounded-full bg-neutral-200/80 dark:bg-neutral-700 text-neutral-700 dark:text-neutral-300 transition-colors duration-200 ${N.badge}`,children:o}),n&&no("span",{className:`shrink-0 inline-flex items-center justify-center transition-colors duration-200 ${N.icon}`,"aria-hidden":"true",children:n})]}),a&&no("button",{type:"button","aria-label":"Close tab",disabled:R,tabIndex:P?0:-1,onClick:E,className:`shrink-0 cursor-pointer rounded-full hover:bg-neutral-200/80 dark:hover:bg-neutral-700 text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200 transition-colors inline-flex items-center justify-center focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500 mr-2 ${N.closeBtn}`,children:no(Oe,{className:"size-full pointer-events-none"})})]})}import{jsx as Qg}from"react/jsx-runtime";function sl({children:e,className:t="",ref:r,...n}){return Qg("div",{ref:r,className:`w-full ${t}`,...n,children:e})}import{jsx as em}from"react/jsx-runtime";function ll({value:e,children:t,className:r="",destroyInactiveTabPane:n,ref:o,...i}){let{activeKey:a,destroyInactiveTabPane:s}=Wr(),l=a===e;if((n??s)&&!l)return null;let d=`tab-${e}`,w=`tabpanel-${e}`,p=["focus-visible:outline-hidden",l?"":"hidden",r].filter(Boolean).join(" ");return em("div",{ref:o,id:w,role:"tabpanel",tabIndex:0,"aria-labelledby":d,hidden:!l,className:p,...i,children:t})}import{createContext as tm,useContext as rm}from"react";var cl=tm(null);function ar(){let e=rm(cl);if(!e)throw new Error("Carousel compound components (CarouselContent, CarouselSlide, CarouselPrevious, CarouselNext, CarouselPagination) must be used within <Carousel>");return e}import{useCallback as Pt,useEffect as nm,useRef as Yo,useState as oo}from"react";function ya({currentIndex:e,defaultIndex:t=0,onIndexChange:r,loop:n=!1,slidesToShow:o=1,slidesToScroll:i=1,spacing:a=0,autoPlay:s=!0,interval:l=3e3,transitionDuration:h=650,pauseOnHover:d=!0,pauseOnFocus:w=!0,draggable:p=!0,size:m="md",radius:x="md"}={}){let[y,b]=oo(t),[k,T]=oo(0),[v,u]=oo(!1),[c,g]=oo(0),[f,S]=oo(!1),[D,R]=oo(!1),P=Yo(new Set),I=Yo(null),E=Yo(null),N=Yo(0),M=Yo(0),z=e!==void 0,H=z?e:y,V=Math.max(0,n?k-1:k-o),Y=Pt(L=>{let te=L;n?k>0?te=(te+k)%k:te=0:te=Math.max(0,Math.min(te,V)),z||b(te),r?.(te)},[z,n,V,r,k]),$=n?k>1:H>0,F=n?k>1:H<k-o,G=Pt(()=>{$&&Y(H-i)},[H,$,Y,i]),A=Pt(()=>{F&&Y(H+i)},[H,F,Y,i]),U=Pt(L=>{Y(L)},[Y]),B=Pt(L=>{P.current.add(L),T(P.current.size)},[]),X=Pt(L=>{P.current.delete(L),T(P.current.size)},[]);nm(()=>{if(!s||k<=o||d&&f||w&&D||v)return;let L=setInterval(()=>{n||H<k-o?A():U(0)},l);return()=>clearInterval(L)},[H,s,l,v,D,f,n,w,d,A,U,o,k]);let le=Pt(L=>{if(!p||k<=o||L.button!==0)return;let te=L.clientX;N.current=te,M.current=te,u(!0),g(0);let Z=L.currentTarget;try{Z.setPointerCapture(L.pointerId)}catch{}},[p,o,k]),ne=Pt(L=>{if(!v)return;let te=L.clientX;M.current=te;let Z=te-N.current;if(!n){if(H===0&&Z>0){g(Z*.3);return}if(H>=k-o&&Z<0){g(Z*.3);return}}g(Z)},[H,v,n,o,k]),ue=Pt(L=>{if(!v)return;u(!1);let te=M.current-N.current;Math.abs(te)>40&&(te>0?G():A()),g(0);try{L.currentTarget.releasePointerCapture(L.pointerId)}catch{}},[v,A,G]),ie=Pt(L=>{L.key==="ArrowLeft"?(L.preventDefault(),G()):L.key==="ArrowRight"?(L.preventDefault(),A()):L.key==="Home"?(L.preventDefault(),U(0)):L.key==="End"&&(L.preventDefault(),U(V))},[V,A,G,U]),Q=Pt(()=>S(!0),[]),q=Pt(()=>S(!1),[]),ge=Pt(()=>R(!0),[]),ke=Pt(()=>R(!1),[]);return{currentIndex:H,totalSlides:k,slidesToShow:o,slidesToScroll:i,spacing:a,loop:n,canScrollPrev:$,canScrollNext:F,size:m,radius:x,transitionDuration:h,isDragging:v,dragOffset:c,scrollPrev:G,scrollNext:A,scrollTo:U,registerSlide:B,unregisterSlide:X,setTotalSlides:T,viewportRef:I,containerRef:E,handlePointerDown:le,handlePointerMove:ne,handlePointerUp:ue,handlePointerCancel:ue,handleKeyDown:ie,handleMouseEnter:Q,handleMouseLeave:q,handleFocus:ge,handleBlur:ke}}var Wo={sm:{arrowBtn:"size-6 p-0.5 text-xs",arrowIcon:"size-3",dot:"size-1.5",activeDot:"size-1.5",line:"w-3.5 h-1",activeLine:"w-6 h-1",fraction:"text-xs px-2 py-0.5",paginationWrapper:"px-2 py-1 gap-1.5",edgeInset:"left-1.5 right-1.5"},md:{arrowBtn:"size-8 p-1.5 text-sm",arrowIcon:"size-3.5",dot:"size-2",activeDot:"size-2",line:"w-5 h-1.5",activeLine:"w-8 h-1.5",fraction:"text-xs px-2.5 py-0.5 font-medium",paginationWrapper:"px-2.5 py-1 gap-2",edgeInset:"left-2 right-2"},lg:{arrowBtn:"size-9 p-2 text-sm",arrowIcon:"size-4",dot:"size-2.5",activeDot:"size-2.5",line:"w-7 h-2",activeLine:"w-11 h-2",fraction:"text-sm px-3 py-1 font-medium",paginationWrapper:"px-3 py-1.5 gap-2.5",edgeInset:"left-2.5 right-2.5"}},fd={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},ul={glass:"bg-white/40 dark:bg-black/35 backdrop-blur-md border border-white/40 dark:border-white/15 text-primary-950 dark:text-white shadow-md hover:bg-white/70 dark:hover:bg-black/60 active:scale-90 disabled:opacity-25 disabled:pointer-events-none",filled:"bg-primary-600 text-white shadow-md hover:bg-primary-700 active:bg-primary-800 disabled:bg-neutral-300 dark:disabled:bg-neutral-800 disabled:text-neutral-500 disabled:opacity-50",outline:"border border-primary-600 text-primary-600 bg-white/70 dark:bg-neutral-900/70 backdrop-blur-sm hover:bg-primary-50 dark:hover:bg-primary-950 disabled:border-neutral-300 disabled:text-neutral-400",ghost:"text-primary-600 hover:bg-primary-100/60 dark:hover:bg-primary-950/60 active:bg-primary-200/60 disabled:text-neutral-400"},dl="bg-black/25 dark:bg-white/15 backdrop-blur-md border border-white/20 dark:border-white/15 shadow-sm rounded-full",Ko={active:"bg-primary-600 dark:bg-primary-400 shadow-sm",inactive:"bg-white/60 dark:bg-white/40 hover:bg-white/90 dark:hover:bg-white/70 transition-colors"};import{jsx as pd}from"react/jsx-runtime";function gd({currentIndex:e,defaultIndex:t=0,onIndexChange:r,loop:n=!1,slidesToShow:o=1,slidesToScroll:i=1,spacing:a=0,autoPlay:s=!0,interval:l=3e3,transitionDuration:h=650,pauseOnHover:d=!0,pauseOnFocus:w=!0,draggable:p=!0,size:m="md",radius:x="md",children:y,className:b="",style:k,ref:T,...v}){let u=ya({currentIndex:e,defaultIndex:t,onIndexChange:r,loop:n,slidesToShow:o,slidesToScroll:i,spacing:a,autoPlay:s,interval:l,transitionDuration:h,pauseOnHover:d,pauseOnFocus:w,draggable:p,size:m,radius:x}),c=C(x,fd,"md");return pd(cl.Provider,{value:u,children:pd("div",{ref:T,role:"region","aria-roledescription":"carousel","aria-label":"B\u0103ng chuy\u1EC1n",tabIndex:0,onKeyDown:u.handleKeyDown,onMouseEnter:u.handleMouseEnter,onMouseLeave:u.handleMouseLeave,onFocus:u.handleFocus,onBlur:u.handleBlur,className:`relative overflow-hidden group focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${c} ${b}`,style:k,...v,children:y})})}import{jsx as md}from"react/jsx-runtime";function bd({children:e,className:t="",style:r,ref:n,...o}){let{currentIndex:i,slidesToShow:a,spacing:s,transitionDuration:l,isDragging:h,dragOffset:d,viewportRef:w,handlePointerDown:p,handlePointerMove:m,handlePointerUp:x,handlePointerCancel:y}=ar(),b=typeof s=="number"?`${s}px`:s||"0px",k=`translateX(calc(-${i} * ((100% + ${b}) / ${a}) + ${d}px))`,T={display:"flex",flexDirection:"row",gap:b,transform:k,transition:h?"none":`transform ${l}ms cubic-bezier(0.25, 1, 0.5, 1)`,touchAction:"pan-y",width:"100%"};return md("div",{ref:w,className:`overflow-hidden relative w-full h-full cursor-grab ${h?"cursor-grabbing select-none":""}`,onPointerDown:p,onPointerMove:m,onPointerUp:x,onPointerCancel:y,children:md("div",{ref:n,role:"presentation",className:`flex ${t}`,style:{...T,...r},...o,children:e})})}import{useId as om,useEffect as im}from"react";import{jsx as am}from"react/jsx-runtime";function hd({children:e,className:t="",style:r,ref:n,...o}){let i=om(),{slidesToShow:a,spacing:s,registerSlide:l,unregisterSlide:h}=ar();im(()=>(l(i),()=>{h(i)}),[i,l,h]);let d=typeof s=="number"?`${s}px`:s||"0px",w={...r};return a>1||d!=="0px"?w.flex=`0 0 calc((100% - ${a-1} * ${d}) / ${a})`:w.flex="0 0 100%",am("div",{ref:n,role:"group","aria-roledescription":"slide",className:`min-w-0 shrink-0 grow-0 select-none box-border relative overflow-hidden ${t}`,style:w,...o,children:e})}import{jsx as wa}from"react/jsx-runtime";function xd({variant:e="glass",icon:t,className:r="",disabled:n,onClick:o,ref:i,...a}){let{scrollPrev:s,canScrollPrev:l,size:h}=ar(),d=n!==void 0?n:!l,w=C(h,Wo,"md"),p=C(e,ul,"glass"),m=wa(Yt,{className:w.arrowIcon}),x=["absolute left-2 top-1/2 -translate-y-1/2 inline-flex items-center justify-center font-medium leading-none rounded-full transition-all duration-200 cursor-pointer select-none outline-none disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-25 focus-visible:ring-2 focus-visible:ring-primary-500/50 active:scale-90 z-10",p,w.arrowBtn,r].filter(Boolean).join(" ");return wa("button",{ref:i,type:"button","aria-label":"Slide tr\u01B0\u1EDBc",disabled:d,onClick:y=>{s(),o?.(y)},className:x,...a,children:t||m})}function vd({variant:e="glass",icon:t,className:r="",disabled:n,onClick:o,ref:i,...a}){let{scrollNext:s,canScrollNext:l,size:h}=ar(),d=n!==void 0?n:!l,w=C(h,Wo,"md"),p=C(e,ul,"glass"),m=wa(Wt,{className:w.arrowIcon}),x=["absolute right-2 top-1/2 -translate-y-1/2 inline-flex items-center justify-center font-medium leading-none rounded-full transition-all duration-200 cursor-pointer select-none outline-none disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-25 focus-visible:ring-2 focus-visible:ring-primary-500/50 active:scale-90 z-10",p,w.arrowBtn,r].filter(Boolean).join(" ");return wa("button",{ref:i,type:"button","aria-label":"Slide ti\u1EBFp theo",disabled:d,onClick:y=>{s(),o?.(y)},className:x,...a,children:t||m})}import{jsx as Ca,jsxs as sm}from"react/jsx-runtime";function yd({type:e="dots",clickable:t=!0,className:r="",ref:n,...o}){let{currentIndex:i,totalSlides:a,slidesToShow:s,loop:l,scrollTo:h,size:d}=ar();if(e==="none"||a<=1)return null;let w=C(d,Wo,"md"),p=l?a:Math.max(1,a-s+1);return e==="fraction"?Ca("div",{ref:n,role:"status","aria-live":"polite",className:`absolute z-10 bottom-2.5 left-1/2 -translate-x-1/2 inline-flex items-center justify-center font-medium ${dl} text-white ${w.fraction} ${r}`,...o,children:sm("span",{children:[Math.min(i+1,p)," / ",p]})}):Ca("div",{ref:n,role:"tablist","aria-label":"Ph\xE2n trang b\u0103ng chuy\u1EC1n",className:`absolute z-10 bottom-2.5 left-1/2 -translate-x-1/2 inline-flex items-center justify-center ${dl} ${w.paginationWrapper} ${r}`,...o,children:Array.from({length:p}).map((m,x)=>{let y=x===i;return e==="line"?Ca("button",{type:"button",role:"tab","aria-selected":y,"aria-label":`Chuy\u1EC3n \u0111\u1EBFn slide ${x+1}`,disabled:!t,onClick:()=>t&&h(x),className:`transition-all duration-300 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${y?`${w.activeLine} ${Ko.active}`:`${w.line} ${Ko.inactive}`} ${t?"cursor-pointer":"cursor-default"}`},x):Ca("button",{type:"button",role:"tab","aria-selected":y,"aria-label":`Chuy\u1EC3n \u0111\u1EBFn slide ${x+1}`,disabled:!t,onClick:()=>t&&h(x),className:`transition-colors duration-200 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${w.dot} ${y?Ko.active:Ko.inactive} ${t?"cursor-pointer":"cursor-default"}`},x)})})}import{useState as wd,useRef as Cd,useMemo as kd,useCallback as um}from"react";import{useFloating as dm,autoUpdate as fm,offset as pm,flip as gm,shift as mm,useClick as bm,useHover as hm,useDismiss as xm,useRole as vm,useListNavigation as ym,useTypeahead as wm,useInteractions as Cm,safePolygon as km}from"@floating-ui/react";import{createContext as lm,useContext as cm}from"react";var fl=lm(null),hr=()=>{let e=cm(fl);if(!e)throw new Error("Dropdown compound components must be used within a <Dropdown> component.");return e};import{jsx as Sm}from"react/jsx-runtime";function pl({children:e,open:t,defaultOpen:r=!1,onOpenChange:n,trigger:o="click",placement:i="bottom-start",offset:a=4,flip:s=!0,shift:l=!0,size:h="md",radius:d="md",color:w="primary",disabled:p=!1,animated:m=!0,animationDuration:x=150,closeOnSelect:y=!0}){let[b,k]=wd(r),[T,v]=wd(null),u=Cd([]),c=Cd([]),g=t!==void 0,f=g?t:b,S=um(U=>{g||k(U),U||v(null),n?.(U)},[g,n]),D=kd(()=>[pm(a),s?gm():void 0,l?mm({padding:8}):void 0].filter(Boolean),[a,s,l]),{refs:R,floatingStyles:P,context:I,placement:E}=dm({placement:i,open:f&&!p,onOpenChange:S,whileElementsMounted:fm,transform:!1,middleware:D}),N=bm(I,{enabled:!p&&o==="click"}),M=hm(I,{enabled:!p&&o==="hover",delay:{open:100,close:150},handleClose:km()}),z=xm(I),H=vm(I,{role:"menu"}),V=ym(I,{listRef:u,activeIndex:T,onNavigate:v,loop:!0}),Y=wm(I,{listRef:c,activeIndex:T,onMatch:f?v:void 0}),{getReferenceProps:$,getFloatingProps:F,getItemProps:G}=Cm([N,M,z,H,V,Y]),A=kd(()=>({isOpen:f,setIsOpen:S,refs:R,floatingStyles:P,context:I,getReferenceProps:$,getFloatingProps:F,getItemProps:G,elementsRef:u,labelsRef:c,activeIndex:T,setActiveIndex:v,size:h,radius:d,color:w,disabled:p,animated:m,animationDuration:x,closeOnSelect:y,computedPlacement:E}),[f,S,R,P,I,$,F,G,u,c,T,v,h,d,w,p,m,x,y,E]);return Sm(fl.Provider,{value:A,children:e})}import{cloneElement as Tm,isValidElement as gl}from"react";import{useMergeRefs as Td}from"@floating-ui/react";import{jsx as Sd}from"react/jsx-runtime";function Dm({children:e,ref:t,disabled:r,className:n="",...o}){let i=gl(e)?e.props?.ref:void 0,a=Td([t,i]);if(!gl(e))return null;let s=e.props||{};return Tm(e,{...o,...s,ref:a,disabled:r?!0:s.disabled,className:[s.className,n].filter(Boolean).join(" ")})}function Rm({ref:e,children:t,className:r="",asChild:n=!1,...o}){let{refs:i,getReferenceProps:a,isOpen:s,disabled:l}=hr(),h=Td([i.setReference,e]),d=a({...o,"aria-expanded":s,"aria-haspopup":"menu",className:r});return gl(t)&&(n||!0)?Sd(Dm,{ref:h,disabled:l,...d,children:t}):Sd("button",{ref:h,type:"button",disabled:l,"aria-expanded":s,"aria-haspopup":"menu",className:r,...d,children:t})}var Dd=Rm;import{FloatingPortal as Nm,FloatingList as Pm,useMergeRefs as zm}from"@floating-ui/react";var io={xs:{menu:"p-1 min-w-36 text-xs",item:"px-2 py-1 text-xs rounded",itemGap:"gap-1.5",icon:"size-3.5",header:"px-2 py-1 text-[10px]",description:"text-[10px]",shortcut:"text-[10px] px-1 py-0.5"},sm:{menu:"p-1.5 min-w-44 text-xs",item:"px-2.5 py-1.5 text-xs rounded-md",itemGap:"gap-2",icon:"size-4",header:"px-2.5 py-1 text-xs",description:"text-[11px]",shortcut:"text-[11px] px-1.5 py-0.5"},md:{menu:"p-1.5 min-w-52 text-sm",item:"px-3 py-2 text-sm rounded-lg",itemGap:"gap-2.5",icon:"size-4.5",header:"px-3 py-1.5 text-xs",description:"text-xs",shortcut:"text-xs px-1.5 py-0.5"},lg:{menu:"p-2 min-w-60 text-base",item:"px-3.5 py-2.5 text-base rounded-xl",itemGap:"gap-3",icon:"size-5",header:"px-3.5 py-1.5 text-sm",description:"text-sm",shortcut:"text-sm px-2 py-0.5"},xl:{menu:"p-2.5 min-w-72 text-lg",item:"px-4 py-3 text-lg rounded-2xl",itemGap:"gap-3.5",icon:"size-6",header:"px-4 py-2 text-base",description:"text-base",shortcut:"text-base px-2 py-1"}},Rd={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-3xl"},Nd={primary:{active:"bg-primary-50 text-primary-900",selected:"bg-primary-100 text-primary-900 font-medium",focus:"focus:bg-primary-50 focus:text-primary-900"},secondary:{active:"bg-secondary-50 text-secondary-900",selected:"bg-secondary-100 text-secondary-900 font-medium",focus:"focus:bg-secondary-50 focus:text-secondary-900"},neutral:{active:"bg-neutral-100 text-neutral-900",selected:"bg-neutral-200 text-neutral-900 font-medium",focus:"focus:bg-neutral-100 focus:text-neutral-900"},error:{active:"bg-error-50 text-error-900",selected:"bg-error-100 text-error-900 font-medium",focus:"focus:bg-error-50 focus:text-error-900"},success:{active:"bg-success-50 text-success-900",selected:"bg-success-100 text-success-900 font-medium",focus:"focus:bg-success-50 focus:text-success-900"},warning:{active:"bg-warning-50 text-warning-900",selected:"bg-warning-100 text-warning-900 font-medium",focus:"focus:bg-warning-50 focus:text-warning-900"},info:{active:"bg-info-50 text-info-900",selected:"bg-info-100 text-info-900 font-medium",focus:"focus:bg-info-50 focus:text-info-900"}},ml={default:"text-error-600 hover:bg-error-50 hover:text-error-700",active:"bg-error-50 text-error-700",focus:"focus:bg-error-50 focus:text-error-700"};import{jsx as bl}from"react/jsx-runtime";function hl({ref:e,children:t,className:r="",style:n,minWidth:o,zIndex:i=Qe.DROPDOWN,...a}){let{isOpen:s,refs:l,floatingStyles:h,context:d,getFloatingProps:w,elementsRef:p,labelsRef:m,size:x,radius:y,animated:b,animationDuration:k,computedPlacement:T}=hr(),v=zm([l.setFloating,e]),{isMounted:u,styles:c}=et(d,{duration:k,animated:b});if(!u)return null;let g=C(x,io,"md"),f=C(y,Rd,"md"),S=["bg-neutral-white border-2 border-neutral-200 shadow-lg outline-none focus:outline-none flex flex-col",g.menu,f,r].filter(Boolean).join(" ");return bl(Nm,{children:bl("div",{ref:v,style:{...h,...b?c:{},minWidth:o,zIndex:i,...n},className:S,"data-state":s?"open":"closed","data-placement":T,...w(a),children:bl(Pm,{elementsRef:p,labelsRef:m,children:t})})})}import{useListItem as Im,useMergeRefs as Mm}from"@floating-ui/react";import{jsx as _o,jsxs as Pd}from"react/jsx-runtime";function Fm({ref:e,children:t,onClick:r,disabled:n=!1,danger:o=!1,selected:i=!1,startIcon:a,endIcon:s,shortcut:l,description:h,className:d="",closeOnSelect:w,...p}){let{getItemProps:m,activeIndex:x,setIsOpen:y,color:b,size:k,closeOnSelect:T}=hr(),v=typeof t=="string"?t:void 0,{ref:u,index:c}=Im({label:v}),g=Mm([u,e]),f=x===c,S=C(k,io,"md"),D=C(b,Nd,"primary"),R=E=>{if(n){E.preventDefault();return}r?.(E),(w??T)&&y(!1)},P=n?"opacity-50 cursor-not-allowed text-neutral-400 select-none":o?`${ml.default} ${f?ml.active:""} cursor-pointer`:i?`${D.selected} cursor-pointer`:`${f?D.active:"text-neutral-700 hover:bg-neutral-100 hover:text-neutral-900"} cursor-pointer`,I=["w-full text-left flex items-center select-none transition-colors duration-100 outline-none focus:outline-none",S.item,S.itemGap,P,d].filter(Boolean).join(" ");return Pd("button",{ref:g,type:"button",role:"menuitem",disabled:n,"aria-disabled":n,tabIndex:f?0:-1,...m({...p,onClick:R,className:I}),children:[a&&_o("span",{className:`flex items-center justify-center shrink-0 ${S.icon}`,children:a}),Pd("div",{className:"flex-1 flex flex-col min-w-0",children:[_o("span",{className:"truncate",children:t}),h&&_o("span",{className:`text-neutral-500 truncate ${S.description}`,children:h})]}),l&&_o("kbd",{className:`shrink-0 rounded border border-neutral-200 bg-neutral-50 font-mono text-neutral-500 tracking-wider ${S.shortcut}`,children:l}),s&&_o("span",{className:`flex items-center justify-center shrink-0 ${S.icon}`,children:s})]})}var zd=Fm;import{jsx as Em}from"react/jsx-runtime";function xl({children:e,className:t="",...r}){let{size:n}=hr(),o=C(n,io,"md");return Em("div",{role:"presentation",className:["font-semibold text-neutral-500 uppercase tracking-wider select-none",o.header,t].filter(Boolean).join(" "),...r,children:e})}var Id=xl;import{jsx as Lm}from"react/jsx-runtime";function $m({className:e="",...t}){return Lm("hr",{className:["-mx-1 my-1 h-px border-0 bg-neutral-200",e].filter(Boolean).join(" "),...t})}var Md=$m;import{jsx as Hm,jsxs as Vm}from"react/jsx-runtime";function Bm({children:e,label:t,className:r="",...n}){return Vm("div",{role:"group",className:["flex flex-col",r].filter(Boolean).join(" "),...n,children:[t&&Hm(xl,{children:t}),e]})}var Fd=Bm;import{useState as Gm,useMemo as Ed,useCallback as Um}from"react";import{useFloating as jm,autoUpdate as Ym,offset as Wm,flip as Km,shift as _m,useClick as Xm,useHover as qm,useDismiss as Zm,useRole as Jm,useInteractions as Qm,safePolygon as eb}from"@floating-ui/react";import{createContext as Am,useContext as Om}from"react";var vl=Am(null),zt=()=>{let e=Om(vl);if(!e)throw new Error("Popover compound components must be used within a <Popover> component.");return e};import{jsx as tb}from"react/jsx-runtime";function Xo({children:e,open:t,defaultOpen:r=!1,onOpenChange:n,trigger:o="click",placement:i="bottom",offset:a=8,flip:s=!0,shift:l=!0,size:h="md",radius:d="md",color:w="neutral",disabled:p=!1,animated:m=!0,animationDuration:x=150,modal:y=!1,closeOnEsc:b=!0,closeOnClickOutside:k=!0}){let[T,v]=Gm(r),u=t!==void 0,c=u?t:T,g=Um(Y=>{u||v(Y),n?.(Y)},[u,n]),f=Ed(()=>[Wm(a),s?Km():void 0,l?_m({padding:8}):void 0].filter(Boolean),[a,s,l]),{refs:S,floatingStyles:D,context:R,placement:P}=jm({placement:i,open:c&&!p,onOpenChange:g,whileElementsMounted:Ym,transform:!1,middleware:f}),I=Xm(R,{enabled:!p&&o==="click"}),E=qm(R,{enabled:!p&&o==="hover",delay:{open:100,close:150},handleClose:eb()}),N=Zm(R,{escapeKey:b,outsidePress:k}),M=Jm(R,{role:"dialog"}),{getReferenceProps:z,getFloatingProps:H}=Qm([I,E,N,M]),V=Ed(()=>({isOpen:c,setIsOpen:g,refs:S,floatingStyles:D,context:R,getReferenceProps:z,getFloatingProps:H,size:h,radius:d,color:w,disabled:p,animated:m,animationDuration:x,modal:y,computedPlacement:P}),[c,g,S,D,R,z,H,h,d,w,p,m,x,y,P]);return tb(vl.Provider,{value:V,children:e})}import{cloneElement as rb,isValidElement as yl}from"react";import{useMergeRefs as Ld}from"@floating-ui/react";import{jsx as $d}from"react/jsx-runtime";function nb({children:e,ref:t,disabled:r,className:n="",...o}){let i=yl(e)?e.props?.ref:void 0,a=Ld([t,i]);if(!yl(e))return null;let s=e.props||{};return rb(e,{...o,...s,ref:a,disabled:r?!0:s.disabled,className:[s.className,n].filter(Boolean).join(" ")})}function ob({ref:e,children:t,className:r="",asChild:n=!1,...o}){let{refs:i,getReferenceProps:a,isOpen:s,disabled:l}=zt(),h=Ld([i.setReference,e]),d=a({...o,"aria-expanded":s,"aria-haspopup":"dialog",className:r});return yl(t)&&(n||!0)?$d(nb,{ref:h,disabled:l,...d,children:t}):$d("button",{ref:h,type:"button",disabled:l,"aria-expanded":s,"aria-haspopup":"dialog",className:r,...d,children:t})}var ka=ob;import{FloatingPortal as ib,FloatingFocusManager as ab,useMergeRefs as sb}from"@floating-ui/react";var Kr={xs:{container:"min-w-44 text-xs",header:"px-2.5 py-1.5 text-xs font-semibold",body:"px-2.5 py-2 text-xs",footer:"px-2.5 py-1.5 text-xs"},sm:{container:"min-w-56 text-xs",header:"px-3 py-2 text-xs font-semibold",body:"px-3 py-2.5 text-xs",footer:"px-3 py-2 text-xs"},md:{container:"min-w-64 text-sm",header:"px-4 py-3 text-sm font-semibold",body:"px-4 py-3 text-sm",footer:"px-4 py-2.5 text-sm"},lg:{container:"min-w-80 text-base",header:"px-5 py-3.5 text-base font-semibold",body:"px-5 py-4 text-base",footer:"px-5 py-3 text-base"},xl:{container:"min-w-96 text-lg",header:"px-6 py-4 text-lg font-semibold",body:"px-6 py-5 text-lg",footer:"px-6 py-4 text-lg"}},Bd={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-3xl"};import{jsx as wl}from"react/jsx-runtime";function Cl({ref:e,children:t,className:r="",style:n,minWidth:o,maxWidth:i,zIndex:a=Qe.POPOVER,...s}){let{isOpen:l,refs:h,floatingStyles:d,context:w,getFloatingProps:p,size:m,radius:x,animated:y,animationDuration:b,modal:k,computedPlacement:T}=zt(),v=sb([h.setFloating,e]),{isMounted:u,styles:c}=et(w,{duration:b,animated:y});if(!u)return null;let g=C(m,Kr,"md"),f=C(x,Bd,"md"),D=["bg-neutral-white shadow-xl outline-none focus:outline-none flex flex-col border-2 border-neutral-200",g.container,f,r].filter(Boolean).join(" "),R=wl(ab,{context:w,modal:k,children:wl("div",{ref:v,style:{...d,...y?c:{},minWidth:o,maxWidth:i,zIndex:a,...n},className:D,"data-state":l?"open":"closed","data-placement":T,...p(s),children:t})});return wl(ib,{children:R})}var Hd=Cl;import{jsx as lb}from"react/jsx-runtime";function kl({children:e,className:t="",...r}){let{size:n}=zt(),o=C(n,Kr,"md");return lb("h2",{className:["text-neutral-900 border-b border-neutral-100 font-semibold",o.header,t].filter(Boolean).join(" "),...r,children:e})}var Vd=kl;import{jsx as cb}from"react/jsx-runtime";function Sl({children:e,className:t="",...r}){let{size:n}=zt(),o=C(n,Kr,"md");return cb("div",{className:["text-neutral-700",o.body,t].filter(Boolean).join(" "),...r,children:e})}var Ad=Sl;import{jsx as db}from"react/jsx-runtime";function ub({children:e,className:t="",...r}){let{size:n}=zt(),o=C(n,Kr,"md");return db("div",{className:["border-t border-neutral-100 bg-neutral-50/50",o.footer,t].filter(Boolean).join(" "),...r,children:e})}var Od=ub;import{cloneElement as fb,isValidElement as Tl}from"react";import{useMergeRefs as pb}from"@floating-ui/react";import{jsx as Gd}from"react/jsx-runtime";function gb({children:e,ref:t,className:r="",onClick:n,...o}){let i=Tl(e)?e.props?.ref:void 0,a=pb([t,i]);if(!Tl(e))return null;let s=e.props||{};return fb(e,{...o,...s,ref:a,className:[s.className,r].filter(Boolean).join(" "),onClick:l=>{s.onClick?.(l),n?.(l)}})}function mb({ref:e,children:t,className:r="",asChild:n=!1,onClick:o,...i}){let{setIsOpen:a}=zt(),s=l=>{o?.(l),l.defaultPrevented||a(!1)};return Tl(t)&&n?Gd(gb,{ref:e,className:r,onClick:s,...i,children:t}):Gd("button",{ref:e,type:"button",className:r,onClick:s,...i,children:t})}var Ud=mb;import{useState as Ml,useId as yb,useMemo as wb}from"react";import{useFloating as Cb,autoUpdate as kb,offset as Sb,flip as Tb,shift as Db,useDismiss as Rb,useRole as Nb,useInteractions as Pb,FloatingPortal as zb,FloatingFocusManager as Ib}from"@floating-ui/react";import{useState as Il,useMemo as Xd}from"react";var jd={months:["Th\xE1ng 1","Th\xE1ng 2","Th\xE1ng 3","Th\xE1ng 4","Th\xE1ng 5","Th\xE1ng 6","Th\xE1ng 7","Th\xE1ng 8","Th\xE1ng 9","Th\xE1ng 10","Th\xE1ng 11","Th\xE1ng 12"],monthsShort:["Thg 1","Thg 2","Thg 3","Thg 4","Thg 5","Thg 6","Thg 7","Thg 8","Thg 9","Thg 10","Thg 11","Thg 12"],weekdays:["Ch\u1EE7 Nh\u1EADt","Th\u1EE9 Hai","Th\u1EE9 Ba","Th\u1EE9 T\u01B0","Th\u1EE9 N\u0103m","Th\u1EE9 S\xE1u","Th\u1EE9 B\u1EA3y"],weekdaysShort:["CN","T2","T3","T4","T5","T6","T7"],weekdaysMin:["CN","T2","T3","T4","T5","T6","T7"],todayText:"H\xF4m nay",clearText:"X\xF3a",weekText:"Tu\u1EA7n",viewTabs:{days:"Ng\xE0y",months:"Th\xE1ng",years:"N\u0103m"}},Yd={months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],todayText:"Today",clearText:"Clear",weekText:"Week",viewTabs:{days:"Day",months:"Month",years:"Year"}},Kt={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,calendarPadding:"p-4.5",cellSize:"w-11 h-11",cellText:"text-base",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}};var _r={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Wd={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Xr={primary:{selected:"bg-primary-500 text-neutral-white hover:bg-primary-600",selectedText:"text-neutral-white",rangeBg:"bg-primary-100 text-primary-900",rangeText:"text-primary-900",hoverBg:"hover:bg-primary-200 hover:text-primary-900",todayRing:"border-primary-500 text-primary-500",activeText:"text-primary-500",accentBg:"bg-primary-500"},secondary:{selected:"bg-secondary-500 text-neutral-white hover:bg-secondary-600",selectedText:"text-neutral-white",rangeBg:"bg-secondary-100 text-secondary-900",rangeText:"text-secondary-900",hoverBg:"hover:bg-secondary-200 hover:text-secondary-900",todayRing:"border-secondary-500 text-secondary-500",activeText:"text-secondary-500",accentBg:"bg-secondary-500"},neutral:{selected:"bg-neutral-800 text-neutral-white hover:bg-neutral-900",selectedText:"text-neutral-white",rangeBg:"bg-neutral-200 text-neutral-900",rangeText:"text-neutral-900",hoverBg:"hover:bg-neutral-300 hover:text-neutral-900",todayRing:"border-neutral-600 text-neutral-600",activeText:"text-neutral-800",accentBg:"bg-neutral-800"},error:{selected:"bg-error-500 text-neutral-white hover:bg-error-600",selectedText:"text-neutral-white",rangeBg:"bg-error-100 text-error-900",rangeText:"text-error-900",hoverBg:"hover:bg-error-200 hover:text-error-900",todayRing:"border-error-500 text-error-500",activeText:"text-error-500",accentBg:"bg-error-500"},success:{selected:"bg-success-500 text-neutral-white hover:bg-success-600",selectedText:"text-neutral-white",rangeBg:"bg-success-100 text-success-900",rangeText:"text-success-900",hoverBg:"hover:bg-success-200 hover:text-success-900",todayRing:"border-success-500 text-success-500",activeText:"text-success-500",accentBg:"bg-success-500"},warning:{selected:"bg-warning-500 text-neutral-950 hover:bg-warning-600",selectedText:"text-neutral-950",rangeBg:"bg-warning-100 text-warning-900",rangeText:"text-warning-900",hoverBg:"hover:bg-warning-200 hover:text-warning-900",todayRing:"border-warning-500 text-warning-700",activeText:"text-warning-700",accentBg:"bg-warning-500"},info:{selected:"bg-info-500 text-neutral-white hover:bg-info-600",selectedText:"text-neutral-white",rangeBg:"bg-info-100 text-info-900",rangeText:"text-info-900",hoverBg:"hover:bg-info-200 hover:text-info-900",todayRing:"border-info-500 text-info-500",activeText:"text-info-500",accentBg:"bg-info-500"}},Kd={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}};function dt(e){return!e||e==="vi"?jd:e==="en"?Yd:e}function mt(e,t){if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:new Date(e.getTime());if(typeof e=="string"){let r=e.trim();if(!r)return null;if(t){let o=Rl(r,t);if(o)return o}let n=new Date(r);return isNaN(n.getTime())?null:n}if(typeof e=="number"){let r=new Date(e);return isNaN(r.getTime())?null:r}return null}function qr(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Sa(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function qo(e,t){let r=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return r<n}function Zo(e,t){let r=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return r>n}function Jo(e){let t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),r=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-r);let n=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t.getTime()-n.getTime())/864e5+1)/7)}function _d(e,t){return new Date(e,t+1,0).getDate()}function Ta(e,t,r=1,n,o,i,a){let s=[],l=new Date,h=new Date(e,t,1).getDay(),d=_d(e,t-1),w=_d(e,t),p=r===1?h===0?6:h-1:h;for(let x=p-1;x>=0;x--){let y=d-x,b=new Date(e,t-1,y);s.push(Dl(b,!1,l,n,o,i,a))}for(let x=1;x<=w;x++){let y=new Date(e,t,x);s.push(Dl(y,!0,l,n,o,i,a))}let m=42-s.length;for(let x=1;x<=m;x++){let y=new Date(e,t+1,x);s.push(Dl(y,!1,l,n,o,i,a))}return s}function Dl(e,t,r,n,o,i,a){let s=n?qr(e,n):!1,l=!1;return o&&qo(e,o)&&(l=!0),i&&Zo(e,i)&&(l=!0),a&&a(e)&&(l=!0),{date:e,day:e.getDate(),month:e.getMonth(),year:e.getFullYear(),isCurrentMonth:t,isToday:qr(e,r),isSelected:s,isDisabled:l,weekNumber:Jo(e)}}function Ht(e,t="DD/MM/YYYY",r){if(!e||isNaN(e.getTime()))return"";let n=dt(r),o=e.getFullYear(),i=e.getMonth(),a=e.getDate(),s=e.getHours(),l=e.getMinutes(),h=e.getSeconds(),d=e.getDay(),w=y=>String(y).padStart(2,"0"),p=s%12||12,m=s>=12?"PM":"AM",x={YYYY:String(o),YY:String(o).slice(-2),MMMM:n.months[i]??"",MMM:n.monthsShort[i]??"",MM:w(i+1),M:String(i+1),DD:w(a),D:String(a),dddd:n.weekdays[d]??"",ddd:n.weekdaysShort[d]??"",dd:n.weekdaysMin[d]??"",HH:w(s),H:String(s),hh:w(p),h:String(p),mm:w(l),m:String(l),ss:w(h),s:String(h),A:m,a:m.toLowerCase()};return t.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|ddd|dd|HH|H|hh|h|mm|m|ss|s|A|a/g,y=>x[y]??y)}function Rl(e,t="DD/MM/YYYY"){if(!e||typeof e!="string")return null;let r=e.trim();if(!r)return null;let n=new Date().getFullYear(),o=1,i=1,a=0,s=0,l=0,h=t.match(/YYYY|YY|MM|M|DD|D|HH|H|hh|h|mm|m|ss|s/g);if(!h){let m=new Date(r);return isNaN(m.getTime())?null:m}let d="^"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");for(let m of h)m==="YYYY"?d=d.replace("YYYY","(\\d{4})"):m==="YY"?d=d.replace("YY","(\\d{2})"):(m==="MM"||m==="M"||m==="DD"||m==="D"||m==="HH"||m==="H"||m==="hh"||m==="h"||m==="mm"||m==="m"||m==="ss"||m==="s")&&(d=d.replace(m,"(\\d{1,2})"));d+="$";let w=new RegExp(d).exec(r);if(!w){let m=new Date(r);return isNaN(m.getTime())?null:m}h.forEach((m,x)=>{let y=w[x+1];if(!y)return;let b=parseInt(y,10);isNaN(b)||(m==="YYYY"?n=b:m==="YY"?n=2e3+b:m==="MM"||m==="M"?o=b:m==="DD"||m==="D"?i=b:m==="HH"||m==="H"||m==="hh"||m==="h"?a=b:m==="mm"||m==="m"?s=b:(m==="ss"||m==="s")&&(l=b))});let p=new Date(n,o-1,i,a,s,l);return isNaN(p.getTime())?null:p}function Da(e,t="days"){if(t==="days")return e;if(t==="years")return e.includes("YYYY")?"YYYY":e.includes("YY")?"YY":"YYYY";if(t==="months"){let r=e.replace(/(?:DD|D|dddd|ddd|dd)\s*[-/.,\s]+\s*/,"");return r=r.replace(/\s*[-/.,\s]+\s*(?:DD|D|dddd|ddd|dd)/,""),r=r.replace(/[-/.,\s]{2,}/g,n=>n.charAt(0)).trim(),!r||!r.includes("M")&&!r.includes("Y")?e.includes("-")?"MM-YYYY":"MM/YYYY":r}return e}import{jsx as Ir,jsxs as Nl}from"react/jsx-runtime";function Qo({currentMonth:e,view:t,onViewChange:r,onPrevMonth:n,onNextMonth:o,onPrevYear:i,onNextYear:a,onPrevDecade:s,onNextDecade:l,size:h="md",color:d="primary",locale:w,showMonthButtons:p=!0}){let m=dt(w),x=C(h,Kt,"md"),y=C(d,Xr,"primary"),b=e.getFullYear(),k=e.getMonth(),T=Math.floor(b/10)*10,v=T+9,u=()=>{t==="days"?r("months"):t==="months"?r("years"):t==="years"&&r("days")},c=()=>{t==="years"?s?s():i():t==="months"?i():n()},g=()=>{t==="years"?l?l():a():t==="months"?a():o()},f=()=>t==="years"?`${T} - ${v}`:t==="months"?`${b}`:`${m.months[k]} ${b}`;return Nl("div",{className:"flex items-center justify-between px-1 pb-1.5 border-b border-neutral-200",children:[Nl("div",{className:"flex items-center space-x-0.5",children:[t==="days"&&Ir("button",{type:"button",onClick:i,"aria-label":"N\u0103m tr\u01B0\u1EDBc",className:`flex items-center justify-center ${x.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:Ir(Gr,{width:14,height:14})}),p&&Ir("button",{type:"button",onClick:c,"aria-label":"Th\xE1ng tr\u01B0\u1EDBc",className:`flex items-center justify-center ${x.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:Ir(Yt,{width:14,height:14})})]}),Ir("button",{type:"button",onClick:u,className:`${x.headerText} px-2 py-1 rounded-md text-neutral-800 hover:bg-neutral-100 hover:${y.activeText} transition-colors cursor-pointer`,children:f()}),Nl("div",{className:"flex items-center space-x-0.5",children:[p&&Ir("button",{type:"button",onClick:g,"aria-label":"Th\xE1ng ti\u1EBFp theo",className:`flex items-center justify-center ${x.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:Ir(Wt,{width:14,height:14})}),t==="days"&&Ir("button",{type:"button",onClick:a,"aria-label":"N\u0103m ti\u1EBFp theo",className:`flex items-center justify-center ${x.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:Ir(Ur,{width:14,height:14})})]})]})}import bb,{useRef as hb}from"react";import{jsx as ei,jsxs as Ra}from"react/jsx-runtime";function ti({days:e,onSelectDate:t,size:r="md",color:n="primary",radius:o,locale:i,firstDayOfWeek:a=1,showWeekNumbers:s=!1}){let l=dt(i),h=C(r,Kt,"md"),d=C(n,Xr,"primary"),w=C(o,_r,"lg"),p=hb(null),m=[...l.weekdaysShort];if(a===1){let u=m.shift();m.push(u)}let x=e.some(u=>u.isSelected&&!u.isDisabled),y=e.findIndex(u=>u.isToday&&!u.isDisabled),b=e.findIndex(u=>u.isCurrentMonth&&!u.isDisabled),k=b!==-1?b:e.findIndex(u=>!u.isDisabled),T=u=>{let g=p.current?.querySelectorAll("button")?.[u];g&&!g.disabled&&g.focus()},v=(u,c)=>{let g=null;if(u.key==="ArrowRight"){u.preventDefault();for(let f=c+1;f<e.length;f++)if(!e[f].isDisabled){g=f;break}}else if(u.key==="ArrowLeft"){u.preventDefault();for(let f=c-1;f>=0;f--)if(!e[f].isDisabled){g=f;break}}else if(u.key==="ArrowDown")u.preventDefault(),c+7<e.length&&!e[c+7].isDisabled&&(g=c+7);else if(u.key==="ArrowUp")u.preventDefault(),c-7>=0&&!e[c-7].isDisabled&&(g=c-7);else if(u.key==="Home"){u.preventDefault();let f=c-c%7;for(let S=f;S<f+7&&S<e.length;S++)if(!e[S].isDisabled){g=S;break}}else if(u.key==="End"){u.preventDefault();let f=Math.min(e.length-1,c-c%7+6);for(let S=f;S>=c-c%7;S--)if(!e[S].isDisabled){g=S;break}}else if(u.key==="Enter"||u.key===" "){u.preventDefault();let f=e[c];f&&!f.isDisabled&&t(f.date);return}g!==null&&T(g)};return Ra("div",{ref:p,role:"grid","aria-label":l.months[e[15]?.month||0],className:"w-full",children:[Ra("div",{role:"row",className:`grid ${s?"grid-cols-8":"grid-cols-7"} gap-1 mb-1 text-center`,children:[s&&ei("div",{role:"columnheader","aria-label":l.weekText||"Week",className:`flex items-center justify-center ${h.cellSize} text-neutral-400 ${h.cellText} font-medium`,children:"#"}),m.map(u=>ei("div",{role:"columnheader","aria-label":u,className:`flex items-center justify-center ${h.cellSize} text-neutral-500 ${h.cellText} font-medium`,children:u},u))]}),ei("div",{role:"rowgroup",className:`grid ${s?"grid-cols-8":"grid-cols-7"} gap-y-1 gap-x-1`,children:e.map((u,c)=>{let g=c%7===0,f="text-neutral-800 hover:bg-neutral-100";u.isDisabled?f="text-neutral-300 cursor-not-allowed line-through":u.isSelected?f=`${d.selected} font-semibold shadow-xs`:u.isCurrentMonth||(f="text-neutral-400 hover:bg-neutral-100");let S=u.isToday&&!u.isSelected?`ring-1 ${d.todayRing} font-bold`:"",D=`${u.day} ${l.months[u.month]} ${u.year}`,R=!u.isDisabled&&(u.isSelected||!x&&u.isToday&&c===y||!x&&y===-1&&c===k);return Ra(bb.Fragment,{children:[s&&g&&Ra("div",{className:`flex items-center justify-center ${h.cellSize} text-neutral-400 ${h.cellText} text-[10px] font-mono`,children:["W",u.weekNumber]}),ei("div",{role:"gridcell","aria-selected":u.isSelected,className:"flex items-center justify-center",children:ei("button",{type:"button",disabled:u.isDisabled,tabIndex:R?0:-1,onKeyDown:P=>v(P,c),onClick:()=>!u.isDisabled&&t(u.date),"aria-label":D,"aria-current":u.isToday?"date":void 0,"aria-disabled":u.isDisabled,className:`flex items-center justify-center ${h.cellSize} ${h.cellText} ${w} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${f} ${S}`,children:u.day})})]},u.date.toISOString())})})]})}import{useRef as xb}from"react";import{jsx as Pl}from"react/jsx-runtime";function ri({currentMonth:e,selectedDate:t,onSelectMonth:r,size:n="md",color:o="primary",radius:i,locale:a}){let s=dt(a),l=C(n,Kt,"md"),h=C(o,Xr,"primary"),d=C(i,_r,"lg"),w=xb(null),p=e.getFullYear(),m=new Date,x=m.getMonth(),y=m.getFullYear(),b=t&&t.getFullYear()===p?t.getMonth():-1,k=b!==-1?b:y===p?x:0,T=u=>{let g=w.current?.querySelectorAll("button")?.[u];g&&g.focus()},v=(u,c)=>{let g=null;if(u.key==="ArrowRight")u.preventDefault(),c+1<s.monthsShort.length&&(g=c+1);else if(u.key==="ArrowLeft")u.preventDefault(),c-1>=0&&(g=c-1);else if(u.key==="ArrowDown")u.preventDefault(),c+3<s.monthsShort.length&&(g=c+3);else if(u.key==="ArrowUp")u.preventDefault(),c-3>=0&&(g=c-3);else if(u.key==="Home")u.preventDefault(),g=0;else if(u.key==="End")u.preventDefault(),g=s.monthsShort.length-1;else if(u.key==="Enter"||u.key===" "){u.preventDefault(),r(c);return}g!==null&&T(g)};return Pl("div",{ref:w,role:"grid","aria-label":"Ch\u1ECDn th\xE1ng",className:"grid grid-cols-3 gap-2 py-2",children:s.monthsShort.map((u,c)=>{let g=new Date(p,c,1),f=t?Sa(g,t):!1,S=y===p&&x===c,D=c===k,R="text-neutral-800 hover:bg-neutral-100";return f?R=`${h.selected} font-semibold shadow-xs`:S&&(R=`ring-1 ${h.todayRing} font-semibold`),Pl("div",{role:"gridcell","aria-selected":f,className:"flex items-center justify-center",children:Pl("button",{type:"button",tabIndex:D?0:-1,onKeyDown:P=>v(P,c),onClick:()=>r(c),"aria-label":`${u} ${p}`,className:`w-full flex items-center justify-center h-10 ${l.cellText} ${d} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${R}`,children:u})},u)})})}import{useRef as vb}from"react";import{jsx as zl}from"react/jsx-runtime";function ni({currentMonth:e,selectedDate:t,onSelectYear:r,size:n="md",color:o="primary",radius:i}){let a=C(n,Kt,"md"),s=C(o,Xr,"primary"),l=C(i,_r,"lg"),h=vb(null),d=e.getFullYear(),w=t?t.getFullYear():d,p=Math.floor(d/10)*10,m=new Date().getFullYear(),x=[];for(let u=0;u<12;u++)x.push(p+u);let y=x.indexOf(w),b=x.indexOf(m),k=y!==-1?y:b!==-1?b:0,T=u=>{let g=h.current?.querySelectorAll("button")?.[u];g&&g.focus()},v=(u,c)=>{let g=null;if(u.key==="ArrowRight")u.preventDefault(),c+1<x.length&&(g=c+1);else if(u.key==="ArrowLeft")u.preventDefault(),c-1>=0&&(g=c-1);else if(u.key==="ArrowDown")u.preventDefault(),c+3<x.length&&(g=c+3);else if(u.key==="ArrowUp")u.preventDefault(),c-3>=0&&(g=c-3);else if(u.key==="Home")u.preventDefault(),g=0;else if(u.key==="End")u.preventDefault(),g=x.length-1;else if(u.key==="Enter"||u.key===" "){u.preventDefault();let f=x[c];f!==void 0&&r(f);return}g!==null&&T(g)};return zl("div",{ref:h,role:"grid","aria-label":"Ch\u1ECDn n\u0103m",className:"grid grid-cols-3 gap-2 py-2",children:x.map((u,c)=>{let g=u===w,f=u===m,S=c===k,D="text-neutral-800 hover:bg-neutral-100";return g?D=`${s.selected} font-semibold shadow-xs`:f&&(D=`ring-1 ${s.todayRing} font-semibold`),zl("div",{role:"gridcell","aria-selected":g,className:"flex items-center justify-center",children:zl("button",{type:"button",tabIndex:S?0:-1,onKeyDown:R=>v(R,c),onClick:()=>r(u),"aria-label":`${u}`,className:`w-full flex items-center justify-center h-10 ${a.cellText} ${l} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${D}`,children:u})},u)})})}import{jsx as Zr,jsxs as qd}from"react/jsx-runtime";function xr({value:e,onChange:t,view:r="days",onViewChange:n,minDate:o,maxDate:i,isDateDisabled:a,locale:s="vi",firstDayOfWeek:l=1,showWeekNumbers:h=!1,showViewTabs:d=!1,viewTabs:w=["days","months","years"],size:p="md",color:m="primary",radius:x,className:y="",bordered:b=!0}){let k=C(p,Kt,"md"),T=C(x,Wd,"lg"),[v,u]=Il(r),[c,g]=Il(r);r!==c&&(g(r),u(r));let[f,S]=Il(()=>{let A=e||new Date;return new Date(A.getFullYear(),A.getMonth(),1)}),D=dt(s),R=Xd(()=>{let A=D.viewTabs||{days:"Ng\xE0y",months:"Th\xE1ng",years:"N\u0103m"};return(w||["days","months","years"]).map(U=>({key:U,label:A[U]||U}))},[w,D.viewTabs]),P=A=>{let U=A;u(U),n?.(U)},I=()=>{let A=new Date(f.getFullYear(),f.getMonth()-1,1);S(A)},E=()=>{let A=new Date(f.getFullYear(),f.getMonth()+1,1);S(A)},N=()=>{let A=new Date(f.getFullYear()-1,f.getMonth(),1);S(A)},M=()=>{let A=new Date(f.getFullYear()+1,f.getMonth(),1);S(A)},z=()=>{let A=new Date(f.getFullYear()-10,f.getMonth(),1);S(A)},H=()=>{let A=new Date(f.getFullYear()+10,f.getMonth(),1);S(A)},V=A=>{let U=new Date(f.getFullYear(),A,1);S(U),r==="months"?t?.(U):u("days")},Y=A=>{let U=new Date(A,f.getMonth(),1);S(U),r==="years"?t?.(U):u("months")},$=mt(o),F=mt(i),G=Xd(()=>Ta(f.getFullYear(),f.getMonth(),l,e,$,F,a),[f,l,e,$,F,a]);return qd("div",{className:`inline-flex flex-col ${b?"border-2 border-neutral-200 bg-neutral-white shadow-xl":"border-0 shadow-none bg-transparent"} ${T} overflow-hidden select-none ${y}`,children:[d&&R.length>0&&Zr("div",{className:"px-2.5 py-1.5 border-b border-neutral-200",children:Zr(wn,{activeKey:r,onChange:P,size:"sm",variant:"solid",color:m,fullWidth:!0,className:"gap-0!",children:Zr(Cn,{className:"p-0.5",children:R.map(A=>Zr(kn,{value:A.key,className:"py-1 px-2 text-xs",children:A.label},A.key))})})}),qd("div",{className:`${k.calendarPadding} min-w-70`,children:[Zr(Qo,{currentMonth:f,view:v,onViewChange:u,onPrevMonth:I,onNextMonth:E,onPrevYear:N,onNextYear:M,onPrevDecade:z,onNextDecade:H,size:p,color:m,locale:s,showMonthButtons:!0}),v==="days"&&Zr(ti,{days:G,onSelectDate:A=>t?.(A),size:p,color:m,radius:x,locale:s,firstDayOfWeek:l,showWeekNumbers:h}),v==="months"&&Zr(ri,{currentMonth:f,selectedDate:e,onSelectMonth:V,size:p,color:m,radius:x,locale:s}),v==="years"&&Zr(ni,{currentMonth:f,selectedDate:e,onSelectYear:Y,size:p,color:m,radius:x})]})]})}import{jsx as bt,jsxs as Na}from"react/jsx-runtime";function Sn({ref:e,value:t,defaultValue:r,onChange:n,format:o="DD/MM/YYYY",displayFormat:i,defaultView:a="days",locale:s="vi",firstDayOfWeek:l=1,minDate:h,maxDate:d,isDateDisabled:w,size:p="md",variant:m="outline",color:x="primary",radius:y,label:b,labelPlacement:k="top",placeholder:T,helperText:v,errorMessage:u,name:c,id:g,autoComplete:f,viewTabs:S=["days","months","years"],view:D,onViewChange:R,onClear:P,placement:I="bottom-start",disabled:E=!1,readOnly:N=!1,portal:M=!0,config:z,className:H="",wrapperClassName:V="",inputWrapperClassName:Y="",labelClassName:$="",helperClassName:F="",popoverClassName:G=""}){let{isRequired:A=!1,isInvalid:U=!1,isLoading:B=!1,showSpinner:X=!1,isClearable:le=!0,isFullWidth:ne=!1,showWeekNumbers:ue=!1,showViewTabs:ie=!1,closeOnSelect:Q=!0}=z??{},q=yb(),ge=g||q,ke=`${ge}-error-helper`,L=`${ge}-popover`,te=D!==void 0,[Z,he]=Ml(a),ae=te?D:Z,ve=i||o,Se=wb(()=>Da(ve,ae),[ve,ae]),ye=t!==void 0,[J,O]=Ml(()=>mt(r,o)),W=ye?mt(t,o):J,we=W?Ht(W,Se,s):"",[fe,se]=Ml(!1),{refs:{setReference:me,setFloating:De},floatingStyles:xe,context:re}=Cb({placement:I,open:fe&&!E&&!N&&!B,onOpenChange:se,whileElementsMounted:kb,transform:!1,middleware:[Sb(6),Tb(),Db({padding:8})]}),de=Rb(re,{escapeKey:!0,outsidePress:!0}),ce=Nb(re,{role:"dialog"}),{getReferenceProps:ee,getFloatingProps:j}=Pb([de,ce]),{isMounted:Ce,styles:Ee}=et(re),Fe=!!(U||u),oe=Fe?"error":x,Te=C(p,Kt,"md"),Pe=C(y,_r,"lg"),_e=m==="other"?"":C(oe,C(m,Kd,"outline"),"primary"),Ue=!!W,Le=Re=>{te||he(Re),R?.(Re)},Be=Re=>{ye||O(Re);let Ye=Re?Ht(Re,o,s):"";n?.(Ye),Q&&se(!1)},Ke=Re=>{E||N||B||(Re.key==="ArrowDown"||Re.key==="Enter"||Re.key===" "?(Re.preventDefault(),fe||se(!0)):Re.key==="Escape"&&fe&&(Re.preventDefault(),se(!1)))},K=Re=>{Re.stopPropagation(),ye||O(null),n?.(null),P?.()},_=T||Se,ze=k==="floating",pe=k==="left",Me=()=>bt(at,{htmlFor:ge,label:b,isRequired:A,isFloating:ze,size:p,color:oe,hasError:Fe,cursor:"pointer",className:$}),Xe=Re=>bt("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Te.icon}`,"aria-hidden":"true",children:Re}),He=["group/field group/datepicker relative flex",pe?"flex-row items-center gap-3":"flex-col",ze?"pt-2":"",ne?"w-full":"inline-flex",V].filter(Boolean).join(" "),Ze=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",Te.inputHeight,Pe,_e,E?"opacity-50":"",ne?"w-full":"w-auto",Y].filter(Boolean).join(" "),qe=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",Te.inputText,Te.inputPadding,H].filter(Boolean).join(" ");return M?Na("div",{className:He,children:[!ze&&Me(),Na("div",{className:`flex flex-col ${ne?"w-full":""}`,children:[Na("div",{ref:me,...ee(),className:Ze,children:[ze&&Me(),bt("input",{ref:e,id:ge,name:c,type:"text",value:we,onClick:()=>!E&&!N&&!B&&se(Re=>!Re),onKeyDown:Ke,readOnly:!0,autoComplete:f,placeholder:_,disabled:E||B,role:"combobox","aria-expanded":fe&&!B,"aria-haspopup":"dialog","aria-controls":L,"aria-required":A,"aria-invalid":Fe,"aria-busy":B,"aria-disabled":E||B,"aria-describedby":v||u?ke:void 0,"aria-errormessage":u?ke:void 0,className:qe}),Na("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[B&&X&&bt("div",{className:"flex items-center justify-center shrink-0",children:Xe(bt(Ne,{}))}),!B&&le&&!E&&!N&&bt("button",{type:"button",onClick:K,"aria-label":"X\xF3a ng\xE0y",tabIndex:Ue?0:-1,"aria-hidden":!Ue,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${Te.icon} ${Ue?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:bt(Oe,{className:"size-full"})}),bt("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${fe?"rotate-180":"rotate-0"}`,children:Xe(bt(lt,{className:"size-full"}))})]})]}),Ce&&bt(zb,{children:bt(Ib,{context:re,modal:!1,returnFocus:!0,children:bt("div",{ref:De,id:L,style:{...xe,...Ee,zIndex:Qe.PICKER},...j(),className:G,children:bt(xr,{value:W,onChange:Be,view:ae,onViewChange:Le,minDate:h,maxDate:d,isDateDisabled:w,locale:s,firstDayOfWeek:l,showWeekNumbers:ue,size:p,color:x,radius:y,showViewTabs:ie,viewTabs:S})})})}),bt($e,{id:ke,helperText:v,errorMessage:u,sizeClassName:Te.helper,className:F})]})]}):bt("div",{className:H,children:bt(xr,{bordered:!1,value:W,onChange:Be,view:ae,onViewChange:Le,minDate:h,maxDate:d,isDateDisabled:w,locale:s,firstDayOfWeek:l,showWeekNumbers:ue,size:p,color:x,radius:y,showViewTabs:ie,viewTabs:S})})}import{useState as Bl,useId as Lb,useMemo as Bb}from"react";import{useFloating as Hb,autoUpdate as Vb,offset as Ab,flip as Ob,shift as Gb,useDismiss as Ub,useRole as jb,useInteractions as Yb,FloatingPortal as Wb,FloatingFocusManager as Kb}from"@floating-ui/react";import{useState as si,useMemo as Fa}from"react";var _t={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,calendarPadding:"p-4.5",cellSize:"w-11 h-11",cellText:"text-base",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},vr={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Pa={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Jr={primary:{selected:"bg-primary-500 text-neutral-white hover:bg-primary-600",rangeBg:"bg-primary-100",rangeText:"text-primary-900",hoverBg:"hover:bg-primary-200 hover:text-primary-900",todayRing:"ring-primary-500 text-primary-600",activeText:"text-primary-600",badge:"bg-primary-100 text-primary-700"},secondary:{selected:"bg-secondary-500 text-neutral-white hover:bg-secondary-600",rangeBg:"bg-secondary-100",rangeText:"text-secondary-900",hoverBg:"hover:bg-secondary-200 hover:text-secondary-900",todayRing:"ring-secondary-500 text-secondary-600",activeText:"text-secondary-600",badge:"bg-secondary-100 text-secondary-700"},neutral:{selected:"bg-neutral-800 text-neutral-white hover:bg-neutral-900",rangeBg:"bg-neutral-200",rangeText:"text-neutral-900",hoverBg:"hover:bg-neutral-300 hover:text-neutral-900",todayRing:"ring-neutral-800 text-neutral-800",activeText:"text-neutral-800",badge:"bg-neutral-200 text-neutral-800"},error:{selected:"bg-error-500 text-neutral-white hover:bg-error-600",rangeBg:"bg-error-100",rangeText:"text-error-900",hoverBg:"hover:bg-error-200 hover:text-error-900",todayRing:"ring-error-500 text-error-600",activeText:"text-error-600",badge:"bg-error-100 text-error-700"},success:{selected:"bg-success-500 text-neutral-white hover:bg-success-600",rangeBg:"bg-success-100",rangeText:"text-success-900",hoverBg:"hover:bg-success-200 hover:text-success-900",todayRing:"ring-success-500 text-success-600",activeText:"text-success-600",badge:"bg-success-100 text-success-700"},warning:{selected:"bg-warning-500 text-neutral-950 hover:bg-warning-600",rangeBg:"bg-warning-100",rangeText:"text-warning-900",hoverBg:"hover:bg-warning-200 hover:text-warning-900",todayRing:"ring-warning-500 text-warning-700",activeText:"text-warning-700",badge:"bg-warning-100 text-warning-700"},info:{selected:"bg-info-500 text-neutral-white hover:bg-info-600",rangeBg:"bg-info-100",rangeText:"text-info-900",hoverBg:"hover:bg-info-200 hover:text-info-900",todayRing:"ring-info-500 text-info-600",activeText:"text-info-600",badge:"bg-info-100 text-info-700"}},za={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"},other:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""}};import{jsx as Xt,jsxs as Ia}from"react/jsx-runtime";function oi({month1:e,month2:t,view:r,onViewChange:n,onPrevMonth:o,onNextMonth:i,onPrevYear:a,onNextYear:s,onPrevDecade:l,onNextDecade:h,size:d="md",color:w="primary",locale:p}){let m=dt(p),x=C(d,_t,"md"),y=C(w,Jr,"primary"),b=m.months[e.getMonth()],k=e.getFullYear(),T=Math.floor(k/10)*10,v=T+9,u=`${b} ${k}`;r==="months"&&(u=`${k}`),r==="years"&&(u=`${T} - ${v}`);let c=m.months[t.getMonth()],g=t.getFullYear(),f=Math.floor(g/10)*10,S=f+9,D=`${c} ${g}`;r==="months"&&(D=`${g}`),r==="years"&&(D=`${f} - ${S}`);let R=()=>{r==="days"?n("months"):r==="months"?n("years"):r==="years"&&n("days")},P=()=>{r==="days"?o():r==="months"?a():r==="years"&&(l?l():a())},I=()=>{r==="days"?i():r==="months"?s():r==="years"&&(h?h():s())};return Ia("div",{className:"flex items-center justify-between px-2 py-1.5 border-b border-neutral-200",children:[Ia("div",{className:"flex items-center space-x-0.5",children:[r==="days"&&Xt("button",{type:"button",onClick:a,"aria-label":"N\u0103m tr\u01B0\u1EDBc",className:`flex items-center justify-center ${x.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:Xt(Gr,{width:14,height:14})}),Xt("button",{type:"button",onClick:P,"aria-label":"Th\xE1ng tr\u01B0\u1EDBc",className:`flex items-center justify-center ${x.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:Xt(Yt,{width:x.iconSize,height:x.iconSize})})]}),Ia("div",{className:"grid grid-cols-2 flex-1 text-center divide-x divide-transparent px-2",children:[Xt("div",{className:"flex items-center justify-center",children:Xt("button",{type:"button",onClick:R,"aria-label":"\u0110\u1ED5i ch\u1EBF \u0111\u1ED9 xem l\u1ECBch",className:`font-semibold text-neutral-800 hover:${y.activeText} hover:bg-neutral-100 rounded-md px-2 py-1 transition-colors cursor-pointer ${x.headerText}`,children:u})}),Xt("div",{className:"flex items-center justify-center",children:Xt("button",{type:"button",onClick:R,"aria-label":"\u0110\u1ED5i ch\u1EBF \u0111\u1ED9 xem l\u1ECBch",className:`font-semibold text-neutral-800 hover:${y.activeText} hover:bg-neutral-100 rounded-md px-2 py-1 transition-colors cursor-pointer ${x.headerText}`,children:D})})]}),Ia("div",{className:"flex items-center space-x-0.5",children:[Xt("button",{type:"button",onClick:I,"aria-label":"Th\xE1ng ti\u1EBFp theo",className:`flex items-center justify-center ${x.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:Xt(Wt,{width:x.iconSize,height:x.iconSize})}),r==="days"&&Xt("button",{type:"button",onClick:s,"aria-label":"N\u0103m ti\u1EBFp theo",className:`flex items-center justify-center ${x.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:Xt(Ur,{width:14,height:14})})]})]})}import Mb,{useRef as Fb}from"react";import{jsx as ii,jsxs as Ma}from"react/jsx-runtime";function ao({days:e,onSelectDate:t,onHoverDate:r,size:n="md",color:o="primary",radius:i,locale:a,firstDayOfWeek:s=1,showWeekNumbers:l=!1}){let h=dt(a),d=C(n,_t,"md"),w=C(o,Jr,"primary"),p=C(i,vr,"lg"),m=Fb(null),x=[...h.weekdaysShort];if(s===1){let c=x.shift();x.push(c)}let y=e.some(c=>(c.isSelected||c.isRangeStart)&&!c.isDisabled),b=e.findIndex(c=>c.isToday&&!c.isDisabled),k=e.findIndex(c=>c.isCurrentMonth&&!c.isDisabled),T=k!==-1?k:e.findIndex(c=>!c.isDisabled),v=c=>{let f=m.current?.querySelectorAll("button")?.[c];f&&!f.disabled&&f.focus()},u=(c,g)=>{let f=null;if(c.key==="ArrowRight"){c.preventDefault();for(let S=g+1;S<e.length;S++)if(!e[S].isDisabled){f=S;break}}else if(c.key==="ArrowLeft"){c.preventDefault();for(let S=g-1;S>=0;S--)if(!e[S].isDisabled){f=S;break}}else if(c.key==="ArrowDown")c.preventDefault(),g+7<e.length&&!e[g+7].isDisabled&&(f=g+7);else if(c.key==="ArrowUp")c.preventDefault(),g-7>=0&&!e[g-7].isDisabled&&(f=g-7);else if(c.key==="Home"){c.preventDefault();let S=g-g%7;for(let D=S;D<S+7&&D<e.length;D++)if(!e[D].isDisabled){f=D;break}}else if(c.key==="End"){c.preventDefault();let S=Math.min(e.length-1,g-g%7+6);for(let D=S;D>=g-g%7;D--)if(!e[D].isDisabled){f=D;break}}else if(c.key==="Enter"||c.key===" "){c.preventDefault();let S=e[g];S&&!S.isDisabled&&t(S.date);return}f!==null&&v(f)};return Ma("div",{ref:m,role:"grid","aria-label":h.months[e[15]?.month||0],className:"w-full",children:[Ma("div",{role:"row",className:`grid ${l?"grid-cols-8":"grid-cols-7"} gap-1 mb-1 text-center`,children:[l&&ii("div",{role:"columnheader","aria-label":h.weekText||"Week",className:`flex items-center justify-center ${d.cellSize} text-neutral-400 ${d.cellText} font-medium`,children:"#"}),x.map(c=>ii("div",{role:"columnheader","aria-label":c,className:`flex items-center justify-center ${d.cellSize} text-neutral-500 ${d.cellText} font-medium`,children:c},c))]}),ii("div",{role:"rowgroup",className:`grid ${l?"grid-cols-8":"grid-cols-7"} gap-y-1 gap-x-1`,children:e.map((c,g)=>{let f=g%7===0,S="text-neutral-800 hover:bg-neutral-100",D="";c.isDisabled?S="text-neutral-300 cursor-not-allowed line-through":c.isRangeStart||c.isRangeEnd?(S=`${w.selected} font-semibold shadow-xs`,c.isRangeStart&&c.isRangeEnd?D="":c.isRangeStart?D=`${w.rangeBg} rounded-l-full`:c.isRangeEnd&&(D=`${w.rangeBg} rounded-r-full`)):c.isSelected?S=`${w.selected} font-semibold shadow-xs`:c.isInRange||c.isHoveredRange?(S=`${w.rangeBg} ${w.rangeText} rounded-none`,D=`${w.rangeBg}`):c.isCurrentMonth||(S="text-neutral-400 hover:bg-neutral-100");let R=c.isToday&&!c.isSelected?`ring-1 ${w.todayRing} font-bold`:"",P=`${c.day} ${h.months[c.month]} ${c.year}`,I=!c.isDisabled&&(c.isSelected||c.isRangeStart||!y&&c.isToday&&g===b||!y&&b===-1&&g===T);return Ma(Mb.Fragment,{children:[l&&f&&Ma("div",{className:`flex items-center justify-center ${d.cellSize} text-neutral-400 ${d.cellText} text-[10px] font-mono`,children:["W",c.weekNumber]}),ii("div",{role:"gridcell","aria-selected":c.isSelected||c.isInRange,className:`relative flex items-center justify-center ${D}`,children:ii("button",{type:"button",disabled:c.isDisabled,tabIndex:I?0:-1,onKeyDown:E=>u(E,g),onClick:()=>!c.isDisabled&&t(c.date),onMouseEnter:()=>!c.isDisabled&&r?.(c.date),onMouseLeave:()=>r?.(null),"aria-label":P,"aria-current":c.isToday?"date":void 0,"aria-disabled":c.isDisabled,className:`flex items-center justify-center ${d.cellSize} ${d.cellText} ${p} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${S} ${R}`,children:c.day})})]},c.date.toISOString())})})]})}import{useRef as Eb}from"react";import{jsx as Fl}from"react/jsx-runtime";function so({currentMonth:e,onSelectMonth:t,size:r="md",color:n="primary",radius:o,locale:i,rangeStart:a,rangeEnd:s,hoveredDate:l,onHoverMonth:h}){let d=dt(i),w=C(r,_t,"md"),p=C(n,Jr,"primary"),m=C(o,vr,"lg"),x=Eb(null),y=e.getFullYear(),b=new Date,k=b.getMonth(),T=b.getFullYear(),v=a&&a.getFullYear()===y?a.getMonth():-1,u=v!==-1?v:T===y?k:0,c=f=>{let D=x.current?.querySelectorAll("button")?.[f];D&&D.focus()},g=(f,S)=>{let D=null;if(f.key==="ArrowRight")f.preventDefault(),S+1<d.monthsShort.length&&(D=S+1);else if(f.key==="ArrowLeft")f.preventDefault(),S-1>=0&&(D=S-1);else if(f.key==="ArrowDown")f.preventDefault(),S+3<d.monthsShort.length&&(D=S+3);else if(f.key==="ArrowUp")f.preventDefault(),S-3>=0&&(D=S-3);else if(f.key==="Home")f.preventDefault(),D=0;else if(f.key==="End")f.preventDefault(),D=d.monthsShort.length-1;else if(f.key==="Enter"||f.key===" "){f.preventDefault(),t(S);return}D!==null&&c(D)};return Fl("div",{ref:x,role:"grid","aria-label":"Ch\u1ECDn th\xE1ng",className:"grid grid-cols-3 gap-2 py-2",onMouseLeave:()=>h?.(null),children:d.monthsShort.map((f,S)=>{let D=new Date(y,S,1),R=D.getTime(),P=a?new Date(a.getFullYear(),a.getMonth(),1).getTime():null,I=s?new Date(s.getFullYear(),s.getMonth(),1).getTime():null,E=l?new Date(l.getFullYear(),l.getMonth(),1).getTime():null,N=!!P&&P===R,M=!!I&&I===R,z=!1,H=!1;P&&I?z=R>P&&R<I:P&&!I&&E&&(E>P?H=R>P&&R<=E:E<P&&(H=R<P&&R>=E));let V=T===y&&k===S,Y=S===u,$="text-neutral-800 hover:bg-neutral-100";return N||M?$=`${p.selected} font-semibold shadow-xs`:z||H?$=`${p.rangeBg} ${p.rangeText}`:V&&($=`ring-1 ${p.todayRing} font-semibold`),Fl("div",{role:"gridcell","aria-selected":N||M||z,className:"flex items-center justify-center",children:Fl("button",{type:"button",tabIndex:Y?0:-1,onKeyDown:F=>g(F,S),onClick:()=>t(S),onMouseEnter:()=>h?.(D),"aria-label":`${f} ${y}`,className:`w-full flex items-center justify-center h-10 ${w.cellText} ${m} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${$}`,children:f})},f)})})}import{useRef as $b}from"react";import{jsx as El}from"react/jsx-runtime";function lo({currentMonth:e,onSelectYear:t,size:r="md",color:n="primary",radius:o,rangeStart:i,rangeEnd:a,hoveredDate:s,onHoverYear:l}){let h=C(r,_t,"md"),d=C(n,Jr,"primary"),w=C(o,vr,"lg"),p=$b(null),m=e.getFullYear(),x=Math.floor(m/10)*10,y=new Date().getFullYear(),b=[];for(let f=0;f<12;f++)b.push(x+f);let k=i?i.getFullYear():m,T=b.indexOf(k),v=b.indexOf(y),u=T!==-1?T:v!==-1?v:0,c=f=>{let D=p.current?.querySelectorAll("button")?.[f];D&&D.focus()},g=(f,S)=>{let D=null;if(f.key==="ArrowRight")f.preventDefault(),S+1<b.length&&(D=S+1);else if(f.key==="ArrowLeft")f.preventDefault(),S-1>=0&&(D=S-1);else if(f.key==="ArrowDown")f.preventDefault(),S+3<b.length&&(D=S+3);else if(f.key==="ArrowUp")f.preventDefault(),S-3>=0&&(D=S-3);else if(f.key==="Home")f.preventDefault(),D=0;else if(f.key==="End")f.preventDefault(),D=b.length-1;else if(f.key==="Enter"||f.key===" "){f.preventDefault();let R=b[S];R!==void 0&&t(R);return}D!==null&&c(D)};return El("div",{ref:p,role:"grid","aria-label":"Ch\u1ECDn n\u0103m",className:"grid grid-cols-3 gap-2 py-2",onMouseLeave:()=>l?.(null),children:b.map((f,S)=>{let D=i?i.getFullYear():null,R=a?a.getFullYear():null,P=s?s.getFullYear():null,I=D!==null&&f===D,E=R!==null&&f===R,N=!1,M=!1;D!==null&&R!==null?N=f>D&&f<R:D!==null&&R===null&&P!==null&&(P>D?M=f>D&&f<=P:P<D&&(M=f<D&&f>=P));let z=f===y,H=S===u,V="text-neutral-800 hover:bg-neutral-100";return I||E?V=`${d.selected} font-semibold shadow-xs`:N||M?V=`${d.rangeBg} ${d.rangeText}`:z&&(V=`ring-1 ${d.todayRing} font-semibold`),El("div",{role:"gridcell","aria-selected":I||E||N,className:"flex items-center justify-center",children:El("button",{type:"button",tabIndex:H?0:-1,onKeyDown:Y=>g(Y,S),onClick:()=>t(f),onMouseEnter:()=>l?.(new Date(f,0,1)),"aria-label":`${f}`,className:`w-full flex items-center justify-center h-10 ${h.cellText} ${w} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${V}`,children:f})},f)})})}function Ll(e,t,r){if(!t||!r)return!1;let n=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),o=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),i=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime(),a=Math.min(o,i),s=Math.max(o,i);return n>=a&&n<=s}function Zd(e,t){return new Date(e,t+1,0).getDate()}function $l(e,t,r,n,o,i,a,s,l){let h=n?qr(e,n):!1,d=o?qr(e,o):!1,w=Ll(e,n||null,o||null),p=n&&!o&&i?Ll(e,n,i):!1,m=!1;return a&&qo(e,a)&&(m=!0),s&&Zo(e,s)&&(m=!0),l&&l(e)&&(m=!0),{date:e,day:e.getDate(),month:e.getMonth(),year:e.getFullYear(),isCurrentMonth:t,isToday:qr(e,r),isSelected:h||d,isDisabled:m,isRangeStart:h,isRangeEnd:d,isInRange:w,isHoveredRange:p,weekNumber:Jo(e)}}function ai(e,t,r=1,n,o,i,a,s,l){let h=[],d=new Date,w=new Date(e,t,1).getDay(),p=Zd(e,t-1),m=Zd(e,t),x=r===1?w===0?6:w-1:w;for(let b=x-1;b>=0;b--){let k=p-b,T=new Date(e,t-1,k);h.push($l(T,!1,d,n,o,i,a,s,l))}for(let b=1;b<=m;b++){let k=new Date(e,t,b);h.push($l(k,!0,d,n,o,i,a,s,l))}let y=42-h.length;for(let b=1;b<=y;b++){let k=new Date(e,t+1,b);h.push($l(k,!1,d,n,o,i,a,s,l))}return h}import{jsx as sr,jsxs as Ea}from"react/jsx-runtime";function co({value:e,onChange:t,view:r="days",onViewChange:n,minDate:o,maxDate:i,isDateDisabled:a,locale:s="vi",firstDayOfWeek:l=1,showWeekNumbers:h=!1,showViewTabs:d=!1,viewTabs:w=["days","months","years"],size:p="md",color:m="primary",radius:x,className:y="",bordered:b=!0}){let k=C(p,_t,"md"),T=C(x,Pa,"lg"),[v,u]=si(r),[c,g]=si(r);r!==c&&(g(r),u(r));let f=e?e[0]:null,S=e?e[1]:null,[D,R]=si(()=>{let L=f||new Date;return new Date(L.getFullYear(),L.getMonth(),1)}),P=dt(s),I=Fa(()=>{let L=P.viewTabs||{days:"Ng\xE0y",months:"Th\xE1ng",years:"N\u0103m"};return(w||["days","months","years"]).map(te=>({key:te,label:L[te]||te}))},[w,P.viewTabs]),E=L=>{let te=L;u(te),F(null),n?.(te)},N=()=>{let L=new Date(D.getFullYear(),D.getMonth()-1,1);R(L)},M=()=>{let L=new Date(D.getFullYear(),D.getMonth()+1,1);R(L)},z=()=>{let L=new Date(D.getFullYear()-1,D.getMonth(),1);R(L)},H=()=>{let L=new Date(D.getFullYear()+1,D.getMonth(),1);R(L)},V=()=>{let L=new Date(D.getFullYear()-10,D.getMonth(),1);R(L)},Y=()=>{let L=new Date(D.getFullYear()+10,D.getMonth(),1);R(L)},[$,F]=si(null),[G,A]=si(null),U=L=>{if(!$)F(L),t?.([L,null]);else{let te=$,Z=L;L.getTime()<te.getTime()&&(te=L,Z=$),F(null),t?.([te,Z])}},B=(L,te)=>{let Z=new Date(L,te,1);if(R(Z),d&&r==="months")if(!$)F(Z),t?.([Z,null]);else{let he=$,ae=Z;Z.getTime()<he.getTime()&&(he=Z,ae=$),F(null),t?.([he,ae])}else u("days")},X=L=>{let te=new Date(L,0,1);if(R(te),d&&r==="years")if(!$)F(te),t?.([te,null]);else{let Z=$,he=te;te.getTime()<Z.getTime()&&(Z=te,he=$),F(null),t?.([Z,he])}else u("months")},le=mt(o),ne=mt(i),ue=D,ie=Fa(()=>v==="months"?new Date(D.getFullYear()+1,D.getMonth(),1):v==="years"?new Date(D.getFullYear()+10,D.getMonth(),1):new Date(D.getFullYear(),D.getMonth()+1,1),[D,v]),Q=$||f,q=$?null:S,ge=Fa(()=>ai(ue.getFullYear(),ue.getMonth(),l,Q,q,G,le,ne,a),[ue,l,Q,q,G,le,ne,a]),ke=Fa(()=>ai(ie.getFullYear(),ie.getMonth(),l,Q,q,G,le,ne,a),[ie,l,Q,q,G,le,ne,a]);return Ea("div",{className:`inline-flex flex-col ${b?"border-2 border-neutral-200 bg-neutral-white shadow-xl":"border-0 shadow-none bg-transparent"} ${T} overflow-hidden select-none ${y}`,children:[d&&I.length>0&&sr("div",{className:"px-2.5 py-1.5 border-b border-neutral-200",children:sr(wn,{activeKey:r,onChange:E,size:"sm",variant:"solid",color:m,fullWidth:!0,className:"gap-0!",children:sr(Cn,{className:"p-0.5",children:I.map(L=>sr(kn,{value:L.key,className:"py-1 px-2 text-xs",children:L.label},L.key))})})}),sr(oi,{month1:ue,month2:ie,view:v,onViewChange:u,onPrevMonth:N,onNextMonth:M,onPrevYear:z,onNextYear:H,onPrevDecade:V,onNextDecade:Y,size:p,color:m,locale:s}),Ea("div",{className:"flex flex-row divide-x divide-neutral-200",children:[Ea("div",{className:`${k.calendarPadding} min-w-70`,children:[v==="days"&&sr(ao,{days:ge,onSelectDate:U,onHoverDate:A,size:p,color:m,radius:x,locale:s,firstDayOfWeek:l,showWeekNumbers:h}),v==="months"&&sr(so,{currentMonth:ue,onSelectMonth:L=>B(ue.getFullYear(),L),size:p,color:m,radius:x,locale:s,rangeStart:Q,rangeEnd:q,hoveredDate:G,onHoverMonth:A}),v==="years"&&sr(lo,{currentMonth:ue,onSelectYear:X,size:p,color:m,radius:x,rangeStart:Q,rangeEnd:q,hoveredDate:G,onHoverYear:A})]}),Ea("div",{className:`${k.calendarPadding} min-w-70`,children:[v==="days"&&sr(ao,{days:ke,onSelectDate:U,onHoverDate:A,size:p,color:m,radius:x,locale:s,firstDayOfWeek:l,showWeekNumbers:h}),v==="months"&&sr(so,{currentMonth:ie,onSelectMonth:L=>B(ie.getFullYear(),L),size:p,color:m,radius:x,locale:s,rangeStart:Q,rangeEnd:q,hoveredDate:G,onHoverMonth:A}),v==="years"&&sr(lo,{currentMonth:ie,onSelectYear:X,size:p,color:m,radius:x,rangeStart:Q,rangeEnd:q,hoveredDate:G,onHoverYear:A})]})]})]})}import{jsx as ht,jsxs as $a}from"react/jsx-runtime";function Tn({ref:e,value:t,defaultValue:r,onChange:n,separator:o=" - ",format:i="DD/MM/YYYY",displayFormat:a,defaultView:s="days",locale:l="vi",firstDayOfWeek:h=1,minDate:d,maxDate:w,isDateDisabled:p,size:m="md",variant:x="outline",color:y="primary",radius:b,label:k,labelPlacement:T="top",placeholder:v,helperText:u,errorMessage:c,name:g,id:f,autoComplete:S,viewTabs:D=["days","months","years"],view:R,onViewChange:P,onClear:I,placement:E="bottom-start",disabled:N=!1,readOnly:M=!1,portal:z=!0,config:H,className:V="",wrapperClassName:Y="",inputWrapperClassName:$="",labelClassName:F="",helperClassName:G="",popoverClassName:A=""}){let{isRequired:U=!1,isInvalid:B=!1,isLoading:X=!1,showSpinner:le=!1,isClearable:ne=!0,isFullWidth:ue=!1,showWeekNumbers:ie=!1,showViewTabs:Q=!1,closeOnSelect:q=!0}=H??{},ge=Lb(),ke=f||ge,L=`${ke}-error-helper`,te=`${ke}-popover`,Z=R!==void 0,[he,ae]=Bl(s),ve=Z?R:he,Se=a||i,ye=Bb(()=>Da(Se,ve),[Se,ve]),J=t!==void 0,[O,W]=Bl(()=>{let be=r;return be&&Array.isArray(be)?[mt(be[0],i),mt(be[1],i)]:[null,null]}),we=J&&t&&Array.isArray(t)?[mt(t[0],i),mt(t[1],i)]:O,fe=we[0]&&we[1]?`${Ht(we[0],ye,l)}${o}${Ht(we[1],ye,l)}`:we[0]?`${Ht(we[0],ye,l)}${o}`:"",[se,me]=Bl(!1),{refs:{setReference:De,setFloating:xe},floatingStyles:re,context:de}=Hb({placement:E,open:se&&!N&&!M&&!X,onOpenChange:me,whileElementsMounted:Vb,transform:!1,middleware:[Ab(6),Ob(),Gb({padding:8})]}),ce=Ub(de,{escapeKey:!0,outsidePress:!0}),ee=jb(de,{role:"dialog"}),{getReferenceProps:j,getFloatingProps:Ce}=Yb([ce,ee]),{isMounted:Ee,styles:Fe}=et(de),oe=!!(B||c),Te=oe?"error":y,Pe=C(m,_t,"md"),_e=C(b,vr,"lg"),Ue=C(x,za,"outline"),Le=x==="other"?"":C(Te,Ue,"primary"),Be=!!we[0],Ke=be=>{Z||ae(be),P?.(be)},K=be=>{J||W(be);let[Ve,rt]=be;if(Ve&&rt){let Je=[Ht(Ve,i,l),Ht(rt,i,l)];n?.(Je),q&&me(!1)}},_=be=>{N||M||X||(be.key==="ArrowDown"||be.key==="Enter"||be.key===" "?(be.preventDefault(),se||me(!0)):be.key==="Escape"&&se&&(be.preventDefault(),me(!1)))},ze=be=>{be.stopPropagation(),J||W([null,null]),n?.(null),I?.()},pe=v||`${ye}${o}${ye}`,Me=T==="floating",Xe=T==="left",He=()=>ht(at,{htmlFor:ke,label:k,isRequired:U,isFloating:Me,size:m,color:Te,hasError:oe,cursor:"pointer",className:F}),Ze=be=>ht("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Pe.icon}`,"aria-hidden":"true",children:be}),qe=["group/field group/daterangepicker relative flex",Xe?"flex-row items-center gap-3":"flex-col",Me?"pt-2":"",ue?"w-full":"inline-flex",Y].filter(Boolean).join(" "),Re=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",Pe.inputHeight,_e,Le,N?"opacity-50":"",ue?"w-full":"w-auto",$].filter(Boolean).join(" "),Ye=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",Pe.inputText,Pe.inputPadding,V].filter(Boolean).join(" ");return z?$a("div",{className:qe,children:[!Me&&He(),$a("div",{className:`flex flex-col ${ue?"w-full":""}`,children:[$a("div",{ref:De,...j(),className:Re,children:[Me&&He(),ht("input",{ref:e,id:ke,name:g,type:"text",value:fe,onClick:()=>!N&&!M&&!X&&me(be=>!be),onKeyDown:_,readOnly:!0,autoComplete:S,placeholder:pe,disabled:N||X,role:"combobox","aria-expanded":se&&!X,"aria-haspopup":"dialog","aria-controls":te,"aria-required":U,"aria-invalid":oe,"aria-busy":X,"aria-disabled":N||X,"aria-describedby":u||c?L:void 0,"aria-errormessage":c?L:void 0,className:Ye}),$a("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[X&&le&&ht("div",{className:"flex items-center justify-center shrink-0",children:Ze(ht(Ne,{}))}),!X&&ne&&!N&&!M&&ht("button",{type:"button",onClick:ze,"aria-label":"X\xF3a kho\u1EA3ng ng\xE0y",tabIndex:Be?0:-1,"aria-hidden":!Be,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${Pe.icon} ${Be?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:ht(Oe,{className:"size-full"})}),ht("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${se?"rotate-180":"rotate-0"}`,children:Ze(ht(lt,{className:"size-full"}))})]})]}),Ee&&ht(Wb,{children:ht(Kb,{context:de,modal:!1,returnFocus:!0,children:ht("div",{ref:xe,id:te,style:{...re,...Fe,zIndex:Qe.PICKER},...Ce(),className:A,children:ht(co,{value:we,onChange:K,view:ve,onViewChange:Ke,minDate:d,maxDate:w,isDateDisabled:p,locale:l,firstDayOfWeek:h,showWeekNumbers:ie,size:m,color:y,radius:b,showViewTabs:Q,viewTabs:D})})})}),ht($e,{id:L,helperText:u,errorMessage:c,sizeClassName:Pe.helper,className:G})]})]}):ht("div",{className:V,children:ht(co,{bordered:!1,value:we,onChange:K,view:ve,onViewChange:Ke,minDate:d,maxDate:w,isDateDisabled:p,locale:l,firstDayOfWeek:h,showWeekNumbers:ie,size:m,color:y,radius:b,showViewTabs:Q,viewTabs:D})})}import{useState as s0,useId as Xb}from"react";import{useFloating as qb,autoUpdate as Zb,offset as Jb,flip as Qb,shift as eh,useDismiss as th,useRole as rh,useInteractions as nh,FloatingPortal as oh,FloatingFocusManager as ih}from"@floating-ui/react";import{useMemo as uo}from"react";var Qr={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,panelPadding:"p-1.5",columnWidth:"w-12",columnHeight:"h-36",itemHeight:"h-6",itemText:"text-[11px]",headerText:"text-[11px] font-semibold",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,panelPadding:"p-2",columnWidth:"w-14",columnHeight:"h-44",itemHeight:"h-7",itemText:"text-xs",headerText:"text-xs font-semibold",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,panelPadding:"p-2.5",columnWidth:"w-16",columnHeight:"h-52",itemHeight:"h-8",itemText:"text-sm",headerText:"text-sm font-semibold",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,panelPadding:"p-3",columnWidth:"w-18",columnHeight:"h-60",itemHeight:"h-9",itemText:"text-base",headerText:"text-base font-semibold",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,panelPadding:"p-3.5",columnWidth:"w-20",columnHeight:"h-68",itemHeight:"h-10",itemText:"text-base",headerText:"text-lg font-semibold",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},La={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Ba={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Jd={none:"rounded-none",sm:"rounded-xs",md:"rounded-md",lg:"rounded-lg",xl:"rounded-lg",full:"rounded-full"},Qd={primary:{selected:"bg-primary-500 text-neutral-white font-semibold shadow-xs hover:bg-primary-600",hoverBg:"hover:bg-primary-100 hover:text-primary-900",activeText:"text-primary-600",accentBg:"bg-primary-500"},secondary:{selected:"bg-secondary-500 text-neutral-white font-semibold shadow-xs hover:bg-secondary-600",hoverBg:"hover:bg-secondary-100 hover:text-secondary-900",activeText:"text-secondary-600",accentBg:"bg-secondary-500"},neutral:{selected:"bg-neutral-800 text-neutral-white font-semibold shadow-xs hover:bg-neutral-900",hoverBg:"hover:bg-neutral-200 hover:text-neutral-900",activeText:"text-neutral-800",accentBg:"bg-neutral-800"},error:{selected:"bg-error-500 text-neutral-white font-semibold shadow-xs hover:bg-error-600",hoverBg:"hover:bg-error-100 hover:text-error-900",activeText:"text-error-600",accentBg:"bg-error-500"},success:{selected:"bg-success-500 text-neutral-white font-semibold shadow-xs hover:bg-success-600",hoverBg:"hover:bg-success-100 hover:text-success-900",activeText:"text-success-600",accentBg:"bg-success-500"},warning:{selected:"bg-warning-500 text-neutral-950 font-semibold shadow-xs hover:bg-warning-600",hoverBg:"hover:bg-warning-100 hover:text-warning-900",activeText:"text-warning-700",accentBg:"bg-warning-500"},info:{selected:"bg-info-500 text-neutral-white font-semibold shadow-xs hover:bg-info-600",hoverBg:"hover:bg-info-100 hover:text-info-900",activeText:"text-info-600",accentBg:"bg-info-500"}};var Ha={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}};function lr(e){return e<10?`0${e}`:`${e}`}function en(e=!1,t=!0){return e?t?"hh:mm:ss A":"hh:mm A":t?"HH:mm:ss":"HH:mm"}function Vt(e){if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:new Date(e);if(typeof e!="string")return null;let t=e.trim();if(!t)return null;if(t.includes("T")){let o=new Date(t);if(!isNaN(o.getTime()))return o}let r=/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?(?:\s*([ap]m))?$/i,n=t.match(r);if(n){let o=parseInt(n[1],10),i=parseInt(n[2],10),a=n[3]?parseInt(n[3],10):0,s=n[4]?.toUpperCase();if(s&&(s==="PM"&&o<12&&(o+=12),s==="AM"&&o===12&&(o=0)),o>=0&&o<24&&i>=0&&i<60&&a>=0&&a<60){let l=new Date;return l.setHours(o,i,a,0),l}}return null}function It(e,t="HH:mm:ss"){if(!e||isNaN(e.getTime()))return"";let r=e.getHours(),n=e.getMinutes(),o=e.getSeconds(),i=r%12;i===0&&(i=12);let a=r>=12?"PM":"AM";return t.replace(/HH/g,lr(r)).replace(/H/g,`${r}`).replace(/hh/g,lr(i)).replace(/h/g,`${i}`).replace(/mm/g,lr(n)).replace(/m/g,`${n}`).replace(/ss/g,lr(o)).replace(/s/g,`${o}`).replace(/A/g,a).replace(/a/g,a.toLowerCase())}function e0(e){if(!e)return{hours:0,minutes:0,seconds:0,period:"AM"};let t=e.getHours();return{hours:t,minutes:e.getMinutes(),seconds:e.getSeconds(),period:t>=12?"PM":"AM"}}function Dn(e,t,r=0){let n=new Date;return n.setHours(e,t,r,0),n}function t0(e,t,r=!0){return!e||!t?!1:r?e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes()&&e.getSeconds()===t.getSeconds():e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes()}function r0(e,t){if(!e||!t)return!1;let r=e.getHours()*3600+e.getMinutes()*60+e.getSeconds(),n=t.getHours()*3600+t.getMinutes()*60+t.getSeconds();return r<n}function n0(e,t){if(!e||!t)return!1;let r=e.getHours()*3600+e.getMinutes()*60+e.getSeconds(),n=t.getHours()*3600+t.getMinutes()*60+t.getSeconds();return r>n}function Rn(e,t,r,n,o,i,a,s,l){if(e==="hour"){if(a?.().includes(t)||o&&t<o.getHours()||i&&t>i.getHours())return!0}else if(e==="minute"){if(s?.(r).includes(t)||o&&(r<o.getHours()||r===o.getHours()&&t<o.getMinutes())||i&&(r>i.getHours()||r===i.getHours()&&t>i.getMinutes()))return!0}else if(e==="second"&&(l?.(r,n).includes(t)||o&&(r<o.getHours()||r===o.getHours()&&n<o.getMinutes()||r===o.getHours()&&n===o.getMinutes()&&t<o.getSeconds())||i&&(r>i.getHours()||r===i.getHours()&&n>i.getMinutes()||r===i.getHours()&&n===i.getMinutes()&&t>i.getSeconds())))return!0;return!1}import{useEffect as _b,useRef as o0}from"react";import{jsx as i0}from"react/jsx-runtime";function tn({items:e,selectedValue:t,onSelect:r,ariaLabel:n,size:o="md",color:i="primary",radius:a,className:s="",itemClassName:l="",selectedItemClassName:h=""}){let d=o0(null),w=o0(null),p=C(o,Qr,"md"),m=C(i,Qd,"primary"),x=C(a,Jd,"md"),y=e.findIndex(v=>!v.disabled),b=e.some(v=>v.value===t);_b(()=>{if(w.current&&d.current){let v=d.current,u=w.current,c=u.offsetTop-v.offsetTop-(v.clientHeight-u.clientHeight)/2;v.scrollTo({top:Math.max(0,c),behavior:"smooth"}),v.contains(document.activeElement)&&u.focus()}},[t]);let k=v=>{let u=e[v];if(!u||u.disabled)return;r(u.value),d.current?.children[v]?.focus()},T=(v,u)=>{if(e.filter(g=>!g.disabled).length){if(v.key==="ArrowDown"){v.preventDefault();for(let g=u+1;g<e.length;g++)if(!e[g].disabled){k(g);break}}else if(v.key==="ArrowUp"){v.preventDefault();for(let g=u-1;g>=0;g--)if(!e[g].disabled){k(g);break}}else if(v.key==="ArrowRight")v.preventDefault(),d.current?.nextElementSibling?.querySelector('[tabindex="0"], [role="option"]:not([aria-disabled="true"])')?.focus();else if(v.key==="ArrowLeft")v.preventDefault(),d.current?.previousElementSibling?.querySelector('[tabindex="0"], [role="option"]:not([aria-disabled="true"])')?.focus();else if(v.key==="Home"){v.preventDefault();let g=e.findIndex(f=>!f.disabled);g!==-1&&k(g)}else if(v.key==="End"){v.preventDefault();for(let g=e.length-1;g>=0;g--)if(!e[g].disabled){k(g);break}}else if(v.key==="Enter"||v.key===" "){v.preventDefault();let g=e[u];g&&!g.disabled&&k(u)}}};return i0("ul",{ref:d,role:"listbox","aria-label":n,tabIndex:-1,className:`relative flex flex-col overflow-y-auto select-none ${p.columnWidth} ${p.columnHeight} scrollbar-thin scrollbar-thumb-neutral-300 hover:scrollbar-thumb-neutral-400 py-1 focus:outline-none ${s}`,style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e.map((v,u)=>{let c=t===v.value,g=!!v.disabled,f=!g&&(c||!b&&u===y);return i0("li",{ref:c?w:void 0,role:"option","aria-selected":c,"aria-disabled":g,"aria-label":`${v.label} ${n||""}`.trim(),tabIndex:f?0:-1,onKeyDown:S=>T(S,u),onClick:()=>{g||k(u)},className:`flex items-center justify-center shrink-0 transition-colors duration-150 mx-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${x} ${p.itemHeight} ${p.itemText} ${g?"opacity-30 cursor-not-allowed text-neutral-400":c?`${m.selected} cursor-default ${h}`:`text-neutral-700 ${m.hoverBg} cursor-pointer`} ${l}`,children:v.label},`${v.value}`)})})}import{jsx as fo,jsxs as a0}from"react/jsx-runtime";function qt({value:e,onChange:t,ariaLabel:r="Time selector",use12Hours:n=!1,showSeconds:o=!0,hourStep:i=1,minuteStep:a=1,secondStep:s=1,minTime:l,maxTime:h,disabledHours:d,disabledMinutes:w,disabledSeconds:p,size:m="md",color:x="primary",radius:y,className:b=""}){let k=uo(()=>Vt(l),[l]),T=uo(()=>Vt(h),[h]),v=en(n,o),u=C(y,Ba,"lg"),c=C(m,Qr,"md"),g=e?e.getHours():0,f=g%12===0?12:g%12,S=e?e.getMinutes():0,D=e?e.getSeconds():0,R=g>=12?"PM":"AM",P=uo(()=>{let $=[];if(n)for(let F=1;F<=12;F+=i){let G=R==="PM"?F===12?12:F+12:F===12?0:F,A=Rn("hour",G,g,S,k,T,d,w,p);$.push({value:F,label:lr(F),disabled:A})}else for(let F=0;F<24;F+=i){let G=Rn("hour",F,g,S,k,T,d,w,p);$.push({value:F,label:lr(F),disabled:G})}return $},[n,i,R,g,S,k,T,d,w,p]),I=uo(()=>{let $=[];for(let F=0;F<60;F+=a){let G=Rn("minute",F,g,S,k,T,d,w,p);$.push({value:F,label:lr(F),disabled:G})}return $},[a,g,S,k,T,d,w,p]),E=uo(()=>{if(!o)return[];let $=[];for(let F=0;F<60;F+=s){let G=Rn("second",F,g,S,k,T,d,w,p);$.push({value:F,label:lr(F),disabled:G})}return $},[o,s,g,S,k,T,d,w,p]),N=uo(()=>[{value:"AM",label:"AM"},{value:"PM",label:"PM"}],[]),M=$=>{let F=Number($);n&&(R==="PM"&&F<12&&(F+=12),R==="AM"&&F===12&&(F=0));let G=Dn(F,S,D);t?.(G)},z=$=>{let F=Number($),G=Dn(g,F,D);t?.(G)},H=$=>{let F=Number($),G=Dn(g,S,F);t?.(G)},V=$=>{let F=$,G=g;F==="AM"&&G>=12?G-=12:F==="PM"&&G<12&&(G+=12);let A=Dn(G,S,D);t?.(A)},Y=o?"--:--:--":"--:--";return a0("div",{"aria-label":r,className:`inline-flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${u} ${b}`,children:[fo("div",{className:"flex items-center justify-center px-4 py-2 border-b border-neutral-200 bg-neutral-50/50",children:fo("span",{className:`text-neutral-700 tracking-wider font-mono ${c.headerText}`,children:e?It(e,v):Y})}),a0("div",{className:`flex divide-x divide-neutral-200 ${c.panelPadding}`,children:[fo(tn,{ariaLabel:"Gi\u1EDD",items:P,selectedValue:n?f:e?g:null,onSelect:M,size:m,color:x,radius:y}),fo(tn,{ariaLabel:"Ph\xFAt",items:I,selectedValue:e?S:null,onSelect:z,size:m,color:x,radius:y}),o&&fo(tn,{ariaLabel:"Gi\xE2y",items:E,selectedValue:e?D:null,onSelect:H,size:m,color:x,radius:y}),n&&fo(tn,{ariaLabel:"Bu\u1ED5i",items:N,selectedValue:e?R:null,onSelect:V,size:m,color:x,radius:y})]})]})}import{jsx as Mt,jsxs as Va}from"react/jsx-runtime";function Hl({ref:e,value:t,defaultValue:r,onChange:n,format:o="HH:mm:ss",displayFormat:i,use12Hours:a=!1,showSeconds:s=!0,hourStep:l=1,minuteStep:h=1,secondStep:d=1,minTime:w,maxTime:p,disabledHours:m,disabledMinutes:x,disabledSeconds:y,size:b="md",variant:k="outline",color:T="primary",radius:v,label:u,labelPlacement:c="top",placeholder:g,helperText:f,errorMessage:S,name:D,id:R,autoComplete:P,onClear:I,placement:E="bottom-start",disabled:N=!1,readOnly:M=!1,config:z,className:H="",wrapperClassName:V="",inputWrapperClassName:Y="",labelClassName:$="",helperClassName:F="",popoverClassName:G=""}){let{isRequired:A=!1,isInvalid:U=!1,isLoading:B=!1,showSpinner:X=!1,isClearable:le=!0,isFullWidth:ne=!1,closeOnSelect:ue=!1}=z??{},ie=Xb(),Q=R||ie,q=`${Q}-error-helper`,ge=`${Q}-popover`,ke=en(a,s),L=o||ke,te=i||L,Z=t!==void 0,[he,ae]=s0(()=>Vt(r)),ve=Z?Vt(t):he,Se=ve?It(ve,te):"",[ye,J]=s0(!1),{refs:{setReference:O,setFloating:W},floatingStyles:we,context:fe}=qb({placement:E,open:ye&&!N&&!M&&!B,onOpenChange:J,whileElementsMounted:Zb,transform:!1,middleware:[Jb(6),Qb(),eh({padding:8})]}),se=th(fe,{escapeKey:!0,outsidePress:!0}),me=rh(fe,{role:"dialog"}),{getReferenceProps:De,getFloatingProps:xe}=nh([se,me]),{isMounted:re,styles:de}=et(fe),ce=!!(U||S),ee=ce?"error":T,j=C(b,Qr,"md"),Ce=C(v,La,"lg"),Ee=k==="other"?"":C(ee,C(k,Ha,"outline"),"primary"),Fe=!!ve,oe=pe=>{Z||ae(pe);let Me=pe?It(pe,L):"";n?.(Me),ue&&J(!1)},Te=pe=>{N||M||B||(pe.key==="ArrowDown"||pe.key==="Enter"||pe.key===" "?(pe.preventDefault(),ye||J(!0)):pe.key==="Escape"&&ye&&(pe.preventDefault(),J(!1)))},Pe=pe=>{pe.stopPropagation(),Z||ae(null),n?.(null),I?.()},_e=g||te,Ue=c==="floating",Le=c==="left",Be=()=>Mt(at,{htmlFor:Q,label:u,isRequired:A,isFloating:Ue,size:b,color:ee,hasError:ce,cursor:"pointer",className:$}),Ke=pe=>Mt("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${j.icon}`,"aria-hidden":"true",children:pe}),K=["group/field group/timepicker relative flex",Le?"flex-row items-center gap-3":"flex-col",Ue?"pt-2":"",ne?"w-full":"inline-flex",V].filter(Boolean).join(" "),_=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",j.inputHeight,Ce,Ee,N?"opacity-50":"",ne?"w-full":"w-auto",Y].filter(Boolean).join(" "),ze=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",j.inputText,j.inputPadding,H].filter(Boolean).join(" ");return Va("div",{className:K,children:[!Ue&&Be(),Va("div",{className:`flex flex-col ${ne?"w-full":""}`,children:[Va("div",{ref:O,...De(),className:_,children:[Ue&&Be(),Mt("input",{ref:e,id:Q,name:D,type:"text",value:Se,onClick:()=>!N&&!M&&!B&&J(pe=>!pe),onKeyDown:Te,readOnly:!0,autoComplete:P,placeholder:_e,disabled:N||B,role:"combobox","aria-expanded":ye&&!B,"aria-haspopup":"dialog","aria-controls":ge,"aria-required":A,"aria-invalid":ce,"aria-busy":B,"aria-disabled":N||B,"aria-describedby":f||S?q:void 0,"aria-errormessage":S?q:void 0,className:ze}),Va("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[B&&X&&Mt("div",{className:"flex items-center justify-center shrink-0",children:Ke(Mt(Ne,{}))}),!B&&le&&!N&&!M&&Mt("button",{type:"button",onClick:Pe,"aria-label":"X\xF3a th\u1EDDi gian",tabIndex:Fe?0:-1,"aria-hidden":!Fe,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${j.icon} ${Fe?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:Mt(Oe,{className:"size-full"})}),Mt("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${ye?"rotate-180":"rotate-0"}`,children:Ke(Mt(lt,{className:"size-full"}))})]})]}),re&&Mt(oh,{children:Mt(ih,{context:fe,modal:!1,returnFocus:!0,children:Mt("div",{ref:W,id:ge,style:{...we,...de,zIndex:Qe.PICKER},...xe(),className:G,children:Mt(qt,{value:ve,onChange:oe,ariaLabel:typeof u=="string"?`${u} selector`:"Time selector",use12Hours:a,showSeconds:s,hourStep:l,minuteStep:h,secondStep:d,minTime:w,maxTime:p,disabledHours:m,disabledMinutes:x,disabledSeconds:y,size:b,color:T,radius:v})})})}),Mt($e,{id:q,helperText:f,errorMessage:S,sizeClassName:j.helper,className:F})]})]})}import{useState as f0,useId as ah,useMemo as sh}from"react";import{useFloating as lh,autoUpdate as ch,offset as uh,flip as dh,shift as fh,useDismiss as ph,useRole as gh,useInteractions as mh,FloatingPortal as bh,FloatingFocusManager as hh}from"@floating-ui/react";var l0=Qr,c0=La,u0=Ba,d0=Ha;import{jsx as xt,jsxs as Nn}from"react/jsx-runtime";function Vl({ref:e,value:t,defaultValue:r,onChange:n,format:o,displayFormat:i,separator:a=" - ",startLabel:s="Th\u1EDDi gian b\u1EAFt \u0111\u1EA7u",endLabel:l="Th\u1EDDi gian k\u1EBFt th\xFAc",use12Hours:h=!1,showSeconds:d=!0,hourStep:w=1,minuteStep:p=1,secondStep:m=1,minTime:x,maxTime:y,disabledHours:b,disabledMinutes:k,disabledSeconds:T,size:v="md",variant:u="outline",color:c="primary",radius:g,label:f,labelPlacement:S="top",placeholder:D,placeholders:R,helperText:P,errorMessage:I,name:E,id:N,autoComplete:M,disabled:z=!1,readOnly:H=!1,config:V,onClear:Y,placement:$="bottom-start",className:F="",wrapperClassName:G="",inputWrapperClassName:A="",labelClassName:U="",helperClassName:B="",popoverClassName:X=""}){let{isRequired:le=!1,isInvalid:ne=!1,isLoading:ue=!1,showSpinner:ie=!1,isClearable:Q=!0,isFullWidth:q=!1,closeOnSelect:ge=!1}=V??{},ke=ah(),L=N||ke,te=`${L}-error-helper`,Z=`${L}-popover`,he=en(h,d),ae=o||he,ve=i||ae,Se=t!==void 0,[ye,J]=f0(()=>{let be=r;return be&&Array.isArray(be)?[Vt(be[0]),Vt(be[1])]:[null,null]}),O=Se&&t&&Array.isArray(t)?[Vt(t[0]),Vt(t[1])]:ye,W=O[0]?It(O[0],ve):"",we=O[1]?It(O[1],ve):"",fe=sh(()=>W&&we?`${W}${a}${we}`:W?`${W}${a}`:"",[W,we,a]),[se,me]=f0(!1),{refs:{setReference:De,setFloating:xe},floatingStyles:re,context:de}=lh({placement:$,open:se&&!z&&!H&&!ue,onOpenChange:me,whileElementsMounted:ch,transform:!1,middleware:[uh(6),dh(),fh({padding:8})]}),ce=ph(de,{escapeKey:!0,outsidePress:!0}),ee=gh(de,{role:"dialog"}),{getReferenceProps:j,getFloatingProps:Ce}=mh([ce,ee]),{isMounted:Ee,styles:Fe}=et(de),oe=!!(ne||I),Te=oe?"error":c,Pe=C(v,l0,"md"),_e=C(g,c0,"lg"),Ue=C(g,u0,"lg"),Le=u==="other"?"":C(Te,C(u,d0,"outline"),"primary"),Be=!!(O[0]||O[1]),Ke=be=>{let Ve=[be,O[1]];Se||J(Ve);let rt=It(be,ae),Je=O[1]?It(O[1],ae):"";n?.([rt,Je])},K=be=>{let Ve=[O[0],be];Se||J(Ve);let rt=O[0]?It(O[0],ae):"",Je=It(be,ae);n?.([rt,Je]),ge&&me(!1)},_=be=>{z||H||ue||(be.key==="ArrowDown"||be.key==="Enter"||be.key===" "?(be.preventDefault(),se||me(!0)):be.key==="Escape"&&se&&(be.preventDefault(),me(!1)))},ze=be=>{be.stopPropagation(),Se||J([null,null]),n?.(null),Y?.()},pe=D||(R?`${R[0]}${a}${R[1]}`:`${ve}${a}${ve}`),Me=S==="floating",Xe=S==="left",He=()=>xt(at,{htmlFor:L,label:f,isRequired:le,isFloating:Me,size:v,color:Te,hasError:oe,cursor:"pointer",className:U}),Ze=be=>xt("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Pe.icon}`,"aria-hidden":"true",children:be}),qe=["group/field group/timerangepicker relative flex",Xe?"flex-row items-center gap-3":"flex-col",Me?"pt-2":"",q?"w-full":"inline-flex",G].filter(Boolean).join(" "),Re=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",Pe.inputHeight,_e,Le,z?"opacity-50":"",q?"w-full":"w-auto",A].filter(Boolean).join(" "),Ye=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",Pe.inputText,Pe.inputPadding,F].filter(Boolean).join(" ");return Nn("div",{className:qe,children:[!Me&&He(),Nn("div",{className:`flex flex-col ${q?"w-full":""}`,children:[Nn("div",{ref:De,...j(),className:Re,children:[Me&&He(),xt("input",{ref:e,id:L,name:E,type:"text",value:fe,onClick:()=>!z&&!H&&!ue&&me(be=>!be),onKeyDown:_,readOnly:!0,autoComplete:M,placeholder:pe,disabled:z||ue,role:"combobox","aria-expanded":se&&!ue,"aria-haspopup":"dialog","aria-controls":Z,"aria-required":le,"aria-invalid":oe,"aria-busy":ue,"aria-disabled":z||ue,"aria-describedby":P||I?te:void 0,"aria-errormessage":I?te:void 0,className:Ye}),Nn("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[ue&&ie&&xt("div",{className:"flex items-center justify-center shrink-0",children:Ze(xt(Ne,{}))}),!ue&&Q&&!z&&!H&&xt("button",{type:"button",onClick:ze,"aria-label":"X\xF3a kho\u1EA3ng th\u1EDDi gian",tabIndex:Be?0:-1,"aria-hidden":!Be,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${Pe.icon} ${Be?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:xt(Oe,{className:"size-full"})}),xt("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${se?"rotate-180":"rotate-0"}`,children:Ze(xt(lt,{className:"size-full"}))})]})]}),Ee&&xt(bh,{children:xt(hh,{context:de,modal:!1,returnFocus:!0,children:Nn("div",{ref:xe,id:Z,style:{...re,...Fe,zIndex:Qe.PICKER},...Ce(),className:`flex flex-row bg-neutral-white border-2 border-neutral-200 shadow-xl divide-x divide-neutral-200 overflow-hidden select-none ${Ue} ${X}`,children:[Nn("div",{className:"flex flex-col",children:[xt("div",{className:"px-3 py-1.5 bg-neutral-50 text-xs font-semibold text-neutral-600 border-b border-neutral-200 text-center",children:s}),xt(qt,{value:O[0],onChange:Ke,ariaLabel:s,use12Hours:h,showSeconds:d,hourStep:w,minuteStep:p,secondStep:m,minTime:x,maxTime:O[1]||y,disabledHours:b,disabledMinutes:k,disabledSeconds:T,size:v,color:c,radius:g,className:"border-none shadow-none"})]}),Nn("div",{className:"flex flex-col",children:[xt("div",{className:"px-3 py-1.5 bg-neutral-50 text-xs font-semibold text-neutral-600 border-b border-neutral-200 text-center",children:l}),xt(qt,{value:O[1],onChange:K,ariaLabel:l,use12Hours:h,showSeconds:d,hourStep:w,minuteStep:p,secondStep:m,minTime:O[0]||x,maxTime:y,disabledHours:b,disabledMinutes:k,disabledSeconds:T,size:v,color:c,radius:g,className:"border-none shadow-none"})]})]})})}),xt($e,{id:te,helperText:P,errorMessage:I,sizeClassName:Pe.helper,className:B})]})]})}function p0(e,t,r){if(!e||!t||!r)return!1;let n=e.getHours()*3600+e.getMinutes()*60+e.getSeconds(),o=t.getHours()*3600+t.getMinutes()*60+t.getSeconds(),i=r.getHours()*3600+r.getMinutes()*60+r.getSeconds();return n>=o&&n<=i}import{useState as Al,useId as xh}from"react";import{useFloating as vh,autoUpdate as yh,offset as wh,flip as Ch,shift as kh,useDismiss as Sh,useRole as Th,useInteractions as Dh,FloatingPortal as Rh,FloatingFocusManager as Nh}from"@floating-ui/react";function rn(e=!1,t=!0){return e?t?"DD/MM/YYYY hh:mm:ss A":"DD/MM/YYYY hh:mm A":t?"DD/MM/YYYY HH:mm:ss":"DD/MM/YYYY HH:mm"}function Zt(e,t){if(!e&&!t)return null;let r=e?new Date(e):new Date;return t&&(r.setHours(t.getHours()),r.setMinutes(t.getMinutes()),r.setSeconds(t.getSeconds()),r.setMilliseconds(t.getMilliseconds())),r}function Jt(e,t="DD/MM/YYYY HH:mm:ss"){if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:new Date(e.getTime());if(typeof e=="string"||typeof e=="number"){if(typeof e=="string"){let o=li(e,t);if(o)return o}let n=new Date(e);return isNaN(n.getTime())?null:n}let r=e;return typeof r.toDate=="function"?r.toDate():typeof r.epochMilliseconds=="number"?new Date(r.epochMilliseconds):null}function At(e,t="DD/MM/YYYY HH:mm:ss",r){return!e||isNaN(e.getTime())?"":Ht(e,t,r)}function li(e,t="DD/MM/YYYY HH:mm:ss"){if(!e||typeof e!="string")return null;let r=e.trim();if(!r)return null;let n=new Date().getFullYear(),o=1,i=1,a=0,s=0,l=0,h=!1,d=!1,w=t.match(/YYYY|YY|MM|M|DD|D|HH|H|hh|h|mm|m|ss|s|A|a/g);if(!w){let y=new Date(r);return isNaN(y.getTime())?null:y}let p="^"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");for(let y of w)y==="YYYY"?p=p.replace("YYYY","(\\d{4})"):y==="YY"?p=p.replace("YY","(\\d{2})"):y==="MM"||y==="M"||y==="DD"||y==="D"||y==="HH"||y==="H"||y==="hh"||y==="h"||y==="mm"||y==="m"||y==="ss"||y==="s"?p=p.replace(y,"(\\d{1,2})"):(y==="A"||y==="a")&&(p=p.replace(y,"(AM|PM|am|pm)"));p+="$";let m=new RegExp(p,"i").exec(r);if(!m){let y=new Date(r);return isNaN(y.getTime())?null:y}w.forEach((y,b)=>{let k=m[b+1];if(!k)return;if(y==="A"||y==="a"){h=!0,k.toUpperCase()==="PM"&&(d=!0);return}let T=parseInt(k,10);isNaN(T)||(y==="YYYY"?n=T:y==="YY"?n=2e3+T:y==="MM"||y==="M"?o=T:y==="DD"||y==="D"?i=T:y==="HH"||y==="H"?a=T:y==="hh"||y==="h"?(h=!0,a=T):y==="mm"||y==="m"?s=T:(y==="ss"||y==="s")&&(l=T))}),h&&(d?a<12&&(a+=12):a===12&&(a=0));let x=new Date(n,o-1,i,a,s,l);return isNaN(x.getTime())?null:x}var g0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},m0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},b0={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,calendarPadding:"p-4",cellSize:"w-12 h-12",cellText:"text-lg",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-sm",helper:"text-sm mt-1.5"}};var h0={outline:{primary:"bg-neutral-white border-2 border-neutral-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-2 border-neutral-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-2 border-error-500 hover:border-error-600 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-2 border-neutral-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-2 border-neutral-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-2 border-neutral-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-2 border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-2 border-transparent hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-2 border-transparent hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-error-50/60 border-2 border-transparent hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-2 border-transparent hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-2 border-transparent hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-2 border-transparent hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-50/60 border-2 border-transparent hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},ghost:{primary:"bg-transparent border-2 border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-2 border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-transparent border-2 border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-2 border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-2 border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-2 border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-transparent border-2 border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20"}};import{jsx as vt,jsxs as ci}from"react/jsx-runtime";function Ol({ref:e,value:t,defaultValue:r,onChange:n,format:o,displayFormat:i,layout:a="side-by-side",locale:s="vi",defaultView:l="days",firstDayOfWeek:h=1,minDate:d,maxDate:w,isDateDisabled:p,viewTabs:m,use12Hours:x=!1,showSeconds:y=!0,hourStep:b=1,minuteStep:k=1,secondStep:T=1,minTime:v,maxTime:u,disabledHours:c,disabledMinutes:g,disabledSeconds:f,size:S="md",variant:D="outline",color:R="primary",radius:P,label:I,labelPlacement:E="top",placeholder:N,helperText:M,errorMessage:z,name:H,id:V,autoComplete:Y,disabled:$=!1,readOnly:F=!1,config:G,onClear:A,placement:U="bottom-start",className:B="",wrapperClassName:X="",inputWrapperClassName:le="",labelClassName:ne="",helperClassName:ue="",popoverClassName:ie=""}){let{isRequired:Q=!1,isInvalid:q=!1,isLoading:ge=!1,showSpinner:ke=!1,isClearable:L=!0,isFullWidth:te=!1,closeOnSelect:Z=!1,showWeekNumbers:he=!1,showViewTabs:ae=!1}=G??{},ve=xh(),Se=V||ve,ye=`${Se}-error-helper`,J=`${Se}-popover`,O=rn(x,y),W=o||O,we=i||W,fe=t!==void 0,[se,me]=Al(()=>Jt(r,W)),De=fe?Jt(t,W):se,xe=De?At(De,we,s):"",[re,de]=Al(l),[ce,ee]=Al(!1),{refs:{setReference:j,setFloating:Ce},floatingStyles:Ee,context:Fe}=vh({placement:U,open:ce&&!$&&!F&&!ge,onOpenChange:ee,whileElementsMounted:yh,transform:!1,middleware:[wh(6),Ch(),kh({padding:8})]}),oe=Sh(Fe,{escapeKey:!0,outsidePress:!0}),Te=Th(Fe,{role:"dialog"}),{getReferenceProps:Pe,getFloatingProps:_e}=Dh([oe,Te]),{isMounted:Ue,styles:Le}=et(Fe),Be=!!(q||z),Ke=Be?"error":R,K=C(S,b0,"md"),_=C(P,g0,"lg"),ze=C(P,m0,"lg"),pe=D==="other"?"":C(Ke,C(D,h0,"outline"),"primary"),Me=!!De,Xe=ot=>{let Dt=Zt(ot,De||new Date);fe||me(Dt);let cn=Dt?At(Dt,W,s):"";n?.(cn),Z&&ee(!1)},He=ot=>{if(!ot)return;let Dt=Zt(De||new Date,ot);fe||me(Dt);let cn=Dt?At(Dt,W,s):"";n?.(cn),Z&&ee(!1)},Ze=ot=>{$||F||ge||(ot.key==="ArrowDown"||ot.key==="Enter"||ot.key===" "?(ot.preventDefault(),ce||ee(!0)):ot.key==="Escape"&&ce&&(ot.preventDefault(),ee(!1)))},qe=ot=>{ot.stopPropagation(),fe||me(null),n?.(null),A?.()},Re=N||we,Ye=E==="floating",be=E==="left",Ve=()=>vt(at,{htmlFor:Se,label:I,isRequired:Q,isFloating:Ye,size:S,color:Ke,hasError:Be,cursor:"pointer",className:ne}),rt=ot=>vt("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${K.icon}`,"aria-hidden":"true",children:ot}),Je=["group/field group/datetimepicker relative flex",be?"flex-row items-center gap-3":"flex-col",Ye?"pt-2":"",te?"w-full":"inline-flex",X].filter(Boolean).join(" "),Tt=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",K.inputHeight,_,pe,$?"opacity-50":"",te?"w-full":"w-auto",le].filter(Boolean).join(" "),Ft=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",K.inputText,K.inputPadding,B].filter(Boolean).join(" ");return ci("div",{className:Je,children:[!Ye&&Ve(),ci("div",{className:`flex flex-col ${te?"w-full":""}`,children:[ci("div",{ref:j,...Pe(),className:Tt,children:[Ye&&Ve(),vt("input",{ref:e,id:Se,name:H,type:"text",value:xe,onClick:()=>!$&&!F&&!ge&&ee(ot=>!ot),onKeyDown:Ze,readOnly:!0,autoComplete:Y,placeholder:Re,disabled:$||ge,role:"combobox","aria-expanded":ce&&!ge,"aria-haspopup":"dialog","aria-controls":J,"aria-required":Q,"aria-invalid":Be,"aria-busy":ge,"aria-disabled":$||ge,"aria-describedby":M||z?ye:void 0,"aria-errormessage":z?ye:void 0,className:Ft}),ci("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[ge&&ke&&vt("div",{className:"flex items-center justify-center shrink-0",children:rt(vt(Ne,{}))}),!ge&&L&&!$&&!F&&vt("button",{type:"button",onClick:qe,"aria-label":"X\xF3a ng\xE0y gi\u1EDD",tabIndex:Me?0:-1,"aria-hidden":!Me,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${K.icon} ${Me?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:vt(Oe,{className:"size-full"})}),vt("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${ce?"rotate-180":"rotate-0"}`,children:rt(vt(lt,{className:"size-full"}))})]})]}),Ue&&vt(Rh,{children:vt(Nh,{context:Fe,modal:!1,returnFocus:!0,children:ci("div",{ref:Ce,id:J,style:{...Ee,...Le,zIndex:Qe.PICKER},..._e(),className:`flex bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${ze} ${a==="stacked"?"flex-col divide-y-2 divide-neutral-200":"flex-row divide-x-2 divide-neutral-200"} ${ie}`,children:[vt("div",{className:"flex flex-col",children:vt(xr,{value:De,onChange:Xe,view:re,onViewChange:de,minDate:d,maxDate:w,isDateDisabled:p,locale:s,firstDayOfWeek:h,showWeekNumbers:he,size:S,color:R,radius:P,showViewTabs:ae,viewTabs:m,className:"border-none shadow-none rounded-none"})}),vt("div",{className:"flex flex-col justify-center items-center p-1 bg-neutral-50/50",children:vt(qt,{value:De,onChange:He,ariaLabel:typeof I=="string"?`${I} time`:"Time selector",use12Hours:x,showSeconds:y,hourStep:b,minuteStep:k,secondStep:T,minTime:v,maxTime:u,disabledHours:c,disabledMinutes:g,disabledSeconds:f,size:S,color:R,radius:P,className:"border-none shadow-none bg-transparent"})})]})})}),vt($e,{id:ye,helperText:M,errorMessage:z,sizeClassName:K.helper,className:ue})]})]})}import{useState as Aa,useId as Ph,useMemo as zh}from"react";import{useFloating as Ih,autoUpdate as Mh,offset as Fh,flip as Eh,shift as $h,useDismiss as Lh,useRole as Bh,useInteractions as Hh,FloatingPortal as Vh,FloatingFocusManager as Ah}from"@floating-ui/react";var x0={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",minWidth:"min-w-72",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",minWidth:"min-w-80",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",minWidth:"min-w-96",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",minWidth:"min-w-105",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",minWidth:"min-w-120",icon:"size-6",iconSize:20,calendarPadding:"p-4",cellSize:"w-12 h-12",cellText:"text-lg",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-sm",helper:"text-sm mt-1.5"}};var v0={primary:{activeStep:"bg-primary-500 border-primary-500 text-neutral-white shadow-xs",applyButton:"bg-primary-500 hover:bg-primary-600 active:bg-primary-700 text-neutral-white shadow-xs"},secondary:{activeStep:"bg-secondary-500 border-secondary-500 text-neutral-white shadow-xs",applyButton:"bg-secondary-500 hover:bg-secondary-600 active:bg-secondary-700 text-neutral-white shadow-xs"},error:{activeStep:"bg-error-500 border-error-500 text-neutral-white shadow-xs",applyButton:"bg-error-500 hover:bg-error-600 active:bg-error-700 text-neutral-white shadow-xs"},success:{activeStep:"bg-success-500 border-success-500 text-neutral-white shadow-xs",applyButton:"bg-success-500 hover:bg-success-600 active:bg-success-700 text-neutral-white shadow-xs"},warning:{activeStep:"bg-warning-500 border-warning-500 text-neutral-950 shadow-xs",applyButton:"bg-warning-500 hover:bg-warning-600 active:bg-warning-700 text-neutral-950 shadow-xs"},info:{activeStep:"bg-info-500 border-info-500 text-neutral-white shadow-xs",applyButton:"bg-info-500 hover:bg-info-600 active:bg-info-700 text-neutral-white shadow-xs"},neutral:{activeStep:"bg-neutral-800 border-neutral-800 text-neutral-white shadow-xs",applyButton:"bg-neutral-800 hover:bg-neutral-900 active:bg-neutral-950 text-neutral-white shadow-xs"}};import{jsx as gt,jsxs as yr}from"react/jsx-runtime";function Gl({ref:e,value:t,defaultValue:r,onChange:n,format:o,displayFormat:i,separator:a=" - ",startLabel:s="Th\u1EDDi gian b\u1EAFt \u0111\u1EA7u",endLabel:l="Th\u1EDDi gian k\u1EBFt th\xFAc",layout:h="side-by-side",locale:d="vi",defaultView:w="days",firstDayOfWeek:p=1,minDate:m,maxDate:x,isDateDisabled:y,viewTabs:b,use12Hours:k=!1,showSeconds:T=!0,hourStep:v=1,minuteStep:u=1,secondStep:c=1,minTime:g,maxTime:f,disabledHours:S,disabledMinutes:D,disabledSeconds:R,size:P="md",variant:I="outline",color:E="primary",radius:N,label:M,labelPlacement:z="top",placeholder:H,placeholders:V,helperText:Y,errorMessage:$,name:F,id:G,autoComplete:A,disabled:U=!1,readOnly:B=!1,config:X,onClear:le,placement:ne="bottom-start",className:ue="",wrapperClassName:ie="",inputWrapperClassName:Q="",labelClassName:q="",helperClassName:ge="",popoverClassName:ke=""}){let{isRequired:L=!1,isInvalid:te=!1,isLoading:Z=!1,showSpinner:he=!1,isClearable:ae=!0,isFullWidth:ve=!1,closeOnSelect:Se=!1,showWeekNumbers:ye=!1,showViewTabs:J=!1}=X??{},O=Ph(),W=G||O,we=`${W}-error-helper`,fe=`${W}-popover`,se=rn(k,T),me=o||se,De=i||me,xe=t!==void 0,[re,de]=Aa(()=>{let je=r;return je&&Array.isArray(je)?[Jt(je[0],me),Jt(je[1],me)]:[null,null]}),ce=xe?t&&Array.isArray(t)?[Jt(t[0],me),Jt(t[1],me)]:[null,null]:re,[ee,j]=Aa("start"),[Ce,Ee]=Aa(w),[Fe,oe]=Aa(!1),Te=ce[0]?At(ce[0],De,d):"",Pe=ce[1]?At(ce[1],De,d):"",_e=zh(()=>Te&&Pe?`${Te}${a}${Pe}`:Te?`${Te}${a}`:"",[Te,Pe,a]),{refs:{setReference:Ue,setFloating:Le},floatingStyles:Be,context:Ke}=Ih({placement:ne,open:Fe&&!U&&!B&&!Z,onOpenChange:oe,whileElementsMounted:Mh,transform:!1,middleware:[Fh(6),Eh(),$h({padding:8})]}),K=Lh(Ke,{escapeKey:!0,outsidePress:!0}),_=Bh(Ke,{role:"dialog"}),{getReferenceProps:ze,getFloatingProps:pe}=Hh([K,_]),{isMounted:Me,styles:Xe}=et(Ke),He=!!(te||$),Ze=He?"error":E,qe=C(P,x0,"md"),Re=C(N,vr,"lg"),Ye=C(N,Pa,"lg"),be=C(Ze,v0,"primary"),Ve=I==="other"?"":C(Ze,C(I,za,"outline"),"primary"),rt=!!(ce[0]||ce[1]),Je=je=>{xe||de(je);let Rt=je[0]?At(je[0],me,d):"",Gt=je[1]?At(je[1],me,d):"";n?.(Rt||Gt?[Rt,Gt]:null),Se&&je[0]&&je[1]&&oe(!1)},Tt=je=>{if(ee==="start"){let Rt=Zt(je,ce[0]||new Date),Gt=ce[1];Gt&&Rt&&Rt.getTime()>Gt.getTime()&&(Gt=null),Je([Rt,Gt])}else{let Rt=Zt(je,ce[1]||ce[0]||new Date);Je([ce[0],Rt])}},Ft=je=>{if(je)if(ee==="start"){let Rt=Zt(ce[0]||new Date,je),Gt=ce[1];Gt&&Rt&&Rt.getTime()>Gt.getTime()&&(Gt=null),Je([Rt,Gt])}else{let Rt=Zt(ce[1]||ce[0]||new Date,je);Je([ce[0],Rt])}},ot=je=>{U||B||Z||(je.key==="ArrowDown"||je.key==="Enter"||je.key===" "?(je.preventDefault(),Fe||oe(!0)):je.key==="Escape"&&Fe&&(je.preventDefault(),oe(!1)))},Dt=je=>{je.stopPropagation(),xe||de([null,null]),n?.(null),le?.()},cn=H||(V?`${V[0]}${a}${V[1]}`:`${De}${a}${De}`),Ie=z==="floating",Ae=z==="left",ut=()=>gt(at,{htmlFor:W,label:M,isRequired:L,isFloating:Ie,size:P,color:Ze,hasError:He,cursor:"pointer",className:q}),pt=je=>gt("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${qe.icon}`,"aria-hidden":"true",children:je}),Tr=["group/field group/datetimerangepicker relative flex",Ae?"flex-row items-center gap-3":"flex-col",Ie?"pt-2":"",ve?"w-full":"inline-flex",ie].filter(Boolean).join(" "),Et=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",qe.inputHeight,Re,Ve,U?"opacity-50":"",ve?"w-full":qe.minWidth||"min-w-80",Q].filter(Boolean).join(" "),Gn=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",qe.inputText,qe.inputPadding,ue].filter(Boolean).join(" "),Ic=ee==="start"?ce[0]:ce[1];return yr("div",{className:Tr,children:[!Ie&&ut(),yr("div",{className:`flex flex-col ${ve?"w-full":""}`,children:[yr("div",{ref:Ue,...ze(),className:Et,children:[Ie&&ut(),gt("input",{ref:e,id:W,name:F,type:"text",value:_e,onClick:()=>!U&&!B&&!Z&&oe(je=>!je),onKeyDown:ot,readOnly:!0,autoComplete:A,placeholder:cn,disabled:U||Z,role:"combobox","aria-expanded":Fe&&!Z,"aria-haspopup":"dialog","aria-controls":fe,"aria-required":L,"aria-invalid":He,"aria-busy":Z,"aria-disabled":U||Z,"aria-describedby":Y||$?we:void 0,"aria-errormessage":$?we:void 0,className:Gn}),yr("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[Z&&he&&gt("div",{className:"flex items-center justify-center shrink-0",children:pt(gt(Ne,{}))}),!Z&&ae&&!U&&!B&&gt("button",{type:"button",onClick:Dt,"aria-label":"X\xF3a kho\u1EA3ng ng\xE0y gi\u1EDD",tabIndex:rt?0:-1,"aria-hidden":!rt,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${qe.icon} ${rt?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:gt(Oe,{className:"size-full"})}),gt("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${Fe?"rotate-180":"rotate-0"}`,children:pt(gt(lt,{className:"size-full"}))})]})]}),Me&&gt(Vh,{children:gt(Ah,{context:Ke,modal:!1,returnFocus:!0,children:yr("div",{ref:Le,id:fe,style:{...Be,...Xe,zIndex:Qe.PICKER},...pe(),className:`flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${Ye} ${ke}`,children:[yr("div",{className:`flex ${h==="stacked"?"flex-col divide-y-2 divide-neutral-200":"flex-row divide-x-2 divide-neutral-200"}`,children:[gt("div",{className:"flex flex-col",children:gt(xr,{value:Ic,onChange:Tt,view:Ce,onViewChange:Ee,minDate:ee==="end"&&ce[0]||m,maxDate:ee==="start"&&ce[1]||x,isDateDisabled:y,locale:d,firstDayOfWeek:p,showWeekNumbers:ye,size:P,color:E,radius:N,showViewTabs:J,viewTabs:b,className:"border-none shadow-none rounded-none"},`calendar-step-${ee}`)}),gt("div",{className:"flex flex-col justify-center items-center p-1 bg-neutral-50/50",children:gt(qt,{value:Ic||ce[0],onChange:Ft,ariaLabel:ee==="start"?`${s} time`:`${l} time`,use12Hours:k,showSeconds:T,hourStep:v,minuteStep:u,secondStep:c,minTime:ee==="end"&&ce[0]||g,maxTime:ee==="start"&&ce[1]||f,disabledHours:S,disabledMinutes:D,disabledSeconds:R,size:P,color:E,radius:N,className:"border-none shadow-none bg-transparent"},`timeview-step-${ee}`)})]}),yr("div",{className:"flex items-center justify-between border-t border-neutral-200 bg-neutral-50 px-3 py-2",children:[yr("div",{className:"flex items-center space-x-2",children:[yr("button",{type:"button",onClick:()=>j("start"),className:`px-3 py-1.5 text-xs font-semibold rounded-md border transition-all cursor-pointer ${ee==="start"?be.activeStep:"bg-neutral-white border-neutral-300 hover:bg-neutral-100 text-neutral-700"}`,children:["\u2190 ",s]}),yr("button",{type:"button",onClick:()=>j("end"),className:`px-3 py-1.5 text-xs font-semibold rounded-md border transition-all cursor-pointer ${ee==="end"?be.activeStep:"bg-neutral-white border-neutral-300 hover:bg-neutral-100 text-neutral-700"}`,children:[l," \u2192"]})]}),gt("button",{type:"button",onClick:()=>oe(!1),className:`px-3.5 py-1.5 text-xs font-semibold rounded-md transition-colors cursor-pointer ${be.applyButton}`,children:"\xC1p d\u1EE5ng"})]})]})})}),gt($e,{id:we,helperText:Y,errorMessage:$,sizeClassName:qe.helper,className:ge})]})]})}import{isValidElement as Oh}from"react";import Gh from"next/image";var y0={sm:{container:"p-3",imageWrapper:"w-16 h-16",defaultImageSize:64,title:"text-xs font-semibold text-neutral-800",description:"text-xs text-neutral-500",gap:"gap-2.5",contentGap:"gap-1",actionsGap:"mt-2"},md:{container:"p-6",imageWrapper:"w-28 h-28",defaultImageSize:112,title:"text-sm font-semibold text-neutral-800",description:"text-xs sm:text-sm text-neutral-500",gap:"gap-4",contentGap:"gap-1.5",actionsGap:"mt-3.5"},lg:{container:"p-10",imageWrapper:"w-40 h-40",defaultImageSize:160,title:"text-base font-semibold text-neutral-900",description:"text-sm text-neutral-500",gap:"gap-6",contentGap:"gap-2",actionsGap:"mt-5"}},w0={vertical:{container:"flex flex-col items-center justify-center text-center",content:"flex flex-col items-center justify-center text-center"},horizontal:{container:"flex flex-row items-center justify-start text-left",content:"flex flex-col items-start justify-center text-left flex-1"}};import{jsx as ui}from"react/jsx-runtime";function po({preset:e="default",...t}){switch(e){case"search":return ui(Gs,{...t});case"error":return ui(Us,{...t});case"folder":return ui(js,{...t});case"simple":return ui(Ys,{...t});default:return ui(Os,{...t})}}var C0=["default","search","error","folder","simple"];function Ul(e){return typeof e=="string"&&C0.includes(e)}function jl(e){return typeof e!="string"?!1:e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")||e.startsWith("./")||e.startsWith("data:")||/\.(png|jpe?g|svg|webp|gif|avif)$/i.test(e)}function Yl(e){if(!e)return{};let t=typeof e=="number"?`${e}px`:e;return{width:t,height:t}}import{jsx as nn,jsxs as k0}from"react/jsx-runtime";function Pn({size:e="md",layout:t="vertical",image:r="default",imageSize:n,imageClassName:o="",imageAlt:i="Tr\u1ED1ng",title:a,titleClassName:s="",description:l="Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u",descriptionClassName:h="",actions:d,actionsClassName:w="",children:p,className:m="",role:x="status",ref:y,...b}){let k=C(e,y0,"md"),T=C(t,w0,"vertical"),v=Yl(n),u=()=>{if(!r)return null;if(Ul(r))return nn(po,{preset:r});if(jl(r)){let P=typeof n=="number"?n:k.defaultImageSize;return nn(Gh,{src:r,alt:i,width:P,height:P,className:"size-full object-contain pointer-events-none select-none",unoptimized:r.startsWith("data:")||r.endsWith(".svg")})}return Oh(r)?r:nn(po,{preset:"default"})},c=["flex items-center justify-center shrink-0",n?"":k.imageWrapper,o].filter(Boolean).join(" "),g=["w-full transition-all",T.container,k.container,k.gap,m].filter(Boolean).join(" "),f=[T.content,k.contentGap].filter(Boolean).join(" "),S=[k.title,s].filter(Boolean).join(" "),D=[k.description,h].filter(Boolean).join(" "),R=["flex flex-wrap items-center gap-2",k.actionsGap,t==="vertical"?"justify-center":"justify-start",w].filter(Boolean).join(" ");return k0("div",{ref:y,role:x,"aria-live":"polite",className:g,...b,children:[r&&nn("div",{className:c,style:v,"aria-hidden":"true",children:u()}),(a||l||d||p)&&k0("div",{className:f,children:[a&&nn("div",{className:S,children:a}),l&&nn("div",{className:D,children:l}),d&&nn("div",{className:R,children:d}),p&&nn("div",{className:"mt-2 w-full",children:p})]})]})}import{useState as Ya,useMemo as bx,useCallback as H0,useId as hx}from"react";import{useRef as jh}from"react";var go={xs:{trigger:"min-h-6 text-[11px] px-2 py-0.5",input:"text-[11px] leading-tight",text:"text-[11px]",icon:"size-3",option:"px-2 py-1 text-[11px] min-h-6",gap:"gap-1",badgeSize:"xs",defaultRadius:"sm"},sm:{trigger:"min-h-8 text-xs px-2.5 py-1",input:"text-xs leading-normal",text:"text-xs",icon:"size-3.5",option:"px-2.5 py-1.5 text-xs min-h-7",gap:"gap-1",badgeSize:"xs",defaultRadius:"md"},md:{trigger:"min-h-10 text-sm px-3.5 py-1.5",input:"text-sm leading-normal",text:"text-sm",icon:"size-[18px]",option:"px-3 py-2 text-sm min-h-9",gap:"gap-1.5",badgeSize:"sm",defaultRadius:"lg"},lg:{trigger:"min-h-12 text-base px-4 py-2",input:"text-base leading-normal",text:"text-base",icon:"size-5",option:"px-3.5 py-2.5 text-base min-h-11",gap:"gap-2",badgeSize:"md",defaultRadius:"xl"},xl:{trigger:"min-h-14 text-lg px-5 py-2.5",input:"text-lg leading-normal",text:"text-lg",icon:"size-6",option:"px-4 py-3 text-lg min-h-12",gap:"gap-2",badgeSize:"lg",defaultRadius:"xl"}},mo={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},di={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},S0={none:"none",sm:"sm",md:"md",lg:"lg",xl:"xl",full:"full"},bo={outline:{primary:"bg-neutral-white border-primary-400 hover:border-primary-500 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20 text-neutral-900",secondary:"bg-neutral-white border-secondary-400 hover:border-secondary-500 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20 text-neutral-900",error:"bg-neutral-white border-error-500 hover:border-error-600 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20 text-neutral-900",success:"bg-neutral-white border-success-400 hover:border-success-500 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20 text-neutral-900",warning:"bg-neutral-white border-warning-400 hover:border-warning-500 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20 text-neutral-900",info:"bg-neutral-white border-info-400 hover:border-info-500 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20 text-neutral-900",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20 text-neutral-900"},filled:{primary:"bg-primary-50/60 border border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20 text-neutral-900",secondary:"bg-secondary-50/60 border border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20 text-neutral-900",error:"bg-error-50/60 border border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20 text-neutral-900",success:"bg-success-50/60 border border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20 text-neutral-900",warning:"bg-warning-50/60 border border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20 text-neutral-900",info:"bg-info-50/60 border border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20 text-neutral-900",neutral:"bg-neutral-50/60 border border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20 text-neutral-900"},ghost:{primary:"bg-transparent border border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20 text-neutral-900",secondary:"bg-transparent border border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20 text-neutral-900",error:"bg-transparent border border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20 text-neutral-900",success:"bg-transparent border border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20 text-neutral-900",warning:"bg-transparent border border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20 text-neutral-900",info:"bg-transparent border border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20 text-neutral-900",neutral:"bg-transparent border border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20 text-neutral-900"}},T0={primary:"bg-primary-50 text-primary-700 font-medium",secondary:"bg-secondary-50 text-secondary-700 font-medium",error:"bg-error-50 text-error-700 font-medium",success:"bg-success-50 text-success-700 font-medium",warning:"bg-warning-50 text-warning-700 font-medium",info:"bg-info-50 text-info-700 font-medium",neutral:"bg-neutral-100 text-neutral-900 font-medium"},D0={primary:"bg-primary-50/60",secondary:"bg-secondary-50/60",error:"bg-error-50/60",success:"bg-success-50/60",warning:"bg-warning-50/60",info:"bg-info-50/60",neutral:"bg-neutral-100"};import{jsx as ho,jsxs as R0}from"react/jsx-runtime";function Uh({id:e,isOpen:t,disabled:r=!1,isLoading:n=!1,showClear:o=!1,onClear:i,startContent:a,endContent:s,triggerRef:l,getReferenceProps:h,onClick:d,roundedClass:w,currentSize:p,variantStyle:m,className:x="",children:y}){let b=r?"opacity-60 cursor-not-allowed bg-neutral-100 pointer-events-none":"cursor-pointer";return R0("div",{ref:l,role:"combobox","aria-expanded":t,"aria-haspopup":"listbox","aria-controls":e?`${e}-listbox`:void 0,tabIndex:r?-1:0,onClick:d,"aria-busy":n,"aria-disabled":r||n,...h({id:e,className:`group relative flex items-center justify-between transition-all duration-150 ease-in-out border-2 select-none ${w} ${p.trigger} ${p.gap} ${m} ${b} ${x}`,"aria-expanded":t,"aria-haspopup":"listbox"}),children:[a&&ho("span",{className:"shrink-0 inline-flex items-center text-neutral-400",children:a}),y,R0("div",{className:"shrink-0 flex items-center gap-1.5 ml-1 text-neutral-400",children:[n&&ho(Ne,{className:`${p.icon} animate-spin text-current`}),o&&!n&&ho("button",{type:"button","aria-label":"Clear selection",onClick:k=>{k.stopPropagation(),i?.(k)},className:"hover:text-neutral-600 transition-colors p-0.5 rounded-full hover:bg-neutral-100",children:ho(Oe,{className:"size-3.5"})}),s,ho("span",{className:`transition-transform duration-200 ${t?"rotate-180":""}`,"aria-hidden":"true",children:ho(lt,{className:p.icon})})]})]})}var Oa=Uh;import{jsx as zn}from"react/jsx-runtime";function Yh({id:e,selectedOption:t,isOpen:r,size:n="md",variant:o="outline",color:i="primary",radius:a="md",placeholder:s="Ch\u1ECDn...",disabled:l=!1,readOnly:h=!1,isInvalid:d=!1,searchable:w=!1,searchPlacement:p="trigger",searchValue:m="",onSearchChange:x,onClear:y,clearable:b=!1,isLoading:k=!1,startContent:T,endContent:v,renderValue:u,triggerRef:c,getReferenceProps:g,onKeyDown:f,className:S=""}){let D=jh(null),R=C(n,go,"md"),P=C(a,mo,"md"),E=!!d?"error":i,N=o==="other"?"":bo[o]?.[E]||bo.outline.primary,M=w&&(p==="trigger"||p==="both"),z=t!=null,H=b&&(z||m.length>0)&&!l&&!h;return zn(Oa,{id:e,isOpen:r,disabled:l,isLoading:k,showClear:H,onClear:y,startContent:T,endContent:v,triggerRef:c,getReferenceProps:g,onClick:()=>{!l&&!h&&!k&&M&&D.current?.focus()},roundedClass:P,currentSize:R,variantStyle:N,className:S,children:u&&z&&t?zn("div",{className:"flex-1 min-w-0 truncate text-neutral-900",children:u(t)}):M&&!l&&!h&&!k?zn("div",{className:"relative flex-1 min-w-0 flex items-center",children:zn("input",{ref:D,type:"text","aria-label":"Search",value:m,placeholder:t?t.label:s,onChange:$=>x?.($.target.value),onKeyDown:f,className:`w-full bg-transparent outline-none border-none p-0 text-neutral-900 ${!m&&t?"placeholder:text-neutral-900 placeholder:font-normal":"placeholder:text-neutral-400"} ${R.input}`})}):zn("div",{className:"flex-1 min-w-0 truncate",children:t?zn("span",{className:"text-neutral-900",children:t.label}):zn("span",{className:"text-neutral-400",children:s})})})}var xo=Yh;import{FloatingPortal as Qh}from"@floating-ui/react";import{jsx as vo,jsxs as Wl}from"react/jsx-runtime";function Wh({option:e,isSelected:t,isActive:r,size:n="md",color:o="primary",radius:i="md",disabled:a=!1,renderOption:s,onClick:l,onMouseEnter:h,ref:d}){let w=C(n,go,"md"),p=C(i,mo,"md"),m=a||e.disabled;if(s)return vo("div",{ref:d,role:"option",tabIndex:-1,"aria-selected":t,"aria-disabled":m,"data-active":r,"data-selected":t,"data-value":e.value,className:`cursor-pointer select-none transition-colors duration-100 ${m?"opacity-50 cursor-not-allowed pointer-events-none":""}`,onClick:m?void 0:l,onMouseEnter:m?void 0:h,children:s(e,{selected:t,active:r})});let x=t?C(o,T0,"primary"):"text-neutral-800 hover:bg-neutral-100",y=r&&!t?C(o,D0,"primary"):"";return Wl("div",{ref:d,role:"option",tabIndex:-1,"aria-selected":t,"aria-disabled":m,"data-active":r,"data-selected":t,"data-value":e.value,className:`group flex items-center justify-between gap-2 select-none cursor-pointer transition-colors duration-100 ${p} ${w.option} ${x} ${y} ${m?"opacity-40 cursor-not-allowed pointer-events-none":""}`,onClick:m?void 0:l,onMouseEnter:m?void 0:h,children:[Wl("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.icon&&vo("span",{className:"shrink-0 inline-flex items-center text-neutral-400",children:e.icon}),Wl("div",{className:"flex flex-col min-w-0 flex-1",children:[vo("span",{className:"truncate leading-normal font-normal",children:e.label}),e.description&&vo("span",{className:"text-[11px] text-neutral-500 truncate font-normal",children:e.description})]})]}),t&&vo("span",{className:"shrink-0 flex items-center justify-center text-current","aria-hidden":"true",children:vo(Ar,{className:"size-3.5"})})]})}var Ga=Wh;import{useState as ql,useRef as Kh,useEffect as _h,useMemo as Xh}from"react";import{useFloating as N0,autoUpdate as P0,offset as z0,flip as I0,shift as M0,useClick as F0,useDismiss as E0,useInteractions as $0,FloatingPortal as L0}from"@floating-ui/react";function fi(e){let t=new Map;return e.forEach(r=>{t.set(r.value,r)}),t}function Kl(e,t,r){return e==null?null:t.find(n=>n.value===e)||r?.get(e)||{value:e,label:String(e)}}function Ua(e,t,r){return e.map(n=>t.find(o=>o.value===n)||r?.get(n)||{value:n,label:String(n)})}function _l(e,t){let r=t&&t>0?e.slice(0,t):e,n=t&&t>0?Math.max(0,e.length-t):0;return{visibleTags:r,hiddenTagCount:n}}function Xl(e,t){if(t==null||t==="")return"Ch\u01B0a nh\u1EADp";if(t instanceof Date)return t.toLocaleDateString("vi-VN");if(Array.isArray(t)){if(t.length===0)return"Ch\u01B0a ch\u1ECDn";if(e.type==="date-range"||t[0]instanceof Date||t[1]instanceof Date){let o=s=>s?s instanceof Date?s.toLocaleDateString("vi-VN"):String(s):"",i=o(t[0]),a=o(t[1]);return i&&a?`${i} - ${a}`:i||a||"Ch\u01B0a ch\u1ECDn"}let r=o=>{if(e.options&&e.options.length>0){let i=e.options.find(a=>String(a.value)===String(o));if(i)return String(i.label)}return String(o)};return t.length===1?r(t[0]):`${r(t[0])}, +${t.length-1}`}return String(t)}import{Fragment as Jh,jsx as tt,jsxs as Qt}from"react/jsx-runtime";function qh({field:e,currentValue:t,isOpen:r,onOpenChange:n,onRemove:o,onChange:i,color:a,radius:s}){let{refs:{setFloating:l,setReference:h},floatingStyles:d,context:w}=N0({open:r,onOpenChange:n,placement:"bottom-start",transform:!1,middleware:[z0(6),I0(),M0({padding:8})],whileElementsMounted:P0}),{isMounted:p,styles:m}=et(w),x=C(s,di,"md"),y=F0(w),b=E0(w,{outsidePress:f=>!f.target?.closest?.("[data-select-filter-popover]")}),{getReferenceProps:k,getFloatingProps:T}=$0([y,b]),v=Kh(null);_h(()=>{r&&v.current?.focus({preventScroll:!0})},[r]);let u=t!=null&&t!==""&&(!Array.isArray(t)||t.length>0),c=Xl(e,t),g=()=>{if(e.type==="custom")return e.render?.({value:t,onChange:f=>i(e.name,f)})??null;switch(e.type){case"string":case"text":return tt(Ct,{ref:v,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Nh\u1EADp t\u1EEB kh\xF3a...",value:t||"",onChange:f=>i(e.name,f.target.value),...e.props||{}});case"number":return tt(dn,{ref:v,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Nh\u1EADp s\u1ED1...",value:t??"",onChange:f=>{let S=f.target.value;if(S==="")i(e.name,"");else{let D=Hr(S);i(e.name,D!==void 0?D:S)}},onClear:()=>i(e.name,""),...e.props||{}});case"date":return tt(Sn,{portal:!1,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Ch\u1ECDn ng\xE0y",value:t,onChange:f=>i(e.name,f),...e.props||{}});case"date-range":return tt(Tn,{portal:!1,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Ch\u1ECDn kho\u1EA3ng ng\xE0y",value:t||[null,null],onChange:f=>i(e.name,f),...e.props||{}});case"checkbox-group":return tt(bn,{size:"sm",color:a,value:t||[],onChange:f=>i(e.name,f),options:(e.options||[]).map(f=>({value:String(f.value),label:f.label,disabled:f.disabled})),className:"max-h-48 overflow-y-auto py-1 gap-2",...e.props||{}});default:return null}};return Qt(Jh,{children:[tt("div",{ref:h,...k({className:"inline-flex items-center"}),children:Qt($t,{size:"sm",variant:"soft",color:u||r?a:"neutral",radius:"full",className:`cursor-pointer select-none transition-all duration-150 gap-1 px-3 py-1 rounded-full ${r?"ring-2 ring-primary-500/30":"hover:opacity-90"}`,onDelete:o,deleteAriaLabel:`X\xF3a b\u1ED9 l\u1ECDc ${e.label}`,children:[Qt("span",{className:"font-semibold",children:[e.label,":"]}),tt("span",{className:u?"font-medium":"opacity-70 italic",children:c})]})}),p&&tt(L0,{children:Qt("div",{ref:l,"data-select-filter-popover":"true",style:{...d,...m,zIndex:Qe.SELECT_FILTER},...T({className:`bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 ${x} p-3 shadow-2xl ${e.type==="date"||e.type==="date-range"?"w-auto min-w-[280px]":"min-w-64 max-w-xs"}`}),children:[Qt("div",{className:"flex items-center justify-between pb-2 mb-2 border-b border-neutral-100 dark:border-neutral-800",children:[tt("span",{className:"text-xs font-bold text-neutral-800 dark:text-neutral-200",children:e.label}),tt("button",{type:"button",onClick:()=>n(!1),className:"text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-200 p-0.5 rounded transition-colors",title:"\u0110\xF3ng",children:tt(Oe,{className:"size-3.5"})})]}),tt("div",{className:"mt-1",children:g()}),Qt("div",{className:"flex items-center justify-between mt-3 pt-2 border-t border-neutral-100 dark:border-neutral-800",children:[tt("button",{type:"button",onClick:o,className:"text-[11px] text-red-500 hover:text-red-700 transition-colors",children:"X\xF3a b\u1ED9 l\u1ECDc"}),tt("button",{type:"button",onClick:()=>n(!1),className:"text-[11px] font-medium text-neutral-700 dark:text-neutral-200 hover:bg-neutral-100 dark:hover:bg-neutral-800 px-3 py-1 rounded-full border border-neutral-200 dark:border-neutral-700 transition-colors cursor-pointer",children:"Xong"})]})]})})]})}function Zh({filters:e,values:t,onChange:r,onReset:n,showReset:o=!0,resetText:i="\u0110\u1EB7t l\u1EA1i b\u1ED9 l\u1ECDc",color:a="primary",radius:s="full"}){let[l,h]=ql(()=>{let N=[];return e?.forEach(M=>{let z=t?.[M.name]??M.defaultValue;z!=null&&z!==""&&(!Array.isArray(z)||z.length>0)&&N.push(M.name)}),N}),[d,w]=ql(null),[p,m]=ql(!1),{refs:{setFloating:x,setReference:y},floatingStyles:b,context:k}=N0({open:p,onOpenChange:m,placement:"bottom-start",transform:!1,middleware:[z0(6),I0(),M0({padding:8})],whileElementsMounted:P0}),{isMounted:T,styles:v}=et(k,{duration:120}),u=F0(k),c=E0(k,{outsidePress:N=>!N.target?.closest?.("[data-select-filter-popover]")}),{getReferenceProps:g,getFloatingProps:f}=$0([u,c]),S=N=>{l.includes(N.name)||h(M=>[...M,N.name]),m(!1),w(N.name)},D=N=>{h(M=>M.filter(z=>z!==N)),d===N&&w(null),r(N,void 0)},R=N=>{N.stopPropagation(),h([]),w(null),n?.()},P=Xh(()=>new Set(l),[l]),I=l.length>0,E=C(s,di,"md");return!e||e.length===0?null:tt("div",{onClick:N=>N.stopPropagation(),onMouseDown:N=>N.stopPropagation(),className:"p-2.5 border-b border-neutral-200 dark:border-neutral-700 bg-neutral-50/90 dark:bg-neutral-900/80 rounded-t-lg select-text",children:Qt("div",{className:"flex flex-wrap items-center gap-1.5 min-h-7",children:[Qt("div",{className:"inline-flex",children:[Qt("button",{ref:y,type:"button",...g({className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-neutral-700 dark:text-neutral-300 hover:text-neutral-900 dark:hover:text-neutral-100 bg-white dark:bg-neutral-800 border border-neutral-300 dark:border-neutral-700 hover:border-neutral-400 dark:hover:border-neutral-600 rounded-full transition-all shadow-xs hover:shadow-sm cursor-pointer active:scale-95"}),children:[tt(pr,{className:"size-3.5 text-neutral-500"}),tt("span",{children:"B\u1ED9 l\u1ECDc"}),tt(lt,{className:`size-3 text-neutral-400 transition-transform ${p?"rotate-180":""}`})]}),T&&tt(L0,{children:Qt("div",{ref:x,"data-select-filter-popover":"true",style:{...b,...v,zIndex:Qe.SELECT_FILTER},...f({className:`bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 ${E} p-1 shadow-2xl min-w-44`}),children:[tt("div",{className:"px-2 py-1 text-[11px] font-semibold text-neutral-400 uppercase tracking-wider",children:"Ch\u1ECDn tr\u01B0\u1EDDng c\u1EA7n l\u1ECDc"}),tt("div",{className:"space-y-0.5 mt-0.5",children:e.map(N=>{let M=P.has(N.name);return Qt("button",{type:"button",onMouseDown:z=>z.preventDefault(),onClick:z=>{z.preventDefault(),z.stopPropagation(),S(N)},className:`w-full flex items-center justify-between px-2 py-1.5 text-xs rounded text-left transition-colors ${M?"text-primary font-medium bg-primary/5 hover:bg-primary/10":"text-neutral-700 dark:text-neutral-200 hover:bg-neutral-100 dark:hover:bg-neutral-800"}`,children:[tt("span",{children:N.label}),M&&tt("span",{className:"text-[10px] text-neutral-400",children:"\u0110ang l\u1ECDc"})]},N.name)})})]})})]}),l.map(N=>{let M=e.find(H=>H.name===N);if(!M)return null;let z=t[N]??M.defaultValue;return tt(qh,{field:M,currentValue:z,isOpen:d===N,onOpenChange:H=>w(H?N:null),onRemove:()=>D(N),onChange:r,color:a,radius:s},N)}),o&&n&&I&&Qt("button",{type:"button",onClick:R,className:"inline-flex items-center gap-1 text-[11px] text-neutral-500 hover:text-neutral-800 dark:hover:text-neutral-200 px-2.5 py-1 rounded-full border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-100 dark:hover:bg-neutral-800 transition-colors ml-auto cursor-pointer",title:"\u0110\u1EB7t l\u1EA1i to\xE0n b\u1ED9 b\u1ED9 l\u1ECDc",children:[tt(Lt,{className:"size-3"}),tt("span",{children:i})]})]})})}var ja=Zh;import{Fragment as rx,jsx as on,jsxs as Zl}from"react/jsx-runtime";var ex={};function tx({isOpen:e,isMounted:t,animated:r=!0,transitionStyles:n,options:o,selectedValues:i,activeIndex:a,size:s="md",color:l="primary",radius:h="md",isLoading:d=!1,portal:w=!0,maxMenuHeight:p=280,emptyText:m,emptyProps:x,menuHeader:y,menuFooter:b,listFooter:k,menuFilters:T,menuFilterValues:v=ex,menuFilterLayout:u="vertical",menuFilterGridCols:c=2,showResetFilters:g=!0,resetFiltersText:f,onMenuFilterChange:S,onResetFilters:D,renderOption:R,onSelectOption:P,onOptionMouseEnter:I,floatingStyles:E,floatingRef:N,getFloatingProps:M,listElementsRef:z,className:H=""}){if(!(t!==void 0?t:e))return null;let Y=C(h,di,"md"),$=Zl("div",{ref:N,"data-state":e?"open":"closed",style:{...E,...r?n:{},zIndex:Qe.SELECT},...M({className:`flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden focus:outline-none min-w-[200px] ${Y} ${H}`}),children:[y,T&&T.length>0&&S&&on(ja,{filters:T,values:v,onChange:S,onReset:D,layout:u,gridCols:c,showReset:g,resetText:f,color:l,radius:h}),on("div",{role:"listbox",tabIndex:-1,style:{maxHeight:typeof p=="number"?`${p}px`:p},className:`p-1 overflow-y-auto overflow-x-hidden space-y-0.5 transition-opacity duration-150 ui-scrollbar ${d?"opacity-75":"opacity-100"}`,children:o.length===0?d?Zl("div",{className:"flex items-center justify-center py-6 gap-2 text-zinc-500 dark:text-zinc-400 text-sm",children:[on(Ne,{className:"size-4 animate-spin text-current"}),on("span",{children:"Loading..."})]}):on("div",{className:"py-4 px-2",children:on(Pn,{size:"sm",image:"search",description:m||"No data found",className:"py-2",...x})}):Zl(rx,{children:[(()=>{let F=new Set(i);return o.map((G,A)=>{let U=F.has(G.value);return on(Ga,{ref:X=>{z.current[A]=X},option:G,isSelected:U,isActive:a===A,size:s,color:l,radius:h,disabled:G.disabled,renderOption:R,onClick:()=>P(G),onMouseEnter:()=>I(A)},String(G.value))})})(),k]})}),b]});return w?on(Qh,{children:$}):$}var yo=tx;import{useRef as nx}from"react";import{useFloating as ox,autoUpdate as ix,offset as ax,flip as sx,shift as lx,useClick as cx,useDismiss as ux,useRole as dx,useListNavigation as fx,useInteractions as px}from"@floating-ui/react";function pi({placement:e="bottom-start",isOpen:t,onOpenChange:r,disabled:n=!1,readOnly:o=!1,isLoading:i=!1,animated:a=!0,animationDuration:s=150,activeIndex:l,onNavigate:h}){let d=nx([]),w=!n&&!o,{refs:p,floatingStyles:m,context:x}=ox({placement:e,open:t&&w,onOpenChange:f=>{w&&(!i||t||!f)&&r(f)},whileElementsMounted:ix,transform:!1,middleware:[ax(4),sx(),lx({padding:8})]}),y=cx(x,{enabled:w&&(!i||t)}),b=ux(x,{outsidePress:f=>!f.target?.closest?.("[data-select-filter-popover]")}),k=dx(x,{role:"listbox"}),T=fx(x,{listRef:d,activeIndex:l,onNavigate:h,loop:!0}),{getReferenceProps:v,getFloatingProps:u}=px([y,b,k,T]),{isMounted:c,styles:g}=et(x,{duration:s,animated:a});return{refs:p,floatingStyles:m,transitionStyles:g,isMounted:c,context:x,getReferenceProps:v,getFloatingProps:u,elementsRef:d}}import{useState as B0,useMemo as gx}from"react";var mx=[];function gi({options:e,searchMode:t="client",controlledSearchValue:r,onSearchChange:n,searchField:o=["label","value"],menuFilters:i,controlledFilterValues:a,onMenuFilterChange:s,onSearch:l,debounceMs:h=300,filterFn:d,isOpen:w,setIsOpen:p,preserveSelected:m=!1,selectedValues:x=mx,historicalOptions:y}){let[b,k]=B0(""),T=r!==void 0,v=T?r:b,[u,c]=B0(()=>{let N={};return i?.forEach(M=>{M.defaultValue!==void 0&&(N[M.name]=M.defaultValue)}),N}),g=a??u,{debounced:f,cancel:S}=gn((N,M)=>{t==="server"&&l?.(N,M)},h),D=N=>{T||k(N),n?.(N),w||p(!0),f(N,g)},R=()=>{S(),T||k(""),n?.(""),t==="server"&&l?.("",g)},P=(N,M)=>{let z={...g,[N]:M};a||c(z),s?.(z),f(v,z)},I=()=>{let N={};i?.forEach(M=>{M.defaultValue!==void 0&&(N[M.name]=M.defaultValue)}),a||c(N),s?.(N),f(v,N)},E=gx(()=>{if(t==="server")return e;let N=e,M=v.trim();if(M?d?N=N.filter(z=>d(z,v,g)):N=un(N,M,o):d&&(N=N.filter(z=>d(z,v,g))),m&&M&&x.length>0&&y){let z=new Set(N.map(V=>V.value)),H=[];for(let V of x)if(!z.has(V)){let Y=y.get(V);Y&&H.push(Y)}H.length>0&&(N=[...H,...N])}return N},[e,t,v,d,g,o,m,x,y]);return{searchInput:v,handleSearchChange:D,resetSearch:R,currentFilters:g,handleFilterChange:P,handleResetFilters:I,filteredOptions:E}}import{jsx as mi,jsxs as V0}from"react/jsx-runtime";var xx=[];function bi({ref:e,options:t=xx,value:r,defaultValue:n,onChange:o,size:i="md",variant:a="outline",color:s="primary",radius:l="md",id:h,label:d,labelPlacement:w="top",placeholder:p="Ch\u1ECDn...",helperText:m,errorMessage:x,isInvalid:y,isDisabled:b=!1,readOnly:k=!1,isRequired:T=!1,name:v,searchable:u=!1,searchMode:c="client",searchPlacement:g="trigger",searchPlaceholder:f,searchField:S=["label","value"],searchValue:D,onSearchChange:R,menuFilters:P,menuFilterValues:I,menuFilterLayout:E="vertical",menuFilterGridCols:N=2,showResetFilters:M=!0,resetFiltersText:z,onMenuFilterChange:H,menuHeader:V,menuFooter:Y,listFooter:$,onSearch:F,debounceMs:G=300,filterFn:A,isLoading:U=!1,emptyText:B,emptyProps:X,clearable:le=!1,portal:ne=!0,placement:ue="bottom-start",maxMenuHeight:ie=280,animated:Q=!0,animationDuration:q=150,startContent:ge,endContent:ke,renderValue:L,renderOption:te,className:Z="",triggerClassName:he="",menuClassName:ae="",labelClassName:ve="",...Se}){let ye=!!(y??!!x),J=r!==void 0,[O,W]=Ya(n??null),we=J?r??null:O,[fe,se]=Ya(()=>fi(t)),me=bx(()=>Kl(we,t,fe),[we,t,fe]),[De,xe]=Ya(!1),[re,de]=Ya(null),{searchInput:ce,handleSearchChange:ee,resetSearch:j,currentFilters:Ce,handleFilterChange:Ee,handleResetFilters:Fe,filteredOptions:oe}=gi({options:t,searchMode:c,controlledSearchValue:D,onSearchChange:R,searchField:S,menuFilters:P,controlledFilterValues:I,onMenuFilterChange:H,onSearch:F,debounceMs:G,filterFn:A,isOpen:De,setIsOpen:xe}),{refs:Te,floatingStyles:Pe,transitionStyles:_e,isMounted:Ue,getReferenceProps:Le,getFloatingProps:Be,elementsRef:Ke}=pi({placement:ue,isOpen:De,onOpenChange:Re=>{xe(Re),Re||(de(null),j())},disabled:b,readOnly:k,isLoading:U,animated:Q,animationDuration:q,activeIndex:re,onNavigate:de}),K=H0(Re=>{Re.disabled||b||k||(se(Ye=>{if(Ye.has(Re.value))return Ye;let be=new Map(Ye);return be.set(Re.value,Re),be}),J||W(Re.value),o?.(Re.value,Re),xe(!1),j())},[b,k,J,o,j]),_=H0(Re=>{Re.stopPropagation(),!(b||k)&&(J||W(null),o?.(null,null),j())},[b,k,J,o,j]),ze=Re=>{if(Re.key==="Enter"&&De&&re!==null){Re.preventDefault();let Ye=oe[re];Ye&&K(Ye)}else Re.key==="ArrowDown"&&!De&&xe(!0)},pe=w==="floating",Me=w==="left",Xe=hx(),He=h||Xe,Ze=`${He}-trigger`,qe=()=>mi(at,{htmlFor:Ze,label:d,isRequired:T,isFloating:pe,size:i,color:s,hasError:ye,cursor:"pointer",className:ve});return V0("div",{ref:e,id:h,className:`group/field flex ${Me?"flex-row items-center gap-3":"flex-col"} ${pe?"pt-2":""} ${Z}`,"data-disabled":b,"data-invalid":ye,...Se,children:[!pe&&qe(),V0("div",{className:"relative flex-1 min-w-0",children:[pe&&qe(),mi(xo,{id:Ze,triggerRef:Te.setReference,getReferenceProps:Le,selectedOption:me,isOpen:De,size:i,variant:a,color:s,radius:l,placeholder:f||p,disabled:b,readOnly:k,isInvalid:ye,searchable:u,searchPlacement:g,searchValue:ce,onSearchChange:ee,onClear:_,clearable:le,isLoading:U,startContent:ge,endContent:ke,renderValue:L,onKeyDown:ze,className:he}),mi(yo,{isOpen:De,isMounted:Ue,animated:Q,transitionStyles:_e,options:oe,selectedValues:we!=null?[we]:[],activeIndex:re,size:i,color:s,radius:l,isLoading:U,portal:ne,maxMenuHeight:ie,emptyText:B,emptyProps:X,menuHeader:V,menuFooter:Y,listFooter:$,menuFilters:P,menuFilterValues:Ce,menuFilterLayout:E,menuFilterGridCols:N,showResetFilters:M,resetFiltersText:z,onMenuFilterChange:Ee,onResetFilters:Fe,renderOption:te,onSelectOption:K,onOptionMouseEnter:de,floatingRef:Te.setFloating,floatingStyles:Pe,getFloatingProps:Be,listElementsRef:Ke,className:ae})]}),v&&we!==null&&we!==void 0&&mi("input",{type:"hidden",name:v,value:String(we)}),mi($e,{id:`${He}-helper`,errorMessage:x,helperText:m})]})}var A0=bi;import{useState as Ka,useMemo as wx,useCallback as Jl,useId as Cx}from"react";import{useRef as vx}from"react";import{jsx as wo,jsxs as O0}from"react/jsx-runtime";function yx({id:e,selectedOptions:t,isOpen:r,size:n="md",variant:o="outline",color:i="primary",radius:a="md",placeholder:s="Ch\u1ECDn...",disabled:l=!1,readOnly:h=!1,isInvalid:d=!1,maxTagCount:w,searchable:p=!1,searchPlacement:m="trigger",searchValue:x="",onSearchChange:y,onRemoveTag:b,onClear:k,clearable:T=!1,isLoading:v=!1,startContent:u,endContent:c,renderValue:g,triggerRef:f,getReferenceProps:S,onKeyDown:D,className:R=""}){let P=vx(null),I=C(n,go,"md"),E=C(a,mo,"md"),N=C(a,S0,"md"),z=!!d?"error":i,H=o==="other"?"":bo[o]?.[z]||bo.outline.primary,V=p&&(m==="trigger"||m==="both"),Y=t.length>0,$=T&&(Y||x.length>0)&&!l&&!h,{visibleTags:F,hiddenTagCount:G}=_l(t,w);return wo(Oa,{id:e,isOpen:r,disabled:l,isLoading:v,showClear:$,onClear:k,startContent:u,endContent:c,triggerRef:f,getReferenceProps:S,onClick:()=>{!l&&!h&&!v&&V&&P.current?.focus()},roundedClass:E,currentSize:I,variantStyle:H,className:R,children:g&&Y?wo("div",{className:"flex-1 min-w-0 truncate text-neutral-900",children:g(t)}):O0("div",{className:"flex flex-wrap items-center gap-1 flex-1 min-w-0",children:[F.map(B=>wo($t,{size:I.badgeSize,variant:"soft",color:i,radius:N,onDelete:!l&&!h&&!v&&b?()=>b(B):void 0,className:"max-w-full truncate",children:wo("span",{className:"truncate",children:B.label})},String(B.value))),G>0&&O0($t,{size:I.badgeSize,variant:"soft",color:"neutral",radius:N,children:["+",G]}),V&&!l&&!h&&!v?wo("input",{ref:P,type:"text","aria-label":"Search",value:x,placeholder:Y?"":s,onChange:B=>y?.(B.target.value),onKeyDown:D,className:`bg-transparent outline-none border-none p-0 flex-1 min-w-15 text-neutral-900 placeholder:text-neutral-400 ${I.input}`}):Y?null:wo("span",{className:"text-neutral-400 truncate",children:s})]})})}var Wa=yx;import{jsx as hi,jsxs as U0}from"react/jsx-runtime";var kx=[],G0=[];function Sx({ref:e,options:t=kx,value:r,defaultValue:n,onChange:o,size:i="md",variant:a="outline",color:s="primary",radius:l="md",id:h,label:d,labelPlacement:w="top",placeholder:p="Ch\u1ECDn...",helperText:m,errorMessage:x,isInvalid:y,isDisabled:b=!1,readOnly:k=!1,isRequired:T=!1,name:v,maxTagCount:u,searchable:c=!1,searchMode:g="client",searchPlacement:f="trigger",searchPlaceholder:S,searchField:D=["label","value"],preserveSelected:R=!0,searchValue:P,onSearchChange:I,menuFilters:E,menuFilterValues:N,menuFilterLayout:M="vertical",menuFilterGridCols:z=2,showResetFilters:H=!0,resetFiltersText:V,onMenuFilterChange:Y,menuHeader:$,menuFooter:F,listFooter:G,onSearch:A,debounceMs:U=300,filterFn:B,isLoading:X=!1,emptyText:le,emptyProps:ne,clearable:ue=!1,portal:ie=!0,placement:Q="bottom-start",maxMenuHeight:q=280,animated:ge=!0,animationDuration:ke=150,startContent:L,endContent:te,renderValue:Z,renderOption:he,className:ae="",triggerClassName:ve="",menuClassName:Se="",labelClassName:ye="",...J}){let O=!!(y??!!x),W=r!==void 0,[we,fe]=Ka(n??G0),se=W?r??G0:we,[me,De]=Ka(()=>fi(t)),xe=wx(()=>Ua(se,t,me),[se,t,me]),[re,de]=Ka(!1),[ce,ee]=Ka(null),{searchInput:j,handleSearchChange:Ce,resetSearch:Ee,currentFilters:Fe,handleFilterChange:oe,handleResetFilters:Te,filteredOptions:Pe}=gi({options:t,searchMode:g,controlledSearchValue:P,onSearchChange:I,searchField:D,menuFilters:E,controlledFilterValues:N,onMenuFilterChange:Y,onSearch:A,debounceMs:U,filterFn:B,isOpen:re,setIsOpen:de,preserveSelected:R,selectedValues:se,historicalOptions:me}),{refs:_e,floatingStyles:Ue,transitionStyles:Le,isMounted:Be,getReferenceProps:Ke,getFloatingProps:K,elementsRef:_}=pi({placement:Q,isOpen:re,onOpenChange:Ve=>{de(Ve),Ve||ee(null)},disabled:b,readOnly:k,isLoading:X,animated:ge,animationDuration:ke,activeIndex:ce,onNavigate:ee}),ze=Jl(Ve=>{if(Ve.disabled||b||k)return;De(Ft=>{if(Ft.has(Ve.value))return Ft;let ot=new Map(Ft);return ot.set(Ve.value,Ve),ot});let Je=se.includes(Ve.value)?se.filter(Ft=>Ft!==Ve.value):[...se,Ve.value];W||fe(Je);let Tt=Ua(Je,t,me);o?.(Je,Tt),Ee()},[b,k,se,W,t,o,Ee,me]),pe=Jl(Ve=>{if(b||k)return;let rt=se.filter(Tt=>Tt!==Ve.value);W||fe(rt);let Je=rt.map(Tt=>t.find(Ft=>Ft.value===Tt)||me.get(Tt)||{value:Tt,label:String(Tt)});o?.(rt,Je)},[b,k,se,W,t,o,me]),Me=Jl(Ve=>{Ve.stopPropagation(),!(b||k)&&(W||fe([]),o?.([],[]),Ee())},[b,k,W,o,Ee]),Xe=Ve=>{let rt=Ve.currentTarget?.value??j;if(Ve.key==="Backspace"&&(!rt||rt.length===0)&&xe.length>0){Ve.preventDefault();let Je=xe[xe.length-1];Je&&pe(Je)}else if(Ve.key==="Enter"&&re&&ce!==null){Ve.preventDefault();let Je=Pe[ce];Je&&ze(Je)}else Ve.key==="ArrowDown"&&!re&&de(!0)},He=w==="floating",Ze=w==="left",qe=Cx(),Re=h||qe,Ye=`${Re}-trigger`,be=()=>hi(at,{htmlFor:Ye,label:d,isRequired:T,isFloating:He,size:i,color:s,hasError:O,cursor:"pointer",className:ye});return U0("div",{ref:e,id:h,className:`group/field flex ${Ze?"flex-row items-center gap-3":"flex-col"} ${He?"pt-2":""} ${ae}`,"data-disabled":b,"data-invalid":O,...J,children:[!He&&be(),U0("div",{className:"relative flex-1 min-w-0",children:[He&&be(),hi(Wa,{id:Ye,triggerRef:_e.setReference,getReferenceProps:Ke,selectedOptions:xe,isOpen:re,size:i,variant:a,color:s,radius:l,placeholder:S||p,disabled:b,readOnly:k,isInvalid:O,maxTagCount:u,searchable:c,searchPlacement:f,searchValue:j,onSearchChange:Ce,onRemoveTag:pe,onClear:Me,clearable:ue,isLoading:X,startContent:L,endContent:te,renderValue:Z,onKeyDown:Xe,className:ve}),hi(yo,{isOpen:re,isMounted:Be,animated:ge,transitionStyles:Le,options:Pe,selectedValues:se,activeIndex:ce,size:i,color:s,radius:l,isLoading:X,portal:ie,maxMenuHeight:q,emptyText:le,emptyProps:ne,menuHeader:$,menuFooter:F,listFooter:G,menuFilters:E,menuFilterValues:Fe,menuFilterLayout:M,menuFilterGridCols:z,showResetFilters:H,resetFiltersText:V,onMenuFilterChange:oe,onResetFilters:Te,renderOption:he,onSelectOption:ze,onOptionMouseEnter:ee,floatingRef:_e.setFloating,floatingStyles:Ue,getFloatingProps:K,listElementsRef:_,className:Se})]}),v&&se.map((Ve,rt)=>hi("input",{type:"hidden",name:`${v}[]`,value:String(Ve)},`${v}-${Ve}-${rt}`)),hi($e,{id:`${Re}-helper`,errorMessage:x,helperText:m})]})}var j0=Sx;import{useEffect as Tx,useState as Dx}from"react";function Rx(e,t=300){let[r,n]=Dx(e);return Tx(()=>{let o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}import{useId as qx,useMemo as lf,useState as ss}from"react";import{useDropzone as Zx}from"react-dropzone";var _a={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},Y0={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",neutral:"text-neutral-600 group-focus-within/field:text-neutral-800",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600"},W0={xs:"h-28",sm:"h-36",md:"h-48",lg:"h-60",xl:"h-72"},Co={xs:{dropzoneHeight:"min-h-[80px]",dropzonePadding:"p-3",avatarSize:"size-12",thumbnailSize:"size-12",iconSize:24,titleSize:"text-[11px]",descSize:"text-[10px]",labelSize:"text-[11px] mb-1",helperSize:"text-[9px] mt-0.5",gap:"gap-1.5"},sm:{dropzoneHeight:"min-h-[100px]",dropzonePadding:"p-4",avatarSize:"size-16",thumbnailSize:"size-16",iconSize:32,titleSize:"text-xs",descSize:"text-[11px]",labelSize:"text-xs mb-1",helperSize:"text-[10px] mt-0.5",gap:"gap-2"},md:{dropzoneHeight:"min-h-[130px]",dropzonePadding:"p-5",avatarSize:"size-24",thumbnailSize:"size-20",iconSize:44,titleSize:"text-sm",descSize:"text-xs",labelSize:"text-sm mb-1.5",helperSize:"text-[11px] mt-1",gap:"gap-3"},lg:{dropzoneHeight:"min-h-[160px]",dropzonePadding:"p-6",avatarSize:"size-28",thumbnailSize:"size-24",iconSize:54,titleSize:"text-base",descSize:"text-xs",labelSize:"text-base mb-1.5",helperSize:"text-xs mt-1",gap:"gap-3.5"},xl:{dropzoneHeight:"min-h-[200px]",dropzonePadding:"p-8",avatarSize:"size-36",thumbnailSize:"size-28",iconSize:64,titleSize:"text-lg",descSize:"text-sm",labelSize:"text-lg mb-2",helperSize:"text-sm mt-1",gap:"gap-4"}},K0={outline:{primary:{idle:"bg-neutral-white border-primary-400 hover:border-primary-500 text-neutral-700",active:"bg-primary-50/50 border-primary-500 ring-2 ring-primary-500/20 text-primary-900",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600"},secondary:{idle:"bg-neutral-white border-secondary-400 hover:border-secondary-500 text-neutral-700",active:"bg-secondary-50/50 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-900",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600"},neutral:{idle:"bg-neutral-white border-neutral-300 hover:border-neutral-400 text-neutral-700",active:"bg-neutral-100/70 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-900"},error:{idle:"bg-neutral-white border-error-500 hover:border-error-600 text-neutral-700",active:"bg-error-50/50 border-error-500 ring-2 ring-error-500/20 text-error-900",iconColor:"text-error-500",titleHover:"group-hover:text-error-600"},success:{idle:"bg-neutral-white border-success-400 hover:border-success-500 text-neutral-700",active:"bg-success-50/50 border-success-500 ring-2 ring-success-500/20 text-success-900",iconColor:"text-success-500",titleHover:"group-hover:text-success-600"},warning:{idle:"bg-neutral-white border-warning-400 hover:border-warning-500 text-neutral-700",active:"bg-warning-50/50 border-warning-500 ring-2 ring-warning-500/20 text-warning-900",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600"},info:{idle:"bg-neutral-white border-info-400 hover:border-info-500 text-neutral-700",active:"bg-info-50/50 border-info-500 ring-2 ring-info-500/20 text-info-900",iconColor:"text-info-500",titleHover:"group-hover:text-info-600"}},filled:{primary:{idle:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 hover:border-primary-400 text-primary-900",active:"bg-primary-100 border-primary-500 ring-2 ring-primary-500/20 text-primary-950",iconColor:"text-primary-600",titleHover:"group-hover:text-primary-700"},secondary:{idle:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 hover:border-secondary-400 text-secondary-900",active:"bg-secondary-100 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-950",iconColor:"text-secondary-600",titleHover:"group-hover:text-secondary-700"},neutral:{idle:"bg-neutral-100/70 border-neutral-200 hover:bg-neutral-200/70 hover:border-neutral-400 text-neutral-800",active:"bg-neutral-200 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-600",titleHover:"group-hover:text-neutral-950"},error:{idle:"bg-error-50/60 border-error-200 hover:bg-error-100/60 hover:border-error-400 text-error-900",active:"bg-error-100 border-error-500 ring-2 ring-error-500/20 text-error-950",iconColor:"text-error-600",titleHover:"group-hover:text-error-700"},success:{idle:"bg-success-50/60 border-success-200 hover:bg-success-100/60 hover:border-success-400 text-success-900",active:"bg-success-100 border-success-500 ring-2 ring-success-500/20 text-success-950",iconColor:"text-success-600",titleHover:"group-hover:text-success-700"},warning:{idle:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 hover:border-warning-400 text-warning-900",active:"bg-warning-100 border-warning-500 ring-2 ring-warning-500/20 text-warning-950",iconColor:"text-warning-600",titleHover:"group-hover:text-warning-700"},info:{idle:"bg-info-50/60 border-info-200 hover:bg-info-100/60 hover:border-info-400 text-info-900",active:"bg-info-100 border-info-500 ring-2 ring-info-500/20 text-info-950",iconColor:"text-info-600",titleHover:"group-hover:text-info-700"}},ghost:{primary:{idle:"bg-transparent border-transparent hover:bg-primary-50/60 hover:border-primary-300 text-neutral-700",active:"bg-primary-50 border-primary-500 ring-2 ring-primary-500/20 text-primary-900",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600"},secondary:{idle:"bg-transparent border-transparent hover:bg-secondary-50/60 hover:border-secondary-300 text-neutral-700",active:"bg-secondary-50 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-900",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600"},neutral:{idle:"bg-transparent border-transparent hover:bg-neutral-100 hover:border-neutral-300 text-neutral-700",active:"bg-neutral-100 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-900"},error:{idle:"bg-transparent border-transparent hover:bg-error-50/60 hover:border-error-300 text-neutral-700",active:"bg-error-50 border-error-500 ring-2 ring-error-500/20 text-error-900",iconColor:"text-error-500",titleHover:"group-hover:text-error-600"},success:{idle:"bg-transparent border-transparent hover:bg-success-50/60 hover:border-success-300 text-neutral-700",active:"bg-success-50 border-success-500 ring-2 ring-success-500/20 text-success-900",iconColor:"text-success-500",titleHover:"group-hover:text-success-600"},warning:{idle:"bg-transparent border-transparent hover:bg-warning-50/60 hover:border-warning-300 text-neutral-700",active:"bg-warning-50 border-warning-500 ring-2 ring-warning-500/20 text-warning-900",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600"},info:{idle:"bg-transparent border-transparent hover:bg-info-50/60 hover:border-info-300 text-neutral-700",active:"bg-info-50 border-info-500 ring-2 ring-info-500/20 text-info-900",iconColor:"text-info-500",titleHover:"group-hover:text-info-600"}}};function wr(e,t=1){if(!e||!+e)return"0 B";let r=1024,n=t<0?0:t,o=["B","KB","MB","GB","TB"],i=Math.floor(Math.log(e)/Math.log(r));return`${parseFloat((e/Math.pow(r,i)).toFixed(n))} ${o[i]}`}function In(e){return e?Array.isArray(e)?e.filter(t=>!!t):[e]:[]}var Xa={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},_0={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",neutral:"text-neutral-600 group-focus-within/field:text-neutral-800",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600"},X0={xs:"h-28",sm:"h-36",md:"h-48",lg:"h-60",xl:"h-72"},Cr={xs:{dropzoneHeight:"min-h-[80px]",dropzoneMinHeight:"min-h-[80px]",dropzonePadding:"p-3",compactMinHeight:"min-h-[40px]",compactPadding:"px-3 py-2",thumbnailSize:"w-28 h-20",iconSize:24,fileIconSize:28,titleSize:"text-[11px]",descSize:"text-[10px]",fileNameSize:"text-xs",fileMetaSize:"text-[10px]",labelSize:"text-[11px] mb-1",helperSize:"text-[9px] mt-0.5",buttonSize:"xs",actionButtonPadding:"p-1",gap:"gap-1.5",itemPadding:"px-2.5 py-1.5"},sm:{dropzoneHeight:"min-h-[100px]",dropzoneMinHeight:"min-h-[100px]",dropzonePadding:"p-4",compactMinHeight:"min-h-[48px]",compactPadding:"px-3.5 py-2.5",thumbnailSize:"w-32 h-24",iconSize:32,fileIconSize:34,titleSize:"text-xs",descSize:"text-[11px]",fileNameSize:"text-xs font-medium",fileMetaSize:"text-[11px]",labelSize:"text-xs mb-1",helperSize:"text-[10px] mt-0.5",buttonSize:"sm",actionButtonPadding:"p-1.5",gap:"gap-2",itemPadding:"px-3 py-2"},md:{dropzoneHeight:"min-h-[130px]",dropzoneMinHeight:"min-h-[130px]",dropzonePadding:"p-5",compactMinHeight:"min-h-[56px]",compactPadding:"px-4 py-3",thumbnailSize:"w-40 h-28",iconSize:42,fileIconSize:40,titleSize:"text-sm",descSize:"text-xs",fileNameSize:"text-sm font-medium",fileMetaSize:"text-xs",labelSize:"text-sm mb-1.5",helperSize:"text-[11px] mt-1",buttonSize:"md",actionButtonPadding:"p-1.5",gap:"gap-2.5",itemPadding:"px-3.5 py-2.5"},lg:{dropzoneHeight:"min-h-[160px]",dropzoneMinHeight:"min-h-[160px]",dropzonePadding:"p-6",compactMinHeight:"min-h-[64px]",compactPadding:"px-5 py-3.5",thumbnailSize:"w-48 h-32",iconSize:52,fileIconSize:48,titleSize:"text-base",descSize:"text-xs",fileNameSize:"text-base font-medium",fileMetaSize:"text-xs",labelSize:"text-base mb-1.5",helperSize:"text-xs mt-1",buttonSize:"lg",actionButtonPadding:"p-2",gap:"gap-3",itemPadding:"px-4 py-3"},xl:{dropzoneHeight:"min-h-[200px]",dropzoneMinHeight:"min-h-[200px]",dropzonePadding:"p-8",compactMinHeight:"min-h-[72px]",compactPadding:"px-6 py-4",thumbnailSize:"w-56 h-36",iconSize:64,fileIconSize:56,titleSize:"text-lg",descSize:"text-sm",fileNameSize:"text-lg font-medium",fileMetaSize:"text-sm",labelSize:"text-lg mb-2",helperSize:"text-sm mt-1",buttonSize:"xl",actionButtonPadding:"p-2.5",gap:"gap-3.5",itemPadding:"px-5 py-3.5"}},q0={outline:{primary:{idle:"bg-neutral-white border-primary-400 hover:border-primary-500 text-neutral-700",active:"bg-primary-50/50 border-primary-500 ring-2 ring-primary-500/20 text-primary-900",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600",itemBg:"bg-white hover:bg-neutral-50/80",itemBorder:"border-neutral-200 hover:border-primary-300"},secondary:{idle:"bg-neutral-white border-secondary-400 hover:border-secondary-500 text-neutral-700",active:"bg-secondary-50/50 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-900",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600",itemBg:"bg-white hover:bg-neutral-50/80",itemBorder:"border-neutral-200 hover:border-secondary-300"},neutral:{idle:"bg-neutral-white border-neutral-300 hover:border-neutral-400 text-neutral-700",active:"bg-neutral-100/70 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-900",itemBg:"bg-white hover:bg-neutral-50/80",itemBorder:"border-neutral-200 hover:border-neutral-400"},error:{idle:"bg-neutral-white border-error-500 hover:border-error-600 text-neutral-700",active:"bg-error-50/50 border-error-500 ring-2 ring-error-500/20 text-error-900",iconColor:"text-error-500",titleHover:"group-hover:text-error-600",itemBg:"bg-white hover:bg-error-50/30",itemBorder:"border-error-200 hover:border-error-300"},success:{idle:"bg-neutral-white border-success-400 hover:border-success-500 text-neutral-700",active:"bg-success-50/50 border-success-500 ring-2 ring-success-500/20 text-success-900",iconColor:"text-success-500",titleHover:"group-hover:text-success-600",itemBg:"bg-white hover:bg-success-50/30",itemBorder:"border-success-200 hover:border-success-300"},warning:{idle:"bg-neutral-white border-warning-400 hover:border-warning-500 text-neutral-700",active:"bg-warning-50/50 border-warning-500 ring-2 ring-warning-500/20 text-warning-900",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600",itemBg:"bg-white hover:bg-warning-50/30",itemBorder:"border-warning-200 hover:border-warning-300"},info:{idle:"bg-neutral-white border-info-400 hover:border-info-500 text-neutral-700",active:"bg-info-50/50 border-info-500 ring-2 ring-info-500/20 text-info-900",iconColor:"text-info-500",titleHover:"group-hover:text-info-600",itemBg:"bg-white hover:bg-info-50/30",itemBorder:"border-info-200 hover:border-info-300"}},filled:{primary:{idle:"border-transparent bg-primary-50/60 hover:bg-primary-100/60",active:"border-primary-500 bg-primary-100 ring-2 ring-primary-500/20",iconColor:"text-primary-600",titleHover:"group-hover:text-primary-700",itemBg:"bg-primary-50/40 hover:bg-primary-50/80",itemBorder:"border-primary-100 hover:border-primary-200"},secondary:{idle:"border-transparent bg-secondary-50/60 hover:bg-secondary-100/60",active:"border-secondary-500 bg-secondary-100 ring-2 ring-secondary-500/20",iconColor:"text-secondary-600",titleHover:"group-hover:text-secondary-700",itemBg:"bg-secondary-50/40 hover:bg-secondary-50/80",itemBorder:"border-secondary-100 hover:border-secondary-200"},neutral:{idle:"border-transparent bg-neutral-100/70 hover:bg-neutral-200/50",active:"border-neutral-400 bg-neutral-200 ring-2 ring-neutral-400/20",iconColor:"text-neutral-600",titleHover:"group-hover:text-neutral-800",itemBg:"bg-neutral-100/50 hover:bg-neutral-100",itemBorder:"border-neutral-200 hover:border-neutral-300"},error:{idle:"border-transparent bg-error-50/70 hover:bg-error-100/70",active:"border-error-500 bg-error-100 ring-2 ring-error-500/20",iconColor:"text-error-600",titleHover:"group-hover:text-error-700",itemBg:"bg-error-50/40 hover:bg-error-50/80",itemBorder:"border-error-100 hover:border-error-200"},success:{idle:"border-transparent bg-success-50/70 hover:bg-success-100/70",active:"border-success-500 bg-success-100 ring-2 ring-success-500/20",iconColor:"text-success-600",titleHover:"group-hover:text-success-700",itemBg:"bg-success-50/40 hover:bg-success-50/80",itemBorder:"border-success-100 hover:border-success-200"},warning:{idle:"border-transparent bg-warning-50/70 hover:bg-warning-100/70",active:"border-warning-500 bg-warning-100 ring-2 ring-warning-500/20",iconColor:"text-warning-600",titleHover:"group-hover:text-warning-700",itemBg:"bg-warning-50/40 hover:bg-warning-50/80",itemBorder:"border-warning-100 hover:border-warning-200"},info:{idle:"border-transparent bg-info-50/70 hover:bg-info-100/70",active:"border-info-500 bg-info-100 ring-2 ring-info-500/20",iconColor:"text-info-600",titleHover:"group-hover:text-info-700",itemBg:"bg-info-50/40 hover:bg-info-50/80",itemBorder:"border-info-100 hover:border-info-200"}},ghost:{primary:{idle:"border-transparent bg-transparent hover:bg-primary-50/30",active:"border-primary-400 bg-primary-50/40 ring-2 ring-primary-400/20",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600",itemBg:"bg-transparent hover:bg-primary-50/20",itemBorder:"border-transparent hover:border-primary-200"},secondary:{idle:"border-transparent bg-transparent hover:bg-secondary-50/30",active:"border-secondary-400 bg-secondary-50/40 ring-2 ring-secondary-400/20",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600",itemBg:"bg-transparent hover:bg-secondary-50/20",itemBorder:"border-transparent hover:border-secondary-200"},neutral:{idle:"border-transparent bg-transparent hover:bg-neutral-100/40",active:"border-neutral-400 bg-neutral-100/50 ring-2 ring-neutral-400/20",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-800",itemBg:"bg-transparent hover:bg-neutral-100/40",itemBorder:"border-transparent hover:border-neutral-300"},error:{idle:"border-transparent bg-transparent hover:bg-error-50/30",active:"border-error-400 bg-error-50/40 ring-2 ring-error-400/20",iconColor:"text-error-500",titleHover:"group-hover:text-error-600",itemBg:"bg-transparent hover:bg-error-50/20",itemBorder:"border-transparent hover:border-error-200"},success:{idle:"border-transparent bg-transparent hover:bg-success-50/30",active:"border-success-400 bg-success-50/40 ring-2 ring-success-400/20",iconColor:"text-success-500",titleHover:"group-hover:text-success-600",itemBg:"bg-transparent hover:bg-success-50/20",itemBorder:"border-transparent hover:border-success-200"},warning:{idle:"border-transparent bg-transparent hover:bg-warning-50/30",active:"border-warning-400 bg-warning-50/40 ring-2 ring-warning-400/20",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600",itemBg:"bg-transparent hover:bg-warning-50/20",itemBorder:"border-transparent hover:border-warning-200"},info:{idle:"border-transparent bg-transparent hover:bg-info-50/30",active:"border-info-400 bg-info-50/40 ring-2 ring-info-400/20",iconColor:"text-info-500",titleHover:"group-hover:text-info-600",itemBg:"bg-transparent hover:bg-info-50/20",itemBorder:"border-transparent hover:border-info-200"}}},Z0={pdf:["pdf"],word:["doc","docx","dot","dotx","odt","rtf"],excel:["xls","xlsx","xlsm","xlsb","csv","ods"],powerpoint:["ppt","pptx","pot","potx","pps","ppsx","odp"],archive:["zip","rar","7z","tar","gz","bz2","xz","iso"],text:["txt","md","markdown","log"],image:["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","avif"],audio:["mp3","wav","ogg","aac","flac","m4a","wma"],video:["mp4","webm","mov","avi","mkv","wmv","flv"],code:["js","jsx","ts","tsx","html","css","scss","json","py","java","c","cpp","cs","go","rs","php","sql","sh","yaml","yml","xml"],other:[]},J0={pdf:{label:"PDF",bg:"bg-error-50",text:"text-error-700",border:"border-error-200"},word:{label:"DOC",bg:"bg-primary-50",text:"text-primary-700",border:"border-primary-200"},excel:{label:"XLS",bg:"bg-success-50",text:"text-success-700",border:"border-success-200"},powerpoint:{label:"PPT",bg:"bg-secondary-50",text:"text-secondary-700",border:"border-secondary-200"},archive:{label:"ZIP",bg:"bg-warning-50",text:"text-warning-800",border:"border-warning-200"},text:{label:"TXT",bg:"bg-neutral-100",text:"text-neutral-700",border:"border-neutral-200"},image:{label:"IMG",bg:"bg-emerald-50",text:"text-emerald-700",border:"border-emerald-200"},audio:{label:"AUD",bg:"bg-purple-50",text:"text-purple-700",border:"border-purple-200"},video:{label:"VID",bg:"bg-cyan-50",text:"text-cyan-700",border:"border-cyan-200"},code:{label:"DEV",bg:"bg-slate-100",text:"text-slate-700",border:"border-slate-200"},other:{label:"FILE",bg:"bg-neutral-100",text:"text-neutral-600",border:"border-neutral-200"}};var qa=["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","avif"],Za=["pdf"],Ja=["mp4","webm","ogg","mov","avi","mkv"],Qa=["mp3","wav","ogg","aac","flac","m4a"],es=["doc","docx","xls","xlsx","ppt","pptx","txt","csv"];function ct(e){if(!e)return"";if(typeof e=="object"&&!(e instanceof Blob))return e.name?e.name:e.src?ct(e.src):"";if(e instanceof File)return e.name||"";if(typeof e=="string"){let t=e.split("?")[0]?.split("#")[0]||"",r=t.split("/").pop()||t.split("\\").pop()||"",n=r.lastIndexOf(".");return n<=0?r:r.slice(0,n)}return""}function xi(e=""){let t=e.split("?")[0]?.split("#")[0]||"",r=t.lastIndexOf(".");return r===-1?"":t.slice(r+1).toLowerCase()}function ko(e=""){let t=xi(e);return qa.includes(t)?"image":Za.includes(t)?"pdf":Ja.includes(t)?"video":Qa.includes(t)?"audio":es.includes(t)?"document":"other"}function Ql(e){return!e||typeof e!="object"||e instanceof Blob||"height"in e&&"width"in e&&typeof e.height=="number"?!1:"src"in e||"name"in e||"id"in e}function Mr(e){if(!e)return{name:"file",type:"other",file:void 0,serverFile:void 0};if(typeof e=="string"){let n=ct(e)||"file";return{name:n,type:ko(e),file:void 0,serverFile:{src:e,name:n}}}if(e instanceof File)return{name:ct(e.name),type:ko(e.name),file:e,serverFile:void 0};let t=e.name??ct(e?.src),r="other";return e?.src?.startsWith("data:image/")?r="image":e?.src?.startsWith("data:video/")?r="video":e?.src?.startsWith("data:audio/")?r="audio":e?.src?.startsWith("data:application/pdf")?r="pdf":e?.name&&(r=ko(e.name)),r==="other"&&e?.src&&(r=ko(e.src)),{name:t,type:r,file:void 0,serverFile:e}}function kr(e,t){if(!e)return;let r=document.createElement("a");r.href=e;let n=e.split("?")[0]?.split("#")[0]||"",o=n.split("/").pop()||n.split("\\").pop()||"download";r.download=t||o,r.style.display="none",document.body.appendChild(r),r.click(),setTimeout(()=>{try{document.body.removeChild(r)}catch{}},100)}function ec(e){if(e){if(e instanceof File)return e.size;if(typeof e=="object"&&e!==null&&"size"in e){let t=e.size;if(typeof t=="number")return t}}}function tc(e){if(!e||typeof e!="object"||e instanceof File)return{status:"idle"};let t=e,r=typeof t.status=="string"?t.status:void 0,n=typeof t.progress=="number"?t.progress:void 0,o=typeof t.error=="string"?t.error:void 0,i="idle";return r==="uploading"||n!==void 0&&n>=0&&n<100?i="uploading":r==="error"||o?i="error":(r==="success"||r==="done"||n!==void 0&&n>=100)&&(i="success"),{status:i,progress:n,error:o}}function ts(e){if(!e)return"other";let t="",r="";typeof e=="string"?t=e:e instanceof File?(t=e.name,r=e.type):typeof e=="object"&&(t=e.name||(typeof e.src=="string"?e.src:""),typeof e.type=="string"&&(r=e.type));let n=xi(t);if(n){for(let[o,i]of Object.entries(Z0))if(i.includes(n))return o}if(r){if(r==="application/pdf")return"pdf";if(r.startsWith("image/"))return"image";if(r.startsWith("audio/"))return"audio";if(r.startsWith("video/"))return"video";if(r.includes("word")||r.includes("document")||r==="application/msword")return"word";if(r.includes("excel")||r.includes("spreadsheet")||r==="text/csv")return"excel";if(r.includes("presentation")||r.includes("powerpoint"))return"powerpoint";if(r.includes("zip")||r.includes("compressed")||r.includes("archive")||r==="application/x-tar")return"archive";if(r.startsWith("text/"))return"text"}return"other"}function Q0(e,t){return typeof e=="object"&&e&&"id"in e&&e.id!=null?String(e.id):e instanceof File?`${e.name}-${e.size}-${e.lastModified}-${t}`:typeof e=="string"?`${e}-${t}`:`${ct(e)}-${t}`}function vi(e){if(!e)return;if(typeof e=="object")return e;let t={},r=e.split(",").map(o=>o.trim()).filter(Boolean),n={".pdf":"application/pdf",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".csv":"text/csv",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".zip":"application/zip",".rar":"application/vnd.rar",".7z":"application/x-7z-compressed",".tar":"application/x-tar",".gz":"application/gzip",".txt":"text/plain",".json":"application/json",".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".webp":"image/webp",".gif":"image/gif",".svg":"image/svg+xml",".mp3":"audio/mpeg",".wav":"audio/wav",".mp4":"video/mp4"};for(let o of r)if(o.startsWith(".")){let i=o.toLowerCase(),a=n[i]||"application/octet-stream";t[a]=[...t[a]||[],i]}else t[o]||(t[o]=[]);return t}import{useEffect as Mx,useState as Fx}from"react";import{createContext as Nx,useContext as Px}from"react";var rc=Nx(null),rs=()=>Px(rc);import{useState as ns}from"react";import zx from"react-easy-crop";import{jsx as kt,jsxs as ef}from"react/jsx-runtime";function yi({zoom:e=1,minZoom:t=.2,maxZoom:r=5,step:n=.05,onZoomChange:o,sliderProps:i,onZoomIn:a,onZoomOut:s,onRotateCw:l,onRotateCcw:h,onFlipHorizontal:d,onReset:w,currentImage:p,tools:m,className:x=""}){let{zoomIn:y=!0,zoomOut:b=!0,zoomSlider:k=!0,reset:T=!0,rotate:v=!0,flip:u=!0,download:c=!0}=m??{},g=Math.round(e*100),f=()=>{p?.src&&kr(p.src,p.name)},S=R=>{if(typeof R=="number"){let P=Math.round(R*100)/100;o?.(P)}},D="p-2 rounded-full text-neutral-600 hover:text-neutral-900 hover:bg-neutral-100 active:scale-95 transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-500 cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed disabled:hover:bg-transparent";return ef("div",{"data-testid":"image-preview-toolbar",className:`inline-flex items-center gap-1 bg-neutral-white border border-neutral-200 rounded-full px-3 py-1.5 shadow-sm text-neutral-700 select-none pointer-events-auto ${x}`,children:[b&&kt("button",{type:"button","aria-label":"Thu nh\u1ECF",title:"Thu nh\u1ECF (-)",disabled:e<=t,onClick:s,className:D,children:kt(qn,{width:18,height:18})}),k&&kt("div",{className:"flex items-center px-1","data-testid":"image-preview-zoom-slider",children:kt(Oo,{value:e,min:t,max:r,step:n,size:"sm",color:"primary",config:{isFullWidth:!1},className:"w-20 sm:w-28",disabled:!o&&!i?.onChange,onChange:S,"aria-label":"Thanh tr\u01B0\u1EE3t thu ph\xF3ng",...i})}),y&&kt("button",{type:"button","aria-label":"Ph\xF3ng to",title:"Ph\xF3ng to (+)",disabled:e>=r,onClick:a,className:D,children:kt(Xn,{width:18,height:18})}),T&&ef("button",{type:"button","aria-label":"\u0110\u1EB7t l\u1EA1i k\xEDch th\u01B0\u1EDBc v\xE0 g\xF3c xoay",title:"\u0110\u1EB7t l\u1EA1i (1:1)",onClick:w,className:"px-2 py-1 text-xs font-semibold text-neutral-700 hover:text-neutral-900 hover:bg-neutral-100 rounded-full transition-colors cursor-pointer",children:[g,"%"]}),(v||u||c)&&kt("div",{className:"w-px h-4 bg-neutral-200 my-auto mx-1"}),v&&kt("button",{type:"button","aria-label":"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",title:"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",onClick:h,className:D,children:kt(Zn,{width:18,height:18})}),v&&kt("button",{type:"button","aria-label":"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",title:"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3 (r)",onClick:l,className:D,children:kt(jr,{width:18,height:18})}),u&&kt("button",{type:"button","aria-label":"L\u1EADt ngang",title:"L\u1EADt ngang",onClick:d,className:D,children:kt(Qn,{width:18,height:18})}),c&&kt("button",{type:"button","aria-label":"T\u1EA3i \u1EA3nh xu\u1ED1ng",title:"T\u1EA3i \u1EA3nh xu\u1ED1ng",onClick:f,className:D,children:kt(br,{width:18,height:18})})]})}import{jsx as os,jsxs as Ix}from"react/jsx-runtime";function wi({src:e,name:t,minZoom:r=.2,maxZoom:n=5,showToolbar:o=!0,toolbarProps:i,children:a}){let[s,l]=ns({x:0,y:0}),[h,d]=ns(1),[w,p]=ns(0),[m,x]=ns(!1),y=()=>d(g=>Math.min(n,Math.round((g+.25)*100)/100)),b=()=>d(g=>Math.max(r,Math.round((g-.25)*100)/100)),k=()=>p(g=>(g+90)%360),T=()=>p(g=>(g-90+360)%360),v=()=>x(g=>!g),u=()=>{l({x:0,y:0}),d(1),p(0),x(!1)},c={src:e,name:t};return e?Ix("div",{className:"flex flex-col w-full select-none overflow-hidden",children:[os("div",{className:"relative w-full h-90 sm:h-105 md:h-115 overflow-hidden bg-neutral-50/70 select-none",children:os(zx,{image:e,crop:s,zoom:h,rotation:w,minZoom:r,maxZoom:n,zoomSpeed:.5,restrictPosition:!1,showGrid:!1,objectFit:"contain",onCropChange:l,onZoomChange:d,onRotationChange:p,classes:{mediaClassName:m?"scale-x-[-1]":""},style:{containerStyle:{position:"relative",width:"100%",height:"100%",backgroundColor:"transparent"},cropAreaStyle:{display:"none"},mediaStyle:{cursor:"grab"}}})}),o&&os("div",{className:"w-full flex items-center justify-center py-2.5 sm:py-3 border-t border-neutral-200 bg-neutral-white z-20 overflow-x-auto ui-scrollbar px-2 shrink-0",children:os(yi,{zoom:h,minZoom:r,maxZoom:n,onZoomChange:d,rotation:w,isFlipped:m,onZoomIn:y,onZoomOut:b,onRotateCw:k,onRotateCcw:T,onFlipHorizontal:v,onReset:u,currentImage:c,...i})}),a]}):null}import{jsx as Mn,jsxs as tf}from"react/jsx-runtime";function Fr({onDownload:e,imageProps:t,className:r=""}){let n=rs(),o=n?.file,i=n?.headerTitle,[a,s]=Fx("");Mx(()=>{if(!o){s("");return}if(!(o instanceof File)){let p=Mr(o);s(p.serverFile?.src||"");return}let w=URL.createObjectURL(o);return s(w),()=>{URL.revokeObjectURL(w)}},[o]);let l=Mr(o),h=(typeof i=="string"?i:"")||l.name||"file",d=()=>{e&&o&&e(o),a&&kr(a,h)};return l.type==="image"?Mn(wi,{src:a,name:h,...t}):tf("div",{className:`p-6 text-center ${r}`,children:[Mn("div",{className:"w-16 h-16 rounded-2xl bg-neutral-100 flex items-center justify-center mx-auto mb-4 text-primary-600",children:Mn(br,{width:32,height:32})}),Mn("h3",{className:"text-lg font-semibold text-neutral-900 truncate mb-1",title:h,children:i??h}),Mn("p",{className:"text-sm text-neutral-500 mb-6",children:"\u0110\u1ECBnh d\u1EA1ng file ch\u01B0a h\u1ED7 tr\u1EE3 xem tr\u1EF1c ti\u1EBFp. B\u1EA1n c\xF3 th\u1EC3 t\u1EA3i file v\u1EC1 \u0111\u1EC3 xem."}),tf("button",{type:"button",onClick:d,className:"inline-flex items-center justify-center gap-2 w-full py-2.5 px-4 bg-primary-600 hover:bg-primary-500 text-white font-medium rounded-xl transition-colors shadow-md cursor-pointer",children:[Mn(br,{width:18,height:18}),Mn("span",{children:"T\u1EA3i xu\u1ED1ng file"})]})]})}import{useMemo as Ux}from"react";var rf=250,an={xs:{dialog:"max-w-[320px] p-3 gap-1.5",header:"gap-1.5",body:"text-xs",footer:"gap-1.5 pt-1.5",title:"text-sm font-semibold leading-tight text-neutral-900",description:"text-xs leading-normal text-neutral-600",buttonGap:"gap-1.5",closeButton:"size-5 p-0.5 -mr-1 -mt-1",closeIcon:"size-3.5"},sm:{dialog:"max-w-[400px] p-3.5 gap-2",header:"gap-2",body:"text-sm",footer:"gap-2 pt-2",title:"text-base font-semibold leading-tight text-neutral-900",description:"text-sm leading-normal text-neutral-600",buttonGap:"gap-2",closeButton:"size-6 p-0.5 -mr-1 -mt-1",closeIcon:"size-4"},md:{dialog:"max-w-[540px] p-4 gap-2.5",header:"gap-2.5",body:"text-sm",footer:"gap-2 pt-2",title:"text-lg font-semibold leading-tight text-neutral-900",description:"text-sm leading-relaxed text-neutral-600",buttonGap:"gap-2.5",closeButton:"size-7 p-1 -mr-1 -mt-1",closeIcon:"size-4"},lg:{dialog:"max-w-[720px] p-4.5 gap-3",header:"gap-3",body:"text-base",footer:"gap-2.5 pt-2.5",title:"text-xl font-bold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",buttonGap:"gap-3",closeButton:"size-8 p-1 -mr-1 -mt-1",closeIcon:"size-4.5"},xl:{dialog:"max-w-[960px] p-5 gap-3.5",header:"gap-3.5",body:"text-base",footer:"gap-3 pt-3",title:"text-2xl font-bold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",buttonGap:"gap-3.5",closeButton:"size-8 p-1 -mr-1 -mt-1",closeIcon:"size-5"},full:{dialog:"max-w-[calc(100vw-2rem)] w-full h-[calc(100vh-2rem)] p-4 gap-2.5",header:"gap-2.5",body:"text-base",footer:"gap-2 pt-2",title:"text-2xl font-bold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",buttonGap:"gap-2.5",closeButton:"size-8 p-1 -mr-1 -mt-1",closeIcon:"size-4.5"}},nf={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"};import{createContext as Ex,useContext as $x}from"react";var nc=Ex(null),er=()=>$x(nc);import{jsx as Lx}from"react/jsx-runtime";function Fn({size:e,radius:t,className:r="",children:n,ref:o,...i}){let a=er(),s=C(e??a?.size,an,"md"),l=C(t,nf,"lg"),h=["relative flex flex-col w-full bg-neutral-white shadow-2xl border-2 border-neutral-200 outline-none text-neutral-900 pointer-events-auto",s.dialog,l,r].filter(Boolean).join(" ");return Lx("div",{ref:o,tabIndex:-1,className:h,...i,children:n})}import{useEffect as is,useEffectEvent as Bx,useCallback as Hx,useMemo as Vx,useRef as of,useState as Ax}from"react";import{jsx as oc,jsxs as Ox}from"react/jsx-runtime";function En({open:e=!1,id:t,size:r,isLoading:n=!1,closeOnOverlayClick:o=!0,closeOnEsc:i=!0,lockScroll:a=!0,overlayClassName:s="",className:l="",children:h,onClose:d,...w}){let p=of(null),[m,x]=Ax(!1),y=of(null),b=Hx(()=>{m||n||(x(!0),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{x(!1),d?.()},rf))},[m,n,d]),k=Vx(()=>({onClose:b,isLoading:n,size:r}),[b,n,r]);is(()=>()=>{y.current&&clearTimeout(y.current)},[]),is(()=>{let g=p.current;if(g)if(e||m){if(!g.open)try{g.showModal()}catch{}}else g.open&&g.close()},[e,m]),is(()=>{if(!a)return;let g=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=g}},[a]);let T=Bx(g=>{!e||i===!1||g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),b())});if(is(()=>(window.addEventListener("keydown",T),()=>{window.removeEventListener("keydown",T)}),[]),!e&&!m)return null;let v=()=>{o&&b()},u=m?"animate-modal-backdrop-out pointer-events-none":"animate-modal-backdrop-in",c=m?"animate-modal-out pointer-events-none":"animate-modal-in";return oc(nc.Provider,{value:k,children:Ox("dialog",{id:t,ref:p,"aria-labelledby":"modal-dialog-title","aria-describedby":"modal-dialog-description",onCancel:g=>{g.preventDefault(),i!==!1&&b()},className:`fixed inset-0 flex items-center justify-center p-4 bg-neutral-950/40 backdrop-blur-xs border-none m-0 max-w-none max-h-none w-screen h-screen overflow-visible backdrop:bg-transparent ${u} ${s}`,...w,children:[oc("div",{"aria-hidden":"true",onClick:v,className:"fixed inset-0 -z-10"}),oc("div",{className:`w-full flex items-center justify-center pointer-events-none ${c} ${l}`,children:h})]})})}import{jsx as as,jsxs as af}from"react/jsx-runtime";function $n({size:e,title:t,description:r,titleClassName:n="",descriptionClassName:o="",showCloseButton:i=!0,onClose:a,closeButtonClassName:s="",className:l="",children:h,...d}){let w=er(),p=C(e??w?.size,an,"md"),m=w?.isLoading,x=()=>{a?.(),w?.onClose?.()},y=!!(a||w?.onClose);return af("div",{className:`flex items-start justify-between w-full border-b border-neutral-100 pb-2 ${p.header} ${l}`,...d,children:[af("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[t&&as("h3",{id:"modal-dialog-title",className:`${p.title} truncate ${n}`,children:t}),r&&as("p",{id:"modal-dialog-description",className:`${p.description} mt-0.5 ${o}`,children:r}),h]}),i&&y&&as("button",{type:"button",onClick:x,disabled:m,"aria-label":"\u0110\xF3ng h\u1ED9p tho\u1EA1i","data-testid":"modal-close-button",className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-700 hover:bg-neutral-100 rounded-md transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-neutral-400 ${p.closeButton} ${s}`,children:as(Oe,{className:p.closeIcon})})]})}import{jsx as Gx}from"react/jsx-runtime";function Ln({size:e,className:t="",children:r,...n}){let o=er(),i=C(e??o?.size,an,"md");return Gx("div",{className:`w-full max-h-[calc(100vh-8rem)] overflow-y-auto ui-scrollbar ${i.body} ${t}`,...n,children:r})}import{jsx as Ci,jsxs as jx}from"react/jsx-runtime";function cr({open:e=!1,onClose:t,file:r,title:n,description:o,size:i="lg",radius:a="xl",showCloseButton:s=!0,closeOnOverlayClick:l=!0,closeOnEsc:h=!0,lockScroll:d=!0,className:w="",overlayClassName:p="",children:m}){let x=Mr(r),y=n??x?.name,b=Ux(()=>({file:r,headerTitle:y}),[r,y]);return Ci(En,{open:e,onClose:t,size:i,closeOnOverlayClick:l,closeOnEsc:h,lockScroll:d,overlayClassName:p,children:jx(Fn,{size:i,radius:a,"data-testid":"image-preview-modal",className:`bg-neutral-white border border-neutral-200 text-neutral-900 shadow-2xl overflow-hidden p-0 ${w}`,children:[(y||s)&&Ci($n,{title:y,description:o,showCloseButton:s,className:"px-5 py-3.5 border-b border-neutral-200 shrink-0"}),Ci(Ln,{className:"p-0 overflow-hidden flex flex-col flex-1 min-h-0",children:Ci(rc.Provider,{value:b,children:m||Ci(Fr,{})})})]})})}import{useState as ki,useEffect as Yx,useMemo as Wx}from"react";import Kx from"next/image";import{Fragment as _x,jsx as So,jsxs as sf}from"react/jsx-runtime";function Er({src:e,alt:t="",width:r,height:n,fill:o,skeletonVariant:i="pulse",radius:a="md",objectFit:s="cover",preview:l=!0,className:h="",wrapperClassName:d="",style:w,wrapperStyle:p,onLoad:m,onError:x,onClick:y,ref:b,...k}){let[T,v]=ki(!1),[u,c]=ki(!1),[g,f]=ki(null),[S,D]=ki(!1),R=$c(e),[P,I]=ki(R),E=typeof Blob<"u"&&(e instanceof File||e instanceof Blob),N=Ql(e)?e:void 0,M=N?.src,z=E?g:N?M:e,H=E||!!N||typeof z=="string"&&(/^(?:https?:)?\/\//.test(z)||z.startsWith("data:")||z.startsWith("blob:")),V=t||N?.name||"";R!==P&&(I(R),v(!1),c(!1)),Yx(()=>{if(!(e instanceof File||e instanceof Blob)){f(null);return}let ne=URL.createObjectURL(e);return f(ne),()=>URL.revokeObjectURL(ne)},[e]);let Y=Wx(()=>{if(z)return e instanceof File?e:N?{...N,src:N.src,name:V||"image",type:"image"}:{src:typeof z=="string"?z:z?.src,name:V||"image",type:"image"}},[e,z,N,V]),$=C(a,Fc,"md"),F=C(s,Ec,"cover"),G=ne=>{v(!0),m?.(ne)},A=ne=>{c(!0),v(!1),x?.(ne)},U=ne=>{y?.(ne),!ne.defaultPrevented&&l&&T&&!u&&Y&&D(!0)},B=!!(l&&T&&!u||y),X=ne=>{(ne.key==="Enter"||ne.key===" ")&&(ne.preventDefault(),U(ne))},le={...o?{}:{width:r,height:n},...p};return sf(_x,{children:[sf("div",{ref:b,role:B?"button":void 0,tabIndex:B?0:void 0,onClick:U,onKeyDown:X,className:["relative overflow-hidden inline-block",$,B?"cursor-pointer":"",d].filter(Boolean).join(" "),style:le,children:[!T&&!u&&So(jn,{variant:i,radius:a,width:"100%",height:"100%",style:{position:"absolute",inset:0}}),z?So(Kx,{src:z,alt:V,width:o?void 0:r,height:o?void 0:n,fill:o,unoptimized:H?!0:k.unoptimized,className:["block w-full h-full transition-opacity duration-200",F,$,T?"opacity-100":"opacity-0",h].filter(Boolean).join(" "),style:w,onLoad:G,onError:A,...k}):null,u&&So("div",{role:"img","aria-label":"Image failed to load",className:["absolute inset-0 flex items-center justify-center","bg-neutral-100 text-neutral-400"].join(" "),children:So(ra,{width:24,height:24,"aria-hidden":"true"})})]}),S&&Y&&So(cr,{open:S,onClose:()=>D(!1),file:Y,title:V||"Xem \u1EA3nh",children:So(Fr,{})})]})}import{Fragment as Xx,jsx as yt,jsxs as To}from"react/jsx-runtime";function Si({size:e="md",color:t="primary",variant:r="outline",radius:n,shape:o="rectangle",objectFit:i="contain",disabled:a,readOnly:s,isLoading:l,dragStatus:h="idle",isInvalid:d,dropzoneTitle:w,dropzoneDescription:p,icon:m,item:x,onRemove:y,onPreview:b,onTriggerUpload:k,getRootProps:T,className:v="",describedById:u}){let c=C(e,Co,"md"),g=C(n,_a,"md"),f=o==="square"?"aspect-square w-full":C(e,W0,"md"),S=d?"error":t,D=r!=="other"?C(r,K0,"outline"):null,R=D?C(S,D,"primary"):null,P="K\xE9o th\u1EA3 h\xECnh \u1EA3nh v\xE0o \u0111\xE2y, ho\u1EB7c nh\u1EA5n \u0111\u1EC3 duy\u1EC7t file",I="H\u1ED7 tr\u1EE3 \u0111\u1ECBnh d\u1EA1ng PNG, JPG, WEBP, GIF",E=h==="active",N=h==="reject",M=E,z=N?"border-error-500 bg-error-50/50 ring-2 ring-error-500/20 text-error-900":M?R?.active||"border-primary-500 bg-primary-50 ring-2 ring-primary-500/20":R?.idle||"border-neutral-300 bg-neutral-50/50 hover:border-primary-500 hover:bg-primary-50/30",H=x?`group relative w-full ${f} ${g} overflow-hidden border-2 transition-colors duration-150 ease-in-out cursor-pointer select-none ${M?"border-dashed "+z:"border-solid border-neutral-200 hover:border-primary-400"} ${a?"opacity-50 cursor-not-allowed pointer-events-none":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${v}`:`group relative w-full ${o==="square"?"aspect-square w-full":c.dropzoneHeight} ${c.dropzonePadding} ${g} border-2 border-dashed flex flex-col items-center justify-center text-center transition-colors duration-150 ease-in-out cursor-pointer ${z} ${a?"opacity-50 cursor-not-allowed pointer-events-none bg-neutral-100":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${v}`,V=ct(x),Y={role:"button",tabIndex:a?-1:0,"aria-label":x?`H\xECnh \u1EA3nh \u0111\xE3 t\u1EA3i l\xEAn: ${V}. Nh\u1EA5n \u0111\u1EC3 xem tr\u01B0\u1EDBc, ho\u1EB7c d\xF9ng n\xFAt \u1EDF g\xF3c ph\u1EA3i \u0111\u1EC3 thay \u0111\u1ED5i ho\u1EB7c x\xF3a \u1EA3nh.`:"Khu v\u1EF1c k\xE9o th\u1EA3 v\xE0 t\u1EA3i \u1EA3nh l\xEAn","aria-disabled":a,"aria-invalid":d,"aria-describedby":u,"aria-busy":l,className:H,onClick:()=>{a||l||x&&b?.()},onKeyDown:F=>{a||l||(F.key==="Enter"||F.key===" ")&&x&&(F.preventDefault(),b?.())}},$=T?T(Y):Y;return yt("div",{...$,children:x?To(Xx,{children:[yt(Er,{src:x,alt:V,fill:!0,radius:n??"md",objectFit:i,preview:!1,wrapperClassName:"w-full h-full"}),!l&&!a&&To("div",{className:"absolute top-2.5 right-2.5 flex items-center gap-1.5 z-10",children:[!s&&yt("button",{type:"button",onClick:F=>{F.stopPropagation(),k?.()},"aria-label":"Thay \u0111\u1ED5i \u1EA3nh",title:"Thay \u0111\u1ED5i \u1EA3nh",className:"p-1.5 rounded-lg bg-neutral-900/60 hover:bg-neutral-900/80 text-neutral-white backdrop-blur-xs transition-colors shadow-xs cursor-pointer focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden","data-testid":"dropzone-replace-button",children:yt(Lt,{width:16,height:16})}),!s&&yt("button",{type:"button",onClick:F=>{F.stopPropagation(),y?.()},"aria-label":"X\xF3a \u1EA3nh",title:"X\xF3a \u1EA3nh",className:"p-1.5 rounded-lg bg-neutral-900/60 hover:bg-error-600 text-neutral-white backdrop-blur-xs transition-colors shadow-xs cursor-pointer focus-visible:ring-2 focus-visible:ring-error-500 focus-visible:outline-hidden","data-testid":"dropzone-remove-button",children:yt(ir,{width:16,height:16})})]}),l&&To("div",{className:"absolute inset-0 bg-neutral-950/60 flex flex-col items-center justify-center text-neutral-white z-20",children:[yt(Ne,{width:c.iconSize*.8,height:c.iconSize*.8,className:"animate-spin"}),yt("span",{className:`${c.titleSize} font-medium mt-1`,children:"\u0110ang x\u1EED l\xFD h\xECnh \u1EA3nh..."})]}),M&&To("div",{className:"absolute inset-0 bg-primary-950/50 backdrop-blur-xs flex flex-col items-center justify-center text-neutral-white z-20 transition-opacity",children:[yt(Nt,{width:c.iconSize,height:c.iconSize,className:"animate-bounce"}),yt("span",{className:`${c.titleSize} font-medium mt-1`,children:"Th\u1EA3 h\xECnh \u1EA3nh \u0111\u1EC3 thay th\u1EBF"})]})]}):l?To("div",{className:`flex flex-col items-center justify-center gap-2 ${R?.iconColor||"text-primary-600"}`,children:[yt(Ne,{width:c.iconSize*.8,height:c.iconSize*.8}),yt("span",{className:`${c.titleSize} font-medium`,children:"\u0110ang x\u1EED l\xFD h\xECnh \u1EA3nh..."})]}):To("div",{className:"flex flex-col items-center justify-center gap-2",children:[yt("div",{className:`transition-colors ${R?.iconColor||"text-primary-500"}`,children:m||yt(Nt,{width:c.iconSize,height:c.iconSize})}),yt("div",{className:`${c.titleSize} font-medium text-neutral-800 ${R?.titleHover||"group-hover:text-primary-600"} transition-colors`,children:w??P}),yt("div",{id:u,className:`${c.descSize} text-neutral-500`,children:p??I})]})})}import{jsx as $r,jsxs as ic}from"react/jsx-runtime";function Bn({items:e,size:t,radius:r,objectFit:n="cover",disabled:o,readOnly:i,maxCount:a,onRemove:s,onPreview:l,onTriggerUpload:h,renderItem:d,showAddButton:w=!0,className:p=""}){let m=C(t,Co,"md"),x=C(r,_a,"md"),y=!a||e.length<a;return ic("ul",{"aria-label":"Danh s\xE1ch h\xECnh \u1EA3nh \u0111\xE3 t\u1EA3i l\xEAn",className:`flex flex-wrap items-center list-none p-0 m-0 ${m.gap} ${p}`,children:[e.map((b,k)=>{let T=ct(b),v=typeof b=="object"&&b&&"id"in b&&b.id?String(b.id):b instanceof File?`${b.name}-${b.size}-${b.lastModified}`:typeof b=="string"?b:b?.src||T;return d?$r("li",{"data-testid":"upload-image-item",className:"list-none",children:d(b,k,{remove:()=>s(b,k),preview:()=>l(b)})},v):ic("li",{"data-testid":"upload-image-item",tabIndex:o?-1:0,"aria-label":`H\xECnh \u1EA3nh ${T}`,onKeyDown:u=>{o||i||(u.key==="Delete"||u.key==="Backspace")&&(u.preventDefault(),s(b,k))},className:`group relative list-none ${m.thumbnailSize} ${x} border-2 overflow-hidden flex items-center justify-center bg-neutral-100 border-neutral-200 transition-colors duration-150 ease-in-out focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden`,children:[$r(Er,{src:b,alt:T,width:80,height:80,radius:r,objectFit:n,unoptimized:!0,preview:!1,className:"w-full h-full",wrapperClassName:"w-full h-full"}),!o&&ic("div",{className:"absolute inset-0 bg-neutral-900/40 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity duration-150 flex items-center justify-center gap-1.5 p-1",children:[l&&$r("button",{type:"button",onClick:u=>{u.stopPropagation(),l(b)},"aria-label":`Preview image ${T}`,title:"Xem tr\u01B0\u1EDBc",className:"p-1 rounded-md text-neutral-white hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-primary-400 focus-visible:outline-hidden transition-colors cursor-pointer",children:$r(Lr,{width:16,height:16})}),!i&&$r("button",{type:"button",onClick:u=>{u.stopPropagation(),s(b,k)},"aria-label":`Remove image ${T}`,title:"X\xF3a \u1EA3nh",className:"p-1 rounded-md text-error-300 hover:text-error-200 hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-error-400 focus-visible:outline-hidden transition-colors cursor-pointer",children:$r(ir,{width:16,height:16})})]})]},v)}),w&&y&&!i&&$r("li",{className:"list-none",children:$r("button",{type:"button",disabled:o,onClick:h,"aria-label":"Add image",title:"Th\xEAm h\xECnh \u1EA3nh",className:`${m.thumbnailSize} ${x} border-2 border-dashed border-neutral-300 hover:border-primary-500 hover:bg-primary-50/40 text-neutral-400 hover:text-primary-600 flex flex-col items-center justify-center transition-colors duration-150 ease-in-out cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden`,children:$r(pr,{width:m.iconSize*.5,height:m.iconSize*.5})})})]})}import{Fragment as Jx,jsx as Ot,jsxs as Ti}from"react/jsx-runtime";function ac({value:e,defaultValue:t,onChange:r,onRemove:n,onPreview:o,multiple:i=!1,maxCount:a,maxSize:s,accept:l="image/*",beforeUpload:h,viewMode:d="dropzone",shape:w="rectangle",objectFit:p,size:m="md",color:x="primary",variant:y="outline",radius:b,label:k,isRequired:T=!1,labelClassName:v="",helperText:u,errorMessage:c,isInvalid:g,disabled:f=!1,readOnly:S=!1,isLoading:D=!1,dropzoneTitle:R,dropzoneDescription:P,icon:I,buttonText:E="T\u1EA3i \u1EA3nh l\xEAn",renderItem:N,className:M="",dropzoneClassName:z="",previewClassName:H="",helperClassName:V=""}){let Y=qx(),$=`${Y}-input`,F=`${Y}-error-helper`,G=e!==void 0,[A,U]=ss(()=>In(t)),B=lf(()=>G?In(e):A,[G,e,A]),[X,le]=ss(null),[ne,ue]=ss(null),[ie,Q]=ss(""),q=C(m,Co,"md"),ge=b??"md",ke=!!(g||c||X),L=c||X,Z=ke?"text-error-600":C(ke?"error":x,Y0,"primary"),he=a??(i?void 0:1),ae=!i||he===1,ve=ae&&B.length===1?B[0]:null,Se=xe=>{G||U(xe),r?.(xe)},ye=lf(()=>vi(l),[l]),J=d==="dropzone"&&!!ve,{getRootProps:O,getInputProps:W,isDragActive:we,isDragReject:fe,open:se}=Zx({multiple:i,maxSize:s,accept:ye,disabled:f||S||D,noClick:d!=="dropzone"||J,noKeyboard:d!=="dropzone"||J,onDropAccepted:async xe=>{if(f||S||(le(null),xe.length===0))return;let re=xe,de=B.length;if(he!==void 0)if(i){let j=he-de;if(j<=0){let Ce=`Maximum allowed image count reached (${he} images)`;le(Ce),Q(Ce);return}re=xe.slice(0,j)}else{let j=xe[0];if(!j)return;re=[j]}let ce=await Promise.all(re.map(async j=>{if(h)try{let Ce=await h(j);if(Ce===!1||typeof Ce=="string")return{file:null,error:typeof Ce=="string"?Ce:`File ${j.name} was rejected`}}catch(Ce){return{file:null,error:Ce instanceof Error?Ce.message:`Kh\xF4ng th\u1EC3 x\u1EED l\xFD t\u1EC7p ${j.name}`}}return{file:j,error:null}})),ee=[];for(let j of ce)j.error?(le(j.error),Q(`L\u1ED7i: ${j.error}`)):j.file&&ee.push(j.file);if(ee.length>0){let j=i?[...B,...ee]:ee;Se(j),Q(`T\u1EA3i l\xEAn th\xE0nh c\xF4ng ${ee.length} h\xECnh \u1EA3nh. T\u1ED5ng c\u1ED9ng: ${j.length}.`)}},onDropRejected:xe=>{let re=xe[0]?.errors[0];if(!re)return;let de=re.message||"T\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7";re.code==="file-too-large"?de=`K\xEDch th\u01B0\u1EDBc t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n t\u1ED1i \u0111a (${wr(s||0)})`:re.code==="file-invalid-type"?de=`\u0110\u1ECBnh d\u1EA1ng t\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7. C\xE1c \u0111\u1ECBnh d\u1EA1ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3: ${typeof l=="string"?l:Object.keys(l||{}).join(", ")}`:re.code==="too-many-files"&&(de=`S\u1ED1 l\u01B0\u1EE3ng h\xECnh \u1EA3nh v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n cho ph\xE9p (${he} h\xECnh \u1EA3nh)`),le(de),Q(`L\u1ED7i t\u1EC7p: ${de}`)}}),me=(xe,re)=>{if(f||S)return;let de=B.filter((ce,ee)=>ee!==re);Se(de),n?.(xe,re),Q(`\u0110\xE3 x\xF3a h\xECnh \u1EA3nh ${ct(xe)}`)},De=xe=>{ue(xe),o?.(xe)};return Ti("div",{className:`group/field relative flex flex-col w-full ${M}`,children:[Ot("input",{...W({id:$,disabled:f||D,"aria-hidden":!0,tabIndex:-1,className:"hidden"})}),Ot("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:ie}),k&&Ti("label",{htmlFor:$,className:`block font-medium transition-colors duration-150 ${q.labelSize} ${Z} ${v}`,children:[k,T&&Ot("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),Ti("div",{className:"flex flex-col gap-3",children:[d==="dropzone"&&Ti(Jx,{children:[Ot(Si,{size:m,color:x,variant:y,radius:ge,shape:w,objectFit:p,disabled:f,readOnly:S,isLoading:D,dragStatus:fe?"reject":we?"active":"idle",isInvalid:ke,dropzoneTitle:R,dropzoneDescription:P,icon:I,item:ve,onRemove:()=>ve&&me(ve,0),onPreview:()=>ve&&De(ve),getRootProps:O,onTriggerUpload:se,className:z,describedById:L||u?F:void 0}),!ae&&B.length>0&&Ot(Bn,{items:B,size:m,color:x,variant:y,radius:ge,objectFit:p,disabled:f,readOnly:S,maxCount:he,onRemove:me,onPreview:De,onTriggerUpload:se,renderItem:N,showAddButton:!1,className:H})]}),d==="card-grid"&&Ot("div",{...O({className:"w-full focus-visible:outline-hidden"}),children:Ot(Bn,{items:B,size:m,color:x,variant:y,radius:ge,objectFit:p,disabled:f,readOnly:S,maxCount:he,onRemove:me,onPreview:De,onTriggerUpload:se,renderItem:N,showAddButton:!0,className:H})}),d==="button"&&Ti("div",{className:"flex flex-col gap-3",children:[Ot("div",{className:"flex items-center gap-3",children:Ot(Ut,{type:"button",size:m,color:ke?"error":x==="neutral"?"secondary":x,variant:y==="other"?"filled":y,radius:b,disabled:f||S||he!==void 0&&B.length>=he,onClick:se,leftIcon:Ot(Nt,{width:q.iconSize*.5,height:q.iconSize*.5}),"aria-label":"T\u1EA3i \u1EA3nh l\xEAn",children:E})}),B.length>0&&Ot(Bn,{items:B,size:m,color:x,variant:y,radius:ge,objectFit:p,disabled:f,readOnly:S,maxCount:he,onRemove:me,onPreview:De,onTriggerUpload:se,renderItem:N,showAddButton:!1,className:H})]})]}),Ot($e,{id:F,helperText:u,errorMessage:ke?L:void 0,sizeClassName:q.helperSize,className:V}),ne&&Ot(cr,{open:!!ne,onClose:()=>ue(null),file:ne})]})}import{useId as tv,useMemo as rv,useState as Di}from"react";import{useDropzone as nv}from"react-dropzone";import{useMergeRefs as ov}from"@floating-ui/react";var cf={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},uf={xs:{avatarSize:"size-12",iconSize:20,iconClass:"size-5",label:"text-[11px] mb-1",helper:"text-[9px] mt-0.5",rounded:"rounded"},sm:{avatarSize:"size-16",iconSize:24,iconClass:"size-6",label:"text-xs mb-1",helper:"text-[10px] mt-0.5",rounded:"rounded-md"},md:{avatarSize:"size-20",iconSize:32,iconClass:"size-8",label:"text-sm mb-1.5",helper:"text-[11px] mt-1",rounded:"rounded-lg"},lg:{avatarSize:"size-24",iconSize:40,iconClass:"size-10",label:"text-base mb-1.5",helper:"text-xs mt-1",rounded:"rounded-xl"},xl:{avatarSize:"size-32",iconSize:52,iconClass:"size-12",label:"text-lg mb-2",helper:"text-sm mt-1",rounded:"rounded-2xl"}},df={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}},ff={primary:"text-primary-500 group-hover/avatar:text-primary-600",secondary:"text-secondary-500 group-hover/avatar:text-secondary-600",neutral:"text-neutral-400 group-hover/avatar:text-neutral-600",error:"text-error-500 group-hover/avatar:text-error-600",success:"text-success-500 group-hover/avatar:text-success-600",warning:"text-warning-500 group-hover/avatar:text-warning-600",info:"text-info-500 group-hover/avatar:text-info-600"},pf={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600",neutral:"text-neutral-500 group-focus-within/field:text-neutral-600"},gf={primary:"ring-2 ring-primary-500/40 border-primary-500 bg-primary-50/80",secondary:"ring-2 ring-secondary-500/40 border-secondary-500 bg-secondary-50/80",neutral:"ring-2 ring-neutral-500/40 border-neutral-500 bg-neutral-50/80",error:"ring-2 ring-error-500/40 border-error-500 bg-error-50/80",success:"ring-2 ring-success-500/40 border-success-500 bg-success-50/80",warning:"ring-2 ring-warning-500/40 border-warning-500 bg-warning-50/80",info:"ring-2 ring-info-500/40 border-info-500 bg-info-50/80"};function mf(e){if(!e)return;if(typeof e=="object")return e;let t={},r=e.split(",").map(n=>n.trim()).filter(Boolean);for(let n of r)if(n.startsWith(".")){let o=n.toLowerCase();o===".jpg"||o===".jpeg"?t["image/jpeg"]=[...t["image/jpeg"]||[],o]:o===".png"?t["image/png"]=[...t["image/png"]||[],o]:o===".webp"?t["image/webp"]=[...t["image/webp"]||[],o]:o===".gif"?t["image/gif"]=[...t["image/gif"]||[],o]:o===".svg"?t["image/svg+xml"]=[...t["image/svg+xml"]||[],o]:t["application/octet-stream"]=[...t["application/octet-stream"]||[],o]}else t[n]||(t[n]=[]);return t}import{useEffect as Qx,useRef as ls,useState as Hn}from"react";import ev from"react-easy-crop";function bf(e){return new Promise((t,r)=>{let n=new Image;n.addEventListener("load",()=>t(n)),n.addEventListener("error",o=>r(o)),n.setAttribute("crossOrigin","anonymous"),n.src=e})}function hf(e){return e*Math.PI/180}function xf(e,t,r){let n=hf(r);return{width:Math.abs(Math.cos(n)*e)+Math.abs(Math.sin(n)*t),height:Math.abs(Math.sin(n)*e)+Math.abs(Math.cos(n)*t)}}async function sc(e,t,r=0,n=!1,o="avatar-cropped.png",i="image/png"){let a=await bf(e),s=document.createElement("canvas"),l=s.getContext("2d");if(!l)throw new Error("No 2d context available on canvas");let h=hf(r),d=a.naturalWidth||a.width,w=a.naturalHeight||a.height,{width:p,height:m}=xf(d,w,r);s.width=p,s.height=m,l.translate(p/2,m/2),l.rotate(h),l.scale(n?-1:1,1),l.translate(-d/2,-w/2),l.drawImage(a,0,0);let x=document.createElement("canvas"),y=x.getContext("2d");if(!y)throw new Error("No 2d context for cropped canvas");return x.width=t.width,x.height=t.height,y.drawImage(s,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise((b,k)=>{x.toBlob(T=>{if(!T){k(new Error("Canvas is empty or failed to generate blob"));return}let v=new File([T],o,{type:i||"image/png"});b(v)},i||"image/png",.95)})}import{jsx as We,jsxs as lc}from"react/jsx-runtime";function cc({imageSrc:e="",file:t,fileName:r="avatar-cropped.png",fileType:n="image/png",aspectRatio:o=1,cropShape:i="round",showGrid:a=!0,minZoom:s=1,maxZoom:l=4,onApply:h,onCancel:d}){let w=ls(null),[p,m]=Hn(t??null),[x,y]=Hn(e),b=ls(t?.name||r),k=ls(t?.type||n),[T,v]=Hn({x:0,y:0}),[u,c]=Hn(1),[g,f]=Hn(0),[S,D]=Hn(!1),R=ls(null),[P,I]=Hn(!1);Qx(()=>{if(!p)return;let B=URL.createObjectURL(p);return y(B),()=>{URL.revokeObjectURL(B)}},[p]);let E=()=>c(B=>Math.min(l,Math.round((B+.2)*10)/10)),N=()=>c(B=>Math.max(s,Math.round((B-.2)*10)/10)),M=()=>f(B=>(B+90)%360),z=()=>f(B=>(B-90+360)%360),H=()=>D(B=>!B),V=()=>{v({x:0,y:0}),c(1),f(0),D(!1)},Y=()=>{w.current&&(w.current.value="",w.current.click())},$=B=>{if(B.target.files&&B.target.files[0]){let X=B.target.files[0];b.current=X.name,k.current=X.type||"image/png",m(X),V()}},F=(B,X)=>{R.current=X},G=async()=>{if(R.current)try{I(!0);let B=await sc(x,R.current,g,S,b.current,k.current);h(B)}catch(B){console.error("Error cropping avatar:",B)}finally{I(!1)}},A=()=>{d?.()},U="p-1.5 rounded-full text-neutral-600 hover:text-neutral-900 hover:bg-neutral-200/70 transition-colors focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed shrink-0";return lc("div",{className:"flex flex-col w-full select-none","data-testid":"upload-avatar-crop-modal",children:[We("input",{ref:w,type:"file",accept:"image/*","aria-hidden":"true",tabIndex:-1,className:"hidden",onChange:$}),We("div",{className:"relative w-full h-80 md:h-95 bg-neutral-950 overflow-hidden select-none",children:We(ev,{image:x,crop:T,zoom:u,rotation:g,aspect:o,cropShape:i,showGrid:a,minZoom:s,maxZoom:l,onCropChange:v,onZoomChange:c,onRotationChange:f,onCropComplete:F,classes:{mediaClassName:S?"scale-x-[-1]":""},style:{containerStyle:{position:"relative",width:"100%",height:"100%"}}})}),We("div",{className:"w-full flex items-center justify-center py-2.5 px-3 bg-neutral-white border-t border-neutral-200 overflow-x-auto ui-scrollbar",children:lc("div",{className:"inline-flex items-center flex-nowrap shrink-0 gap-1 bg-neutral-50 border border-neutral-200 rounded-full px-2.5 py-1 shadow-xs text-neutral-700",children:[We("button",{type:"button",onClick:Y,"aria-label":"Ch\u1ECDn \u1EA3nh kh\xE1c",title:"Ch\u1ECDn \u1EA3nh kh\xE1c",className:`${U} text-neutral-700 hover:text-primary-600`,"data-testid":"avatar-crop-change-image-button",children:We(Nt,{width:16,height:16})}),We("div",{className:"w-px h-3.5 bg-neutral-300 my-auto mx-0.5 shrink-0"}),We("button",{type:"button",onClick:N,disabled:u<=s,"aria-label":"Thu nh\u1ECF",title:"Thu nh\u1ECF (-)",className:U,children:We(qn,{width:16,height:16})}),We("button",{type:"button",onClick:E,disabled:u>=l,"aria-label":"Ph\xF3ng to",title:"Ph\xF3ng to (+)",className:U,children:We(Xn,{width:16,height:16})}),We("button",{type:"button",onClick:z,title:"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3","aria-label":"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",className:U,children:We(Zn,{width:16,height:16})}),We("button",{type:"button",onClick:M,title:"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3","aria-label":"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",className:U,children:We(jr,{width:16,height:16})}),We("button",{type:"button",onClick:H,title:"L\u1EADt ngang","aria-label":"L\u1EADt ngang",className:U,children:We(Qn,{width:16,height:16})}),We("button",{type:"button",onClick:V,title:"\u0110\u1EB7t l\u1EA1i","aria-label":"\u0110\u1EB7t l\u1EA1i",className:U,children:We(Lt,{width:16,height:16})}),We("div",{className:"w-px h-3.5 bg-neutral-300 my-auto mx-0.5 shrink-0"}),We("button",{type:"button",onClick:A,"aria-label":"H\u1EE7y c\u1EAFt \u1EA3nh",title:"H\u1EE7y (Esc)",className:`${U} text-neutral-500 hover:text-error-600`,"data-testid":"avatar-crop-cancel-button",children:We(Oe,{width:16,height:16})}),We("button",{type:"button",onClick:G,disabled:P,"aria-label":"\xC1p d\u1EE5ng v\xE0 l\u01B0u \u1EA3nh \u0111\xE3 c\u1EAFt",title:"\xC1p d\u1EE5ng",className:"p-1.5 rounded-full bg-primary-600 hover:bg-primary-500 text-white shadow-xs transition-colors active:scale-95 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden shrink-0","data-testid":"avatar-crop-apply-button",children:P?We(Ne,{width:16,height:16}):We(Ar,{width:16,height:16})})]})})]})}function cs({open:e=!0,modalTitle:t="C\u1EAFt \u1EA3nh \u0111\u1EA1i di\u1EC7n",onClose:r,onCancel:n,onApply:o,...i}){let a=()=>{n?.(),r?.()};return We(En,{open:e,closeOnOverlayClick:!0,closeOnEsc:!0,onClose:a,children:lc(Fn,{size:"lg",radius:"xl",className:"bg-neutral-white border border-neutral-200 shadow-2xl overflow-hidden p-0",children:[We($n,{title:We("span",{className:"font-semibold text-neutral-900","data-testid":"avatar-crop-modal-title",children:t}),className:"px-5 py-3.5 border-b border-neutral-200",showCloseButton:!0}),We(Ln,{className:"p-0 overflow-hidden",children:We(cc,{...i,onApply:l=>{o(l),r?.()},onCancel:a})})]})})}import{jsx as ft,jsxs as Ri}from"react/jsx-runtime";function uc({size:e="md",variant:t="outline",color:r="primary",shape:n="circle",radius:o,value:i,defaultValue:a,onChange:s,onRemove:l,onPreview:h,onClear:d,maxSize:w,accept:p="image/*",crop:m=!0,label:x,labelPlacement:y="top",config:b,helperText:k,errorMessage:T,disabled:v=!1,readOnly:u=!1,icon:c,name:g,id:f,className:S="",wrapperClassName:D="",avatarClassName:R="",avatarWrapperClassName:P="",labelClassName:I="",helperClassName:E="",ref:N}){let{isRequired:M=!1,isInvalid:z=!1,isLoading:H=!1,showSpinner:V=!1,isClearable:Y=!1,isFullWidth:$=!1}=b??{},F=tv(),G=f||F,A=`${G}-error-helper`,U=i!==void 0,[B,X]=Di(a??null),le=U?i??null:B,ne=Mr(le),ue=ne.name,[ie,Q]=Di(null),[q,ge]=Di(!1),[ke,L]=Di(null),[te,Z]=Di(""),he=T||ke,ae=!!(z||he),ve=ae?"error":r,Se=C(e,uf,"md"),ye=n==="circle"?"rounded-full":C(o,cf,"md"),J=t==="other"?"":C(ve,C(t,df,"outline"),"primary"),O=C(ve,ff,"primary"),W=ae?"text-error-600 font-bold":C(ve,pf,"primary"),we=C(ve,gf,"primary"),fe=K=>{U||X(K),s?.(K)},se=m!==!1,me=typeof m=="object"?m:{},De=K=>{Q({file:K.file,imageSrc:K.imageSrc,fileName:ue||"avatar.png",fileType:ne.type||"image/png"})},xe=K=>{if(K?.stopPropagation(),!(v||u||H)&&le){let _=le;fe(null),l?.(_),d?.(),Z("\u0110\xE3 x\xF3a \u1EA3nh \u0111\u1EA1i di\u1EC7n.")}},re=K=>{K?.stopPropagation(),le&&(ge(!0),h?.(le))},de=K=>{K?.stopPropagation(),le&&(ne.file?De({file:ne.file}):ne.serverFile?.src&&De({imageSrc:ne.serverFile.src}))},{getRootProps:ce,getInputProps:ee,isDragActive:j,isDragReject:Ce,inputRef:Ee}=nv({multiple:!1,maxSize:w,accept:rv(()=>mf(p),[p]),disabled:v||u||H,onDropAccepted:([K])=>{K&&(L(null),se?De({file:K}):(fe(K),Z("T\u1EA3i \u1EA3nh \u0111\u1EA1i di\u1EC7n th\xE0nh c\xF4ng.")))},onDropRejected:K=>{let _=K[0]?.errors[0],ze=_?.code==="file-too-large"?`Dung l\u01B0\u1EE3ng t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n${w?` ${(w/(1024*1024)).toFixed(1)}MB`:""}.`:_?.code==="file-invalid-type"?"\u0110\u1ECBnh d\u1EA1ng t\u1EC7p kh\xF4ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3.":_?.message||"T\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7.";L(ze),Z(`L\u1ED7i t\u1EC7p: ${ze}`)}}),Fe=ov([Ee,N]),oe=K=>{v||u||H||le&&(K.key==="Delete"||K.key==="Backspace")&&(K.preventDefault(),K.stopPropagation(),xe())},Te=()=>x?Ri("label",{htmlFor:G,className:`inline-flex items-center font-bold transition-colors duration-150 ${Se.label} ${W} ${I}`,children:[x,M&&ft("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):null,Pe="group/avatar relative flex items-center justify-center transition-colors duration-150 ease-in-out border-2 overflow-hidden select-none",_e=v?"opacity-50":"cursor-pointer",Ue=Ce?"ring-2 ring-error-500/40 border-error-500 bg-error-50/80":j?we:"",Le=[Pe,Se.avatarSize,ye,J,_e,Ue,R||P].filter(Boolean).join(" ");return Ri("div",{className:`group/field flex ${y==="left"?"flex-row items-center gap-3":"flex-col"} ${$?"w-full":"inline-flex"} ${D||S}`,children:[ft("input",{...ee({id:G,name:g,disabled:v||H,"aria-hidden":!0,tabIndex:-1,className:"hidden"}),ref:Fe}),ft("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:te}),Te(),Ri("div",{className:`flex flex-col ${$?"w-full":""}`,children:[Ri("div",{...ce({role:"button",tabIndex:v||H?-1:0,"aria-label":"T\u1EA3i l\xEAn \u1EA3nh \u0111\u1EA1i di\u1EC7n","aria-disabled":v||H,"aria-invalid":ae,"aria-required":M,"aria-describedby":T||k||ke?A:void 0,"aria-busy":H,onKeyDown:oe,className:Le}),children:[le?ft(Er,{src:le,alt:ue||"Avatar",fill:!0,radius:n==="circle"?"full":o,preview:!1,className:"object-cover",wrapperClassName:"w-full h-full"}):ft("div",{className:`flex flex-col items-center justify-center transition-colors ${O} ${Se.iconClass}`,children:c||ft(aa,{width:Se.iconSize,height:Se.iconSize})}),H&&V&&ft("div",{className:"absolute inset-0 bg-neutral-950/60 flex items-center justify-center text-neutral-white z-20",role:"status","aria-label":"\u0110ang t\u1EA3i",children:ft(Ne,{width:Se.iconSize,height:Se.iconSize,className:"animate-spin"})}),!H&&!v&&le&&Ri("div",{className:"absolute inset-0 bg-neutral-950/20 opacity-0 group-hover/avatar:opacity-100 group-focus-visible/avatar:opacity-100 transition-opacity flex items-center justify-center gap-1.5 text-neutral-white z-10",children:[ft("button",{type:"button",onClick:re,"aria-label":"Xem tr\u01B0\u1EDBc \u1EA3nh \u0111\u1EA1i di\u1EC7n",title:"Xem tr\u01B0\u1EDBc",className:"p-1 rounded-full text-neutral-white hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-neutral-white focus-visible:outline-hidden cursor-pointer","data-testid":"avatar-preview-button",children:ft(Lr,{width:14,height:14})}),se&&!u&&ft("button",{type:"button",onClick:de,"aria-label":"C\u1EAFt \u1EA3nh \u0111\u1EA1i di\u1EC7n",title:"C\u1EAFt \u1EA3nh",className:"p-1 rounded-full text-neutral-white hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-neutral-white focus-visible:outline-hidden cursor-pointer","data-testid":"avatar-crop-button",children:ft(na,{width:14,height:14})}),(!u||Y)&&ft("button",{type:"button",onClick:xe,"aria-label":"X\xF3a \u1EA3nh \u0111\u1EA1i di\u1EC7n",title:"X\xF3a \u1EA3nh",className:"p-1 rounded-full text-error-300 hover:text-error-200 hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-error-400 focus-visible:outline-hidden cursor-pointer","data-testid":"avatar-remove-button",children:ft(ir,{width:14,height:14})})]})]}),ft($e,{id:A,helperText:k,errorMessage:he,sizeClassName:Se.helper,className:E}),se&&ie&&ft(cs,{open:!!ie,file:ie.file,imageSrc:ie.imageSrc,fileName:ie.fileName,fileType:ie.fileType,aspectRatio:me.aspectRatio??1,cropShape:me.cropShape??(n==="circle"?"round":"rect"),showGrid:me.showGrid??!0,minZoom:me.minZoom??1,maxZoom:me.maxZoom??4,modalTitle:me.modalTitle||"C\u1EAFt \u1EA3nh \u0111\u1EA1i di\u1EC7n",onClose:()=>Q(null),onApply:K=>{fe(K),Z("\u1EA2nh \u0111\u1EA1i di\u1EC7n \u0111\xE3 \u0111\u01B0\u1EE3c c\u1EADp nh\u1EADt th\xE0nh c\xF4ng."),Q(null)}}),q&&le&&ft(cr,{open:q,onClose:()=>ge(!1),file:le,title:ue||"Xem tr\u01B0\u1EDBc \u1EA3nh \u0111\u1EA1i di\u1EC7n",children:ft(Fr,{imageProps:{minZoom:.5,maxZoom:4,toolbarProps:{tools:{rotate:!0,flip:!0,download:!0}}}})})]})]})}import{useId as av,useMemo as wf,useState as ds}from"react";import{useDropzone as sv}from"react-dropzone";import{jsx as tr,jsxs as us}from"react/jsx-runtime";function Do({size:e="md",color:t="primary",variant:r="outline",radius:n,shape:o="rectangle",compact:i=!1,disabled:a=!1,readOnly:s=!1,isLoading:l=!1,showSpinner:h=!1,dragStatus:d="idle",isInvalid:w=!1,dropzoneTitle:p,dropzoneDescription:m,icon:x,onTriggerUpload:y,getRootProps:b,className:k="",describedById:T}){let v=C(e,Cr,"md"),u=C(n,Xa,"md"),c=w?"error":t,g=r!=="other"?C(r,q0,"outline"):null,f=g?C(c,g,"primary"):null,S="K\xE9o th\u1EA3 t\u1EC7p tin v\xE0o \u0111\xE2y, ho\u1EB7c nh\u1EA5n \u0111\u1EC3 duy\u1EC7t file",D="H\u1ED7 tr\u1EE3 t\xE0i li\u1EC7u PDF, Office, t\u1EC7p n\xE9n ZIP, media...",I=d==="reject"?"border-error-500 bg-error-50/50 ring-2 ring-error-500/20 text-error-900":d==="active"?f?.active||"border-primary-500 bg-primary-50 ring-2 ring-primary-500/20":f?.idle||"border-neutral-300 bg-neutral-50/50 hover:border-primary-500 hover:bg-primary-50/30",E=H=>{a||l||s||(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),y?.())};if(i){let H=`group relative w-full ${v.compactMinHeight} ${v.compactPadding} ${u} border-2 border-dashed flex items-center justify-between gap-3 text-left transition-colors duration-150 ease-in-out cursor-pointer select-none ${I} ${a||s?"opacity-50 cursor-not-allowed pointer-events-none bg-neutral-100":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${k}`,V={role:"button",tabIndex:a||s?-1:0,"aria-label":"Khu v\u1EF1c t\u1EA3i t\u1EC7p l\xEAn thu g\u1ECDn","aria-disabled":a||s,"aria-invalid":w,"aria-describedby":T,"aria-busy":l,className:H,onKeyDown:E},Y=b?b(V):V;return us("div",{...Y,children:[us("div",{className:"flex items-center gap-2.5 min-w-0 flex-1",children:[tr("div",{className:`transition-colors shrink-0 ${f?.iconColor||"text-primary-500"}`,children:l&&h?tr(Ne,{width:18,height:18,className:"animate-spin text-primary-600"}):x||tr(Nt,{width:18,height:18})}),tr("span",{className:`truncate text-neutral-700 font-medium ${v.descSize}`,children:p||"K\xE9o th\u1EA3 ho\u1EB7c nh\u1EA5n \u0111\u1EC3 t\u1EA3i t\u1EC7p l\xEAn"})]}),tr("span",{className:`shrink-0 text-primary-600 group-hover:text-primary-700 font-semibold ${v.descSize}`,children:"Ch\u1ECDn file"})]})}let N=`group relative w-full ${o==="square"?"aspect-square w-full":C(e,X0,"md")} ${v.dropzonePadding} ${u} border-2 border-dashed flex flex-col items-center justify-center text-center transition-colors duration-150 ease-in-out cursor-pointer select-none ${I} ${a||s?"opacity-50 cursor-not-allowed pointer-events-none bg-neutral-100":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${k}`,M={role:"button",tabIndex:a||s?-1:0,"aria-label":"Khu v\u1EF1c k\xE9o th\u1EA3 v\xE0 t\u1EA3i t\u1EC7p tin l\xEAn","aria-disabled":a||s,"aria-invalid":w,"aria-describedby":T,"aria-busy":l,className:N,onKeyDown:E},z=b?b(M):M;return tr("div",{...z,children:l&&h?us("div",{className:`flex flex-col items-center justify-center gap-2 ${f?.iconColor||"text-primary-600"}`,children:[tr(Ne,{width:v.iconSize*.8,height:v.iconSize*.8}),tr("span",{className:`${v.titleSize} font-medium`,children:"\u0110ang x\u1EED l\xFD t\u1EC7p tin..."})]}):us("div",{className:"flex flex-col items-center justify-center gap-2",children:[tr("div",{className:`transition-colors ${f?.iconColor||"text-primary-500"}`,children:x||tr(Nt,{width:v.iconSize,height:v.iconSize})}),tr("div",{className:`${v.titleSize} font-medium text-neutral-800 ${f?.titleHover||"group-hover:text-primary-600"} transition-colors`,children:l?"\u0110ang x\u1EED l\xFD t\u1EC7p tin...":p??S}),tr("div",{id:T,className:`${v.descSize} text-neutral-500`,children:m??D})]})})}import{useMemo as iv}from"react";import{jsx as Ni,jsxs as vf}from"react/jsx-runtime";function Ro({file:e,fileName:t,category:r,size:n="md",className:o=""}){let i=iv(()=>{if(r)return r;let h=t||(e?ct(e):"");return ts(e||h)},[r,e,t]),a=C(i,J0,"other"),s=typeof n=="number"?n:C(n,Cr,"md").fileIconSize,l=Math.max(8,Math.round(s*.22));return vf("div",{role:"img","aria-label":`Bi\u1EC3u t\u01B0\u1EE3ng \u0111\u1ECBnh d\u1EA1ng t\u1EC7p ${a.label}`,style:{width:s,height:s},className:`relative inline-flex items-center justify-center shrink-0 select-none ${o}`,children:[vf("svg",{viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-full h-full drop-shadow-xs transition-transform",children:[Ni("path",{d:"M8 5C8 3.9 8.9 3 10 3H26L34 11V35C34 36.1 33.1 37 32 37H10C8.9 37 8 36.1 8 35V5Z",className:"fill-neutral-50 stroke-neutral-300 transition-colors",strokeWidth:"1.5",strokeLinejoin:"round"}),Ni("path",{d:"M26 3V10C26 10.55 26.45 11 27 11H34",className:"fill-neutral-200 stroke-neutral-300",strokeWidth:"1.5",strokeLinejoin:"round"}),Ni("line",{x1:"13",y1:"15",x2:"23",y2:"15",className:"stroke-neutral-300",strokeWidth:"1.5",strokeLinecap:"round"}),Ni("line",{x1:"13",y1:"19",x2:"27",y2:"19",className:"stroke-neutral-300",strokeWidth:"1.5",strokeLinecap:"round"})]}),Ni("div",{style:{fontSize:`${l}px`},className:`absolute bottom-1 right-0.5 px-1 py-0.2 rounded font-bold tracking-tight border shadow-2xs leading-none uppercase ${a.bg} ${a.text} ${a.border}`,children:a.label})]})}import{jsx as Ge,jsxs as ur}from"react/jsx-runtime";function Pi({item:e,index:t,listType:r="list",size:n="md",radius:o,disabled:i=!1,readOnly:a=!1,showPreviewButton:s=!0,showDownloadButton:l=!0,showRemoveButton:h=!0,onRemove:d,onPreview:w,onDownload:p,onRetry:m,renderItem:x,className:y=""}){let b=C(n,Cr,"md"),k=C(o,Xa,"md"),T=ct(e),v=ec(e),{status:u,progress:c,error:g}=tc(e),f=u==="uploading",S=u==="error",D=()=>{i||a||d?.(e,t)},R=()=>{i||w?.(e)},P=()=>{i||p?.(e)},I=()=>{i||a||m?.(e,t)};if(x)return Ge("li",{"data-testid":"upload-file-item",className:"list-none w-full",children:x(e,t,{remove:D,preview:R,download:P})});let E=N=>{i||(N.key==="Delete"||N.key==="Backspace")&&!a&&(N.preventDefault(),D())};return r==="grid"?ur("li",{"data-testid":"upload-file-item",tabIndex:i?-1:0,onKeyDown:E,"aria-label":`T\u1EC7p tin ${T}`,className:`group relative list-none flex flex-col justify-between p-3 ${k} border border-neutral-200 bg-white hover:border-primary-300 hover:shadow-xs transition-colors duration-150 ease-in-out focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${i?"opacity-50 pointer-events-none bg-neutral-50":""} ${S?"border-error-300 bg-error-50/20":""} ${y}`,children:[ur("div",{className:"flex items-start gap-2.5",children:[Ge(Ro,{file:e,size:n}),ur("div",{className:"flex-1 min-w-0",children:[w&&!i?Ge("button",{type:"button",title:T,onClick:R,className:`truncate text-left font-medium text-neutral-800 ${b.fileNameSize} hover:text-primary-600 hover:underline cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500 rounded-xs block w-full`,children:T}):Ge("p",{title:T,className:`truncate font-medium text-neutral-800 ${b.fileNameSize}`,children:T}),Ge("p",{className:`text-neutral-500 ${b.fileMetaSize}`,children:S?Ge("span",{className:"text-error-600 font-medium truncate block",children:g||"L\u1ED7i t\u1EA3i l\xEAn"}):f?ur("span",{className:"text-primary-600 flex items-center gap-1 font-medium",children:[Ge(Ne,{width:12,height:12,className:"animate-spin inline"}),"\u0110ang t\u1EA3i... ",c!==void 0?`${c}%`:""]}):v!==void 0?wr(v):null})]})]}),f&&c!==void 0&&Ge("div",{className:"w-full bg-neutral-100 rounded-full h-1.5 mt-2 overflow-hidden",children:Ge("div",{className:"bg-primary-500 h-1.5 rounded-full transition-[width] duration-300 ease-out",style:{width:`${Math.min(100,Math.max(0,c))}%`}})}),ur("div",{className:"flex items-center justify-end gap-1 mt-2.5 pt-2 border-t border-neutral-100",children:[S&&m&&!a&&Ge("button",{type:"button",disabled:i,onClick:I,"aria-label":`Th\u1EED l\u1EA1i t\u1EA3i l\xEAn ${T}`,title:"Th\u1EED l\u1EA1i",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${b.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(Lt,{width:14,height:14})}),s&&w&&Ge("button",{type:"button",disabled:i,onClick:R,"aria-label":`Xem tr\u01B0\u1EDBc t\u1EC7p ${T}`,title:"Xem tr\u01B0\u1EDBc",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${b.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(Lr,{width:14,height:14})}),l&&Ge("button",{type:"button",disabled:i,onClick:P,"aria-label":`T\u1EA3i xu\u1ED1ng t\u1EC7p ${T}`,title:"T\u1EA3i xu\u1ED1ng",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${b.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(br,{width:14,height:14})}),h&&!a&&Ge("button",{type:"button",disabled:i,onClick:D,"aria-label":`X\xF3a t\u1EC7p ${T}`,title:"X\xF3a t\u1EC7p",className:`text-neutral-400 hover:text-error-600 hover:bg-error-50 ${b.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(ir,{width:14,height:14})})]})]}):ur("li",{"data-testid":"upload-file-item",tabIndex:i?-1:0,onKeyDown:E,"aria-label":`T\u1EC7p tin ${T}`,className:`group relative list-none flex flex-col w-full ${b.itemPadding} ${k} border border-neutral-200 bg-white hover:border-primary-300 hover:bg-neutral-50/50 transition-colors duration-150 ease-in-out focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${i?"opacity-50 pointer-events-none bg-neutral-50":""} ${S?"border-error-300 bg-error-50/20":""} ${y}`,children:[ur("div",{className:"flex items-center justify-between gap-3 w-full",children:[ur("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[Ge(Ro,{file:e,size:n}),ur("div",{className:"flex flex-col min-w-0 flex-1",children:[Ge("div",{className:"flex items-center gap-2",children:w&&!i?Ge("button",{type:"button",title:T,onClick:R,className:`truncate text-left font-medium text-neutral-800 ${b.fileNameSize} hover:text-primary-600 hover:underline cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500 rounded-xs`,children:T}):Ge("span",{title:T,className:`truncate font-medium text-neutral-800 ${b.fileNameSize}`,children:T})}),Ge("div",{className:`flex items-center gap-2 text-neutral-500 ${b.fileMetaSize}`,children:S?Ge("span",{className:"text-error-600 font-medium truncate",children:g||"L\u1ED7i t\u1EA3i l\xEAn"}):f?ur("span",{className:"text-primary-600 flex items-center gap-1 font-medium",children:[Ge(Ne,{width:12,height:12,className:"animate-spin inline"}),"\u0110ang t\u1EA3i l\xEAn... ",c!==void 0?`${c}%`:""]}):v!==void 0?Ge("span",{children:wr(v)}):null})]})]}),ur("div",{className:"flex items-center gap-1 shrink-0",children:[S&&m&&!a&&Ge("button",{type:"button",disabled:i,onClick:I,"aria-label":`Th\u1EED l\u1EA1i t\u1EA3i l\xEAn ${T}`,title:"Th\u1EED l\u1EA1i",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${b.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(Lt,{width:15,height:15})}),s&&w&&Ge("button",{type:"button",disabled:i,onClick:R,"aria-label":`Xem tr\u01B0\u1EDBc t\u1EC7p ${T}`,title:"Xem tr\u01B0\u1EDBc",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${b.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(Lr,{width:15,height:15})}),l&&Ge("button",{type:"button",disabled:i,onClick:P,"aria-label":`T\u1EA3i xu\u1ED1ng t\u1EC7p ${T}`,title:"T\u1EA3i xu\u1ED1ng",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${b.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(br,{width:15,height:15})}),h&&!a&&Ge("button",{type:"button",disabled:i,onClick:D,"aria-label":`X\xF3a t\u1EC7p ${T}`,title:"X\xF3a t\u1EC7p",className:`text-neutral-400 hover:text-error-600 hover:bg-error-50 ${b.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(ir,{width:15,height:15})})]})]}),f&&c!==void 0&&Ge("div",{className:"w-full bg-neutral-100 rounded-full h-1 mt-2 overflow-hidden",children:Ge("div",{className:"bg-primary-500 h-1 rounded-full transition-[width] duration-300 ease-out",style:{width:`${Math.min(100,Math.max(0,c))}%`}})})]})}import{jsx as yf}from"react/jsx-runtime";function zi({items:e,listType:t="list",size:r="md",color:n="primary",radius:o,disabled:i=!1,readOnly:a=!1,showPreviewButton:s=!0,showDownloadButton:l=!0,showRemoveButton:h=!0,onRemove:d,onPreview:w,onDownload:p,onRetry:m,renderItem:x,className:y=""}){let b=C(r,Cr,"md"),k=t==="grid"?`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 ${b.gap} list-none p-0 m-0 ${y}`:`flex flex-col ${b.gap} list-none p-0 m-0 ${y}`;return!e||e.length===0?null:yf("ul",{"aria-label":"Danh s\xE1ch t\u1EC7p tin \u0111\xE3 t\u1EA3i l\xEAn",className:k,children:e.map((T,v)=>{let u=Q0(T,v);return yf(Pi,{item:T,index:v,listType:t,size:r,radius:o,color:n,disabled:i,readOnly:a,showPreviewButton:s,showDownloadButton:l,showRemoveButton:h,onRemove:d,onPreview:w,onDownload:p,onRetry:m,renderItem:x},u)})})}import{jsx as dr,jsxs as dc}from"react/jsx-runtime";function fc({value:e,defaultValue:t,onChange:r,onRemove:n,onPreview:o,onDownload:i,onRetry:a,maxCount:s,maxSize:l,minSize:h,accept:d,beforeUpload:w,viewMode:p="dropzone",listType:m="list",shape:x="rectangle",size:y="md",color:b="primary",variant:k="outline",radius:T,label:v,labelClassName:u="",helperText:c,errorMessage:g,disabled:f=!1,readOnly:S=!1,dropzoneTitle:D,dropzoneDescription:R,buttonText:P="T\u1EA3i t\u1EC7p l\xEAn",icon:I,renderItem:E,className:N="",dropzoneClassName:M="",listClassName:z="",previewClassName:H="",helperClassName:V="",config:Y}){let{isRequired:$=!1,isInvalid:F=!1,isLoading:G=!1,showSpinner:A=!1,multiple:U=!1,showFileList:B=!0,showPreviewButton:X=!0,showDownloadButton:le=!0,showRemoveButton:ne=!0}=Y??{},ue=av(),ie=`${ue}-input`,Q=`${ue}-error-helper`,q=e!==void 0,[ge,ke]=ds(()=>In(t)),L=wf(()=>q?In(e):ge,[q,e,ge]),[te,Z]=ds(null),[he,ae]=ds(null),[ve,Se]=ds(""),ye=C(y,Cr,"md"),J=T??"md",O=!!(F||g||te),W=g||te,fe=O?"text-error-600":C(O?"error":b,_0,"primary"),se=s??(U?void 0:1),me=oe=>{q||ke(oe),r?.(oe)},De=wf(()=>vi(d),[d]),{getRootProps:xe,getInputProps:re,isDragActive:de,isDragReject:ce,open:ee}=sv({multiple:U,maxSize:l,minSize:h,accept:De,disabled:f||S||G,noClick:p==="button",noKeyboard:p==="button",onDropAccepted:async oe=>{if(f||S||(Z(null),oe.length===0))return;let Te=oe,Pe=L.length;if(se!==void 0)if(U){let Le=se-Pe;if(Le<=0){let Be=`S\u1ED1 l\u01B0\u1EE3ng t\u1EC7p \u0111\xE3 \u0111\u1EA1t t\u1ED1i \u0111a (${se} t\u1EC7p)`;Z(Be),Se(Be);return}Te=oe.slice(0,Le)}else{let Le=oe[0];if(!Le)return;Te=[Le]}let _e=await Promise.all(Te.map(async Le=>{if(w)try{let Be=await w(Le);if(Be===!1||typeof Be=="string")return{file:null,error:typeof Be=="string"?Be:`T\u1EC7p ${Le.name} \u0111\xE3 b\u1ECB t\u1EEB ch\u1ED1i`}}catch(Be){return{file:null,error:Be instanceof Error?Be.message:`Kh\xF4ng th\u1EC3 x\u1EED l\xFD t\u1EC7p ${Le.name}`}}return{file:Le,error:null}})),Ue=[];for(let Le of _e)Le.error?(Z(Le.error),Se(`L\u1ED7i: ${Le.error}`)):Le.file&&Ue.push(Le.file);if(Ue.length>0){let Le=U?[...L,...Ue]:Ue;me(Le),Se(`\u0110\xE3 th\xEAm ${Ue.length} t\u1EC7p tin. T\u1ED5ng c\u1ED9ng: ${Le.length} t\u1EC7p.`)}},onDropRejected:oe=>{let Te=oe[0]?.errors[0];if(!Te)return;let Pe=Te.message||"T\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7";Te.code==="file-too-large"?Pe=`K\xEDch th\u01B0\u1EDBc t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n cho ph\xE9p (${wr(l||0)})`:Te.code==="file-too-small"?Pe=`K\xEDch th\u01B0\u1EDBc t\u1EC7p nh\u1ECF h\u01A1n gi\u1EDBi h\u1EA1n t\u1ED1i thi\u1EC3u (${wr(h||0)})`:Te.code==="file-invalid-type"?Pe=`\u0110\u1ECBnh d\u1EA1ng t\u1EC7p kh\xF4ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3. C\xE1c \u0111\u1ECBnh d\u1EA1ng cho ph\xE9p: ${typeof d=="string"?d:Object.keys(d||{}).join(", ")}`:Te.code==="too-many-files"&&(Pe=`S\u1ED1 l\u01B0\u1EE3ng t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n cho ph\xE9p (${se} t\u1EC7p)`),Z(Pe),Se(`L\u1ED7i t\u1EC7p: ${Pe}`)}}),j=(oe,Te)=>{if(f||S)return;let Pe=L.filter((_e,Ue)=>Ue!==Te);me(Pe),n?.(oe,Te),Se(`\u0110\xE3 x\xF3a t\u1EC7p tin ${ct(oe)}`)},Ce=oe=>{ae(oe),o?.(oe)},Ee=oe=>{i?.(oe);let Te=ct(oe);if(oe instanceof File){let Pe=URL.createObjectURL(oe);kr(Pe,oe.name),setTimeout(()=>URL.revokeObjectURL(Pe),1e3);return}if(typeof oe=="string"){kr(oe,Te);return}typeof oe=="object"&&oe&&typeof oe.src=="string"&&kr(oe.src,oe.name||Te)},Fe=H||z;return dc("div",{className:`group/field relative flex flex-col w-full ${N}`,children:[dr("input",{...re({id:ie,disabled:f||G,"aria-hidden":!0,tabIndex:-1,className:"hidden"})}),dr("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:ve}),v&&dc("label",{htmlFor:ie,className:`block font-medium transition-colors duration-150 ${ye.labelSize} ${fe} ${u}`,children:[v,$&&dr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),dc("div",{className:"flex flex-col gap-3",children:[p==="dropzone"&&dr(Do,{size:y,color:b,variant:k,radius:J,shape:x,disabled:f,readOnly:S,isLoading:G,showSpinner:A,dragStatus:ce?"reject":de?"active":"idle",isInvalid:O,dropzoneTitle:D,dropzoneDescription:R,icon:I,onTriggerUpload:ee,getRootProps:xe,className:M,describedById:W||c?Q:void 0}),p==="compact"&&dr(Do,{size:y,color:b,variant:k,radius:J,compact:!0,disabled:f,readOnly:S,isLoading:G,showSpinner:A,dragStatus:ce?"reject":de?"active":"idle",isInvalid:O,dropzoneTitle:D,dropzoneDescription:R,icon:I,onTriggerUpload:ee,getRootProps:xe,className:M,describedById:W||c?Q:void 0}),p==="button"&&dr("div",{className:"flex items-center gap-3",children:dr(Ut,{type:"button",size:ye.buttonSize,color:O?"error":b==="neutral"?"secondary":b,variant:k==="other"?"filled":k,radius:T,disabled:f||S||G||se!==void 0&&L.length>=se,isLoading:G,showSpinner:A,onClick:ee,leftIcon:dr(Nt,{width:ye.iconSize*.5,height:ye.iconSize*.5}),"aria-label":"T\u1EA3i t\u1EC7p l\xEAn",children:P})}),B&&L.length>0&&dr(zi,{items:L,listType:m,size:y,color:b,variant:k,radius:J,disabled:f,readOnly:S,maxCount:se,showPreviewButton:X,showDownloadButton:le,showRemoveButton:ne,onRemove:j,onPreview:Ce,onDownload:Ee,onRetry:a,renderItem:E,className:Fe})]}),dr($e,{id:Q,helperText:c,errorMessage:O?W:void 0,sizeClassName:ye.helperSize,className:V}),he&&dr(cr,{open:!!he,onClose:()=>ae(null),file:he})]})}var Cf=300,sn={xs:{dialog:"max-w-[320px] p-4 gap-3",header:"gap-2.5",body:"text-xs",footer:"gap-2 pt-2",title:"text-sm font-semibold leading-tight text-neutral-900",description:"text-xs leading-normal text-neutral-600",iconWrapper:"size-7 rounded-full",icon:"size-4",buttonSize:"xs",buttonGap:"gap-2",closeButton:"size-5 p-0.5 -mr-1 -mt-1",closeIcon:"size-3.5"},sm:{dialog:"max-w-[380px] p-5 gap-3.5",header:"gap-3",body:"text-sm",footer:"gap-2.5 pt-2.5",title:"text-base font-semibold leading-tight text-neutral-900",description:"text-sm leading-normal text-neutral-600",iconWrapper:"size-9 rounded-full",icon:"size-5",buttonSize:"sm",buttonGap:"gap-2.5",closeButton:"size-6 p-0.5 -mr-1 -mt-1",closeIcon:"size-4"},md:{dialog:"max-w-[440px] p-6 gap-4",header:"gap-3.5",body:"text-sm",footer:"gap-3 pt-3",title:"text-lg font-semibold leading-tight text-neutral-900",description:"text-sm leading-relaxed text-neutral-600",iconWrapper:"size-10 rounded-full",icon:"size-5",buttonSize:"md",buttonGap:"gap-3",closeButton:"size-7 p-1 -mr-1.5 -mt-1.5",closeIcon:"size-4"},lg:{dialog:"max-w-[520px] p-7 gap-5",header:"gap-4",body:"text-base",footer:"gap-3.5 pt-3.5",title:"text-xl font-semibold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",iconWrapper:"size-12 rounded-full",icon:"size-6",buttonSize:"lg",buttonGap:"gap-3.5",closeButton:"size-8 p-1.5 -mr-1.5 -mt-1.5",closeIcon:"size-4.5"},xl:{dialog:"max-w-[600px] p-8 gap-6",header:"gap-4.5",body:"text-lg",footer:"gap-4 pt-4",title:"text-2xl font-bold leading-snug text-neutral-900",description:"text-lg leading-relaxed text-neutral-600",iconWrapper:"size-14 rounded-full",icon:"size-7",buttonSize:"xl",buttonGap:"gap-4",closeButton:"size-9 p-1.5 -mr-2 -mt-2",closeIcon:"size-5"}},kf={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Sf={primary:"bg-primary-50 text-primary-600 border border-primary-200",secondary:"bg-secondary-50 text-secondary-600 border border-secondary-200",neutral:"bg-neutral-100 text-neutral-600 border border-neutral-200",error:"bg-error-50 text-error-600 border border-error-200",success:"bg-success-50 text-success-600 border border-success-200",warning:"bg-warning-50 text-warning-600 border border-warning-200",info:"bg-info-50 text-info-600 border border-info-200"},Tf={warning:ws,error:Cs,success:ys,info:Un,primary:Un,secondary:Un,neutral:Un};import{createContext as lv,useContext as cv}from"react";var pc=lv(null),rr=()=>cv(pc);import{jsx as uv}from"react/jsx-runtime";function gc({size:e,radius:t,className:r="",children:n,ref:o,...i}){let a=rr(),s=C(e??a?.size,sn,"md"),l=C(t,kf,"lg"),h=["relative flex flex-col w-full bg-neutral-white shadow-2xl border-2 border-neutral-200 outline-none text-neutral-900 pointer-events-auto",s.dialog,l,r].filter(Boolean).join(" ");return uv("div",{ref:o,tabIndex:-1,className:h,...i,children:n})}import{useEffect as fs,useEffectEvent as dv,useCallback as fv,useMemo as pv,useRef as Df,useState as gv}from"react";import{jsx as mc,jsxs as mv}from"react/jsx-runtime";function bc({open:e=!1,size:t="md",color:r="warning",isLoading:n=!1,closeOnOverlayClick:o=!0,closeOnEsc:i=!0,lockScroll:a=!0,overlayClassName:s="",className:l="",children:h,onClose:d,...w}){let p=Df(null),[m,x]=gv(!1),y=Df(null),b=fv(()=>{m||n||(x(!0),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{x(!1),d?.()},Cf))},[m,n,d]),k=pv(()=>({onClose:b,isLoading:n,size:t,color:r}),[b,n,t,r]);fs(()=>()=>{y.current&&clearTimeout(y.current)},[]),fs(()=>{let g=p.current;if(g)if(e||m){if(!g.open)try{g.showModal()}catch{}}else g.open&&g.close()},[e,m]),fs(()=>{if(!a)return;let g=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=g}},[a]);let T=dv(g=>{!e||i===!1||g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),b())});if(fs(()=>(window.addEventListener("keydown",T),()=>{window.removeEventListener("keydown",T)}),[]),!e&&!m)return null;let v=()=>{o&&b()},u=m?"animate-confirm-backdrop-out pointer-events-none":"animate-confirm-backdrop-in",c=m?"animate-confirm-out pointer-events-none":"animate-confirm-in";return mc(pc.Provider,{value:k,children:mv("dialog",{ref:p,"aria-labelledby":"confirm-dialog-title","aria-describedby":"confirm-dialog-description",onCancel:g=>{g.preventDefault(),i!==!1&&b()},className:`fixed inset-0 flex items-center justify-center p-4 bg-neutral-950/40 backdrop-blur-xs border-none m-0 max-w-none max-h-none w-screen h-screen overflow-visible backdrop:bg-transparent ${u} ${s}`,...w,children:[mc("div",{"aria-hidden":"true",onClick:v,className:"fixed inset-0 -z-10"}),mc("div",{className:`w-full flex items-center justify-center pointer-events-none ${c} ${l}`,children:h})]})})}import{jsx as No,jsxs as Rf}from"react/jsx-runtime";function hc({size:e,color:t,icon:r=!0,title:n,iconClassName:o="",titleClassName:i="",showCloseButton:a=!1,onClose:s,closeButtonClassName:l="",className:h="",children:d,...w}){let p=rr(),m=C(e??p?.size,sn,"md"),x=C(t??p?.color,Sf,"warning"),y=p?.isLoading,b=()=>{s?.(),p?.onClose?.()},k=!!(s||p?.onClose),T=()=>{if(r===!1)return null;if(r!==void 0&&r!==!0)return No("div",{className:`inline-flex items-center justify-center shrink-0 ${m.iconWrapper} ${x} ${o}`,"aria-hidden":"true",children:r});let v=C(t??p?.color,Tf,"warning");return No("div",{className:`inline-flex items-center justify-center shrink-0 ${m.iconWrapper} ${x} ${o}`,"aria-hidden":"true",children:No(v,{className:m.icon})})};return Rf("div",{className:`flex items-start justify-between w-full ${m.header} ${h}`,...w,children:[Rf("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[T(),n&&No("h3",{className:`${m.title} truncate ${i}`,id:"confirm-dialog-title",children:n}),d]}),a&&k&&No("button",{type:"button",onClick:b,disabled:y,"aria-label":"\u0110\xF3ng h\u1ED9p tho\u1EA1i",className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-700 hover:bg-neutral-100 rounded-md transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-neutral-400 ${m.closeButton} ${l}`,children:No(Oe,{className:m.closeIcon})})]})}import{jsx as bv,jsxs as hv}from"react/jsx-runtime";function xc({size:e,description:t,descriptionClassName:r="",className:n="",children:o,...i}){let a=rr(),s=C(e??a?.size,sn,"md");return hv("div",{className:`w-full ${s.body} ${n}`,id:"confirm-dialog-description",...i,children:[t?bv("p",{className:`${s.description} ${r}`,children:t}):null,o]})}import{jsx as vc,jsxs as xv}from"react/jsx-runtime";function yc({size:e,confirmText:t="X\xE1c nh\u1EADn",cancelText:r="H\u1EE7y",confirmVariant:n="filled",cancelVariant:o="outline",confirmColor:i,cancelColor:a="secondary",onConfirm:s,onCancel:l,onClose:h,confirmButtonProps:d,cancelButtonProps:w,className:p="",children:m,...x}){let y=rr(),b=C(e??y?.size,sn,"md"),k=i??y?.color??"warning",T=()=>{h?.(),y?.onClose?.()},v=async()=>{try{let c=s?.();c&&"then"in c&&await c,T()}catch{}},u=()=>{l?.(),T()};return m?vc("div",{className:`flex items-center justify-end w-full ${b.footer} ${b.buttonGap} ${p}`,...x,children:m}):xv("div",{className:`flex items-center justify-end w-full ${b.footer} ${b.buttonGap} ${p}`,...x,children:[r!==!1&&vc(Ut,{size:b.buttonSize,variant:o,color:a,onClick:u,disabled:w?.disabled||y?.isLoading,...w,children:r}),vc(Ut,{size:b.buttonSize,variant:n,color:k,isLoading:y?.isLoading||d?.isLoading,disabled:d?.disabled,onClick:v,...d,children:t})]})}import{cloneElement as vv,isValidElement as yv}from"react";import{jsx as wv}from"react/jsx-runtime";function wc({children:e,asChild:t=!0,onClick:r,...n}){let o=rr(),i=o?.isLoading,a=s=>{r?.(s),s.defaultPrevented||o?.onClose?.()};if(t&&yv(e)){let s=e;return vv(s,{disabled:s.props.disabled||i,onClick:l=>{s.props.onClick?.(l),a(l)},...n})}return wv("button",{type:"button",onClick:a,disabled:i,...n,children:e})}import{jsx as Cv}from"react/jsx-runtime";function Cc({size:e,className:t="",children:r,...n}){let o=er(),i=C(e??o?.size,an,"md");return Cv("div",{className:`flex items-center justify-end w-full border-t border-neutral-100 pt-2 ${i.footer} ${i.buttonGap} ${t}`,...n,children:r})}import{cloneElement as kv,isValidElement as Sv}from"react";import{jsx as Tv}from"react/jsx-runtime";function kc({children:e,asChild:t=!0,onClick:r,...n}){let o=er(),i=o?.isLoading,a=s=>{r?.(s),s.defaultPrevented||o?.onClose?.()};if(t&&Sv(e)){let s=e;return kv(s,{disabled:s.props.disabled||i,onClick:l=>{s.props.onClick?.(l),a(l)},...n})}return Tv("button",{type:"button",onClick:a,disabled:i,...n,children:e})}import{createContext as Dv,useContext as Rv,useMemo as Nv}from"react";import{jsx as Sr}from"react/jsx-runtime";var Nf=Dv({size:"md",variantStyles:Mi.default}),Po=()=>Rv(Nf);function ps({variant:e="default",size:t="md",className:r="",containerClassName:n="",wrapperProps:o,children:i,ref:a,...s}){let l=C(e,Mi,"default"),h=Nv(()=>({size:t,variantStyles:l}),[t,l]);return Sr(Nf.Provider,{value:h,children:Sr("div",{className:`w-full overflow-x-auto rounded-lg ${l.container} ${n}`.trim(),...o,children:Sr("table",{ref:a,className:`w-full text-left caption-bottom ${l.table} ${r}`.trim(),...s,children:i})})})}function gs({className:e="",children:t,ref:r,...n}){let{variantStyles:o}=Po();return Sr("thead",{ref:r,className:`${o.head} ${e}`.trim(),...n,children:t})}function ms({className:e="",children:t,ref:r,...n}){return Sr("tbody",{ref:r,className:`divide-y divide-neutral-200/70 ${e}`.trim(),...n,children:t})}function Pf({className:e="",children:t,ref:r,...n}){return Sr("tfoot",{ref:r,className:`border-t border-neutral-200 bg-neutral-50/60 font-medium text-neutral-600 ${e}`.trim(),...n,children:t})}function Vn({isSelected:e=!1,isHoverable:t=!0,className:r="",children:n,ref:o,...i}){let{variantStyles:a}=Po(),s=e?"bg-primary-50/70 hover:bg-primary-50 text-primary-950 font-medium":"",l=t&&!e?a.row:"";return Sr("tr",{ref:o,"data-state":e?"selected":void 0,"aria-selected":e,className:`${l} ${s} ${r}`.trim(),...i,children:n})}function ln({align:e="left",className:t="",children:r,ref:n,...o}){let{size:i}=Po(),a=C(i,Ii,"md"),s=C(e,Fi,"left");return Sr("th",{ref:n,className:`tracking-wider ${a.head} ${s} ${t}`.trim(),...o,children:r})}function zo({align:e="left",className:t="",children:r,ref:n,...o}){let{size:i,variantStyles:a}=Po(),s=C(i,Ii,"md"),l=C(e,Fi,"left");return Sr("td",{ref:n,className:`align-middle ${s.cell} ${a.cell} ${l} ${t}`.trim(),...o,children:r})}function zf({className:e="",children:t,ref:r,...n}){return Sr("caption",{ref:r,className:`mt-3 text-xs text-neutral-500 ${e}`.trim(),...n,children:t})}import{jsx as An,jsxs as Pv}from"react/jsx-runtime";function Io({column:e,title:t,className:r="",...n}){if(!e.getCanSort())return An("div",{className:`font-semibold ${r}`.trim(),...n,children:t});let o=e.getIsSorted(),i=a=>{a.preventDefault();let s=e.getToggleSortingHandler();s&&s(a)};return An("div",{className:`flex items-center space-x-1.5 ${r}`.trim(),...n,children:Pv("button",{type:"button",onClick:i,className:"group inline-flex items-center gap-1.5 font-semibold text-inherit hover:text-neutral-900 transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 rounded px-1 py-0.5 -mx-1",children:[An("span",{children:t}),An("span",{className:"shrink-0 inline-flex items-center justify-center","aria-hidden":"true",children:o==="asc"?An(la,{className:"w-3.5 h-3.5 text-primary-600"}):o==="desc"?An(ca,{className:"w-3.5 h-3.5 text-primary-600"}):An(sa,{className:"w-3.5 h-3.5 text-neutral-400 opacity-60 group-hover:opacity-100 transition-opacity"})})]})})}import{useSortable as zv}from"@dnd-kit/sortable";import{CSS as Iv}from"@dnd-kit/utilities";import{jsx as If}from"react/jsx-runtime";function Sc({header:e,canSort:t=!1,headerContent:r,ariaSort:n,disabled:o=!1,className:i=""}){let a=e.column.id==="_select",s=o||a,{attributes:l,listeners:h,setNodeRef:d,transform:w,transition:p,isDragging:m}=zv({id:e.column.id,disabled:s}),x={transform:Iv.Translate.toString(w),transition:p,opacity:m?.75:1,position:m?"relative":void 0,zIndex:m?20:void 0,whiteSpace:"nowrap"},y=t&&typeof e.column.columnDef.header=="string"?If(Io,{column:e.column,title:e.column.columnDef.header}):r;return If(ln,{ref:d,style:x,"aria-sort":n,"data-column-id":e.column.id,...s?{}:l,...s?{}:h,className:`
2
+ import{a as C,b as vo,c as Pe,d as Ye,e as st,f as qo,g as Is,h as Fs,i as Ms,j as Gc,k as op,l as An,m as np,n as ip,o as ap,p as jc,q as Uc,r as Yc,s as Zo,t as Vi,u as Ai,v as Oi,w as Gi,x as ji}from"./chunk-XM7AABEU.js";var Ui={xs:{button:"h-6 px-2.5 text-[11px] gap-1",iconOnly:"size-6 p-0",icon:"size-3"},sm:{button:"h-8 px-3 text-xs gap-1.5",iconOnly:"size-8 p-0",icon:"size-3.5"},md:{button:"h-10 px-4 text-sm gap-2",iconOnly:"size-10 p-0",icon:"size-4"},lg:{button:"h-12 px-5 text-base gap-2.5",iconOnly:"size-12 p-0",icon:"size-5"},xl:{button:"h-14 px-6 text-lg gap-3",iconOnly:"size-14 p-0",icon:"size-6"}},Yi={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Wi={filled:{primary:"bg-primary-500 text-neutral-white border-transparent hover:bg-primary-600 active:bg-primary-700 focus-visible:ring-primary-700",secondary:"bg-secondary-500 text-neutral-white border-transparent hover:bg-secondary-600 active:bg-secondary-700 focus-visible:ring-secondary-700",neutral:"bg-neutral-800 text-neutral-white border-transparent hover:bg-neutral-900 active:bg-neutral-950 focus-visible:ring-neutral-700",error:"bg-error-500 text-neutral-white border-transparent hover:bg-error-600 active:bg-error-700 focus-visible:ring-error-700",success:"bg-success-500 text-neutral-white border-transparent hover:bg-success-600 active:bg-success-700 focus-visible:ring-success-700",warning:"bg-warning-500 text-neutral-white border-transparent hover:bg-warning-600 active:bg-warning-700 focus-visible:ring-warning-700",info:"bg-info-500 text-neutral-white border-transparent hover:bg-info-600 active:bg-info-700 focus-visible:ring-info-700"},soft:{primary:"bg-primary-100 text-primary-800 border-primary-200 hover:bg-primary-200 hover:text-primary-900 active:bg-primary-300 focus-visible:ring-primary-700",secondary:"bg-secondary-100 text-secondary-800 border-secondary-200 hover:bg-secondary-200 hover:text-secondary-900 active:bg-secondary-300 focus-visible:ring-secondary-700",neutral:"bg-neutral-100 text-neutral-800 border-neutral-200 hover:bg-neutral-200 hover:text-neutral-900 active:bg-neutral-300 focus-visible:ring-neutral-700",error:"bg-error-100 text-error-800 border-error-200 hover:bg-error-200 hover:text-error-900 active:bg-error-300 focus-visible:ring-error-700",success:"bg-success-100 text-success-800 border-success-200 hover:bg-success-200 hover:text-success-900 active:bg-success-300 focus-visible:ring-success-700",warning:"bg-warning-100 text-warning-800 border-warning-200 hover:bg-warning-200 hover:text-warning-900 active:bg-warning-300 focus-visible:ring-warning-700",info:"bg-info-100 text-info-800 border-info-200 hover:bg-info-200 hover:text-info-900 active:bg-info-300 focus-visible:ring-info-700"},ghost:{primary:"bg-transparent text-primary-700 border-transparent hover:bg-primary-100 hover:text-primary-900 active:bg-primary-200 focus-visible:ring-primary-700",secondary:"bg-transparent text-secondary-700 border-transparent hover:bg-secondary-100 hover:text-secondary-900 active:bg-secondary-200 focus-visible:ring-secondary-700",neutral:"bg-transparent text-neutral-700 border-transparent hover:bg-neutral-100 hover:text-neutral-900 active:bg-neutral-200 focus-visible:ring-neutral-700",error:"bg-transparent text-error-700 border-transparent hover:bg-error-100 hover:text-error-900 active:bg-error-200 focus-visible:ring-error-700",success:"bg-transparent text-success-700 border-transparent hover:bg-success-100 hover:text-success-900 active:bg-success-200 focus-visible:ring-success-700",warning:"bg-transparent text-warning-700 border-transparent hover:bg-warning-100 hover:text-warning-900 active:bg-warning-200 focus-visible:ring-warning-700",info:"bg-transparent text-info-700 border-transparent hover:bg-info-100 hover:text-info-900 active:bg-info-200 focus-visible:ring-info-700"},text:{primary:"bg-transparent text-primary-500 border-transparent px-1 hover:text-primary-600 active:text-primary-700 focus-visible:ring-primary-700",secondary:"bg-transparent text-secondary-500 border-transparent px-1 hover:text-secondary-600 active:text-secondary-700 focus-visible:ring-secondary-700",neutral:"bg-transparent text-neutral-700 border-transparent px-1 hover:text-neutral-800 active:text-neutral-900 focus-visible:ring-neutral-700",error:"bg-transparent text-error-500 border-transparent px-1 hover:text-error-600 active:text-error-700 focus-visible:ring-error-700",success:"bg-transparent text-success-500 border-transparent px-1 hover:text-success-600 active:text-success-700 focus-visible:ring-success-700",warning:"bg-transparent text-warning-500 border-transparent px-1 hover:text-warning-600 active:text-warning-700 focus-visible:ring-warning-700",info:"bg-transparent text-info-500 border-transparent px-1 hover:text-info-600 active:text-info-700 focus-visible:ring-info-700"},outline:{primary:"bg-transparent text-primary-700 border-2 border-primary-400 hover:bg-primary-50 hover:border-primary-500 hover:text-primary-900 active:bg-primary-100 focus-visible:ring-primary-700",secondary:"bg-transparent text-secondary-700 border-2 border-secondary-400 hover:bg-secondary-50 hover:border-secondary-500 hover:text-secondary-900 active:bg-secondary-100 focus-visible:ring-secondary-700",neutral:"bg-transparent text-neutral-700 border-2 border-neutral-300 hover:bg-neutral-50 hover:border-neutral-400 hover:text-neutral-900 active:bg-neutral-100 focus-visible:ring-neutral-700",error:"bg-transparent text-error-700 border-2 border-error-400 hover:bg-error-50 hover:border-error-500 hover:text-error-900 active:bg-error-100 focus-visible:ring-error-700",success:"bg-transparent text-success-700 border-2 border-success-400 hover:bg-success-50 hover:border-success-500 hover:text-success-900 active:bg-success-100 focus-visible:ring-success-700",warning:"bg-transparent text-warning-700 border-2 border-warning-400 hover:bg-warning-50 hover:border-warning-500 hover:text-warning-900 active:bg-warning-100 focus-visible:ring-warning-700",info:"bg-transparent text-info-700 border-2 border-info-400 hover:bg-info-50 hover:border-info-500 hover:text-info-900 active:bg-info-100 focus-visible:ring-info-700"}};import{jsx as Es,jsxs as sp}from"react/jsx-runtime";function er({size:e,variant:t,color:r,radius:o,leftIcon:n,rightIcon:i,isLoading:a=!1,showSpinner:s=!1,loadingText:l,isFullWidth:m=!1,disabled:f=!1,type:w="button",className:g="",children:p,ref:b,...h}){let x=C(e,Ui,"md"),S=t==="other"?"":C(r,C(t,Wi,"filled"),"primary"),k=C(o,Yi,"lg"),v=["inline-flex items-center justify-center font-medium leading-none border transition-colors duration-150 cursor-pointer select-none whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:pointer-events-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 active:scale-[0.98] transition-transform",x.button,k,S,m?"w-full":"",f?"opacity-50":"",g].filter(Boolean).join(" "),d=y=>Es("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${x.icon}`,"aria-hidden":"true",children:y}),u=a&&l?l:p;return sp("button",{ref:b,type:w,disabled:f||a,"aria-busy":a,"aria-disabled":f||a,className:v,...h,children:[a&&s&&d(Es(Pe,{})),(!a||!s)&&n&&d(n),u&&Es("span",{className:"leading-none",children:u}),!a&&i&&d(i)]})}import{jsx as $s}from"react/jsx-runtime";function Wt({icon:e,size:t,variant:r,color:o,radius:n,isLoading:i=!1,showSpinner:a=!1,disabled:s=!1,type:l="button",className:m="",ref:f,...w}){let g=C(t,Ui,"md"),p=r==="other"?"":C(o,C(r,Wi,"filled"),"primary"),b=C(n,Yi,"full"),h=["inline-flex items-center justify-center font-medium leading-none border transition-colors duration-150 active:scale-[0.98] transition-transform cursor-pointer select-none whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:pointer-events-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",g.iconOnly,b,p,s?"opacity-50":"",m].filter(Boolean).join(" "),x=S=>$s("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${g.icon}`,"aria-hidden":"true",children:S});return $s("button",{ref:f,type:l,disabled:s||i,"aria-busy":i,"aria-disabled":s||i,className:h,...w,children:x(i&&a?$s(Pe,{}):e)})}var Wc={xs:{badge:"h-5 px-2 text-[11px] gap-1",icon:"size-3",dot:"size-1.5",deleteIcon:"size-3"},sm:{badge:"h-6 px-2.5 text-xs gap-1.5",icon:"size-3.5",dot:"size-1.5",deleteIcon:"size-3.5"},md:{badge:"h-7 px-3 text-xs font-medium gap-1.5",icon:"size-3.5",dot:"w-2 h-2",deleteIcon:"size-3.5"},lg:{badge:"h-8 px-3.5 text-sm font-medium gap-2",icon:"size-4",dot:"size-2.5",deleteIcon:"size-4"},xl:{badge:"h-9 px-4 text-sm font-semibold gap-2",icon:"size-4.5",dot:"size-2.5",deleteIcon:"size-4.5"}},Kc={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},_c={primary:"bg-primary-500",secondary:"bg-secondary-500",error:"bg-error-500",success:"bg-success-500",warning:"bg-warning-500",info:"bg-info-500",neutral:"bg-neutral-500"},Xc={soft:{primary:"bg-primary-100 text-primary-800 border-primary-200 hover:bg-primary-200",secondary:"bg-secondary-100 text-secondary-800 border-secondary-200 hover:bg-secondary-200",error:"bg-error-100 text-error-800 border-error-200 hover:bg-error-200",success:"bg-success-100 text-success-800 border-success-200 hover:bg-success-200",warning:"bg-warning-100 text-warning-800 border-warning-200 hover:bg-warning-200",info:"bg-info-100 text-info-800 border-info-200 hover:bg-info-200",neutral:"bg-neutral-100 text-neutral-800 border-neutral-200 hover:bg-neutral-200"},filled:{primary:"bg-primary-500 text-neutral-white border-transparent hover:bg-primary-600 active:bg-primary-700",secondary:"bg-secondary-500 text-neutral-white border-transparent hover:bg-secondary-600 active:bg-secondary-700",error:"bg-error-500 text-neutral-white border-transparent hover:bg-error-600 active:bg-error-700",success:"bg-success-500 text-neutral-white border-transparent hover:bg-success-600 active:bg-success-700",warning:"bg-warning-500 text-neutral-950 border-transparent hover:bg-warning-600 active:bg-warning-700",info:"bg-info-500 text-neutral-white border-transparent hover:bg-info-600 active:bg-info-700",neutral:"bg-neutral-800 text-neutral-white border-transparent hover:bg-neutral-900 active:bg-neutral-950"},outline:{primary:"bg-transparent text-primary-700 border-2 border-primary-400 hover:bg-primary-50/70",secondary:"bg-transparent text-secondary-800 border-2 border-secondary-400 hover:bg-secondary-50/70",error:"bg-transparent text-error-700 border-2 border-error-400 hover:bg-error-50/70",success:"bg-transparent text-success-700 border-2 border-success-400 hover:bg-success-50/70",warning:"bg-transparent text-warning-800 border-2 border-warning-400 hover:bg-warning-50/70",info:"bg-transparent text-info-800 border-2 border-info-400 hover:bg-info-50/70",neutral:"bg-transparent text-neutral-700 border-2 border-neutral-300 hover:bg-neutral-100/70"},ghost:{primary:"bg-transparent text-primary-700 border-transparent hover:bg-primary-50",secondary:"bg-transparent text-secondary-800 border-transparent hover:bg-secondary-50",error:"bg-transparent text-error-700 border-transparent hover:bg-error-50",success:"bg-transparent text-success-700 border-transparent hover:bg-success-50",warning:"bg-transparent text-warning-800 border-transparent hover:bg-warning-50",info:"bg-transparent text-info-800 border-transparent hover:bg-info-50",neutral:"bg-transparent text-neutral-700 border-transparent hover:bg-neutral-50"}};import{jsx as On,jsxs as lp}from"react/jsx-runtime";function Kt({size:e="md",variant:t="soft",color:r="primary",radius:o="full",dot:n=!1,dotPing:i=!1,leftIcon:a,rightIcon:s,onDelete:l,deleteAriaLabel:m="Remove",className:f="",children:w,onClick:g,ref:p,...b}){let h=C(e,Wc,"md"),x=t==="other"?"":C(r,C(t,Xc,"soft"),"primary"),S=C(r,_c,"primary"),k=C(o,Kc,"full"),v=["inline-flex items-center justify-center font-medium leading-none border transition-colors duration-150 whitespace-nowrap",h.badge,k,x,g?"cursor-pointer select-none active:scale-[0.98] transition-transform duration-100":"",f].filter(Boolean).join(" "),d=u=>On("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${h.icon}`,"aria-hidden":"true",children:u});return lp("span",{ref:p,role:g?"button":void 0,tabIndex:g?0:void 0,className:v,onClick:g,...b,children:[n&&On("span",{className:`relative inline-block shrink-0 rounded-full ${i?"animate-pulse":""} ${h.dot} ${S}`,"aria-hidden":"true"}),a&&d(a),w&&On("span",{className:"leading-none",children:w}),s&&!l&&d(s),l&&On("button",{type:"button",onClick:u=>{u.stopPropagation(),l()},"aria-label":m,className:`inline-flex items-center justify-center shrink-0 rounded-full hover:bg-black/10 active:bg-black/20 transition-colors p-0.5 -mr-0.5 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current ${h.deleteIcon}`,children:On(Ye,{className:"size-full"})})]})}import{useId as up,useState as dp,useRef as fp}from"react";import{useMergeRefs as pp}from"@floating-ui/react";var Ki={xs:{wrapper:"h-6 text-[11px]",input:"px-2 py-0.5 text-[11px] leading-tight",icon:"size-3",iconPaddingLeft:"pl-6",iconPaddingRight:"pr-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{wrapper:"h-8 text-xs",input:"px-2.5 py-1 text-xs leading-normal",icon:"size-3.5",iconPaddingLeft:"pl-7.5",iconPaddingRight:"pr-7.5",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{wrapper:"h-10 text-sm",input:"px-3.5 py-2 text-sm leading-normal",icon:"size-[18px]",iconPaddingLeft:"pl-9",iconPaddingRight:"pr-9",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{wrapper:"h-12 text-base",input:"px-4 py-2.5 text-base leading-normal",icon:"size-5",iconPaddingLeft:"pl-11",iconPaddingRight:"pr-11",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{wrapper:"h-14 text-lg",input:"px-5 py-3 text-lg leading-normal",icon:"size-6",iconPaddingLeft:"pl-13",iconPaddingRight:"pr-13",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},Jo={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},qc={none:"none",sm:"sm",md:"md",lg:"lg",xl:"xl",full:"full"},Zc={xs:{wrapper:"min-h-6 text-[11px] px-1.5 py-0.5",input:"text-[11px] leading-tight min-w-[50px]",gap:"gap-1",badgeSize:"xs",icon:"size-3",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{wrapper:"min-h-8 text-xs px-2 py-1",input:"text-xs leading-normal min-w-[60px]",gap:"gap-1",badgeSize:"xs",icon:"size-3.5",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{wrapper:"min-h-10 text-sm px-2.5 py-1.5",input:"text-sm leading-normal min-w-[70px]",gap:"gap-1.5",badgeSize:"sm",icon:"size-[18px]",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{wrapper:"min-h-12 text-base px-3 py-2",input:"text-base leading-normal min-w-[80px]",gap:"gap-1.5",badgeSize:"md",icon:"size-5",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{wrapper:"min-h-14 text-lg px-3.5 py-2.5",input:"text-lg leading-normal min-w-[90px]",gap:"gap-2",badgeSize:"lg",icon:"size-6",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},Qo={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}};var Jc={xs:{slot:"size-6 min-w-6",text:"text-xs",gap:"gap-1",label:"text-[11px] mb-1",helper:"text-[9px] mt-0.5"},sm:{slot:"size-8 min-w-8",text:"text-sm",gap:"gap-1.5",label:"text-xs mb-1",helper:"text-[10px] mt-0.5"},md:{slot:"size-10 min-w-10",text:"text-base font-semibold",gap:"gap-2",label:"text-sm mb-1.5",helper:"text-[11px] mt-1"},lg:{slot:"size-12 min-w-12",text:"text-lg font-semibold",gap:"gap-2.5",label:"text-base mb-1.5",helper:"text-xs mt-1"},xl:{slot:"size-14 min-w-14",text:"text-xl font-bold",gap:"gap-3",label:"text-lg mb-2",helper:"text-sm mt-1"}};import{useEffect as cp,useState as Ls}from"react";function Bs(e,t={}){let{exitDuration:r=250}=t,[o,n]=Ls(e),[i,a]=Ls(!1),[s,l]=Ls(e);return e!==s&&(l(e),e?(n(e),a(!1)):a(!0)),cp(()=>{if(!i)return;let m=setTimeout(()=>{n(void 0),a(!1)},r);return()=>clearTimeout(m)},[r,i]),{displayedError:o,isExiting:i}}import{jsx as Hs}from"react/jsx-runtime";function He({id:e,helperText:t,errorMessage:r,sizeClassName:o="text-xs",className:n=""}){let{displayedError:i,isExiting:a}=Bs(r),s=i||t,l=!!(i||t),m=!!i;return Hs("div",{className:`grid transition-[grid-template-rows,opacity,margin] duration-200 ease-out overflow-hidden ${l?"grid-rows-[1fr] opacity-100 mt-1":"grid-rows-[0fr] opacity-0 mt-0 pointer-events-none"}`,"aria-live":"polite",children:Hs("div",{className:"overflow-hidden",children:Hs("div",{id:e,role:m?"alert":"status",className:`leading-tight transition-colors duration-200 font-normal ${o} ${m?a?"text-error-600 animate-error-out":"text-error-600 animate-error-in":"text-neutral-500"} ${n}`,children:s||"\xA0"})})})}import{jsx as eu,jsxs as tu}from"react/jsx-runtime";var Vs={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600",neutral:"text-neutral-500 group-focus-within/field:text-neutral-600"},Qc={xs:{label:"text-[11px] mb-1",floatingLabel:"text-[10px]"},sm:{label:"text-xs mb-1",floatingLabel:"text-[10px]"},md:{label:"text-sm mb-1.5",floatingLabel:"text-[11px]"},lg:{label:"text-base mb-1.5",floatingLabel:"text-xs"},xl:{label:"text-lg mb-2",floatingLabel:"text-xs"}};function bt({label:e,children:t,htmlFor:r,id:o,isRequired:n=!1,isFloating:i,placement:a,size:s="md",sizeClassName:l,color:m="primary",hasError:f=!1,isInvalid:w=!1,cursor:g,className:p="",colorConfig:b=Vs}){let h=e??t;if(!h)return null;let x=i??a==="floating",S=!!(f||w),k=S?"error":m,v=S?"text-error-600 font-bold":b[k]||Vs[k]||Vs.primary,d=Qc[s]||Qc.md,u=l||(x?d.floatingLabel:d.label),y=g?`cursor-${g}`:x?"cursor-text":"";return x?tu("label",{htmlFor:r,id:o,className:`absolute top-0 -translate-y-1/2 left-3 px-1.5 rounded-sm select-none z-10 font-bold bg-neutral-white transition-colors duration-150 ${y} ${u} ${v} ${p}`,children:[h,n&&eu("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):tu("label",{htmlFor:r,id:o,className:`inline-flex items-center font-bold transition-colors duration-150 ${y} ${u} ${v} ${p}`,children:[h,n&&eu("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})}import{jsx as tr,jsxs as _i}from"react/jsx-runtime";function Bt({size:e,variant:t,color:r,radius:o,label:n,labelPlacement:i="floating",config:a,helperText:s,errorMessage:l,leftIcon:m,leftAddon:f,rightIcon:w,rightAddon:g,onClear:p,wrapperClassName:b="",inputWrapperClassName:h="",labelClassName:x="",helperClassName:S="",id:k,value:v,defaultValue:d,onChange:u,disabled:y=!1,readOnly:c=!1,className:T="",type:R="text",placeholder:D,ref:N,...I}){let{isRequired:E=!1,isInvalid:P=!1,isLoading:F=!1,showSpinner:z=!1,isClearable:H=!1,isFullWidth:V=!0}=a??{},W=up(),L=k||W,M=`${L}-error-helper`,O=fp(null),A=pp([O,N]),U=v!==void 0,[G,K]=dp(d),q=U?v:G,X=J=>{U||K(J.target.value),u?.(J)},fe=()=>{U||K(""),p?.()},ae=q!=null?String(q).length>0:!1,_=!!(P||l),Z=_?"error":r,he=C(e,Ki,"md"),xe=C(o,Jo,"md"),$=t==="other"?"":C(Z,C(t,Qo,"outline"),"primary"),re=J=>tr("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${he.icon}`,"aria-hidden":"true",children:J}),ee=i==="floating",de=ee&&!!n,ne=()=>tr(bt,{htmlFor:L,label:n,isRequired:E,isFloating:ee,size:e,color:Z,hasError:_,className:x}),ze=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2",he.wrapper,xe,$,y?"opacity-50":"",V?"w-full":"w-auto",h].filter(Boolean).join(" "),ve=["w-full h-full bg-transparent outline-none border-none text-neutral-900 placeholder:text-neutral-400 disabled:cursor-not-allowed",he.input,m?"pl-1.5":"",w||H||F?"pr-1.5":"",T].filter(Boolean).join(" ");return _i("div",{className:`group/field relative flex ${i==="left"?"flex-row items-center gap-3":"flex-col"} ${de?"pt-2":""} ${V?"w-full":"inline-flex"} ${b}`,children:[!ee&&ne(),_i("div",{className:`flex flex-col ${V?"w-full":""}`,children:[_i("div",{className:"flex items-stretch",children:[f&&tr("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-r-0 border-neutral-300 text-sm font-medium ${xe?`${xe} rounded-r-none`:""}`,children:f}),_i("div",{className:`${ze} ${f?"rounded-l-none!":""} ${g?"rounded-r-none!":""}`,children:[ee&&ne(),m&&tr("div",{className:"flex items-center justify-center pl-3 shrink-0",children:re(m)}),tr("input",{ref:A,id:L,type:R,value:q,onChange:X,disabled:y||F,readOnly:c,"aria-invalid":_,"aria-required":E,"aria-describedby":l||s?M:void 0,"aria-errormessage":l?M:void 0,"aria-busy":F,"aria-disabled":y||F,placeholder:D,className:ve,...I}),F&&z&&tr("div",{className:"flex items-center justify-center pr-3 shrink-0",children:re(tr(Pe,{}))}),!F&&H&&!y&&!c&&tr("button",{type:"button",onClick:fe,"aria-label":"X\xF3a n\u1ED9i dung",tabIndex:ae?0:-1,"aria-hidden":!ae,className:`inline-flex items-center justify-center mr-2 shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${he.icon} ${ae?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:tr(Ye,{className:"size-full"})}),!F&&w&&tr("div",{className:"flex items-center justify-center pr-3 shrink-0",children:re(w)})]}),g&&tr("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-l-0 border-neutral-300 text-sm font-medium ${xe?`${xe} rounded-l-none`:""}`,children:g})]}),tr(He,{id:M,helperText:s,errorMessage:l,sizeClassName:he.helper,className:S})]})]})}import{useState as mp}from"react";import{jsx as en,jsxs as ou}from"react/jsx-runtime";function As({width:e=16,height:t=16,className:r="",...o}){return ou("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[en("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),en("circle",{cx:"12",cy:"12",r:"3"})]})}function ru({width:e=16,height:t=16,className:r="",...o}){return ou("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[en("path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24"}),en("path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"}),en("path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"}),en("line",{x1:"2",x2:"22",y1:"2",y2:"22"})]})}var jr=As;import{jsx as Xi}from"react/jsx-runtime";function Os({defaultVisible:e=!1,toggleAriaLabel:t="Hi\u1EC3n th\u1ECB/\u1EA9n m\u1EADt kh\u1EA9u",onVisibilityChange:r,rightIcon:o,disabled:n,readOnly:i,...a}){let[s,l]=mp(e);return Xi(Bt,{type:s?"text":"password",disabled:n,readOnly:i,rightIcon:o||Xi("button",{type:"button",onClick:()=>{if(n||i)return;let w=!s;l(w),r?.(w)},disabled:n||i,"aria-label":t,className:"inline-flex items-center justify-center size-full p-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-colors cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded",children:s?Xi(ru,{className:"size-full"}):Xi(As,{className:"size-full"})}),...a})}import{useState as gp}from"react";function Ur(e,t){if(e==null||e==="")return"";let r=t?.thousandSeparator??".",o=t?.decimalSeparator??",",n=t?.maxDecimalDigits??0,i=t?.min,a=t?.max,s=t?.clampMin??!1,l=t?.allowNegative??(i===void 0||i<0),m=String(e).trim();if(!m)return"";let f=l&&m.startsWith("-");if(f&&m==="-")return"-";if(n>0&&m.includes(o)){let x=m.split(o),S=x[0]?.replace(/\D/g,"")??"",k=x.slice(1).join("").replace(/\D/g,"").slice(0,n);if(S||k){let u=parseFloat(`${S||"0"}.${k||"0"}`);if(f&&(u=-u),a!==void 0&&!isNaN(u)&&u>a)return Ur(a,{...t,max:void 0,min:void 0});if(i!==void 0&&!isNaN(u)&&u<i&&(s||f&&i<0))return Ur(i,{...t,max:void 0,min:void 0})}let v=S?parseInt(S,10).toString().replace(/\B(?=(\d{3})+(?!\d))/g,r):"",d=f?"-":"";return x.length>1&&x[1]===""&&k===""?`${d}${v||"0"}${o}`:k.length>0?`${d}${v||"0"}${o}${k}`:`${d}${v}`}let w=m.replace(/\D/g,"");if(!w)return f?"-":"";let g=parseInt(w,10);if(isNaN(g))return"";f&&(g=-g),a!==void 0&&g>a&&(g=a),i!==void 0&&g<i&&(s||f&&i<0)&&(g=i);let p=g<0?"-":"",b=Math.abs(g).toString().replace(/\B(?=(\d{3})+(?!\d))/g,r);return`${p}${b}`}function nu(e,t){let r=t?.thousandSeparator??".";return e.split(r).join("")}function Yr(e,t){if(!e)return;let r=t?.thousandSeparator??".",o=t?.decimalSeparator??",",n=e.split(r).join("");if(o!=="."&&(n=n.split(o).join(".")),n=n.replace(/[^\d.-]/g,""),!n||n==="."||n==="-")return;let i=parseFloat(n);return isNaN(i)?void 0:i}function Gs(e,t,r,o){let n=o?.decimalSeparator??",",i=0;for(let l=0;l<r&&l<e.length;l++){let m=e.charAt(l);(/\d/.test(m)||m===n||m==="-")&&i++}if(i===0)return 0;let a=t.length,s=0;for(let l=0;l<t.length;l++){let m=t.charAt(l);if((/\d/.test(m)||m===n||m==="-")&&s++,s===i){a=l+1;break}}return Math.min(a,t.length)}function qi(e,t="numeric"){return t==="numeric"?/^\d$/.test(e):t==="alphanumeric"?/^[a-zA-Z0-9]$/.test(e):!0}function Zi(e,t="numeric"){return t==="numeric"?e.replace(/\D/g,""):t==="alphanumeric"?e.replace(/[^a-zA-Z0-9]/g,""):e}function Ji(e,t=/[\r\n,;\t]+/,r=!0){return e?e.split(t).map(o=>r?o.trim():o).filter(Boolean):[]}import{jsx as bp}from"react/jsx-runtime";function yo({value:e,defaultValue:t,min:r,max:o,thousandSeparator:n=".",decimalSeparator:i=",",maxDecimalDigits:a=0,allowNegative:s,onChange:l,onClear:m,onBlur:f,ref:w,...g}){let p={max:o,min:r,thousandSeparator:n,decimalSeparator:i,maxDecimalDigits:a,allowNegative:s},b=e!==void 0,[h,x]=gp(t),S=b?e:h,k=Ur(S,p),v=()=>{b||x(""),m?.()},d=y=>{let c=y.target,T=c.value,R=c.selectionStart||0,D=Ur(T,p),N=Gs(T,D,R,{decimalSeparator:i});if(b||x(D),c.value=D,l){let I={...y,target:c,currentTarget:c};l(I)}requestAnimationFrame(()=>{c&&c.setSelectionRange&&c.setSelectionRange(N,N)})},u=y=>{if(r!==void 0&&S!==void 0&&S!==null&&S!==""){let c=Yr(String(S),{thousandSeparator:n,decimalSeparator:i});if(c!==void 0&&c<r){let T=Ur(r,{...p,clampMin:!0});if(b||x(T),l){y.target.value=T;let R={...y,target:y.target,currentTarget:y.target};l(R)}}}f?.(y)};return bp(Bt,{ref:w,type:"text",inputMode:a>0?"decimal":"numeric",value:k,onChange:d,onBlur:u,onClear:v,...g})}import{useId as hp,useState as xp,useEffect as vp,useRef as yp,useImperativeHandle as wp}from"react";import{jsx as wo,jsxs as Gn}from"react/jsx-runtime";function js({ref:e,config:t,id:r,name:o,length:n=6,value:i,defaultValue:a="",onChange:s,onComplete:l,type:m="numeric",mask:f=!1,size:w="md",variant:g="outline",color:p="primary",radius:b,autoFocus:h=!1,disabled:x=!1,readOnly:S=!1,groupSize:k,separator:v="-",ariaLabel:d="One-time password",getSlotAriaLabel:u,allowOneTimeCode:y=!0,label:c,labelPlacement:T="top",helperText:R,errorMessage:D,className:N="",slotClassName:I="",wrapperClassName:E="",labelClassName:P="",helperClassName:F=""}){let{isRequired:z=!1,isInvalid:H=!1,isLoading:V=!1,showSpinner:W=!1}=t??{},L=hp(),M=r||L,O=`${M}-slot-0`,A=`${M}-error-helper`,[U,G]=xp(()=>{let J=(i!==void 0?i:a).split("");return Array.from({length:n},(j,oe)=>J[oe]||"")}),K=yp([]),q=i!==void 0,X=q?Array.from({length:n},(J,j)=>i&&i[j]!==void 0?i[j]:""):U,fe=!!(H||D),ae=fe?"error":p;vp(()=>{if(h&&!x&&!S){let J=X.findIndex(oe=>!oe),j=J!==-1?J:0;K.current[j]?.focus()}},[h,X,x,S]),wp(e,()=>({getValue:()=>X.join(""),clear:()=>{let J=Array(n).fill("");q||G(J),s?.(""),!x&&!S&&K.current[0]?.focus()},focus:(J=0)=>{let j=Math.max(0,Math.min(J,n-1));K.current[j]?.focus()}}),[X,n,q,s,x,S]);let _=J=>{q||G(J);let j=J.join("");s?.(j),J.every(oe=>oe.length>0)&&J.length===n&&l?.(j)},Z=(J,j)=>{let oe=Zi(J,m);if(!oe)return;let ye=[...X],ue=oe.length>=n?0:j,ce=oe.slice(0,n-ue).split("");ce.forEach((Te,pe)=>{ue+pe<n&&(ye[ue+pe]=Te)}),_(ye);let ke=Math.min(ue+ce.length,n-1);K.current[ke]?.focus()},he=(J,j)=>{if(x||S||V)return;let oe=J.target.value;if(!oe){let ue=[...X];ue[j]="",_(ue);return}if(oe.length>1){Z(oe,j);return}let ye=oe.slice(-1);if(qi(ye,m)){let ue=[...X];ue[j]=ye,_(ue),j<n-1&&K.current[j+1]?.focus()}},xe=(J,j)=>{if(!(x||S||V)){if(J.key==="Backspace"){J.preventDefault();let oe=[...X];X[j]?(oe[j]="",_(oe)):j>0&&(oe[j-1]="",_(oe),K.current[j-1]?.focus())}else if(J.key==="Delete"){J.preventDefault();let oe=[...X];oe[j]="",_(oe)}else if(J.key==="ArrowLeft")J.preventDefault(),j>0&&K.current[j-1]?.focus();else if(J.key==="ArrowRight")J.preventDefault(),j<n-1&&K.current[j+1]?.focus();else if((J.ctrlKey||J.metaKey)&&J.key.toLowerCase()==="c"){let oe=X.join("");oe&&navigator.clipboard?.writeText(oe)}else if((J.ctrlKey||J.metaKey)&&J.key.toLowerCase()==="x"){J.preventDefault();let oe=X.join("");oe&&navigator.clipboard?.writeText(oe);let ye=Array(n).fill("");_(ye),K.current[0]?.focus()}}},$=(J,j)=>{if(x||S||V)return;J.preventDefault();let oe=J.clipboardData.getData("text/plain");Z(oe,j)},re=C(w,Jc,"md"),ee=C(w,Ki,"md"),de=C(b,Jo,"md"),ne=g==="other"?"":C(ae,C(g,Qo,"outline"),"primary"),ze=x?"opacity-50":"",ve=()=>c?Gn("label",{htmlFor:O,className:`block font-medium text-neutral-700 select-none ${re.label} ${P}`,children:[c,z&&wo("span",{className:"text-error-500 ml-0.5",children:"*"})]}):null;return Gn("div",{className:`group/otp flex ${T==="left"?"flex-row items-start gap-3":"flex-col"} ${E}`,children:[ve(),Gn("div",{className:"flex flex-col",children:[Gn("div",{role:"group","aria-label":d,"aria-describedby":D||R?A:void 0,className:`inline-flex items-center ${re.gap} ${N}`,children:[Array.from({length:n}).map((J,j)=>{let oe=!!(f||m==="password"),ye=u?u(j,n):`K\xFD t\u1EF1 ${j+1} tr\xEAn ${n}`,ue=!!(k&&k>0)&&(j+1)%(k||1)===0&&j<n-1;return Gn("div",{className:"inline-flex items-center gap-1.5",children:[wo("input",{id:`${M}-slot-${j}`,ref:ce=>{K.current[j]=ce},type:oe?"password":"text",inputMode:m==="numeric"?"numeric":"text",pattern:m==="numeric"?"[0-9]*":void 0,maxLength:1,value:X[j]||"",onFocus:ce=>ce.target.select(),onChange:ce=>he(ce,j),onKeyDown:ce=>xe(ce,j),onPaste:ce=>$(ce,j),disabled:x||V,readOnly:S,"aria-label":ye,"aria-invalid":fe,"aria-required":z,"aria-busy":V,"aria-disabled":x||V,autoComplete:y?"one-time-code":"off",autoCorrect:"off",autoCapitalize:"none",spellCheck:!1,"data-1p-ignore":"true","data-lpignore":"true","data-form-type":"other",className:`border-2 text-center p-0 outline-none transition-all duration-150 ease-in-out text-neutral-900 ${re.slot} ${re.text} ${de} ${ne} ${ze} ${I}`}),ue&&wo("span",{"aria-hidden":"true",className:"inline-flex items-center justify-center text-neutral-400 select-none font-bold shrink-0",children:v})]},`${M}-slot-${j}`)}),V&&W&&wo("div",{role:"status","aria-label":"\u0110ang t\u1EA3i",className:"inline-flex items-center justify-center pl-1.5 shrink-0 text-neutral-400",children:wo(Pe,{className:`animate-spin ${ee.icon}`})})]}),wo(He,{id:A,helperText:R,errorMessage:D,sizeClassName:re.helper,className:F}),o&&wo("input",{type:"hidden",name:o,value:X.join(""),disabled:x||V})]})]})}import{useId as Sp,useState as Us,useRef as Tp}from"react";import{useMergeRefs as kp}from"@floating-ui/react";import{jsx as iu,jsxs as Cp}from"react/jsx-runtime";function yr({width:e=14,height:t=14,className:r="",...o}){return Cp("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[iu("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),iu("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}import{Fragment as Rp,jsx as ht,jsxs as Co}from"react/jsx-runtime";function Ys({size:e,variant:t,color:r,radius:o,label:n,labelPlacement:i="floating",config:a,helperText:s,errorMessage:l,leftIcon:m,leftAddon:f,rightIcon:w,rightAddon:g,onClear:p,wrapperClassName:b="",inputWrapperClassName:h="",labelClassName:x="",helperClassName:S="",id:k,name:v,value:d,defaultValue:u=[],onChange:y,inputValue:c,onInputValueChange:T,delimiters:R=["Enter"],showAddButton:D=!1,renderAddButton:N,addOnBlur:I=!1,addOnPaste:E=!0,pasteSplitRegex:P=/[\r\n,;\t]+/,trimValues:F=!0,allowDuplicates:z=!1,onDuplicate:H,maxTags:V,onMaxTagsReached:W,maxTagLength:L,validateTag:M,onValidateError:O,maxTagCount:A,renderTag:U,tagVariant:G,tagColor:K,tagRadius:q,tagSize:X,tagClassName:fe="",addButtonClassName:ae="",disabled:_=!1,readOnly:Z=!1,className:he="",placeholder:xe="Nh\u1EADp v\xE0 nh\u1EA5n Enter...",autoFocus:$=!1,ref:re}){let{isRequired:ee=!1,isInvalid:de=!1,isLoading:ne=!1,showSpinner:ze=!1,isClearable:ve=!1,isFullWidth:Ce=!0}=a??{},J=Sp(),j=k||J,oe=`${j}-error-helper`,ye=n?`${j}-label`:void 0,ue=Tp(null),ce=kp([ue,re]),ke=d!==void 0,[Te,pe]=Us(u),Y=ke?d||[]:Te,me=c!==void 0,[De,ie]=Us(""),B=me?c||"":De,[se,Ie]=Us(""),Ae=be=>{me||ie(be),T?.(be)},le=be=>{ke||pe(be),y?.(be)},ge=be=>{if(_||Z||ne)return!1;let Se=F?be.trim():be;if(!Se)return!1;if(L&&L>0&&Se.length>L&&(Se=Se.slice(0,L)),V!==void 0&&Y.length>=V)return W?.(Se),Ie(`Maximum limit of ${V} tags reached`),!1;if(!z&&Y.includes(Se))return H?.(Se),Ie(`Tag "${Se}" already exists`),!1;if(M){let rt=M(Se);if(rt===!1||typeof rt=="string")return O?.(Se,typeof rt=="string"?rt:void 0),Ie(`Tag "${Se}" is invalid`),!1}let et=[...Y,Se];return le(et),Ae(""),Ie(`Added tag "${Se}"`),!0},Me=be=>{if(_||Z||ne)return;let Se=[...Y],et=new Set(Y),rt=0;for(let te of be){let Q=F?te.trim():te;if(Q){if(L&&L>0&&Q.length>L&&(Q=Q.slice(0,L)),V!==void 0&&Se.length>=V){W?.(Q);break}if(!z&&et.has(Q)){H?.(Q);continue}if(M){let Ue=M(Q);if(Ue===!1||typeof Ue=="string"){O?.(Q,typeof Ue=="string"?Ue:void 0);continue}}Se.push(Q),et.add(Q),rt++}}le(Se),Ae(""),rt>0&&Ie(`Added ${rt} tags`)},Le=be=>{if(_||Z||ne)return;let Se=Y[be],et=Y.filter((rt,te)=>te!==be);le(et),Se&&Ie(`Removed tag "${Se}"`)},Ve=be=>{be?.stopPropagation(),!(_||Z||ne)&&(le([]),Ae(""),Ie("Removed all tags"),p?.(),ue.current?.focus())},Be=be=>{if(_||Z||ne)return;R.includes(be.key)||R.includes("Enter")&&be.key==="Enter"||R.includes("Comma")&&(be.key===","||be.key==="Comma")||R.includes("Tab")&&be.key==="Tab"||R.includes("Space")&&(be.key===" "||be.key==="Space")?B&&(be.preventDefault(),ge(B)):be.key==="Backspace"&&B===""&&Y.length>0&&(be.preventDefault(),Le(Y.length-1))},je=be=>{if(!(_||Z||ne)&&E){let Se=be.clipboardData.getData("text");if(Se){let et=Ji(Se,P,F);(et.length>1||P.test(Se))&&(be.preventDefault(),Me(et))}}},ut=()=>{I&&B.trim()&&ge(B)},Re=Y.length>0||B.length>0,Xe=!!(de||l),qe=Xe?"error":r,at=C(e,Zc,"md"),ot=C(o,Jo,"md"),vt=q||C(o,qc,"md"),Ee=X||at.badgeSize||"sm",yt=K||r,pt=G||t,mt=t==="other"?"":C(qe,C(t,Qo,"outline"),"primary"),tt=i==="floating",Rt=tt&&!!n,Oe=be=>ht("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${at.icon}`,"aria-hidden":"true",children:be}),dt=()=>ht(bt,{id:ye,htmlFor:j,label:n,isRequired:ee,isFloating:tt,size:e,color:qe,hasError:Xe,className:x}),we=A&&A>0?Y.slice(0,A):Y,We=A&&A>0?Math.max(0,Y.length-A):0,wt=_?"opacity-50 cursor-not-allowed pointer-events-none":"cursor-text",Ke=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2",at.wrapper,ot,mt,wt,Ce?"w-full":"w-auto min-w-[200px]",h].filter(Boolean).join(" "),Dt=i==="left",Pt=V===void 0||Y.length<V,Fe=D&&!_&&!Z;return Co("div",{role:"group","aria-labelledby":ye,className:`group/field relative flex ${Dt?"flex-row items-center gap-3":"flex-col"} ${Rt?"pt-2":""} ${Ce?"w-full":"inline-flex"} ${b}`,children:[ht("span",{className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true",children:se}),!tt&&dt(),Co("div",{className:`flex flex-col ${Ce?"w-full":""}`,children:[Co("div",{className:"flex items-stretch",children:[f&&ht("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-r-0 border-neutral-300 text-sm font-medium ${ot?`${ot} rounded-r-none`:""}`,children:f}),Co("div",{className:`${Ke} ${f?"rounded-l-none!":""} ${g?"rounded-r-none!":""}`,children:[tt&&dt(),m&&ht("div",{className:"flex items-center justify-center pl-1 pr-1.5 shrink-0",children:Oe(m)}),Co("div",{className:`flex flex-wrap items-center flex-1 min-w-0 ${at.gap}`,children:[(()=>{let be=new Map;return we.map((Se,et)=>{let rt=(be.get(Se)??0)+1;be.set(Se,rt);let te=`${Se}_${rt}`;return U?ht("span",{className:"inline-flex shrink-0",children:U({value:Se,index:et,onRemove:()=>Le(et),disabled:_,readOnly:Z})},te):ht("span",{className:"inline-flex shrink-0",children:ht(Kt,{size:Ee,variant:pt,color:yt,radius:vt,deleteAriaLabel:`Remove tag ${Se}`,onDelete:!_&&!Z?()=>Le(et):void 0,className:`shrink-0 max-w-full truncate select-none ${fe}`,children:Se})},te)})})(),We>0&&ht("span",{className:"inline-flex shrink-0",children:Co(Kt,{size:Ee,variant:"filled",color:"neutral",radius:vt,className:"shrink-0 font-medium select-none",children:["+",We]})}),Pt?ht("input",{ref:ce,id:j,type:"text",value:B,onChange:be=>Ae(be.target.value),onKeyDown:Be,onPaste:je,onBlur:ut,disabled:_||ne,readOnly:Z,autoFocus:$,"aria-invalid":Xe,"aria-required":ee,"aria-describedby":l||s?oe:void 0,"aria-errormessage":l?oe:void 0,"aria-busy":ne,"aria-disabled":_||ne,"aria-autocomplete":"none",placeholder:Y.length===0?xe:"",className:`flex-1 bg-transparent outline-none border-none text-neutral-900 placeholder:text-neutral-400 disabled:cursor-not-allowed ${at.input} ${he}`}):null]}),Fe&&ht("div",{className:"flex items-center justify-center pl-1.5 shrink-0",children:N?N({onAdd:()=>ge(B),disabled:!B.trim()||!Pt}):ht("button",{type:"button",onClick:be=>{be.stopPropagation(),B.trim()&&Pt?ge(B):ue.current?.focus()},disabled:!B.trim()||!Pt,"aria-label":"Th\xEAm th\u1EBB",className:`inline-flex items-center justify-center p-1 rounded hover:bg-neutral-200 active:scale-95 disabled:opacity-40 disabled:pointer-events-none transition-all cursor-pointer text-neutral-600 hover:text-neutral-900 ${ae}`,children:ht(yr,{className:at.icon})})}),ne&&ze&&ht("div",{className:"flex items-center justify-center pl-1.5 shrink-0",role:"status","aria-label":"\u0110ang t\u1EA3i",children:Oe(ht(Pe,{}))}),!ne&&ve&&!_&&!Z&&ht("button",{type:"button",onClick:Ve,"aria-label":"X\xF3a t\u1EA5t c\u1EA3 c\xE1c th\u1EBB",tabIndex:Re?0:-1,"aria-hidden":!Re,className:`inline-flex items-center justify-center pl-1.5 shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${at.icon} ${Re?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:ht(Ye,{className:"size-full"})}),!ne&&w&&ht("div",{className:"flex items-center justify-center pl-1.5 shrink-0",children:Oe(w)})]}),g&&ht("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-l-0 border-neutral-300 text-sm font-medium ${ot?`${ot} rounded-l-none`:""}`,children:g})]}),ht(He,{id:oe,helperText:s,errorMessage:l,sizeClassName:at.helper,className:S}),v&&(()=>{let be=new Map;return Co(Rp,{children:[Y.map(Se=>{let et=(be.get(Se)??0)+1;be.set(Se,et);let rt=`${Se}_${et}`;return ht("input",{type:"hidden",name:`${v}[]`,value:Se,disabled:_||ne},`hidden_${rt}`)}),Y.length===0&&ht("input",{type:"hidden",name:v,value:"",disabled:_||ne})]})})()]})]})}import{useId as Dp,useState as Np,useRef as Pp}from"react";import zp from"react-textarea-autosize";import{useMergeRefs as Ip}from"@floating-ui/react";var au={xs:{textarea:"text-[11px] px-2 py-1 leading-tight",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{textarea:"text-xs px-2.5 py-1.5 leading-normal",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{textarea:"text-sm px-3.5 py-2 leading-normal",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{textarea:"text-base px-4 py-2.5 leading-normal",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{textarea:"text-lg px-5 py-3 leading-normal",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},su={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},lu={none:"resize-none",vertical:"resize-y",horizontal:"resize-x",both:"resize"},cu={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-error-50/60 border border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-50/60 border border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},ghost:{primary:"bg-transparent border border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-transparent border border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-transparent border border-transparent hover:bg-neutral-100/50 focus-within:bg-neutral-100/50 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"}};import{jsx as Wr,jsxs as Qi}from"react/jsx-runtime";function Ws({size:e,variant:t,color:r,radius:o,label:n,labelPlacement:i="floating",config:a,helperText:s,errorMessage:l,onClear:m,minRows:f=3,maxRows:w,onHeightChange:g,cacheMeasurements:p,resize:b="none",wrapperClassName:h="",textareaWrapperClassName:x="",labelClassName:S="",helperClassName:k="",countClassName:v="",id:d,value:u,defaultValue:y,onChange:c,disabled:T=!1,readOnly:R=!1,className:D="",placeholder:N,maxLength:I,ref:E,style:P,...F}){let{isRequired:z=!1,isInvalid:H=!1,isLoading:V=!1,showSpinner:W=!1,isClearable:L=!1,showCount:M=!1,isFullWidth:O=!0,autoResize:A=!0}=a??{},U=Dp(),G=d||U,K=`${G}-error-helper`,q=Pp(null),[X,fe]=Np(y),ae=Ip([q,E]),_=u!==void 0,Z=_?u:X,he=!!(H||l),xe=he?"error":r,$=C(e,au,"md"),re=C(o,su,"md"),ee=A?"resize-none":C(b,lu,"none"),de=t==="other"?"":C(xe,C(t,cu,"outline"),"primary"),ne=Z!=null?String(Z).length:0,ze=ne>0,ve=pe=>{let Y=pe.target.value;I!==void 0&&Y.length>I&&(Y=Y.slice(0,I),pe.target.value=Y),_||fe(Y),c?.(pe)},Ce=()=>{_||fe(""),m?.()},J=i==="floating",j=J&&!!n,oe=()=>Wr(bt,{htmlFor:G,label:n,isRequired:z,isFloating:J,size:e,color:xe,hasError:he,className:S}),ye=["group/textarea relative flex flex-col transition-all duration-150 ease-in-out border-2",re,de,T?"opacity-50":"",O?"w-full":"w-auto",x].filter(Boolean).join(" "),ue=L||V&&W,ce=["w-full bg-transparent outline-none border-none text-neutral-900 placeholder:text-neutral-400 disabled:cursor-not-allowed ui-scrollbar",$.textarea,ue?"pr-8":"",M?"pb-6":"",ee,D].filter(Boolean).join(" "),ke=i==="left",Te={id:G,value:Z,onChange:ve,disabled:T||V,readOnly:R,maxLength:I,"aria-invalid":he,"aria-required":z,"aria-describedby":l||s?K:void 0,"aria-errormessage":l?K:void 0,"aria-busy":V,"aria-disabled":T||V,placeholder:N,className:ce,style:P,...F};return Qi("div",{className:`group/field relative flex ${ke?"flex-row items-start gap-3":"flex-col"} ${j?"pt-2":""} ${O?"w-full":"inline-flex"} ${h}`,children:[!J&&oe(),Qi("div",{className:`flex flex-col ${O?"w-full":""}`,children:[Qi("div",{className:ye,children:[J&&oe(),A?Wr(zp,{ref:ae,minRows:f,maxRows:w,onHeightChange:g,cacheMeasurements:p,...Te}):Wr("textarea",{ref:ae,rows:f,...Te}),V&&W&&Wr("div",{className:"absolute top-2.5 right-2.5 text-neutral-400 size-4 select-none pointer-events-none",children:Wr(Pe,{className:"size-full animate-spin"})}),!V&&L&&!T&&!R&&Wr("button",{type:"button",onClick:Ce,"aria-label":"X\xF3a n\u1ED9i dung",tabIndex:ze?0:-1,"aria-hidden":!ze,className:`absolute top-2.5 right-2.5 inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full size-4 ${ze?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:Wr(Ye,{className:"size-full"})}),M&&Qi("div",{className:`absolute bottom-2 right-2.5 text-[11px] font-mono select-none pointer-events-none z-10 text-neutral-400 ${v}`,children:[ne,I!==void 0&&`/${I}`]})]}),Wr(He,{id:K,helperText:s,errorMessage:l,sizeClassName:$.helper,className:k})]})]})}import{useId as Fp,useState as Mp}from"react";var ea={xs:{box:"size-3.5",icon:"size-2.5",label:"text-xs leading-4",gap:"gap-1.5",helper:"text-[10px]"},sm:{box:"size-4",icon:"size-3",label:"text-sm leading-4",gap:"gap-2",helper:"text-[11px]"},md:{box:"size-5",icon:"size-3.5",label:"text-sm leading-5",gap:"gap-2.5",helper:"text-xs"},lg:{box:"size-6",icon:"size-4",label:"text-base leading-6",gap:"gap-3",helper:"text-xs"},xl:{box:"size-7",icon:"size-5",label:"text-lg leading-7",gap:"gap-3.5",helper:"text-sm"}},uu={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},du={filled:{primary:"bg-primary-600 text-neutral-white border-primary-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-600 text-neutral-white border-secondary-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-600 text-neutral-white border-error-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-600 text-neutral-white border-success-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-500 text-neutral-950 border-warning-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-600 text-neutral-white border-info-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-800 text-neutral-white border-neutral-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},outline:{primary:"bg-transparent text-primary-600 border-2 border-primary-600 hover:bg-primary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-transparent text-secondary-600 border-2 border-secondary-600 hover:bg-secondary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-transparent text-error-600 border-2 border-error-600 hover:bg-error-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-transparent text-success-600 border-2 border-success-600 hover:bg-success-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-transparent text-warning-700 border-2 border-warning-500 hover:bg-warning-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-transparent text-info-600 border-2 border-info-600 hover:bg-info-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-transparent text-neutral-800 border-2 border-neutral-800 hover:bg-neutral-100/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},soft:{primary:"bg-primary-100 text-primary-800 border-primary-300 hover:bg-primary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-100 text-secondary-800 border-secondary-300 hover:bg-secondary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-100 text-error-800 border-error-300 hover:bg-error-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-100 text-success-800 border-success-300 hover:bg-success-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-100 text-warning-900 border-warning-300 hover:bg-warning-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-100 text-info-800 border-info-300 hover:bg-info-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-100 text-neutral-800 border-neutral-300 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"}},fu={horizontal:"flex flex-row flex-wrap gap-4 items-center",vertical:"flex flex-col gap-2.5"},pu={xs:"sm",sm:"sm",md:"md",lg:"md",xl:"lg"};import{jsx as mu}from"react/jsx-runtime";function Kr({width:e=14,height:t=14,className:r="",...o}){return mu("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:mu("polyline",{points:"20 6 9 17 4 12"})})}import{jsx as gu}from"react/jsx-runtime";function ta({width:e=14,height:t=14,className:r="",...o}){return gu("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:gu("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})}import{jsx as wr,jsxs as Ks}from"react/jsx-runtime";function Cr({size:e="md",variant:t="filled",color:r="primary",radius:o,config:n,label:i,children:a,helperText:s,errorMessage:l,labelPlacement:m="right",icon:f,indeterminateIcon:w,wrapperClassName:g="",boxClassName:p="",labelClassName:b="",helperClassName:h="",className:x="",checked:S,defaultChecked:k,disabled:v=!1,readOnly:d=!1,onChange:u,value:y,id:c,name:T,ref:R,...D}){let{isRequired:N=!1,isInvalid:I=!1,isLoading:E=!1,showSpinner:P=!1,indeterminate:F=!1}=n??{},z=i||a,H=Fp(),V=c||H,W=`${V}-helper`,L=!!(I??!!l),M=S!==void 0,[O,A]=Mp(k??!1),U=M?S:O,G=ee=>{v||d||E||(M||A(ee.target.checked),u?.(ee))},K=C(e,ea,"md"),q=C(o,uu,"md"),X=U||F,fe=C(t==="other"?"filled":t,du,"filled"),ae;t==="other"?ae="":X?ae=C(r,fe,"primary"):ae="bg-neutral-white border-neutral-300 hover:border-neutral-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",L&&(ae=X?C("error",fe,"primary"):"bg-neutral-white border-error-500 hover:border-error-600 text-error-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500");let _=["inline-flex items-center justify-center shrink-0 border transition-all duration-150 select-none",K.box,q,ae,!v&&!d&&!E?"active:scale-95":"",p].filter(Boolean).join(" "),Z=["select-none font-medium text-neutral-900 transition-colors",K.label,v?"opacity-60":"",b].filter(Boolean).join(" "),he=["group inline-flex relative",m==="left"?"flex-row-reverse justify-between":"flex-row",K.gap,v?"opacity-50":"cursor-pointer",g,x].filter(Boolean).join(" "),xe=()=>E&&P?wr("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${K.icon}`,"aria-hidden":"true",children:wr(Pe,{className:"size-full animate-spin"})}):F?wr("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${K.icon}`,"aria-hidden":"true",children:w||wr(ta,{className:"size-full"})}):U?wr("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${K.icon}`,"aria-hidden":"true",children:f||wr(Kr,{className:"size-full"})}):null,$=!!z,re=ee=>{(v||d||E)&&ee.preventDefault()};return Ks("div",{className:`inline-flex flex-col ${x}`.trim(),children:[Ks("label",{className:he,onClick:re,children:[wr("input",{ref:R,type:"checkbox",id:V,name:T,value:y,checked:U,disabled:v||E,readOnly:d,required:N,"aria-checked":F?"mixed":U,"aria-invalid":L,"aria-required":N,"aria-busy":E,"aria-disabled":v||E,"aria-describedby":l||s?W:void 0,onChange:G,className:"sr-only peer",...D}),wr("span",{className:_,"aria-hidden":"true",children:xe()}),$&&Ks("span",{className:Z,children:[z,N&&wr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})]}),wr(He,{id:W,helperText:s,errorMessage:l,sizeClassName:K.helper,className:h})]})}import{useState as jn,useId as Lp,useMemo as yu,useCallback as Bp}from"react";import{useRef as bu,useEffect as hu,useCallback as xu}from"react";function So(e,t=300){let r=bu(e),o=bu(null);hu(()=>{r.current=e},[e]);let n=xu(()=>{o.current&&(clearTimeout(o.current),o.current=null)},[]);return hu(()=>n,[n]),{debounced:xu((...a)=>{n(),o.current=setTimeout(()=>{r.current(...a)},t)},[n,t]),cancel:n}}import{jsx as vu,jsxs as $p}from"react/jsx-runtime";function Ep({width:e=16,height:t=16,className:r="",...o}){return $p("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[vu("circle",{cx:"11",cy:"11",r:"8"}),vu("line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"})]})}var To=Ep;import{jsx as Mr,jsxs as wu}from"react/jsx-runtime";var Hp=[],Vp=[];function ko({value:e,defaultValue:t=Vp,onChange:r,size:o="md",color:n="primary",variant:i="filled",radius:a,disabled:s=!1,label:l,helperText:m,errorMessage:f,orientation:w="vertical",labelPlacement:g="right",className:p="",wrapperClassName:b="",labelClassName:h="",helperClassName:x="",options:S=Hp,config:k,searchMode:v="client",searchPlaceholder:d="T\xECm ki\u1EBFm...",searchValue:u,defaultSearchValue:y="",onSearchChange:c,searchClassName:T="",searchField:R="label",filterFn:D,onSearch:N,debounceMs:I=300,emptyText:E="Kh\xF4ng t\xECm th\u1EA5y k\u1EBFt qu\u1EA3",children:P,ref:F,...z}){let{isRequired:H=!1,isInvalid:V,isLoading:W=!1,showSpinner:L=!1,isReadOnly:M=!1,searchable:O=!1,preserveSelected:A=!0,isSearching:U}=k??{},G=Lp(),K=`${G}-label`,q=`${G}-helper`,X=`${G}-search`,fe=e!==void 0,[ae,_]=jn(t),Z=fe?e:ae,he=!!(V??!!f),xe=u!==void 0,[$,re]=jn(y),ee=xe?u:$,[de,ne]=jn(null),[ze,ve]=jn(!1),Ce=!!(U??ze),[J,j]=jn(()=>{let ie=new Map;return S.forEach(B=>{ie.set(String(B.value),B)}),ie}),{debounced:oe}=So(async ie=>{if(!(v!=="server"||!N))try{ve(!0);let B=await N(ie);Array.isArray(B)&&ne(B)}catch(B){console.error("Error fetching search options:",B)}finally{ve(!1)}},I),ye=ie=>{let B=ie.target.value;xe||re(B),c?.(B),v==="server"&&oe(B)},ue=()=>{xe||re(""),c?.(""),v==="server"&&oe("")},ce=yu(()=>{let ie=ee.trim(),B=v==="server"&&de?de:S;if(!O||!ie)return B;let se;if(v==="server"?se=B:D?se=B.filter(le=>D(le,ie)):se=vo(B,ie,R),!A)return se;let Ie=new Set(se.map(le=>String(le.value))),Ae=[];for(let le of Z)if(!Ie.has(le)){let ge=J.get(le);ge?Ae.push(ge):Ae.push({value:le,label:le})}return[...Ae,...se]},[O,ee,v,de,S,D,R,A,Z,J]),ke=Bp((ie,B)=>{if(s||M||W)return;if(B){let Ae=(v==="server"&&de?de:S).find(le=>String(le.value)===ie);Ae&&j(le=>{if(le.has(ie))return le;let ge=new Map(le);return ge.set(ie,Ae),ge})}let se;B?se=[...Z,ie]:se=Z.filter(Ie=>Ie!==ie),fe||_(se),r?.(se)},[s,M,W,Z,fe,r,S,v,de]),Te=C(w,fu,"vertical"),pe=["text-sm font-semibold text-neutral-900 mb-1.5 select-none",s?"opacity-60":"",h].filter(Boolean).join(" "),Y=C(o,ea,"md"),me=C(o,pu,"md"),De=yu(()=>new Set(Z.map(String)),[Z]);return wu("div",{ref:F,role:"group","aria-labelledby":l?K:void 0,"aria-describedby":f||m?q:void 0,"aria-disabled":s||W?"true":void 0,"aria-busy":W||Ce?"true":void 0,className:`inline-flex flex-col ${b}`,...z,children:[l&&wu("span",{id:K,className:pe,children:[l,H&&Mr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),O&&Mr("div",{className:`mb-2.5 ${T}`,children:Mr(Bt,{id:X,variant:"outline",size:me,color:n,value:ee,onChange:ye,placeholder:d,disabled:s,leftIcon:Mr(To,{className:"size-4 text-neutral-400"}),rightIcon:Ce?Mr(Pe,{className:"size-4 animate-spin text-neutral-400"}):void 0,onClear:ue,"aria-label":typeof l=="string"?`T\xECm ki\u1EBFm ${l}`:"T\xECm ki\u1EBFm",config:{isClearable:!Ce,isFullWidth:!0}})}),Mr("div",{className:`${Te} ${p}`,children:P||(ce.length>0?ce.map(ie=>{let B=String(ie.value),se=De.has(B);return Mr(Cr,{value:ie.value,label:ie.label,helperText:ie.description,disabled:s||!!ie.disabled,readOnly:M||!!ie.isReadOnly,size:o,color:n,variant:i,radius:a,labelPlacement:g,checked:se,onChange:Ie=>ke(B,Ie.target.checked),config:{indeterminate:ie.indeterminate,isLoading:W,showSpinner:L,isInvalid:he,isRequired:H}},ie.value)}):Mr("div",{className:"py-2 text-xs text-neutral-500 italic",children:!ee.trim()&&v==="server"?"Nh\u1EADp t\u1EEB kh\xF3a \u0111\u1EC3 t\xECm ki\u1EBFm...":E}))}),Mr(He,{id:q,helperText:m,errorMessage:f,sizeClassName:Y.helper,className:x})]})}import{useId as Ap,useState as Op}from"react";var ra={xs:{box:"size-3.5",dot:"size-1.5",label:"text-xs leading-4",gap:"gap-1.5",helper:"text-[10px]"},sm:{box:"size-4",dot:"size-2",label:"text-sm leading-4",gap:"gap-2",helper:"text-[11px]"},md:{box:"size-5",dot:"size-2.5",label:"text-sm leading-5",gap:"gap-2.5",helper:"text-xs"},lg:{box:"size-6",dot:"size-3",label:"text-base leading-6",gap:"gap-3",helper:"text-xs"},xl:{box:"size-7",dot:"size-3.5",label:"text-lg leading-7",gap:"gap-3.5",helper:"text-sm"}},oa={filled:{primary:"bg-primary-600 text-neutral-white border-primary-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-600 text-neutral-white border-secondary-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-600 text-neutral-white border-error-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-600 text-neutral-white border-success-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-500 text-neutral-950 border-warning-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-600 text-neutral-white border-info-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-800 text-neutral-white border-neutral-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},outline:{primary:"bg-transparent text-primary-600 border-2 border-primary-600 hover:bg-primary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-transparent text-secondary-600 border-2 border-secondary-600 hover:bg-secondary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-transparent text-error-600 border-2 border-error-600 hover:bg-error-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-transparent text-success-600 border-2 border-success-600 hover:bg-success-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-transparent text-warning-700 border-2 border-warning-500 hover:bg-warning-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-transparent text-info-600 border-2 border-info-600 hover:bg-info-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-transparent text-neutral-800 border-2 border-neutral-800 hover:bg-neutral-100/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},soft:{primary:"bg-primary-100 text-primary-800 border-primary-300 hover:bg-primary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-100 text-secondary-800 border-secondary-300 hover:bg-secondary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-100 text-error-800 border-error-300 hover:bg-error-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-100 text-success-800 border-success-300 hover:bg-success-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-100 text-warning-900 border-warning-300 hover:bg-warning-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-100 text-info-800 border-info-300 hover:bg-info-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-100 text-neutral-800 border-neutral-300 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"}},Cu={horizontal:"flex flex-row flex-wrap gap-4 items-center",vertical:"flex flex-col gap-2.5"},Su={xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"xl"};import{jsx as Tu}from"react/jsx-runtime";function na({className:e}){return Tu("svg",{viewBox:"0 0 10 10",className:e,fill:"currentColor","aria-hidden":"true",children:Tu("circle",{cx:"5",cy:"5",r:"5"})})}import{jsx as _r,jsxs as Xs}from"react/jsx-runtime";function Un({size:e="md",variant:t="filled",color:r="primary",disabled:o=!1,readOnly:n=!1,config:i,labelPlacement:a="right",label:s,helperText:l,errorMessage:m,dotIcon:f,wrapperClassName:w="",boxClassName:g="",labelClassName:p="",helperClassName:b="",className:h="",checked:x,defaultChecked:S=!1,onChange:k,value:v,id:d,name:u,ref:y,...c}){let{isRequired:T=!1,isInvalid:R=!1,isLoading:D=!1}=i??{},N=Ap(),I=d||N,E=`${I}-helper`,P=x!==void 0,[F,z]=Op(S),H=P?x:F,V=!!(R||m),W=ae=>{o||n||D||(P||z(ae.target.checked),k?.(ae))},L=C(e,ra,"md"),M=t==="other"?"":C(r,C(t,oa,"filled"),"primary"),O=V?oa[t==="other"?"filled":t]?.error||oa.filled.error:H?M:"bg-neutral-white border-neutral-300 hover:border-neutral-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",A=["inline-flex items-center justify-center shrink-0 border rounded-full transition-all duration-150 select-none",L.box,O,!o&&!n&&!D?"active:scale-95":"",g].filter(Boolean).join(" "),U=["select-none font-medium text-neutral-900 transition-colors",L.label,o?"opacity-60":"",p].filter(Boolean).join(" "),G=["group inline-flex relative",a==="left"?"flex-row-reverse justify-between":"flex-row",L.gap,o?"cursor-not-allowed opacity-60":"cursor-pointer",w,h].filter(Boolean).join(" "),K=()=>D?_r("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${L.dot}`,"aria-hidden":"true",children:_r(Pe,{className:"size-full animate-spin"})}):H?_r("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${L.dot}`,"aria-hidden":"true",children:f||_r(na,{className:"size-full"})}):null,q=!!s;return Xs("div",{className:"inline-flex flex-col",children:[Xs("label",{className:G,onClick:ae=>{(o||n||D)&&ae.preventDefault()},children:[_r("input",{ref:y,type:"radio",id:I,name:u,value:v,checked:H,disabled:o||D,readOnly:n,required:T,"aria-busy":D,"aria-disabled":o||D,"aria-describedby":m||l?E:void 0,onChange:W,onClick:ae=>{if(o||n||D){ae.preventDefault();return}c.onClick?.(ae)},className:"sr-only peer",...c}),_r("span",{className:A,"aria-hidden":"true",children:K()}),q&&Xs("span",{className:U,children:[s,T&&_r("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})]}),_r(He,{id:E,helperText:l,errorMessage:m,sizeClassName:L.helper,className:b})]})}import{useState as Yn,useId as ku,useMemo as Gp,useCallback as jp}from"react";import{jsx as Er,jsxs as Ru}from"react/jsx-runtime";var Up=[];function qs({options:e=Up,value:t,defaultValue:r=null,onChange:o,size:n="md",color:i="primary",variant:a="filled",disabled:s=!1,label:l,helperText:m,errorMessage:f,orientation:w="vertical",labelPlacement:g="right",className:p="",wrapperClassName:b="",labelClassName:h="",helperClassName:x="",config:S,searchPlaceholder:k="T\xECm ki\u1EBFm...",searchValue:v,onSearchChange:d,searchMode:u="client",searchField:y="label",filterFn:c,onSearch:T,debounceMs:R=300,emptyText:D="Kh\xF4ng t\xECm th\u1EA5y k\u1EBFt qu\u1EA3",searchClassName:N="",searchInputSize:I,ref:E,...P}){let{isRequired:F=!1,isInvalid:z,isLoading:H=!1,isReadOnly:V=!1,searchable:W=!1,preserveSelected:L=!0,isSearching:M}=S??{},O=ku(),A=`${O}-label`,U=`${O}-helper`,G=`${O}-search`,K=ku(),q=t!==void 0,[X,fe]=Yn(r??null),ae=q?t:X,_=!!(z||f),Z=v!==void 0,[he,xe]=Yn(""),$=Z?v:he,[re,ee]=Yn(!1),de=M??re,[ne,ze]=Yn(null),[ve,Ce]=Yn(()=>{let Y=new Map;return e.forEach(me=>{Y.set(String(me.value),me)}),Y}),{debounced:J}=So(async Y=>{if(!(u!=="server"||!T))try{ee(!0);let me=await T(Y);Array.isArray(me)&&ze(me)}catch(me){console.error("Error fetching radio search options:",me)}finally{ee(!1)}},R),j=Y=>{let me=Y.target.value;Z||xe(me),d?.(me),u==="server"&&J(me)},oe=()=>{Z||xe(""),d?.(""),u==="server"&&ze(null)},ye=Gp(()=>{let Y=$.trim(),me=u==="server"&&ne?ne:e;if(!W||!Y)return me;let De;if(u==="server"?De=me:c?De=me.filter(se=>c(se,Y)):De=vo(me,Y,y),!L||ae===null||ae===void 0)return De;let ie=String(ae);if(!De.some(se=>String(se.value)===ie)){let se=ve.get(ie);return se?[se,...De]:[{value:ie,label:ie},...De]}return De},[W,$,u,ne,e,c,y,L,ae,ve]),ue=jp(Y=>{if(s||V||H)return;let De=(u==="server"&&ne?ne:e).find(ie=>String(ie.value)===Y);De&&Ce(ie=>{if(ie.has(Y))return ie;let B=new Map(ie);return B.set(Y,De),B}),q||fe(Y),o?.(Y)},[s,V,H,q,o,e,u,ne]),ce=C(w,Cu,"vertical"),ke=C(n,ra,"md"),Te=I??C(n,Su,"md"),pe=["text-sm font-semibold text-neutral-900 mb-1.5 select-none",s?"opacity-60":"",h].filter(Boolean).join(" ");return Ru("div",{ref:E,role:"radiogroup","aria-labelledby":l?A:void 0,"aria-describedby":f||m?U:void 0,"aria-errormessage":f?U:void 0,"aria-orientation":w,"aria-required":F?"true":void 0,"aria-invalid":_?"true":void 0,"aria-disabled":s?"true":void 0,"aria-readonly":V?"true":void 0,"aria-busy":H?"true":void 0,className:`inline-flex flex-col ${b}`,...P,children:[l&&Ru("span",{id:A,className:pe,children:[l,F&&Er("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),W&&Er("div",{className:`mb-2.5 ${N}`,children:Er(Bt,{id:G,variant:"outline",size:Te,color:i,value:$,onChange:j,placeholder:k,disabled:s||H,leftIcon:Er(To,{className:"size-4 text-neutral-400"}),rightIcon:de?Er(Pe,{className:"size-4 animate-spin text-neutral-400"}):void 0,onClear:oe,"aria-label":typeof l=="string"?`T\xECm ki\u1EBFm ${l}`:"T\xECm ki\u1EBFm",config:{isClearable:!de,isFullWidth:!0}})}),Er("div",{className:`${ce} ${p}`,children:ye.length>0?ye.map(Y=>{let me=String(Y.value),De=ae!=null&&String(ae)===me;return Er(Un,{name:K,value:Y.value,checked:De,onChange:()=>ue(me),label:Y.label,helperText:Y.description,disabled:s||!!Y.disabled,readOnly:V||!!Y.isReadOnly,size:n,color:i,variant:a,labelPlacement:g,config:{isLoading:H,isInvalid:_,isRequired:F}},Y.value)}):Er("div",{className:"py-3 text-center text-sm text-neutral-400 select-none",children:!$.trim()&&u==="server"?"Nh\u1EADp t\u1EEB kh\xF3a \u0111\u1EC3 t\xECm ki\u1EBFm s\u1EA3n ph\u1EA9m...":D})}),Er(He,{id:U,helperText:m,errorMessage:f,sizeClassName:ke.helper,className:x})]})}import{useId as Yp,useState as Wp,useRef as Kp}from"react";import{useMergeRefs as _p}from"@floating-ui/react";var Du={xs:{track:"w-7 h-4 p-0.5",thumb:"size-3",translate:"translate-x-3",icon:"size-2",content:"text-[9px]",label:"text-xs leading-4",gap:"gap-1.5",helper:"text-[10px]"},sm:{track:"w-9 h-5 p-0.5",thumb:"size-4",translate:"translate-x-4",icon:"size-2.5",content:"text-[10px]",label:"text-sm leading-4",gap:"gap-2",helper:"text-[11px]"},md:{track:"w-11 h-6 p-0.5",thumb:"size-5",translate:"translate-x-5",icon:"size-3",content:"text-xs",label:"text-sm leading-5",gap:"gap-2.5",helper:"text-xs"},lg:{track:"w-13 h-7 p-0.5",thumb:"size-6",translate:"translate-x-6",icon:"size-3.5",content:"text-xs",label:"text-base leading-6",gap:"gap-3",helper:"text-xs"},xl:{track:"w-16 h-9 p-1",thumb:"size-7",translate:"translate-x-7",icon:"size-4",content:"text-sm",label:"text-lg leading-7",gap:"gap-3.5",helper:"text-sm"}},Zs={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Nu={filled:{primary:{checked:{track:"bg-primary-600 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-white text-primary-600 shadow-sm"},unchecked:{track:"bg-neutral-200 border-transparent hover:bg-neutral-300 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},secondary:{checked:{track:"bg-secondary-600 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-white text-secondary-600 shadow-sm"},unchecked:{track:"bg-neutral-200 border-transparent hover:bg-neutral-300 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},error:{checked:{track:"bg-error-600 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-white text-error-600 shadow-sm"},unchecked:{track:"bg-neutral-200 border-transparent hover:bg-neutral-300 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},success:{checked:{track:"bg-success-600 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-white text-success-600 shadow-sm"},unchecked:{track:"bg-neutral-200 border-transparent hover:bg-neutral-300 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},warning:{checked:{track:"bg-warning-500 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-white text-warning-500 shadow-sm"},unchecked:{track:"bg-neutral-200 border-transparent hover:bg-neutral-300 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},info:{checked:{track:"bg-info-600 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-white text-info-600 shadow-sm"},unchecked:{track:"bg-neutral-200 border-transparent hover:bg-neutral-300 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},neutral:{checked:{track:"bg-neutral-800 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-white text-neutral-800 shadow-sm"},unchecked:{track:"bg-neutral-200 border-transparent hover:bg-neutral-300 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}}},outline:{primary:{checked:{track:"bg-primary-50 border-2 border-primary-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-primary-600 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 hover:border-neutral-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-400 text-neutral-white shadow-sm"}},secondary:{checked:{track:"bg-secondary-50 border-2 border-secondary-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-secondary-600 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 hover:border-neutral-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-400 text-neutral-white shadow-sm"}},error:{checked:{track:"bg-error-50 border-2 border-error-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-error-600 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 hover:border-neutral-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-400 text-neutral-white shadow-sm"}},success:{checked:{track:"bg-success-50 border-2 border-success-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-success-600 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 hover:border-neutral-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-400 text-neutral-white shadow-sm"}},warning:{checked:{track:"bg-warning-50 border-2 border-warning-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-warning-500 text-neutral-950 shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 hover:border-neutral-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-400 text-neutral-white shadow-sm"}},info:{checked:{track:"bg-info-50 border-2 border-info-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-info-600 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 hover:border-neutral-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-400 text-neutral-white shadow-sm"}},neutral:{checked:{track:"bg-neutral-100 border-2 border-neutral-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-800 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 hover:border-neutral-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-400 text-neutral-white shadow-sm"}}},soft:{primary:{checked:{track:"bg-primary-100 border border-primary-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-primary-600 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 border border-neutral-200 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},secondary:{checked:{track:"bg-secondary-100 border border-secondary-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-secondary-600 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 border border-neutral-200 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},error:{checked:{track:"bg-error-100 border border-error-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-error-600 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 border border-neutral-200 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},success:{checked:{track:"bg-success-100 border border-success-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-success-600 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 border border-neutral-200 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},warning:{checked:{track:"bg-warning-100 border border-warning-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-warning-500 text-neutral-950 shadow-sm"},unchecked:{track:"bg-neutral-100 border border-neutral-200 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},info:{checked:{track:"bg-info-100 border border-info-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-info-600 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 border border-neutral-200 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}},neutral:{checked:{track:"bg-neutral-200 border border-neutral-300 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-800 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 border border-neutral-200 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-white text-neutral-400 shadow-sm"}}}};import{jsx as $r,jsxs as ia}from"react/jsx-runtime";function Js({size:e,variant:t,color:r,radius:o,thumbRadius:n,config:i,label:a,helperText:s,errorMessage:l,labelPlacement:m="right",thumbIcon:f,startContent:w,endContent:g,wrapperClassName:p="",trackClassName:b="",thumbClassName:h="",labelClassName:x="",helperClassName:S="",className:k="",checked:v,defaultChecked:d,disabled:u=!1,readOnly:y=!1,onChange:c,onClick:T,value:R,id:D,name:N,ref:I,...E}){let{isRequired:P=!1,isInvalid:F=!1,isLoading:z=!1,showSpinner:H=!1}=i??{},V=Yp(),W=D||V,L=`${W}-error-helper`,M=Kp(null),O=_p([M,I]),A=v!==void 0,[U,G]=Wp(d??!1),K=A?!!v:U,q=oe=>{u||y||z||(A||G(oe.target.checked),c?.(oe))},X=oe=>{if(u||y||z){oe.preventDefault();return}T?.(oe)},fe=oe=>{(u||y||z)&&oe.preventDefault()},ae=!!(F||l),_=ae?"error":r,Z=C(e,Du,"md"),he=C(o,Zs,"full"),xe=C(n,Zs,"full"),$=t==="other"?void 0:C(_,C(t,Nu,"filled"),"primary"),re=$?K?$.checked.track:$.unchecked.track:"",ee=$?K?$.checked.thumb:$.unchecked.thumb:"",de=["relative inline-flex items-center shrink-0 border box-border transition-colors duration-200 ease-in-out cursor-pointer select-none",Z.track,he,re,u?"opacity-50":"",b].filter(Boolean).join(" "),ne=["pointer-events-none inline-flex items-center justify-center transition-transform duration-200 ease-in-out select-none",Z.thumb,xe,ee,K?Z.translate:"translate-x-0",h].filter(Boolean).join(" "),ze=["select-none font-medium text-neutral-900 transition-colors",Z.label,u?"opacity-50":"",x].filter(Boolean).join(" "),Ce=["group inline-flex items-center relative",m==="left"?"flex-row-reverse justify-between":"flex-row",Z.gap,u?"cursor-not-allowed opacity-60":"cursor-pointer",p,k].filter(Boolean).join(" "),J=()=>z&&H?$r("span",{className:`inline-flex items-center justify-center ${Z.icon}`,"aria-hidden":"true",children:$r(Pe,{className:"size-full animate-spin"})}):typeof f=="function"?f({isChecked:K,className:Z.icon}):f?$r("span",{className:`inline-flex items-center justify-center ${Z.icon}`,"aria-hidden":"true",children:f}):null,j=()=>a?ia("span",{className:ze,children:[a,P&&$r("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):null;return ia("div",{className:"inline-flex flex-col",children:[ia("label",{className:Ce,onClick:fe,children:[$r("input",{ref:O,type:"checkbox",role:"switch",id:W,name:N,value:R,checked:K,onChange:q,onClick:X,disabled:u||z,readOnly:y,required:P,"aria-checked":K,"aria-invalid":ae,"aria-required":P,"aria-describedby":l||s?L:void 0,"aria-errormessage":l?L:void 0,"aria-busy":z,"aria-disabled":u||z,className:"sr-only peer",...E}),ia("span",{className:de,"aria-hidden":"true",children:[w&&$r("span",{className:`absolute left-1.5 inline-flex items-center justify-center select-none font-medium transition-opacity duration-200 ${Z.content} ${K?"opacity-100":"opacity-0"}`,children:w}),$r("span",{className:ne,children:J()}),g&&$r("span",{className:`absolute right-1.5 inline-flex items-center justify-center select-none font-medium transition-opacity duration-200 ${Z.content} ${K?"opacity-0":"opacity-100"}`,children:g})]}),j()]}),$r(He,{id:L,helperText:s,errorMessage:l,sizeClassName:Z.helper,className:S})]})}import{jsx as Pu}from"react/jsx-runtime";function xt({width:e=16,height:t=16,className:r="",...o}){return Pu("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:Pu("path",{d:"m6 9 6 6 6-6"})})}import{jsx as zu}from"react/jsx-runtime";function rr({width:e=16,height:t=16,className:r="",...o}){return zu("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:zu("path",{d:"m15 18-6-6 6-6"})})}import{jsx as Iu}from"react/jsx-runtime";function Ht({width:e=16,height:t=16,className:r="",...o}){return Iu("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:Iu("path",{d:"m9 18 6-6-6-6"})})}import{jsx as aa,jsxs as Xp}from"react/jsx-runtime";function Fu({width:e=16,height:t=16,className:r="",...o}){return Xp("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[aa("path",{d:"M8 2v4"}),aa("path",{d:"M16 2v4"}),aa("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),aa("path",{d:"M3 10h18"})]})}import{jsx as Mu,jsxs as qp}from"react/jsx-runtime";function Eu({width:e=16,height:t=16,className:r="",...o}){return qp("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[Mu("circle",{cx:"12",cy:"12",r:"10"}),Mu("polyline",{points:"12 6 12 12 16 14"})]})}import{jsx as $u,jsxs as Zp}from"react/jsx-runtime";function Xr({width:e=16,height:t=16,className:r="",...o}){return Zp("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[$u("path",{d:"m11 17-5-5 5-5"}),$u("path",{d:"m18 17-5-5 5-5"})]})}import{jsx as Lu,jsxs as Jp}from"react/jsx-runtime";function qr({width:e=16,height:t=16,className:r="",...o}){return Jp("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[Lu("path",{d:"m6 17 5-5-5-5"}),Lu("path",{d:"m13 17 5-5-5-5"})]})}import{jsx as fr,jsxs as em}from"react/jsx-runtime";function Qp(e){return em("svg",{viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[fr("ellipse",{cx:"48",cy:"80",rx:"36",ry:"8",className:"fill-neutral-200/60"}),fr("ellipse",{cx:"48",cy:"80",rx:"22",ry:"4.5",className:"fill-neutral-300/50"}),fr("path",{d:"M24 38L16 32L40 22L48 28L24 38Z",className:"fill-primary-100/80 stroke-primary-300",strokeWidth:"1.5",strokeLinejoin:"round"}),fr("path",{d:"M72 38L80 32L56 22L48 28L72 38Z",className:"fill-primary-100/80 stroke-primary-300",strokeWidth:"1.5",strokeLinejoin:"round"}),fr("path",{d:"M24 38L48 28V52L24 62V38Z",className:"fill-primary-300/80 stroke-primary-300/40",strokeWidth:"1",strokeLinejoin:"round"}),fr("path",{d:"M72 38L48 28V52L72 62V38Z",className:"fill-primary-300/60 stroke-primary-300/40",strokeWidth:"1",strokeLinejoin:"round"}),fr("path",{d:"M48 52L72 62L48 72L24 62L48 52Z",className:"fill-primary-400/40 stroke-primary-400/30",strokeWidth:"1",strokeLinejoin:"round"}),fr("path",{d:"M24 38V64L48 76V50L24 38Z",className:"fill-primary-100 stroke-primary-400",strokeWidth:"1.8",strokeLinejoin:"round"}),fr("path",{d:"M72 38V64L48 76V50L72 38Z",className:"fill-primary-200/90 stroke-primary-400",strokeWidth:"1.8",strokeLinejoin:"round"}),fr("path",{d:"M24 38L48 50L38 60L14 48L24 38Z",className:"fill-primary-50 stroke-primary-300",strokeWidth:"1.5",strokeLinejoin:"round"}),fr("path",{d:"M72 38L48 50L58 60L82 48L72 38Z",className:"fill-primary-100/90 stroke-primary-300",strokeWidth:"1.5",strokeLinejoin:"round"})]})}var Qs=Qp;import{jsx as Lr,jsxs as Bu}from"react/jsx-runtime";function tm(e){return Bu("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[Lr("ellipse",{cx:"60",cy:"100",rx:"42",ry:"10",className:"fill-neutral-200/50"}),Lr("rect",{x:"32",y:"24",width:"44",height:"56",rx:"6",className:"fill-white stroke-neutral-300",strokeWidth:"2"}),Lr("line",{x1:"42",y1:"36",x2:"66",y2:"36",className:"stroke-neutral-200",strokeWidth:"2.5",strokeLinecap:"round"}),Lr("line",{x1:"42",y1:"44",x2:"60",y2:"44",className:"stroke-neutral-200",strokeWidth:"2.5",strokeLinecap:"round"}),Lr("line",{x1:"42",y1:"52",x2:"52",y2:"52",className:"stroke-neutral-200",strokeWidth:"2.5",strokeLinecap:"round"}),Bu("g",{transform:"translate(48, 38)",children:[Lr("circle",{cx:"28",cy:"28",r:"20",className:"fill-primary-50/80 stroke-primary-500",strokeWidth:"3"}),Lr("path",{d:"M18 20A14 14 0 0 1 34 16",className:"stroke-primary-300",strokeWidth:"2",strokeLinecap:"round"}),Lr("path",{d:"M24 24L32 32M32 24L24 32",className:"stroke-neutral-400",strokeWidth:"2",strokeLinecap:"round"}),Lr("path",{d:"M42 42L58 58",className:"stroke-primary-700",strokeWidth:"5",strokeLinecap:"round"})]})]})}var el=tm;import{jsx as Ro,jsxs as om}from"react/jsx-runtime";function rm(e){return om("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[Ro("ellipse",{cx:"60",cy:"100",rx:"42",ry:"10",className:"fill-neutral-200/50"}),Ro("circle",{cx:"60",cy:"52",r:"32",className:"fill-error-50 stroke-error-200",strokeWidth:"2"}),Ro("path",{d:"M60 30L78 64H42L60 30Z",className:"fill-error-100 stroke-error-500",strokeWidth:"2.5",strokeLinejoin:"round"}),Ro("line",{x1:"60",y1:"42",x2:"60",y2:"52",className:"stroke-error-600",strokeWidth:"2.5",strokeLinecap:"round"}),Ro("circle",{cx:"60",cy:"58",r:"1.5",className:"fill-error-600"}),Ro("path",{d:"M22 66L32 60",className:"stroke-neutral-300",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"3 3"}),Ro("path",{d:"M98 66L88 60",className:"stroke-neutral-300",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"3 3"})]})}var tl=rm;import{jsx as tn,jsxs as im}from"react/jsx-runtime";function nm(e){return im("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[tn("ellipse",{cx:"60",cy:"98",rx:"42",ry:"10",className:"fill-neutral-200/50"}),tn("path",{d:"M24 40C24 36.69 26.69 34 30 34H48L56 42H90C93.31 42 96 44.69 96 48V78C96 81.31 93.31 84 90 84H30C26.69 84 24 81.31 24 78V40Z",className:"fill-primary-200/70 stroke-primary-300",strokeWidth:"2"}),tn("rect",{x:"36",y:"30",width:"48",height:"40",rx:"4",className:"fill-white stroke-neutral-200",strokeWidth:"1.5"}),tn("line",{x1:"44",y1:"40",x2:"68",y2:"40",className:"stroke-neutral-200",strokeWidth:"2",strokeLinecap:"round"}),tn("line",{x1:"44",y1:"48",x2:"60",y2:"48",className:"stroke-neutral-200",strokeWidth:"2",strokeLinecap:"round"}),tn("path",{d:"M24 52H96V80C96 83.31 93.31 86 90 86H30C26.69 86 24 83.31 24 80V52Z",className:"fill-primary-300/80 stroke-primary-400",strokeWidth:"2"})]})}var rl=nm;import{jsx as sa,jsxs as sm}from"react/jsx-runtime";function am(e){return sm("svg",{viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[sa("ellipse",{cx:"32",cy:"54",rx:"24",ry:"5",className:"fill-neutral-200/50"}),sa("path",{d:"M12 24L32 14L52 24L32 34L12 24Z",className:"fill-neutral-100 stroke-neutral-400",strokeWidth:"2",strokeLinejoin:"round"}),sa("path",{d:"M12 24V40L32 50V34L12 24Z",className:"fill-neutral-200 stroke-neutral-400",strokeWidth:"2",strokeLinejoin:"round"}),sa("path",{d:"M52 24V40L32 50V34L52 24Z",className:"fill-neutral-300 stroke-neutral-400",strokeWidth:"2",strokeLinejoin:"round"})]})}var ol=am;import{jsx as la,jsxs as lm}from"react/jsx-runtime";function rn({width:e=20,height:t=20,className:r="",...o}){return lm("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[la("circle",{cx:"11",cy:"11",r:"8"}),la("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),la("line",{x1:"11",y1:"8",x2:"11",y2:"14"}),la("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}import{jsx as nl,jsxs as cm}from"react/jsx-runtime";function on({width:e=20,height:t=20,className:r="",...o}){return cm("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[nl("circle",{cx:"11",cy:"11",r:"8"}),nl("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),nl("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}import{jsx as Hu,jsxs as um}from"react/jsx-runtime";function Zr({width:e=20,height:t=20,className:r="",...o}){return um("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[Hu("path",{d:"M21 2v6h-6"}),Hu("path",{d:"M21 8A10 10 0 1 0 22 13"})]})}import{jsx as Vu,jsxs as dm}from"react/jsx-runtime";function nn({width:e=20,height:t=20,className:r="",...o}){return dm("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[Vu("path",{d:"M3 2v6h6"}),Vu("path",{d:"M3 8a10 10 0 1 1-1 5"})]})}import{jsx as an,jsxs as fm}from"react/jsx-runtime";function sn({width:e=20,height:t=20,className:r="",...o}){return fm("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[an("path",{d:"m3 7 5 5-5 5V7z"}),an("path",{d:"m21 7-5 5 5 5V7z"}),an("path",{d:"M12 20v2"}),an("path",{d:"M12 14v2"}),an("path",{d:"M12 8v2"}),an("path",{d:"M12 2v2"})]})}import{jsx as il,jsxs as pm}from"react/jsx-runtime";function Sr({width:e=20,height:t=20,className:r="",...o}){return pm("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[il("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),il("polyline",{points:"7 10 12 15 17 10"}),il("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}import{jsx as Au,jsxs as mm}from"react/jsx-runtime";function _t({width:e=20,height:t=20,className:r="",...o}){return mm("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[Au("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),Au("path",{d:"M3 3v5h5"})]})}import{jsx as al,jsxs as gm}from"react/jsx-runtime";function ca({width:e=20,height:t=20,className:r="",...o}){return gm("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[al("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),al("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),al("polyline",{points:"21 15 16 10 5 21"})]})}import{jsx as Ou,jsxs as bm}from"react/jsx-runtime";function ua({width:e=16,height:t=16,className:r="",...o}){return bm("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[Ou("path",{d:"M6 2v14a2 2 0 0 0 2 2h14"}),Ou("path",{d:"M18 22V8a2 2 0 0 0-2-2H2"})]})}import{jsx as da,jsxs as hm}from"react/jsx-runtime";function pr({width:e=16,height:t=16,className:r="",...o}){return hm("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[da("polyline",{points:"3 6 5 6 21 6"}),da("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),da("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),da("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}import{jsx as Gu}from"react/jsx-runtime";function Ot({width:e=24,height:t=24,className:r="",...o}){return Gu("svg",{width:e,height:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:r,...o,children:Gu("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95C8.08 7.14 9.94 6 12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11c1.56.1 2.78 1.41 2.78 2.96 0 1.65-1.35 3-3 3M8 13h2.55v3h2.9v-3H16l-4-4z"})})}import{jsx as fa,jsxs as xm}from"react/jsx-runtime";function pa({width:e=24,height:t=24,variant:r="solid",className:o="",...n}){return r==="outline"?xm("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,...n,children:[fa("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),fa("circle",{cx:"12",cy:"7",r:"4"})]}):fa("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:o,...n,children:fa("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.5 6a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM3.751 20.105a8.25 8.25 0 0 1 16.498 0 .75.75 0 0 1-.437.695A18.683 18.683 0 0 1 12 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 0 1-.437-.695Z"})})}import{jsx as ju,jsxs as vm}from"react/jsx-runtime";function ma({width:e=16,height:t=16,className:r="",...o}){return vm("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[ju("path",{d:"m7 15 5 5 5-5"}),ju("path",{d:"m7 9 5-5 5 5"})]})}import{jsx as Uu,jsxs as ym}from"react/jsx-runtime";function ga({width:e=16,height:t=16,className:r="",...o}){return ym("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[Uu("path",{d:"m5 12 7-7 7 7"}),Uu("path",{d:"M12 19V5"})]})}import{jsx as Yu,jsxs as wm}from"react/jsx-runtime";function ba({width:e=16,height:t=16,className:r="",...o}){return wm("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[Yu("path",{d:"M12 5v14"}),Yu("path",{d:"m19 12-7 7-7-7"})]})}import{jsx as Br,jsxs as Cm}from"react/jsx-runtime";function ha({width:e=16,height:t=16,className:r="",...o}){return Cm("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[Br("line",{x1:"21",x2:"14",y1:"4",y2:"4"}),Br("line",{x1:"10",x2:"3",y1:"4",y2:"4"}),Br("line",{x1:"21",x2:"12",y1:"12",y2:"12"}),Br("line",{x1:"8",x2:"3",y1:"12",y2:"12"}),Br("line",{x1:"21",x2:"16",y1:"20",y2:"20"}),Br("line",{x1:"12",x2:"3",y1:"20",y2:"20"}),Br("line",{x1:"14",x2:"14",y1:"2",y2:"6"}),Br("line",{x1:"8",x2:"8",y1:"10",y2:"14"}),Br("line",{x1:"16",x2:"16",y1:"18",y2:"22"})]})}import{cloneElement as Tm,isValidElement as sl,useState as qu}from"react";import{useFloating as km,autoUpdate as Rm,offset as Dm,flip as Nm,shift as Pm,arrow as zm,useHover as Im,useFocus as Fm,useDismiss as Mm,useRole as Em,useInteractions as $m,useMergeRefs as Lm,FloatingPortal as Bm,FloatingArrow as Hm}from"@floating-ui/react";import{useTransitionStyles as Sm}from"@floating-ui/react";function it(e,t={}){let{duration:r=150,offset:o=4,scale:n=.96,animated:i=!0}=t;return Sm(e,{duration:i?r:0,initial:({side:a})=>({opacity:0,transform:a==="top"?`translateY(${o}px) scale(${n})`:a==="bottom"?`translateY(-${o}px) scale(${n})`:a==="left"?`translateX(${o}px) scale(${n})`:`translateX(-${o}px) scale(${n})`}),open:{opacity:1,transform:"translate(0px, 0px) scale(1)"},close:({side:a})=>({opacity:0,transform:a==="top"?`translateY(${o}px) scale(${n})`:a==="bottom"?`translateY(-${o}px) scale(${n})`:a==="left"?`translateX(${o}px) scale(${n})`:`translateX(-${o}px) scale(${n})`})})}var Wu={xs:{box:"px-2 py-0.5 text-[11px] leading-tight font-medium",arrowWidth:8,arrowHeight:4},sm:{box:"px-2.5 py-1 text-xs leading-tight font-medium",arrowWidth:10,arrowHeight:5},md:{box:"px-3 py-1.5 text-xs leading-normal font-medium",arrowWidth:12,arrowHeight:6},lg:{box:"px-3.5 py-2 text-sm leading-normal font-medium",arrowWidth:14,arrowHeight:7},xl:{box:"px-4 py-2.5 text-base leading-normal font-semibold",arrowWidth:16,arrowHeight:8}},Ku={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},_u={filled:{primary:"bg-primary-500 text-neutral-white border border-transparent shadow-md",secondary:"bg-secondary-500 text-neutral-white border border-transparent shadow-md",error:"bg-error-500 text-neutral-white border border-transparent shadow-md",success:"bg-success-500 text-neutral-white border border-transparent shadow-md",warning:"bg-warning-500 text-neutral-950 border border-transparent shadow-md",info:"bg-info-500 text-neutral-white border border-transparent shadow-md",neutral:"bg-neutral-800 text-neutral-white border border-transparent shadow-md"},soft:{primary:"bg-primary-100 text-primary-800 border border-primary-200 shadow-sm",secondary:"bg-secondary-100 text-secondary-800 border border-secondary-200 shadow-sm",error:"bg-error-100 text-error-800 border border-error-200 shadow-sm",success:"bg-success-100 text-success-800 border border-success-200 shadow-sm",warning:"bg-warning-100 text-warning-800 border border-warning-200 shadow-sm",info:"bg-info-100 text-info-800 border border-info-200 shadow-sm",neutral:"bg-neutral-100 text-neutral-800 border border-neutral-200 shadow-sm"},outline:{primary:"bg-neutral-white text-primary-700 border border-primary-400 shadow-md",secondary:"bg-neutral-white text-secondary-800 border border-secondary-400 shadow-md",error:"bg-neutral-white text-error-700 border border-error-400 shadow-md",success:"bg-neutral-white text-success-700 border border-success-400 shadow-md",warning:"bg-neutral-white text-warning-800 border border-warning-400 shadow-md",info:"bg-neutral-white text-info-800 border border-info-400 shadow-md",neutral:"bg-neutral-white text-neutral-800 border border-neutral-300 shadow-md"}},Xu={filled:{primary:"fill-primary-500",secondary:"fill-secondary-500",error:"fill-error-500",success:"fill-success-500",warning:"fill-warning-500",info:"fill-info-500",neutral:"fill-neutral-800"},soft:{primary:"fill-primary-100 stroke-primary-200",secondary:"fill-secondary-100 stroke-secondary-200",error:"fill-error-100 stroke-error-200",success:"fill-success-100 stroke-success-200",warning:"fill-warning-100 stroke-warning-200",info:"fill-info-100 stroke-info-200",neutral:"fill-neutral-100 stroke-neutral-200"},outline:{primary:"fill-neutral-white stroke-primary-400",secondary:"fill-neutral-white stroke-secondary-400",error:"fill-neutral-white stroke-error-400",success:"fill-neutral-white stroke-success-400",warning:"fill-neutral-white stroke-warning-400",info:"fill-neutral-white stroke-info-400",neutral:"fill-neutral-white stroke-neutral-300"}};import{Fragment as Am,jsx as xa,jsxs as Zu}from"react/jsx-runtime";function Vm({children:e,ref:t,disabled:r,className:o="",...n}){let i=sl(e)?e.props?.ref:void 0,a=Lm([t,i]);if(!sl(e))return null;let s=e.props||{};return Tm(e,{...n,...s,ref:a,disabled:r?!0:s.disabled,className:[s.className,o].filter(Boolean).join(" ")})}function Wn({content:e,children:t,placement:r="top",variant:o,color:n,size:i,radius:a,hasArrow:s=!0,offset:l=8,flip:m=!0,shift:f=!0,delay:w={open:200,close:150},disabled:g=!1,animated:p=!0,animationDuration:b=150,open:h,defaultOpen:x=!1,onOpenChange:S,className:k="",arrowClassName:v="",zIndex:d=st.TOOLTIP}){let[u,y]=qu(x),[c,T]=qu(null),R=h!==void 0,D=R?h:u,N=Z=>{R||y(Z),S?.(Z)},I=[Dm(l),m?Nm():void 0,f?Pm({padding:8}):void 0,s?zm({element:c}):void 0].filter(Boolean),{refs:{setReference:E,setFloating:P},floatingStyles:F,context:z,placement:H}=km({placement:r,open:D&&!g,onOpenChange:N,whileElementsMounted:Rm,transform:!1,middleware:I}),V=Im(z,{move:!1,delay:w,enabled:!g}),W=Fm(z,{enabled:!g}),L=Mm(z),M=Em(z,{role:"tooltip"}),{getReferenceProps:O,getFloatingProps:A}=$m([V,W,L,M]),{isMounted:U,styles:G}=it(z,{duration:b,animated:p}),K=C(i,Wu,"md"),q=C(a,Ku,"md"),X=o==="other"?"":C(n,C(o,_u,"filled"),"neutral"),fe=o==="other"?"":C(n,C(o,Xu,"filled"),"neutral"),ae=["select-none pointer-events-none max-w-xs break-words",K.box,q,X,k].filter(Boolean).join(" "),_=O();return Zu(Am,{children:[sl(t)?xa(Vm,{ref:E,disabled:g,..._,children:t}):xa("span",{ref:E,..._,children:t}),xa(Bm,{children:U&&!g&&e&&Zu("div",{ref:P,style:{...F,...p?G:{},zIndex:d},className:ae,"data-state":D?"open":"closed","data-placement":H,...A(),children:[e,s&&xa(Hm,{ref:T,context:z,width:K.arrowWidth,height:K.arrowHeight,strokeWidth:o==="outline"||o==="soft"?1:0,className:[fe,v].filter(Boolean).join(" ")})]})})]})}import{useId as Gm,useState as jm}from"react";import*as ln from"@radix-ui/react-slider";var Do={xs:{trackHorizontal:"h-1",trackVertical:"w-1",thumb:"w-3 h-3",thumbSizePx:12,label:"text-xs font-medium",value:"text-xs font-semibold",helper:"text-[11px]",markText:"text-[10px]",gap:"gap-1",stepDot:"w-1 h-1",tooltipSize:"xs"},sm:{trackHorizontal:"h-1.5",trackVertical:"w-1.5",thumb:"w-4 h-4",thumbSizePx:16,label:"text-xs font-medium",value:"text-xs font-semibold",helper:"text-xs",markText:"text-[11px]",gap:"gap-1.5",stepDot:"w-1.5 h-1.5",tooltipSize:"xs"},md:{trackHorizontal:"h-2",trackVertical:"w-2",thumb:"w-5 h-5",thumbSizePx:20,label:"text-sm font-medium",value:"text-sm font-semibold",helper:"text-xs",markText:"text-xs",gap:"gap-2",stepDot:"w-2 h-2",tooltipSize:"sm"},lg:{trackHorizontal:"h-2.5",trackVertical:"w-2.5",thumb:"w-6 h-6",thumbSizePx:24,label:"text-base font-medium",value:"text-base font-semibold",helper:"text-sm",markText:"text-xs",gap:"gap-2.5",stepDot:"w-2.5 h-2.5",tooltipSize:"md"},xl:{trackHorizontal:"h-3",trackVertical:"w-3",thumb:"w-7 h-7",thumbSizePx:28,label:"text-lg font-medium",value:"text-lg font-semibold",helper:"text-sm",markText:"text-sm",gap:"gap-3",stepDot:"w-3 h-3",tooltipSize:"md"}},ll={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Ju={filled:{primary:{track:"bg-neutral-200",filler:"bg-primary-500",thumb:"bg-white border-2 border-primary-500 text-primary-600 focus-visible:ring-2 focus-visible:ring-primary-500/50 shadow-sm"},secondary:{track:"bg-neutral-200",filler:"bg-secondary-500",thumb:"bg-white border-2 border-secondary-500 text-secondary-600 focus-visible:ring-2 focus-visible:ring-secondary-500/50 shadow-sm"},error:{track:"bg-neutral-200",filler:"bg-error-500",thumb:"bg-white border-2 border-error-500 text-error-600 focus-visible:ring-2 focus-visible:ring-error-500/50 shadow-sm"},success:{track:"bg-neutral-200",filler:"bg-success-500",thumb:"bg-white border-2 border-success-500 text-success-600 focus-visible:ring-2 focus-visible:ring-success-500/50 shadow-sm"},warning:{track:"bg-neutral-200",filler:"bg-warning-500",thumb:"bg-white border-2 border-warning-500 text-warning-600 focus-visible:ring-2 focus-visible:ring-warning-500/50 shadow-sm"},info:{track:"bg-neutral-200",filler:"bg-info-500",thumb:"bg-white border-2 border-info-500 text-info-600 focus-visible:ring-2 focus-visible:ring-info-500/50 shadow-sm"},neutral:{track:"bg-neutral-200",filler:"bg-neutral-800",thumb:"bg-white border-2 border-neutral-800 text-neutral-800 focus-visible:ring-2 focus-visible:ring-neutral-500/50 shadow-sm"}},soft:{primary:{track:"bg-primary-100",filler:"bg-primary-400",thumb:"bg-white border-2 border-primary-400 text-primary-500 focus-visible:ring-2 focus-visible:ring-primary-400/50 shadow-sm"},secondary:{track:"bg-secondary-100",filler:"bg-secondary-400",thumb:"bg-white border-2 border-secondary-400 text-secondary-500 focus-visible:ring-2 focus-visible:ring-secondary-400/50 shadow-sm"},error:{track:"bg-error-100",filler:"bg-error-400",thumb:"bg-white border-2 border-error-400 text-error-500 focus-visible:ring-2 focus-visible:ring-error-400/50 shadow-sm"},success:{track:"bg-success-100",filler:"bg-success-400",thumb:"bg-white border-2 border-success-400 text-success-500 focus-visible:ring-2 focus-visible:ring-success-400/50 shadow-sm"},warning:{track:"bg-warning-100",filler:"bg-warning-400",thumb:"bg-white border-2 border-warning-400 text-warning-500 focus-visible:ring-2 focus-visible:ring-warning-400/50 shadow-sm"},info:{track:"bg-info-100",filler:"bg-info-400",thumb:"bg-white border-2 border-info-400 text-info-500 focus-visible:ring-2 focus-visible:ring-info-400/50 shadow-sm"},neutral:{track:"bg-neutral-200",filler:"bg-neutral-600",thumb:"bg-white border-2 border-neutral-600 text-neutral-600 focus-visible:ring-2 focus-visible:ring-neutral-400/50 shadow-sm"}},outline:{primary:{track:"bg-transparent border border-neutral-300",filler:"bg-primary-500",thumb:"bg-white border-2 border-primary-500 text-primary-600 focus-visible:ring-2 focus-visible:ring-primary-500/50 shadow-sm"},secondary:{track:"bg-transparent border border-neutral-300",filler:"bg-secondary-500",thumb:"bg-white border-2 border-secondary-500 text-secondary-600 focus-visible:ring-2 focus-visible:ring-secondary-500/50 shadow-sm"},error:{track:"bg-transparent border border-neutral-300",filler:"bg-error-500",thumb:"bg-white border-2 border-error-500 text-error-600 focus-visible:ring-2 focus-visible:ring-error-500/50 shadow-sm"},success:{track:"bg-transparent border border-neutral-300",filler:"bg-success-500",thumb:"bg-white border-2 border-success-500 text-success-600 focus-visible:ring-2 focus-visible:ring-success-500/50 shadow-sm"},warning:{track:"bg-transparent border border-neutral-300",filler:"bg-warning-500",thumb:"bg-white border-2 border-warning-500 text-warning-600 focus-visible:ring-2 focus-visible:ring-warning-500/50 shadow-sm"},info:{track:"bg-transparent border border-neutral-300",filler:"bg-info-500",thumb:"bg-white border-2 border-info-500 text-info-600 focus-visible:ring-2 focus-visible:ring-info-500/50 shadow-sm"},neutral:{track:"bg-transparent border border-neutral-300",filler:"bg-neutral-800",thumb:"bg-white border-2 border-neutral-800 text-neutral-800 focus-visible:ring-2 focus-visible:ring-neutral-500/50 shadow-sm"}},other:{primary:{track:"",filler:"",thumb:""},secondary:{track:"",filler:"",thumb:""},error:{track:"",filler:"",thumb:""},success:{track:"",filler:"",thumb:""},warning:{track:"",filler:"",thumb:""},info:{track:"",filler:"",thumb:""},neutral:{track:"",filler:"",thumb:""}}};import{useState as cl}from"react";import*as Qu from"@radix-ui/react-slider";import{jsx as va}from"react/jsx-runtime";function Kn({id:e,thumbIdx:t,value:r,orientation:o,size:n,thumbRadiusClass:i,thumbThemeStyles:a,thumbClassName:s="",tooltipClassName:l="",state:m,label:f,helperId:w,tooltipMode:g="none",tooltipPlacement:p,formatTooltip:b}){let{isLoading:h=!1,showSpinner:x=!1,disabled:S=!1,readOnly:k=!1,isRequired:v=!1,isInvalid:d=!1,isRange:u=!1,hasDescription:y=!1}=m??{},c=C(n,Do,"md"),[T,R]=cl(!1),[D,N]=cl(!1),[I,E]=cl(!1),P;g==="always"?P=!0:g==="active"?P=I||D:g==="hover"?P=T||I||D:g==="none"&&(P=!1);let F=p||(o==="vertical"?"right":"top"),z=b?b(r):r.toString(),H=typeof z=="string"||typeof z=="number"?String(z):void 0,V=va(Qu.Thumb,{id:`${e}-thumb-${t}`,tabIndex:S||h?-1:0,"aria-busy":h,"aria-disabled":S||h,"aria-readonly":k,"aria-required":v,"aria-invalid":d,"aria-errormessage":d?w:void 0,"aria-describedby":y?w:void 0,"aria-valuetext":H,"aria-orientation":o,"aria-label":typeof f=="string"?`${f} ${u?t===0?"minimum":"maximum":""}`:`Slider ${u?t===0?"min":"max":""}`,onFocus:()=>N(!0),onBlur:()=>N(!1),onPointerEnter:()=>R(!0),onPointerLeave:()=>R(!1),onPointerDown:()=>E(!0),onPointerUp:()=>E(!1),className:`block relative z-10 select-none outline-none transition-transform duration-100 ease-out ${S||k?"cursor-not-allowed opacity-60 shadow-none":"cursor-grab active:cursor-grabbing hover:scale-105"} ${c.thumb} ${i} ${a} ${I&&!S&&!h?"scale-110 ring-4 ring-primary-500/20":""} ${s}`,children:h&&x&&va("div",{className:"absolute inset-0 flex items-center justify-center p-0.5","aria-hidden":"true",children:va(Pe,{className:"size-full animate-spin text-current"})})});return g!=="none"?va(Wn,{content:z,placement:F,open:P,size:c.tooltipSize,className:l,disabled:S||h,children:V}):V}function ul(e,t,r){return Math.min(Math.max(e,t),r)}function _n(e,t,r){return r<=t?0:ul((e-t)/(r-t)*100,0,100)}import{Fragment as Om,jsx as ya}from"react/jsx-runtime";function wa({marks:e,min:t,max:r,step:o,orientation:n,size:i,markClassName:a=""}){if(!e)return null;let s=[];if(Array.isArray(e))s=e;else if(e===!0&&o>0){let m=Math.floor((r-t)/o);if(m<=20)for(let f=0;f<=m;f++){let w=t+f*o;s.push({value:w,label:w.toString()})}}if(!s.length)return null;let l=C(i,Do,"md");return ya("div",{className:`relative w-full ${n==="vertical"?"h-full":"mt-2"}`,"aria-hidden":"true",children:s.map(m=>{let f=_n(m.value,t,r);return ya("div",{className:`absolute flex items-center justify-center select-none text-neutral-500 ${l.markText} ${a}`,style:n==="vertical"?{bottom:`${f}%`,left:"100%",transform:"translateY(50%) translateX(6px)"}:{left:`${f}%`,transform:"translateX(-50%)"},children:m.label??m.value},m.value)})})}function Ca({showSteps:e,min:t,max:r,step:o,orientation:n,size:i,isRange:a,currentValues:s}){if(!e||o<=0)return null;let l=Math.floor((r-t)/o);if(l>100)return null;let m=C(i,Do,"md"),f=[];for(let w=0;w<=l;w++){let g=t+w*o,p=_n(g,t,r),b=a?g>=(s[0]??t)&&g<=(s[1]??r):g<=(s[0]??t);f.push(ya("span",{"aria-hidden":"true",className:`absolute rounded-full -translate-x-1/2 -translate-y-1/2 pointer-events-none transition-colors duration-150 ${m.stepDot} ${b?"bg-white/80":"bg-neutral-400/60"}`,style:n==="vertical"?{bottom:`${p}%`,left:"50%"}:{left:`${p}%`,top:"50%"}},`step-dot-${g}`))}return ya(Om,{children:f})}import{Fragment as ed,jsx as Xt,jsxs as No}from"react/jsx-runtime";function Xn({config:e,value:t,defaultValue:r,min:o=0,max:n=100,step:i=1,minStepsBetweenThumbs:a=0,inverted:s=!1,size:l,variant:m,color:f,radius:w,thumbRadius:g,orientation:p="horizontal",label:b,labelPlacement:h="top",formatValue:x,showTooltip:S="none",tooltipPlacement:k,formatTooltip:v,marks:d=!1,startContent:u,endContent:y,disabled:c=!1,readOnly:T=!1,helperText:R,errorMessage:D,name:N,id:I,onChange:E,onChangeEnd:P,className:F="",wrapperClassName:z="",trackWrapperClassName:H="",trackClassName:V="",fillerClassName:W="",thumbClassName:L="",labelClassName:M="",valueClassName:O="",helperClassName:A="",tooltipClassName:U="",markClassName:G="",ref:K}){let{isRequired:q=!1,isInvalid:X=!1,isLoading:fe=!1,showSpinner:ae=!1,showSteps:_=!1,showValue:Z=!1,isFullWidth:he=!0}=e??{},xe=Gm(),$=I||xe,re=`${$}-helper`,ee=!!(X||D),de=ee?"error":f,ne=Array.isArray(t??r),ze=t!==void 0,[ve,Ce]=jm(()=>r!==void 0?Array.isArray(r)?r:[r]:ne?[o,n]:[o]),J=ze?Array.isArray(t)?t:t!==void 0?[t]:void 0:void 0,j=ze?Array.isArray(t)?[t[0]??o,t[1]??n]:[t??o,0]:ne?[ve[0]??o,ve[1]??n]:[ve[0]??o,0],oe=B=>{if(c||T||fe)return;ze||Ce(B);let se=ne?[B[0]??o,B[1]??n]:B[0]??o;E?.(se)},ye=B=>{if(c||T||fe)return;let se=ne?[B[0]??o,B[1]??n]:B[0]??o;P?.(se)},ue=C(l,Do,"md"),ce=C(w,ll,"full"),ke=C(g,ll,"full"),Te=m==="other"?{track:"",filler:"",thumb:""}:C(de,C(m,Ju,"filled"),"primary"),pe=Te.track,Y=Te.filler,me=Te.thumb,De=()=>{if(!b&&!Z)return null;let B="";x?B=x(ne?j:j[0]):ne?B=`${j[0]} - ${j[1]}`:B=`${j[0]}`;let se=ee?"text-error-600 font-medium":"text-neutral-900";return No("div",{className:"flex items-center justify-between gap-2 mb-1.5 select-none",children:[b&&No("label",{htmlFor:`${$}-thumb-0`,className:`font-medium ${se} ${ue.label} ${c?"opacity-60 cursor-not-allowed":"cursor-pointer"} ${M}`,children:[b,q&&Xt("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),Z&&Xt("span",{className:`select-none text-neutral-700 ${ue.value} ${O}`,"aria-hidden":"true",children:B})]})},ie=ne?[j[0],j[1]]:[j[0]];return No("div",{ref:K,className:`group/field flex flex-col ${he?"w-full":"inline-flex"} ${c?"opacity-60 cursor-not-allowed":""} ${z||F}`,children:[h==="top"&&De(),No("div",{className:`flex items-center ${ue.gap} ${p==="vertical"?"flex-col h-48":"flex-row w-full"} ${H}`,children:[h==="left"&&De(),u&&Xt("div",{className:"inline-flex shrink-0 items-center justify-center select-none text-neutral-500","aria-hidden":"true",children:u}),No(ln.Root,{min:o,max:n,step:i,minStepsBetweenThumbs:a,inverted:s,orientation:p,disabled:c||fe||T,value:J,defaultValue:r!==void 0?Array.isArray(r)?r:[r]:void 0,onValueChange:oe,onValueCommit:ye,className:`relative flex items-center select-none touch-none ${p==="vertical"?"flex-col h-full w-auto justify-center":"w-full h-auto justify-center"} ${c||T?"cursor-not-allowed":"cursor-pointer"}`,children:[No(ln.Track,{className:`relative overflow-hidden ${p==="vertical"?`${ue.trackVertical} h-full`:`${ue.trackHorizontal} w-full`} ${ce} ${pe} ${V}`,children:[Xt(Ca,{showSteps:_,min:o,max:n,step:i,orientation:p,size:l||"md",isRange:ne,currentValues:j}),Xt(ln.Range,{className:`absolute ${Y} ${ce} ${W}`})]}),ie.map((B,se)=>{let Ie=ne?se===0?`${$}-thumb-min`:`${$}-thumb-max`:`${$}-thumb-single`;return Xt(Kn,{id:$,thumbIdx:se,value:B,orientation:p,size:l||"md",thumbRadiusClass:ke,thumbThemeStyles:me,thumbClassName:L,tooltipClassName:U,state:{isLoading:fe,showSpinner:ae,disabled:c,readOnly:T,isRequired:q,isInvalid:ee,isRange:ne,hasDescription:!!(ee||R)},label:b,helperId:re,tooltipMode:S,tooltipPlacement:k,formatTooltip:v},Ie)})]}),y&&Xt("div",{className:"inline-flex shrink-0 items-center justify-center select-none text-neutral-500","aria-hidden":"true",children:y}),h==="right"&&De()]}),Xt(wa,{marks:d,min:o,max:n,step:i,orientation:p,size:l||"md",markClassName:G}),Xt(He,{id:re,helperText:R,errorMessage:D,sizeClassName:ue.helper,className:A}),N&&Xt(ed,{children:ne?No(ed,{children:[Xt("input",{type:"hidden",name:`${N}[0]`,value:j[0],disabled:c}),Xt("input",{type:"hidden",name:`${N}[1]`,value:j[1],disabled:c})]}):Xt("input",{type:"hidden",name:N,value:j[0],disabled:c})})]})}import{useState as Um,useMemo as sd,useCallback as Ym}from"react";var Sa={sm:{header:"py-2.5 px-3.5 text-sm",content:"px-3.5 pb-3 text-sm text-neutral-600",title:"font-medium leading-snug",description:"text-xs text-neutral-500 mt-0.5",icon:"size-4",startIcon:"size-4",gap:"gap-2.5"},md:{header:"py-3.5 px-4 text-base",content:"px-4 pb-4 text-sm text-neutral-600",title:"font-semibold leading-snug",description:"text-xs text-neutral-500 mt-1",icon:"size-4.5",startIcon:"size-4.5",gap:"gap-3"},lg:{header:"py-4.5 px-5 text-lg",content:"px-5 pb-5 text-base text-neutral-600",title:"font-semibold leading-snug",description:"text-sm text-neutral-500 mt-1",icon:"size-5",startIcon:"size-5",gap:"gap-3.5"}},Ta={none:"rounded-none",sm:"rounded-md",md:"rounded-xl",lg:"rounded-2xl",xl:"rounded-3xl",full:"rounded-3xl"},td={outlined:{primary:"border border-primary-200 bg-white divide-y divide-primary-100 overflow-hidden",secondary:"border border-secondary-200 bg-white divide-y divide-secondary-100 overflow-hidden",neutral:"border border-neutral-200 bg-white divide-y divide-neutral-200 overflow-hidden",error:"border border-error-200 bg-white divide-y divide-error-100 overflow-hidden",success:"border border-success-200 bg-white divide-y divide-success-100 overflow-hidden",warning:"border border-warning-200 bg-white divide-y divide-warning-100 overflow-hidden",info:"border border-info-200 bg-white divide-y divide-info-100 overflow-hidden"},filled:{primary:"bg-primary-50/40 border border-primary-100 divide-y divide-primary-100/80 overflow-hidden",secondary:"bg-secondary-50/40 border border-secondary-100 divide-y divide-secondary-100/80 overflow-hidden",neutral:"bg-neutral-50 border border-neutral-200/60 divide-y divide-neutral-200/60 overflow-hidden",error:"bg-error-50/40 border border-error-100 divide-y divide-error-100/80 overflow-hidden",success:"bg-success-50/40 border border-success-100 divide-y divide-success-100/80 overflow-hidden",warning:"bg-warning-50/40 border border-warning-100 divide-y divide-warning-100/80 overflow-hidden",info:"bg-info-50/40 border border-info-100 divide-y divide-info-100/80 overflow-hidden"},separated:{primary:"bg-transparent border-0 space-y-3",secondary:"bg-transparent border-0 space-y-3",neutral:"bg-transparent border-0 space-y-3",error:"bg-transparent border-0 space-y-3",success:"bg-transparent border-0 space-y-3",warning:"bg-transparent border-0 space-y-3",info:"bg-transparent border-0 space-y-3"},ghost:{primary:"bg-transparent border-0 divide-y divide-neutral-200/70",secondary:"bg-transparent border-0 divide-y divide-neutral-200/70",neutral:"bg-transparent border-0 divide-y divide-neutral-200/70",error:"bg-transparent border-0 divide-y divide-neutral-200/70",success:"bg-transparent border-0 divide-y divide-neutral-200/70",warning:"bg-transparent border-0 divide-y divide-neutral-200/70",info:"bg-transparent border-0 divide-y divide-neutral-200/70"}},rd={outlined:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""},filled:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""},ghost:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""},separated:{primary:"bg-white border border-primary-200 shadow-xs overflow-hidden",secondary:"bg-white border border-secondary-200 shadow-xs overflow-hidden",neutral:"bg-white border border-neutral-200 shadow-xs overflow-hidden",error:"bg-white border border-error-200 shadow-xs overflow-hidden",success:"bg-white border border-success-200 shadow-xs overflow-hidden",warning:"bg-white border border-warning-200 shadow-xs overflow-hidden",info:"bg-white border border-info-200 shadow-xs overflow-hidden"}},od={outlined:{primary:"bg-primary-50/40",secondary:"bg-secondary-50/40",neutral:"bg-neutral-50/80",error:"bg-error-50/40",success:"bg-success-50/40",warning:"bg-warning-50/40",info:"bg-info-50/40"},filled:{primary:"bg-primary-50/80",secondary:"bg-secondary-50/80",neutral:"bg-neutral-100/70",error:"bg-error-50/80",success:"bg-success-50/80",warning:"bg-warning-50/80",info:"bg-info-50/80"},separated:{primary:"bg-primary-50/40",secondary:"bg-secondary-50/40",neutral:"bg-neutral-50/80",error:"bg-error-50/40",success:"bg-success-50/40",warning:"bg-warning-50/40",info:"bg-info-50/40"},ghost:{primary:"bg-transparent",secondary:"bg-transparent",neutral:"bg-transparent",error:"bg-transparent",success:"bg-transparent",warning:"bg-transparent",info:"bg-transparent"}},nd={primary:{focusRing:"focus-visible:ring-primary-500",title:"text-primary-700",activeIndicator:"text-primary-600"},secondary:{focusRing:"focus-visible:ring-secondary-500",title:"text-secondary-700",activeIndicator:"text-secondary-600"},neutral:{focusRing:"focus-visible:ring-neutral-500",title:"text-neutral-900",activeIndicator:"text-neutral-700"},error:{focusRing:"focus-visible:ring-error-500",title:"text-error-700",activeIndicator:"text-error-600"},success:{focusRing:"focus-visible:ring-success-500",title:"text-success-700",activeIndicator:"text-success-600"},warning:{focusRing:"focus-visible:ring-warning-500",title:"text-warning-700",activeIndicator:"text-warning-600"},info:{focusRing:"focus-visible:ring-info-500",title:"text-info-700",activeIndicator:"text-info-600"}};import{createContext as id,useContext as ad}from"react";var dl=id(null),fl=id(null);function Jr(){let e=ad(dl);if(!e)throw new Error("Collapse compound components must be rendered within a <Collapse> provider");return e}function cn(){let e=ad(fl);if(!e)throw new Error("Collapse subcomponents (CollapseHeader, CollapseContent) must be rendered within a <CollapsePanel>");return e}import{jsx as cd}from"react/jsx-runtime";function ld(e){return e==null?[]:Array.isArray(e)?e:[e]}function pl({activeKey:e,defaultActiveKey:t,onChange:r,accordion:o=!1,size:n="md",variant:i="outlined",color:a="primary",radius:s="md",expandIconPosition:l="right",expandIcon:m,destroyInactivePanel:f=!1,className:w="",style:g,children:p,ref:b,...h}){let x=e!==void 0,[S,k]=Um(()=>ld(t)),v=sd(()=>new Set(x?ld(e):S),[x,e,S]),d=Ym(R=>{let D,N=v.has(R);if(o)D=N?[]:[R];else{let I=Array.from(v);N?D=I.filter(E=>E!==R):D=[...I,R]}x||k(D),r?.(o?D[0]??"":D)},[o,v,x,r]),u=i==="other"?"":C(a,C(i,td,"outlined"),"primary"),y=i!=="separated"&&i!=="ghost"?C(s,Ta,"md"):"",c=["w-full transition-colors",u,y,w].filter(Boolean).join(" "),T=sd(()=>({activeKeys:v,handleToggle:d,accordion:o,size:n,variant:i,color:a,radius:s,expandIconPosition:l,expandIcon:m,destroyInactivePanel:f}),[v,d,o,n,i,a,s,l,m,f]);return cd(dl.Provider,{value:T,children:cd("div",{ref:b,className:c,style:g,...h,children:p})})}import{useId as Wm,useMemo as Km}from"react";import{jsx as Po,jsxs as qn}from"react/jsx-runtime";function Zn({startIcon:e,description:t,extra:r,showArrow:o=!0,children:n,className:i="",ref:a,onClick:s,onKeyDown:l,...m}){let{size:f,variant:w,color:g,expandIconPosition:p,expandIcon:b}=Jr(),{isActive:h,disabled:x,headerId:S,panelId:k,onToggle:v}=cn(),d=C(f,Sa,"md"),u=C(g,nd,"primary"),y=w==="other"?"":C(g,C(w,od,"outlined"),"primary"),c=o&&p!=="none",T=()=>c?typeof b=="function"?Po("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${h?"rotate-180":"rotate-0"}`,"aria-hidden":"true",children:b({isActive:h,disabled:x})}):b?Po("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${h?"rotate-180":"rotate-0"}`,"aria-hidden":"true",children:b}):Po("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${h?"rotate-180 text-neutral-700":"rotate-0"}`,"aria-hidden":"true",children:Po(xt,{className:d.icon})}):null,R=["w-full flex items-center justify-between transition-colors duration-150 select-none",d.header,d.gap,x?"cursor-not-allowed opacity-60":y,i].filter(Boolean).join(" "),D=["flex items-center flex-1 min-w-0 text-left outline-none cursor-pointer bg-transparent border-0 p-0",d.gap,x?"cursor-not-allowed pointer-events-none":`${u.focusRing} focus-visible:ring-2 focus-visible:ring-offset-1 rounded-lg`].filter(Boolean).join(" ");return qn("div",{className:R,children:[qn("button",{ref:a,id:S,type:"button","aria-expanded":h,"aria-controls":k,"aria-disabled":x?!0:void 0,disabled:x,onClick:N=>{v(),s?.(N)},onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),v()),l?.(N)},className:D,...m,children:[p==="left"&&T(),qn("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e&&Po("span",{className:`inline-flex items-center justify-center shrink-0 ${u.activeIndicator} ${d.startIcon}`,"aria-hidden":"true",children:e}),qn("div",{className:"flex flex-col min-w-0 flex-1",children:[Po("span",{className:`truncate ${d.title} ${u.title}`,children:n}),t&&Po("span",{className:`line-clamp-2 ${d.description}`,children:t})]})]}),p==="right"&&!r&&T()]}),r&&qn("div",{className:"inline-flex items-center gap-2.5 shrink-0 ml-3",children:[r,p==="right"&&T()]})]})}import{jsx as ml}from"react/jsx-runtime";function Jn({destroyInactivePanel:e,children:t,className:r="",style:o,ref:n,...i}){let{size:a,destroyInactivePanel:s}=Jr(),{isActive:l,headerId:m,panelId:f}=cn(),w=C(a,Sa,"md");return ml("div",{ref:n,id:f,role:"region","aria-labelledby":m,"aria-hidden":!l,"data-state":l?"open":"closed",className:`grid transition-[grid-template-rows] duration-200 ease-in-out ${l?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,style:o,...i,children:ml("div",{className:"overflow-hidden",children:(!(e??s)||l)&&ml("div",{className:`${w.content} ${r}`,children:t})})})}import{Fragment as _m,jsx as ka,jsxs as Xm}from"react/jsx-runtime";function gl({value:e,label:t,description:r,startIcon:o,extra:n,disabled:i=!1,showArrow:a=!0,headerClassName:s="",contentClassName:l="",destroyInactivePanel:m,className:f="",children:w,ref:g,...p}){let b=Wm(),{activeKeys:h,handleToggle:x,variant:S,color:k,radius:v}=Jr(),d=h.has(e),u=`collapse-header-${e??b}`,y=`collapse-panel-${e??b}`,c=Km(()=>({value:e,isActive:d,disabled:i,headerId:u,panelId:y,onToggle:()=>!i&&x(e)}),[e,d,i,u,y,x]),T=S==="separated"?C(v,Ta,"md"):"",D=["group",S==="other"?"":C(k,C(S,rd,"outlined"),"primary"),T,i?"opacity-50 cursor-not-allowed":"",f].filter(Boolean).join(" ");return ka(fl.Provider,{value:c,children:ka("div",{ref:g,className:D,"data-state":d?"open":"closed",...p,children:t!==void 0?Xm(_m,{children:[ka(Zn,{startIcon:o,description:r,extra:n,showArrow:a,className:s,children:t}),ka(Jn,{destroyInactivePanel:m,className:l,children:w})]}):w})})}import{useId as qm,useState as Zm}from"react";import{jsx as ud}from"react/jsx-runtime";function bl({open:e,defaultOpen:t=!1,destroyInactivePanel:r=!1,className:o="",children:n,ref:i,...a}){let s=qm(),l=e!==void 0,[m]=Zm(t),f=l?e:m;return ud("div",{ref:i,id:s,role:"region","aria-hidden":!f,"data-state":f?"open":"closed",className:`grid transition-[grid-template-rows] duration-200 ease-in-out ${f?"grid-rows-[1fr]":"grid-rows-[0fr]"} ${o}`,...a,children:ud("div",{className:"overflow-hidden",children:(!r||f)&&n})})}import{useState as eg,useMemo as tg,useCallback as dd}from"react";import{createContext as Jm,useContext as Qm}from"react";var hl=Jm(null);function Qr(){let e=Qm(hl);if(!e)throw new Error("Tabs compound components must be used within <Tabs>");return e}import{jsx as fd}from"react/jsx-runtime";function zo({activeKey:e,defaultActiveKey:t,onChange:r,onClose:o,size:n="md",variant:i="line",color:a="primary",radius:s="md",orientation:l="horizontal",placement:m="top",fullWidth:f=!1,disabled:w=!1,destroyInactiveTabPane:g=!1,className:p="",children:b,ref:h,...x}){let S=e!==void 0,[k,v]=eg(t),d=S?e:k,u=dd(N=>{S||v(N),r?.(N)},[S,r]),y=dd(N=>{o?.(N)},[o]),c=tg(()=>({activeKey:d,setActiveKey:u,size:n,variant:i,color:a,radius:s,orientation:l,placement:m,fullWidth:f,disabled:w,destroyInactiveTabPane:g,onCloseTab:y}),[d,u,n,i,a,s,l,m,f,w,g,y]),T=l==="vertical",R;T?R=m==="right"?"flex flex-row-reverse gap-4 items-start":"flex flex-row gap-4 items-start":R=m==="bottom"?"flex flex-col-reverse gap-3":"flex flex-col gap-3";let D=["w-full",R,p].filter(Boolean).join(" ");return fd("div",{ref:h,className:D,...x,children:fd(hl.Provider,{value:c,children:b})})}import{useMergeRefs as ig}from"@floating-ui/react";var pd={sm:{tab:"px-3 py-1.5 text-xs font-medium",icon:"size-3.5",gap:"gap-1.5",badge:"text-[10px] px-1.5 py-0.5 min-w-4 h-4",closeBtn:"size-3.5 -mr-1 p-0.5"},md:{tab:"px-4 py-2 text-sm font-medium",icon:"size-4",gap:"gap-2",badge:"text-xs px-2 py-0.5 min-w-5 h-5",closeBtn:"size-4 -mr-1 p-0.5"},lg:{tab:"px-5 py-2.5 text-base font-medium",icon:"size-5",gap:"gap-2.5",badge:"text-xs px-2.5 py-0.5 min-w-5.5 h-5.5",closeBtn:"size-4.5 -mr-1.5 p-0.5"}},Ra={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},md={line:(e,t)=>e==="vertical"?t==="right"?"border-l border-neutral-200 gap-1":"border-r border-neutral-200 gap-1":t==="bottom"?"border-t border-neutral-200 gap-2":"border-b border-neutral-200 gap-2",solid:()=>"bg-neutral-100 p-1 gap-1",bordered:()=>"border border-neutral-200 p-1 gap-1 bg-neutral-50/50",flat:()=>"bg-neutral-100/60 p-1 gap-1"},gd={primary:{line:{active:"text-primary-700 font-semibold",inactive:"text-neutral-600 hover:text-primary-600"},solid:{active:"text-primary-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},bordered:{active:"text-primary-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},flat:{active:"text-primary-700 font-semibold",inactive:"text-neutral-600 hover:text-primary-700"}},secondary:{line:{active:"text-secondary-700 font-semibold",inactive:"text-neutral-600 hover:text-secondary-600"},solid:{active:"text-secondary-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},bordered:{active:"text-secondary-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},flat:{active:"text-secondary-700 font-semibold",inactive:"text-neutral-600 hover:text-secondary-700"}},neutral:{line:{active:"text-neutral-950 font-semibold",inactive:"text-neutral-600 hover:text-neutral-950"},solid:{active:"text-neutral-950 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},bordered:{active:"text-neutral-950 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},flat:{active:"text-neutral-950 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"}},error:{line:{active:"text-error-700 font-semibold",inactive:"text-neutral-600 hover:text-error-600"},solid:{active:"text-error-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},bordered:{active:"text-error-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},flat:{active:"text-error-700 font-semibold",inactive:"text-neutral-600 hover:text-error-700"}},success:{line:{active:"text-success-700 font-semibold",inactive:"text-neutral-600 hover:text-success-600"},solid:{active:"text-success-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},bordered:{active:"text-success-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},flat:{active:"text-success-700 font-semibold",inactive:"text-neutral-600 hover:text-success-700"}},warning:{line:{active:"text-warning-700 font-semibold",inactive:"text-neutral-600 hover:text-warning-600"},solid:{active:"text-warning-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},bordered:{active:"text-warning-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},flat:{active:"text-warning-700 font-semibold",inactive:"text-neutral-600 hover:text-warning-700"}},info:{line:{active:"text-info-700 font-semibold",inactive:"text-neutral-600 hover:text-info-600"},solid:{active:"text-info-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},bordered:{active:"text-info-700 font-semibold",inactive:"text-neutral-600 hover:text-neutral-900"},flat:{active:"text-info-700 font-semibold",inactive:"text-neutral-600 hover:text-info-700"}}},bd={line:{primary:"bg-primary-600",secondary:"bg-secondary-600",neutral:"bg-neutral-900",error:"bg-error-600",success:"bg-success-600",warning:"bg-warning-600",info:"bg-info-600"},solid:{primary:"bg-white shadow-xs border border-neutral-200/70",secondary:"bg-white shadow-xs border border-neutral-200/70",neutral:"bg-white shadow-xs border border-neutral-200/70",error:"bg-white shadow-xs border border-neutral-200/70",success:"bg-white shadow-xs border border-neutral-200/70",warning:"bg-white shadow-xs border border-neutral-200/70",info:"bg-white shadow-xs border border-neutral-200/70"},bordered:{primary:"bg-white border border-neutral-300 shadow-xs",secondary:"bg-white border border-neutral-300 shadow-xs",neutral:"bg-white border border-neutral-300 shadow-xs",error:"bg-white border border-neutral-300 shadow-xs",success:"bg-white border border-neutral-300 shadow-xs",warning:"bg-white border border-neutral-300 shadow-xs",info:"bg-white border border-neutral-300 shadow-xs"},flat:{primary:"bg-primary-100/90",secondary:"bg-secondary-100/90",neutral:"bg-neutral-200/90",error:"bg-error-100/90",success:"bg-success-100/90",warning:"bg-warning-100/90",info:"bg-info-100/90"}};import{useCallback as hd,useEffect as rg,useLayoutEffect as og,useRef as ng,useState as xl}from"react";var xd=typeof window<"u"?og:rg;function vd({activeKey:e,orientation:t="horizontal",placement:r="top",variant:o="line",color:n="primary",radius:i="md"}={}){let a=ng(null),[s,l]=xl({opacity:0}),[m,f]=xl(!1),[w,g]=xl(!1),p=hd(()=>{if(!a.current||t==="vertical"){f(!1),g(!1);return}let{scrollLeft:k,scrollWidth:v,clientWidth:d}=a.current,u=v-d;f(k>1),g(k<u-1)},[t]),b=hd(()=>{if(!a.current)return;p();let k=a.current.querySelector('[role="tab"][aria-selected="true"]');if(!k){l(T=>({...T,opacity:0}));return}let v=k.closest("[data-tab-wrapper]")||k;v.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"});let{offsetLeft:d,offsetTop:u,offsetWidth:y,offsetHeight:c}=v;l(o==="line"?t==="vertical"?{transform:`translate3d(0, ${u}px, 0)`,height:`${c}px`,width:"2px",top:0,left:r==="right"?0:void 0,right:r!=="right"?0:void 0,opacity:1}:{transform:`translate3d(${d}px, 0, 0)`,width:`${y}px`,height:"2px",left:0,top:r==="bottom"?0:void 0,bottom:r!=="bottom"?0:void 0,opacity:1}:{transform:`translate3d(${d}px, ${u}px, 0)`,width:`${y}px`,height:`${c}px`,top:0,left:0,opacity:1})},[p,t,r,o]);return xd(()=>{b()},[b,e,o,t,r,n,i]),xd(()=>{b();let k=requestAnimationFrame(b),v=new ResizeObserver(b);if(a.current){v.observe(a.current);let u=a.current.querySelectorAll("[data-tab-wrapper], [role='tab']");for(let y of u)v.observe(y)}let d=()=>b();return window.addEventListener("resize",d),()=>{cancelAnimationFrame(k),v.disconnect(),window.removeEventListener("resize",d)}},[b]),{listRef:a,indicatorStyle:s,canScrollLeft:m,canScrollRight:w,checkScroll:p,handleScrollLeft:()=>{a.current&&a.current.scrollBy({left:-200,behavior:"smooth"})},handleScrollRight:()=>{a.current&&a.current.scrollBy({left:200,behavior:"smooth"})},handleKeyDown:k=>{if(!a.current)return;let v=Array.from(a.current.querySelectorAll('[role="tab"]:not([disabled])'));if(!v.length)return;let d=v.findIndex(R=>R===document.activeElement||R.getAttribute("aria-selected")==="true"),u=-1,y=t==="horizontal",c=y?"ArrowRight":"ArrowDown",T=y?"ArrowLeft":"ArrowUp";k.key===c?(k.preventDefault(),u=(d+1)%v.length):k.key===T?(k.preventDefault(),u=(d-1+v.length)%v.length):k.key==="Home"?(k.preventDefault(),u=0):k.key==="End"&&(k.preventDefault(),u=v.length-1),u>=0&&v[u]&&(v[u]?.focus(),v[u]?.click())}}}import{jsx as un,jsxs as yd}from"react/jsx-runtime";function Io({children:e,className:t="",extra:r,centered:o=!1,ref:n,...i}){let{activeKey:a,orientation:s="horizontal",placement:l="top",variant:m="line",color:f="primary",radius:w="md",fullWidth:g=!1}=Qr(),{listRef:p,indicatorStyle:b,canScrollLeft:h,canScrollRight:x,checkScroll:S,handleScrollLeft:k,handleScrollRight:v,handleKeyDown:d}=vd({activeKey:a,orientation:s,placement:l,variant:m,color:f,radius:w}),u=ig([p,n]),y=C(w,Ra,"md"),c=m==="other"?"":C(m,md,"line"),T=typeof c=="function"?c(s,l):"",R=m==="other"?"":C(f,C(m,bd,"line"),"primary"),D=s==="vertical",N=h||x,E=["relative flex-1 min-w-0",D?"flex flex-col items-stretch justify-start w-full":`flex flex-row items-center overflow-x-auto overflow-y-hidden [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden scroll-smooth ${g?"w-full":""}`,o&&!D?"justify-center":"",m!=="line"?y:"",T,t].filter(Boolean).join(" "),P=["absolute pointer-events-none z-0 transition-all duration-300 ease-out",m!=="line"?y:"",R].filter(Boolean).join(" ");return yd("div",{className:D?"flex flex-col items-start gap-2 shrink-0 min-w-44":"flex items-center justify-between gap-1 w-full min-w-0",children:[!D&&N&&un("button",{type:"button","aria-label":"Scroll tabs left",disabled:!h,onClick:k,className:"shrink-0 flex items-center justify-center size-7 rounded-md text-neutral-500 hover:text-neutral-900 hover:bg-neutral-100 disabled:opacity-20 disabled:pointer-events-none transition-colors cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500",children:un(rr,{className:"size-4"})}),yd("div",{ref:u,role:"tablist","aria-orientation":s,onKeyDown:d,onScroll:S,className:E,...i,children:[un("div",{"aria-hidden":"true",className:P,style:b}),e]}),!D&&N&&un("button",{type:"button","aria-label":"Scroll tabs right",disabled:!x,onClick:v,className:"shrink-0 flex items-center justify-center size-7 rounded-md text-neutral-500 hover:text-neutral-900 hover:bg-neutral-100 disabled:opacity-20 disabled:pointer-events-none transition-colors cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500",children:un(Ht,{className:"size-4"})}),r&&un("div",{className:D?"w-full mt-1":"shrink-0 ml-auto pl-1",children:r})]})}import{useRef as ag}from"react";import{useMergeRefs as sg}from"@floating-ui/react";import{jsx as dn,jsxs as wd}from"react/jsx-runtime";function Fo({value:e,label:t,startIcon:r,endIcon:o,badge:n,disabled:i=!1,closable:a=!1,onClose:s,className:l="",children:m,onClick:f,onKeyDown:w,ref:g,...p}){let{activeKey:b,setActiveKey:h,size:x,variant:S,color:k,radius:v,orientation:d,fullWidth:u,disabled:y,onCloseTab:c}=Qr(),T=ag(null),R=sg([T,g]),D=y||i,N=b===e,I=G=>{D||(h(e),f?.(G))},E=G=>{G.stopPropagation(),!D&&(s?.(G),c?.(e))},P=C(x,pd,"md"),F=C(v,Ra,"md"),z=C(k,gd,"primary"),H=S==="other"?{active:"",inactive:""}:C(S,z,"line"),V=`tab-${e}`,W=`tabpanel-${e}`,L=N?H.active:H.inactive,M=d==="vertical",O=["group relative z-10 inline-flex items-center select-none",M?"justify-start text-left w-full":"justify-center text-center",S!=="line"?F:"",u&&!M?"flex-1 text-center":"",D?"opacity-40 cursor-not-allowed pointer-events-none":"",l].filter(Boolean).join(" "),A=["inline-flex items-center cursor-pointer select-none bg-transparent",M?"justify-start text-left w-full":"justify-center text-center","transition-colors duration-200 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2",S!=="line"?F:"",P.tab,P.gap,a?"pr-1.5":"",u&&!M?"flex-1 text-center":"",L,D?"opacity-40 cursor-not-allowed pointer-events-none":""].filter(Boolean).join(" ");return wd("div",{"data-tab-wrapper":!0,className:O,children:[wd("button",{ref:R,id:V,type:"button",role:"tab","aria-selected":N,"aria-controls":W,"aria-disabled":D?"true":void 0,tabIndex:N?0:-1,disabled:D,onClick:I,onKeyDown:G=>{if(a&&(G.key==="Delete"||G.key==="Backspace")){if(G.preventDefault(),G.stopPropagation(),D)return;s?.(G),c?.(e)}w?.(G)},className:A,...p,children:[r&&dn("span",{className:`shrink-0 inline-flex items-center justify-center transition-colors duration-200 ${P.icon}`,"aria-hidden":"true",children:r}),dn("span",{className:`truncate ${M?"flex-1 text-left":""}`,children:t||m}),n!=null&&dn("span",{className:`inline-flex items-center justify-center font-medium rounded-full bg-neutral-200/80 text-neutral-700 transition-colors duration-200 ${P.badge}`,children:n}),o&&dn("span",{className:`shrink-0 inline-flex items-center justify-center transition-colors duration-200 ${P.icon}`,"aria-hidden":"true",children:o})]}),a&&dn("button",{type:"button","aria-label":"Close tab",disabled:D,tabIndex:N?0:-1,onClick:E,className:`shrink-0 cursor-pointer rounded-full hover:bg-neutral-200/80 text-neutral-400 hover:text-neutral-700 transition-colors inline-flex items-center justify-center focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500 mr-2 ${P.closeBtn}`,children:dn(Ye,{className:"size-full pointer-events-none"})})]})}import{jsx as lg}from"react/jsx-runtime";function vl({children:e,className:t="",ref:r,...o}){return lg("div",{ref:r,className:`w-full ${t}`,...o,children:e})}import{jsx as cg}from"react/jsx-runtime";function yl({value:e,children:t,className:r="",destroyInactiveTabPane:o,ref:n,...i}){let{activeKey:a,destroyInactiveTabPane:s}=Qr(),l=a===e;if((o??s)&&!l)return null;let f=`tab-${e}`,w=`tabpanel-${e}`,g=["focus-visible:outline-hidden",l?"":"hidden",r].filter(Boolean).join(" ");return cg("div",{ref:n,id:w,role:"tabpanel",tabIndex:0,"aria-labelledby":f,hidden:!l,className:g,...i,children:t})}import{createContext as ug,useContext as dg}from"react";var wl=ug(null);function mr(){let e=dg(wl);if(!e)throw new Error("Carousel compound components (CarouselContent, CarouselSlide, CarouselPrevious, CarouselNext, CarouselPagination) must be used within <Carousel>");return e}import{useCallback as Gt,useEffect as fg,useRef as Qn,useState as fn}from"react";function Da({currentIndex:e,defaultIndex:t=0,onIndexChange:r,loop:o=!1,slidesToShow:n=1,slidesToScroll:i=1,spacing:a=0,autoPlay:s=!0,interval:l=3e3,transitionDuration:m=650,pauseOnHover:f=!0,pauseOnFocus:w=!0,draggable:g=!0,size:p="md",radius:b="md"}={}){let[h,x]=fn(t),[S,k]=fn(0),[v,d]=fn(!1),[u,y]=fn(0),[c,T]=fn(!1),[R,D]=fn(!1),N=Qn(new Set),I=Qn(null),E=Qn(null),P=Qn(0),F=Qn(0),z=e!==void 0,H=z?e:h,V=Math.max(0,o?S-1:S-n),W=Gt($=>{let re=$;o?S>0?re=(re+S)%S:re=0:re=Math.max(0,Math.min(re,V)),z||x(re),r?.(re)},[z,o,V,r,S]),L=o?S>1:H>0,M=o?S>1:H<S-n,O=Gt(()=>{L&&W(H-i)},[H,L,W,i]),A=Gt(()=>{M&&W(H+i)},[H,M,W,i]),U=Gt($=>{W($)},[W]),G=Gt($=>{N.current.add($),k(N.current.size)},[]),K=Gt($=>{N.current.delete($),k(N.current.size)},[]);fg(()=>{if(!s||S<=n||f&&c||w&&R||v)return;let $=setInterval(()=>{o||H<S-n?A():U(0)},l);return()=>clearInterval($)},[H,s,l,v,R,c,o,w,f,A,U,n,S]);let q=Gt($=>{if(!g||S<=n||$.button!==0)return;let re=$.clientX;P.current=re,F.current=re,d(!0),y(0);let ee=$.currentTarget;try{ee.setPointerCapture($.pointerId)}catch{}},[g,n,S]),X=Gt($=>{if(!v)return;let re=$.clientX;F.current=re;let ee=re-P.current;if(!o){if(H===0&&ee>0){y(ee*.3);return}if(H>=S-n&&ee<0){y(ee*.3);return}}y(ee)},[H,v,o,n,S]),fe=Gt($=>{if(!v)return;d(!1);let re=F.current-P.current;Math.abs(re)>40&&(re>0?O():A()),y(0);try{$.currentTarget.releasePointerCapture($.pointerId)}catch{}},[v,A,O]),ae=Gt($=>{$.key==="ArrowLeft"?($.preventDefault(),O()):$.key==="ArrowRight"?($.preventDefault(),A()):$.key==="Home"?($.preventDefault(),U(0)):$.key==="End"&&($.preventDefault(),U(V))},[V,A,O,U]),_=Gt(()=>T(!0),[]),Z=Gt(()=>T(!1),[]),he=Gt(()=>D(!0),[]),xe=Gt(()=>D(!1),[]);return{currentIndex:H,totalSlides:S,slidesToShow:n,slidesToScroll:i,spacing:a,loop:o,canScrollPrev:L,canScrollNext:M,size:p,radius:b,transitionDuration:m,isDragging:v,dragOffset:u,scrollPrev:O,scrollNext:A,scrollTo:U,registerSlide:G,unregisterSlide:K,setTotalSlides:k,viewportRef:I,containerRef:E,handlePointerDown:q,handlePointerMove:X,handlePointerUp:fe,handlePointerCancel:fe,handleKeyDown:ae,handleMouseEnter:_,handleMouseLeave:Z,handleFocus:he,handleBlur:xe}}var ei={sm:{arrowBtn:"size-6 p-0.5 text-xs",arrowIcon:"size-3",dot:"size-1.5",activeDot:"size-1.5",line:"w-3.5 h-1",activeLine:"w-6 h-1",fraction:"text-xs px-2 py-0.5",paginationWrapper:"px-2 py-1 gap-1.5",edgeInset:"left-1.5 right-1.5"},md:{arrowBtn:"size-8 p-1.5 text-sm",arrowIcon:"size-3.5",dot:"size-2",activeDot:"size-2",line:"w-5 h-1.5",activeLine:"w-8 h-1.5",fraction:"text-xs px-2.5 py-0.5 font-medium",paginationWrapper:"px-2.5 py-1 gap-2",edgeInset:"left-2 right-2"},lg:{arrowBtn:"size-9 p-2 text-sm",arrowIcon:"size-4",dot:"size-2.5",activeDot:"size-2.5",line:"w-7 h-2",activeLine:"w-11 h-2",fraction:"text-sm px-3 py-1 font-medium",paginationWrapper:"px-3 py-1.5 gap-2.5",edgeInset:"left-2.5 right-2.5"}},Cd={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Cl={glass:"bg-white/40 backdrop-blur-md border border-white/40 text-primary-950 shadow-md hover:bg-white/70 active:scale-90 disabled:opacity-25 disabled:pointer-events-none",filled:"bg-primary-600 text-white shadow-md hover:bg-primary-700 active:bg-primary-800 disabled:bg-neutral-300 disabled:text-neutral-500 disabled:opacity-50",outline:"border border-primary-600 text-primary-600 bg-white/70 backdrop-blur-sm hover:bg-primary-50 disabled:border-neutral-300 disabled:text-neutral-400",ghost:"text-primary-600 hover:bg-primary-100/60 active:bg-primary-200/60 disabled:text-neutral-400"},Sl="bg-black/25 backdrop-blur-md border border-white/20 shadow-sm rounded-full",ti={active:"bg-primary-600 shadow-sm",inactive:"bg-white/60 hover:bg-white/90 transition-colors"};import{jsx as Sd}from"react/jsx-runtime";function Td({currentIndex:e,defaultIndex:t=0,onIndexChange:r,loop:o=!1,slidesToShow:n=1,slidesToScroll:i=1,spacing:a=0,autoPlay:s=!0,interval:l=3e3,transitionDuration:m=650,pauseOnHover:f=!0,pauseOnFocus:w=!0,draggable:g=!0,size:p="md",radius:b="md",children:h,className:x="",style:S,ref:k,...v}){let d=Da({currentIndex:e,defaultIndex:t,onIndexChange:r,loop:o,slidesToShow:n,slidesToScroll:i,spacing:a,autoPlay:s,interval:l,transitionDuration:m,pauseOnHover:f,pauseOnFocus:w,draggable:g,size:p,radius:b}),u=C(b,Cd,"md");return Sd(wl.Provider,{value:d,children:Sd("div",{ref:k,role:"region","aria-roledescription":"carousel","aria-label":"B\u0103ng chuy\u1EC1n",tabIndex:0,onKeyDown:d.handleKeyDown,onMouseEnter:d.handleMouseEnter,onMouseLeave:d.handleMouseLeave,onFocus:d.handleFocus,onBlur:d.handleBlur,className:`relative overflow-hidden group focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${u} ${x}`,style:S,...v,children:h})})}import{jsx as kd}from"react/jsx-runtime";function Rd({children:e,className:t="",style:r,ref:o,...n}){let{currentIndex:i,slidesToShow:a,spacing:s,transitionDuration:l,isDragging:m,dragOffset:f,viewportRef:w,handlePointerDown:g,handlePointerMove:p,handlePointerUp:b,handlePointerCancel:h}=mr(),x=typeof s=="number"?`${s}px`:s||"0px",S=`translateX(calc(-${i} * ((100% + ${x}) / ${a}) + ${f}px))`,k={display:"flex",flexDirection:"row",gap:x,transform:S,transition:m?"none":`transform ${l}ms cubic-bezier(0.25, 1, 0.5, 1)`,touchAction:"pan-y",width:"100%"};return kd("div",{ref:w,className:`overflow-hidden relative w-full h-full cursor-grab ${m?"cursor-grabbing select-none":""}`,onPointerDown:g,onPointerMove:p,onPointerUp:b,onPointerCancel:h,children:kd("div",{ref:o,role:"presentation",className:`flex ${t}`,style:{...k,...r},...n,children:e})})}import{useId as pg,useEffect as mg}from"react";import{jsx as gg}from"react/jsx-runtime";function Dd({children:e,className:t="",style:r,ref:o,...n}){let i=pg(),{slidesToShow:a,spacing:s,registerSlide:l,unregisterSlide:m}=mr();mg(()=>(l(i),()=>{m(i)}),[i,l,m]);let f=typeof s=="number"?`${s}px`:s||"0px",w={...r};return a>1||f!=="0px"?w.flex=`0 0 calc((100% - ${a-1} * ${f}) / ${a})`:w.flex="0 0 100%",gg("div",{ref:o,role:"group","aria-roledescription":"slide",className:`min-w-0 shrink-0 grow-0 select-none box-border relative overflow-hidden ${t}`,style:w,...n,children:e})}import{jsx as Na}from"react/jsx-runtime";function Nd({variant:e="glass",icon:t,className:r="",disabled:o,onClick:n,ref:i,...a}){let{scrollPrev:s,canScrollPrev:l,size:m}=mr(),f=o!==void 0?o:!l,w=C(m,ei,"md"),g=C(e,Cl,"glass"),p=Na(rr,{className:w.arrowIcon}),b=["absolute left-2 top-1/2 -translate-y-1/2 inline-flex items-center justify-center font-medium leading-none rounded-full transition-all duration-200 cursor-pointer select-none outline-none disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-25 focus-visible:ring-2 focus-visible:ring-primary-500/50 active:scale-90 z-10",g,w.arrowBtn,r].filter(Boolean).join(" ");return Na("button",{ref:i,type:"button","aria-label":"Slide tr\u01B0\u1EDBc",disabled:f,onClick:h=>{s(),n?.(h)},className:b,...a,children:t||p})}function Pd({variant:e="glass",icon:t,className:r="",disabled:o,onClick:n,ref:i,...a}){let{scrollNext:s,canScrollNext:l,size:m}=mr(),f=o!==void 0?o:!l,w=C(m,ei,"md"),g=C(e,Cl,"glass"),p=Na(Ht,{className:w.arrowIcon}),b=["absolute right-2 top-1/2 -translate-y-1/2 inline-flex items-center justify-center font-medium leading-none rounded-full transition-all duration-200 cursor-pointer select-none outline-none disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-25 focus-visible:ring-2 focus-visible:ring-primary-500/50 active:scale-90 z-10",g,w.arrowBtn,r].filter(Boolean).join(" ");return Na("button",{ref:i,type:"button","aria-label":"Slide ti\u1EBFp theo",disabled:f,onClick:h=>{s(),n?.(h)},className:b,...a,children:t||p})}import{jsx as Pa,jsxs as bg}from"react/jsx-runtime";function zd({type:e="dots",clickable:t=!0,className:r="",ref:o,...n}){let{currentIndex:i,totalSlides:a,slidesToShow:s,loop:l,scrollTo:m,size:f}=mr();if(e==="none"||a<=1)return null;let w=C(f,ei,"md"),g=l?a:Math.max(1,a-s+1);return e==="fraction"?Pa("div",{ref:o,role:"status","aria-live":"polite",className:`absolute z-10 bottom-2.5 left-1/2 -translate-x-1/2 inline-flex items-center justify-center font-medium ${Sl} text-white ${w.fraction} ${r}`,...n,children:bg("span",{children:[Math.min(i+1,g)," / ",g]})}):Pa("div",{ref:o,role:"tablist","aria-label":"Ph\xE2n trang b\u0103ng chuy\u1EC1n",className:`absolute z-10 bottom-2.5 left-1/2 -translate-x-1/2 inline-flex items-center justify-center ${Sl} ${w.paginationWrapper} ${r}`,...n,children:Array.from({length:g}).map((p,b)=>{let h=b===i;return e==="line"?Pa("button",{type:"button",role:"tab","aria-selected":h,"aria-label":`Chuy\u1EC3n \u0111\u1EBFn slide ${b+1}`,disabled:!t,onClick:()=>t&&m(b),className:`transition-all duration-300 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${h?`${w.activeLine} ${ti.active}`:`${w.line} ${ti.inactive}`} ${t?"cursor-pointer":"cursor-default"}`},b):Pa("button",{type:"button",role:"tab","aria-selected":h,"aria-label":`Chuy\u1EC3n \u0111\u1EBFn slide ${b+1}`,disabled:!t,onClick:()=>t&&m(b),className:`transition-colors duration-200 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${w.dot} ${h?ti.active:ti.inactive} ${t?"cursor-pointer":"cursor-default"}`},b)})})}import{useState as Id,useRef as Fd,useMemo as Md,useCallback as vg}from"react";import{useFloating as yg,autoUpdate as wg,offset as Cg,flip as Sg,shift as Tg,useClick as kg,useHover as Rg,useDismiss as Dg,useRole as Ng,useListNavigation as Pg,useTypeahead as zg,useInteractions as Ig,safePolygon as Fg}from"@floating-ui/react";import{createContext as hg,useContext as xg}from"react";var Tl=hg(null),Tr=()=>{let e=xg(Tl);if(!e)throw new Error("Dropdown compound components must be used within a <Dropdown> component.");return e};import{jsx as Mg}from"react/jsx-runtime";function kl({children:e,open:t,defaultOpen:r=!1,onOpenChange:o,trigger:n="click",placement:i="bottom-start",offset:a=4,flip:s=!0,shift:l=!0,size:m="md",radius:f="md",color:w="primary",disabled:g=!1,animated:p=!0,animationDuration:b=150,closeOnSelect:h=!0}){let[x,S]=Id(r),[k,v]=Id(null),d=Fd([]),u=Fd([]),y=t!==void 0,c=y?t:x,T=vg(U=>{y||S(U),U||v(null),o?.(U)},[y,o]),R=Md(()=>[Cg(a),s?Sg():void 0,l?Tg({padding:8}):void 0].filter(Boolean),[a,s,l]),{refs:D,floatingStyles:N,context:I,placement:E}=yg({placement:i,open:c&&!g,onOpenChange:T,whileElementsMounted:wg,transform:!1,middleware:R}),P=kg(I,{enabled:!g&&n==="click"}),F=Rg(I,{enabled:!g&&n==="hover",delay:{open:100,close:150},handleClose:Fg()}),z=Dg(I),H=Ng(I,{role:"menu"}),V=Pg(I,{listRef:d,activeIndex:k,onNavigate:v,loop:!0}),W=zg(I,{listRef:u,activeIndex:k,onMatch:c?v:void 0}),{getReferenceProps:L,getFloatingProps:M,getItemProps:O}=Ig([P,F,z,H,V,W]),A=Md(()=>({isOpen:c,setIsOpen:T,refs:D,floatingStyles:N,context:I,getReferenceProps:L,getFloatingProps:M,getItemProps:O,elementsRef:d,labelsRef:u,activeIndex:k,setActiveIndex:v,size:m,radius:f,color:w,disabled:g,animated:p,animationDuration:b,closeOnSelect:h,computedPlacement:E}),[c,T,D,N,I,L,M,O,d,u,k,v,m,f,w,g,p,b,h,E]);return Mg(Tl.Provider,{value:A,children:e})}import{cloneElement as Eg,isValidElement as Rl}from"react";import{useMergeRefs as $d}from"@floating-ui/react";import{jsx as Ed}from"react/jsx-runtime";function $g({children:e,ref:t,disabled:r,className:o="",...n}){let i=Rl(e)?e.props?.ref:void 0,a=$d([t,i]);if(!Rl(e))return null;let s=e.props||{};return Eg(e,{...n,...s,ref:a,disabled:r?!0:s.disabled,className:[s.className,o].filter(Boolean).join(" ")})}function Lg({ref:e,children:t,className:r="",asChild:o=!1,...n}){let{refs:i,getReferenceProps:a,isOpen:s,disabled:l}=Tr(),m=$d([i.setReference,e]),f=a({...n,"aria-expanded":s,"aria-haspopup":"menu",className:r});return Rl(t)&&(o||!0)?Ed($g,{ref:m,disabled:l,...f,children:t}):Ed("button",{ref:m,type:"button",disabled:l,"aria-expanded":s,"aria-haspopup":"menu",className:r,...f,children:t})}var Ld=Lg;import{FloatingPortal as Og,FloatingList as Gg,useMergeRefs as jg}from"@floating-ui/react";var pn={xs:{menu:"p-1 min-w-36 text-xs",item:"px-2 py-1 text-xs rounded",itemGap:"gap-1.5",icon:"size-3.5",header:"px-2 py-1 text-[10px]",description:"text-[10px]",shortcut:"text-[10px] px-1 py-0.5"},sm:{menu:"p-1.5 min-w-44 text-xs",item:"px-2.5 py-1.5 text-xs rounded-md",itemGap:"gap-2",icon:"size-4",header:"px-2.5 py-1 text-xs",description:"text-[11px]",shortcut:"text-[11px] px-1.5 py-0.5"},md:{menu:"p-1.5 min-w-52 text-sm",item:"px-3 py-2 text-sm rounded-lg",itemGap:"gap-2.5",icon:"size-4.5",header:"px-3 py-1.5 text-xs",description:"text-xs",shortcut:"text-xs px-1.5 py-0.5"},lg:{menu:"p-2 min-w-60 text-base",item:"px-3.5 py-2.5 text-base rounded-xl",itemGap:"gap-3",icon:"size-5",header:"px-3.5 py-1.5 text-sm",description:"text-sm",shortcut:"text-sm px-2 py-0.5"},xl:{menu:"p-2.5 min-w-72 text-lg",item:"px-4 py-3 text-lg rounded-2xl",itemGap:"gap-3.5",icon:"size-6",header:"px-4 py-2 text-base",description:"text-base",shortcut:"text-base px-2 py-1"}},Bd={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-3xl"},Hd={primary:{active:"bg-primary-50 text-primary-900",selected:"bg-primary-100 text-primary-900 font-medium",focus:"focus:bg-primary-50 focus:text-primary-900"},secondary:{active:"bg-secondary-50 text-secondary-900",selected:"bg-secondary-100 text-secondary-900 font-medium",focus:"focus:bg-secondary-50 focus:text-secondary-900"},neutral:{active:"bg-neutral-100 text-neutral-900",selected:"bg-neutral-200 text-neutral-900 font-medium",focus:"focus:bg-neutral-100 focus:text-neutral-900"},error:{active:"bg-error-50 text-error-900",selected:"bg-error-100 text-error-900 font-medium",focus:"focus:bg-error-50 focus:text-error-900"},success:{active:"bg-success-50 text-success-900",selected:"bg-success-100 text-success-900 font-medium",focus:"focus:bg-success-50 focus:text-success-900"},warning:{active:"bg-warning-50 text-warning-900",selected:"bg-warning-100 text-warning-900 font-medium",focus:"focus:bg-warning-50 focus:text-warning-900"},info:{active:"bg-info-50 text-info-900",selected:"bg-info-100 text-info-900 font-medium",focus:"focus:bg-info-50 focus:text-info-900"}},Dl={default:"text-error-600 hover:bg-error-50 hover:text-error-700",active:"bg-error-50 text-error-700",focus:"focus:bg-error-50 focus:text-error-700"};import{createContext as Bg,useContext as Hg}from"react";var Nl=Bg(null),Ze=()=>Hg(Nl);import{createContext as Vg,useContext as Ag}from"react";var Pl=Vg(null),Je=()=>Ag(Pl);import{jsx as zl}from"react/jsx-runtime";function Il({ref:e,children:t,className:r="",style:o,minWidth:n,zIndex:i=st.DROPDOWN,...a}){let{isOpen:s,refs:l,floatingStyles:m,context:f,getFloatingProps:w,elementsRef:g,labelsRef:p,size:b,radius:h,animated:x,animationDuration:S,computedPlacement:k}=Tr(),v=jg([l.setFloating,e]),{isMounted:d,styles:u}=it(f,{duration:S,animated:x}),y=Ze(),c=Je();if(!d)return null;let T=C(b,pn,"md"),R=C(h,Bd,"md"),D=["bg-neutral-white border-2 border-neutral-200 shadow-lg outline-none focus:outline-none flex flex-col",T.menu,R,r].filter(Boolean).join(" "),N=y?.dialogRef??c?.dialogRef;return zl(Og,{root:N,children:zl("div",{ref:v,style:{...m,...x?u:{},minWidth:n,zIndex:i,...o},className:D,"data-state":s?"open":"closed","data-placement":k,...w(a),children:zl(Gg,{elementsRef:g,labelsRef:p,children:t})})})}import{useListItem as Ug,useMergeRefs as Yg}from"@floating-ui/react";import{jsx as ri,jsxs as Vd}from"react/jsx-runtime";function Wg({ref:e,children:t,onClick:r,disabled:o=!1,danger:n=!1,selected:i=!1,startIcon:a,endIcon:s,shortcut:l,description:m,className:f="",closeOnSelect:w,...g}){let{getItemProps:p,activeIndex:b,setIsOpen:h,color:x,size:S,closeOnSelect:k}=Tr(),v=typeof t=="string"?t:void 0,{ref:d,index:u}=Ug({label:v}),y=Yg([d,e]),c=b===u,T=C(S,pn,"md"),R=C(x,Hd,"primary"),D=E=>{if(o){E.preventDefault();return}r?.(E),(w??k)&&h(!1)},N=o?"opacity-50 cursor-not-allowed text-neutral-400 select-none":n?`${Dl.default} ${c?Dl.active:""} cursor-pointer`:i?`${R.selected} cursor-pointer`:`${c?R.active:"text-neutral-700 hover:bg-neutral-100 hover:text-neutral-900"} cursor-pointer`,I=["w-full text-left flex items-center select-none transition-colors duration-100 outline-none focus:outline-none",T.item,T.itemGap,N,f].filter(Boolean).join(" ");return Vd("button",{ref:y,type:"button",role:"menuitem",disabled:o,"aria-disabled":o,tabIndex:c?0:-1,...p({...g,onClick:D,className:I}),children:[a&&ri("span",{className:`flex items-center justify-center shrink-0 ${T.icon}`,children:a}),Vd("div",{className:"flex-1 flex flex-col min-w-0",children:[ri("span",{className:"truncate",children:t}),m&&ri("span",{className:`text-neutral-500 truncate ${T.description}`,children:m})]}),l&&ri("kbd",{className:`shrink-0 rounded border border-neutral-200 bg-neutral-50 font-mono text-neutral-500 tracking-wider ${T.shortcut}`,children:l}),s&&ri("span",{className:`flex items-center justify-center shrink-0 ${T.icon}`,children:s})]})}var Ad=Wg;import{jsx as Kg}from"react/jsx-runtime";function Fl({children:e,className:t="",...r}){let{size:o}=Tr(),n=C(o,pn,"md");return Kg("div",{role:"presentation",className:["font-semibold text-neutral-500 uppercase tracking-wider select-none",n.header,t].filter(Boolean).join(" "),...r,children:e})}var Od=Fl;import{jsx as Xg}from"react/jsx-runtime";function _g({className:e="",...t}){return Xg("hr",{className:["-mx-1 my-1 h-px border-0 bg-neutral-200",e].filter(Boolean).join(" "),...t})}var Gd=_g;import{jsx as Zg,jsxs as Jg}from"react/jsx-runtime";function qg({children:e,label:t,className:r="",...o}){return Jg("div",{role:"group",className:["flex flex-col",r].filter(Boolean).join(" "),...o,children:[t&&Zg(Fl,{children:t}),e]})}var jd=qg;import{useState as tb,useMemo as Ud,useCallback as rb}from"react";import{useFloating as ob,autoUpdate as nb,offset as ib,flip as ab,shift as sb,useClick as lb,useHover as cb,useDismiss as ub,useRole as db,useInteractions as fb,safePolygon as pb}from"@floating-ui/react";import{createContext as Qg,useContext as eb}from"react";var Ml=Qg(null),jt=()=>{let e=eb(Ml);if(!e)throw new Error("Popover compound components must be used within a <Popover> component.");return e};import{jsx as mb}from"react/jsx-runtime";function oi({children:e,open:t,defaultOpen:r=!1,onOpenChange:o,trigger:n="click",placement:i="bottom",offset:a=8,flip:s=!0,shift:l=!0,size:m="md",radius:f="md",color:w="neutral",disabled:g=!1,animated:p=!0,animationDuration:b=150,modal:h=!1,closeOnEsc:x=!0,closeOnClickOutside:S=!0}){let[k,v]=tb(r),d=t!==void 0,u=d?t:k,y=rb(W=>{d||v(W),o?.(W)},[d,o]),c=Ud(()=>[ib(a),s?ab():void 0,l?sb({padding:8}):void 0].filter(Boolean),[a,s,l]),{refs:T,floatingStyles:R,context:D,placement:N}=ob({placement:i,open:u&&!g,onOpenChange:y,whileElementsMounted:nb,transform:!1,middleware:c}),I=lb(D,{enabled:!g&&n==="click"}),E=cb(D,{enabled:!g&&n==="hover",delay:{open:100,close:150},handleClose:pb()}),P=ub(D,{escapeKey:x,outsidePress:S}),F=db(D,{role:"dialog"}),{getReferenceProps:z,getFloatingProps:H}=fb([I,E,P,F]),V=Ud(()=>({isOpen:u,setIsOpen:y,refs:T,floatingStyles:R,context:D,getReferenceProps:z,getFloatingProps:H,size:m,radius:f,color:w,disabled:g,animated:p,animationDuration:b,modal:h,computedPlacement:N}),[u,y,T,R,D,z,H,m,f,w,g,p,b,h,N]);return mb(Ml.Provider,{value:V,children:e})}import{cloneElement as gb,isValidElement as El}from"react";import{useMergeRefs as Wd}from"@floating-ui/react";import{jsx as Yd}from"react/jsx-runtime";function bb({children:e,ref:t,disabled:r,className:o="",...n}){let i=El(e)?e.props?.ref:void 0,a=Wd([t,i]);if(!El(e))return null;let s=e.props||{};return gb(e,{...n,...s,ref:a,disabled:r?!0:s.disabled,className:[s.className,o].filter(Boolean).join(" ")})}function hb({ref:e,children:t,className:r="",asChild:o=!1,...n}){let{refs:i,getReferenceProps:a,isOpen:s,disabled:l}=jt(),m=Wd([i.setReference,e]),f=a({...n,"aria-expanded":s,"aria-haspopup":"dialog",className:r});return El(t)&&(o||!0)?Yd(bb,{ref:m,disabled:l,...f,children:t}):Yd("button",{ref:m,type:"button",disabled:l,"aria-expanded":s,"aria-haspopup":"dialog",className:r,...f,children:t})}var za=hb;import{FloatingPortal as xb,FloatingFocusManager as vb,useMergeRefs as yb}from"@floating-ui/react";var eo={xs:{container:"min-w-44 text-xs",header:"px-2.5 py-1.5 text-xs font-semibold",body:"px-2.5 py-2 text-xs",footer:"px-2.5 py-1.5 text-xs"},sm:{container:"min-w-56 text-xs",header:"px-3 py-2 text-xs font-semibold",body:"px-3 py-2.5 text-xs",footer:"px-3 py-2 text-xs"},md:{container:"min-w-64 text-sm",header:"px-4 py-3 text-sm font-semibold",body:"px-4 py-3 text-sm",footer:"px-4 py-2.5 text-sm"},lg:{container:"min-w-80 text-base",header:"px-5 py-3.5 text-base font-semibold",body:"px-5 py-4 text-base",footer:"px-5 py-3 text-base"},xl:{container:"min-w-96 text-lg",header:"px-6 py-4 text-lg font-semibold",body:"px-6 py-5 text-lg",footer:"px-6 py-4 text-lg"}},Kd={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-3xl"};import{jsx as $l}from"react/jsx-runtime";function Ll({ref:e,children:t,className:r="",style:o,minWidth:n,maxWidth:i,zIndex:a=st.POPOVER,...s}){let{isOpen:l,refs:m,floatingStyles:f,context:w,getFloatingProps:g,size:p,radius:b,animated:h,animationDuration:x,modal:S,computedPlacement:k}=jt(),v=yb([m.setFloating,e]),{isMounted:d,styles:u}=it(w,{duration:x,animated:h}),y=Ze(),c=Je();if(!d)return null;let T=C(p,eo,"md"),R=C(b,Kd,"md"),N=["bg-neutral-white shadow-xl outline-none focus:outline-none flex flex-col border-2 border-neutral-200",T.container,R,r].filter(Boolean).join(" "),I=$l(vb,{context:w,modal:S,children:$l("div",{ref:v,style:{...f,...h?u:{},minWidth:n,maxWidth:i,zIndex:a,...o},className:N,"data-state":l?"open":"closed","data-placement":k,...g(s),children:t})}),E=y?.dialogRef??c?.dialogRef;return $l(xb,{root:E,children:I})}var _d=Ll;import{jsx as wb}from"react/jsx-runtime";function Bl({children:e,className:t="",...r}){let{size:o}=jt(),n=C(o,eo,"md");return wb("h2",{className:["text-neutral-900 border-b border-neutral-100 font-semibold",n.header,t].filter(Boolean).join(" "),...r,children:e})}var Xd=Bl;import{jsx as Cb}from"react/jsx-runtime";function Hl({children:e,className:t="",...r}){let{size:o}=jt(),n=C(o,eo,"md");return Cb("div",{className:["text-neutral-700",n.body,t].filter(Boolean).join(" "),...r,children:e})}var qd=Hl;import{jsx as Tb}from"react/jsx-runtime";function Sb({children:e,className:t="",...r}){let{size:o}=jt(),n=C(o,eo,"md");return Tb("div",{className:["border-t border-neutral-100 bg-neutral-50/50",n.footer,t].filter(Boolean).join(" "),...r,children:e})}var Zd=Sb;import{cloneElement as kb,isValidElement as Vl}from"react";import{useMergeRefs as Rb}from"@floating-ui/react";import{jsx as Jd}from"react/jsx-runtime";function Db({children:e,ref:t,className:r="",onClick:o,...n}){let i=Vl(e)?e.props?.ref:void 0,a=Rb([t,i]);if(!Vl(e))return null;let s=e.props||{};return kb(e,{...n,...s,ref:a,className:[s.className,r].filter(Boolean).join(" "),onClick:l=>{s.onClick?.(l),o?.(l)}})}function Nb({ref:e,children:t,className:r="",asChild:o=!1,onClick:n,...i}){let{setIsOpen:a}=jt(),s=l=>{n?.(l),l.defaultPrevented||a(!1)};return Vl(t)&&o?Jd(Db,{ref:e,className:r,onClick:s,...i,children:t}):Jd("button",{ref:e,type:"button",className:r,onClick:s,...i,children:t})}var Qd=Nb;import{useState as Wl,useId as Mb,useMemo as Eb}from"react";import{useFloating as $b,autoUpdate as Lb,offset as Bb,flip as Hb,shift as Vb,useDismiss as Ab,useRole as Ob,useInteractions as Gb,FloatingPortal as jb,FloatingFocusManager as Ub}from"@floating-ui/react";import{useState as Yl,useMemo as af}from"react";var ef={months:["Th\xE1ng 1","Th\xE1ng 2","Th\xE1ng 3","Th\xE1ng 4","Th\xE1ng 5","Th\xE1ng 6","Th\xE1ng 7","Th\xE1ng 8","Th\xE1ng 9","Th\xE1ng 10","Th\xE1ng 11","Th\xE1ng 12"],monthsShort:["Thg 1","Thg 2","Thg 3","Thg 4","Thg 5","Thg 6","Thg 7","Thg 8","Thg 9","Thg 10","Thg 11","Thg 12"],weekdays:["Ch\u1EE7 Nh\u1EADt","Th\u1EE9 Hai","Th\u1EE9 Ba","Th\u1EE9 T\u01B0","Th\u1EE9 N\u0103m","Th\u1EE9 S\xE1u","Th\u1EE9 B\u1EA3y"],weekdaysShort:["CN","T2","T3","T4","T5","T6","T7"],weekdaysMin:["CN","T2","T3","T4","T5","T6","T7"],todayText:"H\xF4m nay",clearText:"X\xF3a",weekText:"Tu\u1EA7n",viewTabs:{days:"Ng\xE0y",months:"Th\xE1ng",years:"N\u0103m"}},tf={months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],todayText:"Today",clearText:"Clear",weekText:"Week",viewTabs:{days:"Day",months:"Month",years:"Year"}},or={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,calendarPadding:"p-4.5",cellSize:"w-11 h-11",cellText:"text-base",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}};var to={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},rf={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},ro={primary:{selected:"bg-primary-500 text-neutral-white hover:bg-primary-600",selectedText:"text-neutral-white",rangeBg:"bg-primary-100 text-primary-900",rangeText:"text-primary-900",hoverBg:"hover:bg-primary-200 hover:text-primary-900",todayRing:"border-primary-500 text-primary-500",activeText:"text-primary-500",accentBg:"bg-primary-500"},secondary:{selected:"bg-secondary-500 text-neutral-white hover:bg-secondary-600",selectedText:"text-neutral-white",rangeBg:"bg-secondary-100 text-secondary-900",rangeText:"text-secondary-900",hoverBg:"hover:bg-secondary-200 hover:text-secondary-900",todayRing:"border-secondary-500 text-secondary-500",activeText:"text-secondary-500",accentBg:"bg-secondary-500"},neutral:{selected:"bg-neutral-800 text-neutral-white hover:bg-neutral-900",selectedText:"text-neutral-white",rangeBg:"bg-neutral-200 text-neutral-900",rangeText:"text-neutral-900",hoverBg:"hover:bg-neutral-300 hover:text-neutral-900",todayRing:"border-neutral-600 text-neutral-600",activeText:"text-neutral-800",accentBg:"bg-neutral-800"},error:{selected:"bg-error-500 text-neutral-white hover:bg-error-600",selectedText:"text-neutral-white",rangeBg:"bg-error-100 text-error-900",rangeText:"text-error-900",hoverBg:"hover:bg-error-200 hover:text-error-900",todayRing:"border-error-500 text-error-500",activeText:"text-error-500",accentBg:"bg-error-500"},success:{selected:"bg-success-500 text-neutral-white hover:bg-success-600",selectedText:"text-neutral-white",rangeBg:"bg-success-100 text-success-900",rangeText:"text-success-900",hoverBg:"hover:bg-success-200 hover:text-success-900",todayRing:"border-success-500 text-success-500",activeText:"text-success-500",accentBg:"bg-success-500"},warning:{selected:"bg-warning-500 text-neutral-950 hover:bg-warning-600",selectedText:"text-neutral-950",rangeBg:"bg-warning-100 text-warning-900",rangeText:"text-warning-900",hoverBg:"hover:bg-warning-200 hover:text-warning-900",todayRing:"border-warning-500 text-warning-700",activeText:"text-warning-700",accentBg:"bg-warning-500"},info:{selected:"bg-info-500 text-neutral-white hover:bg-info-600",selectedText:"text-neutral-white",rangeBg:"bg-info-100 text-info-900",rangeText:"text-info-900",hoverBg:"hover:bg-info-200 hover:text-info-900",todayRing:"border-info-500 text-info-500",activeText:"text-info-500",accentBg:"bg-info-500"}},of={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}};function Tt(e){return!e||e==="vi"?ef:e==="en"?tf:e}function zt(e,t){if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:new Date(e.getTime());if(typeof e=="string"){let r=e.trim();if(!r)return null;if(t){let n=Ol(r,t);if(n)return n}let o=new Date(r);return isNaN(o.getTime())?null:o}if(typeof e=="number"){let r=new Date(e);return isNaN(r.getTime())?null:r}return null}function oo(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Ia(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function ni(e,t){let r=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),o=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return r<o}function ii(e,t){let r=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),o=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return r>o}function ai(e){let t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),r=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-r);let o=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t.getTime()-o.getTime())/864e5+1)/7)}function nf(e,t){return new Date(e,t+1,0).getDate()}function Fa(e,t,r=1,o,n,i,a){let s=[],l=new Date,m=new Date(e,t,1).getDay(),f=nf(e,t-1),w=nf(e,t),g=r===1?m===0?6:m-1:m;for(let b=g-1;b>=0;b--){let h=f-b,x=new Date(e,t-1,h);s.push(Al(x,!1,l,o,n,i,a))}for(let b=1;b<=w;b++){let h=new Date(e,t,b);s.push(Al(h,!0,l,o,n,i,a))}let p=42-s.length;for(let b=1;b<=p;b++){let h=new Date(e,t+1,b);s.push(Al(h,!1,l,o,n,i,a))}return s}function Al(e,t,r,o,n,i,a){let s=o?oo(e,o):!1,l=!1;return n&&ni(e,n)&&(l=!0),i&&ii(e,i)&&(l=!0),a&&a(e)&&(l=!0),{date:e,day:e.getDate(),month:e.getMonth(),year:e.getFullYear(),isCurrentMonth:t,isToday:oo(e,r),isSelected:s,isDisabled:l,weekNumber:ai(e)}}function qt(e,t="DD/MM/YYYY",r){if(!e||isNaN(e.getTime()))return"";let o=Tt(r),n=e.getFullYear(),i=e.getMonth(),a=e.getDate(),s=e.getHours(),l=e.getMinutes(),m=e.getSeconds(),f=e.getDay(),w=h=>String(h).padStart(2,"0"),g=s%12||12,p=s>=12?"PM":"AM",b={YYYY:String(n),YY:String(n).slice(-2),MMMM:o.months[i]??"",MMM:o.monthsShort[i]??"",MM:w(i+1),M:String(i+1),DD:w(a),D:String(a),dddd:o.weekdays[f]??"",ddd:o.weekdaysShort[f]??"",dd:o.weekdaysMin[f]??"",HH:w(s),H:String(s),hh:w(g),h:String(g),mm:w(l),m:String(l),ss:w(m),s:String(m),A:p,a:p.toLowerCase()};return t.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|ddd|dd|HH|H|hh|h|mm|m|ss|s|A|a/g,h=>b[h]??h)}function Ol(e,t="DD/MM/YYYY"){if(!e||typeof e!="string")return null;let r=e.trim();if(!r)return null;let o=new Date().getFullYear(),n=1,i=1,a=0,s=0,l=0,m=t.match(/YYYY|YY|MM|M|DD|D|HH|H|hh|h|mm|m|ss|s/g);if(!m){let p=new Date(r);return isNaN(p.getTime())?null:p}let f="^"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");for(let p of m)p==="YYYY"?f=f.replace("YYYY","(\\d{4})"):p==="YY"?f=f.replace("YY","(\\d{2})"):(p==="MM"||p==="M"||p==="DD"||p==="D"||p==="HH"||p==="H"||p==="hh"||p==="h"||p==="mm"||p==="m"||p==="ss"||p==="s")&&(f=f.replace(p,"(\\d{1,2})"));f+="$";let w=new RegExp(f).exec(r);if(!w){let p=new Date(r);return isNaN(p.getTime())?null:p}m.forEach((p,b)=>{let h=w[b+1];if(!h)return;let x=parseInt(h,10);isNaN(x)||(p==="YYYY"?o=x:p==="YY"?o=2e3+x:p==="MM"||p==="M"?n=x:p==="DD"||p==="D"?i=x:p==="HH"||p==="H"||p==="hh"||p==="h"?a=x:p==="mm"||p==="m"?s=x:(p==="ss"||p==="s")&&(l=x))});let g=new Date(o,n-1,i,a,s,l);return isNaN(g.getTime())?null:g}function Ma(e,t="days"){if(t==="days")return e;if(t==="years")return e.includes("YYYY")?"YYYY":e.includes("YY")?"YY":"YYYY";if(t==="months"){let r=e.replace(/(?:DD|D|dddd|ddd|dd)\s*[-/.,\s]+\s*/,"");return r=r.replace(/\s*[-/.,\s]+\s*(?:DD|D|dddd|ddd|dd)/,""),r=r.replace(/[-/.,\s]{2,}/g,o=>o.charAt(0)).trim(),!r||!r.includes("M")&&!r.includes("Y")?e.includes("-")?"MM-YYYY":"MM/YYYY":r}return e}import{jsx as Hr,jsxs as Gl}from"react/jsx-runtime";function si({currentMonth:e,view:t,onViewChange:r,onPrevMonth:o,onNextMonth:n,onPrevYear:i,onNextYear:a,onPrevDecade:s,onNextDecade:l,size:m="md",color:f="primary",locale:w,showMonthButtons:g=!0}){let p=Tt(w),b=C(m,or,"md"),h=C(f,ro,"primary"),x=e.getFullYear(),S=e.getMonth(),k=Math.floor(x/10)*10,v=k+9,d=()=>{t==="days"?r("months"):t==="months"?r("years"):t==="years"&&r("days")},u=()=>{t==="years"?s?s():i():t==="months"?i():o()},y=()=>{t==="years"?l?l():a():t==="months"?a():n()},c=()=>t==="years"?`${k} - ${v}`:t==="months"?`${x}`:`${p.months[S]} ${x}`;return Gl("div",{className:"flex items-center justify-between px-1 pb-1.5 border-b border-neutral-200",children:[Gl("div",{className:"flex items-center space-x-0.5",children:[t==="days"&&Hr("button",{type:"button",onClick:i,"aria-label":"N\u0103m tr\u01B0\u1EDBc",className:`flex items-center justify-center ${b.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:Hr(Xr,{width:14,height:14})}),g&&Hr("button",{type:"button",onClick:u,"aria-label":"Th\xE1ng tr\u01B0\u1EDBc",className:`flex items-center justify-center ${b.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:Hr(rr,{width:14,height:14})})]}),Hr("button",{type:"button",onClick:d,className:`${b.headerText} px-2 py-1 rounded-md text-neutral-800 hover:bg-neutral-100 hover:${h.activeText} transition-colors cursor-pointer`,children:c()}),Gl("div",{className:"flex items-center space-x-0.5",children:[g&&Hr("button",{type:"button",onClick:y,"aria-label":"Th\xE1ng ti\u1EBFp theo",className:`flex items-center justify-center ${b.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:Hr(Ht,{width:14,height:14})}),t==="days"&&Hr("button",{type:"button",onClick:a,"aria-label":"N\u0103m ti\u1EBFp theo",className:`flex items-center justify-center ${b.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:Hr(qr,{width:14,height:14})})]})]})}import Pb,{useRef as zb}from"react";import{jsx as li,jsxs as Ea}from"react/jsx-runtime";function ci({days:e,onSelectDate:t,size:r="md",color:o="primary",radius:n,locale:i,firstDayOfWeek:a=1,showWeekNumbers:s=!1}){let l=Tt(i),m=C(r,or,"md"),f=C(o,ro,"primary"),w=C(n,to,"lg"),g=zb(null),p=[...l.weekdaysShort];if(a===1){let d=p.shift();p.push(d)}let b=e.some(d=>d.isSelected&&!d.isDisabled),h=e.findIndex(d=>d.isToday&&!d.isDisabled),x=e.findIndex(d=>d.isCurrentMonth&&!d.isDisabled),S=x!==-1?x:e.findIndex(d=>!d.isDisabled),k=d=>{let y=g.current?.querySelectorAll("button")?.[d];y&&!y.disabled&&y.focus()},v=(d,u)=>{let y=null;if(d.key==="ArrowRight"){d.preventDefault();for(let c=u+1;c<e.length;c++)if(!e[c].isDisabled){y=c;break}}else if(d.key==="ArrowLeft"){d.preventDefault();for(let c=u-1;c>=0;c--)if(!e[c].isDisabled){y=c;break}}else if(d.key==="ArrowDown")d.preventDefault(),u+7<e.length&&!e[u+7].isDisabled&&(y=u+7);else if(d.key==="ArrowUp")d.preventDefault(),u-7>=0&&!e[u-7].isDisabled&&(y=u-7);else if(d.key==="Home"){d.preventDefault();let c=u-u%7;for(let T=c;T<c+7&&T<e.length;T++)if(!e[T].isDisabled){y=T;break}}else if(d.key==="End"){d.preventDefault();let c=Math.min(e.length-1,u-u%7+6);for(let T=c;T>=u-u%7;T--)if(!e[T].isDisabled){y=T;break}}else if(d.key==="Enter"||d.key===" "){d.preventDefault();let c=e[u];c&&!c.isDisabled&&t(c.date);return}y!==null&&k(y)};return Ea("div",{ref:g,role:"grid","aria-label":l.months[e[15]?.month||0],className:"w-full",children:[Ea("div",{role:"row",className:`grid ${s?"grid-cols-8":"grid-cols-7"} gap-1 mb-1 text-center`,children:[s&&li("div",{role:"columnheader","aria-label":l.weekText||"Week",className:`flex items-center justify-center ${m.cellSize} text-neutral-400 ${m.cellText} font-medium`,children:"#"}),p.map(d=>li("div",{role:"columnheader","aria-label":d,className:`flex items-center justify-center ${m.cellSize} text-neutral-500 ${m.cellText} font-medium`,children:d},d))]}),li("div",{role:"rowgroup",className:`grid ${s?"grid-cols-8":"grid-cols-7"} gap-y-1 gap-x-1`,children:e.map((d,u)=>{let y=u%7===0,c="text-neutral-800 hover:bg-neutral-100";d.isDisabled?c="text-neutral-300 cursor-not-allowed line-through":d.isSelected?c=`${f.selected} font-semibold shadow-xs`:d.isCurrentMonth||(c="text-neutral-400 hover:bg-neutral-100");let T=d.isToday&&!d.isSelected?`ring-1 ${f.todayRing} font-bold`:"",R=`${d.day} ${l.months[d.month]} ${d.year}`,D=!d.isDisabled&&(d.isSelected||!b&&d.isToday&&u===h||!b&&h===-1&&u===S);return Ea(Pb.Fragment,{children:[s&&y&&Ea("div",{className:`flex items-center justify-center ${m.cellSize} text-neutral-400 ${m.cellText} text-[10px] font-mono`,children:["W",d.weekNumber]}),li("div",{role:"gridcell","aria-selected":d.isSelected,className:"flex items-center justify-center",children:li("button",{type:"button",disabled:d.isDisabled,tabIndex:D?0:-1,onKeyDown:N=>v(N,u),onClick:()=>!d.isDisabled&&t(d.date),"aria-label":R,"aria-current":d.isToday?"date":void 0,"aria-disabled":d.isDisabled,className:`flex items-center justify-center ${m.cellSize} ${m.cellText} ${w} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${c} ${T}`,children:d.day})})]},d.date.toISOString())})})]})}import{useRef as Ib}from"react";import{jsx as jl}from"react/jsx-runtime";function ui({currentMonth:e,selectedDate:t,onSelectMonth:r,size:o="md",color:n="primary",radius:i,locale:a}){let s=Tt(a),l=C(o,or,"md"),m=C(n,ro,"primary"),f=C(i,to,"lg"),w=Ib(null),g=e.getFullYear(),p=new Date,b=p.getMonth(),h=p.getFullYear(),x=t&&t.getFullYear()===g?t.getMonth():-1,S=x!==-1?x:h===g?b:0,k=d=>{let y=w.current?.querySelectorAll("button")?.[d];y&&y.focus()},v=(d,u)=>{let y=null;if(d.key==="ArrowRight")d.preventDefault(),u+1<s.monthsShort.length&&(y=u+1);else if(d.key==="ArrowLeft")d.preventDefault(),u-1>=0&&(y=u-1);else if(d.key==="ArrowDown")d.preventDefault(),u+3<s.monthsShort.length&&(y=u+3);else if(d.key==="ArrowUp")d.preventDefault(),u-3>=0&&(y=u-3);else if(d.key==="Home")d.preventDefault(),y=0;else if(d.key==="End")d.preventDefault(),y=s.monthsShort.length-1;else if(d.key==="Enter"||d.key===" "){d.preventDefault(),r(u);return}y!==null&&k(y)};return jl("div",{ref:w,role:"grid","aria-label":"Ch\u1ECDn th\xE1ng",className:"grid grid-cols-3 gap-2 py-2",children:s.monthsShort.map((d,u)=>{let y=new Date(g,u,1),c=t?Ia(y,t):!1,T=h===g&&b===u,R=u===S,D="text-neutral-800 hover:bg-neutral-100";return c?D=`${m.selected} font-semibold shadow-xs`:T&&(D=`ring-1 ${m.todayRing} font-semibold`),jl("div",{role:"gridcell","aria-selected":c,className:"flex items-center justify-center",children:jl("button",{type:"button",tabIndex:R?0:-1,onKeyDown:N=>v(N,u),onClick:()=>r(u),"aria-label":`${d} ${g}`,className:`w-full flex items-center justify-center h-10 ${l.cellText} ${f} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${D}`,children:d})},d)})})}import{useRef as Fb}from"react";import{jsx as Ul}from"react/jsx-runtime";function di({currentMonth:e,selectedDate:t,onSelectYear:r,size:o="md",color:n="primary",radius:i}){let a=C(o,or,"md"),s=C(n,ro,"primary"),l=C(i,to,"lg"),m=Fb(null),f=e.getFullYear(),w=t?t.getFullYear():f,g=Math.floor(f/10)*10,p=new Date().getFullYear(),b=[];for(let d=0;d<12;d++)b.push(g+d);let h=b.indexOf(w),x=b.indexOf(p),S=h!==-1?h:x!==-1?x:0,k=d=>{let y=m.current?.querySelectorAll("button")?.[d];y&&y.focus()},v=(d,u)=>{let y=null;if(d.key==="ArrowRight")d.preventDefault(),u+1<b.length&&(y=u+1);else if(d.key==="ArrowLeft")d.preventDefault(),u-1>=0&&(y=u-1);else if(d.key==="ArrowDown")d.preventDefault(),u+3<b.length&&(y=u+3);else if(d.key==="ArrowUp")d.preventDefault(),u-3>=0&&(y=u-3);else if(d.key==="Home")d.preventDefault(),y=0;else if(d.key==="End")d.preventDefault(),y=b.length-1;else if(d.key==="Enter"||d.key===" "){d.preventDefault();let c=b[u];c!==void 0&&r(c);return}y!==null&&k(y)};return Ul("div",{ref:m,role:"grid","aria-label":"Ch\u1ECDn n\u0103m",className:"grid grid-cols-3 gap-2 py-2",children:b.map((d,u)=>{let y=d===w,c=d===p,T=u===S,R="text-neutral-800 hover:bg-neutral-100";return y?R=`${s.selected} font-semibold shadow-xs`:c&&(R=`ring-1 ${s.todayRing} font-semibold`),Ul("div",{role:"gridcell","aria-selected":y,className:"flex items-center justify-center",children:Ul("button",{type:"button",tabIndex:T?0:-1,onKeyDown:D=>v(D,u),onClick:()=>r(d),"aria-label":`${d}`,className:`w-full flex items-center justify-center h-10 ${a.cellText} ${l} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${R}`,children:d})},d)})})}import{jsx as no,jsxs as sf}from"react/jsx-runtime";function kr({value:e,onChange:t,view:r="days",onViewChange:o,minDate:n,maxDate:i,isDateDisabled:a,locale:s="vi",firstDayOfWeek:l=1,showWeekNumbers:m=!1,showViewTabs:f=!1,viewTabs:w=["days","months","years"],size:g="md",color:p="primary",radius:b,className:h="",bordered:x=!0}){let S=C(g,or,"md"),k=C(b,rf,"lg"),[v,d]=Yl(r),[u,y]=Yl(r);r!==u&&(y(r),d(r));let[c,T]=Yl(()=>{let A=e||new Date;return new Date(A.getFullYear(),A.getMonth(),1)}),R=Tt(s),D=af(()=>{let A=R.viewTabs||{days:"Ng\xE0y",months:"Th\xE1ng",years:"N\u0103m"};return(w||["days","months","years"]).map(U=>({key:U,label:A[U]||U}))},[w,R.viewTabs]),N=A=>{let U=A;d(U),o?.(U)},I=()=>{let A=new Date(c.getFullYear(),c.getMonth()-1,1);T(A)},E=()=>{let A=new Date(c.getFullYear(),c.getMonth()+1,1);T(A)},P=()=>{let A=new Date(c.getFullYear()-1,c.getMonth(),1);T(A)},F=()=>{let A=new Date(c.getFullYear()+1,c.getMonth(),1);T(A)},z=()=>{let A=new Date(c.getFullYear()-10,c.getMonth(),1);T(A)},H=()=>{let A=new Date(c.getFullYear()+10,c.getMonth(),1);T(A)},V=A=>{let U=new Date(c.getFullYear(),A,1);T(U),r==="months"?t?.(U):d("days")},W=A=>{let U=new Date(A,c.getMonth(),1);T(U),r==="years"?t?.(U):d("months")},L=zt(n),M=zt(i),O=af(()=>Fa(c.getFullYear(),c.getMonth(),l,e,L,M,a),[c,l,e,L,M,a]);return sf("div",{className:`inline-flex flex-col ${x?"border-2 border-neutral-200 bg-neutral-white shadow-xl":"border-0 shadow-none bg-transparent"} ${k} overflow-hidden select-none ${h}`,children:[f&&D.length>0&&no("div",{className:"px-2.5 py-1.5 border-b border-neutral-200",children:no(zo,{activeKey:r,onChange:N,size:"sm",variant:"solid",color:p,fullWidth:!0,className:"gap-0!",children:no(Io,{className:"p-0.5",children:D.map(A=>no(Fo,{value:A.key,className:"py-1 px-2 text-xs",children:A.label},A.key))})})}),sf("div",{className:`${S.calendarPadding} min-w-70`,children:[no(si,{currentMonth:c,view:v,onViewChange:d,onPrevMonth:I,onNextMonth:E,onPrevYear:P,onNextYear:F,onPrevDecade:z,onNextDecade:H,size:g,color:p,locale:s,showMonthButtons:!0}),v==="days"&&no(ci,{days:O,onSelectDate:A=>t?.(A),size:g,color:p,radius:b,locale:s,firstDayOfWeek:l,showWeekNumbers:m}),v==="months"&&no(ui,{currentMonth:c,selectedDate:e,onSelectMonth:V,size:g,color:p,radius:b,locale:s}),v==="years"&&no(di,{currentMonth:c,selectedDate:e,onSelectYear:W,size:g,color:p,radius:b})]})]})}import{jsx as It,jsxs as $a}from"react/jsx-runtime";function Mo({ref:e,value:t,defaultValue:r,onChange:o,format:n="DD/MM/YYYY",displayFormat:i,defaultView:a="days",locale:s="vi",firstDayOfWeek:l=1,minDate:m,maxDate:f,isDateDisabled:w,size:g="md",variant:p="outline",color:b="primary",radius:h,label:x,labelPlacement:S="floating",placeholder:k,helperText:v,errorMessage:d,name:u,id:y,autoComplete:c,viewTabs:T=["days","months","years"],view:R,onViewChange:D,onClear:N,placement:I="bottom-start",disabled:E=!1,readOnly:P=!1,portal:F=!0,config:z,className:H="",wrapperClassName:V="",inputWrapperClassName:W="",labelClassName:L="",helperClassName:M="",popoverClassName:O=""}){let A=Ze(),U=Je(),{isRequired:G=!1,isInvalid:K=!1,isLoading:q=!1,showSpinner:X=!1,isClearable:fe=!0,isFullWidth:ae=!0,showWeekNumbers:_=!1,showViewTabs:Z=!1,closeOnSelect:he=!0}=z??{},xe=Mb(),$=y||xe,re=`${$}-error-helper`,ee=`${$}-popover`,de=R!==void 0,[ne,ze]=Wl(a),ve=de?R:ne,Ce=i||n,J=Eb(()=>Ma(Ce,ve),[Ce,ve]),j=t!==void 0,[oe,ye]=Wl(()=>zt(r,n)),ue=j?zt(t,n):oe,ce=ue?qt(ue,J,s):"",[ke,Te]=Wl(!1),{refs:{setReference:pe,setFloating:Y},floatingStyles:me,context:De}=$b({placement:I,open:ke&&!E&&!P&&!q,onOpenChange:Te,whileElementsMounted:Lb,transform:!1,middleware:[Bb(6),Hb(),Vb({padding:8})]}),ie=Ab(De,{escapeKey:!0,outsidePress:!0}),B=Ob(De,{role:"dialog"}),{getReferenceProps:se,getFloatingProps:Ie}=Gb([ie,B]),{isMounted:Ae,styles:le}=it(De),ge=!!(K||d),Me=ge?"error":b,Le=C(g,or,"md"),Ve=C(h,to,"lg"),Be=p==="other"?"":C(Me,C(p,of,"outline"),"primary"),je=!!ue,ut=Oe=>{de||ze(Oe),D?.(Oe)},Re=Oe=>{j||ye(Oe);let dt=Oe?qt(Oe,n,s):"";o?.(dt),he&&Te(!1)},Xe=Oe=>{E||P||q||(Oe.key==="ArrowDown"||Oe.key==="Enter"||Oe.key===" "?(Oe.preventDefault(),ke||Te(!0)):Oe.key==="Escape"&&ke&&(Oe.preventDefault(),Te(!1)))},qe=Oe=>{Oe.stopPropagation(),j||ye(null),o?.(null),N?.()},at=k||J,ot=S==="floating",vt=S==="left",Ee=()=>It(bt,{htmlFor:$,label:x,isRequired:G,isFloating:ot,size:g,color:Me,hasError:ge,cursor:"pointer",className:L}),yt=Oe=>It("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Le.icon}`,"aria-hidden":"true",children:Oe}),mt=["group/field group/datepicker relative flex",vt?"flex-row items-center gap-3":"flex-col",ot&&!!x?"pt-2":"",ae?"w-full":"inline-flex",V].filter(Boolean).join(" "),tt=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",Le.inputHeight,Ve,Be,E?"opacity-50":"",ae?"w-full":"w-auto",W].filter(Boolean).join(" "),Rt=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",Le.inputText,Le.inputPadding,H].filter(Boolean).join(" ");return F?$a("div",{className:mt,children:[!ot&&Ee(),$a("div",{className:`flex flex-col ${ae?"w-full":""}`,children:[$a("div",{ref:pe,...se(),className:tt,children:[ot&&Ee(),It("input",{ref:e,id:$,name:u,type:"text",value:ce,onClick:()=>!E&&!P&&!q&&Te(Oe=>!Oe),onKeyDown:Xe,readOnly:!0,autoComplete:c,placeholder:at,disabled:E||q,role:"combobox","aria-expanded":ke&&!q,"aria-haspopup":"dialog","aria-controls":ee,"aria-required":G,"aria-invalid":ge,"aria-busy":q,"aria-disabled":E||q,"aria-describedby":v||d?re:void 0,"aria-errormessage":d?re:void 0,className:Rt}),$a("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[q&&X&&It("div",{className:"flex items-center justify-center shrink-0",children:yt(It(Pe,{}))}),!q&&fe&&!E&&!P&&It("button",{type:"button",onClick:qe,"aria-label":"X\xF3a ng\xE0y",tabIndex:je?0:-1,"aria-hidden":!je,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${Le.icon} ${je?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:It(Ye,{className:"size-full"})}),It("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${ke?"rotate-180":"rotate-0"}`,children:yt(It(xt,{className:"size-full"}))})]})]}),Ae&&It(jb,{root:A?.dialogRef??U?.dialogRef,children:It(Ub,{context:De,modal:!1,returnFocus:!0,children:It("div",{ref:Y,id:ee,style:{...me,...le,zIndex:st.PICKER},...Ie(),className:O,children:It(kr,{value:ue,onChange:Re,view:ve,onViewChange:ut,minDate:m,maxDate:f,isDateDisabled:w,locale:s,firstDayOfWeek:l,showWeekNumbers:_,size:g,color:b,radius:h,showViewTabs:Z,viewTabs:T})})})}),It(He,{id:re,helperText:v,errorMessage:d,sizeClassName:Le.helper,className:M})]})]}):It("div",{className:H,children:It(kr,{bordered:!1,value:ue,onChange:Re,view:ve,onViewChange:ut,minDate:m,maxDate:f,isDateDisabled:w,locale:s,firstDayOfWeek:l,showWeekNumbers:_,size:g,color:b,radius:h,showViewTabs:Z,viewTabs:T})})}import{useState as Zl,useId as Xb,useMemo as qb}from"react";import{useFloating as Zb,autoUpdate as Jb,offset as Qb,flip as eh,shift as th,useDismiss as rh,useRole as oh,useInteractions as nh,FloatingPortal as ih,FloatingFocusManager as ah}from"@floating-ui/react";import{useState as gi,useMemo as Aa}from"react";var nr={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,calendarPadding:"p-4.5",cellSize:"w-11 h-11",cellText:"text-base",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},Rr={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},La={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},io={primary:{selected:"bg-primary-500 text-neutral-white hover:bg-primary-600",rangeBg:"bg-primary-100",rangeText:"text-primary-900",hoverBg:"hover:bg-primary-200 hover:text-primary-900",todayRing:"ring-primary-500 text-primary-600",activeText:"text-primary-600",badge:"bg-primary-100 text-primary-700"},secondary:{selected:"bg-secondary-500 text-neutral-white hover:bg-secondary-600",rangeBg:"bg-secondary-100",rangeText:"text-secondary-900",hoverBg:"hover:bg-secondary-200 hover:text-secondary-900",todayRing:"ring-secondary-500 text-secondary-600",activeText:"text-secondary-600",badge:"bg-secondary-100 text-secondary-700"},neutral:{selected:"bg-neutral-800 text-neutral-white hover:bg-neutral-900",rangeBg:"bg-neutral-200",rangeText:"text-neutral-900",hoverBg:"hover:bg-neutral-300 hover:text-neutral-900",todayRing:"ring-neutral-800 text-neutral-800",activeText:"text-neutral-800",badge:"bg-neutral-200 text-neutral-800"},error:{selected:"bg-error-500 text-neutral-white hover:bg-error-600",rangeBg:"bg-error-100",rangeText:"text-error-900",hoverBg:"hover:bg-error-200 hover:text-error-900",todayRing:"ring-error-500 text-error-600",activeText:"text-error-600",badge:"bg-error-100 text-error-700"},success:{selected:"bg-success-500 text-neutral-white hover:bg-success-600",rangeBg:"bg-success-100",rangeText:"text-success-900",hoverBg:"hover:bg-success-200 hover:text-success-900",todayRing:"ring-success-500 text-success-600",activeText:"text-success-600",badge:"bg-success-100 text-success-700"},warning:{selected:"bg-warning-500 text-neutral-950 hover:bg-warning-600",rangeBg:"bg-warning-100",rangeText:"text-warning-900",hoverBg:"hover:bg-warning-200 hover:text-warning-900",todayRing:"ring-warning-500 text-warning-700",activeText:"text-warning-700",badge:"bg-warning-100 text-warning-700"},info:{selected:"bg-info-500 text-neutral-white hover:bg-info-600",rangeBg:"bg-info-100",rangeText:"text-info-900",hoverBg:"hover:bg-info-200 hover:text-info-900",todayRing:"ring-info-500 text-info-600",activeText:"text-info-600",badge:"bg-info-100 text-info-700"}},Ba={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"},other:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""}};import{jsx as ir,jsxs as Ha}from"react/jsx-runtime";function fi({month1:e,month2:t,view:r,onViewChange:o,onPrevMonth:n,onNextMonth:i,onPrevYear:a,onNextYear:s,onPrevDecade:l,onNextDecade:m,size:f="md",color:w="primary",locale:g}){let p=Tt(g),b=C(f,nr,"md"),h=C(w,io,"primary"),x=p.months[e.getMonth()],S=e.getFullYear(),k=Math.floor(S/10)*10,v=k+9,d=`${x} ${S}`;r==="months"&&(d=`${S}`),r==="years"&&(d=`${k} - ${v}`);let u=p.months[t.getMonth()],y=t.getFullYear(),c=Math.floor(y/10)*10,T=c+9,R=`${u} ${y}`;r==="months"&&(R=`${y}`),r==="years"&&(R=`${c} - ${T}`);let D=()=>{r==="days"?o("months"):r==="months"?o("years"):r==="years"&&o("days")},N=()=>{r==="days"?n():r==="months"?a():r==="years"&&(l?l():a())},I=()=>{r==="days"?i():r==="months"?s():r==="years"&&(m?m():s())};return Ha("div",{className:"flex items-center justify-between px-2 py-1.5 border-b border-neutral-200",children:[Ha("div",{className:"flex items-center space-x-0.5",children:[r==="days"&&ir("button",{type:"button",onClick:a,"aria-label":"N\u0103m tr\u01B0\u1EDBc",className:`flex items-center justify-center ${b.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:ir(Xr,{width:14,height:14})}),ir("button",{type:"button",onClick:N,"aria-label":"Th\xE1ng tr\u01B0\u1EDBc",className:`flex items-center justify-center ${b.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:ir(rr,{width:b.iconSize,height:b.iconSize})})]}),Ha("div",{className:"grid grid-cols-2 flex-1 text-center divide-x divide-transparent px-2",children:[ir("div",{className:"flex items-center justify-center",children:ir("button",{type:"button",onClick:D,"aria-label":"\u0110\u1ED5i ch\u1EBF \u0111\u1ED9 xem l\u1ECBch",className:`font-semibold text-neutral-800 hover:${h.activeText} hover:bg-neutral-100 rounded-md px-2 py-1 transition-colors cursor-pointer ${b.headerText}`,children:d})}),ir("div",{className:"flex items-center justify-center",children:ir("button",{type:"button",onClick:D,"aria-label":"\u0110\u1ED5i ch\u1EBF \u0111\u1ED9 xem l\u1ECBch",className:`font-semibold text-neutral-800 hover:${h.activeText} hover:bg-neutral-100 rounded-md px-2 py-1 transition-colors cursor-pointer ${b.headerText}`,children:R})})]}),Ha("div",{className:"flex items-center space-x-0.5",children:[ir("button",{type:"button",onClick:I,"aria-label":"Th\xE1ng ti\u1EBFp theo",className:`flex items-center justify-center ${b.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:ir(Ht,{width:b.iconSize,height:b.iconSize})}),r==="days"&&ir("button",{type:"button",onClick:s,"aria-label":"N\u0103m ti\u1EBFp theo",className:`flex items-center justify-center ${b.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:ir(qr,{width:14,height:14})})]})]})}import Yb,{useRef as Wb}from"react";import{jsx as pi,jsxs as Va}from"react/jsx-runtime";function mn({days:e,onSelectDate:t,onHoverDate:r,size:o="md",color:n="primary",radius:i,locale:a,firstDayOfWeek:s=1,showWeekNumbers:l=!1}){let m=Tt(a),f=C(o,nr,"md"),w=C(n,io,"primary"),g=C(i,Rr,"lg"),p=Wb(null),b=[...m.weekdaysShort];if(s===1){let u=b.shift();b.push(u)}let h=e.some(u=>(u.isSelected||u.isRangeStart)&&!u.isDisabled),x=e.findIndex(u=>u.isToday&&!u.isDisabled),S=e.findIndex(u=>u.isCurrentMonth&&!u.isDisabled),k=S!==-1?S:e.findIndex(u=>!u.isDisabled),v=u=>{let c=p.current?.querySelectorAll("button")?.[u];c&&!c.disabled&&c.focus()},d=(u,y)=>{let c=null;if(u.key==="ArrowRight"){u.preventDefault();for(let T=y+1;T<e.length;T++)if(!e[T].isDisabled){c=T;break}}else if(u.key==="ArrowLeft"){u.preventDefault();for(let T=y-1;T>=0;T--)if(!e[T].isDisabled){c=T;break}}else if(u.key==="ArrowDown")u.preventDefault(),y+7<e.length&&!e[y+7].isDisabled&&(c=y+7);else if(u.key==="ArrowUp")u.preventDefault(),y-7>=0&&!e[y-7].isDisabled&&(c=y-7);else if(u.key==="Home"){u.preventDefault();let T=y-y%7;for(let R=T;R<T+7&&R<e.length;R++)if(!e[R].isDisabled){c=R;break}}else if(u.key==="End"){u.preventDefault();let T=Math.min(e.length-1,y-y%7+6);for(let R=T;R>=y-y%7;R--)if(!e[R].isDisabled){c=R;break}}else if(u.key==="Enter"||u.key===" "){u.preventDefault();let T=e[y];T&&!T.isDisabled&&t(T.date);return}c!==null&&v(c)};return Va("div",{ref:p,role:"grid","aria-label":m.months[e[15]?.month||0],className:"w-full",children:[Va("div",{role:"row",className:`grid ${l?"grid-cols-8":"grid-cols-7"} gap-1 mb-1 text-center`,children:[l&&pi("div",{role:"columnheader","aria-label":m.weekText||"Week",className:`flex items-center justify-center ${f.cellSize} text-neutral-400 ${f.cellText} font-medium`,children:"#"}),b.map(u=>pi("div",{role:"columnheader","aria-label":u,className:`flex items-center justify-center ${f.cellSize} text-neutral-500 ${f.cellText} font-medium`,children:u},u))]}),pi("div",{role:"rowgroup",className:`grid ${l?"grid-cols-8":"grid-cols-7"} gap-y-1 gap-x-1`,children:e.map((u,y)=>{let c=y%7===0,T="text-neutral-800 hover:bg-neutral-100",R="";u.isDisabled?T="text-neutral-300 cursor-not-allowed line-through":u.isRangeStart||u.isRangeEnd?(T=`${w.selected} font-semibold shadow-xs`,u.isRangeStart&&u.isRangeEnd?R="":u.isRangeStart?R=`${w.rangeBg} rounded-l-full`:u.isRangeEnd&&(R=`${w.rangeBg} rounded-r-full`)):u.isSelected?T=`${w.selected} font-semibold shadow-xs`:u.isInRange||u.isHoveredRange?(T=`${w.rangeBg} ${w.rangeText} rounded-none`,R=`${w.rangeBg}`):u.isCurrentMonth||(T="text-neutral-400 hover:bg-neutral-100");let D=u.isToday&&!u.isSelected?`ring-1 ${w.todayRing} font-bold`:"",N=`${u.day} ${m.months[u.month]} ${u.year}`,I=!u.isDisabled&&(u.isSelected||u.isRangeStart||!h&&u.isToday&&y===x||!h&&x===-1&&y===k);return Va(Yb.Fragment,{children:[l&&c&&Va("div",{className:`flex items-center justify-center ${f.cellSize} text-neutral-400 ${f.cellText} text-[10px] font-mono`,children:["W",u.weekNumber]}),pi("div",{role:"gridcell","aria-selected":u.isSelected||u.isInRange,className:`relative flex items-center justify-center ${R}`,children:pi("button",{type:"button",disabled:u.isDisabled,tabIndex:I?0:-1,onKeyDown:E=>d(E,y),onClick:()=>!u.isDisabled&&t(u.date),onMouseEnter:()=>!u.isDisabled&&r?.(u.date),onMouseLeave:()=>r?.(null),"aria-label":N,"aria-current":u.isToday?"date":void 0,"aria-disabled":u.isDisabled,className:`flex items-center justify-center ${f.cellSize} ${f.cellText} ${g} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${T} ${D}`,children:u.day})})]},u.date.toISOString())})})]})}import{useRef as Kb}from"react";import{jsx as Kl}from"react/jsx-runtime";function gn({currentMonth:e,onSelectMonth:t,size:r="md",color:o="primary",radius:n,locale:i,rangeStart:a,rangeEnd:s,hoveredDate:l,onHoverMonth:m}){let f=Tt(i),w=C(r,nr,"md"),g=C(o,io,"primary"),p=C(n,Rr,"lg"),b=Kb(null),h=e.getFullYear(),x=new Date,S=x.getMonth(),k=x.getFullYear(),v=a&&a.getFullYear()===h?a.getMonth():-1,d=v!==-1?v:k===h?S:0,u=c=>{let R=b.current?.querySelectorAll("button")?.[c];R&&R.focus()},y=(c,T)=>{let R=null;if(c.key==="ArrowRight")c.preventDefault(),T+1<f.monthsShort.length&&(R=T+1);else if(c.key==="ArrowLeft")c.preventDefault(),T-1>=0&&(R=T-1);else if(c.key==="ArrowDown")c.preventDefault(),T+3<f.monthsShort.length&&(R=T+3);else if(c.key==="ArrowUp")c.preventDefault(),T-3>=0&&(R=T-3);else if(c.key==="Home")c.preventDefault(),R=0;else if(c.key==="End")c.preventDefault(),R=f.monthsShort.length-1;else if(c.key==="Enter"||c.key===" "){c.preventDefault(),t(T);return}R!==null&&u(R)};return Kl("div",{ref:b,role:"grid","aria-label":"Ch\u1ECDn th\xE1ng",className:"grid grid-cols-3 gap-2 py-2",onMouseLeave:()=>m?.(null),children:f.monthsShort.map((c,T)=>{let R=new Date(h,T,1),D=R.getTime(),N=a?new Date(a.getFullYear(),a.getMonth(),1).getTime():null,I=s?new Date(s.getFullYear(),s.getMonth(),1).getTime():null,E=l?new Date(l.getFullYear(),l.getMonth(),1).getTime():null,P=!!N&&N===D,F=!!I&&I===D,z=!1,H=!1;N&&I?z=D>N&&D<I:N&&!I&&E&&(E>N?H=D>N&&D<=E:E<N&&(H=D<N&&D>=E));let V=k===h&&S===T,W=T===d,L="text-neutral-800 hover:bg-neutral-100";return P||F?L=`${g.selected} font-semibold shadow-xs`:z||H?L=`${g.rangeBg} ${g.rangeText}`:V&&(L=`ring-1 ${g.todayRing} font-semibold`),Kl("div",{role:"gridcell","aria-selected":P||F||z,className:"flex items-center justify-center",children:Kl("button",{type:"button",tabIndex:W?0:-1,onKeyDown:M=>y(M,T),onClick:()=>t(T),onMouseEnter:()=>m?.(R),"aria-label":`${c} ${h}`,className:`w-full flex items-center justify-center h-10 ${w.cellText} ${p} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${L}`,children:c})},c)})})}import{useRef as _b}from"react";import{jsx as _l}from"react/jsx-runtime";function bn({currentMonth:e,onSelectYear:t,size:r="md",color:o="primary",radius:n,rangeStart:i,rangeEnd:a,hoveredDate:s,onHoverYear:l}){let m=C(r,nr,"md"),f=C(o,io,"primary"),w=C(n,Rr,"lg"),g=_b(null),p=e.getFullYear(),b=Math.floor(p/10)*10,h=new Date().getFullYear(),x=[];for(let c=0;c<12;c++)x.push(b+c);let S=i?i.getFullYear():p,k=x.indexOf(S),v=x.indexOf(h),d=k!==-1?k:v!==-1?v:0,u=c=>{let R=g.current?.querySelectorAll("button")?.[c];R&&R.focus()},y=(c,T)=>{let R=null;if(c.key==="ArrowRight")c.preventDefault(),T+1<x.length&&(R=T+1);else if(c.key==="ArrowLeft")c.preventDefault(),T-1>=0&&(R=T-1);else if(c.key==="ArrowDown")c.preventDefault(),T+3<x.length&&(R=T+3);else if(c.key==="ArrowUp")c.preventDefault(),T-3>=0&&(R=T-3);else if(c.key==="Home")c.preventDefault(),R=0;else if(c.key==="End")c.preventDefault(),R=x.length-1;else if(c.key==="Enter"||c.key===" "){c.preventDefault();let D=x[T];D!==void 0&&t(D);return}R!==null&&u(R)};return _l("div",{ref:g,role:"grid","aria-label":"Ch\u1ECDn n\u0103m",className:"grid grid-cols-3 gap-2 py-2",onMouseLeave:()=>l?.(null),children:x.map((c,T)=>{let R=i?i.getFullYear():null,D=a?a.getFullYear():null,N=s?s.getFullYear():null,I=R!==null&&c===R,E=D!==null&&c===D,P=!1,F=!1;R!==null&&D!==null?P=c>R&&c<D:R!==null&&D===null&&N!==null&&(N>R?F=c>R&&c<=N:N<R&&(F=c<R&&c>=N));let z=c===h,H=T===d,V="text-neutral-800 hover:bg-neutral-100";return I||E?V=`${f.selected} font-semibold shadow-xs`:P||F?V=`${f.rangeBg} ${f.rangeText}`:z&&(V=`ring-1 ${f.todayRing} font-semibold`),_l("div",{role:"gridcell","aria-selected":I||E||P,className:"flex items-center justify-center",children:_l("button",{type:"button",tabIndex:H?0:-1,onKeyDown:W=>y(W,T),onClick:()=>t(c),onMouseEnter:()=>l?.(new Date(c,0,1)),"aria-label":`${c}`,className:`w-full flex items-center justify-center h-10 ${m.cellText} ${w} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${V}`,children:c})},c)})})}function ql(e,t,r){if(!t||!r)return!1;let o=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),i=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime(),a=Math.min(n,i),s=Math.max(n,i);return o>=a&&o<=s}function lf(e,t){return new Date(e,t+1,0).getDate()}function Xl(e,t,r,o,n,i,a,s,l){let m=o?oo(e,o):!1,f=n?oo(e,n):!1,w=ql(e,o||null,n||null),g=o&&!n&&i?ql(e,o,i):!1,p=!1;return a&&ni(e,a)&&(p=!0),s&&ii(e,s)&&(p=!0),l&&l(e)&&(p=!0),{date:e,day:e.getDate(),month:e.getMonth(),year:e.getFullYear(),isCurrentMonth:t,isToday:oo(e,r),isSelected:m||f,isDisabled:p,isRangeStart:m,isRangeEnd:f,isInRange:w,isHoveredRange:g,weekNumber:ai(e)}}function mi(e,t,r=1,o,n,i,a,s,l){let m=[],f=new Date,w=new Date(e,t,1).getDay(),g=lf(e,t-1),p=lf(e,t),b=r===1?w===0?6:w-1:w;for(let x=b-1;x>=0;x--){let S=g-x,k=new Date(e,t-1,S);m.push(Xl(k,!1,f,o,n,i,a,s,l))}for(let x=1;x<=p;x++){let S=new Date(e,t,x);m.push(Xl(S,!0,f,o,n,i,a,s,l))}let h=42-m.length;for(let x=1;x<=h;x++){let S=new Date(e,t+1,x);m.push(Xl(S,!1,f,o,n,i,a,s,l))}return m}import{jsx as gr,jsxs as Oa}from"react/jsx-runtime";function hn({value:e,onChange:t,view:r="days",onViewChange:o,minDate:n,maxDate:i,isDateDisabled:a,locale:s="vi",firstDayOfWeek:l=1,showWeekNumbers:m=!1,showViewTabs:f=!1,viewTabs:w=["days","months","years"],size:g="md",color:p="primary",radius:b,className:h="",bordered:x=!0}){let S=C(g,nr,"md"),k=C(b,La,"lg"),[v,d]=gi(r),[u,y]=gi(r);r!==u&&(y(r),d(r));let c=e?e[0]:null,T=e?e[1]:null,[R,D]=gi(()=>{let $=c||new Date;return new Date($.getFullYear(),$.getMonth(),1)}),N=Tt(s),I=Aa(()=>{let $=N.viewTabs||{days:"Ng\xE0y",months:"Th\xE1ng",years:"N\u0103m"};return(w||["days","months","years"]).map(re=>({key:re,label:$[re]||re}))},[w,N.viewTabs]),E=$=>{let re=$;d(re),M(null),o?.(re)},P=()=>{let $=new Date(R.getFullYear(),R.getMonth()-1,1);D($)},F=()=>{let $=new Date(R.getFullYear(),R.getMonth()+1,1);D($)},z=()=>{let $=new Date(R.getFullYear()-1,R.getMonth(),1);D($)},H=()=>{let $=new Date(R.getFullYear()+1,R.getMonth(),1);D($)},V=()=>{let $=new Date(R.getFullYear()-10,R.getMonth(),1);D($)},W=()=>{let $=new Date(R.getFullYear()+10,R.getMonth(),1);D($)},[L,M]=gi(null),[O,A]=gi(null),U=$=>{if(!L)M($),t?.([$,null]);else{let re=L,ee=$;$.getTime()<re.getTime()&&(re=$,ee=L),M(null),t?.([re,ee])}},G=($,re)=>{let ee=new Date($,re,1);if(D(ee),f&&r==="months")if(!L)M(ee),t?.([ee,null]);else{let de=L,ne=ee;ee.getTime()<de.getTime()&&(de=ee,ne=L),M(null),t?.([de,ne])}else d("days")},K=$=>{let re=new Date($,0,1);if(D(re),f&&r==="years")if(!L)M(re),t?.([re,null]);else{let ee=L,de=re;re.getTime()<ee.getTime()&&(ee=re,de=L),M(null),t?.([ee,de])}else d("months")},q=zt(n),X=zt(i),fe=R,ae=Aa(()=>v==="months"?new Date(R.getFullYear()+1,R.getMonth(),1):v==="years"?new Date(R.getFullYear()+10,R.getMonth(),1):new Date(R.getFullYear(),R.getMonth()+1,1),[R,v]),_=L||c,Z=L?null:T,he=Aa(()=>mi(fe.getFullYear(),fe.getMonth(),l,_,Z,O,q,X,a),[fe,l,_,Z,O,q,X,a]),xe=Aa(()=>mi(ae.getFullYear(),ae.getMonth(),l,_,Z,O,q,X,a),[ae,l,_,Z,O,q,X,a]);return Oa("div",{className:`inline-flex flex-col ${x?"border-2 border-neutral-200 bg-neutral-white shadow-xl":"border-0 shadow-none bg-transparent"} ${k} overflow-hidden select-none ${h}`,children:[f&&I.length>0&&gr("div",{className:"px-2.5 py-1.5 border-b border-neutral-200",children:gr(zo,{activeKey:r,onChange:E,size:"sm",variant:"solid",color:p,fullWidth:!0,className:"gap-0!",children:gr(Io,{className:"p-0.5",children:I.map($=>gr(Fo,{value:$.key,className:"py-1 px-2 text-xs",children:$.label},$.key))})})}),gr(fi,{month1:fe,month2:ae,view:v,onViewChange:d,onPrevMonth:P,onNextMonth:F,onPrevYear:z,onNextYear:H,onPrevDecade:V,onNextDecade:W,size:g,color:p,locale:s}),Oa("div",{className:"flex flex-row divide-x divide-neutral-200",children:[Oa("div",{className:`${S.calendarPadding} min-w-70`,children:[v==="days"&&gr(mn,{days:he,onSelectDate:U,onHoverDate:A,size:g,color:p,radius:b,locale:s,firstDayOfWeek:l,showWeekNumbers:m}),v==="months"&&gr(gn,{currentMonth:fe,onSelectMonth:$=>G(fe.getFullYear(),$),size:g,color:p,radius:b,locale:s,rangeStart:_,rangeEnd:Z,hoveredDate:O,onHoverMonth:A}),v==="years"&&gr(bn,{currentMonth:fe,onSelectYear:K,size:g,color:p,radius:b,rangeStart:_,rangeEnd:Z,hoveredDate:O,onHoverYear:A})]}),Oa("div",{className:`${S.calendarPadding} min-w-70`,children:[v==="days"&&gr(mn,{days:xe,onSelectDate:U,onHoverDate:A,size:g,color:p,radius:b,locale:s,firstDayOfWeek:l,showWeekNumbers:m}),v==="months"&&gr(gn,{currentMonth:ae,onSelectMonth:$=>G(ae.getFullYear(),$),size:g,color:p,radius:b,locale:s,rangeStart:_,rangeEnd:Z,hoveredDate:O,onHoverMonth:A}),v==="years"&&gr(bn,{currentMonth:ae,onSelectYear:K,size:g,color:p,radius:b,rangeStart:_,rangeEnd:Z,hoveredDate:O,onHoverYear:A})]})]})]})}import{jsx as Ft,jsxs as Ga}from"react/jsx-runtime";function Eo({ref:e,value:t,defaultValue:r,onChange:o,separator:n=" - ",format:i="DD/MM/YYYY",displayFormat:a,defaultView:s="days",locale:l="vi",firstDayOfWeek:m=1,minDate:f,maxDate:w,isDateDisabled:g,size:p="md",variant:b="outline",color:h="primary",radius:x,label:S,labelPlacement:k="floating",placeholder:v,helperText:d,errorMessage:u,name:y,id:c,autoComplete:T,viewTabs:R=["days","months","years"],view:D,onViewChange:N,onClear:I,placement:E="bottom-start",disabled:P=!1,readOnly:F=!1,portal:z=!0,config:H,className:V="",wrapperClassName:W="",inputWrapperClassName:L="",labelClassName:M="",helperClassName:O="",popoverClassName:A=""}){let U=Ze(),G=Je(),{isRequired:K=!1,isInvalid:q=!1,isLoading:X=!1,showSpinner:fe=!1,isClearable:ae=!0,isFullWidth:_=!0,showWeekNumbers:Z=!1,showViewTabs:he=!1,closeOnSelect:xe=!0}=H??{},$=Xb(),re=c||$,ee=`${re}-error-helper`,de=`${re}-popover`,ne=D!==void 0,[ze,ve]=Zl(s),Ce=ne?D:ze,J=a||i,j=qb(()=>Ma(J,Ce),[J,Ce]),oe=t!==void 0,[ye,ue]=Zl(()=>{let we=r;return we&&Array.isArray(we)?[zt(we[0],i),zt(we[1],i)]:[null,null]}),ce=oe&&t&&Array.isArray(t)?[zt(t[0],i),zt(t[1],i)]:ye,ke=ce[0]&&ce[1]?`${qt(ce[0],j,l)}${n}${qt(ce[1],j,l)}`:ce[0]?`${qt(ce[0],j,l)}${n}`:"",[Te,pe]=Zl(!1),{refs:{setReference:Y,setFloating:me},floatingStyles:De,context:ie}=Zb({placement:E,open:Te&&!P&&!F&&!X,onOpenChange:pe,whileElementsMounted:Jb,transform:!1,middleware:[Qb(6),eh(),th({padding:8})]}),B=rh(ie,{escapeKey:!0,outsidePress:!0}),se=oh(ie,{role:"dialog"}),{getReferenceProps:Ie,getFloatingProps:Ae}=nh([B,se]),{isMounted:le,styles:ge}=it(ie),Me=!!(q||u),Le=Me?"error":h,Ve=C(p,nr,"md"),Be=C(x,Rr,"lg"),je=C(b,Ba,"outline"),ut=b==="other"?"":C(Le,je,"primary"),Re=!!ce[0],Xe=we=>{ne||ve(we),N?.(we)},qe=we=>{oe||ue(we);let[We,wt]=we;if(We&&wt){let Ke=[qt(We,i,l),qt(wt,i,l)];o?.(Ke),xe&&pe(!1)}},at=we=>{P||F||X||(we.key==="ArrowDown"||we.key==="Enter"||we.key===" "?(we.preventDefault(),Te||pe(!0)):we.key==="Escape"&&Te&&(we.preventDefault(),pe(!1)))},ot=we=>{we.stopPropagation(),oe||ue([null,null]),o?.(null),I?.()},vt=v||`${j}${n}${j}`,Ee=k==="floating",yt=k==="left",pt=()=>Ft(bt,{htmlFor:re,label:S,isRequired:K,isFloating:Ee,size:p,color:Le,hasError:Me,cursor:"pointer",className:M}),mt=we=>Ft("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Ve.icon}`,"aria-hidden":"true",children:we}),Rt=["group/field group/daterangepicker relative flex",yt?"flex-row items-center gap-3":"flex-col",Ee&&!!S?"pt-2":"",_?"w-full":"inline-flex",W].filter(Boolean).join(" "),Oe=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",Ve.inputHeight,Be,ut,P?"opacity-50":"",_?"w-full":"w-auto",L].filter(Boolean).join(" "),dt=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",Ve.inputText,Ve.inputPadding,V].filter(Boolean).join(" ");return z?Ga("div",{className:Rt,children:[!Ee&&pt(),Ga("div",{className:`flex flex-col ${_?"w-full":""}`,children:[Ga("div",{ref:Y,...Ie(),className:Oe,children:[Ee&&pt(),Ft("input",{ref:e,id:re,name:y,type:"text",value:ke,onClick:()=>!P&&!F&&!X&&pe(we=>!we),onKeyDown:at,readOnly:!0,autoComplete:T,placeholder:vt,disabled:P||X,role:"combobox","aria-expanded":Te&&!X,"aria-haspopup":"dialog","aria-controls":de,"aria-required":K,"aria-invalid":Me,"aria-busy":X,"aria-disabled":P||X,"aria-describedby":d||u?ee:void 0,"aria-errormessage":u?ee:void 0,className:dt}),Ga("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[X&&fe&&Ft("div",{className:"flex items-center justify-center shrink-0",children:mt(Ft(Pe,{}))}),!X&&ae&&!P&&!F&&Ft("button",{type:"button",onClick:ot,"aria-label":"X\xF3a kho\u1EA3ng ng\xE0y",tabIndex:Re?0:-1,"aria-hidden":!Re,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${Ve.icon} ${Re?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:Ft(Ye,{className:"size-full"})}),Ft("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${Te?"rotate-180":"rotate-0"}`,children:mt(Ft(xt,{className:"size-full"}))})]})]}),le&&Ft(ih,{root:U?.dialogRef??G?.dialogRef,children:Ft(ah,{context:ie,modal:!1,returnFocus:!0,children:Ft("div",{ref:me,id:de,style:{...De,...ge,zIndex:st.PICKER},...Ae(),className:A,children:Ft(hn,{value:ce,onChange:qe,view:Ce,onViewChange:Xe,minDate:f,maxDate:w,isDateDisabled:g,locale:l,firstDayOfWeek:m,showWeekNumbers:Z,size:p,color:h,radius:x,showViewTabs:he,viewTabs:R})})})}),Ft(He,{id:ee,helperText:d,errorMessage:u,sizeClassName:Ve.helper,className:O})]})]}):Ft("div",{className:V,children:Ft(hn,{bordered:!1,value:ce,onChange:qe,view:Ce,onViewChange:Xe,minDate:f,maxDate:w,isDateDisabled:g,locale:l,firstDayOfWeek:m,showWeekNumbers:Z,size:p,color:h,radius:x,showViewTabs:he,viewTabs:R})})}import{useState as xf,useId as lh}from"react";import{useFloating as ch,autoUpdate as uh,offset as dh,flip as fh,shift as ph,useDismiss as mh,useRole as gh,useInteractions as bh,FloatingPortal as hh,FloatingFocusManager as xh}from"@floating-ui/react";import{useMemo as xn}from"react";var ao={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,panelPadding:"p-1.5",columnWidth:"w-12",columnHeight:"h-36",itemHeight:"h-6",itemText:"text-[11px]",headerText:"text-[11px] font-semibold",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,panelPadding:"p-2",columnWidth:"w-14",columnHeight:"h-44",itemHeight:"h-7",itemText:"text-xs",headerText:"text-xs font-semibold",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,panelPadding:"p-2.5",columnWidth:"w-16",columnHeight:"h-52",itemHeight:"h-8",itemText:"text-sm",headerText:"text-sm font-semibold",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,panelPadding:"p-3",columnWidth:"w-18",columnHeight:"h-60",itemHeight:"h-9",itemText:"text-base",headerText:"text-base font-semibold",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,panelPadding:"p-3.5",columnWidth:"w-20",columnHeight:"h-68",itemHeight:"h-10",itemText:"text-base",headerText:"text-lg font-semibold",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},ja={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Ua={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},cf={none:"rounded-none",sm:"rounded-xs",md:"rounded-md",lg:"rounded-lg",xl:"rounded-lg",full:"rounded-full"},uf={primary:{selected:"bg-primary-500 text-neutral-white font-semibold shadow-xs hover:bg-primary-600",hoverBg:"hover:bg-primary-100 hover:text-primary-900",activeText:"text-primary-600",accentBg:"bg-primary-500"},secondary:{selected:"bg-secondary-500 text-neutral-white font-semibold shadow-xs hover:bg-secondary-600",hoverBg:"hover:bg-secondary-100 hover:text-secondary-900",activeText:"text-secondary-600",accentBg:"bg-secondary-500"},neutral:{selected:"bg-neutral-800 text-neutral-white font-semibold shadow-xs hover:bg-neutral-900",hoverBg:"hover:bg-neutral-200 hover:text-neutral-900",activeText:"text-neutral-800",accentBg:"bg-neutral-800"},error:{selected:"bg-error-500 text-neutral-white font-semibold shadow-xs hover:bg-error-600",hoverBg:"hover:bg-error-100 hover:text-error-900",activeText:"text-error-600",accentBg:"bg-error-500"},success:{selected:"bg-success-500 text-neutral-white font-semibold shadow-xs hover:bg-success-600",hoverBg:"hover:bg-success-100 hover:text-success-900",activeText:"text-success-600",accentBg:"bg-success-500"},warning:{selected:"bg-warning-500 text-neutral-950 font-semibold shadow-xs hover:bg-warning-600",hoverBg:"hover:bg-warning-100 hover:text-warning-900",activeText:"text-warning-700",accentBg:"bg-warning-500"},info:{selected:"bg-info-500 text-neutral-white font-semibold shadow-xs hover:bg-info-600",hoverBg:"hover:bg-info-100 hover:text-info-900",activeText:"text-info-600",accentBg:"bg-info-500"}};var Ya={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}};function br(e){return e<10?`0${e}`:`${e}`}function so(e=!1,t=!0){return e?t?"hh:mm:ss A":"hh:mm A":t?"HH:mm:ss":"HH:mm"}function Zt(e){if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:new Date(e);if(typeof e!="string")return null;let t=e.trim();if(!t)return null;if(t.includes("T")){let n=new Date(t);if(!isNaN(n.getTime()))return n}let r=/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?(?:\s*([ap]m))?$/i,o=t.match(r);if(o){let n=parseInt(o[1],10),i=parseInt(o[2],10),a=o[3]?parseInt(o[3],10):0,s=o[4]?.toUpperCase();if(s&&(s==="PM"&&n<12&&(n+=12),s==="AM"&&n===12&&(n=0)),n>=0&&n<24&&i>=0&&i<60&&a>=0&&a<60){let l=new Date;return l.setHours(n,i,a,0),l}}return null}function Ut(e,t="HH:mm:ss"){if(!e||isNaN(e.getTime()))return"";let r=e.getHours(),o=e.getMinutes(),n=e.getSeconds(),i=r%12;i===0&&(i=12);let a=r>=12?"PM":"AM";return t.replace(/HH/g,br(r)).replace(/H/g,`${r}`).replace(/hh/g,br(i)).replace(/h/g,`${i}`).replace(/mm/g,br(o)).replace(/m/g,`${o}`).replace(/ss/g,br(n)).replace(/s/g,`${n}`).replace(/A/g,a).replace(/a/g,a.toLowerCase())}function df(e){if(!e)return{hours:0,minutes:0,seconds:0,period:"AM"};let t=e.getHours();return{hours:t,minutes:e.getMinutes(),seconds:e.getSeconds(),period:t>=12?"PM":"AM"}}function $o(e,t,r=0){let o=new Date;return o.setHours(e,t,r,0),o}function ff(e,t,r=!0){return!e||!t?!1:r?e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes()&&e.getSeconds()===t.getSeconds():e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes()}function pf(e,t){if(!e||!t)return!1;let r=e.getHours()*3600+e.getMinutes()*60+e.getSeconds(),o=t.getHours()*3600+t.getMinutes()*60+t.getSeconds();return r<o}function mf(e,t){if(!e||!t)return!1;let r=e.getHours()*3600+e.getMinutes()*60+e.getSeconds(),o=t.getHours()*3600+t.getMinutes()*60+t.getSeconds();return r>o}function Lo(e,t,r,o,n,i,a,s,l){if(e==="hour"){if(a?.().includes(t)||n&&t<n.getHours()||i&&t>i.getHours())return!0}else if(e==="minute"){if(s?.(r).includes(t)||n&&(r<n.getHours()||r===n.getHours()&&t<n.getMinutes())||i&&(r>i.getHours()||r===i.getHours()&&t>i.getMinutes()))return!0}else if(e==="second"&&(l?.(r,o).includes(t)||n&&(r<n.getHours()||r===n.getHours()&&o<n.getMinutes()||r===n.getHours()&&o===n.getMinutes()&&t<n.getSeconds())||i&&(r>i.getHours()||r===i.getHours()&&o>i.getMinutes()||r===i.getHours()&&o===i.getMinutes()&&t>i.getSeconds())))return!0;return!1}import{useEffect as sh,useRef as gf}from"react";import{jsx as bf}from"react/jsx-runtime";function lo({items:e,selectedValue:t,onSelect:r,ariaLabel:o,size:n="md",color:i="primary",radius:a,className:s="",itemClassName:l="",selectedItemClassName:m=""}){let f=gf(null),w=gf(null),g=C(n,ao,"md"),p=C(i,uf,"primary"),b=C(a,cf,"md"),h=e.findIndex(v=>!v.disabled),x=e.some(v=>v.value===t);sh(()=>{if(w.current&&f.current){let v=f.current,d=w.current,u=d.offsetTop-v.offsetTop-(v.clientHeight-d.clientHeight)/2;v.scrollTo({top:Math.max(0,u),behavior:"smooth"}),v.contains(document.activeElement)&&d.focus()}},[t]);let S=v=>{let d=e[v];if(!d||d.disabled)return;r(d.value),f.current?.children[v]?.focus()},k=(v,d)=>{if(e.filter(y=>!y.disabled).length){if(v.key==="ArrowDown"){v.preventDefault();for(let y=d+1;y<e.length;y++)if(!e[y].disabled){S(y);break}}else if(v.key==="ArrowUp"){v.preventDefault();for(let y=d-1;y>=0;y--)if(!e[y].disabled){S(y);break}}else if(v.key==="ArrowRight")v.preventDefault(),f.current?.nextElementSibling?.querySelector('[tabindex="0"], [role="option"]:not([aria-disabled="true"])')?.focus();else if(v.key==="ArrowLeft")v.preventDefault(),f.current?.previousElementSibling?.querySelector('[tabindex="0"], [role="option"]:not([aria-disabled="true"])')?.focus();else if(v.key==="Home"){v.preventDefault();let y=e.findIndex(c=>!c.disabled);y!==-1&&S(y)}else if(v.key==="End"){v.preventDefault();for(let y=e.length-1;y>=0;y--)if(!e[y].disabled){S(y);break}}else if(v.key==="Enter"||v.key===" "){v.preventDefault();let y=e[d];y&&!y.disabled&&S(d)}}};return bf("ul",{ref:f,role:"listbox","aria-label":o,tabIndex:-1,className:`relative flex flex-col overflow-y-auto select-none ${g.columnWidth} ${g.columnHeight} scrollbar-thin scrollbar-thumb-neutral-300 hover:scrollbar-thumb-neutral-400 py-1 focus:outline-none ${s}`,style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e.map((v,d)=>{let u=t===v.value,y=!!v.disabled,c=!y&&(u||!x&&d===h);return bf("li",{ref:u?w:void 0,role:"option","aria-selected":u,"aria-disabled":y,"aria-label":`${v.label} ${o||""}`.trim(),tabIndex:c?0:-1,onKeyDown:T=>k(T,d),onClick:()=>{y||S(d)},className:`flex items-center justify-center shrink-0 transition-colors duration-150 mx-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${b} ${g.itemHeight} ${g.itemText} ${y?"opacity-30 cursor-not-allowed text-neutral-400":u?`${p.selected} cursor-default ${m}`:`text-neutral-700 ${p.hoverBg} cursor-pointer`} ${l}`,children:v.label},`${v.value}`)})})}import{jsx as vn,jsxs as hf}from"react/jsx-runtime";function ar({value:e,onChange:t,ariaLabel:r="Time selector",use12Hours:o=!1,showSeconds:n=!0,hourStep:i=1,minuteStep:a=1,secondStep:s=1,minTime:l,maxTime:m,disabledHours:f,disabledMinutes:w,disabledSeconds:g,size:p="md",color:b="primary",radius:h,className:x=""}){let S=xn(()=>Zt(l),[l]),k=xn(()=>Zt(m),[m]),v=so(o,n),d=C(h,Ua,"lg"),u=C(p,ao,"md"),y=e?e.getHours():0,c=y%12===0?12:y%12,T=e?e.getMinutes():0,R=e?e.getSeconds():0,D=y>=12?"PM":"AM",N=xn(()=>{let L=[];if(o)for(let M=1;M<=12;M+=i){let O=D==="PM"?M===12?12:M+12:M===12?0:M,A=Lo("hour",O,y,T,S,k,f,w,g);L.push({value:M,label:br(M),disabled:A})}else for(let M=0;M<24;M+=i){let O=Lo("hour",M,y,T,S,k,f,w,g);L.push({value:M,label:br(M),disabled:O})}return L},[o,i,D,y,T,S,k,f,w,g]),I=xn(()=>{let L=[];for(let M=0;M<60;M+=a){let O=Lo("minute",M,y,T,S,k,f,w,g);L.push({value:M,label:br(M),disabled:O})}return L},[a,y,T,S,k,f,w,g]),E=xn(()=>{if(!n)return[];let L=[];for(let M=0;M<60;M+=s){let O=Lo("second",M,y,T,S,k,f,w,g);L.push({value:M,label:br(M),disabled:O})}return L},[n,s,y,T,S,k,f,w,g]),P=xn(()=>[{value:"AM",label:"AM"},{value:"PM",label:"PM"}],[]),F=L=>{let M=Number(L);o&&(D==="PM"&&M<12&&(M+=12),D==="AM"&&M===12&&(M=0));let O=$o(M,T,R);t?.(O)},z=L=>{let M=Number(L),O=$o(y,M,R);t?.(O)},H=L=>{let M=Number(L),O=$o(y,T,M);t?.(O)},V=L=>{let M=L,O=y;M==="AM"&&O>=12?O-=12:M==="PM"&&O<12&&(O+=12);let A=$o(O,T,R);t?.(A)},W=n?"--:--:--":"--:--";return hf("div",{"aria-label":r,className:`inline-flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${d} ${x}`,children:[vn("div",{className:"flex items-center justify-center px-4 py-2 border-b border-neutral-200 bg-neutral-50/50",children:vn("span",{className:`text-neutral-700 tracking-wider font-mono ${u.headerText}`,children:e?Ut(e,v):W})}),hf("div",{className:`flex divide-x divide-neutral-200 ${u.panelPadding}`,children:[vn(lo,{ariaLabel:"Gi\u1EDD",items:N,selectedValue:o?c:e?y:null,onSelect:F,size:p,color:b,radius:h}),vn(lo,{ariaLabel:"Ph\xFAt",items:I,selectedValue:e?T:null,onSelect:z,size:p,color:b,radius:h}),n&&vn(lo,{ariaLabel:"Gi\xE2y",items:E,selectedValue:e?R:null,onSelect:H,size:p,color:b,radius:h}),o&&vn(lo,{ariaLabel:"Bu\u1ED5i",items:P,selectedValue:e?D:null,onSelect:V,size:p,color:b,radius:h})]})]})}import{jsx as Yt,jsxs as Wa}from"react/jsx-runtime";function Jl({ref:e,value:t,defaultValue:r,onChange:o,format:n="HH:mm:ss",displayFormat:i,use12Hours:a=!1,showSeconds:s=!0,hourStep:l=1,minuteStep:m=1,secondStep:f=1,minTime:w,maxTime:g,disabledHours:p,disabledMinutes:b,disabledSeconds:h,size:x="md",variant:S="outline",color:k="primary",radius:v,label:d,labelPlacement:u="floating",placeholder:y,helperText:c,errorMessage:T,name:R,id:D,autoComplete:N,onClear:I,placement:E="bottom-start",disabled:P=!1,readOnly:F=!1,config:z,className:H="",wrapperClassName:V="",inputWrapperClassName:W="",labelClassName:L="",helperClassName:M="",popoverClassName:O=""}){let A=Ze(),U=Je(),{isRequired:G=!1,isInvalid:K=!1,isLoading:q=!1,showSpinner:X=!1,isClearable:fe=!0,isFullWidth:ae=!0,closeOnSelect:_=!1}=z??{},Z=lh(),he=D||Z,xe=`${he}-error-helper`,$=`${he}-popover`,re=so(a,s),ee=n||re,de=i||ee,ne=t!==void 0,[ze,ve]=xf(()=>Zt(r)),Ce=ne?Zt(t):ze,J=Ce?Ut(Ce,de):"",[j,oe]=xf(!1),{refs:{setReference:ye,setFloating:ue},floatingStyles:ce,context:ke}=ch({placement:E,open:j&&!P&&!F&&!q,onOpenChange:oe,whileElementsMounted:uh,transform:!1,middleware:[dh(6),fh(),ph({padding:8})]}),Te=mh(ke,{escapeKey:!0,outsidePress:!0}),pe=gh(ke,{role:"dialog"}),{getReferenceProps:Y,getFloatingProps:me}=bh([Te,pe]),{isMounted:De,styles:ie}=it(ke),B=!!(K||T),se=B?"error":k,Ie=C(x,ao,"md"),Ae=C(v,ja,"lg"),le=S==="other"?"":C(se,C(S,Ya,"outline"),"primary"),ge=!!Ce,Me=Ee=>{ne||ve(Ee);let yt=Ee?Ut(Ee,ee):"";o?.(yt),_&&oe(!1)},Le=Ee=>{P||F||q||(Ee.key==="ArrowDown"||Ee.key==="Enter"||Ee.key===" "?(Ee.preventDefault(),j||oe(!0)):Ee.key==="Escape"&&j&&(Ee.preventDefault(),oe(!1)))},Ve=Ee=>{Ee.stopPropagation(),ne||ve(null),o?.(null),I?.()},Be=y||de,je=u==="floating",ut=u==="left",Re=()=>Yt(bt,{htmlFor:he,label:d,isRequired:G,isFloating:je,size:x,color:se,hasError:B,cursor:"pointer",className:L}),Xe=Ee=>Yt("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Ie.icon}`,"aria-hidden":"true",children:Ee}),at=["group/field group/timepicker relative flex",ut?"flex-row items-center gap-3":"flex-col",je&&!!d?"pt-2":"",ae?"w-full":"inline-flex",V].filter(Boolean).join(" "),ot=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",Ie.inputHeight,Ae,le,P?"opacity-50":"",ae?"w-full":"w-auto",W].filter(Boolean).join(" "),vt=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",Ie.inputText,Ie.inputPadding,H].filter(Boolean).join(" ");return Wa("div",{className:at,children:[!je&&Re(),Wa("div",{className:`flex flex-col ${ae?"w-full":""}`,children:[Wa("div",{ref:ye,...Y(),className:ot,children:[je&&Re(),Yt("input",{ref:e,id:he,name:R,type:"text",value:J,onClick:()=>!P&&!F&&!q&&oe(Ee=>!Ee),onKeyDown:Le,readOnly:!0,autoComplete:N,placeholder:Be,disabled:P||q,role:"combobox","aria-expanded":j&&!q,"aria-haspopup":"dialog","aria-controls":$,"aria-required":G,"aria-invalid":B,"aria-busy":q,"aria-disabled":P||q,"aria-describedby":c||T?xe:void 0,"aria-errormessage":T?xe:void 0,className:vt}),Wa("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[q&&X&&Yt("div",{className:"flex items-center justify-center shrink-0",children:Xe(Yt(Pe,{}))}),!q&&fe&&!P&&!F&&Yt("button",{type:"button",onClick:Ve,"aria-label":"X\xF3a th\u1EDDi gian",tabIndex:ge?0:-1,"aria-hidden":!ge,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${Ie.icon} ${ge?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:Yt(Ye,{className:"size-full"})}),Yt("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${j?"rotate-180":"rotate-0"}`,children:Xe(Yt(xt,{className:"size-full"}))})]})]}),De&&Yt(hh,{root:A?.dialogRef??U?.dialogRef,children:Yt(xh,{context:ke,modal:!1,returnFocus:!0,children:Yt("div",{ref:ue,id:$,style:{...ce,...ie,zIndex:st.PICKER},...me(),className:O,children:Yt(ar,{value:Ce,onChange:Me,ariaLabel:typeof d=="string"?`${d} selector`:"Time selector",use12Hours:a,showSeconds:s,hourStep:l,minuteStep:m,secondStep:f,minTime:w,maxTime:g,disabledHours:p,disabledMinutes:b,disabledSeconds:h,size:x,color:k,radius:v})})})}),Yt(He,{id:xe,helperText:c,errorMessage:T,sizeClassName:Ie.helper,className:M})]})]})}import{useState as Sf,useId as vh,useMemo as yh}from"react";import{useFloating as wh,autoUpdate as Ch,offset as Sh,flip as Th,shift as kh,useDismiss as Rh,useRole as Dh,useInteractions as Nh,FloatingPortal as Ph,FloatingFocusManager as zh}from"@floating-ui/react";var vf=ao,yf=ja,wf=Ua,Cf=Ya;import{jsx as Mt,jsxs as Bo}from"react/jsx-runtime";function Ql({ref:e,value:t,defaultValue:r,onChange:o,format:n,displayFormat:i,separator:a=" - ",startLabel:s="Th\u1EDDi gian b\u1EAFt \u0111\u1EA7u",endLabel:l="Th\u1EDDi gian k\u1EBFt th\xFAc",use12Hours:m=!1,showSeconds:f=!0,hourStep:w=1,minuteStep:g=1,secondStep:p=1,minTime:b,maxTime:h,disabledHours:x,disabledMinutes:S,disabledSeconds:k,size:v="md",variant:d="outline",color:u="primary",radius:y,label:c,labelPlacement:T="floating",placeholder:R,placeholders:D,helperText:N,errorMessage:I,name:E,id:P,autoComplete:F,disabled:z=!1,readOnly:H=!1,config:V,onClear:W,placement:L="bottom-start",className:M="",wrapperClassName:O="",inputWrapperClassName:A="",labelClassName:U="",helperClassName:G="",popoverClassName:K=""}){let q=Ze(),X=Je(),{isRequired:fe=!1,isInvalid:ae=!1,isLoading:_=!1,showSpinner:Z=!1,isClearable:he=!0,isFullWidth:xe=!0,closeOnSelect:$=!1}=V??{},re=vh(),ee=P||re,de=`${ee}-error-helper`,ne=`${ee}-popover`,ze=so(m,f),ve=n||ze,Ce=i||ve,J=t!==void 0,[j,oe]=Sf(()=>{let we=r;return we&&Array.isArray(we)?[Zt(we[0]),Zt(we[1])]:[null,null]}),ye=J&&t&&Array.isArray(t)?[Zt(t[0]),Zt(t[1])]:j,ue=ye[0]?Ut(ye[0],Ce):"",ce=ye[1]?Ut(ye[1],Ce):"",ke=yh(()=>ue&&ce?`${ue}${a}${ce}`:ue?`${ue}${a}`:"",[ue,ce,a]),[Te,pe]=Sf(!1),{refs:{setReference:Y,setFloating:me},floatingStyles:De,context:ie}=wh({placement:L,open:Te&&!z&&!H&&!_,onOpenChange:pe,whileElementsMounted:Ch,transform:!1,middleware:[Sh(6),Th(),kh({padding:8})]}),B=Rh(ie,{escapeKey:!0,outsidePress:!0}),se=Dh(ie,{role:"dialog"}),{getReferenceProps:Ie,getFloatingProps:Ae}=Nh([B,se]),{isMounted:le,styles:ge}=it(ie),Me=!!(ae||I),Le=Me?"error":u,Ve=C(v,vf,"md"),Be=C(y,yf,"lg"),je=C(y,wf,"lg"),ut=d==="other"?"":C(Le,C(d,Cf,"outline"),"primary"),Re=!!(ye[0]||ye[1]),Xe=we=>{let We=[we,ye[1]];J||oe(We);let wt=Ut(we,ve),Ke=ye[1]?Ut(ye[1],ve):"";o?.([wt,Ke])},qe=we=>{let We=[ye[0],we];J||oe(We);let wt=ye[0]?Ut(ye[0],ve):"",Ke=Ut(we,ve);o?.([wt,Ke]),$&&pe(!1)},at=we=>{z||H||_||(we.key==="ArrowDown"||we.key==="Enter"||we.key===" "?(we.preventDefault(),Te||pe(!0)):we.key==="Escape"&&Te&&(we.preventDefault(),pe(!1)))},ot=we=>{we.stopPropagation(),J||oe([null,null]),o?.(null),W?.()},vt=R||(D?`${D[0]}${a}${D[1]}`:`${Ce}${a}${Ce}`),Ee=T==="floating",yt=T==="left",pt=()=>Mt(bt,{htmlFor:ee,label:c,isRequired:fe,isFloating:Ee,size:v,color:Le,hasError:Me,cursor:"pointer",className:U}),mt=we=>Mt("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Ve.icon}`,"aria-hidden":"true",children:we}),Rt=["group/field group/timerangepicker relative flex",yt?"flex-row items-center gap-3":"flex-col",Ee&&!!c?"pt-2":"",xe?"w-full":"inline-flex",O].filter(Boolean).join(" "),Oe=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",Ve.inputHeight,Be,ut,z?"opacity-50":"",xe?"w-full":"w-auto",A].filter(Boolean).join(" "),dt=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",Ve.inputText,Ve.inputPadding,M].filter(Boolean).join(" ");return Bo("div",{className:Rt,children:[!Ee&&pt(),Bo("div",{className:`flex flex-col ${xe?"w-full":""}`,children:[Bo("div",{ref:Y,...Ie(),className:Oe,children:[Ee&&pt(),Mt("input",{ref:e,id:ee,name:E,type:"text",value:ke,onClick:()=>!z&&!H&&!_&&pe(we=>!we),onKeyDown:at,readOnly:!0,autoComplete:F,placeholder:vt,disabled:z||_,role:"combobox","aria-expanded":Te&&!_,"aria-haspopup":"dialog","aria-controls":ne,"aria-required":fe,"aria-invalid":Me,"aria-busy":_,"aria-disabled":z||_,"aria-describedby":N||I?de:void 0,"aria-errormessage":I?de:void 0,className:dt}),Bo("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[_&&Z&&Mt("div",{className:"flex items-center justify-center shrink-0",children:mt(Mt(Pe,{}))}),!_&&he&&!z&&!H&&Mt("button",{type:"button",onClick:ot,"aria-label":"X\xF3a kho\u1EA3ng th\u1EDDi gian",tabIndex:Re?0:-1,"aria-hidden":!Re,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${Ve.icon} ${Re?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:Mt(Ye,{className:"size-full"})}),Mt("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${Te?"rotate-180":"rotate-0"}`,children:mt(Mt(xt,{className:"size-full"}))})]})]}),le&&Mt(Ph,{root:q?.dialogRef??X?.dialogRef,children:Mt(zh,{context:ie,modal:!1,returnFocus:!0,children:Bo("div",{ref:me,id:ne,style:{...De,...ge,zIndex:st.PICKER},...Ae(),className:`flex flex-row bg-neutral-white border-2 border-neutral-200 shadow-xl divide-x divide-neutral-200 overflow-hidden select-none ${je} ${K}`,children:[Bo("div",{className:"flex flex-col",children:[Mt("div",{className:"px-3 py-1.5 bg-neutral-50 text-xs font-semibold text-neutral-600 border-b border-neutral-200 text-center",children:s}),Mt(ar,{value:ye[0],onChange:Xe,ariaLabel:s,use12Hours:m,showSeconds:f,hourStep:w,minuteStep:g,secondStep:p,minTime:b,maxTime:ye[1]||h,disabledHours:x,disabledMinutes:S,disabledSeconds:k,size:v,color:u,radius:y,className:"border-none shadow-none"})]}),Bo("div",{className:"flex flex-col",children:[Mt("div",{className:"px-3 py-1.5 bg-neutral-50 text-xs font-semibold text-neutral-600 border-b border-neutral-200 text-center",children:l}),Mt(ar,{value:ye[1],onChange:qe,ariaLabel:l,use12Hours:m,showSeconds:f,hourStep:w,minuteStep:g,secondStep:p,minTime:ye[0]||b,maxTime:h,disabledHours:x,disabledMinutes:S,disabledSeconds:k,size:v,color:u,radius:y,className:"border-none shadow-none"})]})]})})}),Mt(He,{id:de,helperText:N,errorMessage:I,sizeClassName:Ve.helper,className:G})]})]})}function Tf(e,t,r){if(!e||!t||!r)return!1;let o=e.getHours()*3600+e.getMinutes()*60+e.getSeconds(),n=t.getHours()*3600+t.getMinutes()*60+t.getSeconds(),i=r.getHours()*3600+r.getMinutes()*60+r.getSeconds();return o>=n&&o<=i}import{useState as ec,useId as Ih}from"react";import{useFloating as Fh,autoUpdate as Mh,offset as Eh,flip as $h,shift as Lh,useDismiss as Bh,useRole as Hh,useInteractions as Vh,FloatingPortal as Ah,FloatingFocusManager as Oh}from"@floating-ui/react";function co(e=!1,t=!0){return e?t?"DD/MM/YYYY hh:mm:ss A":"DD/MM/YYYY hh:mm A":t?"DD/MM/YYYY HH:mm:ss":"DD/MM/YYYY HH:mm"}function sr(e,t){if(!e&&!t)return null;let r=e?new Date(e):new Date;return t&&(r.setHours(t.getHours()),r.setMinutes(t.getMinutes()),r.setSeconds(t.getSeconds()),r.setMilliseconds(t.getMilliseconds())),r}function lr(e,t="DD/MM/YYYY HH:mm:ss"){if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:new Date(e.getTime());if(typeof e=="string"||typeof e=="number"){if(typeof e=="string"){let n=bi(e,t);if(n)return n}let o=new Date(e);return isNaN(o.getTime())?null:o}let r=e;return typeof r.toDate=="function"?r.toDate():typeof r.epochMilliseconds=="number"?new Date(r.epochMilliseconds):null}function Jt(e,t="DD/MM/YYYY HH:mm:ss",r){return!e||isNaN(e.getTime())?"":qt(e,t,r)}function bi(e,t="DD/MM/YYYY HH:mm:ss"){if(!e||typeof e!="string")return null;let r=e.trim();if(!r)return null;let o=new Date().getFullYear(),n=1,i=1,a=0,s=0,l=0,m=!1,f=!1,w=t.match(/YYYY|YY|MM|M|DD|D|HH|H|hh|h|mm|m|ss|s|A|a/g);if(!w){let h=new Date(r);return isNaN(h.getTime())?null:h}let g="^"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");for(let h of w)h==="YYYY"?g=g.replace("YYYY","(\\d{4})"):h==="YY"?g=g.replace("YY","(\\d{2})"):h==="MM"||h==="M"||h==="DD"||h==="D"||h==="HH"||h==="H"||h==="hh"||h==="h"||h==="mm"||h==="m"||h==="ss"||h==="s"?g=g.replace(h,"(\\d{1,2})"):(h==="A"||h==="a")&&(g=g.replace(h,"(AM|PM|am|pm)"));g+="$";let p=new RegExp(g,"i").exec(r);if(!p){let h=new Date(r);return isNaN(h.getTime())?null:h}w.forEach((h,x)=>{let S=p[x+1];if(!S)return;if(h==="A"||h==="a"){m=!0,S.toUpperCase()==="PM"&&(f=!0);return}let k=parseInt(S,10);isNaN(k)||(h==="YYYY"?o=k:h==="YY"?o=2e3+k:h==="MM"||h==="M"?n=k:h==="DD"||h==="D"?i=k:h==="HH"||h==="H"?a=k:h==="hh"||h==="h"?(m=!0,a=k):h==="mm"||h==="m"?s=k:(h==="ss"||h==="s")&&(l=k))}),m&&(f?a<12&&(a+=12):a===12&&(a=0));let b=new Date(o,n-1,i,a,s,l);return isNaN(b.getTime())?null:b}var kf={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Rf={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Df={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,calendarPadding:"p-4",cellSize:"w-12 h-12",cellText:"text-lg",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-sm",helper:"text-sm mt-1.5"}};var Nf={outline:{primary:"bg-neutral-white border-2 border-neutral-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-2 border-neutral-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-2 border-error-500 hover:border-error-600 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-2 border-neutral-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-2 border-neutral-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-2 border-neutral-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-2 border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-2 border-transparent hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-2 border-transparent hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-error-50/60 border-2 border-transparent hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-2 border-transparent hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-2 border-transparent hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-2 border-transparent hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-50/60 border-2 border-transparent hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},ghost:{primary:"bg-transparent border-2 border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-2 border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-transparent border-2 border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-2 border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-2 border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-2 border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-transparent border-2 border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20"}};import{jsx as Et,jsxs as hi}from"react/jsx-runtime";function tc({ref:e,value:t,defaultValue:r,onChange:o,format:n,displayFormat:i,layout:a="side-by-side",locale:s="vi",defaultView:l="days",firstDayOfWeek:m=1,minDate:f,maxDate:w,isDateDisabled:g,viewTabs:p,use12Hours:b=!1,showSeconds:h=!0,hourStep:x=1,minuteStep:S=1,secondStep:k=1,minTime:v,maxTime:d,disabledHours:u,disabledMinutes:y,disabledSeconds:c,size:T="md",variant:R="outline",color:D="primary",radius:N,label:I,labelPlacement:E="floating",placeholder:P,helperText:F,errorMessage:z,name:H,id:V,autoComplete:W,disabled:L=!1,readOnly:M=!1,config:O,onClear:A,placement:U="bottom-start",className:G="",wrapperClassName:K="",inputWrapperClassName:q="",labelClassName:X="",helperClassName:fe="",popoverClassName:ae=""}){let _=Ze(),Z=Je(),{isRequired:he=!1,isInvalid:xe=!1,isLoading:$=!1,showSpinner:re=!1,isClearable:ee=!0,isFullWidth:de=!0,closeOnSelect:ne=!1,showWeekNumbers:ze=!1,showViewTabs:ve=!1}=O??{},Ce=Ih(),J=V||Ce,j=`${J}-error-helper`,oe=`${J}-popover`,ye=co(b,h),ue=n||ye,ce=i||ue,ke=t!==void 0,[Te,pe]=ec(()=>lr(r,ue)),Y=ke?lr(t,ue):Te,me=Y?Jt(Y,ce,s):"",[De,ie]=ec(l),[B,se]=ec(!1),{refs:{setReference:Ie,setFloating:Ae},floatingStyles:le,context:ge}=Fh({placement:U,open:B&&!L&&!M&&!$,onOpenChange:se,whileElementsMounted:Mh,transform:!1,middleware:[Eh(6),$h(),Lh({padding:8})]}),Me=Bh(ge,{escapeKey:!0,outsidePress:!0}),Le=Hh(ge,{role:"dialog"}),{getReferenceProps:Ve,getFloatingProps:Be}=Vh([Me,Le]),{isMounted:je,styles:ut}=it(ge),Re=!!(xe||z),Xe=Re?"error":D,qe=C(T,Df,"md"),at=C(N,kf,"lg"),ot=C(N,Rf,"lg"),vt=R==="other"?"":C(Xe,C(R,Nf,"outline"),"primary"),Ee=!!Y,yt=Fe=>{let be=sr(Fe,Y||new Date);ke||pe(be);let Se=be?Jt(be,ue,s):"";o?.(Se),ne&&se(!1)},pt=Fe=>{if(!Fe)return;let be=sr(Y||new Date,Fe);ke||pe(be);let Se=be?Jt(be,ue,s):"";o?.(Se),ne&&se(!1)},mt=Fe=>{L||M||$||(Fe.key==="ArrowDown"||Fe.key==="Enter"||Fe.key===" "?(Fe.preventDefault(),B||se(!0)):Fe.key==="Escape"&&B&&(Fe.preventDefault(),se(!1)))},tt=Fe=>{Fe.stopPropagation(),ke||pe(null),o?.(null),A?.()},Rt=P||ce,Oe=E==="floating",dt=E==="left",we=()=>Et(bt,{htmlFor:J,label:I,isRequired:he,isFloating:Oe,size:T,color:Xe,hasError:Re,cursor:"pointer",className:X}),We=Fe=>Et("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${qe.icon}`,"aria-hidden":"true",children:Fe}),Ke=["group/field group/datetimepicker relative flex",dt?"flex-row items-center gap-3":"flex-col",Oe&&!!I?"pt-2":"",de?"w-full":"inline-flex",K].filter(Boolean).join(" "),Dt=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",qe.inputHeight,at,vt,L?"opacity-50":"",de?"w-full":"w-auto",q].filter(Boolean).join(" "),Pt=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",qe.inputText,qe.inputPadding,G].filter(Boolean).join(" ");return hi("div",{className:Ke,children:[!Oe&&we(),hi("div",{className:`flex flex-col ${de?"w-full":""}`,children:[hi("div",{ref:Ie,...Ve(),className:Dt,children:[Oe&&we(),Et("input",{ref:e,id:J,name:H,type:"text",value:me,onClick:()=>!L&&!M&&!$&&se(Fe=>!Fe),onKeyDown:mt,readOnly:!0,autoComplete:W,placeholder:Rt,disabled:L||$,role:"combobox","aria-expanded":B&&!$,"aria-haspopup":"dialog","aria-controls":oe,"aria-required":he,"aria-invalid":Re,"aria-busy":$,"aria-disabled":L||$,"aria-describedby":F||z?j:void 0,"aria-errormessage":z?j:void 0,className:Pt}),hi("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[$&&re&&Et("div",{className:"flex items-center justify-center shrink-0",children:We(Et(Pe,{}))}),!$&&ee&&!L&&!M&&Et("button",{type:"button",onClick:tt,"aria-label":"X\xF3a ng\xE0y gi\u1EDD",tabIndex:Ee?0:-1,"aria-hidden":!Ee,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${qe.icon} ${Ee?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:Et(Ye,{className:"size-full"})}),Et("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${B?"rotate-180":"rotate-0"}`,children:We(Et(xt,{className:"size-full"}))})]})]}),je&&Et(Ah,{root:_?.dialogRef??Z?.dialogRef,children:Et(Oh,{context:ge,modal:!1,returnFocus:!0,children:hi("div",{ref:Ae,id:oe,style:{...le,...ut,zIndex:st.PICKER},...Be(),className:`flex bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${ot} ${a==="stacked"?"flex-col divide-y-2 divide-neutral-200":"flex-row divide-x-2 divide-neutral-200"} ${ae}`,children:[Et("div",{className:"flex flex-col",children:Et(kr,{value:Y,onChange:yt,view:De,onViewChange:ie,minDate:f,maxDate:w,isDateDisabled:g,locale:s,firstDayOfWeek:m,showWeekNumbers:ze,size:T,color:D,radius:N,showViewTabs:ve,viewTabs:p,className:"border-none shadow-none rounded-none"})}),Et("div",{className:"flex flex-col justify-center items-center p-1 bg-neutral-50/50",children:Et(ar,{value:Y,onChange:pt,ariaLabel:typeof I=="string"?`${I} time`:"Time selector",use12Hours:b,showSeconds:h,hourStep:x,minuteStep:S,secondStep:k,minTime:v,maxTime:d,disabledHours:u,disabledMinutes:y,disabledSeconds:c,size:T,color:D,radius:N,className:"border-none shadow-none bg-transparent"})})]})})}),Et(He,{id:j,helperText:F,errorMessage:z,sizeClassName:qe.helper,className:fe})]})]})}import{useState as Ka,useId as Gh,useMemo as jh}from"react";import{useFloating as Uh,autoUpdate as Yh,offset as Wh,flip as Kh,shift as _h,useDismiss as Xh,useRole as qh,useInteractions as Zh,FloatingPortal as Jh,FloatingFocusManager as Qh}from"@floating-ui/react";var Pf={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",minWidth:"min-w-72",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",minWidth:"min-w-80",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",minWidth:"min-w-96",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",minWidth:"min-w-105",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",minWidth:"min-w-120",icon:"size-6",iconSize:20,calendarPadding:"p-4",cellSize:"w-12 h-12",cellText:"text-lg",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-sm",helper:"text-sm mt-1.5"}};var zf={primary:{activeStep:"bg-primary-500 border-primary-500 text-neutral-white shadow-xs",applyButton:"bg-primary-500 hover:bg-primary-600 active:bg-primary-700 text-neutral-white shadow-xs"},secondary:{activeStep:"bg-secondary-500 border-secondary-500 text-neutral-white shadow-xs",applyButton:"bg-secondary-500 hover:bg-secondary-600 active:bg-secondary-700 text-neutral-white shadow-xs"},error:{activeStep:"bg-error-500 border-error-500 text-neutral-white shadow-xs",applyButton:"bg-error-500 hover:bg-error-600 active:bg-error-700 text-neutral-white shadow-xs"},success:{activeStep:"bg-success-500 border-success-500 text-neutral-white shadow-xs",applyButton:"bg-success-500 hover:bg-success-600 active:bg-success-700 text-neutral-white shadow-xs"},warning:{activeStep:"bg-warning-500 border-warning-500 text-neutral-950 shadow-xs",applyButton:"bg-warning-500 hover:bg-warning-600 active:bg-warning-700 text-neutral-950 shadow-xs"},info:{activeStep:"bg-info-500 border-info-500 text-neutral-white shadow-xs",applyButton:"bg-info-500 hover:bg-info-600 active:bg-info-700 text-neutral-white shadow-xs"},neutral:{activeStep:"bg-neutral-800 border-neutral-800 text-neutral-white shadow-xs",applyButton:"bg-neutral-800 hover:bg-neutral-900 active:bg-neutral-950 text-neutral-white shadow-xs"}};import{jsx as Nt,jsxs as Dr}from"react/jsx-runtime";function rc({ref:e,value:t,defaultValue:r,onChange:o,format:n,displayFormat:i,separator:a=" - ",startLabel:s="Th\u1EDDi gian b\u1EAFt \u0111\u1EA7u",endLabel:l="Th\u1EDDi gian k\u1EBFt th\xFAc",layout:m="side-by-side",locale:f="vi",defaultView:w="days",firstDayOfWeek:g=1,minDate:p,maxDate:b,isDateDisabled:h,viewTabs:x,use12Hours:S=!1,showSeconds:k=!0,hourStep:v=1,minuteStep:d=1,secondStep:u=1,minTime:y,maxTime:c,disabledHours:T,disabledMinutes:R,disabledSeconds:D,size:N="md",variant:I="outline",color:E="primary",radius:P,label:F,labelPlacement:z="floating",placeholder:H,placeholders:V,helperText:W,errorMessage:L,name:M,id:O,autoComplete:A,disabled:U=!1,readOnly:G=!1,config:K,onClear:q,placement:X="bottom-start",className:fe="",wrapperClassName:ae="",inputWrapperClassName:_="",labelClassName:Z="",helperClassName:he="",popoverClassName:xe=""}){let $=Ze(),re=Je(),{isRequired:ee=!1,isInvalid:de=!1,isLoading:ne=!1,showSpinner:ze=!1,isClearable:ve=!0,isFullWidth:Ce=!0,closeOnSelect:J=!1,showWeekNumbers:j=!1,showViewTabs:oe=!1}=K??{},ye=Gh(),ue=O||ye,ce=`${ue}-error-helper`,ke=`${ue}-popover`,Te=co(S,k),pe=n||Te,Y=i||pe,me=t!==void 0,[De,ie]=Ka(()=>{let Ne=r;return Ne&&Array.isArray(Ne)?[lr(Ne[0],pe),lr(Ne[1],pe)]:[null,null]}),B=me?t&&Array.isArray(t)?[lr(t[0],pe),lr(t[1],pe)]:[null,null]:De,[se,Ie]=Ka("start"),[Ae,le]=Ka(w),[ge,Me]=Ka(!1),Le=B[0]?Jt(B[0],Y,f):"",Ve=B[1]?Jt(B[1],Y,f):"",Be=jh(()=>Le&&Ve?`${Le}${a}${Ve}`:Le?`${Le}${a}`:"",[Le,Ve,a]),{refs:{setReference:je,setFloating:ut},floatingStyles:Re,context:Xe}=Uh({placement:X,open:ge&&!U&&!G&&!ne,onOpenChange:Me,whileElementsMounted:Yh,transform:!1,middleware:[Wh(6),Kh(),_h({padding:8})]}),qe=Xh(Xe,{escapeKey:!0,outsidePress:!0}),at=qh(Xe,{role:"dialog"}),{getReferenceProps:ot,getFloatingProps:vt}=Zh([qe,at]),{isMounted:Ee,styles:yt}=it(Xe),pt=!!(de||L),mt=pt?"error":E,tt=C(N,Pf,"md"),Rt=C(P,Rr,"lg"),Oe=C(P,La,"lg"),dt=C(mt,zf,"primary"),we=I==="other"?"":C(mt,C(I,Ba,"outline"),"primary"),We=!!(B[0]||B[1]),wt=Ne=>{me||ie(Ne);let nt=Ne[0]?Jt(Ne[0],pe,f):"",gt=Ne[1]?Jt(Ne[1],pe,f):"";o?.(nt||gt?[nt,gt]:null),J&&Ne[0]&&Ne[1]&&Me(!1)},Ke=Ne=>{if(se==="start"){let nt=sr(Ne,B[0]||new Date),gt=B[1];gt&&nt&&nt.getTime()>gt.getTime()&&(gt=null),wt([nt,gt])}else{let nt=sr(Ne,B[1]||B[0]||new Date);wt([B[0],nt])}},Dt=Ne=>{if(Ne)if(se==="start"){let nt=sr(B[0]||new Date,Ne),gt=B[1];gt&&nt&&nt.getTime()>gt.getTime()&&(gt=null),wt([nt,gt])}else{let nt=sr(B[1]||B[0]||new Date,Ne);wt([B[0],nt])}},Pt=Ne=>{U||G||ne||(Ne.key==="ArrowDown"||Ne.key==="Enter"||Ne.key===" "?(Ne.preventDefault(),ge||Me(!0)):Ne.key==="Escape"&&ge&&(Ne.preventDefault(),Me(!1)))},Fe=Ne=>{Ne.stopPropagation(),me||ie([null,null]),o?.(null),q?.()},be=H||(V?`${V[0]}${a}${V[1]}`:`${Y}${a}${Y}`),Se=z==="floating",et=z==="left",rt=()=>Nt(bt,{htmlFor:ue,label:F,isRequired:ee,isFloating:Se,size:N,color:mt,hasError:pt,cursor:"pointer",className:Z}),te=Ne=>Nt("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${tt.icon}`,"aria-hidden":"true",children:Ne}),Ue=["group/field group/datetimerangepicker relative flex",et?"flex-row items-center gap-3":"flex-col",Se&&!!F?"pt-2":"",Ce?"w-full":"inline-flex",ae].filter(Boolean).join(" "),$e=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",tt.inputHeight,Rt,we,U?"opacity-50":"",Ce?"w-full":tt.minWidth||"min-w-80",_].filter(Boolean).join(" "),ft=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",tt.inputText,tt.inputPadding,fe].filter(Boolean).join(" "),St=se==="start"?B[0]:B[1];return Dr("div",{className:Ue,children:[!Se&&rt(),Dr("div",{className:`flex flex-col ${Ce?"w-full":""}`,children:[Dr("div",{ref:je,...ot(),className:$e,children:[Se&&rt(),Nt("input",{ref:e,id:ue,name:M,type:"text",value:Be,onClick:()=>!U&&!G&&!ne&&Me(Ne=>!Ne),onKeyDown:Pt,readOnly:!0,autoComplete:A,placeholder:be,disabled:U||ne,role:"combobox","aria-expanded":ge&&!ne,"aria-haspopup":"dialog","aria-controls":ke,"aria-required":ee,"aria-invalid":pt,"aria-busy":ne,"aria-disabled":U||ne,"aria-describedby":W||L?ce:void 0,"aria-errormessage":L?ce:void 0,className:ft}),Dr("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[ne&&ze&&Nt("div",{className:"flex items-center justify-center shrink-0",children:te(Nt(Pe,{}))}),!ne&&ve&&!U&&!G&&Nt("button",{type:"button",onClick:Fe,"aria-label":"X\xF3a kho\u1EA3ng ng\xE0y gi\u1EDD",tabIndex:We?0:-1,"aria-hidden":!We,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${tt.icon} ${We?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:Nt(Ye,{className:"size-full"})}),Nt("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${ge?"rotate-180":"rotate-0"}`,children:te(Nt(xt,{className:"size-full"}))})]})]}),Ee&&Nt(Jh,{root:$?.dialogRef??re?.dialogRef,children:Nt(Qh,{context:Xe,modal:!1,returnFocus:!0,children:Dr("div",{ref:ut,id:ke,style:{...Re,...yt,zIndex:st.PICKER},...vt(),className:`flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${Oe} ${xe}`,children:[Dr("div",{className:`flex ${m==="stacked"?"flex-col divide-y-2 divide-neutral-200":"flex-row divide-x-2 divide-neutral-200"}`,children:[Nt("div",{className:"flex flex-col",children:Nt(kr,{value:St,onChange:Ke,view:Ae,onViewChange:le,minDate:se==="end"&&B[0]||p,maxDate:se==="start"&&B[1]||b,isDateDisabled:h,locale:f,firstDayOfWeek:g,showWeekNumbers:j,size:N,color:E,radius:P,showViewTabs:oe,viewTabs:x,className:"border-none shadow-none rounded-none"},`calendar-step-${se}`)}),Nt("div",{className:"flex flex-col justify-center items-center p-1 bg-neutral-50/50",children:Nt(ar,{value:St||B[0],onChange:Dt,ariaLabel:se==="start"?`${s} time`:`${l} time`,use12Hours:S,showSeconds:k,hourStep:v,minuteStep:d,secondStep:u,minTime:se==="end"&&B[0]||y,maxTime:se==="start"&&B[1]||c,disabledHours:T,disabledMinutes:R,disabledSeconds:D,size:N,color:E,radius:P,className:"border-none shadow-none bg-transparent"},`timeview-step-${se}`)})]}),Dr("div",{className:"flex items-center justify-between border-t border-neutral-200 bg-neutral-50 px-3 py-2",children:[Dr("div",{className:"flex items-center space-x-2",children:[Dr("button",{type:"button",onClick:()=>Ie("start"),className:`px-3 py-1.5 text-xs font-semibold rounded-md border transition-all cursor-pointer ${se==="start"?dt.activeStep:"bg-neutral-white border-neutral-300 hover:bg-neutral-100 text-neutral-700"}`,children:["\u2190 ",s]}),Dr("button",{type:"button",onClick:()=>Ie("end"),className:`px-3 py-1.5 text-xs font-semibold rounded-md border transition-all cursor-pointer ${se==="end"?dt.activeStep:"bg-neutral-white border-neutral-300 hover:bg-neutral-100 text-neutral-700"}`,children:[l," \u2192"]})]}),Nt("button",{type:"button",onClick:()=>Me(!1),className:`px-3.5 py-1.5 text-xs font-semibold rounded-md transition-colors cursor-pointer ${dt.applyButton}`,children:"\xC1p d\u1EE5ng"})]})]})})}),Nt(He,{id:ce,helperText:W,errorMessage:L,sizeClassName:tt.helper,className:he})]})]})}import{isValidElement as ex}from"react";import tx from"next/image";var If={sm:{container:"p-3",imageWrapper:"w-16 h-16",defaultImageSize:64,title:"text-xs font-semibold text-neutral-800",description:"text-xs text-neutral-500",gap:"gap-2.5",contentGap:"gap-1",actionsGap:"mt-2"},md:{container:"p-6",imageWrapper:"w-28 h-28",defaultImageSize:112,title:"text-sm font-semibold text-neutral-800",description:"text-xs sm:text-sm text-neutral-500",gap:"gap-4",contentGap:"gap-1.5",actionsGap:"mt-3.5"},lg:{container:"p-10",imageWrapper:"w-40 h-40",defaultImageSize:160,title:"text-base font-semibold text-neutral-900",description:"text-sm text-neutral-500",gap:"gap-6",contentGap:"gap-2",actionsGap:"mt-5"}},Ff={vertical:{container:"flex flex-col items-center justify-center text-center",content:"flex flex-col items-center justify-center text-center"},horizontal:{container:"flex flex-row items-center justify-start text-left",content:"flex flex-col items-start justify-center text-left flex-1"}};import{jsx as xi}from"react/jsx-runtime";function yn({preset:e="default",...t}){switch(e){case"search":return xi(el,{...t});case"error":return xi(tl,{...t});case"folder":return xi(rl,{...t});case"simple":return xi(ol,{...t});default:return xi(Qs,{...t})}}var Mf=["default","search","error","folder","simple"];function oc(e){return typeof e=="string"&&Mf.includes(e)}function nc(e){return typeof e!="string"?!1:e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")||e.startsWith("./")||e.startsWith("data:")||/\.(png|jpe?g|svg|webp|gif|avif)$/i.test(e)}function ic(e){if(!e)return{};let t=typeof e=="number"?`${e}px`:e;return{width:t,height:t}}import{jsx as uo,jsxs as Ef}from"react/jsx-runtime";function Ho({size:e="md",layout:t="vertical",image:r="default",imageSize:o,imageClassName:n="",imageAlt:i="Tr\u1ED1ng",title:a,titleClassName:s="",description:l="Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u",descriptionClassName:m="",actions:f,actionsClassName:w="",children:g,className:p="",role:b="status",ref:h,...x}){let S=C(e,If,"md"),k=C(t,Ff,"vertical"),v=ic(o),d=()=>{if(!r)return null;if(oc(r))return uo(yn,{preset:r});if(nc(r)){let N=typeof o=="number"?o:S.defaultImageSize;return uo(tx,{src:r,alt:i,width:N,height:N,className:"size-full object-contain pointer-events-none select-none",unoptimized:r.startsWith("data:")||r.endsWith(".svg")})}return ex(r)?r:uo(yn,{preset:"default"})},u=["flex items-center justify-center shrink-0",o?"":S.imageWrapper,n].filter(Boolean).join(" "),y=["w-full transition-all",k.container,S.container,S.gap,p].filter(Boolean).join(" "),c=[k.content,S.contentGap].filter(Boolean).join(" "),T=[S.title,s].filter(Boolean).join(" "),R=[S.description,m].filter(Boolean).join(" "),D=["flex flex-wrap items-center gap-2",S.actionsGap,t==="vertical"?"justify-center":"justify-start",w].filter(Boolean).join(" ");return Ef("div",{ref:h,role:b,"aria-live":"polite",className:y,...x,children:[r&&uo("div",{className:u,style:v,"aria-hidden":"true",children:d()}),(a||l||f||g)&&Ef("div",{className:c,children:[a&&uo("div",{className:T,children:a}),l&&uo("div",{className:R,children:l}),f&&uo("div",{className:D,children:f}),g&&uo("div",{className:"mt-2 w-full",children:g})]})]})}import{useState as Ja,useMemo as Px,useCallback as Xf,useId as zx}from"react";import{useRef as ox}from"react";var Nr={xs:{trigger:"min-h-6 text-[11px] px-2 py-0.5",input:"text-[11px] leading-tight",text:"text-[11px]",icon:"size-3",option:"px-2 py-1 text-[11px] min-h-6",gap:"gap-1",badgeSize:"xs",defaultRadius:"sm",helper:"text-[9px] mt-0.5"},sm:{trigger:"min-h-8 text-xs px-2.5 py-1",input:"text-xs leading-normal",text:"text-xs",icon:"size-3.5",option:"px-2.5 py-1.5 text-xs min-h-7",gap:"gap-1",badgeSize:"xs",defaultRadius:"md",helper:"text-[10px] mt-0.5"},md:{trigger:"min-h-10 text-sm px-3.5 py-1.5",input:"text-sm leading-normal",text:"text-sm",icon:"size-[18px]",option:"px-3 py-2 text-sm min-h-9",gap:"gap-1.5",badgeSize:"sm",defaultRadius:"lg",helper:"text-[11px] mt-1"},lg:{trigger:"min-h-12 text-base px-4 py-2",input:"text-base leading-normal",text:"text-base",icon:"size-5",option:"px-3.5 py-2.5 text-base min-h-11",gap:"gap-2",badgeSize:"md",defaultRadius:"xl",helper:"text-xs mt-1"},xl:{trigger:"min-h-14 text-lg px-5 py-2.5",input:"text-lg leading-normal",text:"text-lg",icon:"size-6",option:"px-4 py-3 text-lg min-h-12",gap:"gap-2",badgeSize:"lg",defaultRadius:"xl",helper:"text-sm mt-1"}},wn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},vi={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},$f={none:"none",sm:"sm",md:"md",lg:"lg",xl:"xl",full:"full"},Cn={outline:{primary:"bg-neutral-white border-primary-400 hover:border-primary-500 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20 text-neutral-900",secondary:"bg-neutral-white border-secondary-400 hover:border-secondary-500 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20 text-neutral-900",error:"bg-neutral-white border-error-500 hover:border-error-600 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20 text-neutral-900",success:"bg-neutral-white border-success-400 hover:border-success-500 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20 text-neutral-900",warning:"bg-neutral-white border-warning-400 hover:border-warning-500 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20 text-neutral-900",info:"bg-neutral-white border-info-400 hover:border-info-500 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20 text-neutral-900",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20 text-neutral-900"},filled:{primary:"bg-primary-50/60 border border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20 text-neutral-900",secondary:"bg-secondary-50/60 border border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20 text-neutral-900",error:"bg-error-50/60 border border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20 text-neutral-900",success:"bg-success-50/60 border border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20 text-neutral-900",warning:"bg-warning-50/60 border border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20 text-neutral-900",info:"bg-info-50/60 border border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20 text-neutral-900",neutral:"bg-neutral-50/60 border border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20 text-neutral-900"},ghost:{primary:"bg-transparent border border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20 text-neutral-900",secondary:"bg-transparent border border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20 text-neutral-900",error:"bg-transparent border border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20 text-neutral-900",success:"bg-transparent border border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20 text-neutral-900",warning:"bg-transparent border border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20 text-neutral-900",info:"bg-transparent border border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20 text-neutral-900",neutral:"bg-transparent border border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20 text-neutral-900"}},Lf={primary:"bg-primary-50 text-primary-700 font-medium",secondary:"bg-secondary-50 text-secondary-700 font-medium",error:"bg-error-50 text-error-700 font-medium",success:"bg-success-50 text-success-700 font-medium",warning:"bg-warning-50 text-warning-700 font-medium",info:"bg-info-50 text-info-700 font-medium",neutral:"bg-neutral-100 text-neutral-900 font-medium"},Bf={primary:"bg-primary-50/60",secondary:"bg-secondary-50/60",error:"bg-error-50/60",success:"bg-success-50/60",warning:"bg-warning-50/60",info:"bg-info-50/60",neutral:"bg-neutral-100"};import{jsx as Sn,jsxs as Hf}from"react/jsx-runtime";function rx({id:e,isOpen:t,disabled:r=!1,isLoading:o=!1,showSpinner:n=!1,showClear:i=!1,onClear:a,startContent:s,endContent:l,triggerRef:m,getReferenceProps:f,onClick:w,roundedClass:g,currentSize:p,variantStyle:b,className:h="",children:x}){let S=r?"opacity-60 cursor-not-allowed bg-neutral-100 pointer-events-none":"cursor-pointer";return Hf("div",{ref:m,role:"combobox","aria-expanded":t,"aria-haspopup":"listbox","aria-controls":e?`${e}-listbox`:void 0,tabIndex:r?-1:0,onClick:w,"aria-busy":o,"aria-disabled":r||o,...f({id:e,className:`group relative flex items-center justify-between transition-all duration-150 ease-in-out border-2 select-none ${g} ${p.trigger} ${p.gap} ${b} ${S} ${h}`,"aria-expanded":t,"aria-haspopup":"listbox"}),children:[s&&Sn("span",{className:"shrink-0 inline-flex items-center text-neutral-400",children:s}),x,Hf("div",{className:"shrink-0 flex items-center gap-1.5 ml-1 text-neutral-400",children:[o&&n&&Sn(Pe,{className:`${p.icon} animate-spin text-current`}),i&&!o&&Sn("button",{type:"button","aria-label":"Clear selection",onClick:k=>{k.stopPropagation(),a?.(k)},className:"hover:text-neutral-600 transition-colors p-0.5 rounded-full hover:bg-neutral-100",children:Sn(Ye,{className:"size-3.5"})}),l,Sn("span",{className:`transition-transform duration-200 ${t?"rotate-180":""}`,"aria-hidden":"true",children:Sn(xt,{className:p.icon})})]})]})}var _a=rx;import{jsx as Vo}from"react/jsx-runtime";function nx({id:e,selectedOption:t,isOpen:r,size:o="md",variant:n="outline",color:i="primary",radius:a="md",placeholder:s="Ch\u1ECDn...",disabled:l=!1,readOnly:m=!1,isInvalid:f=!1,searchable:w=!1,searchPlacement:g="trigger",searchValue:p="",onSearchChange:b,onClear:h,clearable:x=!1,isLoading:S=!1,showSpinner:k=!1,startContent:v,endContent:d,renderValue:u,triggerRef:y,getReferenceProps:c,onKeyDown:T,className:R=""}){let D=ox(null),N=C(o,Nr,"md"),I=C(a,wn,"md"),P=!!f?"error":i,F=n==="other"?"":Cn[n]?.[P]||Cn.outline.primary,z=w&&(g==="trigger"||g==="both"),H=t!=null,V=x&&(H||p.length>0)&&!l&&!m;return Vo(_a,{id:e,isOpen:r,disabled:l,isLoading:S,showSpinner:k,showClear:V,onClear:h,startContent:v,endContent:d,triggerRef:y,getReferenceProps:c,onClick:()=>{!l&&!m&&!S&&z&&D.current?.focus()},roundedClass:I,currentSize:N,variantStyle:F,className:R,children:u&&H&&t?Vo("div",{className:"flex-1 min-w-0 truncate text-neutral-900",children:u(t)}):z&&!l&&!m&&!S?Vo("div",{className:"relative flex-1 min-w-0 flex items-center",children:Vo("input",{ref:D,type:"text","aria-label":"Search",value:p,placeholder:t?t.label:s,onChange:M=>b?.(M.target.value),onKeyDown:T,className:`w-full bg-transparent outline-none border-none p-0 text-neutral-900 ${!p&&t?"placeholder:text-neutral-900 placeholder:font-normal":"placeholder:text-neutral-400"} ${N.input}`})}):Vo("div",{className:"flex-1 min-w-0 truncate",children:t?Vo("span",{className:"text-neutral-900",children:t.label}):Vo("span",{className:"text-neutral-400",children:s})})})}var Tn=nx;import{FloatingPortal as fx}from"@floating-ui/react";import{jsx as kn,jsxs as ac}from"react/jsx-runtime";function ix({option:e,isSelected:t,isActive:r,size:o="md",color:n="primary",radius:i="md",disabled:a=!1,renderOption:s,onClick:l,onMouseEnter:m,ref:f}){let w=C(o,Nr,"md"),g=C(i,wn,"md"),p=a||e.disabled;if(s)return kn("div",{ref:f,role:"option",tabIndex:-1,"aria-selected":t,"aria-disabled":p,"data-active":r,"data-selected":t,"data-value":e.value,className:`cursor-pointer select-none transition-colors duration-100 ${p?"opacity-50 cursor-not-allowed pointer-events-none":""}`,onClick:p?void 0:l,onMouseEnter:p?void 0:m,children:s(e,{selected:t,active:r})});let b=t?C(n,Lf,"primary"):"text-neutral-800 hover:bg-neutral-100",h=r&&!t?C(n,Bf,"primary"):"";return ac("div",{ref:f,role:"option",tabIndex:-1,"aria-selected":t,"aria-disabled":p,"data-active":r,"data-selected":t,"data-value":e.value,className:`group flex items-center justify-between gap-2 select-none cursor-pointer transition-colors duration-100 ${g} ${w.option} ${b} ${h} ${p?"opacity-40 cursor-not-allowed pointer-events-none":""}`,onClick:p?void 0:l,onMouseEnter:p?void 0:m,children:[ac("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.icon&&kn("span",{className:"shrink-0 inline-flex items-center text-neutral-400",children:e.icon}),ac("div",{className:"flex flex-col min-w-0 flex-1",children:[kn("span",{className:"truncate leading-normal font-normal",children:e.label}),e.description&&kn("span",{className:"text-[11px] text-neutral-500 truncate font-normal",children:e.description})]})]}),t&&kn("span",{className:"shrink-0 flex items-center justify-center text-current","aria-hidden":"true",children:kn(Kr,{className:"size-3.5"})})]})}var Xa=ix;import{useState as uc,useRef as ax,useEffect as sx,useMemo as lx}from"react";import{useFloating as Vf,autoUpdate as Af,offset as Of,flip as Gf,shift as jf,useClick as Uf,useDismiss as Yf,useInteractions as Wf,FloatingPortal as Kf}from"@floating-ui/react";function yi(e){let t=new Map;return e.forEach(r=>{t.set(r.value,r)}),t}function sc(e,t,r){return e==null?null:t.find(o=>o.value===e)||r?.get(e)||{value:e,label:String(e)}}function qa(e,t,r){return e.map(o=>t.find(n=>n.value===o)||r?.get(o)||{value:o,label:String(o)})}function lc(e,t){let r=t&&t>0?e.slice(0,t):e,o=t&&t>0?Math.max(0,e.length-t):0;return{visibleTags:r,hiddenTagCount:o}}function cc(e,t){if(t==null||t==="")return"Ch\u01B0a nh\u1EADp";if(t instanceof Date)return t.toLocaleDateString("vi-VN");if(Array.isArray(t)){if(t.length===0)return"Ch\u01B0a ch\u1ECDn";if(e.type==="date-range"||t[0]instanceof Date||t[1]instanceof Date){let n=s=>s?s instanceof Date?s.toLocaleDateString("vi-VN"):String(s):"",i=n(t[0]),a=n(t[1]);return i&&a?`${i} - ${a}`:i||a||"Ch\u01B0a ch\u1ECDn"}let r=n=>{if(e.options&&e.options.length>0){let i=e.options.find(a=>String(a.value)===String(n));if(i)return String(i.label)}return String(n)};return t.length===1?r(t[0]):`${r(t[0])}, +${t.length-1}`}return String(t)}import{Fragment as dx,jsx as lt,jsxs as cr}from"react/jsx-runtime";function cx({field:e,currentValue:t,isOpen:r,onOpenChange:o,onRemove:n,onChange:i,color:a,radius:s}){let{refs:{setFloating:l,setReference:m},floatingStyles:f,context:w}=Vf({open:r,onOpenChange:o,placement:"bottom-start",transform:!1,middleware:[Of(6),Gf(),jf({padding:8})],whileElementsMounted:Af}),{isMounted:g,styles:p}=it(w),b=C(s,vi,"md"),h=Uf(w),x=Yf(w,{outsidePress:c=>!c.target?.closest?.("[data-select-filter-popover]")}),{getReferenceProps:S,getFloatingProps:k}=Wf([h,x]),v=ax(null);sx(()=>{r&&v.current?.focus({preventScroll:!0})},[r]);let d=t!=null&&t!==""&&(!Array.isArray(t)||t.length>0),u=cc(e,t),y=()=>{if(e.type==="custom")return e.render?.({value:t,onChange:c=>i(e.name,c)})??null;switch(e.type){case"string":case"text":return lt(Bt,{ref:v,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Nh\u1EADp t\u1EEB kh\xF3a...",value:t||"",onChange:c=>i(e.name,c.target.value),...e.props||{}});case"number":return lt(yo,{ref:v,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Nh\u1EADp s\u1ED1...",value:t??"",onChange:c=>{let T=c.target.value;if(T==="")i(e.name,"");else{let R=Yr(T);i(e.name,R!==void 0?R:T)}},onClear:()=>i(e.name,""),...e.props||{}});case"date":return lt(Mo,{portal:!1,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Ch\u1ECDn ng\xE0y",value:t,onChange:c=>i(e.name,c),...e.props||{}});case"date-range":return lt(Eo,{portal:!1,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Ch\u1ECDn kho\u1EA3ng ng\xE0y",value:t||[null,null],onChange:c=>i(e.name,c),...e.props||{}});case"checkbox-group":return lt(ko,{size:"sm",color:a,value:t||[],onChange:c=>i(e.name,c),options:(e.options||[]).map(c=>({value:String(c.value),label:c.label,disabled:c.disabled})),className:"max-h-48 overflow-y-auto py-1 gap-2",...e.props||{}});default:return null}};return cr(dx,{children:[lt("div",{ref:m,...S({className:"inline-flex items-center"}),children:cr(Kt,{size:"sm",variant:"soft",color:d||r?a:"neutral",radius:"full",className:`cursor-pointer select-none transition-all duration-150 gap-1 px-3 py-1 rounded-full ${r?"ring-2 ring-primary-500/30":"hover:opacity-90"}`,onDelete:n,deleteAriaLabel:`X\xF3a b\u1ED9 l\u1ECDc ${e.label}`,children:[cr("span",{className:"font-semibold",children:[e.label,":"]}),lt("span",{className:d?"font-medium":"opacity-70 italic",children:u})]})}),g&&lt(Kf,{children:cr("div",{ref:l,"data-select-filter-popover":"true",style:{...f,...p,zIndex:st.SELECT_FILTER},...k({className:`bg-white border border-neutral-200 ${b} p-3 shadow-2xl ${e.type==="date"||e.type==="date-range"?"w-auto min-w-[280px]":"min-w-64 max-w-xs"}`}),children:[cr("div",{className:"flex items-center justify-between pb-2 mb-2 border-b border-neutral-100",children:[lt("span",{className:"text-xs font-bold text-neutral-800",children:e.label}),lt("button",{type:"button",onClick:()=>o(!1),className:"text-neutral-400 hover:text-neutral-600 p-0.5 rounded transition-colors",title:"\u0110\xF3ng",children:lt(Ye,{className:"size-3.5"})})]}),lt("div",{className:"mt-1",children:y()}),cr("div",{className:"flex items-center justify-between mt-3 pt-2 border-t border-neutral-100",children:[lt("button",{type:"button",onClick:n,className:"text-[11px] text-red-500 hover:text-red-700 transition-colors",children:"X\xF3a b\u1ED9 l\u1ECDc"}),lt("button",{type:"button",onClick:()=>o(!1),className:"text-[11px] font-medium text-neutral-700 hover:bg-neutral-100 px-3 py-1 rounded-full border border-neutral-200 transition-colors cursor-pointer",children:"Xong"})]})]})})]})}function ux({filters:e,values:t,onChange:r,onReset:o,showReset:n=!0,resetText:i="\u0110\u1EB7t l\u1EA1i b\u1ED9 l\u1ECDc",color:a="primary",radius:s="full"}){let[l,m]=uc(()=>{let P=[];return e?.forEach(F=>{let z=t?.[F.name]??F.defaultValue;z!=null&&z!==""&&(!Array.isArray(z)||z.length>0)&&P.push(F.name)}),P}),[f,w]=uc(null),[g,p]=uc(!1),{refs:{setFloating:b,setReference:h},floatingStyles:x,context:S}=Vf({open:g,onOpenChange:p,placement:"bottom-start",transform:!1,middleware:[Of(6),Gf(),jf({padding:8})],whileElementsMounted:Af}),{isMounted:k,styles:v}=it(S,{duration:120}),d=Uf(S),u=Yf(S,{outsidePress:P=>!P.target?.closest?.("[data-select-filter-popover]")}),{getReferenceProps:y,getFloatingProps:c}=Wf([d,u]),T=P=>{l.includes(P.name)||m(F=>[...F,P.name]),p(!1),w(P.name)},R=P=>{m(F=>F.filter(z=>z!==P)),f===P&&w(null),r(P,void 0)},D=P=>{P.stopPropagation(),m([]),w(null),o?.()},N=lx(()=>new Set(l),[l]),I=l.length>0,E=C(s,vi,"md");return!e||e.length===0?null:lt("div",{onClick:P=>P.stopPropagation(),onMouseDown:P=>P.stopPropagation(),className:"p-2.5 border-b border-neutral-200 bg-neutral-50/90 rounded-t-lg select-text",children:cr("div",{className:"flex flex-wrap items-center gap-1.5 min-h-7",children:[cr("div",{className:"inline-flex",children:[cr("button",{ref:h,type:"button",...y({className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-neutral-700 hover:text-neutral-900 bg-white border border-neutral-300 hover:border-neutral-400 rounded-full transition-all shadow-xs hover:shadow-sm cursor-pointer active:scale-95"}),children:[lt(yr,{className:"size-3.5 text-neutral-500"}),lt("span",{children:"B\u1ED9 l\u1ECDc"}),lt(xt,{className:`size-3 text-neutral-400 transition-transform ${g?"rotate-180":""}`})]}),k&&lt(Kf,{children:cr("div",{ref:b,"data-select-filter-popover":"true",style:{...x,...v,zIndex:st.SELECT_FILTER},...c({className:`bg-white border border-neutral-200 ${E} p-1 shadow-2xl min-w-44`}),children:[lt("div",{className:"px-2 py-1 text-[11px] font-semibold text-neutral-400 uppercase tracking-wider",children:"Ch\u1ECDn tr\u01B0\u1EDDng c\u1EA7n l\u1ECDc"}),lt("div",{className:"space-y-0.5 mt-0.5",children:e.map(P=>{let F=N.has(P.name);return cr("button",{type:"button",onMouseDown:z=>z.preventDefault(),onClick:z=>{z.preventDefault(),z.stopPropagation(),T(P)},className:`w-full flex items-center justify-between px-2 py-1.5 text-xs rounded text-left transition-colors ${F?"text-primary font-medium bg-primary/5 hover:bg-primary/10":"text-neutral-700 hover:bg-neutral-100"}`,children:[lt("span",{children:P.label}),F&&lt("span",{className:"text-[10px] text-neutral-400",children:"\u0110ang l\u1ECDc"})]},P.name)})})]})})]}),l.map(P=>{let F=e.find(H=>H.name===P);if(!F)return null;let z=t[P]??F.defaultValue;return lt(cx,{field:F,currentValue:z,isOpen:f===P,onOpenChange:H=>w(H?P:null),onRemove:()=>R(P),onChange:r,color:a,radius:s},P)}),n&&o&&I&&cr("button",{type:"button",onClick:D,className:"inline-flex items-center gap-1 text-[11px] text-neutral-500 hover:text-neutral-800 px-2.5 py-1 rounded-full border border-neutral-200 hover:bg-neutral-100 transition-colors ml-auto cursor-pointer",title:"\u0110\u1EB7t l\u1EA1i to\xE0n b\u1ED9 b\u1ED9 l\u1ECDc",children:[lt(_t,{className:"size-3"}),lt("span",{children:i})]})]})})}var Za=ux;import{Fragment as gx,jsx as fo,jsxs as dc}from"react/jsx-runtime";var px={};function mx({isOpen:e,isMounted:t,animated:r=!0,transitionStyles:o,options:n,selectedValues:i,activeIndex:a,size:s="md",color:l="primary",radius:m="md",isLoading:f=!1,portal:w=!0,portalRoot:g,maxMenuHeight:p=280,emptyText:b,emptyProps:h,menuHeader:x,menuFooter:S,listFooter:k,menuFilters:v,menuFilterValues:d=px,menuFilterLayout:u="vertical",menuFilterGridCols:y=2,showResetFilters:c=!0,resetFiltersText:T,onMenuFilterChange:R,onResetFilters:D,renderOption:N,onSelectOption:I,onOptionMouseEnter:E,floatingStyles:P,floatingRef:F,getFloatingProps:z,listElementsRef:H,className:V=""}){let W=Ze(),L=Je();if(!(t!==void 0?t:e))return null;let O=C(m,vi,"md"),A=dc("div",{ref:F,"data-state":e?"open":"closed",style:{...P,...r?o:{},zIndex:st.SELECT},...z({className:`flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden focus:outline-none min-w-[200px] ${O} ${V}`}),children:[x,v&&v.length>0&&R&&fo(Za,{filters:v,values:d,onChange:R,onReset:D,layout:u,gridCols:y,showReset:c,resetText:T,color:l,radius:m}),fo("div",{role:"listbox",tabIndex:-1,style:{maxHeight:typeof p=="number"?`${p}px`:p},className:`p-1 overflow-y-auto overflow-x-hidden space-y-0.5 transition-opacity duration-150 ui-scrollbar ${f?"opacity-75":"opacity-100"}`,children:n.length===0?f?dc("div",{className:"flex items-center justify-center py-6 gap-2 text-zinc-500 text-sm",children:[fo(Pe,{className:"size-4 animate-spin text-current"}),fo("span",{children:"Loading..."})]}):fo("div",{className:"py-4 px-2",children:fo(Ho,{size:"sm",image:"search",description:b||"No data found",className:"py-2",...h})}):dc(gx,{children:[(()=>{let G=new Set(i);return n.map((K,q)=>{let X=G.has(K.value);return fo(Xa,{ref:ae=>{H.current[q]=ae},option:K,isSelected:X,isActive:a===q,size:s,color:l,radius:m,disabled:K.disabled,renderOption:N,onClick:()=>I(K),onMouseEnter:()=>E(q)},String(K.value))})})(),k]})}),S]}),U=g??W?.dialogRef??L?.dialogRef;return w?fo(fx,{root:U,children:A}):A}var Rn=mx;import{useRef as bx}from"react";import{useFloating as hx,autoUpdate as xx,offset as vx,flip as yx,shift as wx,useClick as Cx,useDismiss as Sx,useRole as Tx,useListNavigation as kx,useInteractions as Rx}from"@floating-ui/react";function wi({placement:e="bottom-start",isOpen:t,onOpenChange:r,disabled:o=!1,readOnly:n=!1,isLoading:i=!1,animated:a=!0,animationDuration:s=150,activeIndex:l,onNavigate:m}){let f=bx([]),w=!o&&!n,{refs:g,floatingStyles:p,context:b}=hx({placement:e,open:t&&w,onOpenChange:c=>{w&&(!i||t||!c)&&r(c)},whileElementsMounted:xx,transform:!1,middleware:[vx(4),yx(),wx({padding:8})]}),h=Cx(b,{enabled:w&&(!i||t)}),x=Sx(b,{outsidePress:c=>!c.target?.closest?.("[data-select-filter-popover]")}),S=Tx(b,{role:"listbox"}),k=kx(b,{listRef:f,activeIndex:l,onNavigate:m,loop:!0}),{getReferenceProps:v,getFloatingProps:d}=Rx([h,x,S,k]),{isMounted:u,styles:y}=it(b,{duration:s,animated:a});return{refs:g,floatingStyles:p,transitionStyles:y,isMounted:u,context:b,getReferenceProps:v,getFloatingProps:d,elementsRef:f}}import{useState as _f,useMemo as Dx}from"react";var Nx=[];function Ci({options:e,searchMode:t="client",controlledSearchValue:r,onSearchChange:o,searchField:n=["label","value"],menuFilters:i,controlledFilterValues:a,onMenuFilterChange:s,onSearch:l,debounceMs:m=300,filterFn:f,isOpen:w,setIsOpen:g,preserveSelected:p=!1,selectedValues:b=Nx,historicalOptions:h}){let[x,S]=_f(""),k=r!==void 0,v=k?r:x,[d,u]=_f(()=>{let P={};return i?.forEach(F=>{F.defaultValue!==void 0&&(P[F.name]=F.defaultValue)}),P}),y=a??d,{debounced:c,cancel:T}=So((P,F)=>{t==="server"&&l?.(P,F)},m),R=P=>{k||S(P),o?.(P),w||g(!0),c(P,y)},D=()=>{T(),k||S(""),o?.(""),t==="server"&&l?.("",y)},N=(P,F)=>{let z={...y,[P]:F};a||u(z),s?.(z),c(v,z)},I=()=>{let P={};i?.forEach(F=>{F.defaultValue!==void 0&&(P[F.name]=F.defaultValue)}),a||u(P),s?.(P),c(v,P)},E=Dx(()=>{if(t==="server")return e;let P=e,F=v.trim();if(F?f?P=P.filter(z=>f(z,v,y)):P=vo(P,F,n):f&&(P=P.filter(z=>f(z,v,y))),p&&F&&b.length>0&&h){let z=new Set(P.map(V=>V.value)),H=[];for(let V of b)if(!z.has(V)){let W=h.get(V);W&&H.push(W)}H.length>0&&(P=[...H,...P])}return P},[e,t,v,f,y,n,p,b,h]);return{searchInput:v,handleSearchChange:R,resetSearch:D,currentFilters:y,handleFilterChange:N,handleResetFilters:I,filteredOptions:E}}import{jsx as Si,jsxs as fc}from"react/jsx-runtime";var Ix=[];function Ti({ref:e,options:t=Ix,value:r,defaultValue:o,onChange:n,size:i="md",variant:a="outline",color:s="primary",radius:l="md",id:m,label:f,labelPlacement:w="floating",placeholder:g="Ch\u1ECDn...",helperText:p,errorMessage:b,isDisabled:h=!1,readOnly:x=!1,name:S,searchable:k=!1,searchMode:v="client",searchPlacement:d="trigger",searchPlaceholder:u,searchField:y=["label","value"],searchValue:c,onSearchChange:T,menuFilters:R,menuFilterValues:D,menuFilterLayout:N="vertical",menuFilterGridCols:I=2,showResetFilters:E=!0,resetFiltersText:P,onMenuFilterChange:F,menuHeader:z,menuFooter:H,listFooter:V,onSearch:W,debounceMs:L=300,filterFn:M,emptyText:O,emptyProps:A,portal:U=!0,portalRoot:G,placement:K="bottom-start",maxMenuHeight:q=280,animated:X=!0,animationDuration:fe=150,startContent:ae,endContent:_,renderValue:Z,renderOption:he,config:xe,className:$="",triggerClassName:re="",menuClassName:ee="",labelClassName:de="",helperClassName:ne="",...ze}){let{isRequired:ve=!1,isInvalid:Ce=!1,isLoading:J=!1,showSpinner:j=!1,isClearable:oe=!1,isFullWidth:ye=!0}=xe??{},ue=!!(Ce??!!b),ce=oe,ke=C(i,Nr,"md"),Te=r!==void 0,[pe,Y]=Ja(o??null),me=Te?r??null:pe,[De,ie]=Ja(()=>yi(t)),B=Px(()=>sc(me,t,De),[me,t,De]),[se,Ie]=Ja(!1),[Ae,le]=Ja(null),{searchInput:ge,handleSearchChange:Me,resetSearch:Le,currentFilters:Ve,handleFilterChange:Be,handleResetFilters:je,filteredOptions:ut}=Ci({options:t,searchMode:v,controlledSearchValue:c,onSearchChange:T,searchField:y,menuFilters:R,controlledFilterValues:D,onMenuFilterChange:F,onSearch:W,debounceMs:L,filterFn:M,isOpen:se,setIsOpen:Ie}),{refs:Re,floatingStyles:Xe,transitionStyles:qe,isMounted:at,getReferenceProps:ot,getFloatingProps:vt,elementsRef:Ee}=wi({placement:K,isOpen:se,onOpenChange:Ke=>{Ie(Ke),Ke||(le(null),Le())},disabled:h,readOnly:x,isLoading:J,animated:X,animationDuration:fe,activeIndex:Ae,onNavigate:le}),yt=Xf(Ke=>{Ke.disabled||h||x||(ie(Dt=>{if(Dt.has(Ke.value))return Dt;let Pt=new Map(Dt);return Pt.set(Ke.value,Ke),Pt}),Te||Y(Ke.value),n?.(Ke.value,Ke),Ie(!1),Le())},[h,x,Te,n,Le]),pt=Xf(Ke=>{Ke.stopPropagation(),!(h||x)&&(Te||Y(null),n?.(null,null),Le())},[h,x,Te,n,Le]),mt=Ke=>{if(Ke.key==="Enter"&&se&&Ae!==null){Ke.preventDefault();let Dt=ut[Ae];Dt&&yt(Dt)}else Ke.key==="ArrowDown"&&!se&&Ie(!0)},tt=w==="floating",Rt=w==="left",Oe=zx(),dt=m||Oe,we=`${dt}-trigger`,We=()=>Si(bt,{htmlFor:we,label:f,isRequired:ve,isFloating:tt,size:i,color:s,hasError:ue,cursor:"pointer",className:de});return fc("div",{ref:e,id:m,className:`group/field relative flex ${Rt?"flex-row items-center gap-3":"flex-col"} ${tt&&!!f?"pt-2":""} ${ye?"w-full":"inline-flex"} ${$}`,"data-disabled":h,"data-invalid":ue,...ze,children:[!tt&&We(),fc("div",{className:`flex flex-col ${ye?"w-full":"flex-1 min-w-0"}`,children:[fc("div",{className:"relative w-full",children:[tt&&We(),Si(Tn,{id:we,triggerRef:Re.setReference,getReferenceProps:ot,selectedOption:B,isOpen:se,size:i,variant:a,color:s,radius:l,placeholder:u||g,disabled:h,readOnly:x,isInvalid:ue,searchable:k,searchPlacement:d,searchValue:ge,onSearchChange:Me,onClear:pt,clearable:ce,isLoading:J,showSpinner:j,startContent:ae,endContent:_,renderValue:Z,onKeyDown:mt,className:re}),Si(Rn,{isOpen:se,isMounted:at,animated:X,transitionStyles:qe,options:ut,selectedValues:me!=null?[me]:[],activeIndex:Ae,size:i,color:s,radius:l,isLoading:J,portal:U,portalRoot:G,maxMenuHeight:q,emptyText:O,emptyProps:A,menuHeader:z,menuFooter:H,listFooter:V,menuFilters:R,menuFilterValues:Ve,menuFilterLayout:N,menuFilterGridCols:I,showResetFilters:E,resetFiltersText:P,onMenuFilterChange:Be,onResetFilters:je,renderOption:he,onSelectOption:yt,onOptionMouseEnter:le,floatingRef:Re.setFloating,floatingStyles:Xe,getFloatingProps:vt,listElementsRef:Ee,className:ee})]}),S&&me!==null&&me!==void 0&&Si("input",{type:"hidden",name:S,value:String(me)}),Si(He,{id:`${dt}-helper`,errorMessage:b,helperText:p,sizeClassName:ke.helper,className:ne})]})]})}var qf=Ti;import{useState as es,useMemo as Ex,useCallback as pc,useId as $x}from"react";import{useRef as Fx}from"react";import{jsx as Dn,jsxs as Zf}from"react/jsx-runtime";function Mx({id:e,selectedOptions:t,isOpen:r,size:o="md",variant:n="outline",color:i="primary",radius:a="md",placeholder:s="Ch\u1ECDn...",disabled:l=!1,readOnly:m=!1,isInvalid:f=!1,maxTagCount:w,searchable:g=!1,searchPlacement:p="trigger",searchValue:b="",onSearchChange:h,onRemoveTag:x,onClear:S,clearable:k=!1,isLoading:v=!1,showSpinner:d=!1,startContent:u,endContent:y,renderValue:c,triggerRef:T,getReferenceProps:R,onKeyDown:D,className:N=""}){let I=Fx(null),E=C(o,Nr,"md"),P=C(a,wn,"md"),F=C(a,$f,"md"),H=!!f?"error":i,V=n==="other"?"":Cn[n]?.[H]||Cn.outline.primary,W=g&&(p==="trigger"||p==="both"),L=t.length>0,M=k&&(L||b.length>0)&&!l&&!m,{visibleTags:O,hiddenTagCount:A}=lc(t,w);return Dn(_a,{id:e,isOpen:r,disabled:l,isLoading:v,showSpinner:d,showClear:M,onClear:S,startContent:u,endContent:y,triggerRef:T,getReferenceProps:R,onClick:()=>{!l&&!m&&!v&&W&&I.current?.focus()},roundedClass:P,currentSize:E,variantStyle:V,className:N,children:c&&L?Dn("div",{className:"flex-1 min-w-0 truncate text-neutral-900",children:c(t)}):Zf("div",{className:"flex flex-wrap items-center gap-1 flex-1 min-w-0",children:[O.map(K=>Dn(Kt,{size:E.badgeSize,variant:"soft",color:i,radius:F,onDelete:!l&&!m&&!v&&x?()=>x(K):void 0,className:"max-w-full truncate",children:Dn("span",{className:"truncate",children:K.label})},String(K.value))),A>0&&Zf(Kt,{size:E.badgeSize,variant:"soft",color:"neutral",radius:F,children:["+",A]}),W&&!l&&!m&&!v?Dn("input",{ref:I,type:"text","aria-label":"Search",value:b,placeholder:L?"":s,onChange:K=>h?.(K.target.value),onKeyDown:D,className:`bg-transparent outline-none border-none p-0 flex-1 min-w-15 text-neutral-900 placeholder:text-neutral-400 ${E.input}`}):L?null:Dn("span",{className:"text-neutral-400 truncate",children:s})]})})}var Qa=Mx;import{jsx as ki,jsxs as mc}from"react/jsx-runtime";var Lx=[],Jf=[];function Bx({ref:e,options:t=Lx,value:r,defaultValue:o,onChange:n,size:i="md",variant:a="outline",color:s="primary",radius:l="md",id:m,label:f,labelPlacement:w="floating",placeholder:g="Ch\u1ECDn...",helperText:p,errorMessage:b,isDisabled:h=!1,readOnly:x=!1,name:S,maxTagCount:k,searchable:v=!1,searchMode:d="client",searchPlacement:u="trigger",searchPlaceholder:y,searchField:c=["label","value"],preserveSelected:T=!0,searchValue:R,onSearchChange:D,menuFilters:N,menuFilterValues:I,menuFilterLayout:E="vertical",menuFilterGridCols:P=2,showResetFilters:F=!0,resetFiltersText:z,onMenuFilterChange:H,menuHeader:V,menuFooter:W,listFooter:L,onSearch:M,debounceMs:O=300,filterFn:A,emptyText:U,emptyProps:G,portal:K=!0,portalRoot:q,placement:X="bottom-start",maxMenuHeight:fe=280,animated:ae=!0,animationDuration:_=150,startContent:Z,endContent:he,renderValue:xe,renderOption:$,config:re,className:ee="",triggerClassName:de="",menuClassName:ne="",labelClassName:ze="",helperClassName:ve="",...Ce}){let{isRequired:J=!1,isInvalid:j=!1,isLoading:oe=!1,showSpinner:ye=!1,isClearable:ue=!1,isFullWidth:ce=!0}=re??{},ke=!!(j??!!b),Te=ue,pe=C(i,Nr,"md"),Y=r!==void 0,[me,De]=es(o??Jf),ie=Y?r??Jf:me,[B,se]=es(()=>yi(t)),Ie=Ex(()=>qa(ie,t,B),[ie,t,B]),[Ae,le]=es(!1),[ge,Me]=es(null),{searchInput:Le,handleSearchChange:Ve,resetSearch:Be,currentFilters:je,handleFilterChange:ut,handleResetFilters:Re,filteredOptions:Xe}=Ci({options:t,searchMode:d,controlledSearchValue:R,onSearchChange:D,searchField:c,menuFilters:N,controlledFilterValues:I,onMenuFilterChange:H,onSearch:M,debounceMs:O,filterFn:A,isOpen:Ae,setIsOpen:le,preserveSelected:T,selectedValues:ie,historicalOptions:B}),{refs:qe,floatingStyles:at,transitionStyles:ot,isMounted:vt,getReferenceProps:Ee,getFloatingProps:yt,elementsRef:pt}=wi({placement:X,isOpen:Ae,onOpenChange:Fe=>{le(Fe),Fe||Me(null)},disabled:h,readOnly:x,isLoading:oe,animated:ae,animationDuration:_,activeIndex:ge,onNavigate:Me}),mt=pc(Fe=>{if(Fe.disabled||h||x)return;se(rt=>{if(rt.has(Fe.value))return rt;let te=new Map(rt);return te.set(Fe.value,Fe),te});let Se=ie.includes(Fe.value)?ie.filter(rt=>rt!==Fe.value):[...ie,Fe.value];Y||De(Se);let et=qa(Se,t,B);n?.(Se,et),Be()},[h,x,ie,Y,t,n,Be,B]),tt=pc(Fe=>{if(h||x)return;let be=ie.filter(et=>et!==Fe.value);Y||De(be);let Se=be.map(et=>t.find(rt=>rt.value===et)||B.get(et)||{value:et,label:String(et)});n?.(be,Se)},[h,x,ie,Y,t,n,B]),Rt=pc(Fe=>{Fe.stopPropagation(),!(h||x)&&(Y||De([]),n?.([],[]),Be())},[h,x,Y,n,Be]),Oe=Fe=>{let be=Fe.currentTarget?.value??Le;if(Fe.key==="Backspace"&&(!be||be.length===0)&&Ie.length>0){Fe.preventDefault();let Se=Ie[Ie.length-1];Se&&tt(Se)}else if(Fe.key==="Enter"&&Ae&&ge!==null){Fe.preventDefault();let Se=Xe[ge];Se&&mt(Se)}else Fe.key==="ArrowDown"&&!Ae&&le(!0)},dt=w==="floating",we=dt&&!!f,We=w==="left",wt=$x(),Ke=m||wt,Dt=`${Ke}-trigger`,Pt=()=>ki(bt,{htmlFor:Dt,label:f,isRequired:J,isFloating:dt,size:i,color:s,hasError:ke,cursor:"pointer",className:ze});return mc("div",{ref:e,id:m,className:`group/field relative flex ${We?"flex-row items-center gap-3":"flex-col"} ${we?"pt-2":""} ${ce?"w-full":"inline-flex"} ${ee}`,"data-disabled":h,"data-invalid":ke,...Ce,children:[!dt&&Pt(),mc("div",{className:`flex flex-col ${ce?"w-full":"flex-1 min-w-0"}`,children:[mc("div",{className:"relative w-full",children:[dt&&Pt(),ki(Qa,{id:Dt,triggerRef:qe.setReference,getReferenceProps:Ee,selectedOptions:Ie,isOpen:Ae,size:i,variant:a,color:s,radius:l,placeholder:y||g,disabled:h,readOnly:x,isInvalid:ke,maxTagCount:k,searchable:v,searchPlacement:u,searchValue:Le,onSearchChange:Ve,onRemoveTag:tt,onClear:Rt,clearable:Te,isLoading:oe,showSpinner:ye,startContent:Z,endContent:he,renderValue:xe,onKeyDown:Oe,className:de}),ki(Rn,{isOpen:Ae,isMounted:vt,animated:ae,transitionStyles:ot,options:Xe,selectedValues:ie,activeIndex:ge,size:i,color:s,radius:l,isLoading:oe,portal:K,portalRoot:q,maxMenuHeight:fe,emptyText:U,emptyProps:G,menuHeader:V,menuFooter:W,listFooter:L,menuFilters:N,menuFilterValues:je,menuFilterLayout:E,menuFilterGridCols:P,showResetFilters:F,resetFiltersText:z,onMenuFilterChange:ut,onResetFilters:Re,renderOption:$,onSelectOption:mt,onOptionMouseEnter:Me,floatingRef:qe.setFloating,floatingStyles:at,getFloatingProps:yt,listElementsRef:pt,className:ne})]}),S&&ie.map((Fe,be)=>ki("input",{type:"hidden",name:`${S}[]`,value:String(Fe)},`${S}-${Fe}-${be}`)),ki(He,{id:`${Ke}-helper`,errorMessage:b,helperText:p,sizeClassName:pe.helper,className:ve})]})]})}var Qf=Bx;import{useId as nv,useMemo as b0,useState as gs}from"react";import{useDropzone as iv}from"react-dropzone";var ts={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},e0={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",neutral:"text-neutral-600 group-focus-within/field:text-neutral-800",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600"},t0={xs:"h-28",sm:"h-36",md:"h-48",lg:"h-60",xl:"h-72"},Nn={xs:{dropzoneHeight:"min-h-[80px]",dropzonePadding:"p-3",avatarSize:"size-12",thumbnailSize:"size-12",iconSize:24,titleSize:"text-[11px]",descSize:"text-[10px]",labelSize:"text-[11px] mb-1",helperSize:"text-[9px] mt-0.5",gap:"gap-1.5"},sm:{dropzoneHeight:"min-h-[100px]",dropzonePadding:"p-4",avatarSize:"size-16",thumbnailSize:"size-16",iconSize:32,titleSize:"text-xs",descSize:"text-[11px]",labelSize:"text-xs mb-1",helperSize:"text-[10px] mt-0.5",gap:"gap-2"},md:{dropzoneHeight:"min-h-[130px]",dropzonePadding:"p-5",avatarSize:"size-24",thumbnailSize:"size-20",iconSize:44,titleSize:"text-sm",descSize:"text-xs",labelSize:"text-sm mb-1.5",helperSize:"text-[11px] mt-1",gap:"gap-3"},lg:{dropzoneHeight:"min-h-[160px]",dropzonePadding:"p-6",avatarSize:"size-28",thumbnailSize:"size-24",iconSize:54,titleSize:"text-base",descSize:"text-xs",labelSize:"text-base mb-1.5",helperSize:"text-xs mt-1",gap:"gap-3.5"},xl:{dropzoneHeight:"min-h-[200px]",dropzonePadding:"p-8",avatarSize:"size-36",thumbnailSize:"size-28",iconSize:64,titleSize:"text-lg",descSize:"text-sm",labelSize:"text-lg mb-2",helperSize:"text-sm mt-1",gap:"gap-4"}},r0={outline:{primary:{idle:"bg-neutral-white border-primary-400 hover:border-primary-500 text-neutral-700",active:"bg-primary-50/50 border-primary-500 ring-2 ring-primary-500/20 text-primary-900",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600"},secondary:{idle:"bg-neutral-white border-secondary-400 hover:border-secondary-500 text-neutral-700",active:"bg-secondary-50/50 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-900",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600"},neutral:{idle:"bg-neutral-white border-neutral-300 hover:border-neutral-400 text-neutral-700",active:"bg-neutral-100/70 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-900"},error:{idle:"bg-neutral-white border-error-500 hover:border-error-600 text-neutral-700",active:"bg-error-50/50 border-error-500 ring-2 ring-error-500/20 text-error-900",iconColor:"text-error-500",titleHover:"group-hover:text-error-600"},success:{idle:"bg-neutral-white border-success-400 hover:border-success-500 text-neutral-700",active:"bg-success-50/50 border-success-500 ring-2 ring-success-500/20 text-success-900",iconColor:"text-success-500",titleHover:"group-hover:text-success-600"},warning:{idle:"bg-neutral-white border-warning-400 hover:border-warning-500 text-neutral-700",active:"bg-warning-50/50 border-warning-500 ring-2 ring-warning-500/20 text-warning-900",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600"},info:{idle:"bg-neutral-white border-info-400 hover:border-info-500 text-neutral-700",active:"bg-info-50/50 border-info-500 ring-2 ring-info-500/20 text-info-900",iconColor:"text-info-500",titleHover:"group-hover:text-info-600"}},filled:{primary:{idle:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 hover:border-primary-400 text-primary-900",active:"bg-primary-100 border-primary-500 ring-2 ring-primary-500/20 text-primary-950",iconColor:"text-primary-600",titleHover:"group-hover:text-primary-700"},secondary:{idle:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 hover:border-secondary-400 text-secondary-900",active:"bg-secondary-100 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-950",iconColor:"text-secondary-600",titleHover:"group-hover:text-secondary-700"},neutral:{idle:"bg-neutral-100/70 border-neutral-200 hover:bg-neutral-200/70 hover:border-neutral-400 text-neutral-800",active:"bg-neutral-200 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-600",titleHover:"group-hover:text-neutral-950"},error:{idle:"bg-error-50/60 border-error-200 hover:bg-error-100/60 hover:border-error-400 text-error-900",active:"bg-error-100 border-error-500 ring-2 ring-error-500/20 text-error-950",iconColor:"text-error-600",titleHover:"group-hover:text-error-700"},success:{idle:"bg-success-50/60 border-success-200 hover:bg-success-100/60 hover:border-success-400 text-success-900",active:"bg-success-100 border-success-500 ring-2 ring-success-500/20 text-success-950",iconColor:"text-success-600",titleHover:"group-hover:text-success-700"},warning:{idle:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 hover:border-warning-400 text-warning-900",active:"bg-warning-100 border-warning-500 ring-2 ring-warning-500/20 text-warning-950",iconColor:"text-warning-600",titleHover:"group-hover:text-warning-700"},info:{idle:"bg-info-50/60 border-info-200 hover:bg-info-100/60 hover:border-info-400 text-info-900",active:"bg-info-100 border-info-500 ring-2 ring-info-500/20 text-info-950",iconColor:"text-info-600",titleHover:"group-hover:text-info-700"}},ghost:{primary:{idle:"bg-transparent border-transparent hover:bg-primary-50/60 hover:border-primary-300 text-neutral-700",active:"bg-primary-50 border-primary-500 ring-2 ring-primary-500/20 text-primary-900",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600"},secondary:{idle:"bg-transparent border-transparent hover:bg-secondary-50/60 hover:border-secondary-300 text-neutral-700",active:"bg-secondary-50 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-900",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600"},neutral:{idle:"bg-transparent border-transparent hover:bg-neutral-100 hover:border-neutral-300 text-neutral-700",active:"bg-neutral-100 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-900"},error:{idle:"bg-transparent border-transparent hover:bg-error-50/60 hover:border-error-300 text-neutral-700",active:"bg-error-50 border-error-500 ring-2 ring-error-500/20 text-error-900",iconColor:"text-error-500",titleHover:"group-hover:text-error-600"},success:{idle:"bg-transparent border-transparent hover:bg-success-50/60 hover:border-success-300 text-neutral-700",active:"bg-success-50 border-success-500 ring-2 ring-success-500/20 text-success-900",iconColor:"text-success-500",titleHover:"group-hover:text-success-600"},warning:{idle:"bg-transparent border-transparent hover:bg-warning-50/60 hover:border-warning-300 text-neutral-700",active:"bg-warning-50 border-warning-500 ring-2 ring-warning-500/20 text-warning-900",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600"},info:{idle:"bg-transparent border-transparent hover:bg-info-50/60 hover:border-info-300 text-neutral-700",active:"bg-info-50 border-info-500 ring-2 ring-info-500/20 text-info-900",iconColor:"text-info-500",titleHover:"group-hover:text-info-600"}}};function Pr(e,t=1){if(!e||!+e)return"0 B";let r=1024,o=t<0?0:t,n=["B","KB","MB","GB","TB"],i=Math.floor(Math.log(e)/Math.log(r));return`${parseFloat((e/Math.pow(r,i)).toFixed(o))} ${n[i]}`}function Ao(e){return e?Array.isArray(e)?e.filter(t=>!!t):[e]:[]}var rs={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},o0={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",neutral:"text-neutral-600 group-focus-within/field:text-neutral-800",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600"},n0={xs:"h-28",sm:"h-36",md:"h-48",lg:"h-60",xl:"h-72"},zr={xs:{dropzoneHeight:"min-h-[80px]",dropzoneMinHeight:"min-h-[80px]",dropzonePadding:"p-3",compactMinHeight:"min-h-[40px]",compactPadding:"px-3 py-2",thumbnailSize:"w-28 h-20",iconSize:24,fileIconSize:28,titleSize:"text-[11px]",descSize:"text-[10px]",fileNameSize:"text-xs",fileMetaSize:"text-[10px]",labelSize:"text-[11px] mb-1",helperSize:"text-[9px] mt-0.5",buttonSize:"xs",actionButtonPadding:"p-1",gap:"gap-1.5",itemPadding:"px-2.5 py-1.5"},sm:{dropzoneHeight:"min-h-[100px]",dropzoneMinHeight:"min-h-[100px]",dropzonePadding:"p-4",compactMinHeight:"min-h-[48px]",compactPadding:"px-3.5 py-2.5",thumbnailSize:"w-32 h-24",iconSize:32,fileIconSize:34,titleSize:"text-xs",descSize:"text-[11px]",fileNameSize:"text-xs font-medium",fileMetaSize:"text-[11px]",labelSize:"text-xs mb-1",helperSize:"text-[10px] mt-0.5",buttonSize:"sm",actionButtonPadding:"p-1.5",gap:"gap-2",itemPadding:"px-3 py-2"},md:{dropzoneHeight:"min-h-[130px]",dropzoneMinHeight:"min-h-[130px]",dropzonePadding:"p-5",compactMinHeight:"min-h-[56px]",compactPadding:"px-4 py-3",thumbnailSize:"w-40 h-28",iconSize:42,fileIconSize:40,titleSize:"text-sm",descSize:"text-xs",fileNameSize:"text-sm font-medium",fileMetaSize:"text-xs",labelSize:"text-sm mb-1.5",helperSize:"text-[11px] mt-1",buttonSize:"md",actionButtonPadding:"p-1.5",gap:"gap-2.5",itemPadding:"px-3.5 py-2.5"},lg:{dropzoneHeight:"min-h-[160px]",dropzoneMinHeight:"min-h-[160px]",dropzonePadding:"p-6",compactMinHeight:"min-h-[64px]",compactPadding:"px-5 py-3.5",thumbnailSize:"w-48 h-32",iconSize:52,fileIconSize:48,titleSize:"text-base",descSize:"text-xs",fileNameSize:"text-base font-medium",fileMetaSize:"text-xs",labelSize:"text-base mb-1.5",helperSize:"text-xs mt-1",buttonSize:"lg",actionButtonPadding:"p-2",gap:"gap-3",itemPadding:"px-4 py-3"},xl:{dropzoneHeight:"min-h-[200px]",dropzoneMinHeight:"min-h-[200px]",dropzonePadding:"p-8",compactMinHeight:"min-h-[72px]",compactPadding:"px-6 py-4",thumbnailSize:"w-56 h-36",iconSize:64,fileIconSize:56,titleSize:"text-lg",descSize:"text-sm",fileNameSize:"text-lg font-medium",fileMetaSize:"text-sm",labelSize:"text-lg mb-2",helperSize:"text-sm mt-1",buttonSize:"xl",actionButtonPadding:"p-2.5",gap:"gap-3.5",itemPadding:"px-5 py-3.5"}},i0={outline:{primary:{idle:"bg-neutral-white border-primary-400 hover:border-primary-500 text-neutral-700",active:"bg-primary-50/50 border-primary-500 ring-2 ring-primary-500/20 text-primary-900",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600",itemBg:"bg-white hover:bg-neutral-50/80",itemBorder:"border-neutral-200 hover:border-primary-300"},secondary:{idle:"bg-neutral-white border-secondary-400 hover:border-secondary-500 text-neutral-700",active:"bg-secondary-50/50 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-900",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600",itemBg:"bg-white hover:bg-neutral-50/80",itemBorder:"border-neutral-200 hover:border-secondary-300"},neutral:{idle:"bg-neutral-white border-neutral-300 hover:border-neutral-400 text-neutral-700",active:"bg-neutral-100/70 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-900",itemBg:"bg-white hover:bg-neutral-50/80",itemBorder:"border-neutral-200 hover:border-neutral-400"},error:{idle:"bg-neutral-white border-error-500 hover:border-error-600 text-neutral-700",active:"bg-error-50/50 border-error-500 ring-2 ring-error-500/20 text-error-900",iconColor:"text-error-500",titleHover:"group-hover:text-error-600",itemBg:"bg-white hover:bg-error-50/30",itemBorder:"border-error-200 hover:border-error-300"},success:{idle:"bg-neutral-white border-success-400 hover:border-success-500 text-neutral-700",active:"bg-success-50/50 border-success-500 ring-2 ring-success-500/20 text-success-900",iconColor:"text-success-500",titleHover:"group-hover:text-success-600",itemBg:"bg-white hover:bg-success-50/30",itemBorder:"border-success-200 hover:border-success-300"},warning:{idle:"bg-neutral-white border-warning-400 hover:border-warning-500 text-neutral-700",active:"bg-warning-50/50 border-warning-500 ring-2 ring-warning-500/20 text-warning-900",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600",itemBg:"bg-white hover:bg-warning-50/30",itemBorder:"border-warning-200 hover:border-warning-300"},info:{idle:"bg-neutral-white border-info-400 hover:border-info-500 text-neutral-700",active:"bg-info-50/50 border-info-500 ring-2 ring-info-500/20 text-info-900",iconColor:"text-info-500",titleHover:"group-hover:text-info-600",itemBg:"bg-white hover:bg-info-50/30",itemBorder:"border-info-200 hover:border-info-300"}},filled:{primary:{idle:"border-transparent bg-primary-50/60 hover:bg-primary-100/60",active:"border-primary-500 bg-primary-100 ring-2 ring-primary-500/20",iconColor:"text-primary-600",titleHover:"group-hover:text-primary-700",itemBg:"bg-primary-50/40 hover:bg-primary-50/80",itemBorder:"border-primary-100 hover:border-primary-200"},secondary:{idle:"border-transparent bg-secondary-50/60 hover:bg-secondary-100/60",active:"border-secondary-500 bg-secondary-100 ring-2 ring-secondary-500/20",iconColor:"text-secondary-600",titleHover:"group-hover:text-secondary-700",itemBg:"bg-secondary-50/40 hover:bg-secondary-50/80",itemBorder:"border-secondary-100 hover:border-secondary-200"},neutral:{idle:"border-transparent bg-neutral-100/70 hover:bg-neutral-200/50",active:"border-neutral-400 bg-neutral-200 ring-2 ring-neutral-400/20",iconColor:"text-neutral-600",titleHover:"group-hover:text-neutral-800",itemBg:"bg-neutral-100/50 hover:bg-neutral-100",itemBorder:"border-neutral-200 hover:border-neutral-300"},error:{idle:"border-transparent bg-error-50/70 hover:bg-error-100/70",active:"border-error-500 bg-error-100 ring-2 ring-error-500/20",iconColor:"text-error-600",titleHover:"group-hover:text-error-700",itemBg:"bg-error-50/40 hover:bg-error-50/80",itemBorder:"border-error-100 hover:border-error-200"},success:{idle:"border-transparent bg-success-50/70 hover:bg-success-100/70",active:"border-success-500 bg-success-100 ring-2 ring-success-500/20",iconColor:"text-success-600",titleHover:"group-hover:text-success-700",itemBg:"bg-success-50/40 hover:bg-success-50/80",itemBorder:"border-success-100 hover:border-success-200"},warning:{idle:"border-transparent bg-warning-50/70 hover:bg-warning-100/70",active:"border-warning-500 bg-warning-100 ring-2 ring-warning-500/20",iconColor:"text-warning-600",titleHover:"group-hover:text-warning-700",itemBg:"bg-warning-50/40 hover:bg-warning-50/80",itemBorder:"border-warning-100 hover:border-warning-200"},info:{idle:"border-transparent bg-info-50/70 hover:bg-info-100/70",active:"border-info-500 bg-info-100 ring-2 ring-info-500/20",iconColor:"text-info-600",titleHover:"group-hover:text-info-700",itemBg:"bg-info-50/40 hover:bg-info-50/80",itemBorder:"border-info-100 hover:border-info-200"}},ghost:{primary:{idle:"border-transparent bg-transparent hover:bg-primary-50/30",active:"border-primary-400 bg-primary-50/40 ring-2 ring-primary-400/20",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600",itemBg:"bg-transparent hover:bg-primary-50/20",itemBorder:"border-transparent hover:border-primary-200"},secondary:{idle:"border-transparent bg-transparent hover:bg-secondary-50/30",active:"border-secondary-400 bg-secondary-50/40 ring-2 ring-secondary-400/20",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600",itemBg:"bg-transparent hover:bg-secondary-50/20",itemBorder:"border-transparent hover:border-secondary-200"},neutral:{idle:"border-transparent bg-transparent hover:bg-neutral-100/40",active:"border-neutral-400 bg-neutral-100/50 ring-2 ring-neutral-400/20",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-800",itemBg:"bg-transparent hover:bg-neutral-100/40",itemBorder:"border-transparent hover:border-neutral-300"},error:{idle:"border-transparent bg-transparent hover:bg-error-50/30",active:"border-error-400 bg-error-50/40 ring-2 ring-error-400/20",iconColor:"text-error-500",titleHover:"group-hover:text-error-600",itemBg:"bg-transparent hover:bg-error-50/20",itemBorder:"border-transparent hover:border-error-200"},success:{idle:"border-transparent bg-transparent hover:bg-success-50/30",active:"border-success-400 bg-success-50/40 ring-2 ring-success-400/20",iconColor:"text-success-500",titleHover:"group-hover:text-success-600",itemBg:"bg-transparent hover:bg-success-50/20",itemBorder:"border-transparent hover:border-success-200"},warning:{idle:"border-transparent bg-transparent hover:bg-warning-50/30",active:"border-warning-400 bg-warning-50/40 ring-2 ring-warning-400/20",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600",itemBg:"bg-transparent hover:bg-warning-50/20",itemBorder:"border-transparent hover:border-warning-200"},info:{idle:"border-transparent bg-transparent hover:bg-info-50/30",active:"border-info-400 bg-info-50/40 ring-2 ring-info-400/20",iconColor:"text-info-500",titleHover:"group-hover:text-info-600",itemBg:"bg-transparent hover:bg-info-50/20",itemBorder:"border-transparent hover:border-info-200"}}},a0={pdf:["pdf"],word:["doc","docx","dot","dotx","odt","rtf"],excel:["xls","xlsx","xlsm","xlsb","csv","ods"],powerpoint:["ppt","pptx","pot","potx","pps","ppsx","odp"],archive:["zip","rar","7z","tar","gz","bz2","xz","iso"],text:["txt","md","markdown","log"],image:["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","avif"],audio:["mp3","wav","ogg","aac","flac","m4a","wma"],video:["mp4","webm","mov","avi","mkv","wmv","flv"],code:["js","jsx","ts","tsx","html","css","scss","json","py","java","c","cpp","cs","go","rs","php","sql","sh","yaml","yml","xml"],other:[]},s0={pdf:{label:"PDF",bg:"bg-error-50",text:"text-error-700",border:"border-error-200"},word:{label:"DOC",bg:"bg-primary-50",text:"text-primary-700",border:"border-primary-200"},excel:{label:"XLS",bg:"bg-success-50",text:"text-success-700",border:"border-success-200"},powerpoint:{label:"PPT",bg:"bg-secondary-50",text:"text-secondary-700",border:"border-secondary-200"},archive:{label:"ZIP",bg:"bg-warning-50",text:"text-warning-800",border:"border-warning-200"},text:{label:"TXT",bg:"bg-neutral-100",text:"text-neutral-700",border:"border-neutral-200"},image:{label:"IMG",bg:"bg-emerald-50",text:"text-emerald-700",border:"border-emerald-200"},audio:{label:"AUD",bg:"bg-purple-50",text:"text-purple-700",border:"border-purple-200"},video:{label:"VID",bg:"bg-cyan-50",text:"text-cyan-700",border:"border-cyan-200"},code:{label:"DEV",bg:"bg-slate-100",text:"text-slate-700",border:"border-slate-200"},other:{label:"FILE",bg:"bg-neutral-100",text:"text-neutral-600",border:"border-neutral-200"}};var os=["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","avif"],ns=["pdf"],is=["mp4","webm","ogg","mov","avi","mkv"],as=["mp3","wav","ogg","aac","flac","m4a"],ss=["doc","docx","xls","xlsx","ppt","pptx","txt","csv"];function Ct(e){if(!e)return"";if(typeof e=="object"&&!(e instanceof Blob))return e.name?e.name:e.src?Ct(e.src):"";if(e instanceof File)return e.name||"";if(typeof e=="string"){let t=e.split("?")[0]?.split("#")[0]||"",r=t.split("/").pop()||t.split("\\").pop()||"",o=r.lastIndexOf(".");return o<=0?r:r.slice(0,o)}return""}function Ri(e=""){let t=e.split("?")[0]?.split("#")[0]||"",r=t.lastIndexOf(".");return r===-1?"":t.slice(r+1).toLowerCase()}function Pn(e=""){let t=Ri(e);return os.includes(t)?"image":ns.includes(t)?"pdf":is.includes(t)?"video":as.includes(t)?"audio":ss.includes(t)?"document":"other"}function gc(e){return!e||typeof e!="object"||e instanceof Blob||"height"in e&&"width"in e&&typeof e.height=="number"?!1:"src"in e||"name"in e||"id"in e}function Vr(e){if(!e)return{name:"file",type:"other",file:void 0,serverFile:void 0};if(typeof e=="string"){let o=Ct(e)||"file";return{name:o,type:Pn(e),file:void 0,serverFile:{src:e,name:o}}}if(e instanceof File)return{name:Ct(e.name),type:Pn(e.name),file:e,serverFile:void 0};let t=e.name??Ct(e?.src),r="other";return e?.src?.startsWith("data:image/")?r="image":e?.src?.startsWith("data:video/")?r="video":e?.src?.startsWith("data:audio/")?r="audio":e?.src?.startsWith("data:application/pdf")?r="pdf":e?.name&&(r=Pn(e.name)),r==="other"&&e?.src&&(r=Pn(e.src)),{name:t,type:r,file:void 0,serverFile:e}}function Ir(e,t){if(!e)return;let r=document.createElement("a");r.href=e;let o=e.split("?")[0]?.split("#")[0]||"",n=o.split("/").pop()||o.split("\\").pop()||"download";r.download=t||n,r.style.display="none",document.body.appendChild(r),r.click(),setTimeout(()=>{try{document.body.removeChild(r)}catch{}},100)}function bc(e){if(e){if(e instanceof File)return e.size;if(typeof e=="object"&&e!==null&&"size"in e){let t=e.size;if(typeof t=="number")return t}}}function hc(e){if(!e||typeof e!="object"||e instanceof File)return{status:"idle"};let t=e,r=typeof t.status=="string"?t.status:void 0,o=typeof t.progress=="number"?t.progress:void 0,n=typeof t.error=="string"?t.error:void 0,i="idle";return r==="uploading"||o!==void 0&&o>=0&&o<100?i="uploading":r==="error"||n?i="error":(r==="success"||r==="done"||o!==void 0&&o>=100)&&(i="success"),{status:i,progress:o,error:n}}function ls(e){if(!e)return"other";let t="",r="";typeof e=="string"?t=e:e instanceof File?(t=e.name,r=e.type):typeof e=="object"&&(t=e.name||(typeof e.src=="string"?e.src:""),typeof e.type=="string"&&(r=e.type));let o=Ri(t);if(o){for(let[n,i]of Object.entries(a0))if(i.includes(o))return n}if(r){if(r==="application/pdf")return"pdf";if(r.startsWith("image/"))return"image";if(r.startsWith("audio/"))return"audio";if(r.startsWith("video/"))return"video";if(r.includes("word")||r.includes("document")||r==="application/msword")return"word";if(r.includes("excel")||r.includes("spreadsheet")||r==="text/csv")return"excel";if(r.includes("presentation")||r.includes("powerpoint"))return"powerpoint";if(r.includes("zip")||r.includes("compressed")||r.includes("archive")||r==="application/x-tar")return"archive";if(r.startsWith("text/"))return"text"}return"other"}function l0(e,t){return typeof e=="object"&&e&&"id"in e&&e.id!=null?String(e.id):e instanceof File?`${e.name}-${e.size}-${e.lastModified}-${t}`:typeof e=="string"?`${e}-${t}`:`${Ct(e)}-${t}`}function Di(e){if(!e)return;if(typeof e=="object")return e;let t={},r=e.split(",").map(n=>n.trim()).filter(Boolean),o={".pdf":"application/pdf",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".csv":"text/csv",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".zip":"application/zip",".rar":"application/vnd.rar",".7z":"application/x-7z-compressed",".tar":"application/x-tar",".gz":"application/gzip",".txt":"text/plain",".json":"application/json",".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".webp":"image/webp",".gif":"image/gif",".svg":"image/svg+xml",".mp3":"audio/mpeg",".wav":"audio/wav",".mp4":"video/mp4"};for(let n of r)if(n.startsWith(".")){let i=n.toLowerCase(),a=o[i]||"application/octet-stream";t[a]=[...t[a]||[],i]}else t[n]||(t[n]=[]);return t}import{useEffect as Gx,useState as jx}from"react";import{createContext as Hx,useContext as Vx}from"react";var xc=Hx(null),cs=()=>Vx(xc);import{useState as us}from"react";import Ax from"react-easy-crop";import{jsx as Vt,jsxs as c0}from"react/jsx-runtime";function Ni({zoom:e=1,minZoom:t=.2,maxZoom:r=5,step:o=.05,onZoomChange:n,sliderProps:i,onZoomIn:a,onZoomOut:s,onRotateCw:l,onRotateCcw:m,onFlipHorizontal:f,onReset:w,currentImage:g,tools:p,className:b=""}){let{zoomIn:h=!0,zoomOut:x=!0,zoomSlider:S=!0,reset:k=!0,rotate:v=!0,flip:d=!0,download:u=!0}=p??{},y=Math.round(e*100),c=()=>{g?.src&&Ir(g.src,g.name)},T=D=>{if(typeof D=="number"){let N=Math.round(D*100)/100;n?.(N)}},R="p-2 rounded-full text-neutral-600 hover:text-neutral-900 hover:bg-neutral-100 active:scale-95 transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-500 cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed disabled:hover:bg-transparent";return c0("div",{"data-testid":"image-preview-toolbar",className:`inline-flex items-center gap-1 bg-neutral-white border border-neutral-200 rounded-full px-3 py-1.5 shadow-sm text-neutral-700 select-none pointer-events-auto ${b}`,children:[x&&Vt("button",{type:"button","aria-label":"Thu nh\u1ECF",title:"Thu nh\u1ECF (-)",disabled:e<=t,onClick:s,className:R,children:Vt(on,{width:18,height:18})}),S&&Vt("div",{className:"flex items-center px-1","data-testid":"image-preview-zoom-slider",children:Vt(Xn,{value:e,min:t,max:r,step:o,size:"sm",color:"primary",config:{isFullWidth:!1},className:"w-20 sm:w-28",disabled:!n&&!i?.onChange,onChange:T,"aria-label":"Thanh tr\u01B0\u1EE3t thu ph\xF3ng",...i})}),h&&Vt("button",{type:"button","aria-label":"Ph\xF3ng to",title:"Ph\xF3ng to (+)",disabled:e>=r,onClick:a,className:R,children:Vt(rn,{width:18,height:18})}),k&&c0("button",{type:"button","aria-label":"\u0110\u1EB7t l\u1EA1i k\xEDch th\u01B0\u1EDBc v\xE0 g\xF3c xoay",title:"\u0110\u1EB7t l\u1EA1i (1:1)",onClick:w,className:"px-2 py-1 text-xs font-semibold text-neutral-700 hover:text-neutral-900 hover:bg-neutral-100 rounded-full transition-colors cursor-pointer",children:[y,"%"]}),(v||d||u)&&Vt("div",{className:"w-px h-4 bg-neutral-200 my-auto mx-1"}),v&&Vt("button",{type:"button","aria-label":"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",title:"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",onClick:m,className:R,children:Vt(nn,{width:18,height:18})}),v&&Vt("button",{type:"button","aria-label":"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",title:"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3 (r)",onClick:l,className:R,children:Vt(Zr,{width:18,height:18})}),d&&Vt("button",{type:"button","aria-label":"L\u1EADt ngang",title:"L\u1EADt ngang",onClick:f,className:R,children:Vt(sn,{width:18,height:18})}),u&&Vt("button",{type:"button","aria-label":"T\u1EA3i \u1EA3nh xu\u1ED1ng",title:"T\u1EA3i \u1EA3nh xu\u1ED1ng",onClick:c,className:R,children:Vt(Sr,{width:18,height:18})})]})}import{jsx as ds,jsxs as Ox}from"react/jsx-runtime";function Pi({src:e,name:t,minZoom:r=.2,maxZoom:o=5,showToolbar:n=!0,toolbarProps:i,children:a}){let[s,l]=us({x:0,y:0}),[m,f]=us(1),[w,g]=us(0),[p,b]=us(!1),h=()=>f(y=>Math.min(o,Math.round((y+.25)*100)/100)),x=()=>f(y=>Math.max(r,Math.round((y-.25)*100)/100)),S=()=>g(y=>(y+90)%360),k=()=>g(y=>(y-90+360)%360),v=()=>b(y=>!y),d=()=>{l({x:0,y:0}),f(1),g(0),b(!1)},u={src:e,name:t};return e?Ox("div",{className:"flex flex-col w-full select-none overflow-hidden",children:[ds("div",{className:"relative w-full h-90 sm:h-105 md:h-115 overflow-hidden bg-neutral-50/70 select-none",children:ds(Ax,{image:e,crop:s,zoom:m,rotation:w,minZoom:r,maxZoom:o,zoomSpeed:.5,restrictPosition:!1,showGrid:!1,objectFit:"contain",onCropChange:l,onZoomChange:f,onRotationChange:g,classes:{mediaClassName:p?"scale-x-[-1]":""},style:{containerStyle:{position:"relative",width:"100%",height:"100%",backgroundColor:"transparent"},cropAreaStyle:{display:"none"},mediaStyle:{cursor:"grab"}}})}),n&&ds("div",{className:"w-full flex items-center justify-center py-2.5 sm:py-3 border-t border-neutral-200 bg-neutral-white z-20 overflow-x-auto ui-scrollbar px-2 shrink-0",children:ds(Ni,{zoom:m,minZoom:r,maxZoom:o,onZoomChange:f,rotation:w,isFlipped:p,onZoomIn:h,onZoomOut:x,onRotateCw:S,onRotateCcw:k,onFlipHorizontal:v,onReset:d,currentImage:u,...i})}),a]}):null}import{jsx as Oo,jsxs as u0}from"react/jsx-runtime";function Ar({onDownload:e,imageProps:t,className:r=""}){let o=cs(),n=o?.file,i=o?.headerTitle,[a,s]=jx("");Gx(()=>{if(!n){s("");return}if(!(n instanceof File)){let g=Vr(n);s(g.serverFile?.src||"");return}let w=URL.createObjectURL(n);return s(w),()=>{URL.revokeObjectURL(w)}},[n]);let l=Vr(n),m=(typeof i=="string"?i:"")||l.name||"file",f=()=>{e&&n&&e(n),a&&Ir(a,m)};return l.type==="image"?Oo(Pi,{src:a,name:m,...t}):u0("div",{className:`p-6 text-center ${r}`,children:[Oo("div",{className:"w-16 h-16 rounded-2xl bg-neutral-100 flex items-center justify-center mx-auto mb-4 text-primary-600",children:Oo(Sr,{width:32,height:32})}),Oo("h3",{className:"text-lg font-semibold text-neutral-900 truncate mb-1",title:m,children:i??m}),Oo("p",{className:"text-sm text-neutral-500 mb-6",children:"\u0110\u1ECBnh d\u1EA1ng file ch\u01B0a h\u1ED7 tr\u1EE3 xem tr\u1EF1c ti\u1EBFp. B\u1EA1n c\xF3 th\u1EC3 t\u1EA3i file v\u1EC1 \u0111\u1EC3 xem."}),u0("button",{type:"button",onClick:f,className:"inline-flex items-center justify-center gap-2 w-full py-2.5 px-4 bg-primary-600 hover:bg-primary-500 text-white font-medium rounded-xl transition-colors shadow-md cursor-pointer",children:[Oo(Sr,{width:18,height:18}),Oo("span",{children:"T\u1EA3i xu\u1ED1ng file"})]})]})}import{useMemo as Zx}from"react";var d0=250,po={xs:{dialog:"max-w-[320px] p-3 gap-1.5",header:"gap-1.5",body:"text-xs",footer:"gap-1.5 pt-1.5",title:"text-sm font-semibold leading-tight text-neutral-900",description:"text-xs leading-normal text-neutral-600",buttonGap:"gap-1.5",closeButton:"size-5 p-0.5 -mr-1 -mt-1",closeIcon:"size-3.5"},sm:{dialog:"max-w-[400px] p-3.5 gap-2",header:"gap-2",body:"text-sm",footer:"gap-2 pt-2",title:"text-base font-semibold leading-tight text-neutral-900",description:"text-sm leading-normal text-neutral-600",buttonGap:"gap-2",closeButton:"size-6 p-0.5 -mr-1 -mt-1",closeIcon:"size-4"},md:{dialog:"max-w-[540px] p-4 gap-2.5",header:"gap-2.5",body:"text-sm",footer:"gap-2 pt-2",title:"text-lg font-semibold leading-tight text-neutral-900",description:"text-sm leading-relaxed text-neutral-600",buttonGap:"gap-2.5",closeButton:"size-7 p-1 -mr-1 -mt-1",closeIcon:"size-4"},lg:{dialog:"max-w-[720px] p-4.5 gap-3",header:"gap-3",body:"text-base",footer:"gap-2.5 pt-2.5",title:"text-xl font-bold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",buttonGap:"gap-3",closeButton:"size-8 p-1 -mr-1 -mt-1",closeIcon:"size-4.5"},xl:{dialog:"max-w-[960px] p-5 gap-3.5",header:"gap-3.5",body:"text-base",footer:"gap-3 pt-3",title:"text-2xl font-bold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",buttonGap:"gap-3.5",closeButton:"size-8 p-1 -mr-1 -mt-1",closeIcon:"size-5"},full:{dialog:"max-w-[calc(100vw-2rem)] w-full h-[calc(100vh-2rem)] p-4 gap-2.5",header:"gap-2.5",body:"text-base",footer:"gap-2 pt-2",title:"text-2xl font-bold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",buttonGap:"gap-2.5",closeButton:"size-8 p-1 -mr-1 -mt-1",closeIcon:"size-4.5"}},f0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"};import{jsx as Ux}from"react/jsx-runtime";function Go({size:e,radius:t,className:r="",children:o,ref:n,...i}){let a=Ze(),s=C(e??a?.size,po,"md"),l=C(t,f0,"lg"),m=["relative flex flex-col w-full bg-neutral-white shadow-2xl border-2 border-neutral-200 outline-none text-neutral-900 pointer-events-auto",s.dialog,l,r].filter(Boolean).join(" ");return Ux("div",{ref:n,tabIndex:-1,className:m,...i,children:o})}import{useEffect as fs,useEffectEvent as Yx,useCallback as Wx,useMemo as Kx,useRef as p0,useState as _x}from"react";import{jsx as ps,jsxs as Xx}from"react/jsx-runtime";function jo({open:e=!1,id:t,size:r,isLoading:o=!1,closeOnOverlayClick:n=!0,closeOnEsc:i=!0,lockScroll:a=!0,overlayClassName:s="",className:l="",toaster:m=!0,children:f,onClose:w,...g}){let p=p0(null),[b,h]=_x(!1),x=p0(null),S=Wx(()=>{b||o||(h(!0),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{h(!1),w?.()},d0))},[b,o,w]),k=Kx(()=>({onClose:S,isLoading:o,size:r,dialogRef:p}),[S,o,r]);fs(()=>()=>{x.current&&clearTimeout(x.current)},[]),fs(()=>{let c=p.current;if(c)if(e||b){if(!c.open)try{c.showModal()}catch{}}else c.open&&c.close()},[e,b]),fs(()=>{if(!a)return;let c=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=c}},[a]);let v=Yx(c=>{!e||i===!1||c.key==="Escape"&&(c.preventDefault(),c.stopPropagation(),S())});if(fs(()=>(window.addEventListener("keydown",v),()=>{window.removeEventListener("keydown",v)}),[]),!e&&!b)return null;let d=()=>{n&&S()},u=b?"animate-modal-backdrop-out pointer-events-none":"animate-modal-backdrop-in",y=b?"animate-modal-out pointer-events-none":"animate-modal-in";return ps(Nl.Provider,{value:k,children:Xx("dialog",{id:t,ref:p,"aria-labelledby":"modal-dialog-title","aria-describedby":"modal-dialog-description",onCancel:c=>{c.preventDefault(),i!==!1&&S()},className:`fixed inset-0 flex items-center justify-center p-4 bg-neutral-950/40 backdrop-blur-xs border-none m-0 max-w-none max-h-none w-screen h-screen overflow-visible backdrop:bg-transparent ${u} ${s}`,...g,children:[m!==!1&&ps(An,{position:"top-right",...typeof m=="object"?m:{}}),ps("div",{"aria-hidden":"true",onClick:d,className:"fixed inset-0 -z-10"}),ps("div",{className:`w-full flex items-center justify-center pointer-events-none ${y} ${l}`,children:f})]})})}import{jsx as ms,jsxs as m0}from"react/jsx-runtime";function Uo({size:e,title:t,description:r,titleClassName:o="",descriptionClassName:n="",showCloseButton:i=!0,onClose:a,closeButtonClassName:s="",className:l="",children:m,...f}){let w=Ze(),g=C(e??w?.size,po,"md"),p=w?.isLoading,b=()=>{a?.(),w?.onClose?.()},h=!!(a||w?.onClose);return m0("div",{className:`flex items-start justify-between w-full border-b border-neutral-100 pb-2 ${g.header} ${l}`,...f,children:[m0("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[t&&ms("h3",{id:"modal-dialog-title",className:`${g.title} truncate ${o}`,children:t}),r&&ms("p",{id:"modal-dialog-description",className:`${g.description} mt-0.5 ${n}`,children:r}),m]}),i&&h&&ms("button",{type:"button",onClick:b,disabled:p,"aria-label":"\u0110\xF3ng h\u1ED9p tho\u1EA1i","data-testid":"modal-close-button",className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-700 hover:bg-neutral-100 rounded-md transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-neutral-400 ${g.closeButton} ${s}`,children:ms(Ye,{className:g.closeIcon})})]})}import{jsx as qx}from"react/jsx-runtime";function Yo({size:e,className:t="",children:r,...o}){let n=Ze(),i=C(e??n?.size,po,"md");return qx("div",{className:`w-full max-h-[calc(100vh-8rem)] overflow-y-auto ui-scrollbar ${i.body} ${t}`,...o,children:r})}import{jsx as zi,jsxs as Jx}from"react/jsx-runtime";function hr({open:e=!1,onClose:t,file:r,title:o,description:n,size:i="lg",radius:a="xl",showCloseButton:s=!0,closeOnOverlayClick:l=!0,closeOnEsc:m=!0,lockScroll:f=!0,className:w="",overlayClassName:g="",children:p}){let b=Vr(r),h=o??b?.name,x=Zx(()=>({file:r,headerTitle:h}),[r,h]);return zi(jo,{open:e,onClose:t,size:i,closeOnOverlayClick:l,closeOnEsc:m,lockScroll:f,overlayClassName:g,children:Jx(Go,{size:i,radius:a,"data-testid":"image-preview-modal",className:`bg-neutral-white border border-neutral-200 text-neutral-900 shadow-2xl overflow-hidden p-0 ${w}`,children:[(h||s)&&zi(Uo,{title:h,description:n,showCloseButton:s,className:"px-5 py-3.5 border-b border-neutral-200 shrink-0"}),zi(Yo,{className:"p-0 overflow-hidden flex flex-col flex-1 min-h-0",children:zi(xc.Provider,{value:x,children:p||zi(Ar,{})})})]})})}import{useState as Ii,useEffect as Qx,useMemo as ev}from"react";import tv from"next/image";import{Fragment as rv,jsx as zn,jsxs as g0}from"react/jsx-runtime";function Or({src:e,alt:t="",width:r,height:o,fill:n,skeletonVariant:i="pulse",radius:a="md",objectFit:s="cover",preview:l=!0,className:m="",wrapperClassName:f="",style:w,wrapperStyle:g,onLoad:p,onError:b,onClick:h,ref:x,...S}){let[k,v]=Ii(!1),[d,u]=Ii(!1),[y,c]=Ii(null),[T,R]=Ii(!1),D=Yc(e),[N,I]=Ii(D),E=typeof Blob<"u"&&(e instanceof File||e instanceof Blob),P=gc(e)?e:void 0,F=P?.src,z=E?y:P?F:e,H=E||!!P||typeof z=="string"&&(/^(?:https?:)?\/\//.test(z)||z.startsWith("data:")||z.startsWith("blob:")),V=t||P?.name||"";D!==N&&(I(D),v(!1),u(!1)),Qx(()=>{if(!(e instanceof File||e instanceof Blob)){c(null);return}let X=URL.createObjectURL(e);return c(X),()=>URL.revokeObjectURL(X)},[e]);let W=ev(()=>{if(z)return e instanceof File?e:P?{...P,src:P.src,name:V||"image",type:"image"}:{src:typeof z=="string"?z:z?.src,name:V||"image",type:"image"}},[e,z,P,V]),L=C(a,jc,"md"),M=C(s,Uc,"cover"),O=X=>{v(!0),p?.(X)},A=X=>{u(!0),v(!1),b?.(X)},U=X=>{h?.(X),!X.defaultPrevented&&l&&k&&!d&&W&&R(!0)},G=!!(l&&k&&!d||h),K=X=>{(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),U(X))},q={...n?{}:{width:r,height:o},...g};return g0(rv,{children:[g0("div",{ref:x,role:G?"button":void 0,tabIndex:G?0:void 0,onClick:U,onKeyDown:K,className:["relative overflow-hidden inline-block",L,G?"cursor-pointer":"",f].filter(Boolean).join(" "),style:q,children:[!k&&!d&&zn(Zo,{variant:i,radius:a,width:"100%",height:"100%",style:{position:"absolute",inset:0}}),z?zn(tv,{src:z,alt:V,width:n?void 0:r,height:n?void 0:o,fill:n,unoptimized:H?!0:S.unoptimized,className:["block w-full h-full transition-opacity duration-200",M,L,k?"opacity-100":"opacity-0",m].filter(Boolean).join(" "),style:w,onLoad:O,onError:A,...S}):null,d&&zn("div",{role:"img","aria-label":"Image failed to load",className:["absolute inset-0 flex items-center justify-center","bg-neutral-100 text-neutral-400"].join(" "),children:zn(ca,{width:24,height:24,"aria-hidden":"true"})})]}),T&&W&&zn(hr,{open:T,onClose:()=>R(!1),file:W,title:V||"Xem \u1EA3nh",children:zn(Ar,{})})]})}import{Fragment as ov,jsx as $t,jsxs as In}from"react/jsx-runtime";function Fi({size:e="md",color:t="primary",variant:r="outline",radius:o,shape:n="rectangle",objectFit:i="contain",disabled:a,readOnly:s,isLoading:l,dragStatus:m="idle",isInvalid:f,dropzoneTitle:w,dropzoneDescription:g,icon:p,item:b,onRemove:h,onPreview:x,onTriggerUpload:S,getRootProps:k,className:v="",describedById:d}){let u=C(e,Nn,"md"),y=C(o,ts,"md"),c=n==="square"?"aspect-square w-full":C(e,t0,"md"),T=f?"error":t,R=r!=="other"?C(r,r0,"outline"):null,D=R?C(T,R,"primary"):null,N="K\xE9o th\u1EA3 h\xECnh \u1EA3nh v\xE0o \u0111\xE2y, ho\u1EB7c nh\u1EA5n \u0111\u1EC3 duy\u1EC7t file",I="H\u1ED7 tr\u1EE3 \u0111\u1ECBnh d\u1EA1ng PNG, JPG, WEBP, GIF",E=m==="active",P=m==="reject",F=E,z=P?"border-error-500 bg-error-50/50 ring-2 ring-error-500/20 text-error-900":F?D?.active||"border-primary-500 bg-primary-50 ring-2 ring-primary-500/20":D?.idle||"border-neutral-300 bg-neutral-50/50 hover:border-primary-500 hover:bg-primary-50/30",H=b?`group relative w-full ${c} ${y} overflow-hidden border-2 transition-colors duration-150 ease-in-out cursor-pointer select-none ${F?"border-dashed "+z:"border-solid border-neutral-200 hover:border-primary-400"} ${a?"opacity-50 cursor-not-allowed pointer-events-none":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${v}`:`group relative w-full ${n==="square"?"aspect-square w-full":u.dropzoneHeight} ${u.dropzonePadding} ${y} border-2 border-dashed flex flex-col items-center justify-center text-center transition-colors duration-150 ease-in-out cursor-pointer ${z} ${a?"opacity-50 cursor-not-allowed pointer-events-none bg-neutral-100":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${v}`,V=Ct(b),W={role:"button",tabIndex:a?-1:0,"aria-label":b?`H\xECnh \u1EA3nh \u0111\xE3 t\u1EA3i l\xEAn: ${V}. Nh\u1EA5n \u0111\u1EC3 xem tr\u01B0\u1EDBc, ho\u1EB7c d\xF9ng n\xFAt \u1EDF g\xF3c ph\u1EA3i \u0111\u1EC3 thay \u0111\u1ED5i ho\u1EB7c x\xF3a \u1EA3nh.`:"Khu v\u1EF1c k\xE9o th\u1EA3 v\xE0 t\u1EA3i \u1EA3nh l\xEAn","aria-disabled":a,"aria-invalid":f,"aria-describedby":d,"aria-busy":l,className:H,onClick:()=>{a||l||b&&x?.()},onKeyDown:M=>{a||l||(M.key==="Enter"||M.key===" ")&&b&&(M.preventDefault(),x?.())}},L=k?k(W):W;return $t("div",{...L,children:b?In(ov,{children:[$t(Or,{src:b,alt:V,fill:!0,radius:o??"md",objectFit:i,preview:!1,wrapperClassName:"w-full h-full"}),!l&&!a&&In("div",{className:"absolute top-2.5 right-2.5 flex items-center gap-1.5 z-10",children:[!s&&$t("button",{type:"button",onClick:M=>{M.stopPropagation(),S?.()},"aria-label":"Thay \u0111\u1ED5i \u1EA3nh",title:"Thay \u0111\u1ED5i \u1EA3nh",className:"p-1.5 rounded-lg bg-neutral-900/60 hover:bg-neutral-900/80 text-neutral-white backdrop-blur-xs transition-colors shadow-xs cursor-pointer focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden","data-testid":"dropzone-replace-button",children:$t(_t,{width:16,height:16})}),!s&&$t("button",{type:"button",onClick:M=>{M.stopPropagation(),h?.()},"aria-label":"X\xF3a \u1EA3nh",title:"X\xF3a \u1EA3nh",className:"p-1.5 rounded-lg bg-neutral-900/60 hover:bg-error-600 text-neutral-white backdrop-blur-xs transition-colors shadow-xs cursor-pointer focus-visible:ring-2 focus-visible:ring-error-500 focus-visible:outline-hidden","data-testid":"dropzone-remove-button",children:$t(pr,{width:16,height:16})})]}),l&&In("div",{className:"absolute inset-0 bg-neutral-950/60 flex flex-col items-center justify-center text-neutral-white z-20",children:[$t(Pe,{width:u.iconSize*.8,height:u.iconSize*.8,className:"animate-spin"}),$t("span",{className:`${u.titleSize} font-medium mt-1`,children:"\u0110ang x\u1EED l\xFD h\xECnh \u1EA3nh..."})]}),F&&In("div",{className:"absolute inset-0 bg-primary-950/50 backdrop-blur-xs flex flex-col items-center justify-center text-neutral-white z-20 transition-opacity",children:[$t(Ot,{width:u.iconSize,height:u.iconSize,className:"animate-bounce"}),$t("span",{className:`${u.titleSize} font-medium mt-1`,children:"Th\u1EA3 h\xECnh \u1EA3nh \u0111\u1EC3 thay th\u1EBF"})]})]}):l?In("div",{className:`flex flex-col items-center justify-center gap-2 ${D?.iconColor||"text-primary-600"}`,children:[$t(Pe,{width:u.iconSize*.8,height:u.iconSize*.8}),$t("span",{className:`${u.titleSize} font-medium`,children:"\u0110ang x\u1EED l\xFD h\xECnh \u1EA3nh..."})]}):In("div",{className:"flex flex-col items-center justify-center gap-2",children:[$t("div",{className:`transition-colors ${D?.iconColor||"text-primary-500"}`,children:p||$t(Ot,{width:u.iconSize,height:u.iconSize})}),$t("div",{className:`${u.titleSize} font-medium text-neutral-800 ${D?.titleHover||"group-hover:text-primary-600"} transition-colors`,children:w??N}),$t("div",{id:d,className:`${u.descSize} text-neutral-500`,children:g??I})]})})}import{jsx as Gr,jsxs as vc}from"react/jsx-runtime";function Wo({items:e,size:t,radius:r,objectFit:o="cover",disabled:n,readOnly:i,maxCount:a,onRemove:s,onPreview:l,onTriggerUpload:m,renderItem:f,showAddButton:w=!0,className:g=""}){let p=C(t,Nn,"md"),b=C(r,ts,"md"),h=!a||e.length<a;return vc("ul",{"aria-label":"Danh s\xE1ch h\xECnh \u1EA3nh \u0111\xE3 t\u1EA3i l\xEAn",className:`flex flex-wrap items-center list-none p-0 m-0 ${p.gap} ${g}`,children:[e.map((x,S)=>{let k=Ct(x),v=typeof x=="object"&&x&&"id"in x&&x.id?String(x.id):x instanceof File?`${x.name}-${x.size}-${x.lastModified}`:typeof x=="string"?x:x?.src||k;return f?Gr("li",{"data-testid":"upload-image-item",className:"list-none",children:f(x,S,{remove:()=>s(x,S),preview:()=>l(x)})},v):vc("li",{"data-testid":"upload-image-item",tabIndex:n?-1:0,"aria-label":`H\xECnh \u1EA3nh ${k}`,onKeyDown:d=>{n||i||(d.key==="Delete"||d.key==="Backspace")&&(d.preventDefault(),s(x,S))},className:`group relative list-none ${p.thumbnailSize} ${b} border-2 overflow-hidden flex items-center justify-center bg-neutral-100 border-neutral-200 transition-colors duration-150 ease-in-out focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden`,children:[Gr(Or,{src:x,alt:k,width:80,height:80,radius:r,objectFit:o,unoptimized:!0,preview:!1,className:"w-full h-full",wrapperClassName:"w-full h-full"}),!n&&vc("div",{className:"absolute inset-0 bg-neutral-900/40 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity duration-150 flex items-center justify-center gap-1.5 p-1",children:[l&&Gr("button",{type:"button",onClick:d=>{d.stopPropagation(),l(x)},"aria-label":`Preview image ${k}`,title:"Xem tr\u01B0\u1EDBc",className:"p-1 rounded-md text-neutral-white hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-primary-400 focus-visible:outline-hidden transition-colors cursor-pointer",children:Gr(jr,{width:16,height:16})}),!i&&Gr("button",{type:"button",onClick:d=>{d.stopPropagation(),s(x,S)},"aria-label":`Remove image ${k}`,title:"X\xF3a \u1EA3nh",className:"p-1 rounded-md text-error-300 hover:text-error-200 hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-error-400 focus-visible:outline-hidden transition-colors cursor-pointer",children:Gr(pr,{width:16,height:16})})]})]},v)}),w&&h&&!i&&Gr("li",{className:"list-none",children:Gr("button",{type:"button",disabled:n,onClick:m,"aria-label":"Add image",title:"Th\xEAm h\xECnh \u1EA3nh",className:`${p.thumbnailSize} ${b} border-2 border-dashed border-neutral-300 hover:border-primary-500 hover:bg-primary-50/40 text-neutral-400 hover:text-primary-600 flex flex-col items-center justify-center transition-colors duration-150 ease-in-out cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden`,children:Gr(yr,{width:p.iconSize*.5,height:p.iconSize*.5})})})]})}import{Fragment as av,jsx as Qt,jsxs as Mi}from"react/jsx-runtime";function yc({value:e,defaultValue:t,onChange:r,onRemove:o,onPreview:n,multiple:i=!1,maxCount:a,maxSize:s,accept:l="image/*",beforeUpload:m,viewMode:f="dropzone",shape:w="rectangle",objectFit:g,size:p="md",color:b="primary",variant:h="outline",radius:x,label:S,isRequired:k=!1,labelClassName:v="",helperText:d,errorMessage:u,isInvalid:y,disabled:c=!1,readOnly:T=!1,isLoading:R=!1,dropzoneTitle:D,dropzoneDescription:N,icon:I,buttonText:E="T\u1EA3i \u1EA3nh l\xEAn",renderItem:P,className:F="",dropzoneClassName:z="",previewClassName:H="",helperClassName:V=""}){let W=nv(),L=`${W}-input`,M=`${W}-error-helper`,O=e!==void 0,[A,U]=gs(()=>Ao(t)),G=b0(()=>O?Ao(e):A,[O,e,A]),[K,q]=gs(null),[X,fe]=gs(null),[ae,_]=gs(""),Z=C(p,Nn,"md"),he=x??"md",xe=!!(y||u||K),$=u||K,ee=xe?"text-error-600":C(xe?"error":b,e0,"primary"),de=a??(i?void 0:1),ne=!i||de===1,ze=ne&&G.length===1?G[0]:null,ve=pe=>{O||U(pe),r?.(pe)},Ce=b0(()=>Di(l),[l]),J=f==="dropzone"&&!!ze,{getRootProps:j,getInputProps:oe,isDragActive:ye,isDragReject:ue,open:ce}=iv({multiple:i,maxSize:s,accept:Ce,disabled:c||T||R,noClick:f!=="dropzone"||J,noKeyboard:f!=="dropzone"||J,onDropAccepted:async pe=>{if(c||T||(q(null),pe.length===0))return;let Y=pe,me=G.length;if(de!==void 0)if(i){let B=de-me;if(B<=0){let se=`Maximum allowed image count reached (${de} images)`;q(se),_(se);return}Y=pe.slice(0,B)}else{let B=pe[0];if(!B)return;Y=[B]}let De=await Promise.all(Y.map(async B=>{if(m)try{let se=await m(B);if(se===!1||typeof se=="string")return{file:null,error:typeof se=="string"?se:`File ${B.name} was rejected`}}catch(se){return{file:null,error:se instanceof Error?se.message:`Kh\xF4ng th\u1EC3 x\u1EED l\xFD t\u1EC7p ${B.name}`}}return{file:B,error:null}})),ie=[];for(let B of De)B.error?(q(B.error),_(`L\u1ED7i: ${B.error}`)):B.file&&ie.push(B.file);if(ie.length>0){let B=i?[...G,...ie]:ie;ve(B),_(`T\u1EA3i l\xEAn th\xE0nh c\xF4ng ${ie.length} h\xECnh \u1EA3nh. T\u1ED5ng c\u1ED9ng: ${B.length}.`)}},onDropRejected:pe=>{let Y=pe[0]?.errors[0];if(!Y)return;let me=Y.message||"T\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7";Y.code==="file-too-large"?me=`K\xEDch th\u01B0\u1EDBc t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n t\u1ED1i \u0111a (${Pr(s||0)})`:Y.code==="file-invalid-type"?me=`\u0110\u1ECBnh d\u1EA1ng t\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7. C\xE1c \u0111\u1ECBnh d\u1EA1ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3: ${typeof l=="string"?l:Object.keys(l||{}).join(", ")}`:Y.code==="too-many-files"&&(me=`S\u1ED1 l\u01B0\u1EE3ng h\xECnh \u1EA3nh v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n cho ph\xE9p (${de} h\xECnh \u1EA3nh)`),q(me),_(`L\u1ED7i t\u1EC7p: ${me}`)}}),ke=(pe,Y)=>{if(c||T)return;let me=G.filter((De,ie)=>ie!==Y);ve(me),o?.(pe,Y),_(`\u0110\xE3 x\xF3a h\xECnh \u1EA3nh ${Ct(pe)}`)},Te=pe=>{fe(pe),n?.(pe)};return Mi("div",{className:`group/field relative flex flex-col w-full ${F}`,children:[Qt("input",{...oe({id:L,disabled:c||R,"aria-hidden":!0,tabIndex:-1,className:"hidden"})}),Qt("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:ae}),S&&Mi("label",{htmlFor:L,className:`block font-medium transition-colors duration-150 ${Z.labelSize} ${ee} ${v}`,children:[S,k&&Qt("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),Mi("div",{className:"flex flex-col gap-3",children:[f==="dropzone"&&Mi(av,{children:[Qt(Fi,{size:p,color:b,variant:h,radius:he,shape:w,objectFit:g,disabled:c,readOnly:T,isLoading:R,dragStatus:ue?"reject":ye?"active":"idle",isInvalid:xe,dropzoneTitle:D,dropzoneDescription:N,icon:I,item:ze,onRemove:()=>ze&&ke(ze,0),onPreview:()=>ze&&Te(ze),getRootProps:j,onTriggerUpload:ce,className:z,describedById:$||d?M:void 0}),!ne&&G.length>0&&Qt(Wo,{items:G,size:p,color:b,variant:h,radius:he,objectFit:g,disabled:c,readOnly:T,maxCount:de,onRemove:ke,onPreview:Te,onTriggerUpload:ce,renderItem:P,showAddButton:!1,className:H})]}),f==="card-grid"&&Qt("div",{...j({className:"w-full focus-visible:outline-hidden"}),children:Qt(Wo,{items:G,size:p,color:b,variant:h,radius:he,objectFit:g,disabled:c,readOnly:T,maxCount:de,onRemove:ke,onPreview:Te,onTriggerUpload:ce,renderItem:P,showAddButton:!0,className:H})}),f==="button"&&Mi("div",{className:"flex flex-col gap-3",children:[Qt("div",{className:"flex items-center gap-3",children:Qt(er,{type:"button",size:p,color:xe?"error":b==="neutral"?"secondary":b,variant:h==="other"?"filled":h,radius:x,disabled:c||T||de!==void 0&&G.length>=de,onClick:ce,leftIcon:Qt(Ot,{width:Z.iconSize*.5,height:Z.iconSize*.5}),"aria-label":"T\u1EA3i \u1EA3nh l\xEAn",children:E})}),G.length>0&&Qt(Wo,{items:G,size:p,color:b,variant:h,radius:he,objectFit:g,disabled:c,readOnly:T,maxCount:de,onRemove:ke,onPreview:Te,onTriggerUpload:ce,renderItem:P,showAddButton:!1,className:H})]})]}),Qt(He,{id:M,helperText:d,errorMessage:xe?$:void 0,sizeClassName:Z.helperSize,className:V}),X&&Qt(hr,{open:!!X,onClose:()=>fe(null),file:X})]})}import{useId as cv,useMemo as uv,useState as Ei}from"react";import{useDropzone as dv}from"react-dropzone";import{useMergeRefs as fv}from"@floating-ui/react";var h0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},x0={xs:{avatarSize:"size-12",iconSize:20,iconClass:"size-5",label:"text-[11px] mb-1",helper:"text-[9px] mt-0.5",rounded:"rounded"},sm:{avatarSize:"size-16",iconSize:24,iconClass:"size-6",label:"text-xs mb-1",helper:"text-[10px] mt-0.5",rounded:"rounded-md"},md:{avatarSize:"size-20",iconSize:32,iconClass:"size-8",label:"text-sm mb-1.5",helper:"text-[11px] mt-1",rounded:"rounded-lg"},lg:{avatarSize:"size-24",iconSize:40,iconClass:"size-10",label:"text-base mb-1.5",helper:"text-xs mt-1",rounded:"rounded-xl"},xl:{avatarSize:"size-32",iconSize:52,iconClass:"size-12",label:"text-lg mb-2",helper:"text-sm mt-1",rounded:"rounded-2xl"}},v0={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}},y0={primary:"text-primary-500 group-hover/avatar:text-primary-600",secondary:"text-secondary-500 group-hover/avatar:text-secondary-600",neutral:"text-neutral-400 group-hover/avatar:text-neutral-600",error:"text-error-500 group-hover/avatar:text-error-600",success:"text-success-500 group-hover/avatar:text-success-600",warning:"text-warning-500 group-hover/avatar:text-warning-600",info:"text-info-500 group-hover/avatar:text-info-600"},w0={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600",neutral:"text-neutral-500 group-focus-within/field:text-neutral-600"},C0={primary:"ring-2 ring-primary-500/40 border-primary-500 bg-primary-50/80",secondary:"ring-2 ring-secondary-500/40 border-secondary-500 bg-secondary-50/80",neutral:"ring-2 ring-neutral-500/40 border-neutral-500 bg-neutral-50/80",error:"ring-2 ring-error-500/40 border-error-500 bg-error-50/80",success:"ring-2 ring-success-500/40 border-success-500 bg-success-50/80",warning:"ring-2 ring-warning-500/40 border-warning-500 bg-warning-50/80",info:"ring-2 ring-info-500/40 border-info-500 bg-info-50/80"};function S0(e){if(!e)return;if(typeof e=="object")return e;let t={},r=e.split(",").map(o=>o.trim()).filter(Boolean);for(let o of r)if(o.startsWith(".")){let n=o.toLowerCase();n===".jpg"||n===".jpeg"?t["image/jpeg"]=[...t["image/jpeg"]||[],n]:n===".png"?t["image/png"]=[...t["image/png"]||[],n]:n===".webp"?t["image/webp"]=[...t["image/webp"]||[],n]:n===".gif"?t["image/gif"]=[...t["image/gif"]||[],n]:n===".svg"?t["image/svg+xml"]=[...t["image/svg+xml"]||[],n]:t["application/octet-stream"]=[...t["application/octet-stream"]||[],n]}else t[o]||(t[o]=[]);return t}import{useEffect as sv,useRef as bs,useState as Ko}from"react";import lv from"react-easy-crop";function T0(e){return new Promise((t,r)=>{let o=new Image;o.addEventListener("load",()=>t(o)),o.addEventListener("error",n=>r(n)),o.setAttribute("crossOrigin","anonymous"),o.src=e})}function k0(e){return e*Math.PI/180}function R0(e,t,r){let o=k0(r);return{width:Math.abs(Math.cos(o)*e)+Math.abs(Math.sin(o)*t),height:Math.abs(Math.sin(o)*e)+Math.abs(Math.cos(o)*t)}}async function wc(e,t,r=0,o=!1,n="avatar-cropped.png",i="image/png"){let a=await T0(e),s=document.createElement("canvas"),l=s.getContext("2d");if(!l)throw new Error("No 2d context available on canvas");let m=k0(r),f=a.naturalWidth||a.width,w=a.naturalHeight||a.height,{width:g,height:p}=R0(f,w,r);s.width=g,s.height=p,l.translate(g/2,p/2),l.rotate(m),l.scale(o?-1:1,1),l.translate(-f/2,-w/2),l.drawImage(a,0,0);let b=document.createElement("canvas"),h=b.getContext("2d");if(!h)throw new Error("No 2d context for cropped canvas");return b.width=t.width,b.height=t.height,h.drawImage(s,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise((x,S)=>{b.toBlob(k=>{if(!k){S(new Error("Canvas is empty or failed to generate blob"));return}let v=new File([k],n,{type:i||"image/png"});x(v)},i||"image/png",.95)})}import{jsx as Qe,jsxs as Cc}from"react/jsx-runtime";function Sc({imageSrc:e="",file:t,fileName:r="avatar-cropped.png",fileType:o="image/png",aspectRatio:n=1,cropShape:i="round",showGrid:a=!0,minZoom:s=1,maxZoom:l=4,onApply:m,onCancel:f}){let w=bs(null),[g,p]=Ko(t??null),[b,h]=Ko(e),x=bs(t?.name||r),S=bs(t?.type||o),[k,v]=Ko({x:0,y:0}),[d,u]=Ko(1),[y,c]=Ko(0),[T,R]=Ko(!1),D=bs(null),[N,I]=Ko(!1);sv(()=>{if(!g)return;let G=URL.createObjectURL(g);return h(G),()=>{URL.revokeObjectURL(G)}},[g]);let E=()=>u(G=>Math.min(l,Math.round((G+.2)*10)/10)),P=()=>u(G=>Math.max(s,Math.round((G-.2)*10)/10)),F=()=>c(G=>(G+90)%360),z=()=>c(G=>(G-90+360)%360),H=()=>R(G=>!G),V=()=>{v({x:0,y:0}),u(1),c(0),R(!1)},W=()=>{w.current&&(w.current.value="",w.current.click())},L=G=>{if(G.target.files&&G.target.files[0]){let K=G.target.files[0];x.current=K.name,S.current=K.type||"image/png",p(K),V()}},M=(G,K)=>{D.current=K},O=async()=>{if(D.current)try{I(!0);let G=await wc(b,D.current,y,T,x.current,S.current);m(G)}catch(G){console.error("Error cropping avatar:",G)}finally{I(!1)}},A=()=>{f?.()},U="p-1.5 rounded-full text-neutral-600 hover:text-neutral-900 hover:bg-neutral-200/70 transition-colors focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed shrink-0";return Cc("div",{className:"flex flex-col w-full select-none","data-testid":"upload-avatar-crop-modal",children:[Qe("input",{ref:w,type:"file",accept:"image/*","aria-hidden":"true",tabIndex:-1,className:"hidden",onChange:L}),Qe("div",{className:"relative w-full h-80 md:h-95 bg-neutral-950 overflow-hidden select-none",children:Qe(lv,{image:b,crop:k,zoom:d,rotation:y,aspect:n,cropShape:i,showGrid:a,minZoom:s,maxZoom:l,onCropChange:v,onZoomChange:u,onRotationChange:c,onCropComplete:M,classes:{mediaClassName:T?"scale-x-[-1]":""},style:{containerStyle:{position:"relative",width:"100%",height:"100%"}}})}),Qe("div",{className:"w-full flex items-center justify-center py-2.5 px-3 bg-neutral-white border-t border-neutral-200 overflow-x-auto ui-scrollbar",children:Cc("div",{className:"inline-flex items-center flex-nowrap shrink-0 gap-1 bg-neutral-50 border border-neutral-200 rounded-full px-2.5 py-1 shadow-xs text-neutral-700",children:[Qe("button",{type:"button",onClick:W,"aria-label":"Ch\u1ECDn \u1EA3nh kh\xE1c",title:"Ch\u1ECDn \u1EA3nh kh\xE1c",className:`${U} text-neutral-700 hover:text-primary-600`,"data-testid":"avatar-crop-change-image-button",children:Qe(Ot,{width:16,height:16})}),Qe("div",{className:"w-px h-3.5 bg-neutral-300 my-auto mx-0.5 shrink-0"}),Qe("button",{type:"button",onClick:P,disabled:d<=s,"aria-label":"Thu nh\u1ECF",title:"Thu nh\u1ECF (-)",className:U,children:Qe(on,{width:16,height:16})}),Qe("button",{type:"button",onClick:E,disabled:d>=l,"aria-label":"Ph\xF3ng to",title:"Ph\xF3ng to (+)",className:U,children:Qe(rn,{width:16,height:16})}),Qe("button",{type:"button",onClick:z,title:"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3","aria-label":"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",className:U,children:Qe(nn,{width:16,height:16})}),Qe("button",{type:"button",onClick:F,title:"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3","aria-label":"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",className:U,children:Qe(Zr,{width:16,height:16})}),Qe("button",{type:"button",onClick:H,title:"L\u1EADt ngang","aria-label":"L\u1EADt ngang",className:U,children:Qe(sn,{width:16,height:16})}),Qe("button",{type:"button",onClick:V,title:"\u0110\u1EB7t l\u1EA1i","aria-label":"\u0110\u1EB7t l\u1EA1i",className:U,children:Qe(_t,{width:16,height:16})}),Qe("div",{className:"w-px h-3.5 bg-neutral-300 my-auto mx-0.5 shrink-0"}),Qe("button",{type:"button",onClick:A,"aria-label":"H\u1EE7y c\u1EAFt \u1EA3nh",title:"H\u1EE7y (Esc)",className:`${U} text-neutral-500 hover:text-error-600`,"data-testid":"avatar-crop-cancel-button",children:Qe(Ye,{width:16,height:16})}),Qe("button",{type:"button",onClick:O,disabled:N,"aria-label":"\xC1p d\u1EE5ng v\xE0 l\u01B0u \u1EA3nh \u0111\xE3 c\u1EAFt",title:"\xC1p d\u1EE5ng",className:"p-1.5 rounded-full bg-primary-600 hover:bg-primary-500 text-white shadow-xs transition-colors active:scale-95 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden shrink-0","data-testid":"avatar-crop-apply-button",children:N?Qe(Pe,{width:16,height:16}):Qe(Kr,{width:16,height:16})})]})})]})}function hs({open:e=!0,modalTitle:t="C\u1EAFt \u1EA3nh \u0111\u1EA1i di\u1EC7n",onClose:r,onCancel:o,onApply:n,...i}){let a=()=>{o?.(),r?.()};return Qe(jo,{open:e,closeOnOverlayClick:!0,closeOnEsc:!0,onClose:a,children:Cc(Go,{size:"lg",radius:"xl",className:"bg-neutral-white border border-neutral-200 shadow-2xl overflow-hidden p-0",children:[Qe(Uo,{title:Qe("span",{className:"font-semibold text-neutral-900","data-testid":"avatar-crop-modal-title",children:t}),className:"px-5 py-3.5 border-b border-neutral-200",showCloseButton:!0}),Qe(Yo,{className:"p-0 overflow-hidden",children:Qe(Sc,{...i,onApply:l=>{n(l),r?.()},onCancel:a})})]})})}import{jsx as kt,jsxs as $i}from"react/jsx-runtime";function Tc({size:e="md",variant:t="outline",color:r="primary",shape:o="circle",radius:n,value:i,defaultValue:a,onChange:s,onRemove:l,onPreview:m,onClear:f,maxSize:w,accept:g="image/*",crop:p=!0,label:b,labelPlacement:h="top",config:x,helperText:S,errorMessage:k,disabled:v=!1,readOnly:d=!1,icon:u,name:y,id:c,className:T="",wrapperClassName:R="",avatarClassName:D="",avatarWrapperClassName:N="",labelClassName:I="",helperClassName:E="",ref:P}){let{isRequired:F=!1,isInvalid:z=!1,isLoading:H=!1,showSpinner:V=!1,isClearable:W=!1,isFullWidth:L=!1}=x??{},M=cv(),O=c||M,A=`${O}-error-helper`,U=i!==void 0,[G,K]=Ei(a??null),q=U?i??null:G,X=Vr(q),fe=X.name,[ae,_]=Ei(null),[Z,he]=Ei(!1),[xe,$]=Ei(null),[re,ee]=Ei(""),de=k||xe,ne=!!(z||de),ze=ne?"error":r,ve=C(e,x0,"md"),Ce=o==="circle"?"rounded-full":C(n,h0,"md"),J=t==="other"?"":C(ze,C(t,v0,"outline"),"primary"),j=C(ze,y0,"primary"),oe=ne?"text-error-600 font-bold":C(ze,w0,"primary"),ye=C(ze,C0,"primary"),ue=Re=>{U||K(Re),s?.(Re)},ce=p!==!1,ke=typeof p=="object"?p:{},Te=Re=>{_({file:Re.file,imageSrc:Re.imageSrc,fileName:fe||"avatar.png",fileType:X.type||"image/png"})},pe=Re=>{if(Re?.stopPropagation(),!(v||d||H)&&q){let Xe=q;ue(null),l?.(Xe),f?.(),ee("\u0110\xE3 x\xF3a \u1EA3nh \u0111\u1EA1i di\u1EC7n.")}},Y=Re=>{Re?.stopPropagation(),q&&(he(!0),m?.(q))},me=Re=>{Re?.stopPropagation(),q&&(X.file?Te({file:X.file}):X.serverFile?.src&&Te({imageSrc:X.serverFile.src}))},{getRootProps:De,getInputProps:ie,isDragActive:B,isDragReject:se,inputRef:Ie}=dv({multiple:!1,maxSize:w,accept:uv(()=>S0(g),[g]),disabled:v||d||H,onDropAccepted:([Re])=>{Re&&($(null),ce?Te({file:Re}):(ue(Re),ee("T\u1EA3i \u1EA3nh \u0111\u1EA1i di\u1EC7n th\xE0nh c\xF4ng.")))},onDropRejected:Re=>{let Xe=Re[0]?.errors[0],qe=Xe?.code==="file-too-large"?`Dung l\u01B0\u1EE3ng t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n${w?` ${(w/(1024*1024)).toFixed(1)}MB`:""}.`:Xe?.code==="file-invalid-type"?"\u0110\u1ECBnh d\u1EA1ng t\u1EC7p kh\xF4ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3.":Xe?.message||"T\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7.";$(qe),ee(`L\u1ED7i t\u1EC7p: ${qe}`)}}),Ae=fv([Ie,P]),le=Re=>{v||d||H||q&&(Re.key==="Delete"||Re.key==="Backspace")&&(Re.preventDefault(),Re.stopPropagation(),pe())},ge=()=>b?$i("label",{htmlFor:O,className:`inline-flex items-center font-bold transition-colors duration-150 ${ve.label} ${oe} ${I}`,children:[b,F&&kt("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):null,Me="group/avatar relative flex items-center justify-center transition-colors duration-150 ease-in-out border-2 overflow-hidden select-none",Le=v?"opacity-50":"cursor-pointer",Ve=se?"ring-2 ring-error-500/40 border-error-500 bg-error-50/80":B?ye:"",Be=[Me,ve.avatarSize,Ce,J,Le,Ve,D||N].filter(Boolean).join(" ");return $i("div",{className:`group/field flex ${h==="left"?"flex-row items-center gap-3":"flex-col"} ${L?"w-full":"inline-flex"} ${R||T}`,children:[kt("input",{...ie({id:O,name:y,disabled:v||H,"aria-hidden":!0,tabIndex:-1,className:"hidden"}),ref:Ae}),kt("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:re}),ge(),$i("div",{className:`flex flex-col ${L?"w-full":""}`,children:[$i("div",{...De({role:"button",tabIndex:v||H?-1:0,"aria-label":"T\u1EA3i l\xEAn \u1EA3nh \u0111\u1EA1i di\u1EC7n","aria-disabled":v||H,"aria-invalid":ne,"aria-required":F,"aria-describedby":k||S||xe?A:void 0,"aria-busy":H,onKeyDown:le,className:Be}),children:[q?kt(Or,{src:q,alt:fe||"Avatar",fill:!0,radius:o==="circle"?"full":n,preview:!1,className:"object-cover",wrapperClassName:"w-full h-full"}):kt("div",{className:`flex flex-col items-center justify-center transition-colors ${j} ${ve.iconClass}`,children:u||kt(pa,{width:ve.iconSize,height:ve.iconSize})}),H&&V&&kt("div",{className:"absolute inset-0 bg-neutral-950/60 flex items-center justify-center text-neutral-white z-20",role:"status","aria-label":"\u0110ang t\u1EA3i",children:kt(Pe,{width:ve.iconSize,height:ve.iconSize,className:"animate-spin"})}),!H&&!v&&q&&$i("div",{className:"absolute inset-0 bg-neutral-950/20 opacity-0 group-hover/avatar:opacity-100 group-focus-visible/avatar:opacity-100 transition-opacity flex items-center justify-center gap-1.5 text-neutral-white z-10",children:[kt("button",{type:"button",onClick:Y,"aria-label":"Xem tr\u01B0\u1EDBc \u1EA3nh \u0111\u1EA1i di\u1EC7n",title:"Xem tr\u01B0\u1EDBc",className:"p-1 rounded-full text-neutral-white hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-neutral-white focus-visible:outline-hidden cursor-pointer","data-testid":"avatar-preview-button",children:kt(jr,{width:14,height:14})}),ce&&!d&&kt("button",{type:"button",onClick:me,"aria-label":"C\u1EAFt \u1EA3nh \u0111\u1EA1i di\u1EC7n",title:"C\u1EAFt \u1EA3nh",className:"p-1 rounded-full text-neutral-white hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-neutral-white focus-visible:outline-hidden cursor-pointer","data-testid":"avatar-crop-button",children:kt(ua,{width:14,height:14})}),(!d||W)&&kt("button",{type:"button",onClick:pe,"aria-label":"X\xF3a \u1EA3nh \u0111\u1EA1i di\u1EC7n",title:"X\xF3a \u1EA3nh",className:"p-1 rounded-full text-error-300 hover:text-error-200 hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-error-400 focus-visible:outline-hidden cursor-pointer","data-testid":"avatar-remove-button",children:kt(pr,{width:14,height:14})})]})]}),kt(He,{id:A,helperText:S,errorMessage:de,sizeClassName:ve.helper,className:E}),ce&&ae&&kt(hs,{open:!!ae,file:ae.file,imageSrc:ae.imageSrc,fileName:ae.fileName,fileType:ae.fileType,aspectRatio:ke.aspectRatio??1,cropShape:ke.cropShape??(o==="circle"?"round":"rect"),showGrid:ke.showGrid??!0,minZoom:ke.minZoom??1,maxZoom:ke.maxZoom??4,modalTitle:ke.modalTitle||"C\u1EAFt \u1EA3nh \u0111\u1EA1i di\u1EC7n",onClose:()=>_(null),onApply:Re=>{ue(Re),ee("\u1EA2nh \u0111\u1EA1i di\u1EC7n \u0111\xE3 \u0111\u01B0\u1EE3c c\u1EADp nh\u1EADt th\xE0nh c\xF4ng."),_(null)}}),Z&&q&&kt(hr,{open:Z,onClose:()=>he(!1),file:q,title:fe||"Xem tr\u01B0\u1EDBc \u1EA3nh \u0111\u1EA1i di\u1EC7n",children:kt(Ar,{imageProps:{minZoom:.5,maxZoom:4,toolbarProps:{tools:{rotate:!0,flip:!0,download:!0}}}})})]})]})}import{useId as mv,useMemo as P0,useState as vs}from"react";import{useDropzone as gv}from"react-dropzone";import{jsx as ur,jsxs as xs}from"react/jsx-runtime";function Fn({size:e="md",color:t="primary",variant:r="outline",radius:o,shape:n="rectangle",compact:i=!1,disabled:a=!1,readOnly:s=!1,isLoading:l=!1,showSpinner:m=!1,dragStatus:f="idle",isInvalid:w=!1,dropzoneTitle:g,dropzoneDescription:p,icon:b,onTriggerUpload:h,getRootProps:x,className:S="",describedById:k}){let v=C(e,zr,"md"),d=C(o,rs,"md"),u=w?"error":t,y=r!=="other"?C(r,i0,"outline"):null,c=y?C(u,y,"primary"):null,T="K\xE9o th\u1EA3 t\u1EC7p tin v\xE0o \u0111\xE2y, ho\u1EB7c nh\u1EA5n \u0111\u1EC3 duy\u1EC7t file",R="H\u1ED7 tr\u1EE3 t\xE0i li\u1EC7u PDF, Office, t\u1EC7p n\xE9n ZIP, media...",I=f==="reject"?"border-error-500 bg-error-50/50 ring-2 ring-error-500/20 text-error-900":f==="active"?c?.active||"border-primary-500 bg-primary-50 ring-2 ring-primary-500/20":c?.idle||"border-neutral-300 bg-neutral-50/50 hover:border-primary-500 hover:bg-primary-50/30",E=H=>{a||l||s||(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),h?.())};if(i){let H=`group relative w-full ${v.compactMinHeight} ${v.compactPadding} ${d} border-2 border-dashed flex items-center justify-between gap-3 text-left transition-colors duration-150 ease-in-out cursor-pointer select-none ${I} ${a||s?"opacity-50 cursor-not-allowed pointer-events-none bg-neutral-100":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${S}`,V={role:"button",tabIndex:a||s?-1:0,"aria-label":"Khu v\u1EF1c t\u1EA3i t\u1EC7p l\xEAn thu g\u1ECDn","aria-disabled":a||s,"aria-invalid":w,"aria-describedby":k,"aria-busy":l,className:H,onKeyDown:E},W=x?x(V):V;return xs("div",{...W,children:[xs("div",{className:"flex items-center gap-2.5 min-w-0 flex-1",children:[ur("div",{className:`transition-colors shrink-0 ${c?.iconColor||"text-primary-500"}`,children:l&&m?ur(Pe,{width:18,height:18,className:"animate-spin text-primary-600"}):b||ur(Ot,{width:18,height:18})}),ur("span",{className:`truncate text-neutral-700 font-medium ${v.descSize}`,children:g||"K\xE9o th\u1EA3 ho\u1EB7c nh\u1EA5n \u0111\u1EC3 t\u1EA3i t\u1EC7p l\xEAn"})]}),ur("span",{className:`shrink-0 text-primary-600 group-hover:text-primary-700 font-semibold ${v.descSize}`,children:"Ch\u1ECDn file"})]})}let P=`group relative w-full ${n==="square"?"aspect-square w-full":C(e,n0,"md")} ${v.dropzonePadding} ${d} border-2 border-dashed flex flex-col items-center justify-center text-center transition-colors duration-150 ease-in-out cursor-pointer select-none ${I} ${a||s?"opacity-50 cursor-not-allowed pointer-events-none bg-neutral-100":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${S}`,F={role:"button",tabIndex:a||s?-1:0,"aria-label":"Khu v\u1EF1c k\xE9o th\u1EA3 v\xE0 t\u1EA3i t\u1EC7p tin l\xEAn","aria-disabled":a||s,"aria-invalid":w,"aria-describedby":k,"aria-busy":l,className:P,onKeyDown:E},z=x?x(F):F;return ur("div",{...z,children:l&&m?xs("div",{className:`flex flex-col items-center justify-center gap-2 ${c?.iconColor||"text-primary-600"}`,children:[ur(Pe,{width:v.iconSize*.8,height:v.iconSize*.8}),ur("span",{className:`${v.titleSize} font-medium`,children:"\u0110ang x\u1EED l\xFD t\u1EC7p tin..."})]}):xs("div",{className:"flex flex-col items-center justify-center gap-2",children:[ur("div",{className:`transition-colors ${c?.iconColor||"text-primary-500"}`,children:b||ur(Ot,{width:v.iconSize,height:v.iconSize})}),ur("div",{className:`${v.titleSize} font-medium text-neutral-800 ${c?.titleHover||"group-hover:text-primary-600"} transition-colors`,children:l?"\u0110ang x\u1EED l\xFD t\u1EC7p tin...":g??T}),ur("div",{id:k,className:`${v.descSize} text-neutral-500`,children:p??R})]})})}import{useMemo as pv}from"react";import{jsx as Li,jsxs as D0}from"react/jsx-runtime";function Mn({file:e,fileName:t,category:r,size:o="md",className:n=""}){let i=pv(()=>{if(r)return r;let m=t||(e?Ct(e):"");return ls(e||m)},[r,e,t]),a=C(i,s0,"other"),s=typeof o=="number"?o:C(o,zr,"md").fileIconSize,l=Math.max(8,Math.round(s*.22));return D0("div",{role:"img","aria-label":`Bi\u1EC3u t\u01B0\u1EE3ng \u0111\u1ECBnh d\u1EA1ng t\u1EC7p ${a.label}`,style:{width:s,height:s},className:`relative inline-flex items-center justify-center shrink-0 select-none ${n}`,children:[D0("svg",{viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-full h-full drop-shadow-xs transition-transform",children:[Li("path",{d:"M8 5C8 3.9 8.9 3 10 3H26L34 11V35C34 36.1 33.1 37 32 37H10C8.9 37 8 36.1 8 35V5Z",className:"fill-neutral-50 stroke-neutral-300 transition-colors",strokeWidth:"1.5",strokeLinejoin:"round"}),Li("path",{d:"M26 3V10C26 10.55 26.45 11 27 11H34",className:"fill-neutral-200 stroke-neutral-300",strokeWidth:"1.5",strokeLinejoin:"round"}),Li("line",{x1:"13",y1:"15",x2:"23",y2:"15",className:"stroke-neutral-300",strokeWidth:"1.5",strokeLinecap:"round"}),Li("line",{x1:"13",y1:"19",x2:"27",y2:"19",className:"stroke-neutral-300",strokeWidth:"1.5",strokeLinecap:"round"})]}),Li("div",{style:{fontSize:`${l}px`},className:`absolute bottom-1 right-0.5 px-1 py-0.2 rounded font-bold tracking-tight border shadow-2xs leading-none uppercase ${a.bg} ${a.text} ${a.border}`,children:a.label})]})}import{jsx as _e,jsxs as xr}from"react/jsx-runtime";function Bi({item:e,index:t,listType:r="list",size:o="md",radius:n,disabled:i=!1,readOnly:a=!1,showPreviewButton:s=!0,showDownloadButton:l=!0,showRemoveButton:m=!0,onRemove:f,onPreview:w,onDownload:g,onRetry:p,renderItem:b,className:h=""}){let x=C(o,zr,"md"),S=C(n,rs,"md"),k=Ct(e),v=bc(e),{status:d,progress:u,error:y}=hc(e),c=d==="uploading",T=d==="error",R=()=>{i||a||f?.(e,t)},D=()=>{i||w?.(e)},N=()=>{i||g?.(e)},I=()=>{i||a||p?.(e,t)};if(b)return _e("li",{"data-testid":"upload-file-item",className:"list-none w-full",children:b(e,t,{remove:R,preview:D,download:N})});let E=P=>{i||(P.key==="Delete"||P.key==="Backspace")&&!a&&(P.preventDefault(),R())};return r==="grid"?xr("li",{"data-testid":"upload-file-item",tabIndex:i?-1:0,onKeyDown:E,"aria-label":`T\u1EC7p tin ${k}`,className:`group relative list-none flex flex-col justify-between p-3 ${S} border border-neutral-200 bg-white hover:border-primary-300 hover:shadow-xs transition-colors duration-150 ease-in-out focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${i?"opacity-50 pointer-events-none bg-neutral-50":""} ${T?"border-error-300 bg-error-50/20":""} ${h}`,children:[xr("div",{className:"flex items-start gap-2.5",children:[_e(Mn,{file:e,size:o}),xr("div",{className:"flex-1 min-w-0",children:[w&&!i?_e("button",{type:"button",title:k,onClick:D,className:`truncate text-left font-medium text-neutral-800 ${x.fileNameSize} hover:text-primary-600 hover:underline cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500 rounded-xs block w-full`,children:k}):_e("p",{title:k,className:`truncate font-medium text-neutral-800 ${x.fileNameSize}`,children:k}),_e("p",{className:`text-neutral-500 ${x.fileMetaSize}`,children:T?_e("span",{className:"text-error-600 font-medium truncate block",children:y||"L\u1ED7i t\u1EA3i l\xEAn"}):c?xr("span",{className:"text-primary-600 flex items-center gap-1 font-medium",children:[_e(Pe,{width:12,height:12,className:"animate-spin inline"}),"\u0110ang t\u1EA3i... ",u!==void 0?`${u}%`:""]}):v!==void 0?Pr(v):null})]})]}),c&&u!==void 0&&_e("div",{className:"w-full bg-neutral-100 rounded-full h-1.5 mt-2 overflow-hidden",children:_e("div",{className:"bg-primary-500 h-1.5 rounded-full transition-[width] duration-300 ease-out",style:{width:`${Math.min(100,Math.max(0,u))}%`}})}),xr("div",{className:"flex items-center justify-end gap-1 mt-2.5 pt-2 border-t border-neutral-100",children:[T&&p&&!a&&_e("button",{type:"button",disabled:i,onClick:I,"aria-label":`Th\u1EED l\u1EA1i t\u1EA3i l\xEAn ${k}`,title:"Th\u1EED l\u1EA1i",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${x.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:_e(_t,{width:14,height:14})}),s&&w&&_e("button",{type:"button",disabled:i,onClick:D,"aria-label":`Xem tr\u01B0\u1EDBc t\u1EC7p ${k}`,title:"Xem tr\u01B0\u1EDBc",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${x.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:_e(jr,{width:14,height:14})}),l&&_e("button",{type:"button",disabled:i,onClick:N,"aria-label":`T\u1EA3i xu\u1ED1ng t\u1EC7p ${k}`,title:"T\u1EA3i xu\u1ED1ng",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${x.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:_e(Sr,{width:14,height:14})}),m&&!a&&_e("button",{type:"button",disabled:i,onClick:R,"aria-label":`X\xF3a t\u1EC7p ${k}`,title:"X\xF3a t\u1EC7p",className:`text-neutral-400 hover:text-error-600 hover:bg-error-50 ${x.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:_e(pr,{width:14,height:14})})]})]}):xr("li",{"data-testid":"upload-file-item",tabIndex:i?-1:0,onKeyDown:E,"aria-label":`T\u1EC7p tin ${k}`,className:`group relative list-none flex flex-col w-full ${x.itemPadding} ${S} border border-neutral-200 bg-white hover:border-primary-300 hover:bg-neutral-50/50 transition-colors duration-150 ease-in-out focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${i?"opacity-50 pointer-events-none bg-neutral-50":""} ${T?"border-error-300 bg-error-50/20":""} ${h}`,children:[xr("div",{className:"flex items-center justify-between gap-3 w-full",children:[xr("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[_e(Mn,{file:e,size:o}),xr("div",{className:"flex flex-col min-w-0 flex-1",children:[_e("div",{className:"flex items-center gap-2",children:w&&!i?_e("button",{type:"button",title:k,onClick:D,className:`truncate text-left font-medium text-neutral-800 ${x.fileNameSize} hover:text-primary-600 hover:underline cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500 rounded-xs`,children:k}):_e("span",{title:k,className:`truncate font-medium text-neutral-800 ${x.fileNameSize}`,children:k})}),_e("div",{className:`flex items-center gap-2 text-neutral-500 ${x.fileMetaSize}`,children:T?_e("span",{className:"text-error-600 font-medium truncate",children:y||"L\u1ED7i t\u1EA3i l\xEAn"}):c?xr("span",{className:"text-primary-600 flex items-center gap-1 font-medium",children:[_e(Pe,{width:12,height:12,className:"animate-spin inline"}),"\u0110ang t\u1EA3i l\xEAn... ",u!==void 0?`${u}%`:""]}):v!==void 0?_e("span",{children:Pr(v)}):null})]})]}),xr("div",{className:"flex items-center gap-1 shrink-0",children:[T&&p&&!a&&_e("button",{type:"button",disabled:i,onClick:I,"aria-label":`Th\u1EED l\u1EA1i t\u1EA3i l\xEAn ${k}`,title:"Th\u1EED l\u1EA1i",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${x.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:_e(_t,{width:15,height:15})}),s&&w&&_e("button",{type:"button",disabled:i,onClick:D,"aria-label":`Xem tr\u01B0\u1EDBc t\u1EC7p ${k}`,title:"Xem tr\u01B0\u1EDBc",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${x.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:_e(jr,{width:15,height:15})}),l&&_e("button",{type:"button",disabled:i,onClick:N,"aria-label":`T\u1EA3i xu\u1ED1ng t\u1EC7p ${k}`,title:"T\u1EA3i xu\u1ED1ng",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${x.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:_e(Sr,{width:15,height:15})}),m&&!a&&_e("button",{type:"button",disabled:i,onClick:R,"aria-label":`X\xF3a t\u1EC7p ${k}`,title:"X\xF3a t\u1EC7p",className:`text-neutral-400 hover:text-error-600 hover:bg-error-50 ${x.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:_e(pr,{width:15,height:15})})]})]}),c&&u!==void 0&&_e("div",{className:"w-full bg-neutral-100 rounded-full h-1 mt-2 overflow-hidden",children:_e("div",{className:"bg-primary-500 h-1 rounded-full transition-[width] duration-300 ease-out",style:{width:`${Math.min(100,Math.max(0,u))}%`}})})]})}import{jsx as N0}from"react/jsx-runtime";function Hi({items:e,listType:t="list",size:r="md",color:o="primary",radius:n,disabled:i=!1,readOnly:a=!1,showPreviewButton:s=!0,showDownloadButton:l=!0,showRemoveButton:m=!0,onRemove:f,onPreview:w,onDownload:g,onRetry:p,renderItem:b,className:h=""}){let x=C(r,zr,"md"),S=t==="grid"?`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 ${x.gap} list-none p-0 m-0 ${h}`:`flex flex-col ${x.gap} list-none p-0 m-0 ${h}`;return!e||e.length===0?null:N0("ul",{"aria-label":"Danh s\xE1ch t\u1EC7p tin \u0111\xE3 t\u1EA3i l\xEAn",className:S,children:e.map((k,v)=>{let d=l0(k,v);return N0(Bi,{item:k,index:v,listType:t,size:r,radius:n,color:o,disabled:i,readOnly:a,showPreviewButton:s,showDownloadButton:l,showRemoveButton:m,onRemove:f,onPreview:w,onDownload:g,onRetry:p,renderItem:b},d)})})}import{jsx as vr,jsxs as kc}from"react/jsx-runtime";function Rc({value:e,defaultValue:t,onChange:r,onRemove:o,onPreview:n,onDownload:i,onRetry:a,maxCount:s,maxSize:l,minSize:m,accept:f,beforeUpload:w,viewMode:g="dropzone",listType:p="list",shape:b="rectangle",size:h="md",color:x="primary",variant:S="outline",radius:k,label:v,labelClassName:d="",helperText:u,errorMessage:y,disabled:c=!1,readOnly:T=!1,dropzoneTitle:R,dropzoneDescription:D,buttonText:N="T\u1EA3i t\u1EC7p l\xEAn",icon:I,renderItem:E,className:P="",dropzoneClassName:F="",listClassName:z="",previewClassName:H="",helperClassName:V="",config:W}){let{isRequired:L=!1,isInvalid:M=!1,isLoading:O=!1,showSpinner:A=!1,multiple:U=!1,showFileList:G=!0,showPreviewButton:K=!0,showDownloadButton:q=!0,showRemoveButton:X=!0}=W??{},fe=mv(),ae=`${fe}-input`,_=`${fe}-error-helper`,Z=e!==void 0,[he,xe]=vs(()=>Ao(t)),$=P0(()=>Z?Ao(e):he,[Z,e,he]),[re,ee]=vs(null),[de,ne]=vs(null),[ze,ve]=vs(""),Ce=C(h,zr,"md"),J=k??"md",j=!!(M||y||re),oe=y||re,ue=j?"text-error-600":C(j?"error":x,o0,"primary"),ce=s??(U?void 0:1),ke=le=>{Z||xe(le),r?.(le)},Te=P0(()=>Di(f),[f]),{getRootProps:pe,getInputProps:Y,isDragActive:me,isDragReject:De,open:ie}=gv({multiple:U,maxSize:l,minSize:m,accept:Te,disabled:c||T||O,noClick:g==="button",noKeyboard:g==="button",onDropAccepted:async le=>{if(c||T||(ee(null),le.length===0))return;let ge=le,Me=$.length;if(ce!==void 0)if(U){let Be=ce-Me;if(Be<=0){let je=`S\u1ED1 l\u01B0\u1EE3ng t\u1EC7p \u0111\xE3 \u0111\u1EA1t t\u1ED1i \u0111a (${ce} t\u1EC7p)`;ee(je),ve(je);return}ge=le.slice(0,Be)}else{let Be=le[0];if(!Be)return;ge=[Be]}let Le=await Promise.all(ge.map(async Be=>{if(w)try{let je=await w(Be);if(je===!1||typeof je=="string")return{file:null,error:typeof je=="string"?je:`T\u1EC7p ${Be.name} \u0111\xE3 b\u1ECB t\u1EEB ch\u1ED1i`}}catch(je){return{file:null,error:je instanceof Error?je.message:`Kh\xF4ng th\u1EC3 x\u1EED l\xFD t\u1EC7p ${Be.name}`}}return{file:Be,error:null}})),Ve=[];for(let Be of Le)Be.error?(ee(Be.error),ve(`L\u1ED7i: ${Be.error}`)):Be.file&&Ve.push(Be.file);if(Ve.length>0){let Be=U?[...$,...Ve]:Ve;ke(Be),ve(`\u0110\xE3 th\xEAm ${Ve.length} t\u1EC7p tin. T\u1ED5ng c\u1ED9ng: ${Be.length} t\u1EC7p.`)}},onDropRejected:le=>{let ge=le[0]?.errors[0];if(!ge)return;let Me=ge.message||"T\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7";ge.code==="file-too-large"?Me=`K\xEDch th\u01B0\u1EDBc t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n cho ph\xE9p (${Pr(l||0)})`:ge.code==="file-too-small"?Me=`K\xEDch th\u01B0\u1EDBc t\u1EC7p nh\u1ECF h\u01A1n gi\u1EDBi h\u1EA1n t\u1ED1i thi\u1EC3u (${Pr(m||0)})`:ge.code==="file-invalid-type"?Me=`\u0110\u1ECBnh d\u1EA1ng t\u1EC7p kh\xF4ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3. C\xE1c \u0111\u1ECBnh d\u1EA1ng cho ph\xE9p: ${typeof f=="string"?f:Object.keys(f||{}).join(", ")}`:ge.code==="too-many-files"&&(Me=`S\u1ED1 l\u01B0\u1EE3ng t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n cho ph\xE9p (${ce} t\u1EC7p)`),ee(Me),ve(`L\u1ED7i t\u1EC7p: ${Me}`)}}),B=(le,ge)=>{if(c||T)return;let Me=$.filter((Le,Ve)=>Ve!==ge);ke(Me),o?.(le,ge),ve(`\u0110\xE3 x\xF3a t\u1EC7p tin ${Ct(le)}`)},se=le=>{ne(le),n?.(le)},Ie=le=>{i?.(le);let ge=Ct(le);if(le instanceof File){let Me=URL.createObjectURL(le);Ir(Me,le.name),setTimeout(()=>URL.revokeObjectURL(Me),1e3);return}if(typeof le=="string"){Ir(le,ge);return}typeof le=="object"&&le&&typeof le.src=="string"&&Ir(le.src,le.name||ge)},Ae=H||z;return kc("div",{className:`group/field relative flex flex-col w-full ${P}`,children:[vr("input",{...Y({id:ae,disabled:c||O,"aria-hidden":!0,tabIndex:-1,className:"hidden"})}),vr("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:ze}),v&&kc("label",{htmlFor:ae,className:`block font-medium transition-colors duration-150 ${Ce.labelSize} ${ue} ${d}`,children:[v,L&&vr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),kc("div",{className:"flex flex-col gap-3",children:[g==="dropzone"&&vr(Fn,{size:h,color:x,variant:S,radius:J,shape:b,disabled:c,readOnly:T,isLoading:O,showSpinner:A,dragStatus:De?"reject":me?"active":"idle",isInvalid:j,dropzoneTitle:R,dropzoneDescription:D,icon:I,onTriggerUpload:ie,getRootProps:pe,className:F,describedById:oe||u?_:void 0}),g==="compact"&&vr(Fn,{size:h,color:x,variant:S,radius:J,compact:!0,disabled:c,readOnly:T,isLoading:O,showSpinner:A,dragStatus:De?"reject":me?"active":"idle",isInvalid:j,dropzoneTitle:R,dropzoneDescription:D,icon:I,onTriggerUpload:ie,getRootProps:pe,className:F,describedById:oe||u?_:void 0}),g==="button"&&vr("div",{className:"flex items-center gap-3",children:vr(er,{type:"button",size:Ce.buttonSize,color:j?"error":x==="neutral"?"secondary":x,variant:S==="other"?"filled":S,radius:k,disabled:c||T||O||ce!==void 0&&$.length>=ce,isLoading:O,showSpinner:A,onClick:ie,leftIcon:vr(Ot,{width:Ce.iconSize*.5,height:Ce.iconSize*.5}),"aria-label":"T\u1EA3i t\u1EC7p l\xEAn",children:N})}),G&&$.length>0&&vr(Hi,{items:$,listType:p,size:h,color:x,variant:S,radius:J,disabled:c,readOnly:T,maxCount:ce,showPreviewButton:K,showDownloadButton:q,showRemoveButton:X,onRemove:B,onPreview:se,onDownload:Ie,onRetry:a,renderItem:E,className:Ae})]}),vr(He,{id:_,helperText:u,errorMessage:j?oe:void 0,sizeClassName:Ce.helperSize,className:V}),de&&vr(hr,{open:!!de,onClose:()=>ne(null),file:de})]})}var z0=300,mo={xs:{dialog:"max-w-[320px] p-4 gap-3",header:"gap-2.5",body:"text-xs",footer:"gap-2 pt-2",title:"text-sm font-semibold leading-tight text-neutral-900",description:"text-xs leading-normal text-neutral-600",iconWrapper:"size-7 rounded-full",icon:"size-4",buttonSize:"xs",buttonGap:"gap-2",closeButton:"size-5 p-0.5 -mr-1 -mt-1",closeIcon:"size-3.5"},sm:{dialog:"max-w-[380px] p-5 gap-3.5",header:"gap-3",body:"text-sm",footer:"gap-2.5 pt-2.5",title:"text-base font-semibold leading-tight text-neutral-900",description:"text-sm leading-normal text-neutral-600",iconWrapper:"size-9 rounded-full",icon:"size-5",buttonSize:"sm",buttonGap:"gap-2.5",closeButton:"size-6 p-0.5 -mr-1 -mt-1",closeIcon:"size-4"},md:{dialog:"max-w-[440px] p-6 gap-4",header:"gap-3.5",body:"text-sm",footer:"gap-3 pt-3",title:"text-lg font-semibold leading-tight text-neutral-900",description:"text-sm leading-relaxed text-neutral-600",iconWrapper:"size-10 rounded-full",icon:"size-5",buttonSize:"md",buttonGap:"gap-3",closeButton:"size-7 p-1 -mr-1.5 -mt-1.5",closeIcon:"size-4"},lg:{dialog:"max-w-[520px] p-7 gap-5",header:"gap-4",body:"text-base",footer:"gap-3.5 pt-3.5",title:"text-xl font-semibold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",iconWrapper:"size-12 rounded-full",icon:"size-6",buttonSize:"lg",buttonGap:"gap-3.5",closeButton:"size-8 p-1.5 -mr-1.5 -mt-1.5",closeIcon:"size-4.5"},xl:{dialog:"max-w-[600px] p-8 gap-6",header:"gap-4.5",body:"text-lg",footer:"gap-4 pt-4",title:"text-2xl font-bold leading-snug text-neutral-900",description:"text-lg leading-relaxed text-neutral-600",iconWrapper:"size-14 rounded-full",icon:"size-7",buttonSize:"xl",buttonGap:"gap-4",closeButton:"size-9 p-1.5 -mr-2 -mt-2",closeIcon:"size-5"}},I0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},F0={primary:"bg-primary-50 text-primary-600 border border-primary-200",secondary:"bg-secondary-50 text-secondary-600 border border-secondary-200",neutral:"bg-neutral-100 text-neutral-600 border border-neutral-200",error:"bg-error-50 text-error-600 border border-error-200",success:"bg-success-50 text-success-600 border border-success-200",warning:"bg-warning-50 text-warning-600 border border-warning-200",info:"bg-info-50 text-info-600 border border-info-200"},M0={warning:Fs,error:Ms,success:Is,info:qo,primary:qo,secondary:qo,neutral:qo};import{jsx as bv}from"react/jsx-runtime";function Dc({size:e,radius:t,className:r="",children:o,ref:n,...i}){let a=Je(),s=C(e??a?.size,mo,"md"),l=C(t,I0,"lg"),m=["relative flex flex-col w-full bg-neutral-white shadow-2xl border-2 border-neutral-200 outline-none text-neutral-900 pointer-events-auto",s.dialog,l,r].filter(Boolean).join(" ");return bv("div",{ref:n,tabIndex:-1,className:m,...i,children:o})}import{useEffect as ys,useEffectEvent as hv,useCallback as xv,useMemo as vv,useRef as E0,useState as yv}from"react";import{jsx as ws,jsxs as wv}from"react/jsx-runtime";function Nc({open:e=!1,size:t="md",color:r="warning",isLoading:o=!1,closeOnOverlayClick:n=!0,closeOnEsc:i=!0,lockScroll:a=!0,overlayClassName:s="",className:l="",toaster:m=!0,children:f,onClose:w,...g}){let p=E0(null),[b,h]=yv(!1),x=E0(null),S=xv(()=>{b||o||(h(!0),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{h(!1),w?.()},z0))},[b,o,w]),k=vv(()=>({onClose:S,isLoading:o,size:t,color:r,dialogRef:p}),[S,o,t,r]);ys(()=>()=>{x.current&&clearTimeout(x.current)},[]),ys(()=>{let c=p.current;if(c)if(e||b){if(!c.open)try{c.showModal()}catch{}}else c.open&&c.close()},[e,b]),ys(()=>{if(!a)return;let c=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=c}},[a]);let v=hv(c=>{!e||i===!1||c.key==="Escape"&&(c.preventDefault(),c.stopPropagation(),S())});if(ys(()=>(window.addEventListener("keydown",v),()=>{window.removeEventListener("keydown",v)}),[]),!e&&!b)return null;let d=()=>{n&&S()},u=b?"animate-confirm-backdrop-out pointer-events-none":"animate-confirm-backdrop-in",y=b?"animate-confirm-out pointer-events-none":"animate-confirm-in";return ws(Pl.Provider,{value:k,children:wv("dialog",{ref:p,"aria-labelledby":"confirm-dialog-title","aria-describedby":"confirm-dialog-description",onCancel:c=>{c.preventDefault(),i!==!1&&S()},className:`fixed inset-0 flex items-center justify-center p-4 bg-neutral-950/40 backdrop-blur-xs border-none m-0 max-w-none max-h-none w-screen h-screen overflow-visible backdrop:bg-transparent ${u} ${s}`,...g,children:[m!==!1&&ws(An,{position:"top-right",...typeof m=="object"?m:{}}),ws("div",{"aria-hidden":"true",onClick:d,className:"fixed inset-0 -z-10"}),ws("div",{className:`w-full flex items-center justify-center pointer-events-none ${y} ${l}`,children:f})]})})}import{jsx as En,jsxs as $0}from"react/jsx-runtime";function Pc({size:e,color:t,icon:r=!0,title:o,iconClassName:n="",titleClassName:i="",showCloseButton:a=!1,onClose:s,closeButtonClassName:l="",className:m="",children:f,...w}){let g=Je(),p=C(e??g?.size,mo,"md"),b=C(t??g?.color,F0,"warning"),h=g?.isLoading,x=()=>{s?.(),g?.onClose?.()},S=!!(s||g?.onClose),k=()=>{if(r===!1)return null;if(r!==void 0&&r!==!0)return En("div",{className:`inline-flex items-center justify-center shrink-0 ${p.iconWrapper} ${b} ${n}`,"aria-hidden":"true",children:r});let v=C(t??g?.color,M0,"warning");return En("div",{className:`inline-flex items-center justify-center shrink-0 ${p.iconWrapper} ${b} ${n}`,"aria-hidden":"true",children:En(v,{className:p.icon})})};return $0("div",{className:`flex items-start justify-between w-full ${p.header} ${m}`,...w,children:[$0("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[k(),o&&En("h3",{className:`${p.title} truncate ${i}`,id:"confirm-dialog-title",children:o}),f]}),a&&S&&En("button",{type:"button",onClick:x,disabled:h,"aria-label":"\u0110\xF3ng h\u1ED9p tho\u1EA1i",className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-700 hover:bg-neutral-100 rounded-md transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-neutral-400 ${p.closeButton} ${l}`,children:En(Ye,{className:p.closeIcon})})]})}import{jsx as Cv,jsxs as Sv}from"react/jsx-runtime";function zc({size:e,description:t,descriptionClassName:r="",className:o="",children:n,...i}){let a=Je(),s=C(e??a?.size,mo,"md");return Sv("div",{className:`w-full ${s.body} ${o}`,id:"confirm-dialog-description",...i,children:[t?Cv("p",{className:`${s.description} ${r}`,children:t}):null,n]})}import{jsx as Ic,jsxs as Tv}from"react/jsx-runtime";function Fc({size:e,confirmText:t="X\xE1c nh\u1EADn",cancelText:r="H\u1EE7y",confirmVariant:o="filled",cancelVariant:n="outline",confirmColor:i,cancelColor:a="secondary",onConfirm:s,onCancel:l,onClose:m,confirmButtonProps:f,cancelButtonProps:w,className:g="",children:p,...b}){let h=Je(),x=C(e??h?.size,mo,"md"),S=i??h?.color??"warning",k=()=>{m?.(),h?.onClose?.()},v=async()=>{try{let u=s?.();u&&"then"in u&&await u,k()}catch{}},d=()=>{l?.(),k()};return p?Ic("div",{className:`flex items-center justify-end w-full ${x.footer} ${x.buttonGap} ${g}`,...b,children:p}):Tv("div",{className:`flex items-center justify-end w-full ${x.footer} ${x.buttonGap} ${g}`,...b,children:[r!==!1&&Ic(er,{size:x.buttonSize,variant:n,color:a,onClick:d,disabled:w?.disabled||h?.isLoading,...w,children:r}),Ic(er,{size:x.buttonSize,variant:o,color:S,isLoading:h?.isLoading||f?.isLoading,disabled:f?.disabled,onClick:v,...f,children:t})]})}import{cloneElement as kv,isValidElement as Rv}from"react";import{jsx as Dv}from"react/jsx-runtime";function Mc({children:e,asChild:t=!0,onClick:r,...o}){let n=Je(),i=n?.isLoading,a=s=>{r?.(s),s.defaultPrevented||n?.onClose?.()};if(t&&Rv(e)){let s=e;return kv(s,{disabled:s.props.disabled||i,onClick:l=>{s.props.onClick?.(l),a(l)},...o})}return Dv("button",{type:"button",onClick:a,disabled:i,...o,children:e})}import{jsx as Nv}from"react/jsx-runtime";function Ec({size:e,className:t="",children:r,...o}){let n=Ze(),i=C(e??n?.size,po,"md");return Nv("div",{className:`flex items-center justify-end w-full border-t border-neutral-100 pt-2 ${i.footer} ${i.buttonGap} ${t}`,...o,children:r})}import{cloneElement as Pv,isValidElement as zv}from"react";import{jsx as Iv}from"react/jsx-runtime";function $c({children:e,asChild:t=!0,onClick:r,...o}){let n=Ze(),i=n?.isLoading,a=s=>{r?.(s),s.defaultPrevented||n?.onClose?.()};if(t&&zv(e)){let s=e;return Pv(s,{disabled:s.props.disabled||i,onClick:l=>{s.props.onClick?.(l),a(l)},...o})}return Iv("button",{type:"button",onClick:a,disabled:i,...o,children:e})}import{createContext as Fv,useContext as Mv,useMemo as Ev}from"react";import{jsx as Fr}from"react/jsx-runtime";var L0=Fv({size:"md",variantStyles:Ai.default}),$n=()=>Mv(L0);function Cs({variant:e="default",size:t="md",className:r="",containerClassName:o="",wrapperProps:n,children:i,ref:a,...s}){let l=C(e,Ai,"default"),m=Ev(()=>({size:t,variantStyles:l}),[t,l]);return Fr(L0.Provider,{value:m,children:Fr("div",{className:`w-full overflow-x-auto rounded-lg ${l.container} ${o}`.trim(),...n,children:Fr("table",{ref:a,className:`w-full text-left caption-bottom ${l.table} ${r}`.trim(),...s,children:i})})})}function Ss({className:e="",children:t,ref:r,...o}){let{variantStyles:n}=$n();return Fr("thead",{ref:r,className:`${n.head} ${e}`.trim(),...o,children:t})}function Ts({className:e="",children:t,ref:r,...o}){return Fr("tbody",{ref:r,className:`divide-y divide-neutral-200/70 ${e}`.trim(),...o,children:t})}function B0({className:e="",children:t,ref:r,...o}){return Fr("tfoot",{ref:r,className:`border-t border-neutral-200 bg-neutral-50/60 font-medium text-neutral-600 ${e}`.trim(),...o,children:t})}function go({isSelected:e=!1,isHoverable:t=!0,className:r="",children:o,ref:n,...i}){let{variantStyles:a}=$n(),s=e?"bg-primary-50/70 hover:bg-primary-50 text-primary-950 font-medium":"",l=t&&!e?a.row:"";return Fr("tr",{ref:n,"data-state":e?"selected":void 0,"aria-selected":e,className:`${l} ${s} ${r}`.trim(),...i,children:o})}function bo({align:e="left",className:t="",children:r,ref:o,...n}){let{size:i}=$n(),a=C(i,Vi,"md"),s=C(e,Oi,"left");return Fr("th",{ref:o,className:`tracking-wider ${a.head} ${s} ${t}`.trim(),...n,children:r})}function ho({align:e="left",className:t="",children:r,ref:o,...n}){let{size:i,variantStyles:a}=$n(),s=C(i,Vi,"md"),l=C(e,Oi,"left");return Fr("td",{ref:o,className:`align-middle ${s.cell} ${a.cell} ${l} ${t}`.trim(),...n,children:r})}function H0({className:e="",children:t,ref:r,...o}){return Fr("caption",{ref:r,className:`mt-3 text-xs text-neutral-500 ${e}`.trim(),...o,children:t})}import{jsx as _o,jsxs as $v}from"react/jsx-runtime";function Ln({column:e,title:t,className:r="",...o}){if(!e.getCanSort())return _o("div",{className:`font-semibold ${r}`.trim(),...o,children:t});let n=e.getIsSorted(),i=a=>{a.preventDefault();let s=e.getToggleSortingHandler();s&&s(a)};return _o("div",{className:`flex items-center space-x-1.5 ${r}`.trim(),...o,children:$v("button",{type:"button",onClick:i,className:"group inline-flex items-center gap-1.5 font-semibold text-inherit hover:text-neutral-900 transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 rounded px-1 py-0.5 -mx-1",children:[_o("span",{children:t}),_o("span",{className:"shrink-0 inline-flex items-center justify-center","aria-hidden":"true",children:n==="asc"?_o(ga,{className:"w-3.5 h-3.5 text-primary-600"}):n==="desc"?_o(ba,{className:"w-3.5 h-3.5 text-primary-600"}):_o(ma,{className:"w-3.5 h-3.5 text-neutral-400 opacity-60 group-hover:opacity-100 transition-opacity"})})]})})}import{useSortable as Lv}from"@dnd-kit/sortable";import{CSS as Bv}from"@dnd-kit/utilities";import{jsx as V0}from"react/jsx-runtime";function Lc({header:e,canSort:t=!1,headerContent:r,ariaSort:o,disabled:n=!1,className:i=""}){let a=e.column.id==="_select"||e.column.id==="_expand",s=n||a,{attributes:l,listeners:m,setNodeRef:f,transform:w,transition:g,isDragging:p}=Lv({id:e.column.id,disabled:s}),b={transform:Bv.Translate.toString(w),transition:g,opacity:p?.75:1,position:p?"relative":void 0,zIndex:p?20:void 0,whiteSpace:"nowrap"},h=t&&typeof e.column.columnDef.header=="string"?V0(Ln,{column:e.column,title:e.column.columnDef.header}):r;return V0(bo,{ref:f,style:b,"aria-sort":o,"data-column-id":e.column.id,...s?{}:l,...s?{}:m,className:`
3
3
  ${s?"":"select-none cursor-grab active:cursor-grabbing transition-colors"}
4
- ${m?"bg-neutral-100 shadow-md ring-1 ring-primary-500/30":""}
4
+ ${p?"bg-neutral-100 shadow-md ring-1 ring-primary-500/30":""}
5
5
  ${i}
6
- `.trim(),children:y})}import{useMemo as Mf}from"react";import{jsx as St,jsxs as Tc}from"react/jsx-runtime";function Mv(e,t){return t<=7?Array.from({length:t},(r,n)=>n+1):e<=4?[1,2,3,4,5,"...",t]:e>=t-3?[1,"...",t-4,t-3,t-2,t-1,t]:[1,"...",e-1,e,e+1,"...",t]}function bs({table:e,pageSizeOptions:t=Ei,showPageSizeSelector:r=!0,className:n=""}){let o=e.state.pagination,i=o?.pageIndex??0,a=o?.pageSize??10,s=e.getPageCount(),l=Math.max(s,1),h=i+1,d=e.getCanPreviousPage(),w=e.getCanNextPage(),p=Mf(()=>t.map(x=>({label:`${x}`,value:x})),[t]),m=Mf(()=>Mv(h,l),[h,l]);return Tc("div",{className:`flex flex-col sm:flex-row items-center justify-between gap-4 px-2 py-3 text-xs text-neutral-600 ${n}`.trim(),children:[r?Tc("div",{className:"flex items-center gap-2",children:[St("span",{className:"whitespace-nowrap",children:"S\u1ED1 d\xF2ng/trang:"}),St("div",{className:"w-20","data-testid":"table-page-size-selector",children:St(bi,{size:"sm",options:p,value:a,onChange:x=>{x!=null&&e.setPageSize(Number(x))},searchable:!1,clearable:!1,"aria-label":"S\u1ED1 d\xF2ng m\u1ED7i trang"})})]}):St("div",{}),Tc("div",{className:"flex items-center gap-1 ml-auto sm:ml-0",children:[St(fr,{icon:St(Gr,{className:"w-3.5 h-3.5"}),"aria-label":"Trang \u0111\u1EA7u",size:"sm",variant:"outline",color:"neutral",disabled:!d,onClick:()=>e.firstPage()}),St(fr,{icon:St(Yt,{className:"w-3.5 h-3.5"}),"aria-label":"Trang tr\u01B0\u1EDBc",size:"sm",variant:"outline",color:"neutral",disabled:!d,onClick:()=>e.previousPage()}),St("div",{className:"flex items-center gap-1 px-1",children:m.map((x,y)=>{if(x==="...")return St("span",{className:"w-8 h-8 flex items-center justify-center text-xs text-neutral-400 select-none",children:"..."},`ellipsis-${y}`);let b=Number(x),k=b===h;return St("button",{type:"button",onClick:()=>e.setPageIndex(b-1),"aria-label":`Trang ${b}`,"aria-current":k?"page":void 0,className:`w-8 h-8 rounded-full flex items-center justify-center text-xs transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 ${k?"border-2 border-primary-600 text-primary-600 font-semibold bg-primary-50/50":"text-neutral-700 hover:text-neutral-900 hover:bg-neutral-100 font-medium"}`,children:b},b)})}),St(fr,{icon:St(Wt,{className:"w-3.5 h-3.5"}),"aria-label":"Trang sau",size:"sm",variant:"outline",color:"neutral",disabled:!w,onClick:()=>e.nextPage()}),St(fr,{icon:St(Ur,{className:"w-3.5 h-3.5"}),"aria-label":"Trang cu\u1ED1i",size:"sm",variant:"outline",color:"neutral",disabled:!w,onClick:()=>e.lastPage()})]})]})}import{useState as Dc,useRef as Fv,useEffect as Ev,useMemo as Ff}from"react";import{useFloating as Ef,autoUpdate as $f,offset as Lf,flip as Bf,shift as Hf,useClick as Vf,useDismiss as Af,useInteractions as Of,FloatingPortal as Gf}from"@floating-ui/react";import{Fragment as Lv,jsx as nt,jsxs as nr}from"react/jsx-runtime";function Uf(e,t){if(t==null||t==="")return"Ch\u01B0a nh\u1EADp";if(t instanceof Date)return t.toLocaleDateString("vi-VN");if(Array.isArray(t)){if(t.length===0)return"Ch\u01B0a ch\u1ECDn";if(e.type==="date-range"||t[0]instanceof Date||t[1]instanceof Date){let o=s=>{if(!s)return"";if(s instanceof Date)return s.toLocaleDateString("vi-VN");let l=new Date(s);return isNaN(l.getTime())?String(s):l.toLocaleDateString("vi-VN")},i=o(t[0]),a=o(t[1]);return i&&a?`${i} - ${a}`:i||a||"Ch\u01B0a ch\u1ECDn"}let r=o=>{if(e.options&&e.options.length>0){let i=e.options.find(a=>String(a.value)===String(o));if(i)return String(i.label)}return String(o)};return t.length===1?r(t[0]):`${r(t[0])}, +${t.length-1}`}if(e.options&&e.options.length>0){let r=e.options.find(n=>String(n.value)===String(t));if(r)return String(r.label)}return String(t)}function $v({field:e,currentValue:t,isOpen:r,onOpenChange:n,onRemove:o,onChange:i}){let a=e.name,{refs:{setFloating:s,setReference:l},floatingStyles:h,context:d}=Ef({open:r,onOpenChange:n,placement:"bottom-start",transform:!1,middleware:[Lf(6),Bf(),Hf({padding:8})],whileElementsMounted:$f}),{isMounted:w,styles:p}=et(d),m=Vf(d),x=Af(d,{outsidePress:g=>!g.target?.closest?.("[data-table-filter-popover]")}),{getReferenceProps:y,getFloatingProps:b}=Of([m,x]),k=Fv(null);Ev(()=>{r&&k.current?.focus({preventScroll:!0})},[r]);let T=t!=null&&t!==""&&(!Array.isArray(t)||t.length>0&&(t[0]!=null||t[1]!=null)),v=Uf(e,t),u=e.type==="date"||e.type==="date-range",c=()=>e.type==="custom"?e.render?.({value:t,onChange:g=>i(a,g)})??null:e.type==="date-range"?nt(Tn,{portal:!1,size:"sm",radius:"md",placeholder:e.placeholder||"Ch\u1ECDn kho\u1EA3ng ng\xE0y",value:t||[null,null],onChange:g=>i(a,g),...e.props||{}}):e.type==="date"?nt(Sn,{portal:!1,size:"sm",radius:"md",placeholder:e.placeholder||"Ch\u1ECDn ng\xE0y",value:t,onChange:g=>i(a,g),...e.props||{}}):e.type==="number"?nt(dn,{ref:k,size:"sm",radius:"full",placeholder:e.placeholder||"Nh\u1EADp s\u1ED1...",value:t??"",onChange:g=>{let f=g.target.value;if(f==="")i(a,"");else{let S=Hr(f);i(a,S!==void 0?S:f)}},onClear:()=>i(a,""),...e.props||{}}):e.type==="select"||e.type==="checkbox-group"?nt(bn,{size:"sm",value:t||[],onChange:g=>i(a,g),options:(e.options||[]).map(g=>({value:String(g.value),label:g.label,disabled:g.disabled})),className:"max-h-48 overflow-y-auto py-1 gap-2",...e.props||{}}):nt(Ct,{ref:k,size:"sm",radius:"full",placeholder:e.placeholder||"Nh\u1EADp t\u1EEB kh\xF3a...",value:t||"",onChange:g=>i(a,g.target.value),...e.props||{}});return nr(Lv,{children:[nt("div",{ref:l,...y({className:"inline-flex items-center"}),children:nr($t,{size:"sm",variant:"soft",color:T||r?"primary":"neutral",radius:"full","data-testid":`filter-chip-${a}`,className:`cursor-pointer select-none transition-all duration-150 gap-1 px-3 py-1 rounded-full ${r?"ring-2 ring-primary-500/30":"hover:opacity-90"}`,onDelete:o,deleteAriaLabel:`X\xF3a b\u1ED9 l\u1ECDc ${e.label}`,children:[nr("span",{className:"font-semibold",children:[e.label,":"]}),nt("span",{"data-testid":`filter-chip-val-${a}`,className:T?"font-medium":"opacity-70 italic",children:v})]})}),w&&nt(Gf,{children:nr("div",{ref:s,"data-table-filter-popover":"true","data-testid":`filter-popover-${a}`,style:{...h,...p,zIndex:Qe.SELECT_FILTER},...b({className:`bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 rounded-lg p-3 shadow-2xl ${u?"w-auto min-w-[280px]":"min-w-64 max-w-xs"}`}),children:[nr("div",{className:"flex items-center justify-between pb-2 mb-2 border-b border-neutral-100 dark:border-neutral-800",children:[nt("span",{className:"text-xs font-bold text-neutral-800 dark:text-neutral-200",children:e.label}),nt("button",{type:"button",onClick:()=>n(!1),className:"text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-200 p-0.5 rounded transition-colors cursor-pointer",title:"\u0110\xF3ng",children:nt(Oe,{className:"w-3.5 h-3.5"})})]}),nt("div",{className:"mt-1",children:c()}),nr("div",{className:"flex items-center justify-between mt-3 pt-2 border-t border-neutral-100 dark:border-neutral-800",children:[nt("button",{type:"button",onClick:o,className:"text-[11px] text-red-500 hover:text-red-700 transition-colors cursor-pointer font-medium",children:"X\xF3a b\u1ED9 l\u1ECDc"}),nt("button",{type:"button",onClick:()=>n(!1),className:"text-[11px] font-medium text-neutral-700 dark:text-neutral-200 hover:bg-neutral-100 dark:hover:bg-neutral-800 px-2 py-0.5 rounded border border-neutral-200 dark:border-neutral-700 transition-colors cursor-pointer",children:"Xong"})]})]})})]})}function Rc({filters:e,values:t,onChange:r,onReset:n,className:o=""}){let[i,a]=Dc([]),s=Ff(()=>{let P=[],I=new Set;return e?.forEach(E=>{let N=t?.[E.name];N!=null&&N!==""&&(!Array.isArray(N)||N.length>0&&(N[0]!=null||N[1]!=null))&&(P.push(E.name),I.add(E.name))}),i.forEach(E=>{I.has(E)||(P.push(E),I.add(E))}),P},[e,t,i]),l=Ff(()=>new Set(s),[s]),[h,d]=Dc(null),[w,p]=Dc(!1),{refs:{setFloating:m,setReference:x},floatingStyles:y,context:b}=Ef({open:w,onOpenChange:p,placement:"bottom-start",transform:!1,middleware:[Lf(6),Bf(),Hf({padding:8})],whileElementsMounted:$f}),{isMounted:k,styles:T}=et(b,{duration:120}),v=Vf(b),u=Af(b,{outsidePress:P=>!P.target?.closest?.("[data-table-filter-popover]")}),{getReferenceProps:c,getFloatingProps:g}=Of([v,u]),f=P=>{l.has(P.name)||a(I=>[...I,P.name]),p(!1),d(P.name)},S=P=>{a(I=>I.filter(E=>E!==P)),h===P&&d(null),r(P,void 0)},D=P=>{P.stopPropagation(),a([]),d(null),n?.()},R=s.length>0;return!e||e.length===0?null:nr("div",{onClick:P=>P.stopPropagation(),onMouseDown:P=>P.stopPropagation(),className:`inline-flex flex-wrap items-center gap-2 ${o}`.trim(),children:[nr("div",{className:"inline-flex",children:[nr("button",{ref:x,type:"button","data-testid":"table-add-filter-button",...c({className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-neutral-700 dark:text-neutral-300 hover:text-neutral-900 dark:hover:text-neutral-100 bg-white dark:bg-neutral-800 border border-neutral-300 dark:border-neutral-700 hover:border-neutral-400 dark:hover:border-neutral-600 rounded-full transition-all shadow-xs hover:shadow-sm cursor-pointer active:scale-95"}),children:[nt(pr,{className:"w-3.5 h-3.5 text-neutral-500"}),nt("span",{children:"B\u1ED9 l\u1ECDc"}),nt(lt,{className:`w-3 h-3 text-neutral-400 transition-transform ${w?"rotate-180":""}`})]}),k&&nt(Gf,{children:nr("div",{ref:m,"data-table-filter-popover":"true","data-testid":"table-add-filter-menu",style:{...y,...T,zIndex:Qe.SELECT_FILTER},...g({className:"bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 rounded-lg p-1.5 shadow-xl min-w-48"}),children:[nt("div",{className:"px-2 py-1 text-[11px] font-semibold text-neutral-400 uppercase tracking-wider",children:"Ch\u1ECDn tr\u01B0\u1EDDng c\u1EA7n l\u1ECDc"}),nt("div",{className:"space-y-0.5 mt-0.5",children:e.map(P=>{let I=l.has(P.name);return nr("button",{type:"button","data-testid":`filter-option-${P.name}`,onClick:E=>{E.preventDefault(),E.stopPropagation(),f(P)},className:`w-full flex items-center justify-between px-2.5 py-1.5 text-xs rounded-md text-left transition-colors cursor-pointer ${I?"text-primary-600 font-medium bg-primary-50 dark:bg-primary-950/40":"text-neutral-700 dark:text-neutral-200 hover:bg-neutral-100 dark:hover:bg-neutral-800"}`,children:[nt("span",{children:P.label}),I&&nt("span",{className:"text-[10px] text-neutral-400",children:"\u0110ang l\u1ECDc"})]},P.name)})})]})})]}),e.map(P=>{if(!l.has(P.name))return null;let I=t?.[P.name],E=h===P.name;return nt($v,{field:P,currentValue:I,isOpen:E,onOpenChange:N=>{d(N?P.name:null)},onRemove:()=>S(P.name),onChange:r},P.name)}),R&&nr("button",{type:"button","data-testid":"table-filter-reset-button",onClick:D,className:"inline-flex items-center gap-1 px-2 py-1 text-xs font-medium text-neutral-500 hover:text-red-600 dark:hover:text-red-400 transition-colors cursor-pointer",title:"\u0110\u1EB7t l\u1EA1i to\xE0n b\u1ED9 b\u1ED9 l\u1ECDc",children:[nt(Lt,{className:"w-3.5 h-3.5"}),nt("span",{children:"\u0110\u1EB7t l\u1EA1i"})]})]})}import{jsx as wt,jsxs as Mo}from"react/jsx-runtime";var Bv={};function hs({table:e,searchPlaceholder:t="T\xECm ki\u1EBFm trong b\u1EA3ng...",enableGlobalFilter:r=!0,enableColumnVisibility:n=!0,isRefresh:o=!1,onRefresh:i,actions:a,selectedActions:s,filters:l,filterValues:h=Bv,onFilterChange:d,onFilterReset:w,className:p=""}){let m=e.state.globalFilter??"",x=e.getAllLeafColumns().filter(v=>v.getCanHide()),y=e.getSelectedRowModel?.()?.rows??[],b=y.length,k=v=>{e.setGlobalFilter(v.target.value)},T=()=>{e.setGlobalFilter("")};return Mo("div",{className:`flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-3 pb-3 ${p}`.trim(),children:[Mo("div",{className:"flex flex-1 flex-wrap items-center gap-3",children:[r&&Mo("div",{className:"relative w-full sm:w-64 max-w-xs",children:[wt("span",{className:"absolute inset-y-0 left-0 flex items-center pl-2.5 pointer-events-none text-neutral-400",children:wt(mn,{className:"w-4 h-4"})}),wt("input",{type:"text",value:m,onChange:k,placeholder:t,"data-testid":"table-search-input",className:"w-full h-9 pl-8 pr-8 rounded-full border border-neutral-300 bg-white text-xs sm:text-sm text-neutral-800 placeholder:text-neutral-400 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500 shadow-xs transition-colors"}),m&&wt("button",{type:"button",onClick:T,"aria-label":"X\xF3a t\xECm ki\u1EBFm","data-testid":"table-clear-search-button",className:"absolute inset-y-0 right-0 flex items-center pr-2.5 text-neutral-400 hover:text-neutral-600 cursor-pointer",children:wt(Oe,{className:"w-3.5 h-3.5"})})]}),l&&l.length>0&&d&&wt(Rc,{filters:l,values:h,onChange:d,onReset:w}),b>0&&s&&wt("div",{className:"flex items-center gap-2 animate-in fade-in-50 duration-200",children:s(y)})]}),Mo("div",{className:"flex items-center gap-2 self-end sm:self-auto",children:[(o||!!i)&&wt(fr,{icon:wt(jr,{className:"w-3.5 h-3.5"}),"aria-label":"L\xE0m m\u1EDBi d\u1EEF li\u1EC7u",title:"L\xE0m m\u1EDBi d\u1EEF li\u1EC7u",size:"sm",variant:"outline",color:"neutral",onClick:i,"data-testid":"table-refresh-button"}),n&&x.length>0&&Mo(Xo,{size:"sm",placement:"bottom-end",children:[wt(ka,{asChild:!0,children:wt(Ut,{variant:"outline",size:"sm",color:"neutral",leftIcon:wt(ua,{className:"w-3.5 h-3.5"}),children:"C\u1ED9t"})}),Mo(Cl,{className:"w-56 p-0 shadow-lg border border-neutral-200",children:[wt(kl,{className:"px-3 py-2 text-xs font-semibold text-neutral-700 border-b border-neutral-100",children:"Hi\u1EC3n th\u1ECB c\u1ED9t"}),wt(Sl,{className:"max-h-60 overflow-y-auto p-1.5 flex flex-col gap-0.5",children:x.map(v=>{let u=typeof v.columnDef.header=="string"?v.columnDef.header:v.id;return wt("div",{className:"w-full",children:wt(mr,{size:"sm",label:u,checked:v.getIsVisible(),onChange:v.getToggleVisibilityHandler(),className:"w-full",wrapperClassName:"w-full flex items-center px-2 py-1.5 rounded-md hover:bg-neutral-100/80 cursor-pointer select-none",labelClassName:"text-xs text-neutral-700 font-medium truncate"})},v.id)})})]})]}),a]})]})}import{useMemo as Pc,useState as On}from"react";import{flexRender as zc}from"@tanstack/react-table";import{DndContext as Qv,closestCenter as ey,PointerSensor as ty,KeyboardSensor as ry,useSensor as Yf,useSensors as ny}from"@dnd-kit/core";import{restrictToHorizontalAxis as oy}from"@dnd-kit/modifiers";import{arrayMove as iy,SortableContext as ay,horizontalListSortingStrategy as sy}from"@dnd-kit/sortable";import{tableFeatures as Vv,rowSortingFeature as Av,rowPaginationFeature as Ov,rowSelectionFeature as Gv,columnFilteringFeature as Uv,globalFilteringFeature as jv,columnVisibilityFeature as Yv,columnPinningFeature as Wv,columnOrderingFeature as Kv,createSortedRowModel as _v,createPaginatedRowModel as Xv,createFilteredRowModel as qv,createColumnHelper as Zv,useTable as Jv}from"@tanstack/react-table";import{rankItem as Hv}from"@tanstack/match-sorter-utils";var xs=(e,t,r,n)=>{let o=Hv(e.getValue(t),String(r??""));return n?.({itemRank:o}),o.passed};var Nc=Vv({rowSortingFeature:Av,rowPaginationFeature:Ov,rowSelectionFeature:Gv,columnFilteringFeature:Uv,globalFilteringFeature:jv,columnVisibilityFeature:Yv,columnPinningFeature:Wv,columnOrderingFeature:Kv,sortedRowModel:_v(),paginatedRowModel:Xv(),filteredRowModel:qv(),filterFns:{fuzzy:xs}});function jf(){return Zv()}function vs(e){let{features:t=Nc,columns:r,...n}=e;return Jv({features:t,columns:r,...n})}import{jsx as it,jsxs as Wf}from"react/jsx-runtime";function Kf({columns:e,data:t,variant:r="default",size:n="md",isLoading:o=!1,isRefresh:i=!1,onRefresh:a,loadingRowsCount:s=5,emptyText:l,emptyIllustration:h,enableSorting:d=!0,enableFiltering:w=!0,enablePagination:p=!0,enableRowSelection:m=!1,enableColumnVisibility:x=!0,enableColumnOrdering:y=!1,filters:b,searchPlaceholder:k,toolbarActions:T,renderBulkActions:v,pageSizeOptions:u,initialPageSize:c=$i,manualPagination:g=!1,manualSorting:f=!1,manualFiltering:S=!1,pageCount:D,rowCount:R,pagination:P,onPaginationChange:I,sorting:E,onSortingChange:N,rowSelection:M,onRowSelectionChange:z,columnVisibility:H,onColumnVisibilityChange:V,columnOrder:Y,onColumnOrderChange:$,globalFilter:F,onGlobalFilterChange:G,globalFilterFn:A,columnFilters:U,onColumnFiltersChange:B,onRowClick:X,className:le="",containerClassName:ne=""}){let[ue,ie]=On([]),[Q,q]=On({pageIndex:0,pageSize:c}),[ge,ke]=On({}),[L,te]=On({}),[Z,he]=On([]),[ae,ve]=On(""),[Se,ye]=On(()=>{if(!b)return[];let K=[];return b.forEach(_=>{_.defaultValue!==void 0&&_.defaultValue!==null&&_.defaultValue!==""&&(!Array.isArray(_.defaultValue)||_.defaultValue.length>0)&&K.push({id:_.name,value:_.defaultValue})}),K}),J=E??ue,O=K=>{let _=typeof K=="function"?K(J):K;N?N(_):ie(_)},W=P??Q,we=K=>{let _=typeof K=="function"?K(W):K;I?I(_):q(_)},fe=M??ge,se=K=>{let _=typeof K=="function"?K(fe):K;z?z(_):ke(_)},me=H??L,De=K=>{let _=typeof K=="function"?K(me):K;V?V(_):te(_)},xe=Y??Z,re=K=>{let _=typeof K=="function"?K(xe):K;$?$(_):he(_)},de=F??ae,ce=K=>{let _=typeof K=="function"?K(de):K;G?G(String(_??"")):ve(String(_??""))},ee=U??Se,j=Pc(()=>{let K={};return ee.forEach(_=>{K[_.id]=_.value}),K},[ee]),Ce=(K,_)=>{let ze=ee.filter(Me=>Me.id!==K);_!=null&&_!==""&&(!Array.isArray(_)||_.length>0)&&ze.push({id:K,value:_}),B?B(ze):ye(ze)},Ee=()=>{B?B([]):ye([])},Fe=Pc(()=>{let K=e;return!S&&b&&b.length>0&&(K=K.map(_=>{let ze=_.id??_.accessorKey,pe=b.find(Me=>Me.name===ze);return!pe||_.filterFn?_:pe.type==="select"||pe.type==="checkbox-group"?{..._,filterFn:(Me,Xe,He)=>{if(!He||Array.isArray(He)&&He.length===0)return!0;let Ze=Me.getValue(Xe);return Array.isArray(He)?He.some(qe=>String(qe).toLowerCase()===String(Ze).toLowerCase()):String(Ze).toLowerCase()===String(He).toLowerCase()}}:pe.type==="date-range"?{..._,filterFn:(Me,Xe,He)=>{if(!He||!Array.isArray(He))return!0;let[Ze,qe]=He;if(!Ze&&!qe)return!0;let Re=Me.getValue(Xe);if(!Re)return!1;let Ye=Re instanceof Date?Re:new Date(Re);if(isNaN(Ye.getTime()))return!1;if(Ze){let be=new Date(Ze);if(be.setHours(0,0,0,0),Ye<be)return!1}if(qe){let be=new Date(qe);if(be.setHours(23,59,59,999),Ye>be)return!1}return!0}}:_})),m&&!e.some(ze=>ze.id==="_select")?[{id:"_select",header:({table:pe})=>it("div",{className:"flex items-center justify-center",children:it(mr,{size:"sm",checked:pe.getIsAllPageRowsSelected(),config:{indeterminate:pe.getIsSomePageRowsSelected()},onChange:pe.getToggleAllPageRowsSelectedHandler(),"aria-label":"Ch\u1ECDn t\u1EA5t c\u1EA3 c\xE1c d\xF2ng tr\xEAn trang n\xE0y"})}),cell:({row:pe})=>it("div",{className:"flex items-center justify-center",children:it(mr,{size:"sm",checked:pe.getIsSelected(),disabled:!pe.getCanSelect(),onChange:pe.getToggleSelectedHandler(),"aria-label":`Ch\u1ECDn d\xF2ng ${pe.id}`})}),enableSorting:!1,enableHiding:!1},...K]:K},[e,m,S,b]),oe=vs({data:t,columns:Fe,state:{sorting:J,pagination:W,rowSelection:fe,columnVisibility:me,columnOrder:xe,globalFilter:de,columnFilters:S?[]:ee},enableSorting:d,enableRowSelection:m,manualPagination:g,manualSorting:f,manualFiltering:!1,globalFilterFn:A??"fuzzy",pageCount:D,rowCount:R,onSortingChange:O,onPaginationChange:we,onRowSelectionChange:se,onColumnVisibilityChange:De,onColumnOrderChange:re,onGlobalFilterChange:ce}),Te=oe.getVisibleLeafColumns().length,Pe=p?oe.getRowModel().rows:oe.getPrePaginatedRowModel?.()?.rows??oe.getRowModel().rows,_e=w||x||!!(b&&b.length>0)||!!(i||a)||!!T||!!v,Ue=ny(Yf(ty,{activationConstraint:{distance:8}}),Yf(ry)),Le=Pc(()=>oe.getVisibleLeafColumns().map(K=>K.id),[oe]),Be=K=>{let{active:_,over:ze}=K;if(_&&ze&&_.id!==ze.id){if(_.id==="_select"||ze.id==="_select")return;let pe=oe.getVisibleLeafColumns().map(He=>He.id),Me=pe.indexOf(_.id),Xe=pe.indexOf(ze.id);if(Me!==-1&&Xe!==-1){let He=iy(pe,Me,Xe);re(He)}}},Ke=Wf(ps,{variant:r,size:n,containerClassName:ne,children:[it(gs,{children:oe.getHeaderGroups().map(K=>it(Vn,{isHoverable:!1,children:y?it(ay,{items:Le,strategy:sy,children:K.headers.map(_=>{if(_.isPlaceholder)return it(ln,{},_.id);let ze=_.column.getCanSort()&&d,pe=_.column.getIsSorted(),Me=ze?pe==="asc"?"ascending":pe==="desc"?"descending":"none":void 0,Xe=zc(_.column.columnDef.header,_.getContext());return it(Sc,{header:_,canSort:ze,ariaSort:Me,headerContent:Xe},_.id)})}):K.headers.map(_=>{if(_.isPlaceholder)return it(ln,{},_.id);let ze=_.column.getCanSort()&&d,pe=_.column.getIsSorted(),Me=ze?pe==="asc"?"ascending":pe==="desc"?"descending":"none":void 0,Xe=zc(_.column.columnDef.header,_.getContext());return it(ln,{"aria-sort":Me,"data-column-id":_.column.id,children:ze&&typeof _.column.columnDef.header=="string"?it(Io,{column:_.column,title:_.column.columnDef.header}):Xe},_.id)})},K.id))}),it(ms,{children:o||i?Array.from({length:s}).map((K,_)=>it(Vn,{isHoverable:!1,children:Array.from({length:Te}).map((ze,pe)=>it(zo,{children:it(jn,{className:"h-4 w-full rounded"})},`skeleton-cell-${_}-${pe}`))},`skeleton-row-${_}`)):Pe.length===0?it(Vn,{isHoverable:!1,children:it(zo,{colSpan:Te,className:"py-12 text-center",children:h??it(Pn,{size:"sm",image:de?"search":"default",description:l||(de?"Kh\xF4ng t\xECm th\u1EA5y k\u1EBFt qu\u1EA3 ph\xF9 h\u1EE3p v\u1EDBi t\u1EEB kh\xF3a":"Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u hi\u1EC3n th\u1ECB")})})}):Pe.map(K=>{let _=K.getIsSelected();return it(Vn,{isSelected:_,isHoverable:!0,onClick:()=>X?.(K),className:X?"cursor-pointer":void 0,children:K.getVisibleCells().map(ze=>it(zo,{children:zc(ze.column.columnDef.cell,ze.getContext())},ze.id))},K.id)})})]});return Wf("div",{className:`w-full space-y-2 ${le}`.trim(),children:[_e&&it(hs,{table:oe,searchPlaceholder:k,enableGlobalFilter:w,enableColumnVisibility:x,isRefresh:i,onRefresh:a,actions:T,selectedActions:v,filters:b,filterValues:j,onFilterChange:Ce,onFilterReset:Ee}),y?it(Qv,{collisionDetection:ey,modifiers:[oy],onDragEnd:Be,sensors:Ue,children:Ke}):Ke,p&&!o&&Pe.length>0&&it(bs,{table:oe,pageSizeOptions:u})]})}export{Qa as AUDIO_EXTENSIONS,Mc as Alert,Cs as AlertCircleIcon,ws as AlertTriangleIcon,ca as ArrowDownIcon,sa as ArrowUpDownIcon,la as ArrowUpIcon,aa as AvatarIcon,$t as Badge,Ut as Button,xr as Calendar,Qo as CalendarHeader,Cu as CalendarIcon,gd as Carousel,bd as CarouselContent,vd as CarouselNext,yd as CarouselPagination,xd as CarouselPrevious,hd as CarouselSlide,ys as CheckCircleIcon,Ar as CheckIcon,mr as Checkbox,bn as CheckboxGroup,lt as ChevronDownIcon,Yt as ChevronLeftIcon,Wt as ChevronRightIcon,Su as ClockIcon,Oe as CloseIcon,tl as Collapse,jo as CollapseContent,Uo as CollapseHeader,nl as CollapsePanel,ol as Collapsible,gc as Confirm,xc as ConfirmBody,wc as ConfirmClose,bc as ConfirmContainer,yc as ConfirmFooter,hc as ConfirmHeader,na as CropIcon,$i as DEFAULT_PAGE_SIZE,Ei as DEFAULT_PAGE_SIZE_OPTIONS,_f as DEFAULT_TOAST_DURATION,es as DOCUMENT_EXTENSIONS,Kf as DataTable,Sn as DatePicker,co as DateRangeCalendar,ao as DateRangeDayGrid,oi as DateRangeHeader,so as DateRangeMonthGrid,Tn as DateRangePicker,lo as DateRangeYearGrid,Ol as DateTimePicker,Gl as DateTimeRangePicker,ti as DayGrid,Gr as DoubleChevronLeftIcon,Ur as DoubleChevronRightIcon,br as DownloadIcon,pl as Dropdown,Fd as DropdownGroup,Id as DropdownHeader,zd as DropdownItem,hl as DropdownMenu,Md as DropdownSeparator,Dd as DropdownTrigger,Pn as Empty,Os as EmptyDefaultIcon,Us as EmptyErrorIcon,js as EmptyFolderIcon,po as EmptyIllustration,Gs as EmptySearchIcon,Ys as EmptySimpleIcon,Lr as EyeIcon,cr as FileContainer,Ro as FileIcon,Fr as FilePreview,Qn as FlipHorizontalIcon,qa as IMAGE_EXTENSIONS,fr as IconButton,ra as ImageIcon,wi as ImagePreview,yi as ImagePreviewToolbar,Un as InfoCircleIcon,Ct as Input,Er as LoadingImage,Ki as MinusIcon,Fn as Modal,Ln as ModalBody,kc as ModalClose,En as ModalContainer,Cc as ModalFooter,$n as ModalHeader,ri as MonthGrid,Es as MultiInput,j0 as MultiSelect,Wa as MultiSelectTrigger,dn as NumberInput,Ms as OtpInput,Za as PDF_EXTENSIONS,zs as PasswordInput,pr as PlusIcon,Xo as Popover,Ad as PopoverBody,Ud as PopoverClose,Hd as PopoverContent,Od as PopoverFooter,Vd as PopoverHeader,ka as PopoverTrigger,Lo as Radio,Zi as RadioDotIcon,Hs as RadioGroup,Lt as ResetIcon,Zn as RotateCcwIcon,jr as RotateCwIcon,mn as SearchIcon,A0 as Select,bi as SelectComponent,yo as SelectMenu,ja as SelectMenuFilter,Ga as SelectOption,xo as SelectTrigger,xo as SingleSelectTrigger,jn as Skeleton,Oo as Slider,ga as SliderMarks,ma as SliderStepDots,Vo as SliderThumb,ua as SlidersHorizontalIcon,Ne as Spinner,kn as Tab,Cn as TabList,ll as TabPanel,sl as TabPanels,ps as Table,ms as TableBody,zf as TableCaption,zo as TableCell,Io as TableColumnHeader,Pf as TableFooter,ln as TableHead,gs as TableHeader,bs as TablePagination,Vn as TableRow,hs as TableToolbar,wn as Tabs,$s as TextArea,tn as TimeColumn,Hl as TimePicker,Vl as TimeRangePicker,qt as TimeView,Xf as Toaster,As as Toggle,Ho as Tooltip,ir as TrashIcon,uc as UploadAvatar,cc as UploadAvatarCropContent,cs as UploadAvatarCropModal,fc as UploadFile,Do as UploadFileDropzone,Pi as UploadFileItemRow,zi as UploadFileList,Nt as UploadIcon,ac as UploadImage,Si as UploadImageDropzone,Bn as UploadImageList,Ja as VIDEO_EXTENSIONS,ni as YearGrid,Xn as ZoomInIcon,qn as ZoomOutIcon,Rn as checkIsDisabled,Js as clamp,Zt as combineDateTime,Dn as createDateWithTime,jf as createTableColumnHelper,Nc as defaultTableFeatures,kr as downloadFile,wr as formatBytes,Ht as formatDate,At as formatDateTime,Br as formatNumberString,It as formatTime,xs as fuzzyFilter,Ta as generateCalendarGrid,ai as generateRangeCalendarGrid,rn as getDefaultDateTimeFormat,en as getDefaultFormat,ts as getFileCategory,xi as getFileExtension,ct as getFileName,ko as getFileType,Jo as getISOWeekNumber,Ao as getPercentage,C as getSafeConfig,Zo as isDateAfter,qo as isDateBefore,qr as isSameDay,Sa as isSameMonth,t0 as isSameTime,n0 as isTimeAfter,r0 as isTimeBefore,p0 as isTimeInRange,Gi as isValidOtpChar,Mr as normalizePreviewFile,lr as padZero,Rl as parseDate,li as parseDateTime,Hr as parseNumber,_c as parseRawNumberString,Vt as parseTimeToDate,un as rankAndFilterItems,dt as resolveLocale,Ui as sanitizeOtpString,ji as splitTagsFromText,mt as toDate,Jt as toDateTime,e0 as toTimeObject,qf as toast,Ds as useAnimatedError,ya as useCarousel,ar as useCarouselContext,Yr as useCollapseContext,to as useCollapsePanelContext,rr as useConfirmContext,vs as useDataTable,Rx as useDebounce,gn as useDebouncedCallback,hr as useDropdownContext,rs as useFileContext,et as useFloatingTransition,Zf as useInfiniteScroll,er as useModalContext,zt as usePopoverContext,Po as useTableStyles,Wr as useTabsContext};
6
+ `.trim(),children:h})}import{useMemo as A0}from"react";import{jsx as At,jsxs as Bc}from"react/jsx-runtime";function Hv(e,t){return t<=7?Array.from({length:t},(r,o)=>o+1):e<=4?[1,2,3,4,5,"...",t]:e>=t-3?[1,"...",t-4,t-3,t-2,t-1,t]:[1,"...",e-1,e,e+1,"...",t]}function ks({table:e,pageSizeOptions:t=Gi,showPageSizeSelector:r=!0,className:o=""}){let n=e.state.pagination,i=n?.pageIndex??0,a=n?.pageSize??10,s=e.getPageCount(),l=Math.max(s,1),m=i+1,f=e.getCanPreviousPage(),w=e.getCanNextPage(),g=A0(()=>t.map(b=>({label:`${b}`,value:b})),[t]),p=A0(()=>Hv(m,l),[m,l]);return Bc("div",{className:`flex flex-col sm:flex-row items-center justify-between gap-4 px-2 py-3 text-xs text-neutral-600 ${o}`.trim(),children:[r?Bc("div",{className:"flex items-center gap-2",children:[At("span",{className:"whitespace-nowrap",children:"S\u1ED1 d\xF2ng/trang:"}),At("div",{className:"w-20","data-testid":"table-page-size-selector",children:At(Ti,{size:"sm",options:g,value:a,onChange:b=>{b!=null&&e.setPageSize(Number(b))},searchable:!1,"aria-label":"S\u1ED1 d\xF2ng m\u1ED7i trang"})})]}):At("div",{}),Bc("div",{className:"flex items-center gap-1 ml-auto sm:ml-0",children:[At(Wt,{icon:At(Xr,{className:"w-3.5 h-3.5"}),"aria-label":"Trang \u0111\u1EA7u",size:"sm",variant:"outline",color:"neutral",disabled:!f,onClick:()=>e.firstPage()}),At(Wt,{icon:At(rr,{className:"w-3.5 h-3.5"}),"aria-label":"Trang tr\u01B0\u1EDBc",size:"sm",variant:"outline",color:"neutral",disabled:!f,onClick:()=>e.previousPage()}),At("div",{className:"flex items-center gap-1 px-1",children:p.map((b,h)=>{if(b==="...")return At("span",{className:"w-8 h-8 flex items-center justify-center text-xs text-neutral-400 select-none",children:"..."},`ellipsis-${h}`);let x=Number(b),S=x===m;return At("button",{type:"button",onClick:()=>e.setPageIndex(x-1),"aria-label":`Trang ${x}`,"aria-current":S?"page":void 0,className:`w-8 h-8 rounded-full flex items-center justify-center text-xs transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 ${S?"border-2 border-primary-600 text-primary-600 font-semibold bg-primary-50/50":"text-neutral-700 hover:text-neutral-900 hover:bg-neutral-100 font-medium"}`,children:x},x)})}),At(Wt,{icon:At(Ht,{className:"w-3.5 h-3.5"}),"aria-label":"Trang sau",size:"sm",variant:"outline",color:"neutral",disabled:!w,onClick:()=>e.nextPage()}),At(Wt,{icon:At(qr,{className:"w-3.5 h-3.5"}),"aria-label":"Trang cu\u1ED1i",size:"sm",variant:"outline",color:"neutral",disabled:!w,onClick:()=>e.lastPage()})]})]})}import{useState as Hc,useRef as Vv,useEffect as Av,useMemo as O0}from"react";import{useFloating as G0,autoUpdate as j0,offset as U0,flip as Y0,shift as W0,useClick as K0,useDismiss as _0,useInteractions as X0,FloatingPortal as q0}from"@floating-ui/react";import{Fragment as Gv,jsx as ct,jsxs as dr}from"react/jsx-runtime";function Z0(e,t){if(t==null||t==="")return"Ch\u01B0a nh\u1EADp";if(t instanceof Date)return t.toLocaleDateString("vi-VN");if(Array.isArray(t)){if(t.length===0)return"Ch\u01B0a ch\u1ECDn";if(e.type==="date-range"||t[0]instanceof Date||t[1]instanceof Date){let n=s=>{if(!s)return"";if(s instanceof Date)return s.toLocaleDateString("vi-VN");let l=new Date(s);return isNaN(l.getTime())?String(s):l.toLocaleDateString("vi-VN")},i=n(t[0]),a=n(t[1]);return i&&a?`${i} - ${a}`:i||a||"Ch\u01B0a ch\u1ECDn"}let r=n=>{if(e.options&&e.options.length>0){let i=e.options.find(a=>String(a.value)===String(n));if(i)return String(i.label)}return String(n)};return t.length===1?r(t[0]):`${r(t[0])}, +${t.length-1}`}if(e.options&&e.options.length>0){let r=e.options.find(o=>String(o.value)===String(t));if(r)return String(r.label)}return String(t)}function Ov({field:e,currentValue:t,isOpen:r,onOpenChange:o,onRemove:n,onChange:i}){let a=e.name,{refs:{setFloating:s,setReference:l},floatingStyles:m,context:f}=G0({open:r,onOpenChange:o,placement:"bottom-start",transform:!1,middleware:[U0(6),Y0(),W0({padding:8})],whileElementsMounted:j0}),{isMounted:w,styles:g}=it(f),p=K0(f),b=_0(f,{outsidePress:y=>!y.target?.closest?.("[data-table-filter-popover]")}),{getReferenceProps:h,getFloatingProps:x}=X0([p,b]),S=Vv(null);Av(()=>{r&&S.current?.focus({preventScroll:!0})},[r]);let k=t!=null&&t!==""&&(!Array.isArray(t)||t.length>0&&(t[0]!=null||t[1]!=null)),v=Z0(e,t),d=e.type==="date"||e.type==="date-range",u=()=>e.type==="custom"?e.render?.({value:t,onChange:y=>i(a,y)})??null:e.type==="date-range"?ct(Eo,{portal:!1,size:"sm",radius:"md",placeholder:e.placeholder||"Ch\u1ECDn kho\u1EA3ng ng\xE0y",value:t||[null,null],onChange:y=>i(a,y),...e.props||{}}):e.type==="date"?ct(Mo,{portal:!1,size:"sm",radius:"md",placeholder:e.placeholder||"Ch\u1ECDn ng\xE0y",value:t,onChange:y=>i(a,y),...e.props||{}}):e.type==="number"?ct(yo,{ref:S,size:"sm",radius:"full",placeholder:e.placeholder||"Nh\u1EADp s\u1ED1...",value:t??"",onChange:y=>{let c=y.target.value;if(c==="")i(a,"");else{let T=Yr(c);i(a,T!==void 0?T:c)}},onClear:()=>i(a,""),...e.props||{}}):e.type==="select"||e.type==="checkbox-group"?ct(ko,{size:"sm",value:t||[],onChange:y=>i(a,y),options:(e.options||[]).map(y=>({value:String(y.value),label:y.label,disabled:y.disabled})),className:"max-h-48 overflow-y-auto py-1 gap-2",...e.props||{}}):ct(Bt,{ref:S,size:"sm",radius:"full",placeholder:e.placeholder||"Nh\u1EADp t\u1EEB kh\xF3a...",value:t||"",onChange:y=>i(a,y.target.value),...e.props||{}});return dr(Gv,{children:[ct("div",{ref:l,...h({className:"inline-flex items-center"}),children:dr(Kt,{size:"sm",variant:"soft",color:k||r?"primary":"neutral",radius:"full","data-testid":`filter-chip-${a}`,className:`cursor-pointer select-none transition-all duration-150 gap-1 px-3 py-1 rounded-full ${r?"ring-2 ring-primary-500/30":"hover:opacity-90"}`,onDelete:n,deleteAriaLabel:`X\xF3a b\u1ED9 l\u1ECDc ${e.label}`,children:[dr("span",{className:"font-semibold",children:[e.label,":"]}),ct("span",{"data-testid":`filter-chip-val-${a}`,className:k?"font-medium":"opacity-70 italic",children:v})]})}),w&&ct(q0,{children:dr("div",{ref:s,"data-table-filter-popover":"true","data-testid":`filter-popover-${a}`,style:{...m,...g,zIndex:st.SELECT_FILTER},...x({className:`bg-white border border-neutral-200 rounded-lg p-3 shadow-2xl ${d?"w-auto min-w-[280px]":"min-w-64 max-w-xs"}`}),children:[dr("div",{className:"flex items-center justify-between pb-2 mb-2 border-b border-neutral-100",children:[ct("span",{className:"text-xs font-bold text-neutral-800",children:e.label}),ct("button",{type:"button",onClick:()=>o(!1),className:"text-neutral-400 hover:text-neutral-600 p-0.5 rounded transition-colors cursor-pointer",title:"\u0110\xF3ng",children:ct(Ye,{className:"w-3.5 h-3.5"})})]}),ct("div",{className:"mt-1",children:u()}),dr("div",{className:"flex items-center justify-between mt-3 pt-2 border-t border-neutral-100",children:[ct("button",{type:"button",onClick:n,className:"text-[11px] text-red-500 hover:text-red-700 transition-colors cursor-pointer font-medium",children:"X\xF3a b\u1ED9 l\u1ECDc"}),ct("button",{type:"button",onClick:()=>o(!1),className:"text-[11px] font-medium text-neutral-700 hover:bg-neutral-100 px-2 py-0.5 rounded border border-neutral-200 transition-colors cursor-pointer",children:"Xong"})]})]})})]})}function Vc({filters:e,values:t,onChange:r,onReset:o,className:n=""}){let[i,a]=Hc([]),s=O0(()=>{let N=[],I=new Set;return e?.forEach(E=>{let P=t?.[E.name];P!=null&&P!==""&&(!Array.isArray(P)||P.length>0&&(P[0]!=null||P[1]!=null))&&(N.push(E.name),I.add(E.name))}),i.forEach(E=>{I.has(E)||(N.push(E),I.add(E))}),N},[e,t,i]),l=O0(()=>new Set(s),[s]),[m,f]=Hc(null),[w,g]=Hc(!1),{refs:{setFloating:p,setReference:b},floatingStyles:h,context:x}=G0({open:w,onOpenChange:g,placement:"bottom-start",transform:!1,middleware:[U0(6),Y0(),W0({padding:8})],whileElementsMounted:j0}),{isMounted:S,styles:k}=it(x,{duration:120}),v=K0(x),d=_0(x,{outsidePress:N=>!N.target?.closest?.("[data-table-filter-popover]")}),{getReferenceProps:u,getFloatingProps:y}=X0([v,d]),c=N=>{l.has(N.name)||a(I=>[...I,N.name]),g(!1),f(N.name)},T=N=>{a(I=>I.filter(E=>E!==N)),m===N&&f(null),r(N,void 0)},R=N=>{N.stopPropagation(),a([]),f(null),o?.()},D=s.length>0;return!e||e.length===0?null:dr("div",{onClick:N=>N.stopPropagation(),onMouseDown:N=>N.stopPropagation(),className:`inline-flex flex-wrap items-center gap-2 ${n}`.trim(),children:[dr("div",{className:"inline-flex",children:[dr("button",{ref:b,type:"button","data-testid":"table-add-filter-button",...u({className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-neutral-700 hover:text-neutral-900 bg-white border border-neutral-300 hover:border-neutral-400 rounded-full transition-all shadow-xs hover:shadow-sm cursor-pointer active:scale-95"}),children:[ct(yr,{className:"w-3.5 h-3.5 text-neutral-500"}),ct("span",{children:"B\u1ED9 l\u1ECDc"}),ct(xt,{className:`w-3 h-3 text-neutral-400 transition-transform ${w?"rotate-180":""}`})]}),S&&ct(q0,{children:dr("div",{ref:p,"data-table-filter-popover":"true","data-testid":"table-add-filter-menu",style:{...h,...k,zIndex:st.SELECT_FILTER},...y({className:"bg-white border border-neutral-200 rounded-lg p-1.5 shadow-xl min-w-48"}),children:[ct("div",{className:"px-2 py-1 text-[11px] font-semibold text-neutral-400 uppercase tracking-wider",children:"Ch\u1ECDn tr\u01B0\u1EDDng c\u1EA7n l\u1ECDc"}),ct("div",{className:"space-y-0.5 mt-0.5",children:e.map(N=>{let I=l.has(N.name);return dr("button",{type:"button","data-testid":`filter-option-${N.name}`,onClick:E=>{E.preventDefault(),E.stopPropagation(),c(N)},className:`w-full flex items-center justify-between px-2.5 py-1.5 text-xs rounded-md text-left transition-colors cursor-pointer ${I?"text-primary-600 font-medium bg-primary-50":"text-neutral-700 hover:bg-neutral-100"}`,children:[ct("span",{children:N.label}),I&&ct("span",{className:"text-[10px] text-neutral-400",children:"\u0110ang l\u1ECDc"})]},N.name)})})]})})]}),e.map(N=>{if(!l.has(N.name))return null;let I=t?.[N.name],E=m===N.name;return ct(Ov,{field:N,currentValue:I,isOpen:E,onOpenChange:P=>{f(P?N.name:null)},onRemove:()=>T(N.name),onChange:r},N.name)}),D&&dr("button",{type:"button","data-testid":"table-filter-reset-button",onClick:R,className:"inline-flex items-center gap-1 px-2 py-1 text-xs font-medium text-neutral-500 hover:text-red-600 transition-colors cursor-pointer",title:"\u0110\u1EB7t l\u1EA1i to\xE0n b\u1ED9 b\u1ED9 l\u1ECDc",children:[ct(_t,{className:"w-3.5 h-3.5"}),ct("span",{children:"\u0110\u1EB7t l\u1EA1i"})]})]})}import{jsx as Lt,jsxs as Bn}from"react/jsx-runtime";var jv={};function Rs({table:e,searchPlaceholder:t="T\xECm ki\u1EBFm trong b\u1EA3ng...",enableGlobalFilter:r=!0,enableColumnVisibility:o=!0,isRefresh:n=!1,onRefresh:i,actions:a,selectedActions:s,filters:l,filterValues:m=jv,onFilterChange:f,onFilterReset:w,className:g=""}){let p=e.state.globalFilter??"",b=e.getAllLeafColumns().filter(v=>v.getCanHide()),h=e.getSelectedRowModel?.()?.rows??[],x=h.length,S=v=>{e.setGlobalFilter(v.target.value)},k=()=>{e.setGlobalFilter("")};return Bn("div",{className:`flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-3 pb-3 ${g}`.trim(),children:[Bn("div",{className:"flex flex-1 flex-wrap items-center gap-3",children:[r&&Bn("div",{className:"relative w-full sm:w-64 max-w-xs",children:[Lt("span",{className:"absolute inset-y-0 left-0 flex items-center pl-2.5 pointer-events-none text-neutral-400",children:Lt(To,{className:"w-4 h-4"})}),Lt("input",{type:"text",value:p,onChange:S,placeholder:t,"data-testid":"table-search-input",className:"w-full h-9 pl-8 pr-8 rounded-full border border-neutral-300 bg-white text-xs sm:text-sm text-neutral-800 placeholder:text-neutral-400 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500 shadow-xs transition-colors"}),p&&Lt("button",{type:"button",onClick:k,"aria-label":"X\xF3a t\xECm ki\u1EBFm","data-testid":"table-clear-search-button",className:"absolute inset-y-0 right-0 flex items-center pr-2.5 text-neutral-400 hover:text-neutral-600 cursor-pointer",children:Lt(Ye,{className:"w-3.5 h-3.5"})})]}),l&&l.length>0&&f&&Lt(Vc,{filters:l,values:m,onChange:f,onReset:w}),x>0&&s&&Lt("div",{className:"flex items-center gap-2 animate-in fade-in-50 duration-200",children:s(h)})]}),Bn("div",{className:"flex items-center gap-2 self-end sm:self-auto",children:[(n||!!i)&&Lt(Wt,{icon:Lt(Zr,{className:"w-3.5 h-3.5"}),"aria-label":"L\xE0m m\u1EDBi d\u1EEF li\u1EC7u",title:"L\xE0m m\u1EDBi d\u1EEF li\u1EC7u",size:"sm",variant:"outline",color:"neutral",onClick:i,"data-testid":"table-refresh-button"}),o&&b.length>0&&Bn(oi,{size:"sm",placement:"bottom-end",children:[Lt(za,{asChild:!0,children:Lt(er,{variant:"outline",size:"sm",color:"neutral",leftIcon:Lt(ha,{className:"w-3.5 h-3.5"}),children:"C\u1ED9t"})}),Bn(Ll,{className:"w-56 p-0 shadow-lg border border-neutral-200",children:[Lt(Bl,{className:"px-3 py-2 text-xs font-semibold text-neutral-700 border-b border-neutral-100",children:"Hi\u1EC3n th\u1ECB c\u1ED9t"}),Lt(Hl,{className:"max-h-60 overflow-y-auto p-1.5 flex flex-col gap-0.5",children:b.map(v=>{let d=typeof v.columnDef.header=="string"?v.columnDef.header:v.id;return Lt("div",{className:"w-full",children:Lt(Cr,{size:"sm",label:d,checked:v.getIsVisible(),onChange:v.getToggleVisibilityHandler(),className:"w-full",wrapperClassName:"w-full flex items-center px-2 py-1.5 rounded-md hover:bg-neutral-100/80 cursor-pointer select-none",labelClassName:"text-xs text-neutral-700 font-medium truncate"})},v.id)})})]})]}),a]})]})}import{Fragment as ay,useMemo as Ps,useState as xo}from"react";import{flexRender as Oc}from"@tanstack/react-table";import{DndContext as sy,closestCenter as ly,PointerSensor as cy,KeyboardSensor as uy,useSensor as tp,useSensors as dy}from"@dnd-kit/core";import{restrictToHorizontalAxis as fy}from"@dnd-kit/modifiers";import{arrayMove as py,SortableContext as my,horizontalListSortingStrategy as gy}from"@dnd-kit/sortable";import{tableFeatures as Uv,rowSortingFeature as Yv,rowPaginationFeature as Wv,rowSelectionFeature as Kv,columnFilteringFeature as _v,globalFilteringFeature as Xv,columnVisibilityFeature as qv,columnPinningFeature as Zv,columnOrderingFeature as Jv,rowExpandingFeature as Qv,createSortedRowModel as ey,createPaginatedRowModel as ty,createFilteredRowModel as ry,createExpandedRowModel as oy,createColumnHelper as ny,useTable as iy}from"@tanstack/react-table";import{rankItem as J0}from"@tanstack/match-sorter-utils";function Q0(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/đ/g,"d").replace(/Đ/g,"D")}var Ds=(e,t,r,o)=>{let n=String(e.getValue(t)??""),i=String(r??""),a=J0(n,i);if(!a.passed){let s=Q0(n),l=Q0(i);a=J0(s,l)}return o?.({itemRank:a}),a.passed};var Ac=Uv({rowSortingFeature:Yv,rowPaginationFeature:Wv,rowSelectionFeature:Kv,columnFilteringFeature:_v,globalFilteringFeature:Xv,columnVisibilityFeature:qv,columnPinningFeature:Zv,columnOrderingFeature:Jv,rowExpandingFeature:Qv,sortedRowModel:ey(),paginatedRowModel:ty(),filteredRowModel:ry(),expandedRowModel:oy(),filterFns:{fuzzy:Ds}});function ep(){return ny()}function Ns(e){let{features:t=Ac,columns:r,...o}=e;return iy({features:t,columns:r,...o})}import{jsx as Ge,jsxs as zs}from"react/jsx-runtime";function rp({columns:e,data:t,variant:r="default",size:o="md",isLoading:n=!1,isRefresh:i=!1,onRefresh:a,loadingRowsCount:s=5,emptyText:l,emptyIllustration:m,enableSorting:f=!0,enableFiltering:w=!0,enablePagination:g=!0,enableRowSelection:p=!1,enableColumnVisibility:b=!0,enableColumnOrdering:h=!1,enableExpanding:x,enableExpandingAnimation:S=!0,expanded:k,onExpandedChange:v,getSubRows:d,getRowCanExpand:u,manualExpanding:y=!1,autoResetExpanded:c=!1,paginateExpandedRows:T=!0,renderExpandedRow:R,showExpandColumn:D,expandColumnMode:N="integrated",expandColumnId:I,expandColumnPosition:E="start",maxIndentDepth:P=4,indentSize:F=1.25,filters:z,searchPlaceholder:H,toolbarActions:V,renderBulkActions:W,pageSizeOptions:L,initialPageSize:M=ji,manualPagination:O=!1,manualSorting:A=!1,manualFiltering:U=!1,pageCount:G,rowCount:K,debounceMs:q=300,pagination:X,onPaginationChange:fe,sorting:ae,onSortingChange:_,rowSelection:Z,onRowSelectionChange:he,columnVisibility:xe,onColumnVisibilityChange:$,columnOrder:re,onColumnOrderChange:ee,globalFilter:de,onGlobalFilterChange:ne,globalFilterFn:ze,columnFilters:ve,onColumnFiltersChange:Ce,onRowClick:J,className:j="",containerClassName:oe=""}){let[ye,ue]=xo([]),[ce,ke]=xo({pageIndex:0,pageSize:M}),[Te,pe]=xo({}),[Y,me]=xo({}),[De,ie]=xo([]),[B,se]=xo(""),[Ie,Ae]=xo({}),le=x??!!(R||d||k),ge=(D??le)&&N!=="none",[Me,Le]=xo(()=>{if(!z)return[];let te=[];return z.forEach(Q=>{Q.defaultValue!==void 0&&Q.defaultValue!==null&&Q.defaultValue!==""&&(!Array.isArray(Q.defaultValue)||Q.defaultValue.length>0)&&te.push({id:Q.name,value:Q.defaultValue})}),te}),Ve=ae??ye,Be=te=>{let Q=typeof te=="function"?te(Ve):te;_?_(Q):ue(Q)},je=X??ce,ut=te=>{let Q=typeof te=="function"?te(je):te;fe?fe(Q):ke(Q)},Re=Z??Te,Xe=te=>{let Q=typeof te=="function"?te(Re):te;he?he(Q):pe(Q)},qe=xe??Y,at=te=>{let Q=typeof te=="function"?te(qe):te;$?$(Q):me(Q)},ot=re??De,vt=te=>{let Q=typeof te=="function"?te(ot):te;ee?ee(Q):ie(Q)},Ee=de??B,yt=te=>{let Q=typeof te=="function"?te(Ee):te;ne?ne(String(Q??"")):se(String(Q??""))},pt=ve??Me,mt=k??Ie,tt=te=>{let Q=typeof te=="function"?te(mt):te;v?v(Q):Ae(Q)},Rt=Ps(()=>{let te={};return pt.forEach(Q=>{te[Q.id]=Q.value}),te},[pt]),Oe=(te,Q)=>{let Ue=pt.filter(ft=>ft.id!==te);Q!=null&&Q!==""&&(!Array.isArray(Q)||Q.length>0)&&Ue.push({id:te,value:Q}),Ce?Ce(Ue):Le(Ue)},dt=()=>{Ce?Ce([]):Le([])},we=Ps(()=>{let te=e;if(!U&&z&&z.length>0&&(te=te.map(Q=>{let Ue=Q.id??Q.accessorKey,$e=z.find(ft=>ft.name===Ue);return!$e||Q.filterFn?Q:$e.type==="select"||$e.type==="checkbox-group"?{...Q,filterFn:(ft,St,Ne)=>{if(!Ne||Array.isArray(Ne)&&Ne.length===0)return!0;let nt=ft.getValue(St);return Array.isArray(Ne)?Ne.some(gt=>String(gt).toLowerCase()===String(nt).toLowerCase()):String(nt).toLowerCase()===String(Ne).toLowerCase()}}:$e.type==="date-range"?{...Q,filterFn:(ft,St,Ne)=>{if(!Ne||!Array.isArray(Ne))return!0;let[nt,gt]=Ne;if(!nt&&!gt)return!0;let Xo=ft.getValue(St);if(!Xo)return!1;let Hn=Xo instanceof Date?Xo:new Date(Xo);if(isNaN(Hn.getTime()))return!1;if(nt){let Vn=new Date(nt);if(Vn.setHours(0,0,0,0),Hn<Vn)return!1}if(gt){let Vn=new Date(gt);if(Vn.setHours(23,59,59,999),Hn>Vn)return!1}return!0}}:Q})),p&&(e.some(Ue=>Ue.id==="_select")||(te=[{id:"_select",header:({table:$e})=>Ge("div",{className:"flex items-center justify-center",children:Ge(Cr,{size:"sm",checked:$e.getIsAllPageRowsSelected(),config:{indeterminate:$e.getIsSomePageRowsSelected()},onChange:$e.getToggleAllPageRowsSelectedHandler(),"aria-label":"Ch\u1ECDn t\u1EA5t c\u1EA3 c\xE1c d\xF2ng tr\xEAn trang n\xE0y"})}),cell:({row:$e})=>Ge("div",{className:"flex items-center justify-center",onClick:ft=>ft.stopPropagation(),children:Ge(Cr,{size:"sm",checked:$e.getIsSelected(),disabled:!$e.getCanSelect(),onChange:$e.getToggleSelectedHandler(),"aria-label":`Ch\u1ECDn d\xF2ng ${$e.id}`})}),enableSorting:!1,enableHiding:!1},...te])),le&&ge&&N==="standalone"&&!e.some(Ue=>Ue.id==="_expand")){let Ue={id:"_expand",header:()=>null,cell:({row:$e})=>{let ft=$e.getCanExpand(),St=$e.getIsExpanded(),Ne=Math.min($e.depth,P),nt=Ne>0?`${Ne*F}rem`:void 0;return Ge("div",{className:"flex items-center",style:{paddingLeft:nt},children:ft?Ge(Wt,{icon:Ge(Ht,{className:`w-3.5 h-3.5 transition-transform duration-200 ${St?"rotate-90 text-primary-600":""}`}),size:"xs",variant:"ghost",color:"neutral",radius:"sm",onClick:gt=>{gt.stopPropagation(),$e.toggleExpanded()},"aria-expanded":St,"aria-label":St?`Thu g\u1ECDn d\xF2ng ${$e.id}`:`M\u1EDF r\u1ED9ng d\xF2ng ${$e.id}`,"data-testid":`table-row-expand-button-${$e.id}`}):$e.depth>0?Ge("span",{className:"inline-flex items-center justify-center w-6 h-6 text-neutral-300 select-none text-xs","aria-hidden":"true",children:"\u21B3"}):Ge("span",{className:"w-6 h-6 inline-block","aria-hidden":"true"})})},enableSorting:!1,enableHiding:!1};if(E==="end")te=[...te,Ue];else{let $e=te.findIndex(ft=>ft.id==="_select");$e!==-1?te=[...te.slice(0,$e+1),Ue,...te.slice($e+1)]:te=[Ue,...te]}}return te},[e,p,U,z,le,ge,N,E,P,F]),We=Ns({data:t,columns:we,state:{sorting:Ve,pagination:je,rowSelection:Re,columnVisibility:qe,columnOrder:ot,globalFilter:Ee,columnFilters:U?[]:pt,expanded:mt},enableSorting:f,enableRowSelection:p,enableExpanding:le,manualPagination:O,manualSorting:A,manualFiltering:!1,manualExpanding:y,autoResetExpanded:c,paginateExpandedRows:T,getSubRows:d,getRowCanExpand:u??(R?()=>!0:void 0),globalFilterFn:ze??"fuzzy",pageCount:G,rowCount:K,onSortingChange:Be,onPaginationChange:ut,onRowSelectionChange:Xe,onColumnVisibilityChange:at,onColumnOrderChange:vt,onGlobalFilterChange:yt,onExpandedChange:tt}),wt=We.getVisibleLeafColumns().length,Ke=g?We.getRowModel().rows:We.getPrePaginatedRowModel?.()?.rows??We.getRowModel().rows,Dt=Ps(()=>!le||!ge||N!=="integrated"?void 0:I||We.getVisibleLeafColumns().find(Q=>Q.id!=="_select"&&Q.id!=="_expand")?.id,[le,ge,N,I,We]),Pt=We.getCanSomeRowsExpand?.()??!1,Fe=w||b||!!(z&&z.length>0)||!!(i||a)||!!V||!!W,be=dy(tp(cy,{activationConstraint:{distance:8}}),tp(uy)),Se=Ps(()=>We.getVisibleLeafColumns().map(te=>te.id),[We]),et=te=>{let{active:Q,over:Ue}=te;if(Q&&Ue&&Q.id!==Ue.id){if(Q.id==="_select"||Ue.id==="_select"||Q.id==="_expand"||Ue.id==="_expand")return;let $e=We.getVisibleLeafColumns().map(Ne=>Ne.id),ft=$e.indexOf(Q.id),St=$e.indexOf(Ue.id);if(ft!==-1&&St!==-1){let Ne=py($e,ft,St);vt(Ne)}}},rt=zs(Cs,{variant:r,size:o,containerClassName:oe,children:[Ge(Ss,{children:We.getHeaderGroups().map(te=>Ge(go,{isHoverable:!1,children:h?Ge(my,{items:Se,strategy:gy,children:te.headers.map(Q=>{if(Q.isPlaceholder)return Ge(bo,{},Q.id);let Ue=Q.column.getCanSort()&&f,$e=Q.column.getIsSorted(),ft=Ue?$e==="asc"?"ascending":$e==="desc"?"descending":"none":void 0,St=Oc(Q.column.columnDef.header,Q.getContext());return Ge(Lc,{header:Q,canSort:Ue,ariaSort:ft,headerContent:St},Q.id)})}):te.headers.map(Q=>{if(Q.isPlaceholder)return Ge(bo,{},Q.id);let Ue=Q.column.getCanSort()&&f,$e=Q.column.getIsSorted(),ft=Ue?$e==="asc"?"ascending":$e==="desc"?"descending":"none":void 0,St=Oc(Q.column.columnDef.header,Q.getContext()),Ne=Ue&&typeof Q.column.columnDef.header=="string"?Ge(Ln,{column:Q.column,title:Q.column.columnDef.header}):St;return Ge(bo,{"aria-sort":ft,"data-column-id":Q.column.id,children:Ne},Q.id)})},te.id))}),Ge(Ts,{children:n||i?Array.from({length:s}).map((te,Q)=>Ge(go,{isHoverable:!1,children:Array.from({length:wt}).map((Ue,$e)=>Ge(ho,{children:Ge(Zo,{className:"h-4 w-full rounded"})},`skeleton-cell-${Q}-${$e}`))},`skeleton-row-${Q}`)):Ke.length===0?Ge(go,{isHoverable:!1,children:Ge(ho,{colSpan:wt,className:"py-12 text-center",children:m??Ge(Ho,{size:"sm",image:Ee?"search":"default",description:l||(Ee?"Kh\xF4ng t\xECm th\u1EA5y k\u1EBFt qu\u1EA3 ph\xF9 h\u1EE3p v\u1EDBi t\u1EEB kh\xF3a":"Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u hi\u1EC3n th\u1ECB")})})}):Ke.map(te=>{let Q=te.getIsSelected(),Ue=te.getIsExpanded();return zs(ay,{children:[Ge(go,{isSelected:Q,isHoverable:!0,onClick:()=>J?.(te),className:`
7
+ ${J?"cursor-pointer":""}
8
+ ${S&&te.depth>0?"animate-table-subrow-in":""}
9
+ `.trim()||void 0,"data-expanded":Ue?"true":void 0,children:te.getVisibleCells().map($e=>{let ft=le&&ge&&N==="integrated"&&$e.column.id===Dt,St=Oc($e.column.columnDef.cell,$e.getContext());if(!ft)return Ge(ho,{children:St},$e.id);let Ne=te.getCanExpand(),nt=te.getIsExpanded(),gt=Math.min(te.depth,P),Xo=gt>0?`${gt*F}rem`:void 0;return Ge(ho,{children:zs("div",{className:"flex items-center gap-1.5",style:{paddingLeft:Xo},children:[Ne?Ge(Wt,{icon:Ge(Ht,{className:`w-3.5 h-3.5 transition-transform duration-200 ${nt?"rotate-90 text-primary-600":""}`}),size:"xs",variant:"ghost",color:"neutral",radius:"sm",className:"shrink-0",onClick:Hn=>{Hn.stopPropagation(),te.toggleExpanded()},"aria-expanded":nt,"aria-label":nt?`Thu g\u1ECDn d\xF2ng ${te.id}`:`M\u1EDF r\u1ED9ng d\xF2ng ${te.id}`,"data-testid":`table-row-expand-button-${te.id}`}):te.depth>0?Ge("span",{className:"inline-flex items-center justify-center w-5 h-5 text-neutral-300 select-none text-xs shrink-0","aria-hidden":"true",children:"\u21B3"}):Pt?Ge("span",{className:"w-5 h-5 shrink-0 inline-block","aria-hidden":"true"}):null,Ge("div",{className:"min-w-0 flex-1",children:St})]})},$e.id)})}),Ue&&R&&Ge(go,{isHoverable:!1,className:"bg-neutral-50/70 border-b border-neutral-200/80 transition-colors","data-testid":`table-expanded-row-${te.id}`,children:Ge(ho,{colSpan:wt,className:"p-0 border-none",children:Ge("div",{className:S?"animate-table-expand-wrapper overflow-hidden":void 0,children:Ge("div",{className:S?"p-4 animate-table-expand-content":"p-4",children:R(te)})})})},`${te.id}-expanded`)]},te.id)})})]});return zs("div",{className:`w-full space-y-2 ${j}`.trim(),children:[Fe&&Ge(Rs,{table:We,searchPlaceholder:H,enableGlobalFilter:w,enableColumnVisibility:b,isRefresh:i,onRefresh:a,actions:V,selectedActions:W,filters:z,filterValues:Rt,onFilterChange:Oe,onFilterReset:dt}),h?Ge(sy,{collisionDetection:ly,modifiers:[fy],onDragEnd:et,sensors:be,children:rt}):rt,g&&!n&&Ke.length>0&&Ge(ks,{table:We,pageSizeOptions:L})]})}export{as as AUDIO_EXTENSIONS,Gc as Alert,Ms as AlertCircleIcon,Fs as AlertTriangleIcon,ba as ArrowDownIcon,ma as ArrowUpDownIcon,ga as ArrowUpIcon,pa as AvatarIcon,Kt as Badge,er as Button,kr as Calendar,si as CalendarHeader,Fu as CalendarIcon,Td as Carousel,Rd as CarouselContent,Pd as CarouselNext,zd as CarouselPagination,Nd as CarouselPrevious,Dd as CarouselSlide,Is as CheckCircleIcon,Kr as CheckIcon,Cr as Checkbox,ko as CheckboxGroup,xt as ChevronDownIcon,rr as ChevronLeftIcon,Ht as ChevronRightIcon,Eu as ClockIcon,Ye as CloseIcon,pl as Collapse,Jn as CollapseContent,Zn as CollapseHeader,gl as CollapsePanel,bl as Collapsible,Dc as Confirm,zc as ConfirmBody,Mc as ConfirmClose,Nc as ConfirmContainer,Fc as ConfirmFooter,Pc as ConfirmHeader,ua as CropIcon,ji as DEFAULT_PAGE_SIZE,Gi as DEFAULT_PAGE_SIZE_OPTIONS,op as DEFAULT_TOAST_DURATION,ss as DOCUMENT_EXTENSIONS,rp as DataTable,Mo as DatePicker,hn as DateRangeCalendar,mn as DateRangeDayGrid,fi as DateRangeHeader,gn as DateRangeMonthGrid,Eo as DateRangePicker,bn as DateRangeYearGrid,tc as DateTimePicker,rc as DateTimeRangePicker,ci as DayGrid,Xr as DoubleChevronLeftIcon,qr as DoubleChevronRightIcon,Sr as DownloadIcon,kl as Dropdown,jd as DropdownGroup,Od as DropdownHeader,Ad as DropdownItem,Il as DropdownMenu,Gd as DropdownSeparator,Ld as DropdownTrigger,Ho as Empty,Qs as EmptyDefaultIcon,tl as EmptyErrorIcon,rl as EmptyFolderIcon,yn as EmptyIllustration,el as EmptySearchIcon,ol as EmptySimpleIcon,jr as EyeIcon,hr as FileContainer,Mn as FileIcon,Ar as FilePreview,sn as FlipHorizontalIcon,os as IMAGE_EXTENSIONS,Wt as IconButton,ca as ImageIcon,Pi as ImagePreview,Ni as ImagePreviewToolbar,qo as InfoCircleIcon,Bt as Input,Or as LoadingImage,ta as MinusIcon,Go as Modal,Yo as ModalBody,$c as ModalClose,jo as ModalContainer,Ec as ModalFooter,Uo as ModalHeader,ui as MonthGrid,Ys as MultiInput,Qf as MultiSelect,Qa as MultiSelectTrigger,yo as NumberInput,js as OtpInput,ns as PDF_EXTENSIONS,Os as PasswordInput,yr as PlusIcon,oi as Popover,qd as PopoverBody,Qd as PopoverClose,_d as PopoverContent,Zd as PopoverFooter,Xd as PopoverHeader,za as PopoverTrigger,Un as Radio,na as RadioDotIcon,qs as RadioGroup,_t as ResetIcon,nn as RotateCcwIcon,Zr as RotateCwIcon,To as SearchIcon,qf as Select,Ti as SelectComponent,Rn as SelectMenu,Za as SelectMenuFilter,Xa as SelectOption,Tn as SelectTrigger,Tn as SingleSelectTrigger,Zo as Skeleton,Xn as Slider,wa as SliderMarks,Ca as SliderStepDots,Kn as SliderThumb,ha as SlidersHorizontalIcon,Pe as Spinner,Fo as Tab,Io as TabList,yl as TabPanel,vl as TabPanels,Cs as Table,Ts as TableBody,H0 as TableCaption,ho as TableCell,Ln as TableColumnHeader,B0 as TableFooter,bo as TableHead,Ss as TableHeader,ks as TablePagination,go as TableRow,Rs as TableToolbar,zo as Tabs,Ws as TextArea,lo as TimeColumn,Jl as TimePicker,Ql as TimeRangePicker,ar as TimeView,An as Toaster,Js as Toggle,Wn as Tooltip,pr as TrashIcon,Tc as UploadAvatar,Sc as UploadAvatarCropContent,hs as UploadAvatarCropModal,Rc as UploadFile,Fn as UploadFileDropzone,Bi as UploadFileItemRow,Hi as UploadFileList,Ot as UploadIcon,yc as UploadImage,Fi as UploadImageDropzone,Wo as UploadImageList,is as VIDEO_EXTENSIONS,di as YearGrid,rn as ZoomInIcon,on as ZoomOutIcon,Lo as checkIsDisabled,ul as clamp,sr as combineDateTime,$o as createDateWithTime,ep as createTableColumnHelper,Ac as defaultTableFeatures,Ir as downloadFile,Pr as formatBytes,qt as formatDate,Jt as formatDateTime,Ur as formatNumberString,Ut as formatTime,Ds as fuzzyFilter,Fa as generateCalendarGrid,mi as generateRangeCalendarGrid,co as getDefaultDateTimeFormat,so as getDefaultFormat,ls as getFileCategory,Ri as getFileExtension,Ct as getFileName,Pn as getFileType,ai as getISOWeekNumber,_n as getPercentage,C as getSafeConfig,ii as isDateAfter,ni as isDateBefore,oo as isSameDay,Ia as isSameMonth,ff as isSameTime,mf as isTimeAfter,pf as isTimeBefore,Tf as isTimeInRange,qi as isValidOtpChar,Vr as normalizePreviewFile,br as padZero,Ol as parseDate,bi as parseDateTime,Yr as parseNumber,nu as parseRawNumberString,Zt as parseTimeToDate,vo as rankAndFilterItems,Tt as resolveLocale,Zi as sanitizeOtpString,Ji as splitTagsFromText,zt as toDate,lr as toDateTime,df as toTimeObject,np as toast,Bs as useAnimatedError,Da as useCarousel,mr as useCarouselContext,Jr as useCollapseContext,cn as useCollapsePanelContext,Je as useConfirmContext,Ns as useDataTable,ip as useDebounce,So as useDebouncedCallback,Tr as useDropdownContext,cs as useFileContext,it as useFloatingTransition,ap as useInfiniteScroll,Ze as useModalContext,jt as usePopoverContext,$n as useTableStyles,Qr as useTabsContext};
7
10
  //# sourceMappingURL=index.js.map