{"version":3,"file":"PageAddress.eOj3i2cM.mjs","names":["useState","useState","Framer.useRouter"],"sources":["https:/framerusercontent.com/modules/OYhFPv9p5Lh6s0KjdF2l/POM009Uj1LAyeoOxmXxD/CopyShare.js","https:/framerusercontent.com/modules/tQt5Dt2OHBv8fOP1U2PB/OdtnF3UzCwO9tZtVOYX1/PageAddress.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Copy the line / Share: two buttons in the site's outlined blue style.\n * Copy puts the line plus this page's own address on the clipboard. Share opens\n * the device's share sheet with the line and the address as the link; without\n * one, it opens an email with both. The address is read from the page at\n * runtime (origin + path, no query), so it is right on any domain and for\n * every CMS page, and nothing is stored in the copy.\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function CopyShare(props){const{text,leadIn,copyLabel,copiedLabel,shareLabel,color,hoverColor,link}=props;const[copied,setCopied]=useState(false);const[hover,setHover]=useState(\"\");// A fixed address (e.g. \"https://richardrussell.co/coaching/me\") wins over this page's own.\nconst pageUrl=()=>link?link:typeof window!==\"undefined\"?window.location.origin+window.location.pathname:\"\";// The line without any address someone may have typed at the end\nconst line=()=>String(text||\"\").replace(/\\s*https?:\\/\\/\\S+\\s*$/,\"\");const full=()=>{const u=pageUrl();const lead=leadIn?\" \"+leadIn:\"\";return u?line()+lead+\" \"+u:line();};const onCopy=async()=>{try{await navigator.clipboard.writeText(full());}catch(e){const t=document.createElement(\"textarea\");t.value=full();document.body.appendChild(t);t.select();document.execCommand(\"copy\");document.body.removeChild(t);}setCopied(true);setTimeout(()=>setCopied(false),1600);};const onShare=async()=>{if(navigator.share){try{await navigator.share({text:line()+(leadIn?\" \"+leadIn:\"\"),url:pageUrl()});return;}catch(e){return;}}window.location.href=\"mailto:?body=\"+encodeURIComponent(full());};const button=(key,label,onClick)=>/*#__PURE__*/_jsx(\"button\",{onClick:onClick,onMouseEnter:()=>setHover(key),onMouseLeave:()=>setHover(\"\"),style:{appearance:\"none\",background:\"transparent\",border:`1px solid ${hover===key?hoverColor:color}`,color:hover===key?hoverColor:color,borderRadius:8,padding:\"11px 20px\",font:'500 14px/1 \"Inter\", \"Inter Placeholder\", sans-serif',cursor:\"pointer\",whiteSpace:\"nowrap\"},children:label},key);return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",gap:12,flexWrap:\"wrap\"},children:[button(\"copy\",copied?copiedLabel:copyLabel,onCopy),button(\"share\",shareLabel,onShare)]});}CopyShare.defaultProps={text:\"Richard gets a founder's leadership team onto one strategy, clear goals and a weekly rhythm that works without the founder, then coaches the leaders who step up.\",copyLabel:\"Copy the line\",copiedLabel:\"Copied\",shareLabel:\"Share\",leadIn:\"Here's the page:\",color:\"#1A64F0\",hoverColor:\"#1450C4\"};addPropertyControls(CopyShare,{text:{type:ControlType.String,title:\"Text\",displayTextArea:true},copyLabel:{type:ControlType.String,title:\"Copy label\"},copiedLabel:{type:ControlType.String,title:\"Copied label\"},shareLabel:{type:ControlType.String,title:\"Share label\"},leadIn:{type:ControlType.String,title:\"Lead-in\"},color:{type:ControlType.Color,title:\"Colour\"},hoverColor:{type:ControlType.Color,title:\"Hover colour\"},link:{type:ControlType.String,title:\"Fixed address\",placeholder:\"This page\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CopyShare\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CopyShare.map","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import*as Framer from\"framer\";import{addPropertyControls,ControlType}from\"framer\";// Framer's router hook (used by its own pages; not in the public types)\nconst useRouterSafe=Framer.useRouter||(()=>null);/**\n * Page address: shows a lead-in and this page's own address (origin + path,\n * no query), e.g. \"Here's the page: https://richardrussell.co/coaching\".\n * Sits under the line to paste, in the same text style; the address is a\n * blue, underlined link (blue = clickable in the brand).\n *\n * The first render (the HTML that link previews, search engines and AI tools\n * read) builds the path from the page's own route, on the site address set\n * below. In the browser it then switches to the real address, so the test\n * site shows its own domain.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */function routePath(router){try{const route=router?.routes?.[router?.currentRouteId];let path=route?.path||\"\";const vars=router?.currentPathVariables||{};path=path.replace(/:([A-Za-z0-9_]+)/g,(_m,k)=>vars[k]!=null?String(vars[k]):\"\");return path.startsWith(\"/\")?path:\"\";}catch(e){return\"\";}}export default function PageAddress(props){const{leadIn,color,linkColor,fontSize,siteAddress}=props;const[hover,setHover]=useState(false);const router=useRouterSafe();const base=String(siteAddress||\"https://richardrussell.co\").replace(/\\/+$/,\"\");const path=routePath(router)||\"/\";const[url,setUrl]=useState(base+path);useEffect(()=>{if(typeof window!==\"undefined\")setUrl(window.location.origin+window.location.pathname);},[path]);return /*#__PURE__*/_jsxs(\"p\",{style:{margin:0,width:\"100%\",font:`400 ${fontSize}px/1.55 \"Inter\", \"Inter Placeholder\", sans-serif`,color,overflowWrap:\"anywhere\"},children:[leadIn,leadIn?\" \":\"\",/*#__PURE__*/_jsx(\"a\",{href:url,onMouseEnter:()=>setHover(true),onMouseLeave:()=>setHover(false),style:{color:linkColor,textDecoration:\"underline\",textDecorationThickness:hover?\"2px\":\"1px\",textUnderlineOffset:\"3px\"},children:url})]});}PageAddress.defaultProps={leadIn:\"Here's the page:\",color:\"#1F1F1F\",linkColor:\"#1A64F0\",fontSize:17,siteAddress:\"https://richardrussell.co\"};addPropertyControls(PageAddress,{leadIn:{type:ControlType.String,title:\"Lead-in\"},color:{type:ControlType.Color,title:\"Color\"},linkColor:{type:ControlType.Color,title:\"Link color\"},fontSize:{type:ControlType.Number,title:\"Size\",min:12,max:24,step:1},siteAddress:{type:ControlType.String,title:\"Site address\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PageAddress\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PageAddress.map"],"mappings":"2MAUG,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,OAAK,SAAO,YAAU,cAAY,aAAW,QAAM,aAAW,QAAM,EAAW,CAAC,EAAO,GAAWA,EAAS,EAAK,EAAO,CAAC,EAAM,GAAUA,EAAS,EAAE,EAC/L,MAAY,IAAiB,IAAS,OAA4D,GAAhD,EAAO,SAAS,OAAO,EAAO,SAAS,UACzF,MAAS,OAAO,GAAM,EAAE,CAAC,CAAC,QAAQ,wBAAwB,EAAE,EAAQ,MAAS,CAAC,IAAM,EAAE,EAAQ,EAAQ,EAAK,EAAO,IAAI,EAAO,GAAG,OAAO,EAAE,EAAK,EAAE,EAAK,IAAI,EAAE,EAAK,CAAE,EAAQ,EAAO,SAAS,CAAC,GAAG,CAAC,MAAM,EAAU,UAAU,UAAU,EAAK,CAAC,CAAE,MAAS,CAAC,IAAM,EAAE,SAAS,cAAc,UAAU,EAAE,EAAE,MAAM,EAAK,EAAE,SAAS,KAAK,YAAY,CAAC,EAAE,EAAE,OAAO,EAAE,SAAS,YAAY,MAAM,EAAE,SAAS,KAAK,YAAY,CAAC,CAAE,CAAC,EAAU,EAAI,EAAE,eAAe,EAAU,EAAK,EAAE,IAAI,CAAE,EAAQ,EAAQ,SAAS,CAAC,GAAG,EAAU,MAAO,GAAG,CAAC,MAAM,EAAU,MAAM,CAAC,KAAK,EAAK,GAAG,EAAO,IAAI,EAAO,IAAI,IAAI,EAAQ,CAAC,CAAC,EAAE,MAAO,MAAS,CAAC,MAAO,CAAE,EAAO,SAAS,KAAK,gBAAgB,mBAAmB,EAAK,CAAC,CAAE,EAAQ,GAAQ,EAAI,EAAM,IAAuB,EAAK,SAAS,CAAS,UAAQ,i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