{"version":3,"sources":["webpack:///./app/javascript/mastodon/features/favourites/index.js"],"names":["messages","defineMessages","refresh","Favourites","connect","state","props","accountIds","getIn","params","statusId","injectIntl","ImmutablePureComponent","handleRefresh","this","dispatch","fetchFavourites","componentWillMount","componentWillReceiveProps","nextProps","render","intl","multiColumn","emptyMessage","id","defaultMessage","bindToDocument","showBackButton","extraButton","type","className","title","formatMessage","aria-label","onClick","scrollKey","map","withNote","name","content","propTypes","PropTypes","object","isRequired","func","ImmutablePropTypes","list","bool"],"mappings":"4RAeA,MAAMA,EAAWC,YAAe,CAC9BC,QAAQ,CAAD,yCAKN,IAIGC,EAFUC,mBAJQ,CAACC,EAAOC,KAAK,CACnCC,WAAYF,EAAMG,MAAM,CAAC,aAAc,gBAAiBF,EAAMG,OAAOC,cAG/B,GACvCC,cAAU,EADI,cAEUC,IAAwB,cAAD,yBAsB9CC,cAAgB,KACdC,KAAKR,MAAMS,SAASC,YAAgBF,KAAKR,MAAMG,OAAOC,YAbxDO,qBACOH,KAAKR,MAAMC,YACdO,KAAKR,MAAMS,SAASC,YAAgBF,KAAKR,MAAMG,OAAOC,WAI1DQ,0BAA2BC,GACrBA,EAAUV,OAAOC,WAAaI,KAAKR,MAAMG,OAAOC,UAAYS,EAAUV,OAAOC,UAC/EI,KAAKR,MAAMS,SAASC,YAAgBG,EAAUV,OAAOC,WAQzDU,SACE,MAAM,KAAEC,EAAI,WAAEd,EAAU,YAAEe,GAAgBR,KAAKR,MAE/C,IAAKC,EACH,OACE,YAAC,IAAM,UACL,YAAC,IAAgB,KAKvB,MAAMgB,EAAe,YAAC,IAAgB,CAACC,GAAG,0BAA0BC,eAAe,oFAEnF,OACE,YAAC,IAAM,CAACC,gBAAiBJ,QAAY,EACnC,YAAC,IAAY,CACXK,gBAAc,EACdL,YAAaA,EACbM,YACE,sBAAQC,KAAK,SAASC,UAAU,wBAAwBC,MAAOV,EAAKW,cAAchC,EAASE,SAAU+B,aAAYZ,EAAKW,cAAchC,EAASE,SAAUgC,QAASpB,KAAKD,oBAAc,EAAC,YAAC,IAAI,CAACW,GAAG,eAIjM,YAAC,IAAc,CACbW,UAAU,aACVZ,aAAcA,EACdG,gBAAiBJ,QAAY,EAE5Bf,EAAW6B,KAAIZ,GACd,YAAC,IAAgB,CAAUA,GAAIA,EAAIa,UAAU,GAAtBb,MAI3B,YAAC,IAAM,UACL,oBAAMc,KAAK,SAASC,QAAQ,iBA1D7BC,UAAY,CACjB/B,OAAQgC,IAAUC,OAAOC,WACzB5B,SAAU0B,IAAUG,KAAKD,WACzBpC,WAAYsC,IAAmBC,KAC/BxB,YAAamB,IAAUM,KACvB1B,KAAMoB,IAAUC,OAAOC,YARhB,EASR","file":"js/features/favourites-a7acc829ae80e112988b.chunk.js","sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport { connect } from 'react-redux';\nimport ColumnHeader from 'mastodon/components/column_header';\nimport Icon from 'mastodon/components/icon';\nimport { fetchFavourites } from 'mastodon/actions/interactions';\nimport LoadingIndicator from 'mastodon/components/loading_indicator';\nimport ScrollableList from 'mastodon/components/scrollable_list';\nimport AccountContainer from 'mastodon/containers/account_container';\nimport Column from 'mastodon/features/ui/components/column';\nimport { Helmet } from 'react-helmet';\n\nconst messages = defineMessages({\n  refresh: { id: 'refresh', defaultMessage: 'Refresh' },\n});\n\nconst mapStateToProps = (state, props) => ({\n  accountIds: state.getIn(['user_lists', 'favourited_by', props.params.statusId]),\n});\n\nexport default @connect(mapStateToProps)\n@injectIntl\nclass Favourites extends ImmutablePureComponent {\n\n  static propTypes = {\n    params: PropTypes.object.isRequired,\n    dispatch: PropTypes.func.isRequired,\n    accountIds: ImmutablePropTypes.list,\n    multiColumn: PropTypes.bool,\n    intl: PropTypes.object.isRequired,\n  };\n\n  componentWillMount () {\n    if (!this.props.accountIds) {\n      this.props.dispatch(fetchFavourites(this.props.params.statusId));\n    }\n  }\n\n  componentWillReceiveProps (nextProps) {\n    if (nextProps.params.statusId !== this.props.params.statusId && nextProps.params.statusId) {\n      this.props.dispatch(fetchFavourites(nextProps.params.statusId));\n    }\n  }\n\n  handleRefresh = () => {\n    this.props.dispatch(fetchFavourites(this.props.params.statusId));\n  }\n\n  render () {\n    const { intl, accountIds, multiColumn } = this.props;\n\n    if (!accountIds) {\n      return (\n        <Column>\n          <LoadingIndicator />\n        </Column>\n      );\n    }\n\n    const emptyMessage = <FormattedMessage id='empty_column.favourites' defaultMessage='No one has favourited 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='favourites'\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"],"sourceRoot":""}