{"version":3,"file":"CheckInternational.B6KNInph.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/WBKYEBzkbQPgDsMN6scM/7dk32WUYsHJcCNbapllO/CheckInternational.js"],"sourcesContent":["// Get Started: https://www.framer.com/developers\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,forwardRef}from\"react\";export const countryWhiteList=[\"US\",\"IN\",\"CA\",\"GB\",\"IE\",\"AU\",\"DE\",\"IT\"];const useCheckLocation=()=>{const[isLoading,setIsLoading]=useState(true);const[isIntl,setIsIntl]=useState(false);useEffect(()=>{async function checkLocation(){try{const res=await fetch(\"https://app.mynucleus.com/api/location\");const data=await res.json();if(data?.data?.countryCode&&!countryWhiteList.includes(data.data.countryCode)){console.log(data.data.countryCode);setIsIntl(true);}setIsLoading(false);}catch(err){console.error(\"Geo lookup failed\",err);}}checkLocation();},[]);return{isIntl,isLoading};};/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export function showIfInternational(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const{isIntl,isLoading}=useCheckLocation();const shouldBeShown=isIntl&&!isLoading;if(!shouldBeShown)return;return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export function hideIfInternational(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const{isIntl,isLoading}=useCheckLocation();const shouldBeHidden=isIntl||isLoading;if(shouldBeHidden)return;return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}\nexport const __FramerMetadata__ = {\"exports\":{\"showIfInternational\":{\"type\":\"reactHoc\",\"name\":\"showIfInternational\",\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"countryWhiteList\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"hideIfInternational\":{\"type\":\"reactHoc\",\"name\":\"hideIfInternational\",\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CheckInternational.map"],"mappings":"gIAIG,SAAgB,EAAoB,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,SAAO,aAAW,GAAkB,CAAqB,MAAQ,CAAC,EAAmC,OAAoB,EAAK,EAAU,CAAK,MAAI,GAAG,EAAM,CAAC,EAAG,CAGhQ,SAAgB,EAAoB,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,SAAO,aAAW,GAAkB,CAAsB,QAAQ,GAAmC,OAAoB,EAAK,EAAU,CAAK,MAAI,GAAG,EAAM,CAAC,EAAG,sBANxN,IAAiD,CAAa,EAAiB,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,CAAO,MAAqB,CAAC,GAAK,CAAC,EAAU,GAAcA,EAAS,GAAK,CAAM,CAAC,EAAO,GAAWA,EAAS,GAAM,CAAiX,OAAhX,MAAc,CAAC,eAAe,GAAe,CAAC,GAAG,CAAiE,IAAM,EAAK,MAAjE,MAAM,MAAM,yCAAyC,EAAsB,MAAM,CAAI,GAAM,MAAM,aAAa,CAAC,EAAiB,SAAS,EAAK,KAAK,YAAY,GAAE,QAAQ,IAAI,EAAK,KAAK,YAAY,CAAC,EAAU,GAAK,EAAE,EAAa,GAAM,OAAQ,EAAI,CAAC,QAAQ,MAAM,oBAAoB,EAAI,EAAG,GAAe,EAAG,EAAE,CAAC,CAAO,CAAC,SAAO,YAAU"}