{"version":3,"file":"Embed.CEAKdvxZ.mjs","names":["hash","useState","useRef"],"sources":["https:/framerusercontent.com/modules/dZ9c6z10n71dmz3JQVi4/0dSuyhnHD9HrUa3w2XFr/Arc.js","https:/framerusercontent.com/modules/o1PI5S8YtkA5bP5g4dFz/Mn69eMnaMcqJ65TjxwR1/Embed.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget,withCSS}from\"framer\";import hash from\"@emotion/hash\";function getAlignmentIcon(alignmentBaseline){switch(alignmentBaseline){case\"top\":return\"Text Top\";case\"center\":return\"Central\";case\"bottom\":return\"Hanging\";}}/**\n * ARC TEXT FOR INSERT\n * By Adam and Benjamin\n *\n * @framerIntrinsicWidth 150\n * @framerIntrinsicHeight 150\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */const Arc=withCSS(function Arc(props){// Checks\nconst isCanvas=RenderTarget.current()===RenderTarget.canvas;// For Ellipse\nconst isEllipse=!props.type;const cylinder=isEllipse?props.cylinderHeight/2:0;// Base arc path\nconst path=createPath(props.flip,cylinder);// Unique IDs to avoid multiple instances on the canvas sharing a single path\nconst id=`curve-${hash(path)}`;// Alignment icon conversion\nconst alignmentValue=getAlignmentIcon(props.alignmentBaseline);return /*#__PURE__*/_jsxs(\"svg\",{className:\"transform-origin-center-center\",style:{width:\"100%\",height:\"100%\",transformOrigin:\"center\"},viewBox:`0 0 100 100`,overflow:\"visible\",children:[/*#__PURE__*/_jsx(\"path\",{id:id,d:path,strokeWidth:\"none\",fill:\"transparent\"}),/*#__PURE__*/_jsx(\"text\",{children:/*#__PURE__*/_jsx(\"textPath\",{href:`#${id}`,startOffset:props.startOffset,dominantBaseline:alignmentValue,style:{letterSpacing:props.font.letterSpacing?props.font.letterSpacing:1.85,...props.font,fill:props.color},children:props.text})})]});},// Work around a bug with framer-motion that calculates a px origin when animating SVG elements.\n[\".transform-origin-center-center { transform-origin: center center !important; }\"]);export default Arc;Arc.defaultProps={height:50,width:50};addPropertyControls(Arc,{text:{title:\"Content\",type:ControlType.String,defaultValue:\"DESIGN SITES LIKE A PRO WITH FRAMER\",displayTextArea:true},type:{title:\"Type\",type:ControlType.Boolean,enabledTitle:\"Circle\",disabledTitle:\"Ellipse\",defaultValue:true},cylinderHeight:{title:\"Height\",type:ControlType.Number,min:0,max:1e3,displayStepper:true,hidden:props=>props.type},alignmentBaseline:{title:\"Align\",type:ControlType.Enum,options:[\"top\",\"center\",\"bottom\"],optionIcons:[\"align-top\",\"align-middle\",\"align-bottom\"],defaultValue:\"bottom\",displaySegmentedControl:true},flip:{type:ControlType.Boolean,defaultValue:false,title:\"Direction\",enabledTitle:\"CW\",disabledTitle:\"CCW\"},startOffset:{title:\"Offset\",type:ControlType.Number,defaultValue:0,max:360,unit:\"\\xb0\",step:.5},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",displayTextAlignment:false},color:{title:\"Color\",type:ControlType.Color,defaultValue:\"#999\"}});/* Path creation method */const createPath=(flip,cylinder)=>{const cylinderTop=50-cylinder;const cylinderBottom=50+cylinder;return!flip?`M 0 50 L 0 ${cylinderTop} A 1 1 0 0 1 100 ${cylinderTop} L 100 50 L 100 ${cylinderBottom} A 1 1 0 0 1 0 ${cylinderBottom} L 0 ${cylinderTop}`:`M 0 50 L 0 ${cylinderBottom} A 1 1 0 1 0 100 ${cylinderBottom} L 100 ${cylinderTop} A 1 1 0 1 0 0 ${cylinderTop} L 0 50`;};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Arc\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"*\",\"framerIntrinsicHeight\":\"150\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicWidth\":\"150\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Arc.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{useIsOnCanvas,emptyStateStyle,containerStyles}from\"https://framer.com/m/framer/default-utils.js\";/**\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 400\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n *\n * @framerDisableUnlink\n */export default function Embed({type,url,html,style={}}){if(type===\"url\"&&url){return /*#__PURE__*/_jsx(EmbedURL,{url:url,style:style});}if(type===\"html\"&&html){return /*#__PURE__*/_jsx(EmbedHTML,{html:html,style:style});}return /*#__PURE__*/_jsx(Instructions,{style:style});}addPropertyControls(Embed,{type:{type:ControlType.Enum,defaultValue:\"url\",displaySegmentedControl:true,options:[\"url\",\"html\"],optionTitles:[\"URL\",\"HTML\"]},url:{title:\"URL\",type:ControlType.String,description:\"Some websites don’t support embedding.\",hidden(props){return props.type!==\"url\";}},html:{title:\"HTML\",type:ControlType.String,displayTextArea:true,hidden(props){return props.type!==\"html\";}}});function Instructions({style}){return /*#__PURE__*/_jsx(\"div\",{style:{minHeight:getMinHeight(style),...emptyStateStyle,overflow:\"hidden\",...style},children:/*#__PURE__*/_jsx(\"div\",{style:centerTextStyle,children:\"To embed a website or widget, add it to the properties\\xa0panel.\"})});}function EmbedURL({url,style}){const hasAutoHeight=!style.height;// Add https:// if the URL does not have a protocol.\nif(!/[a-z]+:\\/\\//.test(url)){url=\"https://\"+url;}const onCanvas=useIsOnCanvas();// We need to check if the url is blocked inside an iframe by the X-Frame-Options\n// or Content-Security-Policy headers on the backend.\nconst[state,setState]=useState(onCanvas?undefined:false);useEffect(()=>{// We only want to check on the canvas.\n// On the website we want to avoid the additional delay.\nif(!onCanvas)return;// TODO: We could also use AbortController here.\nlet isLastEffect=true;setState(undefined);async function load(){const response=await fetch(\"https://api.framer.com/functions/check-iframe-url?url=\"+encodeURIComponent(url));if(response.status==200){const{isBlocked}=await response.json();if(isLastEffect){setState(isBlocked);}}else{const message=await response.text();console.error(message);const error=new Error(\"This site can’t be reached.\");setState(error);}}load().catch(error=>{console.error(error);setState(error);});return()=>{isLastEffect=false;};},[url]);if(onCanvas&&hasAutoHeight){return /*#__PURE__*/_jsx(ErrorMessage,{message:\"URL embeds do not support auto height.\",style:style});}if(!url.startsWith(\"https://\")){return /*#__PURE__*/_jsx(ErrorMessage,{message:\"Unsupported protocol.\",style:style});}if(state===undefined){return /*#__PURE__*/_jsx(LoadingIndicator,{});}if(state instanceof Error){return /*#__PURE__*/_jsx(ErrorMessage,{message:state.message,style:style});}if(state===true){const message=`Can’t embed ${url} due to its content security policy.`;return /*#__PURE__*/_jsx(ErrorMessage,{message:message,style:style});}return /*#__PURE__*/_jsx(\"iframe\",{src:url,style:{...iframeStyle,...style},loading:\"lazy\",// @ts-ignore\nfetchPriority:onCanvas?\"low\":\"auto\",referrerPolicy:\"no-referrer\",sandbox:getSandbox(onCanvas)});}const iframeStyle={width:\"100%\",height:\"100%\",border:\"none\"};function getSandbox(onCanvas){const result=[\"allow-same-origin\",\"allow-scripts\"];if(!onCanvas){result.push(\"allow-downloads\",\"allow-forms\",\"allow-modals\",\"allow-orientation-lock\",\"allow-pointer-lock\",\"allow-popups\",\"allow-popups-to-escape-sandbox\",\"allow-presentation\",\"allow-storage-access-by-user-activation\",\"allow-top-navigation-by-user-activation\");}return result.join(\" \");}function EmbedHTML({html,style}){const ref=useRef();const onCanvas=useIsOnCanvas();const[iframeHeight,setIframeHeight]=useState(0);const hasAutoHeight=!style.height;const hasScript=html.includes(\"</script>\");useEffect(()=>{var _ref_current;const iframeWindow=(_ref_current=ref.current)===null||_ref_current===void 0?void 0:_ref_current.contentWindow;function handleMessage(event){if(event.source!==iframeWindow)return;const data=event.data;if(typeof data!==\"object\"||data===null)return;const height=data.embedHeight;if(typeof height!==\"number\")return;setIframeHeight(height);}window.addEventListener(\"message\",handleMessage);// After SSG the iframe loads before we attach the event handler,\n// therefore we need to request the latest height from the iframe.\niframeWindow===null||iframeWindow===void 0?void 0:iframeWindow.postMessage(\"getEmbedHeight\",\"*\");return()=>{window.removeEventListener(\"message\",handleMessage);};},[]);if(hasScript){const srcDoc=`<html>\n    <head>\n        <style>body { margin: 0; }</style>\n    </head>\n    <body>\n        ${html}\n        <script type=\"module\">\n            let height = 0\n\n            function sendEmbedHeight() {\n                window.parent.postMessage({\n                    embedHeight: height\n                }, \"*\")\n            }\n\n            const observer = new ResizeObserver((entries) => {\n                if (entries.length !== 1) return\n                const entry = entries[0]\n                if (entry.target !== document.body) return\n\n                height = entry.contentRect.height\n                sendEmbedHeight()\n            })\n\n            observer.observe(document.body)\n\n            window.addEventListener(\"message\", (event) => {\n                if (event.source !== window.parent) return\n                if (event.data !== \"getEmbedHeight\") return\n                sendEmbedHeight()\n            })\n        </script>\n    <body>\n</html>`;const currentStyle={...iframeStyle,...style};if(hasAutoHeight){currentStyle.height=iframeHeight+\"px\";}return /*#__PURE__*/_jsx(\"iframe\",{ref:ref,style:currentStyle,srcDoc:srcDoc});}return /*#__PURE__*/_jsx(\"div\",{style:{...htmlStyle,...style},dangerouslySetInnerHTML:{__html:html}});}const htmlStyle={width:\"100%\",height:\"100%\",display:\"flex\",flexDirection:\"column\",justifyContent:\"center\",alignItems:\"center\"};// Generic components\nfunction LoadingIndicator(){return /*#__PURE__*/_jsx(\"div\",{className:\"framerInternalUI-componentPlaceholder\",style:{...containerStyles,overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"div\",{style:centerTextStyle,children:\"Loading…\"})});}function ErrorMessage({message,style}){return /*#__PURE__*/_jsx(\"div\",{className:\"framerInternalUI-errorPlaceholder\",style:{minHeight:getMinHeight(style),...containerStyles,overflow:\"hidden\",...style},children:/*#__PURE__*/_jsx(\"div\",{style:centerTextStyle,children:message})});}const centerTextStyle={textAlign:\"center\",minWidth:140};// Returns a min-height if the component is using auto-height.\nfunction getMinHeight(style){const hasAutoHeight=!style.height;if(hasAutoHeight)return 200;}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Embed\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"600\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicHeight\":\"400\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Embed.map"],"mappings":"+XAAkK,SAAS,EAAiB,EAAkB,CAAC,OAAO,EAAP,CAA0B,IAAI,MAAM,MAAM,WAAW,IAAI,SAAS,MAAM,UAAU,IAAI,SAAS,MAAM,SAAU,CAAC,qBAAvQ,IAAyE,IAAgC,EAUxJ,EAAI,EAAQ,SAAa,EAAM,CACzB,EAAa,QAAQ,EAAI,EAAa,OACzB,IAAM,EAAjB,EAAM,KAAqD,EAAvB,EAAM,eAAe,EACpE,EAAK,EAAW,EAAM,KAAK,CAAQ,EACnC,EAAG,SAASA,EAAK,CAAI,IACrB,EAAe,EAAiB,EAAM,iBAAiB,EAAE,OAAoB,EAAM,MAAM,CAAC,UAAU,iCAAiC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,gBAAgB,QAAQ,EAAE,QAAQ,cAAc,SAAS,UAAU,SAAS,CAAc,EAAK,OAAO,CAAI,KAAG,EAAE,EAAK,YAAY,OAAO,KAAK,aAAa,CAAC,EAAe,EAAK,OAAO,CAAC,SAAsB,EAAK,WAAW,CAAC,KAAK,IAAI,IAAK,YAAY,EAAM,YAAY,iBAAiB,EAAe,MAAM,CAAC,cAAc,EAAM,KAAK,cAAc,EAAM,KAAK,cAAc,KAAK,GAAG,EAAM,KAAK,KAAK,EAAM,KAAK,EAAE,SAAS,EAAM,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,EAC7lB,CAAC,iFAAiF,CAAC,EAAqB,EAAI,aAAa,CAAC,OAAO,GAAG,MAAM,EAAE,EAA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