(window.webpackJsonp=window.webpackJsonp||[]).push([[94],{1125:function(e,t,o){"use strict";o.r(t),o.d(t,"default",(function(){return R}));var n,l=o(0),a=o(1),i=o.n(a),s=o(12),c=o(4),d=o(3),r=o.n(d),m=o(1316),h=o(1302),u=o(1294),y=o(41),p=o(373),g=o(1315);let b=Object(c.g)(n=class extends i.a.PureComponent{render(){const{settings:e,onChange:t}=this.props;return Object(l.a)("div",{},void 0,Object(l.a)("div",{className:"column-settings__row"},void 0,Object(l.a)(g.a,{settings:e,settingPath:["other","onlyMedia"],onChange:t,label:Object(l.a)(c.b,{id:"community.column_settings.media_only",defaultMessage:"Media only"})}),Object(l.a)(g.a,{settings:e,settingPath:["other","onlyRemote"],onChange:t,label:Object(l.a)(c.b,{id:"community.column_settings.remote_only",defaultMessage:"Remote only"})}),!e.getIn(["other","onlyRemote"])&&Object(l.a)(g.a,{settings:e,settingPath:["other","allowLocalOnly"],onChange:t,label:Object(l.a)(c.b,{id:"community.column_settings.allow_local_only",defaultMessage:"Show local-only toots"})})))}})||n;var O=o(83);var M,j,w=Object(s.connect)(((e,t)=>{let{columnId:o}=t;const n=o,l=e.getIn(["settings","columns"]),a=l.findIndex((e=>e.get("uuid")===n));return{settings:n&&a>=0?l.get(a).get("params"):e.getIn(["settings","public"])}}),((e,t)=>{let{columnId:o}=t;return{onChange(t,n){e(o?Object(p.f)(o,t,n):Object(O.c)(["public",...t],n))}}}))(b),f=o(1318);const I=Object(c.f)({title:{id:"column.public",defaultMessage:"Federated timeline"}});let R=Object(s.connect)(((e,t)=>{let{columnId:o}=t;const n=o,l=e.getIn(["settings","columns"]),a=l.findIndex((e=>e.get("uuid")===n)),i=o&&a>=0?l.get(a).getIn(["params","other","onlyMedia"]):e.getIn(["settings","public","other","onlyMedia"]),s=o&&a>=0?l.get(a).getIn(["params","other","onlyRemote"]):e.getIn(["settings","public","other","onlyRemote"]),c=o&&a>=0?l.get(a).getIn(["params","other","allowLocalOnly"]):e.getIn(["settings","public","other","allowLocalOnly"]),d=e.getIn(["timelines","public"+(i?":media":"")]);return{hasUnread:!!d&&d.get("unread")>0,onlyMedia:i,onlyRemote:s,allowLocalOnly:c}}))(M=Object(c.g)(((j=class extends i.a.PureComponent{constructor(){super(...arguments),this.handlePin=()=>{const{columnId:e,dispatch:t,onlyMedia:o,onlyRemote:n,allowLocalOnly:l}=this.props;t(e?Object(p.h)(e):Object(p.e)(n?"REMOTE":"PUBLIC",{other:{onlyMedia:o,onlyRemote:n,allowLocalOnly:l}}))},this.handleMove=e=>{const{columnId:t,dispatch:o}=this.props;o(Object(p.g)(t,e))},this.handleHeaderClick=()=>{this.column.scrollTop()},this.setRef=e=>{this.column=e},this.handleLoadMore=e=>{const{dispatch:t,onlyMedia:o,onlyRemote:n,allowLocalOnly:l}=this.props;t(Object(y.x)({maxId:e,onlyMedia:o,onlyRemote:n,allowLocalOnly:l}))}}componentDidMount(){const{dispatch:e,onlyMedia:t,onlyRemote:o,allowLocalOnly:n}=this.props;e(Object(y.x)({onlyMedia:t,onlyRemote:o,allowLocalOnly:n})),this.disconnect=e(Object(f.e)({onlyMedia:t,onlyRemote:o,allowLocalOnly:n}))}componentDidUpdate(e){if(e.onlyMedia!==this.props.onlyMedia||e.onlyRemote!==this.props.onlyRemote||e.allowLocalOnly!==this.props.allowLocalOnly){const{dispatch:e,onlyMedia:t,onlyRemote:o,allowLocalOnly:n}=this.props;this.disconnect(),e(Object(y.x)({onlyMedia:t,onlyRemote:o,allowLocalOnly:n})),this.disconnect=e(Object(f.e)({onlyMedia:t,onlyRemote:o,allowLocalOnly:n}))}}componentWillUnmount(){this.disconnect&&(this.disconnect(),this.disconnect=null)}render(){const{intl:e,columnId:t,hasUnread:o,multiColumn:n,onlyMedia:a,onlyRemote:s,allowLocalOnly:d}=this.props,r=!!t;return i.a.createElement(h.a,{bindToDocument:!n,ref:this.setRef,name:"federated",label:e.formatMessage(I.title)},Object(l.a)(u.a,{icon:"globe",active:o,title:e.formatMessage(I.title),onPin:this.handlePin,onMove:this.handleMove,onClick:this.handleHeaderClick,pinned:r,multiColumn:n},void 0,Object(l.a)(w,{columnId:t})),Object(l.a)(m.a,{timelineId:"public"+(s?":remote":d?":allow_local_only":"")+(a?":media":""),onLoadMore:this.handleLoadMore,trackScroll:!r,scrollKey:"public_timeline-"+t,emptyMessage:Object(l.a)(c.b,{id:"empty_column.public",defaultMessage:"There is nothing here! Write something publicly, or manually follow users from other servers to fill it up"}),bindToDocument:!n}))}}).defaultProps={onlyMedia:!1},j.contextTypes={router:r.a.object},M=j))||M)||M}}]);
//# sourceMappingURL=public_timeline-7ae29541866f7a02b55d.chunk.js.map