{"version":3,"sources":["webpack:///app/javascript/opt/mastodon/app/javascript/flavours/glitch/features/following/index.jsx"],"names":["RemoteHint","_ref2","url","_jsx","TimelineHint","resource","FormattedMessage","id","defaultMessage","Following","ImmutablePureComponent","constructor","arguments","_defineProperty","_debounce","this","props","dispatch","expandFollowing","accountId","leading","c","column","scrollTop","_load","isAccount","fetchAccount","fetchFollowing","componentDidMount","params","acct","lookupAccount","componentDidUpdate","prevProps","render","accountIds","hasMore","multiColumn","isLoading","suspended","hidden","remote","remoteUrl","hideCollections","BundleColumnError","errorType","Column","LoadingIndicator","emptyMessage","forceEmptyState","LimitedAccountHint","isEmpty","remoteMessage","_jsxs","ref","setRef","children","ProfileColumnHeader","onClick","handleHeaderClick","ScrollableList","scrollKey","onLoadMore","handleLoadMore","prepend","HeaderContainer","hideTabs","alwaysPrepend","append","bindToDocument","map","AccountContainer","withNote","PropTypes","shape","string","isRequired","func","ImmutablePropTypes","list","bool","connect","mapStateToProps","state","_ref","getIn","normalizeForLookup","getAccountHidden"],"mappings":"oUA6BA,MAuBMA,EAAaC,IAAA,IAAC,IAAEC,GAAKD,EAAA,OACzBE,YAACC,IAAY,CAACF,IAAKA,EAAKG,SAAUF,YAACG,IAAgB,CAACC,GAAE,kCAAmCC,eAAe,aAAgB,EAO1H,MAAMC,UAAkBC,IAAuBC,cAAA,SAAAC,WAAAC,YAAA,sBA+C5BC,KAAS,KACxBC,KAAKC,MAAMC,SAASC,YAAgBH,KAAKC,MAAMG,WAAW,GACzD,IAAK,CAAEC,SAAS,KAAOP,YAAA,eAEjBQ,IACPN,KAAKO,OAASD,CAAC,IAChBR,YAAA,0BAEmB,KAClBE,KAAKO,OAAOC,WAAW,GACxB,CArCDC,QACE,MAAM,UAAEL,EAAS,UAAEM,EAAS,SAAER,GAAaF,KAAKC,MAE3CS,GAAWR,EAASS,YAAaP,IACtCF,EAASU,YAAeR,GAC1B,CAEAS,oBACE,MAAQC,QAAQ,KAAEC,GAAM,UAAEX,EAAS,SAAE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1EqB,OAAQ+C,YAAiBJ,EAAOhE,IAfzB,CACLmB,WAAW,EAed,GAkIY2C,CAAyBxE,E","file":"js/flavours/glitch/async/following-8f467aeb6165b238c560.chunk.js","sourcesContent":["import PropTypes from 'prop-types';\n\nimport { FormattedMessage } from 'react-intl';\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 { TimelineHint } from 'flavours/glitch/components/timeline_hint';\nimport BundleColumnError from 'flavours/glitch/features/ui/components/bundle_column_error';\nimport { normalizeForLookup } from 'flavours/glitch/reducers/accounts_map';\nimport { getAccountHidden } from 'flavours/glitch/selectors';\n\nimport {\n lookupAccount,\n fetchAccount,\n fetchFollowing,\n expandFollowing,\n} from '../../actions/accounts';\nimport { LoadingIndicator } from '../../components/loading_indicator';\nimport ScrollableList from '../../components/scrollable_list';\nimport AccountContainer from '../../containers/account_container';\nimport ProfileColumnHeader from '../account/components/profile_column_header';\nimport { LimitedAccountHint } from '../account_timeline/components/limited_account_hint';\nimport HeaderContainer from '../account_timeline/containers/header_container';\nimport Column from '../ui/components/column';\n\nconst mapStateToProps = (state, { params: { acct, id } }) => {\n const accountId = id || state.getIn(['accounts_map', normalizeForLookup(acct)]);\n\n if (!accountId) {\n return {\n isLoading: true,\n };\n }\n\n return {\n accountId,\n remote: !!(state.getIn(['accounts', accountId, 'acct']) !== state.getIn(['accounts', accountId, 'username'])),\n remoteUrl: state.getIn(['accounts', accountId, 'url']),\n isAccount: !!state.getIn(['accounts', accountId]),\n accountIds: state.getIn(['user_lists', 'following', accountId, 'items']),\n hasMore: !!state.getIn(['user_lists', 'following', accountId, 'next']),\n isLoading: state.getIn(['user_lists', 'following', accountId, 'isLoading'], true),\n suspended: state.getIn(['accounts', accountId, 'suspended'], false),\n hideCollections: state.getIn(['accounts', accountId, 'hide_collections'], false),\n hidden: getAccountHidden(state, accountId),\n };\n};\n\nconst RemoteHint = ({ url }) => (\n } />\n);\n\nRemoteHint.propTypes = {\n url: PropTypes.string.isRequired,\n};\n\nclass Following extends ImmutablePureComponent {\n\n static propTypes = {\n params: PropTypes.shape({\n acct: PropTypes.string,\n id: PropTypes.string,\n }).isRequired,\n accountId: PropTypes.string,\n dispatch: PropTypes.func.isRequired,\n accountIds: ImmutablePropTypes.list,\n hasMore: PropTypes.bool,\n isLoading: PropTypes.bool,\n isAccount: PropTypes.bool,\n suspended: PropTypes.bool,\n hidden: PropTypes.bool,\n remote: PropTypes.bool,\n remoteUrl: PropTypes.string,\n multiColumn: PropTypes.bool,\n };\n\n _load () {\n const { accountId, isAccount, dispatch } = this.props;\n\n if (!isAccount) dispatch(fetchAccount(accountId));\n dispatch(fetchFollowing(accountId));\n }\n\n componentDidMount () {\n const { params: { acct }, accountId, dispatch } = this.props;\n\n if (accountId) {\n this._load();\n } else {\n dispatch(lookupAccount(acct));\n }\n }\n\n componentDidUpdate (prevProps) {\n const { params: { acct }, accountId, dispatch } = this.props;\n\n if (prevProps.accountId !== accountId && accountId) {\n this._load();\n } else if (prevProps.params.acct !== acct) {\n dispatch(lookupAccount(acct));\n }\n }\n\n handleLoadMore = debounce(() => {\n this.props.dispatch(expandFollowing(this.props.accountId));\n }, 300, { leading: true });\n\n setRef = c => {\n this.column = c;\n };\n\n handleHeaderClick = () => {\n this.column.scrollTop();\n };\n\n render () {\n const { accountId, accountIds, hasMore, isAccount, multiColumn, isLoading, suspended, hidden, remote, remoteUrl, hideCollections } = this.props;\n\n if (!isAccount) {\n return (\n \n );\n }\n\n if (!accountIds) {\n return (\n \n \n \n );\n }\n\n let emptyMessage;\n\n const forceEmptyState = suspended || hidden;\n\n if (suspended) {\n emptyMessage = ;\n } else if (hidden) {\n emptyMessage = ;\n } else if (hideCollections && accountIds.isEmpty()) {\n emptyMessage = ;\n } else if (remote && accountIds.isEmpty()) {\n emptyMessage = ;\n } else {\n emptyMessage = ;\n }\n\n const remoteMessage = remote ? : null;\n\n return (\n \n \n\n }\n alwaysPrepend\n append={remoteMessage}\n emptyMessage={emptyMessage}\n bindToDocument={!multiColumn}\n >\n {accountIds.map(id =>\n ,\n )}\n \n \n );\n }\n\n}\n\nexport default connect(mapStateToProps)(Following);\n"],"sourceRoot":""}