import{t as e}from"./rolldown-runtime.CMAw1HyY.mjs";import{B as t,F as n,N as r,O as i,R as a,l as o,s,w as c}from"./react.D3LpXLeJ.mjs";import{Y as l,a as u,k as d}from"./framer.B9eBDazG.mjs";import{h as f,o as p,p as m}from"./OIjZRBmWDcIE2B6qgG1j.C7ytnr-7.mjs";import{t as h}from"./default-utils.fANXn9xb.mjs";function g({type:e,url:t,html:n,zoom:r=1,radius:i=0,border:a={width:0,color:`rgba(200,200,200,0.5)`},style:s={}}){return e===`url`&&t?o(v,{url:t,zoom:r,radius:i,border:a,style:s}):e===`html`&&n?o(b,{html:n,style:s}):o(_,{style:s})}function _({style:e}){return o(`div`,{style:{minHeight:D(e),...f,overflow:`hidden`,...e},children:o(`div`,{style:A,children:`To embed a website or widget, add it to the properties\xA0panel.`})})}function v({url:e,zoom:t,radius:i,border:a,style:s}){let c=!s.height;/[a-z]+:\/\//.test(e)||(e=`https://`+e);let l=p(),[u,d]=n(l?void 0:!1);return r(()=>{if(!l)return;let t=!0;d(void 0);async function n(){let n=await fetch(`https://api.framer.com/functions/check-iframe-url?url=`+encodeURIComponent(e));if(n.status==200){let{isBlocked:e}=await n.json();t&&d(e)}else{let e=await n.text();console.error(e),d(Error(`This site can’t be reached.`))}}return n().catch(e=>{console.error(e),d(e)}),()=>{t=!1}},[e]),l&&c?o(E,{message:`URL embeds do not support auto height.`,style:s}):e.startsWith(`https://`)?u===void 0?o(T,{}):u instanceof Error?o(E,{message:u.message,style:s}):u===!0?o(E,{message:`Can’t embed ${e} due to its content security policy.`,style:s}):o(`iframe`,{src:e,style:{...O,...s,zoom:t,borderRadius:i,border:`${a.width}px solid ${a.color}`,transformOrigin:`top center`},loading:`lazy`,fetchPriority:l?`low`:`auto`,referrerPolicy:`no-referrer`,sandbox:y(l)}):o(E,{message:`Unsupported protocol.`,style:s})}function y(e){let t=[`allow-same-origin`,`allow-scripts`];return e||t.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`),t.join(` `)}function b({html:e,...t}){if(e.includes(`<\/script>`)){let n=e.includes(``),r=e.includes(``);return o(n||r?S:x,{html:e,...t})}return o(C,{html:e,...t})}function x({html:e,style:a}){let s=i(),[c,l]=n(0);r(()=>{let e=s.current?.contentWindow;function n(t){if(t.source!==e)return;let n=t.data;if(typeof n!=`object`||!n)return;let r=n.embedHeight;typeof r==`number`&&l(r)}return t.addEventListener(`message`,n),e?.postMessage(`getEmbedHeight`,`*`),()=>{t.removeEventListener(`message`,n)}},[]);let u=`
${e}