decord/alpha/source/modules/applications/useGuildEmbeddedApplications.tsx

184 lines
5.2 KiB
TypeScript
Raw Permalink Normal View History

2026-10-12 06:59:38 +00:00
// Module ID: 8610
// Function ID: 8611
// Name: useGuildEmbeddedApplications
2026-10-12 06:59:38 +00:00
// Dependencies: [5, 19, 5440, 1085, 504, 1102, 1388, 6853, 558, 576, 2]
2026-09-02 09:53:35 +00:00
2026-10-12 06:59:38 +00:00
// Module 8610 (useGuildEmbeddedApplications)
2026-10-03 08:58:59 +00:00
import react2 from "react" /* 576 */;
import Constants from "Constants" /* 1085 */;
import DurationsDefault from "Durations" /* 1102 */;
2026-10-12 06:59:38 +00:00
import ApplicationActionCreatorsDefault from "ApplicationActionCreators" /* 6853 */;
2026-10-03 08:58:59 +00:00
import _asyncToGenerator from "_asyncToGenerator" /* 5 */;
import react from "react" /* 19 */;
2026-10-10 08:08:14 +00:00
import ApplicationStore from "ApplicationStore" /* 5440 */;
2026-10-03 08:58:59 +00:00
import get_initialized from "get initialized" /* 504 */;
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
import size from "module_2" /* 2 */;
2026-09-02 09:53:35 +00:00
2026-10-03 08:58:59 +00:00
const require = globalThis.__r;
let application, c3, c4, status;
const QueryIds = Constants.QueryIds;
let obj = {
getQueryId: QueryIds.GUILD_EMBEDDED_APPLICATIONS,
failureStaleAfter: DurationsDefault.Seconds.MINUTE,
2026-09-02 09:53:35 +00:00
get(arg0, arg1) {
2026-10-03 08:58:59 +00:00
let tmp2 = ApplicationStore;
const getGuildEmbeddedApplications = ApplicationStore.getGuildEmbeddedApplications;
const guildEmbeddedApplications = getGuildEmbeddedApplications(arg1, arg0);
2026-09-02 09:53:35 +00:00
let found = null;
if (null != guildEmbeddedApplications) {
2026-10-03 08:58:59 +00:00
const mapped = guildEmbeddedApplications.map((status) => {
status = status.status;
application = application.getApplication(status.applicationId);
2026-09-02 09:53:35 +00:00
let tmp2 = null;
if (null != application) {
2026-10-03 08:58:59 +00:00
tmp2 = { application, status };
const obj = { application, status };
2026-09-02 09:53:35 +00:00
}
return tmp2;
});
found = mapped.filter(require("GlobalUtils").isNotNullish);
2026-09-02 09:53:35 +00:00
}
return found;
},
2026-10-08 09:57:35 +00:00
load() {
2026-10-03 08:58:59 +00:00
return closure_3(...arguments);
}
2026-09-02 09:53:35 +00:00
};
2026-10-03 08:58:59 +00:00
const createFetchStore = get_initialized.createFetchStore;
let closure_3 = _asyncToGenerator(async (arg0, value, arg2) => {
let closure_0;
let closure_2;
let obj2;
let closure_1 = value;
if (c3 === 2) {
c3 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
2026-10-03 08:58:59 +00:00
} else if (tmp2 === 3) {
if (arg0 === 1) {
throw value;
} else if (arg0 === 2) {
const obj3 = { value, done: true };
return obj3;
2026-09-02 09:53:35 +00:00
} else {
2026-10-12 06:59:38 +00:00
return { value: "IconComponent", done: null };
}
} else {
try {
c3 = 2;
if (0 === c4) {
if (arg0 === 1) {
2026-09-02 09:53:35 +00:00
c3 = 3;
throw value;
2026-09-02 09:53:35 +00:00
} else if (arg0 === 2) {
c3 = 3;
const obj4 = { value, done: true };
return obj4;
} else if (null != closure_1) {
c4 = 1;
c3 = 1;
2026-10-03 08:58:59 +00:00
const obj5 = { value: obj2.getEmbeddedApplicationsForGuild(tmp5, tmp4, tmp6), done: false };
obj2 = ApplicationActionCreatorsDefault;
return obj5;
2026-09-02 09:53:35 +00:00
}
} else if (arg0 === 1) {
2026-09-02 09:53:35 +00:00
c3 = 3;
throw value;
} else if (arg0 === 2) {
c3 = 3;
const obj = { value, done: true };
return obj;
2026-09-02 09:53:35 +00:00
}
c3 = 3;
2026-10-12 06:59:38 +00:00
return { value: "IconComponent", done: null };
2026-10-03 08:58:59 +00:00
} catch (tmp10) {
c3 = 3;
throw tmp10;
2026-09-02 09:53:35 +00:00
}
}
2026-09-02 09:53:35 +00:00
});
2026-10-03 08:58:59 +00:00
let closure_6 = createFetchStore(ApplicationStore, obj);
2026-10-08 09:57:35 +00:00
const tmp5 = ReactCompilerGating.isReactCompilerEnabled() ? (function useGuildEmbeddedApplications(arg0, arg1, arg2) {
2026-10-03 08:58:59 +00:00
const obj = react2;
const cResult = obj.c(6);
const tmp2 = closure_6(arg0, arg1, arg2);
const data = tmp2.data;
const error = tmp2.error;
const isLoading = tmp2.isLoading;
const refetch = tmp2.refetch;
let closure_4 = react.useRef(false);
const obj2 = react;
if (cResult[0] === data) {
if (cResult[1] === error) {
if (cResult[2] === isLoading) {
let tmp3;
let tmp4;
if (cResult[3] === refetch) {
tmp3 = cResult[4];
tmp4 = cResult[5];
}
const effect = obj2.useEffect(tmp3, tmp4);
return tmp2;
}
}
2026-09-02 09:53:35 +00:00
}
2026-10-08 09:57:35 +00:00
const fn = function s() {
2026-10-03 08:58:59 +00:00
if (null != data) {
ref.current = true;
} else {
let current = ref.current;
const tmp = ref;
if (current) {
current = !isLoading;
}
if (current) {
current = null == error;
}
if (current) {
tmp.current = false;
refetch();
}
}
};
const items = [data, isLoading, error, refetch];
cResult[0] = data;
cResult[1] = error;
cResult[2] = isLoading;
cResult[3] = refetch;
cResult[4] = fn;
cResult[5] = items;
tmp4 = items;
tmp3 = fn;
2026-10-08 09:57:35 +00:00
}) : (function useGuildEmbeddedApplications(arg0, arg1, arg2) {
2026-10-03 08:58:59 +00:00
let tmp = closure_6(arg0, arg1, arg2);
2026-09-02 09:53:35 +00:00
const data = tmp.data;
const error = tmp.error;
2026-09-02 09:53:35 +00:00
const isLoading = tmp.isLoading;
const refetch = tmp.refetch;
2026-10-03 08:58:59 +00:00
let closure_4 = react.useRef(false);
2026-09-02 09:53:35 +00:00
const items = [data, isLoading, error, refetch];
2026-10-03 08:58:59 +00:00
const effect = react.useEffect(() => {
2026-09-02 09:53:35 +00:00
if (null != data) {
ref.current = true;
} else {
let current = ref.current;
2026-10-03 08:58:59 +00:00
const tmp = ref;
2026-09-02 09:53:35 +00:00
if (current) {
current = !isLoading;
}
if (current) {
current = null == error;
}
if (current) {
tmp.current = false;
refetch();
}
}
}, items);
return tmp;
2026-10-03 08:58:59 +00:00
});
const result = size.fileFinishedImporting("modules/applications/useGuildEmbeddedApplications.tsx");
export const useGuildEmbeddedApplications = tmp5;