{"version":3,"file":"Input_Validations.CMMsQFft.mjs","names":[],"sources":["https:/framerusercontent.com/modules/TONy7zI4Ca5gwqyZQnLK/50ETXbCVhOL1a7UE0RYX/Input_Validations.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";/**\n * @framerDisableUnlink\n * @framerIntrinsicWidth 100\n * @framerIntrinsicHeight 100\n */export function withPhoneMask(Component){return props=>{useEffect(()=>{const applyPhoneMask=event=>{const target=event.target;// Pega apenas os números digitados (remove tudo que não é dígito)\nlet currentValue=target.value.replace(/\\D/g,\"\");// LÓGICA DE ESCAPE CORRIGIDA:\n// Se tiver mais que 11 dígitos (ex: DDI + DDD + Numero),\n// removemos a máscara e mostramos apenas os números crus.\nif(currentValue.length>11){target.value=currentValue;return;}// --- Abaixo segue a lógica normal para números BR (<= 11) ---\nconst matrix=\"(__) _____-____\";let i=0;const def=matrix.replace(/\\D/g,\"\");if(def.length>=currentValue.length){currentValue=def;}const newValue=matrix.replace(/./g,a=>{return/[_\\d]/.test(a)&&i<currentValue.length?currentValue.charAt(i++):i>=currentValue.length?\"\":a;});target.value=newValue;};const handleBlur=event=>{const target=event.target;const currentValue=target.value.replace(/\\D/g,\"\");setTimeout(()=>{if(currentValue.length>0&&currentValue.length<10){target.value=\"\";}},200);};const phoneFields=document.querySelectorAll('input[type=\"tel\"]');phoneFields.forEach(phoneField=>{phoneField.addEventListener(\"input\",applyPhoneMask);phoneField.addEventListener(\"blur\",handleBlur);});return()=>{phoneFields.forEach(phoneField=>{phoneField.removeEventListener(\"input\",applyPhoneMask);phoneField.removeEventListener(\"blur\",handleBlur);});};},[]);return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withPhoneMask\":{\"type\":\"reactHoc\",\"name\":\"withPhoneMask\",\"annotations\":{\"framerIntrinsicHeight\":\"100\",\"framerDisableUnlink\":\"* @framerIntrinsicWidth 100\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Input_Validations.map"],"mappings":"kHAIG,SAAgB,EAAc,EAAU,CAAC,MAAO,KAAQ,MAAc,CAAC,IAAM,EAAe,GAAO,CAAC,IAAM,EAAO,EAAM,OACtH,EAAa,EAAO,MAAM,QAAQ,MAAM,GAAG,CAG/C,GAAG,EAAa,OAAO,GAAG,CAAC,EAAO,MAAM,EAAa,OACrD,IAAM,EAAO,kBAAsB,EAAE,EAAQ,EAAI,EAAO,QAAQ,MAAM,GAAG,CAAI,EAAI,QAAQ,EAAa,SAAQ,EAAa,GAAiJ,EAAO,MAApI,EAAO,QAAQ,KAAK,GAAU,QAAQ,KAAK,EAAE,EAAE,EAAE,EAAa,OAAO,EAAa,OAAO,IAAI,CAAC,GAAG,EAAa,OAAO,GAAG,EAAI,EAA+B,EAAW,GAAO,CAAC,IAAM,EAAO,EAAM,OAAa,EAAa,EAAO,MAAM,QAAQ,MAAM,GAAG,CAAC,eAAe,CAAI,EAAa,OAAO,GAAG,EAAa,OAAO,KAAI,EAAO,MAAM,KAAM,IAAI,EAAS,EAAY,SAAS,iBAAiB,oBAAoB,CAAwI,OAAvI,EAAY,QAAQ,GAAY,CAAC,EAAW,iBAAiB,QAAQ,EAAe,CAAC,EAAW,iBAAiB,OAAO,EAAW,EAAG,KAAW,CAAC,EAAY,QAAQ,GAAY,CAAC,EAAW,oBAAoB,QAAQ,EAAe,CAAC,EAAW,oBAAoB,OAAO,EAAW,EAAG,GAAK,EAAE,CAAC,CAAqB,EAAK,EAAU,CAAC,GAAG,EAAM,CAAC,mBATh1B,IAA6B"}