2026-07-25 08:10:48 +00:00
|
|
|
// Module ID: 6205
|
2026-07-27 11:26:19 +00:00
|
|
|
// Function ID: 55667
|
2026-07-20 16:05:17 +00:00
|
|
|
// Name: useDiscountOffer
|
2026-07-25 08:10:48 +00:00
|
|
|
// Dependencies: [57, 31, 1850, 6157, 1852, 566, 3777, 4016, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: default
|
|
|
|
|
|
2026-07-25 08:10:48 +00:00
|
|
|
// Module 6205 (useDiscountOffer)
|
2026-07-23 10:11:24 +00:00
|
|
|
import _slicedToArray from "_slicedToArray";
|
|
|
|
|
import result from "result";
|
|
|
|
|
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
|
|
|
|
|
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
|
|
|
|
|
import GuildFeatures from "GuildFeatures";
|
|
|
|
|
|
|
|
|
|
let closure_6;
|
|
|
|
|
let closure_7;
|
|
|
|
|
const require = arg1;
|
|
|
|
|
({ PREMIUM_TIER_2_CHURN_1_MONTH_DISCOUNT_ID: closure_6, PREMIUM_TIER_2_CHURN_3_MONTH_DISCOUNT_ID: closure_7 } = GuildFeatures);
|
|
|
|
|
const result = require("_isNativeReflectConstruct").fileFinishedImporting("modules/premium/hooks/useDiscountOffer.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
export default function useDiscountOffer(arg0, arg1) {
|
2026-07-23 10:11:24 +00:00
|
|
|
const _require = arg0;
|
|
|
|
|
const items = [_createForOfIteratorHelperLoose];
|
|
|
|
|
stateFromStores = _require(stateFromStores[5]).useStateFromStores(items, () => outer1_5.getUserDiscountOffer(closure_0));
|
2026-07-20 16:05:17 +00:00
|
|
|
let hasExpiredResult;
|
|
|
|
|
if (null != stateFromStores) {
|
|
|
|
|
hasExpiredResult = stateFromStores.hasExpired();
|
|
|
|
|
}
|
2026-07-23 10:11:24 +00:00
|
|
|
const tmp4 = first(React.useState(null != hasExpiredResult && hasExpiredResult), 2);
|
|
|
|
|
first = tmp4[0];
|
|
|
|
|
React = tmp4[1];
|
|
|
|
|
const obj = _require(stateFromStores[5]);
|
2026-07-20 16:05:17 +00:00
|
|
|
const tmp3 = null != hasExpiredResult && hasExpiredResult;
|
2026-07-23 10:11:24 +00:00
|
|
|
const items1 = [_isNativeReflectConstruct];
|
2026-07-20 16:05:17 +00:00
|
|
|
const items2 = [first, stateFromStores];
|
2026-07-23 10:11:24 +00:00
|
|
|
const stateFromStores1 = _require(stateFromStores[5]).useStateFromStores(items1, () => callback(stateFromStores[6]).isPremium(outer1_4.getCurrentUser()));
|
2026-07-20 16:05:17 +00:00
|
|
|
const effect = React.useEffect(() => {
|
2026-07-23 10:11:24 +00:00
|
|
|
if (null != startTimer) {
|
|
|
|
|
if (startTimer.hasAcknowledged()) {
|
|
|
|
|
const Timeout = callback(stateFromStores[7]).Timeout;
|
2026-07-20 16:05:17 +00:00
|
|
|
const prototype = Timeout.prototype;
|
|
|
|
|
const timeout = new Timeout();
|
2026-07-23 10:11:24 +00:00
|
|
|
startTimer = function startTimer() {
|
2026-07-20 16:05:17 +00:00
|
|
|
if (null != startTimer) {
|
|
|
|
|
if (startTimer.hasAcknowledged()) {
|
|
|
|
|
let num = 0;
|
|
|
|
|
if (null != startTimer.expiresAt) {
|
|
|
|
|
const expiresAt = startTimer.expiresAt;
|
|
|
|
|
const _Date = Date;
|
|
|
|
|
const time = expiresAt.getTime();
|
|
|
|
|
num = time - Date.now();
|
|
|
|
|
}
|
|
|
|
|
if (null != timeout) {
|
|
|
|
|
timeout.start(num, () => {
|
2026-07-23 10:11:24 +00:00
|
|
|
if (!outer2_2) {
|
|
|
|
|
if (startTimer.hasExpired()) {
|
|
|
|
|
outer2_3(true);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-07-23 10:11:24 +00:00
|
|
|
outer1_1();
|
2026-07-20 16:05:17 +00:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-07-23 10:11:24 +00:00
|
|
|
};
|
2026-07-20 16:05:17 +00:00
|
|
|
startTimer();
|
|
|
|
|
return () => timeout.stop();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, items2);
|
|
|
|
|
let tmp8 = null;
|
|
|
|
|
if (!first) {
|
|
|
|
|
if (stateFromStores1) {
|
|
|
|
|
if (!arg1) {
|
|
|
|
|
if (arg0 !== closure_6) {
|
|
|
|
|
tmp8 = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
tmp8 = stateFromStores;
|
|
|
|
|
}
|
|
|
|
|
return tmp8;
|
|
|
|
|
};
|