// Metro module 8099 (f8100). import { useReducer, useEffect } from "react"; import { Image as Image2, PixelRatio } from "react-native"; import { getCollectiblesItemAssetUrl, CollectiblesItemAssetFormat } from "../../utils/CollectiblesAssetUtils"; let c5137_6 = new Map(); export default function useProfileFrameLayerAsset({ skuId, layer, width }) { const collectiblesItemAssetUrl = getCollectiblesItemAssetUrl({ skuId, assetFormat: CollectiblesItemAssetFormat.STATIC, assetId: layer.id }); const [, dispatch] = useReducer((a0) => a0 + 1, 0); useEffect(() => { if (!(collectiblesItemAssetUrl == null || collectiblesItemAssetUrl === "" || c5137_6.has(collectiblesItemAssetUrl))) { Image2.getSize(collectiblesItemAssetUrl, (a0, a1) => { if (a0 > 0) { c5137_6.set(collectiblesItemAssetUrl, a1 / a0); dispatch(); } }, () => {}); } }, [collectiblesItemAssetUrl]); const r40 = collectiblesItemAssetUrl != null ? c5137_6.get(collectiblesItemAssetUrl) : void 0; const imageHeight = r40 != null ? r40 * width : 0; const r45 = collectiblesItemAssetUrl != null; let assetUrl = null; if (r45) { const r47 = r40 != null; assetUrl = null; if (r47) { const r55 = Math.round(width * PixelRatio.get()); assetUrl = `${collectiblesItemAssetUrl}?width=${r55}&height=${Math.round(r55 * r40)}`; } } return { assetUrl, imageHeight }; };