(window.webpackJsonp=window.webpackJsonp||[]).push([[85],{783:function(e,t,a){"use strict";a.d(t,"a",(function(){return S}));var s=a(0),n=a(10),i=a(2),o=(a(9),a(6),a(8)),c=a(1),l=a(3),r=a.n(l),d=a(5),u=a.n(d),p=a(16),h=a.n(p),b=a(96),g=a(98),f=a(155),m=a(474),O=a(265),j=a(322),v=a(7),k=a(475),M=a(21),y=a(87),_=a(227),C=a(541),x=a(772),I=a(14),w=a.n(I),R=a(543),D=a(25),H=a(589);var S=function(e){Object(o.a)(a,e);var t;t=a;function a(){for(var t,a=arguments.length,s=new Array(a),o=0;o0)if(e.get("media_attachments").some((function(e){return"unknown"===e.get("type")})))l=Object(s.a)(O.a,{media:e.get("media_attachments")});else if("audio"===e.getIn(["media_attachments",0,"type"])){var x=e.getIn(["media_attachments",0]);l=Object(s.a)(_.default,{src:x.get("url"),alt:x.get("description"),duration:x.getIn(["meta","original","duration"],0),height:110,preload:!0}),d="music"}else if("video"===e.getIn(["media_attachments",0,"type"])){var I=e.getIn(["media_attachments",0]);l=Object(s.a)(y.default,{preview:I.get("preview_url"),blurhash:I.get("blurhash"),src:I.get("url"),alt:I.get("description"),inline:!0,sensitive:e.get("sensitive"),letterbox:i.getIn(["media","letterbox"]),fullwidth:i.getIn(["media","fullwidth"]),preventPlayback:!a,onOpenVideo:this.handleOpenVideo,autoplay:!0,visible:this.props.showMedia,onToggleVisibility:this.props.onToggleMediaVisibility}),d="video-camera"}else l=Object(s.a)(m.default,{standalone:!0,sensitive:e.get("sensitive"),media:e.get("media_attachments"),letterbox:i.getIn(["media","letterbox"]),fullwidth:i.getIn(["media","fullwidth"]),hidden:!a,onOpenMedia:this.props.onOpenMedia,visible:this.props.showMedia,onToggleVisibility:this.props.onToggleMediaVisibility}),d="picture-o";else e.get("card")&&(l=Object(s.a)(k.a,{onOpenMedia:this.props.onOpenMedia,card:e.get("card")}),d="link");return e.get("application")&&(u=Object(s.a)("span",{},void 0," · ",Object(s.a)("a",{className:"detailed-status__application",href:e.getIn(["application","website"]),target:"_blank",rel:"noopener noreferrer"},void 0,e.getIn(["application","name"])))),"direct"===e.get("visibility")?h="envelope":"private"===e.get("visibility")&&(h="lock"),p=["unlisted","public"].includes(e.get("visibility"))?this.context.router?Object(s.a)(j.a,{to:"/statuses/"+e.get("id")+"/reblogs",className:"detailed-status__link"},void 0,Object(s.a)(D.a,{id:h}),Object(s.a)("span",{className:"detailed-status__reblogs"},void 0,Object(s.a)(H.a,{value:e.get("reblogs_count")}))):Object(s.a)("a",{href:"/interact/"+e.get("id")+"?type=reblog",className:"detailed-status__link",onClick:this.handleModalLink},void 0,Object(s.a)(D.a,{id:h}),Object(s.a)("span",{className:"detailed-status__reblogs"},void 0,Object(s.a)(H.a,{value:e.get("reblogs_count")}))):null,M=this.context.router?Object(s.a)(j.a,{to:"/statuses/"+e.get("id")+"/favourites",className:"detailed-status__link"},void 0,Object(s.a)(D.a,{id:"star"}),Object(s.a)("span",{className:"detailed-status__favorites"},void 0,Object(s.a)(H.a,{value:e.get("favourites_count")}))):Object(s.a)("a",{href:"/interact/"+e.get("id")+"?type=favourite",className:"detailed-status__link",onClick:this.handleModalLink},void 0,Object(s.a)(D.a,{id:"star"}),Object(s.a)("span",{className:"detailed-status__favorites"},void 0,Object(s.a)(H.a,{value:e.get("favourites_count")}))),Object(s.a)("div",{style:o},void 0,r.a.createElement("div",{ref:this.setRef,className:w()("detailed-status",{compact:c}),"data-status-by":e.getIn(["account","acct"])},Object(s.a)("a",{href:e.getIn(["account","url"]),onClick:this.handleAccountClick,className:"detailed-status__display-name"},void 0,Object(s.a)("div",{className:"detailed-status__display-avatar"},void 0,Object(s.a)(b.a,{account:e.get("account"),size:48})),Object(s.a)(g.a,{account:e.get("account"),localDomain:this.props.domain})),Object(s.a)(f.a,{status:e,media:l,mediaIcon:d,expanded:a,collapsed:!1,onExpandedToggle:n,parseClick:this.parseClick,onUpdate:this.handleChildUpdate,tagLinks:i.get("tag_misleading_links"),rewriteMentions:i.get("rewrite_mentions"),disabled:!0}),Object(s.a)("div",{className:"detailed-status__meta"},void 0,Object(s.a)("a",{className:"detailed-status__datetime",href:e.get("url"),target:"_blank",rel:"noopener noreferrer"},void 0,Object(s.a)(v.a,{value:new Date(e.get("created_at")),hour12:!1,year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"})),u," ",!!p&&["·",p]," · ",M," · ",Object(s.a)(C.a,{visibility:e.get("visibility")}))))},a}(M.a);Object(c.a)(S,"contextTypes",{router:u.a.object}),Object(c.a)(S,"propTypes",{status:h.a.map,settings:h.a.map.isRequired,onOpenMedia:u.a.func.isRequired,onOpenVideo:u.a.func.isRequired,onToggleHidden:u.a.func,expanded:u.a.bool,measureHeight:u.a.bool,onHeightChange:u.a.func,domain:u.a.string.isRequired,compact:u.a.bool,showMedia:u.a.bool,onToggleMediaVisibility:u.a.func})},858:function(e,t,a){"use strict";a.r(t),a.d(t,"default",(function(){return se}));var s,n,i,o=a(0),c=a(10),l=a(2),r=(a(9),a(6),a(8)),d=a(1),u=a(4),p=a.n(u),h=a(3),b=a.n(h),g=a(15),f=a(5),m=a.n(f),O=a(14),j=a.n(O),v=a(16),k=a.n(v),M=a(57),y=a(117),_=a(1056),C=a(783),x=a(41),I=a(767),w=a(7),R=a(18),D=a(150);var H,S,T,B,E=Object(w.f)({delete:{id:"status.delete",defaultMessage:"Delete"},redraft:{id:"status.redraft",defaultMessage:"Delete & re-draft"},direct:{id:"status.direct",defaultMessage:"Direct message @{name}"},mention:{id:"status.mention",defaultMessage:"Mention @{name}"},reply:{id:"status.reply",defaultMessage:"Reply"},reblog:{id:"status.reblog",defaultMessage:"Boost"},reblog_private:{id:"status.reblog_private",defaultMessage:"Boost to original audience"},cannot_reblog:{id:"status.cannot_reblog",defaultMessage:"This post cannot be boosted"},favourite:{id:"status.favourite",defaultMessage:"Favourite"},bookmark:{id:"status.bookmark",defaultMessage:"Bookmark"},more:{id:"status.more",defaultMessage:"More"},mute:{id:"status.mute",defaultMessage:"Mute @{name}"},muteConversation:{id:"status.mute_conversation",defaultMessage:"Mute conversation"},unmuteConversation:{id:"status.unmute_conversation",defaultMessage:"Unmute conversation"},block:{id:"status.block",defaultMessage:"Block @{name}"},report:{id:"status.report",defaultMessage:"Report @{name}"},share:{id:"status.share",defaultMessage:"Share"},pin:{id:"status.pin",defaultMessage:"Pin on profile"},unpin:{id:"status.unpin",defaultMessage:"Unpin from profile"},embed:{id:"status.embed",defaultMessage:"Embed"},admin_account:{id:"status.admin_account",defaultMessage:"Open moderation interface for @{name}"},admin_status:{id:"status.admin_status",defaultMessage:"Open this status in the moderation interface"},copy:{id:"status.copy",defaultMessage:"Copy link to status"}}),N=Object(w.g)((i=n=function(e){Object(r.a)(a,e);var t;t=a;function a(){for(var t,a=arguments.length,s=new Array(a),n=0;n0;){var i=n.shift(),o=t.get(i);e!==i&&s.push(i),o&&o.reverse().forEach((function(e){n.unshift(e)}))}var c=s.findIndex((function(e){return a.get(e).get("in_reply_to_account_id")!==a.get(e).get("account")}));return-1!==c&&s.forEach((function(e,t){t>c&&a.get(e).get("in_reply_to_account_id")===a.get(e).get("account")&&(s.splice(t,1),s.splice(c,0,e),c+=1)})),p.a.List(s)}));return function(s,n){var i=e(s,{id:n.params.statusId}),o=p.a.List(),c=p.a.List();return i&&(o=t(s,{id:i.get("in_reply_to_id")}),c=a(s,{id:i.get("id")})),{status:i,ancestorsIds:o,descendantsIds:c,settings:s.get("local_settings"),askReplyConfirmation:s.getIn(["local_settings","confirm_before_clearing_draft"])&&0!==s.getIn(["compose","text"]).trim().length,domain:s.getIn(["meta","domain"])}}})),Object(w.g)(S=H((B=T=function(e){Object(r.a)(a,e);var t;t=a;function a(){for(var t,a=arguments.length,s=new Array(a),n=0;n0&&("audio"===a.getIn(["media_attachments",0,"type"])||("video"===a.getIn(["media_attachments",0,"type"])?t.handleOpenVideo(a.getIn(["media_attachments",0]),0):t.handleOpenMedia(a.get("media_attachments"),0)))})),Object(d.a)(Object(l.a)(t),"handleMuteClick",(function(e){t.props.dispatch(Object(z.g)(e))})),Object(d.a)(Object(l.a)(t),"handleConversationMuteClick",(function(e){e.get("muted")?t.props.dispatch(Object(y.j)(e.get("id"))):t.props.dispatch(Object(y.h)(e.get("id")))})),Object(d.a)(Object(l.a)(t),"handleToggleAll",(function(){var e=t.state.isExpanded;t.setState({isExpanded:!e,threadExpanded:!e})})),Object(d.a)(Object(l.a)(t),"handleBlockClick",(function(e){var a=t.props.dispatch,s=e.get("account");a(Object(P.f)(s))})),Object(d.a)(Object(l.a)(t),"handleReport",(function(e){t.props.dispatch(Object(q.k)(e.get("account"),e))})),Object(d.a)(Object(l.a)(t),"handleEmbed",(function(e){t.props.dispatch(Object(G.d)("EMBED",{url:e.get("url")}))})),Object(d.a)(Object(l.a)(t),"handleHotkeyToggleSensitive",(function(){t.handleToggleMediaVisibility()})),Object(d.a)(Object(l.a)(t),"handleHotkeyMoveUp",(function(){t.handleMoveUp(t.props.status.get("id"))})),Object(d.a)(Object(l.a)(t),"handleHotkeyMoveDown",(function(){t.handleMoveDown(t.props.status.get("id"))})),Object(d.a)(Object(l.a)(t),"handleHotkeyReply",(function(e){e.preventDefault(),t.handleReplyClick(t.props.status)})),Object(d.a)(Object(l.a)(t),"handleHotkeyFavourite",(function(){t.handleFavouriteClick(t.props.status)})),Object(d.a)(Object(l.a)(t),"handleHotkeyBoost",(function(){t.handleReblogClick(t.props.status)})),Object(d.a)(Object(l.a)(t),"handleHotkeyBookmark",(function(){t.handleBookmarkClick(t.props.status)})),Object(d.a)(Object(l.a)(t),"handleHotkeyMention",(function(e){e.preventDefault(),t.handleMentionClick(t.props.status)})),Object(d.a)(Object(l.a)(t),"handleHotkeyOpenProfile",(function(){var e=Object(c.default)({},t.context.router.history.location.state);e.mastodonBackSteps=(e.mastodonBackSteps||0)+1,t.context.router.history.push("/accounts/"+t.props.status.getIn(["account","id"]),e)})),Object(d.a)(Object(l.a)(t),"handleMoveUp",(function(e){var a=t.props,s=a.status,n=a.ancestorsIds,i=a.descendantsIds;if(e===s.get("id"))t._selectChild(n.size-1,!0);else{var o=n.indexOf(e);-1===o?(o=i.indexOf(e),t._selectChild(n.size+o,!0)):t._selectChild(o-1,!0)}})),Object(d.a)(Object(l.a)(t),"handleMoveDown",(function(e){var a=t.props,s=a.status,n=a.ancestorsIds,i=a.descendantsIds;if(e===s.get("id"))t._selectChild(n.size+1,!1);else{var o=n.indexOf(e);-1===o?(o=i.indexOf(e),t._selectChild(n.size+o+2,!1)):t._selectChild(o+1,!1)}})),Object(d.a)(Object(l.a)(t),"handleHeaderClick",(function(){t.column.scrollTop()})),Object(d.a)(Object(l.a)(t),"setExpansion",(function(e){t.setState({isExpanded:e})})),Object(d.a)(Object(l.a)(t),"setRef",(function(e){t.node=e})),Object(d.a)(Object(l.a)(t),"setColumnRef",(function(e){t.column=e})),Object(d.a)(Object(l.a)(t),"onFullScreenChange",(function(){t.setState({fullscreen:Object(Z.d)()})})),Object(d.a)(Object(l.a)(t),"shouldUpdateScroll",(function(e,t){var a=t.location;return!(((e||{}).location||{}).state||{}).mastodonModalOpen&&!(a.state&&a.state.mastodonModalOpen)})),t}var s=a.prototype;return s.componentDidMount=function(){Object(Z.a)(this.onFullScreenChange),this.props.dispatch(Object(y.f)(this.props.params.statusId));var e=this.props,t=e.status,a=e.ancestorsIds;if(t&&a&&a.size>0){var s=this.node.querySelectorAll(".focusable")[a.size-1];window.requestAnimationFrame((function(){s.scrollIntoView(!0)}))}},a.getDerivedStateFromProps=function(e,t){var a={},s=!1;e.params.statusId&&t.statusId!==e.params.statusId&&(e.dispatch(Object(y.f)(e.params.statusId)),a.threadExpanded=void 0,a.statusId=e.params.statusId,s=!0);var n=e.settings.getIn(["media","reveal_behind_cw"]);return n!==t.revealBehindCW&&(a.revealBehindCW=n,n&&(a.showMedia=Object(ee.b)(e.status,e.settings)),s=!0),e.status&&t.loadedStatusId!==e.status.get("id")&&(a.showMedia=Object(ee.b)(e.status,e.settings),a.loadedStatusId=e.status.get("id"),a.isExpanded=Object($.a)(e.settings,e.status),s=!0),s?a:null},s._selectChild=function(e,t){var a=this.node,s=a.querySelectorAll(".focusable")[e];s&&(t&&a.scrollTop>s.offsetTop?s.scrollIntoView(!0):!t&&a.scrollTop+a.clientHeight0){var n=this.node.querySelectorAll(".focusable")[s.size-1];window.requestAnimationFrame((function(){n.scrollIntoView(!0)}))}}},s.componentWillUnmount=function(){Object(Z.b)(this.onFullScreenChange)},s.render=function(){this.setExpansion;var e,t,a=this.props,s=a.status,n=a.settings,i=a.ancestorsIds,c=a.descendantsIds,l=a.intl,r=a.domain,d=a.multiColumn,u=this.state,p=u.fullscreen,h=u.isExpanded;if(null===s)return Object(o.a)(A.a,{},void 0,Object(o.a)(W.a,{multiColumn:d}),Object(o.a)(_.a,{}));i&&i.size>0&&(e=Object(o.a)("div",{},void 0,this.renderChildren(i))),c&&c.size>0&&(t=Object(o.a)("div",{},void 0,this.renderChildren(c)));var g={moveUp:this.handleHotkeyMoveUp,moveDown:this.handleHotkeyMoveDown,reply:this.handleHotkeyReply,favourite:this.handleHotkeyFavourite,boost:this.handleHotkeyBoost,bookmark:this.handleHotkeyBookmark,mention:this.handleHotkeyMention,openProfile:this.handleHotkeyOpenProfile,toggleSpoiler:this.handleExpandedToggle,toggleSensitive:this.handleHotkeyToggleSensitive,openMedia:this.handleHotkeyOpenMedia};return(b.a.createElement(A.a,{bindToDocument:!d,ref:this.setColumnRef,label:l.formatMessage(ae.detailedStatus)},Object(o.a)(J.a,{icon:"comment",title:l.formatMessage(ae.tootHeading),onClick:this.handleHeaderClick,showBackButton:!0,multiColumn:d,extraButton:Object(o.a)("button",{className:"column-header__button",title:l.formatMessage(h?ae.hideAll:ae.revealAll),"aria-label":l.formatMessage(h?ae.hideAll:ae.revealAll),onClick:this.handleToggleAll,"aria-pressed":h?"true":"false"},void 0,Object(o.a)(te.a,{id:s.get("hidden")?"eye-slash":"eye"}))}),Object(o.a)(L.a,{scrollKey:"thread",shouldUpdateScroll:this.shouldUpdateScroll},void 0,b.a.createElement("div",{className:j()("scrollable","detailed-status__wrapper",{fullscreen:p}),ref:this.setRef},e,Object(o.a)(X.HotKeys,{handlers:g},void 0,Object(o.a)("div",{className:"focusable",tabIndex:"0","aria-label":Object(ee.c)(l,s,!1,!s.get("hidden"))},void 0,Object(o.a)(C.a,{status:s,settings:n,onOpenVideo:this.handleOpenVideo,onOpenMedia:this.handleOpenMedia,expanded:h,onToggleHidden:this.handleExpandedToggle,domain:r,showMedia:this.state.showMedia,onToggleMediaVisibility:this.handleToggleMediaVisibility},"details-"+s.get("id")),Object(o.a)(N,{status:s,onReply:this.handleReplyClick,onFavourite:this.handleFavouriteClick,onReblog:this.handleReblogClick,onBookmark:this.handleBookmarkClick,onDelete:this.handleDeleteClick,onDirect:this.handleDirectClick,onMention:this.handleMentionClick,onMute:this.handleMuteClick,onMuteConversation:this.handleConversationMuteClick,onBlock:this.handleBlockClick,onReport:this.handleReport,onPin:this.handlePin,onEmbed:this.handleEmbed},"action-bar-"+s.get("id")))),t))))},a}(Q.a),Object(d.a)(T,"contextTypes",{router:m.a.object}),Object(d.a)(T,"propTypes",{params:m.a.object.isRequired,dispatch:m.a.func.isRequired,status:k.a.map,settings:k.a.map.isRequired,ancestorsIds:k.a.list,descendantsIds:k.a.list,intl:m.a.object.isRequired,askReplyConfirmation:m.a.bool,multiColumn:m.a.bool,domain:m.a.string.isRequired}),S=B))||S)||S)}}]);
//# sourceMappingURL=status.js.map