Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4792.js (118.4 MB)
189 lines
7.2 KiB
TypeScript
189 lines
7.2 KiB
TypeScript
// Module ID: 7477
|
|
// Function ID: 7478
|
|
// Name: GuildBoostPurchasingUtils
|
|
// Dependencies: [5, 4270, 1074, 1373, 4952, 1114, 1242, 4931, 7478, 7483, 7314, 7484, 7485, 4264, 2]
|
|
// Exports: launchGuildBoostFlowOrAlert
|
|
|
|
// Module 7477 (GuildBoostPurchasingUtils)
|
|
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
|
|
import SubscriptionStore from "SubscriptionStore" /* 4270 */;
|
|
|
|
const require = fn;
|
|
let closure_10 = async function _launchGuildBoostFlowOrAlert(arg0, value) {
|
|
if (c6 === 2) {
|
|
c6 = 3;
|
|
throw new TypeError("Generator functions may not be called on executing generators");
|
|
} else if (tmp5 === 3) {
|
|
if (arg0 === 1) {
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
const obj3 = { value, done: true };
|
|
return obj3;
|
|
} else {
|
|
return { value: "HermesInternal", done: null };
|
|
}
|
|
} else {
|
|
try {
|
|
c6 = 2;
|
|
if (0 === c5) {
|
|
if (arg0 === 1) {
|
|
c6 = 3;
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
c6 = 3;
|
|
const obj7 = { value, done: true };
|
|
return obj7;
|
|
} else {
|
|
closure_3 = tmp2;
|
|
dependencyMap = tmp6;
|
|
closure_130_0 = undefined;
|
|
closure_130_1 = undefined;
|
|
closure_130_2 = undefined;
|
|
closure_130_3 = undefined;
|
|
closure_130_4 = undefined;
|
|
closure_130_5 = undefined;
|
|
({ source: closure_130_0, analyticsLocations: closure_130_1, guildId: closure_130_2, onBack: closure_130_3, onPaymentSuccess: closure_130_4, onPaymentDismiss: closure_130_5 } = closure_0);
|
|
let premiumTypeSubscription;
|
|
let externalManagementMessage;
|
|
closure_130_8 = undefined;
|
|
let productIdFromSubscription;
|
|
closure_130_10 = undefined;
|
|
c5 = 1;
|
|
c6 = 1;
|
|
return { value: "PX_16", done: true };
|
|
}
|
|
} else {
|
|
if (1 === tmp6) {
|
|
if (arg0 === 1) {
|
|
c6 = 3;
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
c6 = 3;
|
|
const obj8 = { value, done: true };
|
|
return obj8;
|
|
} else if (closure_131_4.hasFetchedSubscriptions()) {
|
|
premiumTypeSubscription = closure_131_4.getPremiumTypeSubscription();
|
|
externalManagementMessage = closure_131_0(closure_131_2[8]).getExternalManagementMessage(premiumTypeSubscription);
|
|
if (null != externalManagementMessage) {
|
|
(function alertUnableToManageSub(body, source) {
|
|
const obj2 = { title: null, body: null };
|
|
const intl = closure_1_0(1114).intl;
|
|
obj2.title = intl.string(closure_1_0(1114).t["8P7MX0"]);
|
|
obj2.body = body;
|
|
closure_1_1(4952).show(obj2);
|
|
const obj = closure_1_1(4952);
|
|
closure_1_1(1242).track(constants.OPEN_MODAL, { type: closure_1_6.IOS_CANNOT_MANAGE_SUBSCRIPTION, source });
|
|
})(externalManagementMessage, closure_130_0);
|
|
} else {
|
|
closure_130_8 = null;
|
|
if (null != premiumTypeSubscription) {
|
|
c4 = 1;
|
|
productIdFromSubscription = closure_131_0(closure_131_2[9]).getProductIdFromSubscription(premiumTypeSubscription, true);
|
|
const tmp64 = closure_131_0(closure_131_2[10]).AppStorePremiumProductIdsToPremiumBundledItems[productIdFromSubscription];
|
|
let interval;
|
|
if (tmp64 != null) {
|
|
interval = tmp64.interval;
|
|
}
|
|
c1 = interval;
|
|
if (interval == null) {
|
|
c1 = null;
|
|
}
|
|
closure_130_8 = c1;
|
|
c4 = 0;
|
|
const obj11 = closure_131_0(closure_131_2[9]);
|
|
}
|
|
}
|
|
c6 = 3;
|
|
const obj4 = closure_131_0(closure_131_2[8]);
|
|
} else {
|
|
c5 = 2;
|
|
c6 = 1;
|
|
const obj9 = { value: closure_131_0(closure_131_2[7]).fetchSubscriptions(), done: false };
|
|
return obj9;
|
|
}
|
|
} else if (2 === tmp6) {
|
|
if (arg0 === 1) {
|
|
c6 = 3;
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
c6 = 3;
|
|
let obj = { value, done: true };
|
|
return obj;
|
|
}
|
|
} else {
|
|
c4 = 0;
|
|
closure_130_8 = null;
|
|
}
|
|
let mobileBoostingEnabled = closure_131_0(closure_131_2[11]).getMobileBoostingEnabled("GuildBoostPurchasing");
|
|
if (mobileBoostingEnabled) {
|
|
mobileBoostingEnabled = closure_130_8 === closure_131_9.YEAR;
|
|
}
|
|
closure_130_10 = mobileBoostingEnabled;
|
|
const obj5 = closure_131_0(closure_131_2[11]);
|
|
const obj10 = {
|
|
showCurrentPlan: false,
|
|
isBoostPurchaseFlow: true,
|
|
allowYearlyBundles: closure_130_10,
|
|
predicate(interval) {
|
|
let tmp = !closure_1_10;
|
|
if (closure_1_10) {
|
|
let tmp3 = interval.interval !== constants.YEAR;
|
|
if (!tmp3) {
|
|
tmp3 = interval.numPremiumGuild > 5;
|
|
}
|
|
tmp = !tmp3;
|
|
}
|
|
if (tmp) {
|
|
let num2 = 0;
|
|
if (interval.premiumTier === TIER_2.TIER_2) {
|
|
num2 = closure_2_7;
|
|
}
|
|
let num3 = 0;
|
|
const sum = interval.numPremiumGuild + num2;
|
|
if (null != closure_1_6) {
|
|
const numPremiumGuildSubscriptions = closure_0(4264).getNumPremiumGuildSubscriptions(closure_1_6.additionalPlans);
|
|
const obj = closure_0(4264);
|
|
num3 = numPremiumGuildSubscriptions + c1(4264).getNumIncludedPremiumGuildSubscriptionSlots(closure_1_6.planId);
|
|
const obj2 = c1(4264);
|
|
}
|
|
tmp = sum > num3;
|
|
}
|
|
return tmp;
|
|
},
|
|
analyticsLocation: closure_130_0,
|
|
analyticsLocations: closure_130_1,
|
|
guildId: closure_130_2,
|
|
onBack: closure_130_3,
|
|
onPaymentSuccess: closure_130_4,
|
|
onPaymentDismiss: closure_130_5
|
|
};
|
|
const result = closure_131_0(closure_131_2[12]).launchPremiumPlanSelect(obj10);
|
|
const obj6 = closure_131_0(closure_131_2[12]);
|
|
}
|
|
} catch (tmp45) {
|
|
if (tmp3 === c4) {
|
|
c6 = tmp;
|
|
throw tmp45;
|
|
} else {
|
|
c5 = tmp;
|
|
}
|
|
}
|
|
}
|
|
};
|
|
const Constants = fn(1074);
|
|
({ AnalyticEvents: hasOwnProperty, AnalyticsSections: metroRequire } = Constants);
|
|
const PremiumConstants = fn(1373);
|
|
({ NUM_FREE_GUILD_BOOSTS_WITH_PREMIUM: closure_7, PremiumTypes: closure_8, SubscriptionIntervalTypes: closure_9 } = PremiumConstants);
|
|
const size = fn(2);
|
|
let result = size.fileFinishedImporting("modules/guild_boosting/native/GuildBoostPurchasingUtils.tsx");
|
|
|
|
export const launchGuildBoostFlowOrAlert = function launchGuildBoostFlowOrAlert() {
|
|
const self = this;
|
|
const apply = closure_10.apply;
|
|
if (typeof apply === "unknown") {
|
|
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
|
|
} else {
|
|
applyArgumentsResult = apply(self, arguments);
|
|
}
|
|
return applyArgumentsResult;
|
|
};
|