(window.webpackJsonp=window.webpackJsonp||[]).push([[50],{679:function(e,t,a){"use strict";a.r(t),a.d(t,"default",function(){returnj});vari,o,n,s=a(1),c=a(6),r=a(0),d=a(2),l=a(3),b=a.n(l),m=a(5),u=a.n(m),f=a(24),h=a(7),p=a(10),j=Object(h.g)((n=o=function(o){functione(){for(vart,e=arguments.length,a=newArray(e),i=0;i<e;i++)a[i]=arguments[i];returnt=o.call.apply(o,[this].concat(a))||this,Object(d.a)(Object(r.a)(Object(r.a)(t)),"state",{loading:!1,oembed:null}),Object(d.a)(Object(r.a)(Object(r.a)(t)),"setIframeRef",function(e){t.iframe=e}),Object(d.a)(Object(r.a)(Object(r.a)(t)),"handleTextareaClick",function(e){e.target.select()}),t}Object(c.a)(e,o);vart=e.prototype;returnt.componentDidMount=function(){vara=this,e=this.props.url;this.setState({loading:!0}),Object(p.a)().post("/api/web/embed",{url:e}).then(function(e){a.setState({loading:!1,oembed:e.data});vart=a.iframe.contentWindow.document;t.open(),t.write(e.data.html),t.close(),t.body.style.margin=0,a.iframe.width=t.body.scrollWidth,a.iframe.height=t.body.scrollHeight})},t.render=function(){vare=this.state.oembed;returnObject(s.a)("div",{className:"modal-root__modal embed-modal"},void0,Object(s.a)("h4",{},void0,Object(s.a)(h.b,{id:"status.embed",defaultMessage:"Embed"})),Object(s.a)("div",{className:"embed-modal__container"},void0,Object(s.a)("p",{className:"hint"},void0,Object(s.a)(h.b,{id:"embed.instructions",defaultMessage:"Embed this status on your website by copying the code below."})),Object(s.a)("input",{type:"text",className:"embed-modal__html",readOnly:!0,value:e&&e.html||"",onClick:this.handleTextareaClick}),Object(s.a)("p",{className:"hint"},void0,Object(s.a)(h.b,{id:"embed.preview",defaultMessage:"Here is what it will look like:"})),b.a.createElement("iframe",{className:"embed-modal__iframe",frameBorder:"0",ref:this.setIframeRef,sandbox:"allow-same-origin",title:"preview"})))},e}(f.a),Object(d.a)(o,"propTypes",{url:u.a.string.isRequired,onClose:u.a.func.isRequired,intl:u.a.object.isRequired}),i=n))||i}}]);