{"version":3,"file":"CTAButton.CSVfEEty.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/j9jxia5mUza4IrgD0sRA/7sYCIuIx46X3SKakHmV5/CTAButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState}from\"react\";// Canonical brand colours from the ev.energy guidelines.\nexport const ELECTRIC=\"#50fb60\";const JUNGLE=\"#0E2B2E\";const JUNGLE_RGB=\"14, 43, 46\";const WHITE=\"#ffffff\";const WHITE_RGB=\"255, 255, 255\";// Rewrite legacy `/demo` hrefs to the canonical `/eve/demo` route at render\n// time. Catches every CTAButton instance configured before the route move\n// without requiring per-page edits across the site.\nfunction rewriteDemoHref(href){if(!href)return href;if(href===\"/demo\"||href===\"/demo/\")return\"/eve/demo\";return href;}// Smart default destination based on the button label.\n//\n// V7 split (Book a Demo vs. Contact Us):\n//   - Labels explicitly mentioning \"demo\" or \"book a demo\" route to\n//     /eve/demo. The demo page is reserved for explicit demo intent.\n//   - Soft / conversational labels (\"talk to us\", \"tell us\", \"get in\n//     touch\", \"contact\", and the per-topic \"talk to us about X\" family)\n//     route to /contact, the general contact page. Previously these all\n//     resolved to /eve/demo because /contact didn't exist.\nfunction inferLink(label){const l=(label||\"\").toLowerCase();if(l.includes(\"chargewise\"))return\"/insights/chargewise\";if(l.includes(\"smartcharge\"))return\"/insights/smartcharge-ny\";if(l.includes(\"anwb\"))return\"/insights/anwb\";if(l.includes(\"ukpn\")||l.includes(\"uk power networks\"))return\"/insights/ukpn\";if(l.includes(\"ameren\"))return\"/insights/ameren\";if(l.includes(\"ccas\")||l.includes(\"for ccas\")||l.includes(\"cca \"))return\"/eve/utilities/california-cca\";if(l.includes(\"eve insight\"))return\"/eve/insight\";if(l.includes(\"eve programs\"))return\"/eve/programs\";if(l.includes(\"eve sync\"))return\"/eve/sync\";if(l.includes(\"eve ops\"))return\"/eve/ops\";if(l.includes(\"integration\")&&!l.includes(\"integration mix\"))return\"/eve/integrations\";if(l.includes(\"playbook\")||l.includes(\"download\"))return\"/insights\";if(l.includes(\"open roles\")||l.includes(\"all roles\"))return\"/careers\";if(l.includes(\"explore eve\"))return\"/eve\";if(l.includes(\"find your program\"))return\"/eve\";if(l.includes(\"ju report\")||l.includes(\"read the ju\"))return\"/insights\";if(l.includes(\"case study\")||l.includes(\"case studies\"))return\"/insights\";// Explicit demo intent — must mention \"demo\" or \"book a demo\".\nif(l.includes(\"demo\")||l.includes(\"book a demo\"))return\"/eve/demo\";// Conversational / general-contact CTAs. Routes to /contact (V7)\n// instead of forcing every \"talk to us about X\" into the demo form.\n// Visitors with a specific demo intent click the dedicated \"Book a\n// Demo\" CTA elsewhere on the page.\nif(l.includes(\"talk to us\")||l.includes(\"tell us\")||l.includes(\"get in touch\")||l.includes(\"contact\")||l.includes(\"have a filing\")||l.includes(\"filing coming up\")||l.includes(\"regulatory filing\")||l.includes(\"flex strategy\")||l.includes(\"cost-avoidance\")||l.includes(\"integration mix\")||l.includes(\"architecture\")||l.includes(\"your fleet\")||l.includes(\"multi-family\")||l.includes(\"white-label\")||l.includes(\"your specific challenge\")||l.includes(\"specific challenge\"))return\"/contact\";return\"#\";}// Detect whether a CTA label already ends in an arrow glyph so we can\n// suppress the auto-appended `→` and avoid double-arrow bugs like\n// \"Try Eve Insight → →\" or \"See the ChargeWise story → →\".\n//\n// Covers all the directional arrows we use across the site: right (→),\n// down (↓), up (↑), left (←), plus the diagonals. Trim trailing whitespace\n// before testing so \"Read more → \" (with a trailing space) still matches.\nconst ARROW_TRAILING_RE=/[→↓↑←↗↘↙↖]\\s*$/;function labelEndsInArrow(label){if(!label)return false;return ARROW_TRAILING_RE.test(label);}// Build the className for analytics tracking. Always emits `track-cta` for\n// universal CTA-button selection, a variant class (`track-cta-primary`,\n// `track-cta-secondary`, `track-cta-soft`) for styling-tier selection, plus\n// a specific intent class when the label or href matches a known intent.\n// Inspect with:\n//   document.querySelectorAll(\".track-cta-book-demo\")\n//   document.querySelectorAll(\".track-cta-contact\")\n//   document.querySelectorAll(\".track-cta-primary\")\nfunction trackingClasses(label,href,variant){const classes=[\"track-cta\",`track-cta-${variant}`];const l=(label||\"\").toLowerCase();const h=(href||\"\").toLowerCase();if(l.includes(\"demo\")||h===\"/demo\"||h===\"/eve/demo\"){classes.push(\"track-cta-book-demo\");}else if(l.includes(\"case stud\")||h.startsWith(\"/case-studies\")){classes.push(\"track-cta-case-studies\");}else if(l.includes(\"resources\")||h===\"/resources\"){classes.push(\"track-cta-resources\");}else if(l.includes(\"subscribe\")||l.includes(\"newsletter\")||h.startsWith(\"mailto:\")){classes.push(\"track-cta-newsletter\");}else if(l.includes(\"download\")||l.includes(\"playbook\")||l.includes(\"report\")||l.includes(\"ju report\")){classes.push(\"track-cta-download\");}else if(l.includes(\"careers\")||l.includes(\"roles\")||h===\"/careers\"){classes.push(\"track-cta-careers\");}else if(l.includes(\"contact\")||l.includes(\"talk\")||l.includes(\"touch\")||l.includes(\"tell us\")||h===\"/contact\"){classes.push(\"track-cta-contact\");}else if(l.includes(\"calculator\")||h.includes(\"calculator\")){classes.push(\"track-cta-calculator\");}return classes.join(\" \");}/**\n * CTA Button — canonical ev.energy buttons.\n *\n * V7: Book a Demo vs. Contact Us split. `inferLink()` now distinguishes\n * explicit demo intent (label contains \"demo\") from conversational\n * contact intent (talk to us / tell us / get in touch / per-topic\n * \"talk to us about X\" family). Demo labels route to /eve/demo;\n * conversational labels route to the new /contact page. Was previously\n * routing every soft CTA at the demo booking form.\n *\n * V6: Demo CTAs now resolve to `/eve/demo` instead of legacy `/demo`.\n * `inferLink()` returns `/eve/demo` for demo-labeled buttons and a\n * `rewriteDemoHref()` pass at render time rewrites any explicit\n * `/demo` href (typically from old instance configs) to `/eve/demo`.\n *\n * V5 change: tracking classes now also emit a variant tier class\n * (`track-cta-primary`, `track-cta-secondary`, `track-cta-soft`) alongside\n * the universal `.track-cta` and any specific intent class. Lets analytics\n * and styling differentiate hierarchy without parsing the label.\n *\n * V4 change: suppresses the auto-appended arrow when the label already\n * ends in an arrow glyph (→ ↓ ↑ ← and diagonals). Many instance configs\n * across the site type \"Try Eve Insight →\" into the label AND set\n * showArrow=\"true\", which previously rendered two arrows side by side.\n * Now the in-label arrow wins and the component skips its own arrow span.\n *\n * V3 change: auto-applies tracking classes to the rendered <a> element\n * based on label and resolved href. Every CTAButton site-wide gets at\n * minimum `.track-cta`; specific intents (`.track-cta-book-demo`,\n * `.track-cta-case-studies`, etc.) layer on top.\n *\n * V2 change: adds `hrefOverride` (plain string). When set it takes precedence\n * over both `link` (ControlType.Link) and label-based inference.\n *\n * Primary on dark:  Electric Green bg, Jungle text.\n * Primary on light: Jungle bg, White text. (Electric on light fails contrast.)\n * Secondary on dark:  Transparent, White text, 1px White border.\n * Secondary on light: Transparent, Jungle text, 1px Jungle border.\n *\n * @framerIntrinsicWidth 200\n * @framerIntrinsicHeight 56\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function CTAButton(props){const{label,link,hrefOverride,variant,onDark,showArrow,fullWidth,style}=props;const[hover,setHover]=useState(false);const resolvedHref=rewriteDemoHref(hrefOverride&&hrefOverride.length>0&&hrefOverride||link&&link.length>0&&link||inferLink(label));const trackClass=trackingClasses(label,resolvedHref,variant);// Suppress the auto-arrow when the label already ends in an arrow glyph.\n// This stops \"Try Eve Insight → →\" double-arrow rendering when an\n// instance both types the arrow into the label and leaves showArrow on.\nconst renderAutoArrow=showArrow&&!labelEndsInArrow(label);let bg=\"transparent\";let color=WHITE;let border=\"0\";let hoverBg=\"transparent\";let hoverColor=WHITE;let padX=\"28px\";let padY=\"18px\";let radius=\"999px\";if(variant===\"primary\"){if(onDark){bg=ELECTRIC;color=JUNGLE;hoverBg=ELECTRIC;hoverColor=JUNGLE;border=`1px solid ${ELECTRIC}`;}else{bg=JUNGLE;color=WHITE;hoverBg=JUNGLE;hoverColor=WHITE;border=`1px solid ${JUNGLE}`;}}else if(variant===\"secondary\"){bg=\"transparent\";color=onDark?WHITE:JUNGLE;border=onDark?`1px solid ${WHITE}`:`1px solid ${JUNGLE}`;hoverBg=onDark?`rgba(${WHITE_RGB}, 0.08)`:`rgba(${JUNGLE_RGB}, 0.06)`;hoverColor=color;}else{bg=\"transparent\";color=onDark?WHITE:JUNGLE;border=\"0\";hoverBg=\"transparent\";hoverColor=ELECTRIC;padX=\"0\";padY=\"8px\";radius=\"0\";}const isSoft=variant===\"soft\";const baseStyle={display:\"inline-flex\",alignItems:\"center\",justifyContent:isSoft?\"flex-start\":\"center\",gap:\"10px\",textDecoration:\"none\",background:hover?hoverBg:bg,color:hover?hoverColor:color,border,borderRadius:radius,padding:`${padY} ${padX}`,fontFamily:\"'Barlow Condensed', 'Barlow', -apple-system, system-ui, sans-serif\",fontWeight:800,fontSize:\"16px\",lineHeight:1,letterSpacing:isSoft?\"0.04em\":\"0.06em\",textTransform:\"uppercase\",cursor:\"pointer\",transition:\"background 180ms ease, color 180ms ease, transform 180ms ease\",transform:hover&&!isSoft?\"translateY(-1px)\":\"translateY(0)\",width:fullWidth?\"100%\":\"auto\",whiteSpace:\"nowrap\",boxSizing:\"border-box\",...style};const arrowStyle={display:\"inline-block\",transform:hover?\"translateX(3px)\":\"translateX(0)\",transition:\"transform 180ms ease\",fontSize:\"1.05em\",lineHeight:1};return /*#__PURE__*/_jsxs(\"a\",{href:resolvedHref,className:trackClass,\"data-label\":label,style:baseStyle,onMouseEnter:()=>setHover(true),onMouseLeave:()=>setHover(false),children:[/*#__PURE__*/_jsx(\"span\",{children:label}),renderAutoArrow&&/*#__PURE__*/_jsx(\"span\",{style:arrowStyle,children:\"→\"})]});}addPropertyControls(CTAButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Contact Us\"},link:{type:ControlType.Link,title:\"Link\"},hrefOverride:{type:ControlType.String,title:\"Href Override\",defaultValue:\"\",description:\"Plain-string href, takes precedence over Link and label inference.\"},variant:{type:ControlType.Enum,title:\"Variant\",options:[\"primary\",\"secondary\",\"soft\"],optionTitles:[\"Primary\",\"Secondary\",\"Soft\"],defaultValue:\"primary\",displaySegmentedControl:true},onDark:{type:ControlType.Boolean,title:\"On Dark\",defaultValue:true},showArrow:{type:ControlType.Boolean,title:\"Arrow\",defaultValue:true,description:\"Auto-append a → after the label. Automatically suppressed when the label already ends in an arrow glyph (→ ↓ ↑ ← or diagonals).\"},fullWidth:{type:ControlType.Boolean,title:\"Full Width\",defaultValue:false},accentColor:{type:ControlType.Color,title:\"Accent (legacy)\",defaultValue:ELECTRIC}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CTAButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"56\",\"framerIntrinsicWidth\":\"200\"}},\"ELECTRIC\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CTAButton.map"],"mappings":"iLAIA,SAAS,EAAgB,EAAK,CAA2E,OAAtE,IAAoB,IAAO,SAAS,IAAO,SAAe,YAAmB,GAShH,SAAS,EAAU,EAAM,CAAC,IAAM,GAAG,GAAO,IAAI,aAAa,CAK0a,OALta,EAAE,SAAS,aAAa,CAAO,uBAA0B,EAAE,SAAS,cAAc,CAAO,2BAA8B,EAAE,SAAS,OAAO,CAAO,iBAAoB,EAAE,SAAS,OAAO,EAAE,EAAE,SAAS,oBAAoB,CAAO,iBAAoB,EAAE,SAAS,SAAS,CAAO,mBAAsB,EAAE,SAAS,OAAO,EAAE,EAAE,SAAS,WAAW,EAAE,EAAE,SAAS,OAAO,CAAO,gCAAmC,EAAE,SAAS,cAAc,CAAO,eAAkB,EAAE,SAAS,eAAe,CAAO,gBAAmB,EAAE,SAAS,WAAW,CAAO,YAAe,EAAE,SAAS,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