{"version":3,"file":"ShareButton.Be3H9kfB.mjs","names":["useState","useRef","_Fragment","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","navigator","window","l","_e","p","init_jsx_runtime","ce","de","init_framer_BWFVvmND","addPropertyControls","ControlType","init_Guard","Guard","ShareButtonView","props","copied","setCopied","timer","share","url","path","name","title","text","error","field","colour","tone","CSS","style","ShareButton","init_ShareButton"],"sources":["https:/framerusercontent.com/modules/TsqTtfCWGLfYBC4vhh23/yjnoL4q11gwOd4vb60u8/ShareButton.js"],"sourcesContent":["// Share this page, matching the code site (886fd6d, app/components/ShareButton.tsx). On phones and tablets\n// (coarse pointer) it opens the device's own share sheet (Web Share API); on desktops it copies the page address\n// and says so (\"Link Copied\", 2.4s). Shares the title, an optional text, and the page address (with an optional #section).\n// A plain underlined text control with a drawn 16px share glyph; ink on light rooms, white on dark ones. Never inside a link.\n// The Glass Pill option is kept for existing instances but no longer draws a pill (code site 886fd6d: no pill anywhere).\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import Guard from\"https://framerusercontent.com/modules/rvuFbMafTttccjUqdUzc/VswQA1U1IG50gpxXB5lQ/Guard.js\";const CSS=`\n.hosh-share { appearance: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; border: 0; border-radius: 8px; background: none; cursor: pointer; font: 600 14px/1 'Figtree', Arial, sans-serif; letter-spacing: .01em; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .35em; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); touch-action: manipulation; -webkit-tap-highlight-color: transparent; white-space: nowrap; }\n.hosh-share-glyph { flex: none; width: 16px; height: 16px; transition: transform .3s cubic-bezier(.2, .7, .2, 1); }\n.hosh-share:is(:hover, :focus-visible) .hosh-share-glyph { transform: translateY(-2px); }\n@media (prefers-reduced-motion: reduce) { .hosh-share-glyph { transition: none; } }\n.hosh-share:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }\n.hosh-share-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }\n`;/**\n * @framerIntrinsicWidth 90\n * @framerIntrinsicHeight 44\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */function ShareButtonView(props){const{title=\"\",text=\"\",path=\"\",tone=\"light\",style}=props;const[copied,setCopied]=useState(false);const timer=useRef(undefined);useEffect(()=>()=>window.clearTimeout(timer.current),[]);const share=async()=>{const url=new URL(path||window.location.pathname,window.location.origin).href;const name=title||document.title;const touch=window.matchMedia(\"(pointer: coarse)\").matches;if(touch&&typeof navigator.share===\"function\"){try{await navigator.share(text?{title:name,text,url}:{title:name,url});return;}catch(error){if(error?.name===\"AbortError\")return;}}try{await navigator.clipboard.writeText(url);}catch{const field=document.createElement(\"textarea\");field.value=url;field.setAttribute(\"readonly\",\"\");field.style.position=\"fixed\";field.style.opacity=\"0\";document.body.append(field);field.select();document.execCommand(\"copy\");field.remove();}setCopied(true);window.clearTimeout(timer.current);timer.current=window.setTimeout(()=>setCopied(false),2400);};const colour=tone===\"dark\"?\"#ffffff\":\"#1d1a17\";return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:CSS}}),/*#__PURE__*/_jsxs(\"button\",{type:\"button\",className:\"hosh-share\",onClick:share,\"aria-label\":`Share: ${title||\"this page\"}`,style:{color:colour,...style},children:[/*#__PURE__*/_jsx(\"span\",{className:\"hosh-share-label\",children:copied?\"Link Copied\":\"Share\"}),/*#__PURE__*/_jsx(\"svg\",{className:\"hosh-share-glyph\",viewBox:\"0 0 16 16\",width:\"16\",height:\"16\",\"aria-hidden\":\"true\",focusable:\"false\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M8 10V1.5M4.75 4.5 8 1.25l3.25 3.25M5.5 6.5H3.75v8h8.5v-8H10.5\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1.25\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})}),/*#__PURE__*/_jsx(\"span\",{className:\"hosh-share-live\",\"aria-live\":\"polite\",children:copied?\"Link copied to clipboard\":\"\"})]})]});}addPropertyControls(ShareButton,{title:{type:ControlType.String,title:\"Title\",defaultValue:\"\"},text:{type:ControlType.String,title:\"Text\",defaultValue:\"\",displayTextArea:true},path:{type:ControlType.String,title:\"Path\",defaultValue:\"\",placeholder:\"/impact#synergos\"},tone:{type:ControlType.Enum,title:\"Tone\",options:[\"light\",\"dark\"],optionTitles:[\"Light Room\",\"Dark Room\"],defaultValue:\"light\"},glass:{type:ControlType.Boolean,title:\"Glass Pill (Retired)\",defaultValue:false}});ShareButton.displayName=\"Share Button\";// Error boundary (phase E): the component renders inside Guard, which logs a failure and keeps a static placeholder.\n/**\n * @framerIntrinsicWidth 90\n * @framerIntrinsicHeight 44\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function ShareButton(props){return /*#__PURE__*/_jsx(Guard,{name:\"ShareButton\",style:props?.style,children:/*#__PURE__*/_jsx(ShareButtonView,{...props})});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ShareButton\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"44\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"90\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ShareButton.map"],"mappings":"A,gRAkBG,SAASmB,EAAgB,EAAM,CAAC,GAAK,CAAC,QAAM,GAAG,OAAK,GAAG,OAAK,GAAG,OAAK,QAAQ,SAAOC,EAAW,CAACC,EAAOC,GAAWtB,EAAS,EAAK,EAAQuB,EAAMtB,EAAO,IAAA,EAAS,EAAEW,UAAkBL,EAAO,aAAagB,EA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