1 (window
.webpackJsonp
=window
.webpackJsonp
||[]).push([[60],{717:function(t
,e
,a
){"use strict";a
.r(e
);var n
,s
,i
=a(1),o
=a(6),c
=a(0),r
=a(2),u
=a(952),l
=a
.n(u
),d
=a(3),h
=a
.n(d
),g
=a(20),p
=a(626),b
=a(430),m
=a(428),O
=a(7),f
=a(391),j
=a
.n(f
),v
=a(953),_
=a
.n(v
),y
=Object(O
.g
)(n=function(s
){function t(){for(var a
,t
=arguments
.length
,e
=new Array(t
),n
=0;n
<t
;n
++)e
[n
]=arguments
[n
];return a
=s
.call
.apply(s
,[this].concat(e
))||this,Object(r
.a
)(Object(c
.a
)(Object(c
.a
)(a
)),"state",{open:a
.hasTags()}),Object(r
.a
)(Object(c
.a
)(Object(c
.a
)(a
)),"onSelect",function(e
){return function(t
){a
.props
.onChange(["tags",e
],t
)}}),Object(r
.a
)(Object(c
.a
)(Object(c
.a
)(a
)),"onToggle",function(){a
.state
.open
&&a
.hasTags()&&a
.props
.onChange("tags",{}),a
.setState({open:!a
.state
.open
})}),a
}Object(o
.a
)(t
,s
);var e
=t
.prototype;return e
.hasTags=function(){var e
=this;return["all","any","none"].map(function(t
){return 0<e
.tags(t
).length
}).includes(!0)},e
.tags=function(t
){var e
=this.props
.settings
.getIn(["tags",t
])||[];return e
.toJSON
?e
.toJSON():e
},e
.modeSelect=function(t
){return Object(i
.a
)("div",{className:"column-settings__section"},void 0,this.modeLabel(t
),Object(i
.a
)(_
.a
,{isMulti:!0,autoFocus:!0,value:this.tags(t
),settings:this.props
.settings
,settingPath:["tags",t
],onChange:this.onSelect(t
),loadOptions:this.props
.onLoad
,classNamePrefix:"column-settings__hashtag-select",name:"tags"}))},e
.modeLabel=function(t
){switch(t
){case"any":return Object(i
.a
)(O
.b
,{id:"hashtag.column_settings.tag_mode.any",defaultMessage:"Any of these"});case"all":return Object(i
.a
)(O
.b
,{id:"hashtag.column_settings.tag_mode.all",defaultMessage:"All of these"});case"none":return Object(i
.a
)(O
.b
,{id:"hashtag.column_settings.tag_mode.none",defaultMessage:"None of these"})}return""},e
.render=function(){return Object(i
.a
)("div",{},void 0,Object(i
.a
)("div",{className:"column-settings__row"},void 0,Object(i
.a
)("div",{className:"setting-toggle"},void 0,Object(i
.a
)(j
.a
,{id:"hashtag.column_settings.tag_toggle",onChange:this.onToggle
,checked:this.state
.open
}),Object(i
.a
)("span",{className:"setting-toggle__label"},void 0,Object(i
.a
)(O
.b
,{id:"hashtag.column_settings.tag_toggle",defaultMessage:"Include additional tags in this column"})))),this.state
.open
&&Object(i
.a
)("div",{className:"column-settings__hashtags"},void 0,this.modeSelect("any"),this.modeSelect("all"),this.modeSelect("none")))},t
}(h
.a
.PureComponent
))||n
,M
=a(205),I
=a(10),w
=Object(g
.connect
)(function(t
,e
){var a
=e
.columnId
,n
=t
.getIn(["settings","columns"]),s
=n
.findIndex(function(t
){return t
.get("uuid")===a
});return a
&&0<=s
?{settings:n
.get(s
).get("params")}:{}},function(a
,t
){var n
=t
.columnId
;return{onChange:function(t
,e
){a(Object(M
.f
)(n
,t
,e
))},onLoad:function(t
){return Object(I
.a
)().get("/api/v2/search",{params:{q:t
}}).then(function(t
){return(t
.data
.hashtags
||[]).map(function(t
){return{value:t
.name
,label:"#"+t
.name
}})})}}})(y
),C
=a(32),S
=a(401);a
.d(e
,"default",function(){return N
});var N
=Object(g
.connect
)(function(t
,e
){return{hasUnread:0<t
.getIn(["timelines","hashtag:"+e
.params
.id
,"unread"])}})(s=function(n
){function t(){for(var s
,t
=arguments
.length
,e
=new Array(t
),a
=0;a
<t
;a
++)e
[a
]=arguments
[a
];return s
=n
.call
.apply(n
,[this].concat(e
))||this,Object(r
.a
)(Object(c
.a
)(Object(c
.a
)(s
)),"disconnects",[]),Object(r
.a
)(Object(c
.a
)(Object(c
.a
)(s
)),"handlePin",function(){var t
=s
.props
,e
=t
.columnId
,a
=t
.dispatch
;a(e
?Object(M
.h
)(e
):Object(M
.e
)("HASHTAG",{id:s
.props
.params
.id
}))}),Object(r
.a
)(Object(c
.a
)(Object(c
.a
)(s
)),"title",function(){var t
=[s
.props
.params
.id
];return s
.additionalFor("any")&&t
.push(" ",Object(i
.a
)(O
.b
,{id:"hashtag.column_header.tag_mode.any",values:{additional:s
.additionalFor("any")},defaultMessage:"or {additional}"})),s
.additionalFor("all")&&t
.push(" ",Object(i
.a
)(O
.b
,{id:"hashtag.column_header.tag_mode.all",values:{additional:s
.additionalFor("all")},defaultMessage:"and {additional}"})),s
.additionalFor("none")&&t
.push(" ",Object(i
.a
)(O
.b
,{id:"hashtag.column_header.tag_mode.none",values:{additional:s
.additionalFor("none")},defaultMessage:"without {additional}"})),t
}),Object(r
.a
)(Object(c
.a
)(Object(c
.a
)(s
)),"additionalFor",function(t
){var e
=s
.props
.params
.tags
;return e
&&0<(e
[t
]||[]).length
?e
[t
].map(function(t
){return t
.value
}).join("/"):""}),Object(r
.a
)(Object(c
.a
)(Object(c
.a
)(s
)),"handleMove",function(t
){var e
=s
.props
,a
=e
.columnId
;(0,e
.dispatch
)(Object(M
.g
)(a
,t
))}),Object(r
.a
)(Object(c
.a
)(Object(c
.a
)(s
)),"handleHeaderClick",function(){s
.column
.scrollTop()}),Object(r
.a
)(Object(c
.a
)(Object(c
.a
)(s
)),"setRef",function(t
){s
.column
=t
}),Object(r
.a
)(Object(c
.a
)(Object(c
.a
)(s
)),"handleLoadMore",function(t
){var e
=s
.props
.params
,a
=e
.id
,n
=e
.tags
;s
.props
.dispatch(Object(C
.q
)(a
,{maxId:t
,tags:n
}))}),s
}Object(o
.a
)(t
,n
);var e
=t
.prototype;return e
._subscribe=function(e
,a
,t
){var n
=this;void 0===t
&&(t
={});var s
=(t
.any
||[]).map(function(t
){return t
.value
}),o
=(t
.all
||[]).map(function(t
){return t
.value
}),i
=(t
.none
||[]).map(function(t
){return t
.value
});[a
].concat(s
).map(function(t
){n
.disconnects
.push(e(Object(S
.c
)(a
,t
,function(t
){var e
=t
.tags
.map(function(t
){return t
.name
});return o
.filter(function(t
){return e
.includes(t
)}).length
===o
.length
&&0===i
.filter(function(t
){return e
.includes(t
)}).length
})))})},e
._unsubscribe=function(){this.disconnects
.map(function(t
){return t()}),this.disconnects
=[]},e
.componentDidMount=function(){var t
=this.props
.dispatch
,e
=this.props
.params
,a
=e
.id
,n
=e
.tags
;t(Object(C
.q
)(a
,{tags:n
}))},e
.componentWillReceiveProps=function(t
){var e
=this.props
,a
=e
.dispatch
,n
=e
.params
,s
=t
.params
,o
=s
.id
,i
=s
.tags
;o
===n
.id
&&l()(i
,n
.tags
)||(this._unsubscribe(),this._subscribe(a
,o
,i
),this.props
.dispatch(Object(C
.i
)("hashtag:"+o
)),this.props
.dispatch(Object(C
.q
)(o
,{tags:i
})))},e
.componentWillUnmount=function(){this._unsubscribe()},e
.render=function(){var t
=this.props
,e
=t
.hasUnread
,a
=t
.columnId
,n
=t
.multiColumn
,s
=this.props
.params
.id
,o
=!!a
;return h
.a
.createElement(b
.a
,{ref:this.setRef
,name:"hashtag",label:"#"+s
},Object(i
.a
)(m
.a
,{icon:"hashtag",active:e
,title:this.title(),onPin:this.handlePin
,onMove:this.handleMove
,onClick:this.handleHeaderClick
,pinned:o
,multiColumn:n
,showBackButton:!0},void 0,a
&&Object(i
.a
)(w
,{columnId:a
})),Object(i
.a
)(p
.a
,{trackScroll:!o
,scrollKey:"hashtag_timeline-"+a
,timelineId:"hashtag:"+s
,onLoadMore:this.handleLoadMore
,emptyMessage:Object(i
.a
)(O
.b
,{id:"empty_column.hashtag",defaultMessage:"There is nothing in this hashtag yet."})}))},t
}(h
.a
.PureComponent
))||s
}}]);
2 //# sourceMappingURL=hashtag_timeline.js.map