107 lines
5.2 KiB
TypeScript
107 lines
5.2 KiB
TypeScript
/* Metro module 14953; source: lib/TapSequencer.tsx; dependencies: [57, 6, 7, 31, 2] */
|
|
function _fun113090(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#113090, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15150:6, offset: 0x023e88e1, size: 243 bytes, params: 8, frame: 19
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_0 = importDefault(57) /* metro dependency 57 */;
|
|
let env0_1 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_2 = importDefault(7) /* metro dependency 7 */;
|
|
let value = require(31) /* metro dependency 31 */;
|
|
const env0_3 = value.useState;
|
|
const env0_4 = value.useEffect;
|
|
const env0_6 = {'long': 1250, 'short': 500};
|
|
value = _fun113091();
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('lib/TapSequencer.tsx');
|
|
exports.TapSequencerPressType = {SHORT: 'short', LONG: 'long'};
|
|
exports.TapSequencer = value;
|
|
exports.useTapSequencer = function(a0) {
|
|
var property = a0(useState(_fun113100), 1)[0];
|
|
var env0_1 = property;
|
|
useEffect(_fun113101);
|
|
return property;
|
|
};
|
|
}
|
|
|
|
function _fun113091() { // fn#113091, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15150:247, offset: 0x023e89d4, size: 138 bytes, params: 1, frame: 15
|
|
return env0_2(TapSequencer, [{key: 'setTapSequenceHandlers', value: function(a0) {
|
|
this.tapSequenceHandlers = a0;
|
|
}}, {key: 'getState', value: value_113096}, {key: 'progressState', value: function(a0) {
|
|
var r1;
|
|
var object;
|
|
var value = null;
|
|
if (value == a0) {
|
|
r1 = value;
|
|
} else {
|
|
object = {handlers: a0};
|
|
object.timestamp = global.Date.now();
|
|
r1 = object;
|
|
}
|
|
this._state = r1;
|
|
}}, {key: 'handlePress', value: function(a0) {
|
|
var r4;
|
|
var value = this.getState(a0);
|
|
var progressState = this.progressState;
|
|
var property = value[a0];
|
|
var value2 = undefined;
|
|
if (property == null) {
|
|
r4 = value2;
|
|
} else {
|
|
value = property.call(value);
|
|
r4 = value;
|
|
}
|
|
Reflect.apply(progressState, this, [r4 ?? value2]);
|
|
return value2;
|
|
}}]);
|
|
}
|
|
|
|
function useTapSequencer(a0) { // fn#113099, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15150:1095, offset: 0x023e8bea, size: 71 bytes, params: 2, frame: 15
|
|
const property = a0(useState(_fun113100), 1)[0];
|
|
useEffect(_fun113101);
|
|
return property;
|
|
}
|
|
|
|
function TapSequencer(a0) { // fn#113092, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15150:268, offset: 0x023e8a5e, size: 76 bytes, params: 2, frame: 14
|
|
env1_1(this, TapSequencer);
|
|
this.tapSequenceHandlers = a0;
|
|
this._state = null;
|
|
this.handleShortPress = handleShortPress;
|
|
this.handleLongPress = handleLongPress;
|
|
}
|
|
|
|
function value_113096(a0) { // fn#113096, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15150:562, offset: 0x023e8afc, size: 110 bytes, params: 2, frame: 12
|
|
const Date = global.Date;
|
|
const value = Date.now();
|
|
if (this._state === null || this._state.timestamp + env1_6[a0] < value) {
|
|
this._state = {handlers: this.tapSequenceHandlers, timestamp: value};
|
|
}
|
|
return this._state.handlers;
|
|
}
|
|
|
|
function _fun113100() { // fn#113100, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15150:1132, offset: 0x023e8c31, size: 66 bytes, params: 1, frame: 12
|
|
let value = environment.__proto__;
|
|
const binding = env1_7;
|
|
const r0 = typeof env0_0 === 'function' ? env0_0() : env0_0;
|
|
value = Object.create(binding.prototype, {constructor: {value: binding}});
|
|
const binding2 = new binding();
|
|
return binding2 instanceof Object ? binding2 : value;
|
|
}
|
|
|
|
function _fun113101() { // fn#113101, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15150:1194, offset: 0x023e8c73, size: 55 bytes, params: 1, frame: 13
|
|
const binding = env0_1;
|
|
binding.setTapSequenceHandlers(typeof env0_0 === 'function' ? env0_0() : env0_0);
|
|
}
|
|
|
|
function handleShortPress() { // fn#113093, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15150:380, owner: TapSequencer.handleShortPress, offset: 0x023e8aaa, size: 33 bytes, params: 1, frame: 11
|
|
const binding = env0_0;
|
|
const handlePress = binding.handlePress;
|
|
const SHORT = env2_5.SHORT;
|
|
return Reflect.apply(handlePress, binding, [SHORT]);
|
|
}
|
|
|
|
function TapSequencerHandleLongPress() { // fn#113094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15150:431, owner: TapSequencer.handleLongPress, offset: 0x023e8acb, size: 33 bytes, params: 1, frame: 11
|
|
const binding = env0_0;
|
|
const handlePress = binding.handlePress;
|
|
const LONG = env2_5.LONG;
|
|
return Reflect.apply(handlePress, binding, [LONG]);
|
|
}
|
|
|