{"version":3,"file":"Localization.CLveDsqp.mjs","names":[],"sources":["https:/framerusercontent.com/modules/AkGOJotPENSIlqAXp8i1/4LtcTda0q6zMErc04qn2/Localization.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";// Learn more: https://www.framer.com/docs/guides/overrides/\nfunction getCurrentURL(){if(typeof window===\"undefined\")return\"\";return window.location.href;}export function getCurrentLanguage(){let currentLink=getCurrentURL();//console.log(currentLink)\ncurrentLink=currentLink.replace(\"https://fincart.io/\",\"\");//console.log(currentLink)\nif(currentLink===\"ar\"){//console.log(\"it's en\")\nreturn\"ar\";}if(currentLink.startsWith(\"ar/\")){//console.log(\"it's en/\")\nreturn\"ar\";}// if (localStorage?.getItem(\"preferredLocale\") == \"en\") {\n//     return \"en\"\n// }\nreturn\"en\";// if (window?.location?.href?.indexOf(\"/en\") != -1) {\n//     return \"en\"\n// } else {\n//     return \"ar\"\n// }\n}export function localizeEnglishComponent(Component){return props=>{if(getCurrentLanguage()===\"ar\"){//Arabic\nreturn /*#__PURE__*/_jsx(Component,{...props,style:{display:\"none\"}});}else{return /*#__PURE__*/_jsx(Component,{...props});}};}export function localizeArabicComponent(Component){return props=>{if(getCurrentLanguage()===\"ar\"){//Arabic\nreturn /*#__PURE__*/_jsx(Component,{...props});}else{return /*#__PURE__*/_jsx(Component,{...props,style:{display:\"none\"}});}};}const FONT_EN=`\"Poppins\", sans-serif`;const FONT_AR=`\"Noto Sans Arabic\", sans-serif`;export function localizeTextFont(Component){return props=>{const isAr=getCurrentLanguage()===\"ar\";return /*#__PURE__*/_jsx(Component,{...props,style:{...props?.style??{},\"--framer-font-family\":isAr?FONT_AR:FONT_EN}});};}export function fixTickerRTL(Component){return props=>{const isAr=getCurrentLanguage()===\"ar\";return /*#__PURE__*/_jsx(Component,{...props,style:{...props?.style??{},direction:isAr?\"ltr\":\"ltr\"}});};}export function clearFormAfterSubmit(Component){return props=>{const handleSubmit=event=>{props?.onSubmit?.(event);const form=event.target;setTimeout(()=>{form.reset();},1e3);};return /*#__PURE__*/_jsx(Component,{...props,onSubmit:handleSubmit});};}\nexport const __FramerMetadata__ = {\"exports\":{\"getCurrentLanguage\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"localizeEnglishComponent\":{\"type\":\"reactHoc\",\"name\":\"localizeEnglishComponent\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"fixTickerRTL\":{\"type\":\"reactHoc\",\"name\":\"fixTickerRTL\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"clearFormAfterSubmit\":{\"type\":\"reactHoc\",\"name\":\"clearFormAfterSubmit\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"localizeArabicComponent\":{\"type\":\"reactHoc\",\"name\":\"localizeArabicComponent\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"localizeTextFont\":{\"type\":\"reactHoc\",\"name\":\"localizeTextFont\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Localization.map"],"mappings":"kHACA,SAAS,GAAe,CAAyC,OAA9B,IAAS,OAAkB,GAAU,EAAO,SAAS,IAAK,CAAC,SAAgB,GAAoB,CAAC,IAAI,EAAY,EAAc,EAOjK,MANA,GAAY,EAAY,QAAQ,sBAAsB,EAAE,EACrD,IAAc,MACF,EAAY,WAAW,KAAK,EACrC,KAGA,IAKN,CAEgb,SAAgB,EAAa,EAAU,CAAC,MAAO,KAAmB,EAAmB,EAA6B,EAAK,EAAU,CAAC,GAAG,EAAM,MAAM,CAAC,GAAG,GAAO,OAAO,CAAC,EAAE,UAAe,KAAW,CAAC,CAAC,EAAI,CAAC,SAAgB,EAAqB,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAa,GAAO,CAAC,GAAO,WAAW,CAAK,EAAE,IAAM,EAAK,EAAM,OAAO,eAAe,CAAC,EAAK,MAAM,CAAE,EAAE,GAAG,CAAE,EAAE,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,SAAS,CAAY,CAAC,CAAE,CAAE,qBAfr0B"}