import{s as D,f as d,a as U,l as P,g as S,h as b,c as j,d as v,m as w,S as F,j as n,E as k,i as V,w as i,n as I,z as G}from"./scheduler.d3b9af56.js";import{S as B,i as M}from"./index.d66e54a8.js";import{T as N,a as A,b as H}from"./TopSong.svelte_svelte_type_style_lang.bb710323.js";const z=""+new URL("../assets/placeholder_artist.72e707df.svg",import.meta.url).href;function J(s){let e,t,l,g,o,a,r,c,m,E,R,_,u,p,T;return{c(){e=d("a"),t=d("picture"),l=d("source"),o=U(),a=d("img"),c=U(),m=d("div"),E=d("strong"),R=P(s[0]),_=U(),u=d("p"),p=P(s[1]),this.h()},l(h){e=S(h,"A",{href:!0,class:!0});var f=b(e);t=S(f,"PICTURE",{});var q=b(t);l=S(q,"SOURCE",{srcset:!0,media:!0}),o=j(q),a=S(q,"IMG",{class:!0,src:!0,alt:!0}),q.forEach(v),c=j(f),m=S(f,"DIV",{class:!0});var C=b(m);E=S(C,"STRONG",{class:!0});var L=b(E);R=w(L,s[0]),L.forEach(v),_=j(C),u=S(C,"P",{class:!0});var O=b(u);p=w(O,s[1]),O.forEach(v),C.forEach(v),f.forEach(v),this.h()},h(){F(l,g=s[3])||n(l,"srcset",g),n(l,"media","(max-width: 680px)"),n(a,"class","topArtist-image svelte-1t81opd"),k(a.src,r=s[4]||s[3]||z)||n(a,"src",r),n(a,"alt",s[0]),n(E,"class","topArtist-name "+N.baseStrong18+" m-"+N.baseRegular16+" svelte-1t81opd"),n(u,"class","topArtist-genre svelte-1t81opd"),n(m,"class","topArtist-info"),n(e,"href",T="/"+s[2]+"/"),n(e,"class","topArtist svelte-1t81opd")},m(h,f){V(h,e,f),i(e,t),i(t,l),i(t,o),i(t,a),i(e,c),i(e,m),i(m,E),i(E,R),i(m,_),i(m,u),i(u,p)},p(h,[f]){f&8&&g!==(g=h[3])&&n(l,"srcset",g),f&24&&!k(a.src,r=h[4]||h[3]||z)&&n(a,"src",r),f&1&&n(a,"alt",h[0]),f&1&&I(R,h[0]),f&2&&I(p,h[1]),f&4&&T!==(T="/"+h[2]+"/")&&n(e,"href",T)},i:G,o:G,d(h){h&&v(e)}}}function K(s,e,t){let{name:l}=e,{genre:g}=e,{slug:o}=e,{image_1x:a=""}=e,{image_2x:r=""}=e;return s.$$set=c=>{"name"in c&&t(0,l=c.name),"genre"in c&&t(1,g=c.genre),"slug"in c&&t(2,o=c.slug),"image_1x"in c&&t(3,a=c.image_1x),"image_2x"in c&&t(4,r=c.image_2x)},[l,g,o,a,r]}class x extends B{constructor(e){super(),M(this,e,K,J,D,{name:0,genre:1,slug:2,image_1x:3,image_2x:4})}}function Q(s){let e,t,l,g,o,a,r,c,m,E,R;return{c(){e=d("a"),t=d("strong"),l=P(s[0]),g=U(),o=d("div"),a=d("span"),r=P(s[1]),c=U(),m=d("span"),E=P("· "),R=P(s[2]),this.h()},l(_){e=S(_,"A",{class:!0,href:!0,title:!0});var u=b(e);t=S(u,"STRONG",{class:!0});var p=b(t);l=w(p,s[0]),p.forEach(v),g=j(u),o=S(u,"DIV",{class:!0});var T=b(o);a=S(T,"SPAN",{class:!0});var h=b(a);r=w(h,s[1]),h.forEach(v),c=j(T),m=S(T,"SPAN",{class:!0});var f=b(m);E=w(f,"· "),R=w(f,s[2]),f.forEach(v),T.forEach(v),u.forEach(v),this.h()},h(){n(t,"class","topSong-title "+N.baseStrong16+" m-"+N.baseRegular16+" svelte-14olug0"),n(a,"class","topSong-artist"),n(m,"class","topSong-genre svelte-14olug0"),n(o,"class","topSong-info "+N.baseRegular14+" svelte-14olug0"),n(e,"class","topSong svelte-14olug0"),n(e,"href",s[3]),n(e,"title",s[0])},m(_,u){V(_,e,u),i(e,t),i(t,l),i(e,g),i(e,o),i(o,a),i(a,r),i(o,c),i(o,m),i(m,E),i(m,R)},p(_,[u]){u&1&&I(l,_[0]),u&2&&I(r,_[1]),u&4&&I(R,_[2]),u&8&&n(e,"href",_[3]),u&1&&n(e,"title",_[0])},i:G,o:G,d(_){_&&v(e)}}}function W(s,e,t){let{title:l}=e,{artist:g}=e,{genre:o}=e,{slug:a}=e;return s.$$set=r=>{"title"in r&&t(0,l=r.title),"artist"in r&&t(1,g=r.artist),"genre"in r&&t(2,o=r.genre),"slug"in r&&t(3,a=r.slug)},[l,g,o,a]}class $ extends B{constructor(e){super(),M(this,e,W,Q,D,{title:0,artist:1,genre:2,slug:3})}}const X=A.array(A.object({name:A.string(),url:A.string(),artist:A.object({name:A.string(),dns:A.string(),genre:A.string(),image_1x:A.string(),image_2x:A.string()})})).transform(s=>s.map(({name:e,artist:t,url:l})=>({artist:t.name,title:e,slug:`/${t.dns}/${l}/`,genre:t.genre}))),ee=async(s,e,t)=>{const l=`${H.Letras}/songs/top/${e?`${e}/`:""}`,g=new URLSearchParams;if(t)for(const r in t)g.append(r,t[r].toString());const o=`${l}${g.toString()?`?${g.toString()}`:""}`,a=await s(o);if(a.ok)return X.parse(await a.json())};export{$ as T,x as a,ee as g};
