14 lines
658 B
TypeScript
14 lines
658 B
TypeScript
// Metro module 12170 (f12171).
|
|
import { getAPIBaseURL } from "../../_bundle/sendRequest";
|
|
import { getBestMediaProxySize } from "../image_upload/ImageLoaderUtils";
|
|
export function getApplicationAssetUrl(a0, a1, a2) {
|
|
const r36 = window.GLOBAL_ENV.CDN_HOST != null ? new URL(`${location.protocol}//${window.GLOBAL_ENV.CDN_HOST}/app-assets/${a0}/${a1.asset_id}.webp`) : new URL(`${getAPIBaseURL()}/applications/${a0}/app-assets/${a1.asset_id}.webp`);
|
|
if (a2 != null) {
|
|
r36.searchParams.set("size", getBestMediaProxySize(a2).toString());
|
|
}
|
|
if (a1.metadata.is_animated) {
|
|
r36.searchParams.set("animated", "true");
|
|
}
|
|
return r36.toString();
|
|
}
|