{"version":3,"file":"AddTracking.DHT9SeFz.mjs","names":[],"sources":["https:/framerusercontent.com/modules/noB34BW0yWxfG3nmicED/e2hLErrHzXLyCSQsWzBN/AddTracking.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{randomColor}from\"https://framer.com/m/framer/utils.js@^0.9.0\";// Learn more: https://www.framer.com/developers/overrides/\nconst useStore=createStore({background:\"#0099FF\"});// Get UUID from localStorage only (no generation)\nfunction getUUID(){try{// Only retrieve from localStorage, don't generate if not found\nreturn localStorage.getItem(\"gb_uuid\")||\"\";}catch(e){// Return empty string if localStorage isn't available\nreturn\"\";}}// Get the UUID once when this code runs\nconst uuid=getUUID();export function withRotate(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,animate:{rotate:90},transition:{duration:2}});});}export function withHover(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,whileHover:{scale:1.05}});});}export function withRandomColor(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{ref:ref,...props,animate:{background:store.background},onClick:()=>{setStore({background:randomColor()});}});});}export function withTrackedLink(Component){return props=>{const handleClick=event=>{event.preventDefault();// Lógica de tracking de Mixpanel\nif(typeof mixpanel!==\"undefined\"&&mixpanel.track){const buttonText=event.target.innerText||event.target.textContent||\"Enlace\";mixpanel.track(`${buttonText} Click`,{\"Button Name\":buttonText});}else{console.error(\"Mixpanel not initialized.\");}let url=props.href||props.url||\"\";if(url&&uuid){// Add UUID to the URL for tracked variants\nconst separator=url.includes(\"?\")?\"&\":\"?\";const trackedUrl=`${url}${separator}uuid=${encodeURIComponent(uuid)}`;// Open URL in a new tab\nwindow.open(trackedUrl,\"_blank\");}else if(url){// For non-tracked variants, just open the original URL\nwindow.location.href=url;}};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTrackedLink\":{\"type\":\"reactHoc\",\"name\":\"withTrackedLink\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AddTracking.map"],"mappings":"kOAEA,SAAS,GAAS,CAAC,GAAG,CACtB,OAAO,aAAa,QAAQ,SAAS,GAAG,EAAG,MAAS,CACpD,MAAM,EAAG,CAAC,CACwnB,SAAgB,EAAgB,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAY,GAAO,CACrtB,GADstB,EAAM,eAAe,EACxuB,OAAO,SAAW,KAAa,SAAS,MAAM,CAAC,IAAM,EAAW,EAAM,OAAO,WAAW,EAAM,OAAO,aAAa,SAAS,SAAS,MAAM,GAAG,EAAW,QAAQ,CAAC,cAAc,CAAU,CAAC,CAAE,MAAM,QAAQ,MAAM,2BAA2B,EAAG,IAAI,EAAI,EAAM,MAAM,EAAM,KAAK,GAAG,GAAG,GAAK,EAAK,CACtP,IAAM,EAAW,GAAG,IAA9C,EAAI,SAAS,GAAG,EAAE,IAAI,IAAwC,OAAO,mBAAmB,CAAI,IAC5G,EAAO,KAAK,EAAW,QAAQ,CAAE,MAAS,IAC1C,EAAO,SAAS,KAAK,EAAK,EAAE,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,QAAQ,CAAW,CAAC,CAAE,CAAE,uBATvD,IAA8B,IAAqE,IAAqE,EACnM,EAAY,CAAC,WAAW,SAAS,CAAC,EAI3C,EAAK,EAAQ"}