decord/source/modules/share/native/ShareScreenModal.tsx
2026-08-06 08:05:19 +00:00

285 lines
8.4 KiB
TypeScript

// Module ID: 13162
// Function ID: 13163
// Name: onClose
// Dependencies: [5, 32, 19, 1372, 13114, 21, 3, 4490, 8847, 589, 4295, 692, 13163, 2]
// Exports: default
// Module 13162 (onClose)
import jsxProd from "jsxProd";
import _slicedToArray from "_slicedToArray";
import noop from "noop";
import ensureGuildLoaded from "ensureGuildLoaded";
import { SHARE_SCREEN_MODAL_KEY } from "SHARE_SCREEN_MODAL_KEY";
import { jsx } from "jsxProd";
let require = arg1;
function onClose() {
importDefault(4490).popWithKey(SHARE_SCREEN_MODAL_KEY);
}
let c9 = new require("ensureGuildLoaded")("ShareScreenModal");
const tmp2 = new require("ensureGuildLoaded")("ShareScreenModal");
const result = require("noop").fileFinishedImporting("modules/share/native/ShareScreenModal.tsx");
export default function ShareScreenModal(text) {
text = text.text;
const require = text;
const channelId = text.channelId;
const shareId = text.shareId;
const attachmentManifest = text.attachmentManifest;
let first;
let React;
let stateFromStores;
let closure_7;
let first1;
let obj = React;
let tmp = first(React.useState(null), 2);
first = tmp[0];
React = tmp[1];
let items = [shareId, attachmentManifest];
const effect = React.useEffect(() => {
function _fetchAttachments() {
const self = this;
const tmp = attachmentManifest(function*() {
if (v0 === 2) {
v0 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp6 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
return { value: "T", done: null };
}
} else {
try {
v0 = 2;
if (0 === c4) {
if (arg0 === 1) {
v0 = 3;
throw arg1;
} else if (arg0 === 2) {
v0 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
let closure_1 = tmp3;
let closure_0 = tmp7;
closure_0 = undefined;
if (undefined !== outer1_2) {
if (undefined !== c3) {
c3 = 1;
let obj1 = outer2_1(outer2_2[8]);
c4 = 2;
v0 = 1;
obj1 = { value: null, done: false };
obj1[0] = obj1.sharedAttachments(tmp20, tmp21);
return obj1;
}
}
}
} else {
if (1 === tmp7) {
c3 = 0;
closure_1 = closure_2;
outer2_9.error("Error fetching attachments:", closure_1);
} else if (arg0 === 1) {
v0 = 3;
throw arg1;
} else if (arg0 !== 2) {
closure_0 = arg1;
v0(closure_0);
c3 = 0;
}
c3 = 0;
v0 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
}
v0 = 3;
} catch (tmp24) {
closure_2 = tmp24;
if (tmp4 === c3) {
v0 = tmp2;
throw tmp24;
} else {
c4 = tmp;
}
}
}
});
const _fetchAttachments = tmp;
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
}
!(function fetchAttachments() {
const self = this;
const apply = _fetchAttachments.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
})();
}, items);
const items1 = [stateFromStores];
stateFromStores = require(shareId[9]).useStateFromStores(items1, () => stateFromStores.getChannel(channelId));
const tmp6 = first(React.useState(null), 2);
closure_7 = tmp6[1];
const items2 = [channelId, stateFromStores];
const effect1 = React.useEffect(() => {
function _fetchChannel() {
const self = this;
const tmp = attachmentManifest(function*() {
if (c5 === 2) {
c5 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp6 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
return { value: "T", done: null };
}
} else {
try {
c5 = 2;
if (0 === c4) {
if (arg0 === 1) {
c5 = 3;
throw arg1;
} else if (arg0 === 2) {
c5 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
let closure_1 = tmp3;
let closure_0 = tmp7;
closure_0 = undefined;
if (null != outer1_1) {
if (null == outer1_6) {
let c3 = 1;
let obj1 = outer2_1(outer2_2[10]);
c4 = 2;
c5 = 1;
obj1 = { value: null, done: false };
obj1[0] = obj1.fetchChannel(tmp20);
return obj1;
}
}
}
} else {
if (1 === tmp7) {
c3 = 0;
closure_1 = closure_2;
outer2_9.error("Error fetching channel:", closure_1);
} else if (arg0 === 1) {
c5 = 3;
throw arg1;
} else if (arg0 !== 2) {
closure_0 = arg1;
outer1_7(closure_0);
c3 = 0;
}
c3 = 0;
c5 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
}
c5 = 3;
} catch (tmp24) {
closure_2 = tmp24;
if (tmp4 === c3) {
c5 = tmp2;
throw tmp24;
} else {
c4 = tmp;
}
}
}
});
const _fetchChannel = tmp;
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
}
!(function fetchChannel() {
const self = this;
const apply = _fetchChannel.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
})();
}, items2);
first1 = stateFromStores;
if (stateFromStores == null) {
first1 = tmp6[0];
}
const items3 = [text, first, channelId, first1];
const memo = obj.useMemo(() => {
const obj = { text: closure_0, attachments: null };
let items = first;
if (first == null) {
items = [];
}
obj[1] = items;
if (null != first1) {
if (tmp.type !== text(shareId[11]).ChannelTypes.DM) {
obj.targetChannelId = channelId;
} else {
let isArray = tmp;
if (tmp) {
isArray = "recipients" in tmp;
}
if (isArray) {
const _Array = Array;
isArray = Array.isArray(tmp.recipients);
}
if (isArray) {
obj.targetUserId = tmp.recipients[0];
} else {
let tmp4 = tmp;
if (tmp) {
tmp4 = "recipient" in tmp;
}
if (tmp4) {
tmp4 = "id" in tmp.recipient;
}
if (tmp4) {
const recipient = tmp.recipient;
let id;
if (recipient != null) {
id = recipient.id;
}
obj.targetUserId = id;
}
}
}
}
return obj;
}, items3);
obj = { sharedContent: memo, onClose };
return first1(channelId(shareId[12]), obj);
};