decord/source/modules/share/native/ShareScreenModal.tsx

286 lines
8.4 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 13125
// Function ID: 13126
2026-07-20 16:05:17 +00:00
// Name: onClose
2026-08-05 07:35:12 +00:00
// Dependencies: [5, 32, 19, 1372, 13077, 21, 3, 4460, 8818, 589, 4265, 692, 13126, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-05 07:35:12 +00:00
// Module 13125 (onClose)
2026-07-23 10:11:24 +00:00
import jsxProd from "jsxProd";
import _slicedToArray from "_slicedToArray";
2026-07-29 08:29:29 +00:00
import noop from "noop";
import ensureGuildLoaded from "ensureGuildLoaded";
2026-07-23 10:11:24 +00:00
import { SHARE_SCREEN_MODAL_KEY } from "SHARE_SCREEN_MODAL_KEY";
import { jsx } from "jsxProd";
let require = arg1;
2026-07-20 16:05:17 +00:00
function onClose() {
2026-08-05 07:35:12 +00:00
importDefault(4460).popWithKey(SHARE_SCREEN_MODAL_KEY);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let c9 = new require("ensureGuildLoaded")("ShareScreenModal");
const tmp2 = new require("ensureGuildLoaded")("ShareScreenModal");
const result = require("noop").fileFinishedImporting("modules/share/native/ShareScreenModal.tsx");
2026-07-20 16:05:17 +00:00
export default function ShareScreenModal(text) {
text = text.text;
2026-07-23 10:11:24 +00:00
const require = text;
2026-07-20 16:05:17 +00:00
const channelId = text.channelId;
const shareId = text.shareId;
const attachmentManifest = text.attachmentManifest;
2026-07-29 08:29:29 +00:00
let first;
let React;
let stateFromStores;
let closure_7;
let first1;
let obj = React;
let tmp = first(React.useState(null), 2);
2026-07-23 10:11:24 +00:00
first = tmp[0];
React = tmp[1];
2026-07-29 08:29:29 +00:00
let items = [shareId, attachmentManifest];
2026-07-20 16:05:17 +00:00
const effect = React.useEffect(() => {
function _fetchAttachments() {
2026-07-29 08:29:29 +00:00
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 {
2026-08-05 07:35:12 +00:00
return { value: "T", done: null };
2026-07-29 08:29:29 +00:00
}
} 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;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
!(function fetchAttachments() {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _fetchAttachments.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-23 10:11:24 +00:00
})();
2026-07-20 16:05:17 +00:00
}, items);
2026-07-23 10:11:24 +00:00
const items1 = [stateFromStores];
2026-07-29 08:29:29 +00:00
stateFromStores = require(shareId[9]).useStateFromStores(items1, () => stateFromStores.getChannel(channelId));
const tmp6 = first(React.useState(null), 2);
closure_7 = tmp6[1];
2026-07-20 16:05:17 +00:00
const items2 = [channelId, stateFromStores];
const effect1 = React.useEffect(() => {
function _fetchChannel() {
2026-07-29 08:29:29 +00:00
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 {
2026-08-05 07:35:12 +00:00
return { value: "T", done: null };
2026-07-29 08:29:29 +00:00
}
} 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;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
!(function fetchChannel() {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _fetchChannel.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-23 10:11:24 +00:00
})();
2026-07-20 16:05:17 +00:00
}, items2);
2026-07-29 08:29:29 +00:00
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;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
let isArray = tmp;
if (tmp) {
isArray = "recipients" in tmp;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (isArray) {
const _Array = Array;
isArray = Array.isArray(tmp.recipients);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
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;
2026-07-20 16:05:17 +00:00
}
}
}
}
2026-07-29 08:29:29 +00:00
return obj;
2026-07-20 16:05:17 +00:00
}, items3);
obj = { sharedContent: memo, onClose };
2026-07-29 08:29:29 +00:00
return first1(channelId(shareId[12]), obj);
2026-07-20 16:05:17 +00:00
};