// Metro module 373 (f374). import _classCallCheck from "./_classCallCheck"; import _createClass from "./_createClass"; import _possibleConstructorReturn from "./_possibleConstructorReturn"; import _getPrototypeOf from "./_getPrototypeOf"; import _get from "./_get"; import _inherits from "./_inherits"; import AnimatedValue from "./AnimatedValue"; import Module38 from "./Module38"; import AnimatedWithChildren from "./AnimatedWithChildren"; function $mk66349($env) { return function(a0) { const r0 = $env; return r0[1].apply(r0[0], a0); }; } let AnimatedValueXY; let env394 = {}; env394[6] = function _isNativeReflectConstruct() { let c12287_0; try { c12287_0 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); } catch ($e) {} const _isNativeReflectConstruct2 = function _isNativeReflectConstruct() { return !!c12287_0; }; env394[6] = _isNativeReflectConstruct2; return _isNativeReflectConstruct2(); }; env394[7] = 1; AnimatedValueXY = function AnimatedValueXY(a0, a1) { _classCallCheck(this, AnimatedValueXY); const r12 = [a1]; const r11 = _getPrototypeOf(AnimatedValueXY); const r23 = (0, env394[6])() ? Reflect.construct(r11, r12, _getPrototypeOf(this).constructor) : r11.apply(this, r12); let r27 = a0; const r28 = _possibleConstructorReturn(this, r23); if (!a0) { r27 = { x: 0, y: 0 }; } if (typeof r27.x === "number" && typeof r27.y === "number") { r28.x = new AnimatedValue(r27.x); r28.y = new AnimatedValue(r27.y); } else { Module38(r27.x instanceof AnimatedValue && r27.y instanceof AnimatedValue, "AnimatedValueXY must be initialized with an object of numbers or AnimatedValues."); r28.x = r27.x; r28.y = r27.y; } r28._listeners = {}; if (a1 ? a1.useNativeDriver : a1) { r28.__makeNative(); } return r28; }; _inherits(AnimatedValueXY, AnimatedWithChildren); export default _createClass(AnimatedValueXY, [{ key: "setValue", value: function setValue(a0) { this.x.setValue(a0.x); this.y.setValue(a0.y); } }, { key: "setOffset", value: function setOffset(a0) { this.x.setOffset(a0.x); this.y.setOffset(a0.y); } }, { key: "flattenOffset", value: function flattenOffset() { this.x.flattenOffset(); this.y.flattenOffset(); } }, { key: "extractOffset", value: function extractOffset() { this.x.extractOffset(); this.y.extractOffset(); } }, { key: "__getValue", value: function __getValue() { return { x: this.x.__getValue(), y: this.y.__getValue() }; } }, { key: "resetAnimation", value: function resetAnimation(a0) { this.x.resetAnimation(); this.y.resetAnimation(); if (a0) { a0(this.__getValue()); } } }, { key: "stopAnimation", value: function stopAnimation(a0) { this.x.stopAnimation(); this.y.stopAnimation(); if (a0) { a0(this.__getValue()); } } }, { key: "addListener", value: function addListener(c23724_0) { const r3 = String; const r10 = +env394[7]; env394[7] = r10 + 1; const r11 = r3(r10); const jointCallback = (a0) => { a0.value; c23724_0(this.__getValue()); }; this._listeners[r11] = { x: this.x.addListener(jointCallback), y: this.y.addListener(jointCallback) }; return r11; } }, { key: "removeListener", value: function removeListener(a0) { this.x.removeListener(this._listeners[a0].x); this.y.removeListener(this._listeners[a0].y); delete this._listeners[a0]; } }, { key: "removeAllListeners", value: function removeAllListeners() { this.x.removeAllListeners(); this.y.removeAllListeners(); this._listeners = {}; } }, { key: "getLayout", value: function getLayout() { return { left: this.x, top: this.y }; } }, { key: "getTranslateTransform", value: function getTranslateTransform() { return [{ translateX: this.x }, { translateY: this.y }]; } }, { key: "__attach", value: function __attach() { let env23725; this.x.__addChild(this); this.y.__addChild(this); const r12 = env23725 = {}; env23725[0] = this; env23725[1] = void 0; let r17 = _get(_getPrototypeOf(AnimatedValueXY.prototype), "__attach", this); env23725[1] = r17; if (typeof r17 === "function") { r17 = $mk66349(r12); } r17([]); } }, { key: "__detach", value: function __detach() { let env23726; this.x.__removeChild(this); this.y.__removeChild(this); const r12 = env23726 = {}; env23726[0] = this; env23726[1] = void 0; let r17 = _get(_getPrototypeOf(AnimatedValueXY.prototype), "__detach", this); env23726[1] = r17; if (typeof r17 === "function") { r17 = $mk66349(r12); } r17([]); } }, { key: "__makeNative", value: function __makeNative(a0) { let env23727; this.x.__makeNative(a0); this.y.__makeNative(a0); const r13 = env23727 = {}; env23727[0] = this; env23727[1] = void 0; let r18 = _get(_getPrototypeOf(AnimatedValueXY.prototype), "__makeNative", this); env23727[1] = r18; if (typeof r18 === "function") { r18 = $mk66349(r13); } r18([a0]); } }]);