Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4943.js (118.4 MB)
153 lines
5.6 KiB
TypeScript
153 lines
5.6 KiB
TypeScript
// Module ID: 7491
|
|
// Function ID: 7492
|
|
// Name: safeTransitionTo
|
|
// Dependencies: [5, 2067, 1078, 4912, 7492, 1105, 7493, 5111, 1119, 7520, 2618, 7559, 2]
|
|
// Exports: default
|
|
|
|
// Module 7491 (safeTransitionTo)
|
|
import router_utils from "router_utils" /* 1105 */;
|
|
import LinkUtils from "LinkUtils" /* 4912 */;
|
|
import DiceRollActionCreators from "DiceRollActionCreators" /* 7492 */;
|
|
import isAccessibleChannelOrThreadPathDefault from "isAccessibleChannelOrThreadPath" /* 7493 */;
|
|
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
|
|
import GuildStore from "GuildStore" /* 2067 */;
|
|
|
|
require = fn;
|
|
let closure_6 = async function _safeTransitionTo(arg0, value) {
|
|
if (c6 === 2) {
|
|
c6 = 3;
|
|
throw new TypeError("Generator functions may not be called on executing generators");
|
|
} else if (tmp4 === 3) {
|
|
if (arg0 === 1) {
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
const obj2 = { value, done: true };
|
|
return obj2;
|
|
} else {
|
|
return { value: "IconComponent", done: null };
|
|
}
|
|
} else {
|
|
try {
|
|
c6 = 2;
|
|
if (0 === c5) {
|
|
if (arg0 === 1) {
|
|
c6 = 3;
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
c6 = 3;
|
|
const obj4 = { value, done: true };
|
|
return obj4;
|
|
} else {
|
|
c4 = 0;
|
|
closure_3 = tmp2;
|
|
closure_131_0 = closure_0;
|
|
closure_131_1 = closure_1;
|
|
closure_131_2 = undefined;
|
|
guild = undefined;
|
|
let channelId2;
|
|
const tryParseDiceRollLinkResult = LinkUtils.tryParseDiceRollLink(closure_0);
|
|
if (null != tryParseDiceRollLinkResult) {
|
|
const channelId = tryParseDiceRollLinkResult.channelId;
|
|
({ guildId, diceCount, diceSides } = tryParseDiceRollLinkResult);
|
|
DiceRollActionCreators.startDiceRoll(channelId, diceCount, diceSides);
|
|
router_utils.transitionTo(Routes.CHANNEL(guildId, channelId), tmp82);
|
|
c6 = 3;
|
|
const obj5 = { value: undefined, done: true };
|
|
return obj5;
|
|
} else {
|
|
const tryParseChannelPathResult = LinkUtils.tryParseChannelPath(tmp81);
|
|
closure_131_2 = tryParseChannelPathResult;
|
|
if (null != tryParseChannelPathResult) {
|
|
c5 = 1;
|
|
c6 = 1;
|
|
const obj6 = { value: isAccessibleChannelOrThreadPathDefault(tryParseChannelPathResult), done: false };
|
|
return obj6;
|
|
}
|
|
}
|
|
tmp81 = closure_0;
|
|
tmp82 = closure_1;
|
|
}
|
|
} else {
|
|
if (1 === tmp5) {
|
|
if (arg0 === 1) {
|
|
c6 = 3;
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
c6 = 3;
|
|
const obj9 = { value, done: true };
|
|
return obj9;
|
|
} else if (!value) {
|
|
const obj11 = { title: null, body: null, confirmText: null };
|
|
const intl = closure_132_0(closure_132_2[8]).intl;
|
|
obj11.title = intl.string(closure_132_0(closure_132_2[8]).t.r0DLNm);
|
|
const intl2 = closure_132_0(closure_132_2[8]).intl;
|
|
obj11.body = intl2.string(closure_132_0(closure_132_2[8]).t["6Y0JlN"]);
|
|
const intl3 = closure_132_0(closure_132_2[8]).intl;
|
|
obj11.confirmText = intl3.string(closure_132_0(closure_132_2[8]).t.BddRzS);
|
|
closure_132_1(closure_132_2[7]).show(obj11);
|
|
c6 = 3;
|
|
const obj3 = closure_132_1(closure_132_2[7]);
|
|
}
|
|
} else if (arg0 === 1) {
|
|
c6 = 3;
|
|
throw value;
|
|
} else if (arg0 !== 2) {
|
|
if (!value) {
|
|
closure_132_0(closure_132_2[5]).transitionTo(closure_131_0, closure_131_1);
|
|
const obj = closure_132_0(closure_132_2[5]);
|
|
}
|
|
}
|
|
c6 = 3;
|
|
const obj12 = { value, done: true };
|
|
return obj12;
|
|
}
|
|
if (null != closure_131_2) {
|
|
if (null != closure_131_2.guildId) {
|
|
guild = closure_132_4.getGuild(closure_131_2.guildId);
|
|
channelId2 = closure_131_2.channelId;
|
|
if (null != guild) {
|
|
if (obj7.isModeratorReportOrPostChannelId(channelId2)) {
|
|
const obj15 = { title: null, body: null, confirmText: null };
|
|
const intl4 = closure_132_0(closure_132_2[8]).intl;
|
|
obj15.title = intl4.string(closure_132_1(closure_132_2[10]).iCIEAV);
|
|
const intl5 = closure_132_0(closure_132_2[8]).intl;
|
|
obj15.body = intl5.string(closure_132_1(closure_132_2[10]).bvzo6p);
|
|
const intl6 = closure_132_0(closure_132_2[8]).intl;
|
|
obj15.confirmText = intl6.string(closure_132_0(closure_132_2[8]).t.BddRzS);
|
|
closure_132_1(closure_132_2[7]).show(obj15);
|
|
c6 = 3;
|
|
const obj16 = { value: undefined, done: true };
|
|
return obj16;
|
|
}
|
|
obj7 = closure_132_0(closure_132_2[9]);
|
|
}
|
|
}
|
|
}
|
|
closure_2 = closure_131_2;
|
|
if (closure_131_2 == null) {
|
|
closure_2 = { guildId: "emoji" };
|
|
}
|
|
c5 = 2;
|
|
c6 = 1;
|
|
const obj17 = { value: closure_132_1(closure_132_2[11]).maybePerformRoleSubscriptionUpsellRedirect(closure_2), done: false };
|
|
return obj17;
|
|
} catch (tmp76) {
|
|
c6 = tmp;
|
|
throw tmp76;
|
|
}
|
|
}
|
|
};
|
|
const Routes = fn(1078).Routes;
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/links/safeTransitionTo.native.tsx");
|
|
|
|
export default function safeTransitionTo() {
|
|
const self = this;
|
|
const apply = closure_6.apply;
|
|
if (typeof apply === "unknown") {
|
|
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
|
|
} else {
|
|
applyArgumentsResult = apply(self, arguments);
|
|
}
|
|
return applyArgumentsResult;
|
|
};
|