// Module ID: 11175 // Function ID: 11176 // Name: AdContentImpressionTrackerBaseNative // Dependencies: [32, 19, 6876, 9520, 676, 21, 7745, 8853, 589, 10488, 10489, 7188, 2] // Exports: BillableAdPlacementImpressionTrackerNative, QuestContentImpressionTrackerNative // Module 11175 (AdContentImpressionTrackerBaseNative) import _slicedToArray from "_slicedToArray"; import noop from "noop"; import getState from "getState"; import { MIN_QUEST_CONTENT_VISIBILITY_PERCENTAGE as closure_6 } from "MAX_BRAND_SAFETY_CONTEXT_ARRAY_LEN"; import { AppStates } from "ME"; import { createElement } from "noop"; import { jsx } from "jsxProd"; const require = arg1; function AdContentImpressionTrackerBaseNative(skipRemountKey) { let obj = adContentIds2(589); let items = [getState]; let tmp3 = obj.useStateFromStores(items, () => state.getState()) === AppStates.ACTIVE; const ref = React.useRef(null); const tmp5 = visibilityRef; let obj1 = adContentIds2(10488); const adContentImpressionTrackerProps = obj1.useAdContentImpressionTrackerProps(skipRemountKey); const adContentIds = adContentImpressionTrackerProps.adContentIds; obj = {}; let merged = Object.assign(skipRemountKey); obj.adContentIds = adContentIds; adContentIds2 = undefined; visibilityRef = undefined; adContentIds2 = obj.adContentIds; visibilityRef = obj.visibilityRef; let overrideVisibility = obj.overrideVisibility; let dependencyMap; const joined = adContentIds2.join("_"); let tmp6 = visibilityRef(8853)(tmp3); let items1 = [joined]; const tmp10 = callback(adContentIds2(7745).useRecyclingState(false, items1), 2); dependencyMap = tmp11; let items2 = [adContentIds2, tmp10[1], visibilityRef]; const effect = React.useEffect(() => { (function initHandlers(arg0) { let adContentIds; let children; let visibilityRef; ({ adContentIds, setVisible: children, visibilityRef } = arg0); if (null != visibilityRef) { function _loop(iter) { let closure_0 = iter; const obj = {}; const merged = Object.assign(visibilityRef.current.children[iter]); obj.calculateVisibility = function calculateVisibility() { let tmp4; if (outer1_1 != null) { const current = tmp2.current; if (current != null) { const children = current.children; if (children != null) { tmp4 = children[tmp3]; } } } let layout; if (tmp4 != null) { layout = tmp4.layout; } let num = 0; if (null != layout) { let layout1; if (tmp2 != null) { const parent = tmp2.current.parent; if (parent != null) { layout1 = parent.layout; } } num = 0; if (null != layout1) { let str = tmp2.current.axis; if (str == null) { str = "vertical"; } if ("horizontal" === str) { num = 0; if (null != tmp2.current.parent.scrollX) { const items = [tmp4.layout.x, tmp4.layout.x + tmp4.layout.width]; const items1 = [tmp2.current.parent.scrollX, tmp2.current.parent.scrollX + tmp2.current.parent.layout.width]; let items3 = items1; let items2 = items; if (null != tmp2.current.parent.firstItemOffset) { const firstItemOffset = tmp2.current.parent.firstItemOffset; items2[0] = items2[0] + firstItemOffset; items2[1] = items2[1] + firstItemOffset; } const _Math = Math; const _Math2 = Math; const bound = Math.max(items2[0], items3[0]); const _Math3 = Math; const _Math4 = Math; num = Math.min(Math.max(0, Math.min(items2[1], items3[1]) - bound) / tmp4.layout.width, 1); } } else { num = 0; if (null != tmp2.current.parent.scrollY) { items2 = [tmp4.layout.y, tmp4.layout.y + tmp4.layout.height]; items3 = [tmp2.current.parent.scrollY, tmp2.current.parent.scrollY + tmp2.current.parent.layout.height]; const height = tmp4.layout.height; } } } } closure_0(num >= outer2_6); }; visibilityRef.current.children[iter] = obj; } const iter = adContentIds[Symbol.iterator](); while (iter !== undefined) { let _loopResult = _loop(iter.next()); continue; } } })({ adContentIds: children, setVisible: c2, visibilityRef }); children = undefined; if (visibilityRef != null) { let current = visibilityRef.current; if (current != null) { children = current.children; } } return () => { if (null != children) { for (const item10008 of children) { let tmp3 = children; let tmp4 = children[item10008]; if (null != tmp4) { let tmp6 = tmp4; tmp5.calculateVisibility = undefined; } continue; } } }; }, items2); if (overrideVisibility == null) { overrideVisibility = tmp10[0]; } obj = { visible: overrideVisibility, visibleChanged: overrideVisibility !== tmp5(8853)(overrideVisibility) }; obj1 = {}; const merged1 = Object.assign(skipRemountKey); const merged2 = Object.assign(obj); obj1.focused = tmp3; obj1.focusedChanged = tmp3 !== tmp6; obj1.reference = ref; obj1.isFocused = tmp3; let key; if (!skipRemountKey.skipRemountKey) { key = adContentImpressionTrackerProps.key; } const obj2 = {}; const merged3 = Object.assign(obj1); obj2.key = key; obj2.adContentIds = adContentIds; if (tmp17) { obj2.adCreativeType = tmp(7188).AdCreativeType.QUEST; let tmp19 = obj2; } else { obj2.adCreativeType = skipRemountKey.adCreativeType; tmp19 = obj2; } return createElement(adContentIds2(10489).QuestContentImpressionTracker, tmp19); } const result = require("getState").fileFinishedImporting("modules/quests/native/QuestContentImpressionTracker.native.tsx"); export const QuestContentImpressionTrackerNative = function QuestContentImpressionTrackerNative(arg0) { const merged = Object.assign(arg0); return ; }; export const BillableAdPlacementImpressionTrackerNative = function BillableAdPlacementImpressionTrackerNative(arg0) { const merged = Object.assign(arg0); return ; };