import{r as t,j as e}from"./vendor-tanstack-DE4ALVGD.js";import{ag as j,ah as T,ai as f,aj as L,al as E,ak as g,am as w,an as u}from"./index-CNL5pSma.js";import{c as b,e as z}from"./dropdown-menu-D34zumpn.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(""),r=t.useDeferredValue(c),i=t.useMemo(()=>p.filter(o=>o.label.toLowerCase().includes(r.toLowerCase())||o.value.toLowerCase().includes(r.toLowerCase())),[r]),d=t.useMemo(()=>h.filter(o=>o.label.toLowerCase().includes(r.toLowerCase())||o.value.toLowerCase().includes(r.toLowerCase())),[r]),S=t.useMemo(()=>M.find(({value:o})=>o===s),[s]);return e.jsxs(j,{children:[e.jsx(T,{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:n})=>e.jsx(u,{selected:s===n,onSelect:l=>{m(l),a("")},value:n,children:o},n)),e.jsx(z,{}),d.length>0&&e.jsx(b,{children:"All timezones"}),d.map(({label:o,value:n})=>e.jsx(u,{selected:s===n,onSelect:l=>{m(l),a("")},value:n,children:o},n))]})})]})]})};export{A as T};
//# sourceMappingURL=timezone-select-zsZ2PBlt.js.map
