{"version":3,"file":"LinkWithUTM.ByASIhFS.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/7gtDhy2foYv7Lrdkp19K/5LGHACq8rdfsis6BGZeJ/LinkWithUTM.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect,useState}from\"react\";export function withForwardParams(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[modifiedLink,setModifiedLink]=useState(props.link);useEffect(()=>{// Only run in browser environment\nif(typeof window!==\"undefined\"&&window.location&&props.link){try{const currentParams=new URLSearchParams(window.location.search);const paramsObj=Object.fromEntries(currentParams);// Only modify if we have parameters to forward\nif(Object.keys(paramsObj).length>0){let finalUrl;if(props.link.startsWith(\"http\")){finalUrl=new URL(props.link);}else if(props.link.startsWith(\"/\")){finalUrl=new URL(props.link,window.location.origin);}else{finalUrl=new URL(props.link,window.location.href);}// Add all current URL parameters to the target link\nObject.entries(paramsObj).forEach(([key,value])=>{finalUrl.searchParams.set(key,value);});setModifiedLink(finalUrl.toString());}}catch(error){// Silently fail and use original link\nconsole.error(\"Error forwarding URL parameters:\",error);}}},[props.link]);const handleClick=e=>{// Call original onClick if it exists\nif(props.onClick){props.onClick(e);}};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,link:modifiedLink,onClick:handleClick});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withForwardParams\":{\"type\":\"reactHoc\",\"name\":\"withForwardParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LinkWithUTM.map"],"mappings":"yIAA4F,SAAgB,EAAkB,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,EAAa,GAAiBA,EAAS,EAAM,IAAI,EAAE,MAAc,CAC7P,GAAU,IAAS,QAAa,EAAO,UAAU,EAAM,KAAM,GAAG,CAAC,IAAM,EAAc,IAAI,gBAAgB,EAAO,SAAS,MAAM,EAAQ,EAAU,OAAO,YAAY,CAAa,EACjL,GAAG,OAAO,KAAK,CAAS,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,EAAS,AAA8J,EAA3J,EAAM,KAAK,WAAW,MAAM,EAAY,IAAI,IAAI,EAAM,IAAI,EAAW,EAAM,KAAK,WAAW,GAAG,EAAY,IAAI,IAAI,EAAM,KAAK,EAAO,SAAS,MAAM,EAAiB,IAAI,IAAI,EAAM,KAAK,EAAO,SAAS,IAAI,EAC/P,OAAO,QAAQ,CAAS,CAAC,CAAC,SAAS,CAAC,EAAI,KAAS,CAAC,EAAS,aAAa,IAAI,EAAI,CAAK,CAAE,CAAC,EAAE,EAAgB,EAAS,SAAS,CAAC,CAAE,CAAC,OAAO,EAAM,CAC7I,QAAQ,MAAM,mCAAmC,CAAK,CAAE,CAAE,EAAE,CAAC,EAAM,IAAI,CAAC,EAAE,IAAM,EAAY,GAAG,CAC5F,EAAM,SAAS,EAAM,QAAQ,CAAC,CAAG,EAAE,OAAoB,EAAK,EAAU,CAAK,MAAI,GAAG,EAAM,KAAK,EAAa,QAAQ,CAAW,CAAC,CAAE,CAAC,CAAE,qBAL5F,IAAiD"}