{"version":3,"sources":["webpack:///./app/javascript/mastodon/features/reblogs/index.jsx"],"names":["messages","defineMessages","refresh","id","defaultMessage","Reblogs","ImmutablePureComponent","constructor","arguments","handleRefresh","this","props","dispatch","fetchReblogs","params","statusId","handleLoadMore","_debounce","expandReblogs","leading","UNSAFE_componentWillMount","accountIds","render","intl","hasMore","isLoading","multiColumn","_jsx","Column","LoadingIndicator","emptyMessage","FormattedMessage","bindToDocument","ColumnHeader","showBackButton","extraButton","type","className","title","formatMessage","onClick","Icon","ScrollableList","scrollKey","onLoadMore","map","AccountContainer","withNote","Helmet","name","content","propTypes","PropTypes","object","isRequired","func","ImmutablePropTypes","list","bool","connect","mapStateToProps","state","getIn","injectIntl"],"mappings":"8QAqBA,MAAMA,EAAWC,YAAe,CAC9BC,QAAS,CAAEC,GAAG,UAAYC,eAAe,aAS3C,MAAMC,UAAgBC,IAAuBC,cAAA,SAAAC,WAAA,KAkB3CC,cAAgB,KACdC,KAAKC,MAAMC,SAASC,YAAaH,KAAKC,MAAMG,OAAOC,UAAU,EAC7D,KAEFC,eAAiBC,KAAS,KACxBP,KAAKC,MAAMC,SAASM,YAAcR,KAAKC,MAAMG,OAAOC,UAAU,GAC7D,IAAK,CAAEI,SAAS,GAAQ,CAZ3BC,4BACOV,KAAKC,MAAMU,YACdX,KAAKC,MAAMC,SAASC,YAAaH,KAAKC,MAAMG,OAAOC,UAEvD,CAUAO,SACE,MAAM,KAAEC,EAAI,WAAEF,EAAU,QAAEG,EAAO,UAAEC,EAAS,YAAEC,GAAgBhB,KAAKC,MAEnE,IAAKU,EACH,OACEM,YAACC,IAAM,UACLD,YAACE,IAAgB,KAKvB,MAAMC,EAAeH,YAACI,IAAgB,CAAC5B,GAAE,uBAAwBC,eAAe,iFAEhF,OACEuB,YAACC,IAAM,CAACI,gBAAiBN,QAAY,EACnCC,YAACM,IAAY,CACXC,gBAAc,EACdR,YAAaA,EACbS,YACER,YAAA,UAAQS,KAAK,SAASC,UAAU,wBAAwBC,MAAOf,EAAKgB,cAAcvC,EAASE,SAAU,aAAYqB,EAAKgB,cAAcvC,EAASE,SAAUsC,QAAS9B,KAAKD,oBAAc,EAACkB,YAACc,IAAI,CAACtC,GAAG,eAIjMwB,YAACe,IAAc,CACbC,UAAU,UACVC,WAAYlC,KAAKM,eACjBQ,QAASA,EACTC,UAAWA,EACXK,aAAcA,EACdE,gBAAiBN,QAAY,EAE5BL,EAAWwB,KAAI1C,GACdwB,YAACmB,IAAgB,CAAU3C,GAAIA,EAAI4C,UAAU,GAAtB5C,MAI3BwB,YAACqB,IAAM,UACLrB,YAAA,QAAMsB,KAAK,SAASC,QAAQ,aAIpC,EAnEI7C,EAEG8C,UAAY,CACjBrC,OAAQsC,IAAUC,OAAOC,WACzB1C,SAAUwC,IAAUG,KAAKD,WACzBjC,WAAYmC,IAAmBC,KAC/BjC,QAAS4B,IAAUM,KACnBjC,UAAW2B,IAAUM,KACrBhC,YAAa0B,IAAUM,KACvBnC,KAAM6B,IAAUC,OAAOC,YA8DZK,6BA7ESC,CAACC,EAAOlD,KAAK,CACnCU,WAAYwC,EAAMC,MAAM,CAAC,aAAc,eAAgBnD,EAAMG,OAAOC,SAAU,UAC9ES,UAAWqC,EAAMC,MAAM,CAAC,aAAc,eAAgBnD,EAAMG,OAAOC,SAAU,SAC7EU,UAAWoC,EAAMC,MAAM,CAAC,aAAc,eAAgBnD,EAAMG,OAAOC,SAAU,cAAc,MA0E9E4C,CAAyBI,YAAW1D,G","file":"js/features/reblogs-b92d6549958d7007da10.chunk.js","sourcesContent":["import PropTypes from 'prop-types';\n\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\n\nimport { Helmet } from 'react-helmet';\n\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { connect } from 'react-redux';\n\nimport { debounce } from 'lodash';\n\nimport { Icon } from 'mastodon/components/icon';\n\nimport { fetchReblogs, expandReblogs } from '../../actions/interactions';\nimport ColumnHeader from '../../components/column_header';\nimport { LoadingIndicator } from '../../components/loading_indicator';\nimport ScrollableList from '../../components/scrollable_list';\nimport AccountContainer from '../../containers/account_container';\nimport Column from '../ui/components/column';\n\nconst messages = defineMessages({\n refresh: { id: 'refresh', defaultMessage: 'Refresh' },\n});\n\nconst mapStateToProps = (state, props) => ({\n accountIds: state.getIn(['user_lists', 'reblogged_by', props.params.statusId, 'items']),\n hasMore: !!state.getIn(['user_lists', 'reblogged_by', props.params.statusId, 'next']),\n isLoading: state.getIn(['user_lists', 'reblogged_by', props.params.statusId, 'isLoading'], true),\n});\n\nclass Reblogs extends ImmutablePureComponent {\n\n static propTypes = {\n params: PropTypes.object.isRequired,\n dispatch: PropTypes.func.isRequired,\n accountIds: ImmutablePropTypes.list,\n hasMore: PropTypes.bool,\n isLoading: PropTypes.bool,\n multiColumn: PropTypes.bool,\n intl: PropTypes.object.isRequired,\n };\n\n UNSAFE_componentWillMount () {\n if (!this.props.accountIds) {\n this.props.dispatch(fetchReblogs(this.props.params.statusId));\n }\n };\n\n handleRefresh = () => {\n this.props.dispatch(fetchReblogs(this.props.params.statusId));\n };\n\n handleLoadMore = debounce(() => {\n this.props.dispatch(expandReblogs(this.props.params.statusId));\n }, 300, { leading: true });\n\n render () {\n const { intl, accountIds, hasMore, isLoading, multiColumn } = this.props;\n\n if (!accountIds) {\n return (\n <Column>\n <LoadingIndicator />\n </Column>\n );\n }\n\n const emptyMessage = <FormattedMessage id='status.reblogs.empty' defaultMessage='No one has boosted this post yet. When someone does, they will show up here.' />;\n\n return (\n <Column bindToDocument={!multiColumn}>\n <ColumnHeader\n showBackButton\n multiColumn={multiColumn}\n extraButton={(\n <button type='button' className='column-header__button' title={intl.formatMessage(messages.refresh)} aria-label={intl.formatMessage(messages.refresh)} onClick={this.handleRefresh}><Icon id='refresh' /></button>\n )}\n />\n\n <ScrollableList\n scrollKey='reblogs'\n onLoadMore={this.handleLoadMore}\n hasMore={hasMore}\n isLoading={isLoading}\n emptyMessage={emptyMessage}\n bindToDocument={!multiColumn}\n >\n {accountIds.map(id =>\n <AccountContainer key={id} id={id} withNote={false} />,\n )}\n </ScrollableList>\n\n <Helmet>\n <meta name='robots' content='noindex' />\n </Helmet>\n </Column>\n );\n }\n\n}\n\nexport default connect(mapStateToProps)(injectIntl(Reblogs));\n"],"sourceRoot":""}