{"version":3,"file":"WithTranslation.CD1fWDWP.mjs","names":["useState","savedLang"],"sources":["https:/framerusercontent.com/modules/JdLsogIj8d1RWkzyXdHB/KMEdku45J8BZyQNc4kDC/WithTranslation.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";const useStore=createStore({lang:\"\"});const LANG_EN=\"en\";const LANG_ZH_HK=\"zh_hk\";const LANG_ZH_CN=\"zh_cn\";export function withTranslation(Component){return props=>{const[store,setStore]=useStore();const[savedLang,setSavedLang]=useState(\"\");useEffect(()=>{const savedLang=localStorage.getItem(\"lang\");if(savedLang){setStore({...store,lang:savedLang});setSavedLang(savedLang);}},[]);return /*#__PURE__*/_jsx(Component,{...props,variant:store.lang||savedLang});};}export function withGetLangFromBrowser(Component){return props=>{const[store,setStore]=useStore();const[savedLang,setSavedLang]=useState(\"\");useEffect(()=>{const savedLang=localStorage.getItem(\"lang\");if(savedLang){setStore({...store,lang:savedLang});setSavedLang(savedLang);}},[]);return /*#__PURE__*/_jsx(Component,{...props,variant:store.lang});};}export function withSelectEn(Component){return props=>{const[store,setStore]=useStore();const handleSelectLang=e=>{e.preventDefault();setStore({...store,lang:LANG_EN});const savedLang=localStorage.getItem(\"lang\");if(!savedLang||savedLang!==LANG_EN){localStorage.setItem(\"lang\",LANG_EN);}};return /*#__PURE__*/_jsx(Component,{...props,tap:handleSelectLang});};}export function withSelectZhHk(Component){return props=>{const[store,setStore]=useStore();const handleSelectLang=e=>{e.preventDefault();setStore({...store,lang:LANG_ZH_HK});const savedLang=localStorage.getItem(\"lang\");if(!savedLang||savedLang!==LANG_ZH_HK){localStorage.setItem(\"lang\",LANG_ZH_HK);}};return /*#__PURE__*/_jsx(Component,{...props,tap:handleSelectLang});};}export function withSelectZhCn(Component){return props=>{const[store,setStore]=useStore();const handleSelectLang=e=>{e.preventDefault();setStore({...store,lang:LANG_ZH_CN});const savedLang=localStorage.getItem(\"lang\");if(!savedLang||savedLang!==LANG_ZH_CN){localStorage.setItem(\"lang\",LANG_ZH_CN);}};return /*#__PURE__*/_jsx(Component,{...props,tap:handleSelectLang});};}export default function SearchInputWithTranslation(props){return /*#__PURE__*/_jsx(\"input\",{type:\"text\",value:props.searchInput,onChange:props.onChange,placeholder:\"\",style:{border:\"2px solid #0497A7\",borderRadius:\"8px\",backgroundColor:\"#FFFFFF\",boxSizing:\"border-box\",padding:\"14px 16px\",fontSize:\"16px\",lineHeight:\"32px\",fontFamily:\"Outfit\",fontWeight:\"500\",color:\"#333333\",width:\"100%\",height:\"48px\",outline:\"none\"}});}\nexport const __FramerMetadata__ = {\"exports\":{\"withSelectZhHk\":{\"type\":\"reactHoc\",\"name\":\"withSelectZhHk\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTranslation\":{\"type\":\"reactHoc\",\"name\":\"withTranslation\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSelectEn\":{\"type\":\"reactHoc\",\"name\":\"withSelectEn\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSelectZhCn\":{\"type\":\"reactHoc\",\"name\":\"withSelectZhCn\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"SearchInputWithTranslation\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"withGetLangFromBrowser\":{\"type\":\"reactHoc\",\"name\":\"withGetLangFromBrowser\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WithTranslation.map"],"mappings":"iLAAiQ,SAAgB,EAAgB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAM,GAAU,GAAU,CAAM,CAAC,EAAU,GAAcA,EAAS,GAAG,CAA8I,OAA7I,MAAc,CAAC,IAAMC,EAAU,aAAa,QAAQ,OAAO,CAAIA,IAAW,EAAS,CAAC,GAAG,EAAM,KAAKA,EAAU,CAAC,CAAC,EAAaA,EAAU,GAAI,EAAE,CAAC,CAAqB,EAAK,EAAU,CAAC,GAAG,EAAM,QAAQ,EAAM,MAAM,EAAU,CAAC,EAAi7C,SAAwB,EAA2B,EAAM,CAAC,OAAoB,EAAK,QAAQ,CAAC,KAAK,OAAO,MAAM,EAAM,YAAY,SAAS,EAAM,SAAS,YAAY,GAAG,MAAM,CAAC,OAAO,oBAAoB,aAAa,MAAM,gBAAgB,UAAU,UAAU,aAAa,QAAQ,YAAY,SAAS,OAAO,WAAW,OAAO,WAAW,SAAS,WAAW,MAAM,MAAM,UAAU,MAAM,OAAO,OAAO,OAAO,QAAQ,OAAO,CAAC,CAAC,oBAA14E,IAAsC,IAAqE,CAAM,EAAS,EAAY,CAAC,KAAK,GAAG,CAAC"}