Files
discord-decomp/_bundle/createAnimatedValue.js
T
2026-11-01 12:12:55 +02:00

10813 lines
373 KiB
JavaScript

// Metro module 15038 (f15039).
import * as __classCallCheck from "./_classCallCheck";
import * as __createClass from "./_createClass";
import * as __objectWithoutProperties from "./_objectWithoutProperties";
import * as __slicedToArray from "./_slicedToArray";
import * as _Module19 from "react";
import { createContext } from "react";
import * as _Module17 from "react-native";
import { StyleSheet, Text, View, Platform, PixelRatio } from "react-native";
import { HermesBuiltin } from "../_hermes/prelude";
function $mk95155($env) {
return function(a0) {
let env27890 = {
$parent: $env
};
env27890[0] = a0;
if (a0 !== "default") {
const r2 = $env;
let r9 = Object.getOwnPropertyDescriptor(r2[0], a0);
const r10 = Object;
const r12 = r2[1];
if (!r9.get) {
r9 = {
enumerable: true,
get: function get() {
return env27890.$parent[0][env27890[0]];
}
};
}
r10.defineProperty(r12, a0, r9);
}
};
}
function $mk95157($env) {
return () => {
let length2;
const r7 = $env;
const r8 = [];
const length = r7[1].length;
let r0 = 0;
const r3 = 0 < length;
let r4 = false;
let r5 = false;
if (r3) {
do {
const r10 = r7[0];
const r14 = r7[1];
const r16 = r10.values.get(r14[r0]);
r8.push(r16);
const r20 = r7[3][r0];
const r1 = r0;
const r21 = r16 !== r20 ? true : r4;
r0 = r1 + 1;
length2 = r14.length;
r4 = r21;
r5 = r4;
} while (r0 < length2);
}
r7[3] = r8;
if (r5) {
r7[2] = r8;
}
return r7[2];
};
}
function $mk95158($env) {
return (a0) => {
let r25;
const r8 = $env;
const r6 = [];
let c27891_0 = r6;
let r2 = r8[1][Symbol.iterator]();
const next = r2.next;
const r4 = $env.$parent;
while (true) {
const r12 = r2 === void 0 ? void 0 : (r25 = next.call(r2)).done ? r2 = void 0 : r25.value;
if (r2 === void 0) {
return () => {
for (const item5 of c27891_0) {
item5();
}
};
}
try {
r6.push((0, r4[20])(r8[0], r12, a0));
} catch (r32) {
if (r2 !== void 0 && typeof r2.return === "function") {
try {
r2.return();
} catch {}
}
throw r32;
}
}
};
}
function $mk95159($env) {
return () => {
const r0 = $env;
return r0[1].delete(r0[0]);
};
}
function $mk95160($env) {
return () => {
let env27892;
const r0 = $env;
const r2 = r0[0];
const r5 = r0[1].split("\x00");
const r7 = env27892 = {
$parent: $env.$parent
};
env27892[0] = r2;
env27892[1] = r5;
env27892[2] = [];
env27892[3] = [];
return {
get: $mk95157(r7),
subscribe: $mk95158(r7)
};
};
}
function $mk95164($env) {
return () => {
const r3 = $env[0];
r3.queuedFullDrawDistancePrewarm = void 0;
const triggerCalculateItemsInView = r3.triggerCalculateItemsInView;
if (triggerCalculateItemsInView != null) {
triggerCalculateItemsInView.call(r3);
}
};
}
function $mk95167($env) {
return () => {
const r4 = $env[0];
const scrollingTo2 = r4.state.scrollingTo;
if (scrollingTo2) {
const state14 = r4.state;
state14.animFrameCheckFinishedScroll = void 0;
const r11 = $env.$parent;
const r7 = (0, r11[62])(r4, scrollingTo2);
let isAtResolvedTarget = r7.isAtResolvedTarget;
if (isAtResolvedTarget) {
const clampedTargetOffset = r7.clampedTargetOffset;
const isInitialScroll = scrollingTo2.isInitialScroll;
isAtResolvedTarget = (isInitialScroll ? state14.hasScrolled : !isInitialScroll) || clampedTargetOffset <= 1;
}
if (isAtResolvedTarget) {
(0, r11[60])(r4);
}
}
};
}
function $mk95174($env) {
return () => {
const r5 = $env[0];
const initialScrollSession = r5.initialScrollSession;
if (initialScrollSession?.kind === "bootstrap" ? r5.initialScrollSession.bootstrap : void 0) {
const triggerCalculateItemsInView = r5.triggerCalculateItemsInView;
if (triggerCalculateItemsInView != null) {
triggerCalculateItemsInView.call(r5, {
forceFullItemPositions: true
});
}
}
};
}
function $mk95175($env) {
return () => {
const r5 = $env;
const r4 = r5[1];
const initialScrollSession = r4.initialScrollSession;
const r9 = initialScrollSession?.kind === "bootstrap" ? r4.initialScrollSession.bootstrap : void 0;
if (r9) {
r9.frameHandle = void 0;
r9.mountFrameCount = r9.mountFrameCount + 1;
const r14 = $env.$parent;
const r15 = r14[78];
const r16 = r5[0];
if (!r15(r16, {
mountFrameCount: r9.mountFrameCount,
passCount: r9.passCount
})) {
let env27894;
const r21 = env27894 = {
$parent: r14
};
env27894[0] = r16;
const state14 = r16.state;
env27894[1] = state14;
const initialScrollSession2 = state14.initialScrollSession;
const r26 = initialScrollSession2?.kind === "bootstrap" ? state14.initialScrollSession.bootstrap : void 0;
if (r26 && r26.frameHandle === void 0) {
r26.frameHandle = requestAnimationFrame($mk95175(r21));
}
}
}
};
}
function $mk95176($env) {
return () => {
L11: {
const r8 = $env;
const r5 = r8[2];
const preservedEndAnchorCorrection = r5.preservedEndAnchorCorrection;
const preservedEndAnchorCorrection2 = r8[1];
if (preservedEndAnchorCorrection === preservedEndAnchorCorrection2) {
const r6 = $env.$parent;
const r7 = r6[83];
const r14 = r8[0];
const r11 = r7(r14);
if (r11 !== void 0 && !(Math.abs(r11) <= 1)) {
const lastRequestTime = preservedEndAnchorCorrection.lastRequestTime;
let r2 = !lastRequestTime;
if (lastRequestTime) {
const lastNativeScrollTime = r5.lastNativeScrollTime;
r2 = (lastNativeScrollTime ?? 0) > preservedEndAnchorCorrection.lastRequestTime;
}
if (r2) {
preservedEndAnchorCorrection.lastRequestTime = Date.now();
(0, r6[65])(r14, r11);
}
let env27895;
const r27 = env27895 = {
$parent: r6
};
env27895[0] = r14;
env27895[1] = preservedEndAnchorCorrection2;
const state14 = r14.state;
env27895[2] = state14;
state14.preservedEndAnchorCorrection = preservedEndAnchorCorrection2;
requestAnimationFrame($mk95176(r27));
break L11;
}
r5.preservedEndAnchorCorrection = void 0;
}
}
};
}
function $mk95179($env) {
return () => {
let r57, r104, r105, r106, r142, r151, r166, r747, r823, r843, queuedInitialLayout;
const r1 = $env;
let env27897 = {
$parent: $env
};
let r12 = void 0;
const r2 = r1[2];
const { columns, containerItemKeys } = r2;
env27897[0] = containerItemKeys;
let enableScrollForNextCalculateItemsInView = r2.enableScrollForNextCalculateItemsInView;
const idCache = r2.idCache;
env27897[1] = idCache;
const { indexByKey: indexByKey2, minIndexSizeChanged, positions: positions2, props } = r2;
const alwaysRenderIndicesArr = props.alwaysRenderIndicesArr;
env27897[2] = props.alwaysRenderIndicesSet;
const getItemType = props.getItemType;
env27897[3] = getItemType;
const keyExtractor2 = props.keyExtractor;
env27897[4] = props.onStickyHeaderChange;
const { scrollForNextCalculateItemsInView, scrollLength } = r2;
env27897[5] = scrollLength;
const { sizes, startBufferedId, viewabilityConfigCallbackPairs: viewabilityConfigCallbackPairs2 } = r2;
const data3 = r2.props.data;
env27897[6] = data3;
const r23 = r2.props.stickyHeaderIndicesArr || [];
env27897[7] = r23;
const r40 = r2.props.stickyHeaderIndicesSet || new Set();
const r116 = $env.$parent;
const r7 = r116[46];
const r6 = r1[0];
const r9 = r1[1];
const r22 = r7(r6, r9.drawDistanceMode);
const { dataChanged, doMVCP, forceFullItemPositions } = r9;
const initialScrollSession = r2.initialScrollSession;
const r25 = initialScrollSession?.kind === "bootstrap" ? r2.initialScrollSession.bootstrap : void 0;
const r126 = !r25;
const r127 = r116[21];
const r17 = r127(r6, "numContainers");
if (data3 && scrollLength !== 0 && r17) {
const r38 = r116[25];
env27897[8] = r38(r6);
env27897[9] = r127(r6, "stylePaddingTop") + r127(r6, "alignItemsAtEndPadding") + r127(r6, "headerSize");
const r139 = r127(r6, "numColumns");
let scrollVelocity = r9.scrollVelocity;
if (scrollVelocity == null) {
scrollVelocity = (0, r116[69])(r2);
}
L25: {
r142 = !r126;
const initialScroll2 = r2.initialScroll;
queuedInitialLayout = r2.queuedInitialLayout;
if (r142) {
let r154 = r25?.scroll;
if (r154 == null) {
r154 = r2.scroll;
}
r151 = r154;
} else {
if (!queuedInitialLayout && (0, r116[41])(r2) && initialScroll2) {
r151 = (0, r116[75])(r6, initialScroll2);
break L25;
}
r151 = r2.scroll;
}
}
env27897[10] = 0;
env27897[11] = 0;
env27897[12] = 0;
env27897[13] = 0;
env27897[14] = 0;
env27897[15] = 0;
env27897[16] = r151;
const updateScroll2 = (a0) => {
env27897[16] = a0;
const r10 = env27897.$parent[0].values.get("scrollAdjustPending");
const r12 = r10 ?? 0;
env27897[10] = r12;
env27897[11] = r12 - env27897[9];
const r20 = Math.round(a0 + 0 + env27897[11]);
env27897[12] = r20;
const r21 = env27897[5];
const r22 = r20 + r21;
const r23 = env27897[8];
if (r22 > r23) {
env27897[12] = Math.max(0, r23 - r21);
}
};
updateScroll2(r151);
const r159 = r127(r6, "activeStickyIndex");
env27897[17] = r159;
const resolveStickyState = () => {
const r13 = env27897[7];
const r6 = r13.length > 0;
let r12 = -1;
let currentStickyIdx = -1;
if (r6) {
const r10 = env27897[12];
const positions2 = env27897.$parent[2].positions;
let r0 = r13.length - 1;
let r2 = -1;
while (0 <= r0) {
const r21 = positions2[r13[r0]];
const r1 = r0;
if (r21 !== void 0) {
r2 = r1;
if (r10 >= r21) {
break;
}
}
r0 = r1 - 1;
r2 = -1;
}
currentStickyIdx = r2;
}
if (0 <= currentStickyIdx) {
r12 = r13[currentStickyIdx];
}
let r23 = currentStickyIdx >= 0;
const index2 = r12;
const r24 = env27897[17];
if (!(0 <= currentStickyIdx)) {
r23 = r24 >= 0;
}
if (r23) {
(0, env27897.$parent.$parent[22])(env27897.$parent[0], "activeStickyIndex", index2);
}
return {
currentStickyIdx,
finishCalculateItemsInView: env27897[4] ? r13.length > 0 ? r24 !== index2 ? () => {
const item5 = env27897[6][index2];
if (item5 !== void 0) {
const r7 = env27897[4];
if (r7 != null) {
r7({
index: index2,
item: item5
});
}
}
} : void 0 : void 0 : void 0
};
};
let r161 = dataChanged ? void 0 : resolveStickyState();
L32: {
L31: {
env27897[18] = r22;
env27897[19] = r22;
if (!(scrollVelocity > 0)) {
if (scrollVelocity === 0 && env27897[12] < Math.max(50, r22)) {
break L31;
}
r57 = 1.5 * r22;
env27897[18] = r57;
r166 = 0.5 * r22;
env27897[19] = r166;
break L32;
}
}
const r168 = 0.5 * r22;
env27897[18] = r168;
const r170 = 1.5 * r22;
env27897[19] = r170;
r166 = r170;
r57 = r168;
}
const r171 = dataChanged ? 0 : forceFullItemPositions ? 0 : r142 ? 0 : (0, r116[41])(r2) ? 0 : r2.scrollingTo ? 0 : r2.pendingNativeMVCPAdjust ? 0 : r127(r6, "readyToRender") ? (function getProjectedBufferAdjustment(a0, a1) {
if (a1 <= 0) {
return 0;
}
const r12 = Math.min(1, Math.abs(a0) / 4);
return Math.sign(a0) * a1 * r12;
})(scrollVelocity, Math.min(r57, r166)) : 0;
env27897[20] = r171;
const updateScrollRange = () => {
const r9 = Math.max(0, env27897[12]);
env27897[14] = Math.max(r9, env27897[12] + env27897[5] + Math.max(0, -env27897[16]));
const r21 = r9 - env27897[18];
const r22 = env27897[20];
env27897[13] = r21 + r22;
env27897[15] = env27897[14] + env27897[19] + r22;
};
updateScrollRange();
if (r171 !== 0) {
(function scheduleRenderRangeProjectionSettle({ state: state13 }) {
let c30823_1;
const timeoutRenderRangeProjectionSettle = state13.timeoutRenderRangeProjectionSettle;
if (timeoutRenderRangeProjectionSettle !== void 0) {
clearTimeout(timeoutRenderRangeProjectionSettle);
state13.timeouts.delete(timeoutRenderRangeProjectionSettle);
}
const timeoutRenderRangeProjectionSettle2 = setTimeout(() => {
state13.timeoutRenderRangeProjectionSettle = void 0;
state13.timeouts.delete(c30823_1);
state13.scrollHistory.length = 0;
const triggerCalculateItemsInView = state13.triggerCalculateItemsInView;
if (triggerCalculateItemsInView != null) {
triggerCalculateItemsInView.call(state13);
}
}, 100);
c30823_1 = timeoutRenderRangeProjectionSettle2;
state13.timeoutRenderRangeProjectionSettle = timeoutRenderRangeProjectionSettle2;
state13.timeouts.add(timeoutRenderRangeProjectionSettle2);
})(r6);
}
L66: {
if (enableScrollForNextCalculateItemsInView && !r142 && !dataChanged && !forceFullItemPositions && scrollForNextCalculateItemsInView) {
const { top, bottom } = scrollForNextCalculateItemsInView;
const r194 = top === null;
if (r194 && bottom === null) {
r2.scrollForNextCalculateItemsInView = void 0;
break L66;
}
if (!r194 && !(env27897[13] > top)) {
break L66;
}
if (bottom !== null && !(env27897[15] < bottom)) {
break L66;
}
if (viewabilityConfigCallbackPairs2) {
const r91 = env27897[12];
const r90 = env27897[14];
$mk110482(r116)(r6, viewabilityConfigCallbackPairs2, scrollLength, r91, r90);
} else if (r2.props.onFirstVisibleItemChanged) {
const r200 = r116[102];
const r203 = env27897[12];
r200(r2, $mk110483(r116)(r6, r203));
}
const finishCalculateItemsInView = r161?.finishCalculateItemsInView;
if (finishCalculateItemsInView != null) {
const r214 = finishCalculateItemsInView.call(r161);
}
return void 0;
}
}
const r218 = doMVCP ? r142 ? void 0 : (0, r116[68])(r6, dataChanged) : void 0;
if (dataChanged) {
(0, r116[86])(r2);
}
let startIndex = 0;
if (!forceFullItemPositions) {
startIndex = 0;
if (!dataChanged) {
let r225 = minIndexSizeChanged;
if (r225 == null) {
r225 = r2.startBuffered;
}
startIndex = r225 ?? 0;
}
}
r116[89](r6, dataChanged, {
doMVCP,
forceFullUpdate: !!forceFullItemPositions,
optimizeForVisibleWindow: (forceFullItemPositions ? !forceFullItemPositions : !dataChanged) && r139 > 1 && minIndexSizeChanged !== void 0,
scrollBottomBuffered: env27897[15],
scrollVelocity,
startIndex
});
const r63 = r38(r6);
env27897[8] = r63;
if (minIndexSizeChanged !== void 0) {
r2.minIndexSizeChanged = void 0;
}
let r240 = void 0;
if (dataChanged) {
r240 = void 0;
if (doMVCP) {
const data4 = r2.props.maintainVisibleContentPosition.data;
r240 = void 0;
if (data4) {
const didContainersLayout = r2.didContainersLayout;
r240 = void 0;
if (didContainersLayout) {
const r250 = r2.idsInView.length > 0;
r240 = void 0;
if (r250) {
const shouldRestorePosition2 = r2.props.maintainVisibleContentPosition.shouldRestorePosition;
const set2 = new Set();
let r263 = r2.idsInView[Symbol.iterator]();
const next = r263.next;
while (true) {
const r266 = r263 === void 0 ? void 0 : (r104 = next.call(r263)).done ? r263 = void 0 : r104.value;
const r267 = r263;
r240 = set2;
if (r267 === void 0) {
break;
}
try {
const r270 = indexByKey2.get(r266);
if (r270 !== void 0) {
let r272 = shouldRestorePosition2;
if (r272) {
r272 = !shouldRestorePosition2(data3[r270], r270, data3);
}
if (!r272) {
set2.add(r266);
}
}
} catch (r279) {
if (r263 !== void 0 && typeof r263.return === "function") {
try {
r263.return();
} catch {}
}
throw r279;
}
}
}
}
}
}
}
const r280 = r1[2];
const scroll2 = r280.scroll;
const r283 = r116[21];
const r285 = r1[0];
const r288 = r283(r285, "scrollAdjustPending");
const r290 = r288 ?? 0;
if (r218 != null) {
r218();
}
let r293 = !!r218;
if (r293) {
let r296 = r280.scroll !== scroll2;
if (!r296) {
const r299 = r283(r285, "scrollAdjustPending");
r296 = (r299 ?? 0) !== r290;
}
r293 = r296;
}
if (r293) {
updateScroll2(r280.scroll);
updateScrollRange();
}
if (dataChanged) {
r161 = resolveStickyState();
}
let r306 = r142 ? r25?.targetIndexSeed : void 0;
if (r306 == null) {
r306 = (dataChanged ? !dataChanged : startBufferedId) && indexByKey2.get(startBufferedId) || 0;
}
let r311 = r306;
let r312 = r311;
let r313 = r312;
if (r313 >= 0) {
do {
let r314 = idCache[r311];
const r315 = r311;
const r316 = r312;
if (r314 == null) {
r314 = (0, r116[49])(r1[2], r315);
}
const r320 = positions2[r315];
let r322 = sizes.get(r314);
const r323 = r314;
if (r322 == null) {
r322 = (0, r116[58])(r1[0], r323, r315, data3[r315]);
}
const r332 = r320 + r322;
const r333 = env27897[13];
r313 = r316;
if (!(r332 > r333)) {
break;
}
r311 = r315 - 1;
r312 = r315;
r313 = r312;
} while (r311 >= 0);
}
let r335 = r313;
if (r139 > 1) {
let r336 = r313;
r335 = r336;
if (r335 > 0) {
do {
const r337 = columns[r336];
const r338 = r336;
r335 = r338;
if (r337 === 1) {
break;
}
r335 = r338;
if (r337 === void 0) {
break;
}
r336 = r338 - 1;
r335 = r336;
} while (0 < r335);
}
}
const r339 = 0 < r17;
let r342 = 0;
let r343 = 0;
let r62 = 0;
if (r339) {
do {
const r351 = (0, r116[21])(r1[0], `containerItemKey${r342}`);
const r352 = r342;
const r353 = r343;
const r354 = r351 !== void 0 ? Math.max(r353, indexByKey2.get(r351)) : r353;
r342 = r352 + 1;
r343 = r354;
r62 = r343;
} while (r342 < r17);
}
const r359 = {
endNoBuffer: null,
firstFullyOnScreenIndex: void 0,
startNoBuffer: null
};
const length = data3.length;
env27897[21] = length;
const r363 = Math.max(0, r335);
const r66 = r363 < length;
let r366 = r363;
let r367 = false;
let r368 = void 0;
let r369 = void 0;
let r370 = null;
let r371 = null;
let r372 = null;
let bottom2 = void 0;
let top2 = void 0;
let endBuffered2 = null;
let startBufferedId2 = null;
let startBuffered2 = null;
if (r66) {
while (true) {
let r68 = idCache[r366];
const r378 = r366;
const r83 = r367;
let r80 = r368;
let r76 = r369;
let r79 = r370;
let r74 = r371;
let r73 = r372;
if (r68 == null) {
r68 = (0, r116[49])(r1[2], r378);
}
let r85 = sizes.get(r68);
const r75 = r68;
if (r85 == null) {
r85 = (0, r116[58])(r1[0], r75, r378, data3[r378]);
}
const r84 = positions2[r378];
let r71 = r80;
let r70 = r76;
let r389 = r79;
let r390 = r74;
let r391 = r73;
let r72 = r83;
if (!r72) {
(0, r116[100])(r359, r378, r84, r85, env27897[12], env27897[14]);
if (r73 === null && r84 + r85 > env27897[13]) {
r76 = env27897[13] < 0 ? null : r84;
r74 = r75;
r73 = r378;
}
const startNoBuffer = r359.startNoBuffer;
let r403 = r83;
let r404 = r80;
let r405 = r79;
if (startNoBuffer !== null) {
const r82 = r84 <= env27897[15];
let r407 = true;
if (r82) {
r80 = env27897[15] > r63 ? null : r84 + r85;
r407 = r83;
r79 = r378;
}
r403 = r407;
r404 = r80;
r405 = r79;
}
r72 = r403;
r71 = r404;
r389 = r405;
r70 = r76;
r390 = r74;
r391 = r73;
}
const r409 = r378 + 1;
bottom2 = r71;
top2 = r70;
endBuffered2 = r389;
startBufferedId2 = r390;
startBuffered2 = r391;
if (!(r409 < length)) {
break;
}
r366 = r409;
r367 = r72;
r368 = r71;
r369 = r70;
r370 = r389;
r371 = r390;
r372 = r391;
if (r72) {
r367 = r72;
r368 = r71;
r369 = r70;
r370 = r389;
r371 = r390;
r372 = r391;
bottom2 = r368;
top2 = r369;
endBuffered2 = r370;
startBufferedId2 = r371;
startBuffered2 = r372;
r366 = r409;
if (!(r366 <= r62)) {
break;
}
}
}
}
const r410 = Object;
const r412 = r1[2];
r410.assign(r412, {
endBuffered: endBuffered2,
endNoBuffer: r359.endNoBuffer,
firstFullyOnScreenIndex: r359.firstFullyOnScreenIndex,
idsInView: (0, r116[101])(r412, r359),
startBuffered: startBuffered2,
startBufferedId: startBufferedId2,
startNoBuffer: r359.startNoBuffer
});
if (enableScrollForNextCalculateItemsInView) {
enableScrollForNextCalculateItemsInView = top2 !== void 0;
}
if (enableScrollForNextCalculateItemsInView) {
enableScrollForNextCalculateItemsInView = bottom2 !== void 0;
}
if (enableScrollForNextCalculateItemsInView) {
const r422 = r116[54];
r412.scrollForNextCalculateItemsInView = r422(top2) ? r422(bottom2) ? void 0 : {
bottom: bottom2,
top: top2
} : {
bottom: bottom2,
top: top2
};
}
let r427 = r17;
const r428 = [];
if (dataChanged) {
const r430 = 0 < r427;
let r431 = 0;
if (r430) {
do {
const r439 = (0, r116[21])(r1[0], `containerItemKey${r431}`);
let r440 = !keyExtractor2;
const r441 = r431;
if (keyExtractor2) {
r440 = r439 && indexByKey2.get(r439) === void 0;
}
if (r440) {
r428.push(r441);
}
r431 = r441 + 1;
} while (r431 < r427);
}
}
const r448 = r1[2];
let r449 = r448;
const scrollTargetPinnedRange = r448.scrollTargetPinnedRange;
env27897[22] = 0;
env27897[23] = -1;
let r452 = -1;
let r453 = 0;
if (scrollTargetPinnedRange) {
const r461 = Math.max(0, Math.min(scrollTargetPinnedRange.start, scrollTargetPinnedRange.end));
env27897[22] = r461;
const r470 = Math.min(length - 1, Math.max(scrollTargetPinnedRange.start, scrollTargetPinnedRange.end));
env27897[23] = r470;
r452 = r470;
r453 = r461;
}
const r471 = r453 <= r452;
env27897[24] = r471;
const isPinnedRenderIndex = (a0) => env27897[2].has(a0) || env27897[24] && a0 >= env27897[22] && a0 <= env27897[23];
if (startBuffered2 !== null && endBuffered2 !== null) {
const r473 = [];
env27897[25] = r473;
const set3 = new Set();
env27897[26] = set3;
const addPinnedIndex = (a0) => {
if (a0 >= 0 && a0 < env27897[21]) {
let r13 = env27897[1][a0];
if (r13 == null) {
const r8 = env27897.$parent[2];
const props = r8.props;
const { data: data3, keyExtractor: keyExtractor2 } = props;
let r15 = "";
if (data3) {
const r16 = a0 < data3.length ? keyExtractor2 ? keyExtractor2(data3[a0], a0) : a0 : null;
r8.idCache[a0] = r16;
r15 = r16;
}
r13 = r15;
}
const r22 = env27897[0].get(r13);
if (r22 !== void 0) {
env27897.$parent[2].stickyContainerPool.add(r22);
} else if (!(r13 == null || env27897[26].has(a0))) {
env27897[26].add(a0);
env27897[25].push(a0);
}
}
};
let r480 = startBuffered2;
while (r480 <= endBuffered2) {
let r481 = idCache[r480];
const r482 = r480;
if (r481 == null) {
r481 = (0, r116[49])(r1[2], r482);
}
if (!containerItemKeys.has(r481)) {
set3.add(r482);
r473.push(r482);
}
r480 = r482 + 1;
}
let r493 = alwaysRenderIndicesArr[Symbol.iterator]();
const next2 = r493.next;
while (true) {
const r496 = r493 === void 0 ? void 0 : (r105 = next2.call(r493)).done ? r493 = void 0 : r105.value;
if (r493 === void 0) {
if (r471) {
while (r453 <= r452) {
addPinnedIndex(r453);
r453 = r453 + 1;
}
}
if (r23.length > 0) {
const r507 = r1[0];
const currentStickyIdx = r161?.currentStickyIdx;
const r512 = currentStickyIdx ?? -1;
$mk110486(r116)(r507, r23, r512, r473, set3, startBuffered2, endBuffered2);
} else if (r159 !== -1) {
(0, r116[22])(r1[0], "activeStickyIndex", -1);
}
if (r473.length > 0) {
const r523 = getItemType ? (a0) => {
const r6 = (0, env27897[3])(env27897[6][a0], a0);
return r6 !== void 0 ? String(r6) : "";
} : void 0;
const r524 = r1[0];
let r537 = $mk110488(r116)(r524, r473, startBuffered2, endBuffered2, r428, r523, r240)[Symbol.iterator]();
const next3 = r537.next;
while (true) {
const r543 = r537 === void 0 ? void 0 : (r106 = next3.call(r537)).done ? r537 = void 0 : r106.value;
if (r537 === void 0) {
if (r427 === r17) {
break;
}
const r672 = r116[22];
const r674 = r1[0];
const r676 = r427;
r672(r674, "numContainers", r676);
if (!(r676 > (0, r116[21])(r674, "numContainersPooled"))) {
break;
}
r672(r674, "numContainersPooled", (function getExpandedContainerPoolSize(a0, a1) {
return a0 <= 0 ? 0 : a1 <= 0 ? 0 : Math.min(Math.max(a0, a1), Math.max(a1, Math.ceil(1.5 * a1)));
})(length, r427));
break;
}
try {
const { itemIndex: itemIndex3, containerIndex } = r543;
const r549 = idCache[itemIndex3];
const r556 = r549 ?? (0, r116[49])(r1[2], itemIndex3);
const r557 = r116[21];
const r559 = r1[0];
let r565 = r557(r559, `containerItemKey${containerIndex}`);
const r566 = r565;
if (r565) {
r565 = r566 !== r556;
}
if (r565) {
containerItemKeys.delete(r566);
}
if (r566 !== r556) {
if (r12 == null) {
r12 = new Set();
}
const r579 = r12;
r579.add(containerIndex);
const r583 = r1[2];
const containerItemGenerations = r583.containerItemGenerations;
const r587 = r583.containerItemGenerations[containerIndex];
containerItemGenerations[containerIndex] = (r587 ?? 0) + 1;
}
const r592 = r116[22];
const r598 = `containerItemKey${containerIndex}`;
r592(r559, r598, r556);
const r603 = `containerItemIndex${containerIndex}`;
r592(r559, r603, itemIndex3);
r592(r559, `containerItemData${containerIndex}`, data3[itemIndex3]);
const r611 = r1[2];
r611.containerItemMetadata.set(containerIndex, (0, r116[28])(r611, itemIndex3, data3[itemIndex3], r543.itemType));
containerItemKeys.set(r556, containerIndex);
const userScrollAnchorReset = r611.userScrollAnchorReset;
if (userScrollAnchorReset != null) {
userScrollAnchorReset.keys.add(r556);
}
const r636 = `containerSticky${containerIndex}`;
const r639 = r40.has(itemIndex3);
const r640 = isPinnedRenderIndex(itemIndex3);
if (r639) {
r592(r559, r636, true);
r611.stickyContainerPool.add(containerIndex);
} else {
if (r557(r559, r636)) {
r592(r559, r636, false);
}
const stickyContainerPool = r611.stickyContainerPool;
if (r640) {
stickyContainerPool.add(containerIndex);
} else {
stickyContainerPool.delete(containerIndex);
}
}
if (containerIndex >= r427) {
r427 = containerIndex + 1;
}
} catch (r670) {
if (r537 !== void 0 && typeof r537.return === "function") {
try {
r537.return();
} catch {}
}
throw r670;
}
}
}
const r688 = r1[2];
r449 = r688;
const userScrollAnchorReset2 = r688.userScrollAnchorReset;
if ((userScrollAnchorReset2 == null ? void 0 : userScrollAnchorReset2.keys.size) !== 0) {
break;
}
r449.userScrollAnchorReset = void 0;
break;
}
try {
addPinnedIndex(r496);
} catch (r499) {
if (r493 !== void 0 && typeof r493.return === "function") {
try {
r493.return();
} catch {}
}
throw r499;
}
}
}
if (r449.stickyContainerPool.size > 0) {
const r697 = r1[0];
const r699 = env27897[12];
const currentStickyIdx2 = r161?.currentStickyIdx;
const r703 = currentStickyIdx2 ?? -1;
$mk110490(r116)(r697, r23, r699, r22, r703, r428, isPinnedRenderIndex);
}
const r716 = r428.length > 0 ? new Set(r428) : void 0;
const r723 = 0 < r427;
let r730 = 0;
let r731 = false;
if (r723) {
do {
const r732 = r116[21];
const r734 = r1[0];
const r739 = r732(r734, `containerItemKey${r730}`);
const r740 = r716 == null;
const r741 = r730;
const r742 = r731;
if (r740 ? void 0 : r716.has(r741)) {
if (r739 !== void 0) {
containerItemKeys.delete(r739);
if (r12 == null) {
r12 = new Set();
}
r12.add(r741);
const r768 = r1[2];
const containerItemGenerations2 = r768.containerItemGenerations;
const r772 = r768.containerItemGenerations[r741];
containerItemGenerations2[r741] = (r772 ?? 0) + 1;
}
const r776 = r1[2];
r776.containerItemMetadata.delete(r741);
if (r776.stickyContainerPool.has(r741)) {
(0, r116[22])(r734, `containerSticky${r741}`, false);
r776.stickyContainerPool.delete(r741);
}
const r795 = r116[22];
r795(r734, `containerItemKey${r741}`, void 0);
r795(r734, `containerItemIndex${r741}`, void 0);
r795(r734, `containerItemData${r741}`, void 0);
r795(r734, `containerPosition${r741}`, r116[32]);
r795(r734, `containerColumn${r741}`, -1);
r795(r734, `containerSpan${r741}`, 1);
r747 = r742;
} else {
const r746 = indexByKey2.get(r739);
r747 = r746 !== void 0 ? (0, r116[88])(r734, r741, r746, {
scrollAdjustPending: env27897[10],
updateLayout: true
}).didChangePosition || r742 : r742;
}
r730 = r741 + 1;
r823 = r427;
r731 = r747;
} while (r730 < r823);
}
if (r12 && r116[27]) {
(0, r116[87])(r1[0], r12);
}
if (r142) {
(0, r116[84])(r1[0]);
} else {
const r829 = r116[102];
const r830 = r1[2];
r829(r830, r359.startNoBuffer);
if (!queuedInitialLayout && !r830.didContainersLayout) {
const r838 = (0, r116[41])(r830);
const r839 = r116[77];
if (r838) {
r843 = r839(r830, r830.startBuffered, r830.endBuffered);
} else {
r843 = r839(r830, r830.startNoBuffer, r830.endNoBuffer);
if (!r843) {
r843 = r839(r830, r830.startBuffered, r830.endBuffered);
}
}
if (r843) {
const r849 = r1[0];
$mk110491(r116)(r849);
$mk110492(r116)(r849);
}
}
if (viewabilityConfigCallbackPairs2 && r359.startNoBuffer !== null && r359.endNoBuffer !== null) {
const r858 = r116[91];
const r859 = r1[0];
const state14 = r859.state;
const { startNoBuffer: startNoBuffer2, endNoBuffer } = r359;
if (startBuffered2 == null) {
startBuffered2 = r359.startNoBuffer;
}
if (endBuffered2 == null) {
endBuffered2 = r359.endNoBuffer;
}
r858(state14, r859, viewabilityConfigCallbackPairs2, scrollLength, startNoBuffer2, endNoBuffer, startBuffered2, endBuffered2);
}
const finishCalculateItemsInView2 = r161?.finishCalculateItemsInView;
if (finishCalculateItemsInView2 != null) {
finishCalculateItemsInView2.call(r161);
}
}
}
};
}
function $mk95184($env) {
return () => (0, $env[0])();
}
function $mk95186($env) {
return (a0) => {
const r2 = $env;
(0, r2[3])(a0.nativeEvent.layout, false);
const r8 = r2[2];
if (r8 != null) {
r8(a0);
}
};
}
function $mk95187($env) {
return () => {
const r1 = $env;
if (r1[1] && r1[0].current) {
r1[0].current.measure($mk110497(r1));
}
};
}
function $mk95193($env) {
return () => $env.$parent[12].forwardRef($mk110502($env));
}
function $mk95195($env) {
return () => {
const r1 = $env;
return r1[0] ? $mk110503(r1) : void 0;
};
}
function $mk110482($env) {
return function updateViewabilityForCachedRange(a0, a1, a2, a3, a4) {
let length;
const state14 = a0.state;
const { endBuffered: endBuffered2, idCache, positions: positions2 } = state14;
const data3 = state14.props.data;
const { sizes, startBuffered: startBuffered2 } = state14;
if (startBuffered2 !== null && endBuffered2 !== null && !(startBuffered2 < 0) && !(endBuffered2 < startBuffered2)) {
const r48 = $env;
const r7 = startBuffered2 <= endBuffered2;
let startNoBuffer = null;
let firstFullyOnScreenIndex = void 0;
let endNoBuffer = null;
if (r7) {
const r3 = startBuffered2 < data3.length;
let r21 = null;
let r20 = void 0;
let r19 = null;
let r12 = startBuffered2;
startNoBuffer = null;
firstFullyOnScreenIndex = void 0;
endNoBuffer = null;
if (r3) {
do {
let r34 = idCache[r12];
let r33 = r21;
let r32 = r20;
let r30 = r19;
const r49 = r12;
if (r34 == null) {
const props = state14.props;
const { data: data4, keyExtractor: keyExtractor2 } = props;
let r50 = "";
if (data4) {
const r52 = r49 < data4.length ? keyExtractor2 ? keyExtractor2(data4[r49], r49) : r49 : null;
state14.idCache[r49] = r52;
r50 = r52;
}
r34 = r50;
}
let r56 = sizes.get(r34);
const r57 = r34;
if (r56 == null) {
r56 = (0, r48[58])(a0, r57, r49, data3[r49]);
}
const r59 = positions2[r49];
if (r33 === null && r59 + r56 > a3) {
r33 = r49;
}
if (r32 === void 0 && r59 >= a3 - 10 && r59 <= a4) {
r32 = r49;
}
let r63 = r30;
let r64 = false;
if (r33 !== null) {
const r9 = r59 <= a4;
let r4 = true;
if (r9) {
r30 = r49;
r4 = false;
}
r63 = r30;
r64 = r4;
}
startNoBuffer = r33;
firstFullyOnScreenIndex = r32;
endNoBuffer = r63;
if (r64) {
break;
}
const r65 = r49 + 1;
startNoBuffer = r33;
firstFullyOnScreenIndex = r32;
endNoBuffer = r63;
if (!(r65 <= endBuffered2)) {
break;
}
length = data3.length;
r21 = r33;
r20 = r32;
r19 = r63;
startNoBuffer = r21;
firstFullyOnScreenIndex = r20;
endNoBuffer = r19;
r12 = r65;
} while (r12 < length);
}
}
const r68 = Object;
const r70 = {
endNoBuffer,
firstFullyOnScreenIndex,
idsInView: null,
startNoBuffer: null
};
if (firstFullyOnScreenIndex == null) {
firstFullyOnScreenIndex = startNoBuffer;
}
const idsInView = [];
if (firstFullyOnScreenIndex != null && endNoBuffer !== null) {
while (firstFullyOnScreenIndex <= endNoBuffer) {
let r74 = state14.idCache[firstFullyOnScreenIndex];
const r75 = firstFullyOnScreenIndex;
if (r74 == null) {
const props2 = state14.props;
const { data: data5, keyExtractor: keyExtractor3 } = props2;
let r79 = "";
if (data5) {
const r82 = r75 < data5.length ? keyExtractor3 ? keyExtractor3(data5[r75], r75) : r75 : null;
state14.idCache[r75] = r82;
r79 = r82;
}
r74 = r79;
}
idsInView.push(r74);
firstFullyOnScreenIndex = r75 + 1;
}
}
r70.idsInView = idsInView;
r70.startNoBuffer = startNoBuffer;
r68.assign(state14, r70);
(0, r48[102])(state14, startNoBuffer);
if (startNoBuffer !== null && endNoBuffer !== null) {
(0, r48[91])(state14, a0, a1, a2, startNoBuffer, endNoBuffer, startBuffered2, endBuffered2);
}
}
};
}
function $mk110483($env) {
return function findFirstVisibleIndexInCachedRange(a0, a1) {
let length;
const r16 = $env;
const state14 = a0.state;
const { endBuffered: endBuffered2, idCache, positions: positions2 } = state14;
const data3 = state14.props.data;
const sizes = state14.sizes;
let startBuffered2 = state14.startBuffered;
if (startBuffered2 !== null && endBuffered2 !== null && !(startBuffered2 < 0) && !(endBuffered2 < startBuffered2)) {
if (startBuffered2 <= endBuffered2 && startBuffered2 < data3.length) {
do {
let r17 = idCache[startBuffered2];
const r28 = startBuffered2;
if (r17 == null) {
const props = state14.props;
const { data: data4, keyExtractor: keyExtractor2 } = props;
let r29 = "";
if (data4) {
const r30 = r28 < data4.length ? keyExtractor2 ? keyExtractor2(data4[r28], r28) : r28 : null;
state14.idCache[r28] = r30;
r29 = r30;
}
r17 = r29;
}
const r34 = sizes.get(r17);
const r35 = r17;
let r36 = r34;
if (r36 == null) {
r36 = (0, r16[58])(a0, r35, r28, data3[r28]);
}
if (positions2[r28] + r36 > a1) {
return r28;
}
const r40 = r28 + 1;
if (!(r40 <= endBuffered2)) {
break;
}
length = data3.length;
startBuffered2 = r40;
} while (startBuffered2 < length);
}
return null;
}
return null;
};
}
function $mk110486($env) {
return function handleStickyActivation(a0, a1, a2, a3, a4, a5, a6) {
const r18 = $env;
const state14 = a0.state;
r18[22](a0, "activeStickyIndex", a2 >= 0 ? a1[a2] : -1);
let r0 = 0;
while (true) {
const r1 = a2 - r0;
const r2 = r0;
if (!(r1 < 0)) {
const r29 = a1[r1];
if (!(0, r18[99])(a0, r29)) {
let r23 = state14.idCache[r29];
if (r23 == null) {
const props = state14.props;
const { data: data3, keyExtractor: keyExtractor2 } = props;
let r33 = "";
if (data3) {
const r35 = r29 < data3.length ? keyExtractor2 ? keyExtractor2(data3[r29], r29) : r29 : null;
state14.idCache[r29] = r35;
r33 = r35;
}
r23 = r33;
}
if (r23 && !state14.containerItemKeys.has(r23) && (r29 < a5 || r29 > a6) && !a4.has(r29)) {
a4.add(r29);
a3.push(r29);
}
}
}
r0 = r2 + 1;
if (!(r0 <= 1)) {
return void 0;
}
}
};
}
function $mk110488($env) {
return function findAvailableContainers(a0, a1, a2, a3, a4, a5, a6) {
let env30824 = {
$parent: $env
};
env30824[0] = a5;
const length = a1.length;
if (length === 0) {
return [];
}
const r3 = $env;
const numContainers = (0, r3[21])(a0, "numContainers");
const state14 = a0.state;
env30824[1] = state14;
env30824[2] = state14.containerItemMetadata;
const stickyContainerPool = state14.stickyContainerPool;
const r15 = state14.props.recycleItems && !!state14.props.positionComponentInternal;
const r12 = a4.length > 0 ? new Set(a4) : void 0;
env30824[3] = r12;
const r19 = a1.map((item, index) => {
const r2 = {
isSticky: env30824[1].props.stickyHeaderIndicesSet.has(item),
itemIndex: item,
itemType: null,
order: null
};
const r10 = env30824[0];
r2.itemType = r10 == null ? void 0 : r10(item);
r2.order = index;
return r2;
});
const r24 = r19.filter((item) => !item.isSticky);
const r21 = r19.filter((item) => item.isSticky);
const r23 = [];
const r20 = [];
const r28 = 0 < numContainers;
let r68 = 0;
if (r28) {
do {
const r72 = (0, r3[21])(a0, `containerItemKey${r68}`);
const r31 = r12 == null;
const containerIndex = r68;
const r30 = r31 ? void 0 : r12.has(containerIndex);
L29: {
const r75 = !r30;
if (!(r72 && ((a6 == null ? void 0 : a6.has(r72)) && state14.indexByKey.has(r72)))) {
const r81 = !r75;
if (stickyContainerPool.has(containerIndex)) {
if (r72 === void 0 || r81) {
r20.push({
containerIndex,
distance: Number.POSITIVE_INFINITY
});
}
} else {
if (r72 !== void 0 && !r81) {
if (r15) {
break L29;
}
const r86 = state14.indexByKey.get(r72);
if (r86 === void 0) {
break L29;
}
if (!(r86 < a2) && !(r86 > a3)) {
break L29;
}
r23.push({
containerIndex,
distance: r86 < a2 ? a2 - r86 : r86 - a3
});
break L29;
}
r23.push({
containerIndex,
distance: Number.POSITIVE_INFINITY
});
}
}
}
r68 = containerIndex + 1;
} while (r68 < numContainers);
}
r23.sort(r3[98]);
const array = new Array(length);
env30824[4] = array;
let r110 = numContainers;
env30824[5] = false;
const assign = (a0, a1) => {
env30824[4][a0.order] = {
containerIndex: a1,
itemIndex: a0.itemIndex,
itemType: a0.itemType
};
const r10 = env30824[3];
if (r10 == null ? void 0 : r10.delete(a1)) {
env30824[5] = true;
}
};
env30824[6] = assign;
env30824[7] = (a0, c31753_0, c31753_1) => {
const _loop2 = function _loop2(a0) {
const r6 = env30824[4];
if (r6[a0.order]) {
return 1;
}
const r16 = c31753_0.findIndex((item) => {
const r9 = env30824[2].get(item.containerIndex);
return c31753_1(r9?.itemType, a0.itemType);
});
if (r16 !== -1) {
const r23 = (0, env30824.$parent[4])(c31753_0.splice(r16, 1), 1)[0];
const r24 = env30824[6];
const containerIndex = r23.containerIndex;
r6[a0.order] = {
containerIndex,
itemIndex: a0.itemIndex,
itemType: a0.itemType
};
const r30 = env30824[3];
if (r30 == null ? void 0 : r30.delete(containerIndex)) {
env30824[5] = true;
}
}
};
for (const item5 of a0) {
_loop2(item5);
}
};
const assignFromPool = (a0, a1, a2) => {
if (env30824[0]) {
(0, env30824[7])(a0, a1, (a0, a1) => a1 !== void 0 && a0 === a1);
}
const r11 = env30824[7];
r11(a0, a1, (a0) => a0 === void 0);
if (a2) {
r11(a0, a1, () => true);
}
};
assignFromPool(r24, r23, true);
assignFromPool(r21, r20, false);
for (const item5 of r19) {
const r124 = item5;
if (!array[item5.order]) {
const r128 = +r110;
r110 = r128 + 1;
if (r124.isSticky) {
stickyContainerPool.add(r128);
}
assign(r124, r128);
}
}
if (env30824[5]) {
a4.length = 0;
if (r12) {
for (const item6 of r12) {
a4.push(item6);
}
}
}
if (r3[31]) {
let numContainersPooled = (0, r3[21])(a0, "numContainersPooled");
if (numContainersPooled == null) {
numContainersPooled = Number.POSITIVE_INFINITY;
}
if (r110 > numContainersPooled) {
console.warn("[legend-list] No unused container available, so creating one on demand. This can be a minor performance issue and is likely caused by the estimatedItemSize being too large. Consider decreasing estimatedItemSize.", {
debugInfo: {
numContainers,
numContainersPooled,
numNeeded: length,
stillNeeded: r110 - numContainers
}
});
}
}
return array;
};
}
function $mk110490($env) {
return function handleStickyRecycling(a0, a1, a2, a3, a4, a5, a6) {
let r109;
const r33 = $env;
const state14 = a0.state;
for (const item5 of state14.stickyContainerPool) {
const r55 = item5;
const r59 = (0, r33[21])(a0, `containerItemKey${item5}`);
const r61 = r59 ? state14.indexByKey.get(r59) : void 0;
if (r61 !== void 0 && !a6(r61)) {
const r69 = a1.indexOf(r61);
if (r69 !== -1) {
if (r69 >= a4 - 1 && r69 <= a4 + 1) {
continue;
}
const r86 = a1[r69 + 1];
let r88 = false;
if (r86) {
const r120 = state14.positions[r86];
r88 = r120 !== void 0 && a2 > r120 + 2 * a3;
} else {
const r91 = state14.idCache[r61];
const r95 = r91 ?? (0, r33[49])(state14, r61);
if (r95) {
const r99 = state14.positions[r61];
const r103 = state14.sizes.get(r95);
if (r103 != null) {
r109 = r103;
} else {
const r105 = r33[58];
r109 = r105(a0, r95, r61, state14.props.data[r61]);
}
r88 = r99 !== void 0 && a2 > r99 + r109 + 3 * a3;
}
}
if (r88) {
a5.push(r55);
}
} else {
const stickyContainerPool = state14.stickyContainerPool;
stickyContainerPool.delete(r55);
(0, r33[22])(a0, `containerSticky${r55}`, false);
}
}
}
};
}
function $mk110491($env) {
return function setDidLayout(a0) {
const r2 = $env;
a0.state.queuedInitialLayout = true;
(0, r2[42])(a0);
(0, r2[47])(a0, {
didLayout: true
});
};
}
function $mk110492($env) {
return function handleInitialScrollLayoutReady(a0) {
let env30825 = {
$parent: $env
};
env30825[0] = a0;
if (a0.state.initialScroll) {
const r10 = $env;
(0, r10[76])(a0, {
forceScroll: true
});
const initialScrollSession = a0.state.initialScrollSession;
if (initialScrollSession?.kind !== "offset") {
requestAnimationFrame(() => (0, env30825.$parent[76])(env30825[0], {
forceScroll: true
}));
}
let env30826;
const r20 = env30826 = {
$parent: $env
};
env30826[0] = a0;
const scrollingTo2 = a0.state.scrollingTo;
if (scrollingTo2?.isInitialScroll && !scrollingTo2.animated && (0, r10[62])(a0, scrollingTo2).isAtResolvedTarget) {
a0.state.animFrameCheckFinishedScroll = requestAnimationFrame($mk95167(r20));
}
}
};
}
function $mk110497($env) {
return (a0, a1, a2, a3) => {
(0, $env[3])({
height: a3,
width: a2,
x: a0,
y: a1
}, true);
};
}
function $mk110502($env) {
return (a0, a1) => {
const r4 = $env;
const r6 = r4[0];
const current5 = r6.current;
const r2 = current5 == null ? void 0 : current5.call(r6, r4[1].current(a0, a1));
return r2 ?? null;
};
}
function $mk110503($env) {
return (a0, a1, a2) => a0 !== void 0 ? a1 !== void 0 ? (0, $env[0])(a0, a1, a2) : void 0 : void 0;
}
function $mk110505() {
return () => true;
}
function $mk110506($env) {
return (a0) => {
const r5 = $env.$parent;
const r0 = r5[3] + 1;
r5[3] = r0;
const r6 = r5[2];
r6.pendingScrollToEnd = void 0;
const pendingScrollResolve2 = r6.pendingScrollResolve;
if (pendingScrollResolve2 != null) {
pendingScrollResolve2.call(r6);
}
const r18 = $env;
r6.pendingScrollResolve = a0;
(0, r5[6])(r0, a0, r18[0], r18[1]);
};
}
let r13, r140, peek$, useIsLastItem;
let createAnimatedValue, c10649_17, DebugRow, c10649_27, c10649_31, c10649_32, c10649_33, c10649_34, c10649_36, c10649_37, checkThreshold, c10649_53, c10649_66, getScrollVelocity, unstable_batchedUpdates, c10649_104, c10649_110, getComponent, c10649_113, c10649_114, c10649_115, noop, c10649_120, c10649_121, c10649_123, c10649_124, c10649_125, ScrollView, SnapWrapperInner, LayoutView, c10649_130, c10649_131, c10649_132, c10649_134, useCombinedRef, sortAsc, toCount, addIndex, c10649_141;
let env10649;
let env10650;
L5: {
env10649 = {};
env10649[0] = require;
env10649[1] = dependencyMap;
env10649[15] = function toNativeHorizontalOffset(a0, a1, a2) {
let r58;
if (a0) {
const props = a0?.props;
let r16 = !!props?.horizontal;
if (r16) {
let r7 = props?.rtl;
if (r7 == null) {
r7 = !!env10649[11].I18nManager.isRTL;
}
r16 = r7;
}
if (r16) {
const r13 = a2 !== void 0 && (Number.isFinite(a2) && (Number.isFinite(a0.scrollLength) && !(a2 <= a0.scrollLength))) ? Math.max(0, a2 - a0.scrollLength) : a2 !== void 0 ? Number.isFinite(a2) ? Number.isFinite(a0.scrollLength) ? 0 : void 0 : void 0 : void 0;
const r44 = r13 === void 0;
const r45 = r44 ? a1 : Math.max(0, Math.min(r13, a1));
const horizontalRTLScrollType = a0?.horizontalRTLScrollType;
const r56 = horizontalRTLScrollType ?? "inverted";
if (r56 === "negative") {
r58 = r45 !== 0 ? -r45 : 0;
} else {
r58 = r45;
if (r56 === "inverted") {
let r59 = r45;
if (!r44) {
const r12 = r13 - r45;
r59 = r44 ? r12 : Math.max(0, Math.min(r13, r12));
}
r58 = r59;
}
}
return r58;
}
}
return a1;
};
env10649[19] = function StateProvider({ children }) {
const r5 = env10649[12];
return r5.createElement(c10649_17.Provider, {
value: (0, env10649[4])(r5.useState(() => {
const r15 = {
animatedScrollY: new env10649[11].Animated.Value(0),
columnWrapperStyle: void 0,
containerLayoutTriggers: new Map(),
contextNum: null,
listeners: null,
mapViewabilityAmountCallbacks: null,
mapViewabilityAmountValues: null,
mapViewabilityCallbacks: null,
mapViewabilityConfigStates: null,
mapViewabilityValues: null,
pendingContainerIds: void 0,
positionListeners: null,
scrollAxisGap: 0,
state: void 0,
values: null,
viewRefs: null
};
const contextNum = +env10649[18];
env10649[18] = contextNum + 1;
r15.contextNum = contextNum;
r15.listeners = new Map();
r15.mapViewabilityAmountCallbacks = new Map();
r15.mapViewabilityAmountValues = new Map();
r15.mapViewabilityCallbacks = new Map();
r15.mapViewabilityConfigStates = new Map();
r15.mapViewabilityValues = new Map();
r15.positionListeners = new Map();
r15.values = new Map([["alignItemsAtEndPadding", 0], ["containerLayoutEpoch", 0], ["stylePaddingTop", 0], ["headerSize", 0], ["numContainers", 0], ["activeStickyIndex", -1], ["isAtEnd", false], ["isAtStart", false], ["isNearEnd", false], ["isNearStart", false], ["isWithinMaintainScrollAtEndThreshold", false], ["adaptiveRender", "normal"], ["totalSize", 0], ["scrollAdjustPending", 0]]);
r15.viewRefs = new Map();
return r15;
}), 1)[0]
}, children);
};
env10649[20] = function listen$(a0, a1, a2) {
let env21546;
const r0 = env21546 = {};
env21546[0] = a2;
const listeners = a0.listeners;
const r11 = listeners.get(a1);
env21546[1] = r11;
let r2 = r11;
if (!r2) {
const set2 = new Set();
env21546[1] = set2;
listeners.set(a1, set2);
r2 = set2;
}
r2.add(a2);
return $mk95159(r0);
};
peek$ = function peek$(a0, a1) {
return a0.values.get(a1);
};
env10649[21] = peek$;
env10649[22] = function set$({ listeners, values }, a1, a2) {
if (values.get(a1) !== a2) {
values.set(a1, a2);
const r23 = listeners.get(a1);
if (r23) {
for (const item5 of r23) {
item5(a2);
}
}
}
};
env10649[23] = function notifyPosition$(a0, a1, a2) {
const r18 = a0.positionListeners.get(a1);
if (r18) {
for (const item5 of r18) {
item5(a2);
}
}
};
env10649[24] = function getContentInsetEnd(a0, a1) {
let r9, r55;
const state14 = a0.state;
const props = state14.props;
const horizontal6 = props.horizontal;
let contentInset = props.contentInset;
if (contentInset == null) {
contentInset = state14.nativeContentInset;
}
if (horizontal6) {
let r4 = contentInset;
if (r4) {
const props2 = state14?.props;
let r20 = !!props2?.horizontal;
if (r20) {
let r10 = props2?.rtl;
if (r10 == null) {
r10 = !!env10649[11].I18nManager.isRTL;
}
r20 = r10;
}
r4 = r20 ? contentInset.left : contentInset.right;
}
if (!r4) {
r4 = 0;
}
r9 = r4;
} else {
r9 = contentInset?.bottom;
}
if (!r9) {
r9 = 0;
}
const r14 = a1 == null ? props.contentInsetEndAdjustment : a1;
const r32 = Math.max(0, r14 ?? 0);
const r36 = a0.values.get("anchoredEndSpaceSize");
const anchoredEndSpace2 = props.anchoredEndSpace;
const r40 = anchoredEndSpace2?.includeInEndInset ? r36 ? r36 : 0 : 0;
const contentInsetOverride = state14.contentInsetOverride;
const r43 = contentInsetOverride ?? void 0;
const r44 = r9 + r32;
if (r43) {
const r48 = {
bottom: 0,
left: 0,
right: 0,
...contentInset,
...r43
};
const r53 = Math;
if (horizontal6) {
const props3 = state14?.props;
let r61 = !!props3?.horizontal;
if (r61) {
let r63 = props3?.rtl;
if (r63 == null) {
r63 = !!env10649[11].I18nManager.isRTL;
}
r61 = r63;
}
r55 = (r61 ? r48.left : r48.right) || 0;
} else {
r55 = r48.bottom;
}
if (!r55) {
r55 = 0;
}
return r53.max(r55 + r32, r40);
}
return Math.max(r44, r40);
};
env10649[25] = function getContentSize(a0) {
const { values, state: state14 } = a0;
const r6 = values.get("stylePaddingTop") || 0;
const r4 = state14.props.stylePaddingBottom || 0;
const r5 = values.get("alignItemsAtEndPadding") || 0;
const r7 = values.get("headerSize") || 0;
const r18 = values.get("footerSize") || 0;
let r21 = (0, env10649[24])(a0);
const r22 = r7 + r18;
let pendingTotalSize = state14.pendingTotalSize;
if (pendingTotalSize == null) {
pendingTotalSize = state14.totalSize;
}
if (pendingTotalSize == null) {
pendingTotalSize = values.get("totalSize");
}
const r29 = r22 + pendingTotalSize + r6 + r5 + r4;
if (!r21) {
r21 = 0;
}
return r29 + r21;
};
env10649[28] = function createContainerItemMetadata(a0, a1, a2, a3) {
return {
dataChangeEpoch: a0.dataChangeEpoch,
getFixedItemSize: a0.props.getFixedItemSize,
getItemType: a0.props.getItemType,
itemData: a2,
itemIndex: a1,
itemType: a3
};
};
env10649[29] = function resolveContainerItemMetadata(a0, a1, a2, a3) {
const props = a0.props;
const { getFixedItemSize, getItemType } = props;
let r13 = a0.containerItemMetadata.get(a1);
if (!(r13?.dataChangeEpoch === a0.dataChangeEpoch && (r13.getItemType === getItemType && (r13.itemData === a3 && r13.itemIndex === a2)))) {
let itemType2 = void 0;
if (getItemType) {
const r19 = getItemType(a3, a2);
itemType2 = r19 ?? "";
}
const r23 = {
dataChangeEpoch: a0.dataChangeEpoch,
getFixedItemSize: a0.props.getFixedItemSize,
getItemType: a0.props.getItemType,
itemData: a3,
itemIndex: a2,
itemType: itemType2
};
a0.containerItemMetadata.set(a1, r23);
r13 = r23;
}
if (r13.getFixedItemSize !== getFixedItemSize) {
r13.didResolveFixedItemSize = false;
r13.fixedItemSize = void 0;
r13.getFixedItemSize = getFixedItemSize;
}
if (getFixedItemSize && !r13.didResolveFixedItemSize) {
const itemType = r13.itemType;
r13.fixedItemSize = getFixedItemSize(a3, a2, itemType ?? "");
r13.didResolveFixedItemSize = true;
}
return r13;
};
env10649[30] = function invalidateContainerFixedItemSizes(a0) {
for (const item5 of a0.containerItemMetadata.values()) {
item5.didResolveFixedItemSize = false;
item5.fixedItemSize = void 0;
}
};
env10649[35] = function ensureInitialScrollSessionCompletion(a0, kind3) {
if (kind3 === void 0) {
const initialScrollSession = a0.initialScrollSession;
const kind = initialScrollSession?.kind;
kind3 = kind ?? "bootstrap";
}
if (a0.initialScrollSession) {
if (a0.initialScrollSession.kind !== kind3) {
const bootstrap2 = a0.initialScrollSession.kind === "bootstrap" ? a0.initialScrollSession.bootstrap : void 0;
const completion2 = a0.initialScrollSession.completion;
const previousDataLength2 = a0.initialScrollSession.previousDataLength;
a0.initialScrollSession = kind3 === "offset" ? {
completion: completion2,
kind: kind3,
previousDataLength: previousDataLength2
} : {
bootstrap: bootstrap2,
completion: completion2,
kind: kind3,
previousDataLength: previousDataLength2
};
}
} else {
const r14 = {
completion: {},
kind: kind3,
previousDataLength: 0
};
const { bootstrap, completion, kind: kind2, previousDataLength } = r14;
a0.initialScrollSession = kind2 === "offset" ? {
completion,
kind: kind2,
previousDataLength
} : {
bootstrap,
completion,
kind: kind2,
previousDataLength
};
}
const initialScrollSession2 = a0.initialScrollSession;
if (initialScrollSession2.completion == null) {
initialScrollSession2.completion = {};
}
return a0.initialScrollSession.completion;
};
env10649[38] = function setInitialScrollSession(a0, r3 = {}) {
const initialScrollSession = a0.initialScrollSession;
let kind = r3.kind;
if (kind == null) {
kind = initialScrollSession?.kind;
}
const completion = initialScrollSession?.completion;
let r10 = initialScrollSession?.kind === "bootstrap" ? initialScrollSession.bootstrap : void 0;
let bootstrap3 = void 0;
if (kind === "bootstrap") {
const bootstrap = r3.bootstrap;
let r16 = void 0;
if (bootstrap !== null) {
const bootstrap2 = r3.bootstrap;
if (bootstrap2 != null) {
r10 = bootstrap2;
}
r16 = r10;
}
bootstrap3 = r16;
}
if (kind) {
if (!a0.initialScroll && !bootstrap3 && !(completion?.didDispatchNativeScroll || completion?.didRetrySilentInitialScroll || completion?.watchdog)) {
a0.initialScrollSession = void 0;
return void 0;
}
let previousDataLength = r3.previousDataLength;
if (previousDataLength == null) {
previousDataLength = initialScrollSession?.previousDataLength;
}
const previousDataLength2 = previousDataLength ?? 0;
a0.initialScrollSession = kind === "offset" ? {
completion,
kind,
previousDataLength: previousDataLength2
} : {
bootstrap: bootstrap3,
completion,
kind,
previousDataLength: previousDataLength2
};
return a0.initialScrollSession;
}
a0.initialScrollSession = void 0;
};
env10649[40] = function resetSharedEdgeGateIfOutsideHysteresis(a0) {
const state14 = a0.state;
if (state14.edgeReachedGate) {
const r16 = (0, env10649[25])(a0);
const r21 = r16 - state14.scroll - state14.scrollLength - (0, env10649[24])(a0);
const r5 = r16 < state14.scrollLength;
const r26 = state14.props.onStartReachedThreshold * state14.scrollLength;
const r30 = state14.props.onEndReachedThreshold * state14.scrollLength;
const r33 = Math.abs(state14.scroll);
let r3 = r26 > 0 && r33 >= 1.3 * r26 || r26 <= 0 && r33 > 0;
const r37 = Math.abs(r21);
let r4 = !r5;
let r38 = (r5 ? r4 : r30 > 0) && r37 >= 1.3 * r30;
if (!r38) {
if (!r5) {
r4 = r30 <= 0;
}
if (r4) {
r4 = r37 > 0;
}
r38 = r4;
}
if (r3) {
r3 = r38;
}
if (r3) {
state14.edgeReachedGate = void 0;
}
}
};
env10649[41] = function hasActiveInitialScroll(a0) {
return !!a0?.initialScroll && !a0.didFinishInitialScroll;
};
env10649[42] = function checkAtBottom(a0, c21548_1, c21548_2) {
let c21548_0 = a0;
const state = a0.state;
if (state) {
const { queuedInitialLayout, scrollLength, scroll: scroll2, maintainingScrollAtEnd: maintainingScrollAtEnd2, props } = state;
const { maintainScrollAtEndThreshold, onEndReachedThreshold } = props;
const contentSize = (0, env10649[25])(a0);
(0, env10649[40])(a0);
if (contentSize > 0 && queuedInitialLayout) {
const r35 = contentSize - scroll2 - scrollLength - (0, env10649[24])(a0);
const r36 = contentSize < scrollLength;
const r37 = env10649[22];
r37(a0, "isAtEnd", r36 ? r36 : r35 <= 1);
r37(a0, "isNearEnd", r36 ? r36 : r35 <= onEndReachedThreshold * scrollLength);
r37(a0, "isWithinMaintainScrollAtEndThreshold", r36 || r35 <= maintainScrollAtEndThreshold * scrollLength);
if (!(!!(state == null ? void 0 : state.initialScroll) && !state.didFinishInitialScroll || maintainingScrollAtEnd2)) {
const r53 = onEndReachedThreshold * scrollLength;
const { isEndReached, endReachedSnapshot } = state;
const data3 = state.props.data;
state.isEndReached = checkThreshold(r35, r36, r53, isEndReached, endReachedSnapshot, {
contentSize,
dataLength: data3?.length,
scrollPosition: scroll2
}, (a0) => {
const edgeReachedGate = c21548_0.state.edgeReachedGate;
if ((edgeReachedGate ? c21548_1 === "end" : !edgeReachedGate) || !!c21548_2) {
c21548_0.state.edgeReachedGate = "closed";
const props = state.props;
const onEndReached = props.onEndReached;
if (onEndReached != null) {
onEndReached.call(props, {
distanceFromEnd: a0
});
}
}
}, (a0) => {
state.endReachedSnapshot = a0;
});
}
}
}
};
env10649[43] = function checkThresholds(a0, a1) {
const r4 = !a0.state.edgeReachedGate;
(0, env10649[42])(a0, a1, r4);
let c21549_0 = a0;
let c21549_1 = a1;
let c21549_2 = r4;
const state2 = a0?.state;
if (state2) {
let isStartReached = state2.isStartReached;
const props = state2.props;
const { data: data3, onStartReachedThreshold } = props;
const { scroll: scroll2, scrollLength, startReachedSnapshot, totalSize } = state2;
const length = data3.length;
const r34 = onStartReachedThreshold * scrollLength;
(0, env10649[40])(a0);
if (isStartReached) {
isStartReached = r34 > 0;
}
if (isStartReached) {
isStartReached = scroll2 > r34;
}
if (isStartReached) {
isStartReached = startReachedSnapshot;
}
if (isStartReached) {
isStartReached = startReachedSnapshot.contentSize !== totalSize || startReachedSnapshot.dataLength !== length;
}
if (isStartReached) {
state2.isStartReached = false;
state2.startReachedSnapshot = void 0;
}
const r41 = env10649[22];
r41(a0, "isAtStart", scroll2 <= 1);
r41(a0, "isNearStart", scroll2 <= r34);
if (!(!!(state2 == null ? void 0 : state2.initialScroll) && !state2.didFinishInitialScroll || state2.scrollingTo)) {
state2.isStartReached = checkThreshold(scroll2, false, r34, state2.isStartReached, startReachedSnapshot, {
contentSize: totalSize,
dataLength: length,
scrollPosition: scroll2
}, (a0) => {
const edgeReachedGate = c21549_0.state.edgeReachedGate;
if ((edgeReachedGate ? c21549_1 === "start" : !edgeReachedGate) || !!c21549_2) {
c21549_0.state.edgeReachedGate = "closed";
const props = state2.props;
const onStartReached = props.onStartReached;
if (onStartReached != null) {
onStartReached.call(props, {
distanceFromStart: a0
});
}
}
}, (a0) => {
state2.startReachedSnapshot = a0;
});
}
}
};
env10649[44] = function scheduleAdaptiveRenderExit(a0, a1) {
let c21550_2;
const { state: state3, state: state14 } = a0;
const timeoutAdaptiveRender = state14.timeoutAdaptiveRender;
if (timeoutAdaptiveRender !== void 0) {
clearTimeout(timeoutAdaptiveRender);
state14.timeouts.delete(timeoutAdaptiveRender);
state14.timeoutAdaptiveRender = void 0;
}
if (a1 <= 0) {
if (a0.values.get("adaptiveRender") !== "normal") {
(0, env10649[22])(a0, "adaptiveRender", "normal");
const adaptiveRender = a0.state.props.adaptiveRender;
const onChange = adaptiveRender?.onChange;
if (onChange != null) {
onChange.call(adaptiveRender, "normal", "scroll");
}
}
} else {
const timeoutAdaptiveRender2 = setTimeout(() => {
state3.timeouts.delete(c21550_2);
state3.timeoutAdaptiveRender = void 0;
if (a0.values.get("adaptiveRender") !== "normal") {
(0, env10649[22])(a0, "adaptiveRender", "normal");
const adaptiveRender = a0.state.props.adaptiveRender;
const onChange = adaptiveRender?.onChange;
if (onChange != null) {
onChange.call(adaptiveRender, "normal", "scroll");
}
}
}, a1);
c21550_2 = timeoutAdaptiveRender2;
state3.timeoutAdaptiveRender = timeoutAdaptiveRender2;
state3.timeouts.add(timeoutAdaptiveRender2);
}
};
env10649[45] = function resetAdaptiveRender(a0) {
const state14 = a0.state;
const timeoutAdaptiveRender = state14.timeoutAdaptiveRender;
if (timeoutAdaptiveRender !== void 0) {
clearTimeout(timeoutAdaptiveRender);
state14.timeouts.delete(timeoutAdaptiveRender);
state14.timeoutAdaptiveRender = void 0;
}
const adaptiveRender = a0.state.props.adaptiveRender;
const initialMode = adaptiveRender?.initialMode;
const r18 = initialMode ?? "normal";
if (a0.values.get("adaptiveRender") !== r18 && a0.values.get("adaptiveRender") !== r18) {
(0, env10649[22])(a0, "adaptiveRender", r18);
const adaptiveRender2 = a0.state.props.adaptiveRender;
const onChange = adaptiveRender2?.onChange;
if (onChange != null) {
onChange.call(adaptiveRender2, r18, "initial");
}
}
};
env10649[46] = function getEffectiveDrawDistance(a0, a1) {
let r16;
const drawDistance = a0.state.props.drawDistance;
const initialScroll2 = a0.state.initialScroll;
let r11 = initialScroll2 !== void 0;
if (r11) {
const viewPosition2 = initialScroll2.viewPosition;
r11 = (viewPosition2 ?? 0) > 0;
}
L9: {
if (a1 !== "visible-first") {
r16 = drawDistance;
if (a1 === "full") {
break L9;
}
const r20 = a0.values.get("readyToRender");
r16 = drawDistance;
if (r20) {
break L9;
}
r16 = r11 ? drawDistance : Math.min(drawDistance, 50);
} else {
r16 = Math.min(drawDistance, 50);
}
}
return r16;
};
env10649[47] = function setInitialRenderState(a0, { didLayout, didInitialScroll }) {
const state14 = a0.state;
const loadStartTime = state14.loadStartTime;
const onLoad = state14.props.onLoad;
if (didLayout) {
state14.didContainersLayout = true;
}
if (didInitialScroll) {
state14.didFinishInitialScroll = true;
}
if (Boolean(state14.didContainersLayout && state14.didFinishInitialScroll) && !a0.values.get("readyToRender")) {
const r25 = env10649[22];
r25(a0, "readyToRender", true);
if (a0.values.get("adaptiveRender") !== "normal") {
r25(a0, "adaptiveRender", "normal");
const adaptiveRender = a0.state.props.adaptiveRender;
const onChange = adaptiveRender?.onChange;
if (onChange != null) {
onChange.call(adaptiveRender, "normal", "ready");
}
}
if (state14.props.drawDistance > 50) {
let env21551;
const r45 = env21551 = {};
const state15 = a0.state;
env21551[0] = state15;
if (!(state15.props.drawDistance <= 50 || state15.queuedFullDrawDistancePrewarm !== void 0)) {
state15.queuedFullDrawDistancePrewarm = requestAnimationFrame($mk95164(r45));
}
}
if (!state14.didLoad) {
state14.didLoad = true;
if (onLoad) {
onLoad({
elapsedTimeInMs: Date.now() - loadStartTime
});
}
}
}
};
env10649[48] = function finishInitialScroll(a0, a1) {
const state4 = a0.state;
if (a1.resolvedOffset !== void 0) {
const resolvedOffset = a1.resolvedOffset;
state4.scroll = resolvedOffset;
state4.scrollPending = resolvedOffset;
state4.scrollPrev = resolvedOffset;
} else if (a1.syncObservedOffset) {
const initialScrollSession = state4.initialScrollSession;
if (initialScrollSession?.kind === "offset") {
const current5 = state4.refScroller.current;
const getCurrentScrollOffset = current5?.getCurrentScrollOffset;
const scroll2 = getCurrentScrollOffset == null ? void 0 : getCurrentScrollOffset.call(current5);
if (typeof scroll2 === "number" ? Number.isFinite(scroll2) : typeof scroll2 === "number") {
state4.scroll = scroll2;
state4.scrollPending = scroll2;
state4.scrollPrev = scroll2;
}
}
}
const complete = () => {
let resolvedOffset = a1.resolvedOffset;
if (resolvedOffset == null) {
resolvedOffset = state4.scrollPending;
}
if (resolvedOffset == null) {
state4.scroll;
}
L13: {
c10649_37.clear(state4);
if (a1.preserveTarget && state4.initialScroll) {
state4.clearPreservedInitialScrollOnNextFinish = void 0;
(0, env10649[38])(state4);
if (state4.timeoutPreservedInitialScrollClear !== void 0) {
clearTimeout(state4.timeoutPreservedInitialScrollClear);
state4.timeoutPreservedInitialScrollClear = void 0;
}
if (!a1.schedulePreservedTargetClear) {
break L13;
}
state4.timeoutPreservedInitialScrollClear = setTimeout(() => {
state4.timeoutPreservedInitialScrollClear = void 0;
let didFinishInitialScroll = state4.didFinishInitialScroll;
if (didFinishInitialScroll) {
const scrollingTo2 = state4.scrollingTo;
didFinishInitialScroll = !scrollingTo2?.isInitialScroll;
}
if (didFinishInitialScroll) {
didFinishInitialScroll = state4.initialScroll;
}
if (didFinishInitialScroll) {
if (state4.timeoutPreservedInitialScrollClear !== void 0) {
clearTimeout(state4.timeoutPreservedInitialScrollClear);
state4.timeoutPreservedInitialScrollClear = void 0;
}
state4.clearPreservedInitialScrollOnNextFinish = void 0;
state4.initialScroll = void 0;
(0, env10649[38])(state4);
}
}, 2000);
} else {
if (state4.timeoutPreservedInitialScrollClear !== void 0) {
clearTimeout(state4.timeoutPreservedInitialScrollClear);
state4.timeoutPreservedInitialScrollClear = void 0;
}
state4.clearPreservedInitialScrollOnNextFinish = void 0;
state4.initialScroll = void 0;
(0, env10649[38])(state4);
}
}
if (a1.recalculateItems) {
const state14 = a0.state;
const props = state14.props;
if (props?.data) {
const triggerCalculateItemsInView = state14.triggerCalculateItemsInView;
if (triggerCalculateItemsInView != null) {
triggerCalculateItemsInView.call(state14, {
forceFullItemPositions: true
});
}
}
(0, env10649[43])(a0);
}
(0, env10649[47])(a0, {
didInitialScroll: true
});
const onFinished2 = a1.onFinished;
if (onFinished2 != null) {
onFinished2.call(a1);
}
};
if (a1.waitForCompletionFrame) {
requestAnimationFrame(complete);
} else {
complete();
}
};
env10649[49] = function getId(a0, a1) {
const props = a0.props;
const { data: data3, keyExtractor: keyExtractor2 } = props;
if (data3) {
const r9 = a1 < data3.length ? keyExtractor2 ? keyExtractor2(data3[a1], a1) : a1 : null;
a0.idCache[a1] = r9;
return r9;
}
return "";
};
env10649[50] = function updateContentMetricsState(a0) {
const r6 = a0.values.get("alignItemsAtEndPadding") || 0;
const state14 = a0.state;
const alignItemsAtEndPaddingEnabled = state14.props.alignItemsAtEndPaddingEnabled;
let r18 = 0;
if (alignItemsAtEndPaddingEnabled) {
const horizontal6 = state14.props.horizontal;
r18 = 0;
if (!horizontal6) {
const r1 = state14.props.data.length > 0;
r18 = 0;
if (r1) {
const r25 = state14.scrollLength > 0;
r18 = 0;
if (r25) {
const r9 = Math;
const scrollLength = state14.scrollLength;
const { state: state15, values } = a0;
const r32 = (values.get("headerSize") || 0) + (values.get("footerSize") || 0);
let pendingTotalSize = state15.pendingTotalSize;
if (pendingTotalSize == null) {
pendingTotalSize = state15.totalSize;
}
if (pendingTotalSize == null) {
pendingTotalSize = values.get("totalSize");
}
r18 = r9.max(0, scrollLength - (r32 + (pendingTotalSize ?? 0) + (state15.props.stylePaddingTop || 0) + (state15.props.stylePaddingBottom || 0)) - (0, env10649[24])(a0));
}
}
}
}
if (r6 !== r18) {
(0, env10649[22])(a0, "alignItemsAtEndPadding", r18);
}
};
env10649[51] = function setSize(a0, a1, a2, r1 = true) {
let pendingTotalSize;
const sizes = a0.state.sizes;
const r10 = sizes.get(a1);
const r17 = r10 !== void 0 ? a2 - r10 : a2;
L23: {
if (r17 !== 0) {
if (r1 === void 0) {
r1 = true;
}
const state14 = a0.state;
const { totalSize, totalSize: totalSize2 } = state14;
if (a1 === null) {
const timeoutSetPaddingTop = state14.timeoutSetPaddingTop;
pendingTotalSize = r17;
if (timeoutSetPaddingTop) {
clearTimeout(state14.timeoutSetPaddingTop);
state14.timeoutSetPaddingTop = void 0;
pendingTotalSize = r17;
}
} else {
pendingTotalSize = totalSize2 + r17;
}
if (totalSize !== pendingTotalSize) {
if (!c10649_27 && state14.initialScroll && pendingTotalSize < totalSize) {
state14.pendingTotalSize = pendingTotalSize;
break L23;
}
state14.pendingTotalSize = void 0;
state14.totalSize = pendingTotalSize;
if (r1) {
(0, env10649[22])(a0, "totalSize", pendingTotalSize);
}
(0, env10649[50])(a0);
} else if (r1 && a0.values.get("totalSize") !== pendingTotalSize) {
(0, env10649[22])(a0, "totalSize", pendingTotalSize);
}
}
}
sizes.set(a1, a2);
};
env10649[52] = function isFunction(a0) {
return typeof a0 === "function";
};
env10649[54] = function isNullOrUndefined(a0) {
return a0 == null;
};
env10649[55] = function extractPadding(a0, a1, a2) {
const r2 = a2 === "Left";
let r5 = !r2 && a2 !== "Right" ? a0.paddingVertical : a0.paddingHorizontal;
const r14 = a0[`padding${a2}`];
if (r14 != null) {
r5 = r14;
}
if (r5 == null) {
r5 = a0.padding;
}
const r15 = r5 ?? 0;
let r17 = !r2 && a2 !== "Right" ? a1.paddingVertical : a1.paddingHorizontal;
const r21 = a1[`padding${a2}`];
if (r21 != null) {
r17 = r21;
}
if (r17 == null) {
r17 = a1.padding;
}
return r15 + (r17 ?? 0);
};
env10649[56] = function findContainerId(a0, a1) {
const state14 = a0.state;
const containerItemKeys = state14?.containerItemKeys;
const r17 = containerItemKeys == null ? void 0 : containerItemKeys.get(a1);
if (r17 !== void 0) {
return r17;
}
const r20 = a0.values.get("numContainers");
let r0 = 0;
while (r0 < r20) {
const r26 = a0.values.get(`containerItemKey${r0}`);
const r1 = r0;
if (r26 === a1) {
return r1;
}
r0 = r1 + 1;
}
return -1;
};
env10649[57] = function getKnownOrFixedItemSize(a0, a1) {
const state14 = a0.state;
const props = state14.props;
const { data: data3, keyExtractor: keyExtractor2 } = props;
let r6 = "";
if (data3) {
const r14 = a1 < data3.length ? keyExtractor2 ? keyExtractor2(data3[a1], a1) : a1 : null;
state14.idCache[a1] = r14;
r6 = r14;
}
const r9 = a0.state.props.data[a1];
const state15 = a0.state;
const props2 = state15.props;
const { getFixedItemSize, getItemType } = props2;
const r25 = r6 ? state15.sizesKnown.get(r6) : void 0;
let r28 = r25;
if (r28 === void 0) {
r28 = r25;
if (r6) {
r28 = r25;
if (getFixedItemSize) {
let r29 = "";
if (getItemType) {
const r30 = getItemType(r9, a1);
r29 = r30 ?? "";
}
const r32 = getFixedItemSize(r9, a1, r29);
r28 = r25;
if (r32 !== void 0) {
const r34 = r32 + a0.scrollAxisGap;
state15.sizesKnown.set(r6, r34);
r28 = r34;
}
}
}
}
return r28;
};
env10649[58] = function getItemSize(a0, a1, a2, a3, a4, a5, a6, a7) {
const state14 = a0.state;
const { sizes, averageSizes, props } = state14;
const { estimatedItemSize, getItemType } = props;
const scrollingTo2 = state14.scrollingTo;
const r33 = state14.sizesKnown.get(a1);
if (r33 !== void 0) {
return r33;
}
const r35 = sizes.get(a1);
if (a5 && r35 !== void 0) {
return r35;
}
const state15 = a0.state;
const props2 = state15.props;
const { getFixedItemSize, getItemType: getItemType2 } = props2;
const r37 = a1 ? state15.sizesKnown.get(a1) : void 0;
let r40 = r37;
if (r40 === void 0) {
r40 = r37;
if (a1) {
r40 = r37;
if (getFixedItemSize) {
let r19 = a7?.itemType;
if (r19 == null) {
let r23 = "";
if (getItemType2) {
const r41 = getItemType2(a3, a2);
r23 = r41 ?? "";
}
r19 = r23;
}
const r45 = a7?.didResolveFixedItemSize ? a7.fixedItemSize : getFixedItemSize(a3, a2, r19);
r40 = r37;
if (r45 !== void 0) {
const r47 = r45 + a0.scrollAxisGap;
state15.sizesKnown.set(a1, r47);
r40 = r47;
}
}
}
}
if (r40 !== void 0) {
(0, env10649[51])(a0, a1, r40, a6);
return r40;
}
let r54 = a7?.itemType;
if (r54 == null) {
let r56 = "";
if (getItemType) {
const r57 = getItemType(a3, a2);
r56 = r57 ?? "";
}
r54 = r56;
}
let r60 = r40;
if (a4) {
r60 = r40;
if (!scrollingTo2) {
const r61 = averageSizes[r54];
const avg = r61?.avg;
r60 = avg !== void 0 ? Math.floor(8 * avg) / 8 : r40;
}
}
const r67 = r60 === void 0;
if (r67 && r35 !== void 0) {
return r35;
}
let r68 = r60;
if (r67) {
r68 = r60;
if (a4) {
r68 = r60;
if (scrollingTo2) {
const averageSizeSnapshot = scrollingTo2.averageSizeSnapshot;
const r71 = averageSizeSnapshot == null ? void 0 : averageSizeSnapshot[r54];
r68 = r71 !== void 0 ? Math.floor(8 * r71) / 8 : r60;
}
}
}
if (r68 === void 0) {
r68 = estimatedItemSize + a0.scrollAxisGap;
}
(0, env10649[51])(a0, a1, r68, a6);
return r68;
};
env10649[59] = function calculateOffsetWithOffsetPosition(a0, a1, a2) {
const state14 = a0.state;
const { index: index3, viewOffset, viewPosition: viewPosition2 } = a2;
const r24 = viewOffset ? a1 - viewOffset : a1;
const r2 = index3 !== void 0;
let r25 = r24;
if (r2) {
const r36 = (a0.values.get("stylePaddingTop") || 0) + (a0.values.get("alignItemsAtEndPadding") || 0) + (a0.values.get("headerSize") || 0);
r25 = r36 ? r24 + r36 : r24;
}
let r37 = r25;
if (viewPosition2 !== void 0) {
r37 = r25;
if (r2) {
const length = state14.props.data.length;
if (length === 0) {
return r25;
}
const r41 = index3 < 0 || index3 >= length;
const estimatedItemSize = state14.props.estimatedItemSize;
let r45 = estimatedItemSize ?? 0;
if (!r41) {
const r15 = env10649[58];
const props = state14.props;
const { data: data3, keyExtractor: keyExtractor2 } = props;
let r48 = "";
if (data3) {
const r50 = index3 < data3.length ? keyExtractor2 ? keyExtractor2(data3[index3], index3) : index3 : null;
state14.idCache[index3] = r50;
r48 = r50;
}
r45 = r15(a0, r48, index3, state14.props.data[index3]);
}
const r62 = r25 - viewPosition2 * (state14.scrollLength - (0, env10649[24])(a0) - r45);
r37 = r41 ? r62 : index3 === state14.props.data.length - 1 ? r62 + (a0.values.get("footerSize") || 0) : r62;
}
}
return r37;
};
env10649[60] = function finishScrollTo(a0) {
let scrollingTo3;
const state14 = a0.state;
const scrollingTo2 = state14?.scrollingTo;
L25: {
if (scrollingTo2) {
let pendingScrollResolve;
L14: {
pendingScrollResolve = state14.pendingScrollResolve;
state14.pendingScrollResolve = void 0;
scrollingTo3 = state14.scrollingTo;
state14.scrollHistory.length = 0;
state14.scrollingTo = void 0;
state14.scrollTargetPinnedRange = void 0;
if (state14.pendingTotalSize !== void 0) {
const pendingTotalSize = state14.pendingTotalSize;
const state15 = a0.state;
const totalSize = state15.totalSize;
state15.totalSize;
if (state15.timeoutSetPaddingTop) {
clearTimeout(state15.timeoutSetPaddingTop);
state15.timeoutSetPaddingTop = void 0;
}
if (totalSize !== pendingTotalSize) {
if (!c10649_27 && state15.initialScroll && pendingTotalSize < totalSize) {
state15.pendingTotalSize = pendingTotalSize;
break L14;
}
state15.pendingTotalSize = void 0;
state15.totalSize = pendingTotalSize;
(0, env10649[22])(a0, "totalSize", pendingTotalSize);
(0, env10649[50])(a0);
} else if (a0.values.get("totalSize") !== pendingTotalSize) {
(0, env10649[22])(a0, "totalSize", pendingTotalSize);
}
}
}
state14.scrollAdjustHandler.commitPendingAdjust(scrollingTo3);
if (!scrollingTo3.isInitialScroll && !state14.initialScroll) {
const state16 = a0.state;
const props = state16.props;
if (props?.data) {
const triggerCalculateItemsInView = state16.triggerCalculateItemsInView;
if (triggerCalculateItemsInView != null) {
triggerCalculateItemsInView.call(state16, {
forceFullItemPositions: true
});
}
}
(0, env10649[43])(a0);
if (pendingScrollResolve == null) {
break L25;
}
pendingScrollResolve();
break L25;
}
const initialScrollSession = state14.initialScrollSession;
const kind = initialScrollSession?.kind;
let schedulePreservedTargetClear = !!scrollingTo3.isInitialScroll && !state14.clearPreservedInitialScrollOnNextFinish && state14.props.data.length > 0;
if (schedulePreservedTargetClear) {
const initialScroll2 = state14.initialScroll;
schedulePreservedTargetClear = initialScroll2?.viewPosition === 1;
}
const syncObservedOffset = kind === "offset";
env10649[48](a0, {
onFinished: () => {
if (pendingScrollResolve != null) {
pendingScrollResolve();
}
},
preserveTarget: syncObservedOffset && state14.props.data.length === 0 || schedulePreservedTargetClear,
recalculateItems: true,
schedulePreservedTargetClear,
syncObservedOffset,
waitForCompletionFrame: !!scrollingTo3.waitForInitialScrollCompletionFrame
});
return void 0;
}
}
};
env10649[61] = function shouldFinishInitialScrollWithoutNativeProgress(a0, a1) {
if (a1.isInitialScroll && !a1.animated && a0.didContainersLayout) {
const initialScrollSession = a0.initialScrollSession;
if (initialScrollSession?.kind === "bootstrap") {
return false;
}
let targetOffset2 = a1.targetOffset;
if (targetOffset2 == null) {
targetOffset2 = a1.offset;
}
let r19 = c10649_37.hasNonZeroTargetOffset(targetOffset2);
const r12 = targetOffset2;
if (r19) {
r19 = c10649_36.didDispatchNativeScroll(a0);
}
if (r19) {
r19 = !a0.hasScrolled;
}
let r23 = !r19;
if (!r19) {
const r25 = c10649_37.isAtZeroTargetOffset(r12) || Math.abs(a0.scroll - r12) > 1 || Math.abs(a0.scrollPending - r12) > 1;
let r37 = !r25;
if (!r25) {
let r40 = !!a1.waitForInitialScrollCompletionFrame;
if (!r40) {
const r42 = c10649_37.get(a0);
const targetOffset3 = r42?.targetOffset;
const didFinishInitialScroll = a0.didFinishInitialScroll;
r40 = didFinishInitialScroll ? !didFinishInitialScroll : c10649_37.hasNonZeroTargetOffset(targetOffset3);
}
r37 = r40;
}
r23 = r37;
}
return r23;
}
return false;
};
env10649[62] = function getResolvedScrollCompletionState(a0, a1) {
let r16;
const state14 = a0.state;
const scrollPending = state14.scrollPending;
const adjust = state14.scrollAdjustHandler.getAdjust();
const index3 = a1.index;
const r2 = a1.index === a0.state.props.data.length - 1 && a1.viewPosition === 1;
L23: {
if (r2) {
let r10 = index3 !== void 0;
if (r10) {
const r56 = env10649[59];
const state16 = a0.state;
if (r10) {
r10 = state16.positions[index3];
}
if (!r10) {
r10 = 0;
}
r16 = r56(a0, r10, a1);
break L23;
}
}
r16 = a1.targetOffset;
if (r16 == null) {
const r19 = a1.offset - (a1.viewOffset || 0);
const state15 = a0.state;
const r20 = (0, env10649[25])(a0);
const isFinite2 = Number.isFinite(r20);
let r38 = r19;
if (isFinite2) {
const isFinite3 = Number.isFinite(state15.scrollLength);
r38 = r19;
if (isFinite3) {
const lastLayout = state15.lastLayout;
r38 = r19;
if (lastLayout) {
const r46 = Math.max(0, r20 - state15.scrollLength);
const viewOffset = a1?.viewOffset;
r38 = Math.min(r19, r46 + (typeof viewOffset === "number" ? viewOffset < 0 ? -viewOffset : 0 : 0));
}
}
}
r16 = Math.max(0, r38);
}
}
const state17 = a0.state;
const r61 = env10649[25];
const r63 = r61(a0);
const isFinite4 = Number.isFinite(r63);
let r68 = r16;
if (isFinite4) {
const isFinite5 = Number.isFinite(state17.scrollLength);
r68 = r16;
if (isFinite5) {
const lastLayout2 = state17.lastLayout;
r68 = r16;
if (lastLayout2) {
const r78 = Math.max(0, r63 - state17.scrollLength);
const viewOffset2 = a1?.viewOffset;
r68 = Math.min(r16, r78 + (typeof viewOffset2 === "number" ? viewOffset2 < 0 ? -viewOffset2 : 0 : 0));
}
}
}
const clampedTargetOffset = Math.max(0, r68);
const state18 = a0.state;
const r91 = r61(a0);
const isFinite6 = Number.isFinite(r91);
let r95 = scrollPending;
if (isFinite6) {
const isFinite7 = Number.isFinite(state18.scrollLength);
r95 = scrollPending;
if (isFinite7) {
const lastLayout3 = state18.lastLayout;
r95 = scrollPending;
if (lastLayout3) {
const r105 = Math.max(0, r91 - state18.scrollLength);
const viewOffset3 = a1?.viewOffset;
r95 = Math.min(scrollPending, r105 + (typeof viewOffset3 === "number" ? viewOffset3 < 0 ? -viewOffset3 : 0 : 0));
}
}
}
const r116 = Math.max(0, r95);
const r120 = Math.abs(scrollPending - clampedTargetOffset);
const r125 = Math.abs(scrollPending - (clampedTargetOffset + adjust));
const animated = a1.animated;
let r3 = animated ? false : !animated;
let isAtResolvedTarget = Math.abs(scrollPending - r116) < 1;
if (isAtResolvedTarget) {
let r4 = r120 < 1;
if (!r4) {
if (r3) {
r3 = r125 < 1;
}
r4 = r3;
}
isAtResolvedTarget = r4;
}
return {
clampedTargetOffset,
isAtResolvedTarget
};
};
env10649[63] = function checkFinishedScrollFallback(a0) {
const state5 = a0.state;
const scrollingTo3 = state5.scrollingTo;
const state14 = a0.state;
const scrollingTo2 = state14.scrollingTo;
const r16 = !!scrollingTo2?.isInitialScroll && state14.props.data.length > 0 && (0, env10649[25])(a0) <= state14.scrollLength && state14.scrollPending <= 1;
const r29 = !!scrollingTo3?.isInitialScroll && c10649_36.didDispatchNativeScroll(state5) && !state5.hasScrolled;
let c21554_2 = r29;
const r33 = scrollingTo3 !== void 0 && (0, env10649[61])(state5, scrollingTo3);
const r37 = scrollingTo3?.isInitialScroll && !r16 && !r33 || !state5.didContainersLayout;
state5.timeoutCheckFinishedScrollFallback = setTimeout(() => {
let c27893_0 = 0;
const checkHasScrolled2 = () => {
L77: {
state5.timeoutCheckFinishedScrollFallback = void 0;
const scrollingTo2 = state5.scrollingTo;
if (scrollingTo2) {
c27893_0 = c27893_0 + 1;
const r25 = c10649_37.get(state5);
const targetOffset2 = r25?.targetOffset;
const didFinishInitialScroll = state5.didFinishInitialScroll;
const r17 = (didFinishInitialScroll ? !didFinishInitialScroll : c10649_37.hasNonZeroTargetOffset(targetOffset2)) && !state5.hasScrolled;
let r30 = 5;
let r2 = 5;
if (!c21554_2) {
if (r17) {
r30 = 20;
}
r2 = r30;
}
const state14 = a0.state;
const scrollingTo3 = state14.scrollingTo;
const r34 = !!scrollingTo3?.isInitialScroll && state14.props.data.length > 0 && (0, env10649[25])(a0) <= state14.scrollLength && state14.scrollPending <= 1;
const r46 = (0, env10649[61])(state5, scrollingTo2);
const r22 = (0, env10649[62])(a0, scrollingTo2);
const r48 = c21554_2 && r22.isAtResolvedTarget && c27893_0 >= 1;
const r21 = r48 && !c10649_36.didRetrySilentInitialScroll(state5);
let hasScrolled = state5.hasScrolled;
if (hasScrolled) {
const isInitialScroll = scrollingTo2.isInitialScroll;
hasScrolled = isInitialScroll ? r22.isAtResolvedTarget : !isInitialScroll;
}
const r53 = scrollingTo2.isInitialScroll && !r22.isAtResolvedTarget && c27893_0 <= r2;
if (r21) {
const r88 = c10649_37.get(state5);
let r90 = r88?.targetOffset;
if (r90 == null) {
r90 = scrollingTo2.targetOffset;
}
const targetOffset = r90 ?? 0;
const r94 = targetOffset >= 1 ? targetOffset - 1 : targetOffset + 1;
c10649_36.markSilentInitialScrollRetry(state5);
const current6 = a0.state.refScroller.current;
if (current6 != null) {
current6.scrollTo({
animated: false,
x: a0.state.props.horizontal ? r94 : 0,
y: a0.state.props.horizontal ? 0 : r94
});
}
requestAnimationFrame(() => {
const current5 = a0.state.refScroller.current;
if (current5 != null) {
current5.scrollTo({
animated: false,
x: a0.state.props.horizontal ? targetOffset : 0,
y: a0.state.props.horizontal ? 0 : targetOffset
});
}
});
state5.timeoutCheckFinishedScrollFallback = setTimeout(checkHasScrolled2, 16);
} else {
if (!r34 && !hasScrolled && !r46 && !r48) {
const r56 = c27893_0;
if (!(r2 < r56)) {
if (!(!r17 && !r53) && r56 <= r2) {
const r63 = c10649_37.get(state5);
let r65 = r63?.targetOffset;
if (r65 == null) {
r65 = scrollingTo2.targetOffset;
}
if (r65 == null) {
r65 = state5.scrollPending;
}
const current5 = a0.state.refScroller.current;
if (current5 != null) {
current5.scrollTo({
animated: false,
x: a0.state.props.horizontal ? r65 : 0,
y: a0.state.props.horizontal ? 0 : r65
});
}
state5.timeoutCheckFinishedScrollFallback = setTimeout(checkHasScrolled2, c21554_2 ? 16 : 100);
break L77;
}
state5.timeoutCheckFinishedScrollFallback = setTimeout(checkHasScrolled2, c21554_2 ? 16 : 100);
break L77;
}
}
(0, env10649[60])(a0);
}
}
}
};
checkHasScrolled2();
}, r16 ? 0 : r33 ? 0 : r29 ? 16 : r37 ? 500 : 100);
};
env10649[64] = function doMaintainScrollAtEnd(a0) {
let c21555_4, maintainingScrollAtEnd;
const state6 = a0.state;
const { didContainersLayout, pendingNativeMVCPAdjust, refScroller } = state6;
const maintainScrollAtEnd = state6.props.maintainScrollAtEnd;
const pendingMaintainScrollAtEnd = !!(a0.values.get("isWithinMaintainScrollAtEndThreshold") && maintainScrollAtEnd && didContainersLayout);
if (pendingNativeMVCPAdjust) {
state6.pendingMaintainScrollAtEnd = pendingMaintainScrollAtEnd;
return false;
}
state6.pendingMaintainScrollAtEnd = false;
if (pendingMaintainScrollAtEnd) {
if ((0, env10649[25])(a0) < state6.scrollLength) {
state6.scroll = 0;
}
if (state6.maintainingScrollAtEnd) {
state6.pendingMaintainScrollAtEnd = true;
} else {
const maintainingScrollAtEnd2 = maintainScrollAtEnd.animated ? "pending-animated" : "pending-instant";
c21555_4 = maintainingScrollAtEnd2;
maintainingScrollAtEnd = maintainScrollAtEnd.animated ? "animated" : "instant";
state6.maintainingScrollAtEnd = maintainingScrollAtEnd2;
requestAnimationFrame(() => {
if (a0.values.get("isWithinMaintainScrollAtEndThreshold")) {
L29: {
state6.maintainingScrollAtEnd = maintainingScrollAtEnd;
const current5 = refScroller.current;
if (state6.props.horizontal) {
const r12 = state6 == null ? void 0 : state6.props;
let r27 = !!r12?.horizontal;
if (r27) {
let r11 = r12?.rtl;
if (r11 == null) {
r11 = !!env10649[11].I18nManager.isRTL;
}
r27 = r11;
}
if (r27) {
const r40 = (0, env10649[25])(a0);
const r53 = Number.isFinite(r40) && (Number.isFinite(state6.scrollLength) && !(r40 <= state6.scrollLength)) ? Math.max(0, r40 - state6.scrollLength) : Number.isFinite(r40) ? Number.isFinite(state6.scrollLength) ? 0 : void 0 : void 0;
const r65 = (0, env10649[15])(state6, r53 ?? 0, r40);
if (current5 == null) {
break L29;
}
current5.scrollTo({
animated: maintainScrollAtEnd.animated,
x: r65,
y: 0
});
break L29;
}
}
if (current5 != null) {
current5.scrollToEnd({
animated: maintainScrollAtEnd.animated
});
}
}
setTimeout(() => {
if (state6.maintainingScrollAtEnd === maintainingScrollAtEnd) {
state6.maintainingScrollAtEnd = void 0;
if (state6.pendingMaintainScrollAtEnd) {
(0, env10649[64])(a0);
}
}
}, maintainScrollAtEnd.animated ? 500 : 0);
} else if (state6.maintainingScrollAtEnd === c21555_4) {
state6.maintainingScrollAtEnd = void 0;
}
});
}
return true;
}
return false;
};
env10649[65] = function requestAdjust(a0, a1, a2) {
let c21556_3;
const state7 = a0.state;
if (Math.abs(a1) > 0.1) {
const r15 = (c10649_27 ? !c10649_27 : a2) && state7.scroll <= a1;
c21556_3 = r15;
const doit = () => {
if (c21556_3) {
const r23 = {
horizontal: state7.props.horizontal,
offset: state7.scroll
};
const state14 = a0.state;
const { animated, horizontal: horizontal6, isInitialScroll, offset } = r23;
const r1 = !animated;
const current5 = state14.refScroller.current;
if (current5) {
const r30 = !!horizontal6;
const r9 = env10649[15];
const r31 = r30 ? (0, env10649[25])(a0) : void 0;
const animated2 = !r1;
const r12 = r9(state14, offset, r31);
current5.scrollTo({
animated: animated2,
x: r30 ? r12 : 0,
y: r30 ? 0 : offset
});
if (isInitialScroll) {
c10649_36.markInitialScrollNativeDispatch(state14);
}
if (!animated2) {
state14.scroll = offset;
(0, env10649[63])(a0);
}
}
} else {
state7.scrollAdjustHandler.requestAdjust(a1);
if (state7.adjustingFromInitialMount) {
state7.adjustingFromInitialMount = state7.adjustingFromInitialMount - 1;
}
}
};
state7.scroll = state7.scroll + a1;
state7.scrollForNextCalculateItemsInView = void 0;
if (a0.values.get("readyToRender")) {
doit();
const lt = state7.scroll - a1 / 2;
if (!state7.ignoreScrollFromMVCP) {
state7.ignoreScrollFromMVCP = {};
}
if (a1 > 0) {
state7.ignoreScrollFromMVCP.lt = lt;
} else {
state7.ignoreScrollFromMVCP.gt = lt;
}
if (state7.ignoreScrollFromMVCPTimeout) {
clearTimeout(state7.ignoreScrollFromMVCPTimeout);
}
state7.ignoreScrollFromMVCPTimeout = setTimeout(() => {
state7.ignoreScrollFromMVCP = void 0;
if (state7.ignoreScrollFromMVCPIgnored && state7.scrollProcessingEnabled !== false) {
state7.ignoreScrollFromMVCPIgnored = false;
state7.scrollPending = state7.scroll;
const reprocessCurrentScroll = state7.reprocessCurrentScroll;
if (reprocessCurrentScroll != null) {
reprocessCurrentScroll.call(state7);
}
}
}, r15 ? 250 : 100);
} else {
state7.adjustingFromInitialMount = (state7.adjustingFromInitialMount || 0) + 1;
requestAnimationFrame(doit);
}
}
};
env10649[67] = function maybeApplyPredictedNativeMVCPAdjust(a0) {
const state14 = a0.state;
const pendingNativeMVCPAdjust = state14.pendingNativeMVCPAdjust;
if (pendingNativeMVCPAdjust) {
const r15 = Math.abs(pendingNativeMVCPAdjust.manualApplied);
if (!(r15 > c10649_66)) {
const r13 = (0, env10649[25])(a0);
const amount = pendingNativeMVCPAdjust.amount;
const r2 = Math.abs(amount) <= c10649_66;
let r20 = 0;
if (!r2) {
const r14 = Math.max(0, r13 - state14.scrollLength) - state14.scroll;
r20 = amount < 0 ? Math.max(amount, Math.min(0, r14)) : amount > 0 ? Math.min(amount, Math.max(0, r14)) : 0;
}
if (!(Math.abs(r20) <= c10649_66)) {
const manualApplied = pendingNativeMVCPAdjust.amount - r20;
if (!(Math.abs(manualApplied) <= c10649_66)) {
pendingNativeMVCPAdjust.manualApplied = manualApplied;
(0, env10649[65])(a0, manualApplied, true);
pendingNativeMVCPAdjust.furthestProgressTowardAmount = 0;
}
}
}
}
};
env10649[68] = function prepareMVCP(a0, a1) {
let r51;
let c21557_2, c21557_3;
const state8 = a0.state;
const { idsInView, positions } = state8;
const maintainVisibleContentPosition = state8.props.maintainVisibleContentPosition;
const data = maintainVisibleContentPosition.data;
let size = maintainVisibleContentPosition.size;
const shouldRestorePosition = maintainVisibleContentPosition.shouldRestorePosition;
Date.now();
const scrollingTo = state8.scrollingTo;
const r29 = [];
let c21557_9 = r29;
const index = scrollingTo == null ? void 0 : scrollingTo.index;
const viewPosition = scrollingTo == null ? void 0 : scrollingTo.viewPosition;
const r31 = index !== void 0;
let c21557_12 = r31 && state8.props.data.length > 0 && index >= state8.props.data.length - 1 && (viewPosition != null ? viewPosition : 0) > 0;
if (a1) {
size = data;
}
const { indexByKey, scroll } = state8;
let c21557_15 = (0, env10649[25])(a0);
if (size) {
if (state8.pendingNativeMVCPAdjust && index === void 0) {
(0, env10649[67])(a0);
return void 0;
}
if (r31) {
if (!c10649_27 && (scrollingTo == null ? void 0 : scrollingTo.isInitialScroll)) {
return void 0;
}
const props = state8.props;
const { data: data3, keyExtractor: keyExtractor2 } = props;
let r59 = "";
if (data3) {
const r62 = index < data3.length ? keyExtractor2 ? keyExtractor2(data3[index], index) : index : null;
state8.idCache[index] = r62;
r59 = r62;
}
c21557_3 = r59;
r51 = r59;
} else {
const r50 = idsInView.length > 0 && state8.didContainersLayout && !a1;
r51 = void 0;
if (r50) {
const r53 = idsInView.find((item) => indexByKey.get(item) !== void 0);
c21557_3 = r53;
r51 = r53;
}
}
if (a1 && idsInView.length > 0 && state8.didContainersLayout) {
const r69 = 0 < idsInView.length;
let r0 = 0;
if (r69) {
do {
const id4 = idsInView[r0];
const r72 = indexByKey.get(id4);
const r1 = r0;
if (r72 !== void 0) {
const position = positions[r72];
if (position !== void 0) {
r29.push({
id: id4,
position
});
}
}
r0 = r1 + 1;
} while (r0 < idsInView.length);
}
}
if (r51 !== void 0) {
const r79 = indexByKey.get(r51);
if (r79 !== void 0) {
c21557_2 = positions[r79];
}
}
return () => {
let r1, r34, r47;
const data3 = state8.props.data;
let r9 = a1 && data && index === void 0;
if (r9) {
let r24 = true;
if (c21557_3 !== void 0) {
const r26 = indexByKey.get(c21557_3);
r24 = r26 === void 0 || positions[r26] === void 0;
}
r9 = r24;
}
let r29 = 0;
if (r9) {
const r32 = 0 < c21557_9.length;
let r0 = 0;
r29 = 0;
if (r32) {
do {
L20: {
r34 = c21557_9;
const r35 = r34[r0];
const { id: id4, position } = r35;
const r38 = indexByKey.get(id4);
const r39 = r38 !== void 0;
r1 = r0;
if (r39 && shouldRestorePosition) {
const r41 = data3[r38];
if (r41 === void 0) {
break L20;
}
if (!shouldRestorePosition(r41, r38, data3)) {
break L20;
}
}
const r43 = r39 ? positions[r38] : void 0;
if (r43 !== void 0) {
r29 = r43 - position;
break;
}
}
const r45 = r1 + 1;
r47 = r45 < r34.length;
r0 = r45;
r29 = 0;
} while (r47);
}
}
let r49 = r29;
if (c21557_3 !== void 0) {
r49 = r29;
if (c21557_2 !== void 0) {
const r53 = indexByKey.get(c21557_3);
const r54 = r53 !== void 0 ? positions[r53] : void 0;
r49 = r29;
if (r54 !== void 0) {
const r59 = (0, env10649[25])(a0);
const r60 = r54 - c21557_2;
let r61 = r60;
if (r61 !== 0) {
r61 = r60;
if (c21557_12) {
const r66 = state8.scroll + state8.scrollLength;
r61 = r60;
if (r66 > r59) {
if (r60 > 0) {
r61 = Math.max(0, r59 - state8.scroll - state8.scrollLength);
} else {
const scroll2 = Math.max(0, r59 - state8.scrollLength);
state8.scroll = scroll2;
state8.scrollPending = scroll2;
r61 = 0;
}
}
}
}
r49 = r61;
}
}
}
let amount = r49;
if (viewPosition) {
amount = r49;
if (viewPosition > 0) {
const itemSize = (0, env10649[58])(a0, c21557_3, index, state8.props.data[index]);
const r92 = scrollingTo == null ? void 0 : scrollingTo.itemSize;
amount = r49;
if (itemSize !== void 0) {
amount = r49;
if (r92 !== void 0) {
amount = r49;
if (itemSize !== r92) {
const r93 = itemSize - r92;
amount = r49;
if (r93 !== 0) {
amount = r49 + r93 * viewPosition;
scrollingTo.itemSize = itemSize;
}
}
}
}
}
}
let r95 = a1;
const r100 = (r95 ? !state8.props.maintainVisibleContentPosition.data : !r95) || index !== void 0 || amount >= -0.1;
if (r100 ? !r100 : c21557_15 - scroll - state8.scrollLength < Math.abs(amount) - c10649_66) {
state8.pendingNativeMVCPAdjust = {
amount,
furthestProgressTowardAmount: 0,
manualApplied: 0,
startScroll: scroll
};
(0, env10649[67])(a0);
return void 0;
}
if (Math.abs(amount) > c10649_66 && !((state8.maintainingScrollAtEnd === "pending-animated" || state8.maintainingScrollAtEnd === "animated") && a0.values.get("isWithinMaintainScrollAtEndThreshold"))) {
const r130 = env10649[65];
if (r95) {
r95 = data;
}
r130(a0, amount, r95);
}
};
}
};
env10649[70] = function updateScroll(a0, a1, a2, a3) {
let r118;
const state14 = a0.state;
const { ignoreScrollFromMVCP, lastScrollAdjustForHistory, scrollAdjustHandler, scrollHistory, scrollingTo: scrollingTo2, scroll: scroll2 } = state14;
if (a3?.markHasScrolled !== false) {
state14.hasScrolled = true;
}
const lastBatchingAction = Date.now();
state14.lastBatchingAction = lastBatchingAction;
const adjust = scrollAdjustHandler.getAdjust();
const r38 = lastScrollAdjustForHistory !== void 0 && Math.abs(adjust - lastScrollAdjustForHistory) > 0.1;
if (r38) {
scrollHistory.length = 0;
}
state14.lastScrollAdjustForHistory = adjust;
const doMVCP = scrollingTo2 !== void 0;
if (!(doMVCP || scrollHistory.length === 0 && a1 === state14.scroll || r38)) {
scrollHistory.push({
scroll: a1,
time: lastBatchingAction
});
}
if (scrollHistory.length > 5) {
scrollHistory.shift();
}
L25: {
if (ignoreScrollFromMVCP && !scrollingTo2) {
const { lt, gt } = ignoreScrollFromMVCP;
if (!(lt && a1 < lt)) {
if (!gt) {
break L25;
}
if (!(a1 > gt)) {
break L25;
}
}
state14.ignoreScrollFromMVCPIgnored = true;
return void 0;
}
}
state14.scrollPrev = scroll2;
state14.scrollPrevTime = state14.scrollTime;
state14.scroll = a1;
state14.scrollTime = lastBatchingAction;
const lastScrollDelta = Math.abs(a1 - scroll2);
const fromNativeScrollEvent = a3?.fromNativeScrollEvent;
let r63 = void 0;
if (fromNativeScrollEvent) {
const r65 = lastScrollDelta > 0.1;
r63 = void 0;
if (r65) {
r63 = void 0;
if (!r38) {
r63 = void 0;
if (scrollingTo2 === void 0) {
const pendingNativeMVCPAdjust = state14.pendingNativeMVCPAdjust;
r63 = void 0;
if (!pendingNativeMVCPAdjust) {
const r67 = a1 - scroll2;
const state15 = a0.state;
const edgeReachedGate = state15.edgeReachedGate;
let r71 = void 0;
if (edgeReachedGate === "prepared") {
const r72 = r67 < 0 ? "start" : "end";
state15.edgeReachedGate = "closed";
const state16 = a0.state;
if (r72 === "start") {
state16.isStartReached = false;
state16.startReachedSnapshot = void 0;
r71 = r72;
} else {
state16.isEndReached = false;
state16.endReachedSnapshot = void 0;
r71 = r72;
}
}
r63 = r71;
}
}
}
}
}
const state17 = a0.state;
const pendingNativeMVCPAdjust2 = state17.pendingNativeMVCPAdjust;
let r80 = false;
if (pendingNativeMVCPAdjust2) {
const r83 = pendingNativeMVCPAdjust2.amount - pendingNativeMVCPAdjust2.manualApplied;
const r87 = a1 - (pendingNativeMVCPAdjust2.startScroll + pendingNativeMVCPAdjust2.manualApplied);
const r89 = r83 < 0;
const r90 = r89 && r87 > c10649_66 || r83 > 0 && r87 < -0.1;
const furthestProgressTowardAmount = r89 ? -r87 : r87;
const r94 = Math.abs(r83);
if (r94 <= c10649_66) {
state17.pendingNativeMVCPAdjust = void 0;
r80 = true;
} else if (r90) {
state17.pendingNativeMVCPAdjust = void 0;
r80 = false;
} else if (furthestProgressTowardAmount + c10649_66 >= Math.abs(r83)) {
a0.state.pendingNativeMVCPAdjust = void 0;
const r130 = r83 - r87;
const r134 = Math.abs(r130) > c10649_66;
r80 = true;
if (r134) {
(0, env10649[65])(a0, r130, true);
r80 = true;
}
} else {
L65: {
L63: {
if (!(Math.abs(a1 - Math.max(0, (0, env10649[25])(a0) - state17.scrollLength)) <= 1)) {
if (state17.pendingMaintainScrollAtEnd && a0.values.get("isWithinMaintainScrollAtEndThreshold") && furthestProgressTowardAmount > c10649_66) {
break L63;
}
if (furthestProgressTowardAmount > pendingNativeMVCPAdjust2.furthestProgressTowardAmount + c10649_66) {
pendingNativeMVCPAdjust2.furthestProgressTowardAmount = furthestProgressTowardAmount;
r118 = false;
break L65;
}
r118 = pendingNativeMVCPAdjust2.furthestProgressTowardAmount > c10649_66 && furthestProgressTowardAmount < pendingNativeMVCPAdjust2.furthestProgressTowardAmount - c10649_66;
if (!r118) {
break L65;
}
state17.pendingNativeMVCPAdjust = void 0;
r118 = false;
break L65;
}
}
a0.state.pendingNativeMVCPAdjust = void 0;
const r122 = r83 - r87;
const r10 = Math.abs(r122) > c10649_66;
r118 = true;
if (r10) {
(0, env10649[65])(a0, r122, true);
r118 = true;
}
}
r80 = r118;
}
}
const scrollLength = state14.scrollLength;
const r140 = scrollLength > 0 && scrollingTo2 === void 0 && lastScrollDelta > scrollLength && !state14.pendingNativeMVCPAdjust;
const scrollVelocity = getScrollVelocity(state14);
const state18 = a0.state;
const adaptiveRender = state18.props.adaptiveRender;
const r150 = a0.values.get("adaptiveRender");
if (a0.values.get("readyToRender")) {
if (adaptiveRender) {
const enterVelocity = adaptiveRender.enterVelocity;
let r159 = enterVelocity ?? 3;
const exitVelocity = adaptiveRender.exitVelocity;
const r162 = exitVelocity ?? 1;
const exitDelay = adaptiveRender.exitDelay;
const r165 = exitDelay ?? 250;
const r167 = r150 === "light";
if (r167) {
r159 = r162;
}
const r172 = r140 ? "light" : Math.abs(scrollVelocity) > r159 ? "light" : "normal";
if (r172 !== (state18.timeoutAdaptiveRender === void 0 ? r150 : "normal")) {
if (r172 === "light") {
if (a0.values.get("adaptiveRender") !== "light") {
(0, env10649[22])(a0, "adaptiveRender", "light");
const adaptiveRender2 = a0.state.props.adaptiveRender;
const onChange = adaptiveRender2?.onChange;
if (onChange != null) {
onChange.call(adaptiveRender2, "light", "scroll");
}
}
(0, env10649[44])(a0, r165);
} else if (r167) {
(0, env10649[44])(a0, r165);
}
}
} else {
(0, env10649[45])(a0);
}
}
const scrollLastCalculate = state14.scrollLastCalculate;
if (!(!state14.dataChangeNeedsScrollUpdate && (!r80 && (r63 === void 0 && (!a2 && (scrollLastCalculate !== void 0 && !(Math.abs(state14.scroll - scrollLastCalculate) > 2))))))) {
state14.scrollLastCalculate = state14.scroll;
state14.ignoreScrollFromMVCPIgnored = false;
state14.lastScrollDelta = lastScrollDelta;
if (r140) {
state14.mvcpAnchorLock = void 0;
state14.pendingNativeMVCPAdjust = void 0;
state14.userScrollAnchorReset = {
keys: new Set()
};
if (state14.queuedMVCPRecalculate !== void 0) {
cancelAnimationFrame(state14.queuedMVCPRecalculate);
state14.queuedMVCPRecalculate = void 0;
}
const r220 = {
doMVCP,
scrollVelocity
};
if (r140) {
r220.drawDistanceMode = "visible-first";
}
const triggerCalculateItemsInView2 = state14.triggerCalculateItemsInView;
if (triggerCalculateItemsInView2 != null) {
triggerCalculateItemsInView2.call(state14, r220);
}
let env21558;
(0, env10649[43])(a0, r63);
const r228 = env21558 = {};
env21558[0] = void 0;
const state19 = a0.state;
env21558[0] = state19;
if (!(state19.props.drawDistance <= 50 || state19.queuedFullDrawDistancePrewarm !== void 0)) {
state19.queuedFullDrawDistancePrewarm = requestAnimationFrame($mk95164(r228));
}
} else {
const r203 = {
doMVCP,
scrollVelocity
};
if (r140) {
r203.drawDistanceMode = "visible-first";
}
const triggerCalculateItemsInView = state14.triggerCalculateItemsInView;
if (triggerCalculateItemsInView != null) {
triggerCalculateItemsInView.call(state14, r203);
}
(0, env10649[43])(a0, r63);
}
let r240 = !!state14.pendingMaintainScrollAtEnd;
if (!r240) {
const maintainScrollAtEnd2 = state14.props.maintainScrollAtEnd;
r240 = !!maintainScrollAtEnd2?.onDataChange;
}
if (r80) {
r80 = r240;
}
if (r80) {
state14.pendingMaintainScrollAtEnd = false;
(0, env10649[64])(a0);
}
state14.dataChangeNeedsScrollUpdate = false;
state14.lastScrollDelta = 0;
}
};
env10649[71] = function getItemBottom(a0, a1) {
const r4 = a0.state.positions[a1];
if (r4 !== void 0) {
let r6 = void 0;
if (a1 !== void 0) {
const r2 = a1 < 0;
r6 = void 0;
if (!r2) {
const r7 = env10649[58];
const state14 = a0.state;
const props = state14.props;
const { data: data3, keyExtractor: keyExtractor2 } = props;
let r5 = "";
if (data3) {
const r24 = a1 < data3.length ? keyExtractor2 ? keyExtractor2(data3[a1], a1) : a1 : null;
state14.idCache[a1] = r24;
r5 = r24;
}
r6 = r7(a0, r5, a1, a0.state.props.data[a1]);
}
}
const r32 = r6 ?? 0;
return r4 + (Number.isFinite(r32) ? r32 : 0);
}
};
env10649[72] = function scrollTo(a0, a1) {
let r138, r139, r140, r176, end2, scrollTargetPinnedRange;
const state14 = a0.state;
const noScrollingTo = a1.noScrollingTo;
a1.forceScroll;
const r19 = (0, env10649[3])(a1, env10649[5]);
const { animated, isInitialScroll, offset, precomputedWithViewOffset, waitForInitialScrollCompletionFrame } = r19;
const horizontal6 = state14.props.horizontal;
if (state14.animFrameCheckFinishedScroll) {
cancelAnimationFrame(a0.state.animFrameCheckFinishedScroll);
}
if (state14.timeoutCheckFinishedScrollFallback) {
clearTimeout(a0.state.timeoutCheckFinishedScrollFallback);
}
const r55 = precomputedWithViewOffset ? offset : (0, env10649[59])(a0, offset, r19);
let r57 = !!isInitialScroll;
if (r57) {
const initialScrollSession = state14.initialScrollSession;
r57 = initialScrollSession?.kind === "offset";
}
const state16 = a0.state;
const r24 = (0, env10649[25])(a0);
const isFinite2 = Number.isFinite(r24);
let r68 = r55;
if (isFinite2) {
const isFinite3 = Number.isFinite(state16.scrollLength);
r68 = r55;
if (isFinite3) {
const lastLayout = state16.lastLayout;
r68 = r55;
if (lastLayout) {
const r76 = Math.max(0, r24 - state16.scrollLength);
const viewOffset = r19?.viewOffset;
r68 = Math.min(r55, r76 + (typeof viewOffset === "number" ? viewOffset < 0 ? -viewOffset : 0 : 0));
}
}
}
const targetOffset2 = Math.max(0, r68);
const scroll2 = r57 ? r55 : targetOffset2;
state14.scrollHistory.length = 0;
if (!noScrollingTo) {
if (isInitialScroll) {
c10649_36.resetFlags(state14);
}
const length = Object.keys(state14.averageSizes).length;
let averageSizeSnapshot = void 0;
if (length !== 0) {
const r99 = {};
const averageSizes = state14.averageSizes;
averageSizeSnapshot = r99;
for (const key in averageSizes) {
averageSizeSnapshot = r99;
r99[key] = state14.averageSizes[key].avg;
}
averageSizeSnapshot = r99;
}
state14.scrollingTo = {
...r19,
...averageSizeSnapshot ? {
averageSizeSnapshot
} : {},
targetOffset: targetOffset2,
waitForInitialScrollCompletionFrame
};
if (!isInitialScroll) {
L64: {
const index3 = r19.index;
const state17 = a0.state;
const length2 = state17.props.data.length;
scrollTargetPinnedRange = void 0;
if (length2 !== 0) {
const r120 = Math.max(0, targetOffset2);
const r125 = Math.max(r120, targetOffset2 + state17.scrollLength);
const r126 = index3 !== void 0;
if (r126) {
end2 = Math.max(0, Math.min(length2 - 1, index3));
} else {
const state15 = a0.state;
let r130 = state15.props.data.length - 1;
let r132 = 0;
let r133 = void 0;
end2 = void 0;
while (r132 <= r130) {
const r33 = Math.floor((r132 + r130) / 2);
const r136 = state15.positions[r33];
const r5 = r130;
const r32 = r132;
const r137 = r133;
if (r136 === void 0) {
r138 = r33 - 1;
r139 = r32;
r140 = r137;
} else if (r136 <= r120) {
r139 = r33 + 1;
r138 = r5;
r140 = r33;
} else {
r138 = r33 - 1;
r139 = r32;
r140 = r137;
}
r130 = r138;
r132 = r139;
r133 = r140;
end2 = r133;
}
}
scrollTargetPinnedRange = void 0;
if (end2 !== void 0) {
if (r126 && state17.positions[end2] === void 0) {
scrollTargetPinnedRange = {
end: end2,
start: end2
};
break L64;
}
if (index3 === void 0) {
const r151 = (0, env10649[71])(a0, end2);
scrollTargetPinnedRange = void 0;
if (r151 === void 0) {
break L64;
}
const r152 = r151 <= r120;
scrollTargetPinnedRange = void 0;
if (r152) {
break L64;
}
}
let r154 = end2;
let r155 = r154;
while (r155 > 0) {
const r157 = state17.positions[r154];
const r158 = r154;
r155 = r158;
if (r157 === void 0) {
break;
}
r155 = r158;
if (r157 <= r120) {
break;
}
const r161 = state17.positions[r158 - 1];
r155 = r158;
if (r161 === void 0) {
break;
}
r154 = r158 - 1;
r155 = r154;
}
let r162 = r155;
let start2 = r162;
while (start2 > 0) {
const r166 = (0, env10649[71])(a0, r162 - 1);
start2 = r162;
if (r166 === void 0) {
break;
}
start2 = start2;
if (r166 <= r120) {
break;
}
r162 = start2 - 1;
start2 = r162;
}
const r168 = start2 + 1;
let r169 = start2;
let end3 = r169;
if (r168 < length2) {
do {
const r173 = state17.positions[r169 + 1];
const r174 = r169;
end3 = r174;
if (r173 === void 0) {
break;
}
end3 = r174;
if (r173 > r125) {
break;
}
const r175 = r174 + 1;
r176 = r175 + 1;
r169 = r175;
end3 = r169;
} while (r176 < length2);
}
scrollTargetPinnedRange = {
end: end3,
start: start2
};
}
}
}
const state18 = a0.state;
if (scrollTargetPinnedRange) {
state18.scrollTargetPinnedRange = scrollTargetPinnedRange;
a0.state.scrollForNextCalculateItemsInView = void 0;
} else {
state18.scrollTargetPinnedRange = void 0;
}
}
}
state14.scrollPending = targetOffset2;
const r183 = c10649_37.get(state14);
const didFinishInitialScroll = state14.didFinishInitialScroll;
const r185 = (didFinishInitialScroll ? !didFinishInitialScroll : isInitialScroll || !!r183) && c10649_37.hasNonZeroTargetOffset(targetOffset2);
const didFinishInitialScroll2 = state14.didFinishInitialScroll;
const r190 = (didFinishInitialScroll2 ? !didFinishInitialScroll2 : !!r183) && c10649_37.isAtZeroTargetOffset(scroll2);
if (r185) {
state14.hasScrolled = false;
let startScroll = r183?.startScroll;
if (startScroll == null) {
startScroll = state14.scroll;
}
c10649_37.set(state14, {
startScroll,
targetOffset: targetOffset2
});
} else if (r190) {
c10649_37.clear(state14);
}
if ((isInitialScroll ? !isInitialScroll : !noScrollingTo) && Math.abs(state14.scroll - targetOffset2) > 1) {
if (animated) {
if (state14.scrollTargetPinnedRange) {
const triggerCalculateItemsInView = state14.triggerCalculateItemsInView;
if (triggerCalculateItemsInView != null) {
triggerCalculateItemsInView.call(state14);
}
}
} else {
(0, env10649[70])(a0, targetOffset2, true, {
markHasScrolled: false
});
}
}
const state19 = a0.state;
const r220 = !animated;
const current5 = state19.refScroller.current;
if (current5) {
const r224 = !!horizontal6;
const r225 = env10649[15];
const r226 = r224 ? (0, env10649[25])(a0) : void 0;
const animated2 = !r220;
const r229 = r225(state19, scroll2, r226);
current5.scrollTo({
animated: animated2,
x: r224 ? r229 : 0,
y: r224 ? 0 : scroll2
});
if (isInitialScroll) {
c10649_36.markInitialScrollNativeDispatch(state19);
}
if (!animated2) {
state19.scroll = scroll2;
(0, env10649[63])(a0);
}
}
};
env10649[73] = function scrollToIndex(a0, a1) {
const { index: index3, viewOffset = 0, animated = true, forceScroll, isInitialScroll } = a1;
let viewPosition2 = a1.viewPosition;
const state14 = a0.state;
const data3 = state14.props.data;
const length = data3.length;
const index4 = length <= 0 ? -1 : index3 >= length ? length - 1 : index3 < 0 ? 0 : index3;
let itemSize = void 0;
if (index4 !== void 0) {
const r34 = index4 < 0;
itemSize = void 0;
if (!r34) {
const r19 = env10649[58];
const state15 = a0.state;
const props = state15.props;
const { data: data4, keyExtractor: keyExtractor2 } = props;
let r18 = "";
if (data4) {
const r38 = index4 < data4.length ? keyExtractor2 ? keyExtractor2(data4[index4], index4) : index4 : null;
state15.idCache[index4] = r38;
r18 = r38;
}
itemSize = r19(a0, r18, index4, a0.state.props.data[index4]);
}
}
const state16 = a0.state;
const offset = index4 !== void 0 && state16.positions[index4] || 0;
if (index4 === data3.length - 1 && viewPosition2 === void 0) {
viewPosition2 = 1;
}
state14.scrollForNextCalculateItemsInView = void 0;
env10649[72](a0, {
animated,
forceScroll,
index: index4,
isInitialScroll,
itemSize,
offset,
viewOffset,
viewPosition: viewPosition2 ?? 0
});
};
env10649[74] = function dispatchInitialScroll(a0, { forceScroll, resolvedOffset, target, waitForCompletionFrame }) {
const index3 = target.index;
let r13 = void 0;
if (index3 !== void 0) {
const length = a0.state.props.data.length;
r13 = length <= 0 ? -1 : index3 >= length ? length - 1 : index3 < 0 ? 0 : index3;
}
const r30 = env10649[72];
const index4 = r13 !== void 0 ? r13 >= 0 ? r13 : void 0 : void 0;
let itemSize = void 0;
if (r13 !== void 0) {
const r37 = r13 < 0;
itemSize = void 0;
if (!r37) {
const r12 = env10649[58];
const state14 = a0.state;
const props = state14.props;
const { data: data3, keyExtractor: keyExtractor2 } = props;
let r39 = "";
if (data3) {
const r42 = r13 < data3.length ? keyExtractor2 ? keyExtractor2(data3[r13], r13) : r13 : null;
state14.idCache[r13] = r42;
r39 = r42;
}
itemSize = r12(a0, r39, r13, a0.state.props.data[r13]);
}
}
r30(a0, {
animated: false,
forceScroll,
index: index4,
isInitialScroll: true,
itemSize,
offset: resolvedOffset,
precomputedWithViewOffset: true,
viewOffset: target.viewOffset,
viewPosition: target.viewPosition,
waitForInitialScrollCompletionFrame: waitForCompletionFrame
});
};
env10649[75] = function resolveInitialScrollOffset(a0, a1) {
let r46;
const initialScrollSession = a0.state.initialScrollSession;
if (initialScrollSession?.kind === "offset") {
const contentOffset = a1.contentOffset;
r46 = contentOffset ?? 0;
} else {
const r7 = env10649[59];
const index3 = a1.index;
let r16 = 0;
if (index3 !== void 0) {
const index4 = a1.index;
const state14 = a0.state;
r16 = index4 !== void 0 && state14.positions[index4] || 0;
}
const r19 = r7(a0, r16, a1);
const state15 = a0.state;
const r22 = (0, env10649[25])(a0);
const isFinite2 = Number.isFinite(r22);
let r27 = r19;
if (isFinite2) {
const isFinite3 = Number.isFinite(state15.scrollLength);
r27 = r19;
if (isFinite3) {
const lastLayout = state15.lastLayout;
r27 = r19;
if (lastLayout) {
const r36 = Math.max(0, r22 - state15.scrollLength);
const viewOffset = a1?.viewOffset;
r27 = Math.min(r19, r36 + (typeof viewOffset === "number" ? viewOffset < 0 ? -viewOffset : 0 : 0));
}
}
}
r46 = Math.max(0, r27);
}
return r46;
};
env10649[76] = function advanceCurrentInitialScrollSession(a0, a1) {
let r34, r36, r109, r111;
const initialScrollSession = a0.state.initialScrollSession;
if (initialScrollSession?.kind === "offset") {
let forceScroll2 = a1?.forceScroll;
const state16 = a0.state;
const { didFinishInitialScroll: didFinishInitialScroll2, queuedInitialLayout: queuedInitialLayout3, scrollingTo: scrollingTo3, initialScroll: initialScroll4 } = state16;
const isInitialScrollInProgress3 = !!scrollingTo3?.isInitialScroll;
const r108 = false;
L76: {
r109 = void 0;
if (initialScroll4) {
r109 = void 0;
if (!r108) {
r109 = void 0;
if (!didFinishInitialScroll2) {
if (scrollingTo3) {
r109 = void 0;
if (!isInitialScrollInProgress3) {
break L76;
}
}
r109 = {
initialScroll: initialScroll4,
isInitialScrollInProgress: isInitialScrollInProgress3,
queuedInitialLayout: queuedInitialLayout3,
scrollingTo: scrollingTo3
};
}
}
}
}
L90: {
r111 = false;
if (r109) {
const { initialScroll: initialScroll5, queuedInitialLayout: queuedInitialLayout4 } = r109;
const contentOffset = initialScroll5.contentOffset;
const resolvedOffset = contentOffset ?? 0;
const r125 = Math.abs(state16.scroll - resolvedOffset) <= 1 && Math.abs(state16.scrollPending - resolvedOffset) <= 1;
if (forceScroll2) {
r111 = false;
if (r125) {
break L90;
}
}
let r133 = !!state16.lastLayout && state16.scrollLength > 0;
const r135 = env10649[74];
if (forceScroll2 == null) {
if (!r133) {
r133 = !!queuedInitialLayout4;
}
forceScroll2 = r133;
}
r135(a0, {
forceScroll: forceScroll2,
resolvedOffset,
target: initialScroll5
});
r111 = true;
}
}
r36 = r111;
} else {
let forceScroll = a1?.forceScroll;
const state14 = a0.state;
const { didFinishInitialScroll, queuedInitialLayout, scrollingTo: scrollingTo2, initialScroll: initialScroll2 } = state14;
const r30 = !scrollingTo2?.isInitialScroll;
let r32 = !!true && !queuedInitialLayout;
const isInitialScrollInProgress2 = !r30;
if (r32) {
r32 = !isInitialScrollInProgress2;
}
L17: {
r34 = void 0;
if (initialScroll2) {
r34 = void 0;
if (!r32) {
r34 = void 0;
if (!didFinishInitialScroll) {
if (scrollingTo2) {
r34 = void 0;
if (!isInitialScrollInProgress2) {
break L17;
}
}
r34 = {
initialScroll: initialScroll2,
isInitialScrollInProgress: isInitialScrollInProgress2,
queuedInitialLayout,
scrollingTo: scrollingTo2
};
}
}
}
}
r36 = false;
if (r34) {
const initialScroll3 = r34.initialScroll;
let isInitialScrollInProgress = r34.isInitialScrollInProgress;
const queuedInitialLayout2 = r34.queuedInitialLayout;
const r21 = isInitialScrollInProgress ? r34.scrollingTo : void 0;
const contentOffset2 = (0, env10649[75])(a0, initialScroll3);
let r42 = void 0;
if (r21) {
let targetOffset2 = r21.targetOffset;
if (targetOffset2 == null) {
targetOffset2 = r21.offset;
}
r42 = targetOffset2;
}
const r44 = initialScroll3.contentOffset === void 0 || Math.abs(initialScroll3.contentOffset - contentOffset2) > 1;
let r4 = r42 !== void 0;
const r6 = r4 ? Math.abs(r42 - contentOffset2) > 1 : r4;
if (r4) {
r4 = Math.abs(state14.scroll - contentOffset2) <= 1;
}
if (r4) {
r4 = Math.abs(state14.scrollPending - contentOffset2) <= 1;
}
let r70 = (forceScroll ? !forceScroll : !r44) && isInitialScrollInProgress && !r6 || (forceScroll ? r4 : forceScroll);
if (!r70) {
let r72 = r44;
if (r44) {
const initialScrollSession2 = state14.initialScrollSession;
r72 = initialScrollSession2?.kind !== "offset";
}
if (r72) {
const initialScroll6 = {
...initialScroll3,
contentOffset: contentOffset2
};
const state15 = a0.state;
state15.clearPreservedInitialScrollOnNextFinish = void 0;
if (state15.timeoutPreservedInitialScrollClear !== void 0) {
clearTimeout(state15.timeoutPreservedInitialScrollClear);
state15.timeoutPreservedInitialScrollClear = void 0;
}
state15.initialScroll = initialScroll6;
const r84 = env10649[38];
const initialScrollSession3 = state15.initialScrollSession;
r84(state15, {
kind: initialScrollSession3?.kind === "offset" ? "offset" : "bootstrap"
});
}
const r91 = env10649[74];
if (forceScroll == null) {
let r93 = !!queuedInitialLayout2;
if (!r93) {
if (isInitialScrollInProgress) {
isInitialScrollInProgress = r44;
}
r93 = isInitialScrollInProgress;
}
forceScroll = r93;
}
r91(a0, {
forceScroll,
resolvedOffset: contentOffset2,
target: initialScroll3
});
r70 = 0;
}
r36 = !r70;
}
}
return r36;
};
env10649[77] = function checkAllSizesKnown(a0, a1, a2) {
if (a1 != null && a2 != null && !(a1 < 0) && !(a2 < a1)) {
let r29 = false;
for (const item5 of a0.containerItemKeys.keys()) {
const r35 = a0.indexByKey.get(item5);
if (r35 === void 0) {
continue;
}
if (!(r35 >= a1)) {
continue;
}
if (!(r35 <= a2)) {
continue;
}
r29 = true;
const r41 = (0, env10649[49])(a0, r35);
if (r41 !== void 0 && a0.sizesKnown.has(r41)) {
continue;
}
return false;
}
return r29;
}
return false;
};
env10649[78] = function abortBootstrapRevealIfNeeded(a0, { mountFrameCount, maxFrames = 8, maxPasses = 24, passCount }) {
let r19;
const r3 = mountFrameCount >= maxFrames || passCount >= maxPasses;
L67: {
r19 = !!r3;
if (r19) {
if (c10649_31) {
console.warn("LegendList bootstrap initial scroll aborted after exceeding convergence bounds.");
}
const state14 = a0.state;
const initialScrollSession = state14.initialScrollSession;
const r14 = initialScrollSession?.kind === "bootstrap" ? state14.initialScrollSession.bootstrap : void 0;
const initialScroll2 = state14.initialScroll;
if (r14 && initialScroll2) {
const initialScrollSession2 = state14.initialScrollSession;
if (initialScrollSession2?.kind !== "offset" && state14.refScroller.current) {
const initialScrollSession3 = state14.initialScrollSession;
const r41 = initialScrollSession3?.kind === "bootstrap" ? state14.initialScrollSession.bootstrap : void 0;
const frameHandle = r41?.frameHandle;
if (frameHandle !== void 0 && typeof globalThis.cancelAnimationFrame === "function") {
cancelAnimationFrame(frameHandle);
}
if (r41) {
r41.frameHandle = void 0;
}
const r50 = env10649[38];
const initialScrollSession4 = state14.initialScrollSession;
r50(state14, {
bootstrap: null,
kind: initialScrollSession4?.kind
});
(0, env10649[74])(a0, {
forceScroll: true,
resolvedOffset: r14.scroll,
target: initialScroll2,
waitForCompletionFrame: false
});
r19 = true;
break L67;
}
}
const initialScrollSession5 = state14.initialScrollSession;
const r63 = initialScrollSession5?.kind === "bootstrap" ? state14.initialScrollSession.bootstrap : void 0;
let r66 = r63?.scroll;
if (r66 == null) {
r66 = state14.scrollPending;
}
if (r66 == null) {
r66 = state14.scroll;
}
const resolvedOffset = r66 ?? 0;
const state15 = a0.state;
const initialScrollSession6 = state15.initialScrollSession;
const r74 = initialScrollSession6?.kind === "bootstrap" ? state15.initialScrollSession.bootstrap : void 0;
const frameHandle2 = r74?.frameHandle;
if (frameHandle2 !== void 0 && typeof globalThis.cancelAnimationFrame === "function") {
cancelAnimationFrame(frameHandle2);
}
if (r74) {
r74.frameHandle = void 0;
}
const r84 = env10649[38];
const initialScrollSession7 = state15.initialScrollSession;
r84(state15, {
bootstrap: null,
kind: initialScrollSession7?.kind
});
const clearPreservedInitialScrollOnNextFinish = state15.clearPreservedInitialScrollOnNextFinish;
let preserveTarget = clearPreservedInitialScrollOnNextFinish ? !clearPreservedInitialScrollOnNextFinish : state15.props.data.length > 0;
if (preserveTarget) {
const initialScroll3 = state15.initialScroll;
preserveTarget = initialScroll3?.viewPosition === 1;
}
(0, env10649[48])(a0, {
preserveTarget,
recalculateItems: true,
resolvedOffset,
schedulePreservedTargetClear: preserveTarget
});
r19 = true;
}
}
return r19;
};
env10649[79] = function startBootstrapInitialScrollSession(a0, a1) {
const initialScrollSession = a0.initialScrollSession;
const r10 = initialScrollSession?.kind === "bootstrap" ? a0.initialScrollSession.bootstrap : void 0;
const r14 = env10649[38];
const frameHandle = r10?.frameHandle;
const mountFrameCount = r10?.mountFrameCount;
const mountFrameCount2 = mountFrameCount ?? 0;
let seedContentOffset = a1.seedContentOffset;
if (seedContentOffset == null) {
seedContentOffset = r10?.seedContentOffset;
}
if (seedContentOffset == null) {
seedContentOffset = a1.scroll;
}
r14(a0, {
bootstrap: {
frameHandle,
mountFrameCount: mountFrameCount2,
passCount: 0,
previousResolvedOffset: void 0,
scroll: a1.scroll,
seedContentOffset,
targetIndexSeed: a1.targetIndexSeed,
visibleIndices: void 0
},
kind: "bootstrap"
});
};
env10649[80] = function rearmBootstrapInitialScroll(a0, a1) {
const state14 = a0.state;
const initialScrollSession = state14.initialScrollSession;
const bootstrap = initialScrollSession?.kind === "bootstrap" ? state14.initialScrollSession.bootstrap : void 0;
if (bootstrap) {
bootstrap.passCount = 0;
bootstrap.previousResolvedOffset = void 0;
let scroll2 = a1.scroll;
if (scroll2 == null) {
scroll2 = bootstrap.scroll;
}
bootstrap.scroll = scroll2;
let seedContentOffset = a1.seedContentOffset;
if (seedContentOffset == null) {
seedContentOffset = bootstrap.seedContentOffset;
}
bootstrap.seedContentOffset = seedContentOffset;
let targetIndexSeed = a1.targetIndexSeed;
if (targetIndexSeed == null) {
targetIndexSeed = bootstrap.targetIndexSeed;
}
bootstrap.targetIndexSeed = targetIndexSeed;
bootstrap.visibleIndices = void 0;
(0, env10649[38])(state14, {
bootstrap,
kind: "bootstrap"
});
} else if (a1.scroll !== void 0) {
(0, env10649[79])(state14, {
scroll: a1.scroll,
seedContentOffset: a1.seedContentOffset,
targetIndexSeed: a1.targetIndexSeed
});
}
let env21559;
const r27 = env21559 = {
$parent: env10649
};
env21559[0] = a0;
const state15 = a0.state;
env21559[1] = state15;
const initialScrollSession2 = state15.initialScrollSession;
const r32 = initialScrollSession2?.kind === "bootstrap" ? state15.initialScrollSession.bootstrap : void 0;
if (r32 && r32.frameHandle === void 0) {
r32.frameHandle = requestAnimationFrame($mk95175(r27));
}
let env21560;
const state16 = a0.state;
const r40 = env21560 = {};
env21560[0] = state16;
requestAnimationFrame($mk95174(r40));
};
env10649[81] = function clearPendingInitialScrollFooterLayout(a0, { dataLength, stylePaddingBottom: stylePaddingBottom2, target }) {
if (target?.preserveForFooterLayout) {
const initialScroll2 = {
contentOffset: void 0,
index: Math.max(0, dataLength - 1),
preserveForBottomPadding: true,
preserveForFooterLayout: void 0,
viewOffset: -stylePaddingBottom2 - 0,
viewPosition: 1
};
const state14 = a0.state;
state14.clearPreservedInitialScrollOnNextFinish = void 0;
if (state14.timeoutPreservedInitialScrollClear !== void 0) {
clearTimeout(state14.timeoutPreservedInitialScrollClear);
state14.timeoutPreservedInitialScrollClear = void 0;
}
state14.initialScroll = initialScroll2;
const r27 = env10649[38];
const initialScrollSession = state14.initialScrollSession;
r27(state14, {
kind: initialScrollSession?.kind === "offset" ? "offset" : "bootstrap"
});
}
};
env10649[82] = function didFinishedInitialScrollMoveAwayFromTarget(a0, a1) {
let r20;
const r1 = void 0 === void 0 ? 1 : void 0;
const state14 = a0.state;
if (state14.didFinishInitialScroll) {
const current5 = state14.refScroller.current;
const getCurrentScrollOffset = current5?.getCurrentScrollOffset;
const r13 = getCurrentScrollOffset == null ? void 0 : getCurrentScrollOffset.call(current5);
L18: {
if (typeof r13 === "number") {
const isFinite2 = Number.isFinite(r13);
r20 = r13;
if (isFinite2) {
break L18;
}
}
let scrollPending = state14.scrollPending;
if (scrollPending == null) {
scrollPending = state14.scroll;
}
r20 = scrollPending ?? 0;
}
return Math.abs(r20 - (0, env10649[75])(a0, a1)) > r1;
}
return false;
};
env10649[83] = function getPreservedEndAnchorOffsetDiff(a0) {
let lastNativeScroll;
const state14 = a0.state;
const initialScroll2 = state14.initialScroll;
if (state14.didFinishInitialScroll) {
const scrollingTo2 = state14.scrollingTo;
if (!scrollingTo2?.isInitialScroll && initialScroll2 && initialScroll2.viewPosition === 1 && state14.props.data.length !== 0) {
const initialScrollSession = state14.initialScrollSession;
if (initialScrollSession?.kind !== "offset") {
if (typeof state14.lastNativeScroll === "number" && Number.isFinite(state14.lastNativeScroll)) {
lastNativeScroll = state14.lastNativeScroll;
} else {
const current5 = state14.refScroller.current;
const getCurrentScrollOffset = current5?.getCurrentScrollOffset;
lastNativeScroll = getCurrentScrollOffset == null ? void 0 : getCurrentScrollOffset.call(current5);
if (!(typeof lastNativeScroll === "number" && Number.isFinite(lastNativeScroll))) {
let scrollPending = state14.scrollPending;
if (scrollPending == null) {
scrollPending = state14.scroll;
}
lastNativeScroll = scrollPending ?? 0;
}
}
return (0, env10649[75])(a0, initialScroll2) - lastNativeScroll;
}
}
}
};
env10649[84] = function evaluateBootstrapInitialScroll(a0) {
let r100, r147;
const state9 = a0.state;
const initialScrollSession = state9.initialScrollSession;
const r13 = initialScrollSession?.kind === "bootstrap" ? state9.initialScrollSession.bootstrap : void 0;
L94: {
const initialScroll2 = state9.initialScroll;
if (r13 && initialScroll2) {
const initialScrollSession2 = state9.initialScrollSession;
if (initialScrollSession2?.kind !== "offset") {
const scrollingTo2 = state9.scrollingTo;
if (!scrollingTo2?.isInitialScroll) {
r13.passCount = r13.passCount + 1;
if (!(0, env10649[78])(a0, {
mountFrameCount: r13.mountFrameCount,
passCount: r13.passCount
})) {
if (initialScroll2.index !== void 0 && state9.startBuffered >= 0 && state9.endBuffered >= 0 && initialScroll2.index >= state9.startBuffered && initialScroll2.index <= state9.endBuffered) {
r13.targetIndexSeed = void 0;
}
const previousResolvedOffset2 = (0, env10649[75])(a0, initialScroll2);
const r65 = (0, env10649[77])(state9, state9.startBuffered, state9.endBuffered);
const r9 = Math.abs(r13.scroll - previousResolvedOffset2) > 1;
const data3 = state9.props.data;
const length = data3.length;
const { positions: positions2, scrollLength } = state9;
let targetIndexSeed = r13.targetIndexSeed;
if (targetIndexSeed == null) {
targetIndexSeed = state9.startBuffered >= 0 ? state9.startBuffered : void 0;
}
const r22 = previousResolvedOffset2 + scrollLength;
let r80 = targetIndexSeed !== void 0 ? Math.max(0, Math.min(length - 1, targetIndexSeed)) : 0;
let r81 = r80;
if (r81 > 0) {
do {
const r82 = r80 - 1;
const r83 = positions2[r82];
const r84 = r80;
if (r83 !== void 0) {
let r29 = state9.idCache[r82];
if (r29 == null) {
const props = state9.props;
const { data: data4, keyExtractor: keyExtractor2 } = props;
let r87 = "";
if (data4) {
const r89 = r82 < data4.length ? keyExtractor2 ? keyExtractor2(data4[r82], r82) : r82 : null;
state9.idCache[r82] = r89;
r87 = r89;
}
r29 = r87;
}
let r94 = state9.sizes.get(r29);
const r95 = r29;
if (r94 == null) {
r94 = (0, env10649[58])(a0, r95, r82, data3[r82]);
}
if (r94 !== void 0) {
const r97 = r83 + r94;
r81 = r84;
if (r97 <= previousResolvedOffset2) {
break;
}
}
}
r80 = r82;
r81 = r80;
} while (0 < r81);
}
const visibleIndices2 = [];
while (r81 < length) {
L63: {
const r99 = positions2[r81];
r100 = r81;
if (r99 !== void 0) {
let r102 = state9.idCache[r100];
if (r102 == null) {
const props2 = state9.props;
const { data: data5, keyExtractor: keyExtractor3 } = props2;
let r106 = "";
if (data5) {
const r109 = r100 < data5.length ? keyExtractor3 ? keyExtractor3(data5[r100], r100) : r100 : null;
state9.idCache[r100] = r109;
r106 = r109;
}
r102 = r106;
}
let r115 = state9.sizes.get(r102);
const r116 = r102;
if (r115 == null) {
r115 = (0, env10649[58])(a0, r116, r100, data3[r100]);
}
if (r115 !== void 0) {
if (r99 < r22 && r99 + r115 > previousResolvedOffset2) {
visibleIndices2.push(r100);
break L63;
}
if (visibleIndices2.length > 0 && r99 >= r22) {
break;
}
}
}
}
r81 = r100 + 1;
}
const r128 = visibleIndices2.length > 0 && visibleIndices2.every((item) => {
let r3 = state9.idCache[item];
if (r3 == null) {
const props = state9.props;
const { data: data3, keyExtractor: keyExtractor2 } = props;
let r11 = "";
if (data3) {
const r12 = item < data3.length ? keyExtractor2 ? keyExtractor2(data3[item], item) : item : null;
state9.idCache[item] = r12;
r11 = r12;
}
r3 = r11;
}
return state9.sizesKnown.has(r3);
});
const { previousResolvedOffset, visibleIndices } = r13;
r13.previousResolvedOffset = previousResolvedOffset2;
r13.visibleIndices = visibleIndices2;
if (r9) {
let env21563;
r13.scroll = previousResolvedOffset2;
const r172 = env21563 = {};
env21563[0] = state9;
requestAnimationFrame($mk95174(r172));
return void 0;
}
if (r65 && r128) {
if (previousResolvedOffset !== void 0 && Math.abs(previousResolvedOffset - previousResolvedOffset2) <= 1) {
let r137 = false;
if (visibleIndices) {
const length2 = visibleIndices.length;
const length3 = visibleIndices2.length;
r137 = false;
if (length2 === length3) {
const r141 = 0 < visibleIndices.length;
let r142 = 0;
r137 = true;
if (r141) {
do {
const r143 = visibleIndices[r142];
const r144 = visibleIndices2[r142];
const r1 = r142;
r137 = false;
if (r143 !== r144) {
break;
}
const r145 = r1 + 1;
r147 = r145 < visibleIndices.length;
r142 = r145;
r137 = true;
} while (r147);
}
}
}
if (r137) {
const initialScrollSession3 = state9.initialScrollSession;
const r155 = initialScrollSession3?.kind === "bootstrap" ? state9.initialScrollSession.bootstrap : void 0;
const frameHandle = r155?.frameHandle;
if (frameHandle !== void 0 && typeof globalThis.cancelAnimationFrame === "function") {
cancelAnimationFrame(frameHandle);
}
if (r155) {
r155.frameHandle = void 0;
}
const r163 = env10649[38];
const initialScrollSession4 = state9.initialScrollSession;
r163(state9, {
bootstrap: null,
kind: initialScrollSession4?.kind
});
(0, env10649[74])(a0, {
forceScroll: true,
resolvedOffset: previousResolvedOffset2,
target: initialScroll2,
waitForCompletionFrame: false
});
break L94;
}
}
let env21562;
const r148 = env21562 = {};
env21562[0] = state9;
requestAnimationFrame($mk95174(r148));
}
}
}
}
}
}
};
env10649[85] = function retargetActiveInitialScrollAtEnd(a0) {
let r18;
const state14 = a0.state;
const initialScroll2 = state14.initialScroll;
if (state14.didFinishInitialScroll) {
const r24 = (0, env10649[83])(a0);
let r25 = false;
if (r24 !== void 0) {
let env21564;
const preservedEndAnchorCorrection = {};
const r27 = env21564 = {
$parent: env10649
};
env21564[0] = a0;
env21564[1] = preservedEndAnchorCorrection;
const state15 = a0.state;
env21564[2] = state15;
state15.preservedEndAnchorCorrection = preservedEndAnchorCorrection;
requestAnimationFrame($mk95176(r27));
r25 = true;
}
r18 = r25;
} else {
let r1 = !initialScroll2;
if (initialScroll2) {
const initialScrollSession = state14.initialScrollSession;
r1 = initialScrollSession?.kind === "offset";
}
if (!r1) {
r1 = initialScroll2.viewPosition !== 1;
}
if (!r1) {
r1 = state14.props.data.length === 0;
}
r18 = r1 ? !r1 : (0, env10649[76])(a0, {
forceScroll: true
});
}
return r18;
};
env10649[86] = function resetLayoutCachesForDataChange(a0) {
a0.indexByKey.clear();
a0.idCache.length = 0;
a0.positions.length = 0;
a0.columns.length = 0;
a0.columnSpans.length = 0;
};
env10649[87] = function scheduleContainerLayout(a0, a1) {
let r22, pendingContainerIds3;
const { pendingContainerIds, pendingContainerIds: pendingContainerIds2 } = a0;
if (a1 === void 0) {
a0.pendingContainerIds = null;
} else if (pendingContainerIds2 !== null) {
if (pendingContainerIds2) {
if (typeof a1 === "number") {
pendingContainerIds2.add(a1);
pendingContainerIds3 = pendingContainerIds2;
} else {
let r33 = a1[Symbol.iterator]();
const next = r33.next;
while (true) {
const r9 = r33 === void 0 ? void 0 : (r22 = next.call(r33)).done ? r33 = void 0 : r22.value;
const r36 = r33;
pendingContainerIds3 = pendingContainerIds2;
if (r36 === void 0) {
break;
}
try {
pendingContainerIds2.add(r9);
} catch (r39) {
if (r33 !== void 0 && typeof r33.return === "function") {
try {
r33.return();
} catch {}
}
throw r39;
}
}
}
} else {
pendingContainerIds3 = typeof a1 === "number" ? new Set([a1]) : new Set(a1);
}
a0.pendingContainerIds = pendingContainerIds3;
}
if (pendingContainerIds === void 0) {
const r44 = env10649[22];
const r47 = (0, env10649[21])(a0, "containerLayoutEpoch");
r44(a0, "containerLayoutEpoch", (r47 ?? 0) + 1);
}
};
env10649[88] = function syncMountedContainer(a0, a1, a2, a3) {
let didRefreshData;
const state14 = a0.state;
const { columns, columnSpans, positions: positions2, props } = state14;
const { data: data3, itemsAreEqual, keyExtractor: keyExtractor2 } = props;
const r15 = data3[a2];
if (r15 === void 0) {
return {
didChangePosition: false,
didRefreshData: false
};
}
let r22 = state14.idCache[a2];
if (r22 == null) {
const props3 = state14.props;
const { data: data4, keyExtractor: keyExtractor3 } = props3;
let r39 = "";
if (data4) {
const r40 = a2 < data4.length ? keyExtractor3 ? keyExtractor3(data4[a2], a2) : a2 : null;
state14.idCache[a2] = r40;
r39 = r40;
}
r22 = r39;
}
const updateLayout = a3.updateLayout;
const r45 = updateLayout == null || updateLayout;
let didChangePosition = false;
if (r45) {
let r47 = positions2[a2];
if (r47 === void 0) {
(0, env10649[22])(a0, `containerPosition${a1}`, c10649_32);
return {
didChangePosition: false,
didRefreshData: false
};
}
if (!r47) {
r47 = 0;
}
const scrollAdjustPending = a3.scrollAdjustPending;
const r51 = r47 - (scrollAdjustPending ?? 0);
let r54 = state14.sizes.get(r22);
if (r54 == null) {
r54 = (0, env10649[58])(a0, r22, a2, r15);
}
const r59 = a0.values.get("totalSize");
const props2 = state14?.props;
let r64 = !!props2?.horizontal;
if (r64) {
let r66 = props2?.rtl;
if (r66 == null) {
r66 = !!env10649[11].I18nManager.isRTL;
}
r64 = r66;
}
const r29 = r64 ? r59 !== void 0 ? Number.isFinite(r59) ? Math.max(0, r59 - r51 - r54) : r51 : r51 : r51;
const r79 = columns[a2] || 1;
const r80 = columnSpans[a2] || 1;
const r87 = a0.values.get(`containerPosition${a1}`);
const r94 = a0.values.get(`containerColumn${a1}`);
const r99 = a0.values.get(`containerSpan${a1}`);
const r5 = r29 > c10649_32 && r29 !== r87;
let r101 = false;
if (r5) {
(0, env10649[22])(a0, `containerPosition${a1}`, r29);
r101 = true;
}
if (r79 >= 0 && r79 !== r94) {
(0, env10649[22])(a0, `containerColumn${a1}`, r79);
}
didChangePosition = r101;
if (r80 !== r99) {
(0, env10649[22])(a0, `containerSpan${a1}`, r80);
didChangePosition = r101;
}
}
if (a0.values.get(`containerItemIndex${a1}`) !== a2) {
(0, env10649[22])(a0, `containerItemIndex${a1}`, a2);
}
L89: {
const r138 = a0.values.get(`containerItemData${a1}`);
didRefreshData = false;
if (r138 !== r15) {
const pendingDataComparison = state14.pendingDataComparison;
const previousData = pendingDataComparison?.previousData;
const previousData2 = state14.previousData;
let r144 = void 0;
if (previousData === previousData2) {
const pendingDataComparison2 = state14.pendingDataComparison;
r144 = pendingDataComparison2?.nextData === data3 ? state14.pendingDataComparison : void 0;
}
const r149 = r144 == null ? void 0 : r144.byIndex[a2];
const r153 = r149 ?? 0;
let r2 = 2;
if (r153 === 2) {
(0, env10649[22])(a0, `containerItemData${a1}`, r15);
didRefreshData = true;
} else {
didRefreshData = false;
if (r153 !== 1) {
const r160 = a0.values.get(`containerItemKey${a1}`);
if (r160 != null) {
r22 = r160;
}
const r162 = keyExtractor2 == null ? void 0 : keyExtractor2(r138, a2);
if (r138 !== void 0 && keyExtractor2 && r162 === r22) {
if (itemsAreEqual) {
const r178 = itemsAreEqual(r138, r15, a2, data3);
if (!(state14.pendingDataComparison && state14.pendingDataComparison.previousData === state14.previousData && state14.pendingDataComparison.nextData === data3) && state14.previousData) {
state14.pendingDataComparison = {
byIndex: [],
nextData: data3,
previousData: state14.previousData
};
}
const pendingDataComparison3 = state14.pendingDataComparison;
if (pendingDataComparison3?.byIndex) {
const byIndex = state14.pendingDataComparison.byIndex;
if (r178) {
r2 = 1;
}
byIndex[a2] = r2;
}
didRefreshData = false;
if (r178) {
break L89;
}
(0, env10649[22])(a0, `containerItemData${a1}`, r15);
didRefreshData = true;
break L89;
}
(0, env10649[22])(a0, `containerItemData${a1}`, r15);
didRefreshData = true;
break L89;
}
(0, env10649[22])(a0, `containerItemData${a1}`, r15);
didRefreshData = true;
}
}
}
}
return {
didChangePosition,
didRefreshData
};
};
env10649[89] = function updateItemPositions(a0, a1, r16 = {
doMVCP: false,
forceFullUpdate: false,
optimizeForVisibleWindow: false,
scrollBottomBuffered: -1,
startIndex: 0
}) {
let r49, r132, r250, r251, r252, r255;
const { doMVCP, forceFullUpdate = false } = r16;
let optimizeForVisibleWindow = r16.optimizeForVisibleWindow;
if (optimizeForVisibleWindow === void 0) {
optimizeForVisibleWindow = false;
}
const scrollBottomBuffered = r16.scrollBottomBuffered;
let scrollVelocity = r16.scrollVelocity;
const startIndex = r16.startIndex;
const state14 = a0.state;
const r14 = a0.positionListeners.size > 0;
const { columns, columnSpans, indexByKey: indexByKey2, positions: positions2, idCache, sizesKnown, props: props2 } = state14;
const { data: data3, overrideItemLayout, snapToIndices: snapToIndices2 } = props2;
const scrollingTo2 = state14.scrollingTo;
const length = data3.length;
const r75 = a0.values.get("numColumns");
const r37 = r75 ?? 1;
const r13 = r37 > 1;
const r36 = c10649_31 ? new Map() : void 0;
const r35 = a0.values.get("extraData");
const r34 = overrideItemLayout ? {
span: 1
} : void 0;
state14.lastScrollDelta;
if (scrollVelocity == null) {
scrollVelocity = getScrollVelocity(state14);
}
let r32 = forceFullUpdate ? !forceFullUpdate : !a1;
if (r32) {
if (!optimizeForVisibleWindow) {
optimizeForVisibleWindow = Math.abs(scrollVelocity) > 0;
}
if (!optimizeForVisibleWindow) {
optimizeForVisibleWindow = false;
}
r32 = optimizeForVisibleWindow;
}
const r31 = scrollBottomBuffered + 1000;
let r30 = (doMVCP ? a1 : !doMVCP) || state14.scrollAdjustHandler.getAdjust() !== 0;
if (!r30) {
const r95 = a0.values.get("scrollAdjustPending");
r30 = (r95 ?? 0) !== 0;
}
if (a1) {
columnSpans.length = 0;
}
if (!r13) {
if (columns.length) {
columns.length = 0;
}
if (columnSpans.length) {
columnSpans.length = 0;
}
}
const r100 = startIndex > 0;
let r29 = 0;
let r101 = startIndex;
if (r100) {
if (r13) {
const state15 = a0.state;
const r124 = a0.values.get("numColumns");
const r126 = state15.columns[startIndex];
let r127 = startIndex;
if (r126 !== 1) {
if (r124 <= 1) {
r132 = Math.max(0, startIndex);
} else {
let r131 = Math.max(0, startIndex);
r132 = r131;
while (r132 > 0) {
const r134 = state15.columns[r131];
const r135 = r131;
r132 = r135;
if (r134 === 1) {
break;
}
r131 = r135 - 1;
r132 = r131;
}
}
r127 = r132;
}
state15.columns[r127];
const r141 = r127 > 0;
let r142 = 0;
if (r141) {
const r143 = r127 - 1;
const r145 = state15.positions[r143];
const r147 = r145 ?? 0;
if (r124 <= 1) {
r49 = Math.max(0, r143);
} else {
let r151 = Math.max(0, r143);
r49 = r151;
while (r49 > 0) {
const r153 = state15.columns[r151];
const r154 = r151;
r49 = r154;
if (r153 === 1) {
break;
}
r151 = r154 - 1;
r49 = r151;
}
}
const state16 = a0.state;
const r159 = r143 < r49;
let r160 = 0;
if (!r159) {
const data6 = state16.props.data;
r160 = 0;
if (data6) {
const r6 = r49 <= r143;
let r163 = 0;
let r164 = 0;
if (r6) {
do {
const r50 = r49;
const r53 = r163;
let r51 = r53;
if (!(r50 < 0)) {
const length2 = data6.length;
r51 = r53;
if (!(r50 >= length2)) {
const r172 = (0, env10649[58])(a0, state16.idCache[r50], r50, data6[r50], true);
r51 = r53;
if (r172 > r51) {
r51 = r172;
}
}
}
r49 = r50 + 1;
r163 = r51;
r164 = r163;
} while (r49 <= r143);
}
r160 = r164;
}
}
r142 = r147 + r160;
}
r29 = r142;
r101 = r127;
} else {
const r102 = startIndex < length;
r29 = 0;
r101 = startIndex;
if (r102) {
const r103 = startIndex - 1;
const props3 = state14.props;
const { data: data5, keyExtractor: keyExtractor3 } = props3;
let r107 = "";
if (data5) {
const r110 = r103 < data5.length ? keyExtractor3 ? keyExtractor3(data5[r103], r103) : r103 : null;
state14.idCache[r103] = r110;
r107 = r110;
}
const r114 = positions2[r103];
const r116 = r114 ?? 0;
let r118 = sizesKnown.get(r107);
if (r118 == null) {
r118 = (0, env10649[58])(a0, r107, r103, data3[r103], true, r30, false);
}
r29 = r116 + r118;
r101 = startIndex;
}
}
}
const r173 = a1 ? a1 : indexByKey2.size === 0;
const r12 = (r13 ? !!overrideItemLayout : r13) && !!r34;
const r177 = r101 < length;
const r179 = ") which causes missing items and gaps and other terrrible things. Check that keyExtractor returns unique values.";
let r183 = void 0;
let r184 = 0;
let r185 = 1;
let r186 = false;
if (r177) {
do {
const r187 = r101;
const r188 = r183;
const r189 = r184;
let r57 = r185;
const r190 = r29;
if (r32 && r188 !== void 0) {
const r191 = r187 > r188;
r186 = true;
if (r191) {
break;
}
}
let r192 = r188;
if (r32) {
r192 = r188;
if (r192 === void 0) {
r192 = scrollingTo2 ? r188 : a1 ? r188 : r190 > r31 ? r187 + (r13 ? r37 : 1) + 10 : r188;
}
}
let r195 = idCache[r187];
if (r195 == null) {
const props = state14.props;
const { data: data4, keyExtractor: keyExtractor2 } = props;
let r196 = "";
if (data4) {
const r199 = r187 < data4.length ? keyExtractor2 ? keyExtractor2(data4[r187], r187) : r187 : null;
state14.idCache[r187] = r199;
r196 = r199;
}
r195 = r196;
}
let r202 = 1;
if (r12) {
r34.span = 1;
overrideItemLayout(r34, data3[r187], r187, r37, r35);
const span = r34.span;
r202 = span !== void 0 && Number.isFinite(span) ? Math.max(1, Math.min(r37, Math.round(span))) : 1;
}
const r219 = r13 && r57 + r202 - 1 > r37;
let r221 = r189;
let r222 = r190;
if (r219) {
r222 = r190 + r189;
r221 = 0;
r57 = 1;
}
let r224 = sizesKnown.get(r195);
if (r224 === void 0) {
r224 = (0, env10649[58])(a0, r195, r187, data3[r187], true, r30, false);
}
if (c10649_31 && r173) {
if (r36.has(r195)) {
console.error(`[legend-list] Error: Detected overlapping key (${r195}${r179}`);
}
r36.set(r195, r187);
}
if (r222 !== positions2[r187]) {
positions2[r187] = r222;
if (r14) {
(0, env10649[23])(a0, r195, r222);
}
}
if (r173) {
indexByKey2.set(r195, r187);
}
if (r13) {
columns[r187] = r57;
columnSpans[r187] = r202;
const r253 = r224 > r221 ? r224 : r221;
r252 = r57 + r202;
r251 = r253;
r250 = r222;
if (r252 > r37) {
r250 = r222 + r253;
r251 = 0;
r252 = 1;
}
} else {
r250 = r222 + r224;
r251 = r221;
r252 = r57;
}
const r254 = r187 + 1;
r255 = r254 < length;
r184 = r251;
r185 = r252;
r29 = r250;
r101 = r254;
r183 = r192;
r186 = false;
} while (r255);
}
L194: {
if (!r186) {
const state17 = a0.state;
const positions3 = state17.positions;
const data7 = state17.props.data;
const r262 = a0.values.get("numColumns");
const r264 = r262 ?? 1;
if (data7.length === 0) {
const state20 = a0.state;
const totalSize3 = state20.totalSize;
state20.totalSize;
if (state20.timeoutSetPaddingTop) {
clearTimeout(state20.timeoutSetPaddingTop);
state20.timeoutSetPaddingTop = void 0;
}
if (totalSize3 !== 0) {
if (!c10649_27 && state20.initialScroll && 0 < totalSize3) {
state20.pendingTotalSize = 0;
break L194;
}
state20.pendingTotalSize = void 0;
state20.totalSize = 0;
(0, env10649[22])(a0, "totalSize", 0);
(0, env10649[50])(a0);
} else if (a0.values.get("totalSize") !== 0) {
(0, env10649[22])(a0, "totalSize", 0);
}
} else {
const r267 = data7.length - 1;
const props4 = state17.props;
const { data: data8, keyExtractor: keyExtractor4 } = props4;
let r271 = "";
if (data8) {
const r274 = r267 < data8.length ? keyExtractor4 ? keyExtractor4(data8[r267], r267) : r267 : null;
state17.idCache[r267] = r274;
r271 = r274;
}
const r278 = positions3[r267];
if (r271 !== void 0 && r278 !== void 0) {
if (r264 > 1) {
let r1 = r267;
let r307 = r1;
while (0 < r307) {
const r309 = state17.columns[r1];
const r5 = r1;
r307 = r5;
if (r309 === 1) {
break;
}
r307 = r5;
if (r309 === void 0) {
break;
}
r1 = r5 - 1;
r307 = r1;
}
let r310 = 0;
let r311 = 0;
while (r307 <= r267) {
const r312 = env10649[58];
let r314 = state17.idCache[r307];
const r315 = r307;
let r316 = r310;
if (r314 == null) {
const props5 = state17.props;
const { data: data9, keyExtractor: keyExtractor5 } = props5;
let r320 = "";
if (data9) {
const r323 = r315 < data9.length ? keyExtractor5 ? keyExtractor5(data9[r315], r315) : r315 : null;
state17.idCache[r315] = r323;
r320 = r323;
}
r314 = r320;
}
const r332 = r312(a0, r314, r315, data7[r315]);
if (r332 > r316) {
r316 = r332;
}
r307 = r315 + 1;
r310 = r316;
r311 = r310;
}
const pendingTotalSize2 = r278 + r311;
const state19 = a0.state;
const totalSize2 = state19.totalSize;
state19.totalSize;
if (state19.timeoutSetPaddingTop) {
clearTimeout(state19.timeoutSetPaddingTop);
state19.timeoutSetPaddingTop = void 0;
}
if (totalSize2 !== pendingTotalSize2) {
if (!c10649_27 && state19.initialScroll && pendingTotalSize2 < totalSize2) {
state19.pendingTotalSize = pendingTotalSize2;
break L194;
}
state19.pendingTotalSize = void 0;
state19.totalSize = pendingTotalSize2;
(0, env10649[22])(a0, "totalSize", pendingTotalSize2);
(0, env10649[50])(a0);
} else if (a0.values.get("totalSize") !== pendingTotalSize2) {
(0, env10649[22])(a0, "totalSize", pendingTotalSize2);
}
} else {
const r285 = (0, env10649[58])(a0, r271, r267, data7[r267]);
if (r285 !== void 0) {
const pendingTotalSize = r278 + r285;
const state18 = a0.state;
const totalSize = state18.totalSize;
state18.totalSize;
if (state18.timeoutSetPaddingTop) {
clearTimeout(state18.timeoutSetPaddingTop);
state18.timeoutSetPaddingTop = void 0;
}
if (totalSize !== pendingTotalSize) {
if (!c10649_27 && state18.initialScroll && pendingTotalSize < totalSize) {
state18.pendingTotalSize = pendingTotalSize;
break L194;
}
state18.pendingTotalSize = void 0;
state18.totalSize = pendingTotalSize;
(0, env10649[22])(a0, "totalSize", pendingTotalSize);
(0, env10649[50])(a0);
} else if (a0.values.get("totalSize") !== pendingTotalSize) {
(0, env10649[22])(a0, "totalSize", pendingTotalSize);
}
}
}
}
}
}
}
if (snapToIndices2) {
const state21 = a0.state;
const snapToIndices3 = state21.props.snapToIndices;
const r379 = state21.props.horizontal ? (0, env10649[25])(a0) : void 0;
const r383 = Array(snapToIndices3.length);
const r385 = 0 < snapToIndices3.length;
let r386 = 0;
if (r385) {
do {
const r387 = snapToIndices3[r386];
const props6 = state21.props;
const { data: data10, keyExtractor: keyExtractor6 } = props6;
const r391 = r386;
if (data10) {
state21.idCache[r387] = r387 < data10.length ? keyExtractor6 ? keyExtractor6(data10[r387], r387) : r387 : null;
}
r383[r391] = (0, env10649[15])(state21, state21.positions[r387], r379);
r386 = r391 + 1;
} while (r386 < snapToIndices3.length);
}
(0, env10649[22])(a0, "snapToOffsets", r383);
}
};
env10649[90] = function ensureViewabilityState(a0, a1) {
let mapViewabilityConfigStates = a0.mapViewabilityConfigStates;
if (!mapViewabilityConfigStates) {
const map = new Map();
a0.mapViewabilityConfigStates = map;
mapViewabilityConfigStates = map;
}
let r12 = mapViewabilityConfigStates.get(a1);
const r13 = mapViewabilityConfigStates;
if (!r12) {
const r15 = {
end: -1,
endBuffered: -1,
previousEnd: -1,
previousStart: -1,
start: -1,
startBuffered: -1,
viewableItems: []
};
r13.set(a1, r15);
r12 = r15;
}
return r12;
};
env10649[91] = function updateViewableItems(a0, c21565_1, a2, c21565_2, a4, a5) {
let c21565_0 = a0;
const start = a4;
const end = a5;
let r4 = arguments[6];
if (r4 === void 0) {
r4 = a4;
}
const startBuffered = r4;
let r20 = arguments[7];
if (r20 === void 0) {
r20 = a5;
}
const endBuffered = r20;
const timeouts = a0.timeouts;
const data2 = a0.props.data;
const _loop = function _loop(a0) {
let c27896_1;
const id4 = a0.viewabilityConfig.id;
let mapViewabilityConfigStates = c21565_1.mapViewabilityConfigStates;
if (!mapViewabilityConfigStates) {
const map = new Map();
c21565_1.mapViewabilityConfigStates = map;
mapViewabilityConfigStates = map;
}
const r22 = mapViewabilityConfigStates.get(id4);
const r8 = mapViewabilityConfigStates;
let r23 = r22;
if (!r23) {
const r25 = {
end: -1,
endBuffered: -1,
previousEnd: -1,
previousStart: -1,
start: -1,
startBuffered: -1,
viewableItems: []
};
r8.set(id4, r25);
r23 = r25;
}
r23.start = start;
r23.end = end;
r23.startBuffered = startBuffered;
r23.endBuffered = endBuffered;
if (a0.viewabilityConfig.minimumViewTime) {
const r43 = setTimeout(() => {
timeouts.delete(c27896_1);
(0, env10649[92])(data2, a0, c21565_0, c21565_1, c21565_2);
}, a0.viewabilityConfig.minimumViewTime);
c27896_1 = r43;
timeouts.add(r43);
} else {
(0, env10649[92])(data2, a0, c21565_0, c21565_1, c21565_2);
}
};
for (const item5 of a2) {
_loop(item5);
}
};
env10649[92] = function updateViewableItemsWithConfig(a0, a1, a2, a3, a4) {
let r1 = void 0;
const { viewabilityConfig: viewabilityConfig2, onViewableItemsChanged: onViewableItemsChanged2 } = a1;
const id4 = viewabilityConfig2.id;
const r56 = (0, env10649[90])(a3, id4);
const { viewableItems, start: start2, end: end2, startBuffered: startBuffered2, endBuffered: endBuffered2 } = r56;
for (const mapViewabilityAmountValue of a3.mapViewabilityAmountValues) {
const r61 = (0, env10649[4])(mapViewabilityAmountValue, 2);
const r32 = r61[0];
const r63 = r61[1];
if ((0, env10649[94])(a2, a3, viewabilityConfig2, r32, r63.key, a4, r63.item, r63.index).sizeVisible < 0) {
if (r1 == null) {
r1 = [];
}
r1.push(r32);
}
}
const changed = [];
const set2 = new Set();
if (viewableItems) {
for (const item5 of viewableItems) {
const r86 = item5;
set2.add(item5.key);
const r93 = a2.indexByKey.get(item5.key);
const r97 = r93 !== void 0 ? a0[r93] : void 0;
const r101 = (0, env10649[56])(a3, r86.key);
if (!(r93 !== void 0 && r97 !== void 0 ? (0, env10649[95])(a2, a3, viewabilityConfig2, r101, r86.key, a4, r97, r93) : false)) {
changed.push({
...r86,
index: r93 ?? r86.index,
isViewable: false,
item: r97 ?? r86.item
});
}
}
}
const viewableItems2 = [];
let r131 = start2;
while (r131 <= end2) {
const item7 = a0[r131];
const index3 = r131;
if (item7) {
const key = (0, env10649[49])(a2, index3);
const containerId3 = (0, env10649[56])(a3, key);
if ((0, env10649[95])(a2, a3, viewabilityConfig2, containerId3, key, a4, item7, index3)) {
const r149 = {
containerId: containerId3,
index: index3,
isViewable: true,
item: item7,
key
};
viewableItems2.push(r149);
if (!set2.has(r149.key)) {
changed.push(r149);
}
}
}
r131 = index3 + 1;
}
Object.assign(r56, {
previousEnd: end2,
previousStart: start2,
viewableItems: viewableItems2
});
if (changed.length > 0) {
r56.viewableItems = viewableItems2;
const r163 = 0 < changed.length;
let r165 = 0;
if (r163) {
do {
const r166 = changed[r165];
(0, env10649[96])(a3, id4, r166.containerId, r166);
r165 = r165 + 1;
} while (r165 < changed.length);
}
if (onViewableItemsChanged2) {
onViewableItemsChanged2({
changed,
end: end2,
endBuffered: endBuffered2,
start: start2,
startBuffered: startBuffered2,
viewableItems: viewableItems2
});
}
}
if (r1) {
for (const item6 of r1) {
const r185 = item6;
let r188 = a3.mapViewabilityAmountValues.get(item6);
const r189 = r188;
if (r188) {
r188 = r189.sizeVisible < 0;
}
if (r188) {
a3.mapViewabilityAmountValues.delete(r185);
}
}
}
};
env10649[93] = function areViewabilityAmountTokensEqual(a0, a1) {
return !!a0 && a0.containerId === a1.containerId && a0.index === a1.index && a0.isViewable === a1.isViewable && a0.item === a1.item && a0.key === a1.key && a0.percentOfScroller === a1.percentOfScroller && a0.percentVisible === a1.percentVisible && a0.scrollSize === a1.scrollSize && a0.size === a1.size && a0.sizeVisible === a1.sizeVisible;
};
env10649[94] = function computeViewability(a0, a1, a2, a3, a4, a5, a6, a7) {
const { sizes, scroll: scroll2 } = a0;
const r34 = (a1.values.get("stylePaddingTop") || 0) + (a1.values.get("alignItemsAtEndPadding") || 0) + (a1.values.get("headerSize") || 0);
let itemVisiblePercentThreshold = a2.itemVisiblePercentThreshold;
const viewAreaCoveragePercentThreshold = a2.viewAreaCoveragePercentThreshold;
const r7 = viewAreaCoveragePercentThreshold != null;
if (r7) {
itemVisiblePercentThreshold = viewAreaCoveragePercentThreshold;
}
const r18 = scroll2 - r34;
const r38 = a0.positions[a7];
const size = sizes.get(a4) || 0;
if (r38 === void 0) {
const r71 = {
containerId: a3,
index: a7,
isViewable: false,
item: a6,
key: a4,
percentOfScroller: 0,
percentVisible: 0,
scrollSize: a5,
size,
sizeVisible: -1
};
if (!(0, env10649[93])(a1.mapViewabilityAmountValues.get(a3), r71)) {
a1.mapViewabilityAmountValues.set(a3, r71);
const r83 = a1.mapViewabilityAmountCallbacks.get(a3);
if (r83) {
r83(r71);
}
}
return r71;
}
const r22 = r38 - r18;
const r23 = r22 + size;
const r5 = r22 >= 0 && r23 <= a5 && r23 > r22;
const sizeVisible = r5 ? size : Math.min(r23, a5) - Math.max(r22, 0);
const percentVisible = size ? r5 ? 100 : sizeVisible / size * 100 : 0;
const percentOfScroller = size ? sizeVisible / a5 * 100 : 0;
const r56 = {
containerId: a3,
index: a7,
isViewable: (r5 ? 100 : r7 ? percentOfScroller : percentVisible) >= itemVisiblePercentThreshold,
item: a6,
key: a4,
percentOfScroller,
percentVisible,
scrollSize: a5,
size,
sizeVisible
};
if (!(0, env10649[93])(a1.mapViewabilityAmountValues.get(a3), r56)) {
a1.mapViewabilityAmountValues.set(a3, r56);
const r69 = a1.mapViewabilityAmountCallbacks.get(a3);
if (r69) {
r69(r56);
}
}
return r56;
};
env10649[95] = function checkIsViewable(a0, a1, a2, a3, a4, a5, a6, a7) {
let r21 = a1.mapViewabilityAmountValues.get(a3);
if (!((r21 ? r21.key === a4 : r21) && r21.index === a7)) {
r21 = (0, env10649[94])(a0, a1, a2, a3, a4, a5, a6, a7);
}
return r21.isViewable;
};
env10649[96] = function maybeUpdateViewabilityCallback(a0, a1, a2, a3) {
const r6 = a2 + a1;
a0.mapViewabilityValues.set(r6, a3);
const r11 = a0.mapViewabilityCallbacks.get(r6);
if (r11 != null) {
r11(a3);
}
};
env10649[98] = function comparatorByDistance(a0, a1) {
return a1.distance - a0.distance;
};
env10649[99] = function isStickyIndexActive(a0, a1) {
const state14 = a0.state;
let r27 = false;
for (const item5 of state14.stickyContainerPool) {
const r34 = (0, env10649[21])(a0, `containerItemKey${item5}`);
if ((r34 ? state14.indexByKey.get(r34) : void 0) !== a1) {
continue;
}
r27 = true;
break;
}
return r27;
};
env10649[100] = function trackVisibleRange(a0, a1, a2, a3, a4, a5) {
if (a0.startNoBuffer === null && a2 + a3 > a4) {
a0.startNoBuffer = a1;
}
if (a0.firstFullyOnScreenIndex === void 0 && a2 >= a4 - 10 && a2 <= a5) {
a0.firstFullyOnScreenIndex = a1;
}
const startNoBuffer = a0.startNoBuffer;
let r18 = false;
if (startNoBuffer !== null) {
const r4 = a2 <= a5;
let r19 = true;
if (r4) {
a0.endNoBuffer = a1;
r19 = false;
}
r18 = r19;
}
return r18;
};
env10649[101] = function getIdsInVisibleRange(a0, a1) {
let firstFullyOnScreenIndex = a1.firstFullyOnScreenIndex;
if (firstFullyOnScreenIndex == null) {
firstFullyOnScreenIndex = a1.startNoBuffer;
}
const r3 = [];
if (firstFullyOnScreenIndex != null && a1.endNoBuffer !== null) {
while (firstFullyOnScreenIndex <= a1.endNoBuffer) {
let r10 = a0.idCache[firstFullyOnScreenIndex];
const r17 = firstFullyOnScreenIndex;
if (r10 == null) {
const props = a0.props;
const { data: data3, keyExtractor: keyExtractor2 } = props;
let r18 = "";
if (data3) {
const r19 = r17 < data3.length ? keyExtractor2 ? keyExtractor2(data3[r17], r17) : r17 : null;
a0.idCache[r17] = r19;
r18 = r19;
}
r10 = r18;
}
r3.push(r10);
firstFullyOnScreenIndex = r17 + 1;
}
}
return r3;
};
env10649[102] = function maybeEmitFirstVisibleItemChanged(a0, a1) {
const onFirstVisibleItemChanged = a0.props.onFirstVisibleItemChanged;
if (onFirstVisibleItemChanged && a1 !== null && !(a1 < 0) && !(a1 >= a0.props.data.length)) {
let key = a0.idCache[a1];
if (key == null) {
const props = a0.props;
const { data: data3, keyExtractor: keyExtractor2 } = props;
let r18 = "";
if (data3) {
const r19 = a1 < data3.length ? keyExtractor2 ? keyExtractor2(data3[a1], a1) : a1 : null;
a0.idCache[a1] = r19;
r18 = r19;
}
key = r18;
}
const lastFirstVisibleItemCallback = a0.lastFirstVisibleItemCallback;
if (!(lastFirstVisibleItemCallback?.index === a1 && lastFirstVisibleItemCallback.key === key)) {
a0.lastFirstVisibleItemCallback = {
index: a1,
key
};
onFirstVisibleItemChanged({
index: a1,
item: a0.props.data[a1],
key
});
}
}
};
env10649[103] = function maybeUpdateAnchoredEndSpace(a0) {
let r6, anchoredEndSpaceReadyAnchorKey2, length, size;
const state14 = a0.state;
const anchoredEndSpace2 = state14.props.anchoredEndSpace;
const r18 = a0.values.get("anchoredEndSpaceSize");
const { anchoredEndSpaceReadyAnchorIndex, anchoredEndSpaceReadyAnchorKey } = state14;
const anchorIndex = anchoredEndSpace2?.anchorIndex;
L39: {
size = 0;
r6 = true;
anchoredEndSpaceReadyAnchorKey2 = void 0;
if (anchoredEndSpace2) {
const { anchorIndex: anchorIndex2, anchorMaxSize, anchorOffset = 0 } = anchoredEndSpace2;
const data4 = state14.props.data;
if (anchorIndex2 >= 0 && anchorIndex2 < data4.length && state14.scrollLength > 0) {
const props = state14.props;
const { data: data3, keyExtractor: keyExtractor2 } = props;
let r50 = "";
if (data3) {
const r52 = anchorIndex2 < data3.length ? keyExtractor2 ? keyExtractor2(data3[anchorIndex2], anchorIndex2) : anchorIndex2 : null;
state14.idCache[anchorIndex2] = r52;
r50 = r52;
}
const r58 = a0.values.get("footerSize") || 0;
const r60 = state14.props.stylePaddingBottom || 0;
const r2 = anchorIndex2 < data4.length;
let r4 = false;
let r30 = anchorIndex2;
let r29 = 0;
let r63 = false;
let r64 = 0;
if (r2) {
do {
const r35 = (0, env10649[57])(a0, r30);
const r65 = r30;
let r66 = r4;
const r36 = r29;
const r34 = r65 === anchorIndex2 ? anchorMaxSize !== void 0 ? Math.min(r35 ? r35 : 0, Math.max(0, anchorMaxSize)) : r35 : r35;
if (r35 === void 0) {
r66 = true;
}
const r68 = r34 != null && r34 > 0 ? r36 + r34 : r36;
r30 = r65 + 1;
length = data4.length;
r29 = r68;
r4 = r66;
r63 = r4;
r64 = r29;
} while (r30 < length);
}
const r71 = r64 + (r58 + r60);
const r76 = r63 ? r18 || 0 : Math.max(0, state14.scrollLength - r71 - anchorOffset);
r6 = !r63;
size = r76;
anchoredEndSpaceReadyAnchorKey2 = r50;
break L39;
}
const r5 = anchorIndex2 >= 0;
size = 0;
r6 = true;
anchoredEndSpaceReadyAnchorKey2 = void 0;
if (r5) {
r6 = false;
size = 0;
anchoredEndSpaceReadyAnchorKey2 = void 0;
}
}
}
let r78 = r18 !== size;
if (r6) {
r6 = r78 ? r78 : anchoredEndSpaceReadyAnchorIndex !== anchorIndex || anchoredEndSpaceReadyAnchorKey !== anchoredEndSpaceReadyAnchorKey2;
}
if (r6) {
state14.anchoredEndSpaceReadyAnchorIndex = anchorIndex;
state14.anchoredEndSpaceReadyAnchorKey = anchoredEndSpaceReadyAnchorKey2;
if (r78) {
(0, env10649[22])(a0, "anchoredEndSpaceSize", size);
const onSizeChanged = anchoredEndSpace2?.onSizeChanged;
if (onSizeChanged != null) {
onSizeChanged.call(anchoredEndSpace2, size);
}
}
if (r78) {
r78 = anchoredEndSpace2?.includeInEndInset;
}
if (r78) {
(0, env10649[70])(a0, state14.scroll, true);
}
const onReady = anchoredEndSpace2?.onReady;
if (onReady != null) {
onReady.call(anchoredEndSpace2, {
anchorIndex,
anchorKey: anchoredEndSpaceReadyAnchorKey2,
size
});
}
}
return size;
};
env10649[105] = function mergeItemSizeUpdateResult(a0, a1) {
if (!a0.didChange) {
a0.didChange = a1.didChange;
}
if (!a0.didMeasureUserScrollAnchorResetItem) {
a0.didMeasureUserScrollAnchorResetItem = a1.didMeasureUserScrollAnchorResetItem;
}
if (!a0.needsRecalculate) {
a0.needsRecalculate = a1.needsRecalculate;
}
if (!a0.shouldMaintainScrollAtEnd) {
a0.shouldMaintainScrollAtEnd = a1.shouldMaintainScrollAtEnd;
}
};
env10649[106] = function flushItemSizeUpdates(a0, a1) {
const state14 = a0.state;
if (a1.needsRecalculate) {
state14.scrollForNextCalculateItemsInView = void 0;
const state15 = a0.state;
if (state15.userScrollAnchorReset !== void 0) {
let env21567;
const r23 = env21567 = {
$parent: env10649
};
env21567[0] = a0;
env21567[1] = {};
env21567[2] = a0.state;
unstable_batchedUpdates($mk95179(r23));
const userScrollAnchorReset2 = state15.userScrollAnchorReset;
if ((userScrollAnchorReset2 == null ? void 0 : userScrollAnchorReset2.keys.size) === 0) {
state15.userScrollAnchorReset = void 0;
}
} else {
let env21566;
const r17 = env21566 = {
$parent: env10649
};
env21566[0] = a0;
env21566[1] = {
doMVCP: true
};
env21566[2] = a0.state;
unstable_batchedUpdates($mk95179(r17));
}
} else {
let didMeasureUserScrollAnchorResetItem = a1.didMeasureUserScrollAnchorResetItem;
if (didMeasureUserScrollAnchorResetItem) {
const userScrollAnchorReset = state14.userScrollAnchorReset;
didMeasureUserScrollAnchorResetItem = (userScrollAnchorReset == null ? void 0 : userScrollAnchorReset.keys.size) === 0;
}
if (didMeasureUserScrollAnchorResetItem) {
state14.userScrollAnchorReset = void 0;
}
}
if (a1.didChange && a1.shouldMaintainScrollAtEnd) {
(0, env10649[64])(a0);
}
};
env10649[107] = function updateItemSizesBatch(a0, a1) {
const state14 = a0.state;
const r3 = {};
for (const item5 of a1) {
const r36 = item5;
if (item5.containerId !== void 0) {
const r17 = env10649[21];
if (r17(a0, `containerItemKey${r36.containerId}`) !== r36.itemKey) {
continue;
}
}
const r48 = state14.indexByKey.get(r36.itemKey);
let r50 = void 0;
if (r48 !== void 0) {
const data3 = state14.props.data;
r50 = data3 == null ? void 0 : data3[r48];
}
const r57 = r50;
const r19 = r36.containerId !== void 0 ? r48 !== void 0 ? r57 !== void 0 ? (0, env10649[29])(state14, r36.containerId, r48, r57) : void 0 : void 0 : void 0;
const r64 = env10649[105];
const r65 = env10649[108];
r64(r3, r65(a0, r36.itemKey, r36.size, r19));
}
(0, env10649[106])(a0, r3);
};
env10649[108] = function applyItemSize(a0, a1, a2, a3) {
let r2, r6, r72, r197, avg;
const state14 = a0.state;
const userScrollAnchorReset = state14.userScrollAnchorReset;
const didMeasureUserScrollAnchorResetItem = !!(userScrollAnchorReset == null ? void 0 : userScrollAnchorReset.keys.delete(a1));
const { didContainersLayout, sizesKnown, props } = state14;
const { getFixedItemSize, getItemType, horizontal: horizontal6, onItemSizeChanged, data: data3, maintainScrollAtEnd: maintainScrollAtEnd2 } = props;
if (data3) {
const index3 = state14.indexByKey.get(a1);
let r57 = a3;
if (getFixedItemSize) {
if (index3 === void 0) {
return {
didMeasureUserScrollAnchorResetItem
};
}
const r29 = state14.props.data[index3];
if (r29 === void 0) {
return {
didMeasureUserScrollAnchorResetItem
};
}
const didResolveFixedItemSize = a3?.didResolveFixedItemSize;
let r27 = a3;
if (!didResolveFixedItemSize) {
let itemType = a3?.itemType;
if (itemType == null) {
let r62 = "";
if (getItemType) {
const r63 = getItemType(r29, index3);
r62 = r63 ?? "";
}
itemType = r62;
}
r27 = {
didResolveFixedItemSize: true,
fixedItemSize: getFixedItemSize(r29, index3, itemType),
itemType
};
}
const fixedItemSize = r27.fixedItemSize;
r57 = r27;
if (fixedItemSize !== void 0) {
const r69 = sizesKnown.get(a1);
r57 = r27;
if (fixedItemSize === r69) {
if (a0.state.needsOtherAxisSize) {
const r204 = horizontal6 ? a2.height : a2.width;
const r208 = a0.values.get("otherAxisSize");
if (r208 ? r204 > r208 : !r208) {
(0, env10649[22])(a0, "otherAxisSize", r204);
}
}
return {
didMeasureUserScrollAnchorResetItem
};
}
}
}
L65: {
r6 = !didContainersLayout;
r72 = state14.sizesKnown.get(a1);
const state15 = a0.state;
const { indexByKey: indexByKey2, sizesKnown: sizesKnown2, averageSizes, props: props2 } = state15;
const { data: data4, horizontal: horizontal7, getItemType: getItemType2, getFixedItemSize: getFixedItemSize2 } = props2;
r2 = 0;
if (data4) {
const r33 = indexByKey2.get(a1);
const r81 = data4[r33];
let itemType2 = r57?.itemType;
let fixedItemSize2 = r57?.fixedItemSize;
if (getFixedItemSize2 && !r57?.didResolveFixedItemSize) {
let r88 = "";
if (getItemType2) {
const r89 = getItemType2(r81, r33);
r88 = r89 ?? "";
}
fixedItemSize2 = getFixedItemSize2(r81, r33, r88);
itemType2 = r88;
}
const r98 = (0, env10649[58])(a0, a1, r33, r81, void 0, void 0, void 0, !r57?.didResolveFixedItemSize && itemType2 === void 0 ? fixedItemSize2 !== void 0 ? {
didResolveFixedItemSize: r57?.didResolveFixedItemSize,
fixedItemSize: fixedItemSize2,
itemType: itemType2
} : void 0 : {
didResolveFixedItemSize: r57?.didResolveFixedItemSize,
fixedItemSize: fixedItemSize2,
itemType: itemType2
});
const r99 = horizontal7 ? a2.width : a2.height;
const r101 = sizesKnown2.get(a1);
const r102 = r101 !== void 0;
if (r102) {
const r108 = Math.abs(r99 - r101) <= c10649_104;
r2 = 0;
if (r108) {
break L65;
}
}
L62: {
avg = Math.floor(8 * r99) / 8;
sizesKnown2.set(a1, avg);
if (fixedItemSize2 === void 0 && 0 < avg) {
if (itemType2 == null) {
let r117 = "";
if (getItemType2) {
const r118 = getItemType2(r81, r33);
r117 = r118 ?? "";
}
itemType2 = r117;
}
let r120 = averageSizes[itemType2];
if (!r120) {
const r121 = {
avg: 0,
num: 0
};
averageSizes[itemType2] = r121;
r120 = r121;
}
if (r120.num === 0) {
r120.avg = avg;
r120.num = r120.num + 1;
} else {
if (r102 && r101 > 0) {
r120.avg = r120.avg + (avg - r101) / r120.num;
break L62;
}
r120.avg = (r120.avg * r120.num + avg) / (r120.num + 1);
r120.num = r120.num + 1;
}
}
}
if (r98) {
const r144 = Math.abs(r98 - avg) > 0.1;
r2 = 0;
if (!r144) {
break L65;
}
}
(0, env10649[51])(a0, a1, avg);
r2 = avg - r98;
}
}
const size = Math.floor(8 * (horizontal6 ? a2.width : a2.height)) / 8;
let shouldMaintainScrollAtEnd = false;
let needsRecalculate = r6;
let r157 = void 0;
if (r2 !== 0) {
const { startBuffered: startBuffered2, endBuffered: endBuffered2 } = state14;
if (didContainersLayout) {
r6 = index3 >= startBuffered2 && index3 <= endBuffered2;
}
if (r6 ? !r6 : state14.containerItemKeys.has(a1)) {
r6 = true;
}
const r10 = r72 !== void 0 && Math.abs(r72 - size) > 5 ? true : false;
if (onItemSizeChanged != null) {
onItemSizeChanged({
index: index3,
itemData: state14.props.data[index3],
itemKey: a1,
previous: size - r2,
size
});
}
(0, env10649[103])(a0);
shouldMaintainScrollAtEnd = r10;
needsRecalculate = r6;
r157 = index3;
}
if (r157 !== void 0) {
state14.minIndexSizeChanged = state14.minIndexSizeChanged !== void 0 ? Math.min(state14.minIndexSizeChanged, r157) : r157;
}
if (a0.state.needsOtherAxisSize) {
const r184 = horizontal6 ? a2.height : a2.width;
const r188 = a0.values.get("otherAxisSize");
if (r188 ? r184 > r188 : !r188) {
(0, env10649[22])(a0, "otherAxisSize", r184);
}
}
const didChange = r2 !== 0;
if (!didContainersLayout && !(0, env10649[77])(state14, state14.startBuffered, state14.endBuffered)) {
r197 = {
didChange,
didMeasureUserScrollAnchorResetItem
};
} else {
if (shouldMaintainScrollAtEnd) {
shouldMaintainScrollAtEnd = !!maintainScrollAtEnd2?.onItemLayout;
}
r197 = {
didChange,
didMeasureUserScrollAnchorResetItem,
needsRecalculate,
shouldMaintainScrollAtEnd
};
}
return r197;
}
return {
didMeasureUserScrollAnchorResetItem
};
};
env10649[109] = function measureContainersInLayoutEffect(a0) {
let c21568_1, current, measure;
let c21568_0 = a0;
let r2 = arguments[1];
if (r2 === void 0) {
r2 = null;
}
c21568_1 = void 0;
current = void 0;
measure = void 0;
const state10 = a0.state;
const r3 = [];
let c21568_5 = r3;
let c21568_6 = true;
if (r2 == null) {
r2 = a0.viewRefs.keys();
}
const _loop3 = function _loop3(a0) {
let containerId, itemKey2, c27898_2;
L26: {
containerId = a0;
const r22 = c21568_0.viewRefs.get(a0);
itemKey2 = c21568_0.values.get(`containerItemKey${a0}`);
if (itemKey2 !== void 0) {
const r30 = state10.containerItemGenerations[a0];
c21568_1 = r30;
const r32 = (r30 != null ? c21568_1 : 0) + 1;
c27898_2 = r32;
state10.containerItemGenerations[a0] = r32;
const state14 = c21568_0.state;
const props = state14.props;
const { data: data3, getFixedItemSize } = props;
const r37 = state14.indexByKey.get(itemKey2);
let r38 = void 0;
if (data3) {
r38 = void 0;
if (getFixedItemSize) {
r38 = void 0;
if (r37 !== void 0) {
const r39 = data3[r37];
r38 = void 0;
if (r39 !== void 0) {
const r42 = (0, env10649[29])(state14, a0, r37, r39);
r38 = r42?.fixedItemSize;
}
}
}
}
if (!state10.needsOtherAxisSize && r38 !== void 0 && state10.sizesKnown.get(itemKey2) === r38 + c21568_0.scrollAxisGap) {
const state15 = c21568_0.state;
const userScrollAnchorReset = state15.userScrollAnchorReset;
if (!((userScrollAnchorReset == null ? void 0 : userScrollAnchorReset.keys.delete(itemKey2)) && userScrollAnchorReset.keys.size === 0)) {
break L26;
}
state15.userScrollAnchorReset = void 0;
break L26;
}
if (r22) {
current = r22.current;
measure = current == null ? void 0 : current.measure;
if (measure != null) {
const call = measure.call;
measure.call(current, (a0, a1, a2, a3) => {
const r10 = c21568_0.state.containerItemGenerations[containerId];
if ((r10 ?? 0) === c27898_2) {
const r16 = {
containerId,
itemKey: itemKey2,
size: {
height: a3,
width: a2
}
};
if (c21568_6) {
c21568_5.push(r16);
} else {
(0, env10649[107])(c21568_0, [r16]);
}
}
});
}
}
}
}
};
for (const item5 of r2) {
_loop3(item5);
}
c21568_6 = false;
if (r3.length > 0) {
(0, env10649[107])(a0, r3);
}
};
env10649[111] = function useValue$(a0, a1) {
let value, state11;
const getValue2 = (a1 ? a1 : {}).getValue;
const context = env10649[12].useContext(c10649_17);
const getNewValue2 = () => {};
const r14 = context.values.get(a0);
const r15 = getValue2 ? getValue2(r14) : r14;
value = r15 ?? 0;
const r19 = env10649[10];
state11 = (0, env10649[4])(r19.useState(() => new env10649[11].Animated.Value(value)), 1)[0];
r19.useLayoutEffect(() => {
let env27899;
const syncCurrentValue = () => {
const r12 = context.values.get(a0);
const r13 = getValue2 ? getValue2(r12) : r12;
state11.setValue(r13 ?? 0);
};
const r1 = env27899 = {};
env27899[0] = syncCurrentValue;
const listeners = context.listeners;
const r13 = listeners.get(a0);
env27899[1] = r13;
let r4 = r13;
if (!r4) {
const set2 = new Set();
env27899[1] = set2;
listeners.set(a0, set2);
r4 = set2;
}
r4.add(syncCurrentValue);
const r29 = context.values.get(a0);
const r30 = getValue2 ? getValue2(r29) : r29;
const r33 = r30 ?? 0;
const r34 = $mk95159(r1);
state11.setValue(r33);
return r34;
}, [state11, context, a0]);
return state11;
};
env10649[116] = function useContainerItemSignals(a0) {
const containerId3 = a0?.containerId;
const r9 = containerId3 ?? -1;
let env21570;
const r16 = [`containerItemKey${r9}`, `containerItemIndex${r9}`, `containerItemData${r9}`];
const r24 = env21570 = {
$parent: env10649
};
env21570[0] = void 0;
env21570[1] = void 0;
const r25 = env10649[12];
const context18 = r25.useContext(c10649_17);
env21570[0] = context18;
const r31 = r16.length === 1 ? r16[0] : r16.join("\x00");
env21570[1] = r31;
const memo5 = r25.useMemo($mk95160(r24), [context18, r31]);
const { subscribe: subscribe2, get: get3 } = memo5;
const r46 = (0, env10649[4])((0, env10649[0])(env10649[1][6]).useSyncExternalStore(subscribe2, get3, get3), 3);
const itemKey4 = r46[0];
const itemIndex3 = r46[1];
return {
hasItemInfo: !!a0 && itemKey4 !== void 0 && itemIndex3 !== void 0,
item: r46[2],
itemIndex: itemIndex3,
itemKey: itemKey4
};
};
useIsLastItem = function useIsLastItem() {
let env21571 = {
$parent: env10649
};
const context19 = env10649[10].useContext(c10649_115);
env21571[0] = context19;
const containerId3 = context19?.containerId;
const r17 = containerId3 ?? -1;
let env21572;
const r23 = [`containerItemKey${r17}`];
const r24 = env21572 = {
$parent: env10649
};
env21572[0] = void 0;
env21572[1] = void 0;
const r10 = env10649[12];
const context18 = r10.useContext(c10649_17);
env21572[0] = context18;
const r28 = r23.length === 1 ? r23[0] : r23.join("\x00");
let get2;
env21572[1] = r28;
const memo5 = r10.useMemo($mk95160(r24), [context18, r28]);
const { subscribe: subscribe2, get: get3 } = memo5;
const r34 = env10649[0];
const r35 = env10649[1];
env21571[1] = (0, env10649[4])(r34(r35[6]).useSyncExternalStore(subscribe2, get3, get3), 1)[0];
get2 = void 0;
const context2 = r10.useContext(c10649_17);
const memo6 = r10.useMemo(() => {
let env30827;
const r3 = ["lastItemKeys"];
const r5 = env30827 = {
$parent: env10649
};
env30827[0] = context2;
env30827[1] = r3;
env30827[2] = [];
env30827[3] = [];
return {
get: $mk95157(r5),
subscribe: $mk95158(r5)
};
}, [context2, "lastItemKeys"]);
const subscribe3 = memo6.subscribe;
get2 = memo6.get;
const callback5 = r10.useCallback(() => {
const r6 = get2()[0];
return env21571[0] && !(env21571[1] == null) && (r6 == null ? void 0 : r6.includes(env21571[1])) || false;
}, [get2, (a0) => env21571[0] && !(env21571[1] == null) && (a0 == null ? void 0 : a0.includes(env21571[1])) || false]);
return r34(r35[6]).useSyncExternalStore(subscribe3, callback5, callback5);
};
env10649[117] = useIsLastItem;
env10649[119] = function Separator({ ItemSeparatorComponent: ItemSeparatorComponent2, leadingItem }) {
return (0, env10649[117])() ? null : env10649[12].createElement(ItemSeparatorComponent2, {
leadingItem
});
};
env10649[122] = function ContainerSlotBase({ id: id4, horizontal: horizontal6, recycleItems, ItemSeparatorComponent: ItemSeparatorComponent2, getRenderedItem: getRenderedItem3, stickyHeaderConfig: stickyHeaderConfig2, ContainerComponent = c10649_121 }) {
let env21574;
const r20 = [`containerItemKey${id4}`];
const r21 = env21574 = {
$parent: env10649
};
env21574[0] = void 0;
env21574[1] = void 0;
const r5 = env10649[12];
const context18 = r5.useContext(c10649_17);
env21574[0] = context18;
const r25 = r20.length === 1 ? r20[0] : r20.join("\x00");
env21574[1] = r25;
const memo5 = r5.useMemo($mk95160(r21), [context18, r25]);
const { subscribe: subscribe2, get: get3 } = memo5;
const itemKey4 = (0, env10649[4])((0, env10649[0])(env10649[1][6]).useSyncExternalStore(subscribe2, get3, get3), 1)[0];
return itemKey4 !== void 0 ? r5.createElement(ContainerComponent, {
getRenderedItem: getRenderedItem3,
horizontal: horizontal6,
ItemSeparatorComponent: ItemSeparatorComponent2,
id: id4,
itemKey: itemKey4,
recycleItems,
stickyHeaderConfig: stickyHeaderConfig2
}) : null;
};
env10649[127] = function ScrollAdjust() {
let env21575;
const r6 = env10649[12];
const context18 = r6.useContext(c10649_17);
const r7 = ["scrollAdjust", "scrollAdjustUserOffset"];
const r11 = env21575 = {
$parent: env10649
};
env21575[0] = void 0;
env21575[1] = void 0;
const context19 = r6.useContext(c10649_17);
env21575[0] = context19;
const r15 = r7.length === 1 ? r7[0] : r7.join("\x00");
env21575[1] = r15;
const memo5 = r6.useMemo($mk95160(r11), [context19, r15]);
const { subscribe: subscribe2, get: get3 } = memo5;
const r30 = (0, env10649[4])((0, env10649[0])(env10649[1][6]).useSyncExternalStore(subscribe2, get3, get3), 2);
const r35 = (r30[0] || 0) + (r30[1] || 0) + 10000000;
const state14 = context18.state;
const r41 = !!(state14 == null ? void 0 : state14.props.horizontal);
return r6.createElement(env10649[11].View, {
style: {
height: 0,
left: r41 ? r35 : 0,
position: "absolute",
top: r41 ? 0 : r35,
width: 0
}
});
};
env10649[133] = function doInitialAllocateContainers(a0) {
let r21;
const state14 = a0.state;
const { scrollLength, props } = state14;
const { data: data3, getFixedItemSize, getItemType, numColumns: numColumns2, estimatedItemSize } = props;
const drawDistance = a0.state.props.drawDistance;
const initialScroll2 = a0.state.initialScroll;
let r5 = initialScroll2 !== void 0;
if (r5) {
const viewPosition2 = initialScroll2.viewPosition;
r5 = (viewPosition2 ?? 0) > 0;
}
const r22 = a0.values.get("readyToRender") ? drawDistance : r5 ? drawDistance : Math.min(drawDistance, 50);
const r45 = a0.values.get("numContainers");
if (scrollLength > 0 && data3.length > 0 && !r45) {
if (getFixedItemSize) {
const r53 = Math.min(20, data3.length);
const r54 = 0 < r53;
let r56 = 0;
let r57 = 0;
let r58 = 0;
if (r54) {
do {
const r27 = data3[r56];
const r1 = r56;
const r26 = r57;
let r24 = r26;
if (r27 !== void 0) {
const r28 = getItemType == null ? void 0 : getItemType(r27, r1);
const r61 = getFixedItemSize(r27, r1, r28 ?? "");
r24 = r26 + ((r61 ?? estimatedItemSize) + a0.scrollAxisGap);
}
r56 = r1 + 1;
r57 = r24;
r58 = r57;
} while (r56 < r53);
}
r21 = r58 / r53;
} else {
r21 = estimatedItemSize + a0.scrollAxisGap;
}
const r78 = Math.max(1, Math.ceil((scrollLength + 2 * r22) / r21 * numColumns2));
const r79 = 0 < r78;
let r84 = 0;
if (r79) {
do {
const r85 = env10649[22];
r85(a0, `containerPosition${r84}`, c10649_32);
r85(a0, `containerColumn${r84}`, -1);
r85(a0, `containerSpan${r84}`, 1);
r84 = r84 + 1;
} while (r84 < r78);
}
const r99 = env10649[22];
r99(a0, "numContainers", r78);
const length = data3.length;
const r102 = length <= 0;
let r103 = 0;
if (!r102) {
const r104 = r78 <= 0;
r103 = 0;
if (!r104) {
const r121 = Math.max(r78, Math.min(Math.ceil(3 * r78), r78 + 64), Math.min(length, 32));
r103 = Math.min(Math.max(length, r78), r121);
}
}
r99(a0, "numContainersPooled", r103);
if (!(c10649_27 && !state14.lastLayout)) {
if (state14.initialScroll) {
requestAnimationFrame(() => {
let env27902;
const r2 = env10649;
const r5 = env27902 = {
$parent: r2
};
env27902[0] = a0;
env27902[1] = {
dataChanged: true,
doMVCP: true
};
env27902[2] = a0.state;
unstable_batchedUpdates($mk95179(r5));
});
} else {
let env21578;
const r132 = env21578 = {
$parent: env10649
};
env21578[0] = a0;
env21578[1] = {
dataChanged: true,
doMVCP: true
};
env21578[2] = a0.state;
unstable_batchedUpdates($mk95179(r132));
}
}
return true;
}
};
env10649[140] = function normalizeMaintainScrollAtEndOn(a0, a1) {
let onLayout = !a1;
let onDataChange = onLayout;
if (a1) {
const dataChange = a0?.dataChange;
onDataChange = dataChange != null && dataChange;
}
let onFooterLayout = onLayout;
if (a1) {
const footerLayout = a0?.footerLayout;
onFooterLayout = footerLayout != null && footerLayout;
}
let onItemLayout = onLayout;
if (a1) {
const itemLayout = a0?.itemLayout;
onItemLayout = itemLayout != null && itemLayout;
}
if (a1) {
const layout = a0?.layout;
onLayout = layout != null && layout;
}
return {
animated: false,
onDataChange,
onFooterLayout,
onItemLayout,
onLayout
};
};
env10649[2] = __classCallCheck;
env10649[3] = __objectWithoutProperties;
env10649[4] = __slicedToArray;
env10649[5] = ["noScrollingTo", "forceScroll"];
env10649[6] = ["index"];
env10649[7] = ["children", "data", "renderItem"];
env10649[8] = ["alignItemsAtEnd", "anchoredEndSpace", "alwaysRender", "columnWrapperStyle", "contentContainerStyle", "contentInset", "data", "dataKey", "dataVersion", "drawDistance", "contentInsetEndAdjustment", "estimatedItemSize", "estimatedListSize", "extraData", "getFixedItemSize", "getItemType", "horizontal", "rtl", "estimatedHeaderSize", "initialScrollAtEnd", "initialScrollIndex", "initialScrollOffset", "experimental_adaptiveRender", "itemsAreEqual", "keyExtractor", "ListEmptyComponent", "ListFooterComponent", "ListFooterComponentStyle", "ListHeaderComponent", "maintainScrollAtEnd", "maintainScrollAtEndThreshold", "maintainVisibleContentPosition", "numColumns", "overrideItemLayout", "onEndReached", "onEndReachedThreshold", "onItemSizeChanged", "onMetricsChange", "onLayout", "onLoad", "onMomentumScrollEnd", "onRefresh", "onScroll", "onScrollBeginDrag", "onStartReached", "onStartReachedThreshold", "onStickyHeaderChange", "onFirstVisibleItemChanged", "onViewableItemsChanged", "progressViewOffset", "recycleItems", "refreshControl", "refreshing", "refScrollView", "renderScrollComponent", "renderItem", "scrollEventThrottle", "snapToIndices", "stickyHeaderIndices", "style", "useWindowScroll", "viewabilityConfig", "viewabilityConfigCallbackPairs"];
env10649[9] = ["positionComponentInternal", "stickyPositionComponentInternal"];
env10649[10] = _Module19;
env10649[11] = _Module17;
const r127 = env10650 = {};
env10650[0] = _Module19;
env10650[1] = void 0;
if (_Module19) {
const __esModule = _Module19.__esModule;
r13 = _Module19;
if (__esModule) {
break L5;
}
}
const r130 = Object.create(null);
env10650[1] = r130;
if (_Module19) {
Object.keys(_Module19).forEach($mk95155(r127));
}
r130.default = _Module19;
r13 = Object.freeze(r130);
}
let env10651;
L10: {
env10649[12] = r13;
const r138 = env10651 = {};
env10651[0] = _Module17;
env10651[1] = void 0;
if (_Module17) {
const __esModule2 = _Module17.__esModule;
r140 = _Module17;
if (__esModule2) {
break L10;
}
}
const r145 = Object.create(null);
env10651[1] = r145;
if (_Module17) {
Object.keys(_Module17).forEach($mk95155(r138));
}
r145.default = _Module17;
r140 = Object.freeze(r145);
}
_Module17.Animated.View;
Platform;
createAnimatedValue = (a0) => {};
c10649_17 = r13.createContext(null);
env10649[18] = 0;
DebugRow = (a0) => env10649[12].createElement(View, {
style: {
alignItems: "center",
flexDirection: "row",
justifyContent: "space-between"
}
}, a0.children);
r13.memo(function DebugView2() {
let env21579;
const r13 = env10649[12];
const context18 = r13.useContext(c10649_17);
const r6 = ["totalSize", "scrollAdjust", "debugRawScroll", "debugComputedScroll", "numContainers", "numContainersPooled", "isAtEnd"];
const r29 = env21579 = {
$parent: env10649
};
env21579[0] = void 0;
env21579[1] = void 0;
const context19 = r13.useContext(c10649_17);
env21579[0] = context19;
const r33 = r6.length === 1 ? r6[0] : r6.join("\x00");
env21579[1] = r33;
const memo5 = r13.useMemo($mk95160(r29), [context19, r33]);
const { subscribe: subscribe2, get: get3 } = memo5;
const syncExternalStore = (0, env10649[0])(env10649[1][6]).useSyncExternalStore(subscribe2, get3, get3);
const r46 = env10649[4];
const r48 = r46(syncExternalStore, 7);
const r49 = r48[0];
const r51 = r49 !== void 0 ? r49 : 0;
const r52 = r48[1];
const r15 = r52 !== void 0 ? r52 : 0;
const r53 = r48[2];
const r17 = r53 !== void 0 ? r53 : 0;
const r54 = r48[3];
const r19 = r54 !== void 0 ? r54 : 0;
r48[4];
r48[5];
const r57 = r48[6];
const r14 = r57 !== void 0 && r57;
let c21581_0;
const r60 = (0, env10649[25])(context18);
const r61 = env10649[10];
const dispatch = r46(r61.useReducer((a0) => a0 + 1, 0), 2)[1];
c21581_0 = () => {
dispatch();
};
r61.useEffect(() => {
let c30831_0 = setInterval(c21581_0, 100);
return () => clearInterval(c30831_0);
}, [100]);
const r75 = {
pointerEvents: "none",
style: {
backgroundColor: "#FFFFFFCC",
borderRadius: 4,
padding: 4,
paddingBottom: 4,
paddingLeft: 4,
position: "absolute",
right: 0,
top: 0
}
};
return r13.createElement(View, r75, r13.createElement(DebugRow, null, r13.createElement(Text, null, "TotalSize:"), r13.createElement(Text, null, r51.toFixed(2))), r13.createElement(DebugRow, null, r13.createElement(Text, null, "ContentSize:"), r13.createElement(Text, null, r60.toFixed(2))), r13.createElement(DebugRow, null, r13.createElement(Text, null, "At end:"), r13.createElement(Text, null, String(r14))), r13.createElement(DebugRow, null, r13.createElement(Text, null, "ScrollAdjust:"), r13.createElement(Text, null, r15.toFixed(2))), r13.createElement(DebugRow, null, r13.createElement(Text, null, "RawScroll: "), r13.createElement(Text, null, r17.toFixed(2))), r13.createElement(DebugRow, null, r13.createElement(Text, null, "ComputedScroll: "), r13.createElement(Text, null, r19.toFixed(2))));
});
const nativeFabricUIManager2 = global.nativeFabricUIManager;
const IsNewArchitecture = nativeFabricUIManager2 !== void 0 && nativeFabricUIManager2 != null;
c10649_27 = IsNewArchitecture;
const r170 = typeof globalThis.process !== "undefined" ? typeof globalThis.process.env === "object" ? globalThis.process.env ? "production" : void 0 : void 0 : void 0;
const r4 = typeof r170 === "string" ? r170.toLowerCase() !== "production" : void 0;
const r3 = r4 != null && r4;
c10649_31 = r3 != null && r3;
c10649_32 = -10000000;
c10649_33 = c10649_31 ? false : c10649_31;
c10649_34 = c10649_31 && false;
c10649_36 = {
didDispatchNativeScroll: ({ initialScrollSession }) => {
const completion = initialScrollSession?.completion;
return !!completion?.didDispatchNativeScroll;
},
didRetrySilentInitialScroll: ({ initialScrollSession }) => {
const completion = initialScrollSession?.completion;
return !!completion?.didRetrySilentInitialScroll;
},
markInitialScrollNativeDispatch: (a0) => {
(0, env10649[35])(a0).didDispatchNativeScroll = true;
},
markSilentInitialScrollRetry: (a0) => {
(0, env10649[35])(a0).didRetrySilentInitialScroll = true;
},
resetFlags: (a0) => {
if (a0.initialScrollSession) {
const r8 = (0, env10649[35])(a0, a0.initialScrollSession.kind);
r8.didDispatchNativeScroll = void 0;
r8.didRetrySilentInitialScroll = void 0;
}
}
};
c10649_37 = {
clear: (a0) => {
c10649_37.set(a0, void 0);
},
didReachTarget: (a0, a1) => Math.abs(a0 - a1.targetOffset) <= 1,
get: ({ initialScrollSession }) => {
const completion = initialScrollSession?.completion;
return completion?.watchdog;
},
hasNonZeroTargetOffset: (a0) => a0 !== void 0 && a0 > 1,
isAtZeroTargetOffset: (a0) => a0 <= 1,
set: (a0, a1) => {
let r3 = a1;
if (!a1) {
const initialScrollSession = a0.initialScrollSession;
const completion = initialScrollSession?.completion;
r3 = completion?.watchdog;
}
if (r3) {
(0, env10649[35])(a0).watchdog = a1 ? {
startScroll: a1.startScroll,
targetOffset: a1.targetOffset
} : void 0;
}
}
};
checkThreshold = (a0, a1, a2, a3, a4, a5, a6, a7) => {
const r13 = Math.abs(a0);
const r2 = a1 ? a1 : a2 > 0 && r13 <= a2;
if (a3) {
const r26 = Math.abs(a0);
let r27 = !a1;
let r28 = (a1 ? r27 : a2 > 0) && r26 >= 1.3 * a2;
if (!r28) {
if (!a1) {
r27 = a2 <= 0;
}
if (r27) {
r27 = r26 > 0;
}
r28 = r27;
}
if (r28) {
a7(void 0);
return false;
}
if (r2 && ((a4 ? a4.atThreshold !== a1 : !a4) || a4.contentSize !== a5.contentSize || a4.dataLength !== a5.dataLength)) {
a7({
atThreshold: a1,
contentSize: a5.contentSize,
dataLength: a5.dataLength,
scrollPosition: a5.scrollPosition
});
}
return true;
}
let r17 = !!r2;
if (r17) {
a6(a0);
a7({
atThreshold: a1,
contentSize: a5.contentSize,
dataLength: a5.dataLength,
scrollPosition: a5.scrollPosition
});
r17 = true;
}
return r17;
};
c10649_53 = new Set();
c10649_66 = 0.1;
getScrollVelocity = ({ scrollHistory }) => {
let r1 = scrollHistory.length - 1;
if (r1 < 1) {
return 0;
}
const r15 = scrollHistory[r1];
if (Date.now() - r15.time > 1000) {
return 0;
}
let r13 = 0;
let r2 = 0;
let r30 = 0;
let r31 = 0;
let r4 = 0;
while (0 < r1) {
const r19 = scrollHistory[r1];
const r5 = r1 - 1;
const r17 = scrollHistory[r5];
const r22 = r19.scroll - r17.scroll;
const r21 = r19.time - r17.time;
const r24 = Math.sign(r22);
const r36 = r13;
const r3 = r2;
const r23 = r30;
let r37 = r23;
if (r24 !== 0) {
r37 = r24;
if (r23 !== 0) {
r37 = r23;
r31 = r36;
r4 = r3;
if (r24 !== r23) {
break;
}
}
}
const r40 = r15.time - r17.time;
r31 = r36;
r4 = r3;
if (r40 > 1000) {
break;
}
let r41 = r36;
let r0 = r3;
if (r22 !== 0) {
r41 = r36;
r0 = r3;
if (!(r21 <= 0)) {
const r48 = Math.exp(-(r15.time - r19.time) / 200);
r0 = r3 + r22 / r21 * r48;
r41 = r36 + r48;
}
}
r13 = r41;
r2 = r0;
r30 = r37;
r31 = r13;
r4 = r2;
r1 = r5;
}
return r31 > 0 ? r4 / r31 : 0;
};
let unstable_batchedUpdates2 = r140.unstable_batchedUpdates;
if (typeof unstable_batchedUpdates2 !== "function") {
unstable_batchedUpdates2 = (a0) => a0();
}
unstable_batchedUpdates = unstable_batchedUpdates2;
c10649_104 = 1 / PixelRatio.get() + 0.01;
const { forwardRef, memo: memo5 } = r13;
c10649_110 = memo5(function ContainerLayoutCoordinatorComponent({ children }) {
let env21583;
const r6 = env10649[12];
const context3 = r6.useContext(c10649_17);
const r7 = ["containerLayoutEpoch"];
const r13 = env21583 = {
$parent: env10649
};
env21583[0] = void 0;
env21583[1] = void 0;
const context18 = r6.useContext(c10649_17);
env21583[0] = context18;
const r17 = r7.length === 1 ? r7[0] : r7.join("\x00");
env21583[1] = r17;
const memo5 = r6.useMemo($mk95160(r13), [context18, r17]);
const { subscribe: subscribe2, get: get3 } = memo5;
r6.useLayoutEffect(() => {
if (c10649_27) {
const r7 = (function getContainerLayoutEffectScope(a0) {
let r20;
const pendingContainerIds = a0.pendingContainerIds;
a0.pendingContainerIds = void 0;
if (pendingContainerIds !== void 0) {
const state14 = a0.state;
let r21 = pendingContainerIds;
if (pendingContainerIds) {
const userScrollAnchorReset = state14.userScrollAnchorReset;
const r22 = userScrollAnchorReset == null ? void 0 : userScrollAnchorReset.keys.size;
r21 = pendingContainerIds;
if (r22) {
const set2 = new Set(pendingContainerIds);
let r32 = state14.userScrollAnchorReset.keys[Symbol.iterator]();
const next = r32.next;
while (true) {
const r9 = r32 === void 0 ? void 0 : (r20 = next.call(r32)).done ? r32 = void 0 : r20.value;
const r35 = r32;
r21 = set2;
if (r35 === void 0) {
break;
}
try {
const r37 = state14.containerItemKeys.get(r9);
if (r37 !== void 0) {
set2.add(r37);
}
} catch (r42) {
if (r32 !== void 0 && typeof r32.return === "function") {
try {
r32.return();
} catch {}
}
throw r42;
}
}
}
}
return r21;
}
})(context3);
if (r7 !== void 0) {
(0, env10649[109])(context3, r7);
}
}
}, [context3, (0, env10649[4])((0, env10649[0])(env10649[1][6]).useSyncExternalStore(subscribe2, get3, get3), 1)[0]]);
return children;
});
getComponent = (a0) => {
const r4 = env10649[12];
return r4.isValidElement(a0) ? a0 : a0 ? r4.createElement(a0, null) : null;
};
const r213 = memo5(function PositionViewState2({ id: id4, horizontal: horizontal6, style: style2, refView, ...rest }) {
let env21584;
const r19 = [`containerPosition${id4}`, `containerItemKey${id4}`];
const r24 = env21584 = {
$parent: env10649
};
env21584[0] = void 0;
env21584[1] = void 0;
const r26 = env10649[12];
const context18 = r26.useContext(c10649_17);
env21584[0] = context18;
const r31 = r19.length === 1 ? r19[0] : r19.join("\x00");
env21584[1] = r31;
const memo5 = r26.useMemo($mk95160(r24), [context18, r31]);
const { subscribe: subscribe2, get: get3 } = memo5;
const r46 = (0, env10649[4])((0, env10649[0])(env10649[1][6]).useSyncExternalStore(subscribe2, get3, get3), 2);
let left2 = r46[0];
if (left2 === void 0) {
left2 = c10649_32;
}
r46[1];
return r26.createElement(env10649[11].View, {
ref: refView,
style: [style2, horizontal6 ? {
left: left2
} : {
top: left2
}],
...rest
});
});
let r215 = memo5(function PositionViewAnimated2({ id: id4, horizontal: horizontal6, style: style2, refView, ...rest }) {
const left2 = (0, env10649[111])(`containerPosition${id4}`, {
getValue: (a0) => a0 == null ? c10649_32 : a0
});
return env10649[12].createElement(env10649[11].Animated.View, {
ref: refView,
style: [style2, horizontal6 ? {
left: left2
} : {
top: left2
}],
...rest
});
});
c10649_113 = memo5(function PositionViewSticky2({ id: id4, horizontal, style, refView, animatedScrollY, stickyHeaderConfig, children, ...rest }) {
let memo2;
let env21586;
memo2 = void 0;
const r8 = env10649[12];
const context4 = r8.useContext(c10649_17);
const r33 = [`containerPosition${id4}`, "alignItemsAtEndPadding", "headerSize", "stylePaddingTop", `containerItemKey${id4}`, `containerItemIndex${id4}`, "totalSize"];
const r45 = env21586 = {
$parent: env10649
};
env21586[0] = void 0;
env21586[1] = void 0;
const context18 = r8.useContext(c10649_17);
env21586[0] = context18;
const r51 = r33.length === 1 ? r33[0] : r33.join("\x00");
env21586[1] = r51;
const memo5 = r8.useMemo($mk95160(r45), [context18, r51]);
const { subscribe: subscribe2, get: get3 } = memo5;
const r66 = (0, env10649[4])((0, env10649[0])(env10649[1][6]).useSyncExternalStore(subscribe2, get3, get3), 7);
let r67 = r66[0];
if (r67 === void 0) {
r67 = c10649_32;
}
let c21585_5 = r67;
const r68 = r66[1];
const r20 = r68 !== void 0 ? r68 : 0;
let c21585_6 = r20;
const r69 = r66[2];
const r70 = r69 !== void 0 ? r69 : 0;
let c21585_7 = r70;
const r71 = r66[3];
const r72 = r71 !== void 0 ? r71 : 0;
let c21585_8 = r72;
const r21 = r66[4];
let c21585_9 = r21;
const r73 = r66[5];
let c21585_10 = r73;
const r74 = r66[6];
const memo = r8.useMemo(() => {
const state14 = context4.state;
let r10 = void 0;
if (c21585_9) {
const r11 = state14.sizes.get(c21585_9);
r10 = void 0;
if (r11) {
const r2 = r11 > 0;
r10 = void 0;
if (r2) {
const r15 = state14.props.stickyHeaderIndicesArr.indexOf(c21585_10);
r10 = void 0;
if (r15 !== -1) {
const r21 = state14.props.stickyHeaderIndicesArr[r15 + 1];
r10 = void 0;
if (r21 !== void 0) {
const r23 = state14.positions[r21];
r10 = r23 !== void 0 ? r23 - r11 : void 0;
}
}
}
}
}
return r10;
}, [context4.state, r73, r21, r74 !== void 0 ? r74 : 0]);
memo2 = r8.useMemo(() => {
if (animatedScrollY) {
const r6 = stickyHeaderConfig == null ? void 0 : stickyHeaderConfig.offset;
const r17 = r6 ?? 0;
const r15 = c21585_5 + c21585_7 + c21585_8 + c21585_6 - r17;
const translateX = memo !== void 0 ? memo <= c21585_5 ? memo : animatedScrollY.interpolate({
extrapolateLeft: "clamp",
extrapolateRight: "clamp",
inputRange: [r15, r15 + (memo - c21585_5)],
outputRange: [c21585_5, memo]
}) : animatedScrollY.interpolate({
extrapolateLeft: "clamp",
extrapolateRight: "extend",
inputRange: [r15, r15 + 5000],
outputRange: [c21585_5, c21585_5 + 5000]
});
return horizontal ? [{
translateX
}] : [{
translateY: translateX
}];
}
}, [r20, animatedScrollY, r70, r67, memo, r72, stickyHeaderConfig == null ? void 0 : stickyHeaderConfig.offset]);
return r8.createElement(env10649[11].Animated.View, {
ref: refView,
style: r8.useMemo(() => [style, {
zIndex: c21585_10 + 1000
}, {
transform: memo2
}], [style, r73, memo2]),
...rest
}, r8.useMemo(() => {
const r3 = stickyHeaderConfig == null ? void 0 : stickyHeaderConfig.backdropComponent;
let r14 = null;
if (r3) {
const r7 = env10649[12];
const View2 = env10649[11].View;
const r16 = {
style: {
inset: 0,
pointerEvents: "none",
position: "absolute"
}
};
const r10 = stickyHeaderConfig == null ? void 0 : stickyHeaderConfig.backdropComponent;
r14 = r7.createElement(View2, r16, r7.isValidElement(r10) ? r10 : r10 ? r7.createElement(r10, null) : null);
}
return r14;
}, [stickyHeaderConfig == null ? void 0 : stickyHeaderConfig.backdropComponent]), children);
});
if (IsNewArchitecture) {
r215 = r213;
}
c10649_114 = r215;
c10649_115 = createContext(null);
noop = () => {};
c10649_120 = new Map();
c10649_121 = memo5(function Container2({ id, itemKey, recycleItems, horizontal: horizontal2, getRenderedItem: getRenderedItem2, ItemSeparatorComponent, stickyHeaderConfig: stickyHeaderConfig2 }) {
let callback, left, width;
callback = void 0;
left = void 0;
width = void 0;
const r10 = env10649[12];
const context5 = r10.useContext(c10649_17);
const { columnWrapperStyle, animatedScrollY: animatedScrollY2, state: state14 } = context5;
const props = state14?.props;
let r32 = !!props?.horizontal;
if (r32) {
let r51 = props?.rtl;
if (r51 == null) {
r51 = !!env10649[11].I18nManager.isRTL;
}
r32 = r51;
}
let env21588;
let positionComponentInternal = context5.state.props.positionComponentInternal;
let stickyPositionComponentInternal = context5.state.props.stickyPositionComponentInternal;
const r64 = [`containerColumn${id}`, `containerSpan${id}`, `containerItemData${id}`, "numColumns", "extraData", `containerSticky${id}`];
const r78 = env21588 = {
$parent: env10649
};
env21588[0] = void 0;
env21588[1] = void 0;
const context18 = r10.useContext(c10649_17);
env21588[0] = context18;
const r83 = r64.length === 1 ? r64[0] : r64.join("\x00");
env21588[1] = r83;
const memo5 = r10.useMemo($mk95160(r78), [context18, r83]);
const { subscribe: subscribe2, get: get3 } = memo5;
const syncExternalStore = (0, env10649[0])(env10649[1][6]).useSyncExternalStore(subscribe2, get3, get3);
const r27 = env10649[4];
const r96 = r27(syncExternalStore, 6);
const r97 = r96[0];
const r30 = r97 !== void 0 ? r97 : 0;
const r99 = r96[1];
let r34 = r99 !== void 0 ? r99 : 1;
const r25 = r96[2];
const r100 = r96[3];
const r101 = r100 !== void 0 ? r100 : 1;
let callback2;
let env21590;
let c21587_7 = r101;
const r102 = r96[4];
const r24 = r96[5];
const r26 = env10649[10];
const ref = r26.useRef(null);
const id2 = id;
const context6 = context5;
const ref2 = ref;
callback2 = void 0;
const ref3 = r26.useRef({
didLayout: false,
horizontal: horizontal2,
itemKey
});
ref3.current.horizontal = horizontal2;
ref3.current.itemKey = itemKey;
const r112 = r27(r26.useState(0), 2);
const r113 = r112[0];
const setState = r112[1];
const callback5 = r26.useCallback((a0) => {
let c27900_5;
const current5 = ref3.current;
const id3 = id2;
const context16 = context6;
const current4 = current5;
c27900_5 = void 0;
const state14 = context6.state;
const itemKey3 = current4.itemKey;
current4.didLayout = true;
let lastSize = a0;
const r16 = current4.horizontal ? "width" : "height";
const r24 = Math.floor(8 * a0[r16]) / 8;
if (current4.lastSize) {
Math.floor(8 * current4.lastSize[r16]) / 8;
}
L13: {
state14.sizesKnown.get(itemKey3);
c27900_5 = () => {};
if (!c10649_27 && !(0 < r24)) {
const current6 = ref2.current;
const measure2 = current6?.measure;
if (measure2 == null) {
break L13;
}
const call = measure2.call;
const r42 = (a0, a1, a2, a3) => {
const lastSize2 = {
height: a3,
width: a2
};
lastSize = lastSize2;
current4.lastSize = lastSize2;
(0, env10649[107])(context16, [{
containerId: id3,
itemKey: itemKey3,
size: lastSize
}]);
};
if (call === Function.prototype.call) {
measure2.call(current6, r42);
break L13;
}
call.call(measure2, current6, r42);
} else {
current4.lastSize = lastSize;
(0, env10649[107])(context6, [{
containerId: id2,
itemKey: itemKey3,
size: lastSize
}]);
}
}
}, [id, context5, ref]);
callback2 = r26.useCallback(() => {
if (c10649_27) {
(0, env10649[87])(context6, id2);
} else {
setState((prevState) => prevState + 1);
}
}, [id, context5]);
r26.useLayoutEffect(() => {
context6.containerLayoutTriggers.set(id2, callback2);
return () => {
c10649_120.delete(ref3.current);
if (context6.containerLayoutTriggers.get(id2) === callback2) {
context6.containerLayoutTriggers.delete(id2);
}
};
}, [id, context5, callback2]);
r26.useLayoutEffect(() => {
if (c10649_27) {
(0, env10649[87])(context6, id2);
}
});
const r129 = {
measureInLayoutEffect: !c10649_27,
onLayoutChange: callback5,
ref
};
const r130 = [itemKey, r113];
const r131 = env21590 = {};
env21590[0] = void 0;
env21590[1] = void 0;
env21590[2] = void 0;
env21590[3] = void 0;
env21590[0] = r129.ref;
let measureInLayoutEffect = r129.measureInLayoutEffect;
if (measureInLayoutEffect === void 0) {
measureInLayoutEffect = true;
}
env21590[1] = measureInLayoutEffect;
const onLayoutProp = r129.onLayoutProp;
env21590[2] = onLayoutProp;
const onLayoutChange = r129.onLayoutChange;
env21590[3] = onLayoutChange;
const callback6 = r26.useCallback($mk95186(r131), [onLayoutChange, onLayoutProp]);
if (c10649_27) {
const r139 = [measureInLayoutEffect, ...r130];
r26.useLayoutEffect($mk95187(r131), r139);
}
r26.useEffect(() => {
if (c10649_27) {
return void 0;
}
ref3.current.didLayout = false;
let c27901_0 = setTimeout(() => {
const current5 = ref3.current;
const didLayout = current5.didLayout;
if (didLayout ? !didLayout : current5.lastSize) {
(0, env10649[107])(context6, [{
containerId: id2,
itemKey: current5.itemKey,
size: current5.lastSize
}]);
current5.didLayout = true;
}
}, 16);
return () => {
clearTimeout(c27901_0);
};
}, [id, context5, itemKey]);
callback = callback2;
const r148 = r30 > 0 ? r30 : 1;
const r149 = Math;
const r151 = Math;
if (!r34) {
r34 = 1;
}
const r154 = r149.min(r151.max(r34, 1), r101);
left = r101 > 1 ? (r148 - 1) / r101 * 100 + "%" : 0;
width = r101 > 1 ? r154 / r101 * 100 + "%" : void 0;
const memo6 = r26.useMemo(() => {
let r24, r40;
const contentContainerAlignItems = context5.state.props.contentContainerAlignItems;
const r4 = !ItemSeparatorComponent;
let r23 = void 0;
if (columnWrapperStyle) {
let columnGap = columnWrapperStyle.columnGap;
let rowGap = columnWrapperStyle.rowGap;
const gap = columnWrapperStyle.gap;
if (horizontal2) {
const paddingBottom = c21587_7 > 1 ? ((rowGap ? rowGap : gap) || 0) / 2 : void 0;
if (!columnGap) {
columnGap = gap;
}
if (!columnGap) {
columnGap = void 0;
}
const r36 = c21587_7 > 1;
let paddingTop = void 0;
if (r36) {
if (!rowGap) {
rowGap = gap;
}
if (!rowGap) {
rowGap = 0;
}
paddingTop = rowGap / 2;
}
r24 = {
paddingBottom,
paddingRight: columnGap,
paddingTop
};
} else {
r24 = {
paddingBottom: (rowGap ? rowGap : gap) || void 0,
paddingLeft: c21587_7 > 1 ? ((columnGap ? columnGap : gap) || 0) / 2 : void 0,
paddingRight: c21587_7 > 1 ? ((columnGap ? columnGap : gap) || 0) / 2 : void 0
};
}
r23 = r24;
}
if (horizontal2) {
const r47 = contentContainerAlignItems === "flex-end";
const r50 = {
bottom: r47 ? c21587_7 === 1 ? 0 : void 0 : void 0,
boxSizing: r23 ? "border-box" : void 0,
direction: void 0,
flexDirection: r4 ? void 0 : "row",
height: width,
left: 0,
position: "absolute",
top: r47 ? c21587_7 !== 1 ? left : void 0 : left
};
if (!r23) {
r23 = {};
}
HermesBuiltin.copyDataProperties(r50, r23);
r40 = r50;
} else {
r40 = {
boxSizing: r23 ? "border-box" : void 0,
left,
position: "absolute",
right: c21587_7 > 1 ? null : 0,
top: 0,
width,
...r23 ? r23 : {}
};
}
return r40;
}, [horizontal2, r32, left, width, columnWrapperStyle, context5.state.props.contentContainerAlignItems, r101, ItemSeparatorComponent]);
const memo7 = r26.useMemo(() => itemKey !== void 0 ? getRenderedItem2(itemKey) : null, [itemKey, r25, r102]);
const renderedItem = (memo7 ? memo7 : {}).renderedItem;
const memo8 = r26.useMemo(() => {
context5.viewRefs.set(id, ref);
return {
containerId: id,
triggerLayout: callback
};
}, [id, callback2]);
if (r24) {
if (!stickyPositionComponentInternal) {
stickyPositionComponentInternal = c10649_113;
}
positionComponentInternal = stickyPositionComponentInternal;
} else if (!positionComponentInternal) {
positionComponentInternal = c10649_114;
}
return r10.createElement(positionComponentInternal, {
animatedScrollY: r24 ? animatedScrollY2 : void 0,
horizontal: horizontal2,
id,
key: recycleItems ? void 0 : itemKey,
onLayout: callback6,
refView: ref,
stickyHeaderConfig: stickyHeaderConfig2,
style: memo6
}, r10.createElement(c10649_115.Provider, {
value: memo8
}, renderedItem, memo7 && ItemSeparatorComponent && r10.createElement(env10649[119], {
ItemSeparatorComponent,
leadingItem: memo7.item
})));
});
c10649_123 = memo5(function ContainerSlot2(a0) {
return env10649[12].createElement(env10649[122], {
...a0
});
});
c10649_124 = memo5(function ContainersLayer2({ children, horizontal: horizontal6 }) {
let env21591;
const r8 = env10649[12];
const columnWrapperStyle2 = r8.useContext(c10649_17).columnWrapperStyle;
const width2 = (0, env10649[111])("totalSize");
const r9 = ["readyToRender", "numColumns", "otherAxisSize"];
const r20 = env21591 = {
$parent: env10649
};
env21591[0] = void 0;
env21591[1] = void 0;
const context18 = r8.useContext(c10649_17);
env21591[0] = context18;
const r24 = r9.length === 1 ? r9[0] : r9.join("\x00");
env21591[1] = r24;
const memo5 = r8.useMemo($mk95160(r20), [context18, r24]);
const { subscribe: subscribe2, get: get3 } = memo5;
const r38 = (0, env10649[4])((0, env10649[0])(env10649[1][6]).useSyncExternalStore(subscribe2, get3, get3), 3);
const r39 = r38[0];
const r40 = r38[1];
const r41 = r38[2];
const minHeight = r41 !== void 0 ? r41 : 0;
const style2 = horizontal6 ? {
height: minHeight || "100%",
minHeight,
opacity: r39 ? 1 : 0,
width: width2
} : {
height: width2,
minWidth: minHeight,
opacity: r39 ? 1 : 0
};
if (columnWrapperStyle2) {
let columnGap = columnWrapperStyle2.columnGap;
let rowGap = columnWrapperStyle2.rowGap;
const gap = columnWrapperStyle2.gap;
if (!columnGap) {
columnGap = gap;
}
if (!columnGap) {
columnGap = 0;
}
if (!rowGap) {
rowGap = gap;
}
if (!rowGap) {
rowGap = 0;
}
if (horizontal6) {
if (rowGap && r40 > 1) {
style2.marginVertical = -rowGap / 2;
}
if (columnGap) {
style2.marginRight = -columnGap;
}
} else {
if (columnGap && r40 > 1) {
style2.marginHorizontal = -columnGap;
}
if (rowGap) {
style2.marginBottom = -rowGap;
}
}
}
return r8.createElement(env10649[11].Animated.View, {
style: style2
}, r8.createElement(c10649_110, null, children));
});
c10649_125 = memo5(function Containers2({ horizontal: horizontal6, recycleItems, ItemSeparatorComponent: ItemSeparatorComponent2, stickyHeaderConfig: stickyHeaderConfig2, getRenderedItem: getRenderedItem3 }) {
let env21592;
const r8 = ["numContainersPooled"];
const r18 = env21592 = {
$parent: env10649
};
env21592[0] = void 0;
env21592[1] = void 0;
let r7 = env10649[12];
const context18 = r7.useContext(c10649_17);
env21592[0] = context18;
const r22 = r8.length === 1 ? r8[0] : r8.join("\x00");
env21592[1] = r22;
const memo5 = r7.useMemo($mk95160(r18), [context18, r22]);
const { subscribe: subscribe2, get: get3 } = memo5;
const r37 = (0, env10649[4])((0, env10649[0])(env10649[1][6]).useSyncExternalStore(subscribe2, get3, get3), 1)[0];
const r38 = [];
let id4 = 0;
while (id4 < r37) {
const r41 = env10649[12];
r38.push(r41.createElement(c10649_123, {
getRenderedItem: getRenderedItem3,
horizontal: horizontal6,
ItemSeparatorComponent: ItemSeparatorComponent2,
id: id4,
key: id4,
recycleItems,
stickyHeaderConfig: stickyHeaderConfig2
}));
id4 = id4 + 1;
r7 = r41;
}
return r7.createElement(c10649_124, {
horizontal: horizontal6
}, r38);
});
ScrollView = _Module17.Animated.ScrollView;
SnapWrapperInner = r13.forwardRef(function SnapWrapperInner({ ScrollComponent, ...rest }, a1) {
let env21593;
const r15 = ["snapToOffsets"];
const r3 = env21593 = {
$parent: env10649
};
env21593[0] = void 0;
env21593[1] = void 0;
const r4 = env10649[12];
const context18 = r4.useContext(c10649_17);
env21593[0] = context18;
const r10 = r15.length === 1 ? r15[0] : r15.join("\x00");
env21593[1] = r10;
const memo5 = r4.useMemo($mk95160(r3), [context18, r10]);
const { subscribe: subscribe2, get: get3 } = memo5;
return r4.createElement(ScrollComponent, {
...rest,
ref: a1,
snapToOffsets: (0, env10649[4])((0, env10649[0])(env10649[1][6]).useSyncExternalStore(subscribe2, get3, get3), 1)[0]
});
});
LayoutView = ({ onLayoutChange, refView, ...rest }) => {
const r9 = env10649[10];
let ref12 = r9.useRef(null);
if (refView != null) {
ref12 = refView;
}
let env21594;
const r15 = {
onLayoutChange,
ref: ref12
};
const r16 = env21594 = {};
env21594[0] = r15.ref;
let measureInLayoutEffect = r15.measureInLayoutEffect;
if (measureInLayoutEffect === void 0) {
measureInLayoutEffect = true;
}
env21594[1] = measureInLayoutEffect;
const onLayoutProp = r15.onLayoutProp;
env21594[2] = onLayoutProp;
const onLayoutChange2 = r15.onLayoutChange;
env21594[3] = onLayoutChange2;
const callback5 = r9.useCallback($mk95186(r16), [onLayoutChange2, onLayoutProp]);
if (c10649_27) {
const r27 = [measureInLayoutEffect, ...[]];
r9.useLayoutEffect($mk95187(r16), r27);
}
return env10649[12].createElement(env10649[11].View, {
...rest,
onLayout: callback5,
ref: ref12
});
};
c10649_130 = memo5(function AlignItemsAtEndSpacer2({ horizontal: horizontal6 }) {
let env21595;
const r6 = ["alignItemsAtEndPadding"];
const r11 = env21595 = {
$parent: env10649
};
env21595[0] = void 0;
env21595[1] = void 0;
const r7 = env10649[12];
const context18 = r7.useContext(c10649_17);
env21595[0] = context18;
const r15 = r6.length === 1 ? r6[0] : r6.join("\x00");
env21595[1] = r15;
const memo5 = r7.useMemo($mk95160(r11), [context18, r15]);
const { subscribe: subscribe2, get: get3 } = memo5;
const r30 = (0, env10649[4])((0, env10649[0])(env10649[1][6]).useSyncExternalStore(subscribe2, get3, get3), 1)[0];
const width2 = r30 !== void 0 ? r30 : 0;
return width2 <= 0 ? null : r7.createElement(View, {
style: horizontal6 ? {
flexShrink: 0,
width: width2
} : {
flexShrink: 0,
height: width2
}
}, null);
});
c10649_131 = memo5(function ListComponent2(a0) {
let callback3;
let env21597;
const { canRender: _canRender, style: style2, contentContainerStyle, horizontal: horizontal3, initialContentOffset, recycleItems, ItemSeparatorComponent: ItemSeparatorComponent2, alignItemsAtEnd, onScroll: onScroll4, onLayout, ListHeaderComponent, ListHeaderComponentStyle, ListFooterComponent, ListFooterComponentStyle, ListEmptyComponent, getRenderedItem: getRenderedItem3, refScrollView, renderScrollComponent: renderScrollComponent2, onLayoutFooter, onInternalScrollBeginDrag, onInternalScrollEnd, scrollAdjustHandler, snapToIndices: snapToIndices2, stickyHeaderConfig: stickyHeaderConfig2, stickyHeaderIndices, useWindowScroll, ...rest } = a0;
let canRender = a0.canRender;
a0.alignItemsAtEnd;
a0.onInternalScrollEnd;
a0.scrollAdjustHandler;
a0.stickyHeaderIndices;
a0.useWindowScroll;
callback3 = void 0;
const r12 = env10649[12];
const context7 = r12.useContext(c10649_17);
const maintainVisibleContentPosition = context7.state.props.maintainVisibleContentPosition;
const r57 = ["otherAxisSize"];
const r58 = env21597 = {
$parent: env10649
};
env21597[0] = void 0;
env21597[1] = void 0;
const context18 = r12.useContext(c10649_17);
env21597[0] = context18;
const r62 = r57.length === 1 ? r57[0] : r57.join("\x00");
env21597[1] = r62;
const memo5 = r12.useMemo($mk95160(r58), [context18, r62]);
const { subscribe: subscribe2, get: get3 } = memo5;
const r77 = (0, env10649[4])((0, env10649[0])(env10649[1][6]).useSyncExternalStore(subscribe2, get3, get3), 1)[0];
const height = r77 !== void 0 ? r77 : 0;
let alignItemsAtEndPaddingEnabled = context7.state.props.alignItemsAtEndPaddingEnabled;
const r85 = context7.state.needsOtherAxisSize ? height ? height <= 0 ? void 0 : horizontal3 ? {
height
} : {
width: height
} : void 0 : void 0;
let env21598;
const current5 = (a0, a1) => ({
...a0,
ref: a1
});
const r89 = env21598 = {
$parent: env10649
};
const ref12 = r12.useRef(renderScrollComponent2);
ref12.current = renderScrollComponent2;
env21598[0] = ref12;
const ref13 = r12.useRef(current5);
ref13.current = current5;
env21598[1] = ref13;
let r95 = r12.useMemo($mk95193(r89), [ref13, ref12]);
if (!renderScrollComponent2) {
r95 = ScrollView;
}
const r96 = snapToIndices2 ? SnapWrapperInner : r95;
const r97 = env10649[10];
callback3 = r97.useCallback((a0, a1) => {
let r11 = context7.values.get("footerSize") !== a0;
if (r11) {
(0, env10649[22])(context7, "footerSize", a0);
(0, env10649[50])(context7);
}
if (a1 != null) {
a1();
}
if (r11) {
const maintainScrollAtEnd2 = context7.state.props.maintainScrollAtEnd;
r11 = maintainScrollAtEnd2?.onFooterLayout;
}
if (r11) {
(0, env10649[64])(context7);
}
}, [context7]);
r97.useLayoutEffect(() => {
if (!ListHeaderComponent) {
const state14 = context7.state;
const r13 = context7.values.get("headerSize") || 0;
let r8 = state14.didMeasureHeader || r13 > 0.1;
if (r13 !== 0) {
(0, env10649[22])(context7, "headerSize", 0);
(0, env10649[50])(context7);
if (r8) {
const state15 = context7.state;
state15.didContainersLayout;
state15.didFinishInitialScroll;
const props = state15.props;
state15.scroll;
state15.scrollingTo;
if (props.horizontal) {
props.stylePaddingLeft;
r8 = false;
} else {
props.stylePaddingTop;
r8 = false;
}
}
if (r8) {
(0, env10649[65])(context7, 0 - r13);
}
}
state14.didMeasureHeader = true;
}
if (!ListFooterComponent) {
callback3(0);
}
}, [ListHeaderComponent, ListFooterComponent, context7, callback3]);
const callback5 = r97.useCallback((a0) => {
const r6 = a0[horizontal3 ? "width" : "height"];
const state14 = context7.state;
const r15 = context7.values.get("headerSize") || 0;
let r7 = state14.didMeasureHeader || r15 > 0.1;
if (r15 !== r6) {
(0, env10649[22])(context7, "headerSize", r6);
(0, env10649[50])(context7);
if (r7) {
const state15 = context7.state;
state15.didContainersLayout;
state15.didFinishInitialScroll;
const props = state15.props;
state15.scroll;
state15.scrollingTo;
if (props.horizontal) {
props.stylePaddingLeft;
r7 = false;
} else {
props.stylePaddingTop;
r7 = false;
}
}
if (r7) {
(0, env10649[65])(context7, r6 - r15);
}
}
state14.didMeasureHeader = true;
}, [context7, horizontal3]);
const callback6 = r97.useCallback((a0, c27917_1) => {
callback3(a0[horizontal3 ? "width" : "height"], () => {
if (onLayoutFooter != null) {
onLayoutFooter(a0, c27917_1);
}
});
}, [horizontal3, onLayoutFooter, callback3]);
const r114 = {
...rest,
onScrollBeginDrag: onInternalScrollBeginDrag,
contentContainerStyle: [horizontal3 ? {
height: "100%"
} : {}, contentContainerStyle],
contentOffset: initialContentOffset !== void 0 ? horizontal3 ? {
x: initialContentOffset,
y: 0
} : {
x: 0,
y: initialContentOffset
} : void 0,
horizontal: horizontal3,
maintainVisibleContentPosition: maintainVisibleContentPosition.size ? {
minIndexForVisible: 0
} : maintainVisibleContentPosition.data ? {
minIndexForVisible: 0
} : void 0,
onLayout,
onScroll: onScroll4,
ref: refScrollView,
ScrollComponent: snapToIndices2 ? r95 : void 0,
style: r85 ? [r85, style2] : style2
};
const element = r12.createElement(env10649[127], null);
let r132 = ListHeaderComponent;
if (ListHeaderComponent) {
r132 = r12.createElement(LayoutView, {
onLayoutChange: callback5,
style: ListHeaderComponentStyle
}, r12.isValidElement(ListHeaderComponent) ? ListHeaderComponent : ListHeaderComponent ? r12.createElement(ListHeaderComponent, null) : null);
}
const r144 = ListEmptyComponent && (r12.isValidElement(ListEmptyComponent) ? ListEmptyComponent : ListEmptyComponent ? r12.createElement(ListEmptyComponent, null) : null);
if (alignItemsAtEndPaddingEnabled) {
alignItemsAtEndPaddingEnabled = r12.createElement(c10649_130, {
horizontal: horizontal3
});
}
if (canRender) {
canRender = !ListEmptyComponent;
}
if (canRender) {
canRender = r12.createElement(c10649_125, {
getRenderedItem: getRenderedItem3,
horizontal: horizontal3,
ItemSeparatorComponent: ItemSeparatorComponent2,
recycleItems,
stickyHeaderConfig: stickyHeaderConfig2
});
}
let r159 = ListFooterComponent;
if (ListFooterComponent) {
r159 = r12.createElement(LayoutView, {
onLayoutChange: callback6,
style: ListFooterComponentStyle
}, r12.isValidElement(ListFooterComponent) ? ListFooterComponent : ListFooterComponent ? r12.createElement(ListFooterComponent, null) : null);
}
return r12.createElement(r96, r114, element, r132, r144, alignItemsAtEndPaddingEnabled, canRender, r159, false, c10649_31 && c10649_33);
});
const r244 = c10649_31 ? function useDevChecksImpl(a0) {
const context8 = env10649[12].useContext(c10649_17);
const { childrenMode, keyExtractor, renderScrollComponent, useWindowScroll } = a0;
const r13 = env10649[10];
r13.useEffect(() => {
let r2 = useWindowScroll;
if (useWindowScroll) {
r2 = renderScrollComponent;
}
if (r2 && c10649_31 && !c10649_53.has("useWindowScrollRenderScrollComponent")) {
c10649_53.add("useWindowScrollRenderScrollComponent");
console.warn(`[legend-list] useWindowScroll is not supported when renderScrollComponent is provided.`);
}
}, [renderScrollComponent, useWindowScroll]);
r13.useEffect(() => {
let r2 = keyExtractor;
if (!keyExtractor) {
r2 = context8.state.isFirst;
}
if (!r2) {
r2 = !context8.state.didDataChange;
}
if (!r2) {
r2 = childrenMode;
}
if (!r2 && c10649_31 && !c10649_53.has("keyExtractor")) {
c10649_53.add("keyExtractor");
console.warn(`[legend-list] Changing data without a keyExtractor can cause slow performance and resetting scroll. If your list data can change you should use a keyExtractor with a unique id for best performance and behavior.`);
}
}, [childrenMode, context8, keyExtractor]);
r13.useEffect(() => {
const state14 = context8.state;
state14.props.data.length;
state14.props.useWindowScroll;
}, [context8]);
} : function useDevChecksNoop(a0) {};
let ScrollAdjustHandler;
const useStateContext = function useStateContext() {
return env10649[12].useContext(c10649_17);
};
const useArr$ = function useArr$(a0) {
let env21547;
const r3 = env21547 = {
$parent: env10649
};
const r6 = env10649[12];
const context18 = r6.useContext(c10649_17);
env21547[0] = context18;
const r12 = a0.length === 1 ? a0[0] : a0.join("\x00");
env21547[1] = r12;
const memo5 = r6.useMemo($mk95160(r3), [context18, r12]);
const { subscribe: subscribe2, get: get3 } = memo5;
return (0, env10649[0])(env10649[1][6]).useSyncExternalStore(subscribe2, get3, get3);
};
const getStickyPushLimit = function getStickyPushLimit(a0, a1, a2) {
if (a2) {
const r7 = a0.sizes.get(a2);
if (r7 && r7 > 0) {
const r11 = a0.props.stickyHeaderIndicesArr.indexOf(a1);
if (r11 !== -1) {
const r17 = a0.props.stickyHeaderIndicesArr[r11 + 1];
if (r17 !== void 0) {
const r19 = a0.positions[r17];
if (r19 !== void 0) {
return r19 - r7;
}
}
}
}
}
};
const useLatestRef = function useLatestRef(a0) {
const ref12 = env10649[12].useRef(a0);
ref12.current = a0;
return ref12;
};
const useStableRenderComponent = function useStableRenderComponent(a0, a1) {
let env21576;
const r0 = env21576 = {
$parent: env10649
};
const r6 = env10649[12];
const ref13 = r6.useRef(a0);
ref13.current = a0;
env21576[0] = ref13;
const ref12 = r6.useRef(a1);
ref12.current = a1;
env21576[1] = ref12;
return r6.useMemo($mk95193(r0), [ref12, ref13]);
};
c10649_132 = r244;
ScrollAdjustHandler = function ScrollAdjustHandler(a0) {
(0, env10649[2])(this, ScrollAdjustHandler);
this.appliedAdjust = 0;
this.pendingAdjust = 0;
this.ctx = a0;
};
c10649_134 = __createClass(ScrollAdjustHandler, [{
key: "requestAdjust",
value: function requestAdjust(a0) {
const scrollingTo2 = this.ctx.state.scrollingTo;
if (scrollingTo2?.animated && !scrollingTo2.isInitialScroll) {
this.pendingAdjust = this.pendingAdjust + a0;
(0, env10649[22])(this.ctx, "scrollAdjustPending", this.pendingAdjust);
} else {
this.appliedAdjust = this.appliedAdjust + a0;
(0, env10649[22])(this.ctx, "scrollAdjust", this.appliedAdjust);
}
if (this.ctx.state.scrollingTo) {
let env27918;
const ctx = this.ctx;
const r31 = env27918 = {
$parent: env10649
};
env27918[0] = ctx;
ctx.state.scrollingTo;
ctx.state.animFrameCheckFinishedScroll = requestAnimationFrame($mk95167(r31));
}
}
}, {
key: "getAdjust",
value: function getAdjust() {
return this.appliedAdjust;
}
}, {
key: "commitPendingAdjust",
value: function commitPendingAdjust(a0) {
let scroll2;
const state14 = this.ctx.state;
const pendingAdjust = this.pendingAdjust;
this.pendingAdjust = 0;
if (pendingAdjust !== 0) {
if (a0?.index !== void 0) {
const ctx2 = this.ctx;
const index3 = a0.index;
const state16 = ctx2.state;
const r48 = (0, env10649[59])(this.ctx, index3 !== void 0 && state16.positions[index3] || 0, a0);
const ctx3 = this.ctx;
const state17 = ctx3.state;
const r52 = (0, env10649[25])(ctx3);
const isFinite2 = Number.isFinite(r52);
let r57 = r48;
if (isFinite2) {
const isFinite3 = Number.isFinite(state17.scrollLength);
r57 = r48;
if (isFinite3) {
const lastLayout = state17.lastLayout;
r57 = r48;
if (lastLayout) {
const r66 = Math.max(0, r52 - state17.scrollLength);
const viewOffset = a0?.viewOffset;
r57 = Math.min(r48, r66 + (typeof viewOffset === "number" ? viewOffset < 0 ? -viewOffset : 0 : 0));
}
}
}
scroll2 = Math.max(0, r57);
} else {
const ctx = this.ctx;
const r16 = state14.scroll + pendingAdjust;
const state15 = ctx.state;
const r17 = (0, env10649[25])(ctx);
scroll2 = Math.max(0, Number.isFinite(r17) ? Number.isFinite(state15.scrollLength) ? state15.lastLayout ? Math.min(r16, Math.max(0, r17 - state15.scrollLength) + (typeof void 0 === "number" ? void 0 < 0 ? NaN : 0 : 0)) : r16 : r16 : r16);
}
const r77 = scroll2 - state14.scroll;
if (Math.abs(r77) > 0.1 || Math.abs(pendingAdjust) > 0.1) {
this.appliedAdjust = this.appliedAdjust + r77;
state14.scroll = scroll2;
state14.scrollForNextCalculateItemsInView = void 0;
(0, env10649[22])(this.ctx, "scrollAdjust", this.appliedAdjust);
}
let env27919;
(0, env10649[22])(this.ctx, "scrollAdjustPending", 0);
const ctx4 = this.ctx;
const r99 = env27919 = {
$parent: env10649
};
env27919[0] = ctx4;
env27919[1] = {};
env27919[2] = void 0;
env27919[2] = ctx4.state;
unstable_batchedUpdates($mk95179(r99));
}
}
}]);
useCombinedRef = function useCombinedRef(...args) {
let c21600_0 = args;
return env10649[10].useCallback((a0) => {
for (const item5 of c21600_0) {
const r24 = item5;
if (item5) {
const r27 = (0, env10649[52])(r24);
if (r27) {
r24(a0);
} else {
r24.current = a0;
}
}
}
}, args);
};
sortAsc = (a0, a1) => a0 - a1;
toCount = (a0) => typeof a0 === "number" ? Number.isFinite(a0) ? Math.max(0, Math.floor(a0)) : 0 : 0;
addIndex = (a0, a1, a2) => {
if (a2 >= 0 && a2 < a1) {
a0.add(a2);
}
};
const r265 = memo5(forwardRef(function LegendList2(a0, a1) {
let r10;
const children = a0.children;
let data3 = a0.data;
const renderItem2 = a0.renderItem;
const r14 = (0, env10649[3])(a0, env10649[7]);
if (children !== void 0 && data3 === void 0) {
r10 = {
...r14,
childrenMode: true,
data: (Array.isArray(children) ? children : env10649[12].Children.toArray(children)).flat(1),
renderItem: (a0) => a0.item
};
} else {
if (!data3) {
data3 = [];
}
r10 = {
...r14,
data: data3,
renderItem: renderItem2
};
}
const r33 = env10649[12];
return r33.createElement(env10649[19], null, r33.createElement(c10649_141, {
...r10,
ref: a1
}));
}));
c10649_141 = forwardRef(function LegendListInner2(a0, a1) {
let r186, r222, r228, r269, r273, r326, r463, maintainVisibleContentPosition2, refreshControl2;
const r31 = env10649[10];
const callback5 = r31.useCallback((a0) => {}, []);
if (a0.recycleItems === void 0 && c10649_31 && !c10649_53.has("recycleItems-omitted")) {
c10649_53.add("recycleItems-omitted");
console.warn(`[legend-list] recycleItems was not provided, so it defaults to false. Set recycleItems explicitly to true for better performance with recycling-aware rows, or false to preserve remount-on-reuse behavior.`);
}
const alignItemsAtEnd = a0.alignItemsAtEnd;
const alignItemsAtEnd2 = alignItemsAtEnd !== void 0 && alignItemsAtEnd;
let context9, c21601_23, stickyHeaderIndices, ref4, ref5, current2, ref6, state12, current3, c21601_31, c21601_32, c21601_33, memo3, initializeStateVars2, memo4;
const { anchoredEndSpace, alwaysRender } = a0;
let columnWrapperStyle2 = a0.columnWrapperStyle;
const { contentContainerStyle, contentInset, data: data3 = [] } = a0;
let c21601_2 = data3;
const { dataKey, dataVersion, drawDistance: drawDistance2 = 250 } = a0;
a0.contentInsetEndAdjustment;
const estimatedItemSize = a0.estimatedItemSize;
const estimatedItemSize2 = estimatedItemSize !== void 0 ? estimatedItemSize : 100;
let estimatedListSize = a0.estimatedListSize;
const { extraData, getFixedItemSize, getItemType, horizontal: horizontal4, rtl, estimatedHeaderSize, initialScrollAtEnd = false, initialScrollIndex, initialScrollOffset, experimental_adaptiveRender, itemsAreEqual } = a0;
let keyExtractor2 = a0.keyExtractor;
const { ListEmptyComponent, ListFooterComponent: ListFooterComponent2, ListFooterComponentStyle, ListHeaderComponent: ListHeaderComponent2, maintainScrollAtEnd: maintainScrollAtEnd2 = false, maintainScrollAtEndThreshold: maintainScrollAtEndThreshold2 = 0.1, maintainVisibleContentPosition, numColumns = 1, overrideItemLayout, onEndReached, onEndReachedThreshold } = a0;
let onStartReachedThreshold2 = 0.5;
const onEndReachedThreshold2 = onEndReachedThreshold !== void 0 ? onEndReachedThreshold : 0.5;
const { onItemSizeChanged, onMetricsChange, onLayout, onLoad, onMomentumScrollEnd: onMomentumScrollEnd2, onRefresh, onScroll: onScroll4, onScrollBeginDrag: onScrollBeginDrag2, onStartReached, onStartReachedThreshold } = a0;
if (onStartReachedThreshold !== void 0) {
onStartReachedThreshold2 = onStartReachedThreshold;
}
const { onStickyHeaderChange, onFirstVisibleItemChanged, onViewableItemsChanged } = a0;
let progressViewOffset = a0.progressViewOffset;
const { recycleItems: recycleItems2 = false, refreshControl, refreshing, refScrollView, renderScrollComponent: renderScrollComponent2, renderItem: renderItem2, scrollEventThrottle: scrollEventThrottle2, snapToIndices, stickyHeaderIndices: stickyHeaderIndices3, style: style2 } = a0;
a0.useWindowScroll;
const { viewabilityConfig, viewabilityConfigCallbackPairs } = a0;
const r47 = env10649[3];
const r35 = r47(a0, env10649[8]);
const { animatedPropsInternal, positionComponentInternal, stickyPositionComponentInternal } = a0;
r35.positionComponentInternal;
r35.stickyPositionComponentInternal;
const r50 = r47(r35, env10649[9]);
const r153 = StyleSheet.flatten(contentContainerStyle);
const alignItemsAtEndPaddingEnabled = (alignItemsAtEnd2 ? !horizontal4 : alignItemsAtEnd2) && r153?.minHeight == null && data3.length > 0;
let r157 = alignItemsAtEnd2 && !alignItemsAtEndPaddingEnabled;
if (r157) {
const r11 = r153 == null;
r157 = horizontal4 ? (r11 ? void 0 : r153.minWidth) == null : (r11 ? void 0 : r153.minHeight) == null;
}
const contentContainerStyle2 = {
...r153,
...alignItemsAtEnd2 && !alignItemsAtEndPaddingEnabled ? {
display: "flex",
flexDirection: horizontal4 ? "row" : "column",
...r157 ? {
flexGrow: 1
} : {},
justifyContent: "flex-end"
} : {}
};
const style3 = {
...StyleSheet.flatten(style2)
};
const r178 = env10649[55];
const stylePaddingTop = r178(style3, contentContainerStyle2, "Top");
let c21601_13 = stylePaddingTop;
const stylePaddingBottom = r178(style3, contentContainerStyle2, "Bottom");
const stylePaddingLeft = r178(style3, contentContainerStyle2, "Left");
const stylePaddingRight = r178(style3, contentContainerStyle2, "Right");
let maintainScrollAtEnd3 = void 0;
if (maintainScrollAtEnd2) {
if (maintainScrollAtEnd2 === true) {
r186 = {
...(0, env10649[140])(void 0, false),
animated: false
};
} else {
r186 = {
...(0, env10649[140])(maintainScrollAtEnd2.on, "on" in maintainScrollAtEnd2)
};
const animated = maintainScrollAtEnd2.animated;
r186.animated = animated != null && animated;
}
maintainScrollAtEnd3 = r186;
}
L76: {
if (maintainVisibleContentPosition === true) {
maintainVisibleContentPosition2 = {
data: true,
size: true
};
} else {
if (maintainVisibleContentPosition && typeof maintainVisibleContentPosition === "object") {
const data4 = maintainVisibleContentPosition.data;
const data8 = data4 != null && data4;
const size = maintainVisibleContentPosition.size;
maintainVisibleContentPosition2 = {
data: data8,
shouldRestorePosition: maintainVisibleContentPosition.shouldRestorePosition,
size: size == null || size
};
break L76;
}
maintainVisibleContentPosition2 = maintainVisibleContentPosition === false ? {
data: false,
size: false
} : {
data: false,
size: true
};
}
}
let c21601_15 = maintainVisibleContentPosition2;
const r211 = initialScrollIndex != null;
let r212 = initialScrollOffset != null;
let r213 = (initialScrollAtEnd ? !initialScrollAtEnd : !r211) && !r212;
if (r213) {
let r215 = !!horizontal4;
if (r215) {
let r216 = rtl;
if (r216 == null) {
r216 = !!env10649[11].I18nManager.isRTL;
}
r215 = r216;
}
r213 = r215;
}
let c21601_16 = r213;
let r81 = initialScrollAtEnd ? !initialScrollAtEnd : !r211;
if (r81) {
if (!r212) {
r212 = r213;
}
r81 = r212;
}
let c21601_17 = r81;
const r221 = initialScrollAtEnd ? initialScrollAtEnd : r211;
let c21601_18 = r221;
if (initialScrollAtEnd) {
r222 = {
index: Math.max(0, data3.length - 1),
preserveForBottomPadding: true,
viewOffset: -stylePaddingBottom,
viewPosition: 1
};
} else if (r211) {
if (typeof initialScrollIndex === "object") {
const index3 = initialScrollIndex.index;
const index4 = index3 ?? 0;
const preserveForBottomPadding = initialScrollIndex.viewOffset === void 0 && initialScrollIndex.viewPosition === 1 || void 0;
let viewOffset = initialScrollIndex.viewOffset;
if (viewOffset == null) {
viewOffset = initialScrollIndex.viewPosition === 1 ? -stylePaddingBottom : 0;
}
const viewPosition2 = initialScrollIndex.viewPosition;
r228 = {
index: index4,
preserveForBottomPadding,
viewOffset,
viewPosition: viewPosition2 ?? 0
};
} else {
r228 = {
index: initialScrollIndex ?? 0,
viewOffset: initialScrollOffset ?? 0
};
}
r222 = r228;
} else {
r222 = r81 ? {
contentOffset: initialScrollOffset ?? 0,
index: 0,
viewOffset: 0
} : void 0;
}
const initialScroll = r222;
const r251 = env10649[12];
const state14 = r251.useState(!c10649_27);
const r256 = env10649[4];
const r257 = r256(state14, 2);
const canRender = r257[0];
const setState2 = r257[1];
const dispatch2 = r256(r251.useReducer((a0) => a0 + 1, 0), 2)[1];
context9 = r251.useContext(c10649_17);
if (!columnWrapperStyle2) {
L128: {
const { gap, columnGap, rowGap } = contentContainerStyle2;
if (!gap && !columnGap) {
r269 = void 0;
if (!rowGap) {
break L128;
}
}
contentContainerStyle2.gap = void 0;
contentContainerStyle2.columnGap = void 0;
contentContainerStyle2.rowGap = void 0;
r269 = {
columnGap,
gap,
rowGap
};
}
columnWrapperStyle2 = r269;
}
context9.columnWrapperStyle = columnWrapperStyle2;
const columnWrapperStyle3 = context9.columnWrapperStyle;
const r272 = columnWrapperStyle3 == null;
if (horizontal4) {
let r276 = r272 ? void 0 : columnWrapperStyle3.columnGap;
if (r276 == null) {
const columnWrapperStyle5 = context9.columnWrapperStyle;
r276 = columnWrapperStyle5?.gap;
}
r273 = r276;
} else {
r273 = r272 ? void 0 : columnWrapperStyle3.rowGap;
if (r273 == null) {
const columnWrapperStyle4 = context9.columnWrapperStyle;
r273 = columnWrapperStyle4?.gap;
}
}
const scrollAxisGap = typeof r273 === "number" ? Number.isFinite(r273) ? r273 : 0 : 0;
const ref12 = r31.useRef(null);
const combinedRef = useCombinedRef(ref12, refScrollView);
const r94 = keyExtractor2 == null ? (a0, a1) => a1.toString() : keyExtractor2;
c21601_23 = r94;
stickyHeaderIndices = stickyHeaderIndices3;
ref4 = r31.useRef(void 0);
const r294 = [anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex, alwaysRender == null ? void 0 : alwaysRender.top, alwaysRender == null ? void 0 : alwaysRender.bottom, , , , , , ,];
const r102 = alwaysRender == null ? void 0 : alwaysRender.indices;
r294[3] = r102 == null ? void 0 : r102.join(",");
const r304 = alwaysRender == null ? void 0 : alwaysRender.keys;
const r306 = r304 == null ? void 0 : r304.join(",");
const r309 = () => {
const arr = (function getAlwaysRenderIndices(a0, a1, a2, a3) {
let size;
if (a1.length === 0) {
return [];
}
const set2 = new Set();
const length = a1.length;
const top = a0?.top;
const r33 = toCount(top);
if (r33 > 0) {
const r37 = 0 < Math.min(r33, length);
let r39 = 0;
if (r37) {
do {
addIndex(set2, length, r39);
r39 = r39 + 1;
} while (r39 < Math.min(r33, length));
}
}
const r47 = toCount(a0?.bottom);
if (r47 > 0) {
let r51 = Math.max(0, length - r47);
while (r51 < length) {
addIndex(set2, length, r51);
r51 = r51 + 1;
}
}
const indices = a0?.indices;
if (indices?.length) {
for (const indice of a0.indices) {
const r64 = indice;
if (Number.isFinite(indice)) {
addIndex(set2, length, Math.floor(r64));
}
}
}
const keys = a0?.keys;
if (keys?.length) {
const set3 = new Set(a0.keys);
if (0 < length) {
const r85 = set3.size > 0;
let r87 = 0;
if (r85) {
do {
const r89 = a2(a1[r87], r87);
const r91 = set3.has(r89);
const r92 = r87;
if (r91) {
addIndex(set2, length, r92);
set3.delete(r89);
}
const r97 = r92 + 1;
if (!(r97 < length)) {
break;
}
size = set3.size;
r87 = r97;
} while (size > 0);
}
}
}
if (a3 !== void 0 && Number.isFinite(a3)) {
const r105 = Math.floor(a3);
let r106 = r105 >= 0 ? r105 : length;
while (r106 < length) {
addIndex(set2, length, r106);
r106 = r106 + 1;
}
}
const r111 = Array.from(set2);
r111.sort(sortAsc);
return r111;
})(alwaysRender, c21601_2, c21601_23, anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex);
return {
arr,
set: new Set(arr)
};
};
r294[4] = r306;
r294[5] = data3;
r294[6] = dataKey;
r294[7] = dataVersion;
r294[8] = r94;
const memo5 = r31.useMemo(r309, r294);
ref5 = r31.useRef(void 0);
current2 = !!overrideItemLayout;
ref6 = r31.useRef(current2);
if (!ref5.current) {
if (!context9.state) {
if (estimatedListSize == null) {
if (c10649_27) {
r326 = {
height: 0,
width: 0
};
} else {
const r323 = env10649[11].Dimensions.get("window");
r326 = {
height: r323.height,
width: r323.width
};
}
estimatedListSize = r326;
}
const scrollLength = estimatedListSize[horizontal4 ? "width" : "height"];
const values = context9.values;
const initialMode = experimental_adaptiveRender?.initialMode;
values.set("adaptiveRender", initialMode ?? "normal");
context9.state = {
averageSizes: {},
columnSpans: [],
columns: [],
containerItemGenerations: [],
containerItemKeys: new Map(),
containerItemMetadata: new Map(),
contentInsetOverride: void 0,
dataChangeEpoch: 0,
dataChangeNeedsScrollUpdate: false,
didColumnsChange: false,
didDataChange: false,
didLoad: false,
enableScrollForNextCalculateItemsInView: true,
endBuffered: -1,
endNoBuffer: -1,
endReachedSnapshot: void 0,
firstFullyOnScreenIndex: -1,
hasHadNonEmptyData: data3.length > 0,
idCache: [],
idsInView: [],
indexByKey: new Map(),
initialScroll,
initialScrollSession: initialScroll ? {
kind: r81 ? "offset" : "bootstrap",
previousDataLength: data3.length
} : void 0,
isEndReached: null,
isFirst: true,
isStartReached: null,
lastBatchingAction: Date.now(),
lastLayout: void 0,
lastScrollDelta: 0,
loadStartTime: Date.now(),
minIndexSizeChanged: 0,
nativeContentInset: void 0,
nativeMarginTop: 0,
pendingDataComparison: void 0,
pendingNativeMVCPAdjust: void 0,
positions: [],
props: {},
queuedCalculateItemsInView: 0,
queuedFullDrawDistancePrewarm: void 0,
refScroller: {
current: null
},
scroll: 0,
scrollAdjustHandler: new c10649_134(context9),
scrollForNextCalculateItemsInView: void 0,
scrollHistory: [],
scrollLength,
scrollPending: 0,
scrollPrev: 0,
scrollPrevTime: 0,
scrollProcessingEnabled: true,
scrollTime: 0,
sizes: new Map(),
sizesKnown: new Map(),
startBuffered: -1,
startNoBuffer: -1,
startReachedSnapshot: void 0,
stickyContainerPool: new Set(),
stickyContainers: new Map(),
timeoutAdaptiveRender: void 0,
timeouts: new Set(),
totalSize: 0,
viewabilityConfigCallbackPairs: void 0
};
state12 = context9.state;
state12.triggerCalculateItemsInView = (a0) => {
let env27920;
let r4 = a0;
const r5 = env27920 = {
$parent: env10649
};
env27920[0] = context9;
if (a0 === void 0) {
r4 = {};
}
env27920[1] = r4;
env27920[2] = void 0;
env27920[2] = context9.state;
unstable_batchedUpdates($mk95179(r5));
};
state12.reprocessCurrentScroll = () => {
(0, env10649[70])(context9, state12.scroll, true);
};
const r409 = env10649[22];
r409(context9, "maintainVisibleContentPosition", maintainVisibleContentPosition2);
r409(context9, "extraData", extraData);
if (estimatedHeaderSize !== void 0) {
r409(context9, "headerSize", estimatedHeaderSize);
}
}
ref5.current = context9.state;
}
current3 = ref5.current;
const isFirst = current3.isFirst;
const adaptiveRender = current3.props.adaptiveRender;
const numColumns3 = current3.props.numColumns;
const r423 = isFirst ? !isFirst : context9.scrollAxisGap !== scrollAxisGap;
context9.scrollAxisGap = scrollAxisGap;
current3.didColumnsChange = numColumns !== numColumns3 || r423;
const data5 = current3.props.data;
const length = data5?.length;
const r431 = length ?? 0;
const data6 = current3.props.data;
let r436 = current3.props.dataKey !== dataKey;
const dataVersion2 = current3.props.dataVersion;
let r12 = r436 ? r436 : dataVersion2 !== dataVersion;
if (!r12) {
let r439 = data6 !== data3;
if (r439) {
const data7 = current3.props.data;
current3.pendingDataComparison = void 0;
let r9 = true;
if (data7) {
r9 = true;
if (data3) {
const length2 = data3.length;
const length3 = data7.length;
r9 = true;
if (length2 === length3) {
const { idCache, props } = current3;
const { itemsAreEqual: itemsAreEqual2, keyExtractor: keyExtractor3 } = props;
const r15 = 0 < data3.length;
let r446 = 0;
let r447 = void 0;
r9 = false;
if (r15) {
do {
const r108 = data3[r446];
const r107 = data7[r446];
const r0 = r446;
const byIndex = r447;
let r106 = byIndex;
if (r108 !== r107) {
if (!keyExtractor3) {
r9 = true;
if (!byIndex) {
break;
}
current3.pendingDataComparison = {
byIndex,
nextData: data3,
previousData: data7
};
r9 = true;
break;
}
let r450 = idCache[r0];
if (r450 == null) {
r450 = keyExtractor3(data7[r0], r0);
}
if (r450 !== keyExtractor3(data3[r0], r0)) {
r9 = true;
if (!byIndex) {
break;
}
current3.pendingDataComparison = {
byIndex,
nextData: data3,
previousData: data7
};
r9 = true;
break;
}
if (!itemsAreEqual2) {
r9 = true;
if (!byIndex) {
break;
}
current3.pendingDataComparison = {
byIndex,
nextData: data3,
previousData: data7
};
r9 = true;
break;
}
const r458 = itemsAreEqual2(data7[r0], data3[r0], r0, data3);
const byIndex2 = byIndex == null ? [] : byIndex;
byIndex2[r0] = r458 ? 1 : 2;
r106 = byIndex2;
if (!r458) {
current3.pendingDataComparison = {
byIndex: byIndex2,
nextData: data3,
previousData: data7
};
r9 = true;
break;
}
}
const r461 = r0 + 1;
r463 = r461 < data3.length;
r447 = r106;
r446 = r461;
r9 = false;
} while (r463);
}
}
}
}
r439 = r9;
}
r12 = r439;
}
c21601_31 = r12;
let r465 = (isFirst ? !isFirst : r12) && current3.hasHadNonEmptyData;
if (r465) {
if (!r436) {
r436 = r431 === 0;
}
r465 = r436;
}
if (r465) {
r465 = data3.length > 0;
}
c21601_32 = r465;
let r467 = (r12 ? !initialScrollAtEnd : r12) && current3.didFinishInitialScroll;
if (r467) {
const initialScroll2 = current3.initialScroll;
r467 = initialScroll2?.viewPosition === 1;
}
if (r467) {
r467 = current3.props.data.length > 0;
}
if (r467) {
if (current3.timeoutPreservedInitialScrollClear !== void 0) {
clearTimeout(current3.timeoutPreservedInitialScrollClear);
current3.timeoutPreservedInitialScrollClear = void 0;
}
current3.clearPreservedInitialScrollOnNextFinish = void 0;
current3.initialScroll = void 0;
(0, env10649[38])(current3);
}
if (r12) {
current3.dataChangeEpoch = current3.dataChangeEpoch + 1;
current3.dataChangeNeedsScrollUpdate = true;
current3.didDataChange = true;
current3.previousData = current3.props.data;
}
const r485 = onScroll4 ?? callback5;
const r487 = scrollEventThrottle2 ?? 0;
let callback4;
const onScroll2 = r485;
const scrollEventThrottle = r487;
const r490 = env10649[10];
const ref7 = r490.useRef(null);
const ref8 = r490.useRef(0);
const ref9 = r490.useRef(null);
const clearTimeoutRef2 = () => {};
callback4 = r490.useCallback(function(a0, a1, ...current5) {
const current6 = Date.now();
ref9.current = current5;
if (current6 - ref8.current >= a1) {
ref8.current = current6;
a0.apply(void 0, [...current5]);
if (ref7.current) {
clearTimeout(ref7.current);
ref7.current = null;
}
} else {
if (ref7.current) {
clearTimeout(ref7.current);
ref7.current = null;
}
ref7.current = setTimeout(() => {
if (ref9.current) {
ref8.current = Date.now();
a0.apply(void 0, [...ref9.current]);
ref7.current = null;
ref9.current = null;
}
}, a1 - (current6 - ref8.current));
}
}, ["throttle"]);
const onScroll6 = scrollEventThrottle2 ? onScroll4 && ((a0) => callback4(onScroll2, scrollEventThrottle, {
nativeEvent: a0.nativeEvent
})) : onScroll4;
let r504 = isFirst ? !isFirst : !r12;
if (r504) {
const anchoredEndSpace2 = current3.props.anchoredEndSpace;
r504 = anchoredEndSpace2?.anchorIndex !== (anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex);
}
let env21604;
let env21605;
let env21606;
c21601_33 = r504;
const r515 = env21604 = {};
env21604[0] = getFixedItemSize;
const props2 = {
adaptiveRender: experimental_adaptiveRender,
alignItemsAtEnd: alignItemsAtEnd2,
alignItemsAtEndPaddingEnabled,
alwaysRender,
alwaysRenderIndicesArr: memo5.arr,
alwaysRenderIndicesSet: memo5.set,
anchoredEndSpace,
animatedProps: animatedPropsInternal,
contentContainerAlignItems: contentContainerStyle2.alignItems,
contentInset,
contentInsetEndAdjustment: void 0,
data: data3,
dataKey,
dataVersion,
drawDistance: drawDistance2,
estimatedItemSize: estimatedItemSize2,
getFixedItemSize: r490.useMemo($mk95195(r515), [getFixedItemSize]),
getItemType: null,
horizontal: null,
itemsAreEqual: null,
keyExtractor: null,
maintainScrollAtEnd: null,
maintainScrollAtEndThreshold: null,
maintainVisibleContentPosition: null,
numColumns: null,
onEndReached: null,
onEndReachedThreshold: null,
onFirstVisibleItemChanged: null,
onItemSizeChanged: null,
onLoad: null,
onMomentumScrollEnd: null,
onScroll: null,
onScrollBeginDrag: null,
onStartReached: null,
onStartReachedThreshold: null,
onStickyHeaderChange: null,
overrideItemLayout: null,
positionComponentInternal: null,
recycleItems: null,
renderItem: null,
rtl: null,
snapToIndices: null,
stickyHeaderIndicesArr: null,
stickyHeaderIndicesSet: null,
stickyPositionComponentInternal: null,
stylePaddingBottom: null,
stylePaddingLeft: null,
stylePaddingRight: null,
stylePaddingTop: null,
useWindowScroll: false
};
const r520 = env21605 = {};
env21605[0] = getItemType;
props2.getItemType = r490.useMemo($mk95195(r520), [getItemType]);
props2.horizontal = !!horizontal4;
props2.itemsAreEqual = itemsAreEqual;
const r527 = env21606 = {};
env21606[0] = r94;
props2.keyExtractor = r490.useMemo($mk95195(r527), [r94]);
props2.maintainScrollAtEnd = maintainScrollAtEnd3;
props2.maintainScrollAtEndThreshold = maintainScrollAtEndThreshold2;
props2.maintainVisibleContentPosition = maintainVisibleContentPosition2;
props2.numColumns = numColumns;
props2.onEndReached = onEndReached;
props2.onEndReachedThreshold = onEndReachedThreshold2;
props2.onFirstVisibleItemChanged = onFirstVisibleItemChanged;
props2.onItemSizeChanged = onItemSizeChanged;
props2.onLoad = onLoad;
props2.onMomentumScrollEnd = onMomentumScrollEnd2;
props2.onScroll = onScroll6;
props2.onScrollBeginDrag = onScrollBeginDrag2;
props2.onStartReached = onStartReached;
props2.onStartReachedThreshold = onStartReachedThreshold2;
props2.onStickyHeaderChange = onStickyHeaderChange;
props2.overrideItemLayout = overrideItemLayout;
props2.positionComponentInternal = positionComponentInternal;
props2.recycleItems = !!recycleItems2;
props2.renderItem = renderItem2;
props2.rtl = rtl;
props2.snapToIndices = snapToIndices;
props2.stickyHeaderIndicesArr = stickyHeaderIndices == null ? [] : stickyHeaderIndices;
props2.stickyHeaderIndicesSet = r31.useMemo(() => {
const r3 = Set;
let r7 = stickyHeaderIndices;
if (stickyHeaderIndices == null) {
r7 = [];
}
return new r3(r7);
}, [stickyHeaderIndices == null ? void 0 : stickyHeaderIndices.join(",")]);
props2.stickyPositionComponentInternal = stickyPositionComponentInternal;
props2.stylePaddingBottom = stylePaddingBottom;
props2.stylePaddingLeft = stylePaddingLeft;
props2.stylePaddingRight = stylePaddingRight;
props2.stylePaddingTop = stylePaddingTop;
current3.props = props2;
current3.refScroller = ref12;
if (!((isFirst ? isFirst : !adaptiveRender) || experimental_adaptiveRender)) {
(0, env10649[45])(context9);
}
if (r465) {
const r546 = !initialScroll;
const state15 = context9.state;
state15.didContainersLayout = false;
state15.queuedInitialLayout = false;
if (!r546) {
state15.didFinishInitialScroll = false;
}
(0, env10649[22])(context9, "readyToRender", false);
(0, env10649[45])(context9);
}
memo3 = r31.useMemo(() => c21601_2.length ? Array.from({
length: Math.min(numColumns, c21601_2.length)
}, (a0, a1) => {
const r12 = c21601_2.length - 1 - a1;
const props = current3.props;
const { data: data3, keyExtractor: keyExtractor2 } = props;
let r14 = "";
if (data3) {
const r15 = r12 < data3.length ? keyExtractor2 ? keyExtractor2(data3[r12], r12) : r12 : null;
current3.idCache[r12] = r15;
r14 = r15;
}
return r14;
}) : [], [data3, dataKey, dataVersion, numColumns]);
initializeStateVars2 = (a0) => {
let c27921_1;
const r10 = env10649[22];
r10(context9, "lastItemKeys", memo3);
r10(context9, "numColumns", numColumns);
context9.values.get("stylePaddingTop");
const context17 = context9;
c27921_1 = void 0;
const state14 = context9.state;
if (c21601_13 !== void 0) {
const r15 = context9.values.get("stylePaddingTop") || 0;
c27921_1 = r15;
if (c21601_13 < r15) {
r10(context9, "totalSize", (context9.values.get("totalSize") || 0) + r15);
state14.timeoutSetPaddingTop = setTimeout(() => {
(0, env10649[22])(context17, "totalSize", (context17.values.get("totalSize") || 0) - c27921_1);
}, 16);
}
r10(context9, "stylePaddingTop", c21601_13);
}
ref5.current.props.stylePaddingBottom = stylePaddingBottom;
(0, env10649[50])(context9);
if (a0) {
c21601_15.size;
}
};
if (isFirst) {
initializeStateVars2(false);
current3.indexByKey.clear();
current3.idCache.length = 0;
current3.positions.length = 0;
current3.columns.length = 0;
current3.columnSpans.length = 0;
(0, env10649[89])(context9, true);
}
memo4 = r31.useMemo(() => {
const initialScroll2 = current3.initialScroll;
if (initialScroll2) {
let contentOffset = initialScroll2.contentOffset;
if (contentOffset == null) {
contentOffset = (0, env10649[75])(context9, initialScroll2);
}
if (c21601_18) {
const initialScrollSession = current3.initialScrollSession;
if (initialScrollSession != null) {
initialScrollSession.kind;
}
}
return contentOffset;
}
}, [r221]);
r31.useLayoutEffect(() => {
let r73;
let r13 = c21601_16;
const length = c21601_2.length;
const r3 = !ListFooterComponent2;
const state14 = context9.state;
const initialScroll2 = state14.initialScroll;
const contentOffset2 = memo4 != null ? memo4 : 0;
const preserveForFooterLayout = c21601_18 && initialScrollAtEnd && !r3;
let r16 = initialScroll2;
if (r16) {
let r27 = initialScroll2.contentOffset === void 0;
if (!r27) {
let r31 = !!initialScroll2.preserveForFooterLayout !== preserveForFooterLayout;
if (r31) {
const initialScrollSession = state14.initialScrollSession;
r31 = initialScrollSession?.kind !== "offset";
}
r27 = r31;
}
r16 = r27;
}
const r35 = env10649;
if (r16) {
const initialScroll4 = {
...initialScroll2,
contentOffset: contentOffset2,
preserveForFooterLayout
};
const state15 = context9.state;
state15.clearPreservedInitialScrollOnNextFinish = void 0;
if (state15.timeoutPreservedInitialScrollClear !== void 0) {
clearTimeout(state15.timeoutPreservedInitialScrollClear);
state15.timeoutPreservedInitialScrollClear = void 0;
}
state15.initialScroll = initialScroll4;
const r44 = env10649[38];
const initialScrollSession2 = state15.initialScrollSession;
r44(state15, {
kind: initialScrollSession2?.kind === "offset" ? "offset" : "bootstrap"
});
}
L102: {
if (c21601_18 && initialScroll2) {
const initialScrollSession3 = state14.initialScrollSession;
if (initialScrollSession3?.kind !== "offset") {
const initialScroll3 = state14.initialScroll;
const state16 = context9.state;
const resolvedOffset = (0, env10649[75])(context9, initialScroll3);
let r68 = resolvedOffset === 0 && !initialScrollAtEnd;
if (r68) {
const initialScrollSession4 = state16.initialScrollSession;
if (initialScrollSession4?.kind === "offset") {
const r84 = Math;
const contentOffset = initialScroll3.contentOffset;
r73 = r84.abs(contentOffset ?? 0) <= 1;
} else {
r73 = initialScroll3.index === 0;
if (r73) {
const viewPosition2 = initialScroll3.viewPosition;
r73 = (viewPosition2 ?? 0) === 0;
}
if (r73) {
const r77 = Math;
const viewOffset = initialScroll3.viewOffset;
r73 = r77.abs(viewOffset ?? 0) <= 1;
}
}
r68 = r73;
}
const r94 = state16.props.data.length === 0 && initialScroll3.index !== void 0;
if (r68) {
const initialScrollSession8 = state16.initialScrollSession;
const r140 = initialScrollSession8?.kind === "bootstrap" ? state16.initialScrollSession.bootstrap : void 0;
const frameHandle2 = r140?.frameHandle;
if (frameHandle2 !== void 0 && typeof globalThis.cancelAnimationFrame === "function") {
cancelAnimationFrame(frameHandle2);
}
if (r140) {
r140.frameHandle = void 0;
}
const r150 = env10649[38];
const initialScrollSession9 = state16.initialScrollSession;
r150(state16, {
bootstrap: null,
kind: initialScrollSession9?.kind
});
(0, env10649[48])(context9, {
resolvedOffset
});
break L102;
}
if (r94) {
const initialScrollSession6 = state16.initialScrollSession;
const r117 = initialScrollSession6?.kind === "bootstrap" ? state16.initialScrollSession.bootstrap : void 0;
const frameHandle = r117?.frameHandle;
if (frameHandle !== void 0 && typeof globalThis.cancelAnimationFrame === "function") {
cancelAnimationFrame(frameHandle);
}
if (r117) {
r117.frameHandle = void 0;
}
const r127 = env10649[38];
const initialScrollSession7 = state16.initialScrollSession;
r127(state16, {
bootstrap: null,
kind: initialScrollSession7?.kind
});
(0, env10649[48])(context9, {
preserveTarget: true,
resolvedOffset
});
break L102;
}
let env27922;
(0, env10649[79])(state16, {
scroll: resolvedOffset,
seedContentOffset: resolvedOffset,
targetIndexSeed: initialScroll3.index
});
const r100 = env27922 = {
$parent: r35
};
env27922[0] = context9;
env27922[1] = void 0;
const state17 = context9.state;
env27922[1] = state17;
const initialScrollSession5 = state17.initialScrollSession;
const r106 = initialScrollSession5?.kind === "bootstrap" ? state17.initialScrollSession.bootstrap : void 0;
if (!r106) {
break L102;
}
if (r106.frameHandle !== void 0) {
break L102;
}
r106.frameHandle = requestAnimationFrame($mk95175(r100));
break L102;
}
}
if (!r13) {
r13 = contentOffset2;
}
if (!r13) {
r13 = !((initialScroll2 ? length !== 0 : !initialScroll2) || contentOffset2 === 0 && !initialScrollAtEnd);
}
if (!r13) {
if (initialScroll2 && !initialScrollAtEnd) {
(0, env10649[48])(context9, {
resolvedOffset: contentOffset2
});
break L102;
}
(0, env10649[47])(context9, {
didInitialScroll: true
});
}
}
}, []);
if ((isFirst ? isFirst : r12) || current3.didColumnsChange) {
ref5.current.lastBatchingAction = Date.now();
if (!keyExtractor2) {
keyExtractor2 = isFirst;
}
if (!keyExtractor2) {
keyExtractor2 = !r12;
}
if (!keyExtractor2) {
ref5.current.sizes.clear();
ref5.current.positions.length = 0;
ref5.current.totalSize = 0;
(0, env10649[22])(context9, "totalSize", 0);
}
}
let r595 = c10649_31;
if (r595) {
c10649_132(a0);
}
r31.useLayoutEffect(() => {
let initialScroll3;
const length = c21601_2.length;
let r27 = c21601_31;
let kind2 = "bootstrap";
const kind = c21601_17 ? "offset" : "bootstrap";
const state14 = context9.state;
const initialScrollSession = state14.initialScrollSession;
const previousDataLength = initialScrollSession?.previousDataLength;
const previousDataLength2 = previousDataLength ?? 0;
let r32 = length > 0;
if (r32) {
const hasHadNonEmptyData = state14.hasHadNonEmptyData;
r32 = hasHadNonEmptyData ? c21601_32 : !hasHadNonEmptyData;
}
if (length > 0) {
state14.hasHadNonEmptyData = true;
}
if (r32) {
if (initialScroll) {
const state15 = context9.state;
state15.clearPreservedInitialScrollOnNextFinish = void 0;
if (state15.timeoutPreservedInitialScrollClear !== void 0) {
clearTimeout(state15.timeoutPreservedInitialScrollClear);
state15.timeoutPreservedInitialScrollClear = void 0;
}
state15.initialScroll = initialScroll;
const r48 = env10649[38];
const initialScrollSession2 = state15.initialScrollSession;
r48(state15, {
kind: initialScrollSession2?.kind === "offset" ? "offset" : "bootstrap"
});
(0, env10649[38])(state14, {
kind,
previousDataLength: previousDataLength2
});
} else {
if (state14.timeoutPreservedInitialScrollClear !== void 0) {
clearTimeout(state14.timeoutPreservedInitialScrollClear);
state14.timeoutPreservedInitialScrollClear = void 0;
}
state14.clearPreservedInitialScrollOnNextFinish = void 0;
state14.initialScroll = void 0;
(0, env10649[38])(state14);
}
}
if (state14.initialScrollSession) {
state14.initialScrollSession.previousDataLength = length;
}
L192: {
(0, env10649[38])(state14);
if (c21601_18) {
const state17 = context9.state;
const { initialScroll: initialScroll2, initialScrollSession: initialScrollSession4 } = state17;
if (initialScrollSession4?.kind !== "offset" && initialScroll2) {
const r97 = !(state17.didFinishInitialScroll && previousDataLength2 === 0 && length > 0 && initialScroll2.index !== void 0);
const initialScrollSession5 = state17.initialScrollSession;
const r101 = initialScrollSession5?.kind === "bootstrap" ? state17.initialScrollSession.bootstrap : void 0;
const r103 = !r97;
if (!initialScrollAtEnd && r27 && length > 0 && state17.didFinishInitialScroll && !r101 && !r103) {
if (state17.timeoutPreservedInitialScrollClear !== void 0) {
clearTimeout(state17.timeoutPreservedInitialScrollClear);
state17.timeoutPreservedInitialScrollClear = void 0;
}
state17.clearPreservedInitialScrollOnNextFinish = void 0;
state17.initialScroll = void 0;
(0, env10649[38])(state17);
break L192;
}
let r112 = length > 0;
if (r112) {
let r113 = initialScrollAtEnd;
if (!initialScrollAtEnd) {
let r114 = initialScroll2 ? initialScroll2.viewPosition !== 1 : !initialScroll2;
if (!r114) {
const r7 = !!initialScroll2?.preserveForBottomPadding;
r114 = r7 ? !r7 : !!!initialScroll2?.preserveForFooterLayout;
}
r113 = !r114;
}
r112 = r113;
}
if (!r27 && !r103 && !r112) {
break L192;
}
L127: {
if (r112) {
const r126 = context9.values.get("footerSize");
if (initialScrollAtEnd) {
const r145 = r126 || 0;
const preserveForFooterLayout = initialScroll2?.preserveForFooterLayout;
initialScroll3 = {
contentOffset: void 0,
index: Math.max(0, length - 1),
preserveForBottomPadding: true,
preserveForFooterLayout: !!preserveForFooterLayout,
viewOffset: -stylePaddingBottom - r145,
viewPosition: 1
};
} else {
const r127 = r126 ? r126 : 0;
const r130 = !initialScroll2?.preserveForFooterLayout;
const index3 = initialScrollAtEnd ? Math.max(0, length - 1) : initialScroll2.index;
const preserveForFooterLayout2 = !r130;
initialScroll3 = {
...initialScroll2,
contentOffset: void 0,
index: index3,
preserveForBottomPadding: true,
preserveForFooterLayout: preserveForFooterLayout2,
viewOffset: -stylePaddingBottom - (preserveForFooterLayout2 ? r127 : 0),
viewPosition: 1
};
}
if (!r103 && (0, env10649[82])(context9, initialScroll2)) {
(0, env10649[81])(context9, {
dataLength: length,
stylePaddingBottom,
target: initialScroll2
});
break L192;
}
if (initialScroll2.index === initialScroll3.index && initialScroll2.preserveForBottomPadding === initialScroll3.preserveForBottomPadding && initialScroll2.preserveForFooterLayout === initialScroll3.preserveForFooterLayout && initialScroll2.viewOffset === initialScroll3.viewOffset && initialScroll2.viewPosition === initialScroll3.viewPosition && !r101 && !r103 && !r27) {
break L127;
}
const state20 = context9.state;
state20.clearPreservedInitialScrollOnNextFinish = void 0;
if (state20.timeoutPreservedInitialScrollClear !== void 0) {
clearTimeout(state20.timeoutPreservedInitialScrollClear);
state20.timeoutPreservedInitialScrollClear = void 0;
}
state20.initialScroll = initialScroll3;
if (r103) {
const r229 = {
resetInitialScroll: true
};
const { resetLayout: resetLayout3, resetInitialScroll: resetInitialScroll3 } = r229;
const state21 = context9.state;
if (resetLayout3) {
state21.didContainersLayout = false;
state21.queuedInitialLayout = false;
}
if (resetInitialScroll3) {
state21.didFinishInitialScroll = false;
}
(0, env10649[22])(context9, "readyToRender", false);
(0, env10649[45])(context9);
}
const r241 = env10649[38];
const initialScrollSession7 = state20.initialScrollSession;
if (initialScrollSession7?.kind === "offset") {
kind2 = "offset";
}
r241(state20, {
kind: kind2
});
const r247 = env10649[80];
const r250 = {
scroll: (0, env10649[75])(context9, initialScroll3),
seedContentOffset: null,
targetIndexSeed: null
};
let seedContentOffset2 = void 0;
if (r103) {
seedContentOffset2 = void 0;
if (!r101) {
const current6 = state17.refScroller.current;
const getCurrentScrollOffset2 = current6?.getCurrentScrollOffset;
let r257 = getCurrentScrollOffset2 == null ? void 0 : getCurrentScrollOffset2.call(current6);
if (!(typeof r257 === "number" && Number.isFinite(r257))) {
let scrollPending2 = state17.scrollPending;
if (scrollPending2 == null) {
scrollPending2 = state17.scroll;
}
r257 = scrollPending2 ?? 0;
}
seedContentOffset2 = r257;
}
}
r250.seedContentOffset = seedContentOffset2;
r250.targetIndexSeed = initialScroll3.index;
r247(context9, r250);
break L192;
}
}
if (r27) {
r27 = r101 || r103;
}
if (r27) {
const state18 = context9.state;
state18.clearPreservedInitialScrollOnNextFinish = void 0;
if (state18.timeoutPreservedInitialScrollClear !== void 0) {
clearTimeout(state18.timeoutPreservedInitialScrollClear);
state18.timeoutPreservedInitialScrollClear = void 0;
}
state18.initialScroll = initialScroll2;
if (r103) {
const r182 = {
resetInitialScroll: true
};
const { resetLayout: resetLayout2, resetInitialScroll: resetInitialScroll2 } = r182;
const state19 = context9.state;
if (resetLayout2) {
state19.didContainersLayout = false;
state19.queuedInitialLayout = false;
}
if (resetInitialScroll2) {
state19.didFinishInitialScroll = false;
}
(0, env10649[22])(context9, "readyToRender", false);
(0, env10649[45])(context9);
}
const r194 = env10649[38];
const initialScrollSession6 = state18.initialScrollSession;
r194(state18, {
kind: initialScrollSession6?.kind === "offset" ? "offset" : "bootstrap"
});
const r201 = env10649[80];
const r204 = {
scroll: (0, env10649[75])(context9, initialScroll2),
seedContentOffset: null,
targetIndexSeed: null
};
let seedContentOffset = void 0;
if (r103) {
seedContentOffset = void 0;
if (!r101) {
const current5 = state17.refScroller.current;
const getCurrentScrollOffset = current5?.getCurrentScrollOffset;
let r211 = getCurrentScrollOffset == null ? void 0 : getCurrentScrollOffset.call(current5);
if (!(typeof r211 === "number" && Number.isFinite(r211))) {
let scrollPending = state17.scrollPending;
if (scrollPending == null) {
scrollPending = state17.scroll;
}
r211 = scrollPending ?? 0;
}
seedContentOffset = r211;
}
}
r204.seedContentOffset = seedContentOffset;
r204.targetIndexSeed = initialScroll2.index;
r201(context9, r204);
}
}
} else {
let r63 = previousDataLength2 === 0;
let r64 = (r63 ? length > 0 : r63) && !!state14.initialScroll;
if (r64) {
const initialScrollSession3 = context9.state.initialScrollSession;
r64 = initialScrollSession3?.kind === "offset";
}
if (r64) {
r64 = !!state14.didFinishInitialScroll;
}
if (r63) {
r63 = length !== 0;
}
if (r63) {
r63 = state14.initialScroll;
}
if (r63) {
r63 = state14.queuedInitialLayout;
}
if (r63) {
const didFinishInitialScroll = state14.didFinishInitialScroll;
r63 = didFinishInitialScroll ? r64 : !didFinishInitialScroll;
}
if (r63) {
if (r64) {
const r75 = {
resetInitialScroll: true
};
const { resetLayout, resetInitialScroll } = r75;
const state16 = context9.state;
if (resetLayout) {
state16.didContainersLayout = false;
state16.queuedInitialLayout = false;
}
if (resetInitialScroll) {
state16.didFinishInitialScroll = false;
}
(0, env10649[22])(context9, "readyToRender", false);
(0, env10649[45])(context9);
}
(0, env10649[76])(context9);
}
}
}
}, [data3.length, dataKey, r12, r465, initialScrollAtEnd, stylePaddingBottom, r221]);
const r604 = [context9, data3, dataVersion, anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorIndex, anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorMaxSize, , , ,];
const r610 = anchoredEndSpace == null ? void 0 : anchoredEndSpace.anchorOffset;
let env21607;
const r611 = () => {
if (c21601_33) {
current3.scrollForNextCalculateItemsInView = void 0;
const triggerCalculateItemsInView = current3.triggerCalculateItemsInView;
if (triggerCalculateItemsInView != null) {
triggerCalculateItemsInView.call(current3);
}
}
(0, env10649[103])(context9);
};
r604[5] = r610;
r604[6] = r504;
r604[7] = numColumns;
r31.useLayoutEffect(r611, r604);
r31.useLayoutEffect(() => {
const current5 = ref4.current;
ref4.current = void 0;
const state14 = context9.state;
const r18 = env10649[24];
const r19 = r18(context9, current5);
const r21 = r18(context9) - r19;
if (r21 !== 0) {
const r3 = !context9.values.get("isWithinMaintainScrollAtEndThreshold");
(0, env10649[70])(context9, state14.scroll, true, {
markHasScrolled: false
});
const r2 = (0, env10649[85])(context9);
if (r2 ? !r2 : !r3) {
(0, env10649[65])(context9, r21);
}
}
}, [context9, void 0]);
const callback6 = r31.useCallback((a0) => {
L38: {
if (c21601_18) {
const length = c21601_2.length;
const r16 = a0[horizontal4 ? "width" : "height"];
const state14 = context9.state;
if (initialScrollAtEnd) {
const { initialScroll: initialScroll2, initialScrollSession } = state14;
if (initialScrollSession?.kind !== "offset" && length !== 0 && initialScroll2) {
const initialScrollSession2 = state14.initialScrollSession;
const kind = initialScrollSession2?.kind;
let kind2 = "bootstrap";
if (!(kind === "bootstrap" ? state14.initialScrollSession.bootstrap : void 0) && !initialScroll2?.preserveForFooterLayout) {
break L38;
}
if ((0, env10649[82])(context9, initialScroll2)) {
(0, env10649[81])(context9, {
dataLength: length,
stylePaddingBottom,
target: initialScroll2
});
} else {
const preserveForFooterLayout = initialScroll2?.preserveForFooterLayout;
const initialScroll3 = {
contentOffset: void 0,
index: Math.max(0, length - 1),
preserveForBottomPadding: true,
preserveForFooterLayout: !!preserveForFooterLayout,
viewOffset: -stylePaddingBottom - r16,
viewPosition: 1
};
if (initialScroll2.index === initialScroll3.index && initialScroll2.viewPosition === initialScroll3.viewPosition && initialScroll2.viewOffset === initialScroll3.viewOffset) {
(0, env10649[81])(context9, {
dataLength: length,
stylePaddingBottom,
target: initialScroll2
});
break L38;
}
const r56 = !state14.didFinishInitialScroll;
const state15 = context9.state;
state15.clearPreservedInitialScrollOnNextFinish = void 0;
if (state15.timeoutPreservedInitialScrollClear !== void 0) {
clearTimeout(state15.timeoutPreservedInitialScrollClear);
state15.timeoutPreservedInitialScrollClear = void 0;
}
const r62 = !r56;
state15.initialScroll = initialScroll3;
if (r62) {
const r63 = {
resetInitialScroll: true
};
const { resetLayout, resetInitialScroll } = r63;
const state16 = context9.state;
if (resetLayout) {
state16.didContainersLayout = false;
state16.queuedInitialLayout = false;
}
if (resetInitialScroll) {
state16.didFinishInitialScroll = false;
}
(0, env10649[22])(context9, "readyToRender", false);
(0, env10649[45])(context9);
}
const r75 = env10649[38];
const initialScrollSession3 = state15.initialScrollSession;
if (initialScrollSession3?.kind === "offset") {
kind2 = "offset";
}
r75(state15, {
kind: kind2
});
(0, env10649[80])(context9, {
scroll: (0, env10649[75])(context9, initialScroll3),
targetIndexSeed: initialScroll3.index
});
}
}
}
}
}
}, [data3.length, initialScrollAtEnd, horizontal4, stylePaddingBottom, r221]);
const r627 = {
onLayoutChange: r31.useCallback((a0, a1) => {
let r161;
const { scrollLength, otherAxisSize } = current3;
const state14 = context9.state;
const props = state14.props;
const { maintainScrollAtEnd: maintainScrollAtEnd2, useWindowScroll: useWindowScroll2 } = props;
const horizontal6 = state14.props.horizontal;
let r17 = "height";
const r13 = horizontal6 ? "width" : "height";
const r31 = state14.props.horizontal ? "height" : "width";
let lastLayout2 = a0;
if (useWindowScroll2) {
const r36 = env10649[11].Dimensions.get("window");
const r40 = ({
height: r36.height,
width: r36.width
})[r13];
let r41 = a0;
if (r40 > 0) {
const r42 = {
...a0
};
r42[r13] = r40;
r41 = r42;
}
lastLayout2 = r41;
}
const r44 = lastLayout2[r13];
let scrollLength2 = state14.scrollLength;
if (r44 > 0) {
scrollLength2 = r44;
}
const otherAxisSize3 = lastLayout2[r31];
const lastLayout = state14.lastLayout;
const r4 = (lastLayout ? scrollLength2 > state14.scrollLength : !lastLayout) || state14.lastLayout.x !== lastLayout2.x || state14.lastLayout.y !== lastLayout2.y;
state14.lastLayout = lastLayout2;
const otherAxisSize2 = state14.otherAxisSize;
let r2 = scrollLength2 !== state14.scrollLength || otherAxisSize3 !== otherAxisSize2;
if (r2) {
state14.scrollLength = scrollLength2;
state14.otherAxisSize = otherAxisSize3;
const r58 = env10649;
(0, env10649[50])(context9);
state14.lastBatchingAction = Date.now();
state14.scrollForNextCalculateItemsInView = void 0;
if (scrollLength2 > 0) {
(0, env10649[133])(context9);
}
if (r4) {
let env27923;
const r64 = env27923 = {
$parent: r58
};
env27923[0] = context9;
env27923[1] = {
doMVCP: true
};
env27923[2] = context9.state;
unstable_batchedUpdates($mk95179(r64));
}
if (!r2) {
r2 = otherAxisSize3 !== otherAxisSize2;
}
if (r2) {
(0, env10649[22])(context9, "scrollSize", {
height: lastLayout2.height,
width: lastLayout2.width
});
}
if (maintainScrollAtEnd2?.onLayout) {
(0, env10649[64])(context9);
}
(0, env10649[43])(context9);
if (state14) {
const horizontal7 = state14.props.horizontal;
const props2 = state14.props;
state14.needsOtherAxisSize = otherAxisSize3 - (horizontal7 ? (props2.stylePaddingTop || 0) + (state14.props.stylePaddingBottom || 0) : (props2.stylePaddingLeft || 0) + (state14.props.stylePaddingRight || 0)) < 10;
}
let r95 = c10649_31;
if (r95 ? r44 === 0 : r95) {
if (state14.props.horizontal) {
r17 = "width";
}
const r103 = `List ${r17} is 0. You may need to set a style or \`flex: \` for the list, because children are absolutely positioned.`;
if (r95) {
r95 = !c10649_53.has("height0");
}
if (r95) {
c10649_53.add("height0");
console.warn(`[legend-list] ${r103}`);
}
}
}
setState2(true);
const r122 = env10649;
(0, env10649[103])(context9);
const r126 = scrollLength !== current3.scrollLength || otherAxisSize !== current3.otherAxisSize;
const r129 = c21601_18 && !a1 && r126;
L108: {
if (r129) {
const state15 = context9.state;
const { initialScroll: initialScroll2, initialScrollSession } = state15;
const r138 = initialScrollSession?.kind === "bootstrap" ? state15.initialScrollSession.bootstrap : void 0;
if (initialScroll2 && state15.props.data.length > 0) {
const initialScrollSession2 = state15.initialScrollSession;
if (initialScrollSession2?.kind !== "offset") {
if (!r138 && initialScroll2.viewPosition !== 1) {
break L108;
}
const offset = (0, env10649[75])(context9, initialScroll2);
const scrollingTo2 = state15.scrollingTo;
const r154 = scrollingTo2?.isInitialScroll ? state15.scrollingTo : void 0;
L107: {
if (!r138) {
if (!r154 && !state15.didFinishInitialScroll) {
break L107;
}
L97: {
if (r154) {
let targetOffset2 = r154.targetOffset;
if (targetOffset2 == null) {
targetOffset2 = r154.offset;
}
r161 = targetOffset2;
} else {
const current5 = state15.refScroller.current;
const getCurrentScrollOffset = current5?.getCurrentScrollOffset;
r161 = getCurrentScrollOffset == null ? void 0 : getCurrentScrollOffset.call(current5);
if (typeof r161 === "number" && Number.isFinite(r161)) {
break L97;
}
let scrollPending = state15.scrollPending;
if (scrollPending == null) {
scrollPending = state15.scroll;
}
r161 = scrollPending ?? 0;
}
}
const r172 = offset - r161;
if (!(Math.abs(r172) > 1)) {
break L108;
}
if (state15.didFinishInitialScroll) {
if ((0, env10649[83])(context9) === void 0) {
break L108;
}
let env27924;
const preservedEndAnchorCorrection = {};
const r197 = env27924 = {
$parent: r122
};
env27924[0] = context9;
env27924[1] = preservedEndAnchorCorrection;
const state16 = context9.state;
env27924[2] = state16;
state16.preservedEndAnchorCorrection = preservedEndAnchorCorrection;
requestAnimationFrame($mk95176(r197));
break L108;
}
if (!r154) {
break L108;
}
const r181 = c10649_37.get(state15);
r154.offset = offset;
r154.targetOffset = offset;
state15.initialScroll = {
...initialScroll2,
contentOffset: offset
};
state15.hasScrolled = false;
let startScroll = r181?.startScroll;
if (startScroll == null) {
startScroll = state15.scroll;
}
c10649_37.set(state15, {
startScroll,
targetOffset: offset
});
(0, env10649[65])(context9, r172);
break L108;
}
}
(0, env10649[80])(context9, {
scroll: offset,
targetIndexSeed: initialScroll2.index
});
}
}
}
}
if (!c21601_18) {
(0, env10649[76])(context9);
}
}, [data3.length, initialScrollAtEnd, stylePaddingBottom, r221]),
onLayoutProp: onLayout,
ref: ref12
};
const r628 = env21607 = {};
env21607[0] = void 0;
env21607[1] = void 0;
env21607[2] = void 0;
env21607[3] = void 0;
env21607[0] = r627.ref;
let measureInLayoutEffect = r627.measureInLayoutEffect;
if (measureInLayoutEffect === void 0) {
measureInLayoutEffect = true;
}
env21607[1] = measureInLayoutEffect;
const onLayoutProp = r627.onLayoutProp;
env21607[2] = onLayoutProp;
const onLayoutChange = r627.onLayoutChange;
env21607[3] = onLayoutChange;
const callback7 = r490.useCallback($mk95186(r628), [onLayoutChange, onLayoutProp]);
if (c10649_27) {
const r640 = [measureInLayoutEffect, ...[]];
r490.useLayoutEffect($mk95187(r628), r640);
}
let env21608;
let stickyHeaderIndices2, horizontal5, context10, onScroll3, c21609_4;
r31.useLayoutEffect(() => {
if (snapToIndices) {
const state14 = context9.state;
const snapToIndices2 = state14.props.snapToIndices;
const r11 = state14.props.horizontal ? (0, env10649[25])(context9) : void 0;
const r25 = Array(snapToIndices2.length);
const r6 = 0 < snapToIndices2.length;
let r0 = 0;
if (r6) {
do {
const r14 = snapToIndices2[r0];
const props = state14.props;
const { data: data3, keyExtractor: keyExtractor2 } = props;
const r1 = r0;
if (data3) {
state14.idCache[r14] = r14 < data3.length ? keyExtractor2 ? keyExtractor2(data3[r14], r14) : r14 : null;
}
r25[r1] = (0, env10649[15])(state14, state14.positions[r14], r11);
r0 = r1 + 1;
} while (r0 < snapToIndices2.length);
}
(0, env10649[22])(context9, "snapToOffsets", r25);
}
}, [snapToIndices]);
r31.useLayoutEffect(() => {
initializeStateVars2(true);
}, [dataKey, dataVersion, memo3.join(","), numColumns, scrollAxisGap, stylePaddingBottom, stylePaddingTop, alignItemsAtEndPaddingEnabled]);
r31.useLayoutEffect(() => {
const { didColumnsChange, didDataChange, isFirst } = current3;
const data3 = current3.props.data;
if (!(data3.length > 0 && (0, env10649[133])(context9) || isFirst || (didDataChange ? !didDataChange : !didColumnsChange))) {
let didColumnsChange2 = ({
didColumnsChange
}).didColumnsChange;
if (didColumnsChange2 === void 0) {
didColumnsChange2 = false;
}
const state14 = context9.state;
const previousData = state14.previousData;
const maintainScrollAtEnd2 = state14.props.maintainScrollAtEnd;
if (didColumnsChange2) {
state14.sizes.clear();
state14.sizesKnown.clear();
(0, env10649[30])(state14);
const averageSizes = state14.averageSizes;
for (const key in averageSizes) {
delete state14.averageSizes[key];
}
state14.minIndexSizeChanged = 0;
state14.scrollForNextCalculateItemsInView = void 0;
}
let env27925;
const r40 = env27925 = {
$parent: env10649
};
env27925[0] = context9;
env27925[1] = {
dataChanged: true,
doMVCP: true
};
env27925[2] = context9.state;
unstable_batchedUpdates($mk95179(r40));
const r46 = (didColumnsChange2 ? !didColumnsChange2 : maintainScrollAtEnd2?.onDataChange) && (0, env10649[64])(context9);
if ((r46 ? !r46 : previousData) && data3.length > previousData.length) {
state14.isEndReached = false;
}
if (!r46) {
(0, env10649[43])(context9);
}
delete state14["previousData"];
}
if (didDataChange) {
current3.pendingDataComparison = void 0;
}
current3.didColumnsChange = false;
current3.didDataChange = false;
current3.isFirst = false;
}, [data3, dataKey, dataVersion, numColumns, scrollAxisGap]);
r31.useLayoutEffect(() => {
(0, env10649[22])(context9, "extraData", extraData);
const current5 = ref6.current;
ref6.current = current2;
if ((current2 ? current2 : current5 !== current2) && numColumns > 1) {
const triggerCalculateItemsInView = current3.triggerCalculateItemsInView;
if (triggerCalculateItemsInView != null) {
triggerCalculateItemsInView.call(current3, {
forceFullItemPositions: true
});
}
}
}, [extraData, current2, numColumns]);
r31.useEffect(() => {
if (onMetricsChange) {
const footerSize = context9.values.get("footerSize") || 0;
const headerSize = context9.values.get("headerSize") || 0;
let c27926_0, c27926_1;
const r17 = {
footerSize,
headerSize
};
if (!(c27926_0 && r17.headerSize === c27926_0.headerSize && r17.footerSize === c27926_0.footerSize)) {
c27926_0 = r17;
onMetricsChange(r17);
}
let env27927;
const emitMetrics = () => {
const r9 = {
footerSize: context9.values.get("footerSize") || 0,
headerSize: context9.values.get("headerSize") || 0
};
if (!(c27926_0 && r9.headerSize === c27926_0.headerSize && r9.footerSize === c27926_0.footerSize)) {
c27926_0 = r9;
onMetricsChange(r9);
}
};
const r29 = env27927 = {};
env27927[0] = emitMetrics;
const listeners = context9.listeners;
const r31 = listeners.get("headerSize");
env27927[1] = r31;
let r32 = r31;
if (!r32) {
const set2 = new Set();
env27927[1] = set2;
listeners.set("headerSize", set2);
r32 = set2;
}
let env27928;
r32.add(emitMetrics);
const r43 = [$mk95159(r29), ,];
const r44 = env27928 = {};
env27928[0] = emitMetrics;
env27928[1] = void 0;
const listeners2 = context9.listeners;
const r48 = listeners2.get("footerSize");
env27928[1] = r48;
let r49 = r48;
if (!r49) {
const set3 = new Set();
env27928[1] = set3;
listeners2.set("footerSize", set3);
r49 = set3;
}
r49.add(emitMetrics);
r43[1] = $mk95159(r44);
c27926_1 = r43;
return () => {
for (const item5 of c27926_1) {
item5();
}
};
}
}, [context9, onMetricsChange]);
r31.useEffect(() => {
let viewabilityConfig2 = viewabilityConfig;
const r5 = viewabilityConfig ? viewabilityConfig : onViewableItemsChanged;
let viewabilityConfigCallbackPairs2 = viewabilityConfigCallbackPairs;
if (r5) {
const r11 = viewabilityConfigCallbackPairs ? viewabilityConfigCallbackPairs : [];
const r12 = [,];
const r0 = HermesBuiltin.arraySpread(r12, r11, 0);
if (!viewabilityConfig) {
viewabilityConfig2 = {
viewAreaCoveragePercentThreshold: 0
};
}
r12[r0] = {
onViewableItemsChanged,
viewabilityConfig: viewabilityConfig2
};
viewabilityConfigCallbackPairs2 = r12;
}
current3.viewabilityConfigCallbackPairs = viewabilityConfigCallbackPairs2;
current3.enableScrollForNextCalculateItemsInView = true;
if (viewabilityConfigCallbackPairs2) {
current3.scrollForNextCalculateItemsInView = void 0;
}
}, [viewabilityConfig, viewabilityConfigCallbackPairs, onViewableItemsChanged]);
const r674 = env21608 = {};
env21608[0] = () => {
if (!c10649_27) {
(0, env10649[133])(context9);
}
};
r490.useState($mk95184(r674));
r31.useImperativeHandle(a1, () => {
let env27929 = {
$parent: env10649
};
env27929[0] = context9;
env27929[1] = dispatch2;
const state14 = context9.state;
env27929[2] = state14;
env27929[3] = 0;
env27929[4] = () => {};
env27929[5] = function isScrollToIndexReady(a0, r4 = false) {
const props = env27929[2].props;
const length = props.data.length;
const anchoredEndSpace2 = props.anchoredEndSpace;
let r18 = anchoredEndSpace2?.anchorIndex;
if (!(a0 < 0)) {
let r21 = !(a0 >= length);
if (r21) {
let r2 = r18 === void 0 || r18 < 0 || r18 >= length || a0 < r18;
if (!r2) {
const r22 = env27929[0];
const r23 = length - 1;
const r9 = r18 <= r23;
let r3 = true;
if (r9) {
do {
const r14 = (0, env10649[57])(r22, r18);
const r26 = r18;
r3 = false;
if (r14 === void 0) {
break;
}
r18 = r26 + 1;
r3 = true;
} while (r18 <= r23);
}
r2 = r3;
}
r21 = r2;
}
r4 = r21;
}
return r4;
};
env27929[6] = function runScrollRequest(a0, a1, a2) {
let env27903 = {
$parent: env27929
};
env27903[0] = a0;
env27903[1] = a1;
env27903[2] = a2;
let r4 = arguments[3];
if (r4 === void 0) {
r4 = () => true;
}
const r14 = env27929[2];
const r15 = !!r14.didDataChange || !!r14.didColumnsChange || r14.queuedMVCPRecalculate !== void 0 || r14.ignoreScrollFromMVCP !== void 0;
L20: {
if (!r15 && r4()) {
if (a0 !== env27929[3]) {
break L20;
}
if (a2() && r14.scrollingTo) {
break L20;
}
if (r14.pendingScrollResolve === a1) {
r14.pendingScrollResolve = void 0;
}
a1();
} else {
let c27904_0 = a0;
let c27904_1 = r4;
let c27904_2 = Date.now();
let c27904_3 = 0;
const check2 = () => {
L23: {
if (c27904_0 === env27929[3]) {
const r10 = env27929[2];
if (!(!!r10.didDataChange || !!r10.didColumnsChange || r10.queuedMVCPRecalculate !== void 0 || r10.ignoreScrollFromMVCP !== void 0) && c27904_1()) {
c27904_3 = c27904_3 + 1;
} else {
c27904_3 = 0;
}
const r29 = Date.now() - c27904_2;
if (!(c27904_3 >= 2) && !(r29 >= 800)) {
requestAnimationFrame(check2);
break L23;
}
if (env27903[0] === env27929[3] && !((0, env27903[2])() && env27929[2].scrollingTo)) {
const pendingScrollResolve2 = env27929[2].pendingScrollResolve;
const r47 = env27903[1];
if (pendingScrollResolve2 === r47) {
env27929[2].pendingScrollResolve = void 0;
}
r47();
}
}
}
};
requestAnimationFrame(check2);
}
}
};
env27929[7] = (a0) => {};
env27929[8] = (a0) => {};
state14.runPendingScrollToEnd = () => {
const r5 = env27929[2];
const pendingScrollToEnd = r5.pendingScrollToEnd;
if (pendingScrollToEnd) {
r5.pendingScrollToEnd = void 0;
if (pendingScrollToEnd.token === env27929[3]) {
(0, env27929[6])(pendingScrollToEnd.token, pendingScrollToEnd.resolve, () => {
const r7 = env27929[0];
const options2 = pendingScrollToEnd.options;
const state14 = r7.state;
const index3 = state14.props.data.length - 1;
let r3 = false;
if (index3 !== -1) {
env10649[73](r7, {
...options2,
index: index3,
viewOffset: -(state14.props.stylePaddingBottom || 0) - (r7.values.get("footerSize") || 0) + (options2?.viewOffset || 0),
viewPosition: 1
});
r3 = true;
}
return r3;
}, () => (0, env27929[5])(env27929[2].props.data.length - 1, true));
}
}
};
env27929[9] = (a0) => {};
env27929[10] = state14.refScroller;
return {
clearCaches: (a0) => {
const mode = a0?.mode;
const r10 = mode ?? "sizes";
const r8 = env27929[2];
r8.sizes.clear();
r8.sizesKnown.clear();
(0, env10649[30])(r8);
const averageSizes = r8.averageSizes;
for (const key in averageSizes) {
delete env27929[2].averageSizes[key];
}
const r28 = env27929[2];
r28.minIndexSizeChanged = 0;
r28.scrollForNextCalculateItemsInView = void 0;
r28.pendingTotalSize = void 0;
r28.totalSize = 0;
const r29 = env10649[22];
const r30 = env27929[0];
r29(r30, "totalSize", 0);
if (r10 === "full") {
r28.indexByKey.clear();
r28.idCache.length = 0;
r28.positions.length = 0;
r28.columns.length = 0;
r28.columnSpans.length = 0;
}
(function triggerMountedContainerLayouts(a0) {
if (c10649_27) {
(0, env10649[87])(a0);
} else {
for (const item5 of a0.containerLayoutTriggers.values()) {
item5();
}
}
})(r30);
const triggerCalculateItemsInView = r28.triggerCalculateItemsInView;
if (triggerCalculateItemsInView != null) {
triggerCalculateItemsInView.call(r28, {
forceFullItemPositions: true
});
}
},
flashScrollIndicators: () => env27929[10].current.flashScrollIndicators(),
getAnimatableRef: () => {
const r3 = env27929[10];
const current5 = r3.current;
const getNativeScrollRef2 = current5.getNativeScrollRef;
let r7 = getNativeScrollRef2 == null ? void 0 : getNativeScrollRef2.call(current5);
if (r7 == null) {
r7 = r3.current;
}
return r7;
},
getNativeScrollRef: () => env27929[10].current,
getScrollableNode: () => env27929[10].current.getScrollableNode(),
getScrollResponder: () => env27929[10].current.getScrollResponder(),
getState: () => {
const r5 = env27929[0];
const r1 = {
activeStickyIndex: r5.values.get("activeStickyIndex"),
contentLength: (0, env10649[25])(r5),
data: null,
elementAtIndex: null,
end: null,
endBuffered: null,
getAverageItemSizes: null,
isAtEnd: null,
isAtStart: null,
isEndReached: null,
isNearEnd: null,
isNearStart: null,
isStartReached: null,
isWithinMaintainScrollAtEndThreshold: null,
listen: null,
listenToPosition: null,
positionAtIndex: null,
positionByKey: null,
scroll: null,
scrollLength: null,
scrollVelocity: null,
sizeAtIndex: null,
sizes: null,
start: null,
startBuffered: null
};
const r13 = env27929[2];
r1.data = r13.props.data;
r1.elementAtIndex = (a0) => {
let r43;
const r14 = env27929[0];
const viewRefs = r14.viewRefs;
const r7 = env27929[2];
const props = r7.props;
const { data: data3, keyExtractor: keyExtractor2 } = props;
let r13 = "";
if (data3) {
const r20 = a0 < data3.length ? keyExtractor2 ? keyExtractor2(data3[a0], a0) : a0 : null;
r7.idCache[a0] = r20;
r13 = r20;
}
const state14 = r14.state;
const containerItemKeys = state14?.containerItemKeys;
let r29 = containerItemKeys == null ? void 0 : containerItemKeys.get(r13);
if (r29 === void 0) {
const r34 = r14.values.get("numContainers");
let r0 = 0;
const r35 = 0 < r34;
r29 = -1;
if (r35) {
do {
const r41 = r14.values.get(`containerItemKey${r0}`);
const r1 = r0;
r29 = r1;
if (r41 === r13) {
break;
}
const r42 = r1 + 1;
r43 = r42 < r34;
r0 = r42;
r29 = -1;
} while (r43);
}
}
const r44 = viewRefs.get(r29);
return r44?.current;
};
r1.end = r13.endNoBuffer;
r1.endBuffered = r13.endBuffered;
r1.getAverageItemSizes = () => {
const r7 = env27929[2];
const r12 = {};
const averageSizes = r7.averageSizes;
for (const key in averageSizes) {
let r9 = key;
const r10 = r7.averageSizes[r9];
if (r10) {
if (!r9) {
r9 = "default";
}
r12[r9] = {
average: r10.avg,
count: r10.num
};
}
}
return r12;
};
r1.isAtEnd = r5.values.get("isAtEnd");
r1.isAtStart = r5.values.get("isAtStart");
r1.isEndReached = r13.isEndReached;
r1.isNearEnd = r5.values.get("isNearEnd");
r1.isNearStart = r5.values.get("isNearStart");
r1.isStartReached = r13.isStartReached;
r1.isWithinMaintainScrollAtEndThreshold = r5.values.get("isWithinMaintainScrollAtEndThreshold");
r1.listen = (a0, a1) => {
let env30828;
const r1 = env27929[0];
const r10 = env30828 = {};
env30828[0] = a1;
const listeners = r1.listeners;
const r12 = listeners.get(a0);
env30828[1] = r12;
let r2 = r12;
if (!r2) {
const set2 = new Set();
env30828[1] = set2;
listeners.set(a0, set2);
r2 = set2;
}
r2.add(a1);
return $mk95159(r10);
};
r1.listenToPosition = (a0, a1) => {
const r1 = env27929[0];
const positionListeners = r1.positionListeners;
const r12 = positionListeners.get(a0);
let c30829_1 = r12;
let r2 = r12;
if (!r2) {
const set2 = new Set();
c30829_1 = set2;
positionListeners.set(a0, set2);
r2 = set2;
}
r2.add(a1);
return () => c30829_1.delete(a1);
};
r1.positionAtIndex = (a0) => env27929[2].positions[a0];
r1.positionByKey = (a0) => {
const r1 = env27929[2];
const r5 = r1.indexByKey.get(a0);
return r5 !== void 0 ? r1.positions[r5] : void 0;
};
r1.scroll = r13.scroll;
r1.scrollLength = r13.scrollLength;
r1.scrollVelocity = getScrollVelocity(r13);
r1.sizeAtIndex = (a0) => {
const r5 = env27929[2];
const { sizesKnown, props } = r5;
const { data: data3, keyExtractor: keyExtractor2 } = props;
let r11 = "";
if (data3) {
const r12 = a0 < data3.length ? keyExtractor2 ? keyExtractor2(data3[a0], a0) : a0 : null;
r5.idCache[a0] = r12;
r11 = r12;
}
return sizesKnown.get(r11);
};
r1.sizes = r13.sizesKnown;
r1.start = r13.startNoBuffer;
r1.startBuffered = r13.startBuffered;
return r1;
},
reportContentInset: (a0) => {
const r6 = env27929[0];
const state14 = r6.state;
const contentInsetOverride2 = a0 ?? void 0;
const contentInsetOverride = state14.contentInsetOverride;
const top2 = contentInsetOverride?.top;
const r11 = top2 ?? 0;
const top = contentInsetOverride2?.top;
let r24 = r11 === (top ?? 0);
if (r24) {
const bottom = contentInsetOverride?.bottom;
const r27 = bottom ?? 0;
const bottom2 = contentInsetOverride2?.bottom;
r24 = r27 === (bottom2 ?? 0);
}
if (r24) {
const left2 = contentInsetOverride?.left;
const r35 = left2 ?? 0;
const left3 = contentInsetOverride2?.left;
r24 = r35 === (left3 ?? 0);
}
if (r24) {
const right = contentInsetOverride?.right;
const r43 = right ?? 0;
const right2 = contentInsetOverride2?.right;
r24 = r43 === (right2 ?? 0);
}
const r48 = !r24;
state14.contentInsetOverride = contentInsetOverride2;
if (r48) {
(0, env10649[50])(r6);
}
(0, env10649[70])(r6, env27929[2].scroll, true, {
markHasScrolled: false
});
if (r48) {
(0, env10649[85])(r6);
}
},
scrollIndexIntoView: (c27906_0) => {
let env27907;
const r9 = () => {
let r2;
const r6 = env27929[9];
L8: {
const r15 = env27929[2];
r2 = false;
if (r15) {
const index3 = c27906_0.index;
const r17 = (0, env10649[3])(c27906_0, env10649[6]);
const { startNoBuffer, endNoBuffer } = r15;
if (!(index3 < startNoBuffer)) {
const r20 = index3 > endNoBuffer;
r2 = false;
if (!r20) {
break L8;
}
}
env10649[73](env27929[0], {
...r17,
index: index3,
viewPosition: index3 < startNoBuffer ? 0 : 1
});
r2 = true;
}
}
return r2;
};
const r10 = env27907 = {
$parent: env27929
};
env27907[0] = r9;
env27907[1] = $mk110505();
return new Promise($mk110506(r10));
},
scrollItemIntoView: ({ item: item3, ...rest }) => {
let c27908_1 = rest;
let env27909;
const r14 = () => {
let r2;
L9: {
const r7 = env27929[2];
const index4 = r7.props.data.indexOf(item3);
r2 = index4 !== -1;
if (r2) {
const r16 = env27929[9];
const r11 = {
index: index4,
...c27908_1
};
r2 = true;
if (r7) {
const index3 = r11.index;
const r24 = (0, env10649[3])(r11, env10649[6]);
const { startNoBuffer, endNoBuffer } = r7;
if (!(index3 < startNoBuffer)) {
const r27 = index3 > endNoBuffer;
r2 = true;
if (!r27) {
break L9;
}
}
env10649[73](env27929[0], {
...r24,
index: index3,
viewPosition: index3 < startNoBuffer ? 0 : 1
});
r2 = true;
}
}
}
return r2;
};
const r15 = env27909 = {
$parent: env27929
};
env27909[0] = r14;
env27909[1] = $mk110505();
return new Promise($mk110506(r15));
},
scrollToEnd: (options) => new Promise((a0) => {
const token = env27929[3] + 1;
env27929[3] = token;
const r5 = env27929[2];
r5.pendingScrollToEnd = void 0;
const pendingScrollResolve2 = r5.pendingScrollResolve;
if (pendingScrollResolve2 != null) {
pendingScrollResolve2.call(r5);
}
r5.pendingScrollResolve = a0;
r5.pendingScrollToEnd = {
options,
resolve: a0,
token
};
const r17 = env27929[1];
if (r17) {
r17();
} else {
const runPendingScrollToEnd = r5.runPendingScrollToEnd;
if (runPendingScrollToEnd != null) {
runPendingScrollToEnd.call(r5);
}
}
}),
scrollToIndex: (a0) => {
const r9 = env27929[8];
let r11 = a0.index >= 0 ? () => (0, env27929[5])(a0.index) : void 0;
let env27912;
const r13 = () => {
(0, env10649[73])(env27929[0], a0);
return true;
};
const r14 = env27912 = {
$parent: env27929
};
env27912[0] = r13;
if (r11 === void 0) {
r11 = $mk110505();
}
env27912[1] = r11;
return new Promise($mk110506(r14));
},
scrollToItem: ({ item: item4, ...rest }) => {
let c27913_1 = rest;
let env27914;
const r14 = () => {
const index3 = env27929[2].props.data.indexOf(item4);
let r1 = index3 !== -1;
if (r1) {
env10649[73](env27929[0], {
index: index3,
...c27913_1
});
r1 = true;
}
return r1;
};
const r15 = env27914 = {
$parent: env27929
};
env27914[0] = r14;
env27914[1] = $mk110505();
return new Promise($mk110506(r15));
},
scrollToOffset: (c27915_0) => {
let env27916;
const r9 = () => {
(0, env10649[72])(env27929[0], c27915_0);
return true;
};
const r10 = env27916 = {
$parent: env27929
};
env27916[0] = r9;
env27916[1] = $mk110505();
return new Promise($mk110506(r10));
},
setItemSize: (a0, a1) => {
(0, env10649[107])(env27929[0], [{
itemKey: a0,
size: a1
}]);
},
setScrollProcessingEnabled: (a0) => {
env27929[2].scrollProcessingEnabled = a0;
},
setVisibleContentAnchorOffset: (a0) => {
(0, env10649[22])(env27929[0], "scrollAdjustUserOffset", typeof a0 === "function" ? a0(env27929[0].values.get("scrollAdjustUserOffset") || 0) : a0);
}
};
}, []);
r31.useEffect(() => () => {
if (current3.queuedFullDrawDistancePrewarm !== void 0) {
cancelAnimationFrame(current3.queuedFullDrawDistancePrewarm);
current3.queuedFullDrawDistancePrewarm = void 0;
}
for (const timeout of current3.timeouts) {
clearTimeout(timeout);
}
current3.timeouts.clear();
}, [current3]);
r31.useLayoutEffect(() => {
const runPendingScrollToEnd = current3.runPendingScrollToEnd;
if (runPendingScrollToEnd != null) {
runPendingScrollToEnd.call(current3);
}
});
r31.useEffect(() => {}, [context9, r221]);
const memo6 = r31.useMemo(() => ({
getRenderedItem: (a0) => {
const state14 = context9.state;
let r13 = null;
if (state14) {
const { indexByKey: indexByKey2, props } = state14;
const { data: data3, getItemType, renderItem: renderItem2 } = props;
const index3 = indexByKey2.get(a0);
r13 = null;
if (index3 !== void 0) {
const extraData2 = context9.values.get("extraData");
const item5 = data3[index3];
const r21 = renderItem2 && !(item5 == null);
let renderedItem = null;
if (r21) {
let type = "";
if (getItemType) {
const r25 = getItemType(item5, index3);
type = r25 ?? "";
}
renderedItem = renderItem2({
data: data3,
extraData: extraData2,
index: index3,
item: item5,
type
});
}
r13 = {
index: index3,
item: data3[index3],
renderedItem
};
}
}
return r13;
},
onMomentumScrollEnd: (a0) => {
(0, env10649[63])(context9);
if (current3.props.onMomentumScrollEnd) {
current3.props.onMomentumScrollEnd(a0);
}
},
onScroll: (a0) => {
let r74;
L142: {
const state14 = context9.state;
if (state14.scrollProcessingEnabled !== false) {
const nativeEvent = a0.nativeEvent;
const contentSize = nativeEvent?.contentSize;
if (contentSize?.height === 0) {
const contentSize2 = a0.nativeEvent.contentSize;
if (contentSize2?.width === 0) {
break L142;
}
}
const nativeEvent2 = a0.nativeEvent;
const contentInset = nativeEvent2?.contentInset;
let r41 = false;
if (contentInset) {
const contentInset2 = a0.nativeEvent.contentInset;
const nativeContentInset = state14.nativeContentInset;
const r44 = nativeContentInset && nativeContentInset.top === contentInset2.top && nativeContentInset.bottom === contentInset2.bottom && nativeContentInset.left === contentInset2.left && nativeContentInset.right === contentInset2.right;
r41 = false;
if (!r44) {
state14.nativeContentInset = contentInset2;
r41 = true;
}
}
const contentOffset = a0.nativeEvent.contentOffset;
const r55 = state14.props.horizontal ? "x" : "y";
const r56 = env10649;
const r57 = contentOffset[r55];
const horizontal6 = state14.props.horizontal;
let lastNativeScroll = r57;
if (horizontal6) {
const contentSize3 = a0.nativeEvent.contentSize;
const width2 = contentSize3?.width;
const props = state14?.props;
let r67 = !!props?.horizontal;
if (r67) {
let r69 = props?.rtl;
if (r69 == null) {
r69 = !!env10649[11].I18nManager.isRTL;
}
r67 = r69;
}
if (r67) {
const r20 = width2 !== void 0 && (Number.isFinite(width2) && (Number.isFinite(state14.scrollLength) && !(width2 <= state14.scrollLength))) ? Math.max(0, width2 - state14.scrollLength) : width2 !== void 0 ? Number.isFinite(width2) ? Number.isFinite(state14.scrollLength) ? 0 : void 0 : void 0 : void 0;
if (r57 < 0) {
state14.horizontalRTLScrollType = "negative";
const r138 = -r57;
r74 = r20 !== void 0 ? Math.max(0, Math.min(r20, r138)) : r138;
} else {
const r95 = r20 === void 0;
r74 = r57;
if (!r95) {
const r21 = r20 - r57;
if (Number.isFinite(r21)) {
const horizontalRTLScrollType = state14.horizontalRTLScrollType;
if (horizontalRTLScrollType === "inverted") {
r74 = r95 ? r21 : Math.max(0, Math.min(r20, r21));
} else {
let horizontalRTLScrollType2 = "normal";
if (horizontalRTLScrollType === "normal") {
r74 = r95 ? r57 : Math.max(0, Math.min(r20, r57));
} else if (state14.hasScrolled) {
const scroll2 = state14.scroll;
const r112 = Math.abs(r57 - scroll2);
const r7 = Math.abs(r21 - scroll2) + 0.5 < r112;
if (r7) {
horizontalRTLScrollType2 = "inverted";
}
state14.horizontalRTLScrollType = horizontalRTLScrollType2;
const r118 = r7 ? r21 : r57;
r74 = r95 ? r118 : Math.max(0, Math.min(r20, r118));
} else {
state14.horizontalRTLScrollType = "inverted";
r74 = r95 ? r21 : Math.max(0, Math.min(r20, r21));
}
}
} else {
state14.horizontalRTLScrollType = "normal";
r74 = r57;
}
}
}
} else {
state14.horizontalRTLScrollType = void 0;
r74 = r57;
}
lastNativeScroll = r74;
}
let didFinishInitialScroll = state14.didFinishInitialScroll;
if (didFinishInitialScroll) {
const initialScroll2 = state14.initialScroll;
didFinishInitialScroll = initialScroll2?.viewPosition === 1;
}
if (didFinishInitialScroll) {
didFinishInitialScroll = state14.scroll > state14.scrollLength;
}
if (r41 && lastNativeScroll < 0 && didFinishInitialScroll) {
break L142;
}
state14.lastNativeScroll = lastNativeScroll;
state14.lastNativeScrollTime = Date.now();
if (state14.scrollingTo && state14.scrollingTo.offset >= lastNativeScroll) {
const scrollingTo2 = state14.scrollingTo;
const state15 = context9.state;
const r163 = (0, env10649[25])(context9);
const isFinite2 = Number.isFinite(r163);
let r167 = lastNativeScroll;
if (isFinite2) {
const isFinite3 = Number.isFinite(state15.scrollLength);
r167 = lastNativeScroll;
if (isFinite3) {
const lastLayout = state15.lastLayout;
r167 = lastNativeScroll;
if (lastLayout) {
const r177 = Math.max(0, r163 - state15.scrollLength);
const viewOffset = scrollingTo2?.viewOffset;
r167 = Math.min(lastNativeScroll, r177 + (typeof viewOffset === "number" ? viewOffset < 0 ? -viewOffset : 0 : 0));
}
}
}
const offset = Math.max(0, r167);
if (lastNativeScroll !== offset && Math.abs(lastNativeScroll - offset) > 1) {
(0, env10649[72])(context9, {
forceScroll: true,
isInitialScroll: true,
noScrollingTo: true,
offset
});
break L142;
}
}
state14.scrollPending = lastNativeScroll;
(0, env10649[70])(context9, lastNativeScroll, r41, {
fromNativeScrollEvent: true
});
const r197 = c10649_37.get(state14);
if (r197 && c10649_37.didReachTarget(lastNativeScroll, r197)) {
c10649_37.clear(state14);
} else if (r197) {
state14.hasScrolled = false;
c10649_37.set(state14, {
startScroll: r197.startScroll,
targetOffset: r197.targetOffset
});
}
const state16 = context9.state;
const { initialScroll: initialScroll3, didFinishInitialScroll: didFinishInitialScroll2 } = state16;
let r210 = !didFinishInitialScroll2;
if (didFinishInitialScroll2) {
const scrollingTo3 = state16.scrollingTo;
r210 = scrollingTo3?.isInitialScroll;
}
if (!r210) {
r210 = initialScroll3?.viewPosition !== 1;
}
if (!r210) {
r210 = state16.preservedEndAnchorCorrection;
}
if (!r210 && (0, env10649[82])(context9, initialScroll3)) {
let r219 = initialScroll3 ? initialScroll3.viewPosition !== 1 : !initialScroll3;
if (!r219) {
const r225 = !!initialScroll3?.preserveForBottomPadding;
r219 = r225 ? !r225 : !!!initialScroll3?.preserveForFooterLayout;
}
if (!(!r219 && context9.values.get("isAtEnd"))) {
if (initialScroll3?.preserveForFooterLayout) {
const r245 = env10649[81];
const stylePaddingBottom2 = state16.props.stylePaddingBottom;
r245(context9, {
dataLength: state16.props.data.length,
stylePaddingBottom: stylePaddingBottom2 ?? 0,
target: initialScroll3
});
} else {
if (state16.timeoutPreservedInitialScrollClear !== void 0) {
clearTimeout(state16.timeoutPreservedInitialScrollClear);
state16.timeoutPreservedInitialScrollClear = void 0;
}
state16.clearPreservedInitialScrollOnNextFinish = void 0;
state16.initialScroll = void 0;
(0, env10649[38])(state16);
}
}
}
if (state14.scrollingTo) {
let env30832;
const r256 = env30832 = {
$parent: r56
};
env30832[0] = context9;
context9.state.scrollingTo;
context9.state.animFrameCheckFinishedScroll = requestAnimationFrame($mk95167(r256));
}
if (state14.props.onScroll) {
state14.props.onScroll(a0);
}
}
}
},
onScrollBeginDrag: (a0) => {
if (context9.state.edgeReachedGate) {
context9.state.edgeReachedGate = "prepared";
}
const props = current3.props;
const onScrollBeginDrag2 = props.onScrollBeginDrag;
if (onScrollBeginDrag2 != null) {
onScrollBeginDrag2.call(props, a0);
}
},
onScrollEnd: () => {
if (context9.state.edgeReachedGate) {
context9.state.edgeReachedGate = "prepared";
}
}
}), []);
const onScroll5 = memo6.onScroll;
stickyHeaderIndices2 = stickyHeaderIndices;
horizontal5 = horizontal4;
context10 = context9;
onScroll3 = onScroll5;
c21609_4 = void 0;
const r703 = !context9.state.props.stickyPositionComponentInternal;
c21609_4 = r703;
const memo7 = r490.useMemo(() => {
if ((stickyHeaderIndices2 == null ? void 0 : stickyHeaderIndices2.length) && c21609_4) {
const animatedScrollY2 = context10.animatedScrollY;
const Animated = env10649[11].Animated;
const r7 = horizontal5 ? "x" : "y";
const contentOffset = {};
contentOffset[r7] = animatedScrollY2;
return Animated.event([{
nativeEvent: {
contentOffset
}
}], {
listener: onScroll3,
useNativeDriver: true
});
}
return onScroll3;
}, [stickyHeaderIndices == null ? void 0 : stickyHeaderIndices.join(","), horizontal4, r703]);
const Fragment = r251.Fragment;
const ListEmptyComponent2 = data3.length === 0 ? ListEmptyComponent : void 0;
if (refreshControl) {
let r733 = refreshControl;
if (stylePaddingTop > 0) {
const progressViewOffset2 = refreshControl.props.progressViewOffset;
r733 = r251.cloneElement(refreshControl, {
progressViewOffset: (progressViewOffset2 ?? 0) + stylePaddingTop
});
}
refreshControl2 = r733;
} else {
refreshControl2 = onRefresh;
if (refreshControl2) {
const RefreshControl = env10649[11].RefreshControl;
if (!progressViewOffset) {
progressViewOffset = 0;
}
refreshControl2 = r251.createElement(RefreshControl, {
onRefresh,
progressViewOffset: progressViewOffset + stylePaddingTop,
refreshing: !!refreshing
});
}
}
const current5 = ref5.current;
const element = r251.createElement(c10649_131, {
...r50,
alignItemsAtEnd: alignItemsAtEnd2,
canRender,
contentContainerStyle: contentContainerStyle2,
contentInset,
getRenderedItem: memo6.getRenderedItem,
horizontal: horizontal4,
initialContentOffset: memo4,
ListEmptyComponent: ListEmptyComponent2,
ListFooterComponent: ListFooterComponent2,
ListFooterComponentStyle,
ListHeaderComponent: ListHeaderComponent2,
onInternalScrollBeginDrag: memo6.onScrollBeginDrag,
onInternalScrollEnd: memo6.onScrollEnd,
onLayout: callback7,
onLayoutFooter: callback6,
onMomentumScrollEnd: memo6.onMomentumScrollEnd,
onScroll: memo7,
recycleItems: recycleItems2,
refreshControl: refreshControl2,
refScrollView: combinedRef,
renderScrollComponent: renderScrollComponent2,
scrollAdjustHandler: current5?.scrollAdjustHandler,
scrollEventThrottle: 0,
snapToIndices,
stickyHeaderIndices,
style: style3,
useWindowScroll: false
});
if (r595) {
r595 = c10649_34;
}
return r251.createElement(Fragment, null, element, r595);
});
const r268 = {
getComponent,
getStickyPushLimit,
IsNewArchitecture,
POSITION_OUT_OF_VIEW: -10000000,
peek$,
typedForwardRef: forwardRef,
typedMemo: memo5,
useArr$,
useCombinedRef,
useLatestRef,
useStableRenderComponent,
useStateContext
};
export { r265 as LegendList };
export { r268 as internal };
export function useAdaptiveRender() {
let env21610;
const r4 = ["adaptiveRender"];
const r3 = env21610 = {
$parent: env10649
};
const r6 = env10649[12];
const context18 = r6.useContext(c10649_17);
env21610[0] = context18;
const r12 = r4.length === 1 ? r4[0] : r4.join("\x00");
env21610[1] = r12;
const memo5 = r6.useMemo($mk95160(r3), [context18, r12]);
const { subscribe: subscribe2, get: get3 } = memo5;
return (0, env10649[4])((0, env10649[0])(env10649[1][6]).useSyncExternalStore(subscribe2, get3, get3), 1)[0];
}
export function useAdaptiveRenderChange(a0) {
const context11 = env10649[12].useContext(c10649_17);
const r8 = env10649[10];
const ref10 = r8.useRef(a0);
ref10.current = a0;
r8.useLayoutEffect(() => {
let env27931;
let c27930_0 = context11.values.get("adaptiveRender");
const r13 = (a0) => {
if (c27930_0 !== a0) {
c27930_0 = a0;
ref10.current(a0);
}
};
const r14 = env27931 = {};
env27931[0] = r13;
env27931[1] = void 0;
const listeners = context11.listeners;
const r16 = listeners.get("adaptiveRender");
env27931[1] = r16;
let r17 = r16;
if (!r17) {
const set2 = new Set();
env27931[1] = set2;
listeners.set("adaptiveRender", set2);
r17 = set2;
}
r17.add(r13);
return $mk95159(r14);
}, [context11]);
}
export { useIsLastItem };
export function useListScrollSize() {
let env21612;
const r4 = ["scrollSize"];
const r3 = env21612 = {
$parent: env10649
};
const r6 = env10649[12];
const context18 = r6.useContext(c10649_17);
env21612[0] = context18;
const r12 = r4.length === 1 ? r4[0] : r4.join("\x00");
env21612[1] = r12;
const memo5 = r6.useMemo($mk95160(r3), [context18, r12]);
const { subscribe: subscribe2, get: get3 } = memo5;
return (0, env10649[4])((0, env10649[0])(env10649[1][6]).useSyncExternalStore(subscribe2, get3, get3), 1)[0];
}
export function useRecyclingEffect(a0) {
const r4 = env10649[116];
const r5 = env10649[10];
const r13 = r4(r5.useContext(c10649_115));
const { hasItemInfo, item, itemIndex, itemKey: itemKey4 } = r13;
const ref11 = r5.useRef(void 0);
r5.useEffect(() => {
if (hasItemInfo) {
const r7 = ref11.current ? a0({
index: itemIndex,
item,
prevIndex: ref11.current.index,
prevItem: ref11.current.item
}) : void 0;
ref11.current = {
index: itemIndex,
item
};
return r7;
}
}, [a0, hasItemInfo, itemIndex, item, itemKey4]);
}
export function useRecyclingState(a0) {
let setState3, triggerLayout;
const r8 = env10649[10];
const context18 = r8.useContext(c10649_115);
const r19 = (0, env10649[116])(context18);
const { hasItemInfo: hasItemInfo2, item: item2, itemIndex: itemIndex2, itemKey: itemKey4 } = r19;
const computeValue2 = () => {};
const r25 = (0, env10649[4])(r8.useState(() => {
let r9 = a0;
if (typeof r9 === "function") {
r9 = hasItemInfo2 ? a0({
index: itemIndex2,
item: item2,
prevIndex: void 0,
prevItem: void 0
}) : a0();
}
return r9;
}), 2);
const r26 = r25[0];
setState3 = r25[1];
const ref12 = r8.useRef(hasItemInfo2 ? itemKey4 : null);
if (hasItemInfo2 ? ref12.current !== itemKey4 : hasItemInfo2) {
ref12.current = itemKey4;
setState3(typeof a0 === "function" ? hasItemInfo2 ? a0({
index: itemIndex2,
item: item2,
prevIndex: void 0,
prevItem: void 0
}) : a0() : a0);
}
triggerLayout = context18?.triggerLayout;
return [r26, r8.useCallback((c27932_0) => {
if (triggerLayout) {
setState3((prevState3) => {
let r4 = c27932_0;
if (typeof r4 === "function") {
r4 = c27932_0(prevState3);
}
return r4;
});
triggerLayout();
}
}, [triggerLayout])];
}
export function useSyncLayout() {
const context18 = env10649[10].useContext(c10649_115);
return c10649_27 && context18 ? context18.triggerLayout : noop;
}
export function useViewability(a0, a1) {
let env21616;
const context12 = env10649[12].useContext(c10649_17);
const r9 = env10649[10];
const context13 = r9.useContext(c10649_115);
const r13 = env21616 = {};
env21616[0] = () => {
if (context13) {
const containerId3 = context13.containerId;
const r11 = context12.mapViewabilityValues.get(containerId3 + (a1 ?? ""));
if (r11) {
a0(r11);
}
}
};
r9.useState($mk95184(r13));
r9.useEffect(() => {
if (context13) {
const containerId3 = context13.containerId;
const r3 = a1 ?? "";
const r5 = containerId3 + r3;
let c27933_0 = r5;
context12.mapViewabilityCallbacks.set(r5, a0);
return () => {
context12.mapViewabilityCallbacks.delete(c27933_0);
};
}
}, [context12, a0, a1, context13]);
}
export function useViewabilityAmount(a0) {
let env21618;
const context14 = env10649[12].useContext(c10649_17);
const r8 = env10649[10];
const context15 = r8.useContext(c10649_115);
const r12 = env21618 = {};
env21618[0] = () => {
if (context15) {
const r7 = context14.mapViewabilityAmountValues.get(context15.containerId);
if (r7) {
a0(r7);
}
}
};
r8.useState($mk95184(r12));
r8.useEffect(() => {
if (context15) {
const containerId2 = context15.containerId;
context14.mapViewabilityAmountCallbacks.set(containerId2, a0);
return () => {
context14.mapViewabilityAmountCallbacks.delete(containerId2);
};
}
}, [context14, a0, context15]);
}