Files
2026-07-28 01:06:53 +03:00

86 lines
5.4 KiB
TypeScript

/* Metro module 13537; source: modules/quests/native/BountiesModal/useBountyVideoProgressPersistence.tsx; dependencies: [57, 31, 7092, 6528, 9530, 13533, 9532, 2] */
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
import BountyStore from '../../BountyStore.tsx'; /* Metro dependency 7092 */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as QuestConstantsModule from '../../QuestConstants.tsx'; /* Metro dependency 6528 */
import * as BountiesStage1ExperimentModule from '../../experiments/BountiesStage1Experiment.tsx'; /* Metro dependency 9530 */
function _fun102883(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#102883, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13727:6, offset: 0x0224ca4f, size: 189 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_6 = {'timestampSec': 0, 'maxTimestampSec': 0, 'duration': 0};
(FileImportTrackerModule).fileFinishedImporting('modules/quests/native/BountiesModal/useBountyVideoProgressPersistence.tsx');
exports.useBountyVideoProgressPersistence = useBountyVideoProgressPersistence;
function useBountyVideoProgressPersistence({bountyId, endMode}) { // fn#102884, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13727:353, offset: 0x0224cb0c, size: 284 bytes, params: 2, frame: 17
const BountiesStage1Experiment = (BountiesStage1ExperimentModule).BountiesStage1Experiment;
const useConfig = BountiesStage1Experiment.useConfig;
const VIDEO_MODAL_MOBILE = QuestsExperimentLocations.VIDEO_MODAL_MOBILE;
const enabled = Reflect.apply(useConfig, BountiesStage1Experiment, [{location: VIDEO_MODAL_MOBILE}]).enabled;
const enabled2 = enabled;
const binding = env0_3;
const property = enabled2(binding.useState(_fun102885), 1)[0];
var env0_3 = binding.useRef(0);
const env0_4 = binding.useRef(property.timestampSec);
const env0_5 = binding.useRef(property.maxTimestampSec);
const env0_6 = binding.useRef(property.duration);
object = {initialProgress: property};
object.handleProgress = binding.useCallback(_fun102886, [enabled, bountyId]);
object.flushProgress = binding.useCallback(_fun102887, [enabled, bountyId]);
return object;
function _fun102885() { // fn#102885, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13727:524, offset: 0x0224cc28, size: 136 bytes, params: 1, frame: 15
var bountyStoreBinding;
var value3;
if (enabled) {
bountyStoreBinding = BountyStore;
value3 = bountyStoreBinding.getBountyVideoProgress(bountyId);
return value3 == null ? env1_6 : endMode !== (require(13533) /* metro dependency 13533: useBountiesModalTiming */).BountyVideoEndMode.LOOP ? value3.timestampSec <= 5 ? env1_6 : value3 : value3.duration > 0 && value3.maxTimestampSec >= value3.duration - 1 || value3.timestampSec <= 5 ? env1_6 : value3;
}
return env1_6;
}
function _fun102886(a0, a1, a2) { // fn#102886, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13727:902, offset: 0x0224ccb0, size: 143 bytes, params: 4, frame: 16
var value3;
var moduleValue;
env0_4.current = a2;
env0_5.current = a0;
env0_6.current = a1;
if (enabled && a2 >= env0_3.current) {
env0_3.current = a2 + 1;
value3 = environment.__proto__;
moduleValue = require(9532) /* metro dependency 9532: BountyActionCreators */;
moduleValue.setBountyVideoProgress(bountyId, {timestampSec: a2, maxTimestampSec: a0, duration: a1});
}
}
function _fun102887() { // fn#102887, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13727:1099, offset: 0x0224cd3f, size: 98 bytes, params: 1, frame: 15
var value2;
var moduleValue;
var setBountyVideoProgress;
var bountyIdBinding;
var object;
var current;
if (enabled) {
value2 = environment.__proto__;
moduleValue = require(9532) /* metro dependency 9532: BountyActionCreators */;
setBountyVideoProgress = moduleValue.setBountyVideoProgress;
bountyIdBinding = bountyId;
object = {};
current = env0_4.current;
object.timestampSec = current;
current = env0_5.current;
object.maxTimestampSec = current;
current = env0_6.current;
object.duration = current;
Reflect.apply(setBountyVideoProgress, moduleValue, [bountyIdBinding, object]);
}
}
}
}
global.__d(_fun102883, 13537, [57, 31, 7092, 6528, 9530, 13533, 9532,
2]) /* metro module 13537, dependencies: [57, 31, 7092, 6528, 9530, 13533, 9532, 2] */;