{"version":3,"file":"ShareButton.DLbVF70F.mjs","names":["useState","startTransition"],"sources":["https:/framerusercontent.com/modules/n499JLXlb4FooyOIEPQ8/pTUbVgBTYKp5zSZFDl2y/ShareButton.js"],"sourcesContent":["// Share Button that shares the current webpage link\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,startTransition}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";function isFramerPreviewUrl(urlString){try{const parsed=new URL(urlString);const host=parsed.hostname.toLowerCase();const pathname=parsed.pathname.toLowerCase();const hasPreviewParam=parsed.searchParams.has(\"experiment\")||parsed.searchParams.has(\"siteId\");// framer.com is the editor (it shows up as document.referrer in preview), never a public page URL\nconst isFramerEditorHost=host===\"framer.com\"||host.endsWith(\".framer.com\");return isFramerEditorHost||host.includes(\"framercanvas.com\")||pathname.includes(\"preview-module\")||hasPreviewParam;}catch{return true;}}function sanitizePublicUrl(urlString){try{const parsed=new URL(urlString);if(!/^https?:$/i.test(parsed.protocol))return\"\";parsed.hash=\"\";parsed.searchParams.delete(\"experiment\");parsed.searchParams.delete(\"siteId\");parsed.searchParams.delete(\"mode\");return parsed.toString();}catch{return\"\";}}function resolveCleanPageUrl(explicitUrl){const explicitTrimmed=explicitUrl?.trim();if(explicitTrimmed){return sanitizePublicUrl(explicitTrimmed);}if(typeof window===\"undefined\")return\"\";const currentUrl=window.location.href;const currentIsPreview=isFramerPreviewUrl(currentUrl);if(!currentIsPreview){return sanitizePublicUrl(currentUrl);}if(typeof document!==\"undefined\"){const referrer=document.referrer;if(referrer&&!isFramerPreviewUrl(referrer)){return sanitizePublicUrl(referrer);}}return\"\";}/**\n * Share Button\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function ShareButton(props){const{label,icon,url,iconOnly,background,color,borderRadius,font,style}=props;const[copied,setCopied]=useState(false);function handleShare(){if(typeof window===\"undefined\")return;const resolvedUrl=resolveCleanPageUrl(url);const fallbackText=label||\"Share\";const textToCopy=resolvedUrl||fallbackText;if(navigator.share){const shareData=resolvedUrl?{url:resolvedUrl}:{text:fallbackText};navigator.share(shareData).catch(()=>{});}else if(navigator.clipboard){navigator.clipboard.writeText(textToCopy).then(()=>{startTransition(()=>setCopied(true));setTimeout(()=>startTransition(()=>setCopied(false)),1200);});}else{// fallback\nconst input=document.createElement(\"input\");input.value=textToCopy;document.body.appendChild(input);input.select();document.execCommand(\"copy\");document.body.removeChild(input);startTransition(()=>setCopied(true));setTimeout(()=>startTransition(()=>setCopied(false)),1200);}}if(RenderTarget.current()===RenderTarget.thumbnail)return null;return /*#__PURE__*/_jsxs(\"button\",{type:\"button\",\"data-share-button\":\"2026-10-01-no-framer-referrer\",\"aria-label\":\"Share this page\",onClick:handleShare,style:{...style,display:\"flex\",alignItems:\"center\",gap:iconOnly?0:10,background,color,border:\"none\",borderRadius,padding:\"12px 24px\",cursor:\"pointer\",boxShadow:\"0 2px 8px rgba(0,0,0,0.06)\",transition:\"background 0.15s, color 0.15s\",width:\"100%\",height:\"100%\",justifyContent:\"center\",...font},children:[(iconOnly||icon)&&/*#__PURE__*/_jsx(\"svg\",{width:\"19\",height:\"19\",viewBox:\"0 0 24 24\",\"aria-hidden\":\"true\",focusable:\"false\",children:/*#__PURE__*/_jsx(\"path\",{fill:\"currentColor\",d:\"M16 3a3 3 0 0 0-2.83 4.01l-4.9 2.45a3 3 0 1 0 0 5.08l4.9 2.45A3 3 0 1 0 14 15.5l-4.9-2.45a3 3 0 0 0 0-2.1L14 8.5A3 3 0 1 0 16 3Zm0 2a1 1 0 1 1 0 2 1 1 0 0 1 0-2ZM6 11a1 1 0 1 1 0 2 1 1 0 0 1 0-2Zm10 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z\"})}),!iconOnly&&/*#__PURE__*/_jsx(\"span\",{style:{fontWeight:600},children:copied?\"Copied!\":label})]});}addPropertyControls(ShareButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Share\"},icon:{type:ControlType.String,title:\"Icon\",defaultValue:\"🔗\",placeholder:\"Emoji or leave blank\"},url:{type:ControlType.String,title:\"Page URL\",defaultValue:\"\"},iconOnly:{type:ControlType.Boolean,title:\"Icon Only\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#111\"},color:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#fff\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:32},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"16px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ShareButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ShareButton.map"],"mappings":"gNACsK,SAAS,EAAmB,EAAU,CAAC,GAAG,CAAC,IAAM,EAAO,IAAI,IAAI,CAAS,EAAQ,EAAK,EAAO,SAAS,YAAY,EAAQ,EAAS,EAAO,SAAS,YAAY,EAAQ,EAAgB,EAAO,aAAa,IAAI,YAAY,GAAG,EAAO,aAAa,IAAI,QAAQ,EACzV,OAAlD,IAAO,cAAc,EAAK,SAAS,aAAa,GAA6B,EAAK,SAAS,kBAAkB,GAAG,EAAS,SAAS,gBAAgB,GAAG,CAAgB,MAAM,CAAC,MAAO,EAAK,CAAC,CAAC,SAAS,EAAkB,EAAU,CAAC,GAAG,CAAC,IAAM,EAAO,IAAI,IAAI,CAAS,EAAkL,MAA5K,aAAa,KAAK,EAAO,QAAQ,GAAW,EAAO,KAAK,GAAG,EAAO,aAAa,OAAO,YAAY,EAAE,EAAO,aAAa,OAAO,QAAQ,EAAE,EAAO,aAAa,OAAO,MAAM,EAAS,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