{"version":3,"file":"responsive-state-combobox.6t1X3TDq.js","sources":["../../../src/components/responsive-state-combobox.tsx"],"sourcesContent":["import { type RefObject } from 'react'\nimport {\n US_STATES_MAP,\n US_STATES_SEARCH,\n type USState\n} from '@lib/us-states'\nimport { ResponsiveCombobox, type SearchOption } from '@components/ui/responsive-combobox'\n\nconst AllStatesOption = { label: 'All states', id: 'ALL', value: 'ALL' }\n\ntype Props = {\n setState: (state: USState | 'ALL') => void\n state: USState | 'ALL' | null\n isPortalPage?: boolean\n triggerButtonClassName?: string\n triggerButtonRef?: RefObject\n onOptionChange?: (option: SearchOption | null) => void\n placeholder?: string\n includeAllStatesOption?: boolean\n}\n\nexport const ResponsiveStateCombobox = ({\n setState,\n state,\n isPortalPage,\n triggerButtonClassName,\n triggerButtonRef,\n onOptionChange,\n placeholder,\n includeAllStatesOption = true\n}: Props) => {\n const options = includeAllStatesOption ? [AllStatesOption, ...US_STATES_SEARCH] : US_STATES_SEARCH\n\n return option.id === state?.abbr) || null\n }\n onOptionChange={(option: SearchOption | null) => {\n if (option) {\n setState(option.id === 'ALL' ? 'ALL' : US_STATES_MAP[option.id])\n } else {\n setState('ALL')\n }\n if (onOptionChange) {\n onOptionChange(option)\n }\n }}\n placeholder={placeholder || 'Select a state'}\n isPortalPage={isPortalPage}\n triggerButtonClassName={triggerButtonClassName || 'flex-1'}\n triggerButtonRef={triggerButtonRef}\n />\n}"],"names":["AllStatesOption","ResponsiveStateCombobox","setState","state","isPortalPage","triggerButtonClassName","triggerButtonRef","onOptionChange","placeholder","includeAllStatesOption","options","US_STATES_SEARCH","jsx","ResponsiveCombobox","option","US_STATES_MAP"],"mappings":"uhBAQA,MAAMA,EAAkB,CAAE,MAAO,aAAc,GAAI,MAAO,MAAO,OAapDC,EAA0B,CAAC,CACtC,SAAAC,EACA,MAAAC,EACA,aAAAC,EACA,uBAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,YAAAC,EACA,uBAAAC,EAAyB,EAC3B,IAAa,CACX,MAAMC,EAAUD,EAAyB,CAACT,EAAiB,GAAGW,CAAgB,EAAIA,EAE3E,OAAAC,EAAA,IAACC,EAAA,CACN,QAAAH,EACA,eACEP,IAAU,MACRH,EAEAW,EAAiB,KAAMG,GAAWA,EAAO,KAAOX,GAAO,IAAI,GAAK,KAEpE,eAAiBW,GAAgC,CAE7CZ,EADEY,EACOA,EAAO,KAAO,MAAQ,MAAQC,EAAcD,EAAO,EAAE,EAErD,KAFsD,EAI7DP,GACFA,EAAeO,CAAM,CAEzB,EACA,YAAaN,GAAe,iBAC5B,aAAAJ,EACA,uBAAwBC,GAA0B,SAClD,iBAAAC,CAAA,CAAA,CAEJ"}