decord/alpha/source/modules/activities/utils/useEmbeddedActivityBackground.tsx

217 lines
6 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 10922
// Function ID: 10923
2026-07-20 16:05:17 +00:00
// Name: useEmbeddedActivityBackground
2026-10-09 10:00:15 +00:00
// Dependencies: [32, 19, 558, 576, 8258, 2]
2026-07-20 16:05:17 +00:00
2026-10-09 10:00:15 +00:00
// Module 10922 (useEmbeddedActivityBackground)
2026-10-03 08:58:59 +00:00
import _slicedToArray_mod from "_slicedToArray" /* 32 */;
import react_mod from "react" /* 19 */;
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
import size from "module_2" /* 2 */;
2026-07-20 16:05:17 +00:00
2026-10-08 09:57:35 +00:00
let nextPromise;
2026-07-20 16:05:17 +00:00
2026-10-03 08:58:59 +00:00
let _slicedToArray = _slicedToArray_mod;
let react = react_mod;
2026-10-08 09:57:35 +00:00
let ref = ["embedded_cover", "embedded_background"];
let tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? (function useEmbeddedActivityBackground(applicationId) {
2026-10-03 08:58:59 +00:00
let closure_3;
let format;
let names;
2026-10-08 09:57:35 +00:00
let tmp15;
2026-10-03 08:58:59 +00:00
let tmp5;
let tmp7;
const tmp = applicationId;
let obj = applicationId(names[3]);
const cResult = obj.c(13);
applicationId = applicationId.applicationId;
const tmp2 = names;
({ size, names, format } = applicationId);
if (undefined === names) {
names = ref;
}
let str = "png";
if (undefined !== format) {
str = format;
}
let tmp4 = _slicedToArray(react.useState(null), 2);
[tmp5, _slicedToArray] = tmp4;
[, react] = react.useState(true);
if (cResult[0] === applicationId) {
if (cResult[1] === tmp5) {
if (cResult[2] === str) {
let tmp8;
let tmp10;
let tmp13;
let tmp12;
if (cResult[3] === size) {
tmp8 = cResult[4];
}
let str2 = "loading";
if (!tmp7) {
let str3 = "not-found";
if (null != tmp8) {
str3 = "fetched";
}
str2 = str3;
}
ref = obj2.useRef(names);
if (cResult[5] !== names) {
2026-10-08 09:57:35 +00:00
class B {
constructor() {
closure_4.current = closure_1;
return;
}
}
2026-10-03 08:58:59 +00:00
cResult[5] = names;
2026-10-08 09:57:35 +00:00
cResult[6] = B;
tmp10 = B;
2026-10-03 08:58:59 +00:00
} else {
2026-10-08 09:57:35 +00:00
class B {
constructor() {
closure_4.current = closure_1;
return;
}
}
2026-10-03 08:58:59 +00:00
}
const effect = obj2.useEffect(tmp10);
if (cResult[7] !== applicationId) {
2026-10-08 09:57:35 +00:00
class O {
constructor() {
current = closure_4.current;
if (null != current) {
tmp2 = applicationId;
tmp3 = closure_1;
obj = applicationId(closure_1[4]);
assets = obj.getAssets(tmp);
2026-10-09 10:00:15 +00:00
nextPromise = assets.then(() => { /* body not rendered: F142720 */ });
2026-10-08 09:57:35 +00:00
}
return;
2026-10-03 08:58:59 +00:00
}
2026-10-08 09:57:35 +00:00
}
2026-10-03 08:58:59 +00:00
const items = [applicationId];
cResult[7] = applicationId;
2026-10-08 09:57:35 +00:00
cResult[8] = O;
2026-10-03 08:58:59 +00:00
cResult[9] = items;
tmp13 = items;
2026-10-08 09:57:35 +00:00
tmp12 = O;
2026-10-03 08:58:59 +00:00
} else {
2026-10-08 09:57:35 +00:00
class O {
constructor() {
current = closure_4.current;
if (null != current) {
tmp2 = applicationId;
tmp3 = closure_1;
obj = applicationId(closure_1[4]);
assets = obj.getAssets(tmp);
2026-10-09 10:00:15 +00:00
nextPromise = assets.then(() => { /* body not rendered: F142720 */ });
2026-10-08 09:57:35 +00:00
}
return;
}
}
2026-10-03 08:58:59 +00:00
tmp13 = cResult[9];
}
const effect1 = obj2.useEffect(tmp12, tmp13);
if (cResult[10] === tmp8) {
2026-10-08 09:57:35 +00:00
class O {
constructor() {
current = closure_4.current;
if (null != current) {
tmp2 = applicationId;
tmp3 = closure_1;
obj = applicationId(closure_1[4]);
assets = obj.getAssets(tmp);
2026-10-09 10:00:15 +00:00
nextPromise = assets.then(() => { /* body not rendered: F142720 */ });
2026-10-08 09:57:35 +00:00
}
return;
}
2026-10-03 08:58:59 +00:00
}
return tmp15;
}
const obj3 = { url: tmp8, state: str2 };
cResult[10] = tmp8;
cResult[11] = str2;
cResult[12] = obj3;
tmp15 = obj3;
}
}
}
const tmpResult = tmp(tmp2[4]);
const assetImage = tmpResult.getAssetImage(applicationId, tmp5, size, str);
cResult[0] = applicationId;
cResult[1] = tmp5;
cResult[2] = str;
cResult[3] = size;
cResult[4] = assetImage;
tmp8 = assetImage;
2026-10-08 09:57:35 +00:00
}) : (function useEmbeddedActivityBackground(applicationId) {
2026-10-03 08:58:59 +00:00
let c2;
let closure_3;
let first;
let names;
let tmp2;
2026-07-20 16:05:17 +00:00
applicationId = applicationId.applicationId;
({ size, names } = applicationId);
if (names === undefined) {
names = ref;
2026-07-20 16:05:17 +00:00
}
let str = applicationId.format;
if (str === undefined) {
str = "png";
}
_slicedToArray = undefined;
2026-10-03 08:58:59 +00:00
react = undefined;
ref = undefined;
2026-10-03 08:58:59 +00:00
let obj = react;
const tmp = _slicedToArray(react.useState(null), 2);
[tmp2, c2] = tmp;
[first, react] = react.useState(true);
const obj2 = applicationId(names[4]);
const url = obj2.getAssetImage(applicationId, tmp2, size, str);
2026-07-29 08:29:29 +00:00
let state = "loading";
2026-10-03 08:58:59 +00:00
if (!first) {
2026-07-20 16:05:17 +00:00
let str3 = "not-found";
2026-07-29 08:29:29 +00:00
if (null != url) {
2026-07-20 16:05:17 +00:00
str3 = "fetched";
}
2026-07-29 08:29:29 +00:00
state = str3;
2026-07-20 16:05:17 +00:00
}
ref = obj.useRef(names);
2026-07-29 08:29:29 +00:00
const effect = obj.useEffect(() => {
2026-10-03 08:58:59 +00:00
ref.current = names;
2026-07-20 16:05:17 +00:00
});
const items = [applicationId];
2026-07-29 08:29:29 +00:00
const effect1 = obj.useEffect(() => {
2026-07-23 10:11:24 +00:00
const current = ref.current;
if (null != current) {
2026-10-03 08:58:59 +00:00
const tmp3 = names;
let obj = applicationId(names[4]);
const assets = obj.getAssets(tmp);
assets.then((result) => {
2026-10-03 08:58:59 +00:00
let tmp6;
closure_3(false);
const entries = Object.entries(result);
2026-07-29 08:29:29 +00:00
const obj = entries[Symbol.iterator]();
while (obj !== undefined) {
let tmp5 = _slicedToArray(tmp3, 2);
2026-07-29 08:29:29 +00:00
[r10020, tmp6] = tmp5;
let tmp7 = tmp6;
if (null != tmp6) {
if ("" !== tmp7.id) {
if (current.includes(tmp7.name)) {
let tmp12 = c2(tmp6.id);
2026-07-29 08:29:29 +00:00
obj.return();
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
continue;
2026-07-20 16:05:17 +00:00
}
});
}
}, items);
2026-07-29 08:29:29 +00:00
return { url, state };
2026-10-03 08:58:59 +00:00
});
const result = size.fileFinishedImporting("modules/activities/utils/useEmbeddedActivityBackground.tsx");
export default tmp2;