{"version":3,"sources":["webpack:///./app/javascript/mastodon/features/account_timeline/index.jsx"],"names":["emptyList","ImmutableList","RemoteHint","_ref2","accountId","url","acct","useAppSelector","state","_state$accounts$get","accounts","get","domain","split","undefined","_jsx","TimelineHint","message","FormattedMessage","id","defaultMessage","label","values","AccountTimeline","ImmutablePureComponent","constructor","arguments","_defineProperty","maxId","this","props","dispatch","expandAccountTimeline","withReplies","tagged","params","_load","fetchAccount","expandAccountFeaturedTimeline","fetchFeaturedTags","me","connectTimeline","concat","componentDidMount","lookupAccount","componentDidUpdate","prevProps","disconnectTimeline","timeline","componentWillUnmount","render","statusIds","featuredStatusIds","isLoading","hasMore","blockedBy","suspended","isAccount","hidden","multiColumn","remote","remoteUrl","isEmpty","Column","LoadingIndicator","BundleColumnError","errorType","emptyMessage","forceEmptyState","LimitedAccountHint","remoteMessage","ColumnBackButton","StatusList","prepend","HeaderContainer","hideTabs","alwaysPrepend","append","scrollKey","onLoadMore","handleLoadMore","bindToDocument","timelineId","withCounters","PropTypes","shape","string","isRequired","func","ImmutablePropTypes","list","bool","connect","mapStateToProps","_ref","getIn","normalizeForLookup","path","getAccountHidden"],"mappings":"oUA2BA,MAAMA,EAAYC,iBAmCZC,EAAaC,IAAyB,IAAxB,UAAEC,EAAS,IAAEC,GAAKF,EACpC,MAAMG,EAAOC,aAAeC,IAAK,IAAAC,EAAA,OAAiC,QAAjCA,EAAID,EAAME,SAASC,IAAIP,UAAU,IAAAK,OAAA,EAA7BA,EAA+BH,IAAI,IAClEM,EAASN,EAAOA,EAAKO,MAAM,KAAK,QAAKC,EAE3C,OACEC,YAACC,IAAY,CACXX,IAAKA,EACLY,QAASF,YAACG,IAAgB,CAACC,GAAE,sCAAuCC,eAAe,iDACnFC,MAAON,YAACG,IAAgB,CAACC,GAAE,gCAAiCC,eAAe,6BAA6BE,OAAQ,CAAEV,OAAQG,YAAA,mBAASH,OACnI,EASN,MAAMW,UAAwBC,IAAuBC,cAAA,SAAAC,WAAAC,YAAA,uB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AQ,cACxD3C,QAAS9C,EAAMuF,MAAM,CAAC,YAAY,WAADrD,OAAauD,GAAQ,YACtDzC,UAAWhD,EAAMuF,MAAM,CAAC,WAAY3F,EAAW,cAAc,GAC7DsD,OAAQwC,YAAiB1F,EAAOJ,GAChCmD,UAAW/C,EAAMuF,MAAM,CAAC,gBAAiB3F,EAAW,eAAe,GACpE,GAiKYwF,CAAyBrE,E","file":"js/features/account_timeline-ffd9078dce4dbc71a39e.chunk.js","sourcesContent":["import PropTypes from 'prop-types';\n\nimport { FormattedMessage } from 'react-intl';\n\nimport { List as ImmutableList } from 'immutable';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { connect } from 'react-redux';\n\nimport { TimelineHint } from 'mastodon/components/timeline_hint';\nimport BundleColumnError from 'mastodon/features/ui/components/bundle_column_error';\nimport { me } from 'mastodon/initial_state';\nimport { normalizeForLookup } from 'mastodon/reducers/accounts_map';\nimport { getAccountHidden } from 'mastodon/selectors';\nimport { useAppSelector } from 'mastodon/store';\n\nimport { lookupAccount, fetchAccount } from '../../actions/accounts';\nimport { fetchFeaturedTags } from '../../actions/featured_tags';\nimport { expandAccountFeaturedTimeline, expandAccountTimeline, connectTimeline, disconnectTimeline } from '../../actions/timelines';\nimport { ColumnBackButton } from '../../components/column_back_button';\nimport { LoadingIndicator } from '../../components/loading_indicator';\nimport StatusList from '../../components/status_list';\nimport Column from '../ui/components/column';\n\nimport { LimitedAccountHint } from './components/limited_account_hint';\nimport HeaderContainer from './containers/header_container';\n\nconst emptyList = ImmutableList();\n\nconst mapStateToProps = (state, { params: { acct, id, tagged }, withReplies = false }) => {\n const accountId = id || state.getIn(['accounts_map', normalizeForLookup(acct)]);\n\n if (accountId === null) {\n return {\n isLoading: false,\n isAccount: false,\n statusIds: emptyList,\n };\n } else if (!accountId) {\n return {\n isLoading: true,\n statusIds: emptyList,\n };\n }\n\n const path = withReplies ? `${accountId}:with_replies` : `${accountId}${tagged ? `:${tagged}` : ''}`;\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 statusIds: state.getIn(['timelines', `account:${path}`, 'items'], emptyList),\n featuredStatusIds: withReplies ? ImmutableList() : state.getIn(['timelines', `account:${accountId}:pinned${tagged ? `:${tagged}` : ''}`, 'items'], emptyList),\n isLoading: state.getIn(['timelines', `account:${path}`, 'isLoading']),\n hasMore: state.getIn(['timelines', `account:${path}`, 'hasMore']),\n suspended: state.getIn(['accounts', accountId, 'suspended'], false),\n hidden: getAccountHidden(state, accountId),\n blockedBy: state.getIn(['relationships', accountId, 'blocked_by'], false),\n };\n};\n\nconst RemoteHint = ({ accountId, url }) => {\n const acct = useAppSelector(state => state.accounts.get(accountId)?.acct);\n const domain = acct ? acct.split('@')[1] : undefined;\n\n return (\n }\n label={{domain} }} />}\n />\n );\n};\n\nRemoteHint.propTypes = {\n url: PropTypes.string.isRequired,\n accountId: PropTypes.string.isRequired,\n};\n\nclass AccountTimeline extends ImmutablePureComponent {\n\n static propTypes = {\n params: PropTypes.shape({\n acct: PropTypes.string,\n id: PropTypes.string,\n tagged: PropTypes.string,\n }).isRequired,\n accountId: PropTypes.string,\n dispatch: PropTypes.func.isRequired,\n statusIds: ImmutablePropTypes.list,\n featuredStatusIds: ImmutablePropTypes.list,\n isLoading: PropTypes.bool,\n hasMore: PropTypes.bool,\n withReplies: PropTypes.bool,\n blockedBy: 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, withReplies, params: { tagged }, dispatch } = this.props;\n\n dispatch(fetchAccount(accountId));\n\n if (!withReplies) {\n dispatch(expandAccountFeaturedTimeline(accountId, { tagged }));\n }\n\n dispatch(fetchFeaturedTags(accountId));\n dispatch(expandAccountTimeline(accountId, { withReplies, tagged }));\n\n if (accountId === me) {\n dispatch(connectTimeline(`account:${me}`));\n }\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, tagged }, accountId, withReplies, 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 } else if (prevProps.params.tagged !== tagged) {\n if (!withReplies) {\n dispatch(expandAccountFeaturedTimeline(accountId, { tagged }));\n }\n dispatch(expandAccountTimeline(accountId, { withReplies, tagged }));\n }\n\n if (prevProps.accountId === me && accountId !== me) {\n dispatch(disconnectTimeline({ timeline: `account:${me}` }));\n }\n }\n\n componentWillUnmount () {\n const { dispatch, accountId } = this.props;\n\n if (accountId === me) {\n dispatch(disconnectTimeline({ timeline: `account:${me}` }));\n }\n }\n\n handleLoadMore = maxId => {\n this.props.dispatch(expandAccountTimeline(this.props.accountId, { maxId, withReplies: this.props.withReplies, tagged: this.props.params.tagged }));\n };\n\n render () {\n const { accountId, statusIds, featuredStatusIds, isLoading, hasMore, blockedBy, suspended, isAccount, hidden, multiColumn, remote, remoteUrl } = this.props;\n\n if (isLoading && statusIds.isEmpty()) {\n return (\n \n \n \n );\n } else if (!isLoading && !isAccount) {\n return (\n \n );\n }\n\n let emptyMessage;\n\n const forceEmptyState = suspended || blockedBy || hidden;\n\n if (suspended) {\n emptyMessage = ;\n } else if (hidden) {\n emptyMessage = ;\n } else if (blockedBy) {\n emptyMessage = ;\n } else if (remote && statusIds.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 scrollKey='account_timeline'\n statusIds={forceEmptyState ? emptyList : statusIds}\n featuredStatusIds={featuredStatusIds}\n isLoading={isLoading}\n hasMore={!forceEmptyState && hasMore}\n onLoadMore={this.handleLoadMore}\n emptyMessage={emptyMessage}\n bindToDocument={!multiColumn}\n timelineId='account'\n withCounters\n />\n \n );\n }\n\n}\n\nexport default connect(mapStateToProps)(AccountTimeline);\n"],"sourceRoot":""}