{"version":3,"file":"StickyMobileCTA.Bom7URso.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/R59ShkmvofZ4JVDj8Tax/MjKn9G2NGvgwqcd9zS5P/StickyMobileCTA.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useState}from\"react\";/**\n * STICKY MOBILE CTA BAR (with analytics)\n * -----------------------------------------------------------------------------\n * Fixed-to-bottom bar on mobile/touch viewports. Fires dataLayer events:\n * phone_clicked + cta_clicked.\n *\n * The hide rule uses hover/pointer features as well as width so Framer pages\n * with a fixed 1200px viewport still show the CTA on touch phones.\n *\n * Link safety: if the Form Link points at an #anchor that does not exist on\n * the current page (or at an anchor on another page), the button scrolls to\n * the first form on this page, or falls back to /schedule-assessment when the\n * page has no form. The bar hides itself on the assessment and thank-you pages.\n * -----------------------------------------------------------------------------\n */const FALLBACK_HREF=\"/schedule-assessment\";const HIDDEN_PATHS=new Set([\"/schedule-assessment\",\"/thank-you\",\"/thank-you/residential\"]);function track(event,extra={}){if(typeof window===\"undefined\")return;const w=window;w.dataLayer=w.dataLayer||[];w.dataLayer.push({event,...extra});}function normalizePath(path){if(!path||path===\"/\")return\"/\";return path.replace(/\\/$/,\"\");}function resolveFormLink(formHref){const hashIndex=formHref.indexOf(\"#\");if(hashIndex===-1)return{href:formHref,mode:\"href\"};const targetPath=normalizePath(formHref.slice(0,hashIndex)||window.location.pathname);const anchorId=decodeURIComponent(formHref.slice(hashIndex+1));const onThisPage=targetPath===normalizePath(window.location.pathname);if(onThisPage&&anchorId&&document.getElementById(anchorId)){return{href:formHref,mode:\"href\"};}if(onThisPage&&document.querySelector(\"form\")){return{href:`#${anchorId}`,mode:\"scroll-form\"};}return{href:FALLBACK_HREF,mode:\"href\"};}export default function StickyMobileCTA(props){const{phoneNumber=\"(770) 294-5181\",phoneLabel=\"Call CKR\",formHref=\"/schedule-assessment\",formLabel=\"Schedule Assessment\",formSubtext=\"Project-team follow-up\",hideOnDesktop=true,maxBreakpoint=810,backgroundColor=\"rgb(0, 21, 36)\",accentColor=\"rgb(64, 207, 112)\",accentTextColor=\"rgb(0, 21, 36)\",phoneTextColor=\"rgb(255, 255, 255)\",safeAreaInset=true,pageLocation=\"\"}=props;const[link,setLink]=useState({href:formHref,mode:\"href\"});const[hidden,setHidden]=useState(false);useEffect(()=>{if(typeof window===\"undefined\"||typeof document===\"undefined\")return;setHidden(HIDDEN_PATHS.has(normalizePath(window.location.pathname)));// Framer hydrates page content after this component in some layouts; re-check once it settles.\nsetLink(resolveFormLink(formHref));const timer=window.setTimeout(()=>setLink(resolveFormLink(formHref)),1500);return()=>window.clearTimeout(timer);},[formHref]);const telHref=`tel:${phoneNumber.replace(/[^0-9+]/g,\"\")}`;const scopeClass=\"ckr-sticky-mobile-cta\";function handleFormClick(event){track(\"cta_clicked\",{button_text:formLabel,cta_destination:link.mode===\"scroll-form\"?\"on_page_form\":link.href,page_location:pageLocation,source:\"sticky_mobile_cta\"});if(link.mode!==\"scroll-form\"||typeof document===\"undefined\")return;const form=document.querySelector(\"form\");if(!form)return;event.preventDefault();form.scrollIntoView({behavior:\"smooth\",block:\"start\"});}if(hidden)return null;const containerStyle={position:\"fixed\",bottom:\"max(10px, env(safe-area-inset-bottom, 0px))\",left:10,right:10,zIndex:9999,display:\"flex\",flexDirection:\"row\",alignItems:\"stretch\",width:\"auto\",backgroundColor,boxShadow:\"0 10px 28px rgba(0, 0, 0, 0.22)\",borderRadius:12,overflow:\"hidden\",paddingBottom:0,fontFamily:\"'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif\"};const phoneButtonStyle={flex:\"0 0 40%\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",padding:\"12px 8px\",minHeight:58,color:phoneTextColor,textDecoration:\"none\",borderRight:\"1px solid rgba(255,255,255,0.12)\",fontWeight:600,fontSize:14,lineHeight:\"18px\",letterSpacing:0,gap:2};const formButtonStyle={flex:\"1 1 60%\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",padding:\"12px 16px\",minHeight:58,backgroundColor:accentColor,color:accentTextColor,textDecoration:\"none\",fontWeight:700,fontSize:15,lineHeight:\"20px\",letterSpacing:0,gap:2};const mediaCss=hideOnDesktop?`@media (max-width: ${maxBreakpoint}px) { body { padding-bottom: ${safeAreaInset?\"calc(82px + env(safe-area-inset-bottom, 0px))\":\"82px\"} !important; } } @media (min-width: ${maxBreakpoint}px) and (hover: hover) and (pointer: fine) { .${scopeClass} { display: none !important; } }`:\"\";return /*#__PURE__*/_jsxs(_Fragment,{children:[mediaCss?/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:mediaCss}}):null,/*#__PURE__*/_jsxs(\"div\",{className:scopeClass,style:containerStyle,role:\"region\",\"aria-label\":\"Contact CKR Exteriors\",children:[/*#__PURE__*/_jsxs(\"a\",{href:telHref,style:phoneButtonStyle,\"aria-label\":`Call CKR Exteriors at ${phoneNumber}`,onClick:()=>track(\"phone_clicked\",{page_location:pageLocation,source:\"sticky_mobile_cta\"}),children:[/*#__PURE__*/_jsxs(\"span\",{style:{display:\"inline-flex\",alignItems:\"center\",gap:6},children:[/*#__PURE__*/_jsx(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.5 19.5 0 01-6-6 19.79 19.79 0 01-3.07-8.67A2 2 0 014.11 2h3a2 2 0 012 1.72c.13.96.37 1.9.72 2.81a2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.91.35 1.85.59 2.81.72A2 2 0 0122 16.92z\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})}),/*#__PURE__*/_jsx(\"span\",{style:{fontWeight:700},children:phoneLabel})]}),/*#__PURE__*/_jsx(\"span\",{style:{fontSize:12,fontWeight:500,opacity:.85},children:phoneNumber})]}),/*#__PURE__*/_jsxs(\"a\",{href:link.href,style:formButtonStyle,\"aria-label\":formLabel,onClick:handleFormClick,children:[/*#__PURE__*/_jsxs(\"span\",{style:{display:\"inline-flex\",alignItems:\"center\",gap:6},children:[/*#__PURE__*/_jsx(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M9 11l3 3L22 4M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})}),/*#__PURE__*/_jsx(\"span\",{children:formLabel})]}),/*#__PURE__*/_jsx(\"span\",{style:{fontSize:11,fontWeight:600,opacity:.78},children:formSubtext})]})]})]});}addPropertyControls(StickyMobileCTA,{phoneNumber:{type:ControlType.String,title:\"Phone Number\",defaultValue:\"(770) 294-5181\",placeholder:\"(770) 294-5181\"},phoneLabel:{type:ControlType.String,title:\"Phone Label\",defaultValue:\"Call CKR\"},formHref:{type:ControlType.String,title:\"Form Link\",defaultValue:\"/schedule-assessment\",description:\"Anchor like #contact or a page path like /schedule-assessment. Missing anchors scroll to the page's form or fall back to /schedule-assessment.\"},formLabel:{type:ControlType.String,title:\"Form Label\",defaultValue:\"Schedule Assessment\"},formSubtext:{type:ControlType.String,title:\"Form Subtext\",defaultValue:\"Project-team follow-up\"},hideOnDesktop:{type:ControlType.Boolean,title:\"Hide On Desktop\",defaultValue:true,enabledTitle:\"Mobile Only\",disabledTitle:\"All Sizes\"},maxBreakpoint:{type:ControlType.Number,title:\"Mobile Max (px)\",defaultValue:810,min:480,max:1200,step:10,unit:\"px\",hidden:props=>!props.hideOnDesktop},backgroundColor:{type:ControlType.Color,title:\"Bar BG\",defaultValue:\"rgb(0, 21, 36)\"},phoneTextColor:{type:ControlType.Color,title:\"Phone Text\",defaultValue:\"rgb(255, 255, 255)\"},accentColor:{type:ControlType.Color,title:\"CTA BG\",defaultValue:\"rgb(64, 207, 112)\"},accentTextColor:{type:ControlType.Color,title:\"CTA Text\",defaultValue:\"rgb(0, 21, 36)\"},safeAreaInset:{type:ControlType.Boolean,title:\"iOS Safe Area\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},pageLocation:{type:ControlType.String,title:\"Page Location Tag\",defaultValue:\"\",placeholder:\"For analytics: homepage, dec-tec, etc.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StickyMobileCTA\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StickyMobileCTA.map"],"mappings":"mMAcyI,SAAS,EAAM,EAAM,EAAM,CAAC,EAAE,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,EAAE,EAAO,EAAE,UAAU,EAAE,WAAW,CAAC,EAAE,EAAE,UAAU,KAAK,CAAC,QAAM,GAAG,CAAK,CAAC,CAAE,CAAC,SAAS,EAAc,EAAK,CAAgC,MAA5B,CAAC,GAAM,IAAO,IAAU,IAAW,EAAK,QAAQ,MAAM,EAAE,CAAE,CAAC,SAAS,EAAgB,EAAS,CAAC,IAAM,EAAU,EAAS,QAAQ,GAAG,EAAE,GAAG,IAAY,GAAG,MAAM,CAAC,KAAK,EAAS,KAAK,MAAM,EAAE,IAAM,EAAW,EAAc,EAAS,MAAM,EAAE,CAAS,GAAG,EAAO,SAAS,QAAQ,EAAQ,EAAS,mBAAmB,EAAS,MAAM,EAAU,CAAC,CAAC,EAAQ,EAAW,IAAa,EAAc,EAAO,SAAS,QAAQ,EAAgM,OAA3L,GAAY,GAAU,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