@unizap/uniui 1.0.71 → 1.0.73

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/uniui.js CHANGED
@@ -3617,6 +3617,7 @@ const Qr = ({
3617
3617
  /* @__PURE__ */ a(
3618
3618
  "button",
3619
3619
  {
3620
+ type: "button",
3620
3621
  className: "ml-2 p-1 bg-color-red-50 rounded-full text-color-red-500 hover:text-color-red-700 cursor-pointer",
3621
3622
  onClick: () => q(F),
3622
3623
  children: /* @__PURE__ */ a("svg", { className: "size-4", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z" }) })
@@ -6855,6 +6856,7 @@ const sa = xn(function({
6855
6856
  /* @__PURE__ */ a(
6856
6857
  "button",
6857
6858
  {
6859
+ type: "button",
6858
6860
  "aria-label": "prev",
6859
6861
  onClick: V,
6860
6862
  className: `absolute z-20 bg-color-white/80 border border-color-gray-300 rounded-full w-8 h-8 md:w-10 md:h-10 flex items-center justify-center text-sm md:text-lg font-bold text-color-gray-800 hover:bg-color-white transition-color cursor-pointer
@@ -6865,6 +6867,7 @@ const sa = xn(function({
6865
6867
  /* @__PURE__ */ a(
6866
6868
  "button",
6867
6869
  {
6870
+ type: "button",
6868
6871
  "aria-label": "next",
6869
6872
  onClick: H,
6870
6873
  className: `absolute z-20 bg-color-white/80 border border-color-gray-300 rounded-full w-8 h-8 md:w-10 md:h-10 flex items-center justify-center text-sm md:text-lg font-bold text-color-gray-800 hover:bg-color-white transition-color cursor-pointer
@@ -6881,6 +6884,7 @@ const sa = xn(function({
6881
6884
  (U, re) => /* @__PURE__ */ a(
6882
6885
  "button",
6883
6886
  {
6887
+ type: "button",
6884
6888
  onClick: () => N(
6885
6889
  Math.round(
6886
6890
  re / (le() - 1) * M
@@ -7542,7 +7546,7 @@ const Ir = {
7542
7546
  ({
7543
7547
  open: e,
7544
7548
  onClose: o,
7545
- shouldClose: t = !0,
7549
+ shouldClose: t = !1,
7546
7550
  className: n,
7547
7551
  title: i,
7548
7552
  children: r,
@@ -7608,7 +7612,7 @@ const Ir = {
7608
7612
  size: "small",
7609
7613
  roundedFull: !0,
7610
7614
  onClick: () => {
7611
- t && (o(), d(!1));
7615
+ o == null || o(), d(!1);
7612
7616
  },
7613
7617
  variant: "transparent"
7614
7618
  }
@@ -7672,6 +7676,7 @@ function ba({ items: e, trigger: o, className: t, dropdownItemClass: n, position
7672
7676
  children: e.map((f, b) => /* @__PURE__ */ C(
7673
7677
  "button",
7674
7678
  {
7679
+ type: "button",
7675
7680
  disabled: f.disabled,
7676
7681
  onClick: () => {
7677
7682
  var y;
@@ -7801,6 +7806,7 @@ const jr = ({
7801
7806
  /* @__PURE__ */ C(
7802
7807
  "button",
7803
7808
  {
7809
+ type: "button",
7804
7810
  onClick: h,
7805
7811
  className: `flex justify-between items-center w-full p-4 bg-color-gray-50 hover:bg-color-gray-200 transition ${c}`,
7806
7812
  children: [
@@ -7863,6 +7869,7 @@ const jr = ({
7863
7869
  /* @__PURE__ */ a(
7864
7870
  "button",
7865
7871
  {
7872
+ type: "button",
7866
7873
  onClick: () => {
7867
7874
  s(!1), t == null || t();
7868
7875
  },
@@ -8518,6 +8525,7 @@ const jr = ({
8518
8525
  return /* @__PURE__ */ C(
8519
8526
  "button",
8520
8527
  {
8528
+ type: "button",
8521
8529
  onClick: () => t(u.key),
8522
8530
  className: `relative flex ${m ? "flex-row items-center px-4 py-3" : "flex-col items-center py-4"}
8523
8531
  text-sm font-medium transition-color duration-200 bg-color-transparent
@@ -8609,6 +8617,7 @@ function Ma({
8609
8617
  ) : /* @__PURE__ */ C(
8610
8618
  "button",
8611
8619
  {
8620
+ type: "button",
8612
8621
  onClick: () => g(m),
8613
8622
  className: `flex items-center gap-3 py-3 px-4 cursor-pointer rounded-full w-full no-underline
8614
8623
  ${m.label === (c == null ? void 0 : c.label) ? "bg-color-blue-500 text-color-white font-medium " : "hover:bg-color-gray-50 text-color-gray-600 bg-color-transparent"}
@@ -62,7 +62,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
62
62
  ${se?"border-color-red-500 bg-color-red-50":""}
63
63
  ${l?"opacity-50 cursor-not-allowed":""}
64
64
  ${g}
65
- `,children:[a.jsxs("div",{...ee(),className:"flex flex-col items-center justify-center text-center px-6 pt-6 pb-4 cursor-pointer",children:[a.jsx("input",{...X()}),a.jsx("div",{className:`text-4xl mb-2 ${m}`,children:u}),a.jsx("p",{className:`text-sm font-medium ${p}`,children:s}),c&&a.jsx("p",{className:`text-xs mt-1 ${d}`,children:c})]}),k.length>0&&a.jsx("div",{className:"text-left text-sm text-color-red-600 px-6 pb-2 space-y-1",children:k.map((W,T)=>a.jsxs("p",{children:["• ",W]},T))}),x&&y.length>0&&a.jsx("ul",{className:`w-full ${f?"space-y-2":"grid grid-columns-2 gap-2"} px-4 pb-4`,children:y.map((W,T)=>a.jsxs("li",{className:"flex items-center justify-between bg-color-white rounded-md px-4 py-2 shadow-sm",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[w&&a.jsx("div",{className:"w-10 h-10 rounded bg-color-gray-100 overflow-hidden shrink-0",children:a.jsx("img",{src:W.type.startsWith("image/")?URL.createObjectURL(W):"https://img.icons8.com/ios-filled/50/pdf-2.png",className:"w-full h-full object-cover",alt:"preview"})}),a.jsx("div",{className:"text-sm max-w-[200px]",children:a.jsx("p",{className:"font-medium truncate text-xs text-color-gray-700",children:W.name})})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("p",{className:"text-xs text-color-gray-400",children:[(W.size/1024).toFixed(2)," KB"]}),a.jsx("button",{className:"ml-2 p-1 bg-color-red-50 rounded-full text-color-red-500 hover:text-color-red-700 cursor-pointer",onClick:()=>Z(T),children:a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"})})})]})]},T))})]})};function Ao({options:e=[],selectedValue:o,onChange:t=()=>{},placementTop:n}){const[r,i]=v.useState(!1),l=v.useRef(null);return v.useEffect(()=>{function s(c){l.current&&!l.current.contains(c.target)&&i(!1)}return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]),a.jsxs("div",{className:"relative w-fit rounded-md",ref:l,children:[a.jsxs("div",{className:"px-2 border border-color-gray-200 rounded-sm rounded-md flex items-center justify-center gap-1 cursor-pointer",onClick:()=>i(!r),children:[a.jsx("div",{className:"text-color-gray-700 flex text-sm font-medium leading-none",children:o}),a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"})})]}),r&&a.jsx("div",{className:`p-1 absolute mt-1 w-fit min-w-20 max-w-60 bg-color-white border border-color-gray-200 shadow-lg rounded-md
65
+ `,children:[a.jsxs("div",{...ee(),className:"flex flex-col items-center justify-center text-center px-6 pt-6 pb-4 cursor-pointer",children:[a.jsx("input",{...X()}),a.jsx("div",{className:`text-4xl mb-2 ${m}`,children:u}),a.jsx("p",{className:`text-sm font-medium ${p}`,children:s}),c&&a.jsx("p",{className:`text-xs mt-1 ${d}`,children:c})]}),k.length>0&&a.jsx("div",{className:"text-left text-sm text-color-red-600 px-6 pb-2 space-y-1",children:k.map((W,T)=>a.jsxs("p",{children:["• ",W]},T))}),x&&y.length>0&&a.jsx("ul",{className:`w-full ${f?"space-y-2":"grid grid-columns-2 gap-2"} px-4 pb-4`,children:y.map((W,T)=>a.jsxs("li",{className:"flex items-center justify-between bg-color-white rounded-md px-4 py-2 shadow-sm",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[w&&a.jsx("div",{className:"w-10 h-10 rounded bg-color-gray-100 overflow-hidden shrink-0",children:a.jsx("img",{src:W.type.startsWith("image/")?URL.createObjectURL(W):"https://img.icons8.com/ios-filled/50/pdf-2.png",className:"w-full h-full object-cover",alt:"preview"})}),a.jsx("div",{className:"text-sm max-w-[200px]",children:a.jsx("p",{className:"font-medium truncate text-xs text-color-gray-700",children:W.name})})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("p",{className:"text-xs text-color-gray-400",children:[(W.size/1024).toFixed(2)," KB"]}),a.jsx("button",{type:"button",className:"ml-2 p-1 bg-color-red-50 rounded-full text-color-red-500 hover:text-color-red-700 cursor-pointer",onClick:()=>Z(T),children:a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"})})})]})]},T))})]})};function Ao({options:e=[],selectedValue:o,onChange:t=()=>{},placementTop:n}){const[r,i]=v.useState(!1),l=v.useRef(null);return v.useEffect(()=>{function s(c){l.current&&!l.current.contains(c.target)&&i(!1)}return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]),a.jsxs("div",{className:"relative w-fit rounded-md",ref:l,children:[a.jsxs("div",{className:"px-2 border border-color-gray-200 rounded-sm rounded-md flex items-center justify-center gap-1 cursor-pointer",onClick:()=>i(!r),children:[a.jsx("div",{className:"text-color-gray-700 flex text-sm font-medium leading-none",children:o}),a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"})})]}),r&&a.jsx("div",{className:`p-1 absolute mt-1 w-fit min-w-20 max-w-60 bg-color-white border border-color-gray-200 shadow-lg rounded-md
66
66
  ${n?" bottom-7":" top-6"}`,children:e.map(s=>a.jsx("div",{className:`px-2 py-1 text-sm cursor-pointer rounded
67
67
  ${o===s?"bg-color-gray-100 text-color-gray-800 font-semibold":"hover:bg-color-gray-50"}`,onClick:()=>{t(s),i(!1)},children:s},String(s)))})]})}const Sr={small:"w-8 h-8 text-base",medium:"w-12 h-12 text-2xl",large:"w-16 h-16 text-3xl"},_r={none:"rounded-none",small:"rounded-sm",medium:"rounded-md",large:"rounded-lg",full:"rounded-full"},$r={outlined:"border border-color-gray-300 bg-transparent",filled:"border border-color-gray-300 bg-color-gray-50"},Fo=v.forwardRef(({className:e="",inputClass:o="",value:t="",onChange:n,onComplete:r,length:i=6,disabled:l=!1,size:s="medium",variant:c="outlined",rounded:u="medium",autoFocus:g=!1,...m},p)=>{const d=v.useRef([]);v.useEffect(()=>{g&&d.current[0]&&d.current[0].focus()},[g]);const x=(w,b)=>{var $;const z=w.target.value.replace(/[^0-9]/g,"").slice(0,1);if(!z&&t[b]===void 0)return;const y=t.substring(0,b)+z+t.substring(b+1,i);n==null||n(y),z&&b<i-1&&(($=d.current[b+1])==null||$.focus()),r&&y.length===i&&!y.split("").some(k=>!k)&&r(y)},f=(w,b)=>{var z,y,$;w.key==="Backspace"&&!t[b]&&b>0?(n==null||n(t.substring(0,b-1)+""+t.substring(b,i)),(z=d.current[b-1])==null||z.focus(),w.preventDefault()):w.key==="ArrowLeft"&&b>0?((y=d.current[b-1])==null||y.focus(),w.preventDefault()):w.key==="ArrowRight"&&b<i-1&&(($=d.current[b+1])==null||$.focus(),w.preventDefault())};return a.jsx("div",{className:`flex justify-center gap-2 ${e}`,children:Array.from({length:i}).map((w,b)=>a.jsx("input",{ref:z=>{d.current[b]=z},type:"text",inputMode:"numeric",autoComplete:"one-time-code",maxLength:1,disabled:l,className:`
68
68
  text-center font-semibold focus:ring-1 ring-color-primary outline-0 transition-all
@@ -136,9 +136,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
136
136
  ${Y==="max"?"ring-2 ring-offset-1 ring-blue-300":""}
137
137
  shadow-md hover:shadow-lg focus:outline-none dark:shadow-none
138
138
  `,style:{left:`${W}%`},tabIndex:g?-1:0,role:"slider","aria-orientation":"horizontal","aria-valuemin":i,"aria-valuemax":l,"aria-valuenow":j,"aria-disabled":g,"aria-label":"Maximum value",onKeyDown:F=>P(F,"max"),onFocus:()=>N("max"),onBlur:()=>N(null),onPointerDown:F=>H(F,"max")})]})]}),d&&x.length>0&&a.jsx("div",{className:"relative mt-2 text-xs text-color-gray-500 dark:text-color-gray-200",children:x.map((F,ie)=>{const le=X(F.value);return a.jsx("div",{className:"absolute transform -translate-x-1/2 text-xs",style:{left:`${le}%`},children:F.label||F.value},ie)})})]}),p&&a.jsx("div",{className:"ml-3 text-sm font-medium text-color-gray-700 dark:text-color-gray-200 min-w-[2rem] text-right",children:f?a.jsx("div",{className:"range-max",children:a.jsx("div",{children:j})}):a.jsx("span",{children:k})})]})})}),Sa=({open:e=!1,message:o,autoHideDuration:t=4e3,position:n="bottom-center",color:r="dark",onClose:i,action:l,className:s=""})=>{var m;v.useEffect(()=>{if(e&&t>0&&i){const p=setTimeout(()=>{i()},t);return()=>clearTimeout(p)}},[e,t,i]),v.useEffect(()=>{const p=d=>{d.key==="Escape"&&e&&i&&i()};if(e)return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[e,i]);const c=v.useCallback(()=>{i&&i()},[i]),u=p=>{const d="fixed z-50 transform transition-all duration-300 ease-in-out";switch(p){case"top-center":return`${d} top-4 left-1/2 -translate-x-1/2 ${e?"translate-y-0 opacity-100":"-translate-y-full opacity-0"}`;case"top-left":return`${d} top-4 left-4 ${e?"translate-y-0 opacity-100":"-translate-y-full opacity-0"}`;case"top-right":return`${d} top-4 right-4 ${e?"translate-y-0 opacity-100":"-translate-y-full opacity-0"}`;case"bottom-left":return`${d} bottom-4 left-4 ${e?"translate-y-0 opacity-100":"translate-y-full opacity-0"}`;case"bottom-right":return`${d} bottom-4 right-4 ${e?"translate-y-0 opacity-100":"translate-y-full opacity-0"}`;case"bottom-center":default:return`${d} bottom-4 left-1/2 -translate-x-1/2 ${e?"translate-y-0 opacity-100":"translate-y-full opacity-0"}`}},g=(m=xe[r])==null?void 0:m.filled;return e?a.jsxs(a.Fragment,{children:[e&&a.jsx("div",{className:"fixed inset-0 z-40 bg-color-black/10 backdrop-blur-[1px] md:hidden",onClick:c}),a.jsxs("div",{className:`min-w-72 max-w-lg mx-4 px-4 py-2 rounded-lg shadow-xl flex items-center justify-between gap-3 backdrop-blur-sm border border-color-white/20
139
- ${u(n)} ${g} ${s}`,role:"alert","aria-live":"assertive","aria-atomic":"true",children:[a.jsx("span",{className:"flex-1 text-sm font-medium leading-relaxed",children:o}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l&&a.jsx("div",{className:"flex items-center",children:l}),i&&a.jsx(_e,{color:"light",size:"small",icon:a.jsx("svg",{className:"size-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"})}),onClick:c,roundedFull:!0,className:"hover:!bg-color-white/10 -mr-1",variant:"transparent"})]})]})]}):null},_a=({variant:e="linear",value:o=0,color:t="blue",determinate:n=!0,className:r="",...i})=>{var g,m;const l=(g=xe[t])==null?void 0:g.outline,s=(m=xe[t])==null?void 0:m.filled,c=Math.min(Math.max(o,0),100);if(e==="circular"){const{size:p=40,thickness:d=4}=i,x=n?c/100*360:270;return a.jsxs("div",{className:`relative inline-block ${r}`,style:{width:p,height:p},role:"progressbar","aria-valuenow":n?c:void 0,"aria-valuemin":0,"aria-valuemax":100,children:[a.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-color-gray-200 dark:border-color-gray-700",style:{borderWidth:d,width:p,height:p,boxSizing:"border-box"}}),a.jsx("div",{className:`absolute inset-0 rounded-full ${l} ${n?"":"animate-circular-indeterminate"}`,style:{width:p,height:p,borderWidth:d,borderStyle:"solid",transform:"rotate(-90deg)",borderRadius:"50%",boxSizing:"border-box",transition:"all 0.3s",background:"transparent",maskImage:`conic-gradient(black 0deg, black ${x}deg, transparent ${x}deg 360deg)`,WebkitMaskImage:`conic-gradient(black 0deg, black ${x}deg, transparent ${x}deg 360deg)`}})]})}const{thickness:u=4}=i;return a.jsx("div",{className:`inline-block w-full ${r}`,role:"progressbar","aria-valuenow":n?c:void 0,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx("div",{className:"w-full bg-color-gray-200 dark:bg-color-gray-700 rounded-full overflow-hidden relative",style:{height:`${u}px`},children:n?a.jsx("div",{className:`h-full ${s} transition-all duration-300 ease-out`,style:{width:`${c}%`}}):a.jsx("div",{className:`absolute left-0 top-0 h-full ${s} animate-progress-indeterminate-gpu`,style:{width:"40%"}})})})},tn=a.jsx("svg",{className:"w-5 h-5 fill-color-yellow-500",fill:"currentColor",viewBox:"0 0 20 20",children:a.jsx("path",{d:"M10 15l-5.878 3.09 1.122-6.545L.488 6.91l6.561-.955L10 0l2.951 5.955 6.561.955-4.756 4.635 1.122 6.545z"})}),on=a.jsx("svg",{className:"w-5 h-5 fill-color-gray-300",fill:"none",stroke:"currentColor",viewBox:"0 0 20 20",children:a.jsx("path",{d:"M10 15l-5.878 3.09 1.122-6.545L.488 6.91l6.561-.955L10 0l2.951 5.955 6.561.955-4.756 4.635 1.122 6.545z"})}),gt={small:"w-4 h-4",medium:"w-6 h-6",large:"w-8 h-8"},$a=({value:e,onChange:o,readOnly:t=!1,disabled:n=!1,precision:r=1,max:i=5,size:l="medium",icon:s,emptyIcon:c,className:u="",showHoverValue:g=!1,showValue:m=!1,labels:p={}})=>{const[d,x]=v.useState(null),f=(y,$)=>{if(t||n||!o)return;const{left:k,width:V}=y.target.getBoundingClientRect(),j=(y.clientX-k)/V;let Z=$-1+Math.ceil(j/r)*r;Z=Math.min(i,Math.max(r,Math.round(Z/r)*r)),o(Z)},w=(y,$)=>{if(t||n)return;const{left:k,width:V}=y.target.getBoundingClientRect(),j=(y.clientX-k)/V;let Z=$-1+Math.ceil(j/r)*r;Z=Math.min(i,Math.max(r,Math.round(Z/r)*r)),x(Z)},b=()=>x(null),z=[];for(let y=1;y<=i;y++){let $=(d!==null?d:e)>=y,k=!$&&(d!==null?d:e)>y-1,V=$?s||v.cloneElement(tn,{className:`fill-color-yellow-500 ${gt[l]}`}):c||v.cloneElement(on,{className:`stroke-color-gray-300 ${gt[l]}`});if(k){const j=((d!==null?d:e)-(y-1))*100;V=a.jsxs("span",{className:"relative block",children:[a.jsx("span",{className:"absolute top-0 left-0 overflow-hidden",style:{width:`${j}%`},children:s||v.cloneElement(tn,{className:`fill-color-yellow-500 ${gt[l]}`})}),c||v.cloneElement(on,{className:`stroke-color-gray-300 ${gt[l]}`})]})}z.push(a.jsx("span",{className:`inline-block ${n?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,onClick:j=>f(j,y),onMouseMove:j=>w(j,y),onMouseLeave:b,tabIndex:t||n?-1:0,"aria-label":`Rate ${y}`,role:"radio","aria-checked":e===y,children:V},y))}return a.jsxs("div",{className:`flex items-center gap-1 ${u}`,role:"radiogroup","aria-disabled":n,children:[z,g&&d!==null?a.jsx("span",{className:"ml-2 text-xs",children:p[d]||d}):m?a.jsx("span",{className:"ml-2 text-xs",children:p[e]||e}):null]})},za=()=>{const[e,o]=v.useState("desktop");return v.useEffect(()=>{const t=()=>{const n=window.innerWidth;n<768?o("mobile"):n<1024?o("tablet"):o("desktop")};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]),e},He=(e,o,t,n,r)=>{switch(r){case"mobile":return e!==void 0?e:n;case"tablet":return o!==void 0?o:n;case"desktop":return t!==void 0?t:n;default:return n}},Ma=({children:e,width:o="100%",height:t="auto",showIndicators:n=!0,showArrows:r=!0,autoplay:i=!1,interval:l=3e3,infiniteLoop:s=!1,perview:c=1,gap:u=0,onClickItem:g,showThumbs:m=!1,pauseOnHover:p=!1,swipeable:d=!0,thumbWidth:x=60,orientation:f="horizontal",nextIcon:w,prevIcon:b,className:z,mobile:y,tablet:$,desktop:k})=>{const V=za(),j=He(y==null?void 0:y.perview,$==null?void 0:$.perview,k==null?void 0:k.perview,c,V),Z=He(y==null?void 0:y.gap,$==null?void 0:$.gap,k==null?void 0:k.gap,u,V),ee=He(y==null?void 0:y.showArrows,$==null?void 0:$.showArrows,k==null?void 0:k.showArrows,r,V),X=He(y==null?void 0:y.showIndicators,$==null?void 0:$.showIndicators,k==null?void 0:k.showIndicators,n,V),G=He(y==null?void 0:y.showThumbs,$==null?void 0:$.showThumbs,k==null?void 0:k.showThumbs,m,V),se=He(y==null?void 0:y.swipeable,$==null?void 0:$.swipeable,k==null?void 0:k.swipeable,d,V),W=e.length,T=Math.min(Math.max(j,.1),W),[D,Q]=v.useState(0),[R,pe]=v.useState(!1),[M,C]=v.useState(!1),[S,A]=v.useState(0),E=v.useRef(null),O=v.useRef(0),Y=v.useRef(0),N=T>=W?0:Math.max(0,W-T),_=K=>Math.max(0,Math.min(K,N)),L=K=>Q(s&&N>0?(K%(N+1)+(N+1))%(N+1):_(K)),H=()=>{s&&N>0?Q(D===0?N:D-1):L(D-1)},B=()=>{s&&N>0?Q(D>=N?0:D+1):L(D+1)};v.useEffect(()=>{if(!i||p&&R||M||N===0)return;const K=setInterval(()=>{Q(ae=>{const Ce=ae+1;return Ce>N?s?0:ae:Ce})},l);return()=>clearInterval(K)},[i,l,R,p,M,N,s]),v.useEffect(()=>{D>N&&Q(Math.min(D,N))},[N,D]);const re=(K,ae)=>{!se||N===0||(C(!0),O.current=f==="horizontal"?K:ae,Y.current=O.current)},P=(K,ae)=>{M&&(Y.current=f==="horizontal"?K:ae,A(Y.current-O.current))},F=()=>{if(!M)return;Math.abs(Y.current-O.current)>50&&(Y.current<O.current?B():H()),C(!1),A(0)},ie=()=>{const K=f==="horizontal"?"X":"Y";let ae=0;if(M&&E.current&&N>0){const I=f==="horizontal"?E.current.offsetWidth:E.current.offsetHeight;ae=S/I*100*(T/W)}const ve=Math.min(D,N)*(100/W)-ae,Ae=D>=N,Be=D<=0?0:Ae?Z/(j/2):Z/j;return`translate${K}(calc(-${ve}% - ${Be}px))`},le=()=>T>=W?1:Math.floor(N)+1,ge=()=>N===0?0:Math.round(D/N*(le()-1));return a.jsxs("div",{className:`relative flex flex-col items-center select-none ${z}`,style:{width:o,height:t},onMouseEnter:()=>p&&pe(!0),onMouseLeave:()=>p&&pe(!1),children:[a.jsxs("div",{ref:E,className:`w-full overflow-hidden relative ${se&&N>0?M?"cursor-grabbing":"cursor-grab":"cursor-default"}`,style:{height:G?`calc(${t} - ${x+20}px)`:t},onMouseDown:K=>{K.preventDefault(),re(K.clientX,K.clientY)},onMouseMove:K=>P(K.clientX,K.clientY),onMouseUp:F,onMouseLeave:F,onTouchStart:K=>re(K.touches[0].clientX,K.touches[0].clientY),onTouchMove:K=>P(K.touches[0].clientX,K.touches[0].clientY),onTouchEnd:F,children:[a.jsx("div",{className:`flex ${f==="horizontal"?"flex-row":"flex-col"} transition-all duration-300 ease-in-out`,style:{width:f==="vertical"?"100%":`calc(${W*100/T}% + ${(W-1)*Z}px)`,height:f==="vertical"?`${W*100/T}%`:"100%",transform:ie(),gap:`${Z}px`,transitionProperty:M?"none":"transform"},children:e.map((K,ae)=>a.jsx("div",{className:"shrink-0 flex items-center justify-center",style:{width:f==="horizontal"?`calc(${100/W}% - ${Z/j}px)`:"100%",height:f==="vertical"?`calc(${100/W}% - ${Z*(W-1)/W}px)`:"100%"},onClick:()=>!M&&(g==null?void 0:g(ae)),children:K},ae))}),ee&&N>0&&a.jsxs(a.Fragment,{children:[a.jsx("button",{"aria-label":"prev",onClick:H,className:`absolute z-20 bg-color-white/80 border border-color-gray-300 rounded-full w-8 h-8 md:w-10 md:h-10 flex items-center justify-center text-sm md:text-lg font-bold text-color-gray-800 hover:bg-color-white transition-color cursor-pointer
140
- ${f==="horizontal"?"left-1 md:left-2 top-1/2 -translate-y-1/2":"left-1/2 top-1 md:top-2 -translate-x-1/2"}`,children:b||(f==="horizontal"?"‹":"↑")}),a.jsx("button",{"aria-label":"next",onClick:B,className:`absolute z-20 bg-color-white/80 border border-color-gray-300 rounded-full w-8 h-8 md:w-10 md:h-10 flex items-center justify-center text-sm md:text-lg font-bold text-color-gray-800 hover:bg-color-white transition-color cursor-pointer
141
- ${f==="horizontal"?"right-1 md:right-2 top-1/2 -translate-y-1/2":"left-1/2 bottom-1 md:bottom-2 -translate-x-1/2"}`,children:w||(f==="horizontal"?"›":"↓")})]}),X&&le()>1&&a.jsx("div",{className:`uniui-indicator flex gap-1 mt-2 md:mt-3 justify-center absolute bg-color-white/90 py-1 px-[5px] rounded-full ${f==="horizontal"?"bottom-2 md:bottom-3 left-1/2 -translate-x-1/2":"top-1/2 right-2 md:right-3 -translate-y-1/2 rotate-90"} z-10`,children:Array.from({length:le()}).map((K,ae)=>a.jsx("button",{onClick:()=>L(Math.round(ae/(le()-1)*N)),className:`w-2 h-2 md:w-[10px] md:h-[10px] rounded-full transition-color hover:bg-color-gray-600 cursor-pointer ${ae===ge()?"bg-color-gray-800":"bg-color-gray-400"}`},ae))})]}),G&&a.jsx("div",{className:"uniui-thumb flex gap-1 md:gap-2 mt-2 md:mt-3 justify-center flex-wrap",children:e.map((K,ae)=>{const Ce=ae===Math.round(D),ve=V==="mobile"?x*.8:x;return a.jsx("div",{onClick:()=>{const Ae=Math.max(0,Math.min(N,ae-Math.floor(T/2)));L(Ae)},className:`overflow-hidden rounded-md cursor-pointer transition-all hover:opacity-100 ${Ce?"border-2 border-color-gray-800 opacity-100 scale-105":"border-2 border-color-gray-300 opacity-70"}`,style:{width:ve,height:ve},children:K},ae)})})]})},Na=({title:e,description:o,actionLabel:t,onAction:n,illustration:r,illustrationWidth:i=120,children:l,color:s="gray",titleClass:c="",descriptionClass:u=""})=>a.jsxs("section",{className:"flex flex-col items-center justify-center text-center p-6 max-w-md",role:"status","aria-live":"polite",children:[r&&a.jsx("div",{className:"flex items-center justify-center",style:{width:i},children:typeof r=="string"?a.jsx("img",{src:r,alt:"",className:"object-contain"}):r}),a.jsx("h2",{className:`text-lg mt-4 font-semibold text-color-gray-800 ${c}`,children:e}),o&&a.jsx("p",{className:`text-sm mt-2 text-color-gray-600 ${u}`,children:o}),t&&n&&a.jsx(ze,{onClick:n,color:s,className:"mt-4",children:t}),l]}),La=({initialState:e=!1,value:o,onToggle:t,disabled:n=!1,type:r="button",color:i="green",variant:l="ios",id:s})=>{var x,f,w;const[c,u]=v.useState(e),[g,m]=v.useState(!1),p=o!==void 0?o:c,d=async()=>{if(n||g)return;const b=!p;if(t){m(!0);try{await t(b),o===void 0&&u(b)}catch(z){console.error("Toggle failed",z)}finally{m(!1)}}else o===void 0&&u(b)};return l==="android"?a.jsxs("button",{onClick:d,id:s,type:r,disabled:n,className:`relative w-10 h-3 flex items-center transition-color duration-300
139
+ ${u(n)} ${g} ${s}`,role:"alert","aria-live":"assertive","aria-atomic":"true",children:[a.jsx("span",{className:"flex-1 text-sm font-medium leading-relaxed",children:o}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l&&a.jsx("div",{className:"flex items-center",children:l}),i&&a.jsx(_e,{color:"light",size:"small",icon:a.jsx("svg",{className:"size-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"})}),onClick:c,roundedFull:!0,className:"hover:!bg-color-white/10 -mr-1",variant:"transparent"})]})]})]}):null},_a=({variant:e="linear",value:o=0,color:t="blue",determinate:n=!0,className:r="",...i})=>{var g,m;const l=(g=xe[t])==null?void 0:g.outline,s=(m=xe[t])==null?void 0:m.filled,c=Math.min(Math.max(o,0),100);if(e==="circular"){const{size:p=40,thickness:d=4}=i,x=n?c/100*360:270;return a.jsxs("div",{className:`relative inline-block ${r}`,style:{width:p,height:p},role:"progressbar","aria-valuenow":n?c:void 0,"aria-valuemin":0,"aria-valuemax":100,children:[a.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-color-gray-200 dark:border-color-gray-700",style:{borderWidth:d,width:p,height:p,boxSizing:"border-box"}}),a.jsx("div",{className:`absolute inset-0 rounded-full ${l} ${n?"":"animate-circular-indeterminate"}`,style:{width:p,height:p,borderWidth:d,borderStyle:"solid",transform:"rotate(-90deg)",borderRadius:"50%",boxSizing:"border-box",transition:"all 0.3s",background:"transparent",maskImage:`conic-gradient(black 0deg, black ${x}deg, transparent ${x}deg 360deg)`,WebkitMaskImage:`conic-gradient(black 0deg, black ${x}deg, transparent ${x}deg 360deg)`}})]})}const{thickness:u=4}=i;return a.jsx("div",{className:`inline-block w-full ${r}`,role:"progressbar","aria-valuenow":n?c:void 0,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx("div",{className:"w-full bg-color-gray-200 dark:bg-color-gray-700 rounded-full overflow-hidden relative",style:{height:`${u}px`},children:n?a.jsx("div",{className:`h-full ${s} transition-all duration-300 ease-out`,style:{width:`${c}%`}}):a.jsx("div",{className:`absolute left-0 top-0 h-full ${s} animate-progress-indeterminate-gpu`,style:{width:"40%"}})})})},tn=a.jsx("svg",{className:"w-5 h-5 fill-color-yellow-500",fill:"currentColor",viewBox:"0 0 20 20",children:a.jsx("path",{d:"M10 15l-5.878 3.09 1.122-6.545L.488 6.91l6.561-.955L10 0l2.951 5.955 6.561.955-4.756 4.635 1.122 6.545z"})}),on=a.jsx("svg",{className:"w-5 h-5 fill-color-gray-300",fill:"none",stroke:"currentColor",viewBox:"0 0 20 20",children:a.jsx("path",{d:"M10 15l-5.878 3.09 1.122-6.545L.488 6.91l6.561-.955L10 0l2.951 5.955 6.561.955-4.756 4.635 1.122 6.545z"})}),gt={small:"w-4 h-4",medium:"w-6 h-6",large:"w-8 h-8"},$a=({value:e,onChange:o,readOnly:t=!1,disabled:n=!1,precision:r=1,max:i=5,size:l="medium",icon:s,emptyIcon:c,className:u="",showHoverValue:g=!1,showValue:m=!1,labels:p={}})=>{const[d,x]=v.useState(null),f=(y,$)=>{if(t||n||!o)return;const{left:k,width:V}=y.target.getBoundingClientRect(),j=(y.clientX-k)/V;let Z=$-1+Math.ceil(j/r)*r;Z=Math.min(i,Math.max(r,Math.round(Z/r)*r)),o(Z)},w=(y,$)=>{if(t||n)return;const{left:k,width:V}=y.target.getBoundingClientRect(),j=(y.clientX-k)/V;let Z=$-1+Math.ceil(j/r)*r;Z=Math.min(i,Math.max(r,Math.round(Z/r)*r)),x(Z)},b=()=>x(null),z=[];for(let y=1;y<=i;y++){let $=(d!==null?d:e)>=y,k=!$&&(d!==null?d:e)>y-1,V=$?s||v.cloneElement(tn,{className:`fill-color-yellow-500 ${gt[l]}`}):c||v.cloneElement(on,{className:`stroke-color-gray-300 ${gt[l]}`});if(k){const j=((d!==null?d:e)-(y-1))*100;V=a.jsxs("span",{className:"relative block",children:[a.jsx("span",{className:"absolute top-0 left-0 overflow-hidden",style:{width:`${j}%`},children:s||v.cloneElement(tn,{className:`fill-color-yellow-500 ${gt[l]}`})}),c||v.cloneElement(on,{className:`stroke-color-gray-300 ${gt[l]}`})]})}z.push(a.jsx("span",{className:`inline-block ${n?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,onClick:j=>f(j,y),onMouseMove:j=>w(j,y),onMouseLeave:b,tabIndex:t||n?-1:0,"aria-label":`Rate ${y}`,role:"radio","aria-checked":e===y,children:V},y))}return a.jsxs("div",{className:`flex items-center gap-1 ${u}`,role:"radiogroup","aria-disabled":n,children:[z,g&&d!==null?a.jsx("span",{className:"ml-2 text-xs",children:p[d]||d}):m?a.jsx("span",{className:"ml-2 text-xs",children:p[e]||e}):null]})},za=()=>{const[e,o]=v.useState("desktop");return v.useEffect(()=>{const t=()=>{const n=window.innerWidth;n<768?o("mobile"):n<1024?o("tablet"):o("desktop")};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]),e},He=(e,o,t,n,r)=>{switch(r){case"mobile":return e!==void 0?e:n;case"tablet":return o!==void 0?o:n;case"desktop":return t!==void 0?t:n;default:return n}},Ma=({children:e,width:o="100%",height:t="auto",showIndicators:n=!0,showArrows:r=!0,autoplay:i=!1,interval:l=3e3,infiniteLoop:s=!1,perview:c=1,gap:u=0,onClickItem:g,showThumbs:m=!1,pauseOnHover:p=!1,swipeable:d=!0,thumbWidth:x=60,orientation:f="horizontal",nextIcon:w,prevIcon:b,className:z,mobile:y,tablet:$,desktop:k})=>{const V=za(),j=He(y==null?void 0:y.perview,$==null?void 0:$.perview,k==null?void 0:k.perview,c,V),Z=He(y==null?void 0:y.gap,$==null?void 0:$.gap,k==null?void 0:k.gap,u,V),ee=He(y==null?void 0:y.showArrows,$==null?void 0:$.showArrows,k==null?void 0:k.showArrows,r,V),X=He(y==null?void 0:y.showIndicators,$==null?void 0:$.showIndicators,k==null?void 0:k.showIndicators,n,V),G=He(y==null?void 0:y.showThumbs,$==null?void 0:$.showThumbs,k==null?void 0:k.showThumbs,m,V),se=He(y==null?void 0:y.swipeable,$==null?void 0:$.swipeable,k==null?void 0:k.swipeable,d,V),W=e.length,T=Math.min(Math.max(j,.1),W),[D,Q]=v.useState(0),[R,pe]=v.useState(!1),[M,C]=v.useState(!1),[S,A]=v.useState(0),E=v.useRef(null),O=v.useRef(0),Y=v.useRef(0),N=T>=W?0:Math.max(0,W-T),_=K=>Math.max(0,Math.min(K,N)),L=K=>Q(s&&N>0?(K%(N+1)+(N+1))%(N+1):_(K)),H=()=>{s&&N>0?Q(D===0?N:D-1):L(D-1)},B=()=>{s&&N>0?Q(D>=N?0:D+1):L(D+1)};v.useEffect(()=>{if(!i||p&&R||M||N===0)return;const K=setInterval(()=>{Q(ae=>{const Ce=ae+1;return Ce>N?s?0:ae:Ce})},l);return()=>clearInterval(K)},[i,l,R,p,M,N,s]),v.useEffect(()=>{D>N&&Q(Math.min(D,N))},[N,D]);const re=(K,ae)=>{!se||N===0||(C(!0),O.current=f==="horizontal"?K:ae,Y.current=O.current)},P=(K,ae)=>{M&&(Y.current=f==="horizontal"?K:ae,A(Y.current-O.current))},F=()=>{if(!M)return;Math.abs(Y.current-O.current)>50&&(Y.current<O.current?B():H()),C(!1),A(0)},ie=()=>{const K=f==="horizontal"?"X":"Y";let ae=0;if(M&&E.current&&N>0){const I=f==="horizontal"?E.current.offsetWidth:E.current.offsetHeight;ae=S/I*100*(T/W)}const ve=Math.min(D,N)*(100/W)-ae,Ae=D>=N,Be=D<=0?0:Ae?Z/(j/2):Z/j;return`translate${K}(calc(-${ve}% - ${Be}px))`},le=()=>T>=W?1:Math.floor(N)+1,ge=()=>N===0?0:Math.round(D/N*(le()-1));return a.jsxs("div",{className:`relative flex flex-col items-center select-none ${z}`,style:{width:o,height:t},onMouseEnter:()=>p&&pe(!0),onMouseLeave:()=>p&&pe(!1),children:[a.jsxs("div",{ref:E,className:`w-full overflow-hidden relative ${se&&N>0?M?"cursor-grabbing":"cursor-grab":"cursor-default"}`,style:{height:G?`calc(${t} - ${x+20}px)`:t},onMouseDown:K=>{K.preventDefault(),re(K.clientX,K.clientY)},onMouseMove:K=>P(K.clientX,K.clientY),onMouseUp:F,onMouseLeave:F,onTouchStart:K=>re(K.touches[0].clientX,K.touches[0].clientY),onTouchMove:K=>P(K.touches[0].clientX,K.touches[0].clientY),onTouchEnd:F,children:[a.jsx("div",{className:`flex ${f==="horizontal"?"flex-row":"flex-col"} transition-all duration-300 ease-in-out`,style:{width:f==="vertical"?"100%":`calc(${W*100/T}% + ${(W-1)*Z}px)`,height:f==="vertical"?`${W*100/T}%`:"100%",transform:ie(),gap:`${Z}px`,transitionProperty:M?"none":"transform"},children:e.map((K,ae)=>a.jsx("div",{className:"shrink-0 flex items-center justify-center",style:{width:f==="horizontal"?`calc(${100/W}% - ${Z/j}px)`:"100%",height:f==="vertical"?`calc(${100/W}% - ${Z*(W-1)/W}px)`:"100%"},onClick:()=>!M&&(g==null?void 0:g(ae)),children:K},ae))}),ee&&N>0&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button","aria-label":"prev",onClick:H,className:`absolute z-20 bg-color-white/80 border border-color-gray-300 rounded-full w-8 h-8 md:w-10 md:h-10 flex items-center justify-center text-sm md:text-lg font-bold text-color-gray-800 hover:bg-color-white transition-color cursor-pointer
140
+ ${f==="horizontal"?"left-1 md:left-2 top-1/2 -translate-y-1/2":"left-1/2 top-1 md:top-2 -translate-x-1/2"}`,children:b||(f==="horizontal"?"‹":"↑")}),a.jsx("button",{type:"button","aria-label":"next",onClick:B,className:`absolute z-20 bg-color-white/80 border border-color-gray-300 rounded-full w-8 h-8 md:w-10 md:h-10 flex items-center justify-center text-sm md:text-lg font-bold text-color-gray-800 hover:bg-color-white transition-color cursor-pointer
141
+ ${f==="horizontal"?"right-1 md:right-2 top-1/2 -translate-y-1/2":"left-1/2 bottom-1 md:bottom-2 -translate-x-1/2"}`,children:w||(f==="horizontal"?"›":"↓")})]}),X&&le()>1&&a.jsx("div",{className:`uniui-indicator flex gap-1 mt-2 md:mt-3 justify-center absolute bg-color-white/90 py-1 px-[5px] rounded-full ${f==="horizontal"?"bottom-2 md:bottom-3 left-1/2 -translate-x-1/2":"top-1/2 right-2 md:right-3 -translate-y-1/2 rotate-90"} z-10`,children:Array.from({length:le()}).map((K,ae)=>a.jsx("button",{type:"button",onClick:()=>L(Math.round(ae/(le()-1)*N)),className:`w-2 h-2 md:w-[10px] md:h-[10px] rounded-full transition-color hover:bg-color-gray-600 cursor-pointer ${ae===ge()?"bg-color-gray-800":"bg-color-gray-400"}`},ae))})]}),G&&a.jsx("div",{className:"uniui-thumb flex gap-1 md:gap-2 mt-2 md:mt-3 justify-center flex-wrap",children:e.map((K,ae)=>{const Ce=ae===Math.round(D),ve=V==="mobile"?x*.8:x;return a.jsx("div",{onClick:()=>{const Ae=Math.max(0,Math.min(N,ae-Math.floor(T/2)));L(Ae)},className:`overflow-hidden rounded-md cursor-pointer transition-all hover:opacity-100 ${Ce?"border-2 border-color-gray-800 opacity-100 scale-105":"border-2 border-color-gray-300 opacity-70"}`,style:{width:ve,height:ve},children:K},ae)})})]})},Na=({title:e,description:o,actionLabel:t,onAction:n,illustration:r,illustrationWidth:i=120,children:l,color:s="gray",titleClass:c="",descriptionClass:u=""})=>a.jsxs("section",{className:"flex flex-col items-center justify-center text-center p-6 max-w-md",role:"status","aria-live":"polite",children:[r&&a.jsx("div",{className:"flex items-center justify-center",style:{width:i},children:typeof r=="string"?a.jsx("img",{src:r,alt:"",className:"object-contain"}):r}),a.jsx("h2",{className:`text-lg mt-4 font-semibold text-color-gray-800 ${c}`,children:e}),o&&a.jsx("p",{className:`text-sm mt-2 text-color-gray-600 ${u}`,children:o}),t&&n&&a.jsx(ze,{onClick:n,color:s,className:"mt-4",children:t}),l]}),La=({initialState:e=!1,value:o,onToggle:t,disabled:n=!1,type:r="button",color:i="green",variant:l="ios",id:s})=>{var x,f,w;const[c,u]=v.useState(e),[g,m]=v.useState(!1),p=o!==void 0?o:c,d=async()=>{if(n||g)return;const b=!p;if(t){m(!0);try{await t(b),o===void 0&&u(b)}catch(z){console.error("Toggle failed",z)}finally{m(!1)}}else o===void 0&&u(b)};return l==="android"?a.jsxs("button",{onClick:d,id:s,type:r,disabled:n,className:`relative w-10 h-3 flex items-center transition-color duration-300
142
142
  } ${n?"bg-color-gray-200 opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:[a.jsx("span",{className:`absolute rounded-full inset-0 opacity-50 ${p?`${(x=xe[i])==null?void 0:x.filled}`:"bg-color-gray-400"}`}),a.jsx("div",{className:`flex justify-center items-center absolute shadow-md top-0.5 left-0.5 size-5 rounded-full shadow transition-all duration-300 ${p?`translate-x-5 ${(f=xe[i])==null?void 0:f.filled}`:"translate-x-0 bg-color-white"}`,children:g?a.jsx("svg",{className:"animate-spin text-color-gray-500 size-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9995 2C12.5518 2 12.9995 2.44772 12.9995 3V6C12.9995 6.55228 12.5518 7 11.9995 7C11.4472 7 10.9995 6.55228 10.9995 6V3C10.9995 2.44772 11.4472 2 11.9995 2ZM11.9995 17C12.5518 17 12.9995 17.4477 12.9995 18V21C12.9995 21.5523 12.5518 22 11.9995 22C11.4472 22 10.9995 21.5523 10.9995 21V18C10.9995 17.4477 11.4472 17 11.9995 17ZM20.6597 7C20.9359 7.47829 20.772 8.08988 20.2937 8.36602L17.6956 9.86602C17.2173 10.1422 16.6057 9.97829 16.3296 9.5C16.0535 9.02171 16.2173 8.41012 16.6956 8.13398L19.2937 6.63397C19.772 6.35783 20.3836 6.52171 20.6597 7ZM7.66935 14.5C7.94549 14.9783 7.78161 15.5899 7.30332 15.866L4.70525 17.366C4.22695 17.6422 3.61536 17.4783 3.33922 17C3.06308 16.5217 3.22695 15.9101 3.70525 15.634L6.30332 14.134C6.78161 13.8578 7.3932 14.0217 7.66935 14.5ZM20.6597 17C20.3836 17.4783 19.772 17.6422 19.2937 17.366L16.6956 15.866C16.2173 15.5899 16.0535 14.9783 16.3296 14.5C16.6057 14.0217 17.2173 13.8578 17.6956 14.134L20.2937 15.634C20.772 15.9101 20.9359 16.5217 20.6597 17ZM7.66935 9.5C7.3932 9.97829 6.78161 10.1422 6.30332 9.86602L3.70525 8.36602C3.22695 8.08988 3.06308 7.47829 3.33922 7C3.61536 6.52171 4.22695 6.35783 4.70525 6.63397L7.30332 8.13398C7.78161 8.41012 7.94549 9.02171 7.66935 9.5Z"})}):null})]}):a.jsx("button",{onClick:d,id:s,type:r,disabled:n,className:`relative w-11 h-6 flex items-center rounded-full transition-color duration-300 ${p?(w=xe[i])==null?void 0:w.filled:"bg-color-gray-300"} ${n?"bg-color-gray-300 opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:a.jsx("div",{className:`absolute top-[4px] left-1 w-4 h-4 bg-color-white rounded-full flex items-center justify-center transition-all duration-300 ${p?"translate-x-[19px]":"-translate-x-0"}`,children:g?a.jsx("svg",{className:"animate-spin text-color-gray-500 size-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9995 2C12.5518 2 12.9995 2.44772 12.9995 3V6C12.9995 6.55228 12.5518 7 11.9995 7C11.4472 7 10.9995 6.55228 10.9995 6V3C10.9995 2.44772 11.4472 2 11.9995 2ZM11.9995 17C12.5518 17 12.9995 17.4477 12.9995 18V21C12.9995 21.5523 12.5518 22 11.9995 22C11.4472 22 10.9995 21.5523 10.9995 21V18C10.9995 17.4477 11.4472 17 11.9995 17ZM20.6597 7C20.9359 7.47829 20.772 8.08988 20.2937 8.36602L17.6956 9.86602C17.2173 10.1422 16.6057 9.97829 16.3296 9.5C16.0535 9.02171 16.2173 8.41012 16.6956 8.13398L19.2937 6.63397C19.772 6.35783 20.3836 6.52171 20.6597 7ZM7.66935 14.5C7.94549 14.9783 7.78161 15.5899 7.30332 15.866L4.70525 17.366C4.22695 17.6422 3.61536 17.4783 3.33922 17C3.06308 16.5217 3.22695 15.9101 3.70525 15.634L6.30332 14.134C6.78161 13.8578 7.3932 14.0217 7.66935 14.5ZM20.6597 17C20.3836 17.4783 19.772 17.6422 19.2937 17.366L16.6956 15.866C16.2173 15.5899 16.0535 14.9783 16.3296 14.5C16.6057 14.0217 17.2173 13.8578 17.6956 14.134L20.2937 15.634C20.772 15.9101 20.9359 16.5217 20.6597 17ZM7.66935 9.5C7.3932 9.97829 6.78161 10.1422 6.30332 9.86602L3.70525 8.36602C3.22695 8.08988 3.06308 7.47829 3.33922 7C3.61536 6.52171 4.22695 6.35783 4.70525 6.63397L7.30332 8.13398C7.78161 8.41012 7.94549 9.02171 7.66935 9.5Z"})}):null})})},Ea={small:"px-2 py-1 text-sm",medium:"px-4 py-2 text-base",large:"px-6 py-3 text-lg"},Pa=({value:e,onChange:o,options:t,multiple:n=!1,size:r="medium",color:i="blue",orientation:l="horizontal",className:s="",buttonClass:c="",disabled:u=!1})=>{const g=p=>Array.isArray(e)?e.includes(p):e===p,m=p=>{if(!u)if(n){if(!Array.isArray(e))return;e.includes(p)?o(e.filter(d=>d!==p)):o([...e,p])}else o(p)};return a.jsx("div",{className:`inline-flex ${l==="vertical"?"flex-col":"flex-row"} rounded-md overflow-hidden border border-color-gray-200 bg-color-white ${s}`,role:"group","aria-disabled":u,children:t.map((p,d)=>{var x;return a.jsxs("button",{type:"button",disabled:u||p.disabled,className:`
143
143
  flex items-center justify-center gap-2 border-0 ${l==="vertical"?"not-last:border-b-1":"not-last:border-r-1"} border-color-gray-200
144
144
  ${Ea[r]}
@@ -153,21 +153,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
153
153
  ${L?H?"border-color-red-500 bg-red-50":`${k}`:"border-color-gray-300 bg-white hover:border-color-gray-400"}
154
154
  ${_?"":"hover:shadow-md"}
155
155
  ${$}
156
- `,onClick:B=>{B.stopPropagation(),!_&&R(E,N)},children:[L&&H&&a.jsx("div",{className:"absolute top-2 right-2 w-6 h-6 bg-color-red-500 rounded-full flex items-center justify-center",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-4 h-4 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),!X&&L&&!H&&V&&a.jsx("div",{className:`absolute rounded-full flex items-center justify-center shadow-sm ${Z}`,children:j||a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:`${ee} text-color-white`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),a.jsxs("div",{className:`flex items-start gap-3 ${H?"text-color-red-700":""}`,children:[X&&a.jsx("button",{type:"button",onClick:B=>{B.stopPropagation(),_||R(E,N)},disabled:_,className:`mt-1 flex-shrink-0 rounded-full bg-color-gray-300 transition-all duration-150 ${D(p)} ${_?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,"aria-checked":L,children:L&&!H&&a.jsx("div",{className:"w-full h-full flex items-center justify-center",children:G||j||a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:`${ee} text-color-green-500`,fill:"currentColor",viewBox:"0 0 24 24",children:[a.jsx("circle",{cx:"12",cy:"12",r:"8"}),a.jsx("circle",{cx:"12",cy:"12",r:"3",fill:"currentColor"})]})})}),a.jsx("div",{className:"flex-1",children:A})]})]})},E)})}),d&&!x&&a.jsx("div",{id:S,className:"mt-2 text-sm text-color-gray-600",children:d}),x&&!f&&d&&a.jsx("div",{id:S,className:"mt-2 text-sm text-color-red-600",children:d})]}):a.jsxs("div",{className:"w-full",children:[x&&f&&a.jsx("div",{className:"mb-3 p-3 bg-red-50 rounded text-color-red-700 text-sm",role:"alert",id:`${e}-error`,children:f}),a.jsx("div",{role:"radiogroup","aria-label":b,"aria-labelledby":z,"aria-describedby":S,"aria-required":w,className:`flex ${s==="row"?"flex-row gap-6":"flex-col gap-3"} ${g}`,children:o.map(({label:A,value:E,disabled:O,id:Y},N)=>{const _=c||O,L=T===E,H=x&&L;return a.jsxs("label",{className:`relative flex items-center cursor-pointer select-none transition ${_?"opacity-50 cursor-not-allowed":"hover:opacity-90"}`,children:[a.jsx("input",{type:"radio",name:e,value:E,disabled:_,checked:L,onChange:()=>!_&&R(E,N),onBlur:pe,onFocus:B=>M(B,N),className:"sr-only peer","aria-invalid":x,...Y&&{id:Y}}),a.jsx("div",{className:`rounded-full border-2 transition-all duration-150 ${H?"border-color-red-500 peer-checked:border-[7px] peer-checked:border-color-red-500":`border-color-gray-400 peer-checked:border-[7px] ${C.border}`} ${m} ${D(p)}`}),a.jsx("span",{className:`ml-2 text-sm ${H?"text-color-red-500":C.text}`,children:A})]},E)})}),d&&!x&&a.jsx("div",{id:S,className:"mt-2 text-sm text-color-gray-600",children:d}),x&&!f&&d&&a.jsx("div",{id:S,className:"mt-2 text-sm text-color-red-600",children:d})]})},Ta=({label:e,value:o,onChange:t,options:n,className:r="",labelClass:i="",inputClass:l="",disabled:s=!1,size:c="medium",variant:u="outlined",rounded:g="medium",shadow:m=!1})=>{const p={small:"p-2",medium:"p-3",large:"p-4"},d={small:"rounded-md",medium:"rounded-lg",full:"rounded-full"},x={filled:"bg-color-gray-100 border-color-gray-200",outlined:"border-color-gray-300 bg-color-transparent"};return a.jsxs("div",{className:`relative w-full ${r}`,children:[e&&a.jsx("label",{className:`text-sm text-color-gray-500 pointer-events-none block mb-1 ${i}`,children:e}),a.jsxs("div",{className:"relative",children:[a.jsx("select",{disabled:s,value:o,onChange:f=>t(f.target.value),className:`appearance-none focus:ring-1 text-color-gray-800 w-full border outline-none transition-all ${d[g]} ${p[c]} ${x[u]} ${s?"!bg-color-gray-50 opacity-60 cursor-not-allowed":""} ${m?"shadow-md shadow-color-zinc-100":""} ${l}`,children:n.map(f=>a.jsx("option",{value:f.value,className:"text-color-gray-900",children:f.label},f.value))}),a.jsx("span",{className:`absolute right-3 text-sm top-1/2 -translate-y-1/2 ${s?"opacity-60":""}`,children:a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"})})})]})]})},Ia=({content:e,children:o,position:t="top"})=>{const[n,r]=v.useState(!1),[i,l]=v.useState({top:0,left:0}),s=v.useRef(null),c=v.useRef(null);return v.useEffect(()=>{if(n&&s.current&&c.current){const u=s.current.getBoundingClientRect(),g=c.current.getBoundingClientRect();let m=0,p=0;switch(t){case"top":m=u.top-g.height-8,p=u.left+u.width/2-g.width/2;break;case"bottom":m=u.bottom+8,p=u.left+u.width/2-g.width/2;break;case"left":m=u.top+u.height/2-g.height/2,p=u.left-g.width-8;break;case"right":m=u.top+u.height/2-g.height/2,p=u.right+8;break}l({top:m,left:p})}},[n,t]),a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:s,className:"inline-block",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:o}),n&&qe.createPortal(a.jsx("div",{ref:c,style:{top:i.top,left:i.left},className:"fixed z-50 text-center px-2 max-w-xs py-1 text-sm text-color-white bg-color-gray-800 rounded shadow-md pointer-events-none",children:e}),document.body)]})};function Da(...e){return e.filter(Boolean).join(" ")}const ja={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl","4xl":"max-w-4xl","6xl":"max-w-6xl"},We=v.forwardRef(({open:e,onClose:o,shouldClose:t=!0,className:n,title:r,children:i,actions:l,showCloseIcon:s=!0,fullscreen:c=!1,fullWidth:u=!1,maxWidth:g},m)=>{const[p,d]=v.useState(e||!1),[x,f]=v.useState(!1),[w,b]=v.useState(!1);v.useEffect(()=>{e!==void 0&&d(e)},[e]),v.useImperativeHandle(m,()=>({open:()=>d(!0),close:()=>{b(!1),setTimeout(()=>d(!1),300)}})),v.useEffect(()=>{let y;return p?(f(!0),y=setTimeout(()=>b(!0),10)):b(!1),()=>clearTimeout(y)},[p]);const z=()=>{p||f(!1)};return v.useEffect(()=>{const y=$=>{$.key==="Escape"&&(o==null||o())};return p&&document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[p,o]),v.useEffect(()=>(p?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[p]),x?qe.createPortal(a.jsxs("div",{className:Da("fixed inset-0 z-50 flex items-center justify-center transition-opacity duration-300",w?"opacity-100":"opacity-0 pointer-events-none"),children:[a.jsx("div",{className:"fixed inset-0 bg-color-black/50",onClick:()=>{t&&(o(),d(!1))}}),a.jsxs("div",{className:`relative flex flex-col z-50 bg-color-white rounded-xl shadow-lg transition-all duration-300 transform p-6 ${w?"opacity-100 scale-100":"opacity-0 scale-95"} ${c?"w-full h-[calc(100%_-_40px)] m-5":`${u?"w-full":"w-auto"} ${g?ja[g]:""} mx-5`} ${n}`,onTransitionEnd:z,children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r&&a.jsx("h2",{className:"text-xl font-semibold",children:r}),s&&a.jsx(_e,{color:"gray",icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"})}),size:"small",roundedFull:!0,onClick:()=>{t&&(o(),d(!1))},variant:"transparent"})]}),a.jsx("div",{className:"grow lg:max-h-[calc(100vh_-_200px)] max-h-[calc(100vh_-_130px)] overflow-y-auto",children:i}),l&&a.jsx("div",{className:"mt-8",children:l})]})]}),document.body):null});function Oa({items:e,trigger:o,className:t,dropdownItemClass:n,positioning:r="fixed"}){const[i,l]=v.useState(!1),[s,c]=v.useState({top:0,left:0}),[u,g]=v.useState(!1),m=v.useRef(null),p=v.useRef(null),d=f=>{f.stopPropagation(),l(w=>!w),g(!1),i||c(r==="fixed"?{top:f.clientY,left:f.clientX}:{top:f.clientY+window.scrollY,left:f.clientX+window.scrollX})};v.useLayoutEffect(()=>{if(i&&p.current){const f=p.current.getBoundingClientRect(),w=window.innerWidth,b=window.innerHeight;let{left:z,top:y}=s;const $=z,k=y;if(r==="fixed")z+f.width>w&&(z=w-f.width-12),z<12&&(z=12),y+f.height>b&&(y=k-f.height),y<12&&(y=12);else{const V=window.scrollX,j=window.scrollY;z-V+f.width>w&&(z=V+w-f.width-12),z<V+12&&(z=V+12),y-j+f.height>b&&(y=k-f.height),y<j+12&&(y=j+12)}(z!==$||y!==k)&&c({top:y,left:z}),setTimeout(()=>{g(!0)},150)}},[i,r]),v.useEffect(()=>{const f=w=>{var b;p.current&&!p.current.contains(w.target)&&!((b=m.current)!=null&&b.contains(w.target))&&l(!1)};return i&&document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[i]);const x=a.jsx("div",{ref:p,className:`${r} mt-2 z-50 rounded-xl bg-color-white shadow-xl p-2 min-w-[160px] transition-all duration-200 transform ${u?"opacity-100 scale-100":"opacity-0 scale-95"} ${t}`,style:{top:s.top,left:s.left},children:e.map((f,w)=>a.jsxs("button",{disabled:f.disabled,onClick:()=>{var b;(b=f.onClick)==null||b.call(f),l(!1)},className:`flex items-center gap-3 w-full text-left px-3 py-2 bg-color-transparent hover:bg-color-gray-100 transition-all cursor-pointer rounded-md text-md text-color-gray-700 ${f.disabled?"opacity-50 hover:bg-color-transparent !cursor-not-allowed":""} ${n} ${f.itemClass}`,children:[f.icon&&a.jsx("span",{children:f.icon}),a.jsx("span",{children:f.label})]},w))});return a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:m,onClick:d,className:"cursor-pointer",children:o}),i&&qe.createPortal(x,document.body)]})}function Va(...e){return e.filter(Boolean).join(" ")}const sn=({open:e,onClose:o,className:t,title:n,children:r,childrenClass:i,actions:l,showCloseIcon:s=!0,anchor:c="left"})=>{const[u,g]=v.useState(!1),[m,p]=v.useState(!1);v.useEffect(()=>{let w;return e?(g(!0),w=setTimeout(()=>{p(!0)},10)):p(!1),()=>clearTimeout(w)},[e]);const d=()=>{e||g(!1)};if(v.useEffect(()=>{const w=b=>{b.key==="Escape"&&(o==null||o())};return e&&document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[e,o]),v.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),!u)return null;const x={left:"left-0 top-0 h-full min-w-96 transition-all duration-300",right:"right-0 top-0 h-full min-w-96 transition-all duration-300",top:"top-0 left-0 w-full min-h-40 transition-all duration-300",bottom:"bottom-0 left-0 w-full min-h-40 transition-all duration-300"},f={left:m?"translate-x-0":"-translate-x-full",right:m?"translate-x-0":"translate-x-full",top:m?"translate-y-0":"-translate-y-full",bottom:m?"translate-y-0":"translate-y-full"};return qe.createPortal(a.jsxs("div",{className:Va("fixed inset-0 z-50 transition-opacity duration-300",m?"opacity-100":"opacity-0 pointer-events-none"),children:[a.jsx("div",{className:"fixed inset-0 bg-color-black/50",onClick:o}),a.jsxs("div",{className:`
156
+ `,onClick:B=>{B.stopPropagation(),!_&&R(E,N)},children:[L&&H&&a.jsx("div",{className:"absolute top-2 right-2 w-6 h-6 bg-color-red-500 rounded-full flex items-center justify-center",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-4 h-4 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),!X&&L&&!H&&V&&a.jsx("div",{className:`absolute rounded-full flex items-center justify-center shadow-sm ${Z}`,children:j||a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:`${ee} text-color-white`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),a.jsxs("div",{className:`flex items-start gap-3 ${H?"text-color-red-700":""}`,children:[X&&a.jsx("button",{type:"button",onClick:B=>{B.stopPropagation(),_||R(E,N)},disabled:_,className:`mt-1 flex-shrink-0 rounded-full bg-color-gray-300 transition-all duration-150 ${D(p)} ${_?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,"aria-checked":L,children:L&&!H&&a.jsx("div",{className:"w-full h-full flex items-center justify-center",children:G||j||a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:`${ee} text-color-green-500`,fill:"currentColor",viewBox:"0 0 24 24",children:[a.jsx("circle",{cx:"12",cy:"12",r:"8"}),a.jsx("circle",{cx:"12",cy:"12",r:"3",fill:"currentColor"})]})})}),a.jsx("div",{className:"flex-1",children:A})]})]})},E)})}),d&&!x&&a.jsx("div",{id:S,className:"mt-2 text-sm text-color-gray-600",children:d}),x&&!f&&d&&a.jsx("div",{id:S,className:"mt-2 text-sm text-color-red-600",children:d})]}):a.jsxs("div",{className:"w-full",children:[x&&f&&a.jsx("div",{className:"mb-3 p-3 bg-red-50 rounded text-color-red-700 text-sm",role:"alert",id:`${e}-error`,children:f}),a.jsx("div",{role:"radiogroup","aria-label":b,"aria-labelledby":z,"aria-describedby":S,"aria-required":w,className:`flex ${s==="row"?"flex-row gap-6":"flex-col gap-3"} ${g}`,children:o.map(({label:A,value:E,disabled:O,id:Y},N)=>{const _=c||O,L=T===E,H=x&&L;return a.jsxs("label",{className:`relative flex items-center cursor-pointer select-none transition ${_?"opacity-50 cursor-not-allowed":"hover:opacity-90"}`,children:[a.jsx("input",{type:"radio",name:e,value:E,disabled:_,checked:L,onChange:()=>!_&&R(E,N),onBlur:pe,onFocus:B=>M(B,N),className:"sr-only peer","aria-invalid":x,...Y&&{id:Y}}),a.jsx("div",{className:`rounded-full border-2 transition-all duration-150 ${H?"border-color-red-500 peer-checked:border-[7px] peer-checked:border-color-red-500":`border-color-gray-400 peer-checked:border-[7px] ${C.border}`} ${m} ${D(p)}`}),a.jsx("span",{className:`ml-2 text-sm ${H?"text-color-red-500":C.text}`,children:A})]},E)})}),d&&!x&&a.jsx("div",{id:S,className:"mt-2 text-sm text-color-gray-600",children:d}),x&&!f&&d&&a.jsx("div",{id:S,className:"mt-2 text-sm text-color-red-600",children:d})]})},Ta=({label:e,value:o,onChange:t,options:n,className:r="",labelClass:i="",inputClass:l="",disabled:s=!1,size:c="medium",variant:u="outlined",rounded:g="medium",shadow:m=!1})=>{const p={small:"p-2",medium:"p-3",large:"p-4"},d={small:"rounded-md",medium:"rounded-lg",full:"rounded-full"},x={filled:"bg-color-gray-100 border-color-gray-200",outlined:"border-color-gray-300 bg-color-transparent"};return a.jsxs("div",{className:`relative w-full ${r}`,children:[e&&a.jsx("label",{className:`text-sm text-color-gray-500 pointer-events-none block mb-1 ${i}`,children:e}),a.jsxs("div",{className:"relative",children:[a.jsx("select",{disabled:s,value:o,onChange:f=>t(f.target.value),className:`appearance-none focus:ring-1 text-color-gray-800 w-full border outline-none transition-all ${d[g]} ${p[c]} ${x[u]} ${s?"!bg-color-gray-50 opacity-60 cursor-not-allowed":""} ${m?"shadow-md shadow-color-zinc-100":""} ${l}`,children:n.map(f=>a.jsx("option",{value:f.value,className:"text-color-gray-900",children:f.label},f.value))}),a.jsx("span",{className:`absolute right-3 text-sm top-1/2 -translate-y-1/2 ${s?"opacity-60":""}`,children:a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"})})})]})]})},Ia=({content:e,children:o,position:t="top"})=>{const[n,r]=v.useState(!1),[i,l]=v.useState({top:0,left:0}),s=v.useRef(null),c=v.useRef(null);return v.useEffect(()=>{if(n&&s.current&&c.current){const u=s.current.getBoundingClientRect(),g=c.current.getBoundingClientRect();let m=0,p=0;switch(t){case"top":m=u.top-g.height-8,p=u.left+u.width/2-g.width/2;break;case"bottom":m=u.bottom+8,p=u.left+u.width/2-g.width/2;break;case"left":m=u.top+u.height/2-g.height/2,p=u.left-g.width-8;break;case"right":m=u.top+u.height/2-g.height/2,p=u.right+8;break}l({top:m,left:p})}},[n,t]),a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:s,className:"inline-block",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:o}),n&&qe.createPortal(a.jsx("div",{ref:c,style:{top:i.top,left:i.left},className:"fixed z-50 text-center px-2 max-w-xs py-1 text-sm text-color-white bg-color-gray-800 rounded shadow-md pointer-events-none",children:e}),document.body)]})};function Da(...e){return e.filter(Boolean).join(" ")}const ja={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl","4xl":"max-w-4xl","6xl":"max-w-6xl"},We=v.forwardRef(({open:e,onClose:o,shouldClose:t=!1,className:n,title:r,children:i,actions:l,showCloseIcon:s=!0,fullscreen:c=!1,fullWidth:u=!1,maxWidth:g},m)=>{const[p,d]=v.useState(e||!1),[x,f]=v.useState(!1),[w,b]=v.useState(!1);v.useEffect(()=>{e!==void 0&&d(e)},[e]),v.useImperativeHandle(m,()=>({open:()=>d(!0),close:()=>{b(!1),setTimeout(()=>d(!1),300)}})),v.useEffect(()=>{let y;return p?(f(!0),y=setTimeout(()=>b(!0),10)):b(!1),()=>clearTimeout(y)},[p]);const z=()=>{p||f(!1)};return v.useEffect(()=>{const y=$=>{$.key==="Escape"&&(o==null||o())};return p&&document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[p,o]),v.useEffect(()=>(p?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[p]),x?qe.createPortal(a.jsxs("div",{className:Da("fixed inset-0 z-50 flex items-center justify-center transition-opacity duration-300",w?"opacity-100":"opacity-0 pointer-events-none"),children:[a.jsx("div",{className:"fixed inset-0 bg-color-black/50",onClick:()=>{t&&(o(),d(!1))}}),a.jsxs("div",{className:`relative flex flex-col z-50 bg-color-white rounded-xl shadow-lg transition-all duration-300 transform p-6 ${w?"opacity-100 scale-100":"opacity-0 scale-95"} ${c?"w-full h-[calc(100%_-_40px)] m-5":`${u?"w-full":"w-auto"} ${g?ja[g]:""} mx-5`} ${n}`,onTransitionEnd:z,children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r&&a.jsx("h2",{className:"text-xl font-semibold",children:r}),s&&a.jsx(_e,{color:"gray",icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"})}),size:"small",roundedFull:!0,onClick:()=>{o==null||o(),d(!1)},variant:"transparent"})]}),a.jsx("div",{className:"grow lg:max-h-[calc(100vh_-_200px)] max-h-[calc(100vh_-_130px)] overflow-y-auto",children:i}),l&&a.jsx("div",{className:"mt-8",children:l})]})]}),document.body):null});function Oa({items:e,trigger:o,className:t,dropdownItemClass:n,positioning:r="fixed"}){const[i,l]=v.useState(!1),[s,c]=v.useState({top:0,left:0}),[u,g]=v.useState(!1),m=v.useRef(null),p=v.useRef(null),d=f=>{f.stopPropagation(),l(w=>!w),g(!1),i||c(r==="fixed"?{top:f.clientY,left:f.clientX}:{top:f.clientY+window.scrollY,left:f.clientX+window.scrollX})};v.useLayoutEffect(()=>{if(i&&p.current){const f=p.current.getBoundingClientRect(),w=window.innerWidth,b=window.innerHeight;let{left:z,top:y}=s;const $=z,k=y;if(r==="fixed")z+f.width>w&&(z=w-f.width-12),z<12&&(z=12),y+f.height>b&&(y=k-f.height),y<12&&(y=12);else{const V=window.scrollX,j=window.scrollY;z-V+f.width>w&&(z=V+w-f.width-12),z<V+12&&(z=V+12),y-j+f.height>b&&(y=k-f.height),y<j+12&&(y=j+12)}(z!==$||y!==k)&&c({top:y,left:z}),setTimeout(()=>{g(!0)},150)}},[i,r]),v.useEffect(()=>{const f=w=>{var b;p.current&&!p.current.contains(w.target)&&!((b=m.current)!=null&&b.contains(w.target))&&l(!1)};return i&&document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[i]);const x=a.jsx("div",{ref:p,className:`${r} mt-2 z-50 rounded-xl bg-color-white shadow-xl p-2 min-w-[160px] transition-all duration-200 transform ${u?"opacity-100 scale-100":"opacity-0 scale-95"} ${t}`,style:{top:s.top,left:s.left},children:e.map((f,w)=>a.jsxs("button",{type:"button",disabled:f.disabled,onClick:()=>{var b;(b=f.onClick)==null||b.call(f),l(!1)},className:`flex items-center gap-3 w-full text-left px-3 py-2 bg-color-transparent hover:bg-color-gray-100 transition-all cursor-pointer rounded-md text-md text-color-gray-700 ${f.disabled?"opacity-50 hover:bg-color-transparent !cursor-not-allowed":""} ${n} ${f.itemClass}`,children:[f.icon&&a.jsx("span",{children:f.icon}),a.jsx("span",{children:f.label})]},w))});return a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:m,onClick:d,className:"cursor-pointer",children:o}),i&&qe.createPortal(x,document.body)]})}function Va(...e){return e.filter(Boolean).join(" ")}const sn=({open:e,onClose:o,className:t,title:n,children:r,childrenClass:i,actions:l,showCloseIcon:s=!0,anchor:c="left"})=>{const[u,g]=v.useState(!1),[m,p]=v.useState(!1);v.useEffect(()=>{let w;return e?(g(!0),w=setTimeout(()=>{p(!0)},10)):p(!1),()=>clearTimeout(w)},[e]);const d=()=>{e||g(!1)};if(v.useEffect(()=>{const w=b=>{b.key==="Escape"&&(o==null||o())};return e&&document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[e,o]),v.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),!u)return null;const x={left:"left-0 top-0 h-full min-w-96 transition-all duration-300",right:"right-0 top-0 h-full min-w-96 transition-all duration-300",top:"top-0 left-0 w-full min-h-40 transition-all duration-300",bottom:"bottom-0 left-0 w-full min-h-40 transition-all duration-300"},f={left:m?"translate-x-0":"-translate-x-full",right:m?"translate-x-0":"translate-x-full",top:m?"translate-y-0":"-translate-y-full",bottom:m?"translate-y-0":"translate-y-full"};return qe.createPortal(a.jsxs("div",{className:Va("fixed inset-0 z-50 transition-opacity duration-300",m?"opacity-100":"opacity-0 pointer-events-none"),children:[a.jsx("div",{className:"fixed inset-0 bg-color-black/50",onClick:o}),a.jsxs("div",{className:`
157
157
  fixed bg-color-white shadow-lg z-50 p-6 flex flex-col
158
158
  ${x[c]}
159
159
  ${f[c]}
160
160
  ${t}
161
- `,onTransitionEnd:d,children:[s&&a.jsx(_e,{color:"gray",icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"})}),size:"small",roundedFull:!0,className:"!absolute right-3 top-3 z-99",onClick:o,variant:"transparent"}),n&&a.jsx("h2",{className:"text-xl font-semibold mb-4",children:n}),a.jsx("div",{className:`grow overflow-y-auto ${i}`,children:r}),l&&a.jsx("div",{className:"mt-4",children:l})]})]}),document.body)},Ha=({title:e,content:o,expandIcon:t=a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"})}),collapseIcon:n=a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"})}),isOpen:r,defaultExpanded:i=!1,onToggle:l,className:s="",titleClass:c="",contentClass:u=""})=>{const[g,m]=v.useState(i),p=r!==void 0,d=p?r:g,x=()=>{const f=!d;p||m(f),l==null||l(f)};return v.useEffect(()=>{p&&m(r)},[r]),a.jsxs("div",{className:`overflow-hidden w-full border border-color-gray-100 ${s}`,children:[a.jsxs("button",{onClick:x,className:`flex justify-between items-center w-full p-4 bg-color-gray-50 hover:bg-color-gray-200 transition ${c}`,children:[a.jsx("div",{className:"text-left text-sm font-medium",children:e}),a.jsx("div",{className:"transition-transform duration-300",children:d?t:n})]}),a.jsx("div",{className:`grid overflow-hidden transition-all duration-300 ease-in-out grid-rows-[0fr] ${d?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"}`,children:a.jsx("div",{className:"overflow-hidden",children:a.jsx("div",{className:`p-4 text-sm text-color-gray-700 ${u}`,children:o})})})]})},Ba={info:"bg-color-blue-50 border-color-blue-300 text-color-blue-800",success:"bg-color-green-50 border-color-green-300 text-color-green-800",danger:"bg-color-red-50 border-color-red-300 text-color-red-800",warning:"bg-color-yellow-50 border-color-yellow-300 text-color-yellow-800",dark:"bg-color-gray-100 border-color-gray-300 text-color-gray-800"},Ga={info:a.jsx("svg",{className:"text-color-blue-800 shrink-0 size-7",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 7H13V9H11V7ZM11 11H13V17H11V11Z"})}),success:a.jsx("svg",{className:"text-color-green-800 shrink-0 size-7",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12ZM12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM17.4571 9.45711L16.0429 8.04289L11 13.0858L8.20711 10.2929L6.79289 11.7071L11 15.9142L17.4571 9.45711Z"})}),danger:a.jsx("svg",{className:"text-color-red-800 shrink-0 size-7",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 10.5858L14.8284 7.75736L16.2426 9.17157L13.4142 12L16.2426 14.8284L14.8284 16.2426L12 13.4142L9.17157 16.2426L7.75736 14.8284L10.5858 12L7.75736 9.17157L9.17157 7.75736L12 10.5858Z"})}),warning:a.jsx("svg",{className:"text-color-yellow-800 shrink-0 size-7",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM11 7H13V13H11V7Z"})}),dark:a.jsx("svg",{className:"text-color-gray-800 shrink-0 size-7",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 7H13V9H11V7ZM11 11H13V17H11V11Z"})})},qa={info:"bg-color-blue-500",success:"bg-color-green-500",danger:"bg-color-red-500",warning:"bg-color-yellow-500",dark:"bg-color-gray-700"},Ya=({message:e,variant:o="info",onClose:t,autoClose:n=!1,className:r="",autoCloseDuration:i=5e3})=>{const[l,s]=v.useState(!0),c=v.useRef(null);return v.useEffect(()=>{let u;return n&&(requestAnimationFrame(()=>{c.current&&(c.current.style.transition=`width ${i}ms linear`,c.current.style.width="0%")}),u=setTimeout(()=>{s(!1),t==null||t()},i)),()=>clearTimeout(u)},[n,i,t]),l?a.jsxs("div",{className:`relative border-t-4 p-4 flex items-start justify-between ${Ba[o]} ${r}`,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[Ga[o],a.jsx("span",{dangerouslySetInnerHTML:{__html:e}})]}),a.jsx("button",{onClick:()=>{s(!1),t==null||t()},"aria-label":"Close alert",className:"ml-4 bg-color-transparent cursor-pointer hover:bg-color-white rounded-full p-1 transition-color",children:a.jsx("svg",{className:`size-5 ${o==="dark"?"text-color-gray-700":""}`,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"})})}),n&&a.jsx("div",{className:"absolute -top-1 left-0 h-1 w-full bg-color-transparent overflow-hidden",children:a.jsx("div",{ref:c,className:`${qa[o]} h-1`,style:{width:"100%"}})})]}):null},Za=({children:e,count:o,showDot:t=!1,max:n=99,color:r="red",position:i="top-right"})=>{const l=()=>{var u,g;if(t)return a.jsx("span",{className:`h-2 w-2 rounded-full ${(u=xe[r])==null?void 0:u.filled} block`});if(o===0||o===void 0)return null;const c=o>n?`${n}+`:o;return a.jsx("span",{className:`text-color-white text-xs px-[10px] py-1 rounded-full whitespace-nowrap ${(g=xe[r])==null?void 0:g.filled}`,children:c})},s={"top-left":"top-0 left-0 -translate-x-1/2 -translate-y-1/2","bottom-right":"bottom-0 right-0 translate-x-1/2 translate-y-1/2","bottom-left":"bottom-0 left-0 -translate-x-1/2 translate-y-1/2","top-right":"top-0 right-0 translate-x-1/2 -translate-y-1/2"};return a.jsxs("div",{className:"relative inline-block",children:[e,a.jsx("span",{className:`absolute ${s[i]}`,children:l()})]})},Ua=({variant:e="fixed",activeTab:o,navItems:t,onTabChange:n,className:r="",activeClass:i="",buttonClass:l=""})=>{const s={fixed:"fixed bottom-0 left-0 right-0",floating:"fixed bottom-4 left-4 right-4 rounded-full",static:"static w-full"};return a.jsx("nav",{className:`flex justify-around items-center bg-color-white shadow-sm text-color-gray-600 py-2 px-4 ${s[e]} ${r}`,children:t.map(c=>{const u=c.label===o;return a.jsxs("a",{href:c.path,onClick:()=>n(c.label),className:`flex flex-col items-center text-sm cursor-pointer text-color-gray-500 no-underline ${l}`,children:[a.jsx("span",{className:`text-xl ${u?`text-color-blue-500 ${i}`:""}`,children:c.icon}),a.jsx("span",{className:`text-xs font-medium mt-1 ${u?`text-color-blue-500 ${i}`:""}`,children:c.label})]},c.label)})})},Wa=({items:e,separator:o="/",className:t="",itemClass:n="",spanClass:r="",separatorClass:i=""})=>a.jsx("nav",{className:`text-sm text-color-gray-600 ${t}`,"aria-label":"Breadcrumb",children:a.jsx("ol",{className:"flex items-center space-x-1",children:e.map((l,s)=>a.jsxs("li",{className:"flex items-center",children:[l.href?a.jsx("a",{href:l.href,className:`text-color-gray-800 hover:underline font-medium ${n}`,children:l.label}):a.jsx("span",{className:`text-color-gray-500 font-medium ${r}`,children:l.label}),s<e.length-1&&a.jsx("span",{className:`mx-2 text-color-gray-400 ${i}`,children:o})]},s))})}),Ka=a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM13 12V7H11V14H17V12H13Z"})}),cn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Xa=["Su","Mo","Tu","We","Th","Fr","Sa"],Ja=({mode:e="single",type:o="inline",showTime:t=!1,onlyTime:n=!1,fromToTime:r=!1,className:i,onChange:l,onConfirm:s,onCancel:c,placeholder:u="Select date",icon:g=Ka,disableBefore:m,disableAfter:p,selectedDate:d,hideFutureDates:x=!1,defaultDate:f,fromDate:w,toDate:b,minimumDate:z,maxDate:y,defaultTime:$,fromTime:k,toTime:V})=>{const[j,Z]=v.useState(!1),[ee,X]=v.useState(null),[G,se]=v.useState(w||b?new Date:f?new Date(typeof f=="string"?parseInt(f):f):new Date),[W,T]=v.useState(d?new Date(d):f&&!d?new Date(typeof f=="string"?parseInt(f):f):null),[D,Q]=v.useState(w?new Date(w):null),[R,pe]=v.useState(b?new Date(b):null),[M,C]=v.useState(null),[S,A]=v.useState({hour:12,minute:0,ampm:"AM"}),E=v.useRef(null),[O,Y]=v.useState(d?new Date(d):f&&!d?new Date(typeof f=="string"?parseInt(f):f):null),[N,_]=v.useState(w?new Date(w):null),[L,H]=v.useState(b?new Date(b):null),[B,re]=v.useState(!1),[P,F]=v.useState(!1),[ie,le]=v.useState(!1),[ge,K]=v.useState({hour:12,minute:0,ampm:"AM"}),[ae,Ce]=v.useState({hour:12,minute:0,ampm:"AM"}),[ve,Ae]=v.useState(k?new Date(k):null),[Le,Be]=v.useState(V?new Date(V):null);v.useEffect(()=>{if(k){const h=new Date(k);Ae(h);let U=h.getHours();const ne=U>=12?"PM":"AM";U=U%12||12,K({hour:U,minute:h.getMinutes(),ampm:ne})}},[k]),v.useEffect(()=>{if(V){const h=new Date(V);Be(h);let U=h.getHours();const ne=U>=12?"PM":"AM";U=U%12||12,Ce({hour:U,minute:h.getMinutes(),ampm:ne})}},[V]),v.useEffect(()=>{if(d)T(new Date(d)),Y(new Date(d));else if(!d&&f){const h=new Date(typeof f=="string"?parseInt(f):f);T(h),Y(h)}else T(null),Y(null)},[d,f]),v.useEffect(()=>{w&&(Q(new Date(w)),_(new Date(w)),T(new Date(w)),Y(new Date(w)))},[w]),v.useEffect(()=>{b&&(pe(new Date(b)),H(new Date(b)),T(new Date(b)),Y(new Date(b)))},[b]),v.useEffect(()=>{if($&&!d&&!f){const h=new Date;typeof $=="object"&&(h.setHours($.hour+($.ampm==="PM"?12:0)),h.setMinutes($.minute)),T(h),Y(h)}},[$,d,f]);const I=h=>{h.stopPropagation(),X(h.currentTarget),Z(!0),O?se(new Date(O)):f&&!O&&se(new Date(typeof f=="string"?parseInt(f):f))},J=h=>{if(m&&h.getTime()<m||p&&h.getTime()>p||x&&h.getTime()>new Date().setHours(23,59,59,999))return!0;if(y){const U=typeof y=="string"?new Date(y):typeof y=="number"?new Date(y):y;if(h.getTime()>U.getTime())return!0}if(z){const U=typeof z=="string"?new Date(z):typeof z=="number"?new Date(z):z;if(h.getTime()<U.getTime())return!0}return!1},fe=h=>{o==="inline"&&E.current&&!E.current.contains(h.target)&&(e==="single"?W||T(null):e==="range"&&(!D||!R)&&(Q(null),pe(null)),Z(!1))};v.useEffect(()=>(j?document.addEventListener("mousedown",fe):document.removeEventListener("mousedown",fe),()=>{document.removeEventListener("mousedown",fe)}),[j]);const he=h=>{!h||J(h)||(e==="single"?T(h):e==="range"&&(!D||D&&R?(Q(h),pe(null)):h>=D?pe(h):Q(h)))},we=h=>{if(!h||J(h)){C(null);return}e==="range"&&D&&!R&&C(h)},je=()=>{C(null)},Fe=()=>{if(Z(!1),e==="single"){const h=n?new Date:W,U=h?new Date(h.getFullYear(),h.getMonth(),h.getDate(),S.ampm==="PM"&&S.hour!==12?S.hour+12:S.ampm==="AM"&&S.hour===12?0:S.hour,S.minute):null;Y(U);const ne=U?U.getTime():null;l==null||l(ne),s==null||s(ne)}else if(e==="range"){_(D),H(R);const h={startDate:D?D.getTime():null,endDate:R?R.getTime():null};l==null||l(h),s==null||s(h)}},Ke=()=>{Z(!1),T(O),Q(N),pe(L),se(O?new Date(O):new Date),c==null||c()},Oe=h=>{const U=new Date,ne=h.ampm==="PM"&&h.hour!==12?h.hour+12:h.ampm==="AM"&&h.hour===12?0:h.hour;return U.setHours(ne,h.minute,0,0),U},Xe=(h,U)=>Oe(U).getTime()>h.getTime(),Ge=()=>{const h=Oe(ge);Ae(h),F(!1);const U={fromTime:h.getTime(),toTime:Le?Le.getTime():null};l==null||l(U)},Je=()=>{if(!ve)return;if(!Xe(ve,ae)){alert("To Time must be greater than From Time");return}const h=Oe(ae);Be(h),le(!1);const U={fromTime:ve.getTime(),toTime:h.getTime()};l==null||l(U),s==null||s(U)},Qe=()=>{if(F(!1),ve){let h=ve.getHours();const U=h>=12?"PM":"AM";h=h%12||12,K({hour:h,minute:ve.getMinutes(),ampm:U})}c==null||c()},Re=()=>{if(le(!1),Le){let h=Le.getHours();const U=h>=12?"PM":"AM";h=h%12||12,Ce({hour:h,minute:Le.getMinutes(),ampm:U})}c==null||c()},et=()=>{if(!ve){alert("Please select and confirm From Time first");return}le(!0)},ft=(h,U)=>{if(!h)return U;let ne=h.getHours();const ke=ne>=12?"PM":"AM";ne=ne%12||12;const Te=h.getMinutes();return`${String(ne).padStart(2,"0")}:${String(Te).padStart(2,"0")} ${ke}`},oi=()=>{const h=new Date(G.getFullYear(),G.getMonth(),1),U=new Date(G.getFullYear(),G.getMonth()+1,0),ne=new Date().setHours(23,59,59,999),ke=[],Te=h.getDay();for(let ye=0;ye<Te;ye++)ke.push(null);for(let ye=1;ye<=U.getDate();ye++){const Kt=new Date(G.getFullYear(),G.getMonth(),ye);x&&Kt.getTime()>ne||ke.push(Kt)}return ke},ni=()=>{if(z){const h=typeof z=="string"?new Date(z):typeof z=="number"?new Date(z):z;if(G.getFullYear()<h.getFullYear()||G.getFullYear()===h.getFullYear()&&G.getMonth()<=h.getMonth())return!1}if(m){const h=new Date(m);if(G.getFullYear()<h.getFullYear()||G.getFullYear()===h.getFullYear()&&G.getMonth()<=h.getMonth())return!1}return!0},ri=()=>{if(y){const h=typeof y=="string"?new Date(y):typeof y=="number"?new Date(y):y;if(G.getFullYear()>h.getFullYear()||G.getFullYear()===h.getFullYear()&&G.getMonth()>=h.getMonth())return!1}if(p){const h=new Date(p);if(G.getFullYear()>h.getFullYear()||G.getFullYear()===h.getFullYear()&&G.getMonth()>=h.getMonth())return!1}if(x){const h=new Date;if(G.getFullYear()>h.getFullYear()||G.getFullYear()===h.getFullYear()&&G.getMonth()>=h.getMonth())return!1}return!0},ai=h=>{if(!h)return!1;if(e==="single")return(W==null?void 0:W.toDateString())===h.toDateString();if(e==="range"){if(D&&!R&&M){const U=D<M?D:M,ne=D<M?M:D;return h>=U&&h<=ne}return D&&R&&h>=D&&h<=R}return!1},Wt=(h,U)=>{if(!h)return e==="range"?U==="end"?"End Date":"Start Date":n?`${String(S.hour).padStart(2,"0")}:${String(S.minute).padStart(2,"0")} ${S.ampm}`:u;if(n)return`${String(S.hour).padStart(2,"0")}:${String(S.minute).padStart(2,"0")} ${S.ampm}`;const ne=h.getDate().toString().padStart(2,"0"),ke=cn[h.getMonth()],Te=h.getFullYear(),ye=t?` ${String(S.hour).padStart(2,"0")}:${String(S.minute).padStart(2,"0")} ${S.ampm}`:"";return`${ne} ${ke} ${Te}${ye}`},ii=a.jsxs("div",{className:"flex items-center justify-between w-full border border-color-gray-300 rounded-md p-2",children:[a.jsx("select",{value:S.hour,onChange:h=>A({...S,hour:parseInt(h.target.value)}),className:"w-16 border-0 text-center bg-color-transparent outline-0",children:Array.from({length:12},(h,U)=>U+1).map(h=>a.jsx("option",{value:h,children:h.toString().padStart(2,"0")},h))}),a.jsx("select",{value:S.minute,onChange:h=>A({...S,minute:parseInt(h.target.value)}),className:"w-16 border-0 text-center bg-color-transparent outline-0 border-l border-color-gray-300",children:Array.from({length:60},(h,U)=>U).map(h=>a.jsx("option",{value:h,children:h.toString().padStart(2,"0")},h))}),a.jsxs("select",{value:S.ampm,onChange:h=>A({...S,ampm:h.target.value==="AM"?"AM":"PM"}),className:"w-16 border-0 text-center bg-color-transparent outline-0 border-l border-color-gray-300",children:[a.jsx("option",{value:"AM",children:"AM"}),a.jsx("option",{value:"PM",children:"PM"})]})]}),pn=(h,U)=>a.jsxs("div",{className:"flex items-center justify-between w-full border border-color-gray-300 rounded-md p-2",children:[a.jsx("select",{value:h.hour,onChange:ne=>U({...h,hour:parseInt(ne.target.value)}),className:"w-16 border-0 text-center bg-color-transparent outline-0",children:Array.from({length:12},(ne,ke)=>ke+1).map(ne=>a.jsx("option",{value:ne,children:ne.toString().padStart(2,"0")},ne))}),a.jsx("select",{value:h.minute,onChange:ne=>U({...h,minute:parseInt(ne.target.value)}),className:"w-16 border-0 text-center bg-color-transparent outline-0 border-l border-color-gray-300",children:Array.from({length:60},(ne,ke)=>ke).map(ne=>a.jsx("option",{value:ne,children:ne.toString().padStart(2,"0")},ne))}),a.jsxs("select",{value:h.ampm,onChange:ne=>U({...h,ampm:ne.target.value==="AM"?"AM":"PM"}),className:"w-16 border-0 text-center bg-color-transparent outline-0 border-l border-color-gray-300",children:[a.jsx("option",{value:"AM",children:"AM"}),a.jsx("option",{value:"PM",children:"PM"})]})]}),un=a.jsxs("div",{ref:E,className:`${o==="dialog"?"relative w-full":"absolute z-50 mt-2 w-72 rounded-lg border border-color-gray-200 bg-color-white shadow-xl p-4"}`,style:o==="dialog"?void 0:{position:"absolute",left:ee==null?void 0:ee.getBoundingClientRect().left,top:ee?ee.getBoundingClientRect().bottom+window.scrollY:0},children:[!n&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx(_e,{variant:"transparent",size:"small",color:"gray",roundedFull:!0,disabled:!ni(),onClick:()=>se(new Date(G.getFullYear(),G.getMonth()-1,1)),icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"})})}),a.jsx("div",{className:"flex items-center gap-4",children:a.jsxs("select",{className:"text-sm outline-none",value:G.getMonth(),onChange:h=>se(new Date(G.getFullYear(),parseInt(h.target.value),1)),children:[cn.map((h,U)=>{const ne=G.getFullYear(),ke=U,Te=new Date;if(x&&ne===Te.getFullYear()&&ke>Te.getMonth())return null;if(z){const ye=typeof z=="string"?new Date(z):typeof z=="number"?new Date(z):z;if(ne===ye.getFullYear()&&ke<ye.getMonth()||ne<ye.getFullYear())return null}if(y||p){const ye=y?typeof y=="string"?new Date(y):typeof y=="number"?new Date(y):y:p?new Date(p):null;if(ye&&ne===ye.getFullYear()&&ke>ye.getMonth()||ye&&ne>ye.getFullYear())return null}return a.jsx("option",{value:U,children:h},h)}),a.jsxs("select",{value:S.ampm,onChange:h=>A({...S,ampm:h.target.value==="AM"?"AM":"PM"}),className:"w-16 border-0 text-center bg-color-transparent outline-0 border-l border-color-gray-300",children:[a.jsx("option",{value:"AM",children:"AM"}),a.jsx("option",{value:"PM",children:"PM"})]}),Array.from({length:150},(h,U)=>new Date().getFullYear()-100+U).filter(h=>{if(x&&h>new Date().getFullYear())return!1;if(z){const U=typeof z=="string"?new Date(z):typeof z=="number"?new Date(z):z;if(h<U.getFullYear())return!1}if(y||p){const U=y?typeof y=="string"?new Date(y):typeof y=="number"?new Date(y):y:p?new Date(p):null;if(U&&h>U.getFullYear())return!1}return!0}).map(h=>a.jsx("option",{value:h,children:h},h))]})}),a.jsx(_e,{variant:"transparent",size:"small",color:"gray",roundedFull:!0,disabled:!ri(),onClick:()=>se(new Date(G.getFullYear(),G.getMonth()+1,1)),icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"})})})]}),a.jsxs("div",{className:"grid grid-columns-7 gap-1 text-center text-sm mb-2",children:[!x&&Xa.map(h=>a.jsx("div",{className:"font-semibold",children:h},h)),oi().map((h,U)=>a.jsx("div",{className:`size-8 flex justify-center items-center text-sm rounded-full transition-all
161
+ `,onTransitionEnd:d,children:[s&&a.jsx(_e,{color:"gray",icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"})}),size:"small",roundedFull:!0,className:"!absolute right-3 top-3 z-99",onClick:o,variant:"transparent"}),n&&a.jsx("h2",{className:"text-xl font-semibold mb-4",children:n}),a.jsx("div",{className:`grow overflow-y-auto ${i}`,children:r}),l&&a.jsx("div",{className:"mt-4",children:l})]})]}),document.body)},Ha=({title:e,content:o,expandIcon:t=a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"})}),collapseIcon:n=a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"})}),isOpen:r,defaultExpanded:i=!1,onToggle:l,className:s="",titleClass:c="",contentClass:u=""})=>{const[g,m]=v.useState(i),p=r!==void 0,d=p?r:g,x=()=>{const f=!d;p||m(f),l==null||l(f)};return v.useEffect(()=>{p&&m(r)},[r]),a.jsxs("div",{className:`overflow-hidden w-full border border-color-gray-100 ${s}`,children:[a.jsxs("button",{type:"button",onClick:x,className:`flex justify-between items-center w-full p-4 bg-color-gray-50 hover:bg-color-gray-200 transition ${c}`,children:[a.jsx("div",{className:"text-left text-sm font-medium",children:e}),a.jsx("div",{className:"transition-transform duration-300",children:d?t:n})]}),a.jsx("div",{className:`grid overflow-hidden transition-all duration-300 ease-in-out grid-rows-[0fr] ${d?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"}`,children:a.jsx("div",{className:"overflow-hidden",children:a.jsx("div",{className:`p-4 text-sm text-color-gray-700 ${u}`,children:o})})})]})},Ba={info:"bg-color-blue-50 border-color-blue-300 text-color-blue-800",success:"bg-color-green-50 border-color-green-300 text-color-green-800",danger:"bg-color-red-50 border-color-red-300 text-color-red-800",warning:"bg-color-yellow-50 border-color-yellow-300 text-color-yellow-800",dark:"bg-color-gray-100 border-color-gray-300 text-color-gray-800"},Ga={info:a.jsx("svg",{className:"text-color-blue-800 shrink-0 size-7",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 7H13V9H11V7ZM11 11H13V17H11V11Z"})}),success:a.jsx("svg",{className:"text-color-green-800 shrink-0 size-7",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12ZM12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM17.4571 9.45711L16.0429 8.04289L11 13.0858L8.20711 10.2929L6.79289 11.7071L11 15.9142L17.4571 9.45711Z"})}),danger:a.jsx("svg",{className:"text-color-red-800 shrink-0 size-7",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 10.5858L14.8284 7.75736L16.2426 9.17157L13.4142 12L16.2426 14.8284L14.8284 16.2426L12 13.4142L9.17157 16.2426L7.75736 14.8284L10.5858 12L7.75736 9.17157L9.17157 7.75736L12 10.5858Z"})}),warning:a.jsx("svg",{className:"text-color-yellow-800 shrink-0 size-7",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM11 7H13V13H11V7Z"})}),dark:a.jsx("svg",{className:"text-color-gray-800 shrink-0 size-7",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 7H13V9H11V7ZM11 11H13V17H11V11Z"})})},qa={info:"bg-color-blue-500",success:"bg-color-green-500",danger:"bg-color-red-500",warning:"bg-color-yellow-500",dark:"bg-color-gray-700"},Ya=({message:e,variant:o="info",onClose:t,autoClose:n=!1,className:r="",autoCloseDuration:i=5e3})=>{const[l,s]=v.useState(!0),c=v.useRef(null);return v.useEffect(()=>{let u;return n&&(requestAnimationFrame(()=>{c.current&&(c.current.style.transition=`width ${i}ms linear`,c.current.style.width="0%")}),u=setTimeout(()=>{s(!1),t==null||t()},i)),()=>clearTimeout(u)},[n,i,t]),l?a.jsxs("div",{className:`relative border-t-4 p-4 flex items-start justify-between ${Ba[o]} ${r}`,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[Ga[o],a.jsx("span",{dangerouslySetInnerHTML:{__html:e}})]}),a.jsx("button",{type:"button",onClick:()=>{s(!1),t==null||t()},"aria-label":"Close alert",className:"ml-4 bg-color-transparent cursor-pointer hover:bg-color-white rounded-full p-1 transition-color",children:a.jsx("svg",{className:`size-5 ${o==="dark"?"text-color-gray-700":""}`,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"})})}),n&&a.jsx("div",{className:"absolute -top-1 left-0 h-1 w-full bg-color-transparent overflow-hidden",children:a.jsx("div",{ref:c,className:`${qa[o]} h-1`,style:{width:"100%"}})})]}):null},Za=({children:e,count:o,showDot:t=!1,max:n=99,color:r="red",position:i="top-right"})=>{const l=()=>{var u,g;if(t)return a.jsx("span",{className:`h-2 w-2 rounded-full ${(u=xe[r])==null?void 0:u.filled} block`});if(o===0||o===void 0)return null;const c=o>n?`${n}+`:o;return a.jsx("span",{className:`text-color-white text-xs px-[10px] py-1 rounded-full whitespace-nowrap ${(g=xe[r])==null?void 0:g.filled}`,children:c})},s={"top-left":"top-0 left-0 -translate-x-1/2 -translate-y-1/2","bottom-right":"bottom-0 right-0 translate-x-1/2 translate-y-1/2","bottom-left":"bottom-0 left-0 -translate-x-1/2 translate-y-1/2","top-right":"top-0 right-0 translate-x-1/2 -translate-y-1/2"};return a.jsxs("div",{className:"relative inline-block",children:[e,a.jsx("span",{className:`absolute ${s[i]}`,children:l()})]})},Ua=({variant:e="fixed",activeTab:o,navItems:t,onTabChange:n,className:r="",activeClass:i="",buttonClass:l=""})=>{const s={fixed:"fixed bottom-0 left-0 right-0",floating:"fixed bottom-4 left-4 right-4 rounded-full",static:"static w-full"};return a.jsx("nav",{className:`flex justify-around items-center bg-color-white shadow-sm text-color-gray-600 py-2 px-4 ${s[e]} ${r}`,children:t.map(c=>{const u=c.label===o;return a.jsxs("a",{href:c.path,onClick:()=>n(c.label),className:`flex flex-col items-center text-sm cursor-pointer text-color-gray-500 no-underline ${l}`,children:[a.jsx("span",{className:`text-xl ${u?`text-color-blue-500 ${i}`:""}`,children:c.icon}),a.jsx("span",{className:`text-xs font-medium mt-1 ${u?`text-color-blue-500 ${i}`:""}`,children:c.label})]},c.label)})})},Wa=({items:e,separator:o="/",className:t="",itemClass:n="",spanClass:r="",separatorClass:i=""})=>a.jsx("nav",{className:`text-sm text-color-gray-600 ${t}`,"aria-label":"Breadcrumb",children:a.jsx("ol",{className:"flex items-center space-x-1",children:e.map((l,s)=>a.jsxs("li",{className:"flex items-center",children:[l.href?a.jsx("a",{href:l.href,className:`text-color-gray-800 hover:underline font-medium ${n}`,children:l.label}):a.jsx("span",{className:`text-color-gray-500 font-medium ${r}`,children:l.label}),s<e.length-1&&a.jsx("span",{className:`mx-2 text-color-gray-400 ${i}`,children:o})]},s))})}),Ka=a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM13 12V7H11V14H17V12H13Z"})}),cn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Xa=["Su","Mo","Tu","We","Th","Fr","Sa"],Ja=({mode:e="single",type:o="inline",showTime:t=!1,onlyTime:n=!1,fromToTime:r=!1,className:i,onChange:l,onConfirm:s,onCancel:c,placeholder:u="Select date",icon:g=Ka,disableBefore:m,disableAfter:p,selectedDate:d,hideFutureDates:x=!1,defaultDate:f,fromDate:w,toDate:b,minimumDate:z,maxDate:y,defaultTime:$,fromTime:k,toTime:V})=>{const[j,Z]=v.useState(!1),[ee,X]=v.useState(null),[G,se]=v.useState(w||b?new Date:f?new Date(typeof f=="string"?parseInt(f):f):new Date),[W,T]=v.useState(d?new Date(d):f&&!d?new Date(typeof f=="string"?parseInt(f):f):null),[D,Q]=v.useState(w?new Date(w):null),[R,pe]=v.useState(b?new Date(b):null),[M,C]=v.useState(null),[S,A]=v.useState({hour:12,minute:0,ampm:"AM"}),E=v.useRef(null),[O,Y]=v.useState(d?new Date(d):f&&!d?new Date(typeof f=="string"?parseInt(f):f):null),[N,_]=v.useState(w?new Date(w):null),[L,H]=v.useState(b?new Date(b):null),[B,re]=v.useState(!1),[P,F]=v.useState(!1),[ie,le]=v.useState(!1),[ge,K]=v.useState({hour:12,minute:0,ampm:"AM"}),[ae,Ce]=v.useState({hour:12,minute:0,ampm:"AM"}),[ve,Ae]=v.useState(k?new Date(k):null),[Le,Be]=v.useState(V?new Date(V):null);v.useEffect(()=>{if(k){const h=new Date(k);Ae(h);let U=h.getHours();const ne=U>=12?"PM":"AM";U=U%12||12,K({hour:U,minute:h.getMinutes(),ampm:ne})}},[k]),v.useEffect(()=>{if(V){const h=new Date(V);Be(h);let U=h.getHours();const ne=U>=12?"PM":"AM";U=U%12||12,Ce({hour:U,minute:h.getMinutes(),ampm:ne})}},[V]),v.useEffect(()=>{if(d)T(new Date(d)),Y(new Date(d));else if(!d&&f){const h=new Date(typeof f=="string"?parseInt(f):f);T(h),Y(h)}else T(null),Y(null)},[d,f]),v.useEffect(()=>{w&&(Q(new Date(w)),_(new Date(w)),T(new Date(w)),Y(new Date(w)))},[w]),v.useEffect(()=>{b&&(pe(new Date(b)),H(new Date(b)),T(new Date(b)),Y(new Date(b)))},[b]),v.useEffect(()=>{if($&&!d&&!f){const h=new Date;typeof $=="object"&&(h.setHours($.hour+($.ampm==="PM"?12:0)),h.setMinutes($.minute)),T(h),Y(h)}},[$,d,f]);const I=h=>{h.stopPropagation(),X(h.currentTarget),Z(!0),O?se(new Date(O)):f&&!O&&se(new Date(typeof f=="string"?parseInt(f):f))},J=h=>{if(m&&h.getTime()<m||p&&h.getTime()>p||x&&h.getTime()>new Date().setHours(23,59,59,999))return!0;if(y){const U=typeof y=="string"?new Date(y):typeof y=="number"?new Date(y):y;if(h.getTime()>U.getTime())return!0}if(z){const U=typeof z=="string"?new Date(z):typeof z=="number"?new Date(z):z;if(h.getTime()<U.getTime())return!0}return!1},fe=h=>{o==="inline"&&E.current&&!E.current.contains(h.target)&&(e==="single"?W||T(null):e==="range"&&(!D||!R)&&(Q(null),pe(null)),Z(!1))};v.useEffect(()=>(j?document.addEventListener("mousedown",fe):document.removeEventListener("mousedown",fe),()=>{document.removeEventListener("mousedown",fe)}),[j]);const he=h=>{!h||J(h)||(e==="single"?T(h):e==="range"&&(!D||D&&R?(Q(h),pe(null)):h>=D?pe(h):Q(h)))},we=h=>{if(!h||J(h)){C(null);return}e==="range"&&D&&!R&&C(h)},je=()=>{C(null)},Fe=()=>{if(Z(!1),e==="single"){const h=n?new Date:W,U=h?new Date(h.getFullYear(),h.getMonth(),h.getDate(),S.ampm==="PM"&&S.hour!==12?S.hour+12:S.ampm==="AM"&&S.hour===12?0:S.hour,S.minute):null;Y(U);const ne=U?U.getTime():null;l==null||l(ne),s==null||s(ne)}else if(e==="range"){_(D),H(R);const h={startDate:D?D.getTime():null,endDate:R?R.getTime():null};l==null||l(h),s==null||s(h)}},Ke=()=>{Z(!1),T(O),Q(N),pe(L),se(O?new Date(O):new Date),c==null||c()},Oe=h=>{const U=new Date,ne=h.ampm==="PM"&&h.hour!==12?h.hour+12:h.ampm==="AM"&&h.hour===12?0:h.hour;return U.setHours(ne,h.minute,0,0),U},Xe=(h,U)=>Oe(U).getTime()>h.getTime(),Ge=()=>{const h=Oe(ge);Ae(h),F(!1);const U={fromTime:h.getTime(),toTime:Le?Le.getTime():null};l==null||l(U)},Je=()=>{if(!ve)return;if(!Xe(ve,ae)){alert("To Time must be greater than From Time");return}const h=Oe(ae);Be(h),le(!1);const U={fromTime:ve.getTime(),toTime:h.getTime()};l==null||l(U),s==null||s(U)},Qe=()=>{if(F(!1),ve){let h=ve.getHours();const U=h>=12?"PM":"AM";h=h%12||12,K({hour:h,minute:ve.getMinutes(),ampm:U})}c==null||c()},Re=()=>{if(le(!1),Le){let h=Le.getHours();const U=h>=12?"PM":"AM";h=h%12||12,Ce({hour:h,minute:Le.getMinutes(),ampm:U})}c==null||c()},et=()=>{if(!ve){alert("Please select and confirm From Time first");return}le(!0)},ft=(h,U)=>{if(!h)return U;let ne=h.getHours();const ke=ne>=12?"PM":"AM";ne=ne%12||12;const Te=h.getMinutes();return`${String(ne).padStart(2,"0")}:${String(Te).padStart(2,"0")} ${ke}`},oi=()=>{const h=new Date(G.getFullYear(),G.getMonth(),1),U=new Date(G.getFullYear(),G.getMonth()+1,0),ne=new Date().setHours(23,59,59,999),ke=[],Te=h.getDay();for(let ye=0;ye<Te;ye++)ke.push(null);for(let ye=1;ye<=U.getDate();ye++){const Kt=new Date(G.getFullYear(),G.getMonth(),ye);x&&Kt.getTime()>ne||ke.push(Kt)}return ke},ni=()=>{if(z){const h=typeof z=="string"?new Date(z):typeof z=="number"?new Date(z):z;if(G.getFullYear()<h.getFullYear()||G.getFullYear()===h.getFullYear()&&G.getMonth()<=h.getMonth())return!1}if(m){const h=new Date(m);if(G.getFullYear()<h.getFullYear()||G.getFullYear()===h.getFullYear()&&G.getMonth()<=h.getMonth())return!1}return!0},ri=()=>{if(y){const h=typeof y=="string"?new Date(y):typeof y=="number"?new Date(y):y;if(G.getFullYear()>h.getFullYear()||G.getFullYear()===h.getFullYear()&&G.getMonth()>=h.getMonth())return!1}if(p){const h=new Date(p);if(G.getFullYear()>h.getFullYear()||G.getFullYear()===h.getFullYear()&&G.getMonth()>=h.getMonth())return!1}if(x){const h=new Date;if(G.getFullYear()>h.getFullYear()||G.getFullYear()===h.getFullYear()&&G.getMonth()>=h.getMonth())return!1}return!0},ai=h=>{if(!h)return!1;if(e==="single")return(W==null?void 0:W.toDateString())===h.toDateString();if(e==="range"){if(D&&!R&&M){const U=D<M?D:M,ne=D<M?M:D;return h>=U&&h<=ne}return D&&R&&h>=D&&h<=R}return!1},Wt=(h,U)=>{if(!h)return e==="range"?U==="end"?"End Date":"Start Date":n?`${String(S.hour).padStart(2,"0")}:${String(S.minute).padStart(2,"0")} ${S.ampm}`:u;if(n)return`${String(S.hour).padStart(2,"0")}:${String(S.minute).padStart(2,"0")} ${S.ampm}`;const ne=h.getDate().toString().padStart(2,"0"),ke=cn[h.getMonth()],Te=h.getFullYear(),ye=t?` ${String(S.hour).padStart(2,"0")}:${String(S.minute).padStart(2,"0")} ${S.ampm}`:"";return`${ne} ${ke} ${Te}${ye}`},ii=a.jsxs("div",{className:"flex items-center justify-between w-full border border-color-gray-300 rounded-md p-2",children:[a.jsx("select",{value:S.hour,onChange:h=>A({...S,hour:parseInt(h.target.value)}),className:"w-16 border-0 text-center bg-color-transparent outline-0",children:Array.from({length:12},(h,U)=>U+1).map(h=>a.jsx("option",{value:h,children:h.toString().padStart(2,"0")},h))}),a.jsx("select",{value:S.minute,onChange:h=>A({...S,minute:parseInt(h.target.value)}),className:"w-16 border-0 text-center bg-color-transparent outline-0 border-l border-color-gray-300",children:Array.from({length:60},(h,U)=>U).map(h=>a.jsx("option",{value:h,children:h.toString().padStart(2,"0")},h))}),a.jsxs("select",{value:S.ampm,onChange:h=>A({...S,ampm:h.target.value==="AM"?"AM":"PM"}),className:"w-16 border-0 text-center bg-color-transparent outline-0 border-l border-color-gray-300",children:[a.jsx("option",{value:"AM",children:"AM"}),a.jsx("option",{value:"PM",children:"PM"})]})]}),pn=(h,U)=>a.jsxs("div",{className:"flex items-center justify-between w-full border border-color-gray-300 rounded-md p-2",children:[a.jsx("select",{value:h.hour,onChange:ne=>U({...h,hour:parseInt(ne.target.value)}),className:"w-16 border-0 text-center bg-color-transparent outline-0",children:Array.from({length:12},(ne,ke)=>ke+1).map(ne=>a.jsx("option",{value:ne,children:ne.toString().padStart(2,"0")},ne))}),a.jsx("select",{value:h.minute,onChange:ne=>U({...h,minute:parseInt(ne.target.value)}),className:"w-16 border-0 text-center bg-color-transparent outline-0 border-l border-color-gray-300",children:Array.from({length:60},(ne,ke)=>ke).map(ne=>a.jsx("option",{value:ne,children:ne.toString().padStart(2,"0")},ne))}),a.jsxs("select",{value:h.ampm,onChange:ne=>U({...h,ampm:ne.target.value==="AM"?"AM":"PM"}),className:"w-16 border-0 text-center bg-color-transparent outline-0 border-l border-color-gray-300",children:[a.jsx("option",{value:"AM",children:"AM"}),a.jsx("option",{value:"PM",children:"PM"})]})]}),un=a.jsxs("div",{ref:E,className:`${o==="dialog"?"relative w-full":"absolute z-50 mt-2 w-72 rounded-lg border border-color-gray-200 bg-color-white shadow-xl p-4"}`,style:o==="dialog"?void 0:{position:"absolute",left:ee==null?void 0:ee.getBoundingClientRect().left,top:ee?ee.getBoundingClientRect().bottom+window.scrollY:0},children:[!n&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx(_e,{variant:"transparent",size:"small",color:"gray",roundedFull:!0,disabled:!ni(),onClick:()=>se(new Date(G.getFullYear(),G.getMonth()-1,1)),icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"})})}),a.jsx("div",{className:"flex items-center gap-4",children:a.jsxs("select",{className:"text-sm outline-none",value:G.getMonth(),onChange:h=>se(new Date(G.getFullYear(),parseInt(h.target.value),1)),children:[cn.map((h,U)=>{const ne=G.getFullYear(),ke=U,Te=new Date;if(x&&ne===Te.getFullYear()&&ke>Te.getMonth())return null;if(z){const ye=typeof z=="string"?new Date(z):typeof z=="number"?new Date(z):z;if(ne===ye.getFullYear()&&ke<ye.getMonth()||ne<ye.getFullYear())return null}if(y||p){const ye=y?typeof y=="string"?new Date(y):typeof y=="number"?new Date(y):y:p?new Date(p):null;if(ye&&ne===ye.getFullYear()&&ke>ye.getMonth()||ye&&ne>ye.getFullYear())return null}return a.jsx("option",{value:U,children:h},h)}),a.jsxs("select",{value:S.ampm,onChange:h=>A({...S,ampm:h.target.value==="AM"?"AM":"PM"}),className:"w-16 border-0 text-center bg-color-transparent outline-0 border-l border-color-gray-300",children:[a.jsx("option",{value:"AM",children:"AM"}),a.jsx("option",{value:"PM",children:"PM"})]}),Array.from({length:150},(h,U)=>new Date().getFullYear()-100+U).filter(h=>{if(x&&h>new Date().getFullYear())return!1;if(z){const U=typeof z=="string"?new Date(z):typeof z=="number"?new Date(z):z;if(h<U.getFullYear())return!1}if(y||p){const U=y?typeof y=="string"?new Date(y):typeof y=="number"?new Date(y):y:p?new Date(p):null;if(U&&h>U.getFullYear())return!1}return!0}).map(h=>a.jsx("option",{value:h,children:h},h))]})}),a.jsx(_e,{variant:"transparent",size:"small",color:"gray",roundedFull:!0,disabled:!ri(),onClick:()=>se(new Date(G.getFullYear(),G.getMonth()+1,1)),icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"})})})]}),a.jsxs("div",{className:"grid grid-columns-7 gap-1 text-center text-sm mb-2",children:[!x&&Xa.map(h=>a.jsx("div",{className:"font-semibold",children:h},h)),oi().map((h,U)=>a.jsx("div",{className:`size-8 flex justify-center items-center text-sm rounded-full transition-all
162
162
  ${h?"hover:bg-color-blue-100 cursor-pointer":""}
163
163
  ${h&&ai(h)?"bg-color-blue-500 hover:bg-color-blue-500 text-color-white":""}
164
- ${h&&J(h)?"bg-color-gray-100 text-color-gray-400 !cursor-not-allowed hover:bg-color-gray-100":""}`,onClick:()=>h&&he(h),onMouseEnter:()=>h&&we(h),onMouseLeave:je,children:h?h.getDate():""},U))]})]}),(t||n)&&ii,a.jsx("div",{className:"mt-4 flex justify-end",children:a.jsx(ze,{fullWidth:!0,onClick:Fe,disabled:e==="range"&&!R&&!n,className:`${e==="range"&&!R&&!n?"bg-color-gray-400 cursor-not-allowed":""}`,children:"Confirm"})})]});return r?a.jsxs("div",{className:`relative flex items-center gap-2 ${i||""}`,children:[a.jsxs(ze,{onClick:()=>F(!0),fullWidth:!0,color:"gray",variant:"outlined",className:"!justify-between gap-2",children:[ft(ve,"From Time"),g]}),a.jsx("span",{style:{width:20,height:2,background:"#303E59",display:"inline-block",borderRadius:2}}),a.jsxs(ze,{onClick:et,fullWidth:!0,color:"gray",variant:"outlined",className:`!justify-between gap-2 ${ve?"":"opacity-50 cursor-not-allowed"}`,disabled:!ve,children:[ft(Le,"To Time"),g]}),a.jsx(We,{open:P,title:"Select From Time",onClose:Qe,children:a.jsxs("div",{className:"w-72 p-4",children:[pn(ge,K),a.jsx("div",{className:"mt-4 flex justify-end",children:a.jsx(ze,{fullWidth:!0,onClick:Ge,children:"Confirm"})})]})}),a.jsx(We,{open:ie,title:"Select To Time",onClose:Re,children:a.jsxs("div",{className:"w-72 p-4",children:[pn(ae,Ce),a.jsx("div",{className:"mt-4 flex justify-end",children:a.jsx(ze,{fullWidth:!0,onClick:Je,children:"Confirm"})})]})})]}):a.jsxs("div",{className:"relative",children:[a.jsxs(ze,{onClick:I,fullWidth:!0,color:"gray",variant:"outlined",className:`!justify-between gap-2 ${i||""}`,children:[e==="single"?O&&d!==null?Wt(O):u:D||N||L?a.jsxs(a.Fragment,{children:[Wt(D||N,"start")," -"," ",Wt(R||L,"end")]}):u,g]}),o==="inline"?a.jsx(a.Fragment,{children:j&&qe.createPortal(un,document.body)}):a.jsx(We,{open:j,title:n?"Select Time":u,onClose:Ke,children:a.jsx("div",{className:"w-72",children:un})}),B&&a.jsx(We,{open:B,onClose:()=>re(!1),title:"Select Time",children:a.jsxs("div",{className:"p-4",children:[a.jsxs("div",{className:"flex gap-2 mb-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"block text-sm font-medium text-color-gray-700 mb-1",children:"Hour"}),a.jsx("input",{type:"number",min:1,max:12,value:S.hour,onChange:h=>A({...S,hour:parseInt(h.target.value,10)}),className:"w-full border border-color-gray-300 rounded-md p-2 focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"block text-sm font-medium text-color-gray-700 mb-1",children:"Minute"}),a.jsx("input",{type:"number",min:0,max:59,value:S.minute,onChange:h=>A({...S,minute:parseInt(h.target.value,10)}),className:"w-full border border-color-gray-300 rounded-md p-2 focus:outline-none focus:ring-2 focus:ring-blue-500"})]})]}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"block text-sm font-medium text-color-gray-700 mb-1",children:"AM/PM"}),a.jsxs("select",{value:S.ampm,onChange:h=>A({...S,ampm:h.target.value==="AM"?"AM":"PM"}),className:"w-full border border-color-gray-300 rounded-md p-2 focus:outline-none focus:ring-2 focus:ring-blue-500",children:[a.jsx("option",{value:"AM",children:"AM"}),a.jsx("option",{value:"PM",children:"PM"})]})]}),a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsx(ze,{onClick:()=>{const h=new Date;h.setHours(S.hour+(S.ampm==="PM"?12:0)),h.setMinutes(S.minute),T(h),Y(h),re(!1)},className:"w-full bg-blue-600 text-white rounded-md px-4 py-2 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500",children:"Set Time"}),a.jsx(ze,{onClick:()=>re(!1),className:"w-full bg-color-gray-300 text-color-gray-700 rounded-md px-4 py-2 hover:bg-color-gray-400 focus:outline-none",children:"Cancel"})]})]})})]})},Qa=({tabs:e,activeKey:o,onChange:t,className:n="",tabsClass:r="",tabItemClass:i="",tabItemActiveClass:l="",tabContentClass:s="",indicatorClass:c="",variant:u="horizontal"})=>{const g=e.find(p=>p.key===o),m=u==="vertical";return a.jsxs("div",{className:`w-full flex ${m?"flex-row":"flex-col"} ${n}`,children:[a.jsx("div",{className:`${m?"flex flex-col min-w-[160px] border-r border-color-gray-200":"flex space-x-6 border-b border-color-gray-200"} ${r}`,children:e.map(p=>{const d=o===p.key;return a.jsxs("button",{onClick:()=>t(p.key),className:`relative flex ${m?"flex-row items-center px-4 py-3":"flex-col items-center py-4"}
164
+ ${h&&J(h)?"bg-color-gray-100 text-color-gray-400 !cursor-not-allowed hover:bg-color-gray-100":""}`,onClick:()=>h&&he(h),onMouseEnter:()=>h&&we(h),onMouseLeave:je,children:h?h.getDate():""},U))]})]}),(t||n)&&ii,a.jsx("div",{className:"mt-4 flex justify-end",children:a.jsx(ze,{fullWidth:!0,onClick:Fe,disabled:e==="range"&&!R&&!n,className:`${e==="range"&&!R&&!n?"bg-color-gray-400 cursor-not-allowed":""}`,children:"Confirm"})})]});return r?a.jsxs("div",{className:`relative flex items-center gap-2 ${i||""}`,children:[a.jsxs(ze,{onClick:()=>F(!0),fullWidth:!0,color:"gray",variant:"outlined",className:"!justify-between gap-2",children:[ft(ve,"From Time"),g]}),a.jsx("span",{style:{width:20,height:2,background:"#303E59",display:"inline-block",borderRadius:2}}),a.jsxs(ze,{onClick:et,fullWidth:!0,color:"gray",variant:"outlined",className:`!justify-between gap-2 ${ve?"":"opacity-50 cursor-not-allowed"}`,disabled:!ve,children:[ft(Le,"To Time"),g]}),a.jsx(We,{open:P,title:"Select From Time",onClose:Qe,children:a.jsxs("div",{className:"w-72 p-4",children:[pn(ge,K),a.jsx("div",{className:"mt-4 flex justify-end",children:a.jsx(ze,{fullWidth:!0,onClick:Ge,children:"Confirm"})})]})}),a.jsx(We,{open:ie,title:"Select To Time",onClose:Re,children:a.jsxs("div",{className:"w-72 p-4",children:[pn(ae,Ce),a.jsx("div",{className:"mt-4 flex justify-end",children:a.jsx(ze,{fullWidth:!0,onClick:Je,children:"Confirm"})})]})})]}):a.jsxs("div",{className:"relative",children:[a.jsxs(ze,{onClick:I,fullWidth:!0,color:"gray",variant:"outlined",className:`!justify-between gap-2 ${i||""}`,children:[e==="single"?O&&d!==null?Wt(O):u:D||N||L?a.jsxs(a.Fragment,{children:[Wt(D||N,"start")," -"," ",Wt(R||L,"end")]}):u,g]}),o==="inline"?a.jsx(a.Fragment,{children:j&&qe.createPortal(un,document.body)}):a.jsx(We,{open:j,title:n?"Select Time":u,onClose:Ke,children:a.jsx("div",{className:"w-72",children:un})}),B&&a.jsx(We,{open:B,onClose:()=>re(!1),title:"Select Time",children:a.jsxs("div",{className:"p-4",children:[a.jsxs("div",{className:"flex gap-2 mb-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"block text-sm font-medium text-color-gray-700 mb-1",children:"Hour"}),a.jsx("input",{type:"number",min:1,max:12,value:S.hour,onChange:h=>A({...S,hour:parseInt(h.target.value,10)}),className:"w-full border border-color-gray-300 rounded-md p-2 focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"block text-sm font-medium text-color-gray-700 mb-1",children:"Minute"}),a.jsx("input",{type:"number",min:0,max:59,value:S.minute,onChange:h=>A({...S,minute:parseInt(h.target.value,10)}),className:"w-full border border-color-gray-300 rounded-md p-2 focus:outline-none focus:ring-2 focus:ring-blue-500"})]})]}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"block text-sm font-medium text-color-gray-700 mb-1",children:"AM/PM"}),a.jsxs("select",{value:S.ampm,onChange:h=>A({...S,ampm:h.target.value==="AM"?"AM":"PM"}),className:"w-full border border-color-gray-300 rounded-md p-2 focus:outline-none focus:ring-2 focus:ring-blue-500",children:[a.jsx("option",{value:"AM",children:"AM"}),a.jsx("option",{value:"PM",children:"PM"})]})]}),a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsx(ze,{onClick:()=>{const h=new Date;h.setHours(S.hour+(S.ampm==="PM"?12:0)),h.setMinutes(S.minute),T(h),Y(h),re(!1)},className:"w-full bg-blue-600 text-white rounded-md px-4 py-2 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500",children:"Set Time"}),a.jsx(ze,{onClick:()=>re(!1),className:"w-full bg-color-gray-300 text-color-gray-700 rounded-md px-4 py-2 hover:bg-color-gray-400 focus:outline-none",children:"Cancel"})]})]})})]})},Qa=({tabs:e,activeKey:o,onChange:t,className:n="",tabsClass:r="",tabItemClass:i="",tabItemActiveClass:l="",tabContentClass:s="",indicatorClass:c="",variant:u="horizontal"})=>{const g=e.find(p=>p.key===o),m=u==="vertical";return a.jsxs("div",{className:`w-full flex ${m?"flex-row":"flex-col"} ${n}`,children:[a.jsx("div",{className:`${m?"flex flex-col min-w-[160px] border-r border-color-gray-200":"flex space-x-6 border-b border-color-gray-200"} ${r}`,children:e.map(p=>{const d=o===p.key;return a.jsxs("button",{type:"button",onClick:()=>t(p.key),className:`relative flex ${m?"flex-row items-center px-4 py-3":"flex-col items-center py-4"}
165
165
  text-sm font-medium transition-color duration-200 bg-color-transparent
166
166
  ${d?`text-color-blue-500 ${l} `:"text-color-gray-600 hover:text-color-blue-500 cursor-pointer"}
167
167
  ${i}`,children:[a.jsxs("div",{className:`flex items-center ${m?"space-x-3":"space-x-2"}`,children:[p.icon&&a.jsx("span",{children:p.icon}),a.jsx("span",{children:p.label})]}),d&&(m?a.jsx("div",{className:`absolute right-0 top-3 bottom-3 w-1 bg-color-blue-500 rounded-full ${c}`}):a.jsx("div",{className:`absolute bottom-0 left-0 right-0 h-1 bg-color-blue-500 rounded-full ${c}`}))]},p.key)})}),a.jsx("div",{className:`mt-4 ${m?"ml-6 mt-0":""} ${s}`,children:g==null?void 0:g.content})]})},Ra=({stats:e=[],className:o=""})=>a.jsx(ln,{className:`w-full ${o}`,children:a.jsx("div",{className:"grid grid-columns-1 sm:grid-columns-1 md:grid-columns-2 lg:grid-columns-4 gap-4 justify-items-center",children:e.map((t,n)=>a.jsxs("div",{className:`flex items-center justify-center gap-4 lg:not-last:border-r md:not-last:border-r md:nth-2:border-r-0 md:not-last:border-b-0 not-last:border-b border-color-gray-200
168
168
  md:p-2 not-last:pb-4 w-full h-full ${t.className}`,children:[a.jsx("div",{className:`p-2 ${t.accentColor} ${t.accentBackground} shrink-0 flex items-center justify-center p-4 text-md rounded-lg`,children:t.icon}),a.jsxs("div",{className:"flex flex-col justify-center gap-1 w-full ",children:[a.jsx("div",{className:"text-sm",children:t.name}),a.jsx("div",{className:`text-xl ${t.accentColor} font-semibold`,children:t.value})]})]},n))})});function ei({items:e=[],logoJSX:o,position:t,defaultActive:n,open:r=!0,onClose:i,onItemSelect:l,className:s=""}){const[c,u]=v.useState(n),g=m=>{u(m),m.onClick&&m.onClick(),l&&l(m)};return a.jsx(a.Fragment,{children:a.jsx(sn,{open:r,onClose:i,anchor:t,showCloseIcon:!1,className:s,children:a.jsxs("div",{className:"",children:[o&&a.jsx("div",{className:"pb-6",children:o}),a.jsx("nav",{className:"space-y-2 text-sm font-medium text-color-gray-700",children:e.map(m=>m.href?a.jsxs("a",{href:m.href,className:`flex items-center gap-3 py-3 px-4 cursor-pointer rounded-full w-full no-underline
169
169
  ${m.label===(c==null?void 0:c.label)?"bg-color-blue-500 text-color-white font-medium ":"hover:bg-color-gray-50 text-color-gray-600"}
170
- `,onClick:()=>g(m),children:[a.jsx("span",{className:"text-lg",children:m.icon}),a.jsx("span",{children:m.label})]},m.label):a.jsxs("button",{onClick:()=>g(m),className:`flex items-center gap-3 py-3 px-4 cursor-pointer rounded-full w-full no-underline
170
+ `,onClick:()=>g(m),children:[a.jsx("span",{className:"text-lg",children:m.icon}),a.jsx("span",{children:m.label})]},m.label):a.jsxs("button",{type:"button",onClick:()=>g(m),className:`flex items-center gap-3 py-3 px-4 cursor-pointer rounded-full w-full no-underline
171
171
  ${m.label===(c==null?void 0:c.label)?"bg-color-blue-500 text-color-white font-medium ":"hover:bg-color-gray-50 text-color-gray-600 bg-color-transparent"}
172
172
  `,children:[a.jsx("span",{className:"text-lg",children:m.icon}),a.jsx("span",{children:m.label})]},m.label))})]})})})}const dn=[{code:"AF",name:"Afghanistan",dialCode:"+93",flag:"https://ik.imagekit.io/unizap/country_flag/af.svg"},{code:"AL",name:"Albania",dialCode:"+355",flag:"https://ik.imagekit.io/unizap/country_flag/al.svg"},{code:"DZ",name:"Algeria",dialCode:"+213",flag:"https://ik.imagekit.io/unizap/country_flag/dz.svg"},{code:"AS",name:"American Samoa",dialCode:"+1684",flag:"https://ik.imagekit.io/unizap/country_flag/as.svg"},{code:"AD",name:"Andorra",dialCode:"+376",flag:"https://ik.imagekit.io/unizap/country_flag/ad.svg"},{code:"AO",name:"Angola",dialCode:"+244",flag:"https://ik.imagekit.io/unizap/country_flag/ao.svg"},{code:"AI",name:"Anguilla",dialCode:"+1264",flag:"https://ik.imagekit.io/unizap/country_flag/ai.svg"},{code:"AQ",name:"Antarctica",dialCode:"+672",flag:"https://ik.imagekit.io/unizap/country_flag/aq.svg"},{code:"AG",name:"Antigua and Barbuda",dialCode:"+1268",flag:"https://ik.imagekit.io/unizap/country_flag/ag.svg"},{code:"AR",name:"Argentina",dialCode:"+54",flag:"https://ik.imagekit.io/unizap/country_flag/ar.svg"},{code:"AM",name:"Armenia",dialCode:"+374",flag:"https://ik.imagekit.io/unizap/country_flag/am.svg"},{code:"AW",name:"Aruba",dialCode:"+297",flag:"https://ik.imagekit.io/unizap/country_flag/aw.svg"},{code:"AU",name:"Australia",dialCode:"+61",flag:"https://ik.imagekit.io/unizap/country_flag/au.svg"},{code:"AT",name:"Austria",dialCode:"+43",flag:"https://ik.imagekit.io/unizap/country_flag/at.svg"},{code:"AZ",name:"Azerbaijan",dialCode:"+994",flag:"https://ik.imagekit.io/unizap/country_flag/az.svg"},{code:"BS",name:"Bahamas",dialCode:"+1242",flag:"https://ik.imagekit.io/unizap/country_flag/bs.svg"},{code:"BH",name:"Bahrain",dialCode:"+973",flag:"https://ik.imagekit.io/unizap/country_flag/bh.svg"},{code:"BD",name:"Bangladesh",dialCode:"+880",flag:"https://ik.imagekit.io/unizap/country_flag/bd.svg"},{code:"BB",name:"Barbados",dialCode:"+1246",flag:"https://ik.imagekit.io/unizap/country_flag/bb.svg"},{code:"BY",name:"Belarus",dialCode:"+375",flag:"https://ik.imagekit.io/unizap/country_flag/by.svg"},{code:"BE",name:"Belgium",dialCode:"+32",flag:"https://ik.imagekit.io/unizap/country_flag/be.svg"},{code:"BZ",name:"Belize",dialCode:"+501",flag:"https://ik.imagekit.io/unizap/country_flag/bz.svg"},{code:"BJ",name:"Benin",dialCode:"+229",flag:"https://ik.imagekit.io/unizap/country_flag/bj.svg"},{code:"BM",name:"Bermuda",dialCode:"+1441",flag:"https://ik.imagekit.io/unizap/country_flag/bm.svg"},{code:"BT",name:"Bhutan",dialCode:"+975",flag:"https://ik.imagekit.io/unizap/country_flag/bt.svg"},{code:"BO",name:"Bolivia",dialCode:"+591",flag:"https://ik.imagekit.io/unizap/country_flag/bo.svg"},{code:"BA",name:"Bosnia and Herzegovina",dialCode:"+387",flag:"https://ik.imagekit.io/unizap/country_flag/ba.svg"},{code:"BW",name:"Botswana",dialCode:"+267",flag:"https://ik.imagekit.io/unizap/country_flag/bw.svg"},{code:"BR",name:"Brazil",dialCode:"+55",flag:"https://ik.imagekit.io/unizap/country_flag/br.svg"},{code:"IO",name:"British Indian Ocean Territory",dialCode:"+246",flag:"https://ik.imagekit.io/unizap/country_flag/io.svg"},{code:"VG",name:"British Virgin Islands",dialCode:"+1284",flag:"https://ik.imagekit.io/unizap/country_flag/vg.svg"},{code:"BN",name:"Brunei",dialCode:"+673",flag:"https://ik.imagekit.io/unizap/country_flag/bn.svg"},{code:"BG",name:"Bulgaria",dialCode:"+359",flag:"https://ik.imagekit.io/unizap/country_flag/bg.svg"},{code:"BF",name:"Burkina Faso",dialCode:"+226",flag:"https://ik.imagekit.io/unizap/country_flag/bf.svg"},{code:"BI",name:"Burundi",dialCode:"+257",flag:"https://ik.imagekit.io/unizap/country_flag/bi.svg"},{code:"KH",name:"Cambodia",dialCode:"+855",flag:"https://ik.imagekit.io/unizap/country_flag/kh.svg"},{code:"CM",name:"Cameroon",dialCode:"+237",flag:"https://ik.imagekit.io/unizap/country_flag/cm.svg"},{code:"CA",name:"Canada",dialCode:"+1",flag:"https://ik.imagekit.io/unizap/country_flag/ca.svg"},{code:"CV",name:"Cape Verde",dialCode:"+238",flag:"https://ik.imagekit.io/unizap/country_flag/cv.svg"},{code:"KY",name:"Cayman Islands",dialCode:"+1345",flag:"https://ik.imagekit.io/unizap/country_flag/ky.svg"},{code:"CF",name:"Central African Republic",dialCode:"+236",flag:"https://ik.imagekit.io/unizap/country_flag/cf.svg"},{code:"TD",name:"Chad",dialCode:"+235",flag:"https://ik.imagekit.io/unizap/country_flag/td.svg"},{code:"CL",name:"Chile",dialCode:"+56",flag:"https://ik.imagekit.io/unizap/country_flag/cl.svg"},{code:"CN",name:"China",dialCode:"+86",flag:"https://ik.imagekit.io/unizap/country_flag/cn.svg"},{code:"CX",name:"Christmas Island",dialCode:"+61",flag:"https://ik.imagekit.io/unizap/country_flag/cx.svg"},{code:"CC",name:"Cocos Islands",dialCode:"+61",flag:"https://ik.imagekit.io/unizap/country_flag/cc.svg"},{code:"CO",name:"Colombia",dialCode:"+57",flag:"https://ik.imagekit.io/unizap/country_flag/co.svg"},{code:"KM",name:"Comoros",dialCode:"+269",flag:"https://ik.imagekit.io/unizap/country_flag/km.svg"},{code:"CK",name:"Cook Islands",dialCode:"+682",flag:"https://ik.imagekit.io/unizap/country_flag/ck.svg"},{code:"CR",name:"Costa Rica",dialCode:"+506",flag:"https://ik.imagekit.io/unizap/country_flag/cr.svg"},{code:"HR",name:"Croatia",dialCode:"+385",flag:"https://ik.imagekit.io/unizap/country_flag/hr.svg"},{code:"CU",name:"Cuba",dialCode:"+53",flag:"https://ik.imagekit.io/unizap/country_flag/cu.svg"},{code:"CW",name:"Curacao",dialCode:"+599",flag:"https://ik.imagekit.io/unizap/country_flag/cw.svg"},{code:"CY",name:"Cyprus",dialCode:"+357",flag:"https://ik.imagekit.io/unizap/country_flag/cy.svg"},{code:"CZ",name:"Czech Republic",dialCode:"+420",flag:"https://ik.imagekit.io/unizap/country_flag/cz.svg"},{code:"CD",name:"Democratic Republic of the Congo",dialCode:"+243",flag:"https://ik.imagekit.io/unizap/country_flag/cd.svg"},{code:"DK",name:"Denmark",dialCode:"+45",flag:"https://ik.imagekit.io/unizap/country_flag/dk.svg"},{code:"DJ",name:"Djibouti",dialCode:"+253",flag:"https://ik.imagekit.io/unizap/country_flag/dj.svg"},{code:"DM",name:"Dominica",dialCode:"+1767",flag:"https://ik.imagekit.io/unizap/country_flag/dm.svg"},{code:"DO",name:"Dominican Republic",dialCode:"+1809",flag:"https://ik.imagekit.io/unizap/country_flag/do.svg"},{code:"TL",name:"East Timor",dialCode:"+670",flag:"https://ik.imagekit.io/unizap/country_flag/tl.svg"},{code:"EC",name:"Ecuador",dialCode:"+593",flag:"https://ik.imagekit.io/unizap/country_flag/ec.svg"},{code:"EG",name:"Egypt",dialCode:"+20",flag:"https://ik.imagekit.io/unizap/country_flag/eg.svg"},{code:"SV",name:"El Salvador",dialCode:"+503",flag:"https://ik.imagekit.io/unizap/country_flag/sv.svg"},{code:"GQ",name:"Equatorial Guinea",dialCode:"+240",flag:"https://ik.imagekit.io/unizap/country_flag/gq.svg"},{code:"ER",name:"Eritrea",dialCode:"+291",flag:"https://ik.imagekit.io/unizap/country_flag/er.svg"},{code:"EE",name:"Estonia",dialCode:"+372",flag:"https://ik.imagekit.io/unizap/country_flag/ee.svg"},{code:"SZ",name:"Eswatini",dialCode:"+268",flag:"https://ik.imagekit.io/unizap/country_flag/sz.svg"},{code:"ET",name:"Ethiopia",dialCode:"+251",flag:"https://ik.imagekit.io/unizap/country_flag/et.svg"},{code:"FK",name:"Falkland Islands",dialCode:"+500",flag:"https://ik.imagekit.io/unizap/country_flag/fk.svg"},{code:"FO",name:"Faroe Islands",dialCode:"+298",flag:"https://ik.imagekit.io/unizap/country_flag/fo.svg"},{code:"FJ",name:"Fiji",dialCode:"+679",flag:"https://ik.imagekit.io/unizap/country_flag/fj.svg"},{code:"FI",name:"Finland",dialCode:"+358",flag:"https://ik.imagekit.io/unizap/country_flag/fi.svg"},{code:"FR",name:"France",dialCode:"+33",flag:"https://ik.imagekit.io/unizap/country_flag/fr.svg"},{code:"PF",name:"French Polynesia",dialCode:"+689",flag:"https://ik.imagekit.io/unizap/country_flag/pf.svg"},{code:"GA",name:"Gabon",dialCode:"+241",flag:"https://ik.imagekit.io/unizap/country_flag/ga.svg"},{code:"GM",name:"Gambia",dialCode:"+220",flag:"https://ik.imagekit.io/unizap/country_flag/gm.svg"},{code:"GE",name:"Georgia",dialCode:"+995",flag:"https://ik.imagekit.io/unizap/country_flag/ge.svg"},{code:"DE",name:"Germany",dialCode:"+49",flag:"https://ik.imagekit.io/unizap/country_flag/de.svg"},{code:"GH",name:"Ghana",dialCode:"+233",flag:"https://ik.imagekit.io/unizap/country_flag/gh.svg"},{code:"GI",name:"Gibraltar",dialCode:"+350",flag:"https://ik.imagekit.io/unizap/country_flag/gi.svg"},{code:"GR",name:"Greece",dialCode:"+30",flag:"https://ik.imagekit.io/unizap/country_flag/gr.svg"},{code:"GL",name:"Greenland",dialCode:"+299",flag:"https://ik.imagekit.io/unizap/country_flag/gl.svg"},{code:"GD",name:"Grenada",dialCode:"+1473",flag:"https://ik.imagekit.io/unizap/country_flag/gd.svg"},{code:"GU",name:"Guam",dialCode:"+1671",flag:"https://ik.imagekit.io/unizap/country_flag/gu.svg"},{code:"GT",name:"Guatemala",dialCode:"+502",flag:"https://ik.imagekit.io/unizap/country_flag/gt.svg"},{code:"GG",name:"Guernsey",dialCode:"+44",flag:"https://ik.imagekit.io/unizap/country_flag/gg.svg"},{code:"GN",name:"Guinea",dialCode:"+224",flag:"https://ik.imagekit.io/unizap/country_flag/gn.svg"},{code:"GW",name:"Guinea-Bissau",dialCode:"+245",flag:"https://ik.imagekit.io/unizap/country_flag/gw.svg"},{code:"GY",name:"Guyana",dialCode:"+592",flag:"https://ik.imagekit.io/unizap/country_flag/gy.svg"},{code:"HT",name:"Haiti",dialCode:"+509",flag:"https://ik.imagekit.io/unizap/country_flag/ht.svg"},{code:"HN",name:"Honduras",dialCode:"+504",flag:"https://ik.imagekit.io/unizap/country_flag/hn.svg"},{code:"HK",name:"Hong Kong",dialCode:"+852",flag:"https://ik.imagekit.io/unizap/country_flag/hk.svg"},{code:"HU",name:"Hungary",dialCode:"+36",flag:"https://ik.imagekit.io/unizap/country_flag/hu.svg"},{code:"IS",name:"Iceland",dialCode:"+354",flag:"https://ik.imagekit.io/unizap/country_flag/is.svg"},{code:"IN",name:"India",dialCode:"+91",flag:"https://ik.imagekit.io/unizap/country_flag/in.svg"},{code:"ID",name:"Indonesia",dialCode:"+62",flag:"https://ik.imagekit.io/unizap/country_flag/id.svg"},{code:"IR",name:"Iran",dialCode:"+98",flag:"https://ik.imagekit.io/unizap/country_flag/ir.svg"},{code:"IQ",name:"Iraq",dialCode:"+964",flag:"https://ik.imagekit.io/unizap/country_flag/iq.svg"},{code:"IE",name:"Ireland",dialCode:"+353",flag:"https://ik.imagekit.io/unizap/country_flag/ie.svg"},{code:"IM",name:"Isle of Man",dialCode:"+44",flag:"https://ik.imagekit.io/unizap/country_flag/im.svg"},{code:"IL",name:"Israel",dialCode:"+972",flag:"https://ik.imagekit.io/unizap/country_flag/il.svg"},{code:"IT",name:"Italy",dialCode:"+39",flag:"https://ik.imagekit.io/unizap/country_flag/it.svg"},{code:"CI",name:"Ivory Coast",dialCode:"+225",flag:"https://ik.imagekit.io/unizap/country_flag/ci.svg"},{code:"JM",name:"Jamaica",dialCode:"+1876",flag:"https://ik.imagekit.io/unizap/country_flag/jm.svg"},{code:"JP",name:"Japan",dialCode:"+81",flag:"https://ik.imagekit.io/unizap/country_flag/jp.svg"},{code:"JE",name:"Jersey",dialCode:"+44",flag:"https://ik.imagekit.io/unizap/country_flag/je.svg"},{code:"JO",name:"Jordan",dialCode:"+962",flag:"https://ik.imagekit.io/unizap/country_flag/jo.svg"},{code:"KZ",name:"Kazakhstan",dialCode:"+7",flag:"https://ik.imagekit.io/unizap/country_flag/kz.svg"},{code:"KE",name:"Kenya",dialCode:"+254",flag:"https://ik.imagekit.io/unizap/country_flag/ke.svg"},{code:"KI",name:"Kiribati",dialCode:"+686",flag:"https://ik.imagekit.io/unizap/country_flag/ki.svg"},{code:"XK",name:"Kosovo",dialCode:"+383",flag:"https://ik.imagekit.io/unizap/country_flag/xk.svg"},{code:"KW",name:"Kuwait",dialCode:"+965",flag:"https://ik.imagekit.io/unizap/country_flag/kw.svg"},{code:"KG",name:"Kyrgyzstan",dialCode:"+996",flag:"https://ik.imagekit.io/unizap/country_flag/kg.svg"},{code:"LA",name:"Laos",dialCode:"+856",flag:"https://ik.imagekit.io/unizap/country_flag/la.svg"},{code:"LV",name:"Latvia",dialCode:"+371",flag:"https://ik.imagekit.io/unizap/country_flag/lv.svg"},{code:"LB",name:"Lebanon",dialCode:"+961",flag:"https://ik.imagekit.io/unizap/country_flag/lb.svg"},{code:"LS",name:"Lesotho",dialCode:"+266",flag:"https://ik.imagekit.io/unizap/country_flag/ls.svg"},{code:"LR",name:"Liberia",dialCode:"+231",flag:"https://ik.imagekit.io/unizap/country_flag/lr.svg"},{code:"LY",name:"Libya",dialCode:"+218",flag:"https://ik.imagekit.io/unizap/country_flag/ly.svg"},{code:"LI",name:"Liechtenstein",dialCode:"+423",flag:"https://ik.imagekit.io/unizap/country_flag/li.svg"},{code:"LT",name:"Lithuania",dialCode:"+370",flag:"https://ik.imagekit.io/unizap/country_flag/lt.svg"},{code:"LU",name:"Luxembourg",dialCode:"+352",flag:"https://ik.imagekit.io/unizap/country_flag/lu.svg"},{code:"MO",name:"Macau",dialCode:"+853",flag:"https://ik.imagekit.io/unizap/country_flag/mo.svg"},{code:"MK",name:"North Macedonia",dialCode:"+389",flag:"https://ik.imagekit.io/unizap/country_flag/mk.svg"},{code:"MG",name:"Madagascar",dialCode:"+261",flag:"https://ik.imagekit.io/unizap/country_flag/mg.svg"},{code:"MW",name:"Malawi",dialCode:"+265",flag:"https://ik.imagekit.io/unizap/country_flag/mw.svg"},{code:"MY",name:"Malaysia",dialCode:"+60",flag:"https://ik.imagekit.io/unizap/country_flag/my.svg"},{code:"MV",name:"Maldives",dialCode:"+960",flag:"https://ik.imagekit.io/unizap/country_flag/mv.svg"},{code:"ML",name:"Mali",dialCode:"+223",flag:"https://ik.imagekit.io/unizap/country_flag/ml.svg"},{code:"MT",name:"Malta",dialCode:"+356",flag:"https://ik.imagekit.io/unizap/country_flag/mt.svg"},{code:"MH",name:"Marshall Islands",dialCode:"+692",flag:"https://ik.imagekit.io/unizap/country_flag/mh.svg"},{code:"MR",name:"Mauritania",dialCode:"+222",flag:"https://ik.imagekit.io/unizap/country_flag/mr.svg"},{code:"MU",name:"Mauritius",dialCode:"+230",flag:"https://ik.imagekit.io/unizap/country_flag/mu.svg"},{code:"YT",name:"Mayotte",dialCode:"+262",flag:"https://ik.imagekit.io/unizap/country_flag/yt.svg"},{code:"MX",name:"Mexico",dialCode:"+52",flag:"https://ik.imagekit.io/unizap/country_flag/mx.svg"},{code:"FM",name:"Micronesia",dialCode:"+691",flag:"https://ik.imagekit.io/unizap/country_flag/fm.svg"},{code:"MD",name:"Moldova",dialCode:"+373",flag:"https://ik.imagekit.io/unizap/country_flag/md.svg"},{code:"MC",name:"Monaco",dialCode:"+377",flag:"https://ik.imagekit.io/unizap/country_flag/mc.svg"},{code:"MN",name:"Mongolia",dialCode:"+976",flag:"https://ik.imagekit.io/unizap/country_flag/mn.svg"},{code:"ME",name:"Montenegro",dialCode:"+382",flag:"https://ik.imagekit.io/unizap/country_flag/me.svg"},{code:"MS",name:"Montserrat",dialCode:"+1664",flag:"https://ik.imagekit.io/unizap/country_flag/ms.svg"},{code:"MA",name:"Morocco",dialCode:"+212",flag:"https://ik.imagekit.io/unizap/country_flag/ma.svg"},{code:"MZ",name:"Mozambique",dialCode:"+258",flag:"https://ik.imagekit.io/unizap/country_flag/mz.svg"},{code:"MM",name:"Myanmar",dialCode:"+95",flag:"https://ik.imagekit.io/unizap/country_flag/mm.svg"},{code:"NA",name:"Namibia",dialCode:"+264",flag:"https://ik.imagekit.io/unizap/country_flag/na.svg"},{code:"NR",name:"Nauru",dialCode:"+674",flag:"https://ik.imagekit.io/unizap/country_flag/nr.svg"},{code:"NP",name:"Nepal",dialCode:"+977",flag:"https://ik.imagekit.io/unizap/country_flag/np.svg"},{code:"NL",name:"Netherlands",dialCode:"+31",flag:"https://ik.imagekit.io/unizap/country_flag/nl.svg"},{code:"NC",name:"New Caledonia",dialCode:"+687",flag:"https://ik.imagekit.io/unizap/country_flag/nc.svg"},{code:"NZ",name:"New Zealand",dialCode:"+64",flag:"https://ik.imagekit.io/unizap/country_flag/nz.svg"},{code:"NI",name:"Nicaragua",dialCode:"+505",flag:"https://ik.imagekit.io/unizap/country_flag/ni.svg"},{code:"NE",name:"Niger",dialCode:"+227",flag:"https://ik.imagekit.io/unizap/country_flag/ne.svg"},{code:"NG",name:"Nigeria",dialCode:"+234",flag:"https://ik.imagekit.io/unizap/country_flag/ng.svg"},{code:"NU",name:"Niue",dialCode:"+683",flag:"https://ik.imagekit.io/unizap/country_flag/nu.svg"},{code:"NF",name:"Norfolk Island",dialCode:"+672",flag:"https://ik.imagekit.io/unizap/country_flag/nf.svg"},{code:"KP",name:"North Korea",dialCode:"+850",flag:"https://ik.imagekit.io/unizap/country_flag/kp.svg"},{code:"MP",name:"Northern Mariana Islands",dialCode:"+1670",flag:"https://ik.imagekit.io/unizap/country_flag/mp.svg"},{code:"NO",name:"Norway",dialCode:"+47",flag:"https://ik.imagekit.io/unizap/country_flag/no.svg"},{code:"OM",name:"Oman",dialCode:"+968",flag:"https://ik.imagekit.io/unizap/country_flag/om.svg"},{code:"PK",name:"Pakistan",dialCode:"+92",flag:"https://ik.imagekit.io/unizap/country_flag/pk.svg"},{code:"PW",name:"Palau",dialCode:"+680",flag:"https://ik.imagekit.io/unizap/country_flag/pw.svg"},{code:"PS",name:"Palestine",dialCode:"+970",flag:"https://ik.imagekit.io/unizap/country_flag/ps.svg"},{code:"PA",name:"Panama",dialCode:"+507",flag:"https://ik.imagekit.io/unizap/country_flag/pa.svg"},{code:"PG",name:"Papua New Guinea",dialCode:"+675",flag:"https://ik.imagekit.io/unizap/country_flag/pg.svg"},{code:"PY",name:"Paraguay",dialCode:"+595",flag:"https://ik.imagekit.io/unizap/country_flag/py.svg"},{code:"PE",name:"Peru",dialCode:"+51",flag:"https://ik.imagekit.io/unizap/country_flag/pe.svg"},{code:"PH",name:"Philippines",dialCode:"+63",flag:"https://ik.imagekit.io/unizap/country_flag/ph.svg"},{code:"PN",name:"Pitcairn Islands",dialCode:"+64",flag:"https://ik.imagekit.io/unizap/country_flag/pn.svg"},{code:"PL",name:"Poland",dialCode:"+48",flag:"https://ik.imagekit.io/unizap/country_flag/pl.svg"},{code:"PT",name:"Portugal",dialCode:"+351",flag:"https://ik.imagekit.io/unizap/country_flag/pt.svg"},{code:"PR",name:"Puerto Rico",dialCode:"+1787",flag:"https://ik.imagekit.io/unizap/country_flag/pr.svg"},{code:"QA",name:"Qatar",dialCode:"+974",flag:"https://ik.imagekit.io/unizap/country_flag/qa.svg"},{code:"CG",name:"Republic of the Congo",dialCode:"+242",flag:"https://ik.imagekit.io/unizap/country_flag/cg.svg"},{code:"RE",name:"Reunion",dialCode:"+262",flag:"https://ik.imagekit.io/unizap/country_flag/re.svg"},{code:"RO",name:"Romania",dialCode:"+40",flag:"https://ik.imagekit.io/unizap/country_flag/ro.svg"},{code:"RU",name:"Russia",dialCode:"+7",flag:"https://ik.imagekit.io/unizap/country_flag/ru.svg"},{code:"RW",name:"Rwanda",dialCode:"+250",flag:"https://ik.imagekit.io/unizap/country_flag/rw.svg"},{code:"BL",name:"Saint Barthelemy",dialCode:"+590",flag:"https://ik.imagekit.io/unizap/country_flag/bl.svg"},{code:"SH",name:"Saint Helena",dialCode:"+290",flag:"https://ik.imagekit.io/unizap/country_flag/sh.svg"},{code:"KN",name:"Saint Kitts and Nevis",dialCode:"+1869",flag:"https://ik.imagekit.io/unizap/country_flag/kn.svg"},{code:"LC",name:"Saint Lucia",dialCode:"+1758",flag:"https://ik.imagekit.io/unizap/country_flag/lc.svg"},{code:"MF",name:"Saint Martin",dialCode:"+590",flag:"https://ik.imagekit.io/unizap/country_flag/mf.svg"},{code:"PM",name:"Saint Pierre and Miquelon",dialCode:"+508",flag:"https://ik.imagekit.io/unizap/country_flag/pm.svg"},{code:"VC",name:"Saint Vincent and the Grenadines",dialCode:"+1784",flag:"https://ik.imagekit.io/unizap/country_flag/vc.svg"},{code:"WS",name:"Samoa",dialCode:"+685",flag:"https://ik.imagekit.io/unizap/country_flag/ws.svg"},{code:"SM",name:"San Marino",dialCode:"+378",flag:"https://ik.imagekit.io/unizap/country_flag/sm.svg"},{code:"ST",name:"Sao Tome and Principe",dialCode:"+239",flag:"https://ik.imagekit.io/unizap/country_flag/st.svg"},{code:"SA",name:"Saudi Arabia",dialCode:"+966",flag:"https://ik.imagekit.io/unizap/country_flag/sa.svg"},{code:"SN",name:"Senegal",dialCode:"+221",flag:"https://ik.imagekit.io/unizap/country_flag/sn.svg"},{code:"RS",name:"Serbia",dialCode:"+381",flag:"https://ik.imagekit.io/unizap/country_flag/rs.svg"},{code:"SC",name:"Seychelles",dialCode:"+248",flag:"https://ik.imagekit.io/unizap/country_flag/sc.svg"},{code:"SL",name:"Sierra Leone",dialCode:"+232",flag:"https://ik.imagekit.io/unizap/country_flag/sl.svg"},{code:"SG",name:"Singapore",dialCode:"+65",flag:"https://ik.imagekit.io/unizap/country_flag/sg.svg"},{code:"SX",name:"Sint Maarten",dialCode:"+1721",flag:"https://ik.imagekit.io/unizap/country_flag/sx.svg"},{code:"SK",name:"Slovakia",dialCode:"+421",flag:"https://ik.imagekit.io/unizap/country_flag/sk.svg"},{code:"SI",name:"Slovenia",dialCode:"+386",flag:"https://ik.imagekit.io/unizap/country_flag/si.svg"},{code:"SB",name:"Solomon Islands",dialCode:"+677",flag:"https://ik.imagekit.io/unizap/country_flag/sb.svg"},{code:"SO",name:"Somalia",dialCode:"+252",flag:"https://ik.imagekit.io/unizap/country_flag/so.svg"},{code:"ZA",name:"South Africa",dialCode:"+27",flag:"https://ik.imagekit.io/unizap/country_flag/za.svg"},{code:"KR",name:"South Korea",dialCode:"+82",flag:"https://ik.imagekit.io/unizap/country_flag/kr.svg"},{code:"SS",name:"South Sudan",dialCode:"+211",flag:"https://ik.imagekit.io/unizap/country_flag/ss.svg"},{code:"ES",name:"Spain",dialCode:"+34",flag:"https://ik.imagekit.io/unizap/country_flag/es.svg"},{code:"LK",name:"Sri Lanka",dialCode:"+94",flag:"https://ik.imagekit.io/unizap/country_flag/lk.svg"},{code:"SD",name:"Sudan",dialCode:"+249",flag:"https://ik.imagekit.io/unizap/country_flag/sd.svg"},{code:"SR",name:"Suriname",dialCode:"+597",flag:"https://ik.imagekit.io/unizap/country_flag/sr.svg"},{code:"SJ",name:"Svalbard and Jan Mayen",dialCode:"+47",flag:"https://ik.imagekit.io/unizap/country_flag/sj.svg"},{code:"SE",name:"Sweden",dialCode:"+46",flag:"https://ik.imagekit.io/unizap/country_flag/se.svg"},{code:"CH",name:"Switzerland",dialCode:"+41",flag:"https://ik.imagekit.io/unizap/country_flag/ch.svg"},{code:"SY",name:"Syria",dialCode:"+963",flag:"https://ik.imagekit.io/unizap/country_flag/sy.svg"},{code:"TW",name:"Taiwan",dialCode:"+886",flag:"https://ik.imagekit.io/unizap/country_flag/tw.svg"},{code:"TJ",name:"Tajikistan",dialCode:"+992",flag:"https://ik.imagekit.io/unizap/country_flag/tj.svg"},{code:"TZ",name:"Tanzania",dialCode:"+255",flag:"https://ik.imagekit.io/unizap/country_flag/tz.svg"},{code:"TH",name:"Thailand",dialCode:"+66",flag:"https://ik.imagekit.io/unizap/country_flag/th.svg"},{code:"TG",name:"Togo",dialCode:"+228",flag:"https://ik.imagekit.io/unizap/country_flag/tg.svg"},{code:"TK",name:"Tokelau",dialCode:"+690",flag:"https://ik.imagekit.io/unizap/country_flag/tk.svg"},{code:"TO",name:"Tonga",dialCode:"+676",flag:"https://ik.imagekit.io/unizap/country_flag/to.svg"},{code:"TT",name:"Trinidad and Tobago",dialCode:"+1868",flag:"https://ik.imagekit.io/unizap/country_flag/tt.svg"},{code:"TN",name:"Tunisia",dialCode:"+216",flag:"https://ik.imagekit.io/unizap/country_flag/tn.svg"},{code:"TR",name:"Turkey",dialCode:"+90",flag:"https://ik.imagekit.io/unizap/country_flag/tr.svg"},{code:"TM",name:"Turkmenistan",dialCode:"+993",flag:"https://ik.imagekit.io/unizap/country_flag/tm.svg"},{code:"TC",name:"Turks and Caicos Islands",dialCode:"+1649",flag:"https://ik.imagekit.io/unizap/country_flag/tc.svg"},{code:"TV",name:"Tuvalu",dialCode:"+688",flag:"https://ik.imagekit.io/unizap/country_flag/tv.svg"},{code:"VI",name:"U.S. Virgin Islands",dialCode:"+1340",flag:"https://ik.imagekit.io/unizap/country_flag/vi.svg"},{code:"UG",name:"Uganda",dialCode:"+256",flag:"https://ik.imagekit.io/unizap/country_flag/ug.svg"},{code:"UA",name:"Ukraine",dialCode:"+380",flag:"https://ik.imagekit.io/unizap/country_flag/ua.svg"},{code:"AE",name:"United Arab Emirates",dialCode:"+971",flag:"https://ik.imagekit.io/unizap/country_flag/ae.svg"},{code:"GB",name:"United Kingdom",dialCode:"+44",flag:"https://ik.imagekit.io/unizap/country_flag/gb.svg"},{code:"US",name:"United States",dialCode:"+1",flag:"https://ik.imagekit.io/unizap/country_flag/us.svg"},{code:"UY",name:"Uruguay",dialCode:"+598",flag:"https://ik.imagekit.io/unizap/country_flag/uy.svg"},{code:"UZ",name:"Uzbekistan",dialCode:"+998",flag:"https://ik.imagekit.io/unizap/country_flag/uz.svg"},{code:"VU",name:"Vanuatu",dialCode:"+678",flag:"https://ik.imagekit.io/unizap/country_flag/vu.svg"},{code:"VA",name:"Vatican City",dialCode:"+379",flag:"https://ik.imagekit.io/unizap/country_flag/va.svg"},{code:"VE",name:"Venezuela",dialCode:"+58",flag:"https://ik.imagekit.io/unizap/country_flag/ve.svg"},{code:"VN",name:"Vietnam",dialCode:"+84",flag:"https://ik.imagekit.io/unizap/country_flag/vn.svg"},{code:"WF",name:"Wallis and Futuna",dialCode:"+681",flag:"https://ik.imagekit.io/unizap/country_flag/wf.svg"},{code:"EH",name:"Western Sahara",dialCode:"+212",flag:"https://ik.imagekit.io/unizap/country_flag/eh.svg"},{code:"YE",name:"Yemen",dialCode:"+967",flag:"https://ik.imagekit.io/unizap/country_flag/ye.svg"},{code:"ZM",name:"Zambia",dialCode:"+260",flag:"https://ik.imagekit.io/unizap/country_flag/zm.svg"},{code:"ZW",name:"Zimbabwe",dialCode:"+263",flag:"https://ik.imagekit.io/unizap/country_flag/zw.svg"}],ti=({value:e,onChange:o,multiple:t=!1,searchable:n=!0,placeholder:r="Select country",searchPlaceholder:i="Search countries...",className:l="",menuClassName:s="",maxHeight:c=250,position:u="auto",disabled:g=!1,showDialCode:m=!0,showFlag:p=!0,searchClassName:d="",showClearAll:x=!1})=>{const[f,w]=v.useState(!1),[b,z]=v.useState(""),[y,$]=v.useState(-1),[k,V]=v.useState("bottom"),j=v.useRef(null),Z=v.useRef(null),ee=v.useRef(null),X=t?Array.isArray(e)?e:[]:e&&!Array.isArray(e)?[e]:[],G=b?dn.filter(M=>M.name.toLowerCase().includes(b.toLowerCase())||M.code.toLowerCase().includes(b.toLowerCase())||M.dialCode.includes(b)):dn,se=G.filter(M=>X.some(C=>C.code===M.code)),W=G.filter(M=>!X.some(C=>C.code===M.code)),T=M=>{if(t){const C=Array.isArray(e)?e:[],A=C.some(E=>E.code===M.code)?C.filter(E=>E.code!==M.code):[...C,M];o==null||o(A)}else o==null||o(M),w(!1),z("")},D=(M,C)=>{C.stopPropagation(),t&&Array.isArray(e)&&(o==null||o(e.filter(S=>S.code!==M.code)))},Q=M=>{M.stopPropagation(),o==null||o(t?[]:null)};v.useEffect(()=>{const M=C=>{j.current&&!j.current.contains(C.target)&&(w(!1),z(""),$(-1))};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[]),v.useEffect(()=>{if(f&&j.current){if(u==="auto"){const M=j.current.getBoundingClientRect(),C=Math.min(G.length*44,c),S=window.innerHeight-M.bottom,A=M.top;V(S>=C||S>=A?"bottom":"top")}else V(u);n&&Z.current&&Z.current.focus()}},[f,G.length,c,u,n]);const R=M=>{M.key==="ArrowDown"?(M.preventDefault(),f?$(C=>Math.min(C+1,G.length-1)):(w(!0),$(0))):M.key==="ArrowUp"?(M.preventDefault(),$(C=>Math.max(C-1,0))):M.key==="Enter"?(M.preventDefault(),y>=0&&G[y]&&T(G[y])):M.key==="Escape"&&(M.preventDefault(),w(!1),z(""),$(-1))},pe=()=>{if(t){if(X.length===0)return a.jsx("span",{className:"text-color-gray-400",children:r});const C=X[0],S=X.length-1;return a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-xs bg-color-gray-100 rounded-md",children:[p&&a.jsx("img",{src:C.flag,alt:C.name,className:"size-4 object-contain"}),a.jsx("span",{children:C.name}),a.jsx("button",{type:"button",onClick:A=>D(C,A),className:"ml-1 text-color-gray-500 hover:text-color-gray-700",children:a.jsx("svg",{className:"size-3",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636l4.95 4.95z"})})})]}),S>0&&a.jsxs("span",{className:"text-sm text-color-gray-500",children:["+",S," more"]})]})}const M=X[0];return M?a.jsxs("span",{className:"flex items-center gap-2",children:[p&&a.jsx("img",{src:M.flag,alt:M.name,className:"size-5 object-contain"}),a.jsx("span",{children:M.name}),m&&a.jsxs("span",{className:"text-color-gray-400",children:["(",M.dialCode,")"]})]}):a.jsx("span",{className:"text-color-gray-400",children:r})};return a.jsxs("div",{ref:j,className:"relative inline-block w-full",children:[a.jsxs("button",{type:"button",onClick:()=>!g&&w(!f),onKeyDown:R,disabled:g,className:`flex items-center justify-between w-full px-4 py-3 bg-color-white rounded-sm border border-color-gray-200 text-sm font-medium text-color-gray-700 hover:bg-color-gray-50 focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed ${l}`,children:[a.jsx("div",{className:"flex-1 text-left truncate",children:pe()}),a.jsxs("div",{className:"flex items-center gap-1 ml-2",children:[X.length>0&&x&&a.jsx("span",{role:"button",onClick:Q,className:"p-0.5 text-color-gray-400 hover:text-color-gray-600",children:a.jsx("svg",{className:"size-4",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636l4.95 4.95z"})})}),f?a.jsx("svg",{className:"text-color-gray-500 size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"})}):a.jsx("svg",{className:"text-color-gray-500 size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"})})]})]}),f&&a.jsxs("div",{className:`absolute right-0 z-10 w-full rounded-xl bg-color-white shadow-lg shadow-color-zinc-200 dark:shadow-color-gray-900 border border-color-gray-100 py-2 ${s}`,style:{bottom:k==="top"?"100%":"auto",top:k==="top"?"auto":"100%",marginBottom:k==="top"?"8px":"0",marginTop:k==="top"?"0":"8px"},children:[n&&a.jsx("div",{className:"px-2 pb-2",children:a.jsx("input",{ref:Z,type:"text",value:b,onChange:M=>{z(M.target.value),$(0)},onKeyDown:R,placeholder:i,className:`w-full px-3 py-2 text-sm bg-color-white border border-color-gray-200 rounded-lg focus:outline-none focus:border-color-gray-400 ${d}`})}),a.jsx("ul",{ref:ee,className:"overflow-y-auto",style:{maxHeight:`${c}px`},children:G.length>0?a.jsxs(a.Fragment,{children:[se.map((M,C)=>a.jsxs("li",{onClick:()=>T(M),className:`flex items-center gap-3 cursor-pointer w-full px-4 py-2 text-left text-sm text-color-gray-700 bg-color-gray-200 hover:bg-color-gray-100
173
173
  ${y===C?"bg-color-gray-100":""}`,children:[t&&a.jsx("span",{className:"flex items-center justify-center size-4 border rounded bg-color-blue-500 border-color-blue-500",children:a.jsx("svg",{className:"size-3 text-color-white",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z"})})}),p&&a.jsx("img",{src:M.flag,alt:M.name,className:"size-5 object-contain"}),a.jsx("span",{className:"flex-1",children:M.name}),m&&a.jsx("span",{className:"text-color-gray-400",children:M.dialCode})]},`selected-${M.code}`)),se.length>0&&W.length>0&&a.jsx("li",{className:"border-t border-color-gray-200 my-1"}),W.map((M,C)=>{const S=se.length+(se.length>0&&W.length>0?1:0)+C;return a.jsxs("li",{onClick:()=>T(M),className:`flex items-center gap-3 cursor-pointer w-full px-4 py-2 text-left text-sm text-color-gray-700 hover:bg-color-gray-100
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unizap/uniui",
3
- "version": "1.0.71",
3
+ "version": "1.0.73",
4
4
  "description": "UniUi helps developers and designers build beautiful, responsive UIs faster with ready-made, customizable components. Simplify your workflow and create stunning user interfaces effortlessly.",
5
5
  "type": "module",
6
6
  "files": [