{"version":3,"file":"AutoCountryFetch.CS7zwWRF.mjs","names":["__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/5yn4Kxm44MDquKy2n3OB/Y6Xu2zVKuoekhZFmfdHk/AutoCountryFetch.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";export function autofillCountry(){useEffect(()=>{// Fetch the visitor's country calling code using ipwho.is\nfetch(\"https://ipwho.is/\").then(response=>response.json()).then(data=>{if(!data.success){console.error(\"Error: ipwho.is failed\",data);return;}const callingCode=data.calling_code// e.g., \"92\"\n;// Select the input field by its name attribute (same as before)\nconst inputField=document.querySelector('input[name=\"CountryCode\"]');if(inputField&&callingCode){inputField.value=`+${callingCode}`;}}).catch(error=>{console.error(\"Error fetching country code:\",error);});},[]);// Return an empty object as no additional props are being overridden\nreturn{};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withautofillCountry(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...autofillCountry(props)});};}withautofillCountry.displayName=\"autofillCountry\";\nexport const __FramerMetadata__ = {\"exports\":{\"withautofillCountry\":{\"type\":\"reactHoc\",\"name\":\"withautofillCountry\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"autofillCountry\":{\"type\":\"override\",\"name\":\"autofillCountry\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AutoCountryFetch.map"],"mappings":"yPAAwE,SAAgB,GAAiB,CAIzG,OAJ0G,MAAc,CACxH,MAAM,qBAAqB,KAAK,GAAU,EAAS,QAAQ,KAAK,GAAM,CAAC,GAAG,CAAC,EAAK,QAAQ,CAAC,QAAQ,MAAM,yBAAyB,GAAM,MAAQ,KAAM,EAAY,EAAK,aAE/J,EAAW,SAAS,cAAc,6BAAgC,GAAY,IAAa,EAAW,MAAM,IAAI,IAAgB,GAAE,MAAM,GAAO,CAAC,QAAQ,MAAM,+BAA+B,EAAQ,EAAG,EAAC,EAAE,EAC3M,EAAE,AAAE,CAAmJ,SAAgB,EAAoB,EAAE,CAAC,MAAO,KAAQ,EAA+BA,GAAgDC,EAAK,EAAE,CAAC,GAAG,EAAM,GAAG,EAAgB,GAAO,EAAK,6BAAoB,YAAY"}