{"version":3,"file":"LinkButton.CnaVOA5_.mjs","names":["useRef","useState","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","te","_e","p","c","init_jsx_runtime","ce","de","init_framer_D1IzEvwH","RenderTarget","ControlType","addPropertyControls","init_ServiceCatalog","serviceForPath","normaliseContactLink","contactHref","resolveLink","trackEvent","LinkButton","props","uid","onCanvas","isText","variant","onDark","resolved","anchor","link","base","href","setHref","self","setSelf","next","same","here","plainContact","GENERAL","svc","onClick","track","label","el","reduce","h","css","FONT","showArrow","arrow","fullWidth","newTab","init_LinkButton"],"sources":["https:/framerusercontent.com/modules/wZUt6vL9qQXzZhBSGv4b/ENqUjjaajLHyAdQxFMvx/LinkButton.js"],"sourcesContent":["// Clouden link button.\n// Brief: one reusable call-to-action used across the site. Variants: primary (indigo\n// pill), ghost (translucent pill for dark backgrounds), white (white pill for coloured\n// backgrounds), outline (light backgrounds), text (indigo text link with arrow) and\n// light (white text link with arrow, for dark backgrounds).\n// \"Link\" accepts any URL or path, including planned pages not built yet (for example\n// /services/cloud-migration) and on-page anchors such as #services. Planned pages are\n// resolved through ServiceCatalog.tsx (PLANNED_LINKS): they go to the closest existing\n// page or section, and a button whose destination does not exist yet (for example\n// /our-work) is hidden instead of leading to a missing page. A button that would only\n// reload the page it is on (a planned page standing in for the current page) is hidden too.\n// Text links wrap inside narrow cards. Pills stay on one line where there is room and\n// wrap onto two centred lines on phones, so a long label never runs off the screen.\n// Visible focus ring, hover states, reduced-motion aware.\n// Enquiry links (Contact brief): \"/contact#discovery-call\" style links are converted to\n// \"/contact?topic=project\" (topics resolved by ServiceCatalog.tsx). On a service page, a\n// general enquiry link (\"/contact\" or \"/contact?topic=project\") opens the form with that\n// page's service selected (/contact?topic=<service slug>), unless \"Keep plain contact\n// link\" is on. Links to a specific topic (for example ?topic=health-check) are kept.\n// Tracking (optional): when \"Track as CTA\" has a location (for example \"hero\"), a click\n// sends one cta_click event { cta_location, cta_text, link_path } through the site's\n// existing analytics tag. It records the click only, never a completed enquiry (the\n// Contact form sends generate_lead after a successful submission). No personal data.\n// Same-page anchors (#section) scroll with an offset that clears the sticky header and\n// the page's section bar, and move keyboard focus to the section heading.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useRef,useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{normaliseContactLink,serviceForPath,contactHref,trackEvent,resolveLink}from\"https://framerusercontent.com/modules/YB6xniW63KdTtV8uyS0n/5K4CJUPTdyC1TaYEa1zZ/ServiceCatalog.js\";const FONT=`\"Geist\", \"Inter\", system-ui, -apple-system, \"Segoe UI\", sans-serif`;const GENERAL=[\"/contact\",contactHref(\"project\")];/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function LinkButton(props){const{label=\"Book a Discovery Call\",link=\"/contact?topic=project\",anchor=\"\",variant=\"primary\",arrow=false,newTab=false,fullWidth=false,plainContact=false,track=\"\"}=props;const uid=useRef(\"lb\"+Math.random().toString(36).slice(2,8)).current;const onCanvas=RenderTarget.current()===RenderTarget.canvas;const isText=variant===\"text\"||variant===\"light\";const onDark=variant===\"white\"||variant===\"ghost\"||variant===\"light\";const resolved=anchor?`#${anchor.replace(/^#/,\"\")}`:resolveLink(normaliseContactLink(link||\"#\"));const base=resolved||\"#\";const[href,setHref]=useState(base);const[self,setSelf]=useState(false);useEffect(()=>{let next=base;let same=false;if(typeof window!==\"undefined\"){const here=window.location.pathname.replace(/\\/$/,\"\")||\"/\";if(!plainContact&&GENERAL.includes(base)){const svc=serviceForPath(here);if(svc)next=contactHref(svc.slug);}// A stand-in link that points back to this very page (no section) does nothing useful.\nsame=!!resolved&&resolved!==link&&/^\\/[^?#]*$/.test(next)&&(next.replace(/\\/$/,\"\")||\"/\")===here;}startTransition(()=>{setHref(next);setSelf(same);});},[base,plainContact,resolved,link]);if(!onCanvas&&(resolved===null||self))return null;const onClick=e=>{if(track)trackEvent(\"cta_click\",{cta_location:track,cta_text:label,link_path:href.split(\"#\")[0]||href});// Same-page anchor: scroll with the sticky offset set on the target (scroll-margin-top).\nif(href.startsWith(\"#\")&&typeof document!==\"undefined\"){const el=document.getElementById(href.slice(1));if(!el)return;e.preventDefault();const reduce=window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;if(!el.style.scrollMarginTop)el.style.scrollMarginTop=\"132px\";el.scrollIntoView({block:\"start\",behavior:reduce?\"auto\":\"smooth\"});try{history.replaceState(null,\"\",href);}catch(err){}const h=el.querySelector(\"h2\")||el;if(!h.hasAttribute(\"tabindex\"))h.setAttribute(\"tabindex\",\"-1\");h.style.outline=\"none\";window.setTimeout(()=>h.focus({preventScroll:true}),reduce?0:450);}};const css=`\n.${uid}{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-family:${FONT};font-weight:600;text-decoration:none;white-space:nowrap;box-sizing:border-box;max-width:100%;transition:background-color .2s ease,color .2s ease,box-shadow .2s ease,gap .2s ease;cursor:pointer;letter-spacing:-0.01em}\n.${uid}.pill{min-height:52px;height:auto;padding:14px 26px;border-radius:999px;font-size:15px;line-height:1.25}\n.${uid}.primary{background:#3F42E0;color:#fff}\n.${uid}.primary:hover{background:#3134C2}\n.${uid}.ghost{background:rgba(255,255,255,.08);color:#fff;box-shadow:inset 0 0 0 1px rgba(255,255,255,.28)}\n.${uid}.ghost:hover{background:rgba(255,255,255,.16)}\n.${uid}.white{background:#fff;color:#0E1525}\n.${uid}.white:hover{background:#EEF0FE}\n.${uid}.outline{background:transparent;color:#0E1525;box-shadow:inset 0 0 0 1.5px #0E1525}\n.${uid}.outline:hover{background:#0E1525;color:#fff}\n.${uid}.text,.${uid}.light{font-size:15px;line-height:1.4;padding:2px 0;min-height:24px;white-space:normal;text-align:left;justify-content:flex-start}\n.${uid}.text{color:#3F42E0}\n.${uid}.light{color:#fff}\n.${uid}.text:hover,.${uid}.light:hover{gap:12px;text-decoration:underline;text-underline-offset:4px}\n.${uid}:focus-visible{outline:2px solid ${onDark?\"#FFFFFF\":\"#3F42E0\"};outline-offset:3px}\n.${uid}.full{width:100%}\n@media (max-width: 809.98px){.${uid}.pill{white-space:normal;text-align:center;padding:14px 22px}}\n@media (prefers-reduced-motion: reduce){.${uid}{transition:none}}\n`;const showArrow=arrow||isText;return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",display:fullWidth?\"block\":\"inline-block\",width:fullWidth?\"100%\":\"auto\",maxWidth:\"100%\",...props.style,height:\"auto\"},children:[/*#__PURE__*/_jsx(\"style\",{children:css}),/*#__PURE__*/_jsxs(\"a\",{href:href,onClick:onClick,className:`${uid} ${isText?variant:\"pill \"+variant} ${fullWidth?\"full\":\"\"}`,target:newTab?\"_blank\":undefined,rel:newTab?\"noopener noreferrer\":undefined,children:[/*#__PURE__*/_jsx(\"span\",{children:label}),showArrow&&/*#__PURE__*/_jsx(\"svg\",{width:\"14\",height:\"14\",viewBox:\"0 0 14 14\",\"aria-hidden\":\"true\",style:{flexShrink:0},children:/*#__PURE__*/_jsx(\"path\",{d:\"M2.5 7h9M8 3.5 11.5 7 8 10.5\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1.6\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})]})]});}addPropertyControls(LinkButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Book a Discovery Call\"},link:{type:ControlType.String,title:\"Link (URL or path)\",defaultValue:\"/contact?topic=project\",placeholder:\"/contact\"},anchor:{type:ControlType.String,title:\"Section anchor\",defaultValue:\"\",placeholder:\"e.g. services\"},variant:{type:ControlType.Enum,title:\"Variant\",options:[\"primary\",\"ghost\",\"white\",\"outline\",\"text\",\"light\"],optionTitles:[\"Primary\",\"Ghost (dark bg)\",\"White (colour bg)\",\"Outline\",\"Text link\",\"Text link (dark bg)\"],defaultValue:\"primary\"},arrow:{type:ControlType.Boolean,title:\"Arrow\",defaultValue:false},newTab:{type:ControlType.Boolean,title:\"New tab\",defaultValue:false},fullWidth:{type:ControlType.Boolean,title:\"Full width\",defaultValue:false},plainContact:{type:ControlType.Boolean,title:\"Keep plain contact link\",defaultValue:false,description:\"Off: on a service page, a general enquiry link preselects that page's service in the enquiry form.\"},track:{type:ControlType.String,title:\"Track as CTA\",defaultValue:\"\",placeholder:\"Location, e.g. hero\",description:\"Sends cta_click with this location. Leave empty for navigation links.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LinkButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"A,6SA4BG,SAAwBuB,EAAW,EAAM,CAAC,GAAK,CAAC,QAAM,wBAAwB,OAAK,yBAAyB,SAAO,GAAG,UAAQ,UAAU,QAAM,GAAM,SAAO,GAAM,YAAU,GAAM,eAAa,GAAM,QAAM,IAAIC,EAAYC,EAAIzB,EAAO,KAAK,KAAK,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,QAAc0B,EAASZ,EAAa,QAAQ,IAAIA,EAAa,OAAaa,EAAOC,IAAU,QAAQA,IAAU,QAAcC,EAAOD,IAAU,SAASA,IAAU,SAASA,IAAU,QAAcE,EAASC,EAAO,IAAIA,EAAO,QAAQ,KAAK,EAAE,IAAIV,EAAYF,EAAqBa,GAAM,GAAG,CAAC,EAAQC,EAAKH,GAAU,IAAS,CAACI,EAAKC,GAASlC,EAASgC,CAAI,EAAO,CAACG,EAAKC,GAASpC,EAAS,EAAK,EACnd,GADqdU,MAAc,CAAC,IAAI2B,EAAKL,EAASM,EAAK,GAAM,GAAUlC,IAAS,OAAY,CAAC,IAAMmC,EAAKnC,EAAO,SAAS,SAAS,QAAQ,MAAM,EAAE,GAAG,IAAI,GAAG,CAACoC,GAAcC,EAAQ,SAAST,CAAI,EAAE,CAAC,IAAMU,EAAIzB,EAAesB,CAAI,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