Skip to content

Instantly share code, notes, and snippets.

@lostintangent
Last active March 3, 2021 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lostintangent/6de9be49a0f112dd36eff3b8bc771b9e to your computer and use it in GitHub Desktop.
Save lostintangent/6de9be49a0f112dd36eff3b8bc771b9e to your computer and use it in GitHub Desktop.
React Native Web (Fork)
import ExecutionEnvironment2 from "https://cdn.skypack.dev/fbjs/lib/ExecutionEnvironment.js";
import normalizeColor$1 from "https://cdn.skypack.dev/normalize-css-color";
import hyphenateStyleName from "https://cdn.skypack.dev/hyphenate-style-name";
import createPrefixer2 from "https://cdn.skypack.dev/inline-style-prefixer/lib/createPrefixer.js";
import backgroundClip2 from "https://cdn.skypack.dev/inline-style-prefixer/lib/plugins/backgroundClip.js";
import crossFade2 from "https://cdn.skypack.dev/inline-style-prefixer/lib/plugins/crossFade.js";
import cursor2 from "https://cdn.skypack.dev/inline-style-prefixer/lib/plugins/cursor.js";
import filter2 from "https://cdn.skypack.dev/inline-style-prefixer/lib/plugins/filter.js";
import flex2 from "https://cdn.skypack.dev/inline-style-prefixer/lib/plugins/flex.js";
import flexboxIE2 from "https://cdn.skypack.dev/inline-style-prefixer/lib/plugins/flexboxIE.js";
import flexboxOld2 from "https://cdn.skypack.dev/inline-style-prefixer/lib/plugins/flexboxOld.js";
import gradient2 from "https://cdn.skypack.dev/inline-style-prefixer/lib/plugins/gradient.js";
import grid2 from "https://cdn.skypack.dev/inline-style-prefixer/lib/plugins/grid.js";
import imageSet2 from "https://cdn.skypack.dev/inline-style-prefixer/lib/plugins/imageSet.js";
import logical2 from "https://cdn.skypack.dev/inline-style-prefixer/lib/plugins/logical.js";
import position2 from "https://cdn.skypack.dev/inline-style-prefixer/lib/plugins/position.js";
import sizing2 from "https://cdn.skypack.dev/inline-style-prefixer/lib/plugins/sizing.js";
import transition2 from "https://cdn.skypack.dev/inline-style-prefixer/lib/plugins/transition.js";
const React__default = React;
const {useLayoutEffect} = React__default;
const {useEffect} = React__default;
const {useMemo} = React__default;
const {useRef} = React__default;
const {useDebugValue} = React__default;
const {createContext} = React__default;
const {forwardRef} = React__default;
const {useContext} = React__default;
const {createElement: createElement$1} = React__default;
const {isValidElement} = React__default;
const {cloneElement} = React__default;
const {PureComponent} = React__default;
const {Component} = React__default;
const {Fragment} = React__default;
const {useState} = React__default;
const {memo} = React__default;
const {useCallback} = React__default;
const {Children} = React__default;
;
const {findDOMNode} = ReactDOM;
const {hydrate} = ReactDOM;
const {render} = ReactDOM;
const {unmountComponentAtNode} = ReactDOM;
;
import __commonjs_module0 from "https://cdn.skypack.dev/react-dom";
const __commonjs_module0_render = __commonjs_module0 ? __commonjs_module0.render : __commonjs_module0;
const __commonjs_module0_unmountComponentAtNode = __commonjs_module0 ? __commonjs_module0.unmountComponentAtNode : __commonjs_module0;
export {__commonjs_module0_render as render, __commonjs_module0_unmountComponentAtNode as unmountComponentAtNode};
;
import performanceNow2 from "https://cdn.skypack.dev/fbjs/lib/performanceNow.js";
import PropTypes from "https://cdn.skypack.dev/prop-types";
import createReactClass from "https://cdn.skypack.dev/create-react-class";
import findIndex from "https://cdn.skypack.dev/array-find-index";
const { canUseDOM } = ExecutionEnvironment2;
function invariant2(condition, format) {
}
function warning2() {
}
var buttonLikeRoles = {
button: true,
menuitem: true
};
var isDisabled = function isDisabled2(props) {
return props.disabled || Array.isArray(props.accessibilityStates) && props.accessibilityStates.indexOf("disabled") > -1;
};
var accessibilityRoleToWebRole = {
adjustable: "slider",
button: "button",
header: "heading",
image: "img",
imagebutton: null,
keyboardkey: null,
label: null,
link: "link",
none: "presentation",
search: "search",
summary: "region",
text: null
};
var propsToAriaRole = function propsToAriaRole2(_ref) {
var accessibilityRole = _ref.accessibilityRole;
if (accessibilityRole) {
var inferredRole = accessibilityRoleToWebRole[accessibilityRole];
if (inferredRole !== null) {
return inferredRole || accessibilityRole;
}
}
};
var roleComponents = {
article: "article",
banner: "header",
blockquote: "blockquote",
code: "code",
complementary: "aside",
contentinfo: "footer",
deletion: "del",
emphasis: "em",
figure: "figure",
insertion: "ins",
form: "form",
link: "a",
list: "ul",
listitem: "li",
main: "main",
navigation: "nav",
region: "section",
strong: "strong"
};
var emptyObject = {};
var propsToAccessibilityComponent = function propsToAccessibilityComponent2(props) {
if (props === void 0) {
props = emptyObject;
}
if (props.accessibilityRole === "label") {
return "label";
}
if (props.href != null) {
return "a";
}
var role = propsToAriaRole(props);
if (role) {
if (role === "heading") {
var level = props["aria-level"];
if (level != null) {
return "h" + level;
}
return "h1";
}
return roleComponents[role];
}
};
var AccessibilityUtil = {
buttonLikeRoles,
isDisabled,
propsToAccessibilityComponent,
propsToAriaRole
};
function createCSSStyleSheet(id2) {
if (canUseDOM) {
var element = document.getElementById(id2);
if (element != null) {
return element.sheet;
} else {
var _element = document.createElement("style");
_element.setAttribute("id", id2);
var head = document.head;
if (head) {
head.insertBefore(_element, head.firstChild);
}
return _element.sheet;
}
} else {
return null;
}
}
var unitlessNumbers = {
animationIterationCount: true,
borderImageOutset: true,
borderImageSlice: true,
borderImageWidth: true,
boxFlex: true,
boxFlexGroup: true,
boxOrdinalGroup: true,
columnCount: true,
flex: true,
flexGrow: true,
flexOrder: true,
flexPositive: true,
flexShrink: true,
flexNegative: true,
fontWeight: true,
gridRow: true,
gridRowEnd: true,
gridRowGap: true,
gridRowStart: true,
gridColumn: true,
gridColumnEnd: true,
gridColumnGap: true,
gridColumnStart: true,
lineClamp: true,
opacity: true,
order: true,
orphans: true,
tabSize: true,
widows: true,
zIndex: true,
zoom: true,
fillOpacity: true,
floodOpacity: true,
stopOpacity: true,
strokeDasharray: true,
strokeDashoffset: true,
strokeMiterlimit: true,
strokeOpacity: true,
strokeWidth: true,
scale: true,
scaleX: true,
scaleY: true,
scaleZ: true,
shadowOpacity: true
};
var prefixes = ["ms", "Moz", "O", "Webkit"];
var prefixKey = function prefixKey2(prefix2, key) {
return prefix2 + key.charAt(0).toUpperCase() + key.substring(1);
};
Object.keys(unitlessNumbers).forEach(function(prop) {
prefixes.forEach(function(prefix2) {
unitlessNumbers[prefixKey(prefix2, prop)] = unitlessNumbers[prop];
});
});
var isWebColor = function isWebColor2(color) {
return color === "currentcolor" || color === "currentColor" || color === "inherit" || color.indexOf("var(") === 0;
};
var processColor = function processColor2(color) {
if (color === void 0 || color === null) {
return color;
}
var int32Color = normalizeColor$1(color);
if (int32Color === void 0 || int32Color === null) {
return void 0;
}
int32Color = (int32Color << 24 | int32Color >>> 8) >>> 0;
return int32Color;
};
var normalizeColor = function normalizeColor2(color, opacity) {
if (opacity === void 0) {
opacity = 1;
}
if (color == null)
return;
if (typeof color === "string" && isWebColor(color)) {
return color;
}
var colorInt = processColor(color);
if (colorInt != null) {
var r = colorInt >> 16 & 255;
var g = colorInt >> 8 & 255;
var b = colorInt & 255;
var a = (colorInt >> 24 & 255) / 255;
var alpha = (a * opacity).toFixed(2);
return "rgba(" + r + "," + g + "," + b + "," + alpha + ")";
}
};
var colorProps = {
backgroundColor: true,
borderColor: true,
borderTopColor: true,
borderRightColor: true,
borderBottomColor: true,
borderLeftColor: true,
color: true,
shadowColor: true,
textDecorationColor: true,
textShadowColor: true
};
function normalizeValueWithProperty(value, property) {
var returnValue = value;
if ((property == null || !unitlessNumbers[property]) && typeof value === "number") {
returnValue = value + "px";
} else if (property != null && colorProps[property]) {
returnValue = normalizeColor(value);
}
return returnValue;
}
var defaultOffset = {
height: 0,
width: 0
};
var resolveShadowValue = function resolveShadowValue2(style) {
var shadowColor = style.shadowColor, shadowOffset = style.shadowOffset, shadowOpacity = style.shadowOpacity, shadowRadius = style.shadowRadius;
var _ref = shadowOffset || defaultOffset, height = _ref.height, width = _ref.width;
var offsetX = normalizeValueWithProperty(width);
var offsetY = normalizeValueWithProperty(height);
var blurRadius = normalizeValueWithProperty(shadowRadius || 0);
var color = normalizeColor(shadowColor || "black", shadowOpacity);
if (color != null && offsetX != null && offsetY != null && blurRadius != null) {
return offsetX + " " + offsetY + " " + blurRadius + " " + color;
}
};
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null)
return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0)
continue;
target[key] = source[key];
}
return target;
}
var defaultOffset$1 = {
height: 0,
width: 0
};
function boxShadowReducer(resolvedStyle, style) {
var boxShadow = style.boxShadow;
var shadow = resolveShadowValue(style);
if (shadow != null) {
resolvedStyle.boxShadow = boxShadow ? boxShadow + ", " + shadow : shadow;
}
}
function textShadowReducer(resolvedStyle, style) {
var textShadowColor = style.textShadowColor, textShadowOffset = style.textShadowOffset, textShadowRadius = style.textShadowRadius;
var _ref = textShadowOffset || defaultOffset$1, height = _ref.height, width = _ref.width;
var radius = textShadowRadius || 0;
var offsetX = normalizeValueWithProperty(width);
var offsetY = normalizeValueWithProperty(height);
var blurRadius = normalizeValueWithProperty(radius);
var color = normalizeValueWithProperty(textShadowColor, "textShadowColor");
if (color && (height !== 0 || width !== 0 || radius !== 0) && offsetX != null && offsetY != null && blurRadius != null) {
resolvedStyle.textShadow = offsetX + " " + offsetY + " " + blurRadius + " " + color;
}
}
var createCompileableStyle = function createCompileableStyle2(styles2) {
var shadowColor = styles2.shadowColor, shadowOffset = styles2.shadowOffset, shadowOpacity = styles2.shadowOpacity, shadowRadius = styles2.shadowRadius, textShadowColor = styles2.textShadowColor, textShadowOffset = styles2.textShadowOffset, textShadowRadius = styles2.textShadowRadius, nextStyles = _objectWithoutPropertiesLoose(styles2, ["shadowColor", "shadowOffset", "shadowOpacity", "shadowRadius", "textShadowColor", "textShadowOffset", "textShadowRadius"]);
if (shadowColor != null || shadowOffset != null || shadowOpacity != null || shadowRadius != null) {
boxShadowReducer(nextStyles, styles2);
}
if (textShadowColor != null || textShadowOffset != null || textShadowRadius != null) {
textShadowReducer(nextStyles, styles2);
}
return nextStyles;
};
var slice = Array.prototype.slice;
function createOrderedCSSStyleSheet(sheet) {
var groups = {};
var selectors = {};
if (sheet != null) {
var group;
slice.call(sheet.cssRules).forEach(function(cssRule, i) {
var cssText = cssRule.cssText;
if (cssText.indexOf("stylesheet-group") > -1) {
group = decodeGroupRule(cssRule);
groups[group] = {
start: i,
rules: [cssText]
};
} else {
var selectorText = getSelectorText(cssText);
if (selectorText != null) {
selectors[selectorText] = true;
groups[group].rules.push(cssText);
}
}
});
}
function sheetInsert(sheet2, group2, text) {
var orderedGroups = getOrderedGroups(groups);
var groupIndex = orderedGroups.indexOf(group2);
var nextGroupIndex = groupIndex + 1;
var nextGroup = orderedGroups[nextGroupIndex];
var position3 = nextGroup != null && groups[nextGroup].start != null ? groups[nextGroup].start : sheet2.cssRules.length;
var isInserted = insertRuleAt(sheet2, text, position3);
if (isInserted) {
if (groups[group2].start == null) {
groups[group2].start = position3;
}
for (var i = nextGroupIndex; i < orderedGroups.length; i += 1) {
var groupNumber = orderedGroups[i];
var previousStart = groups[groupNumber].start;
groups[groupNumber].start = previousStart + 1;
}
}
return isInserted;
}
var OrderedCSSStyleSheet = {
getTextContent: function getTextContent() {
return getOrderedGroups(groups).map(function(group2) {
var rules = groups[group2].rules;
return rules.join("\n");
}).join("\n");
},
insert: function insert(cssText, groupValue) {
var group2 = Number(groupValue);
if (groups[group2] == null) {
var markerRule = encodeGroupRule(group2);
groups[group2] = {
start: null,
rules: [markerRule]
};
if (sheet != null) {
sheetInsert(sheet, group2, markerRule);
}
}
var selectorText = getSelectorText(cssText);
if (selectorText != null && selectors[selectorText] == null) {
selectors[selectorText] = true;
groups[group2].rules.push(cssText);
if (sheet != null) {
var isInserted = sheetInsert(sheet, group2, cssText);
if (!isInserted) {
groups[group2].rules.pop();
}
}
}
}
};
return OrderedCSSStyleSheet;
}
function encodeGroupRule(group) {
return '[stylesheet-group="' + group + '"]{}';
}
function decodeGroupRule(cssRule) {
return Number(cssRule.selectorText.split(/["']/)[1]);
}
function getOrderedGroups(obj) {
return Object.keys(obj).map(Number).sort(function(a, b) {
return a > b ? 1 : -1;
});
}
var pattern = /\s*([,])\s*/g;
function getSelectorText(cssText) {
var selector = cssText.split("{")[0].trim();
return selector !== "" ? selector.replace(pattern, "$1") : null;
}
function insertRuleAt(root, cssText, position3) {
try {
root.insertRule(cssText, position3);
return true;
} catch (e) {
return false;
}
}
function flattenArray(array) {
function flattenDown(array2, result) {
for (var i = 0; i < array2.length; i++) {
var value = array2[i];
if (Array.isArray(value)) {
flattenDown(value, result);
} else if (value != null && value !== false) {
result.push(value);
}
}
return result;
}
return flattenDown(array, []);
}
var emptyObject$1 = {};
var objects = {};
var prefix = "r";
var uniqueID = 1;
var createKey = function createKey2(id2) {
return prefix + "-" + id2;
};
var ReactNativePropRegistry = /* @__PURE__ */ function() {
function ReactNativePropRegistry2() {
}
ReactNativePropRegistry2.register = function register(object) {
var id2 = uniqueID++;
var key = createKey(id2);
objects[key] = object;
return id2;
};
ReactNativePropRegistry2.getByID = function getByID(id2) {
if (!id2) {
return emptyObject$1;
}
var key = createKey(id2);
var object = objects[key];
if (!object) {
console.warn("Invalid style with id `" + id2 + "`. Skipping ...");
return emptyObject$1;
}
return object;
};
return ReactNativePropRegistry2;
}();
function getStyle(style) {
if (typeof style === "number") {
return ReactNativePropRegistry.getByID(style);
}
return style;
}
function flattenStyle(style) {
if (!style) {
return void 0;
}
if (!Array.isArray(style)) {
return getStyle(style);
}
var result = {};
for (var i = 0, styleLength = style.length; i < styleLength; ++i) {
var computedStyle = flattenStyle(style[i]);
if (computedStyle) {
for (var key in computedStyle) {
var value = computedStyle[key];
result[key] = value;
}
}
}
return result;
}
var doLeftAndRightSwapInRTL = true;
var isPreferredLanguageRTL = false;
var isRTLAllowed = true;
var isRTLForced = false;
var isRTL = function isRTL2() {
if (isRTLForced) {
return true;
}
return isRTLAllowed && isPreferredLanguageRTL;
};
var onDirectionChange = function onDirectionChange2() {
if (ExecutionEnvironment2.canUseDOM) {
if (document.documentElement && document.documentElement.setAttribute) {
document.documentElement.setAttribute("dir", isRTL() ? "rtl" : "ltr");
}
}
};
var I18nManager = {
allowRTL: function allowRTL(bool) {
isRTLAllowed = bool;
onDirectionChange();
},
forceRTL: function forceRTL(bool) {
isRTLForced = bool;
onDirectionChange();
},
getConstants: function getConstants() {
return {
doLeftAndRightSwapInRTL,
isRTL: isRTL()
};
},
setPreferredLanguageRTL: function setPreferredLanguageRTL(bool) {
isPreferredLanguageRTL = bool;
onDirectionChange();
},
swapLeftAndRightInRTL: function swapLeftAndRightInRTL(bool) {
doLeftAndRightSwapInRTL = bool;
}
};
var CSS_UNIT_RE = /^[+-]?\d*(?:\.\d+)?(?:[Ee][+-]?\d+)?(%|\w*)/;
var getUnit = function getUnit2(str) {
return str.match(CSS_UNIT_RE)[1];
};
var isNumeric = function isNumeric2(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
};
var multiplyStyleLengthValue = function multiplyStyleLengthValue2(value, multiple) {
if (typeof value === "string") {
var number = parseFloat(value) * multiple;
var unit = getUnit(value);
return "" + number + unit;
} else if (isNumeric(value)) {
return value * multiple;
}
};
var emptyObject$2 = {};
var borderTopLeftRadius = "borderTopLeftRadius";
var borderTopRightRadius = "borderTopRightRadius";
var borderBottomLeftRadius = "borderBottomLeftRadius";
var borderBottomRightRadius = "borderBottomRightRadius";
var borderLeftColor = "borderLeftColor";
var borderLeftStyle = "borderLeftStyle";
var borderLeftWidth = "borderLeftWidth";
var borderRightColor = "borderRightColor";
var borderRightStyle = "borderRightStyle";
var borderRightWidth = "borderRightWidth";
var right = "right";
var marginLeft = "marginLeft";
var marginRight = "marginRight";
var paddingLeft = "paddingLeft";
var paddingRight = "paddingRight";
var left = "left";
var PROPERTIES_FLIP = {
borderTopLeftRadius: borderTopRightRadius,
borderTopRightRadius: borderTopLeftRadius,
borderBottomLeftRadius: borderBottomRightRadius,
borderBottomRightRadius: borderBottomLeftRadius,
borderLeftColor: borderRightColor,
borderLeftStyle: borderRightStyle,
borderLeftWidth: borderRightWidth,
borderRightColor: borderLeftColor,
borderRightStyle: borderLeftStyle,
borderRightWidth: borderLeftWidth,
left: right,
marginLeft: marginRight,
marginRight: marginLeft,
paddingLeft: paddingRight,
paddingRight: paddingLeft,
right: left
};
var PROPERTIES_I18N = {
borderTopStartRadius: borderTopLeftRadius,
borderTopEndRadius: borderTopRightRadius,
borderBottomStartRadius: borderBottomLeftRadius,
borderBottomEndRadius: borderBottomRightRadius,
borderStartColor: borderLeftColor,
borderStartStyle: borderLeftStyle,
borderStartWidth: borderLeftWidth,
borderEndColor: borderRightColor,
borderEndStyle: borderRightStyle,
borderEndWidth: borderRightWidth,
end: right,
marginStart: marginLeft,
marginEnd: marginRight,
paddingStart: paddingLeft,
paddingEnd: paddingRight,
start: left
};
var PROPERTIES_VALUE = {
clear: true,
float: true,
textAlign: true
};
var additiveInverse = function additiveInverse2(value) {
return multiplyStyleLengthValue(value, -1);
};
var i18nStyle = function i18nStyle2(originalStyle) {
var _I18nManager$getConst = I18nManager.getConstants(), doLeftAndRightSwapInRTL2 = _I18nManager$getConst.doLeftAndRightSwapInRTL, isRTL3 = _I18nManager$getConst.isRTL;
var style = originalStyle || emptyObject$2;
var frozenProps = {};
var nextStyle = {};
for (var originalProp in style) {
if (!Object.prototype.hasOwnProperty.call(style, originalProp)) {
continue;
}
var originalValue = style[originalProp];
var prop = originalProp;
var value = originalValue;
if (PROPERTIES_I18N.hasOwnProperty(originalProp)) {
var convertedProp = PROPERTIES_I18N[originalProp];
prop = isRTL3 ? PROPERTIES_FLIP[convertedProp] : convertedProp;
} else if (isRTL3 && doLeftAndRightSwapInRTL2 && PROPERTIES_FLIP[originalProp]) {
prop = PROPERTIES_FLIP[originalProp];
}
if (PROPERTIES_VALUE.hasOwnProperty(originalProp)) {
if (originalValue === "start") {
value = isRTL3 ? "right" : "left";
} else if (originalValue === "end") {
value = isRTL3 ? "left" : "right";
} else if (isRTL3 && doLeftAndRightSwapInRTL2) {
if (originalValue === "left") {
value = "right";
} else if (originalValue === "right") {
value = "left";
}
}
}
if (prop === "transitionProperty") {
if (PROPERTIES_I18N.hasOwnProperty(value)) {
var convertedValue = PROPERTIES_I18N[originalValue];
value = isRTL3 ? PROPERTIES_FLIP[convertedValue] : convertedValue;
} else if (isRTL3 && doLeftAndRightSwapInRTL2) {
var flippedValue = PROPERTIES_FLIP[originalValue];
if (flippedValue != null) {
value = flippedValue;
}
}
}
if (isRTL3 && prop === "textShadowOffset") {
var invertedValue = additiveInverse(value.width);
value.width = invertedValue;
nextStyle[prop] = value;
} else if (!frozenProps[prop]) {
nextStyle[prop] = value;
}
if (PROPERTIES_I18N[originalProp]) {
frozenProps[prop] = true;
}
}
return nextStyle;
};
var STYLE_ELEMENT_ID = "react-native-stylesheet";
var STYLE_GROUPS = {
reset: 0,
modality: 0.1,
classicReset: 0.5,
classic: 1,
atomic: 2.2,
custom: {
borderColor: 2,
borderRadius: 2,
borderStyle: 2,
borderWidth: 2,
display: 2,
flex: 2,
margin: 2,
overflow: 2,
overscrollBehavior: 2,
padding: 2,
marginHorizontal: 2.1,
marginVertical: 2.1,
paddingHorizontal: 2.1,
paddingVertical: 2.1
}
};
var STYLE_SHORT_FORM_EXPANSIONS = {
borderColor: ["borderTopColor", "borderRightColor", "borderBottomColor", "borderLeftColor"],
borderRadius: ["borderTopLeftRadius", "borderTopRightRadius", "borderBottomRightRadius", "borderBottomLeftRadius"],
borderStyle: ["borderTopStyle", "borderRightStyle", "borderBottomStyle", "borderLeftStyle"],
borderWidth: ["borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth"],
margin: ["marginTop", "marginRight", "marginBottom", "marginLeft"],
marginHorizontal: ["marginRight", "marginLeft"],
marginVertical: ["marginTop", "marginBottom"],
overflow: ["overflowX", "overflowY"],
overscrollBehavior: ["overscrollBehaviorX", "overscrollBehaviorY"],
padding: ["paddingTop", "paddingRight", "paddingBottom", "paddingLeft"],
paddingHorizontal: ["paddingRight", "paddingLeft"],
paddingVertical: ["paddingTop", "paddingBottom"]
};
var MONOSPACE_FONT_STACK = "monospace,monospace";
var SYSTEM_FONT_STACK = '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif';
var emptyObject$3 = {};
var supportsCSS3TextDecoration = !canUseDOM || window.CSS != null && window.CSS.supports != null && (window.CSS.supports("text-decoration-line", "none") || window.CSS.supports("-webkit-text-decoration-line", "none"));
var mapTransform = function mapTransform2(transform) {
var type = Object.keys(transform)[0];
var value = transform[type];
if (type === "matrix" || type === "matrix3d") {
return type + "(" + value.join(",") + ")";
} else {
var normalizedValue = normalizeValueWithProperty(value, type);
return type + "(" + normalizedValue + ")";
}
};
var resolveTransform = function resolveTransform2(resolvedStyle, style) {
var transform = style.transform;
if (Array.isArray(style.transform)) {
transform = style.transform.map(mapTransform).join(" ");
}
resolvedStyle.transform = transform;
};
var createReactDOMStyle = function createReactDOMStyle2(style) {
if (!style) {
return emptyObject$3;
}
var resolvedStyle = {};
Object.keys(style).sort().forEach(function(prop) {
var value = normalizeValueWithProperty(style[prop], prop);
if (value == null) {
return;
}
switch (prop) {
case "elevation":
case "overlayColor":
case "resizeMode":
case "tintColor": {
break;
}
case "backgroundClip": {
if (value === "text") {
resolvedStyle.backgroundClip = value;
resolvedStyle.WebkitBackgroundClip = value;
}
break;
}
case "flex": {
if (value === -1) {
resolvedStyle.flexGrow = 0;
resolvedStyle.flexShrink = 1;
resolvedStyle.flexBasis = "auto";
} else {
resolvedStyle.flex = value;
}
break;
}
case "font": {
resolvedStyle[prop] = value.replace("System", SYSTEM_FONT_STACK);
break;
}
case "fontFamily": {
if (value.indexOf("System") > -1) {
var stack = value.split(/,\s*/);
stack[stack.indexOf("System")] = SYSTEM_FONT_STACK;
resolvedStyle[prop] = stack.join(",");
} else if (value === "monospace") {
resolvedStyle[prop] = MONOSPACE_FONT_STACK;
} else {
resolvedStyle[prop] = value;
}
break;
}
case "fontVariant": {
if (Array.isArray(value) && value.length > 0) {
resolvedStyle.fontVariant = value.join(" ");
}
break;
}
case "textAlignVertical": {
resolvedStyle.verticalAlign = value === "center" ? "middle" : value;
break;
}
case "textDecorationLine": {
if (!supportsCSS3TextDecoration) {
resolvedStyle.textDecoration = value;
} else {
resolvedStyle.textDecorationLine = value;
}
break;
}
case "transform":
case "transformMatrix": {
resolveTransform(resolvedStyle, style);
break;
}
case "writingDirection": {
resolvedStyle.direction = value;
break;
}
default: {
var longFormProperties = STYLE_SHORT_FORM_EXPANSIONS[prop];
if (longFormProperties) {
longFormProperties.forEach(function(longForm, i) {
if (typeof style[longForm] === "undefined") {
resolvedStyle[longForm] = value;
}
});
} else {
resolvedStyle[prop] = Array.isArray(value) ? value.join(",") : value;
}
}
}
});
return resolvedStyle;
};
function murmurhash2_32_gc(str, seed) {
var l = str.length, h = seed ^ l, i = 0, k;
while (l >= 4) {
k = str.charCodeAt(i) & 255 | (str.charCodeAt(++i) & 255) << 8 | (str.charCodeAt(++i) & 255) << 16 | (str.charCodeAt(++i) & 255) << 24;
k = (k & 65535) * 1540483477 + (((k >>> 16) * 1540483477 & 65535) << 16);
k ^= k >>> 24;
k = (k & 65535) * 1540483477 + (((k >>> 16) * 1540483477 & 65535) << 16);
h = (h & 65535) * 1540483477 + (((h >>> 16) * 1540483477 & 65535) << 16) ^ k;
l -= 4;
++i;
}
switch (l) {
case 3:
h ^= (str.charCodeAt(i + 2) & 255) << 16;
case 2:
h ^= (str.charCodeAt(i + 1) & 255) << 8;
case 1:
h ^= str.charCodeAt(i) & 255;
h = (h & 65535) * 1540483477 + (((h >>> 16) * 1540483477 & 65535) << 16);
}
h ^= h >>> 13;
h = (h & 65535) * 1540483477 + (((h >>> 16) * 1540483477 & 65535) << 16);
h ^= h >>> 15;
return h >>> 0;
}
var hash = function hash2(str) {
return murmurhash2_32_gc(str, 1).toString(36);
};
var w = ["Webkit"];
var m = ["Moz"];
var ms = ["ms"];
var wm = ["Webkit", "Moz"];
var wms = ["Webkit", "ms"];
var wmms = ["Webkit", "Moz", "ms"];
var staticData = {
plugins: [backgroundClip2, crossFade2, cursor2, filter2, flex2, flexboxIE2, flexboxOld2, gradient2, grid2, imageSet2, logical2, position2, sizing2, transition2],
prefixMap: {
animation: w,
animationDelay: w,
animationDirection: w,
animationFillMode: w,
animationDuration: w,
animationIterationCount: w,
animationName: w,
animationPlayState: w,
animationTimingFunction: w,
appearance: wm,
userSelect: wmms,
textEmphasisPosition: w,
textEmphasis: w,
textEmphasisStyle: w,
textEmphasisColor: w,
boxDecorationBreak: w,
clipPath: w,
maskImage: w,
maskMode: w,
maskRepeat: w,
maskPosition: w,
maskClip: w,
maskOrigin: w,
maskSize: w,
maskComposite: w,
mask: w,
maskBorderSource: w,
maskBorderMode: w,
maskBorderSlice: w,
maskBorderWidth: w,
maskBorderOutset: w,
maskBorderRepeat: w,
maskBorder: w,
maskType: w,
textDecorationStyle: w,
textDecorationSkip: w,
textDecorationLine: w,
textDecorationColor: w,
filter: w,
fontFeatureSettings: w,
breakAfter: wmms,
breakBefore: wmms,
breakInside: wmms,
columnCount: wm,
columnFill: wm,
columnGap: wm,
columnRule: wm,
columnRuleColor: wm,
columnRuleStyle: wm,
columnRuleWidth: wm,
columns: wm,
columnSpan: wm,
columnWidth: wm,
writingMode: wms,
flex: wms,
flexBasis: w,
flexDirection: wms,
flexGrow: w,
flexFlow: wms,
flexShrink: w,
flexWrap: wms,
alignContent: w,
alignItems: w,
alignSelf: w,
justifyContent: w,
order: w,
transform: w,
transformOrigin: w,
transformOriginX: w,
transformOriginY: w,
backfaceVisibility: w,
perspective: w,
perspectiveOrigin: w,
transformStyle: w,
transformOriginZ: w,
backdropFilter: w,
fontKerning: w,
scrollSnapType: wms,
scrollSnapPointsX: wms,
scrollSnapPointsY: wms,
scrollSnapDestination: wms,
scrollSnapCoordinate: wms,
shapeImageThreshold: w,
shapeImageMargin: w,
shapeImageOutside: w,
hyphens: wmms,
flowInto: wms,
flowFrom: wms,
regionFragment: wms,
textOrientation: w,
textAlignLast: m,
tabSize: m,
wrapFlow: ms,
wrapThrough: ms,
wrapMargin: ms,
touchAction: ms,
textSizeAdjust: ["ms", "Webkit"],
borderImage: w,
borderImageOutset: w,
borderImageRepeat: w,
borderImageSlice: w,
borderImageSource: w,
borderImageWidth: w,
transitionDelay: w,
transitionDuration: w,
transitionProperty: w,
transitionTimingFunction: w
}
};
var prefixAll = createPrefixer2(staticData);
var prefixInlineStyles = function prefixInlineStyles2(style) {
var prefixedStyles = prefixAll(style);
Object.keys(prefixedStyles).forEach(function(prop) {
var value = prefixedStyles[prop];
if (Array.isArray(value)) {
prefixedStyles[prop] = value[value.length - 1];
}
});
return prefixedStyles;
};
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(Object(source), true).forEach(function(key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {value, enumerable: true, configurable: true, writable: true});
} else {
obj[key] = value;
}
return obj;
}
function _objectWithoutPropertiesLoose$1(source, excluded) {
if (source == null)
return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0)
continue;
target[key] = source[key];
}
return target;
}
var cache = {
get: function get(property, value) {
if (cache[property] != null && cache[property].hasOwnProperty(value) && cache[property][value] != null) {
return cache[property][value];
}
},
set: function set(property, value, object) {
if (cache[property] == null) {
cache[property] = {};
}
return cache[property][value] = object;
}
};
function atomic(style) {
return Object.keys(style).sort().reduce(function(acc, property) {
var value = style[property];
if (value != null) {
var valueString = stringifyValueWithProperty(value, property);
var cachedResult = cache.get(property, valueString);
if (cachedResult != null) {
var identifier = cachedResult.identifier;
acc[identifier] = cachedResult;
} else {
var _identifier = createIdentifier("r", property, value);
var rules = createAtomicRules(_identifier, property, value);
var _cachedResult = cache.set(property, valueString, {
property,
value: stringifyValueWithProperty(value, property),
identifier: _identifier,
rules
});
acc[_identifier] = _cachedResult;
}
}
return acc;
}, {});
}
function classic(style, name) {
var _ref;
var identifier = createIdentifier("css", name, style);
var animationKeyframes = style.animationKeyframes, rest = _objectWithoutPropertiesLoose$1(style, ["animationKeyframes"]);
var rules = [];
var selector = "." + identifier;
var animationName;
if (animationKeyframes != null) {
var _processKeyframesValu = processKeyframesValue(animationKeyframes), animationNames = _processKeyframesValu.animationNames, keyframesRules = _processKeyframesValu.rules;
animationName = animationNames.join(",");
rules.push.apply(rules, keyframesRules);
}
var block = createDeclarationBlock(_objectSpread(_objectSpread({}, rest), {}, {
animationName
}));
rules.push("" + selector + block);
return _ref = {}, _ref[identifier] = {
identifier,
rules
}, _ref;
}
function inline(style) {
return prefixInlineStyles(createReactDOMStyle(style));
}
function stringifyValueWithProperty(value, property) {
var normalizedValue = normalizeValueWithProperty(value, property);
return typeof normalizedValue !== "string" ? JSON.stringify(normalizedValue || "") : normalizedValue;
}
function createAtomicRules(identifier, property, value) {
var rules = [];
var selector = "." + identifier;
switch (property) {
case "animationKeyframes": {
var _processKeyframesValu2 = processKeyframesValue(value), animationNames = _processKeyframesValu2.animationNames, keyframesRules = _processKeyframesValu2.rules;
var block = createDeclarationBlock({
animationName: animationNames.join(",")
});
rules.push.apply(rules, ["" + selector + block].concat(keyframesRules));
break;
}
case "placeholderTextColor": {
var _block = createDeclarationBlock({
color: value,
opacity: 1
});
rules.push(selector + "::-webkit-input-placeholder" + _block, selector + "::-moz-placeholder" + _block, selector + ":-ms-input-placeholder" + _block, selector + "::placeholder" + _block);
break;
}
case "pointerEvents": {
var _createDeclarationBlo3;
var finalValue = value;
if (value === "auto" || value === "box-only") {
finalValue = "auto!important";
if (value === "box-only") {
var _createDeclarationBlo;
var _block3 = createDeclarationBlock((_createDeclarationBlo = {}, _createDeclarationBlo[property] = "none", _createDeclarationBlo));
rules.push(selector + ">*" + _block3);
}
} else if (value === "none" || value === "box-none") {
finalValue = "none!important";
if (value === "box-none") {
var _createDeclarationBlo2;
var _block4 = createDeclarationBlock((_createDeclarationBlo2 = {}, _createDeclarationBlo2[property] = "auto", _createDeclarationBlo2));
rules.push(selector + ">*" + _block4);
}
}
var _block2 = createDeclarationBlock((_createDeclarationBlo3 = {}, _createDeclarationBlo3[property] = finalValue, _createDeclarationBlo3));
rules.push("" + selector + _block2);
break;
}
case "scrollbarWidth": {
var _createDeclarationBlo4;
if (value === "none") {
rules.push(selector + "::-webkit-scrollbar{display:none}");
}
var _block5 = createDeclarationBlock((_createDeclarationBlo4 = {}, _createDeclarationBlo4[property] = value, _createDeclarationBlo4));
rules.push("" + selector + _block5);
break;
}
default: {
var _createDeclarationBlo5;
var _block6 = createDeclarationBlock((_createDeclarationBlo5 = {}, _createDeclarationBlo5[property] = value, _createDeclarationBlo5));
rules.push("" + selector + _block6);
break;
}
}
return rules;
}
function createDeclarationBlock(style) {
var domStyle = prefixAll(createReactDOMStyle(style));
var declarationsString = Object.keys(domStyle).map(function(property) {
var value = domStyle[property];
var prop = hyphenateStyleName(property);
if (Array.isArray(value)) {
return value.map(function(v) {
return prop + ":" + v;
}).join(";");
} else {
return prop + ":" + value;
}
}).sort().join(";");
return "{" + declarationsString + ";}";
}
function createIdentifier(prefix2, name, value) {
var hashedString = hash(name + stringifyValueWithProperty(value, name));
return prefix2 + "-" + hashedString;
}
function createKeyframes(keyframes) {
var prefixes2 = ["-webkit-", ""];
var identifier = createIdentifier("r", "animation", keyframes);
var steps = "{" + Object.keys(keyframes).map(function(stepName) {
var rule2 = keyframes[stepName];
var block = createDeclarationBlock(rule2);
return "" + stepName + block;
}).join("") + "}";
var rules = prefixes2.map(function(prefix2) {
return "@" + prefix2 + "keyframes " + identifier + steps;
});
return {
identifier,
rules
};
}
function processKeyframesValue(keyframesValue) {
if (typeof keyframesValue === "number") {
throw new Error("Invalid CSS keyframes type: " + typeof keyframesValue);
}
var animationNames = [];
var rules = [];
var value = Array.isArray(keyframesValue) ? keyframesValue : [keyframesValue];
value.forEach(function(keyframes) {
if (typeof keyframes === "string") {
animationNames.push(keyframes);
} else {
var _createKeyframes = createKeyframes(keyframes), identifier = _createKeyframes.identifier, keyframesRules = _createKeyframes.rules;
animationNames.push(identifier);
rules.push.apply(rules, keyframesRules);
}
});
return {
animationNames,
rules
};
}
var resets = [
"html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}",
"body{margin:0;}",
"button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}",
"input::-webkit-inner-spin-button,input::-webkit-outer-spin-button,input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}"
];
var focusVisibleAttributeName = "data-focusvisible-polyfill";
var rule = ":focus:not([" + focusVisibleAttributeName + "]){outline: none;}";
var modality = function modality2(insertRule) {
insertRule(rule);
if (!canUseDOM) {
return;
}
var hadKeyboardEvent = true;
var hadFocusVisibleRecently = false;
var hadFocusVisibleRecentlyTimeout = null;
var inputTypesWhitelist = {
text: true,
search: true,
url: true,
tel: true,
email: true,
password: true,
number: true,
date: true,
month: true,
week: true,
time: true,
datetime: true,
"datetime-local": true
};
function isValidFocusTarget(el) {
if (el && el !== document && el.nodeName !== "HTML" && el.nodeName !== "BODY" && "classList" in el && "contains" in el.classList) {
return true;
}
return false;
}
function focusTriggersKeyboardModality(el) {
var type = el.type;
var tagName = el.tagName;
var isReadOnly = el.readOnly;
if (tagName === "INPUT" && inputTypesWhitelist[type] && !isReadOnly) {
return true;
}
if (tagName === "TEXTAREA" && !isReadOnly) {
return true;
}
if (el.isContentEditable) {
return true;
}
return false;
}
function addFocusVisibleAttribute(el) {
if (el.hasAttribute(focusVisibleAttributeName)) {
return;
}
el.setAttribute(focusVisibleAttributeName, true);
}
function removeFocusVisibleAttribute(el) {
el.removeAttribute(focusVisibleAttributeName);
}
function removeAllFocusVisibleAttributes() {
var list = document.querySelectorAll("[" + focusVisibleAttributeName + "]");
for (var i = 0; i < list.length; i += 1) {
removeFocusVisibleAttribute(list[i]);
}
}
function onKeyDown2(e) {
if (e.key !== "Tab" && (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)) {
return;
}
if (isValidFocusTarget(document.activeElement)) {
addFocusVisibleAttribute(document.activeElement);
}
hadKeyboardEvent = true;
}
function onPointerDown(e) {
if (hadKeyboardEvent === true) {
removeAllFocusVisibleAttributes();
}
hadKeyboardEvent = false;
}
function onFocus(e) {
if (!isValidFocusTarget(e.target)) {
return;
}
if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) {
addFocusVisibleAttribute(e.target);
}
}
function onBlur(e) {
if (!isValidFocusTarget(e.target)) {
return;
}
if (e.target.hasAttribute(focusVisibleAttributeName)) {
hadFocusVisibleRecently = true;
window.clearTimeout(hadFocusVisibleRecentlyTimeout);
hadFocusVisibleRecentlyTimeout = window.setTimeout(function() {
hadFocusVisibleRecently = false;
window.clearTimeout(hadFocusVisibleRecentlyTimeout);
}, 100);
removeFocusVisibleAttribute(e.target);
}
}
function onVisibilityChange2(e) {
if (document.visibilityState === "hidden") {
if (hadFocusVisibleRecently) {
hadKeyboardEvent = true;
}
addInitialPointerMoveListeners();
}
}
function addInitialPointerMoveListeners() {
document.addEventListener("mousemove", onInitialPointerMove);
document.addEventListener("mousedown", onInitialPointerMove);
document.addEventListener("mouseup", onInitialPointerMove);
document.addEventListener("pointermove", onInitialPointerMove);
document.addEventListener("pointerdown", onInitialPointerMove);
document.addEventListener("pointerup", onInitialPointerMove);
document.addEventListener("touchmove", onInitialPointerMove);
document.addEventListener("touchstart", onInitialPointerMove);
document.addEventListener("touchend", onInitialPointerMove);
}
function removeInitialPointerMoveListeners() {
document.removeEventListener("mousemove", onInitialPointerMove);
document.removeEventListener("mousedown", onInitialPointerMove);
document.removeEventListener("mouseup", onInitialPointerMove);
document.removeEventListener("pointermove", onInitialPointerMove);
document.removeEventListener("pointerdown", onInitialPointerMove);
document.removeEventListener("pointerup", onInitialPointerMove);
document.removeEventListener("touchmove", onInitialPointerMove);
document.removeEventListener("touchstart", onInitialPointerMove);
document.removeEventListener("touchend", onInitialPointerMove);
}
function onInitialPointerMove(e) {
if (e.target.nodeName === "HTML") {
return;
}
hadKeyboardEvent = false;
removeInitialPointerMoveListeners();
}
document.addEventListener("keydown", onKeyDown2, true);
document.addEventListener("mousedown", onPointerDown, true);
document.addEventListener("pointerdown", onPointerDown, true);
document.addEventListener("touchstart", onPointerDown, true);
document.addEventListener("focus", onFocus, true);
document.addEventListener("blur", onBlur, true);
document.addEventListener("visibilitychange", onVisibilityChange2, true);
addInitialPointerMoveListeners();
};
function createStyleResolver() {
var inserted, sheet, cache2;
var resolved = {
css: {},
ltr: {},
rtl: {},
rtlNoSwap: {}
};
var init = function init2() {
inserted = {
css: {},
ltr: {},
rtl: {},
rtlNoSwap: {}
};
sheet = createOrderedCSSStyleSheet(createCSSStyleSheet(STYLE_ELEMENT_ID));
cache2 = {};
modality(function(rule2) {
return sheet.insert(rule2, STYLE_GROUPS.modality);
});
resets.forEach(function(rule2) {
sheet.insert(rule2, STYLE_GROUPS.reset);
});
};
init();
function addToCache(className, prop, value) {
if (!cache2[prop]) {
cache2[prop] = {};
}
cache2[prop][value] = className;
}
function getClassName(prop, value) {
var val = stringifyValueWithProperty(value, prop);
return cache2[prop] && cache2[prop].hasOwnProperty(val) && cache2[prop][val];
}
function _injectRegisteredStyle(id2) {
var _I18nManager$getConst = I18nManager.getConstants(), doLeftAndRightSwapInRTL2 = _I18nManager$getConst.doLeftAndRightSwapInRTL, isRTL3 = _I18nManager$getConst.isRTL;
var dir = isRTL3 ? doLeftAndRightSwapInRTL2 ? "rtl" : "rtlNoSwap" : "ltr";
if (!inserted[dir][id2]) {
var style = createCompileableStyle(i18nStyle(flattenStyle(id2)));
var results = atomic(style);
Object.keys(results).forEach(function(key) {
var _results$key = results[key], identifier = _results$key.identifier, property = _results$key.property, rules = _results$key.rules, value = _results$key.value;
addToCache(identifier, property, value);
rules.forEach(function(rule2) {
var group = STYLE_GROUPS.custom[property] || STYLE_GROUPS.atomic;
sheet.insert(rule2, group);
});
});
inserted[dir][id2] = true;
}
}
function resolve(style, classList2) {
var nextClassList = [];
var props = {};
if (!style && !classList2) {
return props;
}
if (Array.isArray(classList2)) {
flattenArray(classList2).forEach(function(identifier) {
if (identifier) {
if (inserted.css[identifier] == null && resolved.css[identifier] != null) {
var item = resolved.css[identifier];
item.rules.forEach(function(rule2) {
sheet.insert(rule2, item.group);
});
inserted.css[identifier] = true;
}
nextClassList.push(identifier);
}
});
}
if (typeof style === "number") {
_injectRegisteredStyle(style);
var key = createCacheKey(style);
props = _resolveStyle(style, key);
} else if (!Array.isArray(style)) {
props = _resolveStyle(style);
} else {
var flatArray = flattenArray(style);
var isArrayOfNumbers = true;
var cacheKey = "";
for (var i = 0; i < flatArray.length; i++) {
var id2 = flatArray[i];
if (typeof id2 !== "number") {
isArrayOfNumbers = false;
} else {
if (isArrayOfNumbers) {
cacheKey += id2 + "-";
}
_injectRegisteredStyle(id2);
}
}
var _key = isArrayOfNumbers ? createCacheKey(cacheKey) : null;
props = _resolveStyle(flatArray, _key);
}
nextClassList.push.apply(nextClassList, props.classList);
var finalProps = {
className: classListToString(nextClassList),
classList: nextClassList
};
if (props.style) {
finalProps.style = props.style;
}
return finalProps;
}
function _resolveStyle(style, key) {
var _I18nManager$getConst2 = I18nManager.getConstants(), doLeftAndRightSwapInRTL2 = _I18nManager$getConst2.doLeftAndRightSwapInRTL, isRTL3 = _I18nManager$getConst2.isRTL;
var dir = isRTL3 ? doLeftAndRightSwapInRTL2 ? "rtl" : "rtlNoSwap" : "ltr";
if (key != null && resolved[dir][key] != null) {
return resolved[dir][key];
}
var flatStyle = flattenStyle(style);
var localizedStyle = createCompileableStyle(i18nStyle(flatStyle));
var props = Object.keys(localizedStyle).sort().reduce(function(props2, styleProp) {
var value = localizedStyle[styleProp];
if (value != null) {
var className = getClassName(styleProp, value);
if (className) {
props2.classList.push(className);
} else {
if (styleProp === "animationKeyframes" || styleProp === "placeholderTextColor" || styleProp === "pointerEvents" || styleProp === "scrollbarWidth") {
var _atomic;
var a = atomic((_atomic = {}, _atomic[styleProp] = value, _atomic));
Object.keys(a).forEach(function(key2) {
var _a$key = a[key2], identifier = _a$key.identifier, rules = _a$key.rules;
props2.classList.push(identifier);
rules.forEach(function(rule2) {
sheet.insert(rule2, STYLE_GROUPS.atomic);
});
});
} else {
if (!props2.style) {
props2.style = {};
}
props2.style[styleProp] = value;
}
}
}
return props2;
}, {
classList: []
});
if (props.style) {
props.style = inline(props.style);
}
if (key != null) {
resolved[dir][key] = props;
}
return props;
}
return {
getStyleSheet: function getStyleSheet() {
var textContent = sheet.getTextContent();
if (!canUseDOM) {
init();
}
return {
id: STYLE_ELEMENT_ID,
textContent
};
},
createCSS: function createCSS(rules, group) {
var result = {};
Object.keys(rules).forEach(function(name) {
var style = rules[name];
var compiled = classic(style, name);
Object.keys(compiled).forEach(function(key) {
var _compiled$key = compiled[key], identifier = _compiled$key.identifier, rules2 = _compiled$key.rules;
resolved.css[identifier] = {
group: group || STYLE_GROUPS.classic,
rules: rules2
};
result[name] = identifier;
});
});
return result;
},
resolve,
get sheet() {
return sheet;
}
};
}
var createCacheKey = function createCacheKey2(id2) {
var prefix2 = "rn";
return prefix2 + "-" + id2;
};
var classListToString = function classListToString2(list) {
return list.join(" ").trim();
};
var styleResolver = createStyleResolver();
var css = {
create: function create(rules, group) {
return styleResolver.createCSS(rules, group);
}
};
var absoluteFillObject = {
position: "absolute",
left: 0,
right: 0,
top: 0,
bottom: 0
};
var absoluteFill = ReactNativePropRegistry.register(absoluteFillObject);
var StyleSheet = {
absoluteFill,
absoluteFillObject,
compose: function compose(style1, style2) {
if (style1 && style2) {
return [style1, style2];
} else {
return style1 || style2;
}
},
create: function create2(styles2) {
var result = {};
Object.keys(styles2).forEach(function(key) {
var id2 = styles2[key] && ReactNativePropRegistry.register(styles2[key]);
result[key] = id2;
});
return result;
},
flatten: flattenStyle,
hairlineWidth: 1
};
if (canUseDOM && window.__REACT_DEVTOOLS_GLOBAL_HOOK__) {
window.__REACT_DEVTOOLS_GLOBAL_HOOK__.resolveRNStyle = StyleSheet.flatten;
}
function _objectWithoutPropertiesLoose$2(source, excluded) {
if (source == null)
return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0)
continue;
target[key] = source[key];
}
return target;
}
var emptyObject$4 = {};
var hasOwnProperty = Object.prototype.hasOwnProperty;
var uppercasePattern = /[A-Z]/g;
function toHyphenLower(match) {
return "-" + match.toLowerCase();
}
function hyphenateString(str) {
return str.replace(uppercasePattern, toHyphenLower);
}
var classes = css.create({
reset: {
backgroundColor: "transparent",
color: "inherit",
font: "inherit",
listStyle: "none",
margin: 0,
textAlign: "inherit",
textDecoration: "none"
},
cursor: {
cursor: "pointer"
}
}, STYLE_GROUPS.classicReset);
var pointerEventsStyles = StyleSheet.create({
auto: {
pointerEvents: "auto"
},
"box-none": {
pointerEvents: "box-none"
},
"box-only": {
pointerEvents: "box-only"
},
none: {
pointerEvents: "none"
}
});
var createDOMProps = function createDOMProps2(elementType, props) {
if (!props) {
props = emptyObject$4;
}
var _props = props, accessibilityActiveDescendant = _props.accessibilityActiveDescendant, accessibilityAtomic = _props.accessibilityAtomic, accessibilityAutoComplete = _props.accessibilityAutoComplete, accessibilityBusy = _props.accessibilityBusy, accessibilityChecked = _props.accessibilityChecked, accessibilityColumnCount = _props.accessibilityColumnCount, accessibilityColumnIndex = _props.accessibilityColumnIndex, accessibilityColumnSpan = _props.accessibilityColumnSpan, accessibilityControls = _props.accessibilityControls, accessibilityDescribedBy = _props.accessibilityDescribedBy, accessibilityDetails = _props.accessibilityDetails, accessibilityDisabled = _props.accessibilityDisabled, accessibilityErrorMessage = _props.accessibilityErrorMessage, accessibilityExpanded = _props.accessibilityExpanded, accessibilityFlowTo = _props.accessibilityFlowTo, accessibilityHasPopup = _props.accessibilityHasPopup, accessibilityHidden = _props.accessibilityHidden, accessibilityInvalid = _props.accessibilityInvalid, accessibilityKeyShortcuts = _props.accessibilityKeyShortcuts, accessibilityLabel = _props.accessibilityLabel, accessibilityLabelledBy = _props.accessibilityLabelledBy, accessibilityLevel = _props.accessibilityLevel, accessibilityLiveRegion = _props.accessibilityLiveRegion, accessibilityModal = _props.accessibilityModal, accessibilityMultiline = _props.accessibilityMultiline, accessibilityMultiSelectable = _props.accessibilityMultiSelectable, accessibilityOrientation = _props.accessibilityOrientation, accessibilityOwns = _props.accessibilityOwns, accessibilityPlaceholder = _props.accessibilityPlaceholder, accessibilityPosInSet = _props.accessibilityPosInSet, accessibilityPressed = _props.accessibilityPressed, accessibilityReadOnly = _props.accessibilityReadOnly, accessibilityRequired = _props.accessibilityRequired, accessibilityRole = _props.accessibilityRole, accessibilityRoleDescription = _props.accessibilityRoleDescription, accessibilityRowCount = _props.accessibilityRowCount, accessibilityRowIndex = _props.accessibilityRowIndex, accessibilityRowSpan = _props.accessibilityRowSpan, accessibilitySelected = _props.accessibilitySelected, accessibilitySetSize = _props.accessibilitySetSize, accessibilitySort = _props.accessibilitySort, accessibilityValueMax = _props.accessibilityValueMax, accessibilityValueMin = _props.accessibilityValueMin, accessibilityValueNow = _props.accessibilityValueNow, accessibilityValueText = _props.accessibilityValueText, classList2 = _props.classList, dataSet = _props.dataSet, focusable = _props.focusable, nativeID = _props.nativeID, pointerEvents = _props.pointerEvents, providedStyle = _props.style, testID = _props.testID, accessible = _props.accessible, accessibilityState = _props.accessibilityState, accessibilityValue2 = _props.accessibilityValue, domProps = _objectWithoutPropertiesLoose$2(_props, ["accessibilityActiveDescendant", "accessibilityAtomic", "accessibilityAutoComplete", "accessibilityBusy", "accessibilityChecked", "accessibilityColumnCount", "accessibilityColumnIndex", "accessibilityColumnSpan", "accessibilityControls", "accessibilityDescribedBy", "accessibilityDetails", "accessibilityDisabled", "accessibilityErrorMessage", "accessibilityExpanded", "accessibilityFlowTo", "accessibilityHasPopup", "accessibilityHidden", "accessibilityInvalid", "accessibilityKeyShortcuts", "accessibilityLabel", "accessibilityLabelledBy", "accessibilityLevel", "accessibilityLiveRegion", "accessibilityModal", "accessibilityMultiline", "accessibilityMultiSelectable", "accessibilityOrientation", "accessibilityOwns", "accessibilityPlaceholder", "accessibilityPosInSet", "accessibilityPressed", "accessibilityReadOnly", "accessibilityRequired", "accessibilityRole", "accessibilityRoleDescription", "accessibilityRowCount", "accessibilityRowIndex", "accessibilityRowSpan", "accessibilitySelected", "accessibilitySetSize", "accessibilitySort", "accessibilityValueMax", "accessibilityValueMin", "accessibilityValueNow", "accessibilityValueText", "classList", "dataSet", "focusable", "nativeID", "pointerEvents", "style", "testID", "accessible", "accessibilityState", "accessibilityValue"]);
var disabled = accessibilityState != null && accessibilityState.disabled === true || accessibilityDisabled;
var role = AccessibilityUtil.propsToAriaRole(props);
var isNativeInteractiveElement = role === "link" || elementType === "a" || elementType === "button" || elementType === "input" || elementType === "select" || elementType === "textarea" || domProps.contentEditable != null;
if (accessibilityState != null) {
for (var prop in accessibilityState) {
var value = accessibilityState[prop];
if (value != null) {
if (prop === "disabled" || prop === "hidden") {
if (value === true) {
domProps["aria-" + prop] = value;
domProps[prop] = value;
}
} else {
domProps["aria-" + prop] = value;
}
}
}
}
if (accessibilityValue2 != null) {
for (var _prop in accessibilityValue2) {
var _value = accessibilityValue2[_prop];
if (_value != null) {
domProps["aria-value" + _prop] = _value;
}
}
}
if (accessibilityActiveDescendant != null) {
domProps["aria-activedescendant"] = accessibilityActiveDescendant;
}
if (accessibilityAtomic != null) {
domProps["aria-atomic"] = accessibilityAtomic;
}
if (accessibilityAutoComplete != null) {
domProps["aria-autocomplete"] = accessibilityAutoComplete;
}
if (accessibilityBusy != null) {
domProps["aria-busy"] = accessibilityBusy;
}
if (accessibilityChecked != null) {
domProps["aria-checked"] = accessibilityChecked;
}
if (accessibilityColumnCount != null) {
domProps["aria-colcount"] = accessibilityColumnCount;
}
if (accessibilityColumnIndex != null) {
domProps["aria-colindex"] = accessibilityColumnIndex;
}
if (accessibilityColumnSpan != null) {
domProps["aria-colspan"] = accessibilityColumnSpan;
}
if (accessibilityControls != null) {
domProps["aria-controls"] = accessibilityControls;
}
if (accessibilityDescribedBy != null) {
domProps["aria-describedby"] = accessibilityDescribedBy;
}
if (accessibilityDetails != null) {
domProps["aria-details"] = accessibilityDetails;
}
if (disabled === true) {
domProps["aria-disabled"] = true;
if (elementType === "button" || elementType === "form" || elementType === "input" || elementType === "select" || elementType === "textarea") {
domProps.disabled = true;
}
}
if (accessibilityErrorMessage != null) {
domProps["aria-errormessage"] = accessibilityErrorMessage;
}
if (accessibilityExpanded != null) {
domProps["aria-expanded"] = accessibilityExpanded;
}
if (accessibilityFlowTo != null) {
domProps["aria-flowto"] = accessibilityFlowTo;
}
if (accessibilityHasPopup != null) {
domProps["aria-haspopup"] = accessibilityHasPopup;
}
if (accessibilityHidden === true) {
domProps["aria-hidden"] = accessibilityHidden;
}
if (accessibilityInvalid != null) {
domProps["aria-invalid"] = accessibilityInvalid;
}
if (accessibilityKeyShortcuts != null && Array.isArray(accessibilityKeyShortcuts)) {
domProps["aria-keyshortcuts"] = accessibilityKeyShortcuts.join(" ");
}
if (accessibilityLabel != null) {
domProps["aria-label"] = accessibilityLabel;
}
if (accessibilityLabelledBy != null) {
domProps["aria-labelledby"] = accessibilityLabelledBy;
}
if (accessibilityLevel != null) {
domProps["aria-level"] = accessibilityLevel;
}
if (accessibilityLiveRegion != null) {
domProps["aria-live"] = accessibilityLiveRegion === "none" ? "off" : accessibilityLiveRegion;
}
if (accessibilityModal != null) {
domProps["aria-modal"] = accessibilityModal;
}
if (accessibilityMultiline != null) {
domProps["aria-multiline"] = accessibilityMultiline;
}
if (accessibilityMultiSelectable != null) {
domProps["aria-multiselectable"] = accessibilityMultiSelectable;
}
if (accessibilityOrientation != null) {
domProps["aria-orientation"] = accessibilityOrientation;
}
if (accessibilityOwns != null) {
domProps["aria-owns"] = accessibilityOwns;
}
if (accessibilityPlaceholder != null) {
domProps["aria-placeholder"] = accessibilityPlaceholder;
}
if (accessibilityPosInSet != null) {
domProps["aria-posinset"] = accessibilityPosInSet;
}
if (accessibilityPressed != null) {
domProps["aria-pressed"] = accessibilityPressed;
}
if (accessibilityReadOnly != null) {
domProps["aria-readonly"] = accessibilityReadOnly;
if (elementType === "input" || elementType === "select" || elementType === "textarea") {
domProps.readOnly = true;
}
}
if (accessibilityRequired != null) {
domProps["aria-required"] = accessibilityRequired;
if (elementType === "input" || elementType === "select" || elementType === "textarea") {
domProps.required = true;
}
}
if (role != null) {
domProps["role"] = role === "none" ? "presentation" : role;
}
if (accessibilityRoleDescription != null) {
domProps["aria-roledescription"] = accessibilityRoleDescription;
}
if (accessibilityRowCount != null) {
domProps["aria-rowcount"] = accessibilityRowCount;
}
if (accessibilityRowIndex != null) {
domProps["aria-rowindex"] = accessibilityRowIndex;
}
if (accessibilityRowSpan != null) {
domProps["aria-rowspan"] = accessibilityRowSpan;
}
if (accessibilitySelected != null) {
domProps["aria-selected"] = accessibilitySelected;
}
if (accessibilitySetSize != null) {
domProps["aria-setsize"] = accessibilitySetSize;
}
if (accessibilitySort != null) {
domProps["aria-sort"] = accessibilitySort;
}
if (accessibilityValueMax != null) {
domProps["aria-valuemax"] = accessibilityValueMax;
}
if (accessibilityValueMin != null) {
domProps["aria-valuemin"] = accessibilityValueMin;
}
if (accessibilityValueNow != null) {
domProps["aria-valuenow"] = accessibilityValueNow;
}
if (accessibilityValueText != null) {
domProps["aria-valuetext"] = accessibilityValueText;
}
if (dataSet != null) {
for (var dataProp in dataSet) {
if (hasOwnProperty.call(dataSet, dataProp)) {
var dataName = hyphenateString(dataProp);
var dataValue = dataSet[dataProp];
if (dataValue != null) {
domProps["data-" + dataName] = dataValue;
}
}
}
}
var _focusable = focusable != null ? focusable : accessible;
if (elementType === "a" || elementType === "button" || elementType === "input" || elementType === "select" || elementType === "textarea") {
if (_focusable === false || accessibilityDisabled === true) {
domProps.tabIndex = "-1";
}
} else if (role === "button" || role === "checkbox" || role === "link" || role === "menuitem" || role === "radio" || role === "textbox" || role === "switch") {
if (_focusable !== false) {
domProps.tabIndex = "0";
}
} else {
if (_focusable === true) {
domProps.tabIndex = "0";
}
}
var reactNativeStyle = StyleSheet.compose(pointerEvents && pointerEventsStyles[pointerEvents], providedStyle);
var needsCursor = (role === "button" || role === "link") && !disabled;
var needsReset = elementType === "a" || elementType === "button" || elementType === "li" || elementType === "ul" || role === "heading";
var finalClassList = [needsReset && classes.reset, needsCursor && classes.cursor, classList2];
var _styleResolver$resolv = styleResolver.resolve(reactNativeStyle, finalClassList), className = _styleResolver$resolv.className, style = _styleResolver$resolv.style;
if (className != null && className !== "") {
domProps.className = className;
}
if (style) {
domProps.style = style;
}
if (nativeID != null) {
domProps.id = nativeID;
}
if (testID != null) {
domProps["data-testid"] = testID;
}
if (isNativeInteractiveElement || role === "button" || role === "menuitem" || _focusable === true && !disabled) {
var onClick = domProps.onClick;
if (onClick != null) {
if (disabled) {
domProps.onClick = function(e) {
e.stopPropagation();
};
} else if (!isNativeInteractiveElement) {
var onKeyDown2 = domProps.onKeyDown;
domProps.onKeyDown = function(e) {
var key = e.key, repeat = e.repeat;
var isSpacebarKey = key === " " || key === "Spacebar";
var isButtonRole3 = role === "button" || role === "menuitem";
if (onKeyDown2 != null) {
onKeyDown2(e);
}
if (!repeat && key === "Enter") {
onClick(e);
} else if (isSpacebarKey && isButtonRole3) {
if (!repeat) {
onClick(e);
}
e.preventDefault();
}
};
}
}
}
return domProps;
};
var createElement = function createElement2(component, props) {
var accessibilityComponent;
if (component && component.constructor === String) {
accessibilityComponent = AccessibilityUtil.propsToAccessibilityComponent(props);
}
var Component2 = accessibilityComponent || component;
var domProps = createDOMProps(Component2, props);
for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
children[_key - 2] = arguments[_key];
}
return /* @__PURE__ */ React__default.createElement.apply(React__default, [Component2, domProps].concat(children));
};
var findNodeHandle = function findNodeHandle2(component) {
var node;
try {
node = findDOMNode(component);
} catch (e) {
}
return node;
};
var getBoundingClientRect = function getBoundingClientRect2(node) {
if (node != null) {
var isElement = node.nodeType === 1;
if (isElement && typeof node.getBoundingClientRect === "function") {
return node.getBoundingClientRect();
}
}
};
function dangerousStyleValue(name, value, isCustomProperty) {
var isEmpty = value == null || typeof value === "boolean" || value === "";
if (isEmpty) {
return "";
}
if (!isCustomProperty && typeof value === "number" && value !== 0 && !(unitlessNumbers.hasOwnProperty(name) && unitlessNumbers[name])) {
return value + "px";
}
return ("" + value).trim();
}
function setValueForStyles(node, styles2) {
var style = node.style;
for (var styleName in styles2) {
if (!styles2.hasOwnProperty(styleName)) {
continue;
}
var isCustomProperty = styleName.indexOf("--") === 0;
var styleValue = dangerousStyleValue(styleName, styles2[styleName], isCustomProperty);
if (styleName === "float") {
styleName = "cssFloat";
}
if (isCustomProperty) {
style.setProperty(styleName, styleValue);
} else {
style[styleName] = styleValue;
}
}
}
var getRect = function getRect2(node) {
var _getBoundingClientRec = getBoundingClientRect(node), x = _getBoundingClientRec.x, y = _getBoundingClientRec.y, top = _getBoundingClientRec.top, left2 = _getBoundingClientRec.left;
var width = node.offsetWidth;
var height = node.offsetHeight;
return {
x,
y,
width,
height,
top,
left: left2
};
};
var _measureLayout = function measureLayout(node, relativeToNativeNode, callback) {
var relativeNode = relativeToNativeNode || node && node.parentNode;
if (node && relativeNode) {
setTimeout(function() {
var relativeRect = getBoundingClientRect(relativeNode);
var _getRect = getRect(node), height = _getRect.height, left2 = _getRect.left, top = _getRect.top, width = _getRect.width;
var x = left2 - relativeRect.left;
var y = top - relativeRect.top;
callback(x, y, width, height, left2, top);
}, 0);
}
};
var focusableElements = {
A: true,
INPUT: true,
SELECT: true,
TEXTAREA: true
};
var UIManager = {
blur: function blur(node) {
try {
node.blur();
} catch (err) {
}
},
focus: function focus(node) {
try {
var name = node.nodeName;
if (node.getAttribute("tabIndex") == null && focusableElements[name] == null) {
node.setAttribute("tabIndex", "-1");
}
node.focus();
} catch (err) {
}
},
measure: function measure(node, callback) {
_measureLayout(node, null, callback);
},
measureInWindow: function measureInWindow(node, callback) {
if (node) {
setTimeout(function() {
var _getRect2 = getRect(node), height = _getRect2.height, left2 = _getRect2.left, top = _getRect2.top, width = _getRect2.width;
callback(left2, top, width, height);
}, 0);
}
},
measureLayout: function measureLayout2(node, relativeToNativeNode, onFail, onSuccess) {
_measureLayout(node, relativeToNativeNode, onSuccess);
},
updateView: function updateView(node, props) {
for (var prop in props) {
if (!Object.prototype.hasOwnProperty.call(props, prop)) {
continue;
}
var value = props[prop];
switch (prop) {
case "style": {
setValueForStyles(node, value);
break;
}
case "class":
case "className": {
node.setAttribute("class", value);
break;
}
case "text":
case "value":
node.value = value;
break;
default:
node.setAttribute(prop, value);
}
}
},
configureNextLayoutAnimation: function configureNextLayoutAnimation(config, onAnimationDidEnd) {
onAnimationDidEnd();
},
setLayoutAnimationEnabledExperimental: function setLayoutAnimationEnabledExperimental() {
}
};
var NativeModules = {
UIManager
};
function isScreenReaderEnabled() {
return new Promise(function(resolve, reject) {
resolve(true);
});
}
var prefersReducedMotionMedia = canUseDOM && typeof window.matchMedia === "function" ? window.matchMedia("(prefers-reduced-motion: reduce)") : null;
function isReduceMotionEnabled() {
return new Promise(function(resolve, reject) {
resolve(prefersReducedMotionMedia ? prefersReducedMotionMedia.matches : true);
});
}
function addChangeListener(fn) {
if (prefersReducedMotionMedia != null) {
prefersReducedMotionMedia.addEventListener != null ? prefersReducedMotionMedia.addEventListener("change", fn) : prefersReducedMotionMedia.addListener(fn);
}
}
function removeChangeListener(fn) {
if (prefersReducedMotionMedia != null) {
prefersReducedMotionMedia.removeEventListener != null ? prefersReducedMotionMedia.removeEventListener("change", fn) : prefersReducedMotionMedia.removeListener(fn);
}
}
var handlers = {};
var AccessibilityInfo = {
isScreenReaderEnabled,
isReduceMotionEnabled,
fetch: isScreenReaderEnabled,
addEventListener: function addEventListener(eventName, handler) {
if (eventName === "reduceMotionChanged") {
if (!prefersReducedMotionMedia) {
return;
}
var listener = function listener2(event3) {
handler(event3.matches);
};
addChangeListener(listener);
handlers[handler] = listener;
}
return {
remove: function remove() {
return AccessibilityInfo.removeEventListener(eventName, handler);
}
};
},
setAccessibilityFocus: function setAccessibilityFocus(reactTag) {
},
announceForAccessibility: function announceForAccessibility(announcement) {
},
removeEventListener: function removeEventListener(eventName, handler) {
if (eventName === "reduceMotionChanged") {
var listener = handlers[handler];
if (!listener || !prefersReducedMotionMedia) {
return;
}
removeChangeListener(listener);
}
return;
}
};
var Alert = /* @__PURE__ */ function() {
function Alert2() {
}
Alert2.alert = function alert() {
};
return Alert2;
}();
var EventSubscription = /* @__PURE__ */ function() {
function EventSubscription2(subscriber) {
this.subscriber = subscriber;
}
var _proto = EventSubscription2.prototype;
_proto.remove = function remove() {
this.subscriber.removeSubscription(this);
};
return EventSubscription2;
}();
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf(subClass, superClass);
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf(o, p);
}
var EmitterSubscription = /* @__PURE__ */ function(_EventSubscription) {
_inheritsLoose(EmitterSubscription2, _EventSubscription);
function EmitterSubscription2(emitter, subscriber, listener, context) {
var _this;
_this = _EventSubscription.call(this, subscriber) || this;
_this.emitter = emitter;
_this.listener = listener;
_this.context = context;
return _this;
}
var _proto = EmitterSubscription2.prototype;
_proto.remove = function remove() {
this.emitter.removeSubscription(this);
};
return EmitterSubscription2;
}(EventSubscription);
var EventSubscriptionVendor = /* @__PURE__ */ function() {
function EventSubscriptionVendor2() {
this._subscriptionsForType = {};
this._currentSubscription = null;
}
var _proto = EventSubscriptionVendor2.prototype;
_proto.addSubscription = function addSubscription(eventType, subscription) {
invariant2(subscription.subscriber === this, "The subscriber of the subscription is incorrectly set.");
if (!this._subscriptionsForType[eventType]) {
this._subscriptionsForType[eventType] = [];
}
var key = this._subscriptionsForType[eventType].length;
this._subscriptionsForType[eventType].push(subscription);
subscription.eventType = eventType;
subscription.key = key;
return subscription;
};
_proto.removeAllSubscriptions = function removeAllSubscriptions(eventType) {
if (eventType === void 0) {
this._subscriptionsForType = {};
} else {
delete this._subscriptionsForType[eventType];
}
};
_proto.removeSubscription = function removeSubscription(subscription) {
var eventType = subscription.eventType;
var key = subscription.key;
var subscriptionsForType = this._subscriptionsForType[eventType];
if (subscriptionsForType) {
delete subscriptionsForType[key];
}
};
_proto.getSubscriptionsForType = function getSubscriptionsForType(eventType) {
return this._subscriptionsForType[eventType];
};
return EventSubscriptionVendor2;
}();
var sparseFilterPredicate = function sparseFilterPredicate2() {
return true;
};
var EventEmitter = /* @__PURE__ */ function() {
function EventEmitter2(subscriber) {
this._subscriber = subscriber || new EventSubscriptionVendor();
}
var _proto = EventEmitter2.prototype;
_proto.addListener = function addListener3(eventType, listener, context) {
return this._subscriber.addSubscription(eventType, new EmitterSubscription(this, this._subscriber, listener, context));
};
_proto.once = function once(eventType, listener, context) {
var _this = this;
return this.addListener(eventType, function() {
_this.removeCurrentListener();
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
listener.apply(context, args);
});
};
_proto.removeAllListeners = function removeAllListeners2(eventType) {
this._subscriber.removeAllSubscriptions(eventType);
};
_proto.removeCurrentListener = function removeCurrentListener() {
invariant2(!!this._currentSubscription, "Not in an emitting cycle; there is no current subscription");
this.removeSubscription(this._currentSubscription);
};
_proto.removeSubscription = function removeSubscription(subscription) {
invariant2(subscription.emitter === this, "Subscription does not belong to this emitter.");
this._subscriber.removeSubscription(subscription);
};
_proto.listeners = function listeners2(eventType) {
var subscriptions = this._subscriber.getSubscriptionsForType(eventType);
return subscriptions ? subscriptions.filter(sparseFilterPredicate).map(function(subscription) {
return subscription.listener;
}) : [];
};
_proto.emit = function emit(eventType) {
var subscriptions = this._subscriber.getSubscriptionsForType(eventType);
if (subscriptions) {
for (var i = 0, l = subscriptions.length; i < l; i++) {
var subscription = subscriptions[i];
if (subscription && subscription.listener) {
this._currentSubscription = subscription;
subscription.listener.apply(subscription.context, Array.prototype.slice.call(arguments, 1));
}
}
this._currentSubscription = null;
}
};
_proto.removeListener = function removeListener2(eventType, listener) {
var subscriptions = this._subscriber.getSubscriptionsForType(eventType);
if (subscriptions) {
for (var i = 0, l = subscriptions.length; i < l; i++) {
var subscription = subscriptions[i];
if (subscription && subscription.listener === listener) {
subscription.remove();
}
}
}
};
return EventEmitter2;
}();
function _inheritsLoose$1(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$1(subClass, superClass);
}
function _setPrototypeOf$1(o, p) {
_setPrototypeOf$1 = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$1(o, p);
}
var RCTDeviceEventEmitter = /* @__PURE__ */ function(_EventEmitter) {
_inheritsLoose$1(RCTDeviceEventEmitter2, _EventEmitter);
function RCTDeviceEventEmitter2() {
var _this;
var sharedSubscriber = new EventSubscriptionVendor();
_this = _EventEmitter.call(this, sharedSubscriber) || this;
_this.sharedSubscriber = sharedSubscriber;
return _this;
}
var _proto = RCTDeviceEventEmitter2.prototype;
_proto.addListener = function addListener3(eventType, listener, context) {
return _EventEmitter.prototype.addListener.call(this, eventType, listener, context);
};
_proto.removeAllListeners = function removeAllListeners2(eventType) {
_EventEmitter.prototype.removeAllListeners.call(this, eventType);
};
_proto.removeSubscription = function removeSubscription(subscription) {
if (subscription.emitter !== this) {
subscription.emitter.removeSubscription(subscription);
} else {
_EventEmitter.prototype.removeSubscription.call(this, subscription);
}
};
return RCTDeviceEventEmitter2;
}(EventEmitter);
var RCTDeviceEventEmitter$1 = new RCTDeviceEventEmitter();
function _inheritsLoose$2(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$2(subClass, superClass);
}
function _setPrototypeOf$2(o, p) {
_setPrototypeOf$2 = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$2(o, p);
}
var NativeEventEmitter = /* @__PURE__ */ function(_EventEmitter) {
_inheritsLoose$2(NativeEventEmitter2, _EventEmitter);
function NativeEventEmitter2(nativeModule) {
return _EventEmitter.call(this, RCTDeviceEventEmitter$1.sharedSubscriber) || this;
}
var _proto = NativeEventEmitter2.prototype;
_proto.addListener = function addListener3(eventType, listener, context) {
if (this._nativeModule != null) {
this._nativeModule.addListener(eventType);
}
return _EventEmitter.prototype.addListener.call(this, eventType, listener, context);
};
_proto.removeAllListeners = function removeAllListeners2(eventType) {
invariant2(eventType, "eventType argument is required.");
var count = this.listeners(eventType).length;
if (this._nativeModule != null) {
this._nativeModule.removeListeners(count);
}
_EventEmitter.prototype.removeAllListeners.call(this, eventType);
};
_proto.removeSubscription = function removeSubscription(subscription) {
if (this._nativeModule != null) {
this._nativeModule.removeListeners(1);
}
_EventEmitter.prototype.removeSubscription.call(this, subscription);
};
return NativeEventEmitter2;
}(EventEmitter);
function get2(name) {
return null;
}
var NativeAnimatedModule = get2();
var __nativeAnimatedNodeTagCount = 1;
var __nativeAnimationIdCount = 1;
var nativeEventEmitter;
var queueConnections = false;
var queue = [];
var API = {
enableQueue: function enableQueue() {
queueConnections = true;
},
disableQueue: function disableQueue() {
invariant2(NativeAnimatedModule, "Native animated module is not available");
queueConnections = false;
for (var q = 0, l = queue.length; q < l; q++) {
var args = queue[q];
NativeAnimatedModule.connectAnimatedNodes(args[0], args[1]);
}
queue.length = 0;
},
createAnimatedNode: function createAnimatedNode(tag, config) {
invariant2(NativeAnimatedModule, "Native animated module is not available");
NativeAnimatedModule.createAnimatedNode(tag, config);
},
startListeningToAnimatedNodeValue: function startListeningToAnimatedNodeValue(tag) {
invariant2(NativeAnimatedModule, "Native animated module is not available");
NativeAnimatedModule.startListeningToAnimatedNodeValue(tag);
},
stopListeningToAnimatedNodeValue: function stopListeningToAnimatedNodeValue(tag) {
invariant2(NativeAnimatedModule, "Native animated module is not available");
NativeAnimatedModule.stopListeningToAnimatedNodeValue(tag);
},
connectAnimatedNodes: function connectAnimatedNodes(parentTag, childTag) {
invariant2(NativeAnimatedModule, "Native animated module is not available");
if (queueConnections) {
queue.push([parentTag, childTag]);
return;
}
NativeAnimatedModule.connectAnimatedNodes(parentTag, childTag);
},
disconnectAnimatedNodes: function disconnectAnimatedNodes(parentTag, childTag) {
invariant2(NativeAnimatedModule, "Native animated module is not available");
NativeAnimatedModule.disconnectAnimatedNodes(parentTag, childTag);
},
startAnimatingNode: function startAnimatingNode(animationId, nodeTag, config, endCallback) {
invariant2(NativeAnimatedModule, "Native animated module is not available");
NativeAnimatedModule.startAnimatingNode(animationId, nodeTag, config, endCallback);
},
stopAnimation: function stopAnimation(animationId) {
invariant2(NativeAnimatedModule, "Native animated module is not available");
NativeAnimatedModule.stopAnimation(animationId);
},
setAnimatedNodeValue: function setAnimatedNodeValue(nodeTag, value) {
invariant2(NativeAnimatedModule, "Native animated module is not available");
NativeAnimatedModule.setAnimatedNodeValue(nodeTag, value);
},
setAnimatedNodeOffset: function setAnimatedNodeOffset(nodeTag, offset) {
invariant2(NativeAnimatedModule, "Native animated module is not available");
NativeAnimatedModule.setAnimatedNodeOffset(nodeTag, offset);
},
flattenAnimatedNodeOffset: function flattenAnimatedNodeOffset(nodeTag) {
invariant2(NativeAnimatedModule, "Native animated module is not available");
NativeAnimatedModule.flattenAnimatedNodeOffset(nodeTag);
},
extractAnimatedNodeOffset: function extractAnimatedNodeOffset(nodeTag) {
invariant2(NativeAnimatedModule, "Native animated module is not available");
NativeAnimatedModule.extractAnimatedNodeOffset(nodeTag);
},
connectAnimatedNodeToView: function connectAnimatedNodeToView(nodeTag, viewTag) {
invariant2(NativeAnimatedModule, "Native animated module is not available");
NativeAnimatedModule.connectAnimatedNodeToView(nodeTag, viewTag);
},
disconnectAnimatedNodeFromView: function disconnectAnimatedNodeFromView(nodeTag, viewTag) {
invariant2(NativeAnimatedModule, "Native animated module is not available");
NativeAnimatedModule.disconnectAnimatedNodeFromView(nodeTag, viewTag);
},
dropAnimatedNode: function dropAnimatedNode(tag) {
invariant2(NativeAnimatedModule, "Native animated module is not available");
NativeAnimatedModule.dropAnimatedNode(tag);
},
addAnimatedEventToView: function addAnimatedEventToView(viewTag, eventName, eventMapping) {
invariant2(NativeAnimatedModule, "Native animated module is not available");
NativeAnimatedModule.addAnimatedEventToView(viewTag, eventName, eventMapping);
},
removeAnimatedEventFromView: function removeAnimatedEventFromView(viewTag, eventName, animatedNodeTag) {
invariant2(NativeAnimatedModule, "Native animated module is not available");
NativeAnimatedModule.removeAnimatedEventFromView(viewTag, eventName, animatedNodeTag);
}
};
var STYLES_WHITELIST = {
opacity: true,
transform: true,
borderRadius: true,
borderBottomEndRadius: true,
borderBottomLeftRadius: true,
borderBottomRightRadius: true,
borderBottomStartRadius: true,
borderTopEndRadius: true,
borderTopLeftRadius: true,
borderTopRightRadius: true,
borderTopStartRadius: true,
elevation: true,
shadowOpacity: true,
shadowRadius: true,
scaleX: true,
scaleY: true,
translateX: true,
translateY: true
};
var TRANSFORM_WHITELIST = {
translateX: true,
translateY: true,
scale: true,
scaleX: true,
scaleY: true,
rotate: true,
rotateX: true,
rotateY: true,
perspective: true
};
var SUPPORTED_INTERPOLATION_PARAMS = {
inputRange: true,
outputRange: true,
extrapolate: true,
extrapolateRight: true,
extrapolateLeft: true
};
function addWhitelistedStyleProp(prop) {
STYLES_WHITELIST[prop] = true;
}
function addWhitelistedTransformProp(prop) {
TRANSFORM_WHITELIST[prop] = true;
}
function addWhitelistedInterpolationParam(param) {
SUPPORTED_INTERPOLATION_PARAMS[param] = true;
}
function validateTransform(configs) {
configs.forEach(function(config) {
if (!TRANSFORM_WHITELIST.hasOwnProperty(config.property)) {
throw new Error("Property '" + config.property + "' is not supported by native animated module");
}
});
}
function validateStyles(styles2) {
for (var _key in styles2) {
if (!STYLES_WHITELIST.hasOwnProperty(_key)) {
throw new Error("Style property '" + _key + "' is not supported by native animated module");
}
}
}
function validateInterpolation(config) {
for (var _key2 in config) {
if (!SUPPORTED_INTERPOLATION_PARAMS.hasOwnProperty(_key2)) {
throw new Error("Interpolation property '" + _key2 + "' is not supported by native animated module");
}
}
}
function generateNewNodeTag() {
return __nativeAnimatedNodeTagCount++;
}
function generateNewAnimationId() {
return __nativeAnimationIdCount++;
}
function assertNativeAnimatedModule() {
invariant2(NativeAnimatedModule, "Native animated module is not available");
}
function shouldUseNativeDriver(config) {
if (config.useNativeDriver === true && !NativeAnimatedModule) {
return false;
}
return config.useNativeDriver || false;
}
function transformDataType(value) {
if (typeof value !== "string") {
return value;
}
if (/deg$/.test(value)) {
var degrees = parseFloat(value) || 0;
var radians = degrees * Math.PI / 180;
return radians;
} else {
return value;
}
}
var NativeAnimatedHelper = {
API,
addWhitelistedStyleProp,
addWhitelistedTransformProp,
addWhitelistedInterpolationParam,
validateStyles,
validateTransform,
validateInterpolation,
generateNewNodeTag,
generateNewAnimationId,
assertNativeAnimatedModule,
shouldUseNativeDriver,
transformDataType,
get nativeEventEmitter() {
if (!nativeEventEmitter) {
nativeEventEmitter = new NativeEventEmitter(NativeAnimatedModule);
}
return nativeEventEmitter;
}
};
var NativeAnimatedAPI = NativeAnimatedHelper.API;
var _uniqueId = 1;
var AnimatedNode = /* @__PURE__ */ function() {
var _proto = AnimatedNode2.prototype;
_proto.__attach = function __attach() {
};
_proto.__detach = function __detach() {
if (this.__isNative && this.__nativeTag != null) {
NativeAnimatedHelper.API.dropAnimatedNode(this.__nativeTag);
this.__nativeTag = void 0;
}
};
_proto.__getValue = function __getValue() {
};
_proto.__getAnimatedValue = function __getAnimatedValue() {
return this.__getValue();
};
_proto.__addChild = function __addChild(child) {
};
_proto.__removeChild = function __removeChild(child) {
};
_proto.__getChildren = function __getChildren() {
return [];
};
function AnimatedNode2() {
this._listeners = {};
}
_proto.__makeNative = function __makeNative() {
if (!this.__isNative) {
throw new Error('This node cannot be made a "native" animated node');
}
if (this.hasListeners()) {
this._startListeningToNativeValueUpdates();
}
};
_proto.addListener = function addListener3(callback) {
var id2 = String(_uniqueId++);
this._listeners[id2] = callback;
if (this.__isNative) {
this._startListeningToNativeValueUpdates();
}
return id2;
};
_proto.removeListener = function removeListener2(id2) {
delete this._listeners[id2];
if (this.__isNative && !this.hasListeners()) {
this._stopListeningForNativeValueUpdates();
}
};
_proto.removeAllListeners = function removeAllListeners2() {
this._listeners = {};
if (this.__isNative) {
this._stopListeningForNativeValueUpdates();
}
};
_proto.hasListeners = function hasListeners() {
return !!Object.keys(this._listeners).length;
};
_proto._startListeningToNativeValueUpdates = function _startListeningToNativeValueUpdates() {
var _this = this;
if (this.__nativeAnimatedValueListener && !this.__shouldUpdateListenersForNewNativeTag) {
return;
}
if (this.__shouldUpdateListenersForNewNativeTag) {
this.__shouldUpdateListenersForNewNativeTag = false;
this._stopListeningForNativeValueUpdates();
}
NativeAnimatedAPI.startListeningToAnimatedNodeValue(this.__getNativeTag());
this.__nativeAnimatedValueListener = NativeAnimatedHelper.nativeEventEmitter.addListener("onAnimatedValueUpdate", function(data) {
if (data.tag !== _this.__getNativeTag()) {
return;
}
_this._onAnimatedValueUpdateReceived(data.value);
});
};
_proto._onAnimatedValueUpdateReceived = function _onAnimatedValueUpdateReceived(value) {
this.__callListeners(value);
};
_proto.__callListeners = function __callListeners(value) {
for (var _key in this._listeners) {
this._listeners[_key]({
value
});
}
};
_proto._stopListeningForNativeValueUpdates = function _stopListeningForNativeValueUpdates() {
if (!this.__nativeAnimatedValueListener) {
return;
}
this.__nativeAnimatedValueListener.remove();
this.__nativeAnimatedValueListener = null;
NativeAnimatedAPI.stopListeningToAnimatedNodeValue(this.__getNativeTag());
};
_proto.__getNativeTag = function __getNativeTag() {
NativeAnimatedHelper.assertNativeAnimatedModule();
invariant2(this.__isNative, 'Attempt to get native tag from node not marked as "native"');
if (this.__nativeTag == null) {
var nativeTag = NativeAnimatedHelper.generateNewNodeTag();
this.__nativeTag = nativeTag;
NativeAnimatedHelper.API.createAnimatedNode(nativeTag, this.__getNativeConfig());
this.__shouldUpdateListenersForNewNativeTag = true;
}
return this.__nativeTag;
};
_proto.__getNativeConfig = function __getNativeConfig() {
throw new Error("This JS animated node type cannot be used as native animated node");
};
_proto.toJSON = function toJSON() {
return this.__getValue();
};
return AnimatedNode2;
}();
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
var it;
if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
if (it)
o = it;
var i = 0;
return function() {
if (i >= o.length)
return {done: true};
return {done: false, value: o[i++]};
};
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
it = o[Symbol.iterator]();
return it.next.bind(it);
}
function _unsupportedIterableToArray(o, minLen) {
if (!o)
return;
if (typeof o === "string")
return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor)
n = o.constructor.name;
if (n === "Map" || n === "Set")
return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length)
len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i];
}
return arr2;
}
function _inheritsLoose$3(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$3(subClass, superClass);
}
function _setPrototypeOf$3(o, p) {
_setPrototypeOf$3 = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$3(o, p);
}
var AnimatedWithChildren = /* @__PURE__ */ function(_AnimatedNode) {
_inheritsLoose$3(AnimatedWithChildren2, _AnimatedNode);
function AnimatedWithChildren2() {
var _this;
_this = _AnimatedNode.call(this) || this;
_this._children = [];
return _this;
}
var _proto = AnimatedWithChildren2.prototype;
_proto.__makeNative = function __makeNative() {
if (!this.__isNative) {
this.__isNative = true;
for (var _iterator = _createForOfIteratorHelperLoose(this._children), _step; !(_step = _iterator()).done; ) {
var child = _step.value;
child.__makeNative();
NativeAnimatedHelper.API.connectAnimatedNodes(this.__getNativeTag(), child.__getNativeTag());
}
}
_AnimatedNode.prototype.__makeNative.call(this);
};
_proto.__addChild = function __addChild(child) {
if (this._children.length === 0) {
this.__attach();
}
this._children.push(child);
if (this.__isNative) {
child.__makeNative();
NativeAnimatedHelper.API.connectAnimatedNodes(this.__getNativeTag(), child.__getNativeTag());
}
};
_proto.__removeChild = function __removeChild(child) {
var index2 = this._children.indexOf(child);
if (index2 === -1) {
console.warn("Trying to remove a child that doesn't exist");
return;
}
if (this.__isNative && child.__isNative) {
NativeAnimatedHelper.API.disconnectAnimatedNodes(this.__getNativeTag(), child.__getNativeTag());
}
this._children.splice(index2, 1);
if (this._children.length === 0) {
this.__detach();
}
};
_proto.__getChildren = function __getChildren() {
return this._children;
};
_proto.__callListeners = function __callListeners(value) {
_AnimatedNode.prototype.__callListeners.call(this, value);
if (!this.__isNative) {
for (var _iterator2 = _createForOfIteratorHelperLoose(this._children), _step2; !(_step2 = _iterator2()).done; ) {
var child = _step2.value;
if (child.__getValue) {
child.__callListeners(child.__getValue());
}
}
}
};
return AnimatedWithChildren2;
}(AnimatedNode);
function _inheritsLoose$4(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$4(subClass, superClass);
}
function _setPrototypeOf$4(o, p) {
_setPrototypeOf$4 = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$4(o, p);
}
function ownKeys$1(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$1(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys$1(Object(source), true).forEach(function(key) {
_defineProperty$1(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys$1(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _defineProperty$1(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {value, enumerable: true, configurable: true, writable: true});
} else {
obj[key] = value;
}
return obj;
}
var linear = function linear2(t) {
return t;
};
function createInterpolation(config) {
if (config.outputRange && typeof config.outputRange[0] === "string") {
return createInterpolationFromStringOutputRange(config);
}
var outputRange = config.outputRange;
checkInfiniteRange("outputRange", outputRange);
var inputRange = config.inputRange;
checkInfiniteRange("inputRange", inputRange);
checkValidInputRange(inputRange);
invariant2(inputRange.length === outputRange.length, "inputRange (" + inputRange.length + ") and outputRange (" + outputRange.length + ") must have the same length");
var easing = config.easing || linear;
var extrapolateLeft = "extend";
if (config.extrapolateLeft !== void 0) {
extrapolateLeft = config.extrapolateLeft;
} else if (config.extrapolate !== void 0) {
extrapolateLeft = config.extrapolate;
}
var extrapolateRight = "extend";
if (config.extrapolateRight !== void 0) {
extrapolateRight = config.extrapolateRight;
} else if (config.extrapolate !== void 0) {
extrapolateRight = config.extrapolate;
}
return function(input) {
invariant2(typeof input === "number", "Cannot interpolation an input which is not a number");
var range = findRange(input, inputRange);
return interpolate(input, inputRange[range], inputRange[range + 1], outputRange[range], outputRange[range + 1], easing, extrapolateLeft, extrapolateRight);
};
}
function interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight) {
var result = input;
if (result < inputMin) {
if (extrapolateLeft === "identity") {
return result;
} else if (extrapolateLeft === "clamp") {
result = inputMin;
} else
;
}
if (result > inputMax) {
if (extrapolateRight === "identity") {
return result;
} else if (extrapolateRight === "clamp") {
result = inputMax;
} else
;
}
if (outputMin === outputMax) {
return outputMin;
}
if (inputMin === inputMax) {
if (input <= inputMin) {
return outputMin;
}
return outputMax;
}
if (inputMin === -Infinity) {
result = -result;
} else if (inputMax === Infinity) {
result = result - inputMin;
} else {
result = (result - inputMin) / (inputMax - inputMin);
}
result = easing(result);
if (outputMin === -Infinity) {
result = -result;
} else if (outputMax === Infinity) {
result = result + outputMin;
} else {
result = result * (outputMax - outputMin) + outputMin;
}
return result;
}
function colorToRgba(input) {
var int32Color = normalizeColor$1(input);
if (int32Color === null) {
return input;
}
int32Color = int32Color || 0;
var r = (int32Color & 4278190080) >>> 24;
var g = (int32Color & 16711680) >>> 16;
var b = (int32Color & 65280) >>> 8;
var a = (int32Color & 255) / 255;
return "rgba(" + r + ", " + g + ", " + b + ", " + a + ")";
}
var stringShapeRegex = /[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/g;
function createInterpolationFromStringOutputRange(config) {
var outputRange = config.outputRange;
invariant2(outputRange.length >= 2, "Bad output range");
outputRange = outputRange.map(colorToRgba);
checkPattern(outputRange);
var outputRanges = outputRange[0].match(stringShapeRegex).map(function() {
return [];
});
outputRange.forEach(function(value) {
value.match(stringShapeRegex).forEach(function(number, i) {
outputRanges[i].push(+number);
});
});
var interpolations = outputRange[0].match(stringShapeRegex).map(function(value, i) {
return createInterpolation(_objectSpread$1(_objectSpread$1({}, config), {}, {
outputRange: outputRanges[i]
}));
});
var shouldRound = isRgbOrRgba(outputRange[0]);
return function(input) {
var i = 0;
return outputRange[0].replace(stringShapeRegex, function() {
var val = +interpolations[i++](input);
if (shouldRound) {
val = i < 4 ? Math.round(val) : Math.round(val * 1e3) / 1e3;
}
return String(val);
});
};
}
function isRgbOrRgba(range) {
return typeof range === "string" && range.startsWith("rgb");
}
function checkPattern(arr) {
var pattern2 = arr[0].replace(stringShapeRegex, "");
for (var i = 1; i < arr.length; ++i) {
invariant2(pattern2 === arr[i].replace(stringShapeRegex, ""), "invalid pattern " + arr[0] + " and " + arr[i]);
}
}
function findRange(input, inputRange) {
var i;
for (i = 1; i < inputRange.length - 1; ++i) {
if (inputRange[i] >= input) {
break;
}
}
return i - 1;
}
function checkValidInputRange(arr) {
invariant2(arr.length >= 2, "inputRange must have at least 2 elements");
for (var i = 1; i < arr.length; ++i) {
invariant2(arr[i] >= arr[i - 1], "inputRange must be monotonically non-decreasing " + arr);
}
}
function checkInfiniteRange(name, arr) {
invariant2(arr.length >= 2, name + " must have at least 2 elements");
invariant2(arr.length !== 2 || arr[0] !== -Infinity || arr[1] !== Infinity, name + "cannot be ]-infinity;+infinity[ " + arr);
}
var AnimatedInterpolation = /* @__PURE__ */ function(_AnimatedWithChildren) {
_inheritsLoose$4(AnimatedInterpolation2, _AnimatedWithChildren);
function AnimatedInterpolation2(parent, config) {
var _this;
_this = _AnimatedWithChildren.call(this) || this;
_this._parent = parent;
_this._config = config;
_this._interpolation = createInterpolation(config);
return _this;
}
var _proto = AnimatedInterpolation2.prototype;
_proto.__makeNative = function __makeNative() {
this._parent.__makeNative();
_AnimatedWithChildren.prototype.__makeNative.call(this);
};
_proto.__getValue = function __getValue() {
var parentValue = this._parent.__getValue();
invariant2(typeof parentValue === "number", "Cannot interpolate an input which is not a number.");
return this._interpolation(parentValue);
};
_proto.interpolate = function interpolate2(config) {
return new AnimatedInterpolation2(this, config);
};
_proto.__attach = function __attach() {
this._parent.__addChild(this);
};
_proto.__detach = function __detach() {
this._parent.__removeChild(this);
_AnimatedWithChildren.prototype.__detach.call(this);
};
_proto.__transformDataType = function __transformDataType(range) {
return range.map(NativeAnimatedHelper.transformDataType);
};
_proto.__getNativeConfig = function __getNativeConfig() {
return {
inputRange: this._config.inputRange,
outputRange: this.__transformDataType(this._config.outputRange),
extrapolateLeft: this._config.extrapolateLeft || this._config.extrapolate || "extend",
extrapolateRight: this._config.extrapolateRight || this._config.extrapolate || "extend",
type: "interpolation"
};
};
return AnimatedInterpolation2;
}(AnimatedWithChildren);
AnimatedInterpolation.__createInterpolation = createInterpolation;
var _requestIdleCallback = function _requestIdleCallback2(cb, options) {
return setTimeout(function() {
var start = Date.now();
cb({
didTimeout: false,
timeRemaining: function timeRemaining() {
return Math.max(0, 50 - (Date.now() - start));
}
});
}, 1);
};
var _cancelIdleCallback = function _cancelIdleCallback2(id2) {
clearTimeout(id2);
};
var isSupported = canUseDOM && typeof window.requestIdleCallback !== "undefined";
var requestIdleCallback = isSupported ? window.requestIdleCallback : _requestIdleCallback;
var cancelIdleCallback = isSupported ? window.cancelIdleCallback : _cancelIdleCallback;
var InteractionManager = {
Events: {
interactionStart: "interactionStart",
interactionComplete: "interactionComplete"
},
runAfterInteractions: function runAfterInteractions(task) {
var handle;
var promise = new Promise(function(resolve) {
handle = requestIdleCallback(function() {
if (task) {
resolve(task());
} else {
resolve();
}
});
});
return {
then: promise.then.bind(promise),
done: promise.then.bind(promise),
cancel: function cancel2() {
cancelIdleCallback(handle);
}
};
},
createInteractionHandle: function createInteractionHandle() {
return 1;
},
clearInteractionHandle: function clearInteractionHandle(handle) {
invariant2(!!handle, "Must provide a handle to clear.");
},
addListener: function addListener() {
}
};
function _inheritsLoose$5(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$5(subClass, superClass);
}
function _setPrototypeOf$5(o, p) {
_setPrototypeOf$5 = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$5(o, p);
}
var NativeAnimatedAPI$1 = NativeAnimatedHelper.API;
function _flush(rootNode) {
var animatedStyles = new Set();
function findAnimatedStyles(node) {
if (typeof node.update === "function") {
animatedStyles.add(node);
} else {
node.__getChildren().forEach(findAnimatedStyles);
}
}
findAnimatedStyles(rootNode);
animatedStyles.forEach(function(animatedStyle) {
return animatedStyle.update();
});
}
var AnimatedValue = /* @__PURE__ */ function(_AnimatedWithChildren) {
_inheritsLoose$5(AnimatedValue2, _AnimatedWithChildren);
function AnimatedValue2(value) {
var _this;
_this = _AnimatedWithChildren.call(this) || this;
_this._startingValue = _this._value = value;
_this._offset = 0;
_this._animation = null;
return _this;
}
var _proto = AnimatedValue2.prototype;
_proto.__detach = function __detach() {
this.stopAnimation();
_AnimatedWithChildren.prototype.__detach.call(this);
};
_proto.__getValue = function __getValue() {
return this._value + this._offset;
};
_proto.setValue = function setValue(value) {
if (this._animation) {
this._animation.stop();
this._animation = null;
}
this._updateValue(value, !this.__isNative);
if (this.__isNative) {
NativeAnimatedAPI$1.setAnimatedNodeValue(this.__getNativeTag(), value);
}
};
_proto.setOffset = function setOffset(offset) {
this._offset = offset;
if (this.__isNative) {
NativeAnimatedAPI$1.setAnimatedNodeOffset(this.__getNativeTag(), offset);
}
};
_proto.flattenOffset = function flattenOffset() {
this._value += this._offset;
this._offset = 0;
if (this.__isNative) {
NativeAnimatedAPI$1.flattenAnimatedNodeOffset(this.__getNativeTag());
}
};
_proto.extractOffset = function extractOffset() {
this._offset += this._value;
this._value = 0;
if (this.__isNative) {
NativeAnimatedAPI$1.extractAnimatedNodeOffset(this.__getNativeTag());
}
};
_proto.stopAnimation = function stopAnimation2(callback) {
this.stopTracking();
this._animation && this._animation.stop();
this._animation = null;
callback && callback(this.__getValue());
};
_proto.resetAnimation = function resetAnimation(callback) {
this.stopAnimation(callback);
this._value = this._startingValue;
};
_proto._onAnimatedValueUpdateReceived = function _onAnimatedValueUpdateReceived(value) {
this._updateValue(value, false);
};
_proto.interpolate = function interpolate2(config) {
return new AnimatedInterpolation(this, config);
};
_proto.animate = function animate(animation, callback) {
var _this2 = this;
var handle = null;
if (animation.__isInteraction) {
handle = InteractionManager.createInteractionHandle();
}
var previousAnimation = this._animation;
this._animation && this._animation.stop();
this._animation = animation;
animation.start(this._value, function(value) {
_this2._updateValue(value, true);
}, function(result) {
_this2._animation = null;
if (handle !== null) {
InteractionManager.clearInteractionHandle(handle);
}
callback && callback(result);
}, previousAnimation, this);
};
_proto.stopTracking = function stopTracking() {
this._tracking && this._tracking.__detach();
this._tracking = null;
};
_proto.track = function track(tracking) {
this.stopTracking();
this._tracking = tracking;
};
_proto._updateValue = function _updateValue(value, flush) {
this._value = value;
if (flush) {
_flush(this);
}
_AnimatedWithChildren.prototype.__callListeners.call(this, this.__getValue());
};
_proto.__getNativeConfig = function __getNativeConfig() {
return {
type: "value",
value: this._value,
offset: this._offset
};
};
return AnimatedValue2;
}(AnimatedWithChildren);
var shouldUseNativeDriver$1 = NativeAnimatedHelper.shouldUseNativeDriver;
function attachNativeEvent(viewRef, eventName, argMapping) {
var eventMappings = [];
var traverse = function traverse2(value, path) {
if (value instanceof AnimatedValue) {
value.__makeNative();
eventMappings.push({
nativeEventPath: path,
animatedValueTag: value.__getNativeTag()
});
} else if (typeof value === "object") {
for (var _key in value) {
traverse2(value[_key], path.concat(_key));
}
}
};
invariant2(argMapping[0] && argMapping[0].nativeEvent, "Native driven events only support animated values contained inside `nativeEvent`.");
traverse(argMapping[0].nativeEvent, []);
var viewTag = findNodeHandle(viewRef);
eventMappings.forEach(function(mapping) {
NativeAnimatedHelper.API.addAnimatedEventToView(viewTag, eventName, mapping);
});
return {
detach: function detach() {
eventMappings.forEach(function(mapping) {
NativeAnimatedHelper.API.removeAnimatedEventFromView(viewTag, eventName, mapping.animatedValueTag);
});
}
};
}
var AnimatedEvent = /* @__PURE__ */ function() {
function AnimatedEvent2(argMapping, config) {
if (config === void 0) {
config = {};
}
this._listeners = [];
this._argMapping = argMapping;
if (config.listener) {
this.__addListener(config.listener);
}
this._callListeners = this._callListeners.bind(this);
this._attachedEvent = null;
this.__isNative = shouldUseNativeDriver$1(config);
}
var _proto = AnimatedEvent2.prototype;
_proto.__addListener = function __addListener(callback) {
this._listeners.push(callback);
};
_proto.__removeListener = function __removeListener(callback) {
this._listeners = this._listeners.filter(function(listener) {
return listener !== callback;
});
};
_proto.__attach = function __attach(viewRef, eventName) {
invariant2(this.__isNative, "Only native driven events need to be attached.");
this._attachedEvent = attachNativeEvent(viewRef, eventName, this._argMapping);
};
_proto.__detach = function __detach(viewTag, eventName) {
invariant2(this.__isNative, "Only native driven events need to be detached.");
this._attachedEvent && this._attachedEvent.detach();
};
_proto.__getHandler = function __getHandler() {
var _this = this;
if (this.__isNative) {
return this._callListeners;
}
return function() {
for (var _len = arguments.length, args = new Array(_len), _key2 = 0; _key2 < _len; _key2++) {
args[_key2] = arguments[_key2];
}
var traverse = function traverse2(recMapping, recEvt, key) {
if (typeof recEvt === "number" && recMapping instanceof AnimatedValue) {
recMapping.setValue(recEvt);
} else if (typeof recMapping === "object") {
for (var mappingKey in recMapping) {
traverse2(recMapping[mappingKey], recEvt[mappingKey]);
}
}
};
if (!_this.__isNative) {
_this._argMapping.forEach(function(mapping, idx) {
traverse(mapping, args[idx]);
});
}
_this._callListeners.apply(_this, args);
};
};
_proto._callListeners = function _callListeners() {
for (var _len2 = arguments.length, args = new Array(_len2), _key3 = 0; _key3 < _len2; _key3++) {
args[_key3] = arguments[_key3];
}
this._listeners.forEach(function(listener) {
return listener.apply(void 0, args);
});
};
_proto._validateMapping = function _validateMapping() {
};
return AnimatedEvent2;
}();
function _inheritsLoose$6(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$6(subClass, superClass);
}
function _setPrototypeOf$6(o, p) {
_setPrototypeOf$6 = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$6(o, p);
}
var AnimatedAddition = /* @__PURE__ */ function(_AnimatedWithChildren) {
_inheritsLoose$6(AnimatedAddition2, _AnimatedWithChildren);
function AnimatedAddition2(a, b) {
var _this;
_this = _AnimatedWithChildren.call(this) || this;
_this._a = typeof a === "number" ? new AnimatedValue(a) : a;
_this._b = typeof b === "number" ? new AnimatedValue(b) : b;
return _this;
}
var _proto = AnimatedAddition2.prototype;
_proto.__makeNative = function __makeNative() {
this._a.__makeNative();
this._b.__makeNative();
_AnimatedWithChildren.prototype.__makeNative.call(this);
};
_proto.__getValue = function __getValue() {
return this._a.__getValue() + this._b.__getValue();
};
_proto.interpolate = function interpolate2(config) {
return new AnimatedInterpolation(this, config);
};
_proto.__attach = function __attach() {
this._a.__addChild(this);
this._b.__addChild(this);
};
_proto.__detach = function __detach() {
this._a.__removeChild(this);
this._b.__removeChild(this);
_AnimatedWithChildren.prototype.__detach.call(this);
};
_proto.__getNativeConfig = function __getNativeConfig() {
return {
type: "addition",
input: [this._a.__getNativeTag(), this._b.__getNativeTag()]
};
};
return AnimatedAddition2;
}(AnimatedWithChildren);
function _inheritsLoose$7(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$7(subClass, superClass);
}
function _setPrototypeOf$7(o, p) {
_setPrototypeOf$7 = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$7(o, p);
}
var AnimatedDiffClamp = /* @__PURE__ */ function(_AnimatedWithChildren) {
_inheritsLoose$7(AnimatedDiffClamp2, _AnimatedWithChildren);
function AnimatedDiffClamp2(a, min, max) {
var _this;
_this = _AnimatedWithChildren.call(this) || this;
_this._a = a;
_this._min = min;
_this._max = max;
_this._value = _this._lastValue = _this._a.__getValue();
return _this;
}
var _proto = AnimatedDiffClamp2.prototype;
_proto.__makeNative = function __makeNative() {
this._a.__makeNative();
_AnimatedWithChildren.prototype.__makeNative.call(this);
};
_proto.interpolate = function interpolate2(config) {
return new AnimatedInterpolation(this, config);
};
_proto.__getValue = function __getValue() {
var value = this._a.__getValue();
var diff = value - this._lastValue;
this._lastValue = value;
this._value = Math.min(Math.max(this._value + diff, this._min), this._max);
return this._value;
};
_proto.__attach = function __attach() {
this._a.__addChild(this);
};
_proto.__detach = function __detach() {
this._a.__removeChild(this);
_AnimatedWithChildren.prototype.__detach.call(this);
};
_proto.__getNativeConfig = function __getNativeConfig() {
return {
type: "diffclamp",
input: this._a.__getNativeTag(),
min: this._min,
max: this._max
};
};
return AnimatedDiffClamp2;
}(AnimatedWithChildren);
function _inheritsLoose$8(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$8(subClass, superClass);
}
function _setPrototypeOf$8(o, p) {
_setPrototypeOf$8 = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$8(o, p);
}
var AnimatedDivision = /* @__PURE__ */ function(_AnimatedWithChildren) {
_inheritsLoose$8(AnimatedDivision2, _AnimatedWithChildren);
function AnimatedDivision2(a, b) {
var _this;
_this = _AnimatedWithChildren.call(this) || this;
_this._a = typeof a === "number" ? new AnimatedValue(a) : a;
_this._b = typeof b === "number" ? new AnimatedValue(b) : b;
return _this;
}
var _proto = AnimatedDivision2.prototype;
_proto.__makeNative = function __makeNative() {
this._a.__makeNative();
this._b.__makeNative();
_AnimatedWithChildren.prototype.__makeNative.call(this);
};
_proto.__getValue = function __getValue() {
var a = this._a.__getValue();
var b = this._b.__getValue();
if (b === 0) {
console.error("Detected division by zero in AnimatedDivision");
}
return a / b;
};
_proto.interpolate = function interpolate2(config) {
return new AnimatedInterpolation(this, config);
};
_proto.__attach = function __attach() {
this._a.__addChild(this);
this._b.__addChild(this);
};
_proto.__detach = function __detach() {
this._a.__removeChild(this);
this._b.__removeChild(this);
_AnimatedWithChildren.prototype.__detach.call(this);
};
_proto.__getNativeConfig = function __getNativeConfig() {
return {
type: "division",
input: [this._a.__getNativeTag(), this._b.__getNativeTag()]
};
};
return AnimatedDivision2;
}(AnimatedWithChildren);
function _inheritsLoose$9(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$9(subClass, superClass);
}
function _setPrototypeOf$9(o, p) {
_setPrototypeOf$9 = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$9(o, p);
}
var AnimatedModulo = /* @__PURE__ */ function(_AnimatedWithChildren) {
_inheritsLoose$9(AnimatedModulo2, _AnimatedWithChildren);
function AnimatedModulo2(a, modulus) {
var _this;
_this = _AnimatedWithChildren.call(this) || this;
_this._a = a;
_this._modulus = modulus;
return _this;
}
var _proto = AnimatedModulo2.prototype;
_proto.__makeNative = function __makeNative() {
this._a.__makeNative();
_AnimatedWithChildren.prototype.__makeNative.call(this);
};
_proto.__getValue = function __getValue() {
return (this._a.__getValue() % this._modulus + this._modulus) % this._modulus;
};
_proto.interpolate = function interpolate2(config) {
return new AnimatedInterpolation(this, config);
};
_proto.__attach = function __attach() {
this._a.__addChild(this);
};
_proto.__detach = function __detach() {
this._a.__removeChild(this);
_AnimatedWithChildren.prototype.__detach.call(this);
};
_proto.__getNativeConfig = function __getNativeConfig() {
return {
type: "modulus",
input: this._a.__getNativeTag(),
modulus: this._modulus
};
};
return AnimatedModulo2;
}(AnimatedWithChildren);
function _inheritsLoose$a(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$a(subClass, superClass);
}
function _setPrototypeOf$a(o, p) {
_setPrototypeOf$a = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$a(o, p);
}
var AnimatedMultiplication = /* @__PURE__ */ function(_AnimatedWithChildren) {
_inheritsLoose$a(AnimatedMultiplication2, _AnimatedWithChildren);
function AnimatedMultiplication2(a, b) {
var _this;
_this = _AnimatedWithChildren.call(this) || this;
_this._a = typeof a === "number" ? new AnimatedValue(a) : a;
_this._b = typeof b === "number" ? new AnimatedValue(b) : b;
return _this;
}
var _proto = AnimatedMultiplication2.prototype;
_proto.__makeNative = function __makeNative() {
this._a.__makeNative();
this._b.__makeNative();
_AnimatedWithChildren.prototype.__makeNative.call(this);
};
_proto.__getValue = function __getValue() {
return this._a.__getValue() * this._b.__getValue();
};
_proto.interpolate = function interpolate2(config) {
return new AnimatedInterpolation(this, config);
};
_proto.__attach = function __attach() {
this._a.__addChild(this);
this._b.__addChild(this);
};
_proto.__detach = function __detach() {
this._a.__removeChild(this);
this._b.__removeChild(this);
_AnimatedWithChildren.prototype.__detach.call(this);
};
_proto.__getNativeConfig = function __getNativeConfig() {
return {
type: "multiplication",
input: [this._a.__getNativeTag(), this._b.__getNativeTag()]
};
};
return AnimatedMultiplication2;
}(AnimatedWithChildren);
function _inheritsLoose$b(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$b(subClass, superClass);
}
function _setPrototypeOf$b(o, p) {
_setPrototypeOf$b = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$b(o, p);
}
var AnimatedTransform = /* @__PURE__ */ function(_AnimatedWithChildren) {
_inheritsLoose$b(AnimatedTransform2, _AnimatedWithChildren);
function AnimatedTransform2(transforms) {
var _this;
_this = _AnimatedWithChildren.call(this) || this;
_this._transforms = transforms;
return _this;
}
var _proto = AnimatedTransform2.prototype;
_proto.__makeNative = function __makeNative() {
_AnimatedWithChildren.prototype.__makeNative.call(this);
this._transforms.forEach(function(transform) {
for (var key in transform) {
var value = transform[key];
if (value instanceof AnimatedNode) {
value.__makeNative();
}
}
});
};
_proto.__getValue = function __getValue() {
return this._transforms.map(function(transform) {
var result = {};
for (var key in transform) {
var value = transform[key];
if (value instanceof AnimatedNode) {
result[key] = value.__getValue();
} else {
result[key] = value;
}
}
return result;
});
};
_proto.__getAnimatedValue = function __getAnimatedValue() {
return this._transforms.map(function(transform) {
var result = {};
for (var key in transform) {
var value = transform[key];
if (value instanceof AnimatedNode) {
result[key] = value.__getAnimatedValue();
} else {
result[key] = value;
}
}
return result;
});
};
_proto.__attach = function __attach() {
var _this2 = this;
this._transforms.forEach(function(transform) {
for (var key in transform) {
var value = transform[key];
if (value instanceof AnimatedNode) {
value.__addChild(_this2);
}
}
});
};
_proto.__detach = function __detach() {
var _this3 = this;
this._transforms.forEach(function(transform) {
for (var key in transform) {
var value = transform[key];
if (value instanceof AnimatedNode) {
value.__removeChild(_this3);
}
}
});
_AnimatedWithChildren.prototype.__detach.call(this);
};
_proto.__getNativeConfig = function __getNativeConfig() {
var transConfigs = [];
this._transforms.forEach(function(transform) {
for (var key in transform) {
var value = transform[key];
if (value instanceof AnimatedNode) {
transConfigs.push({
type: "animated",
property: key,
nodeTag: value.__getNativeTag()
});
} else {
transConfigs.push({
type: "static",
property: key,
value
});
}
}
});
NativeAnimatedHelper.validateTransform(transConfigs);
return {
type: "transform",
transforms: transConfigs
};
};
return AnimatedTransform2;
}(AnimatedWithChildren);
function ownKeys$2(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys$2(Object(source), true).forEach(function(key) {
_defineProperty$2(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys$2(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _defineProperty$2(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {value, enumerable: true, configurable: true, writable: true});
} else {
obj[key] = value;
}
return obj;
}
function _inheritsLoose$c(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$c(subClass, superClass);
}
function _setPrototypeOf$c(o, p) {
_setPrototypeOf$c = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$c(o, p);
}
var flattenStyle$1 = StyleSheet.flatten;
var AnimatedStyle = /* @__PURE__ */ function(_AnimatedWithChildren) {
_inheritsLoose$c(AnimatedStyle2, _AnimatedWithChildren);
function AnimatedStyle2(style) {
var _this;
_this = _AnimatedWithChildren.call(this) || this;
style = flattenStyle$1(style) || {};
if (style.transform) {
style = _objectSpread$2(_objectSpread$2({}, style), {}, {
transform: new AnimatedTransform(style.transform)
});
}
_this._style = style;
return _this;
}
var _proto = AnimatedStyle2.prototype;
_proto._walkStyleAndGetValues = function _walkStyleAndGetValues(style) {
var updatedStyle = {};
for (var key in style) {
var value = style[key];
if (value instanceof AnimatedNode) {
if (!value.__isNative) {
updatedStyle[key] = value.__getValue();
}
} else if (value && !Array.isArray(value) && typeof value === "object") {
updatedStyle[key] = this._walkStyleAndGetValues(value);
} else {
updatedStyle[key] = value;
}
}
return updatedStyle;
};
_proto.__getValue = function __getValue() {
return this._walkStyleAndGetValues(this._style);
};
_proto._walkStyleAndGetAnimatedValues = function _walkStyleAndGetAnimatedValues(style) {
var updatedStyle = {};
for (var key in style) {
var value = style[key];
if (value instanceof AnimatedNode) {
updatedStyle[key] = value.__getAnimatedValue();
} else if (value && !Array.isArray(value) && typeof value === "object") {
updatedStyle[key] = this._walkStyleAndGetAnimatedValues(value);
}
}
return updatedStyle;
};
_proto.__getAnimatedValue = function __getAnimatedValue() {
return this._walkStyleAndGetAnimatedValues(this._style);
};
_proto.__attach = function __attach() {
for (var key in this._style) {
var value = this._style[key];
if (value instanceof AnimatedNode) {
value.__addChild(this);
}
}
};
_proto.__detach = function __detach() {
for (var key in this._style) {
var value = this._style[key];
if (value instanceof AnimatedNode) {
value.__removeChild(this);
}
}
_AnimatedWithChildren.prototype.__detach.call(this);
};
_proto.__makeNative = function __makeNative() {
for (var key in this._style) {
var value = this._style[key];
if (value instanceof AnimatedNode) {
value.__makeNative();
}
}
_AnimatedWithChildren.prototype.__makeNative.call(this);
};
_proto.__getNativeConfig = function __getNativeConfig() {
var styleConfig = {};
for (var styleKey in this._style) {
if (this._style[styleKey] instanceof AnimatedNode) {
var style = this._style[styleKey];
style.__makeNative();
styleConfig[styleKey] = style.__getNativeTag();
}
}
NativeAnimatedHelper.validateStyles(styleConfig);
return {
type: "style",
style: styleConfig
};
};
return AnimatedStyle2;
}(AnimatedWithChildren);
function ownKeys$3(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$3(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys$3(Object(source), true).forEach(function(key) {
_defineProperty$3(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys$3(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _defineProperty$3(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {value, enumerable: true, configurable: true, writable: true});
} else {
obj[key] = value;
}
return obj;
}
function _inheritsLoose$d(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$d(subClass, superClass);
}
function _setPrototypeOf$d(o, p) {
_setPrototypeOf$d = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$d(o, p);
}
var AnimatedProps = /* @__PURE__ */ function(_AnimatedNode) {
_inheritsLoose$d(AnimatedProps2, _AnimatedNode);
function AnimatedProps2(props, callback) {
var _this;
_this = _AnimatedNode.call(this) || this;
if (props.style) {
props = _objectSpread$3(_objectSpread$3({}, props), {}, {
style: new AnimatedStyle(props.style)
});
}
_this._props = props;
_this._callback = callback;
_this.__attach();
return _this;
}
var _proto = AnimatedProps2.prototype;
_proto.__getValue = function __getValue() {
var props = {};
for (var key in this._props) {
var value = this._props[key];
if (value instanceof AnimatedNode) {
if (!value.__isNative || value instanceof AnimatedStyle) {
props[key] = value.__getValue();
}
} else if (value instanceof AnimatedEvent) {
props[key] = value.__getHandler();
} else {
props[key] = value;
}
}
return props;
};
_proto.__getAnimatedValue = function __getAnimatedValue() {
var props = {};
for (var key in this._props) {
var value = this._props[key];
if (value instanceof AnimatedNode) {
props[key] = value.__getAnimatedValue();
}
}
return props;
};
_proto.__attach = function __attach() {
for (var key in this._props) {
var value = this._props[key];
if (value instanceof AnimatedNode) {
value.__addChild(this);
}
}
};
_proto.__detach = function __detach() {
if (this.__isNative && this._animatedView) {
this.__disconnectAnimatedView();
}
for (var key in this._props) {
var value = this._props[key];
if (value instanceof AnimatedNode) {
value.__removeChild(this);
}
}
_AnimatedNode.prototype.__detach.call(this);
};
_proto.update = function update() {
this._callback();
};
_proto.__makeNative = function __makeNative() {
if (!this.__isNative) {
this.__isNative = true;
for (var key in this._props) {
var value = this._props[key];
if (value instanceof AnimatedNode) {
value.__makeNative();
}
}
if (this._animatedView) {
this.__connectAnimatedView();
}
}
};
_proto.setNativeView = function setNativeView(animatedView) {
if (this._animatedView === animatedView) {
return;
}
this._animatedView = animatedView;
if (this.__isNative) {
this.__connectAnimatedView();
}
};
_proto.__connectAnimatedView = function __connectAnimatedView() {
invariant2(this.__isNative, 'Expected node to be marked as "native"');
var nativeViewTag = findNodeHandle(this._animatedView);
invariant2(nativeViewTag != null, "Unable to locate attached view in the native tree");
NativeAnimatedHelper.API.connectAnimatedNodeToView(this.__getNativeTag(), nativeViewTag);
};
_proto.__disconnectAnimatedView = function __disconnectAnimatedView() {
invariant2(this.__isNative, 'Expected node to be marked as "native"');
var nativeViewTag = findNodeHandle(this._animatedView);
invariant2(nativeViewTag != null, "Unable to locate attached view in the native tree");
NativeAnimatedHelper.API.disconnectAnimatedNodeFromView(this.__getNativeTag(), nativeViewTag);
};
_proto.__getNativeConfig = function __getNativeConfig() {
var propsConfig = {};
for (var propKey in this._props) {
var value = this._props[propKey];
if (value instanceof AnimatedNode) {
value.__makeNative();
propsConfig[propKey] = value.__getNativeTag();
}
}
return {
type: "props",
props: propsConfig
};
};
return AnimatedProps2;
}(AnimatedNode);
function _inheritsLoose$e(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$e(subClass, superClass);
}
function _setPrototypeOf$e(o, p) {
_setPrototypeOf$e = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$e(o, p);
}
var AnimatedSubtraction = /* @__PURE__ */ function(_AnimatedWithChildren) {
_inheritsLoose$e(AnimatedSubtraction2, _AnimatedWithChildren);
function AnimatedSubtraction2(a, b) {
var _this;
_this = _AnimatedWithChildren.call(this) || this;
_this._a = typeof a === "number" ? new AnimatedValue(a) : a;
_this._b = typeof b === "number" ? new AnimatedValue(b) : b;
return _this;
}
var _proto = AnimatedSubtraction2.prototype;
_proto.__makeNative = function __makeNative() {
this._a.__makeNative();
this._b.__makeNative();
_AnimatedWithChildren.prototype.__makeNative.call(this);
};
_proto.__getValue = function __getValue() {
return this._a.__getValue() - this._b.__getValue();
};
_proto.interpolate = function interpolate2(config) {
return new AnimatedInterpolation(this, config);
};
_proto.__attach = function __attach() {
this._a.__addChild(this);
this._b.__addChild(this);
};
_proto.__detach = function __detach() {
this._a.__removeChild(this);
this._b.__removeChild(this);
_AnimatedWithChildren.prototype.__detach.call(this);
};
_proto.__getNativeConfig = function __getNativeConfig() {
return {
type: "subtraction",
input: [this._a.__getNativeTag(), this._b.__getNativeTag()]
};
};
return AnimatedSubtraction2;
}(AnimatedWithChildren);
function ownKeys$4(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$4(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys$4(Object(source), true).forEach(function(key) {
_defineProperty$4(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys$4(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _defineProperty$4(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {value, enumerable: true, configurable: true, writable: true});
} else {
obj[key] = value;
}
return obj;
}
function _inheritsLoose$f(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$f(subClass, superClass);
}
function _setPrototypeOf$f(o, p) {
_setPrototypeOf$f = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$f(o, p);
}
var AnimatedTracking = /* @__PURE__ */ function(_AnimatedNode) {
_inheritsLoose$f(AnimatedTracking2, _AnimatedNode);
function AnimatedTracking2(value, parent, animationClass, animationConfig, callback) {
var _this;
_this = _AnimatedNode.call(this) || this;
_this._value = value;
_this._parent = parent;
_this._animationClass = animationClass;
_this._animationConfig = animationConfig;
_this._useNativeDriver = shouldUseNativeDriver(animationConfig);
_this._callback = callback;
_this.__attach();
return _this;
}
var _proto = AnimatedTracking2.prototype;
_proto.__makeNative = function __makeNative() {
this.__isNative = true;
this._parent.__makeNative();
_AnimatedNode.prototype.__makeNative.call(this);
this._value.__makeNative();
};
_proto.__getValue = function __getValue() {
return this._parent.__getValue();
};
_proto.__attach = function __attach() {
this._parent.__addChild(this);
if (this._useNativeDriver) {
this.__makeNative();
}
};
_proto.__detach = function __detach() {
this._parent.__removeChild(this);
_AnimatedNode.prototype.__detach.call(this);
};
_proto.update = function update() {
this._value.animate(new this._animationClass(_objectSpread$4(_objectSpread$4({}, this._animationConfig), {}, {
toValue: this._animationConfig.toValue.__getValue()
})), this._callback);
};
_proto.__getNativeConfig = function __getNativeConfig() {
var animation = new this._animationClass(_objectSpread$4(_objectSpread$4({}, this._animationConfig), {}, {
toValue: void 0
}));
var animationConfig = animation.__getNativeAnimationConfig();
return {
type: "tracking",
animationId: generateNewAnimationId(),
animationConfig,
toValue: this._parent.__getNativeTag(),
value: this._value.__getNativeTag()
};
};
return AnimatedTracking2;
}(AnimatedNode);
function _inheritsLoose$g(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$g(subClass, superClass);
}
function _setPrototypeOf$g(o, p) {
_setPrototypeOf$g = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$g(o, p);
}
var _uniqueId$1 = 1;
var AnimatedValueXY = /* @__PURE__ */ function(_AnimatedWithChildren) {
_inheritsLoose$g(AnimatedValueXY2, _AnimatedWithChildren);
function AnimatedValueXY2(valueIn) {
var _this;
_this = _AnimatedWithChildren.call(this) || this;
var value = valueIn || {
x: 0,
y: 0
};
if (typeof value.x === "number" && typeof value.y === "number") {
_this.x = new AnimatedValue(value.x);
_this.y = new AnimatedValue(value.y);
} else {
invariant2(value.x instanceof AnimatedValue && value.y instanceof AnimatedValue, "AnimatedValueXY must be initialized with an object of numbers or AnimatedValues.");
_this.x = value.x;
_this.y = value.y;
}
_this._listeners = {};
return _this;
}
var _proto = AnimatedValueXY2.prototype;
_proto.setValue = function setValue(value) {
this.x.setValue(value.x);
this.y.setValue(value.y);
};
_proto.setOffset = function setOffset(offset) {
this.x.setOffset(offset.x);
this.y.setOffset(offset.y);
};
_proto.flattenOffset = function flattenOffset() {
this.x.flattenOffset();
this.y.flattenOffset();
};
_proto.extractOffset = function extractOffset() {
this.x.extractOffset();
this.y.extractOffset();
};
_proto.__getValue = function __getValue() {
return {
x: this.x.__getValue(),
y: this.y.__getValue()
};
};
_proto.resetAnimation = function resetAnimation(callback) {
this.x.resetAnimation();
this.y.resetAnimation();
callback && callback(this.__getValue());
};
_proto.stopAnimation = function stopAnimation2(callback) {
this.x.stopAnimation();
this.y.stopAnimation();
callback && callback(this.__getValue());
};
_proto.addListener = function addListener3(callback) {
var _this2 = this;
var id2 = String(_uniqueId$1++);
var jointCallback = function jointCallback2(_ref) {
var number = _ref.value;
callback(_this2.__getValue());
};
this._listeners[id2] = {
x: this.x.addListener(jointCallback),
y: this.y.addListener(jointCallback)
};
return id2;
};
_proto.removeListener = function removeListener2(id2) {
this.x.removeListener(this._listeners[id2].x);
this.y.removeListener(this._listeners[id2].y);
delete this._listeners[id2];
};
_proto.removeAllListeners = function removeAllListeners2() {
this.x.removeAllListeners();
this.y.removeAllListeners();
this._listeners = {};
};
_proto.getLayout = function getLayout() {
return {
left: this.x,
top: this.y
};
};
_proto.getTranslateTransform = function getTranslateTransform() {
return [{
translateX: this.x
}, {
translateY: this.y
}];
};
return AnimatedValueXY2;
}(AnimatedWithChildren);
var global$1 = typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};
var Animation = /* @__PURE__ */ function() {
function Animation2() {
}
var _proto = Animation2.prototype;
_proto.start = function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {
};
_proto.stop = function stop() {
if (this.__nativeId) {
NativeAnimatedHelper.API.stopAnimation(this.__nativeId);
}
};
_proto.__getNativeAnimationConfig = function __getNativeAnimationConfig() {
throw new Error("This animation type cannot be offloaded to native");
};
_proto.__debouncedOnEnd = function __debouncedOnEnd(result) {
var onEnd = this.__onEnd;
this.__onEnd = null;
onEnd && onEnd(result);
};
_proto.__startNativeAnimation = function __startNativeAnimation(animatedValue) {
NativeAnimatedHelper.API.enableQueue();
animatedValue.__makeNative();
NativeAnimatedHelper.API.disableQueue();
this.__nativeId = NativeAnimatedHelper.generateNewAnimationId();
NativeAnimatedHelper.API.startAnimatingNode(this.__nativeId, animatedValue.__getNativeTag(), this.__getNativeAnimationConfig(), this.__debouncedOnEnd.bind(this));
};
return Animation2;
}();
function _inheritsLoose$h(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$h(subClass, superClass);
}
function _setPrototypeOf$h(o, p) {
_setPrototypeOf$h = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$h(o, p);
}
var DecayAnimation = /* @__PURE__ */ function(_Animation) {
_inheritsLoose$h(DecayAnimation2, _Animation);
function DecayAnimation2(config) {
var _config$deceleration, _config$isInteraction, _config$iterations;
var _this;
_this = _Animation.call(this) || this;
_this._deceleration = (_config$deceleration = config.deceleration) !== null && _config$deceleration !== void 0 ? _config$deceleration : 0.998;
_this._velocity = config.velocity;
_this._useNativeDriver = shouldUseNativeDriver(config);
_this.__isInteraction = (_config$isInteraction = config.isInteraction) !== null && _config$isInteraction !== void 0 ? _config$isInteraction : !_this._useNativeDriver;
_this.__iterations = (_config$iterations = config.iterations) !== null && _config$iterations !== void 0 ? _config$iterations : 1;
return _this;
}
var _proto = DecayAnimation2.prototype;
_proto.__getNativeAnimationConfig = function __getNativeAnimationConfig() {
return {
type: "decay",
deceleration: this._deceleration,
velocity: this._velocity,
iterations: this.__iterations
};
};
_proto.start = function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {
this.__active = true;
this._lastValue = fromValue;
this._fromValue = fromValue;
this._onUpdate = onUpdate;
this.__onEnd = onEnd;
this._startTime = Date.now();
if (this._useNativeDriver) {
this.__startNativeAnimation(animatedValue);
} else {
this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));
}
};
_proto.onUpdate = function onUpdate() {
var now = Date.now();
var value = this._fromValue + this._velocity / (1 - this._deceleration) * (1 - Math.exp(-(1 - this._deceleration) * (now - this._startTime)));
this._onUpdate(value);
if (Math.abs(this._lastValue - value) < 0.1) {
this.__debouncedOnEnd({
finished: true
});
return;
}
this._lastValue = value;
if (this.__active) {
this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));
}
};
_proto.stop = function stop() {
_Animation.prototype.stop.call(this);
this.__active = false;
global$1.cancelAnimationFrame(this._animationFrame);
this.__debouncedOnEnd({
finished: false
});
};
return DecayAnimation2;
}(Animation);
function stiffnessFromOrigamiValue(oValue) {
return (oValue - 30) * 3.62 + 194;
}
function dampingFromOrigamiValue(oValue) {
return (oValue - 8) * 3 + 25;
}
function fromOrigamiTensionAndFriction(tension, friction) {
return {
stiffness: stiffnessFromOrigamiValue(tension),
damping: dampingFromOrigamiValue(friction)
};
}
function fromBouncinessAndSpeed(bounciness, speed) {
function normalize(value, startValue, endValue) {
return (value - startValue) / (endValue - startValue);
}
function projectNormal(n, start, end) {
return start + n * (end - start);
}
function linearInterpolation(t, start, end) {
return t * end + (1 - t) * start;
}
function quadraticOutInterpolation(t, start, end) {
return linearInterpolation(2 * t - t * t, start, end);
}
function b3Friction1(x) {
return 7e-4 * Math.pow(x, 3) - 0.031 * Math.pow(x, 2) + 0.64 * x + 1.28;
}
function b3Friction2(x) {
return 44e-6 * Math.pow(x, 3) - 6e-3 * Math.pow(x, 2) + 0.36 * x + 2;
}
function b3Friction3(x) {
return 45e-8 * Math.pow(x, 3) - 332e-6 * Math.pow(x, 2) + 0.1078 * x + 5.84;
}
function b3Nobounce(tension) {
if (tension <= 18) {
return b3Friction1(tension);
} else if (tension > 18 && tension <= 44) {
return b3Friction2(tension);
} else {
return b3Friction3(tension);
}
}
var b = normalize(bounciness / 1.7, 0, 20);
b = projectNormal(b, 0, 0.8);
var s = normalize(speed / 1.7, 0, 20);
var bouncyTension = projectNormal(s, 0.5, 200);
var bouncyFriction = quadraticOutInterpolation(b, b3Nobounce(bouncyTension), 0.01);
return {
stiffness: stiffnessFromOrigamiValue(bouncyTension),
damping: dampingFromOrigamiValue(bouncyFriction)
};
}
var SpringConfig = {
fromOrigamiTensionAndFriction,
fromBouncinessAndSpeed
};
function _inheritsLoose$i(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$i(subClass, superClass);
}
function _setPrototypeOf$i(o, p) {
_setPrototypeOf$i = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$i(o, p);
}
var SpringAnimation = /* @__PURE__ */ function(_Animation) {
_inheritsLoose$i(SpringAnimation2, _Animation);
function SpringAnimation2(config) {
var _config$overshootClam, _config$restDisplacem, _config$restSpeedThre, _config$velocity, _config$velocity2, _config$delay, _config$isInteraction, _config$iterations;
var _this;
_this = _Animation.call(this) || this;
_this._overshootClamping = (_config$overshootClam = config.overshootClamping) !== null && _config$overshootClam !== void 0 ? _config$overshootClam : false;
_this._restDisplacementThreshold = (_config$restDisplacem = config.restDisplacementThreshold) !== null && _config$restDisplacem !== void 0 ? _config$restDisplacem : 1e-3;
_this._restSpeedThreshold = (_config$restSpeedThre = config.restSpeedThreshold) !== null && _config$restSpeedThre !== void 0 ? _config$restSpeedThre : 1e-3;
_this._initialVelocity = (_config$velocity = config.velocity) !== null && _config$velocity !== void 0 ? _config$velocity : 0;
_this._lastVelocity = (_config$velocity2 = config.velocity) !== null && _config$velocity2 !== void 0 ? _config$velocity2 : 0;
_this._toValue = config.toValue;
_this._delay = (_config$delay = config.delay) !== null && _config$delay !== void 0 ? _config$delay : 0;
_this._useNativeDriver = shouldUseNativeDriver(config);
_this.__isInteraction = (_config$isInteraction = config.isInteraction) !== null && _config$isInteraction !== void 0 ? _config$isInteraction : !_this._useNativeDriver;
_this.__iterations = (_config$iterations = config.iterations) !== null && _config$iterations !== void 0 ? _config$iterations : 1;
if (config.stiffness !== void 0 || config.damping !== void 0 || config.mass !== void 0) {
var _config$stiffness, _config$damping, _config$mass;
invariant2(config.bounciness === void 0 && config.speed === void 0 && config.tension === void 0 && config.friction === void 0, "You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one");
_this._stiffness = (_config$stiffness = config.stiffness) !== null && _config$stiffness !== void 0 ? _config$stiffness : 100;
_this._damping = (_config$damping = config.damping) !== null && _config$damping !== void 0 ? _config$damping : 10;
_this._mass = (_config$mass = config.mass) !== null && _config$mass !== void 0 ? _config$mass : 1;
} else if (config.bounciness !== void 0 || config.speed !== void 0) {
var _config$bounciness, _config$speed;
invariant2(config.tension === void 0 && config.friction === void 0 && config.stiffness === void 0 && config.damping === void 0 && config.mass === void 0, "You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one");
var springConfig = SpringConfig.fromBouncinessAndSpeed((_config$bounciness = config.bounciness) !== null && _config$bounciness !== void 0 ? _config$bounciness : 8, (_config$speed = config.speed) !== null && _config$speed !== void 0 ? _config$speed : 12);
_this._stiffness = springConfig.stiffness;
_this._damping = springConfig.damping;
_this._mass = 1;
} else {
var _config$tension, _config$friction;
var _springConfig = SpringConfig.fromOrigamiTensionAndFriction((_config$tension = config.tension) !== null && _config$tension !== void 0 ? _config$tension : 40, (_config$friction = config.friction) !== null && _config$friction !== void 0 ? _config$friction : 7);
_this._stiffness = _springConfig.stiffness;
_this._damping = _springConfig.damping;
_this._mass = 1;
}
invariant2(_this._stiffness > 0, "Stiffness value must be greater than 0");
invariant2(_this._damping > 0, "Damping value must be greater than 0");
invariant2(_this._mass > 0, "Mass value must be greater than 0");
return _this;
}
var _proto = SpringAnimation2.prototype;
_proto.__getNativeAnimationConfig = function __getNativeAnimationConfig() {
var _this$_initialVelocit;
return {
type: "spring",
overshootClamping: this._overshootClamping,
restDisplacementThreshold: this._restDisplacementThreshold,
restSpeedThreshold: this._restSpeedThreshold,
stiffness: this._stiffness,
damping: this._damping,
mass: this._mass,
initialVelocity: (_this$_initialVelocit = this._initialVelocity) !== null && _this$_initialVelocit !== void 0 ? _this$_initialVelocit : this._lastVelocity,
toValue: this._toValue,
iterations: this.__iterations
};
};
_proto.start = function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {
var _this2 = this;
this.__active = true;
this._startPosition = fromValue;
this._lastPosition = this._startPosition;
this._onUpdate = onUpdate;
this.__onEnd = onEnd;
this._lastTime = Date.now();
this._frameTime = 0;
if (previousAnimation instanceof SpringAnimation2) {
var internalState = previousAnimation.getInternalState();
this._lastPosition = internalState.lastPosition;
this._lastVelocity = internalState.lastVelocity;
this._initialVelocity = this._lastVelocity;
this._lastTime = internalState.lastTime;
}
var start2 = function start3() {
if (_this2._useNativeDriver) {
_this2.__startNativeAnimation(animatedValue);
} else {
_this2.onUpdate();
}
};
if (this._delay) {
this._timeout = setTimeout(start2, this._delay);
} else {
start2();
}
};
_proto.getInternalState = function getInternalState() {
return {
lastPosition: this._lastPosition,
lastVelocity: this._lastVelocity,
lastTime: this._lastTime
};
};
_proto.onUpdate = function onUpdate() {
var MAX_STEPS = 64;
var now = Date.now();
if (now > this._lastTime + MAX_STEPS) {
now = this._lastTime + MAX_STEPS;
}
var deltaTime = (now - this._lastTime) / 1e3;
this._frameTime += deltaTime;
var c = this._damping;
var m2 = this._mass;
var k = this._stiffness;
var v0 = -this._initialVelocity;
var zeta = c / (2 * Math.sqrt(k * m2));
var omega0 = Math.sqrt(k / m2);
var omega1 = omega0 * Math.sqrt(1 - zeta * zeta);
var x0 = this._toValue - this._startPosition;
var position3 = 0;
var velocity = 0;
var t = this._frameTime;
if (zeta < 1) {
var envelope = Math.exp(-zeta * omega0 * t);
position3 = this._toValue - envelope * ((v0 + zeta * omega0 * x0) / omega1 * Math.sin(omega1 * t) + x0 * Math.cos(omega1 * t));
velocity = zeta * omega0 * envelope * (Math.sin(omega1 * t) * (v0 + zeta * omega0 * x0) / omega1 + x0 * Math.cos(omega1 * t)) - envelope * (Math.cos(omega1 * t) * (v0 + zeta * omega0 * x0) - omega1 * x0 * Math.sin(omega1 * t));
} else {
var _envelope = Math.exp(-omega0 * t);
position3 = this._toValue - _envelope * (x0 + (v0 + omega0 * x0) * t);
velocity = _envelope * (v0 * (t * omega0 - 1) + t * x0 * (omega0 * omega0));
}
this._lastTime = now;
this._lastPosition = position3;
this._lastVelocity = velocity;
this._onUpdate(position3);
if (!this.__active) {
return;
}
var isOvershooting = false;
if (this._overshootClamping && this._stiffness !== 0) {
if (this._startPosition < this._toValue) {
isOvershooting = position3 > this._toValue;
} else {
isOvershooting = position3 < this._toValue;
}
}
var isVelocity = Math.abs(velocity) <= this._restSpeedThreshold;
var isDisplacement = true;
if (this._stiffness !== 0) {
isDisplacement = Math.abs(this._toValue - position3) <= this._restDisplacementThreshold;
}
if (isOvershooting || isVelocity && isDisplacement) {
if (this._stiffness !== 0) {
this._lastPosition = this._toValue;
this._lastVelocity = 0;
this._onUpdate(this._toValue);
}
this.__debouncedOnEnd({
finished: true
});
return;
}
this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));
};
_proto.stop = function stop() {
_Animation.prototype.stop.call(this);
this.__active = false;
clearTimeout(this._timeout);
global$1.cancelAnimationFrame(this._animationFrame);
this.__debouncedOnEnd({
finished: false
});
};
return SpringAnimation2;
}(Animation);
var NEWTON_ITERATIONS = 4;
var NEWTON_MIN_SLOPE = 1e-3;
var SUBDIVISION_PRECISION = 1e-7;
var SUBDIVISION_MAX_ITERATIONS = 10;
var kSplineTableSize = 11;
var kSampleStepSize = 1 / (kSplineTableSize - 1);
var float32ArraySupported = typeof Float32Array === "function";
function A(aA1, aA2) {
return 1 - 3 * aA2 + 3 * aA1;
}
function B(aA1, aA2) {
return 3 * aA2 - 6 * aA1;
}
function C(aA1) {
return 3 * aA1;
}
function calcBezier(aT, aA1, aA2) {
return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;
}
function getSlope(aT, aA1, aA2) {
return 3 * A(aA1, aA2) * aT * aT + 2 * B(aA1, aA2) * aT + C(aA1);
}
function binarySubdivide(aX, _aA, _aB, mX1, mX2) {
var currentX, currentT, i = 0, aA = _aA, aB = _aB;
do {
currentT = aA + (aB - aA) / 2;
currentX = calcBezier(currentT, mX1, mX2) - aX;
if (currentX > 0) {
aB = currentT;
} else {
aA = currentT;
}
} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
return currentT;
}
function newtonRaphsonIterate(aX, _aGuessT, mX1, mX2) {
var aGuessT = _aGuessT;
for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
var currentSlope = getSlope(aGuessT, mX1, mX2);
if (currentSlope === 0) {
return aGuessT;
}
var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
aGuessT -= currentX / currentSlope;
}
return aGuessT;
}
function bezier(mX1, mY1, mX2, mY2) {
if (!(mX1 >= 0 && mX1 <= 1 && mX2 >= 0 && mX2 <= 1)) {
throw new Error("bezier x values must be in [0, 1] range");
}
var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
if (mX1 !== mY1 || mX2 !== mY2) {
for (var i = 0; i < kSplineTableSize; ++i) {
sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
}
}
function getTForX(aX) {
var intervalStart = 0;
var currentSample = 1;
var lastSample = kSplineTableSize - 1;
for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
intervalStart += kSampleStepSize;
}
--currentSample;
var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);
var guessForT = intervalStart + dist * kSampleStepSize;
var initialSlope = getSlope(guessForT, mX1, mX2);
if (initialSlope >= NEWTON_MIN_SLOPE) {
return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
} else if (initialSlope === 0) {
return guessForT;
} else {
return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
}
}
return function BezierEasing(x) {
if (mX1 === mY1 && mX2 === mY2) {
return x;
}
if (x === 0) {
return 0;
}
if (x === 1) {
return 1;
}
return calcBezier(getTForX(x), mY1, mY2);
};
}
var _ease;
var Easing = /* @__PURE__ */ function() {
function Easing2() {
}
Easing2.step0 = function step0(n) {
return n > 0 ? 1 : 0;
};
Easing2.step1 = function step1(n) {
return n >= 1 ? 1 : 0;
};
Easing2.linear = function linear3(t) {
return t;
};
Easing2.ease = function ease(t) {
if (!_ease) {
_ease = Easing2.bezier(0.42, 0, 1, 1);
}
return _ease(t);
};
Easing2.quad = function quad(t) {
return t * t;
};
Easing2.cubic = function cubic(t) {
return t * t * t;
};
Easing2.poly = function poly(n) {
return function(t) {
return Math.pow(t, n);
};
};
Easing2.sin = function sin(t) {
return 1 - Math.cos(t * Math.PI / 2);
};
Easing2.circle = function circle(t) {
return 1 - Math.sqrt(1 - t * t);
};
Easing2.exp = function exp(t) {
return Math.pow(2, 10 * (t - 1));
};
Easing2.elastic = function elastic(bounciness) {
if (bounciness === void 0) {
bounciness = 1;
}
var p = bounciness * Math.PI;
return function(t) {
return 1 - Math.pow(Math.cos(t * Math.PI / 2), 3) * Math.cos(t * p);
};
};
Easing2.back = function back(s) {
if (s === void 0) {
s = 1.70158;
}
return function(t) {
return t * t * ((s + 1) * t - s);
};
};
Easing2.bounce = function bounce(t) {
if (t < 1 / 2.75) {
return 7.5625 * t * t;
}
if (t < 2 / 2.75) {
var _t = t - 1.5 / 2.75;
return 7.5625 * _t * _t + 0.75;
}
if (t < 2.5 / 2.75) {
var _t2 = t - 2.25 / 2.75;
return 7.5625 * _t2 * _t2 + 0.9375;
}
var t2 = t - 2.625 / 2.75;
return 7.5625 * t2 * t2 + 0.984375;
};
Easing2.bezier = function bezier$1(x1, y1, x2, y2) {
return bezier(x1, y1, x2, y2);
};
Easing2.in = function _in(easing) {
return easing;
};
Easing2.out = function out(easing) {
return function(t) {
return 1 - easing(1 - t);
};
};
Easing2.inOut = function inOut(easing) {
return function(t) {
if (t < 0.5) {
return easing(t * 2) / 2;
}
return 1 - easing((1 - t) * 2) / 2;
};
};
return Easing2;
}();
function _inheritsLoose$j(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$j(subClass, superClass);
}
function _setPrototypeOf$j(o, p) {
_setPrototypeOf$j = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$j(o, p);
}
var _easeInOut;
function easeInOut() {
if (!_easeInOut) {
_easeInOut = Easing.inOut(Easing.ease);
}
return _easeInOut;
}
var TimingAnimation = /* @__PURE__ */ function(_Animation) {
_inheritsLoose$j(TimingAnimation2, _Animation);
function TimingAnimation2(config) {
var _config$easing, _config$duration, _config$delay, _config$iterations, _config$isInteraction;
var _this;
_this = _Animation.call(this) || this;
_this._toValue = config.toValue;
_this._easing = (_config$easing = config.easing) !== null && _config$easing !== void 0 ? _config$easing : easeInOut();
_this._duration = (_config$duration = config.duration) !== null && _config$duration !== void 0 ? _config$duration : 500;
_this._delay = (_config$delay = config.delay) !== null && _config$delay !== void 0 ? _config$delay : 0;
_this.__iterations = (_config$iterations = config.iterations) !== null && _config$iterations !== void 0 ? _config$iterations : 1;
_this._useNativeDriver = shouldUseNativeDriver(config);
_this.__isInteraction = (_config$isInteraction = config.isInteraction) !== null && _config$isInteraction !== void 0 ? _config$isInteraction : !_this._useNativeDriver;
return _this;
}
var _proto = TimingAnimation2.prototype;
_proto.__getNativeAnimationConfig = function __getNativeAnimationConfig() {
var frameDuration = 1e3 / 60;
var frames = [];
for (var dt = 0; dt < this._duration; dt += frameDuration) {
frames.push(this._easing(dt / this._duration));
}
frames.push(this._easing(1));
return {
type: "frames",
frames,
toValue: this._toValue,
iterations: this.__iterations
};
};
_proto.start = function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {
var _this2 = this;
this.__active = true;
this._fromValue = fromValue;
this._onUpdate = onUpdate;
this.__onEnd = onEnd;
var start2 = function start3() {
if (_this2._duration === 0 && !_this2._useNativeDriver) {
_this2._onUpdate(_this2._toValue);
_this2.__debouncedOnEnd({
finished: true
});
} else {
_this2._startTime = Date.now();
if (_this2._useNativeDriver) {
_this2.__startNativeAnimation(animatedValue);
} else {
_this2._animationFrame = requestAnimationFrame(_this2.onUpdate.bind(_this2));
}
}
};
if (this._delay) {
this._timeout = setTimeout(start2, this._delay);
} else {
start2();
}
};
_proto.onUpdate = function onUpdate() {
var now = Date.now();
if (now >= this._startTime + this._duration) {
if (this._duration === 0) {
this._onUpdate(this._toValue);
} else {
this._onUpdate(this._fromValue + this._easing(1) * (this._toValue - this._fromValue));
}
this.__debouncedOnEnd({
finished: true
});
return;
}
this._onUpdate(this._fromValue + this._easing((now - this._startTime) / this._duration) * (this._toValue - this._fromValue));
if (this.__active) {
this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));
}
};
_proto.stop = function stop() {
_Animation.prototype.stop.call(this);
this.__active = false;
clearTimeout(this._timeout);
global$1.cancelAnimationFrame(this._animationFrame);
this.__debouncedOnEnd({
finished: false
});
};
return TimingAnimation2;
}(Animation);
function mergeRefs() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return function forwardRef2(node) {
args.forEach(function(ref) {
if (ref == null) {
return;
}
if (typeof ref === "function") {
ref(node);
return;
}
if (typeof ref === "object") {
ref.current = node;
return;
}
console.error("mergeRefs cannot handle Refs of type boolean, number or string, received ref " + String(ref));
});
};
}
function _extends() {
_extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
function _inheritsLoose$k(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$k(subClass, superClass);
}
function _setPrototypeOf$k(o, p) {
_setPrototypeOf$k = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$k(o, p);
}
function createAnimatedComponent(Component2, defaultProps2) {
invariant2(typeof Component2 !== "function" || Component2.prototype && Component2.prototype.isReactComponent, "`createAnimatedComponent` does not support stateless functional components; use a class component instead.");
var AnimatedComponent = /* @__PURE__ */ function(_React$Component) {
_inheritsLoose$k(AnimatedComponent2, _React$Component);
function AnimatedComponent2(props) {
var _this;
_this = _React$Component.call(this, props) || this;
_this._invokeAnimatedPropsCallbackOnMount = false;
_this._eventDetachers = [];
_this._animatedPropsCallback = function() {
if (_this._component == null) {
_this._invokeAnimatedPropsCallbackOnMount = true;
} else if (AnimatedComponent2.__skipSetNativeProps_FOR_TESTS_ONLY || typeof _this._component.setNativeProps !== "function") {
_this.forceUpdate();
} else if (!_this._propsAnimated.__isNative) {
_this._component.setNativeProps(_this._propsAnimated.__getAnimatedValue());
} else {
throw new Error('Attempting to run JS driven animation on animated node that has been moved to "native" earlier by starting an animation with `useNativeDriver: true`');
}
};
_this._setComponentRef = mergeRefs(_this.props.forwardedRef, function(ref) {
_this._prevComponent = _this._component;
_this._component = ref;
if (ref != null && ref.getNode == null) {
ref.getNode = function() {
var _ref$constructor$name;
console.warn("%s: Calling `getNode()` on the ref of an Animated component is no longer necessary. You can now directly use the ref instead. This method will be removed in a future release.", (_ref$constructor$name = ref.constructor.name) !== null && _ref$constructor$name !== void 0 ? _ref$constructor$name : "<<anonymous>>");
return ref;
};
}
});
return _this;
}
var _proto = AnimatedComponent2.prototype;
_proto.componentWillUnmount = function componentWillUnmount2() {
this._propsAnimated && this._propsAnimated.__detach();
this._detachNativeEvents();
};
_proto.UNSAFE_componentWillMount = function UNSAFE_componentWillMount2() {
this._attachProps(this.props);
};
_proto.componentDidMount = function componentDidMount2() {
if (this._invokeAnimatedPropsCallbackOnMount) {
this._invokeAnimatedPropsCallbackOnMount = false;
this._animatedPropsCallback();
}
this._propsAnimated.setNativeView(this._component);
this._attachNativeEvents();
};
_proto._attachNativeEvents = function _attachNativeEvents() {
var _this2 = this;
var scrollableNode = this._component && this._component.getScrollableNode ? this._component.getScrollableNode() : this._component;
var _loop = function _loop2(key2) {
var prop = _this2.props[key2];
if (prop instanceof AnimatedEvent && prop.__isNative) {
prop.__attach(scrollableNode, key2);
_this2._eventDetachers.push(function() {
return prop.__detach(scrollableNode, key2);
});
}
};
for (var key in this.props) {
_loop(key);
}
};
_proto._detachNativeEvents = function _detachNativeEvents() {
this._eventDetachers.forEach(function(remove) {
return remove();
});
this._eventDetachers = [];
};
_proto._attachProps = function _attachProps(nextProps) {
var oldPropsAnimated = this._propsAnimated;
this._propsAnimated = new AnimatedProps(nextProps, this._animatedPropsCallback);
oldPropsAnimated && oldPropsAnimated.__detach();
};
_proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(newProps) {
this._attachProps(newProps);
};
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
if (this._component !== this._prevComponent) {
this._propsAnimated.setNativeView(this._component);
}
if (this._component !== this._prevComponent || prevProps !== this.props) {
this._detachNativeEvents();
this._attachNativeEvents();
}
};
_proto.render = function render3() {
var props = this._propsAnimated.__getValue();
return /* @__PURE__ */ React__default.createElement(Component2, _extends({}, defaultProps2, props, {
ref: this._setComponentRef
}));
};
return AnimatedComponent2;
}(React__default.Component);
AnimatedComponent.__skipSetNativeProps_FOR_TESTS_ONLY = false;
var propTypes = Component2.propTypes;
return /* @__PURE__ */ React__default.forwardRef(function AnimatedComponentWrapper(props, ref) {
return /* @__PURE__ */ React__default.createElement(AnimatedComponent, _extends({}, props, ref == null ? null : {
forwardedRef: ref
}));
});
}
function ownKeys$5(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$5(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys$5(Object(source), true).forEach(function(key) {
_defineProperty$5(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys$5(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _defineProperty$5(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {value, enumerable: true, configurable: true, writable: true});
} else {
obj[key] = value;
}
return obj;
}
var add = function add2(a, b) {
return new AnimatedAddition(a, b);
};
var subtract = function subtract2(a, b) {
return new AnimatedSubtraction(a, b);
};
var divide = function divide2(a, b) {
return new AnimatedDivision(a, b);
};
var multiply = function multiply2(a, b) {
return new AnimatedMultiplication(a, b);
};
var modulo = function modulo2(a, modulus) {
return new AnimatedModulo(a, modulus);
};
var diffClamp = function diffClamp2(a, min, max) {
return new AnimatedDiffClamp(a, min, max);
};
var _combineCallbacks = function _combineCallbacks2(callback, config) {
if (callback && config.onComplete) {
return function() {
config.onComplete && config.onComplete.apply(config, arguments);
callback && callback.apply(void 0, arguments);
};
} else {
return callback || config.onComplete;
}
};
var maybeVectorAnim = function maybeVectorAnim2(value, config, anim) {
if (value instanceof AnimatedValueXY) {
var configX = _objectSpread$5({}, config);
var configY = _objectSpread$5({}, config);
for (var key in config) {
var _config$key = config[key], x = _config$key.x, y = _config$key.y;
if (x !== void 0 && y !== void 0) {
configX[key] = x;
configY[key] = y;
}
}
var aX = anim(value.x, configX);
var aY = anim(value.y, configY);
return parallel([aX, aY], {
stopTogether: false
});
}
return null;
};
var spring = function spring2(value, config) {
var _start = function start(animatedValue, configuration, callback) {
callback = _combineCallbacks(callback, configuration);
var singleValue = animatedValue;
var singleConfig = configuration;
singleValue.stopTracking();
if (configuration.toValue instanceof AnimatedNode) {
singleValue.track(new AnimatedTracking(singleValue, configuration.toValue, SpringAnimation, singleConfig, callback));
} else {
singleValue.animate(new SpringAnimation(singleConfig), callback);
}
};
return maybeVectorAnim(value, config, spring2) || {
start: function start(callback) {
_start(value, config, callback);
},
stop: function stop() {
value.stopAnimation();
},
reset: function reset() {
value.resetAnimation();
},
_startNativeLoop: function _startNativeLoop(iterations) {
var singleConfig = _objectSpread$5(_objectSpread$5({}, config), {}, {
iterations
});
_start(value, singleConfig);
},
_isUsingNativeDriver: function _isUsingNativeDriver() {
return config.useNativeDriver || false;
}
};
};
var timing = function timing2(value, config) {
var _start2 = function start(animatedValue, configuration, callback) {
callback = _combineCallbacks(callback, configuration);
var singleValue = animatedValue;
var singleConfig = configuration;
singleValue.stopTracking();
if (configuration.toValue instanceof AnimatedNode) {
singleValue.track(new AnimatedTracking(singleValue, configuration.toValue, TimingAnimation, singleConfig, callback));
} else {
singleValue.animate(new TimingAnimation(singleConfig), callback);
}
};
return maybeVectorAnim(value, config, timing2) || {
start: function start(callback) {
_start2(value, config, callback);
},
stop: function stop() {
value.stopAnimation();
},
reset: function reset() {
value.resetAnimation();
},
_startNativeLoop: function _startNativeLoop(iterations) {
var singleConfig = _objectSpread$5(_objectSpread$5({}, config), {}, {
iterations
});
_start2(value, singleConfig);
},
_isUsingNativeDriver: function _isUsingNativeDriver() {
return config.useNativeDriver || false;
}
};
};
var decay = function decay2(value, config) {
var _start3 = function start(animatedValue, configuration, callback) {
callback = _combineCallbacks(callback, configuration);
var singleValue = animatedValue;
var singleConfig = configuration;
singleValue.stopTracking();
singleValue.animate(new DecayAnimation(singleConfig), callback);
};
return maybeVectorAnim(value, config, decay2) || {
start: function start(callback) {
_start3(value, config, callback);
},
stop: function stop() {
value.stopAnimation();
},
reset: function reset() {
value.resetAnimation();
},
_startNativeLoop: function _startNativeLoop(iterations) {
var singleConfig = _objectSpread$5(_objectSpread$5({}, config), {}, {
iterations
});
_start3(value, singleConfig);
},
_isUsingNativeDriver: function _isUsingNativeDriver() {
return config.useNativeDriver || false;
}
};
};
var sequence = function sequence2(animations) {
var current = 0;
return {
start: function start(callback) {
var onComplete = function onComplete2(result) {
if (!result.finished) {
callback && callback(result);
return;
}
current++;
if (current === animations.length) {
callback && callback(result);
return;
}
animations[current].start(onComplete2);
};
if (animations.length === 0) {
callback && callback({
finished: true
});
} else {
animations[current].start(onComplete);
}
},
stop: function stop() {
if (current < animations.length) {
animations[current].stop();
}
},
reset: function reset() {
animations.forEach(function(animation, idx) {
if (idx <= current) {
animation.reset();
}
});
current = 0;
},
_startNativeLoop: function _startNativeLoop() {
throw new Error("Loops run using the native driver cannot contain Animated.sequence animations");
},
_isUsingNativeDriver: function _isUsingNativeDriver() {
return false;
}
};
};
var parallel = function parallel2(animations, config) {
var doneCount = 0;
var hasEnded = {};
var stopTogether = !(config && config.stopTogether === false);
var result = {
start: function start(callback) {
if (doneCount === animations.length) {
callback && callback({
finished: true
});
return;
}
animations.forEach(function(animation, idx) {
var cb = function cb2(endResult) {
hasEnded[idx] = true;
doneCount++;
if (doneCount === animations.length) {
doneCount = 0;
callback && callback(endResult);
return;
}
if (!endResult.finished && stopTogether) {
result.stop();
}
};
if (!animation) {
cb({
finished: true
});
} else {
animation.start(cb);
}
});
},
stop: function stop() {
animations.forEach(function(animation, idx) {
!hasEnded[idx] && animation.stop();
hasEnded[idx] = true;
});
},
reset: function reset() {
animations.forEach(function(animation, idx) {
animation.reset();
hasEnded[idx] = false;
doneCount = 0;
});
},
_startNativeLoop: function _startNativeLoop() {
throw new Error("Loops run using the native driver cannot contain Animated.parallel animations");
},
_isUsingNativeDriver: function _isUsingNativeDriver() {
return false;
}
};
return result;
};
var delay = function delay2(time) {
return timing(new AnimatedValue(0), {
toValue: 0,
delay: time,
duration: 0
});
};
var stagger = function stagger2(time, animations) {
return parallel(animations.map(function(animation, i) {
return sequence([delay(time * i), animation]);
}));
};
var loop = function loop2(animation, _temp) {
var _ref = _temp === void 0 ? {} : _temp, _ref$iterations = _ref.iterations, iterations = _ref$iterations === void 0 ? -1 : _ref$iterations, _ref$resetBeforeItera = _ref.resetBeforeIteration, resetBeforeIteration = _ref$resetBeforeItera === void 0 ? true : _ref$resetBeforeItera;
var isFinished = false;
var iterationsSoFar = 0;
return {
start: function start(callback) {
var restart = function restart2(result) {
if (result === void 0) {
result = {
finished: true
};
}
if (isFinished || iterationsSoFar === iterations || result.finished === false) {
callback && callback(result);
} else {
iterationsSoFar++;
resetBeforeIteration && animation.reset();
animation.start(restart2);
}
};
if (!animation || iterations === 0) {
callback && callback({
finished: true
});
} else {
if (animation._isUsingNativeDriver()) {
animation._startNativeLoop(iterations);
} else {
restart();
}
}
},
stop: function stop() {
isFinished = true;
animation.stop();
},
reset: function reset() {
iterationsSoFar = 0;
isFinished = false;
animation.reset();
},
_startNativeLoop: function _startNativeLoop() {
throw new Error("Loops run using the native driver cannot contain Animated.loop animations");
},
_isUsingNativeDriver: function _isUsingNativeDriver() {
return animation._isUsingNativeDriver();
}
};
};
function forkEvent(event3, listener) {
if (!event3) {
return listener;
} else if (event3 instanceof AnimatedEvent) {
event3.__addListener(listener);
return event3;
} else {
return function() {
typeof event3 === "function" && event3.apply(void 0, arguments);
listener.apply(void 0, arguments);
};
}
}
function unforkEvent(event3, listener) {
if (event3 && event3 instanceof AnimatedEvent) {
event3.__removeListener(listener);
}
}
var event = function event2(argMapping, config) {
var animatedEvent = new AnimatedEvent(argMapping, config);
if (animatedEvent.__isNative) {
return animatedEvent;
} else {
return animatedEvent.__getHandler();
}
};
var AnimatedImplementation = {
Value: AnimatedValue,
ValueXY: AnimatedValueXY,
Interpolation: AnimatedInterpolation,
Node: AnimatedNode,
decay,
timing,
spring,
add,
subtract,
divide,
multiply,
modulo,
diffClamp,
delay,
sequence,
parallel,
stagger,
loop,
event,
createAnimatedComponent,
attachNativeEvent,
forkEvent,
unforkEvent,
Event: AnimatedEvent,
__PropsOnlyForTests: AnimatedProps
};
var deepDiffer = function deepDiffer2(one, two, maxDepth) {
if (maxDepth === void 0) {
maxDepth = -1;
}
if (maxDepth === 0) {
return true;
}
if (one === two) {
return false;
}
if (typeof one === "function" && typeof two === "function") {
return false;
}
if (typeof one !== "object" || one === null) {
return one !== two;
}
if (typeof two !== "object" || two === null) {
return true;
}
if (one.constructor !== two.constructor) {
return true;
}
if (Array.isArray(one)) {
var len = one.length;
if (two.length !== len) {
return true;
}
for (var ii = 0; ii < len; ii++) {
if (deepDiffer2(one[ii], two[ii], maxDepth - 1)) {
return true;
}
}
} else {
for (var key in one) {
if (deepDiffer2(one[key], two[key], maxDepth - 1)) {
return true;
}
}
for (var twoKey in two) {
if (one[twoKey] === void 0 && two[twoKey] !== void 0) {
return true;
}
}
}
return false;
};
var defaultProps = {
children: true,
dataSet: true,
nativeID: true,
ref: true,
suppressHydrationWarning: true,
testID: true
};
var accessibilityProps = {
accessibilityActiveDescendant: true,
accessibilityAtomic: true,
accessibilityAutoComplete: true,
accessibilityBusy: true,
accessibilityChecked: true,
accessibilityColumnCount: true,
accessibilityColumnIndex: true,
accessibilityColumnSpan: true,
accessibilityControls: true,
accessibilityDescribedBy: true,
accessibilityDetails: true,
accessibilityDisabled: true,
accessibilityErrorMessage: true,
accessibilityExpanded: true,
accessibilityFlowTo: true,
accessibilityHasPopup: true,
accessibilityHidden: true,
accessibilityInvalid: true,
accessibilityKeyShortcuts: true,
accessibilityLabel: true,
accessibilityLabelledBy: true,
accessibilityLevel: true,
accessibilityLiveRegion: true,
accessibilityModal: true,
accessibilityMultiline: true,
accessibilityMultiSelectable: true,
accessibilityOrientation: true,
accessibilityOwns: true,
accessibilityPlaceholder: true,
accessibilityPosInSet: true,
accessibilityPressed: true,
accessibilityReadOnly: true,
accessibilityRequired: true,
accessibilityRole: true,
accessibilityRoleDescription: true,
accessibilityRowCount: true,
accessibilityRowIndex: true,
accessibilityRowSpan: true,
accessibilitySelected: true,
accessibilitySetSize: true,
accessibilitySort: true,
accessibilityValueMax: true,
accessibilityValueMin: true,
accessibilityValueNow: true,
accessibilityValueText: true,
dir: true,
focusable: true,
accessible: true,
accessibilityState: true,
accessibilityValue: true
};
var clickProps = {
onClick: true,
onClickCapture: true,
onContextMenu: true
};
var focusProps = {
onBlur: true,
onFocus: true
};
var keyboardProps = {
onKeyDown: true,
onKeyDownCapture: true,
onKeyUp: true,
onKeyUpCapture: true
};
var mouseProps = {
onMouseDown: true,
onMouseEnter: true,
onMouseLeave: true,
onMouseMove: true,
onMouseOver: true,
onMouseOut: true,
onMouseUp: true
};
var touchProps = {
onTouchCancel: true,
onTouchCancelCapture: true,
onTouchEnd: true,
onTouchEndCapture: true,
onTouchMove: true,
onTouchMoveCapture: true,
onTouchStart: true,
onTouchStartCapture: true
};
var styleProps = {
classList: true,
style: true
};
function pick(obj, list) {
var nextObj = {};
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
if (list[key] === true || key.indexOf("aria-") === 0) {
nextObj[key] = obj[key];
}
}
}
return nextObj;
}
var useLayoutEffectImpl = canUseDOM ? useLayoutEffect : useEffect;
var DOM_LAYOUT_HANDLER_NAME = "__reactLayoutHandler";
var resizeObserver = null;
function getResizeObserver() {
if (canUseDOM && typeof window.ResizeObserver !== "undefined") {
if (resizeObserver == null) {
resizeObserver = new window.ResizeObserver(function(entries) {
entries.forEach(function(entry) {
var node = entry.target;
var onLayout = node[DOM_LAYOUT_HANDLER_NAME];
if (typeof onLayout === "function") {
UIManager.measure(node, function(x, y, width, height, left2, top) {
var event3 = {
nativeEvent: {
layout: {
x,
y,
width,
height,
left: left2,
top
}
},
timeStamp: Date.now()
};
Object.defineProperty(event3.nativeEvent, "target", {
enumerable: true,
get: function get3() {
return entry.target;
}
});
onLayout(event3);
});
}
});
});
}
}
return resizeObserver;
}
function useElementLayout(ref, onLayout) {
var observer = getResizeObserver();
useLayoutEffectImpl(function() {
var node = ref.current;
if (node != null) {
node[DOM_LAYOUT_HANDLER_NAME] = onLayout;
}
}, [ref, onLayout]);
useLayoutEffectImpl(function() {
var node = ref.current;
if (node != null && observer != null) {
if (typeof node[DOM_LAYOUT_HANDLER_NAME] === "function") {
observer.observe(node);
} else {
observer.unobserve(node);
}
}
return function() {
if (node != null && observer != null) {
observer.unobserve(node);
}
};
}, [ref, observer]);
}
function useMergeRefs() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return useMemo(function() {
return mergeRefs.apply(void 0, args);
}, [].concat(args));
}
var UNINITIALIZED = typeof Symbol === "function" && typeof Symbol() === "symbol" ? Symbol() : Object.freeze({});
function useStable(getInitialValue) {
var ref = useRef(UNINITIALIZED);
if (ref.current === UNINITIALIZED) {
ref.current = getInitialValue();
}
return ref.current;
}
function ownKeys$6(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$6(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys$6(Object(source), true).forEach(function(key) {
_defineProperty$6(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys$6(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _defineProperty$6(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {value, enumerable: true, configurable: true, writable: true});
} else {
obj[key] = value;
}
return obj;
}
var emptyObject$5 = {};
function setNativeProps(node, nativeProps, classList2, pointerEvents, style, previousStyleRef) {
if (node != null && nativeProps) {
var domProps = createDOMProps(null, _objectSpread$6(_objectSpread$6({
pointerEvents
}, nativeProps), {}, {
classList: [classList2, nativeProps.className],
style: [style, nativeProps.style]
}));
var nextDomStyle = domProps.style;
if (previousStyleRef.current != null) {
if (domProps.style == null) {
domProps.style = {};
}
for (var styleName in previousStyleRef.current) {
if (domProps.style[styleName] == null) {
domProps.style[styleName] = "";
}
}
}
previousStyleRef.current = nextDomStyle;
UIManager.updateView(node, domProps);
}
}
function usePlatformMethods(_ref) {
var classList2 = _ref.classList, pointerEvents = _ref.pointerEvents, style = _ref.style;
var previousStyleRef = useRef(null);
var setNativePropsArgsRef = useRef(null);
setNativePropsArgsRef.current = {
classList: classList2,
pointerEvents,
style
};
var ref = useStable(function() {
return function(hostNode) {
if (hostNode != null) {
hostNode.measure = function(callback) {
return UIManager.measure(hostNode, callback);
};
hostNode.measureLayout = function(relativeToNode, success, failure) {
return UIManager.measureLayout(hostNode, relativeToNode, failure, success);
};
hostNode.measureInWindow = function(callback) {
return UIManager.measureInWindow(hostNode, callback);
};
hostNode.setNativeProps = function(nativeProps) {
var _ref2 = setNativePropsArgsRef.current || emptyObject$5, classList3 = _ref2.classList, style2 = _ref2.style, pointerEvents2 = _ref2.pointerEvents;
setNativeProps(hostNode, nativeProps, classList3, pointerEvents2, style2, previousStyleRef);
};
}
};
});
return ref;
}
var MOUSE_DOWN = "mousedown";
var MOUSE_MOVE = "mousemove";
var MOUSE_UP = "mouseup";
var MOUSE_CANCEL = "dragstart";
var TOUCH_START = "touchstart";
var TOUCH_MOVE = "touchmove";
var TOUCH_END = "touchend";
var TOUCH_CANCEL = "touchcancel";
var SCROLL = "scroll";
var SELECT = "select";
var SELECTION_CHANGE = "selectionchange";
function isStartish(eventType) {
return eventType === TOUCH_START || eventType === MOUSE_DOWN;
}
function isMoveish(eventType) {
return eventType === TOUCH_MOVE || eventType === MOUSE_MOVE;
}
function isEndish(eventType) {
return eventType === TOUCH_END || eventType === MOUSE_UP || isCancelish(eventType);
}
function isCancelish(eventType) {
return eventType === TOUCH_CANCEL || eventType === MOUSE_CANCEL;
}
function isScroll(eventType) {
return eventType === SCROLL;
}
function isSelectionChange(eventType) {
return eventType === SELECT || eventType === SELECTION_CHANGE;
}
var MAX_TOUCH_BANK = 20;
var touchBank = [];
var touchHistory = {
touchBank,
numberActiveTouches: 0,
indexOfSingleActiveTouch: -1,
mostRecentTimeStamp: 0
};
function timestampForTouch(touch) {
return touch.timeStamp || touch.timestamp;
}
function createTouchRecord(touch) {
return {
touchActive: true,
startPageX: touch.pageX,
startPageY: touch.pageY,
startTimeStamp: timestampForTouch(touch),
currentPageX: touch.pageX,
currentPageY: touch.pageY,
currentTimeStamp: timestampForTouch(touch),
previousPageX: touch.pageX,
previousPageY: touch.pageY,
previousTimeStamp: timestampForTouch(touch)
};
}
function resetTouchRecord(touchRecord, touch) {
touchRecord.touchActive = true;
touchRecord.startPageX = touch.pageX;
touchRecord.startPageY = touch.pageY;
touchRecord.startTimeStamp = timestampForTouch(touch);
touchRecord.currentPageX = touch.pageX;
touchRecord.currentPageY = touch.pageY;
touchRecord.currentTimeStamp = timestampForTouch(touch);
touchRecord.previousPageX = touch.pageX;
touchRecord.previousPageY = touch.pageY;
touchRecord.previousTimeStamp = timestampForTouch(touch);
}
function getTouchIdentifier(_ref) {
var identifier = _ref.identifier;
if (identifier == null) {
console.error("Touch object is missing identifier.");
}
return identifier;
}
function recordTouchStart(touch) {
var identifier = getTouchIdentifier(touch);
var touchRecord = touchBank[identifier];
if (touchRecord) {
resetTouchRecord(touchRecord, touch);
} else {
touchBank[identifier] = createTouchRecord(touch);
}
touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
}
function recordTouchMove(touch) {
var touchRecord = touchBank[getTouchIdentifier(touch)];
if (touchRecord) {
touchRecord.touchActive = true;
touchRecord.previousPageX = touchRecord.currentPageX;
touchRecord.previousPageY = touchRecord.currentPageY;
touchRecord.previousTimeStamp = touchRecord.currentTimeStamp;
touchRecord.currentPageX = touch.pageX;
touchRecord.currentPageY = touch.pageY;
touchRecord.currentTimeStamp = timestampForTouch(touch);
touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
} else {
console.warn("Cannot record touch move without a touch start.\n", "Touch Move: " + printTouch(touch) + "\n", "Touch Bank: " + printTouchBank());
}
}
function recordTouchEnd(touch) {
var touchRecord = touchBank[getTouchIdentifier(touch)];
if (touchRecord) {
touchRecord.touchActive = false;
touchRecord.previousPageX = touchRecord.currentPageX;
touchRecord.previousPageY = touchRecord.currentPageY;
touchRecord.previousTimeStamp = touchRecord.currentTimeStamp;
touchRecord.currentPageX = touch.pageX;
touchRecord.currentPageY = touch.pageY;
touchRecord.currentTimeStamp = timestampForTouch(touch);
touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
} else {
console.warn("Cannot record touch end without a touch start.\n", "Touch End: " + printTouch(touch) + "\n", "Touch Bank: " + printTouchBank());
}
}
function printTouch(touch) {
return JSON.stringify({
identifier: touch.identifier,
pageX: touch.pageX,
pageY: touch.pageY,
timestamp: timestampForTouch(touch)
});
}
function printTouchBank() {
var printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK));
if (touchBank.length > MAX_TOUCH_BANK) {
printed += " (original size: " + touchBank.length + ")";
}
return printed;
}
var ResponderTouchHistoryStore = {
recordTouchTrack: function recordTouchTrack(topLevelType, nativeEvent) {
if (isMoveish(topLevelType)) {
nativeEvent.changedTouches.forEach(recordTouchMove);
} else if (isStartish(topLevelType)) {
nativeEvent.changedTouches.forEach(recordTouchStart);
touchHistory.numberActiveTouches = nativeEvent.touches.length;
if (touchHistory.numberActiveTouches === 1) {
touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier;
}
} else if (isEndish(topLevelType)) {
nativeEvent.changedTouches.forEach(recordTouchEnd);
touchHistory.numberActiveTouches = nativeEvent.touches.length;
if (touchHistory.numberActiveTouches === 1) {
for (var i = 0; i < touchBank.length; i++) {
var touchTrackToCheck = touchBank[i];
if (touchTrackToCheck != null && touchTrackToCheck.touchActive) {
touchHistory.indexOfSingleActiveTouch = i;
break;
}
}
}
}
},
touchHistory
};
var emptyFunction = function emptyFunction2() {
};
var emptyObject$6 = {};
var emptyArray = [];
function normalizeIdentifier(identifier) {
return identifier > 20 ? identifier % 20 : identifier;
}
function createResponderEvent(domEvent) {
var rect;
var propagationWasStopped = false;
var changedTouches;
var touches;
var domEventChangedTouches = domEvent.changedTouches;
var domEventType = domEvent.type;
var metaKey = domEvent.metaKey === true;
var shiftKey = domEvent.shiftKey === true;
var force = domEventChangedTouches && domEventChangedTouches[0].force || 0;
var identifier = normalizeIdentifier(domEventChangedTouches && domEventChangedTouches[0].identifier || 0);
var clientX = domEventChangedTouches && domEventChangedTouches[0].clientX || domEvent.clientX;
var clientY = domEventChangedTouches && domEventChangedTouches[0].clientY || domEvent.clientY;
var pageX = domEventChangedTouches && domEventChangedTouches[0].pageX || domEvent.pageX;
var pageY = domEventChangedTouches && domEventChangedTouches[0].pageY || domEvent.pageY;
var preventDefault = typeof domEvent.preventDefault === "function" ? domEvent.preventDefault.bind(domEvent) : emptyFunction;
var timestamp = domEvent.timeStamp;
function normalizeTouches(touches2) {
return Array.prototype.slice.call(touches2).map(function(touch) {
return {
force: touch.force,
identifier: normalizeIdentifier(touch.identifier),
get locationX() {
return locationX(touch.clientX);
},
get locationY() {
return locationY(touch.clientY);
},
pageX: touch.pageX,
pageY: touch.pageY,
target: touch.target,
timestamp
};
});
}
if (domEventChangedTouches != null) {
changedTouches = normalizeTouches(domEventChangedTouches);
touches = normalizeTouches(domEvent.touches);
} else {
var emulatedTouches = [{
force,
identifier,
get locationX() {
return locationX(clientX);
},
get locationY() {
return locationY(clientY);
},
pageX,
pageY,
target: domEvent.target,
timestamp
}];
changedTouches = emulatedTouches;
touches = domEventType === "mouseup" || domEventType === "dragstart" ? emptyArray : emulatedTouches;
}
var responderEvent = {
bubbles: true,
cancelable: true,
currentTarget: null,
defaultPrevented: domEvent.defaultPrevented,
dispatchConfig: emptyObject$6,
eventPhase: domEvent.eventPhase,
isDefaultPrevented: function isDefaultPrevented2() {
return domEvent.defaultPrevented;
},
isPropagationStopped: function isPropagationStopped2() {
return propagationWasStopped;
},
isTrusted: domEvent.isTrusted,
nativeEvent: {
altKey: false,
ctrlKey: false,
metaKey,
shiftKey,
changedTouches,
force,
identifier,
get locationX() {
return locationX(clientX);
},
get locationY() {
return locationY(clientY);
},
pageX,
pageY,
target: domEvent.target,
timestamp,
touches,
type: domEventType
},
persist: emptyFunction,
preventDefault,
stopPropagation: function stopPropagation() {
propagationWasStopped = true;
},
target: domEvent.target,
timeStamp: timestamp,
touchHistory: ResponderTouchHistoryStore.touchHistory
};
function locationX(x) {
rect = rect || getBoundingClientRect(responderEvent.currentTarget);
if (rect) {
return x - rect.left;
}
}
function locationY(y) {
rect = rect || getBoundingClientRect(responderEvent.currentTarget);
if (rect) {
return y - rect.top;
}
}
return responderEvent;
}
function isSelectionValid() {
var selection = window.getSelection();
var string = selection.toString();
var anchorNode = selection.anchorNode;
var focusNode = selection.focusNode;
var isTextNode = anchorNode && anchorNode.nodeType === window.Node.TEXT_NODE || focusNode && focusNode.nodeType === window.Node.TEXT_NODE;
return string.length >= 1 && string !== "\n" && isTextNode;
}
var keyName = "__reactResponderId";
function getEventPath(domEvent) {
if (domEvent.type === "selectionchange") {
var target = window.getSelection().anchorNode;
return composedPathFallback(target);
} else {
var path = domEvent.composedPath != null ? domEvent.composedPath() : composedPathFallback(domEvent.target);
return path;
}
}
function composedPathFallback(target) {
var path = [];
while (target != null && target !== document.body) {
path.push(target);
target = target.parentNode;
}
return path;
}
function getResponderId(node) {
if (node != null) {
return node[keyName];
}
return null;
}
function setResponderId(node, id2) {
if (node != null) {
node[keyName] = id2;
}
}
function getResponderPaths(domEvent) {
var idPath = [];
var nodePath = [];
var eventPath = getEventPath(domEvent);
for (var i = 0; i < eventPath.length; i++) {
var node = eventPath[i];
var id2 = getResponderId(node);
if (id2 != null) {
idPath.push(id2);
nodePath.push(node);
}
}
return {
idPath,
nodePath
};
}
function getLowestCommonAncestor(pathA, pathB) {
var pathALength = pathA.length;
var pathBLength = pathB.length;
if (pathALength === 0 || pathBLength === 0 || pathA[pathALength - 1] !== pathB[pathBLength - 1]) {
return null;
}
var itemA = pathA[0];
var indexA = 0;
var itemB = pathB[0];
var indexB = 0;
if (pathALength - pathBLength > 0) {
indexA = pathALength - pathBLength;
itemA = pathA[indexA];
pathALength = pathBLength;
}
if (pathBLength - pathALength > 0) {
indexB = pathBLength - pathALength;
itemB = pathB[indexB];
pathBLength = pathALength;
}
var depth = pathALength;
while (depth--) {
if (itemA === itemB) {
return itemA;
}
itemA = pathA[indexA++];
itemB = pathB[indexB++];
}
return null;
}
function hasTargetTouches(target, touches) {
if (!touches || touches.length === 0) {
return false;
}
for (var i = 0; i < touches.length; i++) {
var node = touches[i].target;
if (node != null) {
if (target.contains(node)) {
return true;
}
}
}
return false;
}
function hasValidSelection(domEvent) {
if (domEvent.type === "selectionchange") {
return isSelectionValid();
}
return domEvent.type === "select";
}
function isPrimaryPointerDown(domEvent) {
var altKey = domEvent.altKey, button = domEvent.button, buttons = domEvent.buttons, ctrlKey = domEvent.ctrlKey, type = domEvent.type;
var isTouch = type === "touchstart" || type === "touchmove";
var isPrimaryMouseDown = type === "mousedown" && (button === 0 || buttons === 1);
var isPrimaryMouseMove = type === "mousemove" && buttons === 1;
var noModifiers = altKey === false && ctrlKey === false;
if (isTouch || isPrimaryMouseDown && noModifiers || isPrimaryMouseMove && noModifiers) {
return true;
}
return false;
}
var emptyObject$7 = {};
var startRegistration = ["onStartShouldSetResponderCapture", "onStartShouldSetResponder", {
bubbles: true
}];
var moveRegistration = ["onMoveShouldSetResponderCapture", "onMoveShouldSetResponder", {
bubbles: true
}];
var scrollRegistration = ["onScrollShouldSetResponderCapture", "onScrollShouldSetResponder", {
bubbles: false
}];
var shouldSetResponderEvents = {
touchstart: startRegistration,
mousedown: startRegistration,
touchmove: moveRegistration,
mousemove: moveRegistration,
scroll: scrollRegistration
};
var emptyResponder = {
id: null,
idPath: null,
node: null
};
var responderListenersMap = new Map();
var isEmulatingMouseEvents = false;
var trackedTouchCount = 0;
var currentResponder = {
id: null,
node: null,
idPath: null
};
function changeCurrentResponder(responder) {
currentResponder = responder;
}
function getResponderConfig(id2) {
var config = responderListenersMap.get(id2);
return config != null ? config : emptyObject$7;
}
function eventListener(domEvent) {
var eventType = domEvent.type;
var eventTarget = domEvent.target;
if (eventType === "touchstart") {
isEmulatingMouseEvents = true;
}
if (eventType === "touchmove" || trackedTouchCount > 1) {
isEmulatingMouseEvents = false;
}
if (eventType === "mousedown" && isEmulatingMouseEvents || eventType === "mousemove" && isEmulatingMouseEvents || eventType === "mousemove" && trackedTouchCount < 1) {
return;
}
if (isEmulatingMouseEvents && eventType === "mouseup") {
if (trackedTouchCount === 0) {
isEmulatingMouseEvents = false;
}
return;
}
var isStartEvent = isStartish(eventType) && isPrimaryPointerDown(domEvent);
var isMoveEvent = isMoveish(eventType);
var isEndEvent = isEndish(eventType);
var isScrollEvent = isScroll(eventType);
var isSelectionChangeEvent = isSelectionChange(eventType);
var responderEvent = createResponderEvent(domEvent);
if (isStartEvent || isMoveEvent || isEndEvent) {
if (domEvent.touches) {
trackedTouchCount = domEvent.touches.length;
} else {
if (isStartEvent) {
trackedTouchCount = 1;
} else if (isEndEvent) {
trackedTouchCount = 0;
}
}
ResponderTouchHistoryStore.recordTouchTrack(eventType, responderEvent.nativeEvent);
}
var eventPaths = getResponderPaths(domEvent);
var wasNegotiated = false;
var wantsResponder;
if (isStartEvent || isMoveEvent || isScrollEvent && trackedTouchCount > 0) {
var currentResponderIdPath = currentResponder.idPath;
var eventIdPath = eventPaths.idPath;
if (currentResponderIdPath != null && eventIdPath != null) {
var lowestCommonAncestor = getLowestCommonAncestor(currentResponderIdPath, eventIdPath);
if (lowestCommonAncestor != null) {
var indexOfLowestCommonAncestor = eventIdPath.indexOf(lowestCommonAncestor);
var index2 = indexOfLowestCommonAncestor + (lowestCommonAncestor === currentResponder.id ? 1 : 0);
eventPaths = {
idPath: eventIdPath.slice(index2),
nodePath: eventPaths.nodePath.slice(index2)
};
} else {
eventPaths = null;
}
}
if (eventPaths != null) {
wantsResponder = findWantsResponder(eventPaths, domEvent, responderEvent);
if (wantsResponder != null) {
attemptTransfer(responderEvent, wantsResponder);
wasNegotiated = true;
}
}
}
if (currentResponder.id != null && currentResponder.node != null) {
var _currentResponder = currentResponder, id2 = _currentResponder.id, node = _currentResponder.node;
var _getResponderConfig = getResponderConfig(id2), onResponderStart = _getResponderConfig.onResponderStart, onResponderMove = _getResponderConfig.onResponderMove, onResponderEnd = _getResponderConfig.onResponderEnd, onResponderRelease = _getResponderConfig.onResponderRelease, onResponderTerminate = _getResponderConfig.onResponderTerminate, onResponderTerminationRequest = _getResponderConfig.onResponderTerminationRequest;
responderEvent.bubbles = false;
responderEvent.cancelable = false;
responderEvent.currentTarget = node;
if (isStartEvent) {
if (onResponderStart != null) {
responderEvent.dispatchConfig.registrationName = "onResponderStart";
onResponderStart(responderEvent);
}
} else if (isMoveEvent) {
if (onResponderMove != null) {
responderEvent.dispatchConfig.registrationName = "onResponderMove";
onResponderMove(responderEvent);
}
} else {
var isTerminateEvent = isCancelish(eventType) || eventType === "contextmenu" || eventType === "blur" && eventTarget === window || eventType === "blur" && eventTarget.contains(node) && domEvent.relatedTarget !== node || isScrollEvent && trackedTouchCount === 0 || isScrollEvent && eventTarget.contains(node) && eventTarget !== node || isSelectionChangeEvent && hasValidSelection(domEvent);
var isReleaseEvent = isEndEvent && !isTerminateEvent && !hasTargetTouches(node, domEvent.touches);
if (isEndEvent) {
if (onResponderEnd != null) {
responderEvent.dispatchConfig.registrationName = "onResponderEnd";
onResponderEnd(responderEvent);
}
}
if (isReleaseEvent) {
if (onResponderRelease != null) {
responderEvent.dispatchConfig.registrationName = "onResponderRelease";
onResponderRelease(responderEvent);
}
changeCurrentResponder(emptyResponder);
}
if (isTerminateEvent) {
var shouldTerminate = true;
if (eventType === "contextmenu" || eventType === "scroll" || eventType === "selectionchange") {
if (wasNegotiated) {
shouldTerminate = false;
} else if (onResponderTerminationRequest != null) {
responderEvent.dispatchConfig.registrationName = "onResponderTerminationRequest";
if (onResponderTerminationRequest(responderEvent) === false) {
shouldTerminate = false;
}
}
}
if (shouldTerminate) {
if (onResponderTerminate != null) {
responderEvent.dispatchConfig.registrationName = "onResponderTerminate";
onResponderTerminate(responderEvent);
}
changeCurrentResponder(emptyResponder);
isEmulatingMouseEvents = false;
trackedTouchCount = 0;
}
}
}
}
}
function findWantsResponder(eventPaths, domEvent, responderEvent) {
var shouldSetCallbacks = shouldSetResponderEvents[domEvent.type];
if (shouldSetCallbacks != null) {
var idPath = eventPaths.idPath, nodePath = eventPaths.nodePath;
var shouldSetCallbackCaptureName = shouldSetCallbacks[0];
var shouldSetCallbackBubbleName = shouldSetCallbacks[1];
var bubbles = shouldSetCallbacks[2].bubbles;
var check = function check2(id3, node2, callbackName) {
var config = getResponderConfig(id3);
var shouldSetCallback = config[callbackName];
if (shouldSetCallback != null) {
responderEvent.currentTarget = node2;
if (shouldSetCallback(responderEvent) === true) {
var prunedIdPath = idPath.slice(idPath.indexOf(id3));
return {
id: id3,
node: node2,
idPath: prunedIdPath
};
}
}
};
for (var i = idPath.length - 1; i >= 0; i--) {
var id2 = idPath[i];
var node = nodePath[i];
var result = check(id2, node, shouldSetCallbackCaptureName);
if (result != null) {
return result;
}
if (responderEvent.isPropagationStopped() === true) {
return;
}
}
if (bubbles) {
for (var _i = 0; _i < idPath.length; _i++) {
var _id = idPath[_i];
var _node = nodePath[_i];
var _result = check(_id, _node, shouldSetCallbackBubbleName);
if (_result != null) {
return _result;
}
if (responderEvent.isPropagationStopped() === true) {
return;
}
}
} else {
var _id2 = idPath[0];
var _node2 = nodePath[0];
var target = domEvent.target;
if (target === _node2) {
return check(_id2, _node2, shouldSetCallbackBubbleName);
}
}
}
}
function attemptTransfer(responderEvent, wantsResponder) {
var _currentResponder2 = currentResponder, currentId = _currentResponder2.id, currentNode = _currentResponder2.node;
var id2 = wantsResponder.id, node = wantsResponder.node;
var _getResponderConfig2 = getResponderConfig(id2), onResponderGrant = _getResponderConfig2.onResponderGrant, onResponderReject = _getResponderConfig2.onResponderReject;
responderEvent.bubbles = false;
responderEvent.cancelable = false;
responderEvent.currentTarget = node;
if (currentId == null) {
if (onResponderGrant != null) {
responderEvent.currentTarget = node;
responderEvent.dispatchConfig.registrationName = "onResponderGrant";
onResponderGrant(responderEvent);
}
changeCurrentResponder(wantsResponder);
} else {
var _getResponderConfig3 = getResponderConfig(currentId), onResponderTerminate = _getResponderConfig3.onResponderTerminate, onResponderTerminationRequest = _getResponderConfig3.onResponderTerminationRequest;
var allowTransfer = true;
if (onResponderTerminationRequest != null) {
responderEvent.currentTarget = currentNode;
responderEvent.dispatchConfig.registrationName = "onResponderTerminationRequest";
if (onResponderTerminationRequest(responderEvent) === false) {
allowTransfer = false;
}
}
if (allowTransfer) {
if (onResponderTerminate != null) {
responderEvent.currentTarget = currentNode;
responderEvent.dispatchConfig.registrationName = "onResponderTerminate";
onResponderTerminate(responderEvent);
}
if (onResponderGrant != null) {
responderEvent.currentTarget = node;
responderEvent.dispatchConfig.registrationName = "onResponderGrant";
onResponderGrant(responderEvent);
}
changeCurrentResponder(wantsResponder);
} else {
if (onResponderReject != null) {
responderEvent.currentTarget = node;
responderEvent.dispatchConfig.registrationName = "onResponderReject";
onResponderReject(responderEvent);
}
}
}
}
var documentEventsCapturePhase = ["blur", "scroll"];
var documentEventsBubblePhase = [
"mousedown",
"mousemove",
"mouseup",
"dragstart",
"touchstart",
"touchmove",
"touchend",
"touchcancel",
"contextmenu",
"select",
"selectionchange"
];
function attachListeners() {
if (canUseDOM && window.__reactResponderSystemActive == null) {
window.addEventListener("blur", eventListener);
documentEventsBubblePhase.forEach(function(eventType) {
document.addEventListener(eventType, eventListener);
});
documentEventsCapturePhase.forEach(function(eventType) {
document.addEventListener(eventType, eventListener, true);
});
window.__reactResponderSystemActive = true;
}
}
function addNode(id2, node, config) {
setResponderId(node, id2);
responderListenersMap.set(id2, config);
}
function removeNode(id2) {
if (currentResponder.id === id2) {
terminateResponder();
}
if (responderListenersMap.has(id2)) {
responderListenersMap.delete(id2);
}
}
function terminateResponder() {
var _currentResponder3 = currentResponder, id2 = _currentResponder3.id, node = _currentResponder3.node;
if (id2 != null && node != null) {
var _getResponderConfig4 = getResponderConfig(id2), onResponderTerminate = _getResponderConfig4.onResponderTerminate;
if (onResponderTerminate != null) {
var event3 = createResponderEvent({});
event3.currentTarget = node;
onResponderTerminate(event3);
}
changeCurrentResponder(emptyResponder);
}
isEmulatingMouseEvents = false;
trackedTouchCount = 0;
}
function getResponderNode() {
return currentResponder.node;
}
var emptyObject$8 = {};
var idCounter = 0;
function useStable$1(getInitialValue) {
var ref = useRef(null);
if (ref.current == null) {
ref.current = getInitialValue();
}
return ref.current;
}
function useResponderEvents(hostRef, config) {
if (config === void 0) {
config = emptyObject$8;
}
var id2 = useStable$1(function() {
return idCounter++;
});
var isAttachedRef = useRef(false);
useEffect(function() {
attachListeners();
return function() {
removeNode(id2);
};
}, [id2]);
useEffect(function() {
var _config = config, onMoveShouldSetResponder = _config.onMoveShouldSetResponder, onMoveShouldSetResponderCapture = _config.onMoveShouldSetResponderCapture, onScrollShouldSetResponder = _config.onScrollShouldSetResponder, onScrollShouldSetResponderCapture = _config.onScrollShouldSetResponderCapture, onSelectionChangeShouldSetResponder = _config.onSelectionChangeShouldSetResponder, onSelectionChangeShouldSetResponderCapture = _config.onSelectionChangeShouldSetResponderCapture, onStartShouldSetResponder = _config.onStartShouldSetResponder, onStartShouldSetResponderCapture = _config.onStartShouldSetResponderCapture;
var requiresResponderSystem = onMoveShouldSetResponder != null || onMoveShouldSetResponderCapture != null || onScrollShouldSetResponder != null || onScrollShouldSetResponderCapture != null || onSelectionChangeShouldSetResponder != null || onSelectionChangeShouldSetResponderCapture != null || onStartShouldSetResponder != null || onStartShouldSetResponderCapture != null;
var node = hostRef.current;
if (requiresResponderSystem) {
addNode(id2, node, config);
isAttachedRef.current = true;
} else if (isAttachedRef.current) {
removeNode(id2);
isAttachedRef.current = false;
}
}, [config, hostRef, id2]);
useDebugValue({
isResponder: hostRef.current === getResponderNode()
});
useDebugValue(config);
}
var TextAncestorContext = /* @__PURE__ */ createContext(false);
function ownKeys$7(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$7(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys$7(Object(source), true).forEach(function(key) {
_defineProperty$7(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys$7(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _defineProperty$7(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {value, enumerable: true, configurable: true, writable: true});
} else {
obj[key] = value;
}
return obj;
}
var forwardPropsList = _objectSpread$7(_objectSpread$7(_objectSpread$7(_objectSpread$7(_objectSpread$7(_objectSpread$7(_objectSpread$7(_objectSpread$7(_objectSpread$7({}, defaultProps), accessibilityProps), clickProps), focusProps), keyboardProps), mouseProps), touchProps), styleProps), {}, {
href: true,
lang: true,
onScroll: true,
onWheel: true,
pointerEvents: true
});
var pickProps = function pickProps2(props) {
return pick(props, forwardPropsList);
};
var View = /* @__PURE__ */ forwardRef(function(props, forwardedRef) {
var hrefAttrs = props.hrefAttrs, onLayout = props.onLayout, onMoveShouldSetResponder = props.onMoveShouldSetResponder, onMoveShouldSetResponderCapture = props.onMoveShouldSetResponderCapture, onResponderEnd = props.onResponderEnd, onResponderGrant = props.onResponderGrant, onResponderMove = props.onResponderMove, onResponderReject = props.onResponderReject, onResponderRelease = props.onResponderRelease, onResponderStart = props.onResponderStart, onResponderTerminate = props.onResponderTerminate, onResponderTerminationRequest = props.onResponderTerminationRequest, onScrollShouldSetResponder = props.onScrollShouldSetResponder, onScrollShouldSetResponderCapture = props.onScrollShouldSetResponderCapture, onSelectionChangeShouldSetResponder = props.onSelectionChangeShouldSetResponder, onSelectionChangeShouldSetResponderCapture = props.onSelectionChangeShouldSetResponderCapture, onStartShouldSetResponder = props.onStartShouldSetResponder, onStartShouldSetResponderCapture = props.onStartShouldSetResponderCapture;
var hasTextAncestor = useContext(TextAncestorContext);
var hostRef = useRef(null);
useElementLayout(hostRef, onLayout);
useResponderEvents(hostRef, {
onMoveShouldSetResponder,
onMoveShouldSetResponderCapture,
onResponderEnd,
onResponderGrant,
onResponderMove,
onResponderReject,
onResponderRelease,
onResponderStart,
onResponderTerminate,
onResponderTerminationRequest,
onScrollShouldSetResponder,
onScrollShouldSetResponderCapture,
onSelectionChangeShouldSetResponder,
onSelectionChangeShouldSetResponderCapture,
onStartShouldSetResponder,
onStartShouldSetResponderCapture
});
var style = StyleSheet.compose(hasTextAncestor && styles.inline, props.style);
var supportedProps = pickProps(props);
supportedProps.classList = classList;
supportedProps.style = style;
if (props.href != null && hrefAttrs != null) {
var download = hrefAttrs.download, rel = hrefAttrs.rel, target = hrefAttrs.target;
if (download != null) {
supportedProps.download = download;
}
if (rel != null) {
supportedProps.rel = rel;
}
if (typeof target === "string" && target.charAt(0) !== "_") {
supportedProps.target = "_" + target;
}
}
var platformMethodsRef = usePlatformMethods(supportedProps);
var setRef = useMergeRefs(hostRef, platformMethodsRef, forwardedRef);
supportedProps.ref = setRef;
return createElement("div", supportedProps);
});
View.displayName = "View";
var classes$1 = css.create({
view: {
alignItems: "stretch",
border: "0 solid black",
boxSizing: "border-box",
display: "flex",
flexBasis: "auto",
flexDirection: "column",
flexShrink: 0,
margin: 0,
minHeight: 0,
minWidth: 0,
padding: 0,
position: "relative",
zIndex: 0
}
});
var classList = [classes$1.view];
var styles = StyleSheet.create({
inline: {
display: "inline-flex"
}
});
var Batchinator = /* @__PURE__ */ function() {
function Batchinator2(callback, delayMS) {
this._delay = delayMS;
this._callback = callback;
}
var _proto = Batchinator2.prototype;
_proto.dispose = function dispose(options) {
if (options === void 0) {
options = {
abort: false
};
}
if (this._taskHandle) {
this._taskHandle.cancel();
if (!options.abort) {
this._callback();
}
this._taskHandle = null;
}
};
_proto.schedule = function schedule() {
var _this = this;
if (this._taskHandle) {
return;
}
var timeoutHandle = setTimeout(function() {
_this._taskHandle = InteractionManager.runAfterInteractions(function() {
_this._taskHandle = null;
_this._callback();
});
}, this._delay);
this._taskHandle = {
cancel: function cancel2() {
return clearTimeout(timeoutHandle);
}
};
};
return Batchinator2;
}();
function ownKeys$8(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$8(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys$8(Object(source), true).forEach(function(key) {
_defineProperty$8(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys$8(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _defineProperty$8(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {value, enumerable: true, configurable: true, writable: true});
} else {
obj[key] = value;
}
return obj;
}
var Info = function Info2() {
this.any_blank_count = 0;
this.any_blank_ms = 0;
this.any_blank_speed_sum = 0;
this.mostly_blank_count = 0;
this.mostly_blank_ms = 0;
this.pixels_blank = 0;
this.pixels_sampled = 0;
this.pixels_scrolled = 0;
this.total_time_spent = 0;
this.sample_count = 0;
};
var _listeners = [];
var _minSampleCount = 10;
var _sampleRate = null;
var FillRateHelper = /* @__PURE__ */ function() {
FillRateHelper2.addListener = function addListener3(callback) {
warning2(_sampleRate !== null, "Call `FillRateHelper.setSampleRate` before `addListener`.");
_listeners.push(callback);
return {
remove: function remove() {
_listeners = _listeners.filter(function(listener) {
return callback !== listener;
});
}
};
};
FillRateHelper2.setSampleRate = function setSampleRate(sampleRate) {
_sampleRate = sampleRate;
};
FillRateHelper2.setMinSampleCount = function setMinSampleCount(minSampleCount) {
_minSampleCount = minSampleCount;
};
function FillRateHelper2(getFrameMetrics) {
this._anyBlankStartTime = null;
this._enabled = false;
this._info = new Info();
this._mostlyBlankStartTime = null;
this._samplesStartTime = null;
this._getFrameMetrics = getFrameMetrics;
this._enabled = (_sampleRate || 0) > Math.random();
this._resetData();
}
var _proto = FillRateHelper2.prototype;
_proto.activate = function activate() {
if (this._enabled && this._samplesStartTime == null) {
this._samplesStartTime = performanceNow2();
}
};
_proto.deactivateAndFlush = function deactivateAndFlush() {
if (!this._enabled) {
return;
}
var start = this._samplesStartTime;
if (start == null) {
return;
}
if (this._info.sample_count < _minSampleCount) {
this._resetData();
return;
}
var total_time_spent = performanceNow2() - start;
var info = _objectSpread$8(_objectSpread$8({}, this._info), {}, {
total_time_spent
});
_listeners.forEach(function(listener) {
return listener(info);
});
this._resetData();
};
_proto.computeBlankness = function computeBlankness(props, state, scrollMetrics) {
if (!this._enabled || props.getItemCount(props.data) === 0 || this._samplesStartTime == null) {
return 0;
}
var dOffset = scrollMetrics.dOffset, offset = scrollMetrics.offset, velocity = scrollMetrics.velocity, visibleLength = scrollMetrics.visibleLength;
this._info.sample_count++;
this._info.pixels_sampled += Math.round(visibleLength);
this._info.pixels_scrolled += Math.round(Math.abs(dOffset));
var scrollSpeed = Math.round(Math.abs(velocity) * 1e3);
var now = performanceNow2();
if (this._anyBlankStartTime != null) {
this._info.any_blank_ms += now - this._anyBlankStartTime;
}
this._anyBlankStartTime = null;
if (this._mostlyBlankStartTime != null) {
this._info.mostly_blank_ms += now - this._mostlyBlankStartTime;
}
this._mostlyBlankStartTime = null;
var blankTop = 0;
var first = state.first;
var firstFrame = this._getFrameMetrics(first);
while (first <= state.last && (!firstFrame || !firstFrame.inLayout)) {
firstFrame = this._getFrameMetrics(first);
first++;
}
if (firstFrame && first > 0) {
blankTop = Math.min(visibleLength, Math.max(0, firstFrame.offset - offset));
}
var blankBottom = 0;
var last = state.last;
var lastFrame = this._getFrameMetrics(last);
while (last >= state.first && (!lastFrame || !lastFrame.inLayout)) {
lastFrame = this._getFrameMetrics(last);
last--;
}
if (lastFrame && last < props.getItemCount(props.data) - 1) {
var bottomEdge = lastFrame.offset + lastFrame.length;
blankBottom = Math.min(visibleLength, Math.max(0, offset + visibleLength - bottomEdge));
}
var pixels_blank = Math.round(blankTop + blankBottom);
var blankness = pixels_blank / visibleLength;
if (blankness > 0) {
this._anyBlankStartTime = now;
this._info.any_blank_speed_sum += scrollSpeed;
this._info.any_blank_count++;
this._info.pixels_blank += pixels_blank;
if (blankness > 0.5) {
this._mostlyBlankStartTime = now;
this._info.mostly_blank_count++;
}
} else if (scrollSpeed < 0.01 || Math.abs(dOffset) < 1) {
this.deactivateAndFlush();
}
return blankness;
};
_proto.enabled = function enabled() {
return this._enabled;
};
_proto._resetData = function _resetData() {
this._anyBlankStartTime = null;
this._info = new Info();
this._mostlyBlankStartTime = null;
this._samplesStartTime = null;
};
return FillRateHelper2;
}();
function _objectWithoutPropertiesLoose$3(source, excluded) {
if (source == null)
return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0)
continue;
target[key] = source[key];
}
return target;
}
function RefreshControl(props) {
var colors = props.colors, enabled = props.enabled, onRefresh = props.onRefresh, progressBackgroundColor = props.progressBackgroundColor, progressViewOffset = props.progressViewOffset, refreshing = props.refreshing, size = props.size, tintColor = props.tintColor, title = props.title, titleColor = props.titleColor, rest = _objectWithoutPropertiesLoose$3(props, ["colors", "enabled", "onRefresh", "progressBackgroundColor", "progressViewOffset", "refreshing", "size", "tintColor", "title", "titleColor"]);
return /* @__PURE__ */ React__default.createElement(View, rest);
}
var TextInputState = {
_currentlyFocusedNode: null,
currentlyFocusedField: function currentlyFocusedField() {
if (document.activeElement !== this._currentlyFocusedNode) {
this._currentlyFocusedNode = null;
}
return this._currentlyFocusedNode;
},
focusTextInput: function focusTextInput(textFieldNode) {
if (textFieldNode !== null) {
this._currentlyFocusedNode = textFieldNode;
if (document.activeElement !== textFieldNode) {
UIManager.focus(textFieldNode);
}
}
},
blurTextInput: function blurTextInput(textFieldNode) {
if (textFieldNode !== null) {
this._currentlyFocusedNode = null;
if (document.activeElement === textFieldNode) {
UIManager.blur(textFieldNode);
}
}
}
};
var dismissKeyboard = function dismissKeyboard2() {
TextInputState.blurTextInput(TextInputState.currentlyFocusedField());
};
var win = canUseDOM ? window : {
devicePixelRatio: void 0,
innerHeight: void 0,
innerWidth: void 0,
screen: {
height: void 0,
width: void 0
}
};
var dimensions = {};
var listeners = {};
var Dimensions = /* @__PURE__ */ function() {
function Dimensions2() {
}
Dimensions2.get = function get3(dimension) {
invariant2(dimensions[dimension], "No dimension set for key " + dimension);
return dimensions[dimension];
};
Dimensions2.set = function set2(initialDimensions) {
if (initialDimensions) {
if (canUseDOM) {
invariant2(false, "Dimensions cannot be set in the browser");
} else {
dimensions.screen = initialDimensions.screen;
dimensions.window = initialDimensions.window;
}
}
};
Dimensions2._update = function _update() {
dimensions.window = {
fontScale: 1,
height: win.innerHeight,
scale: win.devicePixelRatio || 1,
width: win.innerWidth
};
dimensions.screen = {
fontScale: 1,
height: win.screen.height,
scale: win.devicePixelRatio || 1,
width: win.screen.width
};
if (Array.isArray(listeners["change"])) {
listeners["change"].forEach(function(handler) {
return handler(dimensions);
});
}
};
Dimensions2.addEventListener = function addEventListener3(type, handler) {
listeners[type] = listeners[type] || [];
listeners[type].push(handler);
};
Dimensions2.removeEventListener = function removeEventListener2(type, handler) {
if (Array.isArray(listeners[type])) {
listeners[type] = listeners[type].filter(function(_handler) {
return _handler !== handler;
});
}
};
return Dimensions2;
}();
Dimensions._update();
if (canUseDOM) {
window.addEventListener("resize", Dimensions._update, false);
}
var Platform = {
OS: "web",
select: function select(obj) {
return "web" in obj ? obj.web : obj.default;
},
get isTesting() {
return false;
}
};
var emptyObject$9 = {};
var IS_ANIMATING_TOUCH_START_THRESHOLD_MS = 16;
var ScrollResponderMixin = {
scrollResponderMixinGetInitialState: function scrollResponderMixinGetInitialState() {
return {
isTouching: false,
lastMomentumScrollBeginTime: 0,
lastMomentumScrollEndTime: 0,
observedScrollSinceBecomingResponder: false,
becameResponderWhileAnimating: false
};
},
scrollResponderHandleScrollShouldSetResponder: function scrollResponderHandleScrollShouldSetResponder() {
return this.state.isTouching;
},
scrollResponderHandleStartShouldSetResponder: function scrollResponderHandleStartShouldSetResponder() {
return false;
},
scrollResponderHandleStartShouldSetResponderCapture: function scrollResponderHandleStartShouldSetResponderCapture(e) {
return this.scrollResponderIsAnimating();
},
scrollResponderHandleResponderReject: function scrollResponderHandleResponderReject() {
warning2(false, "ScrollView doesn't take rejection well - scrolls anyway");
},
scrollResponderHandleTerminationRequest: function scrollResponderHandleTerminationRequest() {
return !this.state.observedScrollSinceBecomingResponder;
},
scrollResponderHandleTouchEnd: function scrollResponderHandleTouchEnd(e) {
var nativeEvent = e.nativeEvent;
this.state.isTouching = nativeEvent.touches.length !== 0;
this.props.onTouchEnd && this.props.onTouchEnd(e);
},
scrollResponderHandleResponderRelease: function scrollResponderHandleResponderRelease(e) {
this.props.onResponderRelease && this.props.onResponderRelease(e);
var currentlyFocusedTextInput = TextInputState.currentlyFocusedField();
if (!this.props.keyboardShouldPersistTaps && currentlyFocusedTextInput != null && e.target !== currentlyFocusedTextInput && !this.state.observedScrollSinceBecomingResponder && !this.state.becameResponderWhileAnimating) {
this.props.onScrollResponderKeyboardDismissed && this.props.onScrollResponderKeyboardDismissed(e);
TextInputState.blurTextInput(currentlyFocusedTextInput);
}
},
scrollResponderHandleScroll: function scrollResponderHandleScroll(e) {
this.state.observedScrollSinceBecomingResponder = true;
this.props.onScroll && this.props.onScroll(e);
},
scrollResponderHandleResponderGrant: function scrollResponderHandleResponderGrant(e) {
this.state.observedScrollSinceBecomingResponder = false;
this.props.onResponderGrant && this.props.onResponderGrant(e);
this.state.becameResponderWhileAnimating = this.scrollResponderIsAnimating();
},
scrollResponderHandleScrollBeginDrag: function scrollResponderHandleScrollBeginDrag(e) {
this.props.onScrollBeginDrag && this.props.onScrollBeginDrag(e);
},
scrollResponderHandleScrollEndDrag: function scrollResponderHandleScrollEndDrag(e) {
this.props.onScrollEndDrag && this.props.onScrollEndDrag(e);
},
scrollResponderHandleMomentumScrollBegin: function scrollResponderHandleMomentumScrollBegin(e) {
this.state.lastMomentumScrollBeginTime = Date.now();
this.props.onMomentumScrollBegin && this.props.onMomentumScrollBegin(e);
},
scrollResponderHandleMomentumScrollEnd: function scrollResponderHandleMomentumScrollEnd(e) {
this.state.lastMomentumScrollEndTime = Date.now();
this.props.onMomentumScrollEnd && this.props.onMomentumScrollEnd(e);
},
scrollResponderHandleTouchStart: function scrollResponderHandleTouchStart(e) {
this.state.isTouching = true;
this.props.onTouchStart && this.props.onTouchStart(e);
},
scrollResponderHandleTouchMove: function scrollResponderHandleTouchMove(e) {
this.props.onTouchMove && this.props.onTouchMove(e);
},
scrollResponderIsAnimating: function scrollResponderIsAnimating() {
var now = Date.now();
var timeSinceLastMomentumScrollEnd = now - this.state.lastMomentumScrollEndTime;
var isAnimating = timeSinceLastMomentumScrollEnd < IS_ANIMATING_TOUCH_START_THRESHOLD_MS || this.state.lastMomentumScrollEndTime < this.state.lastMomentumScrollBeginTime;
return isAnimating;
},
scrollResponderGetScrollableNode: function scrollResponderGetScrollableNode() {
return this.getScrollableNode ? this.getScrollableNode() : findNodeHandle(this);
},
scrollResponderScrollTo: function scrollResponderScrollTo(x, y, animated) {
if (typeof x === "number") {
console.warn("`scrollResponderScrollTo(x, y, animated)` is deprecated. Use `scrollResponderScrollTo({x: 5, y: 5, animated: true})` instead.");
} else {
var _ref = x || emptyObject$9;
x = _ref.x;
y = _ref.y;
animated = _ref.animated;
}
var node = this.scrollResponderGetScrollableNode();
var left2 = x || 0;
var top = y || 0;
if (typeof node.scroll === "function") {
node.scroll({
top,
left: left2,
behavior: !animated ? "auto" : "smooth"
});
} else {
node.scrollLeft = left2;
node.scrollTop = top;
}
},
scrollResponderZoomTo: function scrollResponderZoomTo(rect, animated) {
if (Platform.OS !== "ios") {
invariant2("zoomToRect is not implemented");
}
},
scrollResponderFlashScrollIndicators: function scrollResponderFlashScrollIndicators() {
},
scrollResponderScrollNativeHandleToKeyboard: function scrollResponderScrollNativeHandleToKeyboard(nodeHandle, additionalOffset, preventNegativeScrollOffset) {
this.additionalScrollOffset = additionalOffset || 0;
this.preventNegativeScrollOffset = !!preventNegativeScrollOffset;
UIManager.measureLayout(nodeHandle, findNodeHandle(this.getInnerViewNode()), this.scrollResponderTextInputFocusError, this.scrollResponderInputMeasureAndScrollToKeyboard);
},
scrollResponderInputMeasureAndScrollToKeyboard: function scrollResponderInputMeasureAndScrollToKeyboard(left2, top, width, height) {
var keyboardScreenY = Dimensions.get("window").height;
if (this.keyboardWillOpenTo) {
keyboardScreenY = this.keyboardWillOpenTo.endCoordinates.screenY;
}
var scrollOffsetY = top - keyboardScreenY + height + this.additionalScrollOffset;
if (this.preventNegativeScrollOffset) {
scrollOffsetY = Math.max(0, scrollOffsetY);
}
this.scrollResponderScrollTo({
x: 0,
y: scrollOffsetY,
animated: true
});
this.additionalOffset = 0;
this.preventNegativeScrollOffset = false;
},
scrollResponderTextInputFocusError: function scrollResponderTextInputFocusError(e) {
console.error("Error measuring text field: ", e);
},
UNSAFE_componentWillMount: function UNSAFE_componentWillMount() {
this.keyboardWillOpenTo = null;
this.additionalScrollOffset = 0;
},
scrollResponderKeyboardWillShow: function scrollResponderKeyboardWillShow(e) {
this.keyboardWillOpenTo = e;
this.props.onKeyboardWillShow && this.props.onKeyboardWillShow(e);
},
scrollResponderKeyboardWillHide: function scrollResponderKeyboardWillHide(e) {
this.keyboardWillOpenTo = null;
this.props.onKeyboardWillHide && this.props.onKeyboardWillHide(e);
},
scrollResponderKeyboardDidShow: function scrollResponderKeyboardDidShow(e) {
if (e) {
this.keyboardWillOpenTo = e;
}
this.props.onKeyboardDidShow && this.props.onKeyboardDidShow(e);
},
scrollResponderKeyboardDidHide: function scrollResponderKeyboardDidHide(e) {
this.keyboardWillOpenTo = null;
this.props.onKeyboardDidHide && this.props.onKeyboardDidHide(e);
}
};
var ScrollResponder = {
Mixin: ScrollResponderMixin
};
function _extends$1() {
_extends$1 = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$1.apply(this, arguments);
}
function _objectWithoutPropertiesLoose$4(source, excluded) {
if (source == null)
return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0)
continue;
target[key] = source[key];
}
return target;
}
function normalizeScrollEvent(e) {
return {
nativeEvent: {
contentOffset: {
get x() {
return e.target.scrollLeft;
},
get y() {
return e.target.scrollTop;
}
},
contentSize: {
get height() {
return e.target.scrollHeight;
},
get width() {
return e.target.scrollWidth;
}
},
layoutMeasurement: {
get height() {
return e.target.offsetHeight;
},
get width() {
return e.target.offsetWidth;
}
}
},
timeStamp: Date.now()
};
}
function shouldEmitScrollEvent(lastTick, eventThrottle) {
var timeSinceLastTick = Date.now() - lastTick;
return eventThrottle > 0 && timeSinceLastTick >= eventThrottle;
}
var ScrollViewBase = /* @__PURE__ */ forwardRef(function(props, forwardedRef) {
var onScroll = props.onScroll, onTouchMove = props.onTouchMove, onWheel = props.onWheel, _props$scrollEnabled = props.scrollEnabled, scrollEnabled = _props$scrollEnabled === void 0 ? true : _props$scrollEnabled, _props$scrollEventThr = props.scrollEventThrottle, scrollEventThrottle = _props$scrollEventThr === void 0 ? 0 : _props$scrollEventThr, showsHorizontalScrollIndicator = props.showsHorizontalScrollIndicator, showsVerticalScrollIndicator = props.showsVerticalScrollIndicator, style = props.style, rest = _objectWithoutPropertiesLoose$4(props, ["onScroll", "onTouchMove", "onWheel", "scrollEnabled", "scrollEventThrottle", "showsHorizontalScrollIndicator", "showsVerticalScrollIndicator", "style"]);
var scrollState = useRef({
isScrolling: false,
scrollLastTick: 0
});
var scrollTimeout = useRef(null);
var scrollRef = useRef(null);
function createPreventableScrollHandler(handler) {
return function(e) {
if (scrollEnabled) {
if (handler) {
handler(e);
}
}
};
}
function handleScroll(e) {
e.stopPropagation();
if (e.target === scrollRef.current) {
e.persist();
if (scrollTimeout.current != null) {
clearTimeout(scrollTimeout.current);
}
scrollTimeout.current = setTimeout(function() {
handleScrollEnd(e);
}, 100);
if (scrollState.current.isScrolling) {
if (shouldEmitScrollEvent(scrollState.current.scrollLastTick, scrollEventThrottle)) {
handleScrollTick(e);
}
} else {
handleScrollStart(e);
}
}
}
function handleScrollStart(e) {
scrollState.current.isScrolling = true;
handleScrollTick(e);
}
function handleScrollTick(e) {
scrollState.current.scrollLastTick = Date.now();
if (onScroll) {
onScroll(normalizeScrollEvent(e));
}
}
function handleScrollEnd(e) {
scrollState.current.isScrolling = false;
if (onScroll) {
onScroll(normalizeScrollEvent(e));
}
}
var hideScrollbar = showsHorizontalScrollIndicator === false || showsVerticalScrollIndicator === false;
return /* @__PURE__ */ createElement$1(View, _extends$1({}, rest, {
onScroll: handleScroll,
onTouchMove: createPreventableScrollHandler(onTouchMove),
onWheel: createPreventableScrollHandler(onWheel),
ref: useMergeRefs(scrollRef, forwardedRef),
style: [style, !scrollEnabled && styles$1.scrollDisabled, hideScrollbar && styles$1.hideScrollbar]
}));
});
var styles$1 = StyleSheet.create({
scrollDisabled: {
overflowX: "hidden",
overflowY: "hidden",
touchAction: "none"
},
hideScrollbar: {
scrollbarWidth: "none"
}
});
function ownKeys$9(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$9(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys$9(Object(source), true).forEach(function(key) {
_defineProperty$9(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys$9(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _defineProperty$9(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {value, enumerable: true, configurable: true, writable: true});
} else {
obj[key] = value;
}
return obj;
}
function _extends$2() {
_extends$2 = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$2.apply(this, arguments);
}
function _objectWithoutPropertiesLoose$5(source, excluded) {
if (source == null)
return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0)
continue;
target[key] = source[key];
}
return target;
}
var emptyObject$a = {};
var ScrollView = createReactClass({
displayName: "ScrollView",
mixins: [ScrollResponder.Mixin],
getInitialState: function getInitialState() {
return this.scrollResponderMixinGetInitialState();
},
flashScrollIndicators: function flashScrollIndicators() {
this.scrollResponderFlashScrollIndicators();
},
setNativeProps: function setNativeProps2(props) {
if (this._scrollNodeRef) {
this._scrollNodeRef.setNativeProps(props);
}
},
getScrollResponder: function getScrollResponder() {
return this;
},
getScrollableNode: function getScrollableNode() {
return this._scrollNodeRef;
},
getInnerViewNode: function getInnerViewNode() {
return this._innerViewRef;
},
scrollTo: function scrollTo(y, x, animated) {
if (typeof y === "number") {
console.warn("`scrollTo(y, x, animated)` is deprecated. Use `scrollTo({x: 5, y: 5, animated: true})` instead.");
} else {
var _ref = y || emptyObject$a;
x = _ref.x;
y = _ref.y;
animated = _ref.animated;
}
this.getScrollResponder().scrollResponderScrollTo({
x: x || 0,
y: y || 0,
animated: animated !== false
});
},
scrollToEnd: function scrollToEnd(options) {
var animated = (options && options.animated) !== false;
var horizontal = this.props.horizontal;
var scrollResponder = this.getScrollResponder();
var scrollResponderNode = scrollResponder.scrollResponderGetScrollableNode();
var x = horizontal ? scrollResponderNode.scrollWidth : 0;
var y = horizontal ? 0 : scrollResponderNode.scrollHeight;
scrollResponder.scrollResponderScrollTo({
x,
y,
animated
});
},
render: function render2() {
var _this$props = this.props, contentContainerStyle = _this$props.contentContainerStyle, horizontal = _this$props.horizontal, onContentSizeChange = _this$props.onContentSizeChange, refreshControl = _this$props.refreshControl, stickyHeaderIndices = _this$props.stickyHeaderIndices, pagingEnabled = _this$props.pagingEnabled, keyboardDismissMode = _this$props.keyboardDismissMode, onScroll = _this$props.onScroll, other = _objectWithoutPropertiesLoose$5(_this$props, ["contentContainerStyle", "horizontal", "onContentSizeChange", "refreshControl", "stickyHeaderIndices", "pagingEnabled", "keyboardDismissMode", "onScroll"]);
var contentSizeChangeProps = {};
if (onContentSizeChange) {
contentSizeChangeProps = {
onLayout: this._handleContentOnLayout
};
}
var hasStickyHeaderIndices = !horizontal && Array.isArray(stickyHeaderIndices);
var children = hasStickyHeaderIndices || pagingEnabled ? React__default.Children.map(this.props.children, function(child, i) {
var isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1;
if (child != null && (isSticky || pagingEnabled)) {
return /* @__PURE__ */ React__default.createElement(View, {
style: StyleSheet.compose(isSticky && styles$2.stickyHeader, pagingEnabled && styles$2.pagingEnabledChild)
}, child);
} else {
return child;
}
}) : this.props.children;
var contentContainer = /* @__PURE__ */ React__default.createElement(View, _extends$2({}, contentSizeChangeProps, {
children,
collapsable: false,
ref: this._setInnerViewRef,
style: StyleSheet.compose(horizontal && styles$2.contentContainerHorizontal, contentContainerStyle)
}));
var baseStyle = horizontal ? styles$2.baseHorizontal : styles$2.baseVertical;
var pagingEnabledStyle = horizontal ? styles$2.pagingEnabledHorizontal : styles$2.pagingEnabledVertical;
var props = _objectSpread$9(_objectSpread$9({}, other), {}, {
style: [baseStyle, pagingEnabled && pagingEnabledStyle, this.props.style],
onTouchStart: this.scrollResponderHandleTouchStart,
onTouchMove: this.scrollResponderHandleTouchMove,
onTouchEnd: this.scrollResponderHandleTouchEnd,
onScrollBeginDrag: this.scrollResponderHandleScrollBeginDrag,
onScrollEndDrag: this.scrollResponderHandleScrollEndDrag,
onMomentumScrollBegin: this.scrollResponderHandleMomentumScrollBegin,
onMomentumScrollEnd: this.scrollResponderHandleMomentumScrollEnd,
onStartShouldSetResponder: this.scrollResponderHandleStartShouldSetResponder,
onStartShouldSetResponderCapture: this.scrollResponderHandleStartShouldSetResponderCapture,
onScrollShouldSetResponder: this.scrollResponderHandleScrollShouldSetResponder,
onScroll: this._handleScroll,
onResponderGrant: this.scrollResponderHandleResponderGrant,
onResponderTerminationRequest: this.scrollResponderHandleTerminationRequest,
onResponderTerminate: this.scrollResponderHandleTerminate,
onResponderRelease: this.scrollResponderHandleResponderRelease,
onResponderReject: this.scrollResponderHandleResponderReject
});
var ScrollViewClass = ScrollViewBase;
invariant2(ScrollViewClass !== void 0, "ScrollViewClass must not be undefined");
if (refreshControl) {
return /* @__PURE__ */ React__default.cloneElement(refreshControl, {
style: props.style
}, /* @__PURE__ */ React__default.createElement(ScrollViewClass, _extends$2({}, props, {
ref: this._setScrollNodeRef,
style: baseStyle
}), contentContainer));
}
return /* @__PURE__ */ React__default.createElement(ScrollViewClass, _extends$2({}, props, {
ref: this._setScrollNodeRef
}), contentContainer);
},
_handleContentOnLayout: function _handleContentOnLayout(e) {
var _e$nativeEvent$layout = e.nativeEvent.layout, width = _e$nativeEvent$layout.width, height = _e$nativeEvent$layout.height;
this.props.onContentSizeChange(width, height);
},
_handleScroll: function _handleScroll(e) {
if (this.props.keyboardDismissMode === "on-drag") {
dismissKeyboard();
}
this.scrollResponderHandleScroll(e);
},
_setInnerViewRef: function _setInnerViewRef(component) {
this._innerViewRef = component;
},
_setScrollNodeRef: function _setScrollNodeRef(component) {
this._scrollNodeRef = component;
}
});
var commonStyle = {
flexGrow: 1,
flexShrink: 1,
transform: [{
translateZ: 0
}],
WebkitOverflowScrolling: "touch"
};
var styles$2 = StyleSheet.create({
baseVertical: _objectSpread$9(_objectSpread$9({}, commonStyle), {}, {
flexDirection: "column",
overflowX: "hidden",
overflowY: "auto"
}),
baseHorizontal: _objectSpread$9(_objectSpread$9({}, commonStyle), {}, {
flexDirection: "row",
overflowX: "auto",
overflowY: "hidden"
}),
contentContainerHorizontal: {
flexDirection: "row"
},
stickyHeader: {
position: "sticky",
top: 0,
zIndex: 10
},
pagingEnabledHorizontal: {
scrollSnapType: "x mandatory"
},
pagingEnabledVertical: {
scrollSnapType: "y mandatory"
},
pagingEnabledChild: {
scrollSnapAlign: "start"
}
});
function ownKeys$a(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$a(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys$a(Object(source), true).forEach(function(key) {
_defineProperty$a(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys$a(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _defineProperty$a(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {value, enumerable: true, configurable: true, writable: true});
} else {
obj[key] = value;
}
return obj;
}
function _createForOfIteratorHelperLoose$1(o, allowArrayLike) {
var it;
if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") {
if (it)
o = it;
var i = 0;
return function() {
if (i >= o.length)
return {done: true};
return {done: false, value: o[i++]};
};
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
it = o[Symbol.iterator]();
return it.next.bind(it);
}
function _unsupportedIterableToArray$1(o, minLen) {
if (!o)
return;
if (typeof o === "string")
return _arrayLikeToArray$1(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor)
n = o.constructor.name;
if (n === "Map" || n === "Set")
return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
return _arrayLikeToArray$1(o, minLen);
}
function _arrayLikeToArray$1(arr, len) {
if (len == null || len > arr.length)
len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i];
}
return arr2;
}
var ViewabilityHelper = /* @__PURE__ */ function() {
function ViewabilityHelper2(config) {
if (config === void 0) {
config = {
viewAreaCoveragePercentThreshold: 0
};
}
this._hasInteracted = false;
this._timers = new Set();
this._viewableIndices = [];
this._viewableItems = new Map();
this._config = config;
}
var _proto = ViewabilityHelper2.prototype;
_proto.dispose = function dispose() {
this._timers.forEach(clearTimeout);
};
_proto.computeViewableItems = function computeViewableItems(itemCount, scrollOffset, viewportHeight, getFrameMetrics, renderRange) {
var _this$_config = this._config, itemVisiblePercentThreshold = _this$_config.itemVisiblePercentThreshold, viewAreaCoveragePercentThreshold = _this$_config.viewAreaCoveragePercentThreshold;
var viewAreaMode = viewAreaCoveragePercentThreshold != null;
var viewablePercentThreshold = viewAreaMode ? viewAreaCoveragePercentThreshold : itemVisiblePercentThreshold;
invariant2(viewablePercentThreshold != null && itemVisiblePercentThreshold != null !== (viewAreaCoveragePercentThreshold != null), "Must set exactly one of itemVisiblePercentThreshold or viewAreaCoveragePercentThreshold");
var viewableIndices = [];
if (itemCount === 0) {
return viewableIndices;
}
var firstVisible = -1;
var _ref = renderRange || {
first: 0,
last: itemCount - 1
}, first = _ref.first, last = _ref.last;
if (last >= itemCount) {
console.warn("Invalid render range computing viewability " + JSON.stringify({
renderRange,
itemCount
}));
return [];
}
for (var idx = first; idx <= last; idx++) {
var metrics = getFrameMetrics(idx);
if (!metrics) {
continue;
}
var top = metrics.offset - scrollOffset;
var bottom = top + metrics.length;
if (top < viewportHeight && bottom > 0) {
firstVisible = idx;
if (_isViewable(viewAreaMode, viewablePercentThreshold, top, bottom, viewportHeight, metrics.length)) {
viewableIndices.push(idx);
}
} else if (firstVisible >= 0) {
break;
}
}
return viewableIndices;
};
_proto.onUpdate = function onUpdate(itemCount, scrollOffset, viewportHeight, getFrameMetrics, createViewToken, onViewableItemsChanged, renderRange) {
var _this = this;
if (this._config.waitForInteraction && !this._hasInteracted || itemCount === 0 || !getFrameMetrics(0)) {
return;
}
var viewableIndices = [];
if (itemCount) {
viewableIndices = this.computeViewableItems(itemCount, scrollOffset, viewportHeight, getFrameMetrics, renderRange);
}
if (this._viewableIndices.length === viewableIndices.length && this._viewableIndices.every(function(v, ii) {
return v === viewableIndices[ii];
})) {
return;
}
this._viewableIndices = viewableIndices;
if (this._config.minimumViewTime) {
var handle = setTimeout(function() {
_this._timers.delete(handle);
_this._onUpdateSync(viewableIndices, onViewableItemsChanged, createViewToken);
}, this._config.minimumViewTime);
this._timers.add(handle);
} else {
this._onUpdateSync(viewableIndices, onViewableItemsChanged, createViewToken);
}
};
_proto.resetViewableIndices = function resetViewableIndices() {
this._viewableIndices = [];
};
_proto.recordInteraction = function recordInteraction() {
this._hasInteracted = true;
};
_proto._onUpdateSync = function _onUpdateSync(viewableIndicesToCheck, onViewableItemsChanged, createViewToken) {
var _this2 = this;
viewableIndicesToCheck = viewableIndicesToCheck.filter(function(ii) {
return _this2._viewableIndices.includes(ii);
});
var prevItems = this._viewableItems;
var nextItems = new Map(viewableIndicesToCheck.map(function(ii) {
var viewable2 = createViewToken(ii, true);
return [viewable2.key, viewable2];
}));
var changed = [];
for (var _iterator = _createForOfIteratorHelperLoose$1(nextItems), _step; !(_step = _iterator()).done; ) {
var _step$value = _step.value, key = _step$value[0], viewable = _step$value[1];
if (!prevItems.has(key)) {
changed.push(viewable);
}
}
for (var _iterator2 = _createForOfIteratorHelperLoose$1(prevItems), _step2; !(_step2 = _iterator2()).done; ) {
var _step2$value = _step2.value, _key = _step2$value[0], _viewable = _step2$value[1];
if (!nextItems.has(_key)) {
changed.push(_objectSpread$a(_objectSpread$a({}, _viewable), {}, {
isViewable: false
}));
}
}
if (changed.length > 0) {
this._viewableItems = nextItems;
onViewableItemsChanged({
viewableItems: Array.from(nextItems.values()),
changed,
viewabilityConfig: this._config
});
}
};
return ViewabilityHelper2;
}();
function _isViewable(viewAreaMode, viewablePercentThreshold, top, bottom, viewportHeight, itemLength) {
if (_isEntirelyVisible(top, bottom, viewportHeight)) {
return true;
} else {
var pixels = _getPixelsVisible(top, bottom, viewportHeight);
var percent = 100 * (viewAreaMode ? pixels / viewportHeight : pixels / itemLength);
return percent >= viewablePercentThreshold;
}
}
function _getPixelsVisible(top, bottom, viewportHeight) {
var visibleHeight = Math.min(bottom, viewportHeight) - Math.max(top, 0);
return Math.max(0, visibleHeight);
}
function _isEntirelyVisible(top, bottom, viewportHeight) {
return top >= 0 && bottom <= viewportHeight && bottom > top;
}
function infoLog() {
var _console;
return (_console = console).log.apply(_console, arguments);
}
function elementsThatOverlapOffsets(offsets, itemCount, getFrameMetrics) {
var out = [];
var outLength = 0;
for (var ii = 0; ii < itemCount; ii++) {
var frame = getFrameMetrics(ii);
var trailingOffset = frame.offset + frame.length;
for (var kk = 0; kk < offsets.length; kk++) {
if (out[kk] == null && trailingOffset >= offsets[kk]) {
out[kk] = ii;
outLength++;
if (kk === offsets.length - 1) {
invariant2(outLength === offsets.length, "bad offsets input, should be in increasing order: %s", JSON.stringify(offsets));
return out;
}
}
}
}
return out;
}
function newRangeCount(prev, next) {
return next.last - next.first + 1 - Math.max(0, 1 + Math.min(next.last, prev.last) - Math.max(next.first, prev.first));
}
function computeWindowedRenderLimits(props, prev, getFrameMetricsApprox, scrollMetrics) {
var data = props.data, getItemCount = props.getItemCount, maxToRenderPerBatch = props.maxToRenderPerBatch, windowSize = props.windowSize;
var itemCount = getItemCount(data);
if (itemCount === 0) {
return prev;
}
var offset = scrollMetrics.offset, velocity = scrollMetrics.velocity, visibleLength = scrollMetrics.visibleLength;
var visibleBegin = Math.max(0, offset);
var visibleEnd = visibleBegin + visibleLength;
var overscanLength = (windowSize - 1) * visibleLength;
var leadFactor = 0.5;
var fillPreference = velocity > 1 ? "after" : velocity < -1 ? "before" : "none";
var overscanBegin = Math.max(0, visibleBegin - (1 - leadFactor) * overscanLength);
var overscanEnd = Math.max(0, visibleEnd + leadFactor * overscanLength);
var lastItemOffset = getFrameMetricsApprox(itemCount - 1).offset;
if (lastItemOffset < overscanBegin) {
return {
first: Math.max(0, itemCount - 1 - maxToRenderPerBatch),
last: itemCount - 1
};
}
var _elementsThatOverlapO = elementsThatOverlapOffsets([overscanBegin, visibleBegin, visibleEnd, overscanEnd], props.getItemCount(props.data), getFrameMetricsApprox), overscanFirst = _elementsThatOverlapO[0], first = _elementsThatOverlapO[1], last = _elementsThatOverlapO[2], overscanLast = _elementsThatOverlapO[3];
overscanFirst = overscanFirst == null ? 0 : overscanFirst;
first = first == null ? Math.max(0, overscanFirst) : first;
overscanLast = overscanLast == null ? itemCount - 1 : overscanLast;
last = last == null ? Math.min(overscanLast, first + maxToRenderPerBatch - 1) : last;
var visible = {
first,
last
};
var newCellCount = newRangeCount(prev, visible);
while (true) {
if (first <= overscanFirst && last >= overscanLast) {
break;
}
var maxNewCells = newCellCount >= maxToRenderPerBatch;
var firstWillAddMore = first <= prev.first || first > prev.last;
var firstShouldIncrement = first > overscanFirst && (!maxNewCells || !firstWillAddMore);
var lastWillAddMore = last >= prev.last || last < prev.first;
var lastShouldIncrement = last < overscanLast && (!maxNewCells || !lastWillAddMore);
if (maxNewCells && !firstShouldIncrement && !lastShouldIncrement) {
break;
}
if (firstShouldIncrement && !(fillPreference === "after" && lastShouldIncrement && lastWillAddMore)) {
if (firstWillAddMore) {
newCellCount++;
}
first--;
}
if (lastShouldIncrement && !(fillPreference === "before" && firstShouldIncrement && firstWillAddMore)) {
if (lastWillAddMore) {
newCellCount++;
}
last++;
}
}
if (!(last >= first && first >= 0 && last < itemCount && first >= overscanFirst && last <= overscanLast && first <= visible.first && last >= visible.last)) {
throw new Error("Bad window calculation " + JSON.stringify({
first,
last,
itemCount,
overscanFirst,
overscanLast,
visible
}));
}
return {
first,
last
};
}
function _createForOfIteratorHelperLoose$2(o, allowArrayLike) {
var it;
if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
if (Array.isArray(o) || (it = _unsupportedIterableToArray$2(o)) || allowArrayLike && o && typeof o.length === "number") {
if (it)
o = it;
var i = 0;
return function() {
if (i >= o.length)
return {done: true};
return {done: false, value: o[i++]};
};
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
it = o[Symbol.iterator]();
return it.next.bind(it);
}
function _unsupportedIterableToArray$2(o, minLen) {
if (!o)
return;
if (typeof o === "string")
return _arrayLikeToArray$2(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor)
n = o.constructor.name;
if (n === "Map" || n === "Set")
return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
return _arrayLikeToArray$2(o, minLen);
}
function _arrayLikeToArray$2(arr, len) {
if (len == null || len > arr.length)
len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i];
}
return arr2;
}
function _extends$3() {
_extends$3 = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$3.apply(this, arguments);
}
function ownKeys$b(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$b(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys$b(Object(source), true).forEach(function(key) {
_defineProperty$b(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys$b(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _defineProperty$b(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {value, enumerable: true, configurable: true, writable: true});
} else {
obj[key] = value;
}
return obj;
}
function _assertThisInitialized(self2) {
if (self2 === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self2;
}
function _inheritsLoose$l(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$l(subClass, superClass);
}
function _setPrototypeOf$l(o, p) {
_setPrototypeOf$l = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$l(o, p);
}
var _usedIndexForKey = false;
var _keylessItemComponentName = "";
var VirtualizedList = /* @__PURE__ */ function(_React$PureComponent) {
_inheritsLoose$l(VirtualizedList2, _React$PureComponent);
var _proto = VirtualizedList2.prototype;
_proto.scrollToEnd = function scrollToEnd2(params) {
var animated = params ? params.animated : true;
var veryLast = this.props.getItemCount(this.props.data) - 1;
var frame = this._getFrameMetricsApprox(veryLast);
var offset = Math.max(0, frame.offset + frame.length + this._footerLength - this._scrollMetrics.visibleLength);
this._scrollRef.scrollTo(this.props.horizontal ? {
x: offset,
animated
} : {
y: offset,
animated
});
};
_proto.scrollToIndex = function scrollToIndex(params) {
var _this$props = this.props, data = _this$props.data, horizontal = _this$props.horizontal, getItemCount = _this$props.getItemCount, getItemLayout = _this$props.getItemLayout, onScrollToIndexFailed = _this$props.onScrollToIndexFailed;
var animated = params.animated, index2 = params.index, viewOffset = params.viewOffset, viewPosition = params.viewPosition;
invariant2(index2 >= 0 && index2 < getItemCount(data), "scrollToIndex out of range: " + index2 + " vs " + (getItemCount(data) - 1));
if (!getItemLayout && index2 > this._highestMeasuredFrameIndex) {
invariant2(!!onScrollToIndexFailed, "scrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed, otherwise there is no way to know the location of offscreen indices or handle failures.");
onScrollToIndexFailed({
averageItemLength: this._averageCellLength,
highestMeasuredFrameIndex: this._highestMeasuredFrameIndex,
index: index2
});
return;
}
var frame = this._getFrameMetricsApprox(index2);
var offset = Math.max(0, frame.offset - (viewPosition || 0) * (this._scrollMetrics.visibleLength - frame.length)) - (viewOffset || 0);
this._scrollRef.scrollTo(horizontal ? {
x: offset,
animated
} : {
y: offset,
animated
});
};
_proto.scrollToItem = function scrollToItem(params) {
var item = params.item;
var _this$props2 = this.props, data = _this$props2.data, getItem = _this$props2.getItem, getItemCount = _this$props2.getItemCount;
var itemCount = getItemCount(data);
for (var _index = 0; _index < itemCount; _index++) {
if (getItem(data, _index) === item) {
this.scrollToIndex(_objectSpread$b(_objectSpread$b({}, params), {}, {
index: _index
}));
break;
}
}
};
_proto.scrollToOffset = function scrollToOffset(params) {
var animated = params.animated, offset = params.offset;
this._scrollRef.scrollTo(this.props.horizontal ? {
x: offset,
animated
} : {
y: offset,
animated
});
};
_proto.recordInteraction = function recordInteraction() {
this._nestedChildLists.forEach(function(childList) {
childList.ref && childList.ref.recordInteraction();
});
this._viewabilityTuples.forEach(function(t) {
t.viewabilityHelper.recordInteraction();
});
this._updateViewableItems(this.props.data);
};
_proto.flashScrollIndicators = function flashScrollIndicators2() {
this._scrollRef.flashScrollIndicators();
};
_proto.getScrollResponder = function getScrollResponder2() {
if (this._scrollRef && this._scrollRef.getScrollResponder) {
return this._scrollRef.getScrollResponder();
}
};
_proto.getScrollableNode = function getScrollableNode2() {
if (this._scrollRef && this._scrollRef.getScrollableNode) {
return this._scrollRef.getScrollableNode();
} else {
return findNodeHandle(this._scrollRef);
}
};
_proto.getScrollRef = function getScrollRef() {
if (this._scrollRef && this._scrollRef.getScrollRef) {
return this._scrollRef.getScrollRef();
} else {
return this._scrollRef;
}
};
_proto.setNativeProps = function setNativeProps3(props) {
if (this._scrollRef) {
this._scrollRef.setNativeProps(props);
}
};
_proto.getChildContext = function getChildContext() {
return {
virtualizedList: {
getScrollMetrics: this._getScrollMetrics,
horizontal: this.props.horizontal,
getOutermostParentListRef: this._getOutermostParentListRef,
getNestedChildState: this._getNestedChildState,
registerAsNestedChild: this._registerAsNestedChild,
unregisterAsNestedChild: this._unregisterAsNestedChild
}
};
};
_proto._getCellKey = function _getCellKey() {
return this.context.virtualizedCell && this.context.virtualizedCell.cellKey || "rootList";
};
_proto.hasMore = function hasMore() {
return this._hasMore;
};
function VirtualizedList2(_props, context) {
var _this;
_this = _React$PureComponent.call(this, _props, context) || this;
_this._getScrollMetrics = function() {
return _this._scrollMetrics;
};
_this._getOutermostParentListRef = function() {
if (_this._isNestedWithSameOrientation()) {
return _this.context.virtualizedList.getOutermostParentListRef();
} else {
return _assertThisInitialized(_this);
}
};
_this._getNestedChildState = function(key) {
var existingChildData = _this._nestedChildLists.get(key);
return existingChildData && existingChildData.state;
};
_this._registerAsNestedChild = function(childList) {
var childListsInCell = _this._cellKeysToChildListKeys.get(childList.cellKey) || new Set();
childListsInCell.add(childList.key);
_this._cellKeysToChildListKeys.set(childList.cellKey, childListsInCell);
var existingChildData = _this._nestedChildLists.get(childList.key);
if (existingChildData && existingChildData.ref !== null) {
console.error("A VirtualizedList contains a cell which itself contains more than one VirtualizedList of the same orientation as the parent list. You must pass a unique listKey prop to each sibling list.");
}
_this._nestedChildLists.set(childList.key, {
ref: childList.ref,
state: null
});
if (_this._hasInteracted) {
childList.ref.recordInteraction();
}
};
_this._unregisterAsNestedChild = function(childList) {
_this._nestedChildLists.set(childList.key, {
ref: null,
state: childList.state
});
};
_this._onUpdateSeparators = function(keys, newProps) {
keys.forEach(function(key) {
var ref = key != null && _this._cellRefs[key];
ref && ref.updateSeparatorProps(newProps);
});
};
_this._averageCellLength = 0;
_this._cellKeysToChildListKeys = new Map();
_this._cellRefs = {};
_this._frames = {};
_this._footerLength = 0;
_this._hasDataChangedSinceEndReached = true;
_this._hasDoneInitialScroll = false;
_this._hasInteracted = false;
_this._hasMore = false;
_this._hasWarned = {};
_this._headerLength = 0;
_this._hiPriInProgress = false;
_this._highestMeasuredFrameIndex = 0;
_this._indicesToKeys = new Map();
_this._nestedChildLists = new Map();
_this._offsetFromParentVirtualizedList = 0;
_this._prevParentOffset = 0;
_this._scrollMetrics = {
contentLength: 0,
dOffset: 0,
dt: 10,
offset: 0,
timestamp: 0,
velocity: 0,
visibleLength: 0
};
_this._scrollRef = null;
_this._sentEndForContentLength = 0;
_this._totalCellLength = 0;
_this._totalCellsMeasured = 0;
_this._viewabilityTuples = [];
_this._captureScrollRef = function(ref) {
_this._scrollRef = ref;
};
_this._defaultRenderScrollComponent = function(props) {
var onRefresh = props.onRefresh;
if (_this._isNestedWithSameOrientation()) {
return /* @__PURE__ */ createElement$1(View, props);
} else if (onRefresh) {
invariant2(typeof props.refreshing === "boolean", "`refreshing` prop must be set as a boolean in order to use `onRefresh`, but got `" + JSON.stringify(props.refreshing) + "`");
return /* @__PURE__ */ createElement$1(ScrollView, _extends$3({}, props, {
refreshControl: props.refreshControl == null ? /* @__PURE__ */ createElement$1(RefreshControl, {
refreshing: props.refreshing,
onRefresh,
progressViewOffset: props.progressViewOffset
}) : props.refreshControl
}));
} else {
return /* @__PURE__ */ createElement$1(ScrollView, props);
}
};
_this._onCellUnmount = function(cellKey) {
var curr = _this._frames[cellKey];
if (curr) {
_this._frames[cellKey] = _objectSpread$b(_objectSpread$b({}, curr), {}, {
inLayout: false
});
}
};
_this._onLayout = function(e) {
if (_this._isNestedWithSameOrientation()) {
_this.measureLayoutRelativeToContainingList();
} else {
_this._scrollMetrics.visibleLength = _this._selectLength(e.nativeEvent.layout);
}
_this.props.onLayout && _this.props.onLayout(e);
_this._scheduleCellsToRenderUpdate();
_this._maybeCallOnEndReached();
};
_this._onLayoutEmpty = function(e) {
_this.props.onLayout && _this.props.onLayout(e);
};
_this._onLayoutFooter = function(e) {
_this._footerLength = _this._selectLength(e.nativeEvent.layout);
};
_this._onLayoutHeader = function(e) {
_this._headerLength = _this._selectLength(e.nativeEvent.layout);
};
_this._onContentSizeChange = function(width, height) {
if (width > 0 && height > 0 && _this.props.initialScrollIndex != null && _this.props.initialScrollIndex > 0 && !_this._hasDoneInitialScroll) {
_this.scrollToIndex({
animated: false,
index: _this.props.initialScrollIndex
});
_this._hasDoneInitialScroll = true;
}
if (_this.props.onContentSizeChange) {
_this.props.onContentSizeChange(width, height);
}
_this._scrollMetrics.contentLength = _this._selectLength({
height,
width
});
_this._scheduleCellsToRenderUpdate();
_this._maybeCallOnEndReached();
};
_this._convertParentScrollMetrics = function(metrics) {
var offset = metrics.offset - _this._offsetFromParentVirtualizedList;
var visibleLength = metrics.visibleLength;
var dOffset = offset - _this._scrollMetrics.offset;
var contentLength = _this._scrollMetrics.contentLength;
return {
visibleLength,
contentLength,
offset,
dOffset
};
};
_this._onScroll = function(e) {
_this._nestedChildLists.forEach(function(childList) {
childList.ref && childList.ref._onScroll(e);
});
if (_this.props.onScroll) {
_this.props.onScroll(e);
}
var timestamp = e.timeStamp;
var visibleLength = _this._selectLength(e.nativeEvent.layoutMeasurement);
var contentLength = _this._selectLength(e.nativeEvent.contentSize);
var offset = _this._selectOffset(e.nativeEvent.contentOffset);
var dOffset = offset - _this._scrollMetrics.offset;
if (_this._isNestedWithSameOrientation()) {
if (_this._scrollMetrics.contentLength === 0) {
return;
}
var _this$_convertParentS = _this._convertParentScrollMetrics({
visibleLength,
offset
});
visibleLength = _this$_convertParentS.visibleLength;
contentLength = _this$_convertParentS.contentLength;
offset = _this$_convertParentS.offset;
dOffset = _this$_convertParentS.dOffset;
}
var dt = _this._scrollMetrics.timestamp ? Math.max(1, timestamp - _this._scrollMetrics.timestamp) : 1;
var velocity = dOffset / dt;
if (dt > 500 && _this._scrollMetrics.dt > 500 && contentLength > 5 * visibleLength && !_this._hasWarned.perf) {
infoLog("VirtualizedList: You have a large list that is slow to update - make sure your renderItem function renders components that follow React performance best practices like PureComponent, shouldComponentUpdate, etc.", {
dt,
prevDt: _this._scrollMetrics.dt,
contentLength
});
_this._hasWarned.perf = true;
}
_this._scrollMetrics = {
contentLength,
dt,
dOffset,
offset,
timestamp,
velocity,
visibleLength
};
_this._updateViewableItems(_this.props.data);
if (!_this.props) {
return;
}
_this._maybeCallOnEndReached();
if (velocity !== 0) {
_this._fillRateHelper.activate();
}
_this._computeBlankness();
_this._scheduleCellsToRenderUpdate();
};
_this._onScrollBeginDrag = function(e) {
_this._nestedChildLists.forEach(function(childList) {
childList.ref && childList.ref._onScrollBeginDrag(e);
});
_this._viewabilityTuples.forEach(function(tuple) {
tuple.viewabilityHelper.recordInteraction();
});
_this._hasInteracted = true;
_this.props.onScrollBeginDrag && _this.props.onScrollBeginDrag(e);
};
_this._onScrollEndDrag = function(e) {
var velocity = e.nativeEvent.velocity;
if (velocity) {
_this._scrollMetrics.velocity = _this._selectOffset(velocity);
}
_this._computeBlankness();
_this.props.onScrollEndDrag && _this.props.onScrollEndDrag(e);
};
_this._onMomentumScrollEnd = function(e) {
_this._scrollMetrics.velocity = 0;
_this._computeBlankness();
_this.props.onMomentumScrollEnd && _this.props.onMomentumScrollEnd(e);
};
_this._updateCellsToRender = function() {
var _this$props3 = _this.props, data = _this$props3.data, getItemCount = _this$props3.getItemCount, onEndReachedThreshold = _this$props3.onEndReachedThreshold;
var isVirtualizationDisabled = _this._isVirtualizationDisabled();
_this._updateViewableItems(data);
if (!data) {
return;
}
_this.setState(function(state) {
var newState;
if (!isVirtualizationDisabled) {
if (_this._scrollMetrics.visibleLength) {
if (!_this.props.initialScrollIndex || _this._scrollMetrics.offset) {
newState = computeWindowedRenderLimits(_this.props, state, _this._getFrameMetricsApprox, _this._scrollMetrics);
}
}
} else {
var _this$_scrollMetrics = _this._scrollMetrics, contentLength = _this$_scrollMetrics.contentLength, offset = _this$_scrollMetrics.offset, visibleLength = _this$_scrollMetrics.visibleLength;
var distanceFromEnd = contentLength - visibleLength - offset;
var renderAhead = distanceFromEnd < onEndReachedThreshold * visibleLength ? _this.props.maxToRenderPerBatch : 0;
newState = {
first: 0,
last: Math.min(state.last + renderAhead, getItemCount(data) - 1)
};
}
if (newState && _this._nestedChildLists.size > 0) {
var newFirst = newState.first;
var newLast = newState.last;
for (var ii = newFirst; ii <= newLast; ii++) {
var cellKeyForIndex = _this._indicesToKeys.get(ii);
var childListKeys = cellKeyForIndex && _this._cellKeysToChildListKeys.get(cellKeyForIndex);
if (!childListKeys) {
continue;
}
var someChildHasMore = false;
for (var _iterator = _createForOfIteratorHelperLoose$2(childListKeys), _step; !(_step = _iterator()).done; ) {
var childKey = _step.value;
var childList = _this._nestedChildLists.get(childKey);
if (childList && childList.ref && childList.ref.hasMore()) {
someChildHasMore = true;
break;
}
}
if (someChildHasMore) {
newState.last = ii;
break;
}
}
}
return newState;
});
};
_this._createViewToken = function(index2, isViewable) {
var _this$props4 = _this.props, data = _this$props4.data, getItem = _this$props4.getItem, keyExtractor2 = _this$props4.keyExtractor;
var item = getItem(data, index2);
return {
index: index2,
item,
key: keyExtractor2(item, index2),
isViewable
};
};
_this._getFrameMetricsApprox = function(index2) {
var frame = _this._getFrameMetrics(index2);
if (frame && frame.index === index2) {
return frame;
} else {
var getItemLayout = _this.props.getItemLayout;
invariant2(!getItemLayout, "Should not have to estimate frames when a measurement metrics function is provided");
return {
length: _this._averageCellLength,
offset: _this._averageCellLength * index2
};
}
};
_this._getFrameMetrics = function(index2) {
var _this$props5 = _this.props, data = _this$props5.data, getItem = _this$props5.getItem, getItemCount = _this$props5.getItemCount, getItemLayout = _this$props5.getItemLayout, keyExtractor2 = _this$props5.keyExtractor;
invariant2(getItemCount(data) > index2, "Tried to get frame for out of range index " + index2);
var item = getItem(data, index2);
var frame = item && _this._frames[keyExtractor2(item, index2)];
if (!frame || frame.index !== index2) {
if (getItemLayout) {
frame = getItemLayout(data, index2);
}
}
return frame;
};
invariant2(!_props.onScroll || !_props.onScroll.__isNative, "Components based on VirtualizedList must be wrapped with Animated.createAnimatedComponent to support native onScroll events with useNativeDriver");
invariant2(_props.windowSize > 0, "VirtualizedList: The windowSize prop must be present and set to a value greater than 0.");
_this._fillRateHelper = new FillRateHelper(_this._getFrameMetrics);
_this._updateCellsToRenderBatcher = new Batchinator(_this._updateCellsToRender, _this.props.updateCellsBatchingPeriod);
if (_this.props.viewabilityConfigCallbackPairs) {
_this._viewabilityTuples = _this.props.viewabilityConfigCallbackPairs.map(function(pair) {
return {
viewabilityHelper: new ViewabilityHelper(pair.viewabilityConfig),
onViewableItemsChanged: pair.onViewableItemsChanged
};
});
} else if (_this.props.onViewableItemsChanged) {
_this._viewabilityTuples.push({
viewabilityHelper: new ViewabilityHelper(_this.props.viewabilityConfig),
onViewableItemsChanged: _this.props.onViewableItemsChanged
});
}
var initialState = {
first: _this.props.initialScrollIndex || 0,
last: Math.min(_this.props.getItemCount(_this.props.data), (_this.props.initialScrollIndex || 0) + _this.props.initialNumToRender) - 1
};
if (_this._isNestedWithSameOrientation()) {
var storedState = _this.context.virtualizedList.getNestedChildState(_this.props.listKey || _this._getCellKey());
if (storedState) {
initialState = storedState;
_this.state = storedState;
_this._frames = storedState.frames;
}
}
_this.state = initialState;
return _this;
}
_proto.componentDidMount = function componentDidMount2() {
if (this._isNestedWithSameOrientation()) {
this.context.virtualizedList.registerAsNestedChild({
cellKey: this._getCellKey(),
key: this.props.listKey || this._getCellKey(),
ref: this
});
}
};
_proto.componentWillUnmount = function componentWillUnmount2() {
if (this._isNestedWithSameOrientation()) {
this.context.virtualizedList.unregisterAsNestedChild({
key: this.props.listKey || this._getCellKey(),
state: {
first: this.state.first,
last: this.state.last,
frames: this._frames
}
});
}
this._updateViewableItems(null);
this._updateCellsToRenderBatcher.dispose({
abort: true
});
this._viewabilityTuples.forEach(function(tuple) {
tuple.viewabilityHelper.dispose();
});
this._fillRateHelper.deactivateAndFlush();
};
VirtualizedList2.getDerivedStateFromProps = function getDerivedStateFromProps(newProps, prevState) {
var data = newProps.data, getItemCount = newProps.getItemCount, maxToRenderPerBatch = newProps.maxToRenderPerBatch;
return {
first: Math.max(0, Math.min(prevState.first, getItemCount(data) - 1 - maxToRenderPerBatch)),
last: Math.max(0, Math.min(prevState.last, getItemCount(data) - 1))
};
};
_proto._pushCells = function _pushCells(cells, stickyHeaderIndices, stickyIndicesFromProps, first, last, inversionStyle) {
var _this2 = this;
var _this$props6 = this.props, CellRendererComponent = _this$props6.CellRendererComponent, ItemSeparatorComponent = _this$props6.ItemSeparatorComponent, data = _this$props6.data, getItem = _this$props6.getItem, getItemCount = _this$props6.getItemCount, horizontal = _this$props6.horizontal, keyExtractor2 = _this$props6.keyExtractor;
var stickyOffset = this.props.ListHeaderComponent ? 1 : 0;
var end = getItemCount(data) - 1;
var prevCellKey;
last = Math.min(end, last);
var _loop = function _loop2(ii2) {
var item = getItem(data, ii2);
var key = keyExtractor2(item, ii2);
_this2._indicesToKeys.set(ii2, key);
if (stickyIndicesFromProps.has(ii2 + stickyOffset)) {
stickyHeaderIndices.push(cells.length);
}
cells.push(/* @__PURE__ */ createElement$1(CellRenderer, {
CellRendererComponent,
ItemSeparatorComponent: ii2 < end ? ItemSeparatorComponent : void 0,
cellKey: key,
fillRateHelper: _this2._fillRateHelper,
horizontal,
index: ii2,
inversionStyle,
item,
key,
prevCellKey,
onUpdateSeparators: _this2._onUpdateSeparators,
onLayout: function onLayout(e) {
return _this2._onCellLayout(e, key, ii2);
},
onUnmount: _this2._onCellUnmount,
parentProps: _this2.props,
ref: function ref(_ref) {
_this2._cellRefs[key] = _ref;
}
}));
prevCellKey = key;
};
for (var ii = first; ii <= last; ii++) {
_loop(ii);
}
};
_proto._isVirtualizationDisabled = function _isVirtualizationDisabled() {
return this.props.disableVirtualization || false;
};
_proto._isNestedWithSameOrientation = function _isNestedWithSameOrientation() {
var nestedContext = this.context.virtualizedList;
return !!(nestedContext && !!nestedContext.horizontal === !!this.props.horizontal);
};
_proto.render = function render3() {
var _this3 = this;
var _this$props7 = this.props, ListEmptyComponent = _this$props7.ListEmptyComponent, ListFooterComponent = _this$props7.ListFooterComponent, ListHeaderComponent = _this$props7.ListHeaderComponent;
var _this$props8 = this.props, data = _this$props8.data, horizontal = _this$props8.horizontal;
var isVirtualizationDisabled = this._isVirtualizationDisabled();
var inversionStyle = this.props.inverted ? this.props.horizontal ? styles$3.horizontallyInverted : styles$3.verticallyInverted : null;
var cells = [];
var stickyIndicesFromProps = new Set(this.props.stickyHeaderIndices);
var stickyHeaderIndices = [];
if (ListHeaderComponent) {
if (stickyIndicesFromProps.has(0)) {
stickyHeaderIndices.push(0);
}
var element = /* @__PURE__ */ isValidElement(ListHeaderComponent) ? ListHeaderComponent : /* @__PURE__ */ createElement$1(ListHeaderComponent, null);
cells.push(/* @__PURE__ */ createElement$1(VirtualizedCellWrapper, {
cellKey: this._getCellKey() + "-header",
key: "$header"
}, /* @__PURE__ */ createElement$1(View, {
onLayout: this._onLayoutHeader,
style: StyleSheet.compose(inversionStyle, this.props.ListHeaderComponentStyle)
}, element)));
}
var itemCount = this.props.getItemCount(data);
if (itemCount > 0) {
_usedIndexForKey = false;
_keylessItemComponentName = "";
var spacerKey = !horizontal ? "height" : "width";
var lastInitialIndex = this.props.initialScrollIndex ? -1 : this.props.initialNumToRender - 1;
var _this$state = this.state, first = _this$state.first, last = _this$state.last;
this._pushCells(cells, stickyHeaderIndices, stickyIndicesFromProps, 0, lastInitialIndex, inversionStyle);
var firstAfterInitial = Math.max(lastInitialIndex + 1, first);
if (!isVirtualizationDisabled && first > lastInitialIndex + 1) {
var insertedStickySpacer = false;
if (stickyIndicesFromProps.size > 0) {
var stickyOffset = ListHeaderComponent ? 1 : 0;
for (var ii = firstAfterInitial - 1; ii > lastInitialIndex; ii--) {
if (stickyIndicesFromProps.has(ii + stickyOffset)) {
var _ref2, _ref3;
var initBlock = this._getFrameMetricsApprox(lastInitialIndex);
var stickyBlock = this._getFrameMetricsApprox(ii);
var leadSpace = stickyBlock.offset - initBlock.offset - (this.props.initialScrollIndex ? 0 : initBlock.length);
cells.push(/* @__PURE__ */ createElement$1(View, {
key: "$sticky_lead",
style: (_ref2 = {}, _ref2[spacerKey] = leadSpace, _ref2)
}));
this._pushCells(cells, stickyHeaderIndices, stickyIndicesFromProps, ii, ii, inversionStyle);
var trailSpace = this._getFrameMetricsApprox(first).offset - (stickyBlock.offset + stickyBlock.length);
cells.push(/* @__PURE__ */ createElement$1(View, {
key: "$sticky_trail",
style: (_ref3 = {}, _ref3[spacerKey] = trailSpace, _ref3)
}));
insertedStickySpacer = true;
break;
}
}
}
if (!insertedStickySpacer) {
var _ref4;
var _initBlock = this._getFrameMetricsApprox(lastInitialIndex);
var firstSpace = this._getFrameMetricsApprox(first).offset - (_initBlock.offset + _initBlock.length);
cells.push(/* @__PURE__ */ createElement$1(View, {
key: "$lead_spacer",
style: (_ref4 = {}, _ref4[spacerKey] = firstSpace, _ref4)
}));
}
}
this._pushCells(cells, stickyHeaderIndices, stickyIndicesFromProps, firstAfterInitial, last, inversionStyle);
if (!this._hasWarned.keys && _usedIndexForKey) {
console.warn("VirtualizedList: missing keys for items, make sure to specify a key or id property on each item or provide a custom keyExtractor.", _keylessItemComponentName);
this._hasWarned.keys = true;
}
if (!isVirtualizationDisabled && last < itemCount - 1) {
var _ref5;
var lastFrame = this._getFrameMetricsApprox(last);
var end = this.props.getItemLayout ? itemCount - 1 : Math.min(itemCount - 1, this._highestMeasuredFrameIndex);
var endFrame = this._getFrameMetricsApprox(end);
var tailSpacerLength = endFrame.offset + endFrame.length - (lastFrame.offset + lastFrame.length);
cells.push(/* @__PURE__ */ createElement$1(View, {
key: "$tail_spacer",
style: (_ref5 = {}, _ref5[spacerKey] = tailSpacerLength, _ref5)
}));
}
} else if (ListEmptyComponent) {
var _element = /* @__PURE__ */ isValidElement(ListEmptyComponent) ? ListEmptyComponent : /* @__PURE__ */ createElement$1(ListEmptyComponent, null);
cells.push(/* @__PURE__ */ cloneElement(_element, {
key: "$empty",
onLayout: function onLayout(event3) {
_this3._onLayoutEmpty(event3);
if (_element.props.onLayout) {
_element.props.onLayout(event3);
}
},
style: StyleSheet.compose(inversionStyle, _element.props.style)
}));
}
if (ListFooterComponent) {
var _element2 = /* @__PURE__ */ isValidElement(ListFooterComponent) ? ListFooterComponent : /* @__PURE__ */ createElement$1(ListFooterComponent, null);
cells.push(/* @__PURE__ */ createElement$1(VirtualizedCellWrapper, {
cellKey: this._getCellKey() + "-footer",
key: "$footer"
}, /* @__PURE__ */ createElement$1(View, {
onLayout: this._onLayoutFooter,
style: StyleSheet.compose(inversionStyle, this.props.ListFooterComponentStyle)
}, _element2)));
}
var scrollProps = _objectSpread$b(_objectSpread$b({}, this.props), {}, {
onContentSizeChange: this._onContentSizeChange,
onLayout: this._onLayout,
onScroll: this._onScroll,
onScrollBeginDrag: this._onScrollBeginDrag,
onScrollEndDrag: this._onScrollEndDrag,
onMomentumScrollEnd: this._onMomentumScrollEnd,
scrollEventThrottle: this.props.scrollEventThrottle,
invertStickyHeaders: this.props.invertStickyHeaders !== void 0 ? this.props.invertStickyHeaders : this.props.inverted,
stickyHeaderIndices
});
if (inversionStyle) {
scrollProps.style = [inversionStyle, this.props.style];
}
this._hasMore = this.state.last < this.props.getItemCount(this.props.data) - 1;
var ret = /* @__PURE__ */ cloneElement((this.props.renderScrollComponent || this._defaultRenderScrollComponent)(scrollProps), {
ref: this._captureScrollRef
}, cells);
if (this.props.debug) {
return /* @__PURE__ */ createElement$1(View, {
style: styles$3.debug
}, ret, this._renderDebugOverlay());
} else {
return ret;
}
};
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
var _this$props9 = this.props, data = _this$props9.data, extraData = _this$props9.extraData;
if (data !== prevProps.data || extraData !== prevProps.extraData) {
this._hasDataChangedSinceEndReached = true;
this._viewabilityTuples.forEach(function(tuple) {
tuple.viewabilityHelper.resetViewableIndices();
});
}
var hiPriInProgress = this._hiPriInProgress;
this._scheduleCellsToRenderUpdate();
if (hiPriInProgress) {
this._hiPriInProgress = false;
}
};
_proto._computeBlankness = function _computeBlankness() {
this._fillRateHelper.computeBlankness(this.props, this.state, this._scrollMetrics);
};
_proto._onCellLayout = function _onCellLayout(e, cellKey, index2) {
var layout = e.nativeEvent.layout;
var next = {
offset: this._selectOffset(layout),
length: this._selectLength(layout),
index: index2,
inLayout: true
};
var curr = this._frames[cellKey];
if (!curr || next.offset !== curr.offset || next.length !== curr.length || index2 !== curr.index) {
this._totalCellLength += next.length - (curr ? curr.length : 0);
this._totalCellsMeasured += curr ? 0 : 1;
this._averageCellLength = this._totalCellLength / this._totalCellsMeasured;
this._frames[cellKey] = next;
this._highestMeasuredFrameIndex = Math.max(this._highestMeasuredFrameIndex, index2);
this._scheduleCellsToRenderUpdate();
} else {
this._frames[cellKey].inLayout = true;
}
var childListKeys = this._cellKeysToChildListKeys.get(cellKey);
if (childListKeys) {
for (var _iterator2 = _createForOfIteratorHelperLoose$2(childListKeys), _step2; !(_step2 = _iterator2()).done; ) {
var childKey = _step2.value;
var childList = this._nestedChildLists.get(childKey);
childList && childList.ref && childList.ref.measureLayoutRelativeToContainingList();
}
}
this._computeBlankness();
this._updateViewableItems(this.props.data);
};
_proto.measureLayoutRelativeToContainingList = function measureLayoutRelativeToContainingList() {
var _this4 = this;
try {
if (!this._scrollRef) {
return;
}
this._scrollRef.measureLayout(this.context.virtualizedList.getOutermostParentListRef().getScrollRef().getNativeScrollRef(), function(x, y, width, height) {
_this4._offsetFromParentVirtualizedList = _this4._selectOffset({
x,
y
});
_this4._scrollMetrics.contentLength = _this4._selectLength({
width,
height
});
var scrollMetrics = _this4._convertParentScrollMetrics(_this4.context.virtualizedList.getScrollMetrics());
_this4._scrollMetrics.visibleLength = scrollMetrics.visibleLength;
_this4._scrollMetrics.offset = scrollMetrics.offset;
}, function(error) {
console.warn("VirtualizedList: Encountered an error while measuring a list's offset from its containing VirtualizedList.");
});
} catch (error) {
console.warn("measureLayoutRelativeToContainingList threw an error", error.stack);
}
};
_proto._renderDebugOverlay = function _renderDebugOverlay() {
var normalize = this._scrollMetrics.visibleLength / (this._scrollMetrics.contentLength || 1);
var framesInLayout = [];
var itemCount = this.props.getItemCount(this.props.data);
for (var ii = 0; ii < itemCount; ii++) {
var frame = this._getFrameMetricsApprox(ii);
if (frame.inLayout) {
framesInLayout.push(frame);
}
}
var windowTop = this._getFrameMetricsApprox(this.state.first).offset;
var frameLast = this._getFrameMetricsApprox(this.state.last);
var windowLen = frameLast.offset + frameLast.length - windowTop;
var visTop = this._scrollMetrics.offset;
var visLen = this._scrollMetrics.visibleLength;
return /* @__PURE__ */ createElement$1(View, {
style: [styles$3.debugOverlayBase, styles$3.debugOverlay]
}, framesInLayout.map(function(f, ii2) {
return /* @__PURE__ */ createElement$1(View, {
key: "f" + ii2,
style: [styles$3.debugOverlayBase, styles$3.debugOverlayFrame, {
top: f.offset * normalize,
height: f.length * normalize
}]
});
}), /* @__PURE__ */ createElement$1(View, {
style: [styles$3.debugOverlayBase, styles$3.debugOverlayFrameLast, {
top: windowTop * normalize,
height: windowLen * normalize
}]
}), /* @__PURE__ */ createElement$1(View, {
style: [styles$3.debugOverlayBase, styles$3.debugOverlayFrameVis, {
top: visTop * normalize,
height: visLen * normalize
}]
}));
};
_proto._selectLength = function _selectLength(metrics) {
return !this.props.horizontal ? metrics.height : metrics.width;
};
_proto._selectOffset = function _selectOffset(metrics) {
return !this.props.horizontal ? metrics.y : metrics.x;
};
_proto._maybeCallOnEndReached = function _maybeCallOnEndReached() {
var _this$props10 = this.props, data = _this$props10.data, getItemCount = _this$props10.getItemCount, onEndReached = _this$props10.onEndReached, onEndReachedThreshold = _this$props10.onEndReachedThreshold;
var _this$_scrollMetrics2 = this._scrollMetrics, contentLength = _this$_scrollMetrics2.contentLength, visibleLength = _this$_scrollMetrics2.visibleLength, offset = _this$_scrollMetrics2.offset;
var distanceFromEnd = contentLength - visibleLength - offset;
if (onEndReached && this.state.last === getItemCount(data) - 1 && distanceFromEnd < onEndReachedThreshold * visibleLength && (this._hasDataChangedSinceEndReached || this._scrollMetrics.contentLength !== this._sentEndForContentLength)) {
this._hasDataChangedSinceEndReached = false;
this._sentEndForContentLength = this._scrollMetrics.contentLength;
onEndReached({
distanceFromEnd
});
}
};
_proto._scheduleCellsToRenderUpdate = function _scheduleCellsToRenderUpdate() {
var _this$state2 = this.state, first = _this$state2.first, last = _this$state2.last;
var _this$_scrollMetrics3 = this._scrollMetrics, offset = _this$_scrollMetrics3.offset, visibleLength = _this$_scrollMetrics3.visibleLength, velocity = _this$_scrollMetrics3.velocity;
var itemCount = this.props.getItemCount(this.props.data);
var hiPri = false;
var scrollingThreshold = this.props.onEndReachedThreshold * visibleLength / 2;
if (first > 0) {
var distTop = offset - this._getFrameMetricsApprox(first).offset;
hiPri = hiPri || distTop < 0 || velocity < -2 && distTop < scrollingThreshold;
}
if (last < itemCount - 1) {
var distBottom = this._getFrameMetricsApprox(last).offset - (offset + visibleLength);
hiPri = hiPri || distBottom < 0 || velocity > 2 && distBottom < scrollingThreshold;
}
if (hiPri && (this._averageCellLength || this.props.getItemLayout) && !this._hiPriInProgress) {
this._hiPriInProgress = true;
this._updateCellsToRenderBatcher.dispose({
abort: true
});
this._updateCellsToRender();
return;
} else {
this._updateCellsToRenderBatcher.schedule();
}
};
_proto._updateViewableItems = function _updateViewableItems(data) {
var _this5 = this;
var getItemCount = this.props.getItemCount;
this._viewabilityTuples.forEach(function(tuple) {
tuple.viewabilityHelper.onUpdate(getItemCount(data), _this5._scrollMetrics.offset, _this5._scrollMetrics.visibleLength, _this5._getFrameMetrics, _this5._createViewToken, tuple.onViewableItemsChanged, _this5.state);
});
};
return VirtualizedList2;
}(PureComponent);
VirtualizedList.defaultProps = {
disableVirtualization: false,
horizontal: false,
initialNumToRender: 10,
keyExtractor: function keyExtractor(item, index2) {
if (item.key != null) {
return item.key;
}
if (item.id != null) {
return item.id;
}
_usedIndexForKey = true;
if (item.type && item.type.displayName) {
_keylessItemComponentName = item.type.displayName;
}
return String(index2);
},
maxToRenderPerBatch: 10,
onEndReachedThreshold: 2,
scrollEventThrottle: 50,
updateCellsBatchingPeriod: 50,
windowSize: 21
};
VirtualizedList.contextTypes = {
virtualizedCell: PropTypes.shape({
cellKey: PropTypes.string
}),
virtualizedList: PropTypes.shape({
getScrollMetrics: PropTypes.func,
horizontal: PropTypes.bool,
getOutermostParentListRef: PropTypes.func,
getNestedChildState: PropTypes.func,
registerAsNestedChild: PropTypes.func,
unregisterAsNestedChild: PropTypes.func
})
};
VirtualizedList.childContextTypes = {
virtualizedList: PropTypes.shape({
getScrollMetrics: PropTypes.func,
horizontal: PropTypes.bool,
getOutermostParentListRef: PropTypes.func,
getNestedChildState: PropTypes.func,
registerAsNestedChild: PropTypes.func,
unregisterAsNestedChild: PropTypes.func
})
};
var CellRenderer = /* @__PURE__ */ function(_React$Component) {
_inheritsLoose$l(CellRenderer2, _React$Component);
function CellRenderer2() {
var _this6;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this6 = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
_this6.state = {
separatorProps: {
highlighted: false,
leadingItem: _this6.props.item
}
};
_this6._separators = {
highlight: function highlight() {
var _this6$props = _this6.props, cellKey = _this6$props.cellKey, prevCellKey = _this6$props.prevCellKey;
_this6.props.onUpdateSeparators([cellKey, prevCellKey], {
highlighted: true
});
},
unhighlight: function unhighlight() {
var _this6$props2 = _this6.props, cellKey = _this6$props2.cellKey, prevCellKey = _this6$props2.prevCellKey;
_this6.props.onUpdateSeparators([cellKey, prevCellKey], {
highlighted: false
});
},
updateProps: function updateProps(select2, newProps) {
var _this6$props3 = _this6.props, cellKey = _this6$props3.cellKey, prevCellKey = _this6$props3.prevCellKey;
_this6.props.onUpdateSeparators([select2 === "leading" ? prevCellKey : cellKey], newProps);
}
};
return _this6;
}
var _proto2 = CellRenderer2.prototype;
_proto2.getChildContext = function getChildContext() {
return {
virtualizedCell: {
cellKey: this.props.cellKey
}
};
};
_proto2.updateSeparatorProps = function updateSeparatorProps(newProps) {
this.setState(function(state) {
return {
separatorProps: _objectSpread$b(_objectSpread$b({}, state.separatorProps), newProps)
};
});
};
_proto2.componentWillUnmount = function componentWillUnmount2() {
this.props.onUnmount(this.props.cellKey);
};
_proto2.render = function render3() {
var _this$props11 = this.props, CellRendererComponent = _this$props11.CellRendererComponent, ItemSeparatorComponent = _this$props11.ItemSeparatorComponent, fillRateHelper = _this$props11.fillRateHelper, horizontal = _this$props11.horizontal, item = _this$props11.item, index2 = _this$props11.index, inversionStyle = _this$props11.inversionStyle, parentProps = _this$props11.parentProps;
var renderItem = parentProps.renderItem, getItemLayout = parentProps.getItemLayout;
invariant2(renderItem, "no renderItem!");
var element = renderItem({
item,
index: index2,
separators: this._separators
});
var onLayout = getItemLayout && !parentProps.debug && !fillRateHelper.enabled() ? void 0 : this.props.onLayout;
var itemSeparator = ItemSeparatorComponent && /* @__PURE__ */ createElement$1(ItemSeparatorComponent, this.state.separatorProps);
var cellStyle = inversionStyle ? horizontal ? [styles$3.rowReverse, inversionStyle] : [styles$3.columnReverse, inversionStyle] : horizontal ? [styles$3.row, inversionStyle] : inversionStyle;
if (!CellRendererComponent) {
return /* @__PURE__ */ createElement$1(View, {
style: cellStyle,
onLayout
}, element, itemSeparator);
}
return /* @__PURE__ */ createElement$1(CellRendererComponent, _extends$3({}, this.props, {
style: cellStyle,
onLayout
}), element, itemSeparator);
};
return CellRenderer2;
}(Component);
CellRenderer.childContextTypes = {
virtualizedCell: PropTypes.shape({
cellKey: PropTypes.string
})
};
var VirtualizedCellWrapper = /* @__PURE__ */ function(_React$Component2) {
_inheritsLoose$l(VirtualizedCellWrapper2, _React$Component2);
function VirtualizedCellWrapper2() {
return _React$Component2.apply(this, arguments) || this;
}
var _proto3 = VirtualizedCellWrapper2.prototype;
_proto3.getChildContext = function getChildContext() {
return {
virtualizedCell: {
cellKey: this.props.cellKey
}
};
};
_proto3.render = function render3() {
return this.props.children;
};
return VirtualizedCellWrapper2;
}(Component);
VirtualizedCellWrapper.childContextTypes = {
virtualizedCell: PropTypes.shape({
cellKey: PropTypes.string
})
};
var styles$3 = StyleSheet.create({
verticallyInverted: {
transform: [{
scaleY: -1
}]
},
horizontallyInverted: {
transform: [{
scaleX: -1
}]
},
row: {
flexDirection: "row"
},
rowReverse: {
flexDirection: "row-reverse"
},
columnReverse: {
flexDirection: "column-reverse"
},
debug: {
flex: 1
},
debugOverlayBase: {
position: "absolute",
top: 0,
right: 0
},
debugOverlay: {
bottom: 0,
width: 20,
borderColor: "blue",
borderWidth: 1
},
debugOverlayFrame: {
left: 0,
backgroundColor: "orange"
},
debugOverlayFrameLast: {
left: 0,
borderColor: "green",
borderWidth: 2
},
debugOverlayFrameVis: {
left: 0,
borderColor: "red",
borderWidth: 2
}
});
function _extends$4() {
_extends$4 = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$4.apply(this, arguments);
}
function _inheritsLoose$m(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$m(subClass, superClass);
}
function _setPrototypeOf$m(o, p) {
_setPrototypeOf$m = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$m(o, p);
}
function ownKeys$c(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$c(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys$c(Object(source), true).forEach(function(key) {
_defineProperty$c(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys$c(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _defineProperty$c(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {value, enumerable: true, configurable: true, writable: true});
} else {
obj[key] = value;
}
return obj;
}
var defaultProps$1 = _objectSpread$c(_objectSpread$c({}, VirtualizedList.defaultProps), {}, {
numColumns: 1,
removeClippedSubviews: false
});
var FlatList = /* @__PURE__ */ function(_React$PureComponent) {
_inheritsLoose$m(FlatList2, _React$PureComponent);
var _proto = FlatList2.prototype;
_proto.scrollToEnd = function scrollToEnd2(params) {
if (this._listRef) {
this._listRef.scrollToEnd(params);
}
};
_proto.scrollToIndex = function scrollToIndex(params) {
if (this._listRef) {
this._listRef.scrollToIndex(params);
}
};
_proto.scrollToItem = function scrollToItem(params) {
if (this._listRef) {
this._listRef.scrollToItem(params);
}
};
_proto.scrollToOffset = function scrollToOffset(params) {
if (this._listRef) {
this._listRef.scrollToOffset(params);
}
};
_proto.recordInteraction = function recordInteraction() {
if (this._listRef) {
this._listRef.recordInteraction();
}
};
_proto.flashScrollIndicators = function flashScrollIndicators2() {
if (this._listRef) {
this._listRef.flashScrollIndicators();
}
};
_proto.getScrollResponder = function getScrollResponder2() {
if (this._listRef) {
return this._listRef.getScrollResponder();
}
};
_proto.getNativeScrollRef = function getNativeScrollRef() {
if (this._listRef) {
return this._listRef.getScrollRef();
}
};
_proto.getScrollableNode = function getScrollableNode2() {
if (this._listRef) {
return this._listRef.getScrollableNode();
}
};
_proto.setNativeProps = function setNativeProps3(props) {
if (this._listRef) {
this._listRef.setNativeProps(props);
}
};
function FlatList2(props) {
var _this;
_this = _React$PureComponent.call(this, props) || this;
_this._virtualizedListPairs = [];
_this._captureRef = function(ref) {
_this._listRef = ref;
};
_this._getItem = function(data, index2) {
var numColumns = _this.props.numColumns;
if (numColumns > 1) {
var ret = [];
for (var kk = 0; kk < numColumns; kk++) {
var _item = data[index2 * numColumns + kk];
if (_item != null) {
ret.push(_item);
}
}
return ret;
} else {
return data[index2];
}
};
_this._getItemCount = function(data) {
return data ? Math.ceil(data.length / _this.props.numColumns) : 0;
};
_this._keyExtractor = function(items, index2) {
var _this$props = _this.props, keyExtractor2 = _this$props.keyExtractor, numColumns = _this$props.numColumns;
if (numColumns > 1) {
invariant2(Array.isArray(items), "FlatList: Encountered internal consistency error, expected each item to consist of an array with 1-%s columns; instead, received a single item.", numColumns);
return items.map(function(it, kk) {
return keyExtractor2(it, index2 * numColumns + kk);
}).join(":");
} else {
return keyExtractor2(items, index2);
}
};
_this._renderItem = function(info) {
var _this$props2 = _this.props, renderItem = _this$props2.renderItem, numColumns = _this$props2.numColumns, columnWrapperStyle = _this$props2.columnWrapperStyle;
if (numColumns > 1) {
var _item2 = info.item, _index = info.index;
invariant2(Array.isArray(_item2), "Expected array of items with numColumns > 1");
return /* @__PURE__ */ createElement$1(View, {
style: StyleSheet.compose(styles$4.row, columnWrapperStyle)
}, _item2.map(function(it, kk) {
var element = renderItem({
item: it,
index: _index * numColumns + kk,
separators: info.separators
});
return element != null ? /* @__PURE__ */ createElement$1(Fragment, {
key: kk
}, element) : null;
}));
} else {
return renderItem(info);
}
};
_this._checkProps(_this.props);
if (_this.props.viewabilityConfigCallbackPairs) {
_this._virtualizedListPairs = _this.props.viewabilityConfigCallbackPairs.map(function(pair) {
return {
viewabilityConfig: pair.viewabilityConfig,
onViewableItemsChanged: _this._createOnViewableItemsChanged(pair.onViewableItemsChanged)
};
});
} else if (_this.props.onViewableItemsChanged) {
_this._virtualizedListPairs.push({
viewabilityConfig: _this.props.viewabilityConfig,
onViewableItemsChanged: _this._createOnViewableItemsChanged(_this.props.onViewableItemsChanged)
});
}
return _this;
}
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
invariant2(prevProps.numColumns === this.props.numColumns, "Changing numColumns on the fly is not supported. Change the key prop on FlatList when changing the number of columns to force a fresh render of the component.");
invariant2(prevProps.onViewableItemsChanged === this.props.onViewableItemsChanged, "Changing onViewableItemsChanged on the fly is not supported");
invariant2(!deepDiffer(prevProps.viewabilityConfig, this.props.viewabilityConfig), "Changing viewabilityConfig on the fly is not supported");
invariant2(prevProps.viewabilityConfigCallbackPairs === this.props.viewabilityConfigCallbackPairs, "Changing viewabilityConfigCallbackPairs on the fly is not supported");
this._checkProps(this.props);
};
_proto._checkProps = function _checkProps(props) {
var getItem = props.getItem, getItemCount = props.getItemCount, horizontal = props.horizontal, numColumns = props.numColumns, columnWrapperStyle = props.columnWrapperStyle, onViewableItemsChanged = props.onViewableItemsChanged, viewabilityConfigCallbackPairs = props.viewabilityConfigCallbackPairs;
invariant2(!getItem && !getItemCount, "FlatList does not support custom data formats.");
if (numColumns > 1) {
invariant2(!horizontal, "numColumns does not support horizontal.");
} else {
invariant2(!columnWrapperStyle, "columnWrapperStyle not supported for single column lists");
}
invariant2(!(onViewableItemsChanged && viewabilityConfigCallbackPairs), "FlatList does not support setting both onViewableItemsChanged and viewabilityConfigCallbackPairs.");
};
_proto._pushMultiColumnViewable = function _pushMultiColumnViewable(arr, v) {
var _this$props3 = this.props, numColumns = _this$props3.numColumns, keyExtractor2 = _this$props3.keyExtractor;
v.item.forEach(function(item, ii) {
invariant2(v.index != null, "Missing index!");
var index2 = v.index * numColumns + ii;
arr.push(_objectSpread$c(_objectSpread$c({}, v), {}, {
item,
key: keyExtractor2(item, index2),
index: index2
}));
});
};
_proto._createOnViewableItemsChanged = function _createOnViewableItemsChanged(onViewableItemsChanged) {
var _this2 = this;
return function(info) {
var numColumns = _this2.props.numColumns;
if (onViewableItemsChanged) {
if (numColumns > 1) {
var changed = [];
var viewableItems = [];
info.viewableItems.forEach(function(v) {
return _this2._pushMultiColumnViewable(viewableItems, v);
});
info.changed.forEach(function(v) {
return _this2._pushMultiColumnViewable(changed, v);
});
onViewableItemsChanged({
viewableItems,
changed
});
} else {
onViewableItemsChanged(info);
}
}
};
};
_proto.render = function render3() {
return /* @__PURE__ */ createElement$1(VirtualizedList, _extends$4({}, this.props, {
renderItem: this._renderItem,
getItem: this._getItem,
getItemCount: this._getItemCount,
keyExtractor: this._keyExtractor,
ref: this._captureRef,
viewabilityConfigCallbackPairs: this._virtualizedListPairs
}));
};
return FlatList2;
}(PureComponent);
FlatList.defaultProps = defaultProps$1;
var styles$4 = StyleSheet.create({
row: {
flexDirection: "row"
}
});
var assets = [];
function getAssetByID(assetId) {
return assets[assetId - 1];
}
var dataUriPattern = /^data:/;
var ImageUriCache = /* @__PURE__ */ function() {
function ImageUriCache2() {
}
ImageUriCache2.has = function has2(uri) {
var entries = ImageUriCache2._entries;
var isDataUri = dataUriPattern.test(uri);
return isDataUri || Boolean(entries[uri]);
};
ImageUriCache2.add = function add3(uri) {
var entries = ImageUriCache2._entries;
var lastUsedTimestamp = Date.now();
if (entries[uri]) {
entries[uri].lastUsedTimestamp = lastUsedTimestamp;
entries[uri].refCount += 1;
} else {
entries[uri] = {
lastUsedTimestamp,
refCount: 1
};
}
};
ImageUriCache2.remove = function remove(uri) {
var entries = ImageUriCache2._entries;
if (entries[uri]) {
entries[uri].refCount -= 1;
}
ImageUriCache2._cleanUpIfNeeded();
};
ImageUriCache2._cleanUpIfNeeded = function _cleanUpIfNeeded() {
var entries = ImageUriCache2._entries;
var imageUris = Object.keys(entries);
if (imageUris.length + 1 > ImageUriCache2._maximumEntries) {
var leastRecentlyUsedKey;
var leastRecentlyUsedEntry;
imageUris.forEach(function(uri) {
var entry = entries[uri];
if ((!leastRecentlyUsedEntry || entry.lastUsedTimestamp < leastRecentlyUsedEntry.lastUsedTimestamp) && entry.refCount === 0) {
leastRecentlyUsedKey = uri;
leastRecentlyUsedEntry = entry;
}
});
if (leastRecentlyUsedKey) {
delete entries[leastRecentlyUsedKey];
}
}
};
return ImageUriCache2;
}();
ImageUriCache._maximumEntries = 256;
ImageUriCache._entries = {};
var id = 0;
var requests = {};
var ImageLoader = {
abort: function abort(requestId) {
var image = requests["" + requestId];
if (image) {
image.onerror = null;
image.onload = null;
image = null;
delete requests["" + requestId];
}
},
getSize: function getSize(uri, success, failure) {
var complete = false;
var interval = setInterval(callback, 16);
var requestId = ImageLoader.load(uri, callback, errorCallback);
function callback() {
var image = requests["" + requestId];
if (image) {
var naturalHeight = image.naturalHeight, naturalWidth = image.naturalWidth;
if (naturalHeight && naturalWidth) {
success(naturalWidth, naturalHeight);
complete = true;
}
}
if (complete) {
ImageLoader.abort(requestId);
clearInterval(interval);
}
}
function errorCallback() {
if (typeof failure === "function") {
failure();
}
ImageLoader.abort(requestId);
clearInterval(interval);
}
},
has: function has(uri) {
return ImageUriCache.has(uri);
},
load: function load(uri, onLoad, onError) {
id += 1;
var image = new window.Image();
image.onerror = onError;
image.onload = function(e) {
var onDecode = function onDecode2() {
return onLoad({
nativeEvent: e
});
};
if (typeof image.decode === "function") {
image.decode().then(onDecode, onDecode);
} else {
setTimeout(onDecode, 0);
}
};
image.src = uri;
requests["" + id] = image;
return id;
},
prefetch: function prefetch(uri) {
return new Promise(function(resolve, reject) {
ImageLoader.load(uri, function() {
ImageUriCache.add(uri);
ImageUriCache.remove(uri);
resolve();
}, reject);
});
},
queryCache: function queryCache(uris) {
var result = {};
uris.forEach(function(u) {
if (ImageUriCache.has(u)) {
result[u] = "disk/memory";
}
});
return Promise.resolve(result);
}
};
var PixelRatio = /* @__PURE__ */ function() {
function PixelRatio2() {
}
PixelRatio2.get = function get3() {
return Dimensions.get("window").scale;
};
PixelRatio2.getFontScale = function getFontScale() {
return Dimensions.get("window").fontScale || PixelRatio2.get();
};
PixelRatio2.getPixelSizeForLayoutSize = function getPixelSizeForLayoutSize(layoutSize) {
return Math.round(layoutSize * PixelRatio2.get());
};
PixelRatio2.roundToNearestPixel = function roundToNearestPixel(layoutSize) {
var ratio = PixelRatio2.get();
return Math.round(layoutSize * ratio) / ratio;
};
return PixelRatio2;
}();
function _extends$5() {
_extends$5 = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$5.apply(this, arguments);
}
function _objectWithoutPropertiesLoose$6(source, excluded) {
if (source == null)
return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0)
continue;
target[key] = source[key];
}
return target;
}
function ownKeys$d(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$d(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys$d(Object(source), true).forEach(function(key) {
_defineProperty$d(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys$d(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _defineProperty$d(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {value, enumerable: true, configurable: true, writable: true});
} else {
obj[key] = value;
}
return obj;
}
var ERRORED = "ERRORED";
var LOADED = "LOADED";
var LOADING = "LOADING";
var IDLE = "IDLE";
var _filterId = 0;
var svgDataUriPattern = /^(data:image\/svg\+xml;utf8,)(.*)/;
function createTintColorSVG(tintColor, id2) {
return tintColor && id2 != null ? /* @__PURE__ */ React__default.createElement("svg", {
style: {
position: "absolute",
height: 0,
visibility: "hidden",
width: 0
}
}, /* @__PURE__ */ React__default.createElement("defs", null, /* @__PURE__ */ React__default.createElement("filter", {
id: "tint-" + id2,
suppressHydrationWarning: true
}, /* @__PURE__ */ React__default.createElement("feFlood", {
floodColor: "" + tintColor,
key: tintColor
}), /* @__PURE__ */ React__default.createElement("feComposite", {
in2: "SourceAlpha",
operator: "atop"
})))) : null;
}
function getFlatStyle(style, blurRadius, filterId) {
var flatStyle = _objectSpread$d({}, StyleSheet.flatten(style));
var filter3 = flatStyle.filter, resizeMode = flatStyle.resizeMode, shadowOffset = flatStyle.shadowOffset, tintColor = flatStyle.tintColor;
var filters = [];
var _filter = null;
if (filter3) {
filters.push(filter3);
}
if (blurRadius) {
filters.push("blur(" + blurRadius + "px)");
}
if (shadowOffset) {
var shadowString = resolveShadowValue(flatStyle);
if (shadowString) {
filters.push("drop-shadow(" + shadowString + ")");
}
}
if (tintColor && filterId != null) {
filters.push("url(#tint-" + filterId + ")");
}
if (filters.length > 0) {
_filter = filters.join(" ");
}
delete flatStyle.blurRadius;
delete flatStyle.shadowColor;
delete flatStyle.shadowOpacity;
delete flatStyle.shadowOffset;
delete flatStyle.shadowRadius;
delete flatStyle.tintColor;
delete flatStyle.overlayColor;
delete flatStyle.resizeMode;
return [flatStyle, resizeMode, _filter, tintColor];
}
function resolveAssetDimensions(source) {
if (typeof source === "number") {
var _getAssetByID = getAssetByID(source), height = _getAssetByID.height, width = _getAssetByID.width;
return {
height,
width
};
} else if (source != null && !Array.isArray(source) && typeof source === "object") {
var _height = source.height, _width = source.width;
return {
height: _height,
width: _width
};
}
}
function resolveAssetUri(source) {
var uri = null;
if (typeof source === "number") {
var asset = getAssetByID(source);
var scale = asset.scales[0];
if (asset.scales.length > 1) {
var preferredScale = PixelRatio.get();
scale = asset.scales.reduce(function(prev, curr) {
return Math.abs(curr - preferredScale) < Math.abs(prev - preferredScale) ? curr : prev;
});
}
var scaleSuffix = scale !== 1 ? "@" + scale + "x" : "";
uri = asset ? asset.httpServerLocation + "/" + asset.name + scaleSuffix + "." + asset.type : "";
} else if (typeof source === "string") {
uri = source;
} else if (source && typeof source.uri === "string") {
uri = source.uri;
}
if (uri) {
var match = uri.match(svgDataUriPattern);
if (match) {
var prefix2 = match[1], svg = match[2];
var encodedSvg = encodeURIComponent(svg);
return "" + prefix2 + encodedSvg;
}
}
return uri;
}
var Image = /* @__PURE__ */ forwardRef(function(props, ref) {
var accessibilityLabel = props.accessibilityLabel, blurRadius = props.blurRadius, defaultSource = props.defaultSource, draggable = props.draggable, onError = props.onError, onLayout = props.onLayout, onLoad = props.onLoad, onLoadEnd = props.onLoadEnd, onLoadStart = props.onLoadStart, pointerEvents = props.pointerEvents, source = props.source, style = props.style, rest = _objectWithoutPropertiesLoose$6(props, ["accessibilityLabel", "blurRadius", "defaultSource", "draggable", "onError", "onLayout", "onLoad", "onLoadEnd", "onLoadStart", "pointerEvents", "source", "style"]);
var _useState = useState(function() {
var uri2 = resolveAssetUri(source);
if (uri2 != null) {
var isLoaded = ImageLoader.has(uri2);
if (isLoaded) {
return LOADED;
}
}
return IDLE;
}), state = _useState[0], updateState = _useState[1];
var _useState2 = useState({}), layout = _useState2[0], updateLayout = _useState2[1];
var hasTextAncestor = useContext(TextAncestorContext);
var hiddenImageRef = useRef(null);
var filterRef = useRef(_filterId++);
var requestRef = useRef(null);
var shouldDisplaySource = state === LOADED || state === LOADING && defaultSource == null;
var _getFlatStyle = getFlatStyle(style, blurRadius, filterRef.current), flatStyle = _getFlatStyle[0], _resizeMode = _getFlatStyle[1], filter3 = _getFlatStyle[2], tintColor = _getFlatStyle[3];
var resizeMode = props.resizeMode || _resizeMode || "cover";
var selectedSource = shouldDisplaySource ? source : defaultSource;
var displayImageUri = resolveAssetUri(selectedSource);
var imageSizeStyle = resolveAssetDimensions(selectedSource);
var backgroundImage = displayImageUri ? 'url("' + displayImageUri + '")' : null;
var backgroundSize = getBackgroundSize();
var hiddenImage = displayImageUri ? createElement("img", {
alt: accessibilityLabel || "",
classList: [classes$2.accessibilityImage],
draggable: draggable || false,
ref: hiddenImageRef,
src: displayImageUri
}) : null;
function getBackgroundSize() {
if (hiddenImageRef.current != null && (resizeMode === "center" || resizeMode === "repeat")) {
var _hiddenImageRef$curre = hiddenImageRef.current, naturalHeight = _hiddenImageRef$curre.naturalHeight, naturalWidth = _hiddenImageRef$curre.naturalWidth;
var height = layout.height, width = layout.width;
if (naturalHeight && naturalWidth && height && width) {
var scaleFactor = Math.min(1, width / naturalWidth, height / naturalHeight);
var x = Math.ceil(scaleFactor * naturalWidth);
var y = Math.ceil(scaleFactor * naturalHeight);
return x + "px " + y + "px";
}
}
}
function handleLayout(e) {
if (resizeMode === "center" || resizeMode === "repeat" || onLayout) {
var _layout = e.nativeEvent.layout;
onLayout && onLayout(e);
updateLayout(_layout);
}
}
var uri = resolveAssetUri(source);
useEffect(function() {
abortPendingRequest();
if (uri != null) {
updateState(LOADING);
if (onLoadStart) {
onLoadStart();
}
requestRef.current = ImageLoader.load(uri, function load2(e) {
updateState(LOADED);
if (onLoad) {
onLoad(e);
}
if (onLoadEnd) {
onLoadEnd();
}
}, function error() {
updateState(ERRORED);
if (onError) {
onError({
nativeEvent: {
error: "Failed to load resource " + uri + " (404)"
}
});
}
if (onLoadEnd) {
onLoadEnd();
}
});
}
function abortPendingRequest() {
if (requestRef.current != null) {
ImageLoader.abort(requestRef.current);
requestRef.current = null;
}
}
return abortPendingRequest;
}, [uri, requestRef, updateState, onError, onLoad, onLoadEnd, onLoadStart]);
return /* @__PURE__ */ React__default.createElement(View, _extends$5({}, rest, {
accessibilityLabel,
onLayout: handleLayout,
pointerEvents,
ref,
style: [styles$5.root, hasTextAncestor && styles$5.inline, imageSizeStyle, flatStyle]
}), /* @__PURE__ */ React__default.createElement(View, {
style: [styles$5.image, resizeModeStyles[resizeMode], {
backgroundImage,
filter: filter3
}, backgroundSize != null && {
backgroundSize
}],
suppressHydrationWarning: true
}), hiddenImage, createTintColorSVG(tintColor, filterRef.current));
});
Image.displayName = "Image";
Image.getSize = function(uri, success, failure) {
ImageLoader.getSize(uri, success, failure);
};
Image.prefetch = function(uri) {
return ImageLoader.prefetch(uri);
};
Image.queryCache = function(uris) {
return ImageLoader.queryCache(uris);
};
var classes$2 = css.create({
accessibilityImage: _objectSpread$d(_objectSpread$d({}, StyleSheet.absoluteFillObject), {}, {
height: "100%",
opacity: 0,
width: "100%",
zIndex: -1
})
});
var styles$5 = StyleSheet.create({
root: {
flexBasis: "auto",
overflow: "hidden",
zIndex: 0
},
inline: {
display: "inline-flex"
},
image: _objectSpread$d(_objectSpread$d({}, StyleSheet.absoluteFillObject), {}, {
backgroundColor: "transparent",
backgroundPosition: "center",
backgroundRepeat: "no-repeat",
backgroundSize: "cover",
height: "100%",
width: "100%",
zIndex: -1
})
});
var resizeModeStyles = StyleSheet.create({
center: {
backgroundSize: "auto"
},
contain: {
backgroundSize: "contain"
},
cover: {
backgroundSize: "cover"
},
none: {
backgroundPosition: "0 0",
backgroundSize: "auto"
},
repeat: {
backgroundPosition: "0 0",
backgroundRepeat: "repeat",
backgroundSize: "auto"
},
stretch: {
backgroundSize: "100% 100%"
}
});
function _extends$6() {
_extends$6 = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$6.apply(this, arguments);
}
function ownKeys$e(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$e(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys$e(Object(source), true).forEach(function(key) {
_defineProperty$e(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys$e(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _defineProperty$e(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {value, enumerable: true, configurable: true, writable: true});
} else {
obj[key] = value;
}
return obj;
}
function _assertThisInitialized$1(self2) {
if (self2 === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self2;
}
function _inheritsLoose$n(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$n(subClass, superClass);
}
function _setPrototypeOf$n(o, p) {
_setPrototypeOf$n = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$n(o, p);
}
var VirtualizedSectionList = /* @__PURE__ */ function(_React$PureComponent) {
_inheritsLoose$n(VirtualizedSectionList2, _React$PureComponent);
var _proto = VirtualizedSectionList2.prototype;
_proto.scrollToLocation = function scrollToLocation(params) {
var index2 = params.itemIndex;
for (var i = 0; i < params.sectionIndex; i++) {
index2 += this.props.getItemCount(this.props.sections[i].data) + 2;
}
var viewOffset = 0;
if (params.itemIndex > 0 && this.props.stickySectionHeadersEnabled) {
var frame = this._listRef._getFrameMetricsApprox(index2 - params.itemIndex);
viewOffset = frame.length;
}
var toIndexParams = _objectSpread$e(_objectSpread$e({}, params), {}, {
viewOffset,
index: index2
});
this._listRef.scrollToIndex(toIndexParams);
};
_proto.getListRef = function getListRef() {
return this._listRef;
};
function VirtualizedSectionList2(props, context) {
var _this;
_this = _React$PureComponent.call(this, props, context) || this;
_this._keyExtractor = function(item, index2) {
var info = _this._subExtractor(index2);
return info && info.key || String(index2);
};
_this._convertViewable = function(viewable) {
invariant2(viewable.index != null, "Received a broken ViewToken");
var info = _this._subExtractor(viewable.index);
if (!info) {
return null;
}
var keyExtractor2 = info.section.keyExtractor || _this.props.keyExtractor;
return _objectSpread$e(_objectSpread$e({}, viewable), {}, {
index: info.index,
key: keyExtractor2(viewable.item, info.index),
section: info.section
});
};
_this._onViewableItemsChanged = function(_ref) {
var viewableItems = _ref.viewableItems, changed = _ref.changed;
if (_this.props.onViewableItemsChanged) {
_this.props.onViewableItemsChanged({
viewableItems: viewableItems.map(_this._convertViewable, _assertThisInitialized$1(_this)).filter(Boolean),
changed: changed.map(_this._convertViewable, _assertThisInitialized$1(_this)).filter(Boolean)
});
}
};
_this._renderItem = function(_ref2) {
var item = _ref2.item, index2 = _ref2.index;
var info = _this._subExtractor(index2);
if (!info) {
return null;
}
var infoIndex = info.index;
if (infoIndex == null) {
var section = info.section;
if (info.header === true) {
var renderSectionHeader = _this.props.renderSectionHeader;
return renderSectionHeader ? renderSectionHeader({
section
}) : null;
} else {
var renderSectionFooter = _this.props.renderSectionFooter;
return renderSectionFooter ? renderSectionFooter({
section
}) : null;
}
} else {
var renderItem = info.section.renderItem || _this.props.renderItem;
var SeparatorComponent = _this._getSeparatorComponent(index2, info);
invariant2(renderItem, "no renderItem!");
return /* @__PURE__ */ createElement$1(ItemWithSeparator, {
SeparatorComponent,
LeadingSeparatorComponent: infoIndex === 0 ? _this.props.SectionSeparatorComponent : void 0,
cellKey: info.key,
index: infoIndex,
item,
leadingItem: info.leadingItem,
leadingSection: info.leadingSection,
onUpdateSeparator: _this._onUpdateSeparator,
prevCellKey: (_this._subExtractor(index2 - 1) || {}).key,
ref: function ref(_ref3) {
_this._cellRefs[info.key] = _ref3;
},
renderItem,
section: info.section,
trailingItem: info.trailingItem,
trailingSection: info.trailingSection
});
}
};
_this._onUpdateSeparator = function(key, newProps) {
var ref = _this._cellRefs[key];
ref && ref.updateSeparatorProps(newProps);
};
_this._cellRefs = {};
_this._captureRef = function(ref) {
_this._listRef = ref;
};
_this.state = _this._computeState(props);
return _this;
}
_proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps) {
this.setState(this._computeState(nextProps));
};
_proto._computeState = function _computeState(props) {
var offset = props.ListHeaderComponent ? 1 : 0;
var stickyHeaderIndices = [];
var itemCount = props.sections ? props.sections.reduce(function(v, section) {
stickyHeaderIndices.push(v + offset);
return v + props.getItemCount(section.data) + 2;
}, 0) : 0;
return {
childProps: _objectSpread$e(_objectSpread$e({}, props), {}, {
renderItem: this._renderItem,
ItemSeparatorComponent: void 0,
data: props.sections,
getItemCount: function getItemCount() {
return itemCount;
},
getItem: function getItem(sections, index2) {
return _getItem(props, sections, index2);
},
keyExtractor: this._keyExtractor,
onViewableItemsChanged: props.onViewableItemsChanged ? this._onViewableItemsChanged : void 0,
stickyHeaderIndices: props.stickySectionHeadersEnabled ? stickyHeaderIndices : void 0
})
};
};
_proto.render = function render3() {
return /* @__PURE__ */ createElement$1(VirtualizedList, _extends$6({}, this.state.childProps, {
ref: this._captureRef
}));
};
_proto._subExtractor = function _subExtractor(index2) {
var itemIndex = index2;
var _this$props = this.props, getItem = _this$props.getItem, getItemCount = _this$props.getItemCount, keyExtractor2 = _this$props.keyExtractor, sections = _this$props.sections;
for (var i = 0; i < sections.length; i++) {
var section = sections[i];
var sectionData = section.data;
var key = section.key || String(i);
itemIndex -= 1;
if (itemIndex >= getItemCount(sectionData) + 1) {
itemIndex -= getItemCount(sectionData) + 1;
} else if (itemIndex === -1) {
return {
section,
key: key + ":header",
index: null,
header: true,
trailingSection: sections[i + 1]
};
} else if (itemIndex === getItemCount(sectionData)) {
return {
section,
key: key + ":footer",
index: null,
header: false,
trailingSection: sections[i + 1]
};
} else {
var extractor = section.keyExtractor || keyExtractor2;
return {
section,
key: key + ":" + extractor(getItem(sectionData, itemIndex), itemIndex),
index: itemIndex,
leadingItem: getItem(sectionData, itemIndex - 1),
leadingSection: sections[i - 1],
trailingItem: getItem(sectionData, itemIndex + 1),
trailingSection: sections[i + 1]
};
}
}
};
_proto._getSeparatorComponent = function _getSeparatorComponent(index2, info) {
info = info || this._subExtractor(index2);
if (!info) {
return null;
}
var ItemSeparatorComponent = info.section.ItemSeparatorComponent || this.props.ItemSeparatorComponent;
var SectionSeparatorComponent = this.props.SectionSeparatorComponent;
var isLastItemInList = index2 === this.state.childProps.getItemCount() - 1;
var isLastItemInSection = info.index === this.props.getItemCount(info.section.data) - 1;
if (SectionSeparatorComponent && isLastItemInSection) {
return SectionSeparatorComponent;
}
if (ItemSeparatorComponent && !isLastItemInSection && !isLastItemInList) {
return ItemSeparatorComponent;
}
return null;
};
return VirtualizedSectionList2;
}(PureComponent);
VirtualizedSectionList.defaultProps = _objectSpread$e(_objectSpread$e({}, VirtualizedList.defaultProps), {}, {
data: []
});
var ItemWithSeparator = /* @__PURE__ */ function(_React$Component) {
_inheritsLoose$n(ItemWithSeparator2, _React$Component);
function ItemWithSeparator2() {
var _this2;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this2 = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
_this2.state = {
separatorProps: {
highlighted: false,
leadingItem: _this2.props.item,
leadingSection: _this2.props.leadingSection,
section: _this2.props.section,
trailingItem: _this2.props.trailingItem,
trailingSection: _this2.props.trailingSection
},
leadingSeparatorProps: {
highlighted: false,
leadingItem: _this2.props.leadingItem,
leadingSection: _this2.props.leadingSection,
section: _this2.props.section,
trailingItem: _this2.props.item,
trailingSection: _this2.props.trailingSection
}
};
_this2._separators = {
highlight: function highlight() {
["leading", "trailing"].forEach(function(s) {
return _this2._separators.updateProps(s, {
highlighted: true
});
});
},
unhighlight: function unhighlight() {
["leading", "trailing"].forEach(function(s) {
return _this2._separators.updateProps(s, {
highlighted: false
});
});
},
updateProps: function updateProps(select2, newProps) {
var _this2$props = _this2.props, LeadingSeparatorComponent = _this2$props.LeadingSeparatorComponent, cellKey = _this2$props.cellKey, prevCellKey = _this2$props.prevCellKey;
if (select2 === "leading" && LeadingSeparatorComponent != null) {
_this2.setState(function(state) {
return {
leadingSeparatorProps: _objectSpread$e(_objectSpread$e({}, state.leadingSeparatorProps), newProps)
};
});
} else {
_this2.props.onUpdateSeparator(select2 === "leading" && prevCellKey || cellKey, newProps);
}
}
};
return _this2;
}
ItemWithSeparator2.getDerivedStateFromProps = function getDerivedStateFromProps(props, prevState) {
return {
separatorProps: _objectSpread$e(_objectSpread$e({}, prevState.separatorProps), {}, {
leadingItem: props.item,
leadingSection: props.leadingSection,
section: props.section,
trailingItem: props.trailingItem,
trailingSection: props.trailingSection
}),
leadingSeparatorProps: _objectSpread$e(_objectSpread$e({}, prevState.leadingSeparatorProps), {}, {
leadingItem: props.leadingItem,
leadingSection: props.leadingSection,
section: props.section,
trailingItem: props.item,
trailingSection: props.trailingSection
})
};
};
var _proto2 = ItemWithSeparator2.prototype;
_proto2.updateSeparatorProps = function updateSeparatorProps(newProps) {
this.setState(function(state) {
return {
separatorProps: _objectSpread$e(_objectSpread$e({}, state.separatorProps), newProps)
};
});
};
_proto2.render = function render3() {
var _this$props2 = this.props, LeadingSeparatorComponent = _this$props2.LeadingSeparatorComponent, SeparatorComponent = _this$props2.SeparatorComponent, item = _this$props2.item, index2 = _this$props2.index, section = _this$props2.section;
var element = this.props.renderItem({
item,
index: index2,
section,
separators: this._separators
});
var leadingSeparator = LeadingSeparatorComponent && /* @__PURE__ */ createElement$1(LeadingSeparatorComponent, this.state.leadingSeparatorProps);
var separator = SeparatorComponent && /* @__PURE__ */ createElement$1(SeparatorComponent, this.state.separatorProps);
return leadingSeparator || separator ? /* @__PURE__ */ createElement$1(View, null, leadingSeparator, element, separator) : element;
};
return ItemWithSeparator2;
}(Component);
function _getItem(props, sections, index2) {
if (!sections) {
return null;
}
var itemIdx = index2 - 1;
for (var i = 0; i < sections.length; i++) {
var section = sections[i];
var sectionData = section.data;
var itemCount = props.getItemCount(sectionData);
if (itemIdx === -1 || itemIdx === itemCount) {
return section;
} else if (itemIdx < itemCount) {
return props.getItem(sectionData, itemIdx);
} else {
itemIdx -= itemCount + 2;
}
}
return null;
}
function _extends$7() {
_extends$7 = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$7.apply(this, arguments);
}
function _inheritsLoose$o(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$o(subClass, superClass);
}
function _setPrototypeOf$o(o, p) {
_setPrototypeOf$o = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$o(o, p);
}
function ownKeys$f(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$f(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys$f(Object(source), true).forEach(function(key) {
_defineProperty$f(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys$f(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _defineProperty$f(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {value, enumerable: true, configurable: true, writable: true});
} else {
obj[key] = value;
}
return obj;
}
var defaultProps$2 = _objectSpread$f(_objectSpread$f({}, VirtualizedSectionList.defaultProps), {}, {
stickySectionHeadersEnabled: Platform.OS === "ios"
});
var SectionList = /* @__PURE__ */ function(_React$PureComponent) {
_inheritsLoose$o(SectionList2, _React$PureComponent);
function SectionList2() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args)) || this;
_this._captureRef = function(ref) {
_this._wrapperListRef = ref;
};
return _this;
}
var _proto = SectionList2.prototype;
_proto.scrollToLocation = function scrollToLocation(params) {
if (this._wrapperListRef != null) {
this._wrapperListRef.scrollToLocation(params);
}
};
_proto.recordInteraction = function recordInteraction() {
var listRef = this._wrapperListRef && this._wrapperListRef.getListRef();
listRef && listRef.recordInteraction();
};
_proto.flashScrollIndicators = function flashScrollIndicators2() {
var listRef = this._wrapperListRef && this._wrapperListRef.getListRef();
listRef && listRef.flashScrollIndicators();
};
_proto.getScrollResponder = function getScrollResponder2() {
var listRef = this._wrapperListRef && this._wrapperListRef.getListRef();
if (listRef) {
return listRef.getScrollResponder();
}
};
_proto.getScrollableNode = function getScrollableNode2() {
var listRef = this._wrapperListRef && this._wrapperListRef.getListRef();
if (listRef) {
return listRef.getScrollableNode();
}
};
_proto.setNativeProps = function setNativeProps3(props) {
var listRef = this._wrapperListRef && this._wrapperListRef.getListRef();
if (listRef) {
listRef.setNativeProps(props);
}
};
_proto.render = function render3() {
return /* @__PURE__ */ createElement$1(VirtualizedSectionList, _extends$7({}, this.props, {
ref: this._captureRef,
getItemCount: function getItemCount(items) {
return items.length;
},
getItem: function getItem(items, index2) {
return items[index2];
}
}));
};
return SectionList2;
}(PureComponent);
SectionList.defaultProps = defaultProps$2;
function ownKeys$g(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$g(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys$g(Object(source), true).forEach(function(key) {
_defineProperty$g(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys$g(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _defineProperty$g(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {value, enumerable: true, configurable: true, writable: true});
} else {
obj[key] = value;
}
return obj;
}
var forwardPropsList$1 = _objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g({}, defaultProps), accessibilityProps), clickProps), focusProps), keyboardProps), mouseProps), touchProps), styleProps), {}, {
href: true,
lang: true,
pointerEvents: true
});
var pickProps$1 = function pickProps3(props) {
return pick(props, forwardPropsList$1);
};
var Text = /* @__PURE__ */ forwardRef(function(props, forwardedRef) {
var dir = props.dir, hrefAttrs = props.hrefAttrs, numberOfLines = props.numberOfLines, onClick = props.onClick, onLayout = props.onLayout, onPress = props.onPress, onMoveShouldSetResponder = props.onMoveShouldSetResponder, onMoveShouldSetResponderCapture = props.onMoveShouldSetResponderCapture, onResponderEnd = props.onResponderEnd, onResponderGrant = props.onResponderGrant, onResponderMove = props.onResponderMove, onResponderReject = props.onResponderReject, onResponderRelease = props.onResponderRelease, onResponderStart = props.onResponderStart, onResponderTerminate = props.onResponderTerminate, onResponderTerminationRequest = props.onResponderTerminationRequest, onScrollShouldSetResponder = props.onScrollShouldSetResponder, onScrollShouldSetResponderCapture = props.onScrollShouldSetResponderCapture, onSelectionChangeShouldSetResponder = props.onSelectionChangeShouldSetResponder, onSelectionChangeShouldSetResponderCapture = props.onSelectionChangeShouldSetResponderCapture, onStartShouldSetResponder = props.onStartShouldSetResponder, onStartShouldSetResponderCapture = props.onStartShouldSetResponderCapture, selectable = props.selectable;
var hasTextAncestor = useContext(TextAncestorContext);
var hostRef = useRef(null);
var classList2 = [classes$3.text, hasTextAncestor === true && classes$3.textHasAncestor, numberOfLines === 1 && classes$3.textOneLine, numberOfLines != null && numberOfLines > 1 && classes$3.textMultiLine];
var style = [props.style, numberOfLines != null && numberOfLines > 1 && {
WebkitLineClamp: numberOfLines
}, selectable === true && styles$6.selectable, selectable === false && styles$6.notSelectable, onPress && styles$6.pressable];
useElementLayout(hostRef, onLayout);
useResponderEvents(hostRef, {
onMoveShouldSetResponder,
onMoveShouldSetResponderCapture,
onResponderEnd,
onResponderGrant,
onResponderMove,
onResponderReject,
onResponderRelease,
onResponderStart,
onResponderTerminate,
onResponderTerminationRequest,
onScrollShouldSetResponder,
onScrollShouldSetResponderCapture,
onSelectionChangeShouldSetResponder,
onSelectionChangeShouldSetResponderCapture,
onStartShouldSetResponder,
onStartShouldSetResponderCapture
});
function handleClick(e) {
if (onClick != null) {
onClick(e);
}
if (onClick == null && onPress != null) {
e.stopPropagation();
onPress(e);
}
}
var component = hasTextAncestor ? "span" : "div";
var supportedProps = pickProps$1(props);
supportedProps.classList = classList2;
supportedProps.dir = dir;
if (!hasTextAncestor) {
supportedProps.dir = dir != null ? dir : "auto";
}
supportedProps.onClick = handleClick;
supportedProps.style = style;
if (props.href != null && hrefAttrs != null) {
var download = hrefAttrs.download, rel = hrefAttrs.rel, target = hrefAttrs.target;
if (download != null) {
supportedProps.download = download;
}
if (rel != null) {
supportedProps.rel = rel;
}
if (typeof target === "string" && target.charAt(0) !== "_") {
supportedProps.target = "_" + target;
}
}
var platformMethodsRef = usePlatformMethods(supportedProps);
var setRef = useMergeRefs(hostRef, platformMethodsRef, forwardedRef);
supportedProps.ref = setRef;
var element = createElement(component, supportedProps);
return hasTextAncestor ? element : /* @__PURE__ */ createElement$1(TextAncestorContext.Provider, {
value: true
}, element);
});
Text.displayName = "Text";
var classes$3 = css.create({
text: {
border: "0 solid black",
boxSizing: "border-box",
color: "black",
display: "inline",
font: "14px System",
margin: 0,
padding: 0,
whiteSpace: "pre-wrap",
wordWrap: "break-word"
},
textHasAncestor: {
color: "inherit",
font: "inherit",
whiteSpace: "inherit"
},
textOneLine: {
maxWidth: "100%",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap"
},
textMultiLine: {
display: "-webkit-box",
maxWidth: "100%",
overflow: "hidden",
textOverflow: "ellipsis",
WebkitBoxOrient: "vertical"
}
});
var styles$6 = StyleSheet.create({
notSelectable: {
userSelect: "none"
},
selectable: {
userSelect: "text"
},
pressable: {
cursor: "pointer"
}
});
function ownKeys$h(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$h(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys$h(Object(source), true).forEach(function(key) {
_defineProperty$h(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys$h(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _defineProperty$h(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {value, enumerable: true, configurable: true, writable: true});
} else {
obj[key] = value;
}
return obj;
}
var Animated = _objectSpread$h(_objectSpread$h({}, AnimatedImplementation), {}, {
FlatList: AnimatedImplementation.createAnimatedComponent(FlatList, {
scrollEventThrottle: 1e-4
}),
Image: AnimatedImplementation.createAnimatedComponent(Image),
ScrollView: AnimatedImplementation.createAnimatedComponent(ScrollView, {
scrollEventThrottle: 1e-4
}),
SectionList: AnimatedImplementation.createAnimatedComponent(SectionList, {
scrollEventThrottle: 1e-4
}),
View: AnimatedImplementation.createAnimatedComponent(View),
Text: AnimatedImplementation.createAnimatedComponent(Text)
});
function getQuery() {
return canUseDOM && window.matchMedia != null ? window.matchMedia("(prefers-color-scheme: dark)") : null;
}
var query = getQuery();
var listenerMapping = new WeakMap();
var Appearance = {
getColorScheme: function getColorScheme() {
return query && query.matches ? "dark" : "light";
},
addChangeListener: function addChangeListener2(listener) {
var mappedListener = listenerMapping.get(listener);
if (!mappedListener) {
mappedListener = function mappedListener2(_ref) {
var matches = _ref.matches;
listener({
colorScheme: matches ? "dark" : "light"
});
};
listenerMapping.set(listener, mappedListener);
}
if (query) {
query.addListener(mappedListener);
}
},
removeChangeListener: function removeChangeListener2(listener) {
var mappedListener = listenerMapping.get(listener);
if (mappedListener) {
if (query) {
query.removeListener(mappedListener);
}
listenerMapping.delete(listener);
}
}
};
var RootTagContext = /* @__PURE__ */ createContext(null);
function AppContainer(props) {
var children = props.children, WrapperComponent = props.WrapperComponent;
var innerView = /* @__PURE__ */ React__default.createElement(View, {
children,
key: 1,
pointerEvents: "box-none",
style: styles$7.appContainer
});
if (WrapperComponent) {
innerView = /* @__PURE__ */ React__default.createElement(WrapperComponent, null, innerView);
}
return /* @__PURE__ */ React__default.createElement(RootTagContext.Provider, {
value: props.rootTag
}, /* @__PURE__ */ React__default.createElement(View, {
pointerEvents: "box-none",
style: styles$7.appContainer
}, innerView));
}
var styles$7 = StyleSheet.create({
appContainer: {
flex: 1
}
});
function _extends$8() {
_extends$8 = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$8.apply(this, arguments);
}
function renderApplication(RootComponent, WrapperComponent, callback, options) {
var shouldHydrate = options.hydrate, initialProps = options.initialProps, rootTag = options.rootTag;
var renderFn = shouldHydrate ? hydrate : render;
invariant2(rootTag, "Expect to have a valid rootTag, instead got ", rootTag);
renderFn(/* @__PURE__ */ React__default.createElement(AppContainer, {
WrapperComponent,
rootTag
}, /* @__PURE__ */ React__default.createElement(RootComponent, initialProps)), rootTag, callback);
}
function getApplication(RootComponent, initialProps, WrapperComponent) {
var element = /* @__PURE__ */ React__default.createElement(AppContainer, {
WrapperComponent,
rootTag: {}
}, /* @__PURE__ */ React__default.createElement(RootComponent, initialProps));
var getStyleElement = function getStyleElement2(props) {
var sheet = styleResolver.getStyleSheet();
return /* @__PURE__ */ React__default.createElement("style", _extends$8({}, props, {
dangerouslySetInnerHTML: {
__html: sheet.textContent
},
id: sheet.id
}));
};
return {
element,
getStyleElement
};
}
var emptyObject$b = {};
var runnables = {};
var componentProviderInstrumentationHook = function componentProviderInstrumentationHook2(component) {
return component();
};
var wrapperComponentProvider;
var AppRegistry = /* @__PURE__ */ function() {
function AppRegistry2() {
}
AppRegistry2.getAppKeys = function getAppKeys() {
return Object.keys(runnables);
};
AppRegistry2.getApplication = function getApplication2(appKey, appParameters) {
invariant2(runnables[appKey] && runnables[appKey].getApplication, "Application " + appKey + " has not been registered. This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.");
return runnables[appKey].getApplication(appParameters);
};
AppRegistry2.registerComponent = function registerComponent(appKey, componentProvider) {
runnables[appKey] = {
getApplication: function getApplication$1(appParameters) {
return getApplication(componentProviderInstrumentationHook(componentProvider), appParameters ? appParameters.initialProps : emptyObject$b, wrapperComponentProvider && wrapperComponentProvider(appParameters));
},
run: function run(appParameters) {
return renderApplication(componentProviderInstrumentationHook(componentProvider), wrapperComponentProvider && wrapperComponentProvider(appParameters), appParameters.callback, {
hydrate: appParameters.hydrate || false,
initialProps: appParameters.initialProps || emptyObject$b,
rootTag: appParameters.rootTag
});
}
};
return appKey;
};
AppRegistry2.registerConfig = function registerConfig(config) {
config.forEach(function(_ref) {
var appKey = _ref.appKey, component = _ref.component, run = _ref.run;
if (run) {
AppRegistry2.registerRunnable(appKey, run);
} else {
invariant2(component, "No component provider passed in");
AppRegistry2.registerComponent(appKey, component);
}
});
};
AppRegistry2.registerRunnable = function registerRunnable(appKey, run) {
runnables[appKey] = {
run
};
return appKey;
};
AppRegistry2.runApplication = function runApplication(appKey, appParameters) {
invariant2(runnables[appKey] && runnables[appKey].run, 'Application "' + appKey + '" has not been registered. This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.');
runnables[appKey].run(appParameters);
};
AppRegistry2.setComponentProviderInstrumentationHook = function setComponentProviderInstrumentationHook(hook) {
componentProviderInstrumentationHook = hook;
};
AppRegistry2.setWrapperComponentProvider = function setWrapperComponentProvider(provider) {
wrapperComponentProvider = provider;
};
AppRegistry2.unmountApplicationComponentAtRootTag = function unmountApplicationComponentAtRootTag(rootTag) {
unmountComponentAtNode(rootTag);
};
return AppRegistry2;
}();
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor)
descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps)
_defineProperties(Constructor.prototype, protoProps);
if (staticProps)
_defineProperties(Constructor, staticProps);
return Constructor;
}
var isPrefixed = canUseDOM && !document.hasOwnProperty("hidden") && document.hasOwnProperty("webkitHidden");
var EVENT_TYPES = ["change", "memoryWarning"];
var VISIBILITY_CHANGE_EVENT = isPrefixed ? "webkitvisibilitychange" : "visibilitychange";
var VISIBILITY_STATE_PROPERTY = isPrefixed ? "webkitVisibilityState" : "visibilityState";
var AppStates = {
BACKGROUND: "background",
ACTIVE: "active"
};
var listeners$1 = [];
var AppState = /* @__PURE__ */ function() {
function AppState2() {
}
AppState2.addEventListener = function addEventListener3(type, handler) {
if (AppState2.isAvailable) {
invariant2(EVENT_TYPES.indexOf(type) !== -1, 'Trying to subscribe to unknown event: "%s"', type);
if (type === "change") {
var callback = function callback2() {
return handler(AppState2.currentState);
};
listeners$1.push([handler, callback]);
document.addEventListener(VISIBILITY_CHANGE_EVENT, callback, false);
}
}
};
AppState2.removeEventListener = function removeEventListener2(type, handler) {
if (AppState2.isAvailable) {
invariant2(EVENT_TYPES.indexOf(type) !== -1, 'Trying to remove listener for unknown event: "%s"', type);
if (type === "change") {
var listenerIndex = findIndex(listeners$1, function(pair) {
return pair[0] === handler;
});
invariant2(listenerIndex !== -1, "Trying to remove AppState listener for unregistered handler");
var callback = listeners$1[listenerIndex][1];
document.removeEventListener(VISIBILITY_CHANGE_EVENT, callback, false);
listeners$1.splice(listenerIndex, 1);
}
}
};
_createClass(AppState2, null, [{
key: "currentState",
get: function get3() {
if (!AppState2.isAvailable) {
return AppStates.ACTIVE;
}
switch (document[VISIBILITY_STATE_PROPERTY]) {
case "hidden":
case "prerender":
case "unloaded":
return AppStates.BACKGROUND;
default:
return AppStates.ACTIVE;
}
}
}]);
return AppState2;
}();
AppState.isAvailable = canUseDOM && document[VISIBILITY_STATE_PROPERTY];
function emptyFunction$1() {
}
var BackHandler = {
exitApp: emptyFunction$1,
addEventListener: function addEventListener2() {
return {
remove: emptyFunction$1
};
},
removeEventListener: emptyFunction$1
};
var clipboardAvailable;
var Clipboard = /* @__PURE__ */ function() {
function Clipboard2() {
}
Clipboard2.isAvailable = function isAvailable() {
if (clipboardAvailable === void 0) {
clipboardAvailable = typeof document.queryCommandSupported === "function" && document.queryCommandSupported("copy");
}
return clipboardAvailable;
};
Clipboard2.getString = function getString() {
return Promise.resolve("");
};
Clipboard2.setString = function setString(text) {
var success = false;
var body = document.body;
if (body) {
var node = document.createElement("span");
node.textContent = text;
node.style.opacity = "0";
node.style.position = "absolute";
node.style.whiteSpace = "pre-wrap";
node.style.userSelect = "auto";
body.appendChild(node);
var selection = window.getSelection();
selection.removeAllRanges();
var range = document.createRange();
range.selectNodeContents(node);
selection.addRange(range);
try {
document.execCommand("copy");
success = true;
} catch (e) {
}
selection.removeAllRanges();
body.removeChild(node);
}
return success;
};
return Clipboard2;
}();
var DeviceInfo = {
Dimensions: {
get windowPhysicalPixels() {
var _Dimensions$get = Dimensions.get("window"), width = _Dimensions$get.width, height = _Dimensions$get.height, fontScale = _Dimensions$get.fontScale, scale = _Dimensions$get.scale;
return {
width: width * scale,
height: height * scale,
scale,
fontScale
};
},
get screenPhysicalPixels() {
var _Dimensions$get2 = Dimensions.get("screen"), width = _Dimensions$get2.width, height = _Dimensions$get2.height, fontScale = _Dimensions$get2.fontScale, scale = _Dimensions$get2.scale;
return {
width: width * scale,
height: height * scale,
scale,
fontScale
};
}
},
get locale() {
if (canUseDOM) {
if (window.navigator.languages) {
return window.navigator.languages[0];
} else {
return window.navigator.language;
}
}
},
get totalMemory() {
return canUseDOM ? window.navigator.deviceMemory : void 0;
},
get userAgent() {
return canUseDOM ? window.navigator.userAgent : "";
}
};
var Keyboard = {
addListener: function addListener2() {
return {
remove: function remove() {
}
};
},
dismiss: function dismiss() {
dismissKeyboard();
},
removeAllListeners: function removeAllListeners() {
},
removeListener: function removeListener() {
}
};
function configureNext(config, onAnimationDidEnd) {
if (!Platform.isTesting) {
UIManager.configureNextLayoutAnimation(config, onAnimationDidEnd !== null && onAnimationDidEnd !== void 0 ? onAnimationDidEnd : function() {
}, function() {
});
}
}
function create3(duration, type, property) {
return {
duration,
create: {
type,
property
},
update: {
type
},
delete: {
type,
property
}
};
}
var Presets = {
easeInEaseOut: create3(300, "easeInEaseOut", "opacity"),
linear: create3(500, "linear", "opacity"),
spring: {
duration: 700,
create: {
type: "linear",
property: "opacity"
},
update: {
type: "spring",
springDamping: 0.4
},
delete: {
type: "linear",
property: "opacity"
}
}
};
var LayoutAnimation = {
configureNext,
create: create3,
Types: Object.freeze({
spring: "spring",
linear: "linear",
easeInEaseOut: "easeInEaseOut",
easeIn: "easeIn",
easeOut: "easeOut",
keyboard: "keyboard"
}),
Properties: Object.freeze({
opacity: "opacity",
scaleX: "scaleX",
scaleY: "scaleY",
scaleXY: "scaleXY"
}),
checkConfig: function checkConfig() {
console.error("LayoutAnimation.checkConfig(...) has been disabled.");
},
Presets,
easeInEaseOut: configureNext.bind(null, Presets.easeInEaseOut),
linear: configureNext.bind(null, Presets.linear),
spring: configureNext.bind(null, Presets.spring)
};
var initialURL = canUseDOM ? window.location.href : "";
var Linking = /* @__PURE__ */ function() {
function Linking2() {
var _this = this;
this._eventCallbacks = {};
this.addEventListener = function(event3, callback) {
if (!_this._eventCallbacks[event3]) {
_this._eventCallbacks[event3] = [callback];
return;
}
_this._eventCallbacks[event3].push(callback);
};
this.removeEventListener = function(event3, callback) {
var callbacks = _this._eventCallbacks[event3];
var filteredCallbacks = callbacks.filter(function(c) {
return c.toString() !== callback.toString();
});
_this._eventCallbacks[event3] = filteredCallbacks;
};
}
var _proto = Linking2.prototype;
_proto._dispatchEvent = function _dispatchEvent(event3) {
for (var _len = arguments.length, data = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
data[_key - 1] = arguments[_key];
}
var listeners2 = this._eventCallbacks[event3];
if (listeners2 != null && Array.isArray(listeners2)) {
listeners2.map(function(listener) {
listener.apply(void 0, data);
});
}
};
_proto.canOpenURL = function canOpenURL() {
return Promise.resolve(true);
};
_proto.getInitialURL = function getInitialURL() {
return Promise.resolve(initialURL);
};
_proto.openURL = function openURL(url) {
try {
open(url);
this._dispatchEvent("onOpen", url);
return Promise.resolve();
} catch (e) {
return Promise.reject(e);
}
};
_proto._validateURL = function _validateURL(url) {
invariant2(typeof url === "string", "Invalid URL: should be a string. Was: " + url);
invariant2(url, "Invalid URL: cannot be empty");
};
return Linking2;
}();
var open = function open2(url) {
if (canUseDOM) {
var urlToOpen = new URL(url, window.location).toString();
window.open(urlToOpen, "_blank", "noopener");
}
};
var index = new Linking();
var TouchHistoryMath = {
centroidDimension: function centroidDimension(touchHistory2, touchesChangedAfter, isXAxis, ofCurrent) {
var touchBank2 = touchHistory2.touchBank;
var total = 0;
var count = 0;
var oneTouchData = touchHistory2.numberActiveTouches === 1 ? touchHistory2.touchBank[touchHistory2.indexOfSingleActiveTouch] : null;
if (oneTouchData !== null) {
if (oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter) {
total += ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis ? oneTouchData.currentPageY : !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY;
count = 1;
}
} else {
for (var i = 0; i < touchBank2.length; i++) {
var touchTrack = touchBank2[i];
if (touchTrack !== null && touchTrack !== void 0 && touchTrack.touchActive && touchTrack.currentTimeStamp >= touchesChangedAfter) {
var toAdd = void 0;
if (ofCurrent && isXAxis) {
toAdd = touchTrack.currentPageX;
} else if (ofCurrent && !isXAxis) {
toAdd = touchTrack.currentPageY;
} else if (!ofCurrent && isXAxis) {
toAdd = touchTrack.previousPageX;
} else {
toAdd = touchTrack.previousPageY;
}
total += toAdd;
count++;
}
}
}
return count > 0 ? total / count : TouchHistoryMath.noCentroid;
},
currentCentroidXOfTouchesChangedAfter: function currentCentroidXOfTouchesChangedAfter(touchHistory2, touchesChangedAfter) {
return TouchHistoryMath.centroidDimension(touchHistory2, touchesChangedAfter, true, true);
},
currentCentroidYOfTouchesChangedAfter: function currentCentroidYOfTouchesChangedAfter(touchHistory2, touchesChangedAfter) {
return TouchHistoryMath.centroidDimension(touchHistory2, touchesChangedAfter, false, true);
},
previousCentroidXOfTouchesChangedAfter: function previousCentroidXOfTouchesChangedAfter(touchHistory2, touchesChangedAfter) {
return TouchHistoryMath.centroidDimension(touchHistory2, touchesChangedAfter, true, false);
},
previousCentroidYOfTouchesChangedAfter: function previousCentroidYOfTouchesChangedAfter(touchHistory2, touchesChangedAfter) {
return TouchHistoryMath.centroidDimension(touchHistory2, touchesChangedAfter, false, false);
},
currentCentroidX: function currentCentroidX(touchHistory2) {
return TouchHistoryMath.centroidDimension(touchHistory2, 0, true, true);
},
currentCentroidY: function currentCentroidY(touchHistory2) {
return TouchHistoryMath.centroidDimension(touchHistory2, 0, false, true);
},
noCentroid: -1
};
var currentCentroidXOfTouchesChangedAfter2 = TouchHistoryMath.currentCentroidXOfTouchesChangedAfter;
var currentCentroidYOfTouchesChangedAfter2 = TouchHistoryMath.currentCentroidYOfTouchesChangedAfter;
var previousCentroidXOfTouchesChangedAfter2 = TouchHistoryMath.previousCentroidXOfTouchesChangedAfter;
var previousCentroidYOfTouchesChangedAfter2 = TouchHistoryMath.previousCentroidYOfTouchesChangedAfter;
var currentCentroidX2 = TouchHistoryMath.currentCentroidX;
var currentCentroidY2 = TouchHistoryMath.currentCentroidY;
var PanResponder = {
_initializeGestureState: function _initializeGestureState(gestureState) {
gestureState.moveX = 0;
gestureState.moveY = 0;
gestureState.x0 = 0;
gestureState.y0 = 0;
gestureState.dx = 0;
gestureState.dy = 0;
gestureState.vx = 0;
gestureState.vy = 0;
gestureState.numberActiveTouches = 0;
gestureState._accountsForMovesUpTo = 0;
},
_updateGestureStateOnMove: function _updateGestureStateOnMove(gestureState, touchHistory2) {
gestureState.numberActiveTouches = touchHistory2.numberActiveTouches;
gestureState.moveX = currentCentroidXOfTouchesChangedAfter2(touchHistory2, gestureState._accountsForMovesUpTo);
gestureState.moveY = currentCentroidYOfTouchesChangedAfter2(touchHistory2, gestureState._accountsForMovesUpTo);
var movedAfter = gestureState._accountsForMovesUpTo;
var prevX = previousCentroidXOfTouchesChangedAfter2(touchHistory2, movedAfter);
var x = currentCentroidXOfTouchesChangedAfter2(touchHistory2, movedAfter);
var prevY = previousCentroidYOfTouchesChangedAfter2(touchHistory2, movedAfter);
var y = currentCentroidYOfTouchesChangedAfter2(touchHistory2, movedAfter);
var nextDX = gestureState.dx + (x - prevX);
var nextDY = gestureState.dy + (y - prevY);
var dt = touchHistory2.mostRecentTimeStamp - gestureState._accountsForMovesUpTo;
gestureState.vx = (nextDX - gestureState.dx) / dt;
gestureState.vy = (nextDY - gestureState.dy) / dt;
gestureState.dx = nextDX;
gestureState.dy = nextDY;
gestureState._accountsForMovesUpTo = touchHistory2.mostRecentTimeStamp;
},
create: function create4(config) {
var interactionState = {
handle: null,
shouldCancelClick: false,
timeout: null
};
var gestureState = {
stateID: Math.random(),
moveX: 0,
moveY: 0,
x0: 0,
y0: 0,
dx: 0,
dy: 0,
vx: 0,
vy: 0,
numberActiveTouches: 0,
_accountsForMovesUpTo: 0
};
var panHandlers = {
onStartShouldSetResponder: function onStartShouldSetResponder(event3) {
return config.onStartShouldSetPanResponder == null ? false : config.onStartShouldSetPanResponder(event3, gestureState);
},
onMoveShouldSetResponder: function onMoveShouldSetResponder(event3) {
return config.onMoveShouldSetPanResponder == null ? false : config.onMoveShouldSetPanResponder(event3, gestureState);
},
onStartShouldSetResponderCapture: function onStartShouldSetResponderCapture(event3) {
if (event3.nativeEvent.touches.length === 1) {
PanResponder._initializeGestureState(gestureState);
}
gestureState.numberActiveTouches = event3.touchHistory.numberActiveTouches;
return config.onStartShouldSetPanResponderCapture != null ? config.onStartShouldSetPanResponderCapture(event3, gestureState) : false;
},
onMoveShouldSetResponderCapture: function onMoveShouldSetResponderCapture(event3) {
var touchHistory2 = event3.touchHistory;
PanResponder._updateGestureStateOnMove(gestureState, touchHistory2);
return config.onMoveShouldSetPanResponderCapture ? config.onMoveShouldSetPanResponderCapture(event3, gestureState) : false;
},
onResponderGrant: function onResponderGrant(event3) {
if (!interactionState.handle) {
interactionState.handle = InteractionManager.createInteractionHandle();
}
if (interactionState.timeout) {
clearInteractionTimeout(interactionState);
}
interactionState.shouldCancelClick = true;
gestureState.x0 = currentCentroidX2(event3.touchHistory);
gestureState.y0 = currentCentroidY2(event3.touchHistory);
gestureState.dx = 0;
gestureState.dy = 0;
if (config.onPanResponderGrant) {
config.onPanResponderGrant(event3, gestureState);
}
return config.onShouldBlockNativeResponder == null ? true : config.onShouldBlockNativeResponder(event3, gestureState);
},
onResponderReject: function onResponderReject(event3) {
clearInteractionHandle2(interactionState, config.onPanResponderReject, event3, gestureState);
},
onResponderRelease: function onResponderRelease(event3) {
clearInteractionHandle2(interactionState, config.onPanResponderRelease, event3, gestureState);
setInteractionTimeout(interactionState);
PanResponder._initializeGestureState(gestureState);
},
onResponderStart: function onResponderStart(event3) {
var touchHistory2 = event3.touchHistory;
gestureState.numberActiveTouches = touchHistory2.numberActiveTouches;
if (config.onPanResponderStart) {
config.onPanResponderStart(event3, gestureState);
}
},
onResponderMove: function onResponderMove(event3) {
var touchHistory2 = event3.touchHistory;
PanResponder._updateGestureStateOnMove(gestureState, touchHistory2);
if (config.onPanResponderMove) {
config.onPanResponderMove(event3, gestureState);
}
},
onResponderEnd: function onResponderEnd(event3) {
var touchHistory2 = event3.touchHistory;
gestureState.numberActiveTouches = touchHistory2.numberActiveTouches;
clearInteractionHandle2(interactionState, config.onPanResponderEnd, event3, gestureState);
},
onResponderTerminate: function onResponderTerminate(event3) {
clearInteractionHandle2(interactionState, config.onPanResponderTerminate, event3, gestureState);
setInteractionTimeout(interactionState);
PanResponder._initializeGestureState(gestureState);
},
onResponderTerminationRequest: function onResponderTerminationRequest(event3) {
return config.onPanResponderTerminationRequest == null ? true : config.onPanResponderTerminationRequest(event3, gestureState);
},
onClickCapture: function onClickCapture(event3) {
if (interactionState.shouldCancelClick === true) {
event3.stopPropagation();
event3.preventDefault();
}
}
};
return {
panHandlers,
getInteractionHandle: function getInteractionHandle() {
return interactionState.handle;
}
};
}
};
function clearInteractionHandle2(interactionState, callback, event3, gestureState) {
if (interactionState.handle) {
InteractionManager.clearInteractionHandle(interactionState.handle);
interactionState.handle = null;
}
if (callback) {
callback(event3, gestureState);
}
}
function clearInteractionTimeout(interactionState) {
clearTimeout(interactionState.timeout);
}
function setInteractionTimeout(interactionState) {
interactionState.timeout = setTimeout(function() {
interactionState.shouldCancelClick = false;
}, 250);
}
function _defineProperties$1(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor)
descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass$1(Constructor, protoProps, staticProps) {
if (protoProps)
_defineProperties$1(Constructor.prototype, protoProps);
if (staticProps)
_defineProperties$1(Constructor, staticProps);
return Constructor;
}
var Share = /* @__PURE__ */ function() {
function Share2() {
}
Share2.share = function share(content, options) {
if (options === void 0) {
options = {};
}
invariant2(typeof content === "object" && content !== null, "Content to share must be a valid object");
invariant2(typeof content.url === "string" || typeof content.message === "string", "At least one of URL and message is required");
invariant2(typeof options === "object" && options !== null, "Options must be a valid object");
invariant2(!content.title || typeof content.title === "string", "Invalid title: title should be a string.");
if (window.navigator.share !== void 0) {
return window.navigator.share({
title: content.title,
text: content.message,
url: content.url
});
} else {
return Promise.reject(new Error("Share is not supported in this browser"));
}
};
_createClass$1(Share2, null, [{
key: "sharedAction",
get: function get3() {
return "sharedAction";
}
}, {
key: "dismissedAction",
get: function get3() {
return "dismissedAction";
}
}]);
return Share2;
}();
var _vibrate = function vibrate(pattern2) {
if ("vibrate" in window.navigator) {
window.navigator.vibrate(pattern2);
}
};
var Vibration = {
cancel: function cancel() {
_vibrate(0);
},
vibrate: function vibrate2(pattern2) {
if (pattern2 === void 0) {
pattern2 = 400;
}
_vibrate(pattern2);
}
};
function _extends$9() {
_extends$9 = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$9.apply(this, arguments);
}
function _objectWithoutPropertiesLoose$7(source, excluded) {
if (source == null)
return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0)
continue;
target[key] = source[key];
}
return target;
}
var accessibilityValue = {
max: 1,
min: 0
};
var createSvgCircle = function createSvgCircle2(style) {
return /* @__PURE__ */ React__default.createElement("circle", {
cx: "16",
cy: "16",
fill: "none",
r: "14",
strokeWidth: "4",
style
});
};
var ActivityIndicator = /* @__PURE__ */ forwardRef(function(props, forwardedRef) {
var _props$animating = props.animating, animating = _props$animating === void 0 ? true : _props$animating, _props$color = props.color, color = _props$color === void 0 ? "#1976D2" : _props$color, _props$hidesWhenStopp = props.hidesWhenStopped, hidesWhenStopped = _props$hidesWhenStopp === void 0 ? true : _props$hidesWhenStopp, _props$size = props.size, size = _props$size === void 0 ? "small" : _props$size, style = props.style, other = _objectWithoutPropertiesLoose$7(props, ["animating", "color", "hidesWhenStopped", "size", "style"]);
var svg = /* @__PURE__ */ React__default.createElement("svg", {
height: "100%",
viewBox: "0 0 32 32",
width: "100%"
}, createSvgCircle({
stroke: color,
opacity: 0.2
}), createSvgCircle({
stroke: color,
strokeDasharray: 80,
strokeDashoffset: 60
}));
return /* @__PURE__ */ React__default.createElement(View, _extends$9({}, other, {
accessibilityRole: "progressbar",
accessibilityValue,
ref: forwardedRef,
style: [styles$8.container, style]
}), /* @__PURE__ */ React__default.createElement(View, {
children: svg,
style: [typeof size === "number" ? {
height: size,
width: size
} : indicatorSizes[size], styles$8.animation, !animating && styles$8.animationPause, !animating && hidesWhenStopped && styles$8.hidesWhenStopped]
}));
});
ActivityIndicator.displayName = "ActivityIndicator";
var styles$8 = StyleSheet.create({
container: {
alignItems: "center",
justifyContent: "center"
},
hidesWhenStopped: {
visibility: "hidden"
},
animation: {
animationDuration: "0.75s",
animationKeyframes: [{
"0%": {
transform: [{
rotate: "0deg"
}]
},
"100%": {
transform: [{
rotate: "360deg"
}]
}
}],
animationTimingFunction: "linear",
animationIterationCount: "infinite"
},
animationPause: {
animationPlayState: "paused"
}
});
var indicatorSizes = StyleSheet.create({
small: {
width: 20,
height: 20
},
large: {
width: 36,
height: 36
}
});
var DELAY = "DELAY";
var ERROR = "ERROR";
var LONG_PRESS_DETECTED = "LONG_PRESS_DETECTED";
var NOT_RESPONDER = "NOT_RESPONDER";
var RESPONDER_ACTIVE_LONG_PRESS_START = "RESPONDER_ACTIVE_LONG_PRESS_START";
var RESPONDER_ACTIVE_PRESS_START = "RESPONDER_ACTIVE_PRESS_START";
var RESPONDER_INACTIVE_PRESS_START = "RESPONDER_INACTIVE_PRESS_START";
var RESPONDER_GRANT = "RESPONDER_GRANT";
var RESPONDER_RELEASE = "RESPONDER_RELEASE";
var RESPONDER_TERMINATED = "RESPONDER_TERMINATED";
var Transitions = Object.freeze({
NOT_RESPONDER: {
DELAY: ERROR,
RESPONDER_GRANT: RESPONDER_INACTIVE_PRESS_START,
RESPONDER_RELEASE: ERROR,
RESPONDER_TERMINATED: ERROR,
LONG_PRESS_DETECTED: ERROR
},
RESPONDER_INACTIVE_PRESS_START: {
DELAY: RESPONDER_ACTIVE_PRESS_START,
RESPONDER_GRANT: ERROR,
RESPONDER_RELEASE: NOT_RESPONDER,
RESPONDER_TERMINATED: NOT_RESPONDER,
LONG_PRESS_DETECTED: ERROR
},
RESPONDER_ACTIVE_PRESS_START: {
DELAY: ERROR,
RESPONDER_GRANT: ERROR,
RESPONDER_RELEASE: NOT_RESPONDER,
RESPONDER_TERMINATED: NOT_RESPONDER,
LONG_PRESS_DETECTED: RESPONDER_ACTIVE_LONG_PRESS_START
},
RESPONDER_ACTIVE_LONG_PRESS_START: {
DELAY: ERROR,
RESPONDER_GRANT: ERROR,
RESPONDER_RELEASE: NOT_RESPONDER,
RESPONDER_TERMINATED: NOT_RESPONDER,
LONG_PRESS_DETECTED: RESPONDER_ACTIVE_LONG_PRESS_START
},
ERROR: {
DELAY: NOT_RESPONDER,
RESPONDER_GRANT: RESPONDER_INACTIVE_PRESS_START,
RESPONDER_RELEASE: NOT_RESPONDER,
RESPONDER_TERMINATED: NOT_RESPONDER,
LONG_PRESS_DETECTED: NOT_RESPONDER
}
});
var isActiveSignal = function isActiveSignal2(signal) {
return signal === RESPONDER_ACTIVE_PRESS_START || signal === RESPONDER_ACTIVE_LONG_PRESS_START;
};
var isButtonRole = function isButtonRole2(element) {
return element.getAttribute("role") === "button";
};
var isPressStartSignal = function isPressStartSignal2(signal) {
return signal === RESPONDER_INACTIVE_PRESS_START || signal === RESPONDER_ACTIVE_PRESS_START || signal === RESPONDER_ACTIVE_LONG_PRESS_START;
};
var isTerminalSignal = function isTerminalSignal2(signal) {
return signal === RESPONDER_TERMINATED || signal === RESPONDER_RELEASE;
};
var isValidKeyPress = function isValidKeyPress2(event3) {
var key = event3.key;
var target = event3.currentTarget;
var role = target.getAttribute("role");
var isSpacebar = key === " " || key === "Spacebar";
return !event3.repeat && (key === "Enter" || isSpacebar && (role === "button" || role === "menuitem"));
};
var DEFAULT_LONG_PRESS_DELAY_MS = 450;
var DEFAULT_PRESS_DELAY_MS = 50;
var PressResponder = /* @__PURE__ */ function() {
function PressResponder2(config) {
this._eventHandlers = null;
this._isPointerTouch = false;
this._longPressDelayTimeout = null;
this._longPressDispatched = false;
this._pressDelayTimeout = null;
this._pressOutDelayTimeout = null;
this._touchState = NOT_RESPONDER;
this.configure(config);
}
var _proto = PressResponder2.prototype;
_proto.configure = function configure(config) {
this._config = config;
};
_proto.reset = function reset() {
this._cancelLongPressDelayTimeout();
this._cancelPressDelayTimeout();
this._cancelPressOutDelayTimeout();
};
_proto.getEventHandlers = function getEventHandlers() {
if (this._eventHandlers == null) {
this._eventHandlers = this._createEventHandlers();
}
return this._eventHandlers;
};
_proto._createEventHandlers = function _createEventHandlers() {
var _this = this;
var start = function start2(event3, shouldDelay) {
event3.persist();
_this._cancelPressOutDelayTimeout();
_this._longPressDispatched = false;
_this._responder = event3.currentTarget;
_this._selectionTerminated = false;
_this._touchState = NOT_RESPONDER;
_this._isPointerTouch = event3.nativeEvent.type === "touchstart";
_this._receiveSignal(RESPONDER_GRANT, event3);
var delayPressStart = normalizeDelay(_this._config.delayPressStart, 0, DEFAULT_PRESS_DELAY_MS);
if (shouldDelay !== false && delayPressStart > 0) {
_this._pressDelayTimeout = setTimeout(function() {
_this._receiveSignal(DELAY, event3);
}, delayPressStart);
} else {
_this._receiveSignal(DELAY, event3);
}
var delayLongPress = normalizeDelay(_this._config.delayLongPress, 10, DEFAULT_LONG_PRESS_DELAY_MS);
_this._longPressDelayTimeout = setTimeout(function() {
_this._handleLongPress(event3);
}, delayLongPress + delayPressStart);
};
var end = function end2(event3) {
_this._receiveSignal(RESPONDER_RELEASE, event3);
};
var keyupHandler = function keyupHandler2(event3) {
if (_this._touchState !== NOT_RESPONDER) {
end(event3);
document.removeEventListener("keyup", keyupHandler2);
}
};
return {
onStartShouldSetResponder: function onStartShouldSetResponder(event3) {
var disabled = _this._config.disabled;
if (disabled && isButtonRole(event3.currentTarget)) {
event3.stopPropagation();
}
if (disabled == null) {
return true;
}
return !disabled;
},
onKeyDown: function onKeyDown2(event3) {
if (isValidKeyPress(event3)) {
if (_this._touchState === NOT_RESPONDER) {
start(event3, false);
document.addEventListener("keyup", keyupHandler);
}
event3.stopPropagation();
}
},
onResponderGrant: function onResponderGrant(event3) {
return start(event3);
},
onResponderMove: function onResponderMove(event3) {
if (_this._config.onPressMove != null) {
_this._config.onPressMove(event3);
}
var touch = getTouchFromResponderEvent(event3);
if (_this._touchActivatePosition != null) {
var deltaX = _this._touchActivatePosition.pageX - touch.pageX;
var deltaY = _this._touchActivatePosition.pageY - touch.pageY;
if (Math.hypot(deltaX, deltaY) > 10) {
_this._cancelLongPressDelayTimeout();
}
}
},
onResponderRelease: function onResponderRelease(event3) {
return end(event3);
},
onResponderTerminate: function onResponderTerminate(event3) {
if (event3.nativeEvent.type === "selectionchange") {
_this._selectionTerminated = true;
}
_this._receiveSignal(RESPONDER_TERMINATED, event3);
},
onResponderTerminationRequest: function onResponderTerminationRequest(event3) {
var _this$_config = _this._config, cancelable = _this$_config.cancelable, disabled = _this$_config.disabled, onLongPress = _this$_config.onLongPress;
if (!disabled && onLongPress != null && _this._isPointerTouch && event3.nativeEvent.type === "contextmenu") {
return false;
}
if (cancelable == null) {
return true;
}
return cancelable;
},
onClick: function onClick(event3) {
var _this$_config2 = _this._config, disabled = _this$_config2.disabled, onPress = _this$_config2.onPress;
if (!disabled) {
event3.stopPropagation();
if (_this._longPressDispatched || _this._selectionTerminated) {
event3.preventDefault();
} else if (onPress != null && event3.ctrlKey === false && event3.altKey === false) {
onPress(event3);
}
} else {
if (isButtonRole(event3.currentTarget)) {
event3.stopPropagation();
}
}
},
onContextMenu: function onContextMenu(event3) {
var _this$_config3 = _this._config, disabled = _this$_config3.disabled, onLongPress = _this$_config3.onLongPress;
if (!disabled) {
if (onLongPress != null && _this._isPointerTouch && !event3.defaultPrevented) {
event3.preventDefault();
event3.stopPropagation();
}
} else {
if (isButtonRole(event3.currentTarget)) {
event3.stopPropagation();
}
}
}
};
};
_proto._receiveSignal = function _receiveSignal2(signal, event3) {
var prevState = this._touchState;
var nextState = null;
if (Transitions[prevState] != null) {
nextState = Transitions[prevState][signal];
}
if (this._responder == null && signal === RESPONDER_RELEASE) {
return;
}
if (nextState == null || nextState === ERROR) {
console.error("PressResponder: Invalid signal " + signal + " for state " + prevState + " on responder");
} else if (prevState !== nextState) {
this._performTransitionSideEffects(prevState, nextState, signal, event3);
this._touchState = nextState;
}
};
_proto._performTransitionSideEffects = function _performTransitionSideEffects(prevState, nextState, signal, event3) {
if (isTerminalSignal(signal)) {
this._isPointerTouch = false;
this._touchActivatePosition = null;
this._cancelLongPressDelayTimeout();
}
if (isPressStartSignal(prevState) && signal === LONG_PRESS_DETECTED) {
var onLongPress = this._config.onLongPress;
if (onLongPress != null && event3.nativeEvent.key == null) {
onLongPress(event3);
this._longPressDispatched = true;
}
}
var isPrevActive = isActiveSignal(prevState);
var isNextActive = isActiveSignal(nextState);
if (!isPrevActive && isNextActive) {
this._activate(event3);
} else if (isPrevActive && !isNextActive) {
this._deactivate(event3);
}
if (isPressStartSignal(prevState) && signal === RESPONDER_RELEASE) {
var _this$_config4 = this._config, _onLongPress = _this$_config4.onLongPress, onPress = _this$_config4.onPress;
if (onPress != null) {
var isPressCanceledByLongPress = _onLongPress != null && prevState === RESPONDER_ACTIVE_LONG_PRESS_START;
if (!isPressCanceledByLongPress) {
if (!isNextActive && !isPrevActive) {
this._activate(event3);
this._deactivate(event3);
}
}
}
}
this._cancelPressDelayTimeout();
};
_proto._activate = function _activate(event3) {
var _this$_config5 = this._config, onPressChange = _this$_config5.onPressChange, onPressStart = _this$_config5.onPressStart;
var touch = getTouchFromResponderEvent(event3);
this._touchActivatePosition = {
pageX: touch.pageX,
pageY: touch.pageY
};
if (onPressStart != null) {
onPressStart(event3);
}
if (onPressChange != null) {
onPressChange(true);
}
};
_proto._deactivate = function _deactivate(event3) {
var _this$_config6 = this._config, onPressChange = _this$_config6.onPressChange, onPressEnd = _this$_config6.onPressEnd;
function end() {
if (onPressEnd != null) {
onPressEnd(event3);
}
if (onPressChange != null) {
onPressChange(false);
}
}
var delayPressEnd = normalizeDelay(this._config.delayPressEnd);
if (delayPressEnd > 0) {
this._pressOutDelayTimeout = setTimeout(function() {
end();
}, delayPressEnd);
} else {
end();
}
};
_proto._handleLongPress = function _handleLongPress(event3) {
if (this._touchState === RESPONDER_ACTIVE_PRESS_START || this._touchState === RESPONDER_ACTIVE_LONG_PRESS_START) {
this._receiveSignal(LONG_PRESS_DETECTED, event3);
}
};
_proto._cancelLongPressDelayTimeout = function _cancelLongPressDelayTimeout2() {
if (this._longPressDelayTimeout != null) {
clearTimeout(this._longPressDelayTimeout);
this._longPressDelayTimeout = null;
}
};
_proto._cancelPressDelayTimeout = function _cancelPressDelayTimeout() {
if (this._pressDelayTimeout != null) {
clearTimeout(this._pressDelayTimeout);
this._pressDelayTimeout = null;
}
};
_proto._cancelPressOutDelayTimeout = function _cancelPressOutDelayTimeout() {
if (this._pressOutDelayTimeout != null) {
clearTimeout(this._pressOutDelayTimeout);
this._pressOutDelayTimeout = null;
}
};
return PressResponder2;
}();
function normalizeDelay(delay3, min, fallback) {
if (min === void 0) {
min = 0;
}
if (fallback === void 0) {
fallback = 0;
}
return Math.max(min, delay3 !== null && delay3 !== void 0 ? delay3 : fallback);
}
function getTouchFromResponderEvent(event3) {
var _event$nativeEvent = event3.nativeEvent, changedTouches = _event$nativeEvent.changedTouches, touches = _event$nativeEvent.touches;
if (touches != null && touches.length > 0) {
return touches[0];
}
if (changedTouches != null && changedTouches.length > 0) {
return changedTouches[0];
}
return event3.nativeEvent;
}
function usePressEvents(hostRef, config) {
var pressResponderRef = useRef(null);
if (pressResponderRef.current == null) {
pressResponderRef.current = new PressResponder(config);
}
var pressResponder = pressResponderRef.current;
useEffect(function() {
pressResponder.configure(config);
}, [config, pressResponder]);
useEffect(function() {
return function() {
pressResponder.reset();
};
}, [pressResponder]);
useDebugValue(config);
return pressResponder.getEventHandlers();
}
function _extends$a() {
_extends$a = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$a.apply(this, arguments);
}
function _objectWithoutPropertiesLoose$8(source, excluded) {
if (source == null)
return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0)
continue;
target[key] = source[key];
}
return target;
}
function TouchableOpacity(props, forwardedRef) {
var activeOpacity = props.activeOpacity, delayPressIn = props.delayPressIn, delayPressOut = props.delayPressOut, delayLongPress = props.delayLongPress, disabled = props.disabled, focusable = props.focusable, onLongPress = props.onLongPress, onPress = props.onPress, onPressIn = props.onPressIn, onPressOut = props.onPressOut, rejectResponderTermination = props.rejectResponderTermination, style = props.style, rest = _objectWithoutPropertiesLoose$8(props, ["activeOpacity", "delayPressIn", "delayPressOut", "delayLongPress", "disabled", "focusable", "onLongPress", "onPress", "onPressIn", "onPressOut", "rejectResponderTermination", "style"]);
var hostRef = useRef(null);
var setRef = useMergeRefs(forwardedRef, hostRef);
var _useState = useState("0s"), duration = _useState[0], setDuration = _useState[1];
var _useState2 = useState(null), opacityOverride = _useState2[0], setOpacityOverride = _useState2[1];
var setOpacityTo = useCallback(function(value, duration2) {
setOpacityOverride(value);
setDuration(duration2 ? duration2 / 1e3 + "s" : "0s");
}, [setOpacityOverride, setDuration]);
var setOpacityActive = useCallback(function(duration2) {
setOpacityTo(activeOpacity !== null && activeOpacity !== void 0 ? activeOpacity : 0.2, duration2);
}, [activeOpacity, setOpacityTo]);
var setOpacityInactive = useCallback(function(duration2) {
setOpacityTo(null, duration2);
}, [setOpacityTo]);
var pressConfig = useMemo(function() {
return {
cancelable: !rejectResponderTermination,
disabled,
delayLongPress,
delayPressStart: delayPressIn,
delayPressEnd: delayPressOut,
onLongPress,
onPress,
onPressStart: function onPressStart(event3) {
var isGrant = event3.dispatchConfig != null ? event3.dispatchConfig.registrationName === "onResponderGrant" : event3.type === "keydown";
setOpacityActive(isGrant ? 0 : 150);
if (onPressIn != null) {
onPressIn(event3);
}
},
onPressEnd: function onPressEnd(event3) {
setOpacityInactive(250);
if (onPressOut != null) {
onPressOut(event3);
}
}
};
}, [delayLongPress, delayPressIn, delayPressOut, disabled, onLongPress, onPress, onPressIn, onPressOut, rejectResponderTermination, setOpacityActive, setOpacityInactive]);
var pressEventHandlers = usePressEvents(hostRef, pressConfig);
return /* @__PURE__ */ createElement$1(View, _extends$a({}, rest, pressEventHandlers, {
accessibilityDisabled: disabled,
focusable: !disabled && focusable !== false,
ref: setRef,
style: [styles$9.root, !disabled && styles$9.actionable, style, opacityOverride != null && {
opacity: opacityOverride
}, {
transitionDuration: duration
}]
}));
}
var styles$9 = StyleSheet.create({
root: {
transitionProperty: "opacity",
transitionDuration: "0.15s",
userSelect: "none"
},
actionable: {
cursor: "pointer",
touchAction: "manipulation"
}
});
var MemoedTouchableOpacity = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef(TouchableOpacity));
MemoedTouchableOpacity.displayName = "TouchableOpacity";
var Button = /* @__PURE__ */ forwardRef(function(props, forwardedRef) {
var accessibilityLabel = props.accessibilityLabel, color = props.color, disabled = props.disabled, onPress = props.onPress, testID = props.testID, title = props.title;
return /* @__PURE__ */ createElement$1(MemoedTouchableOpacity, {
accessibilityLabel,
accessibilityRole: "button",
disabled,
focusable: !disabled,
onPress,
ref: forwardedRef,
style: [styles$a.button, color && {
backgroundColor: color
}, disabled && styles$a.buttonDisabled],
testID
}, /* @__PURE__ */ createElement$1(Text, {
style: [styles$a.text, disabled && styles$a.textDisabled]
}, title));
});
Button.displayName = "Button";
var styles$a = StyleSheet.create({
button: {
backgroundColor: "#2196F3",
borderRadius: 2
},
text: {
color: "#fff",
fontWeight: "500",
padding: 8,
textAlign: "center",
textTransform: "uppercase"
},
buttonDisabled: {
backgroundColor: "#dfdfdf"
},
textDisabled: {
color: "#a1a1a1"
}
});
function ownKeys$i(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$i(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys$i(Object(source), true).forEach(function(key) {
_defineProperty$i(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys$i(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _defineProperty$i(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {value, enumerable: true, configurable: true, writable: true});
} else {
obj[key] = value;
}
return obj;
}
function _extends$b() {
_extends$b = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$b.apply(this, arguments);
}
function _objectWithoutPropertiesLoose$9(source, excluded) {
if (source == null)
return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0)
continue;
target[key] = source[key];
}
return target;
}
var CheckBox = /* @__PURE__ */ forwardRef(function(props, forwardedRef) {
var color = props.color, disabled = props.disabled, onChange = props.onChange, onValueChange = props.onValueChange, style = props.style, value = props.value, other = _objectWithoutPropertiesLoose$9(props, ["color", "disabled", "onChange", "onValueChange", "style", "value"]);
function handleChange(event3) {
var value2 = event3.nativeEvent.target.checked;
event3.nativeEvent.value = value2;
onChange && onChange(event3);
onValueChange && onValueChange(value2);
}
var fakeControl = /* @__PURE__ */ createElement$1(View, {
style: [
styles$b.fakeControl,
value && styles$b.fakeControlChecked,
value && color && {
backgroundColor: color,
borderColor: color
},
disabled && styles$b.fakeControlDisabled,
value && disabled && styles$b.fakeControlCheckedAndDisabled
]
});
var nativeControl = createElement("input", {
checked: value,
disabled,
onChange: handleChange,
ref: forwardedRef,
style: [styles$b.nativeControl, styles$b.cursorInherit],
type: "checkbox"
});
return /* @__PURE__ */ createElement$1(View, _extends$b({}, other, {
accessibilityDisabled: disabled,
style: [styles$b.root, style, disabled && styles$b.cursorDefault]
}), fakeControl, nativeControl);
});
CheckBox.displayName = "CheckBox";
var styles$b = StyleSheet.create({
root: {
cursor: "pointer",
height: 16,
userSelect: "none",
width: 16
},
cursorDefault: {
cursor: "default"
},
cursorInherit: {
cursor: "inherit"
},
fakeControl: {
alignItems: "center",
backgroundColor: "#fff",
borderColor: "#657786",
borderRadius: 2,
borderStyle: "solid",
borderWidth: 2,
height: "100%",
justifyContent: "center",
width: "100%"
},
fakeControlChecked: {
backgroundColor: "#009688",
backgroundImage: 'url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgdmVyc2lvbj0iMS4xIgogICB2aWV3Qm94PSIwIDAgMSAxIgogICBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWluWU1pbiBtZWV0Ij4KICA8cGF0aAogICAgIGQ9Ik0gMC4wNDAzODA1OSwwLjYyNjc3NjcgMC4xNDY0NDY2MSwwLjUyMDcxMDY4IDAuNDI5Mjg5MzIsMC44MDM1NTMzOSAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IE0gMC4yMTcxNTcyOSwwLjgwMzU1MzM5IDAuODUzNTUzMzksMC4xNjcxNTcyOSAwLjk1OTYxOTQxLDAuMjczMjIzMyAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IgogICAgIGlkPSJyZWN0Mzc4MCIKICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lIiAvPgo8L3N2Zz4K")',
backgroundRepeat: "no-repeat",
borderColor: "#009688"
},
fakeControlDisabled: {
borderColor: "#CCD6DD"
},
fakeControlCheckedAndDisabled: {
backgroundColor: "#AAB8C2",
borderColor: "#AAB8C2"
},
nativeControl: _objectSpread$i(_objectSpread$i({}, StyleSheet.absoluteFillObject), {}, {
height: "100%",
margin: 0,
opacity: 0,
padding: 0,
width: "100%"
})
});
function _extends$c() {
_extends$c = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$c.apply(this, arguments);
}
function _objectWithoutPropertiesLoose$a(source, excluded) {
if (source == null)
return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0)
continue;
target[key] = source[key];
}
return target;
}
var emptyObject$c = {};
var ImageBackground = /* @__PURE__ */ forwardRef(function(props, forwardedRef) {
var children = props.children, _props$style = props.style, style = _props$style === void 0 ? emptyObject$c : _props$style, imageStyle = props.imageStyle, imageRef = props.imageRef, rest = _objectWithoutPropertiesLoose$a(props, ["children", "style", "imageStyle", "imageRef"]);
var _StyleSheet$flatten = StyleSheet.flatten(style), height = _StyleSheet$flatten.height, width = _StyleSheet$flatten.width;
return /* @__PURE__ */ createElement$1(View, {
ref: forwardedRef,
style
}, /* @__PURE__ */ createElement$1(Image, _extends$c({}, rest, {
ref: imageRef,
style: [StyleSheet.absoluteFill, {
width,
height,
zIndex: -1
}, imageStyle]
})), children);
});
ImageBackground.displayName = "ImageBackground";
function _extends$d() {
_extends$d = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$d.apply(this, arguments);
}
function _objectWithoutPropertiesLoose$b(source, excluded) {
if (source == null)
return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0)
continue;
target[key] = source[key];
}
return target;
}
function _inheritsLoose$p(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$p(subClass, superClass);
}
function _setPrototypeOf$p(o, p) {
_setPrototypeOf$p = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$p(o, p);
}
var KeyboardAvoidingView = /* @__PURE__ */ function(_React$Component) {
_inheritsLoose$p(KeyboardAvoidingView2, _React$Component);
function KeyboardAvoidingView2() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
_this.frame = null;
_this.onLayout = function(event3) {
_this.frame = event3.nativeEvent.layout;
};
return _this;
}
var _proto = KeyboardAvoidingView2.prototype;
_proto.relativeKeyboardHeight = function relativeKeyboardHeight(keyboardFrame) {
var frame = this.frame;
if (!frame || !keyboardFrame) {
return 0;
}
var keyboardY = keyboardFrame.screenY - (this.props.keyboardVerticalOffset || 0);
return Math.max(frame.y + frame.height - keyboardY, 0);
};
_proto.onKeyboardChange = function onKeyboardChange(event3) {
};
_proto.render = function render3() {
var _this$props = this.props, behavior = _this$props.behavior, contentContainerStyle = _this$props.contentContainerStyle, keyboardVerticalOffset = _this$props.keyboardVerticalOffset, rest = _objectWithoutPropertiesLoose$b(_this$props, ["behavior", "contentContainerStyle", "keyboardVerticalOffset"]);
return /* @__PURE__ */ React__default.createElement(View, _extends$d({
onLayout: this.onLayout
}, rest));
};
return KeyboardAvoidingView2;
}(React__default.Component);
function ModalPortal(props) {
var children = props.children;
var elementRef = useRef(null);
if (canUseDOM && !elementRef.current) {
var element = document.createElement("div");
if (element && document.body) {
document.body.appendChild(element);
elementRef.current = element;
}
}
useEffect(function() {
if (canUseDOM) {
return function() {
if (document.body && elementRef.current) {
document.body.removeChild(elementRef.current);
elementRef.current = null;
}
};
}
}, []);
return elementRef.current && canUseDOM ? /* @__PURE__ */ ReactDOM.createPortal(children, elementRef.current) : null;
}
var ANIMATION_DURATION = 300;
function getAnimationStyle(animationType, visible) {
if (animationType === "slide") {
return visible ? animatedSlideInStyles : animatedSlideOutStyles;
}
if (animationType === "fade") {
return visible ? animatedFadeInStyles : animatedFadeOutStyles;
}
return visible ? styles$c.container : styles$c.hidden;
}
function ModalAnimation(props) {
var animationType = props.animationType, children = props.children, onDismiss = props.onDismiss, onShow = props.onShow, visible = props.visible;
var _useState = useState(false), isRendering = _useState[0], setIsRendering = _useState[1];
var wasVisible = useRef(false);
var isAnimated = animationType && animationType !== "none";
var animationEndCallback = useCallback(function(e) {
if (e && e.currentTarget !== e.target) {
return;
}
if (visible) {
if (onShow) {
onShow();
}
} else {
setIsRendering(false);
if (onDismiss) {
onDismiss();
}
}
}, [onDismiss, onShow, visible]);
useEffect(function() {
if (visible) {
setIsRendering(true);
}
if (visible !== wasVisible.current && !isAnimated) {
animationEndCallback();
}
wasVisible.current = visible;
}, [isAnimated, visible, animationEndCallback]);
return isRendering || visible ? createElement("div", {
style: isRendering ? getAnimationStyle(animationType, visible) : styles$c.hidden,
onAnimationEnd: animationEndCallback,
children
}) : null;
}
var styles$c = StyleSheet.create({
container: {
position: "fixed",
top: 0,
right: 0,
bottom: 0,
left: 0,
zIndex: 9999
},
animatedIn: {
animationDuration: ANIMATION_DURATION + "ms",
animationTimingFunction: "ease-in"
},
animatedOut: {
pointerEvents: "none",
animationDuration: ANIMATION_DURATION + "ms",
animationTimingFunction: "ease-out"
},
fadeIn: {
opacity: 1,
animationKeyframes: {
"0%": {
opacity: 0
},
"100%": {
opacity: 1
}
}
},
fadeOut: {
opacity: 0,
animationKeyframes: {
"0%": {
opacity: 1
},
"100%": {
opacity: 0
}
}
},
slideIn: {
transform: [{
translateY: "0%"
}],
animationKeyframes: {
"0%": {
transform: [{
translateY: "100%"
}]
},
"100%": {
transform: [{
translateY: "0%"
}]
}
}
},
slideOut: {
transform: [{
translateY: "100%"
}],
animationKeyframes: {
"0%": {
transform: [{
translateY: "0%"
}]
},
"100%": {
transform: [{
translateY: "100%"
}]
}
}
},
hidden: {
opacity: 0
}
});
var animatedSlideInStyles = [styles$c.container, styles$c.animatedIn, styles$c.slideIn];
var animatedSlideOutStyles = [styles$c.container, styles$c.animatedOut, styles$c.slideOut];
var animatedFadeInStyles = [styles$c.container, styles$c.animatedIn, styles$c.fadeIn];
var animatedFadeOutStyles = [styles$c.container, styles$c.animatedOut, styles$c.fadeOut];
var ModalContent = /* @__PURE__ */ forwardRef(function(props, forwardedRef) {
var active = props.active, children = props.children, onRequestClose = props.onRequestClose, transparent = props.transparent;
useEffect(function() {
if (canUseDOM) {
var closeOnEscape = function closeOnEscape2(e) {
if (active && e.key === "Escape") {
e.stopPropagation();
if (onRequestClose) {
onRequestClose();
}
}
};
document.addEventListener("keyup", closeOnEscape, false);
return function() {
return document.removeEventListener("keyup", closeOnEscape, false);
};
}
}, [active, onRequestClose]);
var style = useMemo(function() {
return [styles$d.modal, transparent ? styles$d.modalTransparent : styles$d.modalOpaque];
}, [transparent]);
return /* @__PURE__ */ React__default.createElement(View, {
accessibilityRole: active ? "dialog" : null,
"aria-modal": true,
ref: forwardedRef,
style
}, /* @__PURE__ */ React__default.createElement(View, {
style: styles$d.container
}, children));
});
var styles$d = StyleSheet.create({
modal: {
position: "fixed",
top: 0,
right: 0,
bottom: 0,
left: 0
},
modalTransparent: {
backgroundColor: "transparent"
},
modalOpaque: {
backgroundColor: "white"
},
container: {
top: 0,
flex: 1
}
});
var FocusBracket = function FocusBracket2() {
return createElement("div", {
accessibilityRole: "none",
tabIndex: 0,
style: styles$e.focusBracket
});
};
function attemptFocus(element) {
if (!canUseDOM) {
return false;
}
try {
element.focus();
} catch (e) {
}
return document.activeElement === element;
}
function focusFirstDescendant(element) {
for (var i = 0; i < element.childNodes.length; i++) {
var child = element.childNodes[i];
if (attemptFocus(child) || focusFirstDescendant(child)) {
return true;
}
}
return false;
}
function focusLastDescendant(element) {
for (var i = element.childNodes.length - 1; i >= 0; i--) {
var child = element.childNodes[i];
if (attemptFocus(child) || focusLastDescendant(child)) {
return true;
}
}
return false;
}
var ModalFocusTrap = function ModalFocusTrap2(_ref) {
var active = _ref.active, children = _ref.children;
var trapElementRef = useRef();
var focusRef = useRef({
trapFocusInProgress: false,
lastFocusedElement: null
});
useEffect(function() {
if (canUseDOM) {
var trapFocus = function trapFocus2() {
if (trapElementRef.current == null || focusRef.current.trapFocusInProgress || !active) {
return;
}
try {
focusRef.current.trapFocusInProgress = true;
if (document.activeElement instanceof Node && !trapElementRef.current.contains(document.activeElement)) {
var hasFocused = focusFirstDescendant(trapElementRef.current);
if (focusRef.current.lastFocusedElement === document.activeElement) {
hasFocused = focusLastDescendant(trapElementRef.current);
}
if (!hasFocused && trapElementRef.current != null && document.activeElement) {
UIManager.focus(trapElementRef.current);
}
}
} finally {
focusRef.current.trapFocusInProgress = false;
}
focusRef.current.lastFocusedElement = document.activeElement;
};
trapFocus();
document.addEventListener("focus", trapFocus, true);
return function() {
return document.removeEventListener("focus", trapFocus, true);
};
}
}, [active]);
useEffect(function() {
if (canUseDOM) {
var lastFocusedElementOutsideTrap = document.activeElement;
return function() {
if (lastFocusedElementOutsideTrap && document.contains(lastFocusedElementOutsideTrap)) {
UIManager.focus(lastFocusedElementOutsideTrap);
}
};
}
}, []);
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(FocusBracket, null), /* @__PURE__ */ React__default.createElement(View, {
ref: trapElementRef
}, children), /* @__PURE__ */ React__default.createElement(FocusBracket, null));
};
var styles$e = StyleSheet.create({
focusBracket: {
outlineStyle: "none"
}
});
var uniqueModalIdentifier = 0;
var activeModalStack = [];
var activeModalListeners = {};
function notifyActiveModalListeners() {
if (activeModalStack.length === 0) {
return;
}
var activeModalId = activeModalStack[activeModalStack.length - 1];
activeModalStack.forEach(function(modalId) {
if (modalId in activeModalListeners) {
activeModalListeners[modalId](modalId === activeModalId);
}
});
}
function removeActiveModal(modalId) {
if (modalId in activeModalListeners) {
activeModalListeners[modalId](false);
delete activeModalListeners[modalId];
}
var index2 = activeModalStack.indexOf(modalId);
if (index2 !== -1) {
activeModalStack.splice(index2, 1);
notifyActiveModalListeners();
}
}
function addActiveModal(modalId, listener) {
removeActiveModal(modalId);
activeModalStack.push(modalId);
activeModalListeners[modalId] = listener;
notifyActiveModalListeners();
}
var Modal = /* @__PURE__ */ forwardRef(function(props, forwardedRef) {
var animationType = props.animationType, children = props.children, onDismiss = props.onDismiss, onRequestClose = props.onRequestClose, onShow = props.onShow, transparent = props.transparent, _props$visible = props.visible, visible = _props$visible === void 0 ? true : _props$visible;
var modalId = useMemo(function() {
return uniqueModalIdentifier++;
}, []);
var _useState = useState(false), isActive = _useState[0], setIsActive = _useState[1];
var onDismissCallback = useCallback(function() {
removeActiveModal(modalId);
if (onDismiss) {
onDismiss();
}
}, [modalId, onDismiss]);
var onShowCallback = useCallback(function() {
addActiveModal(modalId, setIsActive);
if (onShow) {
onShow();
}
}, [modalId, onShow]);
useEffect(function() {
return function() {
return removeActiveModal(modalId);
};
}, [modalId]);
return /* @__PURE__ */ React__default.createElement(ModalPortal, null, /* @__PURE__ */ React__default.createElement(ModalAnimation, {
animationType,
onDismiss: onDismissCallback,
onShow: onShowCallback,
visible
}, /* @__PURE__ */ React__default.createElement(ModalFocusTrap, {
active: isActive
}, /* @__PURE__ */ React__default.createElement(ModalContent, {
active: isActive,
onRequestClose,
ref: forwardedRef,
transparent
}, children))));
});
function PickerItem(props) {
var color = props.color, label = props.label, testID = props.testID, value = props.value;
var style = {
color
};
return createElement("option", {
style,
testID,
value
}, label);
}
function ownKeys$j(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$j(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys$j(Object(source), true).forEach(function(key) {
_defineProperty$j(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys$j(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _defineProperty$j(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {value, enumerable: true, configurable: true, writable: true});
} else {
obj[key] = value;
}
return obj;
}
function _objectWithoutPropertiesLoose$c(source, excluded) {
if (source == null)
return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0)
continue;
target[key] = source[key];
}
return target;
}
var Picker = /* @__PURE__ */ forwardRef(function(props, forwardedRef) {
var children = props.children, enabled = props.enabled, onValueChange = props.onValueChange, selectedValue = props.selectedValue, style = props.style, testID = props.testID, itemStyle = props.itemStyle, mode = props.mode, prompt = props.prompt, other = _objectWithoutPropertiesLoose$c(props, ["children", "enabled", "onValueChange", "selectedValue", "style", "testID", "itemStyle", "mode", "prompt"]);
var hostRef = useRef(null);
function handleChange(e) {
var _e$target = e.target, selectedIndex = _e$target.selectedIndex, value = _e$target.value;
if (onValueChange) {
onValueChange(value, selectedIndex);
}
}
var supportedProps = _objectSpread$j({
children,
disabled: enabled === false ? true : void 0,
onChange: handleChange,
style: [styles$f.initial, style],
testID,
value: selectedValue
}, other);
var platformMethodsRef = usePlatformMethods(supportedProps);
var setRef = useMergeRefs(hostRef, platformMethodsRef, forwardedRef);
supportedProps.ref = setRef;
return createElement("select", supportedProps);
});
Picker.Item = PickerItem;
var styles$f = StyleSheet.create({
initial: {
fontFamily: "System",
fontSize: "inherit",
margin: 0
}
});
var emptyFunction$2 = function emptyFunction3() {
};
function supportsPassiveEvents() {
var supported = false;
if (canUseDOM) {
try {
var options = {};
Object.defineProperty(options, "passive", {
get: function get3() {
supported = true;
return false;
}
});
window.addEventListener("test", null, options);
window.removeEventListener("test", null, options);
} catch (e) {
}
}
return supported;
}
var canUsePassiveEvents = supportsPassiveEvents();
function getOptions(options) {
if (options == null) {
return false;
}
return canUsePassiveEvents ? options : Boolean(options.capture);
}
function isPropagationStopped() {
return this.cancelBubble;
}
function isDefaultPrevented() {
return this.defaultPrevented;
}
function normalizeEvent(event3) {
event3.nativeEvent = event3;
event3.persist = emptyFunction$2;
event3.isDefaultPrevented = isDefaultPrevented;
event3.isPropagationStopped = isPropagationStopped;
return event3;
}
function createEventHandle(type, options) {
var opts2 = getOptions(options);
return function(target, listener) {
if (target == null || typeof target.addEventListener !== "function") {
throw new Error("createEventHandle: called on an invalid target.");
}
var element = target;
if (listener != null) {
var compatListener = function compatListener2(e) {
return listener(normalizeEvent(e));
};
element.addEventListener(type, compatListener, opts2);
return function removeListener2() {
if (element != null) {
element.removeEventListener(type, compatListener, opts2);
}
};
} else {
return emptyFunction$2;
}
};
}
var supportsPointerEvent = function supportsPointerEvent2() {
return typeof window !== "undefined" && window.PointerEvent != null;
};
var activeModality = "keyboard";
var modality$1 = "keyboard";
var previousModality;
var previousActiveModality;
var isEmulatingMouseEvents$1 = false;
var listeners$2 = new Set();
var KEYBOARD = "keyboard";
var MOUSE = "mouse";
var TOUCH = "touch";
var BLUR = "blur";
var CONTEXTMENU = "contextmenu";
var FOCUS = "focus";
var KEYDOWN = "keydown";
var MOUSEDOWN = "mousedown";
var MOUSEMOVE = "mousemove";
var MOUSEUP = "mouseup";
var POINTERDOWN = "pointerdown";
var POINTERMOVE = "pointermove";
var SCROLL$1 = "scroll";
var SELECTIONCHANGE = "selectionchange";
var TOUCHCANCEL = "touchcancel";
var TOUCHMOVE = "touchmove";
var TOUCHSTART = "touchstart";
var VISIBILITYCHANGE = "visibilitychange";
var bubbleOptions = {
passive: true
};
var captureOptions = {
capture: true,
passive: true
};
var addBlurListener = createEventHandle(BLUR, bubbleOptions);
var addFocusListener = createEventHandle(FOCUS, bubbleOptions);
var addVisibilityChangeListener = createEventHandle(VISIBILITYCHANGE, captureOptions);
var addKeyDownListener = createEventHandle(KEYDOWN, captureOptions);
var addPointerDownListener = createEventHandle(POINTERDOWN, captureOptions);
var addPointerMoveListener = createEventHandle(POINTERMOVE, captureOptions);
var addContextMenuListener = createEventHandle(CONTEXTMENU, captureOptions);
var addMouseDownListener = createEventHandle(MOUSEDOWN, captureOptions);
var addMouseMoveListener = createEventHandle(MOUSEMOVE, captureOptions);
var addMouseUpListener = createEventHandle(MOUSEUP, captureOptions);
var addScrollListener = createEventHandle(SCROLL$1, captureOptions);
var addSelectiomChangeListener = createEventHandle(SELECTIONCHANGE, captureOptions);
var addTouchCancelListener = createEventHandle(TOUCHCANCEL, captureOptions);
var addTouchMoveListener = createEventHandle(TOUCHMOVE, captureOptions);
var addTouchStartListener = createEventHandle(TOUCHSTART, captureOptions);
function restoreModality() {
if (previousModality != null || previousActiveModality != null) {
if (previousModality != null) {
modality$1 = previousModality;
previousModality = null;
}
if (previousActiveModality != null) {
activeModality = previousActiveModality;
previousActiveModality = null;
}
callListeners();
}
}
function onBlurWindow() {
previousModality = modality$1;
previousActiveModality = activeModality;
activeModality = KEYBOARD;
modality$1 = KEYBOARD;
callListeners();
isEmulatingMouseEvents$1 = false;
}
function onFocusWindow() {
restoreModality();
}
function onKeyDown(event3) {
if (event3.metaKey || event3.altKey || event3.ctrlKey) {
return;
}
if (modality$1 !== KEYBOARD) {
modality$1 = KEYBOARD;
activeModality = KEYBOARD;
callListeners();
}
}
function onVisibilityChange() {
if (document.visibilityState !== "hidden") {
restoreModality();
}
}
function onPointerish(event3) {
var eventType = event3.type;
if (supportsPointerEvent()) {
if (eventType === POINTERDOWN) {
if (activeModality !== event3.pointerType) {
modality$1 = event3.pointerType;
activeModality = event3.pointerType;
callListeners();
}
return;
}
if (eventType === POINTERMOVE) {
if (modality$1 !== event3.pointerType) {
modality$1 = event3.pointerType;
callListeners();
}
return;
}
} else {
if (!isEmulatingMouseEvents$1) {
if (eventType === MOUSEDOWN) {
if (activeModality !== MOUSE) {
modality$1 = MOUSE;
activeModality = MOUSE;
callListeners();
}
}
if (eventType === MOUSEMOVE) {
if (modality$1 !== MOUSE) {
modality$1 = MOUSE;
callListeners();
}
}
}
if (eventType === TOUCHSTART) {
isEmulatingMouseEvents$1 = true;
if (event3.touches && event3.touches.length > 1) {
isEmulatingMouseEvents$1 = false;
}
if (activeModality !== TOUCH) {
modality$1 = TOUCH;
activeModality = TOUCH;
callListeners();
}
return;
}
if (eventType === CONTEXTMENU || eventType === MOUSEUP || eventType === SELECTIONCHANGE || eventType === SCROLL$1 || eventType === TOUCHCANCEL || eventType === TOUCHMOVE) {
isEmulatingMouseEvents$1 = false;
}
}
}
if (canUseDOM) {
addBlurListener(window, onBlurWindow);
addFocusListener(window, onFocusWindow);
addKeyDownListener(document, onKeyDown);
addPointerDownListener(document, onPointerish);
addPointerMoveListener(document, onPointerish);
addVisibilityChangeListener(document, onVisibilityChange);
addContextMenuListener(document, onPointerish);
addMouseDownListener(document, onPointerish);
addMouseMoveListener(document, onPointerish);
addMouseUpListener(document, onPointerish);
addTouchCancelListener(document, onPointerish);
addTouchMoveListener(document, onPointerish);
addTouchStartListener(document, onPointerish);
addSelectiomChangeListener(document, onPointerish);
addScrollListener(document, onPointerish);
}
function callListeners() {
var value = {
activeModality,
modality: modality$1
};
listeners$2.forEach(function(listener) {
listener(value);
});
}
function getModality() {
return modality$1;
}
function useEvent(event3, options) {
var targetListeners = useStable(function() {
return new Map();
});
var addListener3 = useStable(function() {
var addEventListener3 = createEventHandle(event3, options);
return function(target, callback) {
var removeTargetListener = targetListeners.get(target);
if (removeTargetListener != null) {
removeTargetListener();
}
if (callback == null) {
targetListeners.delete(target);
}
var removeEventListener2 = addEventListener3(target, callback);
targetListeners.set(target, removeEventListener2);
return removeEventListener2;
};
});
useLayoutEffectImpl(function() {
return function() {
if (addListener3 != null) {
targetListeners.forEach(function(removeListener2) {
removeListener2();
});
targetListeners.clear();
}
addListener3 = null;
};
}, [addListener3]);
return addListener3;
}
var emptyObject$d = {};
var opts = {
passive: true
};
var lockEventType = "react-gui:hover:lock";
var unlockEventType = "react-gui:hover:unlock";
var supportsPointerEvent$1 = function supportsPointerEvent3() {
return typeof window !== "undefined" && window.PointerEvent != null;
};
function dispatchCustomEvent(target, type, payload) {
var event3 = document.createEvent("CustomEvent");
var _ref = payload || emptyObject$d, _ref$bubbles = _ref.bubbles, bubbles = _ref$bubbles === void 0 ? true : _ref$bubbles, _ref$cancelable = _ref.cancelable, cancelable = _ref$cancelable === void 0 ? true : _ref$cancelable, detail = _ref.detail;
event3.initCustomEvent(type, bubbles, cancelable, detail);
target.dispatchEvent(event3);
}
function getPointerType(event3) {
var pointerType = event3.pointerType;
return pointerType != null ? pointerType : getModality();
}
function useHover(targetRef, config) {
var contain = config.contain, disabled = config.disabled, onHoverStart = config.onHoverStart, onHoverChange = config.onHoverChange, onHoverUpdate = config.onHoverUpdate, onHoverEnd = config.onHoverEnd;
var canUsePE = supportsPointerEvent$1();
var addMoveListener = useEvent(canUsePE ? "pointermove" : "mousemove", opts);
var addEnterListener = useEvent(canUsePE ? "pointerenter" : "mouseenter", opts);
var addLeaveListener = useEvent(canUsePE ? "pointerleave" : "mouseleave", opts);
var addLockListener = useEvent(lockEventType, opts);
var addUnlockListener = useEvent(unlockEventType, opts);
useLayoutEffectImpl(function() {
var target = targetRef.current;
if (target !== null) {
var hoverEnd = function hoverEnd2(e) {
if (onHoverEnd != null) {
onHoverEnd(e);
}
if (onHoverChange != null) {
onHoverChange(false);
}
addMoveListener(target, null);
addLeaveListener(target, null);
};
var leaveListener = function leaveListener2(e) {
var target2 = targetRef.current;
if (target2 != null && getPointerType(e) !== "touch") {
if (contain) {
dispatchCustomEvent(target2, unlockEventType);
}
hoverEnd(e);
}
};
var moveListener = function moveListener2(e) {
if (getPointerType(e) !== "touch") {
if (onHoverUpdate != null) {
if (e.x == null) {
e.x = e.clientX;
}
if (e.y == null) {
e.y = e.clientY;
}
onHoverUpdate(e);
}
}
};
var hoverStart = function hoverStart2(e) {
if (onHoverStart != null) {
onHoverStart(e);
}
if (onHoverChange != null) {
onHoverChange(true);
}
if (onHoverUpdate != null) {
addMoveListener(target, !disabled ? moveListener : null);
}
addLeaveListener(target, !disabled ? leaveListener : null);
};
var enterListener = function enterListener2(e) {
var target2 = targetRef.current;
if (target2 != null && getPointerType(e) !== "touch") {
if (contain) {
dispatchCustomEvent(target2, lockEventType);
}
hoverStart(e);
var lockListener = function lockListener2(lockEvent) {
if (lockEvent.target !== target2) {
hoverEnd(e);
}
};
var unlockListener = function unlockListener2(lockEvent) {
if (lockEvent.target !== target2) {
hoverStart(e);
}
};
addLockListener(target2, !disabled ? lockListener : null);
addUnlockListener(target2, !disabled ? unlockListener : null);
}
};
addEnterListener(target, !disabled ? enterListener : null);
}
}, [addEnterListener, addMoveListener, addLeaveListener, addLockListener, addUnlockListener, contain, disabled, onHoverStart, onHoverChange, onHoverUpdate, onHoverEnd, targetRef]);
}
function _extends$e() {
_extends$e = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$e.apply(this, arguments);
}
function _objectWithoutPropertiesLoose$d(source, excluded) {
if (source == null)
return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0)
continue;
target[key] = source[key];
}
return target;
}
function Pressable(props, forwardedRef) {
var children = props.children, delayLongPress = props.delayLongPress, delayPressIn = props.delayPressIn, delayPressOut = props.delayPressOut, disabled = props.disabled, focusable = props.focusable, onBlur = props.onBlur, onFocus = props.onFocus, onHoverIn = props.onHoverIn, onHoverOut = props.onHoverOut, onLongPress = props.onLongPress, onPress = props.onPress, onPressMove = props.onPressMove, onPressIn = props.onPressIn, onPressOut = props.onPressOut, style = props.style, testOnly_hovered = props.testOnly_hovered, testOnly_pressed = props.testOnly_pressed, rest = _objectWithoutPropertiesLoose$d(props, ["children", "delayLongPress", "delayPressIn", "delayPressOut", "disabled", "focusable", "onBlur", "onFocus", "onHoverIn", "onHoverOut", "onLongPress", "onPress", "onPressMove", "onPressIn", "onPressOut", "style", "testOnly_hovered", "testOnly_pressed"]);
var _useForceableState = useForceableState(testOnly_hovered === true), hovered = _useForceableState[0], setHovered = _useForceableState[1];
var _useForceableState2 = useForceableState(false), focused = _useForceableState2[0], setFocused = _useForceableState2[1];
var _useForceableState3 = useForceableState(testOnly_pressed === true), pressed = _useForceableState3[0], setPressed = _useForceableState3[1];
var hostRef = useRef(null);
var setRef = useMergeRefs(forwardedRef, hostRef);
var pressConfig = useMemo(function() {
return {
delayLongPress,
delayPressStart: delayPressIn,
delayPressEnd: delayPressOut,
disabled,
onLongPress,
onPress,
onPressChange: setPressed,
onPressStart: onPressIn,
onPressMove,
onPressEnd: onPressOut
};
}, [delayLongPress, delayPressIn, delayPressOut, disabled, onLongPress, onPress, onPressIn, onPressMove, onPressOut, setPressed]);
var pressEventHandlers = usePressEvents(hostRef, pressConfig);
useHover(hostRef, {
contain: true,
disabled,
onHoverChange: setHovered,
onHoverStart: onHoverIn,
onHoverEnd: onHoverOut
});
var interactionState = {
hovered,
focused,
pressed
};
function createFocusHandler(callback, value) {
return function(event3) {
if (event3.nativeEvent.target === hostRef.current) {
setFocused(value);
if (callback != null) {
callback(event3);
}
}
};
}
return /* @__PURE__ */ createElement$1(View, _extends$e({}, rest, pressEventHandlers, {
accessibilityDisabled: disabled,
focusable: !disabled && focusable !== false,
onBlur: createFocusHandler(onBlur, false),
onFocus: createFocusHandler(onFocus, true),
ref: setRef,
style: [!disabled && styles$g.root, typeof style === "function" ? style(interactionState) : style]
}), typeof children === "function" ? children(interactionState) : children);
}
function useForceableState(forced) {
var _useState = useState(false), bool = _useState[0], setBool = _useState[1];
return [bool || forced, setBool];
}
var styles$g = StyleSheet.create({
root: {
cursor: "pointer",
touchAction: "manipulation"
}
});
var MemoedPressable = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef(Pressable));
MemoedPressable.displayName = "Pressable";
function _extends$f() {
_extends$f = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$f.apply(this, arguments);
}
function _objectWithoutPropertiesLoose$e(source, excluded) {
if (source == null)
return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0)
continue;
target[key] = source[key];
}
return target;
}
var ProgressBar = /* @__PURE__ */ forwardRef(function(props, ref) {
var _props$color = props.color, color = _props$color === void 0 ? "#1976D2" : _props$color, _props$indeterminate = props.indeterminate, indeterminate = _props$indeterminate === void 0 ? false : _props$indeterminate, _props$progress = props.progress, progress = _props$progress === void 0 ? 0 : _props$progress, _props$trackColor = props.trackColor, trackColor = _props$trackColor === void 0 ? "transparent" : _props$trackColor, style = props.style, other = _objectWithoutPropertiesLoose$e(props, ["color", "indeterminate", "progress", "trackColor", "style"]);
var percentageProgress = progress * 100;
var progressRef = useRef(null);
useEffect(function() {
var width = indeterminate ? "25%" : percentageProgress + "%";
if (progressRef.current != null) {
progressRef.current.setNativeProps({
style: {
width
}
});
}
}, [indeterminate, percentageProgress, progressRef]);
return /* @__PURE__ */ React__default.createElement(View, _extends$f({}, other, {
accessibilityRole: "progressbar",
accessibilityValue: {
max: 100,
min: 0,
now: indeterminate ? null : percentageProgress
},
ref,
style: [styles$h.track, style, {
backgroundColor: trackColor
}]
}), /* @__PURE__ */ React__default.createElement(View, {
ref: progressRef,
style: [styles$h.progress, indeterminate && styles$h.animation, {
backgroundColor: color
}]
}));
});
ProgressBar.displayName = "ProgressBar";
var styles$h = StyleSheet.create({
track: {
height: 5,
overflow: "hidden",
userSelect: "none",
zIndex: 0
},
progress: {
height: "100%",
zIndex: -1
},
animation: {
animationDuration: "1s",
animationKeyframes: [{
"0%": {
transform: [{
translateX: "-100%"
}]
},
"100%": {
transform: [{
translateX: "400%"
}]
}
}],
animationTimingFunction: "linear",
animationIterationCount: "infinite"
}
});
function _extends$g() {
_extends$g = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$g.apply(this, arguments);
}
function _objectWithoutPropertiesLoose$f(source, excluded) {
if (source == null)
return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0)
continue;
target[key] = source[key];
}
return target;
}
var cssFunction = function() {
if (canUseDOM && window.CSS && window.CSS.supports && window.CSS.supports("top: constant(safe-area-inset-top)")) {
return "constant";
}
return "env";
}();
var SafeAreaView = /* @__PURE__ */ forwardRef(function(props, ref) {
var style = props.style, rest = _objectWithoutPropertiesLoose$f(props, ["style"]);
return /* @__PURE__ */ React__default.createElement(View, _extends$g({}, rest, {
ref,
style: StyleSheet.compose(styles$i.root, style)
}));
});
SafeAreaView.displayName = "SafeAreaView";
var styles$i = StyleSheet.create({
root: {
paddingTop: cssFunction + "(safe-area-inset-top)",
paddingRight: cssFunction + "(safe-area-inset-right)",
paddingBottom: cssFunction + "(safe-area-inset-bottom)",
paddingLeft: cssFunction + "(safe-area-inset-left)"
}
});
var emptyFunction$3 = function emptyFunction4() {
};
function StatusBar() {
return null;
}
StatusBar.setBackgroundColor = emptyFunction$3;
StatusBar.setBarStyle = emptyFunction$3;
StatusBar.setHidden = emptyFunction$3;
StatusBar.setNetworkActivityIndicatorVisible = emptyFunction$3;
StatusBar.setTranslucent = emptyFunction$3;
function ownKeys$k(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$k(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys$k(Object(source), true).forEach(function(key) {
_defineProperty$k(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys$k(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _defineProperty$k(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {value, enumerable: true, configurable: true, writable: true});
} else {
obj[key] = value;
}
return obj;
}
function _extends$h() {
_extends$h = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$h.apply(this, arguments);
}
function _objectWithoutPropertiesLoose$g(source, excluded) {
if (source == null)
return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0)
continue;
target[key] = source[key];
}
return target;
}
var emptyObject$e = {};
var thumbDefaultBoxShadow = "0px 1px 3px rgba(0,0,0,0.5)";
var thumbFocusedBoxShadow = thumbDefaultBoxShadow + ", 0 0 0 10px rgba(0,0,0,0.1)";
var Switch = /* @__PURE__ */ forwardRef(function(props, forwardedRef) {
var accessibilityLabel = props.accessibilityLabel, _props$activeThumbCol = props.activeThumbColor, activeThumbColor = _props$activeThumbCol === void 0 ? "#009688" : _props$activeThumbCol, _props$activeTrackCol = props.activeTrackColor, activeTrackColor = _props$activeTrackCol === void 0 ? "#A3D3CF" : _props$activeTrackCol, _props$disabled = props.disabled, disabled = _props$disabled === void 0 ? false : _props$disabled, onValueChange = props.onValueChange, _props$style = props.style, style = _props$style === void 0 ? emptyObject$e : _props$style, _props$thumbColor = props.thumbColor, thumbColor = _props$thumbColor === void 0 ? "#FAFAFA" : _props$thumbColor, _props$trackColor = props.trackColor, trackColor = _props$trackColor === void 0 ? "#939393" : _props$trackColor, _props$value = props.value, value = _props$value === void 0 ? false : _props$value, other = _objectWithoutPropertiesLoose$g(props, ["accessibilityLabel", "activeThumbColor", "activeTrackColor", "disabled", "onValueChange", "style", "thumbColor", "trackColor", "value"]);
var thumbRef = useRef(null);
function handleChange(event3) {
if (onValueChange != null) {
onValueChange(event3.nativeEvent.target.checked);
}
}
function handleFocusState(event3) {
var isFocused = event3.nativeEvent.type === "focus";
var boxShadow = isFocused ? thumbFocusedBoxShadow : thumbDefaultBoxShadow;
if (thumbRef.current != null) {
thumbRef.current.style.boxShadow = boxShadow;
}
}
var _StyleSheet$flatten = StyleSheet.flatten(style), styleHeight = _StyleSheet$flatten.height, styleWidth = _StyleSheet$flatten.width;
var height = styleHeight || "20px";
var minWidth = multiplyStyleLengthValue(height, 2);
var width = styleWidth > minWidth ? styleWidth : minWidth;
var trackBorderRadius = multiplyStyleLengthValue(height, 0.5);
var trackCurrentColor = function() {
if (value === true) {
if (trackColor != null && typeof trackColor === "object") {
return trackColor.true;
} else {
return activeTrackColor;
}
} else {
if (trackColor != null && typeof trackColor === "object") {
return trackColor.false;
} else {
return trackColor;
}
}
}();
var thumbCurrentColor = value ? activeThumbColor : thumbColor;
var thumbHeight = height;
var thumbWidth = thumbHeight;
var rootStyle = [styles$j.root, style, disabled && styles$j.cursorDefault, {
height,
width
}];
var trackStyle = [styles$j.track, {
backgroundColor: disabled ? "#D5D5D5" : trackCurrentColor,
borderRadius: trackBorderRadius
}];
var thumbStyle = [styles$j.thumb, value && styles$j.thumbActive, {
backgroundColor: disabled ? "#BDBDBD" : thumbCurrentColor,
height: thumbHeight,
marginStart: value ? multiplyStyleLengthValue(thumbWidth, -1) : 0,
width: thumbWidth
}];
var nativeControl = createElement("input", {
accessibilityLabel,
checked: value,
disabled,
onBlur: handleFocusState,
onChange: handleChange,
onFocus: handleFocusState,
ref: forwardedRef,
style: [styles$j.nativeControl, styles$j.cursorInherit],
type: "checkbox",
role: "switch"
});
return /* @__PURE__ */ createElement$1(View, _extends$h({}, other, {
style: rootStyle
}), /* @__PURE__ */ createElement$1(View, {
style: trackStyle
}), /* @__PURE__ */ createElement$1(View, {
ref: thumbRef,
style: thumbStyle
}), nativeControl);
});
Switch.displayName = "Switch";
var styles$j = StyleSheet.create({
root: {
cursor: "pointer",
userSelect: "none"
},
cursorDefault: {
cursor: "default"
},
cursorInherit: {
cursor: "inherit"
},
track: _objectSpread$k(_objectSpread$k({}, StyleSheet.absoluteFillObject), {}, {
height: "70%",
margin: "auto",
transitionDuration: "0.1s",
width: "100%"
}),
thumb: {
alignSelf: "flex-start",
borderRadius: "100%",
boxShadow: thumbDefaultBoxShadow,
start: "0%",
transform: [{
translateZ: 0
}],
transitionDuration: "0.1s"
},
thumbActive: {
start: "100%"
},
nativeControl: _objectSpread$k(_objectSpread$k({}, StyleSheet.absoluteFillObject), {}, {
height: "100%",
margin: 0,
opacity: 0,
padding: 0,
width: "100%"
})
});
function ownKeys$l(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$l(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys$l(Object(source), true).forEach(function(key) {
_defineProperty$l(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys$l(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _defineProperty$l(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {value, enumerable: true, configurable: true, writable: true});
} else {
obj[key] = value;
}
return obj;
}
var isSelectionStale = function isSelectionStale2(node, selection) {
var selectionEnd = node.selectionEnd, selectionStart = node.selectionStart;
var start = selection.start, end = selection.end;
return start !== selectionStart || end !== selectionEnd;
};
var setSelection = function setSelection2(node, selection) {
if (isSelectionStale(node, selection)) {
var start = selection.start, end = selection.end;
try {
node.setSelectionRange(start, end || start);
} catch (e) {
}
}
};
var forwardPropsList$2 = _objectSpread$l(_objectSpread$l(_objectSpread$l(_objectSpread$l(_objectSpread$l(_objectSpread$l(_objectSpread$l(_objectSpread$l(_objectSpread$l({}, defaultProps), accessibilityProps), clickProps), focusProps), keyboardProps), mouseProps), touchProps), styleProps), {}, {
autoCapitalize: true,
autoComplete: true,
autoCorrect: true,
autoFocus: true,
defaultValue: true,
disabled: true,
lang: true,
maxLength: true,
onChange: true,
onScroll: true,
placeholder: true,
pointerEvents: true,
readOnly: true,
rows: true,
spellCheck: true,
value: true,
type: true
});
var pickProps$2 = function pickProps4(props) {
return pick(props, forwardPropsList$2);
};
function isEventComposing(nativeEvent) {
return nativeEvent.isComposing || nativeEvent.keyCode === 229;
}
var TextInput = /* @__PURE__ */ forwardRef(function(props, forwardedRef) {
var _props$autoCapitalize = props.autoCapitalize, autoCapitalize = _props$autoCapitalize === void 0 ? "sentences" : _props$autoCapitalize, autoComplete = props.autoComplete, autoCompleteType = props.autoCompleteType, _props$autoCorrect = props.autoCorrect, autoCorrect = _props$autoCorrect === void 0 ? true : _props$autoCorrect, blurOnSubmit = props.blurOnSubmit, clearTextOnFocus = props.clearTextOnFocus, dir = props.dir, _props$editable = props.editable, editable = _props$editable === void 0 ? true : _props$editable, _props$keyboardType = props.keyboardType, keyboardType = _props$keyboardType === void 0 ? "default" : _props$keyboardType, _props$multiline = props.multiline, multiline = _props$multiline === void 0 ? false : _props$multiline, _props$numberOfLines = props.numberOfLines, numberOfLines = _props$numberOfLines === void 0 ? 1 : _props$numberOfLines, onBlur = props.onBlur, onChange = props.onChange, onChangeText = props.onChangeText, onContentSizeChange = props.onContentSizeChange, onFocus = props.onFocus, onKeyPress = props.onKeyPress, onLayout = props.onLayout, onMoveShouldSetResponder = props.onMoveShouldSetResponder, onMoveShouldSetResponderCapture = props.onMoveShouldSetResponderCapture, onResponderEnd = props.onResponderEnd, onResponderGrant = props.onResponderGrant, onResponderMove = props.onResponderMove, onResponderReject = props.onResponderReject, onResponderRelease = props.onResponderRelease, onResponderStart = props.onResponderStart, onResponderTerminate = props.onResponderTerminate, onResponderTerminationRequest = props.onResponderTerminationRequest, onScrollShouldSetResponder = props.onScrollShouldSetResponder, onScrollShouldSetResponderCapture = props.onScrollShouldSetResponderCapture, onSelectionChange = props.onSelectionChange, onSelectionChangeShouldSetResponder = props.onSelectionChangeShouldSetResponder, onSelectionChangeShouldSetResponderCapture = props.onSelectionChangeShouldSetResponderCapture, onStartShouldSetResponder = props.onStartShouldSetResponder, onStartShouldSetResponderCapture = props.onStartShouldSetResponderCapture, onSubmitEditing = props.onSubmitEditing, placeholderTextColor = props.placeholderTextColor, returnKeyType = props.returnKeyType, _props$secureTextEntr = props.secureTextEntry, secureTextEntry = _props$secureTextEntr === void 0 ? false : _props$secureTextEntr, selection = props.selection, selectTextOnFocus = props.selectTextOnFocus, spellCheck = props.spellCheck;
var type;
var inputMode;
switch (keyboardType) {
case "email-address":
type = "email";
break;
case "number-pad":
case "numeric":
inputMode = "numeric";
break;
case "decimal-pad":
inputMode = "decimal";
break;
case "phone-pad":
type = "tel";
break;
case "search":
case "web-search":
type = "search";
break;
case "url":
type = "url";
break;
default:
type = "text";
}
if (secureTextEntry) {
type = "password";
}
var dimensions2 = useRef({
height: null,
width: null
});
var hostRef = useRef(null);
var handleContentSizeChange = useCallback(function() {
var node = hostRef.current;
if (multiline && onContentSizeChange && node != null) {
var newHeight = node.scrollHeight;
var newWidth = node.scrollWidth;
if (newHeight !== dimensions2.current.height || newWidth !== dimensions2.current.width) {
dimensions2.current.height = newHeight;
dimensions2.current.width = newWidth;
onContentSizeChange({
nativeEvent: {
contentSize: {
height: dimensions2.current.height,
width: dimensions2.current.width
}
}
});
}
}
}, [hostRef, multiline, onContentSizeChange]);
var imperativeRef = useMemo(function() {
return function(hostNode) {
if (hostNode != null) {
hostNode.clear = function() {
if (hostNode != null) {
hostNode.value = "";
}
};
hostNode.isFocused = function() {
return hostNode != null && TextInputState.currentlyFocusedField() === hostNode;
};
handleContentSizeChange();
}
};
}, [handleContentSizeChange]);
function handleBlur(e) {
TextInputState._currentlyFocusedNode = null;
if (onBlur) {
e.nativeEvent.text = e.target.value;
onBlur(e);
}
}
function handleChange(e) {
var text = e.target.value;
e.nativeEvent.text = text;
handleContentSizeChange();
if (onChange) {
onChange(e);
}
if (onChangeText) {
onChangeText(text);
}
}
function handleFocus(e) {
var node = hostRef.current;
if (node != null) {
TextInputState._currentlyFocusedNode = node;
if (onFocus) {
e.nativeEvent.text = e.target.value;
onFocus(e);
}
if (clearTextOnFocus) {
node.value = "";
}
if (selectTextOnFocus) {
setTimeout(function() {
node.select();
}, 0);
}
}
}
function handleKeyDown(e) {
e.stopPropagation();
var blurOnSubmitDefault = !multiline;
var shouldBlurOnSubmit = blurOnSubmit == null ? blurOnSubmitDefault : blurOnSubmit;
var nativeEvent = e.nativeEvent;
var isComposing = isEventComposing(nativeEvent);
if (onKeyPress) {
onKeyPress(e);
}
if (e.key === "Enter" && !e.shiftKey && !isComposing && !e.isDefaultPrevented()) {
if ((blurOnSubmit || !multiline) && onSubmitEditing) {
e.preventDefault();
nativeEvent.text = e.target.value;
onSubmitEditing(e);
}
if (shouldBlurOnSubmit && hostRef.current != null) {
hostRef.current.blur();
}
}
}
function handleSelectionChange(e) {
if (onSelectionChange) {
try {
var node = e.target;
var selectionStart = node.selectionStart, selectionEnd = node.selectionEnd;
e.nativeEvent.selection = {
start: selectionStart,
end: selectionEnd
};
e.nativeEvent.text = e.target.value;
onSelectionChange(e);
} catch (e2) {
}
}
}
useLayoutEffectImpl(function() {
var node = hostRef.current;
if (node != null && selection != null) {
setSelection(node, selection);
}
if (document.activeElement === node) {
TextInputState._currentlyFocusedNode = node;
}
}, [hostRef, selection]);
var component = multiline ? "textarea" : "input";
var classList2 = [classes$4.textinput];
var style = StyleSheet.compose(props.style, placeholderTextColor && {
placeholderTextColor
});
useElementLayout(hostRef, onLayout);
useResponderEvents(hostRef, {
onMoveShouldSetResponder,
onMoveShouldSetResponderCapture,
onResponderEnd,
onResponderGrant,
onResponderMove,
onResponderReject,
onResponderRelease,
onResponderStart,
onResponderTerminate,
onResponderTerminationRequest,
onScrollShouldSetResponder,
onScrollShouldSetResponderCapture,
onSelectionChangeShouldSetResponder,
onSelectionChangeShouldSetResponderCapture,
onStartShouldSetResponder,
onStartShouldSetResponderCapture
});
var supportedProps = pickProps$2(props);
supportedProps.autoCapitalize = autoCapitalize;
supportedProps.autoComplete = autoComplete || autoCompleteType || "on";
supportedProps.autoCorrect = autoCorrect ? "on" : "off";
supportedProps.classList = classList2;
supportedProps.dir = dir !== void 0 ? dir : "auto";
supportedProps.enterKeyHint = returnKeyType;
supportedProps.onBlur = handleBlur;
supportedProps.onChange = handleChange;
supportedProps.onFocus = handleFocus;
supportedProps.onKeyDown = handleKeyDown;
supportedProps.onSelect = handleSelectionChange;
supportedProps.readOnly = !editable;
supportedProps.rows = multiline ? numberOfLines : void 0;
supportedProps.spellCheck = spellCheck != null ? spellCheck : autoCorrect;
supportedProps.style = style;
supportedProps.type = multiline ? void 0 : type;
supportedProps.inputMode = inputMode;
var platformMethodsRef = usePlatformMethods(supportedProps);
var setRef = useMergeRefs(hostRef, platformMethodsRef, imperativeRef, forwardedRef);
supportedProps.ref = setRef;
return createElement(component, supportedProps);
});
TextInput.displayName = "TextInput";
TextInput.State = TextInputState;
var classes$4 = css.create({
textinput: {
MozAppearance: "textfield",
WebkitAppearance: "none",
backgroundColor: "transparent",
border: "0 solid black",
borderRadius: 0,
boxSizing: "border-box",
font: "14px System",
margin: 0,
padding: 0,
resize: "none"
}
});
var twoArgumentPooler = function twoArgumentPooler2(a1, a2) {
var Klass = this;
if (Klass.instancePool.length) {
var instance = Klass.instancePool.pop();
Klass.call(instance, a1, a2);
return instance;
} else {
return new Klass(a1, a2);
}
};
var standardReleaser = function standardReleaser2(instance) {
var Klass = this;
instance.destructor();
if (Klass.instancePool.length < Klass.poolSize) {
Klass.instancePool.push(instance);
}
};
var DEFAULT_POOL_SIZE = 10;
var DEFAULT_POOLER = twoArgumentPooler;
var addPoolingTo = function addPoolingTo2(CopyConstructor, pooler) {
var NewKlass = CopyConstructor;
NewKlass.instancePool = [];
NewKlass.getPooled = pooler || DEFAULT_POOLER;
if (!NewKlass.poolSize) {
NewKlass.poolSize = DEFAULT_POOL_SIZE;
}
NewKlass.release = standardReleaser;
return NewKlass;
};
var PooledClass = {
addPoolingTo,
twoArgumentPooler
};
var twoArgumentPooler$1 = PooledClass.twoArgumentPooler;
function BoundingDimensions(width, height) {
this.width = width;
this.height = height;
}
BoundingDimensions.prototype.destructor = function() {
this.width = null;
this.height = null;
};
BoundingDimensions.getPooledFromElement = function(element) {
return BoundingDimensions.getPooled(element.offsetWidth, element.offsetHeight);
};
PooledClass.addPoolingTo(BoundingDimensions, twoArgumentPooler$1);
var twoArgumentPooler$2 = PooledClass.twoArgumentPooler;
function Position(left2, top) {
this.left = left2;
this.top = top;
}
Position.prototype.destructor = function() {
this.left = null;
this.top = null;
};
PooledClass.addPoolingTo(Position, twoArgumentPooler$2);
function _objectWithoutPropertiesLoose$h(source, excluded) {
if (source == null)
return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0)
continue;
target[key] = source[key];
}
return target;
}
function ownKeys$m(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$m(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys$m(Object(source), true).forEach(function(key) {
_defineProperty$m(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys$m(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _defineProperty$m(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {value, enumerable: true, configurable: true, writable: true});
} else {
obj[key] = value;
}
return obj;
}
var extractSingleTouch = function extractSingleTouch2(nativeEvent) {
var touches = nativeEvent.touches;
var changedTouches = nativeEvent.changedTouches;
var hasTouches = touches && touches.length > 0;
var hasChangedTouches = changedTouches && changedTouches.length > 0;
return !hasTouches && hasChangedTouches ? changedTouches[0] : hasTouches ? touches[0] : nativeEvent;
};
var States = {
NOT_RESPONDER: "NOT_RESPONDER",
RESPONDER_INACTIVE_PRESS_IN: "RESPONDER_INACTIVE_PRESS_IN",
RESPONDER_INACTIVE_PRESS_OUT: "RESPONDER_INACTIVE_PRESS_OUT",
RESPONDER_ACTIVE_PRESS_IN: "RESPONDER_ACTIVE_PRESS_IN",
RESPONDER_ACTIVE_PRESS_OUT: "RESPONDER_ACTIVE_PRESS_OUT",
RESPONDER_ACTIVE_LONG_PRESS_IN: "RESPONDER_ACTIVE_LONG_PRESS_IN",
RESPONDER_ACTIVE_LONG_PRESS_OUT: "RESPONDER_ACTIVE_LONG_PRESS_OUT",
ERROR: "ERROR"
};
var baseStatesConditions = {
NOT_RESPONDER: false,
RESPONDER_INACTIVE_PRESS_IN: false,
RESPONDER_INACTIVE_PRESS_OUT: false,
RESPONDER_ACTIVE_PRESS_IN: false,
RESPONDER_ACTIVE_PRESS_OUT: false,
RESPONDER_ACTIVE_LONG_PRESS_IN: false,
RESPONDER_ACTIVE_LONG_PRESS_OUT: false,
ERROR: false
};
var IsActive = _objectSpread$m(_objectSpread$m({}, baseStatesConditions), {}, {
RESPONDER_ACTIVE_PRESS_OUT: true,
RESPONDER_ACTIVE_PRESS_IN: true
});
var IsPressingIn = _objectSpread$m(_objectSpread$m({}, baseStatesConditions), {}, {
RESPONDER_INACTIVE_PRESS_IN: true,
RESPONDER_ACTIVE_PRESS_IN: true,
RESPONDER_ACTIVE_LONG_PRESS_IN: true
});
var IsLongPressingIn = _objectSpread$m(_objectSpread$m({}, baseStatesConditions), {}, {
RESPONDER_ACTIVE_LONG_PRESS_IN: true
});
var Signals = {
DELAY: "DELAY",
RESPONDER_GRANT: "RESPONDER_GRANT",
RESPONDER_RELEASE: "RESPONDER_RELEASE",
RESPONDER_TERMINATED: "RESPONDER_TERMINATED",
ENTER_PRESS_RECT: "ENTER_PRESS_RECT",
LEAVE_PRESS_RECT: "LEAVE_PRESS_RECT",
LONG_PRESS_DETECTED: "LONG_PRESS_DETECTED"
};
var Transitions$1 = {
NOT_RESPONDER: {
DELAY: States.ERROR,
RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN,
RESPONDER_RELEASE: States.ERROR,
RESPONDER_TERMINATED: States.ERROR,
ENTER_PRESS_RECT: States.ERROR,
LEAVE_PRESS_RECT: States.ERROR,
LONG_PRESS_DETECTED: States.ERROR
},
RESPONDER_INACTIVE_PRESS_IN: {
DELAY: States.RESPONDER_ACTIVE_PRESS_IN,
RESPONDER_GRANT: States.ERROR,
RESPONDER_RELEASE: States.NOT_RESPONDER,
RESPONDER_TERMINATED: States.NOT_RESPONDER,
ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN,
LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT,
LONG_PRESS_DETECTED: States.ERROR
},
RESPONDER_INACTIVE_PRESS_OUT: {
DELAY: States.RESPONDER_ACTIVE_PRESS_OUT,
RESPONDER_GRANT: States.ERROR,
RESPONDER_RELEASE: States.NOT_RESPONDER,
RESPONDER_TERMINATED: States.NOT_RESPONDER,
ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN,
LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT,
LONG_PRESS_DETECTED: States.ERROR
},
RESPONDER_ACTIVE_PRESS_IN: {
DELAY: States.ERROR,
RESPONDER_GRANT: States.ERROR,
RESPONDER_RELEASE: States.NOT_RESPONDER,
RESPONDER_TERMINATED: States.NOT_RESPONDER,
ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN,
LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT,
LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN
},
RESPONDER_ACTIVE_PRESS_OUT: {
DELAY: States.ERROR,
RESPONDER_GRANT: States.ERROR,
RESPONDER_RELEASE: States.NOT_RESPONDER,
RESPONDER_TERMINATED: States.NOT_RESPONDER,
ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN,
LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT,
LONG_PRESS_DETECTED: States.ERROR
},
RESPONDER_ACTIVE_LONG_PRESS_IN: {
DELAY: States.ERROR,
RESPONDER_GRANT: States.ERROR,
RESPONDER_RELEASE: States.NOT_RESPONDER,
RESPONDER_TERMINATED: States.NOT_RESPONDER,
ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN,
LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT,
LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN
},
RESPONDER_ACTIVE_LONG_PRESS_OUT: {
DELAY: States.ERROR,
RESPONDER_GRANT: States.ERROR,
RESPONDER_RELEASE: States.NOT_RESPONDER,
RESPONDER_TERMINATED: States.NOT_RESPONDER,
ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN,
LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT,
LONG_PRESS_DETECTED: States.ERROR
},
error: {
DELAY: States.NOT_RESPONDER,
RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN,
RESPONDER_RELEASE: States.NOT_RESPONDER,
RESPONDER_TERMINATED: States.NOT_RESPONDER,
ENTER_PRESS_RECT: States.NOT_RESPONDER,
LEAVE_PRESS_RECT: States.NOT_RESPONDER,
LONG_PRESS_DETECTED: States.NOT_RESPONDER
}
};
var HIGHLIGHT_DELAY_MS = 130;
var PRESS_EXPAND_PX = 20;
var LONG_PRESS_THRESHOLD = 500;
var LONG_PRESS_DELAY_MS = LONG_PRESS_THRESHOLD - HIGHLIGHT_DELAY_MS;
var LONG_PRESS_ALLOWED_MOVEMENT = 10;
var TouchableMixin = {
componentDidMount: function componentDidMount() {
var _this = this;
this._touchableNode = findNodeHandle(this);
if (this._touchableNode && this._touchableNode.addEventListener) {
this._touchableBlurListener = function(e) {
if (_this._isTouchableKeyboardActive) {
if (_this.state.touchable.touchState && _this.state.touchable.touchState !== States.NOT_RESPONDER) {
_this.touchableHandleResponderTerminate({
nativeEvent: e
});
}
_this._isTouchableKeyboardActive = false;
}
};
this._touchableNode.addEventListener("blur", this._touchableBlurListener);
}
},
componentWillUnmount: function componentWillUnmount() {
if (this._touchableNode && this._touchableNode.addEventListener) {
this._touchableNode.removeEventListener("blur", this._touchableBlurListener);
}
this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout);
this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout);
this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout);
},
touchableGetInitialState: function touchableGetInitialState() {
return {
touchable: {
touchState: void 0,
responderID: null
}
};
},
touchableHandleResponderTerminationRequest: function touchableHandleResponderTerminationRequest() {
return !this.props.rejectResponderTermination;
},
touchableHandleStartShouldSetResponder: function touchableHandleStartShouldSetResponder() {
return !this.props.disabled;
},
touchableLongPressCancelsPress: function touchableLongPressCancelsPress() {
return true;
},
touchableHandleResponderGrant: function touchableHandleResponderGrant(e) {
var dispatchID = e.currentTarget;
e.persist();
this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout);
this.pressOutDelayTimeout = null;
this.state.touchable.touchState = States.NOT_RESPONDER;
this.state.touchable.responderID = dispatchID;
this._receiveSignal(Signals.RESPONDER_GRANT, e);
var delayMS = this.touchableGetHighlightDelayMS !== void 0 ? Math.max(this.touchableGetHighlightDelayMS(), 0) : HIGHLIGHT_DELAY_MS;
delayMS = isNaN(delayMS) ? HIGHLIGHT_DELAY_MS : delayMS;
if (delayMS !== 0) {
this.touchableDelayTimeout = setTimeout(this._handleDelay.bind(this, e), delayMS);
} else {
this._handleDelay(e);
}
var longDelayMS = this.touchableGetLongPressDelayMS !== void 0 ? Math.max(this.touchableGetLongPressDelayMS(), 10) : LONG_PRESS_DELAY_MS;
longDelayMS = isNaN(longDelayMS) ? LONG_PRESS_DELAY_MS : longDelayMS;
this.longPressDelayTimeout = setTimeout(this._handleLongDelay.bind(this, e), longDelayMS + delayMS);
},
touchableHandleResponderRelease: function touchableHandleResponderRelease(e) {
this.pressInLocation = null;
this._receiveSignal(Signals.RESPONDER_RELEASE, e);
},
touchableHandleResponderTerminate: function touchableHandleResponderTerminate(e) {
this.pressInLocation = null;
this._receiveSignal(Signals.RESPONDER_TERMINATED, e);
},
touchableHandleResponderMove: function touchableHandleResponderMove(e) {
if (!this.state.touchable.positionOnActivate) {
return;
}
var positionOnActivate = this.state.touchable.positionOnActivate;
var dimensionsOnActivate = this.state.touchable.dimensionsOnActivate;
var pressRectOffset = this.touchableGetPressRectOffset ? this.touchableGetPressRectOffset() : {
left: PRESS_EXPAND_PX,
right: PRESS_EXPAND_PX,
top: PRESS_EXPAND_PX,
bottom: PRESS_EXPAND_PX
};
var pressExpandLeft = pressRectOffset.left;
var pressExpandTop = pressRectOffset.top;
var pressExpandRight = pressRectOffset.right;
var pressExpandBottom = pressRectOffset.bottom;
var hitSlop = this.touchableGetHitSlop ? this.touchableGetHitSlop() : null;
if (hitSlop) {
pressExpandLeft += hitSlop.left || 0;
pressExpandTop += hitSlop.top || 0;
pressExpandRight += hitSlop.right || 0;
pressExpandBottom += hitSlop.bottom || 0;
}
var touch = extractSingleTouch(e.nativeEvent);
var pageX = touch && touch.pageX;
var pageY = touch && touch.pageY;
if (this.pressInLocation) {
var movedDistance = this._getDistanceBetweenPoints(pageX, pageY, this.pressInLocation.pageX, this.pressInLocation.pageY);
if (movedDistance > LONG_PRESS_ALLOWED_MOVEMENT) {
this._cancelLongPressDelayTimeout();
}
}
var isTouchWithinActive = pageX > positionOnActivate.left - pressExpandLeft && pageY > positionOnActivate.top - pressExpandTop && pageX < positionOnActivate.left + dimensionsOnActivate.width + pressExpandRight && pageY < positionOnActivate.top + dimensionsOnActivate.height + pressExpandBottom;
if (isTouchWithinActive) {
var prevState = this.state.touchable.touchState;
this._receiveSignal(Signals.ENTER_PRESS_RECT, e);
var curState = this.state.touchable.touchState;
if (curState === States.RESPONDER_INACTIVE_PRESS_IN && prevState !== States.RESPONDER_INACTIVE_PRESS_IN) {
this._cancelLongPressDelayTimeout();
}
} else {
this._cancelLongPressDelayTimeout();
this._receiveSignal(Signals.LEAVE_PRESS_RECT, e);
}
},
touchableHandleFocus: function touchableHandleFocus(e) {
this.props.onFocus && this.props.onFocus(e);
},
touchableHandleBlur: function touchableHandleBlur(e) {
this.props.onBlur && this.props.onBlur(e);
},
_remeasureMetricsOnActivation: function _remeasureMetricsOnActivation() {
var tag = this.state.touchable.responderID;
if (tag == null) {
return;
}
UIManager.measure(tag, this._handleQueryLayout);
},
_handleQueryLayout: function _handleQueryLayout(l, t, w2, h, globalX, globalY) {
if (!l && !t && !w2 && !h && !globalX && !globalY) {
return;
}
this.state.touchable.positionOnActivate && Position.release(this.state.touchable.positionOnActivate);
this.state.touchable.dimensionsOnActivate && BoundingDimensions.release(this.state.touchable.dimensionsOnActivate);
this.state.touchable.positionOnActivate = Position.getPooled(globalX, globalY);
this.state.touchable.dimensionsOnActivate = BoundingDimensions.getPooled(w2, h);
},
_handleDelay: function _handleDelay(e) {
this.touchableDelayTimeout = null;
this._receiveSignal(Signals.DELAY, e);
},
_handleLongDelay: function _handleLongDelay(e) {
this.longPressDelayTimeout = null;
var curState = this.state.touchable.touchState;
if (curState !== States.RESPONDER_ACTIVE_PRESS_IN && curState !== States.RESPONDER_ACTIVE_LONG_PRESS_IN) {
console.error("Attempted to transition from state `" + curState + "` to `" + States.RESPONDER_ACTIVE_LONG_PRESS_IN + "`, which is not supported. This is most likely due to `Touchable.longPressDelayTimeout` not being cancelled.");
} else {
this._receiveSignal(Signals.LONG_PRESS_DETECTED, e);
}
},
_receiveSignal: function _receiveSignal(signal, e) {
var responderID = this.state.touchable.responderID;
var curState = this.state.touchable.touchState;
var nextState = Transitions$1[curState] && Transitions$1[curState][signal];
if (!responderID && signal === Signals.RESPONDER_RELEASE) {
return;
}
if (!nextState) {
throw new Error("Unrecognized signal `" + signal + "` or state `" + curState + "` for Touchable responder `" + responderID + "`");
}
if (nextState === States.ERROR) {
throw new Error("Touchable cannot transition from `" + curState + "` to `" + signal + "` for responder `" + responderID + "`");
}
if (curState !== nextState) {
this._performSideEffectsForTransition(curState, nextState, signal, e);
this.state.touchable.touchState = nextState;
}
},
_cancelLongPressDelayTimeout: function _cancelLongPressDelayTimeout() {
this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout);
this.longPressDelayTimeout = null;
},
_isHighlight: function _isHighlight(state) {
return state === States.RESPONDER_ACTIVE_PRESS_IN || state === States.RESPONDER_ACTIVE_LONG_PRESS_IN;
},
_savePressInLocation: function _savePressInLocation(e) {
var touch = extractSingleTouch(e.nativeEvent);
var pageX = touch && touch.pageX;
var pageY = touch && touch.pageY;
var locationX = touch && touch.locationX;
var locationY = touch && touch.locationY;
this.pressInLocation = {
pageX,
pageY,
locationX,
locationY
};
},
_getDistanceBetweenPoints: function _getDistanceBetweenPoints(aX, aY, bX, bY) {
var deltaX = aX - bX;
var deltaY = aY - bY;
return Math.sqrt(deltaX * deltaX + deltaY * deltaY);
},
_performSideEffectsForTransition: function _performSideEffectsForTransition(curState, nextState, signal, e) {
var curIsHighlight = this._isHighlight(curState);
var newIsHighlight = this._isHighlight(nextState);
var isFinalSignal = signal === Signals.RESPONDER_TERMINATED || signal === Signals.RESPONDER_RELEASE;
if (isFinalSignal) {
this._cancelLongPressDelayTimeout();
}
var isInitialTransition = curState === States.NOT_RESPONDER && nextState === States.RESPONDER_INACTIVE_PRESS_IN;
var isActiveTransition = !IsActive[curState] && IsActive[nextState];
if (isInitialTransition || isActiveTransition) {
this._remeasureMetricsOnActivation();
}
if (IsPressingIn[curState] && signal === Signals.LONG_PRESS_DETECTED) {
this.touchableHandleLongPress && this.touchableHandleLongPress(e);
}
if (newIsHighlight && !curIsHighlight) {
this._startHighlight(e);
} else if (!newIsHighlight && curIsHighlight) {
this._endHighlight(e);
}
if (IsPressingIn[curState] && signal === Signals.RESPONDER_RELEASE) {
var hasLongPressHandler = !!this.props.onLongPress;
var pressIsLongButStillCallOnPress = IsLongPressingIn[curState] && (!hasLongPressHandler || !this.touchableLongPressCancelsPress());
var shouldInvokePress = !IsLongPressingIn[curState] || pressIsLongButStillCallOnPress;
if (shouldInvokePress && this.touchableHandlePress) {
if (!newIsHighlight && !curIsHighlight) {
this._startHighlight(e);
this._endHighlight(e);
}
this.touchableHandlePress(e);
}
}
this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout);
this.touchableDelayTimeout = null;
},
_playTouchSound: function _playTouchSound() {
UIManager.playTouchSound();
},
_startHighlight: function _startHighlight(e) {
this._savePressInLocation(e);
this.touchableHandleActivePressIn && this.touchableHandleActivePressIn(e);
},
_endHighlight: function _endHighlight(e) {
var _this2 = this;
if (this.touchableHandleActivePressOut) {
if (this.touchableGetPressOutDelayMS && this.touchableGetPressOutDelayMS()) {
this.pressOutDelayTimeout = setTimeout(function() {
_this2.touchableHandleActivePressOut(e);
}, this.touchableGetPressOutDelayMS());
} else {
this.touchableHandleActivePressOut(e);
}
}
},
touchableHandleKeyEvent: function touchableHandleKeyEvent(e) {
var type = e.type, key = e.key;
if (key === "Enter" || key === " ") {
if (type === "keydown") {
if (!this._isTouchableKeyboardActive) {
if (!this.state.touchable.touchState || this.state.touchable.touchState === States.NOT_RESPONDER) {
this.touchableHandleResponderGrant(e);
this._isTouchableKeyboardActive = true;
}
}
} else if (type === "keyup") {
if (this._isTouchableKeyboardActive) {
if (this.state.touchable.touchState && this.state.touchable.touchState !== States.NOT_RESPONDER) {
this.touchableHandleResponderRelease(e);
this._isTouchableKeyboardActive = false;
}
}
}
e.stopPropagation();
if (!(key === "Enter" && AccessibilityUtil.propsToAriaRole(this.props) === "link")) {
e.preventDefault();
}
}
},
withoutDefaultFocusAndBlur: {}
};
var TouchableMixinWithoutDefaultFocusAndBlur = _objectWithoutPropertiesLoose$h(TouchableMixin, ["touchableHandleFocus", "touchableHandleBlur"]);
TouchableMixin.withoutDefaultFocusAndBlur = TouchableMixinWithoutDefaultFocusAndBlur;
var Touchable = {
Mixin: TouchableMixin,
TOUCH_TARGET_DEBUG: false,
renderDebugView: function renderDebugView(_ref) {
var color = _ref.color, hitSlop = _ref.hitSlop;
if (!Touchable.TOUCH_TARGET_DEBUG) {
return null;
}
var debugHitSlopStyle = {};
hitSlop = hitSlop || {
top: 0,
bottom: 0,
left: 0,
right: 0
};
for (var key in hitSlop) {
debugHitSlopStyle[key] = -hitSlop[key];
}
var normalizedColor = normalizeColor$1(color);
if (typeof normalizedColor !== "number") {
return null;
}
var hexColor = "#" + ("00000000" + normalizedColor.toString(16)).substr(-8);
return /* @__PURE__ */ React__default.createElement(View, {
pointerEvents: "none",
style: _objectSpread$m({
position: "absolute",
borderColor: hexColor.slice(0, -2) + "55",
borderWidth: 1,
borderStyle: "dashed",
backgroundColor: hexColor.slice(0, -2) + "0F"
}, debugHitSlopStyle)
});
}
};
function _extends$i() {
_extends$i = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$i.apply(this, arguments);
}
function _objectWithoutPropertiesLoose$i(source, excluded) {
if (source == null)
return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0)
continue;
target[key] = source[key];
}
return target;
}
function createExtraStyles(activeOpacity, underlayColor) {
return {
child: {
opacity: activeOpacity !== null && activeOpacity !== void 0 ? activeOpacity : 0.85
},
underlay: {
backgroundColor: underlayColor === void 0 ? "black" : underlayColor
}
};
}
function hasPressHandler(props) {
return props.onPress != null || props.onPressIn != null || props.onPressOut != null || props.onLongPress != null;
}
function TouchableHighlight(props, forwardedRef) {
var activeOpacity = props.activeOpacity, children = props.children, delayPressIn = props.delayPressIn, delayPressOut = props.delayPressOut, delayLongPress = props.delayLongPress, disabled = props.disabled, focusable = props.focusable, onHideUnderlay = props.onHideUnderlay, onLongPress = props.onLongPress, onPress = props.onPress, onPressIn = props.onPressIn, onPressOut = props.onPressOut, onShowUnderlay = props.onShowUnderlay, rejectResponderTermination = props.rejectResponderTermination, style = props.style, testOnly_pressed = props.testOnly_pressed, underlayColor = props.underlayColor, rest = _objectWithoutPropertiesLoose$i(props, ["activeOpacity", "children", "delayPressIn", "delayPressOut", "delayLongPress", "disabled", "focusable", "onHideUnderlay", "onLongPress", "onPress", "onPressIn", "onPressOut", "onShowUnderlay", "rejectResponderTermination", "style", "testOnly_pressed", "underlayColor"]);
var hostRef = useRef(null);
var setRef = useMergeRefs(forwardedRef, hostRef);
var _useState = useState(testOnly_pressed === true ? createExtraStyles(activeOpacity, underlayColor) : null), extraStyles = _useState[0], setExtraStyles = _useState[1];
var showUnderlay = useCallback(function() {
if (!hasPressHandler(props)) {
return;
}
setExtraStyles(createExtraStyles(activeOpacity, underlayColor));
if (onShowUnderlay != null) {
onShowUnderlay();
}
}, [activeOpacity, onShowUnderlay, props, underlayColor]);
var hideUnderlay = useCallback(function() {
if (testOnly_pressed === true) {
return;
}
if (hasPressHandler(props)) {
setExtraStyles(null);
if (onHideUnderlay != null) {
onHideUnderlay();
}
}
}, [onHideUnderlay, props, testOnly_pressed]);
var pressConfig = useMemo(function() {
return {
cancelable: !rejectResponderTermination,
disabled,
delayLongPress,
delayPressStart: delayPressIn,
delayPressEnd: delayPressOut,
onLongPress,
onPress,
onPressStart: function onPressStart(event3) {
showUnderlay();
if (onPressIn != null) {
onPressIn(event3);
}
},
onPressEnd: function onPressEnd(event3) {
hideUnderlay();
if (onPressOut != null) {
onPressOut(event3);
}
}
};
}, [delayLongPress, delayPressIn, delayPressOut, disabled, onLongPress, onPress, onPressIn, onPressOut, rejectResponderTermination, showUnderlay, hideUnderlay]);
var pressEventHandlers = usePressEvents(hostRef, pressConfig);
var child = Children.only(children);
return /* @__PURE__ */ createElement$1(View, _extends$i({}, rest, pressEventHandlers, {
accessibilityDisabled: disabled,
focusable: !disabled && focusable !== false,
ref: setRef,
style: [styles$k.root, style, !disabled && styles$k.actionable, extraStyles && extraStyles.underlay]
}), /* @__PURE__ */ cloneElement(child, {
style: StyleSheet.compose(child.props.style, extraStyles && extraStyles.child)
}));
}
var styles$k = StyleSheet.create({
root: {
userSelect: "none"
},
actionable: {
cursor: "pointer",
touchAction: "manipulation"
}
});
var MemoedTouchableHighlight = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef(TouchableHighlight));
MemoedTouchableHighlight.displayName = "TouchableHighlight";
function _inheritsLoose$q(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf$q(subClass, superClass);
}
function _setPrototypeOf$q(o, p) {
_setPrototypeOf$q = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf$q(o, p);
}
var UnimplementedView = /* @__PURE__ */ function(_React$Component) {
_inheritsLoose$q(UnimplementedView2, _React$Component);
function UnimplementedView2() {
return _React$Component.apply(this, arguments) || this;
}
var _proto = UnimplementedView2.prototype;
_proto.setNativeProps = function setNativeProps3() {
};
_proto.render = function render3() {
return /* @__PURE__ */ React__default.createElement(View, {
style: [unimplementedViewStyles, this.props.style]
}, this.props.children);
};
return UnimplementedView2;
}(React__default.Component);
var unimplementedViewStyles = {};
var forwardPropsList$3 = {
accessibilityDisabled: true,
accessibilityLabel: true,
accessibilityLiveRegion: true,
accessibilityRole: true,
accessibilityState: true,
accessibilityValue: true,
children: true,
disabled: true,
focusable: true,
nativeID: true,
onBlur: true,
onFocus: true,
onLayout: true,
testID: true
};
var pickProps$3 = function pickProps5(props) {
return pick(props, forwardPropsList$3);
};
function TouchableWithoutFeedback(props, forwardedRef) {
var delayPressIn = props.delayPressIn, delayPressOut = props.delayPressOut, delayLongPress = props.delayLongPress, disabled = props.disabled, focusable = props.focusable, onLongPress = props.onLongPress, onPress = props.onPress, onPressIn = props.onPressIn, onPressOut = props.onPressOut, rejectResponderTermination = props.rejectResponderTermination;
var hostRef = useRef(null);
var pressConfig = useMemo(function() {
return {
cancelable: !rejectResponderTermination,
disabled,
delayLongPress,
delayPressStart: delayPressIn,
delayPressEnd: delayPressOut,
onLongPress,
onPress,
onPressStart: onPressIn,
onPressEnd: onPressOut
};
}, [disabled, delayPressIn, delayPressOut, delayLongPress, onLongPress, onPress, onPressIn, onPressOut, rejectResponderTermination]);
var pressEventHandlers = usePressEvents(hostRef, pressConfig);
var element = Children.only(props.children);
var children = [element.props.children];
var supportedProps = pickProps$3(props);
supportedProps.accessibilityDisabled = disabled;
supportedProps.focusable = !disabled && focusable !== false;
supportedProps.ref = useMergeRefs(forwardedRef, hostRef, element.ref);
var elementProps = Object.assign(supportedProps, pressEventHandlers);
return /* @__PURE__ */ cloneElement.apply(React, [element, elementProps].concat(children));
}
var MemoedTouchableWithoutFeedback = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef(TouchableWithoutFeedback));
MemoedTouchableWithoutFeedback.displayName = "TouchableWithoutFeedback";
function YellowBox(props) {
return /* @__PURE__ */ React__default.createElement(UnimplementedView, props);
}
YellowBox.ignoreWarnings = function() {
};
var LogBox = {
ignoreLogs: function ignoreLogs() {
},
ignoreAllLogs: function ignoreAllLogs() {
},
uninstall: function uninstall() {
},
install: function install() {
}
};
var promiseMock = function promiseMock2() {
return Promise.resolve(false);
};
var index$1 = {
PERMISSIONS: {},
RESULTS: {},
checkPermission: promiseMock,
check: promiseMock,
requestPermission: promiseMock,
request: promiseMock,
requestMultiple: promiseMock
};
var index$2 = {};
var index$3 = {};
var index$4 = {};
function useColorScheme() {
var _React$useState = useState(Appearance.getColorScheme()), colorScheme = _React$useState[0], setColorScheme = _React$useState[1];
useEffect(function() {
function listener(appearance) {
setColorScheme(appearance.colorScheme);
}
Appearance.addChangeListener(listener);
return function() {
return Appearance.removeChangeListener(listener);
};
});
return colorScheme;
}
function useWindowDimensions() {
var _useState = useState(function() {
return Dimensions.get("window");
}), dims = _useState[0], setDims = _useState[1];
useEffect(function() {
function handleChange(_ref) {
var window2 = _ref.window;
setDims(window2);
}
Dimensions.addEventListener("change", handleChange);
setDims(Dimensions.get("window"));
return function() {
Dimensions.removeEventListener("change", handleChange);
};
}, []);
return dims;
}
export {AccessibilityInfo, ActivityIndicator, Alert, Animated, AppRegistry, AppState, Appearance, BackHandler, Button, CheckBox, Clipboard, RCTDeviceEventEmitter$1 as DeviceEventEmitter, DeviceInfo, Dimensions, UnimplementedView as DrawerLayoutAndroid, Easing, FlatList, I18nManager, Image, ImageBackground, UnimplementedView as InputAccessoryView, InteractionManager, Keyboard, KeyboardAvoidingView, LayoutAnimation, index as Linking, LogBox, Modal, NativeEventEmitter, NativeModules, PanResponder, index$1 as PermissionsAndroid, Picker, PixelRatio, Platform, MemoedPressable as Pressable, ProgressBar, RefreshControl, SafeAreaView, ScrollView, SectionList, index$2 as Settings, Share, StatusBar, StyleSheet, Switch, index$3 as Systrace, index$4 as TVEventHandler, Text, TextInput, UnimplementedView as ToastAndroid, Touchable, MemoedTouchableHighlight as TouchableHighlight, UnimplementedView as TouchableNativeFeedback, MemoedTouchableOpacity as TouchableOpacity, MemoedTouchableWithoutFeedback as TouchableWithoutFeedback, UIManager, Vibration, View, VirtualizedList, YellowBox, findNodeHandle, processColor, createElement as unstable_createElement, useColorScheme, useWindowDimensions};
export default null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment