{"version":3,"file":"MetaTracking.BHsAJ__e.mjs","names":["React.forwardRef","useRef","__esmMin","init_ssg_sandbox_shims","navigator","c","J","init_jsx_runtime","ce","init_npm_react_18_3_1","de","window","motion","withCSS","cx","addPropertyControls","ControlType","init_framer_BikQVKhx","useSVGTemplate","mask","Base","MotionSVG","SVG","svg","getProps","Icon","init_ZajZqjjCF","props","rest","animated","width1","color","restProps","href","className","P_DcoRcrY","JEeZYcamG","style","readCookie","parts","part","item","name","withMetaTracking","localRef","builtFbc","el","form","fbclid","setField","input","value","fill","prefetched","prefetchThankYou","link","submitAttempt","wrapperOf","showMessage","wrapper","msg","text","clearMessage","firstInvalid","onSubmitClick","onInvalid","onInput","Component","node","ref","init_MetaTracking"],"sources":["https:/framerusercontent.com/modules/dKmLh6reKh2kxCqhH8OW/8l8OXj3FxXbvCXwywm8Q/ZajZqjjCF.js","https:/framerusercontent.com/modules/FIOmuyA3er0lmgnQ61p0/UDAd9jzkOZHdVNVq15Zg/MetaTracking.js"],"sourcesContent":["// Generated by Framer (85eaff3)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,useSVGTemplate,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask=\"var(--framer-icon-mask)\";const Base=/*#__PURE__*/forwardRef(function(props,ref){return /*#__PURE__*/_jsx(\"svg\",{...props,ref:ref,children:props.children});});const MotionSVG=motion.create(Base);const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(MotionSVG,{...rest,layoutId:layoutId,ref:ref,children:children}):/*#__PURE__*/_jsx(\"svg\",{...rest,ref:ref,children:children});});const svg='<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 16 0 L 5 11 L 0 6\" fill=\"transparent\" height=\"11px\" id=\"RhWX5SVPv\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--js9iwy, 2)\" stroke=\"var(--1m973uw, rgb(0,0,0))\" transform=\"translate(4 6)\" width=\"16px\"/></svg>';const getProps=({color,height,id,width,width1,...props})=>{return{...props,JEeZYcamG:width1??props.JEeZYcamG??2,P_DcoRcrY:color??props.P_DcoRcrY??\"rgb(0, 0, 0)\"};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,P_DcoRcrY,JEeZYcamG,...restProps}=getProps(props);const href=useSVGTemplate(\"3338047389\",svg);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-FCBgc\",className),layoutId:layoutId,ref:ref,role:\"presentation\",style:{\"--1m973uw\":P_DcoRcrY,\"--js9iwy\":JEeZYcamG,...style},viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"use\",{href:href})});});const css=[`.framer-FCBgc { -webkit-mask: ${mask}; aspect-ratio: 1; display: block; mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"P_DcoRcrY\":\"color\",\"JEeZYcamG\":\"width1\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Check\",\"color\":{\"type\":\"variable\",\"value\":\"1m973uw\"},\"set\":{\"localId\":\"vectorSet/ZsiCCGPvG\",\"id\":\"ZsiCCGPvG\",\"moduleId\":\"Y7SpbVH16cWqMhj75z1M\"}}\n */const Icon=withCSS(Component,css,\"framer-FCBgc\");Icon.displayName=\"Check\";export default Icon;addPropertyControls(Icon,{P_DcoRcrY:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Color\",type:ControlType.Color},JEeZYcamG:{defaultValue:2,displayStepper:true,hidden:false,max:16,min:1,title:\"Width\",type:ControlType.Number}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerVariables\":\"{\\\"P_DcoRcrY\\\":\\\"color\\\",\\\"JEeZYcamG\\\":\\\"width1\\\"}\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"24\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerVector\":\"{\\\"name\\\":\\\"Check\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"1m973uw\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/ZsiCCGPvG\\\",\\\"id\\\":\\\"ZsiCCGPvG\\\",\\\"moduleId\\\":\\\"Y7SpbVH16cWqMhj75z1M\\\"}}\",\"framerIntrinsicWidth\":\"24\",\"framerImmutableVariables\":\"true\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect,useRef}from\"react\";// Meta attribution fields for a native Framer form.\n// Apply this override to the form frame. The form must contain three hidden inputs\n// named \"fbc\", \"fbp\" and \"user_agent\"; they are filled right before submission.\n// - fbc: the _fbc cookie; if missing and the URL has ?fbclid=..., built as fb.1.<timestamp ms>.<fbclid>\n// - fbp: the _fbp cookie\n// - user_agent: navigator.userAgent\n// No visual changes.\nfunction readCookie(name){if(typeof document===\"undefined\")return\"\";const parts=document.cookie?document.cookie.split(\";\"):[];for(const part of parts){const item=part.trim();if(item.startsWith(name+\"=\"))return decodeURIComponent(item.slice(name.length+1));}return\"\";}export function withMetaTracking(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const localRef=useRef(null);// Built once per page view, so the timestamp stays the moment the click landed.\nconst builtFbc=useRef(\"\");useEffect(()=>{const el=localRef.current;if(!el)return;const form=el.closest(\"form\")||el.querySelector(\"form\")||el;try{const fbclid=new URLSearchParams(window.location.search).get(\"fbclid\");if(fbclid)builtFbc.current=\"fb.1.\"+Date.now()+\".\"+fbclid;}catch(e){}const setField=(name,value)=>{const input=form.querySelector('input[name=\"'+name+'\"]');if(!input)return;input.value=value;input.setAttribute(\"value\",value);};const fill=()=>{setField(\"fbc\",readCookie(\"_fbc\")||builtFbc.current);setField(\"fbp\",readCookie(\"_fbp\"));setField(\"user_agent\",typeof navigator!==\"undefined\"?navigator.userAgent:\"\");};fill();// Warm the browser cache for the thank-you page while the user is still typing.\nlet prefetched=false;const prefetchThankYou=()=>{if(prefetched)return;prefetched=true;try{const link=document.createElement(\"link\");link.rel=\"prefetch\";link.href=\"/preventivo-inviato\";document.head.appendChild(link);}catch(e){}};form.addEventListener(\"focusin\",prefetchThankYou,true);form.addEventListener(\"pointerdown\",prefetchThankYou,true);// Inline validation feedback. iOS Safari blocks a submit with invalid fields silently,\n// so after a submit attempt we show the message under the field and scroll to it.\n// Passive: it never calls checkValidity() itself (that would interfere with React's controlled inputs).\nconst MSG_CLASS=\"fv-msg\";let submitAttempt=0;const wrapperOf=input=>input.closest(\"label\")||input.parentElement;const showMessage=input=>{const wrapper=wrapperOf(input);if(!wrapper)return;let msg=wrapper.querySelector(\".\"+MSG_CLASS);if(!msg){msg=document.createElement(\"div\");msg.className=MSG_CLASS;msg.style.cssText=\"color:#C0392B;font-size:13px;line-height:1.3;margin-top:6px;font-family:inherit\";wrapper.appendChild(msg);}let text=input.validationMessage;if(input.validity.valueMissing)text=input.type===\"checkbox\"?\"Serve il consenso per continuare.\":\"Campo obbligatorio.\";else if(input.validity.typeMismatch&&input.type===\"email\")text=\"Controlla l'indirizzo email, ad esempio nome@email.it\";msg.textContent=text;if(input.type!==\"checkbox\"){input.style.outline=\"2px solid #C0392B\";input.style.outlineOffset=\"-1px\";}};const clearMessage=input=>{const wrapper=wrapperOf(input);const msg=wrapper?.querySelector(\".\"+MSG_CLASS);if(msg)msg.remove();input.style.outline=\"\";};let firstInvalid=null;const onSubmitClick=e=>{const t=e.target;if(t&&t.closest&&t.closest('button[type=\"submit\"],input[type=\"submit\"]'))submitAttempt=Date.now();};const onInvalid=e=>{if(Date.now()-submitAttempt>1500)return;const input=e.target;e.preventDefault();showMessage(input);if(!firstInvalid){firstInvalid=input;setTimeout(()=>{try{input.scrollIntoView({behavior:\"smooth\",block:\"center\"});}catch(err){}firstInvalid=null;},0);}};const onInput=e=>{const input=e.target;if(input&&input.validity&&input.validity.valid)clearMessage(input);};form.addEventListener(\"click\",onSubmitClick,true);form.addEventListener(\"invalid\",onInvalid,true);form.addEventListener(\"input\",onInput,true);form.addEventListener(\"change\",onInput,true);// Capture phase: runs before the form's own submit handler reads the fields.\nform.addEventListener(\"submit\",fill,true);form.addEventListener(\"pointerdown\",fill,true);form.addEventListener(\"keydown\",fill,true);return()=>{form.removeEventListener(\"click\",onSubmitClick,true);form.removeEventListener(\"invalid\",onInvalid,true);form.removeEventListener(\"input\",onInput,true);form.removeEventListener(\"change\",onInput,true);form.removeEventListener(\"submit\",fill,true);form.removeEventListener(\"pointerdown\",fill,true);form.removeEventListener(\"keydown\",fill,true);form.removeEventListener(\"focusin\",prefetchThankYou,true);form.removeEventListener(\"pointerdown\",prefetchThankYou,true);};},[]);return /*#__PURE__*/_jsx(Component,{...props,ref:node=>{localRef.current=node;if(typeof ref===\"function\")ref(node);else if(ref)ref.current=node;}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withMetaTracking\":{\"type\":\"reactHoc\",\"name\":\"withMetaTracking\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MetaTracking.map"],"mappings":"A,0UACgM,EAAK,0BAAgC,EAAkB,gBAAW,SAAS,EAAM,EAAI,CAAC,MAAoB,gBAAK,MAAM,CAAC,GAAG2B,EAAU,MAAI,SAASA,EAAM,QAAQ,CAAC,CAAE,CAAC,EAAQ,EAAUf,EAAO,OAAOQ,CAAI,EAAQ,EAAiB,iBAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,WAAS,WAAS,GAAGQ,GAAMD,EAAM,OAAOE,EAAsB,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