decord/alpha/source/modules/user_profile/WidgetAssetUtils.tsx

39 lines
1,002 B
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 13303
// Function ID: 13304
// Name: WidgetAssetUtils
2026-10-09 10:00:15 +00:00
// Dependencies: [1085, 1415, 2]
2026-08-06 08:05:19 +00:00
// Exports: getWidgetAssetURL
2026-10-09 10:00:15 +00:00
// Module 13303 (WidgetAssetUtils)
2026-10-03 08:58:59 +00:00
import Constants from "Constants" /* 1085 */;
2026-10-09 10:00:15 +00:00
import AvatarUtils from "AvatarUtils" /* 1415 */;
import size from "module_2" /* 2 */;
2026-08-06 08:05:19 +00:00
2026-10-03 08:58:59 +00:00
let CDN_HOST;
const DEFAULT_CDN_HOST = Constants.DEFAULT_CDN_HOST;
const result = size.fileFinishedImporting("modules/user_profile/WidgetAssetUtils.tsx");
2026-08-06 08:05:19 +00:00
2026-08-14 17:33:39 +00:00
export const getWidgetAssetURL = function getWidgetAssetURL(arg0, fileId, arg2) {
let obj = arg2;
if (arg2 === undefined) {
obj = {};
}
let flag = obj.animated;
if (flag === undefined) {
flag = false;
}
2026-08-06 08:05:19 +00:00
if (CDN_HOST == null) {
CDN_HOST = DEFAULT_CDN_HOST;
}
2026-08-14 17:33:39 +00:00
let str = "webp";
if (!AvatarUtils.SUPPORTS_WEBP) {
2026-08-14 17:33:39 +00:00
let str2 = "png";
if (flag) {
str2 = "gif";
}
str = str2;
}
return "https://" + CDN_HOST + "/widget-assets/" + arg0 + "/" + fileId + "?format=" + str + "&animated=" + flag;
2026-08-06 08:05:19 +00:00
};