{"version":3,"file":"PhoneNumber.CSesLtPd.mjs","names":["useRef","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/gNQSdsoUyfI9AlunaJsK/cVdhXhfF1GeHcQ8miXA8/PhoneNumber.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";export function PhoneNumberWithCountryCode(){const containerRef=useRef(null);const itiRef=useRef(null);useEffect(()=>{const loadAssets=async()=>{const isArabic=window.location.pathname.includes(\"/ar/\")||window.location.pathname.includes(\"/ar\");// Inject intl-tel-input CSS\nconst cssLink=document.createElement(\"link\");cssLink.rel=\"stylesheet\";cssLink.href=\"https://cdn.jsdelivr.net/npm/intl-tel-input@18.1.1/build/css/intlTelInput.css\";document.head.appendChild(cssLink);// Inject custom styles based on language\nconst customStyle=document.createElement(\"style\");customStyle.innerHTML=`\n        .custom-phone-wrapper {\n          overflow: visible;\n          display: flex;\n          transition: all 0.3s ease;\n          direction: ${isArabic?\"rtl\":\"ltr\"};\n        }\n\n        .custom-phone-wrapper.invalid {\n          border-color: red;\n          background-color: #ffe6e6;\n        }\n\n        .custom-phone-wrapper .iti {\n          width: 100%;\n        }\n\n        .custom-phone-wrapper .iti input {\n          border: none;\n          outline: none;\n          background: transparent;\n          width: 100%;\n          font-size: 16px;\n          text-align: ${isArabic?\"right\":\"left\"};\n        }\n\n        .iti--allow-dropdown .iti__flag-container{\n            right:${isArabic?0:\"auto\"};\n            left :${isArabic?\"auto\":0};\n        }\n\n        .iti--allow-dropdown input[type=tel],\n        .iti--allow-dropdown input[type=text]\n        {\n                padding-right: ${isArabic?\"52px !important\":\"6px !important\"};\n                padding-left: ${isArabic?\"6px !important\":\"52px !important\"};\n        }\n\n       .iti--allow-dropdown input[type=text]\n      `;document.head.appendChild(customStyle);// Load intl-tel-input JS\nconst script=document.createElement(\"script\");script.src=\"https://cdn.jsdelivr.net/npm/intl-tel-input@18.1.1/build/js/intlTelInput.min.js\";script.onload=()=>{const input=containerRef.current?.querySelector(\"input\");if(input&&window.intlTelInput){itiRef.current=window.intlTelInput(input,{initialCountry:\"sa\",nationalMode:false,utilsScript:\"https://cdn.jsdelivr.net/npm/intl-tel-input@18.1.1/build/js/utils.js\"});window.phoneInput=itiRef.current;const wrapper=input.closest(\".framer-form-input-wrapper\");if(wrapper){wrapper.classList.add(\"custom-phone-wrapper\");}const form=input.closest(\"form\");if(form){form.addEventListener(\"submit\",e=>{const isValid=itiRef.current.isValidNumber();if(!isValid){e.preventDefault();e.stopPropagation();if(wrapper)wrapper.classList.add(\"invalid\");}else{if(wrapper)wrapper.classList.remove(\"invalid\");input.value=itiRef.current.getNumber();}});}}};document.body.appendChild(script);return()=>{document.head.removeChild(cssLink);document.head.removeChild(customStyle);document.body.removeChild(script);};};loadAssets();},[]);return{ref:containerRef};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withPhoneNumberWithCountryCode(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...PhoneNumberWithCountryCode(props)});};}withPhoneNumberWithCountryCode.displayName=\"PhoneNumberWithCountryCode\";\nexport const __FramerMetadata__ = {\"exports\":{\"PhoneNumberWithCountryCode\":{\"type\":\"override\",\"name\":\"PhoneNumberWithCountryCode\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPhoneNumberWithCountryCode\":{\"type\":\"reactHoc\",\"name\":\"withPhoneNumberWithCountryCode\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PhoneNumber.map"],"mappings":"sLAA+E,SAAgB,GAA4B,CAAC,IAAM,EAAaA,EAAO,KAAK,CAAO,EAAOA,EAAO,KAAK,CA0C22B,OA1C12B,MAAc,EAAkB,SAAS,CAAC,IAAM,EAAS,EAAO,SAAS,SAAS,SAAS,OAAO,EAAE,EAAO,SAAS,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