{"version":3,"file":"CopyEmailButton.BIFEXINK.mjs","names":["useState","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","navigator","window","_e","p","c","init_jsx_runtime","ce","init_framer_DxfB3JJo","addPropertyControls","ControlType","copyEmail","email","previousFocus","field","CopyEmailButton","feedback","setFeedback","timeout","handleClick","matchEyebrow","style","showLabel","neutral","showAddress","eyebrowClassName","eyebrowText","ink","hidden","init_CopyEmailButton"],"sources":["https:/framerusercontent.com/modules/STu6TE4fPo2SvHTSsGBW/Agl7Kkj9Jt8XxoWnZ1pc/CopyEmailButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const ink=\"var(--token-769b2b36-b762-451a-9ad9-f333c17dfad0, #1c1c1c)\";const neutral=\"var(--token-80a5c892-ed04-4b2e-a4af-83b00717f2e1, #545454)\";// OD / Eyebrow / Label (fDwIXT_O0). Framer emits these variables on Home.\n// Use the preset values as fallbacks in render targets without its stylesheet.\nconst eyebrowClassName=\"framer-styles-preset-pvb6s2\";const eyebrowText={color:\"inherit\",fontFamily:'var(--framer-font-family, \"Inter Display\", \"Inter Display Placeholder\", sans-serif)',fontFeatureSettings:'var(--framer-font-open-type-features, \"blwf\", \"cv03\", \"cv04\", \"cv09\", \"cv11\")',fontSize:\"var(--framer-font-size, 13px)\",fontStyle:\"var(--framer-font-style, normal)\",fontWeight:\"var(--framer-font-weight, 600)\",letterSpacing:\"var(--framer-letter-spacing, 0.08em)\",lineHeight:\"var(--framer-line-height, 140%)\",textTransform:\"var(--framer-text-transform, uppercase)\"};const hidden={position:\"absolute\",width:1,height:1,overflow:\"hidden\",clipPath:\"inset(50%)\",whiteSpace:\"nowrap\"};async function copyEmail(email){try{if(navigator.clipboard?.writeText){await navigator.clipboard.writeText(email);return;}}catch{// A preview frame can restrict the Clipboard API.\n}const previousFocus=document.activeElement;const field=document.createElement(\"textarea\");field.value=email;field.readOnly=true;Object.assign(field.style,{position:\"fixed\",top:\"0\",left:\"0\",opacity:\"0\",pointerEvents:\"none\",fontSize:\"16px\"});document.body.appendChild(field);try{field.focus({preventScroll:true});field.select();if(!document.execCommand(\"copy\"))throw new Error(\"Copy unavailable\");}finally{field.remove();if(previousFocus instanceof HTMLElement)previousFocus.focus({preventScroll:true});}}/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 328\n * @framerIntrinsicHeight 44\n */export default function CopyEmailButton({email=\"\",showAddress=true,showLabel=true,matchEyebrow=false,style}){const[feedback,setFeedback]=useState(null);useEffect(()=>{if(!feedback)return;const timeout=window.setTimeout(()=>setFeedback(null),2e3);return()=>window.clearTimeout(timeout);},[feedback]);async function handleClick(){try{await copyEmail(email);setFeedback({copied:true});}catch{setFeedback({copied:false});}}return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",flexWrap:\"wrap\",gap:\"0 6px\",position:\"relative\",color:matchEyebrow?\"#000\":undefined,fontFamily:'Onest, \"Onest Placeholder\", sans-serif',fontSize:\"1.05rem\",fontWeight:600,letterSpacing:\"-0.02em\",lineHeight:1.4,fontFeatureSettings:'\"blwf\", \"cv03\", \"cv04\", \"cv09\", \"cv11\"',whiteSpace:\"nowrap\",...style},children:[showLabel&&/*#__PURE__*/_jsx(\"span\",{style:{color:neutral},children:\"Let's chat!\"}),showAddress&&/*#__PURE__*/_jsxs(\"button\",{type:\"button\",onClick:handleClick,\"aria-label\":\"Copy email address \"+email,title:\"Copy email address\",className:matchEyebrow?eyebrowClassName:undefined,style:{display:\"inline-grid\",alignItems:\"center\",minHeight:44,border:0,padding:0,background:\"transparent\",cursor:\"pointer\",...matchEyebrow?eyebrowText:{color:ink,font:\"inherit\",fontFeatureSettings:\"inherit\",letterSpacing:\"inherit\"},textAlign:\"left\",whiteSpace:\"inherit\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{gridArea:\"1 / 1\",visibility:feedback?\"hidden\":undefined},children:email}),feedback&&/*#__PURE__*/_jsx(\"span\",{style:{gridArea:\"1 / 1\"},children:feedback.copied?\"Email copied!\":\"Try again\"})]}),/*#__PURE__*/_jsx(\"span\",{role:\"status\",style:hidden,children:feedback?feedback.copied?\"Email address copied.\":\"Could not copy the email address.\":\"\"})]});}addPropertyControls(CopyEmailButton,{email:{type:ControlType.String,title:\"Email\",defaultValue:\"\"},showLabel:{type:ControlType.Boolean,title:\"Show label\",defaultValue:true},matchEyebrow:{type:ControlType.Boolean,title:\"Eyebrow typography\",defaultValue:false},showAddress:{type:ControlType.Boolean,title:\"Show address\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CopyEmailButton\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"44\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"328\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CopyEmailButton.map"],"mappings":"A,6MAE0qB,eAAec,EAAU,EAAM,CAAC,GAAG,CAAC,GAAGV,EAAU,WAAW,UAAU,CAAC,MAAMA,EAAU,UAAU,UAAUW,CAAK,EAAE,MAAO,CAAC,MAAM,CAC1yB,CAAC,IAAMC,EAAc,SAAS,cAAoBC,EAAM,SAAS,cAAc,UAAU,EAAE,EAAM,MAAMF,EAAM,EAAM,SAAS,GAAK,OAAO,OAAOE,EAAM,MAAM,CAAC,SAAS,QAAQ,IAAI,IAAI,KAAK,IAAI,QAAQ,IAAI,cAAc,OAAO,SAAS,MAAM,CAAC,EAAE,SAAS,KAAK,YAAYA,CAAK,EAAE,GAAG,CAAkD,GAAjDA,EAAM,MAAM,CAAC,cAAc,EAAI,CAAC,EAAEA,EAAM,OAAO,EAAK,CAAC,SAAS,YAAY,MAAM,EAAE,MAAU,MAAM,kBAAkB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