{"version":3,"sources":["webpack:///app/javascript/opt/mastodon/app/javascript/flavours/glitch/features/reblogs/index.jsx"],"names":["messages","defineMessages","heading","id","defaultMessage","refresh","Reblogs","ImmutablePureComponent","constructor","arguments","_defineProperty","this","column","scrollTop","c","props","dispatch","fetchReblogs","params","statusId","_debounce","expandReblogs","leading","UNSAFE_componentWillMount","accountIds","render","intl","hasMore","isLoading","multiColumn","_jsx","Column","LoadingIndicator","emptyMessage","FormattedMessage","_jsxs","ref","setRef","children","ColumnHeader","icon","iconComponent","RepeatIcon","title","formatMessage","onClick","handleHeaderClick","showBackButton","extraButton","type","className","handleRefresh","Icon","RefreshIcon","ScrollableList","scrollKey","onLoadMore","handleLoadMore","bindToDocument","map","Account","Helmet","name","content","PropTypes","object","isRequired","func","ImmutablePropTypes","list","bool","connect","mapStateToProps","state","getIn","injectIntl"],"mappings":"gUAuBA,MAAMA,EAAWC,YAAe,CAC9BC,QAAS,CAAEC,GAAG,sBAAwBC,eAAe,cACrDC,QAAS,CAAEF,GAAG,UAAYC,eAAe,aAS3C,MAAME,UAAgBC,IAAuBC,cAAA,SAAAC,WAAAC,YAAA,0BAkBvB,KAClBC,KAAKC,OAAOC,WAAW,IACxBH,YAAA,eAEQI,IACPH,KAAKC,OAASE,CAAC,IAChBJ,YAAA,sBAEe,KACdC,KAAKI,MAAMC,SAASC,YAAaN,KAAKI,MAAMG,OAAOC,UAAU,IAC9DT,YAAA,sBAEgBU,KAAS,KACxBT,KAAKI,MAAMC,SAASK,YAAcV,KAAKI,MAAMG,OAAOC,UAAU,GAC7D,IAAK,CAAEG,SAAS,IAAO,CApB1BC,4BACOZ,KAAKI,MAAMS,YACdb,KAAKI,MAAMC,SAASC,YAAaN,KAAKI,MAAMG,OAAOC,UAEvD,CAkBAM,SACE,MAAM,KAAEC,EAAI,WAAEF,EAAU,QAAEG,EAAO,UAAEC,EAAS,YAAEC,GAAgBlB,KAAKI,MAEnE,IAAKS,EACH,OACEM,YAACC,IAAM,UACLD,YAACE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D,CAAyBI,YAAWrE,G","file":"js/flavours/glitch/async/reblogs-d8d959af4726c8a94f1f.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 RefreshIcon from '@/material-icons/400-24px/refresh.svg?react';\nimport RepeatIcon from '@/material-icons/400-24px/repeat.svg?react';\nimport { Account } from 'flavours/glitch/components/account';\nimport { Icon }  from 'flavours/glitch/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 Column from '../ui/components/column';\n\nconst messages = defineMessages({\n  heading: { id: 'column.reblogged_by', defaultMessage: 'Boosted by' },\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  handleHeaderClick = () => {\n    this.column.scrollTop();\n  };\n\n  setRef = c => {\n    this.column = c;\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 ref={this.setRef}>\n        <ColumnHeader\n          icon='retweet'\n          iconComponent={RepeatIcon}\n          title={intl.formatMessage(messages.heading)}\n          onClick={this.handleHeaderClick}\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' icon={RefreshIcon} /></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            <Account key={id} id={id} />,\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":""}