{"version":3,"file":"FBQ_Event_At_Btn_click.Cs7yO2ac.mjs","names":["__legacyOverrideHOC_DataObserverContext","_jsx","useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/lOAkYgpU7l3HXDjxoxr6/hr0JHtJuBkTdlFzEcKap/FBQ_Event_At_Btn_click.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";const Btn=({text,customStyle,redirectSection,showWhatsAppIcon,redirectlInk})=>{const[clicked,setClicked]=useState(false);const[isMobile,setIsMobile]=useState(false);useEffect(()=>{if(typeof window!==\"undefined\"){setIsMobile(window.innerWidth<=768);const handleResize=()=>{setIsMobile(window.innerWidth<=768);};window.addEventListener(\"resize\",handleResize);return()=>window.removeEventListener(\"resize\",handleResize);}},[]);if(typeof window!==\"undefined\"){const pathname=window.location.pathname;if(pathname.includes(\"talk-to-our-expert\")){text=\"Talk to our expert\";customStyle={borderRadius:0,display:\"flex\",justifyContent:\"center\",alignItems:\"center\"};showWhatsAppIcon=true;}if([\"new\",\"swimming-kids-new\",\"swimming-adults-new\"].some(path=>pathname.includes(path))){text=\"Register to hold offer\";}if([\"clubs\"].some(path=>pathname.includes(path))){text=\"Join For Free\";showWhatsAppIcon=true;}}const BookTrialText=text?text:\"Limited offer - BUY NOW!\";const handleOnClick=async()=>{if(typeof window===\"undefined\")return;let eventValue=text||\"Sticky-CTA-Button-Click\";if(showWhatsAppIcon){eventValue=`WhatsApp_Click_${eventValue}`;}const{pathname,search}=window.location;// Extract fbclid and gclid manually using RegExp\nconst fbclidMatch=search.match(/[?&]fbclid=([^&]+)/);const gclidMatch=search.match(/[?&]gclid=([^&]+)/);const fbclid=fbclidMatch?fbclidMatch[1]:null;const gclid=gclidMatch?gclidMatch[1]:null;// Lookup object for mapping paths to redirect links\nconst whatsappLinks={\"/summer/football/kids/talk-to-our-expert\":\"https://api.whatsapp.com/send?phone=918147142447&text=Hi%20%F0%9F%91%8B%20I%27m%20looking%20for%20football%20coaching%20for%20my%20kid\",\"/summer/swimming/kids/talk-to-our-expert\":\"https://api.whatsapp.com/send?phone=918147142447&text=Hi%20%F0%9F%91%8B%20I%27m%20looking%20for%20swimming%20coaching%20for%20my%20kid\",\"/bau/swimming/kids/existing-talk-to-our-expert\":\"https://api.whatsapp.com/send?phone=918147142447&text=Hi%20%F0%9F%91%8B%20I%27m%20looking%20for%20swimming%20coaching%20for%20my%20kid\",\"/summer/swimming/toddlers/talk-to-our-expert\":\"https://api.whatsapp.com/send?phone=918147142447&text=Hi%20%F0%9F%91%8B%20I%27m%20looking%20for%20toddler%20swimming%20classes\",\"/bau/swimming/toddlers/new-talk-to-our-expert\":\"https://api.whatsapp.com/send?phone=918147142447&text=Hi%20%F0%9F%91%8B%20I%27m%20looking%20for%20toddler%20swimming%20classes\",\"/clubs/pickleball-a\":\"https://chat.whatsapp.com/K39aqy45yj0I4HceED3mpT?\",\"/clubs/pickleball-b\":\"https://chat.whatsapp.com/K39aqy45yj0I4HceED3mpT?\",\"/summer/basketball/kids/talk-to-our-expert\":\"https://api.whatsapp.com/send?phone=918147142447&text=Hi%20%F0%9F%91%8B%20I%27m%20looking%20for%20basketball%20coaching%20for%20my%20kid\",\"/badminton/kids/existing/talk-to-our-expert\":\"https://api.whatsapp.com/send?phone=918147142447&text=Hi%20%F0%9F%91%8B\",\"/summer/badminton/kids/talk-to-our-expert\":\"https://api.whatsapp.com/send?phone=918147142447&text=Hi%20%F0%9F%91%8B\"};let redirectLink=Object.keys(whatsappLinks).find(key=>pathname.includes(key))?whatsappLinks[Object.keys(whatsappLinks).find(key=>pathname.includes(key))]:null;if(redirectLink&&(fbclid||gclid)){const referralParams=[];if(fbclid)referralParams.push(`fbclid:${encodeURIComponent(fbclid)}`);if(gclid)referralParams.push(`gclid:${encodeURIComponent(gclid)}`);if(referralParams.length>0){redirectLink+=`%0A%0AHere is my referral code to avail the summer discount: ${referralParams.join(\"&\")}`;}}const webHookRequestBody={event:eventValue,url:pathname,fbclid,gclid,utm_campaign:\"test1\",utm_medium:\"test abc\",utm_source:\"test abc\",utm_content:\"test abc\",timestamp:new Date().toISOString()};const formData=new FormData;formData.append(\"event\",eventValue);formData.append(\"url\",pathname);formData.append(\"fbclid\",fbclid||\"\");formData.append(\"gclid\",gclid||\"\");formData.append(\"utm_campaign\",\"test1\");formData.append(\"utm_medium\",\"test abc\");formData.append(\"utm_source\",\"test abc\");formData.append(\"utm_content\",\"test abc\");formData.append(\"timestamp\",new Date().toISOString());// Replace spaces with underscores\neventValue=eventValue.replace(/\\s+/g,\"_\");// Open WhatsApp link or scroll to target section\nif(redirectLink){// Facebook tracking only for talk to expert\nif(typeof fbq===\"function\"){fbq(\"track\",\"Purchase\",{value:100,currency:\"INR\"},{eventID:\"purchase_talk_to_expert\"});}else{console.error(\"fbq is not defined.\");}window.open(redirectLink,\"_blank\");}else{const targetSection=document.getElementById(redirectSection||\"book-a-free-trial\");if(targetSection){targetSection.scrollIntoView({behavior:\"smooth\"});}}setClicked(true);setTimeout(()=>setClicked(false),2e3);};return /*#__PURE__*/_jsx(\"button\",{style:{...styles.btn,...customStyle||{},borderRadius:isMobile?0:\"50px\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",cursor:\"pointer\",opacity:1,transition:\"all 0.3s ease\"},className:text,onClick:handleOnClick,tabIndex:0,children:showWhatsAppIcon?/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"img\",{src:\"https://upload.wikimedia.org/wikipedia/commons/6/6b/WhatsApp.svg\",width:21}),\"\\xa0\",text?text:\"Book A Free Trial\"]}):/*#__PURE__*/_jsxs(_Fragment,{children:[\" \",text?text:\"Book A Free Trial\"]})});};export function RedColorBtn(){return{children:/*#__PURE__*/_jsx(Btn,{customStyle:{backgroundColor:\"#E95A4F\",color:\"#fff\"}})};}export function GreenColorBtn(){return{children:/*#__PURE__*/_jsx(Btn,{customStyle:{backgroundColor:\"#00A69C\",color:\"#fff\"}})};}export function PurpleColorBtn(){return{children:/*#__PURE__*/_jsx(Btn,{customStyle:{backgroundColor:\"#8761C4\",color:\"#fff\"}})};}export function YellowColorBtn(){return{children:/*#__PURE__*/_jsx(Btn,{customStyle:{backgroundColor:\"#feee4e\",color:\"#000\"}})};}export function DownLoadBtn(){return{children:/*#__PURE__*/_jsx(Btn,{customStyle:{border:\"2px solid #FFF100\",borderRadius:\"100px\",backgroundColor:\"transparent\",height:\"46px\"},text:\"Download the App\"})};}const styles={btn:{width:\"100%\",height:\"51px\",cursor:\"pointer\",backgroundColor:\"#E95A4F\",color:\"#fff\",textAlign:\"center\",fontFamily:\"Urbanist\",fontSize:\"16px\",fontStyle:\"normal\",fontWeight:900,lineHeight:\"24px\",letterSpacing:\"0.5px\",border:\"none\"}};import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withRedColorBtn(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...RedColorBtn(props)});};}withRedColorBtn.displayName=\"RedColorBtn\";export function withGreenColorBtn(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...GreenColorBtn(props)});};}withGreenColorBtn.displayName=\"GreenColorBtn\";export function withPurpleColorBtn(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...PurpleColorBtn(props)});};}withPurpleColorBtn.displayName=\"PurpleColorBtn\";export function withYellowColorBtn(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...YellowColorBtn(props)});};}withYellowColorBtn.displayName=\"YellowColorBtn\";export function withDownLoadBtn(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...DownLoadBtn(props)});};}withDownLoadBtn.displayName=\"DownLoadBtn\";\nexport const __FramerMetadata__ = {\"exports\":{\"withGreenColorBtn\":{\"type\":\"reactHoc\",\"name\":\"withGreenColorBtn\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"YellowColorBtn\":{\"type\":\"override\",\"name\":\"YellowColorBtn\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"PurpleColorBtn\":{\"type\":\"override\",\"name\":\"PurpleColorBtn\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDownLoadBtn\":{\"type\":\"reactHoc\",\"name\":\"withDownLoadBtn\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPurpleColorBtn\":{\"type\":\"reactHoc\",\"name\":\"withPurpleColorBtn\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"GreenColorBtn\":{\"type\":\"override\",\"name\":\"GreenColorBtn\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRedColorBtn\":{\"type\":\"reactHoc\",\"name\":\"withRedColorBtn\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"RedColorBtn\":{\"type\":\"override\",\"name\":\"RedColorBtn\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withYellowColorBtn\":{\"type\":\"reactHoc\",\"name\":\"withYellowColorBtn\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"DownLoadBtn\":{\"type\":\"override\",\"name\":\"DownLoadBtn\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FBQ_Event_At_Btn_click.map"],"mappings":"6MAK28B,SAAgB,GAAa,CAAC,MAAM,CAAC,SAAsB,EAAK,EAAI,CAAC,YAAY,CAAC,gBAAgB,UAAU,MAAM,OAAO,CAAC,CAAC,CAAC,CAAE,SAAgB,GAAe,CAAC,MAAM,CAAC,SAAsB,EAAK,EAAI,CAAC,YAAY,CAAC,gBAAgB,UAAU,MAAM,OAAO,CAAC,CAAC,CAAC,CAAE,SAAgB,GAAgB,CAAC,MAAM,CAAC,SAAsB,EAAK,EAAI,CAAC,YAAY,CAAC,gBA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