import{e as f,f as v,h as k,u as h,j as b,r as u,k as g,l as p,m as w,n as E}from"./nioDs7GF.js";const n=f({callbacks:[]}),y=s=>{E(()=>{if(document.getElementById("twitter-widgets-js"))n.callbacks.push(s);else{n.callbacks.push(s);var e=document.createElement("script");e.id="twitter-widgets-js",e.src="https://platform.twitter.com/widgets.js",e.onload=()=>n.callbacks.forEach(r=>r()),document.body.appendChild(e)}})},j={key:1,class:"notion-tweet-error"},B={name:"NotionTweet"},C=v({...B,props:{...k},setup(s){const e=s,{properties:r}=h(e),m=b(()=>{var t,o,a,d;return(d=(a=(o=(t=r.value)==null?void 0:t.source)==null?void 0:o[0])==null?void 0:a[0].split("status/"))==null?void 0:d[1].split("?")[0]}),c=u(),l=u(),i=()=>{var t;(t=window.twttr)==null||t.ready().then(({widgets:o})=>{o.createTweetEmbed(m.value,c.value,{}).then(a=>{l.value=a?void 0:"error"}).catch(a=>{l.value=a})})};return y(i),g(()=>{i()}),(t,o)=>l.value?(p(),w("div",j,"Error loading Tweet")):(p(),w("div",{key:0,class:"notion-tweet",ref_key:"el",ref:c},null,512))}});export{C as default};