decord/source/modules/user_profile/WidgetAssetUtils.tsx

37 lines
959 B
TypeScript
Raw Normal View History

// Module ID: 8591
// Function ID: 8592
2026-08-06 08:05:19 +00:00
// Name: getWidgetAssetURL
// Dependencies: [673, 1431, 2]
2026-08-06 08:05:19 +00:00
// Exports: getWidgetAssetURL
// Module 8591 (getWidgetAssetURL)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
2026-09-02 09:53:35 +00:00
import ME from "ME" /* 673 */;
import getAvatarURL from "getAvatarURL" /* 1431 */;
2026-08-06 08:05:19 +00:00
2026-08-24 06:08:38 +00:00
const DEFAULT_CDN_HOST = ME.DEFAULT_CDN_HOST;
const result = set.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";
2026-08-24 06:08:38 +00:00
if (!getAvatarURL.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
};