// Module ID: 15624 // Function ID: 15625 // Name: ChangeLogModal // Dependencies: [19, 17, 1074, 2010, 21, 4605, 576, 4315, 1242, 8324, 15625, 5637, 8372, 1114, 5173, 9119, 10467, 1178, 8144, 1477, 8145, 1484, 5674, 4196, 8146, 4601, 4808, 7052, 2] // Exports: default // Module 15624 (ChangeLogModal) import nativeDefault from "native" /* 576 */; import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1242 */; import ModalActionCreatorsDefault from "ModalActionCreators" /* 4808 */; import NavigatorHeader from "NavigatorHeader" /* 5674 */; import Navigator from "Navigator" /* 7052 */; import ChangeLogStandardTemplateDefault from "ChangeLogStandardTemplate" /* 8144 */; import openMediaModal from "openMediaModal" /* 8324 */; import common_VideoDefault from "common/Video" /* 8372 */; import _modDef15625 from "module_15625" /* 15625 */; import noop from "module_19" /* 19 */; require = fn; class ChangeLogScreen { constructor(arg0) { fn = global.onClose; changelog = undefined; loaded = undefined; closure_2 = undefined; tmp = changelog; tmp2 = closure_2; obj = changelog(closure_2[5]); legacyClassComponentStyles = obj.useLegacyClassComponentStyles(closure_10); obj2 = changelog(closure_2[20]); currentChangelog = obj2.useCurrentChangelog(); changelog = currentChangelog.changelog; loaded = currentChangelog.loaded; size = loaded(closure_2[19])(); diff = size.width - 36; result = diff * c9; result1 = 0.5 * size.height; tmp6 = c9; bound = Math.min(result, result1); if (result1 < result) { diff = result1 / tmp6; } tmpResult = tmp(tmp2[21]); navigation = tmpResult.useNavigation(); closure_2 = navigation; if (null == fn) { fn = function o() { return navigation.goBack(); }; } items = [, ]; items[0] = changelog; items[1] = navigation; effect = closure_3.useEffect(() => { if (null != changelog) { let obj = { headerTitle() { const obj = { title: null, subtitle: null }; const intl = changelog(navigation[13]).intl; obj.title = intl.string(changelog(navigation[13]).t.LRmNAl); const intl2 = changelog(navigation[13]).intl; if (null != date.date) { if ("" !== tmp4.date) { let toDateResult = loaded(navigation[23])(tmp4.date).toDate(); const obj2 = loaded(navigation[23])(tmp4.date); } const obj3 = { date: toDateResult }; obj.subtitle = intl2.formatToPlainString(tmp3, obj3); return closure_2_7(changelog(navigation[22]).NavigatorHeader, obj); } toDateResult = new Date(); } }; navigation.setOptions(obj); } }, items); items1 = [, ]; items1[0] = loaded; items1[1] = changelog; effect1 = closure_3.useEffect(() => { if (loaded) { if (null != changelog) { return () => loaded(navigation[24]).markChangelogAsSeen(changelog.id, changelog.date); } } }, items1); if (currentChangelog.clientTooOld) { tmp20 = jsx; tmp21 = View; obj1 = { style: null, children: null }; obj1.style = legacyClassComponentStyles.empty; obj9 = { variant: "heading-lg/medium", children: null }; intl2 = tmp(tmp2[13]).intl; obj9.children = intl2.string(tmp(tmp2[13]).t.V9ospk); obj1.children = jsx(tmp(tmp2[25]).Text, obj9); tmp15 = jsx(View, obj1); } else if (null == changelog) { tmp16 = jsx; obj10 = { style: null, children: null }; obj10.style = legacyClassComponentStyles.empty; tmp17 = View; Text = tmp(tmp2[25]).Text; obj11 = { variant: "text-md/semibold", children: null }; intl = tmp(tmp2[13]).intl; string = intl.string; t = tmp(tmp2[13]).t; if (loaded) { t = string(t.O1iRT8); obj11.children = t; obj11 = tmp16(Text, obj11); obj10.children = obj11; tmp18 = obj10; } else { obj11[1] = string(t.ZTNur7); obj10.children = tmp16(Text, obj11); tmp18 = obj10; } tmp16Result = tmp16(tmp17, tmp18); } else { tmp13 = jsx; tmp14 = ChangeLog; size1 = { onClose: null, height: null, width: null, changeLog: null }; size1.onClose = fn; size1.height = bound; size1.width = diff; size1.changeLog = changelog; tmp15 = jsx(ChangeLog, size1); } return tmp15; } } function hideChangeLog() { ModalActionCreatorsDefault.popWithKey(CHANGELOG_MODAL_KEY); } const View = fn(17).View; const AnalyticEvents = fn(1074).AnalyticEvents; const CHANGELOG_MODAL_KEY = fn(2010).CHANGELOG_MODAL_KEY; const jsxProd = fn(21); ({ jsx: closure_7, jsxs: closure_8 } = jsxProd); let c9 = 0.5625; let createStyles = fn(4605); let obj2 = { video: { alignSelf: "center" }, videoWrapper: { marginBottom: 8 }, videoSpecial: { borderRadius: nativeDefault.radii.xs, overflow: "hidden" }, videoOverlay: { position: "absolute", width: "100%", height: "100%" }, playButton: null, playIcon: null, empty: null }; let size = { position: "absolute", top: "50%", left: "50%", marginLeft: -28, marginTop: -28, borderRadius: nativeDefault.radii.round, backgroundColor: nativeDefault.colors.BACKGROUND_SURFACE_HIGH, width: 56, height: 56 }; obj2.playButton = size; obj2.playIcon = { width: 21, height: 21 }; obj2.empty = { width: "100%", height: 240, alignItems: "center", paddingTop: 48 }; let closure_10 = createStyles.createLegacyClassComponentStyles(obj2); createStyles = fn(4605); let obj4 = { bulletPoint: null, listItem: null, listText: null, listItemContent: null }; let size1 = { width: 7, height: 7, borderRadius: 3.5, marginRight: 13, marginTop: 7, backgroundColor: nativeDefault.colors.BACKGROUND_MOD_STRONG }; obj4.bulletPoint = size1; obj4.listItem = { flexDirection: "row", marginLeft: 4, marginBottom: 8 }; let obj3 = { borderRadius: nativeDefault.radii.xs, overflow: "hidden" }; obj4.listText = { color: nativeDefault.colors.TEXT_DEFAULT, fontSize: 14, lineHeight: 18, flex: 1 }; obj4.listItemContent = { flexDirection: "column", flex: 1 }; let closure_11 = createStyles.createLegacyClassComponentStyles(obj4); const PureComponent = noop.PureComponent; class ListItem extends PureComponent { } ListItem.prototype["render"] = function render() { const children = this.props.children; const tmp = closure_11(this.context); const obj = { style: tmp.listItem, children: null }; const items = [React5(View, { style: tmp.bulletPoint }), ]; const obj3 = { style: tmp.listText, children: null }; let childrenResult = children; if (typeof children === "function") { const obj4 = { style: tmp.listText }; childrenResult = children(obj4); } obj3.children = childrenResult; items[1] = React5(View, obj3); obj.children = items; return React6(View, obj); }; ListItem.contextType = fn(4315).ThemeContext; const PureComponent2 = noop.PureComponent; class ChangeLog extends PureComponent2 { constructor() { applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target); closure_0 = applyArgumentsResult; applyArgumentsResult.mountedAt = 0; applyArgumentsResult.ref = closure_3.createRef(); applyArgumentsResult.maxScrolledPercentage = 0; applyArgumentsResult.state = { ytVideoReady: false }; applyArgumentsResult.handleScroll = function handleScroll(contentOffset) { applyArgumentsResult.maxScrolledPercentage = Math.min(Math.max(applyArgumentsResult.maxScrolledPercentage, (contentOffset.contentOffset.y + contentOffset.layoutMeasurement.height) / contentOffset.contentSize.height), 1); }; applyArgumentsResult.playVideo = function playVideo() { const props = applyArgumentsResult.props; ({ video, image } = props.changeLog); ({ width, height } = props); if (null == video) { if (null == image) { return null; } } if (null != video) { const obj2 = { videoURI: video }; let obj3 = obj2; } else { obj3 = { uri: image }; } applyArgumentsResult.track(AnalyticEvents.CHANGE_LOG_VIDEO_INTERACTED); const current = obj.ref.current; if (null != current) { const obj5 = { initialSources: null, disableDownload: true, shareable: false, analyticsSource: "Change Log", originViewOrOriginLayout: null }; const obj6 = {}; const merged = Object.assign(obj3); obj6.width = width; obj6.height = height; const items = [obj6]; obj5.initialSources = items; obj5.originViewOrOriginLayout = current; openMediaModal.openMediaModal(obj5); } }; return applyArgumentsResult; } } const prototype = ChangeLog.prototype; prototype["componentDidMount"] = function componentDidMount() { this.mountedAt = Date.now(); this.track(AnalyticEvents.CHANGE_LOG_OPENED); }; prototype["componentWillUnmount"] = function componentWillUnmount() { this.track(AnalyticEvents.CHANGE_LOG_CLOSED); }; prototype["track"] = function track(arg0) { let obj = arg1; if (arg1 === undefined) { obj = {}; } const self = this; const changeLog = this.props.changeLog; if (null != changeLog) { const obj3 = { change_log_id: null }; const _HermesInternal = HermesInternal; obj3.change_log_id = "" + changeLog.date + ":" + changeLog.revision; const merged = Object.assign(obj); let tmp10 = obj3; if (arg0 === AnalyticEvents.CHANGE_LOG_CLOSED) { const obj4 = { seconds_open: null, max_scrolled_percentage: null }; const _Math = Math; const _Date = Date; obj4.seconds_open = Math.round((Date.now() - self.mountedAt) / 1000); const _parseInt = parseInt; const maxScrolledPercentage = self.maxScrolledPercentage; obj4.max_scrolled_percentage = 100 * parseInt(maxScrolledPercentage.toPrecision(4), 10); const merged1 = Object.assign(obj3); tmp10 = obj4; } AnalyticsUtilsDefault.track(arg0, tmp10); } }; prototype["renderVideo"] = function renderVideo() { const self = this; const tmp = closure_10(this.context); const props = this.props; ({ changeLog, height, onClose } = props); ({ video, image, youtube_video_id } = changeLog); if (null != video) { const obj2 = { videoURI: video }; let obj = obj2; } else if (null == image) { let tmp4Result = null; if (null != youtube_video_id) { const obj3 = { style: tmp.videoWrapper, onAccessibilityEscape: onClose, children: null }; const obj4 = { height, play: false, videoId: youtube_video_id, onReady() { return self.setState({ ytVideoReady: true }); }, useLocalHTML: true }; const items = [closure_7(_modDef15625, obj4), ]; let tmp6Result = null; if (!tmp2) { const obj5 = { style: tmp.videoOverlay, source: null }; const obj6 = { uri: null }; const _HermesInternal = HermesInternal; obj6.uri = "https://i.ytimg.com/vi/" + youtube_video_id + "/hqdefault.jpg"; obj5.source = obj6; tmp6Result = tmp6(tmp7(5637), obj5); const tmp7Result = tmp7(5637); } items[1] = tmp6Result; obj3.children = items; tmp4Result = closure_8(View, obj3); tmp6 = closure_7; tmp7 = importDefault; } return tmp4Result; } else { obj = { uri: image }; } const obj7 = { style: tmp.videoWrapper, onAccessibilityEscape: onClose, children: null }; const obj8 = { ref: self.ref, style: tmp.videoSpecial, children: null }; const size = { style: tmp.video, src: obj, width: props.width, height, paused: true, canOpenFullscreen: true, unmutedOnFullScreen: true, accessibilityLabel: null, onPress: null }; const intl = self(1114).intl; size.accessibilityLabel = intl.string(self(1114).t.zHeo07); size.onPress = function onPress() { self.track(AnalyticEvents.CHANGE_LOG_VIDEO_INTERACTED); }; const items1 = [closure_7(common_VideoDefault, size), ]; let tmp12Result = null; if (null != video) { const obj9 = { accessibilityLabel: "Play Video", accessibilityRole: "button", style: tmp.videoOverlay, onPress: self.playVideo, children: null }; const obj10 = { accessibilityLabel: "Play Video", accessibilityRole: "button", source: tmp15(10467), onPress: self.playVideo, style: tmp.playButton, iconSize: tmp18(1178).IconSizes.CUSTOM, iconStyle: tmp.playIcon }; obj9.children = tmp12(tmp15(9119), obj10); tmp12Result = tmp12(tmp18(5173).PressableOpacity, obj9); const tmp15Result = tmp15(9119); } items1[1] = tmp12Result; obj8.children = items1; obj7.children = closure_8(View, obj8); return closure_7(View, obj7); }; prototype["render"] = function render() { const obj = {}; const merged = Object.assign(this.props); obj.video = this.renderVideo(); obj.onScroll = this.handleScroll; return React5(ChangeLogStandardTemplateDefault, obj); }; ChangeLog.contextType = fn(4315).ThemeContext; size = fn(2); let result = size.fileFinishedImporting("components_native/ChangeLogModal.tsx"); export default function ChangelogModal() { const screens = noop.useMemo(() => { const obj = { CHANGELOG: null }; const obj2 = { name: "CHANGELOG", headerLeft: NavigatorHeader.getHeaderCloseButton(hideChangeLog), render() { return closure_1_7(closure_1_13, { onClose }); } }; obj.CHANGELOG = obj2; return obj; }, []); return React5(Navigator.Navigator, { screens, initialRouteName: "CHANGELOG" }); }; export { ListItem }; export { ChangeLogScreen };