{"version":3,"file":"PrivacyConsent.DYdFU84T.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/nfwY4bMlv8sKKQFi7iw4/Hbp27XTXH4CNJvnhLQAp/FormAnalyticsTracker.js","https:/framerusercontent.com/modules/Zs9dZ4iUGsW4UlEDqNMZ/6uHIvjZSqbEDbJcQWSmf/PrivacyConsent.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";export default function FormAnalyticsTracker(props){const{formLabel=\"form\"}=props;React.useEffect(()=>{if(typeof document===\"undefined\")return;function handleSubmit(event){const target=event.target;if(!target||target.tagName!==\"FORM\")return;const payload={form_label:formLabel,page_path:typeof window!==\"undefined\"?window.location.pathname:undefined};try{// Standard gtag.js (most common GA4 setup)\nconst w=window;if(typeof w.gtag===\"function\"){w.gtag(\"event\",\"form_submit\",payload);}// Fallback / Google Tag Manager setups\nif(Array.isArray(w.dataLayer)){w.dataLayer.push({event:\"form_submit\",...payload});}}catch(err){// Never let analytics tracking break the page\nconsole.warn(\"FormAnalyticsTracker: failed to send event\",err);}}// Capture phase + no preventDefault/stopPropagation anywhere:\n// this listener only observes, it can never block the real submit.\ndocument.addEventListener(\"submit\",handleSubmit,true);return()=>{document.removeEventListener(\"submit\",handleSubmit,true);};},[formLabel]);return /*#__PURE__*/_jsx(\"div\",{style:{width:1,height:1}});}FormAnalyticsTracker.defaultProps={formLabel:\"form\"};export function addPropertyControls(component,controls){}// Framer property controls\nimport{addPropertyControls as _addPropertyControls,ControlType}from\"framer\";_addPropertyControls(FormAnalyticsTracker,{formLabel:{type:ControlType.String,title:\"Form label\",defaultValue:\"form\",placeholder:\"e.g. home_contact\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FormAnalyticsTracker\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"addPropertyControls\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FormAnalyticsTracker.map","// Required privacy policy checkbox to place inside a Framer Form, just above the submit button.\n// It is a native checkbox with the \"required\" attribute, so the browser blocks the submit\n// until it is ticked, and the value is sent with the rest of the form fields.\n// Language is detected from the URL prefix (/es/, /en/, otherwise Catalan) and both the text\n// and the link to the privacy policy follow it.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const SITE=\"https://estudiantsabellvitge.com\";const TEXTS={ca:{prefix:\"He llegit i accepto la \",linkText:\"Pol\\xedtica de Privacitat\",suffix:\".\",path:\"/politica-de-privacitat\"},es:{prefix:\"He le\\xeddo y acepto la \",linkText:\"Pol\\xedtica de Privacidad\",suffix:\".\",path:\"/es/politica-de-privacitat\"},en:{prefix:\"I have read and accept the \",linkText:\"Privacy Policy\",suffix:\".\",path:\"/en/politica-de-privacitat\"}};function detectLang(){try{const path=window.location.pathname;if(path===\"/es\"||path.startsWith(\"/es/\"))return\"es\";if(path===\"/en\"||path.startsWith(\"/en/\"))return\"en\";}catch(e){// ignore\n}return\"ca\";}/**\n * Privacy policy consent checkbox\n *\n * @framerIntrinsicWidth 360\n * @framerIntrinsicHeight 40\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function PrivacyConsent(props){const{fieldName,textColor,linkColor,font}=props;const[lang,setLang]=useState(\"ca\");useEffect(()=>{setLang(detectLang());},[]);const t=TEXTS[lang];return /*#__PURE__*/_jsxs(\"label\",{style:{...props.style,display:\"flex\",alignItems:\"flex-start\",gap:10,cursor:\"pointer\",color:textColor,width:\"100%\",...font},children:[/*#__PURE__*/_jsx(\"input\",{type:\"checkbox\",name:fieldName,required:true,style:{width:18,height:18,flexShrink:0,margin:0,marginTop:1,cursor:\"pointer\",accentColor:linkColor}}),/*#__PURE__*/_jsxs(\"span\",{children:[t.prefix,/*#__PURE__*/_jsx(\"a\",{href:SITE+t.path,target:\"_blank\",rel:\"noopener noreferrer\",style:{color:linkColor,textDecoration:\"underline\"},children:t.linkText}),t.suffix]})]});}addPropertyControls(PrivacyConsent,{fieldName:{type:ControlType.String,title:\"Field name\",defaultValue:\"Accepta la pol\\xedtica de privacitat\"},textColor:{type:ControlType.Color,title:\"Text color\",defaultValue:\"rgb(29, 64, 136)\"},linkColor:{type:ControlType.Color,title:\"Link color\",defaultValue:\"rgb(29, 64, 136)\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{variant:\"Regular\",fontSize:\"12px\",letterSpacing:\"0em\",lineHeight:\"1.4em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PrivacyConsent\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"360\",\"framerSupportedLayoutWidth\":\"any\",\"framerIntrinsicHeight\":\"40\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PrivacyConsent.map"],"mappings":"sMAAuE,SAAwB,EAAqB,EAAM,CAAC,GAAK,CAAC,YAAU,QAAQ,EAKR,OALc,MAAoB,CAAC,GAAG,OAAO,SAAW,IAAY,OAAO,SAAS,EAAa,EAAM,CAAC,IAAM,EAAO,EAAM,OAAO,GAAG,CAAC,GAAQ,EAAO,UAAU,OAAO,OAAO,IAAM,EAAQ,CAAC,WAAW,EAAU,UAAiB,IAAS,OAAqC,IAAA,GAAzB,EAAO,SAAS,QAAkB,EAAE,GAAG,CACza,IAAM,EAAE,EAAU,OAAO,EAAE,MAAO,YAAY,EAAE,KAAK,QAAQ,cAAc,CAAO,EAC/E,MAAM,QAAQ,EAAE,SAAS,GAAG,EAAE,UAAU,KAAK,CAAC,MAAM,cAAc,GAAG,CAAO,CAAC,CAAG,OAAO,EAAI,CAC9F,QAAQ,KAAK,6CAA6C,CAAG,CAAE,CAA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