2020-05-20 05:55:14 +00:00
|
|
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[70],{1272:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return U}));var a,i,o,s=n(0),c=n(2),r=n(9),u=n(6),l=n(8),d=n(1),m=n(3),p=n.n(m),h=n(21),b=n(216),g=n.n(b),f=n(16),j=n.n(f),v=n(5),O=n.n(v),_=n(41),y=n(25),M=n(7),R=n(18),x=n(99),k=n.n(x),C=n(14),w=n.n(C),A=n(544),N=n(589),I=n(473),E=n.n(I),P=n(35),L=n.n(P);function q(e){return function(){var t,n=Object(u.a)(e);if(S()){var a=Object(u.a)(this).constructor;t=Reflect.construct(n,arguments,a)}else t=n.apply(this,arguments);return Object(r.a)(this,t)}}function S(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}var D=Object(M.f)({close:{id:"lightbox.close",defaultMessage:"Close"},previous:{id:"lightbox.previous",defaultMessage:"Previous"},next:{id:"lightbox.next",defaultMessage:"Next"}}),z=function(e){Object(l.a)(t,e);q(t);function t(){for(var t,n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return t=e.call.apply(e,[this].concat(a))||this,Object(d.a)(Object(c.a)(t),"setRef",(function(e){t.node=e})),Object(d.a)(Object(c.a)(t),"onMentionClick",(function(e,n){!t.context.router||0!==n.button||n.ctrlKey||n.metaKey||(n.preventDefault(),t.context.router.history.push("/accounts/"+e.get("id")))})),Object(d.a)(Object(c.a)(t),"onHashtagClick",(function(e,n){e=e.replace(/^#/,""),!t.context.router||0!==n.button||n.ctrlKey||n.metaKey||(n.preventDefault(),t.context.router.history.push("/timelines/tag/"+e))})),Object(d.a)(Object(c.a)(t),"onStatusClick",(function(e,n){!t.context.router||0!==n.button||n.ctrlKey||n.metaKey||(n.preventDefault(),t.context.router.history.push("/statuses/"+e.get("id")))})),Object(d.a)(Object(c.a)(t),"handleEmojiMouseEnter",(function(e){var t=e.target;t.src=t.getAttribute("data-original")})),Object(d.a)(Object(c.a)(t),"handleEmojiMouseLeave",(function(e){var t=e.target;t.src=t.getAttribute("data-static")})),t}var n=t.prototype;return n.componentDidMount=function(){this._updateLinks(),this._updateEmojis()},n.componentDidUpdate=function(){this._updateLinks(),this._updateEmojis()},n._updateEmojis=function(){var e=this.node;if(e&&!R.a)for(var t=e.querySelectorAll(".custom-emoji"),n=0;n<t.length;n++){var a=t[n];a.classList.contains("status-emoji")||(a.classList.add("status-emoji"),a.addEventListener("mouseenter",this.handleEmojiMouseEnter,!1),a.addEventListener("mouseleave",this.handleEmojiMouseLeave,!1))}},n._updateLinks=function(){var e=this,t=this.node;if(t)for(var n=t.querySelectorAll("a"),a=function(){var t=n[i];if(t.classList.contains("status-link"))return"continue";t.classList.add("status-link");var a=e.props.announcement.get("mentions").find((function(e){return t.href===e.get("url")}));if(a)t.addEventListener("click",e.onMentionClick.bind(e,a),!1),t.setAttribute("title",a.get("acct"));else if("#"===t.textContent[0]||t.previousSibling&&t.previousSibling.textContent&&"#"===t.previousSibling.textContent[t.previousSibling.textContent.length-1])t.addEventListener("click",e.onHashtagClick.bind(e,t.text),!1);else{var o=e.props.announcement.get("statuses").find((function(e){return t.href===e.get("url")}));o&&t.addEventListener("click",e.onStatusClick.bind(e,o),!1),t.setAttribute("title",t.href),t.classList.add("unhandled-link")}t.setAttribute("target","_blank"),t.setAttribute("rel","noopener noreferrer")},i=0;i<n.length;++i)a()},n.render=function(){var e=this.props.announcement;return(p.a.createElement("div",{className:"announcements__item__content",ref:this.setRef,dangerouslySetInnerHTML:{__html:e.get("contentHtml")}}))},t}(h.a);Object(d.a)(z,"contextTypes",{router:O.a.object}),Object(d.a)(z,"propTypes",{announcement:j.a.map.isRequired});var T=e.env.CDN_HOST||"",F=function(e){Object(l.a)(t,e);q(t);function t(){return e.apply(this,arguments)||this}return t.prototype.render=function(){var e=this.props,t=e.emoji,n=e.emojiMap,a=e.hovered;if(k.a[t]){var i=k.a[this.props.emoji],o=i.filename,c=i.shor
|