{"version":3,"file":"AppendUTM.BYV8OYLE.mjs","names":["forwardRef","_jsx","__legacyOverrideHOC_useContext","__legacyOverrideHOC_DataObserverContext","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","oe","window","init_jsx_runtime","J","init_framer_BWzg2IRg","DataObserverContext","withUTMParams","Component","props","ref","handleClick","event","button","anchor","checkoutURL","urlParams","c","AppendUTM","withAppendUTM","C","init_AppendUTM"],"sources":["https:/framerusercontent.com/modules/JGJHLdRXhaKcj26AnwfP/2ln5c5Dw2kIka2WqBJqw/AppendUTM.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef}from\"react\";export function withUTMParams(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const handleClick=event=>{const button=event.currentTarget;// Find the anchor element inside the button (if any)\nconst anchor=button.tagName===\"A\"?button:button.querySelector(\"a\");if(!anchor||!(anchor instanceof HTMLAnchorElement))return;let checkoutURL=anchor.href;if(!checkoutURL)return;const urlParams=new URLSearchParams(window.location.search);if(urlParams.toString()){const separator=checkoutURL.includes(\"?\")?\"&\":\"?\";anchor.href=checkoutURL+separator+urlParams.toString();}props.onClick?.(event);};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:handleClick});});}export function AppendUTM(){return{onClick:event=>{const button=event.currentTarget// General type first\n;// Find the anchor element inside the button (if any)\nconst anchor=button.tagName===\"A\"?button:button.querySelector(\"a\");if(!anchor||!(anchor instanceof HTMLAnchorElement))return;// Skip if no valid link\nlet checkoutURL=anchor.href;if(!checkoutURL)return;const urlParams=new URLSearchParams(window.location.search);if(urlParams.toString()){const separator=checkoutURL.includes(\"?\")?\"&\":\"?\";anchor.href=checkoutURL+separator+urlParams.toString();}}};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withAppendUTM(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...AppendUTM(props)});};}withAppendUTM.displayName=\"AppendUTM\";\nexport const __FramerMetadata__ = {\"exports\":{\"withAppendUTM\":{\"type\":\"reactHoc\",\"name\":\"withAppendUTM\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"AppendUTM\":{\"type\":\"override\",\"name\":\"AppendUTM\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withUTMParams\":{\"type\":\"reactHoc\",\"name\":\"withUTMParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AppendUTM.map"],"mappings":"A,oLAAyE,SAAgBa,EAAcC,EAAU,CAAC,MAAoBd,iBAAYe,EAAMC,IAAM,CAAC,IAAMC,EAAYC,GAAO,CAAC,IAAMC,EAAOD,EAAM,cACtME,EAAOD,EAAO,UAAU,IAAIA,EAAOA,EAAO,cAAc,GAAG,EAAE,GAAG,CAACC,GAAQ,EAAEA,aAAkB,mBAAmB,OAAO,IAAIC,EAAYD,EAAO,KAAK,GAAG,CAACC,EAAY,OAAO,IAAMC,EAAU,IAAI,gBAAgBd,EAAO,SAAS,MAAM,EAAKc,EAAU,SAAS,IAAqDF,EAAO,KAAKC,GAA9CA,EAAY,SAAS,GAAG,EAAE,IAAI,KAAsCC,EAAU,SAAS,GAAGP,EAAM,UAAUG,CAAK,CAAE,EAAE,MAAoBjB,gBAAKa,EAAU,CAAKE,MAAI,GAAGD,EAAM,QAAQE,CAAW,CAAC,CAAE,CAAC,CAAE,CAAC,SAAgBO,GAAW,CAAC,MAAM,CAAC,QAAQN,GAAO,CAAC,IAAMC,EAAOD,EAAM,cAEvhBE,EAAOD,EAAO,UAAU,IAAIA,EAAOA,EAAO,cAAc,GAAG,EAAE,GAAG,CAACC,GAAQ,EAAEA,aAAkB,mBAAmB,OACtH,IAAIC,EAAYD,EAAO,KAAK,GAAG,CAACC,EAAY,OAAO,IAAMC,EAAU,IAAI,gBAAgBd,EAAO,SAAS,MAAM,EAAKc,EAAU,SAAS,IAAqDF,EAAO,KAAKC,GAA9CA,EAAY,SAAS,GAAG,EAAE,IAAI,KAAsCC,EAAU,SAAS,EAAG,CAAC,CAAE,CAAoJ,SAAgBG,EAAcC,EAAE,CAAC,MAAOX,KAAQb,EAA+BC,CAAuC,EAASF,EAAKyB,EAAE,CAAC,GAAGX,EAAM,GAAGS,EAAUT,CAAK,CAAC,CAAC,EAAI,C,8CAACU,EAAc,YAAY,W"}