{"version":3,"file":"CTA_Buttons.CXe9hlsZ.mjs","names":[],"sources":["https:/framerusercontent.com/modules/b9M0FMhruPlFIom3qbHh/mrpKorexR9Aidd7KdYmM/CTA_Buttons.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";// Allowlist for button types to prevent XSS\nconst ALLOWED_BUTTON_TYPES=new Set([\"SignUp\",\"LogIn\",\"SignUpViaStarter\",\"SignUpViaPro\",\"SignUpViaTeam\",\"SignUpViaBusiness\",\"Download\"]);// ======================\n// LOCATION DETECTION\n// ======================\nfunction detectLocation(button){let element=button.parentElement;let hasHeader=false;let hasHero=false;let hasFooter=false;let hasPricing=false;// Early return optimization - stop when Pricing is found\nwhile(element&&element!==document.body){const framerName=element.getAttribute(\"data-framer-name\");if(framerName){const nameLower=framerName.toLowerCase().trim();if(nameLower.includes(\"pricing\"))return\"Pricing\"// Immediate return\n;if(nameLower.includes(\"hero\"))hasHero=true;if(nameLower.includes(\"footer\"))hasFooter=true;if(nameLower.includes(\"header\"))hasHeader=true;}element=element.parentElement;}if(hasHero)return\"Hero\";if(hasFooter)return\"Footer\";if(hasHeader)return\"Header\";try{const rect=button.getBoundingClientRect();const scrollTop=window.scrollY||window.pageYOffset||0;const absoluteTop=rect.top+scrollTop;const viewportHeight=window.innerHeight;if(absoluteTop<viewportHeight*.9)return\"Hero\";const pageHeight=document.documentElement.scrollHeight;if(absoluteTop>pageHeight-viewportHeight*1.5)return\"Footer\";}catch(e){// Silent failure - position detection is a fallback\n}return\"Section\";}// Sanitize button text to prevent XSS\nfunction sanitizeButtonText(text){const trimmed=text.trim().substring(0,100);const sanitized=trimmed.replace(/[<>\"'&]/g,\"\");return ALLOWED_BUTTON_TYPES.has(sanitized)?sanitized:\"UnknownButton\";}// ======================\n// CTA BUTTONS\n// ======================\nfunction createTrackingOverride(Component,ctaButtonType){const Wrapped=props=>{const{onClick:originalOnClick,...rest}=props;const handleClick=event=>{const button=event?.currentTarget;const location=detectLocation(button);window.dataLayer=window.dataLayer||[];window.dataLayer.push({event:\"cta-button-pressed\",ctaButtonType:ctaButtonType,ctaLocation:location});// Forward event to original handler\nif(originalOnClick){originalOnClick(event);}};return /*#__PURE__*/_jsx(Component,{...rest,onClick:handleClick});};// Add displayName for React DevTools\nWrapped.displayName=`withTrack${ctaButtonType}(${Component.displayName||Component.name||\"Component\"})`;return Wrapped;}// ======================\n// AUTO-TRACKING\n// ======================\nexport function withAutoTracking(Component){const Wrapped=props=>{const{onClick:originalOnClick,...rest}=props;const handleClick=event=>{const button=event?.currentTarget;if(button){const buttonText=(button.textContent||\"\").trim();const sanitizedButtonType=sanitizeButtonText(buttonText);const location=detectLocation(button);window.dataLayer=window.dataLayer||[];window.dataLayer.push({event:\"cta-button-pressed\",ctaButtonType:sanitizedButtonType,ctaLocation:location});}// Forward event to original handler\nif(originalOnClick){originalOnClick(event);}};return /*#__PURE__*/_jsx(Component,{...rest,onClick:handleClick});};// Add displayName for React DevTools\nWrapped.displayName=`withAutoTracking(${Component.displayName||Component.name||\"Component\"})`;return Wrapped;}// ======================\n// ALL CTA OVERRIDES\n// ======================\nexport function withTrackSignUp(Component){return createTrackingOverride(Component,\"SignUp\");}export function withTrackLogIn(Component){return createTrackingOverride(Component,\"LogIn\");}export function withTrackSignUpViaStarter(Component){return createTrackingOverride(Component,\"SignUpViaStarter\");}export function withTrackSignUpViaPro(Component){return createTrackingOverride(Component,\"SignUpViaPro\");}export function withTrackSignUpViaTeam(Component){return createTrackingOverride(Component,\"SignUpViaTeam\");}export function withTrackSignUpViaBusiness(Component){return createTrackingOverride(Component,\"SignUpViaBusiness\");}export function withTrackEnterpriseFormSubmit(Component){return createTrackingOverride(Component,\"EnterpriseFormSubmit\");}\nexport const __FramerMetadata__ = {\"exports\":{\"withTrackSignUpViaBusiness\":{\"type\":\"reactHoc\",\"name\":\"withTrackSignUpViaBusiness\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTrackLogIn\":{\"type\":\"reactHoc\",\"name\":\"withTrackLogIn\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAutoTracking\":{\"type\":\"reactHoc\",\"name\":\"withAutoTracking\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTrackSignUp\":{\"type\":\"reactHoc\",\"name\":\"withTrackSignUp\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTrackSignUpViaPro\":{\"type\":\"reactHoc\",\"name\":\"withTrackSignUpViaPro\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTrackSignUpViaTeam\":{\"type\":\"reactHoc\",\"name\":\"withTrackSignUpViaTeam\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTrackSignUpViaStarter\":{\"type\":\"reactHoc\",\"name\":\"withTrackSignUpViaStarter\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTrackEnterpriseFormSubmit\":{\"type\":\"reactHoc\",\"name\":\"withTrackEnterpriseFormSubmit\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CTA_Buttons.map"],"mappings":"kHAIA,SAAS,EAAe,EAAO,CAAC,IAAI,EAAQ,EAAO,cAAkB,EAAU,GAAU,EAAQ,GAAU,EAAU,GACrH,KAAM,GAAS,IAAU,SAAS,MAAK,CAAC,IAAM,EAAW,EAAQ,aAAa,mBAAmB,CAAC,GAAG,EAAW,CAAC,IAAM,EAAU,EAAW,aAAa,CAAC,MAAM,CAAC,GAAG,EAAU,SAAS,UAAU,CAAC,MAAM,UACpM,EAAU,SAAS,OAAO,GAAC,EAAQ,IAAQ,EAAU,SAAS,SAAS,GAAC,EAAU,IAAQ,EAAU,SAAS,SAAS,GAAC,EAAU,IAAM,EAAQ,EAAQ,cAAe,GAAG,EAAQ,MAAM,OAAO,GAAG,EAAU,MAAM,SAAS,GAAG,EAAU,MAAM,SAAS,GAAG,CAAC,IAAM,EAAK,EAAO,uBAAuB,CAAO,EAAU,EAAO,SAAS,EAAO,aAAa,EAAQ,EAAY,EA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