{"version":3,"file":"Embed.B54lyHMl.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/LmXLDjMAE7f9Dlj3daRK/tHFzvy4P7NovlYsOVZLL/XK79Ok1lV.js","https:/framerusercontent.com/modules/o1PI5S8YtkA5bP5g4dFz/pVNq3gPwiiJPmLV2YSlc/Embed.js"],"sourcesContent":["// Generated by Framer (6ca5d98)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask='url(\\'data:image/svg+xml,<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 6.3 3.075 C 6.3 2.205 5.595 1.5 4.725 1.5 C 3.855 1.5 3.15 2.205 3.15 3.075 L 3.15 6.075 M 6.3 3.075 L 6.3 1.575 C 6.3 0.705 7.005 0 7.875 0 C 8.745 0 9.45 0.705 9.45 1.575 L 9.45 3.075 M 6.3 3.075 L 6.375 9 M 9.45 9.75 L 9.45 3.075 M 9.45 3.075 C 9.45 2.205 10.155 1.5 11.025 1.5 C 11.895 1.5 12.6 2.205 12.6 3.075 L 12.6 13.5 M 3.15 6.075 C 3.15 5.205 2.445 4.5 1.575 4.5 C 0.705 4.5 0 5.205 0 6.075 L 0 14.25 C 0 17.978 3.022 21 6.75 21 L 8.768 21 C 10.16 21 11.496 20.447 12.48 19.462 L 14.212 17.73 C 15.197 16.746 15.75 15.41 15.75 14.018 L 15.753 11.994 C 15.755 11.821 15.82 11.653 15.951 11.523 C 16.566 10.908 16.566 9.91 15.951 9.295 C 15.336 8.68 14.338 8.68 13.723 9.295 C 12.982 10.037 12.608 11.011 12.603 11.982 M 3.15 6.075 L 3.15 10.5 M 9.42 14.818 C 9.81 14.428 10.254 14.125 10.727 13.908 C 11.32 13.636 11.96 13.5 12.6 13.5 M 12.602 13.5 L 12.6 13.5\" fill=\"transparent\" height=\"21px\" id=\"eh8U7Zk7F\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" stroke=\"var(--szd5nr, black)\" transform=\"translate(3.75 1.5)\" width=\"16.412025px\"/></svg>\\') alpha no-repeat center / auto var(--framer-icon-mask-mode, add), var(--framer-icon-mask, none)';const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(motion.div,{...rest,layoutId:layoutId,ref:ref}):/*#__PURE__*/_jsx(\"div\",{...rest,ref:ref});});const getProps=({height,id,stroke,width,...props})=>{return{...props,YmfIrZ3Ez:stroke??props.YmfIrZ3Ez??\"rgb(0, 0, 0)\"};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,YmfIrZ3Ez,...restProps}=getProps(props);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-tx8kI\",className),layoutId:layoutId,ref:ref,style:{\"--szd5nr\":YmfIrZ3Ez,...style}});});const css=[`.framer-tx8kI { -webkit-mask: ${mask}; aspect-ratio: 1; background-color: var(--szd5nr); mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"YmfIrZ3Ez\":\"stroke\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Hand Raised\",\"color\":{\"type\":\"variable\",\"value\":\"szd5nr\"},\"set\":{\"localId\":\"vectorSet/kNBkgkDkJ\",\"id\":\"kNBkgkDkJ\",\"moduleId\":\"DyJDRQD0f0RPOu0ZYoEG\"}}\n * @framerDisableUnlink true\n */const Icon=withCSS(Component,css,\"framer-tx8kI\");Icon.displayName=\"Hand Raised\";export default Icon;addPropertyControls(Icon,{YmfIrZ3Ez:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Stroke\",type:ControlType.Color}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerVariables\":\"{\\\"YmfIrZ3Ez\\\":\\\"stroke\\\"}\",\"framerIntrinsicHeight\":\"24\",\"framerDisableUnlink\":\"true\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerImmutableVariables\":\"true\",\"framerVector\":\"{\\\"name\\\":\\\"Hand Raised\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"szd5nr\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/kNBkgkDkJ\\\",\\\"id\\\":\\\"kNBkgkDkJ\\\",\\\"moduleId\\\":\\\"DyJDRQD0f0RPOu0ZYoEG\\\"}}\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"24\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx,jsxs as _jsxs}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 fixed\n */ export default function Embed({type,url,html}){if(type===\"url\"&&url){return /*#__PURE__*/ _jsx(EmbedURL,{url:url});}if(type===\"html\"&&html){return /*#__PURE__*/ _jsx(EmbedHTML,{html:html});}return /*#__PURE__*/ _jsx(Instructions,{});};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\",displayTextArea:true,type:ControlType.String,hidden(props){return props.type!==\"html\";}}});function Instructions(){return /*#__PURE__*/ _jsx(\"div\",{style:{...emptyStateStyle,overflow:\"hidden\"},children:/*#__PURE__*/ _jsx(\"div\",{style:centerTextStyle,children:\"To embed a website or widget, add it to the properties\\xa0panel.\"})});}function EmbedURL({url}){// 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(!url.startsWith(\"https://\")){return /*#__PURE__*/ _jsx(ErrorMessage,{message:\"Unsupported protocol.\"});}if(state===undefined){return /*#__PURE__*/ _jsx(LoadingIndicator,{});}if(state instanceof Error){return /*#__PURE__*/ _jsx(ErrorMessage,{message:state.message});}if(state===true){const message=`Can't embed ${url} due to its content security policy.`;return /*#__PURE__*/ _jsx(ErrorMessage,{message:message});}return /*#__PURE__*/ _jsx(\"iframe\",{src:url,style:iframeStyle,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}){const ref=useRef();// If the HTML contains a script tag we can't use\n// dangerouslySetInnerHTML because it doesn't execute\n// scripts on the client. Otherwise, we can benefit\n// from SSG by using dangerouslySetInnerHTML.\nconst hasScript=html.includes(\"</script>\");useEffect(()=>{if(!hasScript)return;const div=ref.current;div.innerHTML=html;executeScripts(div);return()=>{div.innerHTML=\"\";};},[html,hasScript]);return /*#__PURE__*/ _jsx(\"div\",{ref:ref,style:htmlStyle,dangerouslySetInnerHTML:!hasScript?{__html:html}:undefined});}const htmlStyle={width:\"100%\",height:\"100%\",display:\"flex\",flexDirection:\"column\",justifyContent:\"center\",alignItems:\"center\"};// This function replaces scripts with executable ones.\n// https://stackoverflow.com/questions/1197575/can-scripts-be-inserted-with-innerhtml\nfunction executeScripts(node){if(node instanceof Element&&node.tagName===\"SCRIPT\"){const script=document.createElement(\"script\");script.text=node.innerHTML;for(const{name,value}of node.attributes){script.setAttribute(name,value);}node.parentElement.replaceChild(script,node);}else{for(const child of node.childNodes){executeScripts(child);}}}// 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}){return /*#__PURE__*/ _jsx(\"div\",{className:\"framerInternalUI-errorPlaceholder\",style:{...containerStyles,overflow:\"hidden\"},children:/*#__PURE__*/ _jsxs(\"div\",{style:centerTextStyle,children:[\"Error: \",message]})});}const centerTextStyle={textAlign:\"center\",minWidth:140};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Embed\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntr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