decord/source/modules/channel/useCreateChannelSubmit.tsx
2026-07-31 08:44:05 +00:00

219 lines
6.7 KiB
TypeScript

// Module ID: 8278
// Function ID: 8279
// Name: useCreateChannelSubmit
// Dependencies: [5, 32, 19, 676, 1906, 506, 8279, 4039, 1236, 2]
// Exports: default
// Module 8278 (useCreateChannelSubmit)
import fromString from "fromString";
import _slicedToArray from "_slicedToArray";
import noop from "noop";
import ME from "ME";
let error;
let metroImportAll;
const require = arg1;
({ ChannelTypes: error, Permissions: metroImportAll } = ME);
let obj = { PREMIUM_CHANNEL: 0, [0]: "PREMIUM_CHANNEL" };
const result = require("noop").fileFinishedImporting("modules/channel/useCreateChannelSubmit.tsx");
export default function useCreateChannelSubmit(arg0) {
let importDefault;
let tmp2;
let closure_0 = arg0;
[tmp2, importDefault] = callback2(React.useState(false), 2);
const tmp3 = callback2(React.useState({}), 2);
let closure_2 = tmp3[1];
closure_0 = undefined;
closure_0 = callback((arg0) => {
let closure_0 = arg0;
let c7 = 0;
let c8 = 0;
let c6 = 0;
const iter = (function*(arg0) {
let c0;
let c3;
let c4;
let c5;
let c6;
let c7;
let closure_1;
let closure_2;
if (body === 2) {
body = 3;
HermesBuiltin.throwTypeError();
} else if (tmp7 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
return { value: "HermesInternal", done: null };
}
} else {
try {
body = 2;
if (0 === c7) {
if (arg0 === 1) {
body = 3;
throw arg1;
} else if (arg0 === 2) {
body = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
c4 = tmp4;
c3 = tmp8;
let arr;
closure_1 = undefined;
let callback;
c3 = undefined;
c4 = undefined;
c5 = undefined;
c6 = undefined;
c7 = undefined;
({ overwrites: c0, bitrate: closure_1, userLimit: closure_2, createMode: c3, guildId: c4, name: c5, channelType: c6, categoryId: c7 } = arr);
body = undefined;
let closure_9;
let id;
let guild_id;
c7 = 1;
body = 1;
return { value: "ct", done: "Array" };
}
} else if (1 === tmp8) {
if (arg0 === 1) {
body = 3;
throw arg1;
} else if (arg0 === 2) {
body = 3;
let obj1 = { value: null, done: true };
obj1[0] = arg1;
return obj1;
} else {
if (outer1_3 === outer2_9.PREMIUM_CHANNEL) {
const obj2 = { id: null, type: null, deny: null, allow: null };
obj2[0] = c4;
obj2[1] = arr(outer2_3[4]).PermissionOverwriteType.ROLE;
obj2[2] = outer2_8.VIEW_CHANNEL;
obj2[3] = callback(outer2_3[5]).getFlag(0);
arr = arr.push(obj2);
const obj10 = callback(outer2_3[5]);
}
outer1_1(true);
c6 = 2;
obj1 = outer2_1(outer2_3[6]);
const obj3 = { guildId: null, type: null, name: null, permissionOverwrites: null, bitrate: null, userLimit: null, parentId: null };
obj3[0] = c4;
obj3[1] = c6;
obj3[2] = c5;
obj3[3] = arr;
obj3[4] = closure_1;
obj3[5] = callback;
let tmp60 = null;
if (c6 !== outer2_7.GUILD_CATEGORY) {
tmp60 = c7;
}
obj3[6] = tmp60;
c7 = 4;
body = 1;
const obj4 = { value: null, done: false };
obj4[0] = obj1.createChannel(obj3);
return obj4;
}
} else if (2 === tmp8) {
c6 = 0;
outer1_1(false);
throw c5;
} else {
if (3 === tmp8) {
c6 = 1;
const outer1_12 = c5;
const AccessibilityAnnouncer = arr(outer2_3[7]).AccessibilityAnnouncer;
const intl = arr(outer2_3[8]).intl;
AccessibilityAnnouncer.announce(intl.string(arr(outer2_3[8]).t["0SbUzm"]));
body = outer1_12.body;
let errors;
if (body != null) {
errors = body.errors;
}
closure_1 = errors;
if (errors == null) {
closure_1 = {};
}
outer1_2(closure_1);
c6 = 0;
outer1_1(false);
body = 3;
const tmp32 = outer1_2;
} else if (arg0 === 1) {
body = 3;
throw arg1;
} else if (arg0 !== 2) {
body = arg1;
if (null != body) {
const body2 = body.body;
callback = body2;
if (body2 == null) {
callback = {};
}
closure_9 = callback;
id = closure_9.id;
guild_id = closure_9.guild_id;
if (null != id) {
const AccessibilityAnnouncer2 = arr(outer2_3[7]).AccessibilityAnnouncer;
const intl2 = arr(outer2_3[8]).intl;
const obj5 = { name: null };
obj5[0] = c5;
AccessibilityAnnouncer2.announce(intl2.formatToPlainString(arr(outer2_3[8]).t.Wke70b, obj5));
if (arr != null) {
tmp85(outer1_10, outer1_11);
}
}
}
c6 = 1;
}
c6 = 0;
outer1_1(false);
body = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
}
} catch (tmp62) {
c5 = tmp62;
if (tmp5 === c6) {
body = tmp3;
throw tmp62;
} else if (tmp2 === tmp64) {
c7 = tmp;
} else {
c7 = tmp3;
}
}
}
})();
iter.next();
return iter;
});
const items = [arg0];
const items1 = [
tmp2,
tmp3[0],
React.useCallback(function() {
const self = this;
const apply = closure_0.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
}, items)
];
return items1;
};
export const CreateChannelMode = obj;