import{r as t,j as e}from"./vendor-tanstack-BpuysabX.js";import{ak as T,al as j,am as f,an as L,ap as E,ao as g,aq as w,ar as u}from"./index-CREafGO4.js";import{c as b,e as z}from"./dropdown-menu-DZExFL3b.js";function x(s){return s.replaceAll("/"," / ").replaceAll("_"," ")}const C=Intl.DateTimeFormat().resolvedOptions().timeZone,p=[{label:"UTC",value:"Etc/UTC"},{label:x(C),value:C}],h=Intl.supportedValuesOf("timeZone").map(s=>({label:x(s),value:s})).slice(0,5),M=[...p,...h],A=({selectedValue:s="",onSelect:m})=>{const[c,a]=t.useState(""),n=t.useDeferredValue(c),i=t.useMemo(()=>p.filter(o=>o.label.toLowerCase().includes(n.toLowerCase())||o.value.toLowerCase().includes(n.toLowerCase())),[n]),d=t.useMemo(()=>h.filter(o=>o.label.toLowerCase().includes(n.toLowerCase())||o.value.toLowerCase().includes(n.toLowerCase())),[n]),S=t.useMemo(()=>M.find(({value:o})=>o===s),[s]);return e.jsxs(T,{children:[e.jsx(j,{selected:!!s,"aria-label":"Select timezone",children:S?.label??"Select timezone"}),e.jsxs(f,{children:[e.jsx(L,{value:c,onValueChange:a,placeholder:"Search"}),e.jsx(E,{children:"No timezone found"}),e.jsx(g,{children:e.jsxs(w,{children:[i.length>0&&e.jsx(b,{children:"Suggested timezones"}),i.map(({label:o,value:r})=>e.jsx(u,{selected:s===r,onSelect:l=>{m(l),a("")},value:r,children:o},r)),e.jsx(z,{}),d.length>0&&e.jsx(b,{children:"All timezones"}),d.map(({label:o,value:r})=>e.jsx(u,{selected:s===r,onSelect:l=>{m(l),a("")},value:r,children:o},r))]})})]})]})};export{A as T};
//# sourceMappingURL=timezone-select-DpL0avEm.js.map
