@openway/ui 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- import{a as C,b as mo,c as mp,d as jc,e as Yc,f as Wc,g as _o,h as Ai,i as Oi,j as Gi,k as Ui,l as ji}from"./chunk-CJQNI3QX.js";var Yi={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"}},Wi={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Ki={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 Kc,jsxs as bp}from"react/jsx-runtime";function De({width:e=16,height:t=16,className:r="",...o}){return bp("svg",{width:e,height:t,className:`animate-[spin_1s_steps(8)_infinite] ${r}`,viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:[Kc("path",{d:"M0 0h25v24H0z",fill:"none"}),Kc("path",{fill:"currentColor",d:"M4.818 6.664h-.001a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.277.541h-.029zm-2.97 7.182h-.001a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.278.541h-.031h.002zM12 3.692a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.277.541zM4.818 21.029h-.001a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.276.541h-.031zM19.182 7.125a2.308 2.308 0 1 1 0-4.615a2.308 2.308 0 0 1 0 4.615M12 24a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.277.541zm10.154-9.231h-.048c-.75 0-1.428-.309-1.913-.807l-.001-.001c-.499-.503-.808-1.196-.808-1.961s.308-1.458.808-1.962a2.66 2.66 0 0 1 1.914-.808h.05h-.003h.048c.75 0 1.427.309 1.913.807l.001.001c.499.503.808 1.196.808 1.961s-.308 1.458-.808 1.962a2.66 2.66 0 0 1-1.915.809h-.049zm-2.971 7.643h-.05a3.1 3.1 0 0 1-2.236-.951l-.001-.001c-.584-.584-.945-1.391-.945-2.283s.361-1.698.945-2.283a3.1 3.1 0 0 1 2.234-.945h.054h-.003h.042c.877 0 1.67.362 2.237.944l.001.001c.588.582.952 1.39.952 2.283s-.364 1.7-.952 2.282a3.1 3.1 0 0 1-2.24.953h-.04z"})]})}import{jsx as Ps,jsxs as hp}from"react/jsx-runtime";function Ut({size:e,variant:t,color:r,radius:o,leftIcon:n,rightIcon:i,isLoading:a=!1,showSpinner:s=!1,loadingText:l,isFullWidth:b=!1,disabled:u=!1,type:w="button",className:g="",children:m,ref:x,...v}){let h=C(e,Yi,"md"),k=t==="other"?"":C(r,C(t,Ki,"filled"),"primary"),T=C(o,Wi,"lg"),y=["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",h.button,T,k,b?"w-full":"",u?"opacity-50":"",g].filter(Boolean).join(" "),d=f=>Ps("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${h.icon}`,"aria-hidden":"true",children:f}),c=a&&l?l:m;return hp("button",{ref:x,type:w,disabled:u||a,"aria-busy":a,"aria-disabled":u||a,className:y,...v,children:[a&&s&&d(Ps(De,{})),(!a||!s)&&n&&d(n),c&&Ps("span",{className:"leading-none",children:c}),!a&&i&&d(i)]})}import{jsx as zs}from"react/jsx-runtime";function pr({icon:e,size:t,variant:r,color:o,radius:n,isLoading:i=!1,showSpinner:a=!1,disabled:s=!1,type:l="button",className:b="",ref:u,...w}){let g=C(t,Yi,"md"),m=r==="other"?"":C(o,C(r,Ki,"filled"),"primary"),x=C(n,Wi,"full"),v=["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,x,m,s?"opacity-50":"",b].filter(Boolean).join(" "),h=k=>zs("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${g.icon}`,"aria-hidden":"true",children:k});return zs("button",{ref:u,type:l,disabled:s||i,"aria-busy":i,"aria-disabled":s||i,className:v,...w,children:h(i&&a?zs(De,{}):e)})}var _c={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"}},Xc={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},qc={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"},Zc={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 Jc}from"react/jsx-runtime";function Be({width:e=14,height:t=14,className:r="",...o}){return Jc("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:Jc("path",{d:"M18 6 6 18M6 6l12 12"})})}import{jsx as Gn,jsxs as xp}from"react/jsx-runtime";function $t({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:b="Remove",className:u="",children:w,onClick:g,ref:m,...x}){let v=C(e,_c,"md"),h=t==="other"?"":C(r,C(t,Zc,"soft"),"primary"),k=C(r,qc,"primary"),T=C(o,Xc,"full"),y=["inline-flex items-center justify-center font-medium leading-none border transition-colors duration-150 whitespace-nowrap",v.badge,T,h,g?"cursor-pointer select-none active:scale-[0.98] transition-transform duration-100":"",u].filter(Boolean).join(" "),d=c=>Gn("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${v.icon}`,"aria-hidden":"true",children:c});return xp("span",{ref:m,role:g?"button":void 0,tabIndex:g?0:void 0,className:y,onClick:g,...x,children:[n&&Gn("span",{className:`relative inline-block shrink-0 rounded-full ${i?"animate-pulse":""} ${v.dot} ${k}`,"aria-hidden":"true"}),a&&d(a),w&&Gn("span",{className:"leading-none",children:w}),s&&!l&&d(s),l&&Gn("button",{type:"button",onClick:c=>{c.stopPropagation(),l()},"aria-label":b,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 ${v.deleteIcon}`,children:Gn(Be,{className:"size-full"})})]})}import{useId as yp,useState as wp,useRef as Cp}from"react";import{useMergeRefs as kp}from"@floating-ui/react";var _i={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"}},Xo={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"},eu={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 tu={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 vp,useState as Is}from"react";function Ms(e,t={}){let{exitDuration:r=250}=t,[o,n]=Is(e),[i,a]=Is(!1),[s,l]=Is(e);return e!==s&&(l(e),e?(n(e),a(!1)):a(!0)),vp(()=>{if(!i)return;let b=setTimeout(()=>{n(void 0),a(!1)},r);return()=>clearTimeout(b)},[r,i]),{displayedError:o,isExiting:i}}import{jsx as Fs}from"react/jsx-runtime";function $e({id:e,helperText:t,errorMessage:r,sizeClassName:o="text-xs",className:n=""}){let{displayedError:i,isExiting:a}=Ms(r),s=i||t,l=!!(i||t),b=!!i;return Fs("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:Fs("div",{className:"overflow-hidden",children:Fs("div",{id:e,role:b?"alert":"status",className:`leading-tight transition-colors duration-200 font-normal ${o} ${b?a?"text-error-600 animate-error-out":"text-error-600 animate-error-in":"text-neutral-500 dark:text-neutral-400"} ${n}`,children:s||"\xA0"})})})}import{jsx as ou,jsxs as nu}from"react/jsx-runtime";var Es={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"},ru={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:o,isRequired:n=!1,isFloating:i,placement:a,size:s="md",sizeClassName:l,color:b="primary",hasError:u=!1,isInvalid:w=!1,cursor:g,className:m="",colorConfig:x=Es}){let v=e??t;if(!v)return null;let h=i??a==="floating",k=!!(u||w),T=k?"error":b,y=k?"text-error-600 font-bold":x[T]||Es[T]||Es.primary,d=ru[s]||ru.md,c=l||(h?d.floatingLabel:d.label),f=g?`cursor-${g}`:h?"cursor-text":"";return h?nu("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 ${f} ${c} ${y} ${m}`,children:[v,n&&ou("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):nu("label",{htmlFor:r,id:o,className:`inline-flex items-center font-bold transition-colors duration-150 ${f} ${c} ${y} ${m}`,children:[v,n&&ou("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})}import{jsx as jt,jsxs as Xi}from"react/jsx-runtime";function Ct({size:e,variant:t,color:r,radius:o,label:n,labelPlacement:i="floating",config:a,helperText:s,errorMessage:l,leftIcon:b,leftAddon:u,rightIcon:w,rightAddon:g,onClear:m,wrapperClassName:x="",inputWrapperClassName:v="",labelClassName:h="",helperClassName:k="",id:T,value:y,defaultValue:d,onChange:c,disabled:f=!1,readOnly:p=!1,className:S="",type:R="text",placeholder:D,ref:P,...I}){let{isRequired:E=!1,isInvalid:N=!1,isLoading:M=!1,showSpinner:z=!1,isClearable:H=!1,isFullWidth:V=!1}=a??{},Y=yp(),$=T||Y,F=`${$}-error-helper`,G=Cp(null),A=kp([G,P]),U=y!==void 0,[B,X]=wp(d),le=U?y:B,oe=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,_i,"md"),ke=C(o,Xo,"md"),L=t==="other"?"":C(q,C(t,qo,"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:n,isRequired:E,isFloating:Z,size:e,color:q,hasError:Q,className:h}),ae=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2",ge.wrapper,ke,L,f?"opacity-50":"",V?"w-full":"w-auto",v].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,b?"pl-1.5":"",w||H||M?"pr-1.5":"",S].filter(Boolean).join(" ");return Xi("div",{className:`group/field flex ${i==="left"?"flex-row items-center gap-3":"flex-col"} ${V?"w-full":"inline-flex"} ${x}`,children:[!Z&&he(),Xi("div",{className:`flex flex-col ${V?"w-full":""}`,children:[Xi("div",{className:"flex items-stretch",children:[u&&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:u}),Xi("div",{className:`${ae} ${u?"rounded-l-none!":""} ${g?"rounded-r-none!":""}`,children:[Z&&he(),b&&jt("div",{className:"flex items-center justify-center pl-3 shrink-0",children:te(b)}),jt("input",{ref:A,id:$,type:R,value:le,onChange:oe,disabled:f||M,readOnly:p,"aria-invalid":Q,"aria-required":E,"aria-describedby":l||s?F:void 0,"aria-errormessage":l?F:void 0,"aria-busy":M,"aria-disabled":f||M,placeholder:D,className:ve,...I}),M&&z&&jt("div",{className:"flex items-center justify-center pr-3 shrink-0",children:te(jt(De,{}))}),!M&&H&&!f&&!p&&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(Be,{className:"size-full"})}),!M&&w&&jt("div",{className:"flex items-center justify-center pr-3 shrink-0",children:te(w)})]}),g&&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:g})]}),jt($e,{id:F,helperText:s,errorMessage:l,sizeClassName:ge.helper,className:k})]})]})}import{useState as Sp}from"react";import{jsx as Zo,jsxs as au}from"react/jsx-runtime";function $s({width:e=16,height:t=16,className:r="",...o}){return au("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[Zo("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),Zo("circle",{cx:"12",cy:"12",r:"3"})]})}function iu({width:e=16,height:t=16,className:r="",...o}){return au("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[Zo("path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24"}),Zo("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"}),Zo("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"}),Zo("line",{x1:"2",x2:"22",y1:"2",y2:"22"})]})}var Vr=$s;import{jsx as qi}from"react/jsx-runtime";function Ls({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]=Sp(e);return qi(Ct,{type:s?"text":"password",disabled:n,readOnly:i,rightIcon:o||qi("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?qi(iu,{className:"size-full"}):qi($s,{className:"size-full"})}),...a})}import{useState as Tp}from"react";function Ar(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),b=String(e).trim();if(!b)return"";let u=l&&b.startsWith("-");if(u&&b==="-")return"-";if(n>0&&b.includes(o)){let h=b.split(o),k=h[0]?.replace(/\D/g,"")??"",T=h.slice(1).join("").replace(/\D/g,"").slice(0,n);if(k||T){let c=parseFloat(`${k||"0"}.${T||"0"}`);if(u&&(c=-c),a!==void 0&&!isNaN(c)&&c>a)return Ar(a,{...t,max:void 0,min:void 0});if(i!==void 0&&!isNaN(c)&&c<i&&(s||u&&i<0))return Ar(i,{...t,max:void 0,min:void 0})}let y=k?parseInt(k,10).toString().replace(/\B(?=(\d{3})+(?!\d))/g,r):"",d=u?"-":"";return h.length>1&&h[1]===""&&T===""?`${d}${y||"0"}${o}`:T.length>0?`${d}${y||"0"}${o}${T}`:`${d}${y}`}let w=b.replace(/\D/g,"");if(!w)return u?"-":"";let g=parseInt(w,10);if(isNaN(g))return"";u&&(g=-g),a!==void 0&&g>a&&(g=a),i!==void 0&&g<i&&(s||u&&i<0)&&(g=i);let m=g<0?"-":"",x=Math.abs(g).toString().replace(/\B(?=(\d{3})+(?!\d))/g,r);return`${m}${x}`}function su(e,t){let r=t?.thousandSeparator??".";return e.split(r).join("")}function Or(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 Bs(e,t,r,o){let n=o?.decimalSeparator??",",i=0;for(let l=0;l<r&&l<e.length;l++){let b=e.charAt(l);(/\d/.test(b)||b===n||b==="-")&&i++}if(i===0)return 0;let a=t.length,s=0;for(let l=0;l<t.length;l++){let b=t.charAt(l);if((/\d/.test(b)||b===n||b==="-")&&s++,s===i){a=l+1;break}}return Math.min(a,t.length)}function Zi(e,t="numeric"){return t==="numeric"?/^\d$/.test(e):t==="alphanumeric"?/^[a-zA-Z0-9]$/.test(e):!0}function Ji(e,t="numeric"){return t==="numeric"?e.replace(/\D/g,""):t==="alphanumeric"?e.replace(/[^a-zA-Z0-9]/g,""):e}function Qi(e,t=/[\r\n,;\t]+/,r=!0){return e?e.split(t).map(o=>r?o.trim():o).filter(Boolean):[]}import{jsx as Rp}from"react/jsx-runtime";function bo({value:e,defaultValue:t,min:r,max:o,thousandSeparator:n=".",decimalSeparator:i=",",maxDecimalDigits:a=0,allowNegative:s,onChange:l,onClear:b,onBlur:u,ref:w,...g}){let m={max:o,min:r,thousandSeparator:n,decimalSeparator:i,maxDecimalDigits:a,allowNegative:s},x=e!==void 0,[v,h]=Tp(t),k=x?e:v,T=Ar(k,m),y=()=>{x||h(""),b?.()},d=f=>{let p=f.target,S=p.value,R=p.selectionStart||0,D=Ar(S,m),P=Bs(S,D,R,{decimalSeparator:i});if(x||h(D),p.value=D,l){let I={...f,target:p,currentTarget:p};l(I)}requestAnimationFrame(()=>{p&&p.setSelectionRange&&p.setSelectionRange(P,P)})},c=f=>{if(r!==void 0&&k!==void 0&&k!==null&&k!==""){let p=Or(String(k),{thousandSeparator:n,decimalSeparator:i});if(p!==void 0&&p<r){let S=Ar(r,{...m,clampMin:!0});if(x||h(S),l){f.target.value=S;let R={...f,target:f.target,currentTarget:f.target};l(R)}}}u?.(f)};return Rp(Ct,{ref:w,type:"text",inputMode:a>0?"decimal":"numeric",value:T,onChange:d,onBlur:c,onClear:y,...g})}import{useId as Dp,useState as Np,useEffect as Pp,useRef as zp,useImperativeHandle as Ip}from"react";import{jsx as ho,jsxs as Un}from"react/jsx-runtime";function Hs({ref:e,config:t,id:r,name:o,length:n=6,value:i,defaultValue:a="",onChange:s,onComplete:l,type:b="numeric",mask:u=!1,size:w="md",variant:g="outline",color:m="primary",radius:x,autoFocus:v=!1,disabled:h=!1,readOnly:k=!1,groupSize:T,separator:y="-",ariaLabel:d="One-time password",getSlotAriaLabel:c,allowOneTimeCode:f=!0,label:p,labelPlacement:S="top",helperText:R,errorMessage:D,className:P="",slotClassName:I="",wrapperClassName:E="",labelClassName:N="",helperClassName:M=""}){let{isRequired:z=!1,isInvalid:H=!1,isLoading:V=!1,showSpinner:Y=!1}=t??{},$=Dp(),F=r||$,G=`${F}-slot-0`,A=`${F}-error-helper`,[U,B]=Np(()=>{let J=(i!==void 0?i:a).split("");return Array.from({length:n},(O,W)=>J[W]||"")}),X=zp([]),le=i!==void 0,oe=le?Array.from({length:n},(J,O)=>i&&i[O]!==void 0?i[O]:""):U,ue=!!(H||D),ie=ue?"error":m;Pp(()=>{if(v&&!h&&!k){let J=oe.findIndex(W=>!W),O=J!==-1?J:0;X.current[O]?.focus()}},[v,oe,h,k]),Ip(e,()=>({getValue:()=>oe.join(""),clear:()=>{let J=Array(n).fill("");le||B(J),s?.(""),!h&&!k&&X.current[0]?.focus()},focus:(J=0)=>{let O=Math.max(0,Math.min(J,n-1));X.current[O]?.focus()}}),[oe,n,le,s,h,k]);let Q=J=>{le||B(J);let O=J.join("");s?.(O),J.every(W=>W.length>0)&&J.length===n&&l?.(O)},q=(J,O)=>{let W=Ji(J,b);if(!W)return;let we=[...oe],fe=W.length>=n?0:O,se=W.slice(0,n-fe).split("");se.forEach((Re,xe)=>{fe+xe<n&&(we[fe+xe]=Re)}),Q(we);let me=Math.min(fe+se.length,n-1);X.current[me]?.focus()},ge=(J,O)=>{if(h||k||V)return;let W=J.target.value;if(!W){let fe=[...oe];fe[O]="",Q(fe);return}if(W.length>1){q(W,O);return}let we=W.slice(-1);if(Zi(we,b)){let fe=[...oe];fe[O]=we,Q(fe),O<n-1&&X.current[O+1]?.focus()}},ke=(J,O)=>{if(!(h||k||V)){if(J.key==="Backspace"){J.preventDefault();let W=[...oe];oe[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=[...oe];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<n-1&&X.current[O+1]?.focus();else if((J.ctrlKey||J.metaKey)&&J.key.toLowerCase()==="c"){let W=oe.join("");W&&navigator.clipboard?.writeText(W)}else if((J.ctrlKey||J.metaKey)&&J.key.toLowerCase()==="x"){J.preventDefault();let W=oe.join("");W&&navigator.clipboard?.writeText(W);let we=Array(n).fill("");Q(we),X.current[0]?.focus()}}},L=(J,O)=>{if(h||k||V)return;J.preventDefault();let W=J.clipboardData.getData("text/plain");q(W,O)},te=C(w,tu,"md"),Z=C(w,_i,"md"),he=C(x,Xo,"md"),ae=g==="other"?"":C(ie,C(g,qo,"outline"),"primary"),ve=h?"opacity-50":"",Se=()=>p?Un("label",{htmlFor:G,className:`block font-medium text-neutral-700 select-none ${te.label} ${N}`,children:[p,z&&ho("span",{className:"text-error-500 ml-0.5",children:"*"})]}):null;return Un("div",{className:`group/otp flex ${S==="left"?"flex-row items-start gap-3":"flex-col"} ${E}`,children:[Se(),Un("div",{className:"flex flex-col",children:[Un("div",{role:"group","aria-label":d,"aria-describedby":D||R?A:void 0,className:`inline-flex items-center ${te.gap} ${P}`,children:[Array.from({length:n}).map((J,O)=>{let W=!!(u||b==="password"),we=c?c(O,n):`K\xFD t\u1EF1 ${O+1} tr\xEAn ${n}`,fe=!!(T&&T>0)&&(O+1)%(T||1)===0&&O<n-1;return Un("div",{className:"inline-flex items-center gap-1.5",children:[ho("input",{id:`${F}-slot-${O}`,ref:se=>{X.current[O]=se},type:W?"password":"text",inputMode:b==="numeric"?"numeric":"text",pattern:b==="numeric"?"[0-9]*":void 0,maxLength:1,value:oe[O]||"",onFocus:se=>se.target.select(),onChange:se=>ge(se,O),onKeyDown:se=>ke(se,O),onPaste:se=>L(se,O),disabled:h||V,readOnly:k,"aria-label":we,"aria-invalid":ue,"aria-required":z,"aria-busy":V,"aria-disabled":h||V,autoComplete:f?"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&&ho("span",{"aria-hidden":"true",className:"inline-flex items-center justify-center text-neutral-400 select-none font-bold shrink-0",children:y})]},`${F}-slot-${O}`)}),V&&Y&&ho("div",{role:"status","aria-label":"\u0110ang t\u1EA3i",className:"inline-flex items-center justify-center pl-1.5 shrink-0 text-neutral-400",children:ho(De,{className:`animate-spin ${Z.icon}`})})]}),ho($e,{id:A,helperText:R,errorMessage:D,sizeClassName:te.helper,className:M}),o&&ho("input",{type:"hidden",name:o,value:oe.join(""),disabled:h||V})]})]})}import{useId as Fp,useState as Vs,useRef as Ep}from"react";import{useMergeRefs as $p}from"@floating-ui/react";import{jsx as lu,jsxs as Mp}from"react/jsx-runtime";function gr({width:e=14,height:t=14,className:r="",...o}){return Mp("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:[lu("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),lu("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}import{Fragment as Lp,jsx as st,jsxs as xo}from"react/jsx-runtime";function As({size:e,variant:t,color:r,radius:o,label:n,labelPlacement:i="floating",config:a,helperText:s,errorMessage:l,leftIcon:b,leftAddon:u,rightIcon:w,rightAddon:g,onClear:m,wrapperClassName:x="",inputWrapperClassName:v="",labelClassName:h="",helperClassName:k="",id:T,name:y,value:d,defaultValue:c=[],onChange:f,inputValue:p,onInputValueChange:S,delimiters:R=["Enter"],showAddButton:D=!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:oe,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=Fp(),O=T||J,W=`${O}-error-helper`,we=n?`${O}-label`:void 0,fe=Ep(null),se=$p([fe,te]),me=d!==void 0,[Re,xe]=Vs(c),re=me?d||[]:Re,de=p!==void 0,[ce,ee]=Vs(""),j=de?p||"":ce,[Ce,Ee]=Vs(""),Fe=Ie=>{de||ee(Ie),S?.(Ie)},ne=Ie=>{me||xe(Ie),f?.(Ie)},Te=Ie=>{if(Q||q||ae)return!1;let Oe=M?Ie.trim():Ie;if(!Oe)return!1;if($&&$>0&&Oe.length>$&&(Oe=Oe.slice(0,$)),V!==void 0&&re.length>=V)return Y?.(Oe),Ee(`Maximum limit of ${V} tags reached`),!1;if(!z&&re.includes(Oe))return H?.(Oe),Ee(`Tag "${Oe}" already exists`),!1;if(F){let pt=F(Oe);if(pt===!1||typeof pt=="string")return G?.(Oe,typeof pt=="string"?pt:void 0),Ee(`Tag "${Oe}" is invalid`),!1}let ut=[...re,Oe];return ne(ut),Fe(""),Ee(`Added tag "${Oe}"`),!0},Pe=Ie=>{if(Q||q||ae)return;let Oe=[...re],ut=new Set(re),pt=0;for(let Nr of Ie){let Et=M?Nr.trim():Nr;if(Et){if($&&$>0&&Et.length>$&&(Et=Et.slice(0,$)),V!==void 0&&Oe.length>=V){Y?.(Et);break}if(!z&&ut.has(Et)){H?.(Et);continue}if(F){let Ko=F(Et);if(Ko===!1||typeof Ko=="string"){G?.(Et,typeof Ko=="string"?Ko:void 0);continue}}Oe.push(Et),ut.add(Et),pt++}}ne(Oe),Fe(""),pt>0&&Ee(`Added ${pt} tags`)},_e=Ie=>{if(Q||q||ae)return;let Oe=re[Ie],ut=re.filter((pt,Nr)=>Nr!==Ie);ne(ut),Oe&&Ee(`Removed tag "${Oe}"`)},Ue=Ie=>{Ie?.stopPropagation(),!(Q||q||ae)&&(ne([]),Fe(""),Ee("Removed all tags"),m?.(),fe.current?.focus())},Le=Ie=>{if(Q||q||ae)return;R.includes(Ie.key)||R.includes("Enter")&&Ie.key==="Enter"||R.includes("Comma")&&(Ie.key===","||Ie.key==="Comma")||R.includes("Tab")&&Ie.key==="Tab"||R.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))},He=Ie=>{if(!(Q||q||ae)&&E){let Oe=Ie.clipboardData.getData("text");if(Oe){let ut=Qi(Oe,N,M);(ut.length>1||N.test(Oe))&&(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,eu,"md"),Me=C(o,Xo,"md"),Xe=le||C(o,Qc,"md"),Ve=oe||pe.badgeSize||"sm",Ze=X||r,qe=B||t,Ne=t==="other"?"":C(ze,C(t,qo,"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}),Ae=()=>st(at,{id:we,htmlFor:O,label:n,isRequired:Z,isFloating:Ye,size:e,color:ze,hasError:_,className:h}),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,Ne,Tt,ye?"w-full":"w-auto min-w-[200px]",v].filter(Boolean).join(" "),nt=i==="left",Rt=V===void 0||re.length<V,go=D&&!Q&&!q;return xo("div",{role:"group","aria-labelledby":we,className:`group/field flex ${nt?"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&&Ae(),xo("div",{className:`flex flex-col ${ye?"w-full":""}`,children:[xo("div",{className:"flex items-stretch",children:[u&&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:u}),xo("div",{className:`${Ft} ${u?"rounded-l-none!":""} ${g?"rounded-r-none!":""}`,children:[Ye&&Ae(),b&&st("div",{className:"flex items-center justify-center pl-1 pr-1.5 shrink-0",children:be(b)}),xo("div",{className:`flex flex-wrap items-center flex-1 min-w-0 ${pe.gap}`,children:[(()=>{let Ie=new Map;return rt.map((Oe,ut)=>{let pt=(Ie.get(Oe)??0)+1;Ie.set(Oe,pt);let Nr=`${Oe}_${pt}`;return U?st("span",{className:"inline-flex shrink-0",children:U({value:Oe,index:ut,onRemove:()=>_e(ut),disabled:Q,readOnly:q})},Nr):st("span",{className:"inline-flex shrink-0",children:st($t,{size:Ve,variant:qe,color:Ze,radius:Xe,deleteAriaLabel:`Remove tag ${Oe}`,onDelete:!Q&&!q?()=>_e(ut):void 0,className:`shrink-0 max-w-full truncate select-none ${ue}`,children:Oe})},Nr)})})(),Je>0&&st("span",{className:"inline-flex shrink-0",children:xo($t,{size:Ve,variant:"filled",color:"neutral",radius:Xe,className:"shrink-0 font-medium select-none",children:["+",Je]})}),Rt?st("input",{ref:se,id:O,type:"text",value:j,onChange:Ie=>Fe(Ie.target.value),onKeyDown:Le,onPaste:He,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]}),go&&st("div",{className:"flex items-center justify-center pl-1.5 shrink-0",children:P?P({onAdd:()=>Te(j),disabled:!j.trim()||!Rt}):st("button",{type:"button",onClick:Ie=>{Ie.stopPropagation(),j.trim()&&Rt?Te(j):fe.current?.focus()},disabled:!j.trim()||!Rt,"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(gr,{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(De,{}))}),!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(Be,{className:"size-full"})}),!ae&&w&&st("div",{className:"flex items-center justify-center pl-1.5 shrink-0",children:be(w)})]}),g&&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:g})]}),st($e,{id:W,helperText:s,errorMessage:l,sizeClassName:pe.helper,className:k}),y&&(()=>{let Ie=new Map;return xo(Lp,{children:[re.map(Oe=>{let ut=(Ie.get(Oe)??0)+1;Ie.set(Oe,ut);let pt=`${Oe}_${ut}`;return st("input",{type:"hidden",name:`${y}[]`,value:Oe,disabled:Q||ae},`hidden_${pt}`)}),re.length===0&&st("input",{type:"hidden",name:y,value:"",disabled:Q||ae})]})})()]})]})}import{useId as Bp,useState as Hp,useRef as Vp}from"react";import Ap from"react-textarea-autosize";import{useMergeRefs as Op}from"@floating-ui/react";var cu={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"}},uu={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},du={none:"resize-none",vertical:"resize-y",horizontal:"resize-x",both:"resize"},fu={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 Gr,jsxs as ea}from"react/jsx-runtime";function Os({size:e,variant:t,color:r,radius:o,label:n,labelPlacement:i="floating",config:a,helperText:s,errorMessage:l,onClear:b,minRows:u=3,maxRows:w,onHeightChange:g,cacheMeasurements:m,resize:x="none",wrapperClassName:v="",textareaWrapperClassName:h="",labelClassName:k="",helperClassName:T="",countClassName:y="",id:d,value:c,defaultValue:f,onChange:p,disabled:S=!1,readOnly:R=!1,className:D="",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=Bp(),B=d||U,X=`${B}-error-helper`,le=Vp(null),[oe,ue]=Hp(f),ie=Op([le,E]),Q=c!==void 0,q=Q?c:oe,ge=!!(H||l),ke=ge?"error":r,L=C(e,cu,"md"),te=C(o,uu,"md"),Z=A?"resize-none":C(x,du,"none"),he=t==="other"?"":C(ke,C(t,fu,"outline"),"primary"),ae=q!=null?String(q).length:0,ve=ae>0,Se=Re=>{let xe=Re.target.value;I!==void 0&&xe.length>I&&(xe=xe.slice(0,I),Re.target.value=xe),Q||ue(xe),p?.(Re)},ye=()=>{Q||ue(""),b?.()},J=i==="floating",O=()=>Gr(at,{htmlFor:B,label:n,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",h].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,D].filter(Boolean).join(" "),se=i==="left",me={id:B,value:q,onChange:Se,disabled:S||V,readOnly:R,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 ea("div",{className:`group/field flex ${se?"flex-row items-start gap-3":"flex-col"} ${J?"pt-2":""} ${G?"w-full":"inline-flex"} ${v}`,children:[!J&&O(),ea("div",{className:`flex flex-col ${G?"w-full":""}`,children:[ea("div",{className:W,children:[J&&O(),A?Gr(Ap,{ref:ie,minRows:u,maxRows:w,onHeightChange:g,cacheMeasurements:m,...me}):Gr("textarea",{ref:ie,rows:u,...me}),V&&Y&&Gr("div",{className:"absolute top-2.5 right-2.5 text-neutral-400 size-4 select-none pointer-events-none",children:Gr(De,{className:"size-full animate-spin"})}),!V&&$&&!S&&!R&&Gr("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:Gr(Be,{className:"size-full"})}),F&&ea("div",{className:`absolute bottom-2 right-2.5 text-[11px] font-mono select-none pointer-events-none z-10 text-neutral-400 ${y}`,children:[ae,I!==void 0&&`/${I}`]})]}),Gr($e,{id:X,helperText:s,errorMessage:l,sizeClassName:L.helper,className:T})]})]})}import{useId as Gp,useState as Up}from"react";var ta={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"}},pu={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},gu={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"}},mu={horizontal:"flex flex-row flex-wrap gap-4 items-center",vertical:"flex flex-col gap-2.5"},bu={xs:"sm",sm:"sm",md:"md",lg:"md",xl:"lg"};import{jsx as hu}from"react/jsx-runtime";function Ur({width:e=14,height:t=14,className:r="",...o}){return hu("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:hu("polyline",{points:"20 6 9 17 4 12"})})}import{jsx as xu}from"react/jsx-runtime";function ra({width:e=14,height:t=14,className:r="",...o}){return xu("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:xu("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})}import{jsx as mr,jsxs as Gs}from"react/jsx-runtime";function br({size:e="md",variant:t="filled",color:r="primary",radius:o,config:n,label:i,children:a,helperText:s,errorMessage:l,labelPlacement:b="right",icon:u,indeterminateIcon:w,wrapperClassName:g="",boxClassName:m="",labelClassName:x="",helperClassName:v="",className:h="",checked:k,defaultChecked:T,disabled:y=!1,readOnly:d=!1,onChange:c,value:f,id:p,name:S,ref:R,...D}){let{isRequired:P=!1,isInvalid:I=!1,isLoading:E=!1,showSpinner:N=!1,indeterminate:M=!1}=n??{},z=i||a,H=Gp(),V=p||H,Y=`${V}-helper`,$=!!(I??!!l),F=k!==void 0,[G,A]=Up(T??!1),U=F?k:G,B=Z=>{y||d||E||(F||A(Z.target.checked),c?.(Z))},X=C(e,ta,"md"),le=C(o,pu,"md"),oe=U||M,ue=C(t==="other"?"filled":t,gu,"filled"),ie;t==="other"?ie="":oe?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=oe?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,!y&&!d&&!E?"active:scale-95":"",m].filter(Boolean).join(" "),q=["select-none font-medium text-neutral-900 dark:text-neutral-100 transition-colors",X.label,y?"opacity-60":"",x].filter(Boolean).join(" "),ge=["group inline-flex relative",b==="left"?"flex-row-reverse justify-between":"flex-row",X.gap,y?"opacity-50":"cursor-pointer",g,h].filter(Boolean).join(" "),ke=()=>E&&N?mr("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${X.icon}`,"aria-hidden":"true",children:mr(De,{className:"size-full animate-spin"})}):M?mr("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${X.icon}`,"aria-hidden":"true",children:w||mr(ra,{className:"size-full"})}):U?mr("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${X.icon}`,"aria-hidden":"true",children:u||mr(Ur,{className:"size-full"})}):null,L=!!z,te=Z=>{(y||d||E)&&Z.preventDefault()};return Gs("div",{className:`inline-flex flex-col ${h}`.trim(),children:[Gs("label",{className:ge,onClick:te,children:[mr("input",{ref:R,type:"checkbox",id:V,name:S,value:f,checked:U,disabled:y||E,readOnly:d,required:P,"aria-checked":M?"mixed":U,"aria-invalid":$,"aria-required":P,"aria-busy":E,"aria-disabled":y||E,"aria-describedby":l||s?Y:void 0,onChange:B,className:"sr-only peer",...D}),mr("span",{className:Q,"aria-hidden":"true",children:ke()}),L&&Gs("span",{className:q,children:[z,P&&mr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})]}),mr($e,{id:Y,helperText:s,errorMessage:l,sizeClassName:X.helper,className:v})]})}import{useState as jn,useId as Wp,useMemo as ku,useCallback as Kp}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 vu,useEffect as yu,useCallback as wu}from"react";function vo(e,t=300){let r=vu(e),o=vu(null);yu(()=>{r.current=e},[e]);let n=wu(()=>{o.current&&(clearTimeout(o.current),o.current=null)},[]);return yu(()=>n,[n]),{debounced:wu((...a)=>{n(),o.current=setTimeout(()=>{r.current(...a)},t)},[n,t]),cancel:n}}import{jsx as Cu,jsxs as Yp}from"react/jsx-runtime";function jp({width:e=16,height:t=16,className:r="",...o}){return Yp("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[Cu("circle",{cx:"11",cy:"11",r:"8"}),Cu("line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"})]})}var yo=jp;import{jsx as Pr,jsxs as Su}from"react/jsx-runtime";var _p=[],Xp=[];function wo({value:e,defaultValue:t=Xp,onChange:r,size:o="md",color:n="primary",variant:i="filled",radius:a,disabled:s=!1,label:l,helperText:b,errorMessage:u,orientation:w="vertical",labelPlacement:g="right",className:m="",wrapperClassName:x="",labelClassName:v="",helperClassName:h="",options:k=_p,config:T,searchMode:y="client",searchPlaceholder:d="T\xECm ki\u1EBFm...",searchValue:c,defaultSearchValue:f="",onSearchChange:p,searchClassName:S="",searchField:R="label",filterFn:D,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=Wp(),X=`${B}-label`,le=`${B}-helper`,oe=`${B}-search`,ue=e!==void 0,[ie,Q]=jn(t),q=ue?e:ie,ge=!!(V??!!u),ke=c!==void 0,[L,te]=jn(f),Z=ke?c:L,[he,ae]=jn(null),[ve,Se]=jn(!1),ye=!!(U??ve),[J,O]=jn(()=>{let ee=new Map;return k.forEach(j=>{ee.set(String(j.value),j)}),ee}),{debounced:W}=vo(async ee=>{if(!(y!=="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),p?.(j),y==="server"&&W(j)},fe=()=>{ke||te(""),p?.(""),y==="server"&&W("")},se=ku(()=>{let ee=Z.trim(),j=y==="server"&&he?he:k;if(!G||!ee)return j;let Ce;if(y==="server"?Ce=j:D?Ce=j.filter(ne=>D(ne,ee)):Ce=mo(j,ee,R),!A)return Ce;let Ee=new Set(Ce.map(ne=>String(ne.value))),Fe=[];for(let ne of q)if(!Ee.has(ne)){let Te=J.get(ne);Te?Fe.push(Te):Fe.push({value:ne,label:ne})}return[...Fe,...Ce]},[G,Z,y,he,k,D,R,A,q,J]),me=Kp((ee,j)=>{if(s||F||Y)return;if(j){let Fe=(y==="server"&&he?he:k).find(ne=>String(ne.value)===ee);Fe&&O(ne=>{if(ne.has(ee))return ne;let Te=new Map(ne);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,y,he]),Re=C(w,mu,"vertical"),xe=["text-sm font-semibold text-neutral-900 dark:text-neutral-100 mb-1.5 select-none",s?"opacity-60":"",v].filter(Boolean).join(" "),re=C(o,ta,"md"),de=C(o,bu,"md"),ce=ku(()=>new Set(q.map(String)),[q]);return Su("div",{ref:M,role:"group","aria-labelledby":l?X:void 0,"aria-describedby":u||b?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&&Su("span",{id:X,className:xe,children:[l,H&&Pr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),G&&Pr("div",{className:`mb-2.5 ${S}`,children:Pr(Ct,{id:oe,variant:"outline",size:de,color:n,value:Z,onChange:we,placeholder:d,disabled:s,leftIcon:Pr(yo,{className:"size-4 text-neutral-400"}),rightIcon:ye?Pr(De,{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}})}),Pr("div",{className:`${Re} ${m}`,children:N||(se.length>0?se.map(ee=>{let j=String(ee.value),Ce=ce.has(j);return Pr(br,{value:ee.value,label:ee.label,helperText:ee.description,disabled:s||!!ee.disabled,readOnly:F||!!ee.isReadOnly,size:o,color:n,variant:i,radius:a,labelPlacement:g,checked:Ce,onChange:Ee=>me(j,Ee.target.checked),config:{indeterminate:ee.indeterminate,isLoading:Y,showSpinner:$,isInvalid:ge,isRequired:H}},ee.value)}):Pr("div",{className:"py-2 text-xs text-neutral-500 dark:text-neutral-400 italic",children:!Z.trim()&&y==="server"?"Nh\u1EADp t\u1EEB kh\xF3a \u0111\u1EC3 t\xECm ki\u1EBFm...":E}))}),Pr($e,{id:le,helperText:b,errorMessage:u,sizeClassName:re.helper,className:h})]})}import{useId as qp,useState as Zp}from"react";var na={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"}},ia={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"}},Tu={horizontal:"flex flex-row flex-wrap gap-4 items-center",vertical:"flex flex-col gap-2.5"},Ru={xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"xl"};import{jsx as Du}from"react/jsx-runtime";function aa({className:e}){return Du("svg",{viewBox:"0 0 10 10",className:e,fill:"currentColor","aria-hidden":"true",children:Du("circle",{cx:"5",cy:"5",r:"5"})})}import{jsx as jr,jsxs as Us}from"react/jsx-runtime";function Yn({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:b,dotIcon:u,wrapperClassName:w="",boxClassName:g="",labelClassName:m="",helperClassName:x="",className:v="",checked:h,defaultChecked:k=!1,onChange:T,value:y,id:d,name:c,ref:f,...p}){let{isRequired:S=!1,isInvalid:R=!1,isLoading:D=!1}=i??{},P=qp(),I=d||P,E=`${I}-helper`,N=h!==void 0,[M,z]=Zp(k),H=N?h:M,V=!!(R||b),Y=ie=>{o||n||D||(N||z(ie.target.checked),T?.(ie))},$=C(e,na,"md"),F=t==="other"?"":C(r,C(t,ia,"filled"),"primary"),G=V?ia[t==="other"?"filled":t]?.error||ia.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,!o&&!n&&!D?"active:scale-95":"",g].filter(Boolean).join(" "),U=["select-none font-medium text-neutral-900 dark:text-neutral-100 transition-colors",$.label,o?"opacity-60":"",m].filter(Boolean).join(" "),B=["group inline-flex relative",a==="left"?"flex-row-reverse justify-between":"flex-row",$.gap,o?"cursor-not-allowed opacity-60":"cursor-pointer",w,v].filter(Boolean).join(" "),X=()=>D?jr("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${$.dot}`,"aria-hidden":"true",children:jr(De,{className:"size-full animate-spin"})}):H?jr("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${$.dot}`,"aria-hidden":"true",children:u||jr(aa,{className:"size-full"})}):null,le=!!s;return Us("div",{className:"inline-flex flex-col",children:[Us("label",{className:B,onClick:ie=>{(o||n||D)&&ie.preventDefault()},children:[jr("input",{ref:f,type:"radio",id:I,name:c,value:y,checked:H,disabled:o||D,readOnly:n,required:S,"aria-busy":D,"aria-disabled":o||D,"aria-describedby":b||l?E:void 0,onChange:Y,onClick:ie=>{if(o||n||D){ie.preventDefault();return}p.onClick?.(ie)},className:"sr-only peer",...p}),jr("span",{className:A,"aria-hidden":"true",children:X()}),le&&Us("span",{className:U,children:[s,S&&jr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})]}),jr($e,{id:E,helperText:l,errorMessage:b,sizeClassName:$.helper,className:x})]})}import{useState as Wn,useId as Nu,useMemo as Jp,useCallback as Qp}from"react";import{jsx as zr,jsxs as Pu}from"react/jsx-runtime";var eg=[];function js({options:e=eg,value:t,defaultValue:r=null,onChange:o,size:n="md",color:i="primary",variant:a="filled",disabled:s=!1,label:l,helperText:b,errorMessage:u,orientation:w="vertical",labelPlacement:g="right",className:m="",wrapperClassName:x="",labelClassName:v="",helperClassName:h="",config:k,searchPlaceholder:T="T\xECm ki\u1EBFm...",searchValue:y,onSearchChange:d,searchMode:c="client",searchField:f="label",filterFn:p,onSearch:S,debounceMs:R=300,emptyText:D="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=Nu(),A=`${G}-label`,U=`${G}-helper`,B=`${G}-search`,X=Nu(),le=t!==void 0,[oe,ue]=Wn(r??null),ie=le?t:oe,Q=!!(z||u),q=y!==void 0,[ge,ke]=Wn(""),L=q?y:ge,[te,Z]=Wn(!1),he=F??te,[ae,ve]=Wn(null),[Se,ye]=Wn(()=>{let re=new Map;return e.forEach(de=>{re.set(String(de.value),de)}),re}),{debounced:J}=vo(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)}},R),O=re=>{let de=re.target.value;q||ke(de),d?.(de),c==="server"&&J(de)},W=()=>{q||ke(""),d?.(""),c==="server"&&ve(null)},we=Jp(()=>{let re=L.trim(),de=c==="server"&&ae?ae:e;if(!Y||!re)return de;let ce;if(c==="server"?ce=de:p?ce=de.filter(Ce=>p(Ce,re)):ce=mo(de,re,f),!$||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,p,f,$,ie,Se]),fe=Qp(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),o?.(re)},[s,V,H,le,o,e,c,ae]),se=C(w,Tu,"vertical"),me=C(n,na,"md"),Re=I??C(n,Ru,"md"),xe=["text-sm font-semibold text-neutral-900 dark:text-neutral-100 mb-1.5 select-none",s?"opacity-60":"",v].filter(Boolean).join(" ");return Pu("div",{ref:E,role:"radiogroup","aria-labelledby":l?A:void 0,"aria-describedby":u||b?U:void 0,"aria-errormessage":u?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&&Pu("span",{id:A,className:xe,children:[l,M&&zr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),Y&&zr("div",{className:`mb-2.5 ${P}`,children:zr(Ct,{id:B,variant:"outline",size:Re,color:i,value:L,onChange:O,placeholder:T,disabled:s||H,leftIcon:zr(yo,{className:"size-4 text-neutral-400"}),rightIcon:he?zr(De,{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}})}),zr("div",{className:`${se} ${m}`,children:we.length>0?we.map(re=>{let de=String(re.value),ce=ie!=null&&String(ie)===de;return zr(Yn,{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:n,color:i,variant:a,labelPlacement:g,config:{isLoading:H,isInvalid:Q,isRequired:M}},re.value)}):zr("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...":D})}),zr($e,{id:U,helperText:b,errorMessage:u,sizeClassName:me.helper,className:h})]})}import{useId as tg,useState as rg,useRef as og}from"react";import{useMergeRefs as ng}from"@floating-ui/react";var zu={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"}},Ys={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Iu={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 Ir,jsxs as sa}from"react/jsx-runtime";function Ws({size:e,variant:t,color:r,radius:o,thumbRadius:n,config:i,label:a,helperText:s,errorMessage:l,labelPlacement:b="right",thumbIcon:u,startContent:w,endContent:g,wrapperClassName:m="",trackClassName:x="",thumbClassName:v="",labelClassName:h="",helperClassName:k="",className:T="",checked:y,defaultChecked:d,disabled:c=!1,readOnly:f=!1,onChange:p,onClick:S,value:R,id:D,name:P,ref:I,...E}){let{isRequired:N=!1,isInvalid:M=!1,isLoading:z=!1,showSpinner:H=!1}=i??{},V=tg(),Y=D||V,$=`${Y}-error-helper`,F=og(null),G=ng([F,I]),A=y!==void 0,[U,B]=rg(d??!1),X=A?!!y:U,le=W=>{c||f||z||(A||B(W.target.checked),p?.(W))},oe=W=>{if(c||f||z){W.preventDefault();return}S?.(W)},ue=W=>{(c||f||z)&&W.preventDefault()},ie=!!(M||l),Q=ie?"error":r,q=C(e,zu,"md"),ge=C(o,Ys,"full"),ke=C(n,Ys,"full"),L=t==="other"?void 0:C(Q,C(t,Iu,"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",v].filter(Boolean).join(" "),ve=["select-none font-medium text-neutral-900 dark:text-neutral-100 transition-colors",q.label,c?"opacity-50":"",h].filter(Boolean).join(" "),ye=["group inline-flex items-center relative",b==="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?Ir("span",{className:`inline-flex items-center justify-center ${q.icon}`,"aria-hidden":"true",children:Ir(De,{className:"size-full animate-spin"})}):typeof u=="function"?u({isChecked:X,className:q.icon}):u?Ir("span",{className:`inline-flex items-center justify-center ${q.icon}`,"aria-hidden":"true",children:u}):null,O=()=>a?sa("span",{className:ve,children:[a,N&&Ir("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):null;return sa("div",{className:"inline-flex flex-col",children:[sa("label",{className:ye,onClick:ue,children:[Ir("input",{ref:G,type:"checkbox",role:"switch",id:Y,name:P,value:R,checked:X,onChange:le,onClick:oe,disabled:c||z,readOnly:f,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}),sa("span",{className:he,"aria-hidden":"true",children:[w&&Ir("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}),Ir("span",{className:ae,children:J()}),g&&Ir("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:g})]}),O()]}),Ir($e,{id:$,helperText:s,errorMessage:l,sizeClassName:q.helper,className:k})]})}import{jsx as Mu}from"react/jsx-runtime";function lt({width:e=16,height:t=16,className:r="",...o}){return Mu("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("path",{d:"m6 9 6 6 6-6"})})}import{jsx as Fu}from"react/jsx-runtime";function Yt({width:e=16,height:t=16,className:r="",...o}){return Fu("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:Fu("path",{d:"m15 18-6-6 6-6"})})}import{jsx as Eu}from"react/jsx-runtime";function Wt({width:e=16,height:t=16,className:r="",...o}){return Eu("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:Eu("path",{d:"m9 18 6-6-6-6"})})}import{jsx as la,jsxs as ig}from"react/jsx-runtime";function $u({width:e=16,height:t=16,className:r="",...o}){return ig("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("path",{d:"M8 2v4"}),la("path",{d:"M16 2v4"}),la("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),la("path",{d:"M3 10h18"})]})}import{jsx as Lu,jsxs as ag}from"react/jsx-runtime";function Bu({width:e=16,height:t=16,className:r="",...o}){return ag("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("circle",{cx:"12",cy:"12",r:"10"}),Lu("polyline",{points:"12 6 12 12 16 14"})]})}import{jsx as Hu,jsxs as sg}from"react/jsx-runtime";function Yr({width:e=16,height:t=16,className:r="",...o}){return sg("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:"m11 17-5-5 5-5"}),Hu("path",{d:"m18 17-5-5 5-5"})]})}import{jsx as Vu,jsxs as lg}from"react/jsx-runtime";function Wr({width:e=16,height:t=16,className:r="",...o}){return lg("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:"m6 17 5-5-5-5"}),Vu("path",{d:"m13 17 5-5-5-5"})]})}import{jsx as ir,jsxs as ug}from"react/jsx-runtime";function cg(e){return ug("svg",{viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[ir("ellipse",{cx:"48",cy:"80",rx:"36",ry:"8",className:"fill-neutral-200/60 dark:fill-neutral-800/60"}),ir("ellipse",{cx:"48",cy:"80",rx:"22",ry:"4.5",className:"fill-neutral-300/50 dark:fill-neutral-700/50"}),ir("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"}),ir("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"}),ir("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"}),ir("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"}),ir("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"}),ir("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"}),ir("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"}),ir("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"}),ir("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 Ks=cg;import{jsx as Mr,jsxs as Au}from"react/jsx-runtime";function dg(e){return Au("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[Mr("ellipse",{cx:"60",cy:"100",rx:"42",ry:"10",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),Mr("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"}),Mr("line",{x1:"42",y1:"36",x2:"66",y2:"36",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2.5",strokeLinecap:"round"}),Mr("line",{x1:"42",y1:"44",x2:"60",y2:"44",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2.5",strokeLinecap:"round"}),Mr("line",{x1:"42",y1:"52",x2:"52",y2:"52",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2.5",strokeLinecap:"round"}),Au("g",{transform:"translate(48, 38)",children:[Mr("circle",{cx:"28",cy:"28",r:"20",className:"fill-primary-50/80 dark:fill-primary-950/70 stroke-primary-500",strokeWidth:"3"}),Mr("path",{d:"M18 20A14 14 0 0 1 34 16",className:"stroke-primary-300",strokeWidth:"2",strokeLinecap:"round"}),Mr("path",{d:"M24 24L32 32M32 24L24 32",className:"stroke-neutral-400 dark:stroke-neutral-500",strokeWidth:"2",strokeLinecap:"round"}),Mr("path",{d:"M42 42L58 58",className:"stroke-primary-700 dark:stroke-primary-400",strokeWidth:"5",strokeLinecap:"round"})]})]})}var _s=dg;import{jsx as Co,jsxs as pg}from"react/jsx-runtime";function fg(e){return pg("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[Co("ellipse",{cx:"60",cy:"100",rx:"42",ry:"10",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),Co("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"}),Co("path",{d:"M60 30L78 64H42L60 30Z",className:"fill-error-100 dark:fill-error-900/60 stroke-error-500",strokeWidth:"2.5",strokeLinejoin:"round"}),Co("line",{x1:"60",y1:"42",x2:"60",y2:"52",className:"stroke-error-600",strokeWidth:"2.5",strokeLinecap:"round"}),Co("circle",{cx:"60",cy:"58",r:"1.5",className:"fill-error-600"}),Co("path",{d:"M22 66L32 60",className:"stroke-neutral-300 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"3 3"}),Co("path",{d:"M98 66L88 60",className:"stroke-neutral-300 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"3 3"})]})}var Xs=fg;import{jsx as Jo,jsxs as mg}from"react/jsx-runtime";function gg(e){return mg("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[Jo("ellipse",{cx:"60",cy:"98",rx:"42",ry:"10",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),Jo("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"}),Jo("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"}),Jo("line",{x1:"44",y1:"40",x2:"68",y2:"40",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round"}),Jo("line",{x1:"44",y1:"48",x2:"60",y2:"48",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round"}),Jo("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 qs=gg;import{jsx as ca,jsxs as hg}from"react/jsx-runtime";function bg(e){return hg("svg",{viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[ca("ellipse",{cx:"32",cy:"54",rx:"24",ry:"5",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),ca("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"}),ca("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"}),ca("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 Zs=bg;import{jsx as Js,jsxs as xg}from"react/jsx-runtime";function Kt({width:e=20,height:t=20,className:r="",...o}){return xg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[Js("circle",{cx:"12",cy:"12",r:"10"}),Js("path",{d:"M12 16v-4"}),Js("path",{d:"M12 8h.01"})]})}import{jsx as Ou,jsxs as vg}from"react/jsx-runtime";function Qo({width:e=20,height:t=20,className:r="",...o}){return vg("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("circle",{cx:"12",cy:"12",r:"10"}),Ou("path",{d:"m9 12 2 2 4-4"})]})}import{jsx as Qs,jsxs as yg}from"react/jsx-runtime";function en({width:e=20,height:t=20,className:r="",...o}){return yg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[Qs("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}),Qs("path",{d:"M12 9v4"}),Qs("path",{d:"M12 17h.01"})]})}import{jsx as el,jsxs as wg}from"react/jsx-runtime";function tn({width:e=20,height:t=20,className:r="",...o}){return wg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[el("circle",{cx:"12",cy:"12",r:"10"}),el("path",{d:"M12 8v4"}),el("path",{d:"M12 16h.01"})]})}import{jsx as ua,jsxs as Cg}from"react/jsx-runtime";function rn({width:e=20,height:t=20,className:r="",...o}){return Cg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[ua("circle",{cx:"11",cy:"11",r:"8"}),ua("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),ua("line",{x1:"11",y1:"8",x2:"11",y2:"14"}),ua("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}import{jsx as tl,jsxs as kg}from"react/jsx-runtime";function on({width:e=20,height:t=20,className:r="",...o}){return kg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[tl("circle",{cx:"11",cy:"11",r:"8"}),tl("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),tl("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}import{jsx as Gu,jsxs as Sg}from"react/jsx-runtime";function Kr({width:e=20,height:t=20,className:r="",...o}){return Sg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[Gu("path",{d:"M21 2v6h-6"}),Gu("path",{d:"M21 8A10 10 0 1 0 22 13"})]})}import{jsx as Uu,jsxs as Tg}from"react/jsx-runtime";function nn({width:e=20,height:t=20,className:r="",...o}){return Tg("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:"M3 2v6h6"}),Uu("path",{d:"M3 8a10 10 0 1 1-1 5"})]})}import{jsx as an,jsxs as Rg}from"react/jsx-runtime";function sn({width:e=20,height:t=20,className:r="",...o}){return Rg("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 rl,jsxs as Dg}from"react/jsx-runtime";function hr({width:e=20,height:t=20,className:r="",...o}){return Dg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[rl("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),rl("polyline",{points:"7 10 12 15 17 10"}),rl("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}import{jsx as ju,jsxs as Ng}from"react/jsx-runtime";function Lt({width:e=20,height:t=20,className:r="",...o}){return Ng("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:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),ju("path",{d:"M3 3v5h5"})]})}import{jsx as ol,jsxs as Pg}from"react/jsx-runtime";function da({width:e=20,height:t=20,className:r="",...o}){return Pg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[ol("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),ol("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),ol("polyline",{points:"21 15 16 10 5 21"})]})}import{jsx as Yu,jsxs as zg}from"react/jsx-runtime";function fa({width:e=16,height:t=16,className:r="",...o}){return zg("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:[Yu("path",{d:"M6 2v14a2 2 0 0 0 2 2h14"}),Yu("path",{d:"M18 22V8a2 2 0 0 0-2-2H2"})]})}import{jsx as pa,jsxs as Ig}from"react/jsx-runtime";function ar({width:e=16,height:t=16,className:r="",...o}){return Ig("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[pa("polyline",{points:"3 6 5 6 21 6"}),pa("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"}),pa("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),pa("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}import{jsx as Wu}from"react/jsx-runtime";function Nt({width:e=24,height:t=24,className:r="",...o}){return Wu("svg",{width:e,height:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:r,...o,children:Wu("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 ga,jsxs as Mg}from"react/jsx-runtime";function ma({width:e=24,height:t=24,variant:r="solid",className:o="",...n}){return r==="outline"?Mg("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:[ga("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),ga("circle",{cx:"12",cy:"7",r:"4"})]}):ga("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:o,...n,children:ga("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 Ku,jsxs as Fg}from"react/jsx-runtime";function ba({width:e=16,height:t=16,className:r="",...o}){return Fg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[Ku("path",{d:"m7 15 5 5 5-5"}),Ku("path",{d:"m7 9 5-5 5 5"})]})}import{jsx as _u,jsxs as Eg}from"react/jsx-runtime";function ha({width:e=16,height:t=16,className:r="",...o}){return Eg("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:"m5 12 7-7 7 7"}),_u("path",{d:"M12 19V5"})]})}import{jsx as Xu,jsxs as $g}from"react/jsx-runtime";function xa({width:e=16,height:t=16,className:r="",...o}){return $g("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[Xu("path",{d:"M12 5v14"}),Xu("path",{d:"m19 12-7 7-7-7"})]})}import{jsx as Fr,jsxs as Lg}from"react/jsx-runtime";function va({width:e=16,height:t=16,className:r="",...o}){return Lg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...o,children:[Fr("line",{x1:"21",x2:"14",y1:"4",y2:"4"}),Fr("line",{x1:"10",x2:"3",y1:"4",y2:"4"}),Fr("line",{x1:"21",x2:"12",y1:"12",y2:"12"}),Fr("line",{x1:"8",x2:"3",y1:"12",y2:"12"}),Fr("line",{x1:"21",x2:"16",y1:"20",y2:"20"}),Fr("line",{x1:"12",x2:"3",y1:"20",y2:"20"}),Fr("line",{x1:"14",x2:"14",y1:"2",y2:"6"}),Fr("line",{x1:"8",x2:"8",y1:"10",y2:"14"}),Fr("line",{x1:"16",x2:"16",y1:"18",y2:"22"})]})}var qu={xs:{container:"p-2 gap-2 text-xs",title:"text-xs font-semibold leading-tight",description:"text-[11px] leading-tight",icon:"size-3.5 mt-0.5",closeButton:"size-4 p-0.5 -mr-0.5",closeIcon:"size-3",action:"gap-1.5 text-xs"},sm:{container:"p-2.5 gap-2.5 text-xs",title:"text-sm font-semibold leading-tight",description:"text-xs leading-normal",icon:"size-4 mt-0.5",closeButton:"size-5 p-0.5 -mr-0.5",closeIcon:"size-3.5",action:"gap-1.5 text-xs"},md:{container:"p-3.5 gap-3 text-sm",title:"text-sm font-semibold leading-tight",description:"text-sm leading-normal",icon:"size-5 mt-0.5",closeButton:"size-6 p-1 -mr-1",closeIcon:"size-4",action:"gap-2 text-sm"},lg:{container:"p-4 gap-3.5 text-base",title:"text-base font-semibold leading-snug",description:"text-sm leading-normal",icon:"size-6 mt-0.5",closeButton:"size-7 p-1.5 -mr-1.5",closeIcon:"size-4.5",action:"gap-2.5 text-sm"},xl:{container:"p-5 gap-4 text-lg",title:"text-lg font-semibold leading-snug",description:"text-base leading-normal",icon:"size-7 mt-0.5",closeButton:"size-8 p-1.5 -mr-1.5",closeIcon:"size-5",action:"gap-3 text-base"}},Zu={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Ju={soft:{primary:"bg-primary-50 text-primary-900 border-2 border-primary-200",secondary:"bg-secondary-50 text-secondary-900 border-2 border-secondary-200",neutral:"bg-neutral-100 text-neutral-900 border-2 border-neutral-200",error:"bg-error-50 text-error-900 border-2 border-error-200",success:"bg-success-50 text-success-900 border-2 border-success-200",warning:"bg-warning-50 text-warning-900 border-2 border-warning-200",info:"bg-info-50 text-info-900 border-2 border-info-200"},filled:{primary:"bg-primary-600 text-white border-2 border-primary-600",secondary:"bg-secondary-600 text-white border-2 border-secondary-600",neutral:"bg-neutral-700 text-white border-2 border-neutral-700",error:"bg-error-600 text-white border-2 border-error-600",success:"bg-success-600 text-white border-2 border-success-600",warning:"bg-warning-500 text-neutral-950 border-2 border-warning-500",info:"bg-info-600 text-white border-2 border-info-600"},outline:{primary:"bg-neutral-white text-primary-700 border-2 border-primary-400",secondary:"bg-neutral-white text-secondary-700 border-2 border-secondary-400",neutral:"bg-neutral-white text-neutral-700 border-2 border-neutral-300",error:"bg-neutral-white text-error-700 border-2 border-error-500",success:"bg-neutral-white text-success-700 border-2 border-success-400",warning:"bg-neutral-white text-warning-800 border-2 border-warning-400",info:"bg-neutral-white text-info-700 border-2 border-info-400"},"accent-left":{primary:"bg-primary-50/70 text-primary-900 border-2 border-primary-200 border-l-4 border-l-primary-500",secondary:"bg-secondary-50/70 text-secondary-900 border-2 border-secondary-200 border-l-4 border-l-secondary-500",neutral:"bg-neutral-50/70 text-neutral-900 border-2 border-neutral-200 border-l-4 border-l-neutral-500",error:"bg-error-50/70 text-error-900 border-2 border-error-200 border-l-4 border-l-error-500",success:"bg-success-50/70 text-success-900 border-2 border-success-200 border-l-4 border-l-success-500",warning:"bg-warning-50/70 text-warning-900 border-2 border-warning-200 border-l-4 border-l-warning-500",info:"bg-info-50/70 text-info-900 border-2 border-info-200 border-l-4 border-l-info-500"},ghost:{primary:"bg-transparent text-primary-800 border-2 border-transparent",secondary:"bg-transparent text-secondary-800 border-2 border-transparent",neutral:"bg-transparent text-neutral-800 border-2 border-transparent",error:"bg-transparent text-error-700 border-2 border-transparent",success:"bg-transparent text-success-700 border-2 border-transparent",warning:"bg-transparent text-warning-800 border-2 border-transparent",info:"bg-transparent text-info-800 border-2 border-transparent"}},Qu={soft:{primary:"text-primary-600",secondary:"text-secondary-600",neutral:"text-neutral-600",error:"text-error-600",success:"text-success-600",warning:"text-warning-600",info:"text-info-600"},filled:{primary:"text-white",secondary:"text-white",neutral:"text-white",error:"text-white",success:"text-white",warning:"text-neutral-950",info:"text-white"},outline:{primary:"text-primary-600",secondary:"text-secondary-600",neutral:"text-neutral-600",error:"text-error-600",success:"text-success-600",warning:"text-warning-600",info:"text-info-600"},"accent-left":{primary:"text-primary-600",secondary:"text-secondary-600",neutral:"text-neutral-600",error:"text-error-600",success:"text-success-600",warning:"text-warning-600",info:"text-info-600"},ghost:{primary:"text-primary-600",secondary:"text-secondary-600",neutral:"text-neutral-600",error:"text-error-600",success:"text-success-600",warning:"text-warning-600",info:"text-info-600"}},ed={primary:Kt,secondary:Kt,neutral:Kt,info:Kt,success:Qo,warning:en,error:tn};import{jsx as _r,jsxs as td}from"react/jsx-runtime";function ln({size:e,variant:t,color:r,radius:o,title:n,description:i,icon:a=!0,action:s,closable:l=!0,onClose:b,closeAriaLabel:u="\u0110\xF3ng c\u1EA3nh b\xE1o",banner:w=!1,titleClassName:g="",descriptionClassName:m="",actionClassName:x="",iconClassName:v="",closeButtonClassName:h="",className:k="",children:T,role:y,ref:d,...c}){let f=C(e,qu,"md"),p=w?"rounded-none border-x-0 w-full":C(o,Zu,"lg"),S=t==="other"?"":C(r,C(t,Ju,"soft"),"info"),R=t==="other"?"":C(r,C(t,Qu,"soft"),"info"),D=l||!!b,P=Y=>{Y.stopPropagation(),b?.()},E=y||(r==="error"||r==="warning"?"alert":"status"),N=r==="error"||r==="warning"?"assertive":"polite",M=i??T,z=!!M,H=()=>{if(a===!1)return null;if(a!==!0&&a!==void 0)return _r("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${f.icon} ${v}`,"aria-hidden":"true",children:a});let Y=C(r,ed,"info");return _r("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${f.icon} ${R} ${v}`,"aria-hidden":"true",children:_r(Y,{className:"size-full"})})},V=["relative flex w-full",f.container,p,S,k].filter(Boolean).join(" ");return td("div",{ref:d,role:E,"aria-live":N,className:V,...c,children:[H(),td("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[n&&_r("div",{className:`${f.title} ${g}`,children:n}),z&&_r("div",{className:`${f.description} ${n?"mt-0.5":""} ${m}`,children:M})]}),s&&_r("div",{className:`inline-flex items-center shrink-0 ${f.action} ${x}`,children:s}),D&&_r("button",{type:"button",onClick:P,"aria-label":u,className:`inline-flex items-center justify-center shrink-0 rounded-md transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-current opacity-70 hover:opacity-100 ${t==="filled"?"hover:bg-white/20 active:bg-white/30":"hover:bg-black/5 active:bg-black/10"} ${f.closeButton} ${h}`,children:_r(Be,{className:f.closeIcon})})]})}import{Toaster as Bg}from"sonner";var xr=4e3;import{jsx as Hg}from"react/jsx-runtime";function nl({position:e="top-right",visibleToasts:t=3,expand:r=!1,duration:o=4e3,closeButton:n=!1,className:i="",toastOptions:a,...s}){return Hg(Bg,{position:e,visibleToasts:t,expand:r,duration:o,closeButton:n,className:`toaster group ${i}`,toastOptions:{unstyled:!0,className:"w-full max-w-md pointer-events-auto",...a},...s})}import{isValidElement as Vg}from"react";import{toast as cn}from"sonner";import{jsx as al}from"react/jsx-runtime";function Xr(e,t="info",r="soft",o,n={},i){let{duration:a,position:s,onDismiss:l,onAutoClose:b,...u}=n;return cn.custom(w=>al(ln,{color:t,variant:r,title:e,description:o,closable:u.closable??!0,onClose:()=>{u.onClose?.(),cn.dismiss(w)},...u}),{id:i,duration:a??4e3,position:s,onDismiss:l,onAutoClose:b})}function Ag(e){return typeof e=="object"&&e!==null&&!Vg(e)&&!Array.isArray(e)&&("title"in e||"description"in e||"color"in e||"variant"in e)}function il(e,t,r){return Ag(e)?{title:e.title??"",description:e.description,color:e.color??t,variant:e.variant??r}:{title:e,description:void 0,color:t,variant:r}}var vr=((e,t,r)=>{let o=r||{};return Xr(e,o.color||"info",o.variant||"soft",t,o)});vr.custom=(e,t={})=>{if(typeof e=="function")return cn.custom(s=>e(s),{duration:t.duration??4e3,position:t.position,onDismiss:t.onDismiss,onAutoClose:t.onAutoClose});let{duration:r,position:o,onDismiss:n,onAutoClose:i,...a}=e;return cn.custom(s=>al(ln,{closable:a.closable??!0,onClose:()=>{a.onClose?.(),cn.dismiss(s)},...a}),{duration:r??4e3,position:o,onDismiss:n,onAutoClose:i})};vr.success=(e,t,r)=>{let o=r||{};return Xr(e,o.color||"success",o.variant||"soft",t,o)};vr.error=(e,t,r)=>{let o=r||{};return Xr(e,o.color||"error",o.variant||"soft",t,o)};vr.warning=(e,t,r)=>{let o=r||{};return Xr(e,o.color||"warning",o.variant||"soft",t,o)};vr.info=(e,t,r)=>{let o=r||{};return Xr(e,o.color||"info",o.variant||"soft",t,o)};vr.loading=(e,t,r)=>{let o=r||{};return Xr(e,o.color||"info",o.variant||"soft",t,{...o,icon:o.icon??al(De,{className:"size-full animate-spin"}),duration:o.duration??1/0,closable:o.closable??!1})};vr.promise=async(e,t)=>{let r=typeof e=="function"?e():e,{title:o,description:n}=il(t.loading,"info",t.variant||"soft"),i=vr.loading(o,n,{size:t.size,variant:t.variant,radius:t.radius});try{let a=await r,s=typeof t.success=="function"?t.success(a):t.success,{title:l,description:b,color:u,variant:w}=il(s,"success",t.variant||"soft");return Xr(l,u,w,b,{duration:t.duration??4e3,size:t.size,radius:t.radius},i),a}catch(a){let s=typeof t.error=="function"?t.error(a):t.error,{title:l,description:b,color:u,variant:w}=il(s,"error",t.variant||"soft");throw Xr(l,u,w,b,{duration:t.duration??4e3,size:t.size,radius:t.radius},i),a}finally{t.finally&&await t.finally()}};vr.dismiss=e=>cn.dismiss(e);var rd=vr;import{cloneElement as Gg,isValidElement as sl,useState as sd}from"react";import{useFloating as Ug,autoUpdate as jg,offset as Yg,flip as Wg,shift as Kg,arrow as _g,useHover as Xg,useFocus as qg,useDismiss as Zg,useRole as Jg,useInteractions as Qg,useMergeRefs as em,FloatingPortal as tm,FloatingArrow as rm}from"@floating-ui/react";import{useTransitionStyles as Og}from"@floating-ui/react";function et(e,t={}){let{duration:r=150,offset:o=4,scale:n=.96,animated:i=!0}=t;return Og(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 od={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}},nd={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},id={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"}},ad={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 nm,jsx as ya,jsxs as ld}from"react/jsx-runtime";function om({children:e,ref:t,disabled:r,className:o="",...n}){let i=sl(e)?e.props?.ref:void 0,a=em([t,i]);if(!sl(e))return null;let s=e.props||{};return Gg(e,{...n,...s,ref:a,disabled:r?!0:s.disabled,className:[s.className,o].filter(Boolean).join(" ")})}function Kn({content:e,children:t,placement:r="top",variant:o,color:n,size:i,radius:a,hasArrow:s=!0,offset:l=8,flip:b=!0,shift:u=!0,delay:w={open:200,close:150},disabled:g=!1,animated:m=!0,animationDuration:x=150,open:v,defaultOpen:h=!1,onOpenChange:k,className:T="",arrowClassName:y="",zIndex:d=Qe.TOOLTIP}){let[c,f]=sd(h),[p,S]=sd(null),R=v!==void 0,D=R?v:c,P=q=>{R||f(q),k?.(q)},I=[Yg(l),b?Wg():void 0,u?Kg({padding:8}):void 0,s?_g({element:p}):void 0].filter(Boolean),{refs:{setReference:E,setFloating:N},floatingStyles:M,context:z,placement:H}=Ug({placement:r,open:D&&!g,onOpenChange:P,whileElementsMounted:jg,transform:!1,middleware:I}),V=Xg(z,{move:!1,delay:w,enabled:!g}),Y=qg(z,{enabled:!g}),$=Zg(z),F=Jg(z,{role:"tooltip"}),{getReferenceProps:G,getFloatingProps:A}=Qg([V,Y,$,F]),{isMounted:U,styles:B}=et(z,{duration:x,animated:m}),X=C(i,od,"md"),le=C(a,nd,"md"),oe=o==="other"?"":C(n,C(o,id,"filled"),"neutral"),ue=o==="other"?"":C(n,C(o,ad,"filled"),"neutral"),ie=["select-none pointer-events-none max-w-xs break-words",X.box,le,oe,T].filter(Boolean).join(" "),Q=G();return ld(nm,{children:[sl(t)?ya(om,{ref:E,disabled:g,...Q,children:t}):ya("span",{ref:E,...Q,children:t}),ya(tm,{children:U&&!g&&e&&ld("div",{ref:N,style:{...M,...m?B:{},zIndex:d},className:ie,"data-state":D?"open":"closed","data-placement":H,...A(),children:[e,s&&ya(rm,{ref:S,context:z,width:X.arrowWidth,height:X.arrowHeight,strokeWidth:o==="outline"||o==="soft"?1:0,className:[ue,y].filter(Boolean).join(" ")})]})})]})}import{useId as am,useState as sm}from"react";import*as un from"@radix-ui/react-slider";var ko={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"},cd={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 cl}from"react";import*as ud from"@radix-ui/react-slider";import{jsx as wa}from"react/jsx-runtime";function _n({id:e,thumbIdx:t,value:r,orientation:o,size:n,thumbRadiusClass:i,thumbThemeStyles:a,thumbClassName:s="",tooltipClassName:l="",state:b,label:u,helperId:w,tooltipMode:g="none",tooltipPlacement:m,formatTooltip:x}){let{isLoading:v=!1,showSpinner:h=!1,disabled:k=!1,readOnly:T=!1,isRequired:y=!1,isInvalid:d=!1,isRange:c=!1,hasDescription:f=!1}=b??{},p=C(n,ko,"md"),[S,R]=cl(!1),[D,P]=cl(!1),[I,E]=cl(!1),N;g==="always"?N=!0:g==="active"?N=I||D:g==="hover"?N=S||I||D:g==="none"&&(N=!1);let M=m||(o==="vertical"?"right":"top"),z=x?x(r):r.toString(),H=typeof z=="string"||typeof z=="number"?String(z):void 0,V=wa(ud.Thumb,{id:`${e}-thumb-${t}`,tabIndex:k||v?-1:0,"aria-busy":v,"aria-disabled":k||v,"aria-readonly":T,"aria-required":y,"aria-invalid":d,"aria-errormessage":d?w:void 0,"aria-describedby":f?w:void 0,"aria-valuetext":H,"aria-orientation":o,"aria-label":typeof u=="string"?`${u} ${c?t===0?"minimum":"maximum":""}`:`Slider ${c?t===0?"min":"max":""}`,onFocus:()=>P(!0),onBlur:()=>P(!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 ${k||T?"cursor-not-allowed opacity-60 shadow-none":"cursor-grab active:cursor-grabbing hover:scale-105"} ${p.thumb} ${i} ${a} ${I&&!k&&!v?"scale-110 ring-4 ring-primary-500/20":""} ${s}`,children:v&&h&&wa("div",{className:"absolute inset-0 flex items-center justify-center p-0.5","aria-hidden":"true",children:wa(De,{className:"size-full animate-spin text-current"})})});return g!=="none"?wa(Kn,{content:z,placement:M,open:N,size:p.tooltipSize,className:l,disabled:k||v,children:V}):V}function ul(e,t,r){return Math.min(Math.max(e,t),r)}function Xn(e,t,r){return r<=t?0:ul((e-t)/(r-t)*100,0,100)}import{Fragment as im,jsx as Ca}from"react/jsx-runtime";function ka({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 b=Math.floor((r-t)/o);if(b<=20)for(let u=0;u<=b;u++){let w=t+u*o;s.push({value:w,label:w.toString()})}}if(!s.length)return null;let l=C(i,ko,"md");return Ca("div",{className:`relative w-full ${n==="vertical"?"h-full":"mt-2"}`,"aria-hidden":"true",children:s.map(b=>{let u=Xn(b.value,t,r);return Ca("div",{className:`absolute flex items-center justify-center select-none text-neutral-500 dark:text-neutral-400 ${l.markText} ${a}`,style:n==="vertical"?{bottom:`${u}%`,left:"100%",transform:"translateY(50%) translateX(6px)"}:{left:`${u}%`,transform:"translateX(-50%)"},children:b.label??b.value},b.value)})})}function Sa({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 b=C(i,ko,"md"),u=[];for(let w=0;w<=l;w++){let g=t+w*o,m=Xn(g,t,r),x=a?g>=(s[0]??t)&&g<=(s[1]??r):g<=(s[0]??t);u.push(Ca("span",{"aria-hidden":"true",className:`absolute rounded-full -translate-x-1/2 -translate-y-1/2 pointer-events-none transition-colors duration-150 ${b.stepDot} ${x?"bg-white/80 dark:bg-neutral-900/80":"bg-neutral-400/60 dark:bg-neutral-500/60"}`,style:n==="vertical"?{bottom:`${m}%`,left:"50%"}:{left:`${m}%`,top:"50%"}},`step-dot-${g}`))}return Ca(im,{children:u})}import{Fragment as dd,jsx as Bt,jsxs as So}from"react/jsx-runtime";function qn({config:e,value:t,defaultValue:r,min:o=0,max:n=100,step:i=1,minStepsBetweenThumbs:a=0,inverted:s=!1,size:l,variant:b,color:u,radius:w,thumbRadius:g,orientation:m="horizontal",label:x,labelPlacement:v="top",formatValue:h,showTooltip:k="none",tooltipPlacement:T,formatTooltip:y,marks:d=!1,startContent:c,endContent:f,disabled:p=!1,readOnly:S=!1,helperText:R,errorMessage:D,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:oe=!1,isLoading:ue=!1,showSpinner:ie=!1,showSteps:Q=!1,showValue:q=!1,isFullWidth:ge=!0}=e??{},ke=am(),L=I||ke,te=`${L}-helper`,Z=!!(oe||D),he=Z?"error":u,ae=Array.isArray(t??r),ve=t!==void 0,[Se,ye]=sm(()=>r!==void 0?Array.isArray(r)?r:[r]:ae?[o,n]:[o]),J=ve?Array.isArray(t)?t:t!==void 0?[t]:void 0:void 0,O=ve?Array.isArray(t)?[t[0]??o,t[1]??n]:[t??o,0]:ae?[Se[0]??o,Se[1]??n]:[Se[0]??o,0],W=j=>{if(p||S||ue)return;ve||ye(j);let Ce=ae?[j[0]??o,j[1]??n]:j[0]??o;E?.(Ce)},we=j=>{if(p||S||ue)return;let Ce=ae?[j[0]??o,j[1]??n]:j[0]??o;N?.(Ce)},fe=C(l,ko,"md"),se=C(w,ll,"full"),me=C(g,ll,"full"),Re=b==="other"?{track:"",filler:"",thumb:""}:C(he,C(b,cd,"filled"),"primary"),xe=Re.track,re=Re.filler,de=Re.thumb,ce=()=>{if(!x&&!q)return null;let j="";h?j=h(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 So("div",{className:"flex items-center justify-between gap-2 mb-1.5 select-none",children:[x&&So("label",{htmlFor:`${L}-thumb-0`,className:`font-medium ${Ce} ${fe.label} ${p?"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 So("div",{ref:X,className:`group/field flex flex-col ${ge?"w-full":"inline-flex"} ${p?"opacity-60 cursor-not-allowed":""} ${z||M}`,children:[v==="top"&&ce(),So("div",{className:`flex items-center ${fe.gap} ${m==="vertical"?"flex-col h-48":"flex-row w-full"} ${H}`,children:[v==="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}),So(un.Root,{min:o,max:n,step:i,minStepsBetweenThumbs:a,inverted:s,orientation:m,disabled:p||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"} ${p||S?"cursor-not-allowed":"cursor-pointer"}`,children:[So(un.Track,{className:`relative overflow-hidden ${m==="vertical"?`${fe.trackVertical} h-full`:`${fe.trackHorizontal} w-full`} ${se} ${xe} ${V}`,children:[Bt(Sa,{showSteps:Q,min:o,max:n,step:i,orientation:m,size:l||"md",isRange:ae,currentValues:O}),Bt(un.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(_n,{id:L,thumbIdx:Ce,value:j,orientation:m,size:l||"md",thumbRadiusClass:me,thumbThemeStyles:de,thumbClassName:$,tooltipClassName:U,state:{isLoading:ue,showSpinner:ie,disabled:p,readOnly:S,isRequired:le,isInvalid:Z,isRange:ae,hasDescription:!!(Z||R)},label:x,helperId:te,tooltipMode:k,tooltipPlacement:T,formatTooltip:y},Ee)})]}),f&&Bt("div",{className:"inline-flex shrink-0 items-center justify-center select-none text-neutral-500 dark:text-neutral-400","aria-hidden":"true",children:f}),v==="right"&&ce()]}),Bt(ka,{marks:d,min:o,max:n,step:i,orientation:m,size:l||"md",markClassName:B}),Bt($e,{id:te,helperText:R,errorMessage:D,sizeClassName:fe.helper,className:A}),P&&Bt(dd,{children:ae?So(dd,{children:[Bt("input",{type:"hidden",name:`${P}[0]`,value:O[0],disabled:p}),Bt("input",{type:"hidden",name:`${P}[1]`,value:O[1],disabled:p})]}):Bt("input",{type:"hidden",name:P,value:O[0],disabled:p})})]})}import{useState as lm,useMemo as xd,useCallback as cm}from"react";var Ta={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"}},Ra={none:"rounded-none",sm:"rounded-md",md:"rounded-xl",lg:"rounded-2xl",xl:"rounded-3xl",full:"rounded-3xl"},fd={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"}},pd={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"}},gd={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"}},md={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 bd,useContext as hd}from"react";var dl=bd(null),fl=bd(null);function qr(){let e=hd(dl);if(!e)throw new Error("Collapse compound components must be rendered within a <Collapse> provider");return e}function dn(){let e=hd(fl);if(!e)throw new Error("Collapse subcomponents (CollapseHeader, CollapseContent) must be rendered within a <CollapsePanel>");return e}import{jsx as yd}from"react/jsx-runtime";function vd(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:b,destroyInactivePanel:u=!1,className:w="",style:g,children:m,ref:x,...v}){let h=e!==void 0,[k,T]=lm(()=>vd(t)),y=xd(()=>new Set(h?vd(e):k),[h,e,k]),d=cm(R=>{let D,P=y.has(R);if(o)D=P?[]:[R];else{let I=Array.from(y);P?D=I.filter(E=>E!==R):D=[...I,R]}h||T(D),r?.(o?D[0]??"":D)},[o,y,h,r]),c=i==="other"?"":C(a,C(i,fd,"outlined"),"primary"),f=i!=="separated"&&i!=="ghost"?C(s,Ra,"md"):"",p=["w-full transition-colors",c,f,w].filter(Boolean).join(" "),S=xd(()=>({activeKeys:y,handleToggle:d,accordion:o,size:n,variant:i,color:a,radius:s,expandIconPosition:l,expandIcon:b,destroyInactivePanel:u}),[y,d,o,n,i,a,s,l,b,u]);return yd(dl.Provider,{value:S,children:yd("div",{ref:x,className:p,style:g,...v,children:m})})}import{useId as um,useMemo as dm}from"react";import{jsx as To,jsxs as Zn}from"react/jsx-runtime";function Jn({startIcon:e,description:t,extra:r,showArrow:o=!0,children:n,className:i="",ref:a,onClick:s,onKeyDown:l,...b}){let{size:u,variant:w,color:g,expandIconPosition:m,expandIcon:x}=qr(),{isActive:v,disabled:h,headerId:k,panelId:T,onToggle:y}=dn(),d=C(u,Ta,"md"),c=C(g,md,"primary"),f=w==="other"?"":C(g,C(w,gd,"outlined"),"primary"),p=o&&m!=="none",S=()=>p?typeof x=="function"?To("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${v?"rotate-180":"rotate-0"}`,"aria-hidden":"true",children:x({isActive:v,disabled:h})}):x?To("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${v?"rotate-180":"rotate-0"}`,"aria-hidden":"true",children:x}):To("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${v?"rotate-180 text-neutral-700":"rotate-0"}`,"aria-hidden":"true",children:To(lt,{className:d.icon})}):null,R=["w-full flex items-center justify-between transition-colors duration-150 select-none",d.header,d.gap,h?"cursor-not-allowed opacity-60":f,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,h?"cursor-not-allowed pointer-events-none":`${c.focusRing} focus-visible:ring-2 focus-visible:ring-offset-1 rounded-lg`].filter(Boolean).join(" ");return Zn("div",{className:R,children:[Zn("button",{ref:a,id:k,type:"button","aria-expanded":v,"aria-controls":T,"aria-disabled":h?!0:void 0,disabled:h,onClick:P=>{y(),s?.(P)},onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),y()),l?.(P)},className:D,...b,children:[m==="left"&&S(),Zn("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e&&To("span",{className:`inline-flex items-center justify-center shrink-0 ${c.activeIndicator} ${d.startIcon}`,"aria-hidden":"true",children:e}),Zn("div",{className:"flex flex-col min-w-0 flex-1",children:[To("span",{className:`truncate ${d.title} ${c.title}`,children:n}),t&&To("span",{className:`line-clamp-2 ${d.description}`,children:t})]})]}),m==="right"&&!r&&S()]}),r&&Zn("div",{className:"inline-flex items-center gap-2.5 shrink-0 ml-3",children:[r,m==="right"&&S()]})]})}import{jsx as gl}from"react/jsx-runtime";function Qn({destroyInactivePanel:e,children:t,className:r="",style:o,ref:n,...i}){let{size:a,destroyInactivePanel:s}=qr(),{isActive:l,headerId:b,panelId:u}=dn(),w=C(a,Ta,"md");return gl("div",{ref:n,id:u,role:"region","aria-labelledby":b,"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:gl("div",{className:"overflow-hidden",children:(!(e??s)||l)&&gl("div",{className:`${w.content} ${r}`,children:t})})})}import{Fragment as fm,jsx as Da,jsxs as pm}from"react/jsx-runtime";function ml({value:e,label:t,description:r,startIcon:o,extra:n,disabled:i=!1,showArrow:a=!0,headerClassName:s="",contentClassName:l="",destroyInactivePanel:b,className:u="",children:w,ref:g,...m}){let x=um(),{activeKeys:v,handleToggle:h,variant:k,color:T,radius:y}=qr(),d=v.has(e),c=`collapse-header-${e??x}`,f=`collapse-panel-${e??x}`,p=dm(()=>({value:e,isActive:d,disabled:i,headerId:c,panelId:f,onToggle:()=>!i&&h(e)}),[e,d,i,c,f,h]),S=k==="separated"?C(y,Ra,"md"):"",D=["group",k==="other"?"":C(T,C(k,pd,"outlined"),"primary"),S,i?"opacity-50 cursor-not-allowed":"",u].filter(Boolean).join(" ");return Da(fl.Provider,{value:p,children:Da("div",{ref:g,className:D,"data-state":d?"open":"closed",...m,children:t!==void 0?pm(fm,{children:[Da(Jn,{startIcon:o,description:r,extra:n,showArrow:a,className:s,children:t}),Da(Qn,{destroyInactivePanel:b,className:l,children:w})]}):w})})}import{useId as gm,useState as mm}from"react";import{jsx as wd}from"react/jsx-runtime";function bl({open:e,defaultOpen:t=!1,destroyInactivePanel:r=!1,className:o="",children:n,ref:i,...a}){let s=gm(),l=e!==void 0,[b]=mm(t),u=l?e:b;return wd("div",{ref:i,id:s,role:"region","aria-hidden":!u,"data-state":u?"open":"closed",className:`grid transition-[grid-template-rows] duration-200 ease-in-out ${u?"grid-rows-[1fr]":"grid-rows-[0fr]"} ${o}`,...a,children:wd("div",{className:"overflow-hidden",children:(!r||u)&&n})})}import{useState as xm,useMemo as vm,useCallback as Cd}from"react";import{createContext as bm,useContext as hm}from"react";var hl=bm(null);function Zr(){let e=hm(hl);if(!e)throw new Error("Tabs compound components must be used within <Tabs>");return e}import{jsx as kd}from"react/jsx-runtime";function Ro({activeKey:e,defaultActiveKey:t,onChange:r,onClose:o,size:n="md",variant:i="line",color:a="primary",radius:s="md",orientation:l="horizontal",placement:b="top",fullWidth:u=!1,disabled:w=!1,destroyInactiveTabPane:g=!1,className:m="",children:x,ref:v,...h}){let k=e!==void 0,[T,y]=xm(t),d=k?e:T,c=Cd(P=>{k||y(P),r?.(P)},[k,r]),f=Cd(P=>{o?.(P)},[o]),p=vm(()=>({activeKey:d,setActiveKey:c,size:n,variant:i,color:a,radius:s,orientation:l,placement:b,fullWidth:u,disabled:w,destroyInactiveTabPane:g,onCloseTab:f}),[d,c,n,i,a,s,l,b,u,w,g,f]),S=l==="vertical",R;S?R=b==="right"?"flex flex-row-reverse gap-4 items-start":"flex flex-row gap-4 items-start":R=b==="bottom"?"flex flex-col-reverse gap-3":"flex flex-col gap-3";let D=["w-full",R,m].filter(Boolean).join(" ");return kd("div",{ref:v,className:D,...h,children:kd(hl.Provider,{value:p,children:x})})}import{useMergeRefs as km}from"@floating-ui/react";var Sd={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"}},Na={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},Td={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"},Rd={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"}}},Dd={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 Nd,useEffect as ym,useLayoutEffect as wm,useRef as Cm,useState as xl}from"react";var Pd=typeof window<"u"?wm:ym;function zd({activeKey:e,orientation:t="horizontal",placement:r="top",variant:o="line",color:n="primary",radius:i="md"}={}){let a=Cm(null),[s,l]=xl({opacity:0}),[b,u]=xl(!1),[w,g]=xl(!1),m=Nd(()=>{if(!a.current||t==="vertical"){u(!1),g(!1);return}let{scrollLeft:T,scrollWidth:y,clientWidth:d}=a.current,c=y-d;u(T>1),g(T<c-1)},[t]),x=Nd(()=>{if(!a.current)return;m();let T=a.current.querySelector('[role="tab"][aria-selected="true"]');if(!T){l(S=>({...S,opacity:0}));return}let y=T.closest("[data-tab-wrapper]")||T;y.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"});let{offsetLeft:d,offsetTop:c,offsetWidth:f,offsetHeight:p}=y;l(o==="line"?t==="vertical"?{transform:`translate3d(0, ${c}px, 0)`,height:`${p}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:`${f}px`,height:"2px",left:0,top:r==="bottom"?0:void 0,bottom:r!=="bottom"?0:void 0,opacity:1}:{transform:`translate3d(${d}px, ${c}px, 0)`,width:`${f}px`,height:`${p}px`,top:0,left:0,opacity:1})},[m,t,r,o]);return Pd(()=>{x()},[x,e,o,t,r,n,i]),Pd(()=>{x();let T=requestAnimationFrame(x),y=new ResizeObserver(x);if(a.current){y.observe(a.current);let c=a.current.querySelectorAll("[data-tab-wrapper], [role='tab']");for(let f of c)y.observe(f)}let d=()=>x();return window.addEventListener("resize",d),()=>{cancelAnimationFrame(T),y.disconnect(),window.removeEventListener("resize",d)}},[x]),{listRef:a,indicatorStyle:s,canScrollLeft:b,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 y=Array.from(a.current.querySelectorAll('[role="tab"]:not([disabled])'));if(!y.length)return;let d=y.findIndex(R=>R===document.activeElement||R.getAttribute("aria-selected")==="true"),c=-1,f=t==="horizontal",p=f?"ArrowRight":"ArrowDown",S=f?"ArrowLeft":"ArrowUp";T.key===p?(T.preventDefault(),c=(d+1)%y.length):T.key===S?(T.preventDefault(),c=(d-1+y.length)%y.length):T.key==="Home"?(T.preventDefault(),c=0):T.key==="End"&&(T.preventDefault(),c=y.length-1),c>=0&&y[c]&&(y[c]?.focus(),y[c]?.click())}}}import{jsx as fn,jsxs as Id}from"react/jsx-runtime";function Do({children:e,className:t="",extra:r,centered:o=!1,ref:n,...i}){let{activeKey:a,orientation:s="horizontal",placement:l="top",variant:b="line",color:u="primary",radius:w="md",fullWidth:g=!1}=Zr(),{listRef:m,indicatorStyle:x,canScrollLeft:v,canScrollRight:h,checkScroll:k,handleScrollLeft:T,handleScrollRight:y,handleKeyDown:d}=zd({activeKey:a,orientation:s,placement:l,variant:b,color:u,radius:w}),c=km([m,n]),f=C(w,Na,"md"),p=b==="other"?"":C(b,Td,"line"),S=typeof p=="function"?p(s,l):"",R=b==="other"?"":C(u,C(b,Dd,"line"),"primary"),D=s==="vertical",P=v||h,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":"",b!=="line"?f:"",S,t].filter(Boolean).join(" "),N=["absolute pointer-events-none z-0 transition-all duration-300 ease-out",b!=="line"?f:"",R].filter(Boolean).join(" ");return Id("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&&P&&fn("button",{type:"button","aria-label":"Scroll tabs left",disabled:!v,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:fn(Yt,{className:"size-4"})}),Id("div",{ref:c,role:"tablist","aria-orientation":s,onKeyDown:d,onScroll:k,className:E,...i,children:[fn("div",{"aria-hidden":"true",className:N,style:x}),e]}),!D&&P&&fn("button",{type:"button","aria-label":"Scroll tabs right",disabled:!h,onClick:y,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:fn(Wt,{className:"size-4"})}),r&&fn("div",{className:D?"w-full mt-1":"shrink-0 ml-auto pl-1",children:r})]})}import{useRef as Sm}from"react";import{useMergeRefs as Tm}from"@floating-ui/react";import{jsx as pn,jsxs as Md}from"react/jsx-runtime";function No({value:e,label:t,startIcon:r,endIcon:o,badge:n,disabled:i=!1,closable:a=!1,onClose:s,className:l="",children:b,onClick:u,onKeyDown:w,ref:g,...m}){let{activeKey:x,setActiveKey:v,size:h,variant:k,color:T,radius:y,orientation:d,fullWidth:c,disabled:f,onCloseTab:p}=Zr(),S=Sm(null),R=Tm([S,g]),D=f||i,P=x===e,I=B=>{D||(v(e),u?.(B))},E=B=>{B.stopPropagation(),!D&&(s?.(B),p?.(e))},N=C(h,Sd,"md"),M=C(y,Na,"md"),z=C(T,Rd,"primary"),H=k==="other"?{active:"",inactive:""}:C(k,z,"line"),V=`tab-${e}`,Y=`tabpanel-${e}`,$=P?H.active:H.inactive,F=d==="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":"",D?"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":"",$,D?"opacity-40 cursor-not-allowed pointer-events-none":""].filter(Boolean).join(" ");return Md("div",{"data-tab-wrapper":!0,className:G,children:[Md("button",{ref:R,id:V,type:"button",role:"tab","aria-selected":P,"aria-controls":Y,"aria-disabled":D?"true":void 0,tabIndex:P?0:-1,disabled:D,onClick:I,onKeyDown:B=>{if(a&&(B.key==="Delete"||B.key==="Backspace")){if(B.preventDefault(),B.stopPropagation(),D)return;s?.(B),p?.(e)}w?.(B)},className:A,...m,children:[r&&pn("span",{className:`shrink-0 inline-flex items-center justify-center transition-colors duration-200 ${N.icon}`,"aria-hidden":"true",children:r}),pn("span",{className:`truncate ${F?"flex-1 text-left":""}`,children:t||b}),n!=null&&pn("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:n}),o&&pn("span",{className:`shrink-0 inline-flex items-center justify-center transition-colors duration-200 ${N.icon}`,"aria-hidden":"true",children:o})]}),a&&pn("button",{type:"button","aria-label":"Close tab",disabled:D,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:pn(Be,{className:"size-full pointer-events-none"})})]})}import{jsx as Rm}from"react/jsx-runtime";function vl({children:e,className:t="",ref:r,...o}){return Rm("div",{ref:r,className:`w-full ${t}`,...o,children:e})}import{jsx as Dm}from"react/jsx-runtime";function yl({value:e,children:t,className:r="",destroyInactiveTabPane:o,ref:n,...i}){let{activeKey:a,destroyInactiveTabPane:s}=Zr(),l=a===e;if((o??s)&&!l)return null;let u=`tab-${e}`,w=`tabpanel-${e}`,g=["focus-visible:outline-hidden",l?"":"hidden",r].filter(Boolean).join(" ");return Dm("div",{ref:n,id:w,role:"tabpanel",tabIndex:0,"aria-labelledby":u,hidden:!l,className:g,...i,children:t})}import{createContext as Nm,useContext as Pm}from"react";var wl=Nm(null);function sr(){let e=Pm(wl);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 zm,useRef as ei,useState as gn}from"react";function Pa({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:b=650,pauseOnHover:u=!0,pauseOnFocus:w=!0,draggable:g=!0,size:m="md",radius:x="md"}={}){let[v,h]=gn(t),[k,T]=gn(0),[y,d]=gn(!1),[c,f]=gn(0),[p,S]=gn(!1),[R,D]=gn(!1),P=ei(new Set),I=ei(null),E=ei(null),N=ei(0),M=ei(0),z=e!==void 0,H=z?e:v,V=Math.max(0,o?k-1:k-n),Y=Pt(L=>{let te=L;o?k>0?te=(te+k)%k:te=0:te=Math.max(0,Math.min(te,V)),z||h(te),r?.(te)},[z,o,V,r,k]),$=o?k>1:H>0,F=o?k>1:H<k-n,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)},[]);zm(()=>{if(!s||k<=n||u&&p||w&&R||y)return;let L=setInterval(()=>{o||H<k-n?A():U(0)},l);return()=>clearInterval(L)},[H,s,l,y,R,p,o,w,u,A,U,n,k]);let le=Pt(L=>{if(!g||k<=n||L.button!==0)return;let te=L.clientX;N.current=te,M.current=te,d(!0),f(0);let Z=L.currentTarget;try{Z.setPointerCapture(L.pointerId)}catch{}},[g,n,k]),oe=Pt(L=>{if(!y)return;let te=L.clientX;M.current=te;let Z=te-N.current;if(!o){if(H===0&&Z>0){f(Z*.3);return}if(H>=k-n&&Z<0){f(Z*.3);return}}f(Z)},[H,y,o,n,k]),ue=Pt(L=>{if(!y)return;d(!1);let te=M.current-N.current;Math.abs(te)>40&&(te>0?G():A()),f(0);try{L.currentTarget.releasePointerCapture(L.pointerId)}catch{}},[y,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(()=>D(!0),[]),ke=Pt(()=>D(!1),[]);return{currentIndex:H,totalSlides:k,slidesToShow:n,slidesToScroll:i,spacing:a,loop:o,canScrollPrev:$,canScrollNext:F,size:m,radius:x,transitionDuration:b,isDragging:y,dragOffset:c,scrollPrev:G,scrollNext:A,scrollTo:U,registerSlide:B,unregisterSlide:X,setTotalSlides:T,viewportRef:I,containerRef:E,handlePointerDown:le,handlePointerMove:oe,handlePointerUp:ue,handlePointerCancel:ue,handleKeyDown:ie,handleMouseEnter:Q,handleMouseLeave:q,handleFocus:ge,handleBlur:ke}}var ti={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"},Cl={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"},kl="bg-black/25 dark:bg-white/15 backdrop-blur-md border border-white/20 dark:border-white/15 shadow-sm rounded-full",ri={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 Ed}from"react/jsx-runtime";function $d({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:b=650,pauseOnHover:u=!0,pauseOnFocus:w=!0,draggable:g=!0,size:m="md",radius:x="md",children:v,className:h="",style:k,ref:T,...y}){let d=Pa({currentIndex:e,defaultIndex:t,onIndexChange:r,loop:o,slidesToShow:n,slidesToScroll:i,spacing:a,autoPlay:s,interval:l,transitionDuration:b,pauseOnHover:u,pauseOnFocus:w,draggable:g,size:m,radius:x}),c=C(x,Fd,"md");return Ed(wl.Provider,{value:d,children:Ed("div",{ref:T,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 ${c} ${h}`,style:k,...y,children:v})})}import{jsx as Ld}from"react/jsx-runtime";function Bd({children:e,className:t="",style:r,ref:o,...n}){let{currentIndex:i,slidesToShow:a,spacing:s,transitionDuration:l,isDragging:b,dragOffset:u,viewportRef:w,handlePointerDown:g,handlePointerMove:m,handlePointerUp:x,handlePointerCancel:v}=sr(),h=typeof s=="number"?`${s}px`:s||"0px",k=`translateX(calc(-${i} * ((100% + ${h}) / ${a}) + ${u}px))`,T={display:"flex",flexDirection:"row",gap:h,transform:k,transition:b?"none":`transform ${l}ms cubic-bezier(0.25, 1, 0.5, 1)`,touchAction:"pan-y",width:"100%"};return Ld("div",{ref:w,className:`overflow-hidden relative w-full h-full cursor-grab ${b?"cursor-grabbing select-none":""}`,onPointerDown:g,onPointerMove:m,onPointerUp:x,onPointerCancel:v,children:Ld("div",{ref:o,role:"presentation",className:`flex ${t}`,style:{...T,...r},...n,children:e})})}import{useId as Im,useEffect as Mm}from"react";import{jsx as Fm}from"react/jsx-runtime";function Hd({children:e,className:t="",style:r,ref:o,...n}){let i=Im(),{slidesToShow:a,spacing:s,registerSlide:l,unregisterSlide:b}=sr();Mm(()=>(l(i),()=>{b(i)}),[i,l,b]);let u=typeof s=="number"?`${s}px`:s||"0px",w={...r};return a>1||u!=="0px"?w.flex=`0 0 calc((100% - ${a-1} * ${u}) / ${a})`:w.flex="0 0 100%",Fm("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 za}from"react/jsx-runtime";function Vd({variant:e="glass",icon:t,className:r="",disabled:o,onClick:n,ref:i,...a}){let{scrollPrev:s,canScrollPrev:l,size:b}=sr(),u=o!==void 0?o:!l,w=C(b,ti,"md"),g=C(e,Cl,"glass"),m=za(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",g,w.arrowBtn,r].filter(Boolean).join(" ");return za("button",{ref:i,type:"button","aria-label":"Slide tr\u01B0\u1EDBc",disabled:u,onClick:v=>{s(),n?.(v)},className:x,...a,children:t||m})}function Ad({variant:e="glass",icon:t,className:r="",disabled:o,onClick:n,ref:i,...a}){let{scrollNext:s,canScrollNext:l,size:b}=sr(),u=o!==void 0?o:!l,w=C(b,ti,"md"),g=C(e,Cl,"glass"),m=za(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",g,w.arrowBtn,r].filter(Boolean).join(" ");return za("button",{ref:i,type:"button","aria-label":"Slide ti\u1EBFp theo",disabled:u,onClick:v=>{s(),n?.(v)},className:x,...a,children:t||m})}import{jsx as Ia,jsxs as Em}from"react/jsx-runtime";function Od({type:e="dots",clickable:t=!0,className:r="",ref:o,...n}){let{currentIndex:i,totalSlides:a,slidesToShow:s,loop:l,scrollTo:b,size:u}=sr();if(e==="none"||a<=1)return null;let w=C(u,ti,"md"),g=l?a:Math.max(1,a-s+1);return e==="fraction"?Ia("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 ${kl} text-white ${w.fraction} ${r}`,...n,children:Em("span",{children:[Math.min(i+1,g)," / ",g]})}):Ia("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 ${kl} ${w.paginationWrapper} ${r}`,...n,children:Array.from({length:g}).map((m,x)=>{let v=x===i;return e==="line"?Ia("button",{type:"button",role:"tab","aria-selected":v,"aria-label":`Chuy\u1EC3n \u0111\u1EBFn slide ${x+1}`,disabled:!t,onClick:()=>t&&b(x),className:`transition-all duration-300 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${v?`${w.activeLine} ${ri.active}`:`${w.line} ${ri.inactive}`} ${t?"cursor-pointer":"cursor-default"}`},x):Ia("button",{type:"button",role:"tab","aria-selected":v,"aria-label":`Chuy\u1EC3n \u0111\u1EBFn slide ${x+1}`,disabled:!t,onClick:()=>t&&b(x),className:`transition-colors duration-200 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${w.dot} ${v?ri.active:ri.inactive} ${t?"cursor-pointer":"cursor-default"}`},x)})})}import{useState as Gd,useRef as Ud,useMemo as jd,useCallback as Bm}from"react";import{useFloating as Hm,autoUpdate as Vm,offset as Am,flip as Om,shift as Gm,useClick as Um,useHover as jm,useDismiss as Ym,useRole as Wm,useListNavigation as Km,useTypeahead as _m,useInteractions as Xm,safePolygon as qm}from"@floating-ui/react";import{createContext as $m,useContext as Lm}from"react";var Sl=$m(null),yr=()=>{let e=Lm(Sl);if(!e)throw new Error("Dropdown compound components must be used within a <Dropdown> component.");return e};import{jsx as Zm}from"react/jsx-runtime";function Tl({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:b="md",radius:u="md",color:w="primary",disabled:g=!1,animated:m=!0,animationDuration:x=150,closeOnSelect:v=!0}){let[h,k]=Gd(r),[T,y]=Gd(null),d=Ud([]),c=Ud([]),f=t!==void 0,p=f?t:h,S=Bm(U=>{f||k(U),U||y(null),o?.(U)},[f,o]),R=jd(()=>[Am(a),s?Om():void 0,l?Gm({padding:8}):void 0].filter(Boolean),[a,s,l]),{refs:D,floatingStyles:P,context:I,placement:E}=Hm({placement:i,open:p&&!g,onOpenChange:S,whileElementsMounted:Vm,transform:!1,middleware:R}),N=Um(I,{enabled:!g&&n==="click"}),M=jm(I,{enabled:!g&&n==="hover",delay:{open:100,close:150},handleClose:qm()}),z=Ym(I),H=Wm(I,{role:"menu"}),V=Km(I,{listRef:d,activeIndex:T,onNavigate:y,loop:!0}),Y=_m(I,{listRef:c,activeIndex:T,onMatch:p?y:void 0}),{getReferenceProps:$,getFloatingProps:F,getItemProps:G}=Xm([N,M,z,H,V,Y]),A=jd(()=>({isOpen:p,setIsOpen:S,refs:D,floatingStyles:P,context:I,getReferenceProps:$,getFloatingProps:F,getItemProps:G,elementsRef:d,labelsRef:c,activeIndex:T,setActiveIndex:y,size:b,radius:u,color:w,disabled:g,animated:m,animationDuration:x,closeOnSelect:v,computedPlacement:E}),[p,S,D,P,I,$,F,G,d,c,T,y,b,u,w,g,m,x,v,E]);return Zm(Sl.Provider,{value:A,children:e})}import{cloneElement as Jm,isValidElement as Rl}from"react";import{useMergeRefs as Wd}from"@floating-ui/react";import{jsx as Yd}from"react/jsx-runtime";function Qm({children:e,ref:t,disabled:r,className:o="",...n}){let i=Rl(e)?e.props?.ref:void 0,a=Wd([t,i]);if(!Rl(e))return null;let s=e.props||{};return Jm(e,{...n,...s,ref:a,disabled:r?!0:s.disabled,className:[s.className,o].filter(Boolean).join(" ")})}function eb({ref:e,children:t,className:r="",asChild:o=!1,...n}){let{refs:i,getReferenceProps:a,isOpen:s,disabled:l}=yr(),b=Wd([i.setReference,e]),u=a({...n,"aria-expanded":s,"aria-haspopup":"menu",className:r});return Rl(t)&&(o||!0)?Yd(Qm,{ref:b,disabled:l,...u,children:t}):Yd("button",{ref:b,type:"button",disabled:l,"aria-expanded":s,"aria-haspopup":"menu",className:r,...u,children:t})}var Kd=eb;import{FloatingPortal as tb,FloatingList as rb,useMergeRefs as ob}from"@floating-ui/react";var mn={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"}},_d={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-3xl"},Xd={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{jsx as Nl}from"react/jsx-runtime";function Pl({ref:e,children:t,className:r="",style:o,minWidth:n,zIndex:i=Qe.DROPDOWN,...a}){let{isOpen:s,refs:l,floatingStyles:b,context:u,getFloatingProps:w,elementsRef:g,labelsRef:m,size:x,radius:v,animated:h,animationDuration:k,computedPlacement:T}=yr(),y=ob([l.setFloating,e]),{isMounted:d,styles:c}=et(u,{duration:k,animated:h});if(!d)return null;let f=C(x,mn,"md"),p=C(v,_d,"md"),S=["bg-neutral-white border-2 border-neutral-200 shadow-lg outline-none focus:outline-none flex flex-col",f.menu,p,r].filter(Boolean).join(" ");return Nl(tb,{children:Nl("div",{ref:y,style:{...b,...h?c:{},minWidth:n,zIndex:i,...o},className:S,"data-state":s?"open":"closed","data-placement":T,...w(a),children:Nl(rb,{elementsRef:g,labelsRef:m,children:t})})})}import{useListItem as nb,useMergeRefs as ib}from"@floating-ui/react";import{jsx as oi,jsxs as qd}from"react/jsx-runtime";function ab({ref:e,children:t,onClick:r,disabled:o=!1,danger:n=!1,selected:i=!1,startIcon:a,endIcon:s,shortcut:l,description:b,className:u="",closeOnSelect:w,...g}){let{getItemProps:m,activeIndex:x,setIsOpen:v,color:h,size:k,closeOnSelect:T}=yr(),y=typeof t=="string"?t:void 0,{ref:d,index:c}=nb({label:y}),f=ib([d,e]),p=x===c,S=C(k,mn,"md"),R=C(h,Xd,"primary"),D=E=>{if(o){E.preventDefault();return}r?.(E),(w??T)&&v(!1)},P=o?"opacity-50 cursor-not-allowed text-neutral-400 select-none":n?`${Dl.default} ${p?Dl.active:""} cursor-pointer`:i?`${R.selected} cursor-pointer`:`${p?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",S.item,S.itemGap,P,u].filter(Boolean).join(" ");return qd("button",{ref:f,type:"button",role:"menuitem",disabled:o,"aria-disabled":o,tabIndex:p?0:-1,...m({...g,onClick:D,className:I}),children:[a&&oi("span",{className:`flex items-center justify-center shrink-0 ${S.icon}`,children:a}),qd("div",{className:"flex-1 flex flex-col min-w-0",children:[oi("span",{className:"truncate",children:t}),b&&oi("span",{className:`text-neutral-500 truncate ${S.description}`,children:b})]}),l&&oi("kbd",{className:`shrink-0 rounded border border-neutral-200 bg-neutral-50 font-mono text-neutral-500 tracking-wider ${S.shortcut}`,children:l}),s&&oi("span",{className:`flex items-center justify-center shrink-0 ${S.icon}`,children:s})]})}var Zd=ab;import{jsx as sb}from"react/jsx-runtime";function zl({children:e,className:t="",...r}){let{size:o}=yr(),n=C(o,mn,"md");return sb("div",{role:"presentation",className:["font-semibold text-neutral-500 uppercase tracking-wider select-none",n.header,t].filter(Boolean).join(" "),...r,children:e})}var Jd=zl;import{jsx as cb}from"react/jsx-runtime";function lb({className:e="",...t}){return cb("hr",{className:["-mx-1 my-1 h-px border-0 bg-neutral-200",e].filter(Boolean).join(" "),...t})}var Qd=lb;import{jsx as db,jsxs as fb}from"react/jsx-runtime";function ub({children:e,label:t,className:r="",...o}){return fb("div",{role:"group",className:["flex flex-col",r].filter(Boolean).join(" "),...o,children:[t&&db(zl,{children:t}),e]})}var e0=ub;import{useState as mb,useMemo as t0,useCallback as bb}from"react";import{useFloating as hb,autoUpdate as xb,offset as vb,flip as yb,shift as wb,useClick as Cb,useHover as kb,useDismiss as Sb,useRole as Tb,useInteractions as Rb,safePolygon as Db}from"@floating-ui/react";import{createContext as pb,useContext as gb}from"react";var Il=pb(null),zt=()=>{let e=gb(Il);if(!e)throw new Error("Popover compound components must be used within a <Popover> component.");return e};import{jsx as Nb}from"react/jsx-runtime";function ni({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:b="md",radius:u="md",color:w="neutral",disabled:g=!1,animated:m=!0,animationDuration:x=150,modal:v=!1,closeOnEsc:h=!0,closeOnClickOutside:k=!0}){let[T,y]=mb(r),d=t!==void 0,c=d?t:T,f=bb(Y=>{d||y(Y),o?.(Y)},[d,o]),p=t0(()=>[vb(a),s?yb():void 0,l?wb({padding:8}):void 0].filter(Boolean),[a,s,l]),{refs:S,floatingStyles:R,context:D,placement:P}=hb({placement:i,open:c&&!g,onOpenChange:f,whileElementsMounted:xb,transform:!1,middleware:p}),I=Cb(D,{enabled:!g&&n==="click"}),E=kb(D,{enabled:!g&&n==="hover",delay:{open:100,close:150},handleClose:Db()}),N=Sb(D,{escapeKey:h,outsidePress:k}),M=Tb(D,{role:"dialog"}),{getReferenceProps:z,getFloatingProps:H}=Rb([I,E,N,M]),V=t0(()=>({isOpen:c,setIsOpen:f,refs:S,floatingStyles:R,context:D,getReferenceProps:z,getFloatingProps:H,size:b,radius:u,color:w,disabled:g,animated:m,animationDuration:x,modal:v,computedPlacement:P}),[c,f,S,R,D,z,H,b,u,w,g,m,x,v,P]);return Nb(Il.Provider,{value:V,children:e})}import{cloneElement as Pb,isValidElement as Ml}from"react";import{useMergeRefs as o0}from"@floating-ui/react";import{jsx as r0}from"react/jsx-runtime";function zb({children:e,ref:t,disabled:r,className:o="",...n}){let i=Ml(e)?e.props?.ref:void 0,a=o0([t,i]);if(!Ml(e))return null;let s=e.props||{};return Pb(e,{...n,...s,ref:a,disabled:r?!0:s.disabled,className:[s.className,o].filter(Boolean).join(" ")})}function Ib({ref:e,children:t,className:r="",asChild:o=!1,...n}){let{refs:i,getReferenceProps:a,isOpen:s,disabled:l}=zt(),b=o0([i.setReference,e]),u=a({...n,"aria-expanded":s,"aria-haspopup":"dialog",className:r});return Ml(t)&&(o||!0)?r0(zb,{ref:b,disabled:l,...u,children:t}):r0("button",{ref:b,type:"button",disabled:l,"aria-expanded":s,"aria-haspopup":"dialog",className:r,...u,children:t})}var Ma=Ib;import{FloatingPortal as Mb,FloatingFocusManager as Fb,useMergeRefs as Eb}from"@floating-ui/react";var Jr={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"}},n0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-3xl"};import{jsx as Fl}from"react/jsx-runtime";function El({ref:e,children:t,className:r="",style:o,minWidth:n,maxWidth:i,zIndex:a=Qe.POPOVER,...s}){let{isOpen:l,refs:b,floatingStyles:u,context:w,getFloatingProps:g,size:m,radius:x,animated:v,animationDuration:h,modal:k,computedPlacement:T}=zt(),y=Eb([b.setFloating,e]),{isMounted:d,styles:c}=et(w,{duration:h,animated:v});if(!d)return null;let f=C(m,Jr,"md"),p=C(x,n0,"md"),R=["bg-neutral-white shadow-xl outline-none focus:outline-none flex flex-col border-2 border-neutral-200",f.container,p,r].filter(Boolean).join(" "),D=Fl(Fb,{context:w,modal:k,children:Fl("div",{ref:y,style:{...u,...v?c:{},minWidth:n,maxWidth:i,zIndex:a,...o},className:R,"data-state":l?"open":"closed","data-placement":T,...g(s),children:t})});return Fl(Mb,{children:D})}var i0=El;import{jsx as $b}from"react/jsx-runtime";function $l({children:e,className:t="",...r}){let{size:o}=zt(),n=C(o,Jr,"md");return $b("h2",{className:["text-neutral-900 border-b border-neutral-100 font-semibold",n.header,t].filter(Boolean).join(" "),...r,children:e})}var a0=$l;import{jsx as Lb}from"react/jsx-runtime";function Ll({children:e,className:t="",...r}){let{size:o}=zt(),n=C(o,Jr,"md");return Lb("div",{className:["text-neutral-700",n.body,t].filter(Boolean).join(" "),...r,children:e})}var s0=Ll;import{jsx as Hb}from"react/jsx-runtime";function Bb({children:e,className:t="",...r}){let{size:o}=zt(),n=C(o,Jr,"md");return Hb("div",{className:["border-t border-neutral-100 bg-neutral-50/50",n.footer,t].filter(Boolean).join(" "),...r,children:e})}var l0=Bb;import{cloneElement as Vb,isValidElement as Bl}from"react";import{useMergeRefs as Ab}from"@floating-ui/react";import{jsx as c0}from"react/jsx-runtime";function Ob({children:e,ref:t,className:r="",onClick:o,...n}){let i=Bl(e)?e.props?.ref:void 0,a=Ab([t,i]);if(!Bl(e))return null;let s=e.props||{};return Vb(e,{...n,...s,ref:a,className:[s.className,r].filter(Boolean).join(" "),onClick:l=>{s.onClick?.(l),o?.(l)}})}function Gb({ref:e,children:t,className:r="",asChild:o=!1,onClick:n,...i}){let{setIsOpen:a}=zt(),s=l=>{n?.(l),l.defaultPrevented||a(!1)};return Bl(t)&&o?c0(Ob,{ref:e,className:r,onClick:s,...i,children:t}):c0("button",{ref:e,type:"button",className:r,onClick:s,...i,children:t})}var u0=Gb;import{useState as jl,useId as Kb,useMemo as _b}from"react";import{useFloating as Xb,autoUpdate as qb,offset as Zb,flip as Jb,shift as Qb,useDismiss as eh,useRole as th,useInteractions as rh,FloatingPortal as oh,FloatingFocusManager as nh}from"@floating-ui/react";import{useState as Ul,useMemo as b0}from"react";var d0={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"}},f0={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"}},_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"}};var Qr={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},p0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},eo={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"}},g0={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"?d0:e==="en"?f0: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 n=Vl(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 to(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Fa(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}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,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 si(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 m0(e,t){return new Date(e,t+1,0).getDate()}function Ea(e,t,r=1,o,n,i,a){let s=[],l=new Date,b=new Date(e,t,1).getDay(),u=m0(e,t-1),w=m0(e,t),g=r===1?b===0?6:b-1:b;for(let x=g-1;x>=0;x--){let v=u-x,h=new Date(e,t-1,v);s.push(Hl(h,!1,l,o,n,i,a))}for(let x=1;x<=w;x++){let v=new Date(e,t,x);s.push(Hl(v,!0,l,o,n,i,a))}let m=42-s.length;for(let x=1;x<=m;x++){let v=new Date(e,t+1,x);s.push(Hl(v,!1,l,o,n,i,a))}return s}function Hl(e,t,r,o,n,i,a){let s=o?to(e,o):!1,l=!1;return n&&ii(e,n)&&(l=!0),i&&ai(e,i)&&(l=!0),a&&a(e)&&(l=!0),{date:e,day:e.getDate(),month:e.getMonth(),year:e.getFullYear(),isCurrentMonth:t,isToday:to(e,r),isSelected:s,isDisabled:l,weekNumber:si(e)}}function Ht(e,t="DD/MM/YYYY",r){if(!e||isNaN(e.getTime()))return"";let o=dt(r),n=e.getFullYear(),i=e.getMonth(),a=e.getDate(),s=e.getHours(),l=e.getMinutes(),b=e.getSeconds(),u=e.getDay(),w=v=>String(v).padStart(2,"0"),g=s%12||12,m=s>=12?"PM":"AM",x={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[u]??"",ddd:o.weekdaysShort[u]??"",dd:o.weekdaysMin[u]??"",HH:w(s),H:String(s),hh:w(g),h:String(g),mm:w(l),m:String(l),ss:w(b),s:String(b),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,v=>x[v]??v)}function Vl(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,b=t.match(/YYYY|YY|MM|M|DD|D|HH|H|hh|h|mm|m|ss|s/g);if(!b){let m=new Date(r);return isNaN(m.getTime())?null:m}let u="^"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");for(let m of b)m==="YYYY"?u=u.replace("YYYY","(\\d{4})"):m==="YY"?u=u.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")&&(u=u.replace(m,"(\\d{1,2})"));u+="$";let w=new RegExp(u).exec(r);if(!w){let m=new Date(r);return isNaN(m.getTime())?null:m}b.forEach((m,x)=>{let v=w[x+1];if(!v)return;let h=parseInt(v,10);isNaN(h)||(m==="YYYY"?o=h:m==="YY"?o=2e3+h:m==="MM"||m==="M"?n=h:m==="DD"||m==="D"?i=h:m==="HH"||m==="H"||m==="hh"||m==="h"?a=h:m==="mm"||m==="m"?s=h:(m==="ss"||m==="s")&&(l=h))});let g=new Date(o,n-1,i,a,s,l);return isNaN(g.getTime())?null:g}function $a(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 Er,jsxs as Al}from"react/jsx-runtime";function li({currentMonth:e,view:t,onViewChange:r,onPrevMonth:o,onNextMonth:n,onPrevYear:i,onNextYear:a,onPrevDecade:s,onNextDecade:l,size:b="md",color:u="primary",locale:w,showMonthButtons:g=!0}){let m=dt(w),x=C(b,_t,"md"),v=C(u,eo,"primary"),h=e.getFullYear(),k=e.getMonth(),T=Math.floor(h/10)*10,y=T+9,d=()=>{t==="days"?r("months"):t==="months"?r("years"):t==="years"&&r("days")},c=()=>{t==="years"?s?s():i():t==="months"?i():o()},f=()=>{t==="years"?l?l():a():t==="months"?a():n()},p=()=>t==="years"?`${T} - ${y}`:t==="months"?`${h}`:`${m.months[k]} ${h}`;return Al("div",{className:"flex items-center justify-between px-1 pb-1.5 border-b border-neutral-200",children:[Al("div",{className:"flex items-center space-x-0.5",children:[t==="days"&&Er("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:Er(Yr,{width:14,height:14})}),g&&Er("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:Er(Yt,{width:14,height:14})})]}),Er("button",{type:"button",onClick:d,className:`${x.headerText} px-2 py-1 rounded-md text-neutral-800 hover:bg-neutral-100 hover:${v.activeText} transition-colors cursor-pointer`,children:p()}),Al("div",{className:"flex items-center space-x-0.5",children:[g&&Er("button",{type:"button",onClick:f,"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:Er(Wt,{width:14,height:14})}),t==="days"&&Er("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:Er(Wr,{width:14,height:14})})]})]})}import Ub,{useRef as jb}from"react";import{jsx as ci,jsxs as La}from"react/jsx-runtime";function ui({days:e,onSelectDate:t,size:r="md",color:o="primary",radius:n,locale:i,firstDayOfWeek:a=1,showWeekNumbers:s=!1}){let l=dt(i),b=C(r,_t,"md"),u=C(o,eo,"primary"),w=C(n,Qr,"lg"),g=jb(null),m=[...l.weekdaysShort];if(a===1){let d=m.shift();m.push(d)}let x=e.some(d=>d.isSelected&&!d.isDisabled),v=e.findIndex(d=>d.isToday&&!d.isDisabled),h=e.findIndex(d=>d.isCurrentMonth&&!d.isDisabled),k=h!==-1?h:e.findIndex(d=>!d.isDisabled),T=d=>{let f=g.current?.querySelectorAll("button")?.[d];f&&!f.disabled&&f.focus()},y=(d,c)=>{let f=null;if(d.key==="ArrowRight"){d.preventDefault();for(let p=c+1;p<e.length;p++)if(!e[p].isDisabled){f=p;break}}else if(d.key==="ArrowLeft"){d.preventDefault();for(let p=c-1;p>=0;p--)if(!e[p].isDisabled){f=p;break}}else if(d.key==="ArrowDown")d.preventDefault(),c+7<e.length&&!e[c+7].isDisabled&&(f=c+7);else if(d.key==="ArrowUp")d.preventDefault(),c-7>=0&&!e[c-7].isDisabled&&(f=c-7);else if(d.key==="Home"){d.preventDefault();let p=c-c%7;for(let S=p;S<p+7&&S<e.length;S++)if(!e[S].isDisabled){f=S;break}}else if(d.key==="End"){d.preventDefault();let p=Math.min(e.length-1,c-c%7+6);for(let S=p;S>=c-c%7;S--)if(!e[S].isDisabled){f=S;break}}else if(d.key==="Enter"||d.key===" "){d.preventDefault();let p=e[c];p&&!p.isDisabled&&t(p.date);return}f!==null&&T(f)};return La("div",{ref:g,role:"grid","aria-label":l.months[e[15]?.month||0],className:"w-full",children:[La("div",{role:"row",className:`grid ${s?"grid-cols-8":"grid-cols-7"} gap-1 mb-1 text-center`,children:[s&&ci("div",{role:"columnheader","aria-label":l.weekText||"Week",className:`flex items-center justify-center ${b.cellSize} text-neutral-400 ${b.cellText} font-medium`,children:"#"}),m.map(d=>ci("div",{role:"columnheader","aria-label":d,className:`flex items-center justify-center ${b.cellSize} text-neutral-500 ${b.cellText} font-medium`,children:d},d))]}),ci("div",{role:"rowgroup",className:`grid ${s?"grid-cols-8":"grid-cols-7"} gap-y-1 gap-x-1`,children:e.map((d,c)=>{let f=c%7===0,p="text-neutral-800 hover:bg-neutral-100";d.isDisabled?p="text-neutral-300 cursor-not-allowed line-through":d.isSelected?p=`${u.selected} font-semibold shadow-xs`:d.isCurrentMonth||(p="text-neutral-400 hover:bg-neutral-100");let S=d.isToday&&!d.isSelected?`ring-1 ${u.todayRing} font-bold`:"",R=`${d.day} ${l.months[d.month]} ${d.year}`,D=!d.isDisabled&&(d.isSelected||!x&&d.isToday&&c===v||!x&&v===-1&&c===k);return La(Ub.Fragment,{children:[s&&f&&La("div",{className:`flex items-center justify-center ${b.cellSize} text-neutral-400 ${b.cellText} text-[10px] font-mono`,children:["W",d.weekNumber]}),ci("div",{role:"gridcell","aria-selected":d.isSelected,className:"flex items-center justify-center",children:ci("button",{type:"button",disabled:d.isDisabled,tabIndex:D?0:-1,onKeyDown:P=>y(P,c),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 ${b.cellSize} ${b.cellText} ${w} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${p} ${S}`,children:d.day})})]},d.date.toISOString())})})]})}import{useRef as Yb}from"react";import{jsx as Ol}from"react/jsx-runtime";function di({currentMonth:e,selectedDate:t,onSelectMonth:r,size:o="md",color:n="primary",radius:i,locale:a}){let s=dt(a),l=C(o,_t,"md"),b=C(n,eo,"primary"),u=C(i,Qr,"lg"),w=Yb(null),g=e.getFullYear(),m=new Date,x=m.getMonth(),v=m.getFullYear(),h=t&&t.getFullYear()===g?t.getMonth():-1,k=h!==-1?h:v===g?x:0,T=d=>{let f=w.current?.querySelectorAll("button")?.[d];f&&f.focus()},y=(d,c)=>{let f=null;if(d.key==="ArrowRight")d.preventDefault(),c+1<s.monthsShort.length&&(f=c+1);else if(d.key==="ArrowLeft")d.preventDefault(),c-1>=0&&(f=c-1);else if(d.key==="ArrowDown")d.preventDefault(),c+3<s.monthsShort.length&&(f=c+3);else if(d.key==="ArrowUp")d.preventDefault(),c-3>=0&&(f=c-3);else if(d.key==="Home")d.preventDefault(),f=0;else if(d.key==="End")d.preventDefault(),f=s.monthsShort.length-1;else if(d.key==="Enter"||d.key===" "){d.preventDefault(),r(c);return}f!==null&&T(f)};return Ol("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,c)=>{let f=new Date(g,c,1),p=t?Fa(f,t):!1,S=v===g&&x===c,R=c===k,D="text-neutral-800 hover:bg-neutral-100";return p?D=`${b.selected} font-semibold shadow-xs`:S&&(D=`ring-1 ${b.todayRing} font-semibold`),Ol("div",{role:"gridcell","aria-selected":p,className:"flex items-center justify-center",children:Ol("button",{type:"button",tabIndex:R?0:-1,onKeyDown:P=>y(P,c),onClick:()=>r(c),"aria-label":`${d} ${g}`,className:`w-full flex items-center justify-center h-10 ${l.cellText} ${u} 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 Wb}from"react";import{jsx as Gl}from"react/jsx-runtime";function fi({currentMonth:e,selectedDate:t,onSelectYear:r,size:o="md",color:n="primary",radius:i}){let a=C(o,_t,"md"),s=C(n,eo,"primary"),l=C(i,Qr,"lg"),b=Wb(null),u=e.getFullYear(),w=t?t.getFullYear():u,g=Math.floor(u/10)*10,m=new Date().getFullYear(),x=[];for(let d=0;d<12;d++)x.push(g+d);let v=x.indexOf(w),h=x.indexOf(m),k=v!==-1?v:h!==-1?h:0,T=d=>{let f=b.current?.querySelectorAll("button")?.[d];f&&f.focus()},y=(d,c)=>{let f=null;if(d.key==="ArrowRight")d.preventDefault(),c+1<x.length&&(f=c+1);else if(d.key==="ArrowLeft")d.preventDefault(),c-1>=0&&(f=c-1);else if(d.key==="ArrowDown")d.preventDefault(),c+3<x.length&&(f=c+3);else if(d.key==="ArrowUp")d.preventDefault(),c-3>=0&&(f=c-3);else if(d.key==="Home")d.preventDefault(),f=0;else if(d.key==="End")d.preventDefault(),f=x.length-1;else if(d.key==="Enter"||d.key===" "){d.preventDefault();let p=x[c];p!==void 0&&r(p);return}f!==null&&T(f)};return Gl("div",{ref:b,role:"grid","aria-label":"Ch\u1ECDn n\u0103m",className:"grid grid-cols-3 gap-2 py-2",children:x.map((d,c)=>{let f=d===w,p=d===m,S=c===k,R="text-neutral-800 hover:bg-neutral-100";return f?R=`${s.selected} font-semibold shadow-xs`:p&&(R=`ring-1 ${s.todayRing} font-semibold`),Gl("div",{role:"gridcell","aria-selected":f,className:"flex items-center justify-center",children:Gl("button",{type:"button",tabIndex:S?0:-1,onKeyDown:D=>y(D,c),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 ro,jsxs as h0}from"react/jsx-runtime";function wr({value:e,onChange:t,view:r="days",onViewChange:o,minDate:n,maxDate:i,isDateDisabled:a,locale:s="vi",firstDayOfWeek:l=1,showWeekNumbers:b=!1,showViewTabs:u=!1,viewTabs:w=["days","months","years"],size:g="md",color:m="primary",radius:x,className:v="",bordered:h=!0}){let k=C(g,_t,"md"),T=C(x,p0,"lg"),[y,d]=Ul(r),[c,f]=Ul(r);r!==c&&(f(r),d(r));let[p,S]=Ul(()=>{let A=e||new Date;return new Date(A.getFullYear(),A.getMonth(),1)}),R=dt(s),D=b0(()=>{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]),P=A=>{let U=A;d(U),o?.(U)},I=()=>{let A=new Date(p.getFullYear(),p.getMonth()-1,1);S(A)},E=()=>{let A=new Date(p.getFullYear(),p.getMonth()+1,1);S(A)},N=()=>{let A=new Date(p.getFullYear()-1,p.getMonth(),1);S(A)},M=()=>{let A=new Date(p.getFullYear()+1,p.getMonth(),1);S(A)},z=()=>{let A=new Date(p.getFullYear()-10,p.getMonth(),1);S(A)},H=()=>{let A=new Date(p.getFullYear()+10,p.getMonth(),1);S(A)},V=A=>{let U=new Date(p.getFullYear(),A,1);S(U),r==="months"?t?.(U):d("days")},Y=A=>{let U=new Date(A,p.getMonth(),1);S(U),r==="years"?t?.(U):d("months")},$=mt(n),F=mt(i),G=b0(()=>Ea(p.getFullYear(),p.getMonth(),l,e,$,F,a),[p,l,e,$,F,a]);return h0("div",{className:`inline-flex flex-col ${h?"border-2 border-neutral-200 bg-neutral-white shadow-xl":"border-0 shadow-none bg-transparent"} ${T} overflow-hidden select-none ${v}`,children:[u&&D.length>0&&ro("div",{className:"px-2.5 py-1.5 border-b border-neutral-200",children:ro(Ro,{activeKey:r,onChange:P,size:"sm",variant:"solid",color:m,fullWidth:!0,className:"gap-0!",children:ro(Do,{className:"p-0.5",children:D.map(A=>ro(No,{value:A.key,className:"py-1 px-2 text-xs",children:A.label},A.key))})})}),h0("div",{className:`${k.calendarPadding} min-w-70`,children:[ro(li,{currentMonth:p,view:y,onViewChange:d,onPrevMonth:I,onNextMonth:E,onPrevYear:N,onNextYear:M,onPrevDecade:z,onNextDecade:H,size:g,color:m,locale:s,showMonthButtons:!0}),y==="days"&&ro(ui,{days:G,onSelectDate:A=>t?.(A),size:g,color:m,radius:x,locale:s,firstDayOfWeek:l,showWeekNumbers:b}),y==="months"&&ro(di,{currentMonth:p,selectedDate:e,onSelectMonth:V,size:g,color:m,radius:x,locale:s}),y==="years"&&ro(fi,{currentMonth:p,selectedDate:e,onSelectYear:Y,size:g,color:m,radius:x})]})]})}import{jsx as bt,jsxs as Ba}from"react/jsx-runtime";function Po({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:b,maxDate:u,isDateDisabled:w,size:g="md",variant:m="outline",color:x="primary",radius:v,label:h,labelPlacement:k="top",placeholder:T,helperText:y,errorMessage:d,name:c,id:f,autoComplete:p,viewTabs:S=["days","months","years"],view:R,onViewChange:D,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:oe=!1,showWeekNumbers:ue=!1,showViewTabs:ie=!1,closeOnSelect:Q=!0}=z??{},q=Kb(),ge=f||q,ke=`${ge}-error-helper`,L=`${ge}-popover`,te=R!==void 0,[Z,he]=jl(a),ae=te?R:Z,ve=i||n,Se=_b(()=>$a(ve,ae),[ve,ae]),ye=t!==void 0,[J,O]=jl(()=>mt(r,n)),W=ye?mt(t,n):J,we=W?Ht(W,Se,s):"",[fe,se]=jl(!1),{refs:{setReference:me,setFloating:Re},floatingStyles:xe,context:re}=Xb({placement:I,open:fe&&!E&&!N&&!B,onOpenChange:se,whileElementsMounted:qb,transform:!1,middleware:[Zb(6),Jb(),Qb({padding:8})]}),de=eh(re,{escapeKey:!0,outsidePress:!0}),ce=th(re,{role:"dialog"}),{getReferenceProps:ee,getFloatingProps:j}=rh([de,ce]),{isMounted:Ce,styles:Ee}=et(re),Fe=!!(U||d),ne=Fe?"error":x,Te=C(g,_t,"md"),Pe=C(v,Qr,"lg"),_e=m==="other"?"":C(ne,C(m,g0,"outline"),"primary"),Ue=!!W,Le=Ne=>{te||he(Ne),D?.(Ne)},He=Ne=>{ye||O(Ne);let Ye=Ne?Ht(Ne,n,s):"";o?.(Ye),Q&&se(!1)},Ke=Ne=>{E||N||B||(Ne.key==="ArrowDown"||Ne.key==="Enter"||Ne.key===" "?(Ne.preventDefault(),fe||se(!0)):Ne.key==="Escape"&&fe&&(Ne.preventDefault(),se(!1)))},K=Ne=>{Ne.stopPropagation(),ye||O(null),o?.(null),P?.()},_=T||Se,ze=k==="floating",pe=k==="left",Me=()=>bt(at,{htmlFor:ge,label:h,isRequired:A,isFloating:ze,size:g,color:ne,hasError:Fe,cursor:"pointer",className:$}),Xe=Ne=>bt("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Te.icon}`,"aria-hidden":"true",children:Ne}),Ve=["group/field group/datepicker relative flex",pe?"flex-row items-center gap-3":"flex-col",ze?"pt-2":"",oe?"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":"",oe?"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?Ba("div",{className:Ve,children:[!ze&&Me(),Ba("div",{className:`flex flex-col ${oe?"w-full":""}`,children:[Ba("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(Ne=>!Ne),onKeyDown:Ke,readOnly:!0,autoComplete:p,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":y||d?ke:void 0,"aria-errormessage":d?ke:void 0,className:qe}),Ba("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(De,{}))}),!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(Be,{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(oh,{children:bt(nh,{context:re,modal:!1,returnFocus:!0,children:bt("div",{ref:Re,id:L,style:{...xe,...Ee,zIndex:Qe.PICKER},...j(),className:G,children:bt(wr,{value:W,onChange:He,view:ae,onViewChange:Le,minDate:b,maxDate:u,isDateDisabled:w,locale:s,firstDayOfWeek:l,showWeekNumbers:ue,size:g,color:x,radius:v,showViewTabs:ie,viewTabs:S})})})}),bt($e,{id:ke,helperText:y,errorMessage:d,sizeClassName:Te.helper,className:F})]})]}):bt("div",{className:H,children:bt(wr,{bordered:!1,value:W,onChange:He,view:ae,onViewChange:Le,minDate:b,maxDate:u,isDateDisabled:w,locale:s,firstDayOfWeek:l,showWeekNumbers:ue,size:g,color:x,radius:v,showViewTabs:ie,viewTabs:S})})}import{useState as Xl,useId as ch,useMemo as uh}from"react";import{useFloating as dh,autoUpdate as fh,offset as ph,flip as gh,shift as mh,useDismiss as bh,useRole as hh,useInteractions as xh,FloatingPortal as vh,FloatingFocusManager as yh}from"@floating-ui/react";import{useState as bi,useMemo as Ga}from"react";var Xt={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"}},Cr={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Ha={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},oo={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"}},Va={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 qt,jsxs as Aa}from"react/jsx-runtime";function pi({month1:e,month2:t,view:r,onViewChange:o,onPrevMonth:n,onNextMonth:i,onPrevYear:a,onNextYear:s,onPrevDecade:l,onNextDecade:b,size:u="md",color:w="primary",locale:g}){let m=dt(g),x=C(u,Xt,"md"),v=C(w,oo,"primary"),h=m.months[e.getMonth()],k=e.getFullYear(),T=Math.floor(k/10)*10,y=T+9,d=`${h} ${k}`;r==="months"&&(d=`${k}`),r==="years"&&(d=`${T} - ${y}`);let c=m.months[t.getMonth()],f=t.getFullYear(),p=Math.floor(f/10)*10,S=p+9,R=`${c} ${f}`;r==="months"&&(R=`${f}`),r==="years"&&(R=`${p} - ${S}`);let D=()=>{r==="days"?o("months"):r==="months"?o("years"):r==="years"&&o("days")},P=()=>{r==="days"?n():r==="months"?a():r==="years"&&(l?l():a())},I=()=>{r==="days"?i():r==="months"?s():r==="years"&&(b?b():s())};return Aa("div",{className:"flex items-center justify-between px-2 py-1.5 border-b border-neutral-200",children:[Aa("div",{className:"flex items-center space-x-0.5",children:[r==="days"&&qt("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:qt(Yr,{width:14,height:14})}),qt("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:qt(Yt,{width:x.iconSize,height:x.iconSize})})]}),Aa("div",{className:"grid grid-cols-2 flex-1 text-center divide-x divide-transparent px-2",children:[qt("div",{className:"flex items-center justify-center",children:qt("button",{type:"button",onClick:D,"aria-label":"\u0110\u1ED5i ch\u1EBF \u0111\u1ED9 xem l\u1ECBch",className:`font-semibold text-neutral-800 hover:${v.activeText} hover:bg-neutral-100 rounded-md px-2 py-1 transition-colors cursor-pointer ${x.headerText}`,children:d})}),qt("div",{className:"flex items-center justify-center",children:qt("button",{type:"button",onClick:D,"aria-label":"\u0110\u1ED5i ch\u1EBF \u0111\u1ED9 xem l\u1ECBch",className:`font-semibold text-neutral-800 hover:${v.activeText} hover:bg-neutral-100 rounded-md px-2 py-1 transition-colors cursor-pointer ${x.headerText}`,children:R})})]}),Aa("div",{className:"flex items-center space-x-0.5",children:[qt("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:qt(Wt,{width:x.iconSize,height:x.iconSize})}),r==="days"&&qt("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:qt(Wr,{width:14,height:14})})]})]})}import ih,{useRef as ah}from"react";import{jsx as gi,jsxs as Oa}from"react/jsx-runtime";function bn({days:e,onSelectDate:t,onHoverDate:r,size:o="md",color:n="primary",radius:i,locale:a,firstDayOfWeek:s=1,showWeekNumbers:l=!1}){let b=dt(a),u=C(o,Xt,"md"),w=C(n,oo,"primary"),g=C(i,Cr,"lg"),m=ah(null),x=[...b.weekdaysShort];if(s===1){let c=x.shift();x.push(c)}let v=e.some(c=>(c.isSelected||c.isRangeStart)&&!c.isDisabled),h=e.findIndex(c=>c.isToday&&!c.isDisabled),k=e.findIndex(c=>c.isCurrentMonth&&!c.isDisabled),T=k!==-1?k:e.findIndex(c=>!c.isDisabled),y=c=>{let p=m.current?.querySelectorAll("button")?.[c];p&&!p.disabled&&p.focus()},d=(c,f)=>{let p=null;if(c.key==="ArrowRight"){c.preventDefault();for(let S=f+1;S<e.length;S++)if(!e[S].isDisabled){p=S;break}}else if(c.key==="ArrowLeft"){c.preventDefault();for(let S=f-1;S>=0;S--)if(!e[S].isDisabled){p=S;break}}else if(c.key==="ArrowDown")c.preventDefault(),f+7<e.length&&!e[f+7].isDisabled&&(p=f+7);else if(c.key==="ArrowUp")c.preventDefault(),f-7>=0&&!e[f-7].isDisabled&&(p=f-7);else if(c.key==="Home"){c.preventDefault();let S=f-f%7;for(let R=S;R<S+7&&R<e.length;R++)if(!e[R].isDisabled){p=R;break}}else if(c.key==="End"){c.preventDefault();let S=Math.min(e.length-1,f-f%7+6);for(let R=S;R>=f-f%7;R--)if(!e[R].isDisabled){p=R;break}}else if(c.key==="Enter"||c.key===" "){c.preventDefault();let S=e[f];S&&!S.isDisabled&&t(S.date);return}p!==null&&y(p)};return Oa("div",{ref:m,role:"grid","aria-label":b.months[e[15]?.month||0],className:"w-full",children:[Oa("div",{role:"row",className:`grid ${l?"grid-cols-8":"grid-cols-7"} gap-1 mb-1 text-center`,children:[l&&gi("div",{role:"columnheader","aria-label":b.weekText||"Week",className:`flex items-center justify-center ${u.cellSize} text-neutral-400 ${u.cellText} font-medium`,children:"#"}),x.map(c=>gi("div",{role:"columnheader","aria-label":c,className:`flex items-center justify-center ${u.cellSize} text-neutral-500 ${u.cellText} font-medium`,children:c},c))]}),gi("div",{role:"rowgroup",className:`grid ${l?"grid-cols-8":"grid-cols-7"} gap-y-1 gap-x-1`,children:e.map((c,f)=>{let p=f%7===0,S="text-neutral-800 hover:bg-neutral-100",R="";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?R="":c.isRangeStart?R=`${w.rangeBg} rounded-l-full`:c.isRangeEnd&&(R=`${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`,R=`${w.rangeBg}`):c.isCurrentMonth||(S="text-neutral-400 hover:bg-neutral-100");let D=c.isToday&&!c.isSelected?`ring-1 ${w.todayRing} font-bold`:"",P=`${c.day} ${b.months[c.month]} ${c.year}`,I=!c.isDisabled&&(c.isSelected||c.isRangeStart||!v&&c.isToday&&f===h||!v&&h===-1&&f===T);return Oa(ih.Fragment,{children:[l&&p&&Oa("div",{className:`flex items-center justify-center ${u.cellSize} text-neutral-400 ${u.cellText} text-[10px] font-mono`,children:["W",c.weekNumber]}),gi("div",{role:"gridcell","aria-selected":c.isSelected||c.isInRange,className:`relative flex items-center justify-center ${R}`,children:gi("button",{type:"button",disabled:c.isDisabled,tabIndex:I?0:-1,onKeyDown:E=>d(E,f),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 ${u.cellSize} ${u.cellText} ${g} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${S} ${D}`,children:c.day})})]},c.date.toISOString())})})]})}import{useRef as sh}from"react";import{jsx as Yl}from"react/jsx-runtime";function hn({currentMonth:e,onSelectMonth:t,size:r="md",color:o="primary",radius:n,locale:i,rangeStart:a,rangeEnd:s,hoveredDate:l,onHoverMonth:b}){let u=dt(i),w=C(r,Xt,"md"),g=C(o,oo,"primary"),m=C(n,Cr,"lg"),x=sh(null),v=e.getFullYear(),h=new Date,k=h.getMonth(),T=h.getFullYear(),y=a&&a.getFullYear()===v?a.getMonth():-1,d=y!==-1?y:T===v?k:0,c=p=>{let R=x.current?.querySelectorAll("button")?.[p];R&&R.focus()},f=(p,S)=>{let R=null;if(p.key==="ArrowRight")p.preventDefault(),S+1<u.monthsShort.length&&(R=S+1);else if(p.key==="ArrowLeft")p.preventDefault(),S-1>=0&&(R=S-1);else if(p.key==="ArrowDown")p.preventDefault(),S+3<u.monthsShort.length&&(R=S+3);else if(p.key==="ArrowUp")p.preventDefault(),S-3>=0&&(R=S-3);else if(p.key==="Home")p.preventDefault(),R=0;else if(p.key==="End")p.preventDefault(),R=u.monthsShort.length-1;else if(p.key==="Enter"||p.key===" "){p.preventDefault(),t(S);return}R!==null&&c(R)};return Yl("div",{ref:x,role:"grid","aria-label":"Ch\u1ECDn th\xE1ng",className:"grid grid-cols-3 gap-2 py-2",onMouseLeave:()=>b?.(null),children:u.monthsShort.map((p,S)=>{let R=new Date(v,S,1),D=R.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===D,M=!!I&&I===D,z=!1,H=!1;P&&I?z=D>P&&D<I:P&&!I&&E&&(E>P?H=D>P&&D<=E:E<P&&(H=D<P&&D>=E));let V=T===v&&k===S,Y=S===d,$="text-neutral-800 hover:bg-neutral-100";return N||M?$=`${g.selected} font-semibold shadow-xs`:z||H?$=`${g.rangeBg} ${g.rangeText}`:V&&($=`ring-1 ${g.todayRing} font-semibold`),Yl("div",{role:"gridcell","aria-selected":N||M||z,className:"flex items-center justify-center",children:Yl("button",{type:"button",tabIndex:Y?0:-1,onKeyDown:F=>f(F,S),onClick:()=>t(S),onMouseEnter:()=>b?.(R),"aria-label":`${p} ${v}`,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:p})},p)})})}import{useRef as lh}from"react";import{jsx as Wl}from"react/jsx-runtime";function xn({currentMonth:e,onSelectYear:t,size:r="md",color:o="primary",radius:n,rangeStart:i,rangeEnd:a,hoveredDate:s,onHoverYear:l}){let b=C(r,Xt,"md"),u=C(o,oo,"primary"),w=C(n,Cr,"lg"),g=lh(null),m=e.getFullYear(),x=Math.floor(m/10)*10,v=new Date().getFullYear(),h=[];for(let p=0;p<12;p++)h.push(x+p);let k=i?i.getFullYear():m,T=h.indexOf(k),y=h.indexOf(v),d=T!==-1?T:y!==-1?y:0,c=p=>{let R=g.current?.querySelectorAll("button")?.[p];R&&R.focus()},f=(p,S)=>{let R=null;if(p.key==="ArrowRight")p.preventDefault(),S+1<h.length&&(R=S+1);else if(p.key==="ArrowLeft")p.preventDefault(),S-1>=0&&(R=S-1);else if(p.key==="ArrowDown")p.preventDefault(),S+3<h.length&&(R=S+3);else if(p.key==="ArrowUp")p.preventDefault(),S-3>=0&&(R=S-3);else if(p.key==="Home")p.preventDefault(),R=0;else if(p.key==="End")p.preventDefault(),R=h.length-1;else if(p.key==="Enter"||p.key===" "){p.preventDefault();let D=h[S];D!==void 0&&t(D);return}R!==null&&c(R)};return Wl("div",{ref:g,role:"grid","aria-label":"Ch\u1ECDn n\u0103m",className:"grid grid-cols-3 gap-2 py-2",onMouseLeave:()=>l?.(null),children:h.map((p,S)=>{let R=i?i.getFullYear():null,D=a?a.getFullYear():null,P=s?s.getFullYear():null,I=R!==null&&p===R,E=D!==null&&p===D,N=!1,M=!1;R!==null&&D!==null?N=p>R&&p<D:R!==null&&D===null&&P!==null&&(P>R?M=p>R&&p<=P:P<R&&(M=p<R&&p>=P));let z=p===v,H=S===d,V="text-neutral-800 hover:bg-neutral-100";return I||E?V=`${u.selected} font-semibold shadow-xs`:N||M?V=`${u.rangeBg} ${u.rangeText}`:z&&(V=`ring-1 ${u.todayRing} font-semibold`),Wl("div",{role:"gridcell","aria-selected":I||E||N,className:"flex items-center justify-center",children:Wl("button",{type:"button",tabIndex:H?0:-1,onKeyDown:Y=>f(Y,S),onClick:()=>t(p),onMouseEnter:()=>l?.(new Date(p,0,1)),"aria-label":`${p}`,className:`w-full flex items-center justify-center h-10 ${b.cellText} ${w} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${V}`,children:p})},p)})})}function _l(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 x0(e,t){return new Date(e,t+1,0).getDate()}function Kl(e,t,r,o,n,i,a,s,l){let b=o?to(e,o):!1,u=n?to(e,n):!1,w=_l(e,o||null,n||null),g=o&&!n&&i?_l(e,o,i):!1,m=!1;return a&&ii(e,a)&&(m=!0),s&&ai(e,s)&&(m=!0),l&&l(e)&&(m=!0),{date:e,day:e.getDate(),month:e.getMonth(),year:e.getFullYear(),isCurrentMonth:t,isToday:to(e,r),isSelected:b||u,isDisabled:m,isRangeStart:b,isRangeEnd:u,isInRange:w,isHoveredRange:g,weekNumber:si(e)}}function mi(e,t,r=1,o,n,i,a,s,l){let b=[],u=new Date,w=new Date(e,t,1).getDay(),g=x0(e,t-1),m=x0(e,t),x=r===1?w===0?6:w-1:w;for(let h=x-1;h>=0;h--){let k=g-h,T=new Date(e,t-1,k);b.push(Kl(T,!1,u,o,n,i,a,s,l))}for(let h=1;h<=m;h++){let k=new Date(e,t,h);b.push(Kl(k,!0,u,o,n,i,a,s,l))}let v=42-b.length;for(let h=1;h<=v;h++){let k=new Date(e,t+1,h);b.push(Kl(k,!1,u,o,n,i,a,s,l))}return b}import{jsx as lr,jsxs as Ua}from"react/jsx-runtime";function vn({value:e,onChange:t,view:r="days",onViewChange:o,minDate:n,maxDate:i,isDateDisabled:a,locale:s="vi",firstDayOfWeek:l=1,showWeekNumbers:b=!1,showViewTabs:u=!1,viewTabs:w=["days","months","years"],size:g="md",color:m="primary",radius:x,className:v="",bordered:h=!0}){let k=C(g,Xt,"md"),T=C(x,Ha,"lg"),[y,d]=bi(r),[c,f]=bi(r);r!==c&&(f(r),d(r));let p=e?e[0]:null,S=e?e[1]:null,[R,D]=bi(()=>{let L=p||new Date;return new Date(L.getFullYear(),L.getMonth(),1)}),P=dt(s),I=Ga(()=>{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;d(te),F(null),o?.(te)},N=()=>{let L=new Date(R.getFullYear(),R.getMonth()-1,1);D(L)},M=()=>{let L=new Date(R.getFullYear(),R.getMonth()+1,1);D(L)},z=()=>{let L=new Date(R.getFullYear()-1,R.getMonth(),1);D(L)},H=()=>{let L=new Date(R.getFullYear()+1,R.getMonth(),1);D(L)},V=()=>{let L=new Date(R.getFullYear()-10,R.getMonth(),1);D(L)},Y=()=>{let L=new Date(R.getFullYear()+10,R.getMonth(),1);D(L)},[$,F]=bi(null),[G,A]=bi(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(D(Z),u&&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 d("days")},X=L=>{let te=new Date(L,0,1);if(D(te),u&&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 d("months")},le=mt(n),oe=mt(i),ue=R,ie=Ga(()=>y==="months"?new Date(R.getFullYear()+1,R.getMonth(),1):y==="years"?new Date(R.getFullYear()+10,R.getMonth(),1):new Date(R.getFullYear(),R.getMonth()+1,1),[R,y]),Q=$||p,q=$?null:S,ge=Ga(()=>mi(ue.getFullYear(),ue.getMonth(),l,Q,q,G,le,oe,a),[ue,l,Q,q,G,le,oe,a]),ke=Ga(()=>mi(ie.getFullYear(),ie.getMonth(),l,Q,q,G,le,oe,a),[ie,l,Q,q,G,le,oe,a]);return Ua("div",{className:`inline-flex flex-col ${h?"border-2 border-neutral-200 bg-neutral-white shadow-xl":"border-0 shadow-none bg-transparent"} ${T} overflow-hidden select-none ${v}`,children:[u&&I.length>0&&lr("div",{className:"px-2.5 py-1.5 border-b border-neutral-200",children:lr(Ro,{activeKey:r,onChange:E,size:"sm",variant:"solid",color:m,fullWidth:!0,className:"gap-0!",children:lr(Do,{className:"p-0.5",children:I.map(L=>lr(No,{value:L.key,className:"py-1 px-2 text-xs",children:L.label},L.key))})})}),lr(pi,{month1:ue,month2:ie,view:y,onViewChange:d,onPrevMonth:N,onNextMonth:M,onPrevYear:z,onNextYear:H,onPrevDecade:V,onNextDecade:Y,size:g,color:m,locale:s}),Ua("div",{className:"flex flex-row divide-x divide-neutral-200",children:[Ua("div",{className:`${k.calendarPadding} min-w-70`,children:[y==="days"&&lr(bn,{days:ge,onSelectDate:U,onHoverDate:A,size:g,color:m,radius:x,locale:s,firstDayOfWeek:l,showWeekNumbers:b}),y==="months"&&lr(hn,{currentMonth:ue,onSelectMonth:L=>B(ue.getFullYear(),L),size:g,color:m,radius:x,locale:s,rangeStart:Q,rangeEnd:q,hoveredDate:G,onHoverMonth:A}),y==="years"&&lr(xn,{currentMonth:ue,onSelectYear:X,size:g,color:m,radius:x,rangeStart:Q,rangeEnd:q,hoveredDate:G,onHoverYear:A})]}),Ua("div",{className:`${k.calendarPadding} min-w-70`,children:[y==="days"&&lr(bn,{days:ke,onSelectDate:U,onHoverDate:A,size:g,color:m,radius:x,locale:s,firstDayOfWeek:l,showWeekNumbers:b}),y==="months"&&lr(hn,{currentMonth:ie,onSelectMonth:L=>B(ie.getFullYear(),L),size:g,color:m,radius:x,locale:s,rangeStart:Q,rangeEnd:q,hoveredDate:G,onHoverMonth:A}),y==="years"&&lr(xn,{currentMonth:ie,onSelectYear:X,size:g,color:m,radius:x,rangeStart:Q,rangeEnd:q,hoveredDate:G,onHoverYear:A})]})]})]})}import{jsx as ht,jsxs as ja}from"react/jsx-runtime";function zo({ref:e,value:t,defaultValue:r,onChange:o,separator:n=" - ",format:i="DD/MM/YYYY",displayFormat:a,defaultView:s="days",locale:l="vi",firstDayOfWeek:b=1,minDate:u,maxDate:w,isDateDisabled:g,size:m="md",variant:x="outline",color:v="primary",radius:h,label:k,labelPlacement:T="top",placeholder:y,helperText:d,errorMessage:c,name:f,id:p,autoComplete:S,viewTabs:R=["days","months","years"],view:D,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:oe=!0,isFullWidth:ue=!1,showWeekNumbers:ie=!1,showViewTabs:Q=!1,closeOnSelect:q=!0}=H??{},ge=ch(),ke=p||ge,L=`${ke}-error-helper`,te=`${ke}-popover`,Z=D!==void 0,[he,ae]=Xl(s),ve=Z?D:he,Se=a||i,ye=uh(()=>$a(Se,ve),[Se,ve]),J=t!==void 0,[O,W]=Xl(()=>{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)}${n}${Ht(we[1],ye,l)}`:we[0]?`${Ht(we[0],ye,l)}${n}`:"",[se,me]=Xl(!1),{refs:{setReference:Re,setFloating:xe},floatingStyles:re,context:de}=dh({placement:E,open:se&&!N&&!M&&!X,onOpenChange:me,whileElementsMounted:fh,transform:!1,middleware:[ph(6),gh(),mh({padding:8})]}),ce=bh(de,{escapeKey:!0,outsidePress:!0}),ee=hh(de,{role:"dialog"}),{getReferenceProps:j,getFloatingProps:Ce}=xh([ce,ee]),{isMounted:Ee,styles:Fe}=et(de),ne=!!(B||c),Te=ne?"error":v,Pe=C(m,Xt,"md"),_e=C(h,Cr,"lg"),Ue=C(x,Va,"outline"),Le=x==="other"?"":C(Te,Ue,"primary"),He=!!we[0],Ke=be=>{Z||ae(be),P?.(be)},K=be=>{J||W(be);let[Ae,rt]=be;if(Ae&&rt){let Je=[Ht(Ae,i,l),Ht(rt,i,l)];o?.(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]),o?.(null),I?.()},pe=y||`${ye}${n}${ye}`,Me=T==="floating",Xe=T==="left",Ve=()=>ht(at,{htmlFor:ke,label:k,isRequired:U,isFloating:Me,size:m,color:Te,hasError:ne,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(" "),Ne=["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?ja("div",{className:qe,children:[!Me&&Ve(),ja("div",{className:`flex flex-col ${ue?"w-full":""}`,children:[ja("div",{ref:Re,...j(),className:Ne,children:[Me&&Ve(),ht("input",{ref:e,id:ke,name:f,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":ne,"aria-busy":X,"aria-disabled":N||X,"aria-describedby":d||c?L:void 0,"aria-errormessage":c?L:void 0,className:Ye}),ja("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(De,{}))}),!X&&oe&&!N&&!M&&ht("button",{type:"button",onClick:ze,"aria-label":"X\xF3a kho\u1EA3ng ng\xE0y",tabIndex:He?0:-1,"aria-hidden":!He,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} ${He?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:ht(Be,{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(vh,{children:ht(yh,{context:de,modal:!1,returnFocus:!0,children:ht("div",{ref:xe,id:te,style:{...re,...Fe,zIndex:Qe.PICKER},...Ce(),className:A,children:ht(vn,{value:we,onChange:K,view:ve,onViewChange:Ke,minDate:u,maxDate:w,isDateDisabled:g,locale:l,firstDayOfWeek:b,showWeekNumbers:ie,size:m,color:v,radius:h,showViewTabs:Q,viewTabs:R})})})}),ht($e,{id:L,helperText:d,errorMessage:c,sizeClassName:Pe.helper,className:G})]})]}):ht("div",{className:V,children:ht(vn,{bordered:!1,value:we,onChange:K,view:ve,onViewChange:Ke,minDate:u,maxDate:w,isDateDisabled:g,locale:l,firstDayOfWeek:b,showWeekNumbers:ie,size:m,color:v,radius:h,showViewTabs:Q,viewTabs:R})})}import{useState as N0,useId as Ch}from"react";import{useFloating as kh,autoUpdate as Sh,offset as Th,flip as Rh,shift as Dh,useDismiss as Nh,useRole as Ph,useInteractions as zh,FloatingPortal as Ih,FloatingFocusManager as Mh}from"@floating-ui/react";import{useMemo as yn}from"react";var no={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"}},Ya={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Wa={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},v0={none:"rounded-none",sm:"rounded-xs",md:"rounded-md",lg:"rounded-lg",xl:"rounded-lg",full:"rounded-full"},y0={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 Ka={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 cr(e){return e<10?`0${e}`:`${e}`}function io(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 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 It(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,cr(r)).replace(/H/g,`${r}`).replace(/hh/g,cr(i)).replace(/h/g,`${i}`).replace(/mm/g,cr(o)).replace(/m/g,`${o}`).replace(/ss/g,cr(n)).replace(/s/g,`${n}`).replace(/A/g,a).replace(/a/g,a.toLowerCase())}function w0(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 Io(e,t,r=0){let o=new Date;return o.setHours(e,t,r,0),o}function C0(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 k0(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 S0(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 Mo(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 wh,useRef as T0}from"react";import{jsx as R0}from"react/jsx-runtime";function ao({items:e,selectedValue:t,onSelect:r,ariaLabel:o,size:n="md",color:i="primary",radius:a,className:s="",itemClassName:l="",selectedItemClassName:b=""}){let u=T0(null),w=T0(null),g=C(n,no,"md"),m=C(i,y0,"primary"),x=C(a,v0,"md"),v=e.findIndex(y=>!y.disabled),h=e.some(y=>y.value===t);wh(()=>{if(w.current&&u.current){let y=u.current,d=w.current,c=d.offsetTop-y.offsetTop-(y.clientHeight-d.clientHeight)/2;y.scrollTo({top:Math.max(0,c),behavior:"smooth"}),y.contains(document.activeElement)&&d.focus()}},[t]);let k=y=>{let d=e[y];if(!d||d.disabled)return;r(d.value),u.current?.children[y]?.focus()},T=(y,d)=>{if(e.filter(f=>!f.disabled).length){if(y.key==="ArrowDown"){y.preventDefault();for(let f=d+1;f<e.length;f++)if(!e[f].disabled){k(f);break}}else if(y.key==="ArrowUp"){y.preventDefault();for(let f=d-1;f>=0;f--)if(!e[f].disabled){k(f);break}}else if(y.key==="ArrowRight")y.preventDefault(),u.current?.nextElementSibling?.querySelector('[tabindex="0"], [role="option"]:not([aria-disabled="true"])')?.focus();else if(y.key==="ArrowLeft")y.preventDefault(),u.current?.previousElementSibling?.querySelector('[tabindex="0"], [role="option"]:not([aria-disabled="true"])')?.focus();else if(y.key==="Home"){y.preventDefault();let f=e.findIndex(p=>!p.disabled);f!==-1&&k(f)}else if(y.key==="End"){y.preventDefault();for(let f=e.length-1;f>=0;f--)if(!e[f].disabled){k(f);break}}else if(y.key==="Enter"||y.key===" "){y.preventDefault();let f=e[d];f&&!f.disabled&&k(d)}}};return R0("ul",{ref:u,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((y,d)=>{let c=t===y.value,f=!!y.disabled,p=!f&&(c||!h&&d===v);return R0("li",{ref:c?w:void 0,role:"option","aria-selected":c,"aria-disabled":f,"aria-label":`${y.label} ${o||""}`.trim(),tabIndex:p?0:-1,onKeyDown:S=>T(S,d),onClick:()=>{f||k(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 ${x} ${g.itemHeight} ${g.itemText} ${f?"opacity-30 cursor-not-allowed text-neutral-400":c?`${m.selected} cursor-default ${b}`:`text-neutral-700 ${m.hoverBg} cursor-pointer`} ${l}`,children:y.label},`${y.value}`)})})}import{jsx as wn,jsxs as D0}from"react/jsx-runtime";function Zt({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:b,disabledHours:u,disabledMinutes:w,disabledSeconds:g,size:m="md",color:x="primary",radius:v,className:h=""}){let k=yn(()=>Vt(l),[l]),T=yn(()=>Vt(b),[b]),y=io(o,n),d=C(v,Wa,"lg"),c=C(m,no,"md"),f=e?e.getHours():0,p=f%12===0?12:f%12,S=e?e.getMinutes():0,R=e?e.getSeconds():0,D=f>=12?"PM":"AM",P=yn(()=>{let $=[];if(o)for(let F=1;F<=12;F+=i){let G=D==="PM"?F===12?12:F+12:F===12?0:F,A=Mo("hour",G,f,S,k,T,u,w,g);$.push({value:F,label:cr(F),disabled:A})}else for(let F=0;F<24;F+=i){let G=Mo("hour",F,f,S,k,T,u,w,g);$.push({value:F,label:cr(F),disabled:G})}return $},[o,i,D,f,S,k,T,u,w,g]),I=yn(()=>{let $=[];for(let F=0;F<60;F+=a){let G=Mo("minute",F,f,S,k,T,u,w,g);$.push({value:F,label:cr(F),disabled:G})}return $},[a,f,S,k,T,u,w,g]),E=yn(()=>{if(!n)return[];let $=[];for(let F=0;F<60;F+=s){let G=Mo("second",F,f,S,k,T,u,w,g);$.push({value:F,label:cr(F),disabled:G})}return $},[n,s,f,S,k,T,u,w,g]),N=yn(()=>[{value:"AM",label:"AM"},{value:"PM",label:"PM"}],[]),M=$=>{let F=Number($);o&&(D==="PM"&&F<12&&(F+=12),D==="AM"&&F===12&&(F=0));let G=Io(F,S,R);t?.(G)},z=$=>{let F=Number($),G=Io(f,F,R);t?.(G)},H=$=>{let F=Number($),G=Io(f,S,F);t?.(G)},V=$=>{let F=$,G=f;F==="AM"&&G>=12?G-=12:F==="PM"&&G<12&&(G+=12);let A=Io(G,S,R);t?.(A)},Y=n?"--:--:--":"--:--";return D0("div",{"aria-label":r,className:`inline-flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${d} ${h}`,children:[wn("div",{className:"flex items-center justify-center px-4 py-2 border-b border-neutral-200 bg-neutral-50/50",children:wn("span",{className:`text-neutral-700 tracking-wider font-mono ${c.headerText}`,children:e?It(e,y):Y})}),D0("div",{className:`flex divide-x divide-neutral-200 ${c.panelPadding}`,children:[wn(ao,{ariaLabel:"Gi\u1EDD",items:P,selectedValue:o?p:e?f:null,onSelect:M,size:m,color:x,radius:v}),wn(ao,{ariaLabel:"Ph\xFAt",items:I,selectedValue:e?S:null,onSelect:z,size:m,color:x,radius:v}),n&&wn(ao,{ariaLabel:"Gi\xE2y",items:E,selectedValue:e?R:null,onSelect:H,size:m,color:x,radius:v}),o&&wn(ao,{ariaLabel:"Bu\u1ED5i",items:N,selectedValue:e?D:null,onSelect:V,size:m,color:x,radius:v})]})]})}import{jsx as Mt,jsxs as _a}from"react/jsx-runtime";function ql({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:b=1,secondStep:u=1,minTime:w,maxTime:g,disabledHours:m,disabledMinutes:x,disabledSeconds:v,size:h="md",variant:k="outline",color:T="primary",radius:y,label:d,labelPlacement:c="top",placeholder:f,helperText:p,errorMessage:S,name:R,id:D,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:oe=!1,closeOnSelect:ue=!1}=z??{},ie=Ch(),Q=D||ie,q=`${Q}-error-helper`,ge=`${Q}-popover`,ke=io(a,s),L=n||ke,te=i||L,Z=t!==void 0,[he,ae]=N0(()=>Vt(r)),ve=Z?Vt(t):he,Se=ve?It(ve,te):"",[ye,J]=N0(!1),{refs:{setReference:O,setFloating:W},floatingStyles:we,context:fe}=kh({placement:E,open:ye&&!N&&!M&&!B,onOpenChange:J,whileElementsMounted:Sh,transform:!1,middleware:[Th(6),Rh(),Dh({padding:8})]}),se=Nh(fe,{escapeKey:!0,outsidePress:!0}),me=Ph(fe,{role:"dialog"}),{getReferenceProps:Re,getFloatingProps:xe}=zh([se,me]),{isMounted:re,styles:de}=et(fe),ce=!!(U||S),ee=ce?"error":T,j=C(h,no,"md"),Ce=C(y,Ya,"lg"),Ee=k==="other"?"":C(ee,C(k,Ka,"outline"),"primary"),Fe=!!ve,ne=pe=>{Z||ae(pe);let Me=pe?It(pe,L):"";o?.(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),o?.(null),I?.()},_e=f||te,Ue=c==="floating",Le=c==="left",He=()=>Mt(at,{htmlFor:Q,label:d,isRequired:A,isFloating:Ue,size:h,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":"",oe?"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":"",oe?"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 _a("div",{className:K,children:[!Ue&&He(),_a("div",{className:`flex flex-col ${oe?"w-full":""}`,children:[_a("div",{ref:O,...Re(),className:_,children:[Ue&&He(),Mt("input",{ref:e,id:Q,name:R,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":p||S?q:void 0,"aria-errormessage":S?q:void 0,className:ze}),_a("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(De,{}))}),!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(Be,{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(Ih,{children:Mt(Mh,{context:fe,modal:!1,returnFocus:!0,children:Mt("div",{ref:W,id:ge,style:{...we,...de,zIndex:Qe.PICKER},...xe(),className:G,children:Mt(Zt,{value:ve,onChange:ne,ariaLabel:typeof d=="string"?`${d} selector`:"Time selector",use12Hours:a,showSeconds:s,hourStep:l,minuteStep:b,secondStep:u,minTime:w,maxTime:g,disabledHours:m,disabledMinutes:x,disabledSeconds:v,size:h,color:T,radius:y})})})}),Mt($e,{id:q,helperText:p,errorMessage:S,sizeClassName:j.helper,className:F})]})]})}import{useState as F0,useId as Fh,useMemo as Eh}from"react";import{useFloating as $h,autoUpdate as Lh,offset as Bh,flip as Hh,shift as Vh,useDismiss as Ah,useRole as Oh,useInteractions as Gh,FloatingPortal as Uh,FloatingFocusManager as jh}from"@floating-ui/react";var P0=no,z0=Ya,I0=Wa,M0=Ka;import{jsx as xt,jsxs as Fo}from"react/jsx-runtime";function Zl({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:b=!1,showSeconds:u=!0,hourStep:w=1,minuteStep:g=1,secondStep:m=1,minTime:x,maxTime:v,disabledHours:h,disabledMinutes:k,disabledSeconds:T,size:y="md",variant:d="outline",color:c="primary",radius:f,label:p,labelPlacement:S="top",placeholder:R,placeholders:D,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:oe=!1,isLoading:ue=!1,showSpinner:ie=!1,isClearable:Q=!0,isFullWidth:q=!1,closeOnSelect:ge=!1}=V??{},ke=Fh(),L=N||ke,te=`${L}-error-helper`,Z=`${L}-popover`,he=io(b,u),ae=n||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=Eh(()=>W&&we?`${W}${a}${we}`:W?`${W}${a}`:"",[W,we,a]),[se,me]=F0(!1),{refs:{setReference:Re,setFloating:xe},floatingStyles:re,context:de}=$h({placement:$,open:se&&!z&&!H&&!ue,onOpenChange:me,whileElementsMounted:Lh,transform:!1,middleware:[Bh(6),Hh(),Vh({padding:8})]}),ce=Ah(de,{escapeKey:!0,outsidePress:!0}),ee=Oh(de,{role:"dialog"}),{getReferenceProps:j,getFloatingProps:Ce}=Gh([ce,ee]),{isMounted:Ee,styles:Fe}=et(de),ne=!!(oe||I),Te=ne?"error":c,Pe=C(y,P0,"md"),_e=C(f,z0,"lg"),Ue=C(f,I0,"lg"),Le=d==="other"?"":C(Te,C(d,M0,"outline"),"primary"),He=!!(O[0]||O[1]),Ke=be=>{let Ae=[be,O[1]];Se||J(Ae);let rt=It(be,ae),Je=O[1]?It(O[1],ae):"";o?.([rt,Je])},K=be=>{let Ae=[O[0],be];Se||J(Ae);let rt=O[0]?It(O[0],ae):"",Je=It(be,ae);o?.([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]),o?.(null),Y?.()},pe=R||(D?`${D[0]}${a}${D[1]}`:`${ve}${a}${ve}`),Me=S==="floating",Xe=S==="left",Ve=()=>xt(at,{htmlFor:L,label:p,isRequired:le,isFloating:Me,size:y,color:Te,hasError:ne,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(" "),Ne=["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 Fo("div",{className:qe,children:[!Me&&Ve(),Fo("div",{className:`flex flex-col ${q?"w-full":""}`,children:[Fo("div",{ref:Re,...j(),className:Ne,children:[Me&&Ve(),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":ne,"aria-busy":ue,"aria-disabled":z||ue,"aria-describedby":P||I?te:void 0,"aria-errormessage":I?te:void 0,className:Ye}),Fo("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(De,{}))}),!ue&&Q&&!z&&!H&&xt("button",{type:"button",onClick:ze,"aria-label":"X\xF3a kho\u1EA3ng th\u1EDDi gian",tabIndex:He?0:-1,"aria-hidden":!He,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} ${He?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:xt(Be,{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(Uh,{children:xt(jh,{context:de,modal:!1,returnFocus:!0,children:Fo("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:[Fo("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(Zt,{value:O[0],onChange:Ke,ariaLabel:s,use12Hours:b,showSeconds:u,hourStep:w,minuteStep:g,secondStep:m,minTime:x,maxTime:O[1]||v,disabledHours:h,disabledMinutes:k,disabledSeconds:T,size:y,color:c,radius:f,className:"border-none shadow-none"})]}),Fo("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(Zt,{value:O[1],onChange:K,ariaLabel:l,use12Hours:b,showSeconds:u,hourStep:w,minuteStep:g,secondStep:m,minTime:O[0]||x,maxTime:v,disabledHours:h,disabledMinutes:k,disabledSeconds:T,size:y,color:c,radius:f,className:"border-none shadow-none"})]})]})})}),xt($e,{id:te,helperText:P,errorMessage:I,sizeClassName:Pe.helper,className:B})]})]})}function E0(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 Jl,useId as Yh}from"react";import{useFloating as Wh,autoUpdate as Kh,offset as _h,flip as Xh,shift as qh,useDismiss as Zh,useRole as Jh,useInteractions as Qh,FloatingPortal as ex,FloatingFocusManager as tx}from"@floating-ui/react";function so(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 Jt(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 Qt(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=hi(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 At(e,t="DD/MM/YYYY HH:mm:ss",r){return!e||isNaN(e.getTime())?"":Ht(e,t,r)}function hi(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,b=!1,u=!1,w=t.match(/YYYY|YY|MM|M|DD|D|HH|H|hh|h|mm|m|ss|s|A|a/g);if(!w){let v=new Date(r);return isNaN(v.getTime())?null:v}let g="^"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");for(let v of w)v==="YYYY"?g=g.replace("YYYY","(\\d{4})"):v==="YY"?g=g.replace("YY","(\\d{2})"):v==="MM"||v==="M"||v==="DD"||v==="D"||v==="HH"||v==="H"||v==="hh"||v==="h"||v==="mm"||v==="m"||v==="ss"||v==="s"?g=g.replace(v,"(\\d{1,2})"):(v==="A"||v==="a")&&(g=g.replace(v,"(AM|PM|am|pm)"));g+="$";let m=new RegExp(g,"i").exec(r);if(!m){let v=new Date(r);return isNaN(v.getTime())?null:v}w.forEach((v,h)=>{let k=m[h+1];if(!k)return;if(v==="A"||v==="a"){b=!0,k.toUpperCase()==="PM"&&(u=!0);return}let T=parseInt(k,10);isNaN(T)||(v==="YYYY"?o=T:v==="YY"?o=2e3+T:v==="MM"||v==="M"?n=T:v==="DD"||v==="D"?i=T:v==="HH"||v==="H"?a=T:v==="hh"||v==="h"?(b=!0,a=T):v==="mm"||v==="m"?s=T:(v==="ss"||v==="s")&&(l=T))}),b&&(u?a<12&&(a+=12):a===12&&(a=0));let x=new Date(o,n-1,i,a,s,l);return isNaN(x.getTime())?null:x}var $0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},L0={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 xi}from"react/jsx-runtime";function Ql({ref:e,value:t,defaultValue:r,onChange:o,format:n,displayFormat:i,layout:a="side-by-side",locale:s="vi",defaultView:l="days",firstDayOfWeek:b=1,minDate:u,maxDate:w,isDateDisabled:g,viewTabs:m,use12Hours:x=!1,showSeconds:v=!0,hourStep:h=1,minuteStep:k=1,secondStep:T=1,minTime:y,maxTime:d,disabledHours:c,disabledMinutes:f,disabledSeconds:p,size:S="md",variant:R="outline",color:D="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:oe="",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=Yh(),Se=V||ve,ye=`${Se}-error-helper`,J=`${Se}-popover`,O=so(x,v),W=n||O,we=i||W,fe=t!==void 0,[se,me]=Jl(()=>Qt(r,W)),Re=fe?Qt(t,W):se,xe=Re?At(Re,we,s):"",[re,de]=Jl(l),[ce,ee]=Jl(!1),{refs:{setReference:j,setFloating:Ce},floatingStyles:Ee,context:Fe}=Wh({placement:U,open:ce&&!$&&!F&&!ge,onOpenChange:ee,whileElementsMounted:Kh,transform:!1,middleware:[_h(6),Xh(),qh({padding:8})]}),ne=Zh(Fe,{escapeKey:!0,outsidePress:!0}),Te=Jh(Fe,{role:"dialog"}),{getReferenceProps:Pe,getFloatingProps:_e}=Qh([ne,Te]),{isMounted:Ue,styles:Le}=et(Fe),He=!!(q||z),Ke=He?"error":D,K=C(S,B0,"md"),_=C(P,$0,"lg"),ze=C(P,L0,"lg"),pe=R==="other"?"":C(Ke,C(R,H0,"outline"),"primary"),Me=!!Re,Xe=nt=>{let Rt=Jt(nt,Re||new Date);fe||me(Rt);let go=Rt?At(Rt,W,s):"";o?.(go),Z&&ee(!1)},Ve=nt=>{if(!nt)return;let Rt=Jt(Re||new Date,nt);fe||me(Rt);let go=Rt?At(Rt,W,s):"";o?.(go),Z&&ee(!1)},Ze=nt=>{$||F||ge||(nt.key==="ArrowDown"||nt.key==="Enter"||nt.key===" "?(nt.preventDefault(),ce||ee(!0)):nt.key==="Escape"&&ce&&(nt.preventDefault(),ee(!1)))},qe=nt=>{nt.stopPropagation(),fe||me(null),o?.(null),A?.()},Ne=N||we,Ye=E==="floating",be=E==="left",Ae=()=>vt(at,{htmlFor:Se,label:I,isRequired:Q,isFloating:Ye,size:S,color:Ke,hasError:He,cursor:"pointer",className:oe}),rt=nt=>vt("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${K.icon}`,"aria-hidden":"true",children:nt}),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 xi("div",{className:Je,children:[!Ye&&Ae(),xi("div",{className:`flex flex-col ${te?"w-full":""}`,children:[xi("div",{ref:j,...Pe(),className:Tt,children:[Ye&&Ae(),vt("input",{ref:e,id:Se,name:H,type:"text",value:xe,onClick:()=>!$&&!F&&!ge&&ee(nt=>!nt),onKeyDown:Ze,readOnly:!0,autoComplete:Y,placeholder:Ne,disabled:$||ge,role:"combobox","aria-expanded":ce&&!ge,"aria-haspopup":"dialog","aria-controls":J,"aria-required":Q,"aria-invalid":He,"aria-busy":ge,"aria-disabled":$||ge,"aria-describedby":M||z?ye:void 0,"aria-errormessage":z?ye:void 0,className:Ft}),xi("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(De,{}))}),!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(Be,{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(ex,{children:vt(tx,{context:Fe,modal:!1,returnFocus:!0,children:xi("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(wr,{value:Re,onChange:Xe,view:re,onViewChange:de,minDate:u,maxDate:w,isDateDisabled:g,locale:s,firstDayOfWeek:b,showWeekNumbers:he,size:S,color:D,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(Zt,{value:Re,onChange:Ve,ariaLabel:typeof I=="string"?`${I} time`:"Time selector",use12Hours:x,showSeconds:v,hourStep:h,minuteStep:k,secondStep:T,minTime:y,maxTime:d,disabledHours:c,disabledMinutes:f,disabledSeconds:p,size:S,color:D,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 Xa,useId as rx,useMemo as ox}from"react";import{useFloating as nx,autoUpdate as ix,offset as ax,flip as sx,shift as lx,useDismiss as cx,useRole as ux,useInteractions as dx,FloatingPortal as fx,FloatingFocusManager as px}from"@floating-ui/react";var V0={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 A0={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 kr}from"react/jsx-runtime";function ec({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:b="side-by-side",locale:u="vi",defaultView:w="days",firstDayOfWeek:g=1,minDate:m,maxDate:x,isDateDisabled:v,viewTabs:h,use12Hours:k=!1,showSeconds:T=!0,hourStep:y=1,minuteStep:d=1,secondStep:c=1,minTime:f,maxTime:p,disabledHours:S,disabledMinutes:R,disabledSeconds:D,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:oe="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=rx(),W=G||O,we=`${W}-error-helper`,fe=`${W}-popover`,se=so(k,T),me=n||se,Re=i||me,xe=t!==void 0,[re,de]=Xa(()=>{let je=r;return je&&Array.isArray(je)?[Qt(je[0],me),Qt(je[1],me)]:[null,null]}),ce=xe?t&&Array.isArray(t)?[Qt(t[0],me),Qt(t[1],me)]:[null,null]:re,[ee,j]=Xa("start"),[Ce,Ee]=Xa(w),[Fe,ne]=Xa(!1),Te=ce[0]?At(ce[0],Re,u):"",Pe=ce[1]?At(ce[1],Re,u):"",_e=ox(()=>Te&&Pe?`${Te}${a}${Pe}`:Te?`${Te}${a}`:"",[Te,Pe,a]),{refs:{setReference:Ue,setFloating:Le},floatingStyles:He,context:Ke}=nx({placement:oe,open:Fe&&!U&&!B&&!Z,onOpenChange:ne,whileElementsMounted:ix,transform:!1,middleware:[ax(6),sx(),lx({padding:8})]}),K=cx(Ke,{escapeKey:!0,outsidePress:!0}),_=ux(Ke,{role:"dialog"}),{getReferenceProps:ze,getFloatingProps:pe}=dx([K,_]),{isMounted:Me,styles:Xe}=et(Ke),Ve=!!(te||$),Ze=Ve?"error":E,qe=C(P,V0,"md"),Ne=C(N,Cr,"lg"),Ye=C(N,Ha,"lg"),be=C(Ze,A0,"primary"),Ae=I==="other"?"":C(Ze,C(I,Va,"outline"),"primary"),rt=!!(ce[0]||ce[1]),Je=je=>{xe||de(je);let Dt=je[0]?At(je[0],me,u):"",Gt=je[1]?At(je[1],me,u):"";o?.(Dt||Gt?[Dt,Gt]:null),Se&&je[0]&&je[1]&&ne(!1)},Tt=je=>{if(ee==="start"){let Dt=Jt(je,ce[0]||new Date),Gt=ce[1];Gt&&Dt&&Dt.getTime()>Gt.getTime()&&(Gt=null),Je([Dt,Gt])}else{let Dt=Jt(je,ce[1]||ce[0]||new Date);Je([ce[0],Dt])}},Ft=je=>{if(je)if(ee==="start"){let Dt=Jt(ce[0]||new Date,je),Gt=ce[1];Gt&&Dt&&Dt.getTime()>Gt.getTime()&&(Gt=null),Je([Dt,Gt])}else{let Dt=Jt(ce[1]||ce[0]||new Date,je);Je([ce[0],Dt])}},nt=je=>{U||B||Z||(je.key==="ArrowDown"||je.key==="Enter"||je.key===" "?(je.preventDefault(),Fe||ne(!0)):je.key==="Escape"&&Fe&&(je.preventDefault(),ne(!1)))},Rt=je=>{je.stopPropagation(),xe||de([null,null]),o?.(null),le?.()},go=H||(V?`${V[0]}${a}${V[1]}`:`${Re}${a}${Re}`),Ie=z==="floating",Oe=z==="left",ut=()=>gt(at,{htmlFor:W,label:M,isRequired:L,isFloating:Ie,size:P,color:Ze,hasError:Ve,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}),Nr=["group/field group/datetimerangepicker relative flex",Oe?"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,Ne,Ae,U?"opacity-50":"",ve?"w-full":qe.minWidth||"min-w-80",Q].filter(Boolean).join(" "),Ko=["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(" "),Uc=ee==="start"?ce[0]:ce[1];return kr("div",{className:Nr,children:[!Ie&&ut(),kr("div",{className:`flex flex-col ${ve?"w-full":""}`,children:[kr("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&&ne(je=>!je),onKeyDown:nt,readOnly:!0,autoComplete:A,placeholder:go,disabled:U||Z,role:"combobox","aria-expanded":Fe&&!Z,"aria-haspopup":"dialog","aria-controls":fe,"aria-required":L,"aria-invalid":Ve,"aria-busy":Z,"aria-disabled":U||Z,"aria-describedby":Y||$?we:void 0,"aria-errormessage":$?we:void 0,className:Ko}),kr("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(De,{}))}),!Z&&ae&&!U&&!B&&gt("button",{type:"button",onClick:Rt,"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(Be,{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(fx,{children:gt(px,{context:Ke,modal:!1,returnFocus:!0,children:kr("div",{ref:Le,id:fe,style:{...He,...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:[kr("div",{className:`flex ${b==="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(wr,{value:Uc,onChange:Tt,view:Ce,onViewChange:Ee,minDate:ee==="end"&&ce[0]||m,maxDate:ee==="start"&&ce[1]||x,isDateDisabled:v,locale:u,firstDayOfWeek:g,showWeekNumbers:ye,size:P,color:E,radius:N,showViewTabs:J,viewTabs:h,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(Zt,{value:Uc||ce[0],onChange:Ft,ariaLabel:ee==="start"?`${s} time`:`${l} time`,use12Hours:k,showSeconds:T,hourStep:y,minuteStep:d,secondStep:c,minTime:ee==="end"&&ce[0]||f,maxTime:ee==="start"&&ce[1]||p,disabledHours:S,disabledMinutes:R,disabledSeconds:D,size:P,color:E,radius:N,className:"border-none shadow-none bg-transparent"},`timeview-step-${ee}`)})]}),kr("div",{className:"flex items-center justify-between border-t border-neutral-200 bg-neutral-50 px-3 py-2",children:[kr("div",{className:"flex items-center space-x-2",children:[kr("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]}),kr("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:()=>ne(!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 gx}from"react";import mx from"next/image";var O0={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"}},G0={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 vi}from"react/jsx-runtime";function Cn({preset:e="default",...t}){switch(e){case"search":return vi(_s,{...t});case"error":return vi(Xs,{...t});case"folder":return vi(qs,{...t});case"simple":return vi(Zs,{...t});default:return vi(Ks,{...t})}}var U0=["default","search","error","folder","simple"];function tc(e){return typeof e=="string"&&U0.includes(e)}function rc(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 oc(e){if(!e)return{};let t=typeof e=="number"?`${e}px`:e;return{width:t,height:t}}import{jsx as lo,jsxs as j0}from"react/jsx-runtime";function Eo({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:b="",actions:u,actionsClassName:w="",children:g,className:m="",role:x="status",ref:v,...h}){let k=C(e,O0,"md"),T=C(t,G0,"vertical"),y=oc(o),d=()=>{if(!r)return null;if(tc(r))return lo(Cn,{preset:r});if(rc(r)){let P=typeof o=="number"?o:k.defaultImageSize;return lo(mx,{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 gx(r)?r:lo(Cn,{preset:"default"})},c=["flex items-center justify-center shrink-0",o?"":k.imageWrapper,n].filter(Boolean).join(" "),f=["w-full transition-all",T.container,k.container,k.gap,m].filter(Boolean).join(" "),p=[T.content,k.contentGap].filter(Boolean).join(" "),S=[k.title,s].filter(Boolean).join(" "),R=[k.description,b].filter(Boolean).join(" "),D=["flex flex-wrap items-center gap-2",k.actionsGap,t==="vertical"?"justify-center":"justify-start",w].filter(Boolean).join(" ");return j0("div",{ref:v,role:x,"aria-live":"polite",className:f,...h,children:[r&&lo("div",{className:c,style:y,"aria-hidden":"true",children:d()}),(a||l||u||g)&&j0("div",{className:p,children:[a&&lo("div",{className:S,children:a}),l&&lo("div",{className:R,children:l}),u&&lo("div",{className:D,children:u}),g&&lo("div",{className:"mt-2 w-full",children:g})]})]})}import{useState as es,useMemo as Ux,useCallback as af,useId as jx}from"react";import{useRef as hx}from"react";var kn={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"}},Sn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},yi={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Y0={none:"none",sm:"sm",md:"md",lg:"lg",xl:"xl",full:"full"},Tn={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"}},W0={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"},K0={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 Rn,jsxs as _0}from"react/jsx-runtime";function bx({id:e,isOpen:t,disabled:r=!1,isLoading:o=!1,showClear:n=!1,onClear:i,startContent:a,endContent:s,triggerRef:l,getReferenceProps:b,onClick:u,roundedClass:w,currentSize:g,variantStyle:m,className:x="",children:v}){let h=r?"opacity-60 cursor-not-allowed bg-neutral-100 pointer-events-none":"cursor-pointer";return _0("div",{ref:l,role:"combobox","aria-expanded":t,"aria-haspopup":"listbox","aria-controls":e?`${e}-listbox`:void 0,tabIndex:r?-1:0,onClick:u,"aria-busy":o,"aria-disabled":r||o,...b({id:e,className:`group relative flex items-center justify-between transition-all duration-150 ease-in-out border-2 select-none ${w} ${g.trigger} ${g.gap} ${m} ${h} ${x}`,"aria-expanded":t,"aria-haspopup":"listbox"}),children:[a&&Rn("span",{className:"shrink-0 inline-flex items-center text-neutral-400",children:a}),v,_0("div",{className:"shrink-0 flex items-center gap-1.5 ml-1 text-neutral-400",children:[o&&Rn(De,{className:`${g.icon} animate-spin text-current`}),n&&!o&&Rn("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:Rn(Be,{className:"size-3.5"})}),s,Rn("span",{className:`transition-transform duration-200 ${t?"rotate-180":""}`,"aria-hidden":"true",children:Rn(lt,{className:g.icon})})]})]})}var qa=bx;import{jsx as $o}from"react/jsx-runtime";function xx({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:b=!1,isInvalid:u=!1,searchable:w=!1,searchPlacement:g="trigger",searchValue:m="",onSearchChange:x,onClear:v,clearable:h=!1,isLoading:k=!1,startContent:T,endContent:y,renderValue:d,triggerRef:c,getReferenceProps:f,onKeyDown:p,className:S=""}){let R=hx(null),D=C(o,kn,"md"),P=C(a,Sn,"md"),E=!!u?"error":i,N=n==="other"?"":Tn[n]?.[E]||Tn.outline.primary,M=w&&(g==="trigger"||g==="both"),z=t!=null,H=h&&(z||m.length>0)&&!l&&!b;return $o(qa,{id:e,isOpen:r,disabled:l,isLoading:k,showClear:H,onClear:v,startContent:T,endContent:y,triggerRef:c,getReferenceProps:f,onClick:()=>{!l&&!b&&!k&&M&&R.current?.focus()},roundedClass:P,currentSize:D,variantStyle:N,className:S,children:d&&z&&t?$o("div",{className:"flex-1 min-w-0 truncate text-neutral-900",children:d(t)}):M&&!l&&!b&&!k?$o("div",{className:"relative flex-1 min-w-0 flex items-center",children:$o("input",{ref:R,type:"text","aria-label":"Search",value:m,placeholder:t?t.label:s,onChange:$=>x?.($.target.value),onKeyDown:p,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"} ${D.input}`})}):$o("div",{className:"flex-1 min-w-0 truncate",children:t?$o("span",{className:"text-neutral-900",children:t.label}):$o("span",{className:"text-neutral-400",children:s})})})}var Dn=xx;import{FloatingPortal as Rx}from"@floating-ui/react";import{jsx as Nn,jsxs as nc}from"react/jsx-runtime";function vx({option:e,isSelected:t,isActive:r,size:o="md",color:n="primary",radius:i="md",disabled:a=!1,renderOption:s,onClick:l,onMouseEnter:b,ref:u}){let w=C(o,kn,"md"),g=C(i,Sn,"md"),m=a||e.disabled;if(s)return Nn("div",{ref:u,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:b,children:s(e,{selected:t,active:r})});let x=t?C(n,W0,"primary"):"text-neutral-800 hover:bg-neutral-100",v=r&&!t?C(n,K0,"primary"):"";return nc("div",{ref:u,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 ${g} ${w.option} ${x} ${v} ${m?"opacity-40 cursor-not-allowed pointer-events-none":""}`,onClick:m?void 0:l,onMouseEnter:m?void 0:b,children:[nc("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.icon&&Nn("span",{className:"shrink-0 inline-flex items-center text-neutral-400",children:e.icon}),nc("div",{className:"flex flex-col min-w-0 flex-1",children:[Nn("span",{className:"truncate leading-normal font-normal",children:e.label}),e.description&&Nn("span",{className:"text-[11px] text-neutral-500 truncate font-normal",children:e.description})]})]}),t&&Nn("span",{className:"shrink-0 flex items-center justify-center text-current","aria-hidden":"true",children:Nn(Ur,{className:"size-3.5"})})]})}var Za=vx;import{useState as lc,useRef as yx,useEffect as wx,useMemo as Cx}from"react";import{useFloating as X0,autoUpdate as q0,offset as Z0,flip as J0,shift as Q0,useClick as ef,useDismiss as tf,useInteractions as rf,FloatingPortal as of}from"@floating-ui/react";function wi(e){let t=new Map;return e.forEach(r=>{t.set(r.value,r)}),t}function ic(e,t,r){return e==null?null:t.find(o=>o.value===e)||r?.get(e)||{value:e,label:String(e)}}function Ja(e,t,r){return e.map(o=>t.find(n=>n.value===o)||r?.get(o)||{value:o,label:String(o)})}function ac(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 sc(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 Tx,jsx as tt,jsxs as er}from"react/jsx-runtime";function kx({field:e,currentValue:t,isOpen:r,onOpenChange:o,onRemove:n,onChange:i,color:a,radius:s}){let{refs:{setFloating:l,setReference:b},floatingStyles:u,context:w}=X0({open:r,onOpenChange:o,placement:"bottom-start",transform:!1,middleware:[Z0(6),J0(),Q0({padding:8})],whileElementsMounted:q0}),{isMounted:g,styles:m}=et(w),x=C(s,yi,"md"),v=ef(w),h=tf(w,{outsidePress:p=>!p.target?.closest?.("[data-select-filter-popover]")}),{getReferenceProps:k,getFloatingProps:T}=rf([v,h]),y=yx(null);wx(()=>{r&&y.current?.focus({preventScroll:!0})},[r]);let d=t!=null&&t!==""&&(!Array.isArray(t)||t.length>0),c=sc(e,t),f=()=>{if(e.type==="custom")return e.render?.({value:t,onChange:p=>i(e.name,p)})??null;switch(e.type){case"string":case"text":return tt(Ct,{ref:y,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Nh\u1EADp t\u1EEB kh\xF3a...",value:t||"",onChange:p=>i(e.name,p.target.value),...e.props||{}});case"number":return tt(bo,{ref:y,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Nh\u1EADp s\u1ED1...",value:t??"",onChange:p=>{let S=p.target.value;if(S==="")i(e.name,"");else{let R=Or(S);i(e.name,R!==void 0?R:S)}},onClear:()=>i(e.name,""),...e.props||{}});case"date":return tt(Po,{portal:!1,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Ch\u1ECDn ng\xE0y",value:t,onChange:p=>i(e.name,p),...e.props||{}});case"date-range":return tt(zo,{portal:!1,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Ch\u1ECDn kho\u1EA3ng ng\xE0y",value:t||[null,null],onChange:p=>i(e.name,p),...e.props||{}});case"checkbox-group":return tt(wo,{size:"sm",color:a,value:t||[],onChange:p=>i(e.name,p),options:(e.options||[]).map(p=>({value:String(p.value),label:p.label,disabled:p.disabled})),className:"max-h-48 overflow-y-auto py-1 gap-2",...e.props||{}});default:return null}};return er(Tx,{children:[tt("div",{ref:b,...k({className:"inline-flex items-center"}),children:er($t,{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:[er("span",{className:"font-semibold",children:[e.label,":"]}),tt("span",{className:d?"font-medium":"opacity-70 italic",children:c})]})}),g&&tt(of,{children:er("div",{ref:l,"data-select-filter-popover":"true",style:{...u,...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:[er("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:()=>o(!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(Be,{className:"size-3.5"})})]}),tt("div",{className:"mt-1",children:f()}),er("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:n,className:"text-[11px] text-red-500 hover:text-red-700 transition-colors",children:"X\xF3a b\u1ED9 l\u1ECDc"}),tt("button",{type:"button",onClick:()=>o(!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 Sx({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,b]=lc(()=>{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}),[u,w]=lc(null),[g,m]=lc(!1),{refs:{setFloating:x,setReference:v},floatingStyles:h,context:k}=X0({open:g,onOpenChange:m,placement:"bottom-start",transform:!1,middleware:[Z0(6),J0(),Q0({padding:8})],whileElementsMounted:q0}),{isMounted:T,styles:y}=et(k,{duration:120}),d=ef(k),c=tf(k,{outsidePress:N=>!N.target?.closest?.("[data-select-filter-popover]")}),{getReferenceProps:f,getFloatingProps:p}=rf([d,c]),S=N=>{l.includes(N.name)||b(M=>[...M,N.name]),m(!1),w(N.name)},R=N=>{b(M=>M.filter(z=>z!==N)),u===N&&w(null),r(N,void 0)},D=N=>{N.stopPropagation(),b([]),w(null),o?.()},P=Cx(()=>new Set(l),[l]),I=l.length>0,E=C(s,yi,"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:er("div",{className:"flex flex-wrap items-center gap-1.5 min-h-7",children:[er("div",{className:"inline-flex",children:[er("button",{ref:v,type:"button",...f({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(gr,{className:"size-3.5 text-neutral-500"}),tt("span",{children:"B\u1ED9 l\u1ECDc"}),tt(lt,{className:`size-3 text-neutral-400 transition-transform ${g?"rotate-180":""}`})]}),T&&tt(of,{children:er("div",{ref:x,"data-select-filter-popover":"true",style:{...h,...y,zIndex:Qe.SELECT_FILTER},...p({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 er("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(kx,{field:M,currentValue:z,isOpen:u===N,onOpenChange:H=>w(H?N:null),onRemove:()=>R(N),onChange:r,color:a,radius:s},N)}),n&&o&&I&&er("button",{type:"button",onClick:D,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 Qa=Sx;import{Fragment as Px,jsx as co,jsxs as cc}from"react/jsx-runtime";var Dx={};function Nx({isOpen:e,isMounted:t,animated:r=!0,transitionStyles:o,options:n,selectedValues:i,activeIndex:a,size:s="md",color:l="primary",radius:b="md",isLoading:u=!1,portal:w=!0,maxMenuHeight:g=280,emptyText:m,emptyProps:x,menuHeader:v,menuFooter:h,listFooter:k,menuFilters:T,menuFilterValues:y=Dx,menuFilterLayout:d="vertical",menuFilterGridCols:c=2,showResetFilters:f=!0,resetFiltersText:p,onMenuFilterChange:S,onResetFilters:R,renderOption:D,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(b,yi,"md"),$=cc("div",{ref:N,"data-state":e?"open":"closed",style:{...E,...r?o:{},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:[v,T&&T.length>0&&S&&co(Qa,{filters:T,values:y,onChange:S,onReset:R,layout:d,gridCols:c,showReset:f,resetText:p,color:l,radius:b}),co("div",{role:"listbox",tabIndex:-1,style:{maxHeight:typeof g=="number"?`${g}px`:g},className:`p-1 overflow-y-auto overflow-x-hidden space-y-0.5 transition-opacity duration-150 ui-scrollbar ${u?"opacity-75":"opacity-100"}`,children:n.length===0?u?cc("div",{className:"flex items-center justify-center py-6 gap-2 text-zinc-500 dark:text-zinc-400 text-sm",children:[co(De,{className:"size-4 animate-spin text-current"}),co("span",{children:"Loading..."})]}):co("div",{className:"py-4 px-2",children:co(Eo,{size:"sm",image:"search",description:m||"No data found",className:"py-2",...x})}):cc(Px,{children:[(()=>{let F=new Set(i);return n.map((G,A)=>{let U=F.has(G.value);return co(Za,{ref:X=>{z.current[A]=X},option:G,isSelected:U,isActive:a===A,size:s,color:l,radius:b,disabled:G.disabled,renderOption:D,onClick:()=>P(G),onMouseEnter:()=>I(A)},String(G.value))})})(),k]})}),h]});return w?co(Rx,{children:$}):$}var Pn=Nx;import{useRef as zx}from"react";import{useFloating as Ix,autoUpdate as Mx,offset as Fx,flip as Ex,shift as $x,useClick as Lx,useDismiss as Bx,useRole as Hx,useListNavigation as Vx,useInteractions as Ax}from"@floating-ui/react";function Ci({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:b}){let u=zx([]),w=!o&&!n,{refs:g,floatingStyles:m,context:x}=Ix({placement:e,open:t&&w,onOpenChange:p=>{w&&(!i||t||!p)&&r(p)},whileElementsMounted:Mx,transform:!1,middleware:[Fx(4),Ex(),$x({padding:8})]}),v=Lx(x,{enabled:w&&(!i||t)}),h=Bx(x,{outsidePress:p=>!p.target?.closest?.("[data-select-filter-popover]")}),k=Hx(x,{role:"listbox"}),T=Vx(x,{listRef:u,activeIndex:l,onNavigate:b,loop:!0}),{getReferenceProps:y,getFloatingProps:d}=Ax([v,h,k,T]),{isMounted:c,styles:f}=et(x,{duration:s,animated:a});return{refs:g,floatingStyles:m,transitionStyles:f,isMounted:c,context:x,getReferenceProps:y,getFloatingProps:d,elementsRef:u}}import{useState as nf,useMemo as Ox}from"react";var Gx=[];function ki({options:e,searchMode:t="client",controlledSearchValue:r,onSearchChange:o,searchField:n=["label","value"],menuFilters:i,controlledFilterValues:a,onMenuFilterChange:s,onSearch:l,debounceMs:b=300,filterFn:u,isOpen:w,setIsOpen:g,preserveSelected:m=!1,selectedValues:x=Gx,historicalOptions:v}){let[h,k]=nf(""),T=r!==void 0,y=T?r:h,[d,c]=nf(()=>{let N={};return i?.forEach(M=>{M.defaultValue!==void 0&&(N[M.name]=M.defaultValue)}),N}),f=a??d,{debounced:p,cancel:S}=vo((N,M)=>{t==="server"&&l?.(N,M)},b),R=N=>{T||k(N),o?.(N),w||g(!0),p(N,f)},D=()=>{S(),T||k(""),o?.(""),t==="server"&&l?.("",f)},P=(N,M)=>{let z={...f,[N]:M};a||c(z),s?.(z),p(y,z)},I=()=>{let N={};i?.forEach(M=>{M.defaultValue!==void 0&&(N[M.name]=M.defaultValue)}),a||c(N),s?.(N),p(y,N)},E=Ox(()=>{if(t==="server")return e;let N=e,M=y.trim();if(M?u?N=N.filter(z=>u(z,y,f)):N=mo(N,M,n):u&&(N=N.filter(z=>u(z,y,f))),m&&M&&x.length>0&&v){let z=new Set(N.map(V=>V.value)),H=[];for(let V of x)if(!z.has(V)){let Y=v.get(V);Y&&H.push(Y)}H.length>0&&(N=[...H,...N])}return N},[e,t,y,u,f,n,m,x,v]);return{searchInput:y,handleSearchChange:R,resetSearch:D,currentFilters:f,handleFilterChange:P,handleResetFilters:I,filteredOptions:E}}import{jsx as Si,jsxs as sf}from"react/jsx-runtime";var Yx=[];function Ti({ref:e,options:t=Yx,value:r,defaultValue:o,onChange:n,size:i="md",variant:a="outline",color:s="primary",radius:l="md",id:b,label:u,labelPlacement:w="top",placeholder:g="Ch\u1ECDn...",helperText:m,errorMessage:x,isInvalid:v,isDisabled:h=!1,readOnly:k=!1,isRequired:T=!1,name:y,searchable:d=!1,searchMode:c="client",searchPlacement:f="trigger",searchPlaceholder:p,searchField:S=["label","value"],searchValue:R,onSearchChange:D,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:oe=!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=!!(v??!!x),J=r!==void 0,[O,W]=es(o??null),we=J?r??null:O,[fe,se]=es(()=>wi(t)),me=Ux(()=>ic(we,t,fe),[we,t,fe]),[Re,xe]=es(!1),[re,de]=es(null),{searchInput:ce,handleSearchChange:ee,resetSearch:j,currentFilters:Ce,handleFilterChange:Ee,handleResetFilters:Fe,filteredOptions:ne}=ki({options:t,searchMode:c,controlledSearchValue:R,onSearchChange:D,searchField:S,menuFilters:P,controlledFilterValues:I,onMenuFilterChange:H,onSearch:F,debounceMs:G,filterFn:A,isOpen:Re,setIsOpen:xe}),{refs:Te,floatingStyles:Pe,transitionStyles:_e,isMounted:Ue,getReferenceProps:Le,getFloatingProps:He,elementsRef:Ke}=Ci({placement:ue,isOpen:Re,onOpenChange:Ne=>{xe(Ne),Ne||(de(null),j())},disabled:h,readOnly:k,isLoading:U,animated:Q,animationDuration:q,activeIndex:re,onNavigate:de}),K=af(Ne=>{Ne.disabled||h||k||(se(Ye=>{if(Ye.has(Ne.value))return Ye;let be=new Map(Ye);return be.set(Ne.value,Ne),be}),J||W(Ne.value),n?.(Ne.value,Ne),xe(!1),j())},[h,k,J,n,j]),_=af(Ne=>{Ne.stopPropagation(),!(h||k)&&(J||W(null),n?.(null,null),j())},[h,k,J,n,j]),ze=Ne=>{if(Ne.key==="Enter"&&Re&&re!==null){Ne.preventDefault();let Ye=ne[re];Ye&&K(Ye)}else Ne.key==="ArrowDown"&&!Re&&xe(!0)},pe=w==="floating",Me=w==="left",Xe=jx(),Ve=b||Xe,Ze=`${Ve}-trigger`,qe=()=>Si(at,{htmlFor:Ze,label:u,isRequired:T,isFloating:pe,size:i,color:s,hasError:ye,cursor:"pointer",className:ve});return sf("div",{ref:e,id:b,className:`group/field flex ${Me?"flex-row items-center gap-3":"flex-col"} ${pe?"pt-2":""} ${Z}`,"data-disabled":h,"data-invalid":ye,...Se,children:[!pe&&qe(),sf("div",{className:"relative flex-1 min-w-0",children:[pe&&qe(),Si(Dn,{id:Ze,triggerRef:Te.setReference,getReferenceProps:Le,selectedOption:me,isOpen:Re,size:i,variant:a,color:s,radius:l,placeholder:p||g,disabled:h,readOnly:k,isInvalid:ye,searchable:d,searchPlacement:f,searchValue:ce,onSearchChange:ee,onClear:_,clearable:le,isLoading:U,startContent:ge,endContent:ke,renderValue:L,onKeyDown:ze,className:he}),Si(Pn,{isOpen:Re,isMounted:Ue,animated:Q,transitionStyles:_e,options:ne,selectedValues:we!=null?[we]:[],activeIndex:re,size:i,color:s,radius:l,isLoading:U,portal:oe,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:He,listElementsRef:Ke,className:ae})]}),y&&we!==null&&we!==void 0&&Si("input",{type:"hidden",name:y,value:String(we)}),Si($e,{id:`${Ve}-helper`,errorMessage:x,helperText:m})]})}var lf=Ti;import{useState as rs,useMemo as _x,useCallback as uc,useId as Xx}from"react";import{useRef as Wx}from"react";import{jsx as zn,jsxs as cf}from"react/jsx-runtime";function Kx({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:b=!1,isInvalid:u=!1,maxTagCount:w,searchable:g=!1,searchPlacement:m="trigger",searchValue:x="",onSearchChange:v,onRemoveTag:h,onClear:k,clearable:T=!1,isLoading:y=!1,startContent:d,endContent:c,renderValue:f,triggerRef:p,getReferenceProps:S,onKeyDown:R,className:D=""}){let P=Wx(null),I=C(o,kn,"md"),E=C(a,Sn,"md"),N=C(a,Y0,"md"),z=!!u?"error":i,H=n==="other"?"":Tn[n]?.[z]||Tn.outline.primary,V=g&&(m==="trigger"||m==="both"),Y=t.length>0,$=T&&(Y||x.length>0)&&!l&&!b,{visibleTags:F,hiddenTagCount:G}=ac(t,w);return zn(qa,{id:e,isOpen:r,disabled:l,isLoading:y,showClear:$,onClear:k,startContent:d,endContent:c,triggerRef:p,getReferenceProps:S,onClick:()=>{!l&&!b&&!y&&V&&P.current?.focus()},roundedClass:E,currentSize:I,variantStyle:H,className:D,children:f&&Y?zn("div",{className:"flex-1 min-w-0 truncate text-neutral-900",children:f(t)}):cf("div",{className:"flex flex-wrap items-center gap-1 flex-1 min-w-0",children:[F.map(B=>zn($t,{size:I.badgeSize,variant:"soft",color:i,radius:N,onDelete:!l&&!b&&!y&&h?()=>h(B):void 0,className:"max-w-full truncate",children:zn("span",{className:"truncate",children:B.label})},String(B.value))),G>0&&cf($t,{size:I.badgeSize,variant:"soft",color:"neutral",radius:N,children:["+",G]}),V&&!l&&!b&&!y?zn("input",{ref:P,type:"text","aria-label":"Search",value:x,placeholder:Y?"":s,onChange:B=>v?.(B.target.value),onKeyDown:R,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:zn("span",{className:"text-neutral-400 truncate",children:s})]})})}var ts=Kx;import{jsx as Ri,jsxs as df}from"react/jsx-runtime";var qx=[],uf=[];function Zx({ref:e,options:t=qx,value:r,defaultValue:o,onChange:n,size:i="md",variant:a="outline",color:s="primary",radius:l="md",id:b,label:u,labelPlacement:w="top",placeholder:g="Ch\u1ECDn...",helperText:m,errorMessage:x,isInvalid:v,isDisabled:h=!1,readOnly:k=!1,isRequired:T=!1,name:y,maxTagCount:d,searchable:c=!1,searchMode:f="client",searchPlacement:p="trigger",searchPlaceholder:S,searchField:R=["label","value"],preserveSelected:D=!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:oe,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=!!(v??!!x),W=r!==void 0,[we,fe]=rs(o??uf),se=W?r??uf:we,[me,Re]=rs(()=>wi(t)),xe=_x(()=>Ja(se,t,me),[se,t,me]),[re,de]=rs(!1),[ce,ee]=rs(null),{searchInput:j,handleSearchChange:Ce,resetSearch:Ee,currentFilters:Fe,handleFilterChange:ne,handleResetFilters:Te,filteredOptions:Pe}=ki({options:t,searchMode:f,controlledSearchValue:P,onSearchChange:I,searchField:R,menuFilters:E,controlledFilterValues:N,onMenuFilterChange:Y,onSearch:A,debounceMs:U,filterFn:B,isOpen:re,setIsOpen:de,preserveSelected:D,selectedValues:se,historicalOptions:me}),{refs:_e,floatingStyles:Ue,transitionStyles:Le,isMounted:He,getReferenceProps:Ke,getFloatingProps:K,elementsRef:_}=Ci({placement:Q,isOpen:re,onOpenChange:Ae=>{de(Ae),Ae||ee(null)},disabled:h,readOnly:k,isLoading:X,animated:ge,animationDuration:ke,activeIndex:ce,onNavigate:ee}),ze=uc(Ae=>{if(Ae.disabled||h||k)return;Re(Ft=>{if(Ft.has(Ae.value))return Ft;let nt=new Map(Ft);return nt.set(Ae.value,Ae),nt});let Je=se.includes(Ae.value)?se.filter(Ft=>Ft!==Ae.value):[...se,Ae.value];W||fe(Je);let Tt=Ja(Je,t,me);n?.(Je,Tt),Ee()},[h,k,se,W,t,n,Ee,me]),pe=uc(Ae=>{if(h||k)return;let rt=se.filter(Tt=>Tt!==Ae.value);W||fe(rt);let Je=rt.map(Tt=>t.find(Ft=>Ft.value===Tt)||me.get(Tt)||{value:Tt,label:String(Tt)});n?.(rt,Je)},[h,k,se,W,t,n,me]),Me=uc(Ae=>{Ae.stopPropagation(),!(h||k)&&(W||fe([]),n?.([],[]),Ee())},[h,k,W,n,Ee]),Xe=Ae=>{let rt=Ae.currentTarget?.value??j;if(Ae.key==="Backspace"&&(!rt||rt.length===0)&&xe.length>0){Ae.preventDefault();let Je=xe[xe.length-1];Je&&pe(Je)}else if(Ae.key==="Enter"&&re&&ce!==null){Ae.preventDefault();let Je=Pe[ce];Je&&ze(Je)}else Ae.key==="ArrowDown"&&!re&&de(!0)},Ve=w==="floating",Ze=w==="left",qe=Xx(),Ne=b||qe,Ye=`${Ne}-trigger`,be=()=>Ri(at,{htmlFor:Ye,label:u,isRequired:T,isFloating:Ve,size:i,color:s,hasError:O,cursor:"pointer",className:ye});return df("div",{ref:e,id:b,className:`group/field flex ${Ze?"flex-row items-center gap-3":"flex-col"} ${Ve?"pt-2":""} ${ae}`,"data-disabled":h,"data-invalid":O,...J,children:[!Ve&&be(),df("div",{className:"relative flex-1 min-w-0",children:[Ve&&be(),Ri(ts,{id:Ye,triggerRef:_e.setReference,getReferenceProps:Ke,selectedOptions:xe,isOpen:re,size:i,variant:a,color:s,radius:l,placeholder:S||g,disabled:h,readOnly:k,isInvalid:O,maxTagCount:d,searchable:c,searchPlacement:p,searchValue:j,onSearchChange:Ce,onRemoveTag:pe,onClear:Me,clearable:ue,isLoading:X,startContent:L,endContent:te,renderValue:Z,onKeyDown:Xe,className:ve}),Ri(Pn,{isOpen:re,isMounted:He,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:oe,menuHeader:$,menuFooter:F,listFooter:G,menuFilters:E,menuFilterValues:Fe,menuFilterLayout:M,menuFilterGridCols:z,showResetFilters:H,resetFiltersText:V,onMenuFilterChange:ne,onResetFilters:Te,renderOption:he,onSelectOption:ze,onOptionMouseEnter:ee,floatingRef:_e.setFloating,floatingStyles:Ue,getFloatingProps:K,listElementsRef:_,className:Se})]}),y&&se.map((Ae,rt)=>Ri("input",{type:"hidden",name:`${y}[]`,value:String(Ae)},`${y}-${Ae}-${rt}`)),Ri($e,{id:`${Ne}-helper`,errorMessage:x,helperText:m})]})}var ff=Zx;import{useEffect as Jx,useState as Qx}from"react";function ev(e,t=300){let[r,o]=Qx(e);return Jx(()=>{let n=setTimeout(()=>{o(e)},t);return()=>{clearTimeout(n)}},[e,t]),r}import{useId as kv,useMemo as Pf,useState as bs}from"react";import{useDropzone as Sv}from"react-dropzone";var os={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},pf={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"},gf={xs:"h-28",sm:"h-36",md:"h-48",lg:"h-60",xl:"h-72"},In={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"}},mf={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 Sr(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 Lo(e){return e?Array.isArray(e)?e.filter(t=>!!t):[e]:[]}var ns={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},bf={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"},hf={xs:"h-28",sm:"h-36",md:"h-48",lg:"h-60",xl:"h-72"},Tr={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"}},xf={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"}}},vf={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:[]},yf={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 is=["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","avif"],as=["pdf"],ss=["mp4","webm","ogg","mov","avi","mkv"],ls=["mp3","wav","ogg","aac","flac","m4a"],cs=["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 Di(e=""){let t=e.split("?")[0]?.split("#")[0]||"",r=t.lastIndexOf(".");return r===-1?"":t.slice(r+1).toLowerCase()}function Mn(e=""){let t=Di(e);return is.includes(t)?"image":as.includes(t)?"pdf":ss.includes(t)?"video":ls.includes(t)?"audio":cs.includes(t)?"document":"other"}function dc(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 $r(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:Mn(e),file:void 0,serverFile:{src:e,name:o}}}if(e instanceof File)return{name:ct(e.name),type:Mn(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=Mn(e.name)),r==="other"&&e?.src&&(r=Mn(e.src)),{name:t,type:r,file:void 0,serverFile:e}}function Rr(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 fc(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 pc(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 us(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=Di(t);if(o){for(let[n,i]of Object.entries(vf))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 wf(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 Ni(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 iv,useState as av}from"react";import{createContext as tv,useContext as rv}from"react";var gc=tv(null),ds=()=>rv(gc);import{useState as fs}from"react";import ov from"react-easy-crop";import{jsx as kt,jsxs as Cf}from"react/jsx-runtime";function Pi({zoom:e=1,minZoom:t=.2,maxZoom:r=5,step:o=.05,onZoomChange:n,sliderProps:i,onZoomIn:a,onZoomOut:s,onRotateCw:l,onRotateCcw:b,onFlipHorizontal:u,onReset:w,currentImage:g,tools:m,className:x=""}){let{zoomIn:v=!0,zoomOut:h=!0,zoomSlider:k=!0,reset:T=!0,rotate:y=!0,flip:d=!0,download:c=!0}=m??{},f=Math.round(e*100),p=()=>{g?.src&&Rr(g.src,g.name)},S=D=>{if(typeof D=="number"){let P=Math.round(D*100)/100;n?.(P)}},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 Cf("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:[h&&kt("button",{type:"button","aria-label":"Thu nh\u1ECF",title:"Thu nh\u1ECF (-)",disabled:e<=t,onClick:s,className:R,children:kt(on,{width:18,height:18})}),k&&kt("div",{className:"flex items-center px-1","data-testid":"image-preview-zoom-slider",children:kt(qn,{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:S,"aria-label":"Thanh tr\u01B0\u1EE3t thu ph\xF3ng",...i})}),v&&kt("button",{type:"button","aria-label":"Ph\xF3ng to",title:"Ph\xF3ng to (+)",disabled:e>=r,onClick:a,className:R,children:kt(rn,{width:18,height:18})}),T&&Cf("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:[f,"%"]}),(y||d||c)&&kt("div",{className:"w-px h-4 bg-neutral-200 my-auto mx-1"}),y&&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:b,className:R,children:kt(nn,{width:18,height:18})}),y&&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:R,children:kt(Kr,{width:18,height:18})}),d&&kt("button",{type:"button","aria-label":"L\u1EADt ngang",title:"L\u1EADt ngang",onClick:u,className:R,children:kt(sn,{width:18,height:18})}),c&&kt("button",{type:"button","aria-label":"T\u1EA3i \u1EA3nh xu\u1ED1ng",title:"T\u1EA3i \u1EA3nh xu\u1ED1ng",onClick:p,className:R,children:kt(hr,{width:18,height:18})})]})}import{jsx as ps,jsxs as nv}from"react/jsx-runtime";function zi({src:e,name:t,minZoom:r=.2,maxZoom:o=5,showToolbar:n=!0,toolbarProps:i,children:a}){let[s,l]=fs({x:0,y:0}),[b,u]=fs(1),[w,g]=fs(0),[m,x]=fs(!1),v=()=>u(f=>Math.min(o,Math.round((f+.25)*100)/100)),h=()=>u(f=>Math.max(r,Math.round((f-.25)*100)/100)),k=()=>g(f=>(f+90)%360),T=()=>g(f=>(f-90+360)%360),y=()=>x(f=>!f),d=()=>{l({x:0,y:0}),u(1),g(0),x(!1)},c={src:e,name:t};return e?nv("div",{className:"flex flex-col w-full select-none overflow-hidden",children:[ps("div",{className:"relative w-full h-90 sm:h-105 md:h-115 overflow-hidden bg-neutral-50/70 select-none",children:ps(ov,{image:e,crop:s,zoom:b,rotation:w,minZoom:r,maxZoom:o,zoomSpeed:.5,restrictPosition:!1,showGrid:!1,objectFit:"contain",onCropChange:l,onZoomChange:u,onRotationChange:g,classes:{mediaClassName:m?"scale-x-[-1]":""},style:{containerStyle:{position:"relative",width:"100%",height:"100%",backgroundColor:"transparent"},cropAreaStyle:{display:"none"},mediaStyle:{cursor:"grab"}}})}),n&&ps("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:ps(Pi,{zoom:b,minZoom:r,maxZoom:o,onZoomChange:u,rotation:w,isFlipped:m,onZoomIn:v,onZoomOut:h,onRotateCw:k,onRotateCcw:T,onFlipHorizontal:y,onReset:d,currentImage:c,...i})}),a]}):null}import{jsx as Bo,jsxs as kf}from"react/jsx-runtime";function Lr({onDownload:e,imageProps:t,className:r=""}){let o=ds(),n=o?.file,i=o?.headerTitle,[a,s]=av("");iv(()=>{if(!n){s("");return}if(!(n instanceof File)){let g=$r(n);s(g.serverFile?.src||"");return}let w=URL.createObjectURL(n);return s(w),()=>{URL.revokeObjectURL(w)}},[n]);let l=$r(n),b=(typeof i=="string"?i:"")||l.name||"file",u=()=>{e&&n&&e(n),a&&Rr(a,b)};return l.type==="image"?Bo(zi,{src:a,name:b,...t}):kf("div",{className:`p-6 text-center ${r}`,children:[Bo("div",{className:"w-16 h-16 rounded-2xl bg-neutral-100 flex items-center justify-center mx-auto mb-4 text-primary-600",children:Bo(hr,{width:32,height:32})}),Bo("h3",{className:"text-lg font-semibold text-neutral-900 truncate mb-1",title:b,children:i??b}),Bo("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."}),kf("button",{type:"button",onClick:u,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:[Bo(hr,{width:18,height:18}),Bo("span",{children:"T\u1EA3i xu\u1ED1ng file"})]})]})}import{useMemo as bv}from"react";var Sf=250,uo={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"}},Tf={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"};import{createContext as sv,useContext as lv}from"react";var mc=sv(null),tr=()=>lv(mc);import{jsx as cv}from"react/jsx-runtime";function Ho({size:e,radius:t,className:r="",children:o,ref:n,...i}){let a=tr(),s=C(e??a?.size,uo,"md"),l=C(t,Tf,"lg"),b=["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 cv("div",{ref:n,tabIndex:-1,className:b,...i,children:o})}import{useEffect as gs,useEffectEvent as uv,useCallback as dv,useMemo as fv,useRef as Rf,useState as pv}from"react";import{jsx as bc,jsxs as gv}from"react/jsx-runtime";function Vo({open:e=!1,id:t,size:r,isLoading:o=!1,closeOnOverlayClick:n=!0,closeOnEsc:i=!0,lockScroll:a=!0,overlayClassName:s="",className:l="",children:b,onClose:u,...w}){let g=Rf(null),[m,x]=pv(!1),v=Rf(null),h=dv(()=>{m||o||(x(!0),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{x(!1),u?.()},Sf))},[m,o,u]),k=fv(()=>({onClose:h,isLoading:o,size:r}),[h,o,r]);gs(()=>()=>{v.current&&clearTimeout(v.current)},[]),gs(()=>{let f=g.current;if(f)if(e||m){if(!f.open)try{f.showModal()}catch{}}else f.open&&f.close()},[e,m]),gs(()=>{if(!a)return;let f=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=f}},[a]);let T=uv(f=>{!e||i===!1||f.key==="Escape"&&(f.preventDefault(),f.stopPropagation(),h())});if(gs(()=>(window.addEventListener("keydown",T),()=>{window.removeEventListener("keydown",T)}),[]),!e&&!m)return null;let y=()=>{n&&h()},d=m?"animate-modal-backdrop-out pointer-events-none":"animate-modal-backdrop-in",c=m?"animate-modal-out pointer-events-none":"animate-modal-in";return bc(mc.Provider,{value:k,children:gv("dialog",{id:t,ref:g,"aria-labelledby":"modal-dialog-title","aria-describedby":"modal-dialog-description",onCancel:f=>{f.preventDefault(),i!==!1&&h()},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 ${d} ${s}`,...w,children:[bc("div",{"aria-hidden":"true",onClick:y,className:"fixed inset-0 -z-10"}),bc("div",{className:`w-full flex items-center justify-center pointer-events-none ${c} ${l}`,children:b})]})})}import{jsx as ms,jsxs as Df}from"react/jsx-runtime";function Ao({size:e,title:t,description:r,titleClassName:o="",descriptionClassName:n="",showCloseButton:i=!0,onClose:a,closeButtonClassName:s="",className:l="",children:b,...u}){let w=tr(),g=C(e??w?.size,uo,"md"),m=w?.isLoading,x=()=>{a?.(),w?.onClose?.()},v=!!(a||w?.onClose);return Df("div",{className:`flex items-start justify-between w-full border-b border-neutral-100 pb-2 ${g.header} ${l}`,...u,children:[Df("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}),b]}),i&&v&&ms("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 ${g.closeButton} ${s}`,children:ms(Be,{className:g.closeIcon})})]})}import{jsx as mv}from"react/jsx-runtime";function Oo({size:e,className:t="",children:r,...o}){let n=tr(),i=C(e??n?.size,uo,"md");return mv("div",{className:`w-full max-h-[calc(100vh-8rem)] overflow-y-auto ui-scrollbar ${i.body} ${t}`,...o,children:r})}import{jsx as Ii,jsxs as hv}from"react/jsx-runtime";function ur({open:e=!1,onClose:t,file:r,title:o,description:n,size:i="lg",radius:a="xl",showCloseButton:s=!0,closeOnOverlayClick:l=!0,closeOnEsc:b=!0,lockScroll:u=!0,className:w="",overlayClassName:g="",children:m}){let x=$r(r),v=o??x?.name,h=bv(()=>({file:r,headerTitle:v}),[r,v]);return Ii(Vo,{open:e,onClose:t,size:i,closeOnOverlayClick:l,closeOnEsc:b,lockScroll:u,overlayClassName:g,children:hv(Ho,{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:[(v||s)&&Ii(Ao,{title:v,description:n,showCloseButton:s,className:"px-5 py-3.5 border-b border-neutral-200 shrink-0"}),Ii(Oo,{className:"p-0 overflow-hidden flex flex-col flex-1 min-h-0",children:Ii(gc.Provider,{value:h,children:m||Ii(Lr,{})})})]})})}import{useState as Mi,useEffect as xv,useMemo as vv}from"react";import yv from"next/image";import{Fragment as wv,jsx as Fn,jsxs as Nf}from"react/jsx-runtime";function Br({src:e,alt:t="",width:r,height:o,fill:n,skeletonVariant:i="pulse",radius:a="md",objectFit:s="cover",preview:l=!0,className:b="",wrapperClassName:u="",style:w,wrapperStyle:g,onLoad:m,onError:x,onClick:v,ref:h,...k}){let[T,y]=Mi(!1),[d,c]=Mi(!1),[f,p]=Mi(null),[S,R]=Mi(!1),D=Wc(e),[P,I]=Mi(D),E=typeof Blob<"u"&&(e instanceof File||e instanceof Blob),N=dc(e)?e:void 0,M=N?.src,z=E?f:N?M:e,H=E||!!N||typeof z=="string"&&(/^(?:https?:)?\/\//.test(z)||z.startsWith("data:")||z.startsWith("blob:")),V=t||N?.name||"";D!==P&&(I(D),y(!1),c(!1)),xv(()=>{if(!(e instanceof File||e instanceof Blob)){p(null);return}let oe=URL.createObjectURL(e);return p(oe),()=>URL.revokeObjectURL(oe)},[e]);let Y=vv(()=>{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,jc,"md"),F=C(s,Yc,"cover"),G=oe=>{y(!0),m?.(oe)},A=oe=>{c(!0),y(!1),x?.(oe)},U=oe=>{v?.(oe),!oe.defaultPrevented&&l&&T&&!d&&Y&&R(!0)},B=!!(l&&T&&!d||v),X=oe=>{(oe.key==="Enter"||oe.key===" ")&&(oe.preventDefault(),U(oe))},le={...n?{}:{width:r,height:o},...g};return Nf(wv,{children:[Nf("div",{ref:h,role:B?"button":void 0,tabIndex:B?0:void 0,onClick:U,onKeyDown:X,className:["relative overflow-hidden inline-block",$,B?"cursor-pointer":"",u].filter(Boolean).join(" "),style:le,children:[!T&&!d&&Fn(_o,{variant:i,radius:a,width:"100%",height:"100%",style:{position:"absolute",inset:0}}),z?Fn(yv,{src:z,alt:V,width:n?void 0:r,height:n?void 0:o,fill:n,unoptimized:H?!0:k.unoptimized,className:["block w-full h-full transition-opacity duration-200",F,$,T?"opacity-100":"opacity-0",b].filter(Boolean).join(" "),style:w,onLoad:G,onError:A,...k}):null,d&&Fn("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:Fn(da,{width:24,height:24,"aria-hidden":"true"})})]}),S&&Y&&Fn(ur,{open:S,onClose:()=>R(!1),file:Y,title:V||"Xem \u1EA3nh",children:Fn(Lr,{})})]})}import{Fragment as Cv,jsx as yt,jsxs as En}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:b="idle",isInvalid:u,dropzoneTitle:w,dropzoneDescription:g,icon:m,item:x,onRemove:v,onPreview:h,onTriggerUpload:k,getRootProps:T,className:y="",describedById:d}){let c=C(e,In,"md"),f=C(o,os,"md"),p=n==="square"?"aspect-square w-full":C(e,gf,"md"),S=u?"error":t,R=r!=="other"?C(r,mf,"outline"):null,D=R?C(S,R,"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=b==="active",N=b==="reject",M=E,z=N?"border-error-500 bg-error-50/50 ring-2 ring-error-500/20 text-error-900":M?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=x?`group relative w-full ${p} ${f} 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 ${y}`:`group relative w-full ${n==="square"?"aspect-square w-full":c.dropzoneHeight} ${c.dropzonePadding} ${f} 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 ${y}`,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":u,"aria-describedby":d,"aria-busy":l,className:H,onClick:()=>{a||l||x&&h?.()},onKeyDown:F=>{a||l||(F.key==="Enter"||F.key===" ")&&x&&(F.preventDefault(),h?.())}},$=T?T(Y):Y;return yt("div",{...$,children:x?En(Cv,{children:[yt(Br,{src:x,alt:V,fill:!0,radius:o??"md",objectFit:i,preview:!1,wrapperClassName:"w-full h-full"}),!l&&!a&&En("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(),v?.()},"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(ar,{width:16,height:16})})]}),l&&En("div",{className:"absolute inset-0 bg-neutral-950/60 flex flex-col items-center justify-center text-neutral-white z-20",children:[yt(De,{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&&En("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?En("div",{className:`flex flex-col items-center justify-center gap-2 ${D?.iconColor||"text-primary-600"}`,children:[yt(De,{width:c.iconSize*.8,height:c.iconSize*.8}),yt("span",{className:`${c.titleSize} font-medium`,children:"\u0110ang x\u1EED l\xFD h\xECnh \u1EA3nh..."})]}):En("div",{className:"flex flex-col items-center justify-center gap-2",children:[yt("div",{className:`transition-colors ${D?.iconColor||"text-primary-500"}`,children:m||yt(Nt,{width:c.iconSize,height:c.iconSize})}),yt("div",{className:`${c.titleSize} font-medium text-neutral-800 ${D?.titleHover||"group-hover:text-primary-600"} transition-colors`,children:w??P}),yt("div",{id:d,className:`${c.descSize} text-neutral-500`,children:g??I})]})})}import{jsx as Hr,jsxs as hc}from"react/jsx-runtime";function Go({items:e,size:t,radius:r,objectFit:o="cover",disabled:n,readOnly:i,maxCount:a,onRemove:s,onPreview:l,onTriggerUpload:b,renderItem:u,showAddButton:w=!0,className:g=""}){let m=C(t,In,"md"),x=C(r,os,"md"),v=!a||e.length<a;return hc("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} ${g}`,children:[e.map((h,k)=>{let T=ct(h),y=typeof h=="object"&&h&&"id"in h&&h.id?String(h.id):h instanceof File?`${h.name}-${h.size}-${h.lastModified}`:typeof h=="string"?h:h?.src||T;return u?Hr("li",{"data-testid":"upload-image-item",className:"list-none",children:u(h,k,{remove:()=>s(h,k),preview:()=>l(h)})},y):hc("li",{"data-testid":"upload-image-item",tabIndex:n?-1:0,"aria-label":`H\xECnh \u1EA3nh ${T}`,onKeyDown:d=>{n||i||(d.key==="Delete"||d.key==="Backspace")&&(d.preventDefault(),s(h,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:[Hr(Br,{src:h,alt:T,width:80,height:80,radius:r,objectFit:o,unoptimized:!0,preview:!1,className:"w-full h-full",wrapperClassName:"w-full h-full"}),!n&&hc("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&&Hr("button",{type:"button",onClick:d=>{d.stopPropagation(),l(h)},"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:Hr(Vr,{width:16,height:16})}),!i&&Hr("button",{type:"button",onClick:d=>{d.stopPropagation(),s(h,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:Hr(ar,{width:16,height:16})})]})]},y)}),w&&v&&!i&&Hr("li",{className:"list-none",children:Hr("button",{type:"button",disabled:n,onClick:b,"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:Hr(gr,{width:m.iconSize*.5,height:m.iconSize*.5})})})]})}import{Fragment as Tv,jsx as Ot,jsxs as Ei}from"react/jsx-runtime";function xc({value:e,defaultValue:t,onChange:r,onRemove:o,onPreview:n,multiple:i=!1,maxCount:a,maxSize:s,accept:l="image/*",beforeUpload:b,viewMode:u="dropzone",shape:w="rectangle",objectFit:g,size:m="md",color:x="primary",variant:v="outline",radius:h,label:k,isRequired:T=!1,labelClassName:y="",helperText:d,errorMessage:c,isInvalid:f,disabled:p=!1,readOnly:S=!1,isLoading:R=!1,dropzoneTitle:D,dropzoneDescription:P,icon:I,buttonText:E="T\u1EA3i \u1EA3nh l\xEAn",renderItem:N,className:M="",dropzoneClassName:z="",previewClassName:H="",helperClassName:V=""}){let Y=kv(),$=`${Y}-input`,F=`${Y}-error-helper`,G=e!==void 0,[A,U]=bs(()=>Lo(t)),B=Pf(()=>G?Lo(e):A,[G,e,A]),[X,le]=bs(null),[oe,ue]=bs(null),[ie,Q]=bs(""),q=C(m,In,"md"),ge=h??"md",ke=!!(f||c||X),L=c||X,Z=ke?"text-error-600":C(ke?"error":x,pf,"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=Pf(()=>Ni(l),[l]),J=u==="dropzone"&&!!ve,{getRootProps:O,getInputProps:W,isDragActive:we,isDragReject:fe,open:se}=Sv({multiple:i,maxSize:s,accept:ye,disabled:p||S||R,noClick:u!=="dropzone"||J,noKeyboard:u!=="dropzone"||J,onDropAccepted:async xe=>{if(p||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(b)try{let Ce=await b(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 (${Sr(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(p||S)return;let de=B.filter((ce,ee)=>ee!==re);Se(de),o?.(xe,re),Q(`\u0110\xE3 x\xF3a h\xECnh \u1EA3nh ${ct(xe)}`)},Re=xe=>{ue(xe),n?.(xe)};return Ei("div",{className:`group/field relative flex flex-col w-full ${M}`,children:[Ot("input",{...W({id:$,disabled:p||R,"aria-hidden":!0,tabIndex:-1,className:"hidden"})}),Ot("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:ie}),k&&Ei("label",{htmlFor:$,className:`block font-medium transition-colors duration-150 ${q.labelSize} ${Z} ${y}`,children:[k,T&&Ot("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),Ei("div",{className:"flex flex-col gap-3",children:[u==="dropzone"&&Ei(Tv,{children:[Ot(Fi,{size:m,color:x,variant:v,radius:ge,shape:w,objectFit:g,disabled:p,readOnly:S,isLoading:R,dragStatus:fe?"reject":we?"active":"idle",isInvalid:ke,dropzoneTitle:D,dropzoneDescription:P,icon:I,item:ve,onRemove:()=>ve&&me(ve,0),onPreview:()=>ve&&Re(ve),getRootProps:O,onTriggerUpload:se,className:z,describedById:L||d?F:void 0}),!ae&&B.length>0&&Ot(Go,{items:B,size:m,color:x,variant:v,radius:ge,objectFit:g,disabled:p,readOnly:S,maxCount:he,onRemove:me,onPreview:Re,onTriggerUpload:se,renderItem:N,showAddButton:!1,className:H})]}),u==="card-grid"&&Ot("div",{...O({className:"w-full focus-visible:outline-hidden"}),children:Ot(Go,{items:B,size:m,color:x,variant:v,radius:ge,objectFit:g,disabled:p,readOnly:S,maxCount:he,onRemove:me,onPreview:Re,onTriggerUpload:se,renderItem:N,showAddButton:!0,className:H})}),u==="button"&&Ei("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:v==="other"?"filled":v,radius:h,disabled:p||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(Go,{items:B,size:m,color:x,variant:v,radius:ge,objectFit:g,disabled:p,readOnly:S,maxCount:he,onRemove:me,onPreview:Re,onTriggerUpload:se,renderItem:N,showAddButton:!1,className:H})]})]}),Ot($e,{id:F,helperText:d,errorMessage:ke?L:void 0,sizeClassName:q.helperSize,className:V}),oe&&Ot(ur,{open:!!oe,onClose:()=>ue(null),file:oe})]})}import{useId as Nv,useMemo as Pv,useState as $i}from"react";import{useDropzone as zv}from"react-dropzone";import{useMergeRefs as Iv}from"@floating-ui/react";var zf={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},If={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"}},Mf={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"},Ef={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"},$f={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 Lf(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 Rv,useRef as hs,useState as Uo}from"react";import Dv from"react-easy-crop";function Bf(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 Hf(e){return e*Math.PI/180}function Vf(e,t,r){let o=Hf(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 vc(e,t,r=0,o=!1,n="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 b=Hf(r),u=a.naturalWidth||a.width,w=a.naturalHeight||a.height,{width:g,height:m}=Vf(u,w,r);s.width=g,s.height=m,l.translate(g/2,m/2),l.rotate(b),l.scale(o?-1:1,1),l.translate(-u/2,-w/2),l.drawImage(a,0,0);let x=document.createElement("canvas"),v=x.getContext("2d");if(!v)throw new Error("No 2d context for cropped canvas");return x.width=t.width,x.height=t.height,v.drawImage(s,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise((h,k)=>{x.toBlob(T=>{if(!T){k(new Error("Canvas is empty or failed to generate blob"));return}let y=new File([T],n,{type:i||"image/png"});h(y)},i||"image/png",.95)})}import{jsx as We,jsxs as yc}from"react/jsx-runtime";function wc({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:b,onCancel:u}){let w=hs(null),[g,m]=Uo(t??null),[x,v]=Uo(e),h=hs(t?.name||r),k=hs(t?.type||o),[T,y]=Uo({x:0,y:0}),[d,c]=Uo(1),[f,p]=Uo(0),[S,R]=Uo(!1),D=hs(null),[P,I]=Uo(!1);Rv(()=>{if(!g)return;let B=URL.createObjectURL(g);return v(B),()=>{URL.revokeObjectURL(B)}},[g]);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=()=>p(B=>(B+90)%360),z=()=>p(B=>(B-90+360)%360),H=()=>R(B=>!B),V=()=>{y({x:0,y:0}),c(1),p(0),R(!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];h.current=X.name,k.current=X.type||"image/png",m(X),V()}},F=(B,X)=>{D.current=X},G=async()=>{if(D.current)try{I(!0);let B=await vc(x,D.current,f,S,h.current,k.current);b(B)}catch(B){console.error("Error cropping avatar:",B)}finally{I(!1)}},A=()=>{u?.()},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 yc("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(Dv,{image:x,crop:T,zoom:d,rotation:f,aspect:n,cropShape:i,showGrid:a,minZoom:s,maxZoom:l,onCropChange:y,onZoomChange:c,onRotationChange:p,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:yc("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:d<=s,"aria-label":"Thu nh\u1ECF",title:"Thu nh\u1ECF (-)",className:U,children:We(on,{width:16,height:16})}),We("button",{type:"button",onClick:E,disabled:d>=l,"aria-label":"Ph\xF3ng to",title:"Ph\xF3ng to (+)",className:U,children:We(rn,{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(nn,{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(Kr,{width:16,height:16})}),We("button",{type:"button",onClick:H,title:"L\u1EADt ngang","aria-label":"L\u1EADt ngang",className:U,children:We(sn,{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(Be,{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(De,{width:16,height:16}):We(Ur,{width:16,height:16})})]})})]})}function xs({open:e=!0,modalTitle:t="C\u1EAFt \u1EA3nh \u0111\u1EA1i di\u1EC7n",onClose:r,onCancel:o,onApply:n,...i}){let a=()=>{o?.(),r?.()};return We(Vo,{open:e,closeOnOverlayClick:!0,closeOnEsc:!0,onClose:a,children:yc(Ho,{size:"lg",radius:"xl",className:"bg-neutral-white border border-neutral-200 shadow-2xl overflow-hidden p-0",children:[We(Ao,{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(Oo,{className:"p-0 overflow-hidden",children:We(wc,{...i,onApply:l=>{n(l),r?.()},onCancel:a})})]})})}import{jsx as ft,jsxs as Li}from"react/jsx-runtime";function Cc({size:e="md",variant:t="outline",color:r="primary",shape:o="circle",radius:n,value:i,defaultValue:a,onChange:s,onRemove:l,onPreview:b,onClear:u,maxSize:w,accept:g="image/*",crop:m=!0,label:x,labelPlacement:v="top",config:h,helperText:k,errorMessage:T,disabled:y=!1,readOnly:d=!1,icon:c,name:f,id:p,className:S="",wrapperClassName:R="",avatarClassName:D="",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}=h??{},F=Nv(),G=p||F,A=`${G}-error-helper`,U=i!==void 0,[B,X]=$i(a??null),le=U?i??null:B,oe=$r(le),ue=oe.name,[ie,Q]=$i(null),[q,ge]=$i(!1),[ke,L]=$i(null),[te,Z]=$i(""),he=T||ke,ae=!!(z||he),ve=ae?"error":r,Se=C(e,If,"md"),ye=o==="circle"?"rounded-full":C(n,zf,"md"),J=t==="other"?"":C(ve,C(t,Mf,"outline"),"primary"),O=C(ve,Ff,"primary"),W=ae?"text-error-600 font-bold":C(ve,Ef,"primary"),we=C(ve,$f,"primary"),fe=K=>{U||X(K),s?.(K)},se=m!==!1,me=typeof m=="object"?m:{},Re=K=>{Q({file:K.file,imageSrc:K.imageSrc,fileName:ue||"avatar.png",fileType:oe.type||"image/png"})},xe=K=>{if(K?.stopPropagation(),!(y||d||H)&&le){let _=le;fe(null),l?.(_),u?.(),Z("\u0110\xE3 x\xF3a \u1EA3nh \u0111\u1EA1i di\u1EC7n.")}},re=K=>{K?.stopPropagation(),le&&(ge(!0),b?.(le))},de=K=>{K?.stopPropagation(),le&&(oe.file?Re({file:oe.file}):oe.serverFile?.src&&Re({imageSrc:oe.serverFile.src}))},{getRootProps:ce,getInputProps:ee,isDragActive:j,isDragReject:Ce,inputRef:Ee}=zv({multiple:!1,maxSize:w,accept:Pv(()=>Lf(g),[g]),disabled:y||d||H,onDropAccepted:([K])=>{K&&(L(null),se?Re({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=Iv([Ee,N]),ne=K=>{y||d||H||le&&(K.key==="Delete"||K.key==="Backspace")&&(K.preventDefault(),K.stopPropagation(),xe())},Te=()=>x?Li("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=y?"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,D||P].filter(Boolean).join(" ");return Li("div",{className:`group/field flex ${v==="left"?"flex-row items-center gap-3":"flex-col"} ${$?"w-full":"inline-flex"} ${R||S}`,children:[ft("input",{...ee({id:G,name:f,disabled:y||H,"aria-hidden":!0,tabIndex:-1,className:"hidden"}),ref:Fe}),ft("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:te}),Te(),Li("div",{className:`flex flex-col ${$?"w-full":""}`,children:[Li("div",{...ce({role:"button",tabIndex:y||H?-1:0,"aria-label":"T\u1EA3i l\xEAn \u1EA3nh \u0111\u1EA1i di\u1EC7n","aria-disabled":y||H,"aria-invalid":ae,"aria-required":M,"aria-describedby":T||k||ke?A:void 0,"aria-busy":H,onKeyDown:ne,className:Le}),children:[le?ft(Br,{src:le,alt:ue||"Avatar",fill:!0,radius:o==="circle"?"full":n,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(ma,{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(De,{width:Se.iconSize,height:Se.iconSize,className:"animate-spin"})}),!H&&!y&&le&&Li("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(Vr,{width:14,height:14})}),se&&!d&&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(fa,{width:14,height:14})}),(!d||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(ar,{width:14,height:14})})]})]}),ft($e,{id:A,helperText:k,errorMessage:he,sizeClassName:Se.helper,className:E}),se&&ie&&ft(xs,{open:!!ie,file:ie.file,imageSrc:ie.imageSrc,fileName:ie.fileName,fileType:ie.fileType,aspectRatio:me.aspectRatio??1,cropShape:me.cropShape??(o==="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(ur,{open:q,onClose:()=>ge(!1),file:le,title:ue||"Xem tr\u01B0\u1EDBc \u1EA3nh \u0111\u1EA1i di\u1EC7n",children:ft(Lr,{imageProps:{minZoom:.5,maxZoom:4,toolbarProps:{tools:{rotate:!0,flip:!0,download:!0}}}})})]})]})}import{useId as Fv,useMemo as Gf,useState as ys}from"react";import{useDropzone as Ev}from"react-dropzone";import{jsx as rr,jsxs as vs}from"react/jsx-runtime";function $n({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:b=!1,dragStatus:u="idle",isInvalid:w=!1,dropzoneTitle:g,dropzoneDescription:m,icon:x,onTriggerUpload:v,getRootProps:h,className:k="",describedById:T}){let y=C(e,Tr,"md"),d=C(o,ns,"md"),c=w?"error":t,f=r!=="other"?C(r,xf,"outline"):null,p=f?C(c,f,"primary"):null,S="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=u==="reject"?"border-error-500 bg-error-50/50 ring-2 ring-error-500/20 text-error-900":u==="active"?p?.active||"border-primary-500 bg-primary-50 ring-2 ring-primary-500/20":p?.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(),v?.())};if(i){let H=`group relative w-full ${y.compactMinHeight} ${y.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 ${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=h?h(V):V;return vs("div",{...Y,children:[vs("div",{className:"flex items-center gap-2.5 min-w-0 flex-1",children:[rr("div",{className:`transition-colors shrink-0 ${p?.iconColor||"text-primary-500"}`,children:l&&b?rr(De,{width:18,height:18,className:"animate-spin text-primary-600"}):x||rr(Nt,{width:18,height:18})}),rr("span",{className:`truncate text-neutral-700 font-medium ${y.descSize}`,children:g||"K\xE9o th\u1EA3 ho\u1EB7c nh\u1EA5n \u0111\u1EC3 t\u1EA3i t\u1EC7p l\xEAn"})]}),rr("span",{className:`shrink-0 text-primary-600 group-hover:text-primary-700 font-semibold ${y.descSize}`,children:"Ch\u1ECDn file"})]})}let N=`group relative w-full ${n==="square"?"aspect-square w-full":C(e,hf,"md")} ${y.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 ${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=h?h(M):M;return rr("div",{...z,children:l&&b?vs("div",{className:`flex flex-col items-center justify-center gap-2 ${p?.iconColor||"text-primary-600"}`,children:[rr(De,{width:y.iconSize*.8,height:y.iconSize*.8}),rr("span",{className:`${y.titleSize} font-medium`,children:"\u0110ang x\u1EED l\xFD t\u1EC7p tin..."})]}):vs("div",{className:"flex flex-col items-center justify-center gap-2",children:[rr("div",{className:`transition-colors ${p?.iconColor||"text-primary-500"}`,children:x||rr(Nt,{width:y.iconSize,height:y.iconSize})}),rr("div",{className:`${y.titleSize} font-medium text-neutral-800 ${p?.titleHover||"group-hover:text-primary-600"} transition-colors`,children:l?"\u0110ang x\u1EED l\xFD t\u1EC7p tin...":g??S}),rr("div",{id:T,className:`${y.descSize} text-neutral-500`,children:m??R})]})})}import{useMemo as Mv}from"react";import{jsx as Bi,jsxs as Af}from"react/jsx-runtime";function Ln({file:e,fileName:t,category:r,size:o="md",className:n=""}){let i=Mv(()=>{if(r)return r;let b=t||(e?ct(e):"");return us(e||b)},[r,e,t]),a=C(i,yf,"other"),s=typeof o=="number"?o:C(o,Tr,"md").fileIconSize,l=Math.max(8,Math.round(s*.22));return Af("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:[Af("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:[Bi("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"}),Bi("path",{d:"M26 3V10C26 10.55 26.45 11 27 11H34",className:"fill-neutral-200 stroke-neutral-300",strokeWidth:"1.5",strokeLinejoin:"round"}),Bi("line",{x1:"13",y1:"15",x2:"23",y2:"15",className:"stroke-neutral-300",strokeWidth:"1.5",strokeLinecap:"round"}),Bi("line",{x1:"13",y1:"19",x2:"27",y2:"19",className:"stroke-neutral-300",strokeWidth:"1.5",strokeLinecap:"round"})]}),Bi("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 dr}from"react/jsx-runtime";function Hi({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:b=!0,onRemove:u,onPreview:w,onDownload:g,onRetry:m,renderItem:x,className:v=""}){let h=C(o,Tr,"md"),k=C(n,ns,"md"),T=ct(e),y=fc(e),{status:d,progress:c,error:f}=pc(e),p=d==="uploading",S=d==="error",R=()=>{i||a||u?.(e,t)},D=()=>{i||w?.(e)},P=()=>{i||g?.(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:R,preview:D,download:P})});let E=N=>{i||(N.key==="Delete"||N.key==="Backspace")&&!a&&(N.preventDefault(),R())};return r==="grid"?dr("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":""} ${v}`,children:[dr("div",{className:"flex items-start gap-2.5",children:[Ge(Ln,{file:e,size:o}),dr("div",{className:"flex-1 min-w-0",children:[w&&!i?Ge("button",{type:"button",title:T,onClick:D,className:`truncate text-left font-medium text-neutral-800 ${h.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 ${h.fileNameSize}`,children:T}),Ge("p",{className:`text-neutral-500 ${h.fileMetaSize}`,children:S?Ge("span",{className:"text-error-600 font-medium truncate block",children:f||"L\u1ED7i t\u1EA3i l\xEAn"}):p?dr("span",{className:"text-primary-600 flex items-center gap-1 font-medium",children:[Ge(De,{width:12,height:12,className:"animate-spin inline"}),"\u0110ang t\u1EA3i... ",c!==void 0?`${c}%`:""]}):y!==void 0?Sr(y):null})]})]}),p&&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))}%`}})}),dr("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 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(Lt,{width:14,height:14})}),s&&w&&Ge("button",{type:"button",disabled:i,onClick:D,"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 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(Vr,{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 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(hr,{width:14,height:14})}),b&&!a&&Ge("button",{type:"button",disabled:i,onClick:R,"aria-label":`X\xF3a t\u1EC7p ${T}`,title:"X\xF3a t\u1EC7p",className:`text-neutral-400 hover:text-error-600 hover:bg-error-50 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(ar,{width:14,height:14})})]})]}):dr("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 ${h.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":""} ${v}`,children:[dr("div",{className:"flex items-center justify-between gap-3 w-full",children:[dr("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[Ge(Ln,{file:e,size:o}),dr("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:D,className:`truncate text-left font-medium text-neutral-800 ${h.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 ${h.fileNameSize}`,children:T})}),Ge("div",{className:`flex items-center gap-2 text-neutral-500 ${h.fileMetaSize}`,children:S?Ge("span",{className:"text-error-600 font-medium truncate",children:f||"L\u1ED7i t\u1EA3i l\xEAn"}):p?dr("span",{className:"text-primary-600 flex items-center gap-1 font-medium",children:[Ge(De,{width:12,height:12,className:"animate-spin inline"}),"\u0110ang t\u1EA3i l\xEAn... ",c!==void 0?`${c}%`:""]}):y!==void 0?Ge("span",{children:Sr(y)}):null})]})]}),dr("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 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(Lt,{width:15,height:15})}),s&&w&&Ge("button",{type:"button",disabled:i,onClick:D,"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 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(Vr,{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 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(hr,{width:15,height:15})}),b&&!a&&Ge("button",{type:"button",disabled:i,onClick:R,"aria-label":`X\xF3a t\u1EC7p ${T}`,title:"X\xF3a t\u1EC7p",className:`text-neutral-400 hover:text-error-600 hover:bg-error-50 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(ar,{width:15,height:15})})]})]}),p&&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 Of}from"react/jsx-runtime";function Vi({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:b=!0,onRemove:u,onPreview:w,onDownload:g,onRetry:m,renderItem:x,className:v=""}){let h=C(r,Tr,"md"),k=t==="grid"?`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 ${h.gap} list-none p-0 m-0 ${v}`:`flex flex-col ${h.gap} list-none p-0 m-0 ${v}`;return!e||e.length===0?null:Of("ul",{"aria-label":"Danh s\xE1ch t\u1EC7p tin \u0111\xE3 t\u1EA3i l\xEAn",className:k,children:e.map((T,y)=>{let d=wf(T,y);return Of(Hi,{item:T,index:y,listType:t,size:r,radius:n,color:o,disabled:i,readOnly:a,showPreviewButton:s,showDownloadButton:l,showRemoveButton:b,onRemove:u,onPreview:w,onDownload:g,onRetry:m,renderItem:x},d)})})}import{jsx as fr,jsxs as kc}from"react/jsx-runtime";function Sc({value:e,defaultValue:t,onChange:r,onRemove:o,onPreview:n,onDownload:i,onRetry:a,maxCount:s,maxSize:l,minSize:b,accept:u,beforeUpload:w,viewMode:g="dropzone",listType:m="list",shape:x="rectangle",size:v="md",color:h="primary",variant:k="outline",radius:T,label:y,labelClassName:d="",helperText:c,errorMessage:f,disabled:p=!1,readOnly:S=!1,dropzoneTitle:R,dropzoneDescription:D,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:oe=!0}=Y??{},ue=Fv(),ie=`${ue}-input`,Q=`${ue}-error-helper`,q=e!==void 0,[ge,ke]=ys(()=>Lo(t)),L=Gf(()=>q?Lo(e):ge,[q,e,ge]),[te,Z]=ys(null),[he,ae]=ys(null),[ve,Se]=ys(""),ye=C(v,Tr,"md"),J=T??"md",O=!!(F||f||te),W=f||te,fe=O?"text-error-600":C(O?"error":h,bf,"primary"),se=s??(U?void 0:1),me=ne=>{q||ke(ne),r?.(ne)},Re=Gf(()=>Ni(u),[u]),{getRootProps:xe,getInputProps:re,isDragActive:de,isDragReject:ce,open:ee}=Ev({multiple:U,maxSize:l,minSize:b,accept:Re,disabled:p||S||G,noClick:g==="button",noKeyboard:g==="button",onDropAccepted:async ne=>{if(p||S||(Z(null),ne.length===0))return;let Te=ne,Pe=L.length;if(se!==void 0)if(U){let Le=se-Pe;if(Le<=0){let He=`S\u1ED1 l\u01B0\u1EE3ng t\u1EC7p \u0111\xE3 \u0111\u1EA1t t\u1ED1i \u0111a (${se} t\u1EC7p)`;Z(He),Se(He);return}Te=ne.slice(0,Le)}else{let Le=ne[0];if(!Le)return;Te=[Le]}let _e=await Promise.all(Te.map(async Le=>{if(w)try{let He=await w(Le);if(He===!1||typeof He=="string")return{file:null,error:typeof He=="string"?He:`T\u1EC7p ${Le.name} \u0111\xE3 b\u1ECB t\u1EEB ch\u1ED1i`}}catch(He){return{file:null,error:He instanceof Error?He.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:ne=>{let Te=ne[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 (${Sr(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 (${Sr(b||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 u=="string"?u:Object.keys(u||{}).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=(ne,Te)=>{if(p||S)return;let Pe=L.filter((_e,Ue)=>Ue!==Te);me(Pe),o?.(ne,Te),Se(`\u0110\xE3 x\xF3a t\u1EC7p tin ${ct(ne)}`)},Ce=ne=>{ae(ne),n?.(ne)},Ee=ne=>{i?.(ne);let Te=ct(ne);if(ne instanceof File){let Pe=URL.createObjectURL(ne);Rr(Pe,ne.name),setTimeout(()=>URL.revokeObjectURL(Pe),1e3);return}if(typeof ne=="string"){Rr(ne,Te);return}typeof ne=="object"&&ne&&typeof ne.src=="string"&&Rr(ne.src,ne.name||Te)},Fe=H||z;return kc("div",{className:`group/field relative flex flex-col w-full ${N}`,children:[fr("input",{...re({id:ie,disabled:p||G,"aria-hidden":!0,tabIndex:-1,className:"hidden"})}),fr("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:ve}),y&&kc("label",{htmlFor:ie,className:`block font-medium transition-colors duration-150 ${ye.labelSize} ${fe} ${d}`,children:[y,$&&fr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),kc("div",{className:"flex flex-col gap-3",children:[g==="dropzone"&&fr($n,{size:v,color:h,variant:k,radius:J,shape:x,disabled:p,readOnly:S,isLoading:G,showSpinner:A,dragStatus:ce?"reject":de?"active":"idle",isInvalid:O,dropzoneTitle:R,dropzoneDescription:D,icon:I,onTriggerUpload:ee,getRootProps:xe,className:M,describedById:W||c?Q:void 0}),g==="compact"&&fr($n,{size:v,color:h,variant:k,radius:J,compact:!0,disabled:p,readOnly:S,isLoading:G,showSpinner:A,dragStatus:ce?"reject":de?"active":"idle",isInvalid:O,dropzoneTitle:R,dropzoneDescription:D,icon:I,onTriggerUpload:ee,getRootProps:xe,className:M,describedById:W||c?Q:void 0}),g==="button"&&fr("div",{className:"flex items-center gap-3",children:fr(Ut,{type:"button",size:ye.buttonSize,color:O?"error":h==="neutral"?"secondary":h,variant:k==="other"?"filled":k,radius:T,disabled:p||S||G||se!==void 0&&L.length>=se,isLoading:G,showSpinner:A,onClick:ee,leftIcon:fr(Nt,{width:ye.iconSize*.5,height:ye.iconSize*.5}),"aria-label":"T\u1EA3i t\u1EC7p l\xEAn",children:P})}),B&&L.length>0&&fr(Vi,{items:L,listType:m,size:v,color:h,variant:k,radius:J,disabled:p,readOnly:S,maxCount:se,showPreviewButton:X,showDownloadButton:le,showRemoveButton:oe,onRemove:j,onPreview:Ce,onDownload:Ee,onRetry:a,renderItem:E,className:Fe})]}),fr($e,{id:Q,helperText:c,errorMessage:O?W:void 0,sizeClassName:ye.helperSize,className:V}),he&&fr(ur,{open:!!he,onClose:()=>ae(null),file:he})]})}var Uf=300,fo={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"}},jf={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Yf={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"},Wf={warning:en,error:tn,success:Qo,info:Kt,primary:Kt,secondary:Kt,neutral:Kt};import{createContext as $v,useContext as Lv}from"react";var Tc=$v(null),or=()=>Lv(Tc);import{jsx as Bv}from"react/jsx-runtime";function Rc({size:e,radius:t,className:r="",children:o,ref:n,...i}){let a=or(),s=C(e??a?.size,fo,"md"),l=C(t,jf,"lg"),b=["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:b,...i,children:o})}import{useEffect as ws,useEffectEvent as Hv,useCallback as Vv,useMemo as Av,useRef as Kf,useState as Ov}from"react";import{jsx as Dc,jsxs as Gv}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="",children:b,onClose:u,...w}){let g=Kf(null),[m,x]=Ov(!1),v=Kf(null),h=Vv(()=>{m||o||(x(!0),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{x(!1),u?.()},Uf))},[m,o,u]),k=Av(()=>({onClose:h,isLoading:o,size:t,color:r}),[h,o,t,r]);ws(()=>()=>{v.current&&clearTimeout(v.current)},[]),ws(()=>{let f=g.current;if(f)if(e||m){if(!f.open)try{f.showModal()}catch{}}else f.open&&f.close()},[e,m]),ws(()=>{if(!a)return;let f=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=f}},[a]);let T=Hv(f=>{!e||i===!1||f.key==="Escape"&&(f.preventDefault(),f.stopPropagation(),h())});if(ws(()=>(window.addEventListener("keydown",T),()=>{window.removeEventListener("keydown",T)}),[]),!e&&!m)return null;let y=()=>{n&&h()},d=m?"animate-confirm-backdrop-out pointer-events-none":"animate-confirm-backdrop-in",c=m?"animate-confirm-out pointer-events-none":"animate-confirm-in";return Dc(Tc.Provider,{value:k,children:Gv("dialog",{ref:g,"aria-labelledby":"confirm-dialog-title","aria-describedby":"confirm-dialog-description",onCancel:f=>{f.preventDefault(),i!==!1&&h()},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 ${d} ${s}`,...w,children:[Dc("div",{"aria-hidden":"true",onClick:y,className:"fixed inset-0 -z-10"}),Dc("div",{className:`w-full flex items-center justify-center pointer-events-none ${c} ${l}`,children:b})]})})}import{jsx as Bn,jsxs as _f}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:b="",children:u,...w}){let g=or(),m=C(e??g?.size,fo,"md"),x=C(t??g?.color,Yf,"warning"),v=g?.isLoading,h=()=>{s?.(),g?.onClose?.()},k=!!(s||g?.onClose),T=()=>{if(r===!1)return null;if(r!==void 0&&r!==!0)return Bn("div",{className:`inline-flex items-center justify-center shrink-0 ${m.iconWrapper} ${x} ${n}`,"aria-hidden":"true",children:r});let y=C(t??g?.color,Wf,"warning");return Bn("div",{className:`inline-flex items-center justify-center shrink-0 ${m.iconWrapper} ${x} ${n}`,"aria-hidden":"true",children:Bn(y,{className:m.icon})})};return _f("div",{className:`flex items-start justify-between w-full ${m.header} ${b}`,...w,children:[_f("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[T(),o&&Bn("h3",{className:`${m.title} truncate ${i}`,id:"confirm-dialog-title",children:o}),u]}),a&&k&&Bn("button",{type:"button",onClick:h,disabled:v,"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:Bn(Be,{className:m.closeIcon})})]})}import{jsx as Uv,jsxs as jv}from"react/jsx-runtime";function zc({size:e,description:t,descriptionClassName:r="",className:o="",children:n,...i}){let a=or(),s=C(e??a?.size,fo,"md");return jv("div",{className:`w-full ${s.body} ${o}`,id:"confirm-dialog-description",...i,children:[t?Uv("p",{className:`${s.description} ${r}`,children:t}):null,n]})}import{jsx as Ic,jsxs as Yv}from"react/jsx-runtime";function Mc({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:b,confirmButtonProps:u,cancelButtonProps:w,className:g="",children:m,...x}){let v=or(),h=C(e??v?.size,fo,"md"),k=i??v?.color??"warning",T=()=>{b?.(),v?.onClose?.()},y=async()=>{try{let c=s?.();c&&"then"in c&&await c,T()}catch{}},d=()=>{l?.(),T()};return m?Ic("div",{className:`flex items-center justify-end w-full ${h.footer} ${h.buttonGap} ${g}`,...x,children:m}):Yv("div",{className:`flex items-center justify-end w-full ${h.footer} ${h.buttonGap} ${g}`,...x,children:[r!==!1&&Ic(Ut,{size:h.buttonSize,variant:n,color:a,onClick:d,disabled:w?.disabled||v?.isLoading,...w,children:r}),Ic(Ut,{size:h.buttonSize,variant:o,color:k,isLoading:v?.isLoading||u?.isLoading,disabled:u?.disabled,onClick:y,...u,children:t})]})}import{cloneElement as Wv,isValidElement as Kv}from"react";import{jsx as _v}from"react/jsx-runtime";function Fc({children:e,asChild:t=!0,onClick:r,...o}){let n=or(),i=n?.isLoading,a=s=>{r?.(s),s.defaultPrevented||n?.onClose?.()};if(t&&Kv(e)){let s=e;return Wv(s,{disabled:s.props.disabled||i,onClick:l=>{s.props.onClick?.(l),a(l)},...o})}return _v("button",{type:"button",onClick:a,disabled:i,...o,children:e})}import{jsx as Xv}from"react/jsx-runtime";function Ec({size:e,className:t="",children:r,...o}){let n=tr(),i=C(e??n?.size,uo,"md");return Xv("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 qv,isValidElement as Zv}from"react";import{jsx as Jv}from"react/jsx-runtime";function $c({children:e,asChild:t=!0,onClick:r,...o}){let n=tr(),i=n?.isLoading,a=s=>{r?.(s),s.defaultPrevented||n?.onClose?.()};if(t&&Zv(e)){let s=e;return qv(s,{disabled:s.props.disabled||i,onClick:l=>{s.props.onClick?.(l),a(l)},...o})}return Jv("button",{type:"button",onClick:a,disabled:i,...o,children:e})}import{createContext as Qv,useContext as ey,useMemo as ty}from"react";import{jsx as Dr}from"react/jsx-runtime";var Xf=Qv({size:"md",variantStyles:Oi.default}),Hn=()=>ey(Xf);function Cs({variant:e="default",size:t="md",className:r="",containerClassName:o="",wrapperProps:n,children:i,ref:a,...s}){let l=C(e,Oi,"default"),b=ty(()=>({size:t,variantStyles:l}),[t,l]);return Dr(Xf.Provider,{value:b,children:Dr("div",{className:`w-full overflow-x-auto rounded-lg ${l.container} ${o}`.trim(),...n,children:Dr("table",{ref:a,className:`w-full text-left caption-bottom ${l.table} ${r}`.trim(),...s,children:i})})})}function ks({className:e="",children:t,ref:r,...o}){let{variantStyles:n}=Hn();return Dr("thead",{ref:r,className:`${n.head} ${e}`.trim(),...o,children:t})}function Ss({className:e="",children:t,ref:r,...o}){return Dr("tbody",{ref:r,className:`divide-y divide-neutral-200/70 ${e}`.trim(),...o,children:t})}function qf({className:e="",children:t,ref:r,...o}){return Dr("tfoot",{ref:r,className:`border-t border-neutral-200 bg-neutral-50/60 font-medium text-neutral-600 ${e}`.trim(),...o,children:t})}function jo({isSelected:e=!1,isHoverable:t=!0,className:r="",children:o,ref:n,...i}){let{variantStyles:a}=Hn(),s=e?"bg-primary-50/70 hover:bg-primary-50 text-primary-950 font-medium":"",l=t&&!e?a.row:"";return Dr("tr",{ref:n,"data-state":e?"selected":void 0,"aria-selected":e,className:`${l} ${s} ${r}`.trim(),...i,children:o})}function po({align:e="left",className:t="",children:r,ref:o,...n}){let{size:i}=Hn(),a=C(i,Ai,"md"),s=C(e,Gi,"left");return Dr("th",{ref:o,className:`tracking-wider ${a.head} ${s} ${t}`.trim(),...n,children:r})}function Vn({align:e="left",className:t="",children:r,ref:o,...n}){let{size:i,variantStyles:a}=Hn(),s=C(i,Ai,"md"),l=C(e,Gi,"left");return Dr("td",{ref:o,className:`align-middle ${s.cell} ${a.cell} ${l} ${t}`.trim(),...n,children:r})}function Zf({className:e="",children:t,ref:r,...o}){return Dr("caption",{ref:r,className:`mt-3 text-xs text-neutral-500 ${e}`.trim(),...o,children:t})}import{jsx as Yo,jsxs as ry}from"react/jsx-runtime";function An({column:e,title:t,className:r="",...o}){if(!e.getCanSort())return Yo("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 Yo("div",{className:`flex items-center space-x-1.5 ${r}`.trim(),...o,children:ry("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:[Yo("span",{children:t}),Yo("span",{className:"shrink-0 inline-flex items-center justify-center","aria-hidden":"true",children:n==="asc"?Yo(ha,{className:"w-3.5 h-3.5 text-primary-600"}):n==="desc"?Yo(xa,{className:"w-3.5 h-3.5 text-primary-600"}):Yo(ba,{className:"w-3.5 h-3.5 text-neutral-400 opacity-60 group-hover:opacity-100 transition-opacity"})})]})})}import{useSortable as oy}from"@dnd-kit/sortable";import{CSS as ny}from"@dnd-kit/utilities";import{jsx as Jf}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",s=n||a,{attributes:l,listeners:b,setNodeRef:u,transform:w,transition:g,isDragging:m}=oy({id:e.column.id,disabled:s}),x={transform:ny.Translate.toString(w),transition:g,opacity:m?.75:1,position:m?"relative":void 0,zIndex:m?20:void 0,whiteSpace:"nowrap"},v=t&&typeof e.column.columnDef.header=="string"?Jf(An,{column:e.column,title:e.column.columnDef.header}):r;return Jf(po,{ref:u,style:x,"aria-sort":o,"data-column-id":e.column.id,...s?{}:l,...s?{}:b,className:`
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:`
3
3
  ${s?"":"select-none cursor-grab active:cursor-grabbing transition-colors"}
4
4
  ${m?"bg-neutral-100 shadow-md ring-1 ring-primary-500/30":""}
5
5
  ${i}
6
- `.trim(),children:v})}import{useMemo as Qf}from"react";import{jsx as St,jsxs as Bc}from"react/jsx-runtime";function iy(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 Ts({table:e,pageSizeOptions:t=Ui,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),b=i+1,u=e.getCanPreviousPage(),w=e.getCanNextPage(),g=Qf(()=>t.map(x=>({label:`${x}`,value:x})),[t]),m=Qf(()=>iy(b,l),[b,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:[St("span",{className:"whitespace-nowrap",children:"S\u1ED1 d\xF2ng/trang:"}),St("div",{className:"w-20","data-testid":"table-page-size-selector",children:St(Ti,{size:"sm",options:g,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",{}),Bc("div",{className:"flex items-center gap-1 ml-auto sm:ml-0",children:[St(pr,{icon:St(Yr,{className:"w-3.5 h-3.5"}),"aria-label":"Trang \u0111\u1EA7u",size:"sm",variant:"outline",color:"neutral",disabled:!u,onClick:()=>e.firstPage()}),St(pr,{icon:St(Yt,{className:"w-3.5 h-3.5"}),"aria-label":"Trang tr\u01B0\u1EDBc",size:"sm",variant:"outline",color:"neutral",disabled:!u,onClick:()=>e.previousPage()}),St("div",{className:"flex items-center gap-1 px-1",children:m.map((x,v)=>{if(x==="...")return St("span",{className:"w-8 h-8 flex items-center justify-center text-xs text-neutral-400 select-none",children:"..."},`ellipsis-${v}`);let h=Number(x),k=h===b;return St("button",{type:"button",onClick:()=>e.setPageIndex(h-1),"aria-label":`Trang ${h}`,"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:h},h)})}),St(pr,{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(pr,{icon:St(Wr,{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 ay,useEffect as sy,useMemo as ep}from"react";import{useFloating as tp,autoUpdate as rp,offset as op,flip as np,shift as ip,useClick as ap,useDismiss as sp,useInteractions as lp,FloatingPortal as cp}from"@floating-ui/react";import{Fragment as cy,jsx as ot,jsxs as nr}from"react/jsx-runtime";function up(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 ly({field:e,currentValue:t,isOpen:r,onOpenChange:o,onRemove:n,onChange:i}){let a=e.name,{refs:{setFloating:s,setReference:l},floatingStyles:b,context:u}=tp({open:r,onOpenChange:o,placement:"bottom-start",transform:!1,middleware:[op(6),np(),ip({padding:8})],whileElementsMounted:rp}),{isMounted:w,styles:g}=et(u),m=ap(u),x=sp(u,{outsidePress:f=>!f.target?.closest?.("[data-table-filter-popover]")}),{getReferenceProps:v,getFloatingProps:h}=lp([m,x]),k=ay(null);sy(()=>{r&&k.current?.focus({preventScroll:!0})},[r]);let T=t!=null&&t!==""&&(!Array.isArray(t)||t.length>0&&(t[0]!=null||t[1]!=null)),y=up(e,t),d=e.type==="date"||e.type==="date-range",c=()=>e.type==="custom"?e.render?.({value:t,onChange:f=>i(a,f)})??null:e.type==="date-range"?ot(zo,{portal:!1,size:"sm",radius:"md",placeholder:e.placeholder||"Ch\u1ECDn kho\u1EA3ng ng\xE0y",value:t||[null,null],onChange:f=>i(a,f),...e.props||{}}):e.type==="date"?ot(Po,{portal:!1,size:"sm",radius:"md",placeholder:e.placeholder||"Ch\u1ECDn ng\xE0y",value:t,onChange:f=>i(a,f),...e.props||{}}):e.type==="number"?ot(bo,{ref:k,size:"sm",radius:"full",placeholder:e.placeholder||"Nh\u1EADp s\u1ED1...",value:t??"",onChange:f=>{let p=f.target.value;if(p==="")i(a,"");else{let S=Or(p);i(a,S!==void 0?S:p)}},onClear:()=>i(a,""),...e.props||{}}):e.type==="select"||e.type==="checkbox-group"?ot(wo,{size:"sm",value:t||[],onChange:f=>i(a,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||{}}):ot(Ct,{ref:k,size:"sm",radius:"full",placeholder:e.placeholder||"Nh\u1EADp t\u1EEB kh\xF3a...",value:t||"",onChange:f=>i(a,f.target.value),...e.props||{}});return nr(cy,{children:[ot("div",{ref:l,...v({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:n,deleteAriaLabel:`X\xF3a b\u1ED9 l\u1ECDc ${e.label}`,children:[nr("span",{className:"font-semibold",children:[e.label,":"]}),ot("span",{"data-testid":`filter-chip-val-${a}`,className:T?"font-medium":"opacity-70 italic",children:y})]})}),w&&ot(cp,{children:nr("div",{ref:s,"data-table-filter-popover":"true","data-testid":`filter-popover-${a}`,style:{...b,...g,zIndex:Qe.SELECT_FILTER},...h({className:`bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 rounded-lg p-3 shadow-2xl ${d?"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:[ot("span",{className:"text-xs font-bold text-neutral-800 dark:text-neutral-200",children:e.label}),ot("button",{type:"button",onClick:()=>o(!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:ot(Be,{className:"w-3.5 h-3.5"})})]}),ot("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:[ot("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"}),ot("button",{type:"button",onClick:()=>o(!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 Vc({filters:e,values:t,onChange:r,onReset:o,className:n=""}){let[i,a]=Hc([]),s=ep(()=>{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=ep(()=>new Set(s),[s]),[b,u]=Hc(null),[w,g]=Hc(!1),{refs:{setFloating:m,setReference:x},floatingStyles:v,context:h}=tp({open:w,onOpenChange:g,placement:"bottom-start",transform:!1,middleware:[op(6),np(),ip({padding:8})],whileElementsMounted:rp}),{isMounted:k,styles:T}=et(h,{duration:120}),y=ap(h),d=sp(h,{outsidePress:P=>!P.target?.closest?.("[data-table-filter-popover]")}),{getReferenceProps:c,getFloatingProps:f}=lp([y,d]),p=P=>{l.has(P.name)||a(I=>[...I,P.name]),g(!1),u(P.name)},S=P=>{a(I=>I.filter(E=>E!==P)),b===P&&u(null),r(P,void 0)},R=P=>{P.stopPropagation(),a([]),u(null),o?.()},D=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 ${n}`.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:[ot(gr,{className:"w-3.5 h-3.5 text-neutral-500"}),ot("span",{children:"B\u1ED9 l\u1ECDc"}),ot(lt,{className:`w-3 h-3 text-neutral-400 transition-transform ${w?"rotate-180":""}`})]}),k&&ot(cp,{children:nr("div",{ref:m,"data-table-filter-popover":"true","data-testid":"table-add-filter-menu",style:{...v,...T,zIndex:Qe.SELECT_FILTER},...f({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:[ot("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"}),ot("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(),p(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:[ot("span",{children:P.label}),I&&ot("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=b===P.name;return ot(ly,{field:P,currentValue:I,isOpen:E,onOpenChange:N=>{u(N?P.name:null)},onRemove:()=>S(P.name),onChange:r},P.name)}),D&&nr("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 dark:hover:text-red-400 transition-colors cursor-pointer",title:"\u0110\u1EB7t l\u1EA1i to\xE0n b\u1ED9 b\u1ED9 l\u1ECDc",children:[ot(Lt,{className:"w-3.5 h-3.5"}),ot("span",{children:"\u0110\u1EB7t l\u1EA1i"})]})]})}import{jsx as wt,jsxs as On}from"react/jsx-runtime";var uy={};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:b=uy,onFilterChange:u,onFilterReset:w,className:g=""}){let m=e.state.globalFilter??"",x=e.getAllLeafColumns().filter(y=>y.getCanHide()),v=e.getSelectedRowModel?.()?.rows??[],h=v.length,k=y=>{e.setGlobalFilter(y.target.value)},T=()=>{e.setGlobalFilter("")};return On("div",{className:`flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-3 pb-3 ${g}`.trim(),children:[On("div",{className:"flex flex-1 flex-wrap items-center gap-3",children:[r&&On("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(yo,{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(Be,{className:"w-3.5 h-3.5"})})]}),l&&l.length>0&&u&&wt(Vc,{filters:l,values:b,onChange:u,onReset:w}),h>0&&s&&wt("div",{className:"flex items-center gap-2 animate-in fade-in-50 duration-200",children:s(v)})]}),On("div",{className:"flex items-center gap-2 self-end sm:self-auto",children:[(n||!!i)&&wt(pr,{icon:wt(Kr,{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&&x.length>0&&On(ni,{size:"sm",placement:"bottom-end",children:[wt(Ma,{asChild:!0,children:wt(Ut,{variant:"outline",size:"sm",color:"neutral",leftIcon:wt(va,{className:"w-3.5 h-3.5"}),children:"C\u1ED9t"})}),On(El,{className:"w-56 p-0 shadow-lg border border-neutral-200",children:[wt($l,{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(Ll,{className:"max-h-60 overflow-y-auto p-1.5 flex flex-col gap-0.5",children:x.map(y=>{let d=typeof y.columnDef.header=="string"?y.columnDef.header:y.id;return wt("div",{className:"w-full",children:wt(br,{size:"sm",label:d,checked:y.getIsVisible(),onChange:y.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"})},y.id)})})]})]}),a]})]})}import{useMemo as Oc,useState as Wo}from"react";import{flexRender as Gc}from"@tanstack/react-table";import{DndContext as Ry,closestCenter as Dy,PointerSensor as Ny,KeyboardSensor as Py,useSensor as fp,useSensors as zy}from"@dnd-kit/core";import{restrictToHorizontalAxis as Iy}from"@dnd-kit/modifiers";import{arrayMove as My,SortableContext as Fy,horizontalListSortingStrategy as Ey}from"@dnd-kit/sortable";import{tableFeatures as fy,rowSortingFeature as py,rowPaginationFeature as gy,rowSelectionFeature as my,columnFilteringFeature as by,globalFilteringFeature as hy,columnVisibilityFeature as xy,columnPinningFeature as vy,columnOrderingFeature as yy,createSortedRowModel as wy,createPaginatedRowModel as Cy,createFilteredRowModel as ky,createColumnHelper as Sy,useTable as Ty}from"@tanstack/react-table";import{rankItem as dy}from"@tanstack/match-sorter-utils";var Ds=(e,t,r,o)=>{let n=dy(e.getValue(t),String(r??""));return o?.({itemRank:n}),n.passed};var Ac=fy({rowSortingFeature:py,rowPaginationFeature:gy,rowSelectionFeature:my,columnFilteringFeature:by,globalFilteringFeature:hy,columnVisibilityFeature:xy,columnPinningFeature:vy,columnOrderingFeature:yy,sortedRowModel:wy(),paginatedRowModel:Cy(),filteredRowModel:ky(),filterFns:{fuzzy:Ds}});function dp(){return Sy()}function Ns(e){let{features:t=Ac,columns:r,...o}=e;return Ty({features:t,columns:r,...o})}import{jsx as it,jsxs as pp}from"react/jsx-runtime";function gp({columns:e,data:t,variant:r="default",size:o="md",isLoading:n=!1,isRefresh:i=!1,onRefresh:a,loadingRowsCount:s=5,emptyText:l,emptyIllustration:b,enableSorting:u=!0,enableFiltering:w=!0,enablePagination:g=!0,enableRowSelection:m=!1,enableColumnVisibility:x=!0,enableColumnOrdering:v=!1,filters:h,searchPlaceholder:k,toolbarActions:T,renderBulkActions:y,pageSizeOptions:d,initialPageSize:c=ji,manualPagination:f=!1,manualSorting:p=!1,manualFiltering:S=!1,pageCount:R,rowCount:D,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:oe=""}){let[ue,ie]=Wo([]),[Q,q]=Wo({pageIndex:0,pageSize:c}),[ge,ke]=Wo({}),[L,te]=Wo({}),[Z,he]=Wo([]),[ae,ve]=Wo(""),[Se,ye]=Wo(()=>{if(!h)return[];let K=[];return h.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,Re=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=Oc(()=>{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=Oc(()=>{let K=e;return!S&&h&&h.length>0&&(K=K.map(_=>{let ze=_.id??_.accessorKey,pe=h.find(Me=>Me.name===ze);return!pe||_.filterFn?_:pe.type==="select"||pe.type==="checkbox-group"?{..._,filterFn:(Me,Xe,Ve)=>{if(!Ve||Array.isArray(Ve)&&Ve.length===0)return!0;let Ze=Me.getValue(Xe);return Array.isArray(Ve)?Ve.some(qe=>String(qe).toLowerCase()===String(Ze).toLowerCase()):String(Ze).toLowerCase()===String(Ve).toLowerCase()}}:pe.type==="date-range"?{..._,filterFn:(Me,Xe,Ve)=>{if(!Ve||!Array.isArray(Ve))return!0;let[Ze,qe]=Ve;if(!Ze&&!qe)return!0;let Ne=Me.getValue(Xe);if(!Ne)return!1;let Ye=Ne instanceof Date?Ne:new Date(Ne);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(br,{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(br,{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,h]),ne=Ns({data:t,columns:Fe,state:{sorting:J,pagination:W,rowSelection:fe,columnVisibility:me,columnOrder:xe,globalFilter:de,columnFilters:S?[]:ee},enableSorting:u,enableRowSelection:m,manualPagination:f,manualSorting:p,manualFiltering:!1,globalFilterFn:A??"fuzzy",pageCount:R,rowCount:D,onSortingChange:O,onPaginationChange:we,onRowSelectionChange:se,onColumnVisibilityChange:Re,onColumnOrderChange:re,onGlobalFilterChange:ce}),Te=ne.getVisibleLeafColumns().length,Pe=g?ne.getRowModel().rows:ne.getPrePaginatedRowModel?.()?.rows??ne.getRowModel().rows,_e=w||x||!!(h&&h.length>0)||!!(i||a)||!!T||!!y,Ue=zy(fp(Ny,{activationConstraint:{distance:8}}),fp(Py)),Le=Oc(()=>ne.getVisibleLeafColumns().map(K=>K.id),[ne]),He=K=>{let{active:_,over:ze}=K;if(_&&ze&&_.id!==ze.id){if(_.id==="_select"||ze.id==="_select")return;let pe=ne.getVisibleLeafColumns().map(Ve=>Ve.id),Me=pe.indexOf(_.id),Xe=pe.indexOf(ze.id);if(Me!==-1&&Xe!==-1){let Ve=My(pe,Me,Xe);re(Ve)}}},Ke=pp(Cs,{variant:r,size:o,containerClassName:oe,children:[it(ks,{children:ne.getHeaderGroups().map(K=>it(jo,{isHoverable:!1,children:v?it(Fy,{items:Le,strategy:Ey,children:K.headers.map(_=>{if(_.isPlaceholder)return it(po,{},_.id);let ze=_.column.getCanSort()&&u,pe=_.column.getIsSorted(),Me=ze?pe==="asc"?"ascending":pe==="desc"?"descending":"none":void 0,Xe=Gc(_.column.columnDef.header,_.getContext());return it(Lc,{header:_,canSort:ze,ariaSort:Me,headerContent:Xe},_.id)})}):K.headers.map(_=>{if(_.isPlaceholder)return it(po,{},_.id);let ze=_.column.getCanSort()&&u,pe=_.column.getIsSorted(),Me=ze?pe==="asc"?"ascending":pe==="desc"?"descending":"none":void 0,Xe=Gc(_.column.columnDef.header,_.getContext());return it(po,{"aria-sort":Me,"data-column-id":_.column.id,children:ze&&typeof _.column.columnDef.header=="string"?it(An,{column:_.column,title:_.column.columnDef.header}):Xe},_.id)})},K.id))}),it(Ss,{children:n||i?Array.from({length:s}).map((K,_)=>it(jo,{isHoverable:!1,children:Array.from({length:Te}).map((ze,pe)=>it(Vn,{children:it(_o,{className:"h-4 w-full rounded"})},`skeleton-cell-${_}-${pe}`))},`skeleton-row-${_}`)):Pe.length===0?it(jo,{isHoverable:!1,children:it(Vn,{colSpan:Te,className:"py-12 text-center",children:b??it(Eo,{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(jo,{isSelected:_,isHoverable:!0,onClick:()=>X?.(K),className:X?"cursor-pointer":void 0,children:K.getVisibleCells().map(ze=>it(Vn,{children:Gc(ze.column.columnDef.cell,ze.getContext())},ze.id))},K.id)})})]});return pp("div",{className:`w-full space-y-2 ${le}`.trim(),children:[_e&&it(Rs,{table:ne,searchPlaceholder:k,enableGlobalFilter:w,enableColumnVisibility:x,isRefresh:i,onRefresh:a,actions:T,selectedActions:y,filters:h,filterValues:j,onFilterChange:Ce,onFilterReset:Ee}),v?it(Ry,{collisionDetection:Dy,modifiers:[Iy],onDragEnd:He,sensors:Ue,children:Ke}):Ke,g&&!n&&Pe.length>0&&it(Ts,{table:ne,pageSizeOptions:d})]})}export{ls as AUDIO_EXTENSIONS,ln as Alert,tn as AlertCircleIcon,en as AlertTriangleIcon,xa as ArrowDownIcon,ba as ArrowUpDownIcon,ha as ArrowUpIcon,ma as AvatarIcon,$t as Badge,Ut as Button,wr as Calendar,li as CalendarHeader,$u as CalendarIcon,$d as Carousel,Bd as CarouselContent,Ad as CarouselNext,Od as CarouselPagination,Vd as CarouselPrevious,Hd as CarouselSlide,Qo as CheckCircleIcon,Ur as CheckIcon,br as Checkbox,wo as CheckboxGroup,lt as ChevronDownIcon,Yt as ChevronLeftIcon,Wt as ChevronRightIcon,Bu as ClockIcon,Be as CloseIcon,pl as Collapse,Qn as CollapseContent,Jn as CollapseHeader,ml as CollapsePanel,bl as Collapsible,Rc as Confirm,zc as ConfirmBody,Fc as ConfirmClose,Nc as ConfirmContainer,Mc as ConfirmFooter,Pc as ConfirmHeader,fa as CropIcon,ji as DEFAULT_PAGE_SIZE,Ui as DEFAULT_PAGE_SIZE_OPTIONS,xr as DEFAULT_TOAST_DURATION,cs as DOCUMENT_EXTENSIONS,gp as DataTable,Po as DatePicker,vn as DateRangeCalendar,bn as DateRangeDayGrid,pi as DateRangeHeader,hn as DateRangeMonthGrid,zo as DateRangePicker,xn as DateRangeYearGrid,Ql as DateTimePicker,ec as DateTimeRangePicker,ui as DayGrid,Yr as DoubleChevronLeftIcon,Wr as DoubleChevronRightIcon,hr as DownloadIcon,Tl as Dropdown,e0 as DropdownGroup,Jd as DropdownHeader,Zd as DropdownItem,Pl as DropdownMenu,Qd as DropdownSeparator,Kd as DropdownTrigger,Eo as Empty,Ks as EmptyDefaultIcon,Xs as EmptyErrorIcon,qs as EmptyFolderIcon,Cn as EmptyIllustration,_s as EmptySearchIcon,Zs as EmptySimpleIcon,Vr as EyeIcon,ur as FileContainer,Ln as FileIcon,Lr as FilePreview,sn as FlipHorizontalIcon,is as IMAGE_EXTENSIONS,pr as IconButton,da as ImageIcon,zi as ImagePreview,Pi as ImagePreviewToolbar,Kt as InfoCircleIcon,Ct as Input,Br as LoadingImage,ra as MinusIcon,Ho as Modal,Oo as ModalBody,$c as ModalClose,Vo as ModalContainer,Ec as ModalFooter,Ao as ModalHeader,di as MonthGrid,As as MultiInput,ff as MultiSelect,ts as MultiSelectTrigger,bo as NumberInput,Hs as OtpInput,as as PDF_EXTENSIONS,Ls as PasswordInput,gr as PlusIcon,ni as Popover,s0 as PopoverBody,u0 as PopoverClose,i0 as PopoverContent,l0 as PopoverFooter,a0 as PopoverHeader,Ma as PopoverTrigger,Yn as Radio,aa as RadioDotIcon,js as RadioGroup,Lt as ResetIcon,nn as RotateCcwIcon,Kr as RotateCwIcon,yo as SearchIcon,lf as Select,Ti as SelectComponent,Pn as SelectMenu,Qa as SelectMenuFilter,Za as SelectOption,Dn as SelectTrigger,Dn as SingleSelectTrigger,_o as Skeleton,qn as Slider,ka as SliderMarks,Sa as SliderStepDots,_n as SliderThumb,va as SlidersHorizontalIcon,De as Spinner,No as Tab,Do as TabList,yl as TabPanel,vl as TabPanels,Cs as Table,Ss as TableBody,Zf as TableCaption,Vn as TableCell,An as TableColumnHeader,qf as TableFooter,po as TableHead,ks as TableHeader,Ts as TablePagination,jo as TableRow,Rs as TableToolbar,Ro as Tabs,Os as TextArea,ao as TimeColumn,ql as TimePicker,Zl as TimeRangePicker,Zt as TimeView,nl as Toaster,Ws as Toggle,Kn as Tooltip,ar as TrashIcon,Cc as UploadAvatar,wc as UploadAvatarCropContent,xs as UploadAvatarCropModal,Sc as UploadFile,$n as UploadFileDropzone,Hi as UploadFileItemRow,Vi as UploadFileList,Nt as UploadIcon,xc as UploadImage,Fi as UploadImageDropzone,Go as UploadImageList,ss as VIDEO_EXTENSIONS,fi as YearGrid,rn as ZoomInIcon,on as ZoomOutIcon,Mo as checkIsDisabled,ul as clamp,Jt as combineDateTime,Io as createDateWithTime,dp as createTableColumnHelper,Ac as defaultTableFeatures,Rr as downloadFile,Sr as formatBytes,Ht as formatDate,At as formatDateTime,Ar as formatNumberString,It as formatTime,Ds as fuzzyFilter,Ea as generateCalendarGrid,mi as generateRangeCalendarGrid,so as getDefaultDateTimeFormat,io as getDefaultFormat,us as getFileCategory,Di as getFileExtension,ct as getFileName,Mn as getFileType,si as getISOWeekNumber,Xn as getPercentage,C as getSafeConfig,ai as isDateAfter,ii as isDateBefore,to as isSameDay,Fa as isSameMonth,C0 as isSameTime,S0 as isTimeAfter,k0 as isTimeBefore,E0 as isTimeInRange,Zi as isValidOtpChar,$r as normalizePreviewFile,cr as padZero,Vl as parseDate,hi as parseDateTime,Or as parseNumber,su as parseRawNumberString,Vt as parseTimeToDate,mo as rankAndFilterItems,dt as resolveLocale,Ji as sanitizeOtpString,Qi as splitTagsFromText,mt as toDate,Qt as toDateTime,w0 as toTimeObject,rd as toast,Ms as useAnimatedError,Pa as useCarousel,sr as useCarouselContext,qr as useCollapseContext,dn as useCollapsePanelContext,or as useConfirmContext,Ns as useDataTable,ev as useDebounce,vo as useDebouncedCallback,yr as useDropdownContext,ds as useFileContext,et as useFloatingTransition,mp as useInfiniteScroll,tr as useModalContext,zt as usePopoverContext,Hn as useTableStyles,Zr as useTabsContext};
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};
7
7
  //# sourceMappingURL=index.js.map