iBet uBet web content aggregator. Adding the entire web to your favor.
iBet uBet web content aggregator. Adding the entire web to your favor.



Link to original content: http://ecommerceDB.com/_nuxt/EoaUGGBW.js
import{i as m,g as L}from"./llFuKhWI.js";const x=()=>{const s=L(),{$api:u}=m();function $(n,e){const t=s.public.cdnURL;n=n.replace(/^\//,"");const o=[".png",".jpg",".jpeg"].some(c=>n.includes(c));return e?`${t}/favicons/${e}/${n}${o?"":".png"}`:`${t}/favicons/${n}${o?"":".png"}`}function f(n,e){return`${s.public.cdnURL}/screenshots/${e}/${n}`}function U(n,e){const t=s.public.cdnURL,o=[".png",".jpg",".jpeg"].some(c=>n.includes(c));return`${t}/icons/${e}/${n}${o?"":".png"}`}function g(n,e){const t=s.public.cdnURL;return e=e.replace(/\/$/,"").replace(/^\//,""),`${t}/${e}/${n}`}const b=(n,e)=>{const t=document.createElement("a");t.setAttribute("href",URL.createObjectURL(n)),t.setAttribute("download",e),t.click(),URL.revokeObjectURL(t.href)},a=async(n,e,t,o)=>{var i,l,d,p;const c=t?{method:e,body:JSON.stringify(t),responseType:"arrayBuffer"}:{method:e,responseType:"arrayBuffer"},r=await u.raw(n,c),y=r._data.type??((i=r.headers)==null?void 0:i.get("content-type")),w=(p=(d=(l=r.headers)==null?void 0:l.get("content-disposition"))==null?void 0:d.match(/filename="([\w\d_\-.]*)"/))==null?void 0:p[1],R=new Blob([r._data],{type:y});b(R,o??w??"unnamed_file")};return{downloadPost:async(n,e,t)=>a(n,"POST",e,t),downloadGet:async(n,e)=>a(n,"GET",null,e),getFaviconUrl:$,getIconUrl:U,getScreenshotUrl:f,getStaticUrl:g}};export{x as u};