import{c as u}from"./index-Ef5HIHwv.js";function c(){return u({queryKey:["fx-rates-usd"],queryFn:async()=>{const n=localStorage.getItem("platform_token"),e=await fetch("/api/reports/fx-rates",{headers:{Authorization:`Bearer ${n}`}});if(!e.ok)throw new Error(`FX fetch failed (${e.status})`);const r=await e.json();return(r==null?void 0:r.data)||r},staleTime:6*60*60*1e3,gcTime:24*60*60*1e3})}function f(n,e,r){var s;const t=Number(n);if(!Number.isFinite(t))return 0;const a=String(e).toUpperCase();if(a==="USD")return t;const o=(s=r==null?void 0:r.rates)==null?void 0:s[a];return!o||o<=0?t:t/o}export{f as c,c as u};
