1import{_ as Te}from"./vWTszVWz.js";import{_ as Ve}from"./OyUHcK-I.js";import{c as i,o as l,h as a,d as Ae,G as Re,u as We,y as R,L as Ze,w as Me,a as Le,r as S,b as Ne,p,t as f,j as d,l as u,F as $,k as q,z as W,H as qe,D as m,i as w,M as re,e as H,f as oe,B as D,_ as De}from"./DqVKM6vt.js";import{a as Fe,b as Ke,c as Ge,g as Ue,d as Oe,e as Ee,f as Je}from"./CBDVH-2B.js";import{u as Qe}from"./DiGf_Y3A.js";import{r as Xe}from"./Bwiw8Qxx.js";import{r as Ye,a as et}from"./CshLDZub.js";import{r as ie}from"./CiQBozh6.js";import{r as de}from"./D53mWHyM.js";import{r as tt}from"./DNzAa735.js";function ue(Z,n){return l(),i("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z"})])}function ce(Z,n){return l(),i("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"})])}function F(Z,n){return l(),i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[a("path",{"fill-rule":"evenodd",d:"M9 4.5a.75.75 0 0 1 .721.544l.813 2.846a3.75 3.75 0 0 0 2.576 2.576l2.846.813a.75.75 0 0 1 0 1.442l-2.846.813a3.75 3.75 0 0 0-2.576 2.576l-.813 2.846a.75.75 0 0 1-1.442 0l-.813-2.846a3.75 3.75 0 0 0-2.576-2.576l-2.846-.813a.75.75 0 0 1 0-1.442l2.846-.813A3.75 3.75 0 0 0 7.466 7.89l.813-2.846A.75.75 0 0 1 9 4.5ZM18 1.5a.75.75 0 0 1 .728.568l.258 1.036c.236.94.97 1.674 1.91 1.91l1.036.258a.75.75 0 0 1 0 1.456l-1.036.258c-.94.236-1.674.97-1.91 1.91l-.258 1.036a.75.75 0 0 1-1.456 0l-.258-1.
1036a2.625 2.625 0 0 0-1.91-1.91l-1.036-.258a.75.75 0 0 1 0-1.456l1.036-.258a2.625 2.625 0 0 0 1.91-1.91l.258-1.036A.75.75 0 0 1 18 1.5ZM16.5 15a.75.75 0 0 1 .712.513l.394 1.183c.15.447.5.799.948.948l1.183.395a.75.75 0 0 1 0 1.422l-1.183.395c-.447.15-.799.5-.948.948l-.395 1.183a.75.75 0 0 1-1.422 0l-.395-1.183a1.5 1.5 0 0 0-.948-.948l-1.183-.395a.75.75 0 0 1 0-1.422l1.183-.395c.447-.15.799-.5.948-.948l.395-1.183A.75.75 0 0 1 16.5 15Z","clip-rule":"evenodd"})])}const st={class:"mx-auto max-w-6xl pb-16 pt-6 sm:pt-10"},at={class:"flex items-center justify-between"},lt={class:"flex items-center gap-3"},nt={class:"text-2xl font-semibold text-primaryBlue100 sm:text-3xl"},rt={class:"flex items-center gap-2"},ot=["disabled"],it=["disabled"],dt={class:"mt-6 space-y-4"},ut=["id"],ct={class:"flex w-full items-center justify-between gap-3 sm:w-auto sm:justify-start"},pt={class:"flex min-w-0 items-center gap-2 sm:gap-4"},mt={class:"w-[30px] shrink-0 sm:w-[122px]"},vt={key:0,class:"relative flex w-full items-center justify-center"},ht=["aria-label","onClick"],yt={key:0,class:"absolute -top-8 left-1/2 z-10 -translate-x-1/2 whitespace-nowrap rounded-md bg-primaryBlue100 px-2 py-1 text-[10px] font-semibold text-white shadow sm:hidden"},xt={class:"min-w-0"},gt={key:0},ft=["aria-label","disabled","onClick"],wt={class:"mt-1 flex w-full items-center justify-end gap-3 sm:mt-0 sm:w-auto sm:shrink-0 sm:justify-end"},bt={class:"flex min-w-0 items-center gap-2 sm:gap-3"},kt={key:0,class:"group relative"},_t={class:"min-w-[22px] text-center"},Pt={class:"group relative"},It={class:"min-w-[25px]"},Bt=["aria-label","disabled","onClick"],Ct={key:0,class:"absolute inset-0 z-20 flex items-center justify-between gap-3 rounded-2xl bg-white/90 px-4 backdrop-blur-sm"},St={class:"mt-10 space-y-3"},$t={class:"flex flex-wrap gap-2"},Ht={class:"mt-8 rounded-2xl border border-slate-200 bg-white p-4 sm:p-5"},zt={class:"mt-3 space-y-2 text-sm text-primaryBlue60"},jt={class:"flex items-center gap-2"},Tt={class:"flex items-center gap-2"},Ft=Ae({__name:"hit-parade",async setup(Z){let n,h;const z=Re(),pe=We(),{data:me}=([n,h]=R(()=>W("hitParadePlaylist",()=>Fe({filter:{onMainPage:!0},pagination:{page:1,limit:1}}).then(e=>e.data))),n=await n,h(),n),K=d(()=>me.value?.data?.[0]??null),r=d(()=>K.value?.code??""),{data:ve}=([n,h]=R(()=>W("hitParadePlaylistHistoryWeeks",async()=>r.value?Ke({code:r.value,limit:10}).then(e=>e.data):null,{watch:[r]})),n=await n,h(),n),{data:he}=([n,h]=R(()=>W("hitParadePlaylistSongs",async()=>r.value?Ge({code:r.value,pagination:{page:1,limit:500}}).then(e=>e.data):null,{watch:[r]})),n=await n,h(),n),G=d(()=>he.value?.data??K.value?.songs??[]),ye=new Intl.DateTimeFormat("ru-RU",{day:"numeric",month:"long",timeZone:"UTC"}),b=d(()=>(ve.value?.data??[]).map(e=>({value:e.date,label:ye.format(new Date(`${e.date}T00:00:00Z`)),current:e.current}))),y=d(()=>{const e=Array.isArray(z.query.week)?z.query.week[0]:z.query.week;return b.value.find(s=>s.value===e)??b.value[0]??null}),_=d(()=>b.value.findIndex(e=>e.value===y.value?.value)),j=d(()=>y.value?.value??""),{data:xe}=([n,h]=R(()=>W("hitParadePlaylistHistory",async()=>r.value?j.value?Oe({code:r.value,date:j.value}).then(e=>e.data):Ue({code:r.value}).then(e=>e.data):null,{watch:[r,j]})),n=await n,h(),n),M=d(()=>xe.value?.data??null),U=d(()=>M.value?.current??y.value?.current??!0),O=d(()=>_.value>=0&&_.value<b.value.length-1),E=d(()=>_.value>0),J=e=>{const s=b.value[e];s&&qe({path:"/hit-parade",query:{...z.query,week:s.value}})},ge=()=>{O.value&&J(_.value+1)},fe=()=>{E.value&&J(_.value-1)},Q=d(()=>y.value?`Ð¥Ð¸Ñ Ð¿Ð°Ñад â ${y.value.label}`:"Ð¥Ð¸Ñ Ð¿Ð°Ñад");Qe(()=>({title:Q.value,description:y.value?`Ð¥Ð¸Ñ Ð¿Ð°Ñад Радио ШанÑон за ${y.value.label}: ÑекÑÑие позиÑии, иÑÑоÑÐ¸Ñ Ð¸ голоÑование.`:"Ð¥Ð¸Ñ Ð¿Ð°Ñад Радио ШанÑон: ÑекÑÑие позиÑии, иÑÑоÑÐ¸Ñ Ð¸ голоÑование."}));const we=e=>(e?.artists?.map(o=>o.artist?.title).filter(Boolean)??[]).join(", ")||"ÐÑполниÑелÑ",X=e=>(e?.artists??[]).map(s=>s.artist?.code&&s.artist.title?{code:s.artist.code,title:s.artist.title}:null).filter(s=>!!s),be=e=>we(e.song),Y=(e,s)=>{const o=e?.mediumPath||e?.smallPath||e?.originalPath;return o?pe(o):s},ke=(e,s)=>{const o=e?.artists?.find(C=>C.artist?.picture)?.artist?.picture;return Y(e?.picture||o,s)},_e=e=>{const s=e.currentWeekPosition,o=e.lastWeekPosition;if(!(!s||!o||s===o))return s<o?"up":"down"},Pe=(e,s)=>{const o=_e(e);return{id:e.id,playlistSongId:e.id,rank:String(e.currentWeekPosition||s+1),artist:be(e),artistLinks:X(e.song),title:e.song?.title||"",image:ke(e.song,"/image-preview-small.svg"),weeksInChart:e.weeksOnChart??0,download:!!e.song?.audio,highe
1stRank:e.highestPosition||e.currentWeekPosition||s+1,trend:o,trendPlacement:o==="down"?"bottom":"top"}},Ie=e=>{const s=e.direction===1?"up":e.direction===2?"down":void 0,o=G.value.find(C=>C.song?.id===e.songId)?.song;return{id:e.playlistSongId??e.songId,playlistSongId:e.playlistSongId,rank:String(e.currentWeekPosition),artist:e.artistTitle||"ÐÑполниÑелÑ",artistLinks:X(o),title:e.songTitle,image:Y(e.picture,"/image-preview-small.svg"),weeksInChart:e.weeksOnChart??0,download:e.hasAudio,highestRank:e.highestPosition||e.currentWeekPosition,trend:s,trendPlacement:s==="down"?"bottom":"top",contender:e.direction===3}},L=d(()=>{const e=M.value?.items.map(Ie)??[];if(e.length)return e;const s=G.value.map(Pe);return s.length?s:[]}),P=d(()=>{if(!r.value)return"";const e=M.value?.date??j.value;return e?`${r.value}:${e}`:""}),Be=e=>e.highestRank?e.highestRank:Number(e.rank),ee=e=>e.contender??Number(e.rank)>12,x=S(null),I=S(null);let g=null;const T=S(null),B=S(null);let v=null;const N=Ze("radioshanson_hit_parade_vote",{default:()=>null,maxAge:3600*24*7,sameSite:"lax",path:"/"}),V=e=>e==null?"":String(e),Ce=e=>V(e.playlistSongId)!==""&&V(x.value)===V(e.playlistSongId),A=S(!1),c=e=>A.value&&Ce(e),Se=d(()=>[P.value||"no-chart",A.value?"mounted":"ssr",V(x.value)||"none"].join(":")),te=()=>{const e=N.value;if(!e||e.chartKey!==P.value){x.value=null;return}const s=L.value.some(o=>o.playlistSongId===e.playlistSongId);x.value=s?e.playlistSongId:null};Me([P,L],()=>{A.value&&te()}),Le(()=>{A.value=!0,te()});const se=async e=>{r.value&&await Ee({code:r.value,playlistSongIds:[e]})},$e=async e=>{r.value&&await Je({code:r.value,playlistSongIds:[e]})},ae=async e=>{if(B.value===null){B.value=e;try{if(x.value===e){r.value&&await se(e),x.value=null,N.value=null,le();return}const s=x.value;s&&r.value&&await se(s).catch(()=>{}),r.value&&await $e(e),x.value=e,N.value=P.value?{chartKey:P.value,playlistSongId:e}:null,ze(e)}finally{B.value=null}}},He=e=>{I.value=I.value===e?null:e,g&&(clearTimeout(g),g=null),I.value!==null&&(g=setTimeout(()=>{I.value=null,g=null},1400))},le=()=>{T.value=null,v&&(clearTimeout(v),v=null)},ze=e=>{T.value=e,v&&clearTimeout(v),v=setTimeout(()=>{T.value=null,v=null},3e3)};return Ne(()=>{g&&(clearTimeout(g),g=null),v&&(clearTimeout(v),v=null)}),(e,s)=>{const o=Te,C=Ve,ne=De;return l(),i("div",st,[p(o,{items:[{label:"Ð¥Ð¸Ñ Ð¿Ð°Ñад"}]}),a("section",null,[a("div",at,[a("div",lt,[a("h1",nt,f(Q.value),1),p(u(Xe),{class:"size-5 text-primaryBlue100","aria-hidden":"true"})]),a("div",rt,[a("button",{type:"button",class:"flex h-10 w-10 items-center justify-center rounded-full border border-slate-200 bg-white text-primaryBlue100 shadow-sm disabled:cursor-not-allowed disabled:opacity-50","aria-label":"ÐÑедÑдÑÑие позиÑии",disabled:!O.value,onClick:ge},[p(u(Ye),{class:"size-5","aria-hidden":"true"})],8,ot),a("button",{type:"button",class:"flex h-10 w-10 items-center justify-center rounded-full border border-slate-200 bg-white text-primaryBlue100 shadow-sm disabled:cursor-not-allowed disabled:opacity-50","aria-label":"СледÑÑÑие позиÑии",disabled:!E.value,onClick:fe},[p(u(et),{class:"size-5","aria-hidden":"true"})],8,it)])]),a("div",dt,[(l(),i("ul",{key:Se.value,class:"space-y-4"},[(l(!0),i($,null,q(L.value,t=>(l(),i("li",{key:`${t.id}-${c(t)?"liked":"idle"}`,id:`hit-parade-artist-${t.id}`,class:m(["relative flex flex-col gap-2 overflow-visible rounded-2xl py-3 shadow-sm transition-colors sm:flex-row sm:items-center sm:justify-between sm:gap-4 sm:px-4",c(t)?"bg-primaryRed100 text-white":"bg-white"])},[a("div",ct,[a("div",pt,[a("div",mt,[ee(t)?(l(),i("div",vt,[a("button",{type:"button",class:m(["inline-flex h-9 w-9 items-center justify-center rounded-full border sm:hidden",c(t)?"border-white/45 text-white":"border-primaryBlue60/40 text-primaryBlue100"]),"aria-label":`ÐоÑÑнение: пÑеÑÐµÐ½Ð´ÐµÐ½Ñ ${t.artist}`,onClick:re(k=>He(t.id),["stop"])},[p(u(F),{class:"size-5","aria-hidden":"true"})],10,ht),I.value===t.id?(l(),i("span",yt," ÐÑеÑÐµÐ½Ð´ÐµÐ½Ñ ")):w("",!0),a("div",{class:m(["hidden w-full items-center justify-center gap-1 whitespace-nowrap rounded-full border px-2 py-1 text-[10px] font-semibold uppercase tracking-wide sm:inline-flex",c(t)?"border-white/45 text-white":"border-primaryBlue60/40 text-primaryBlue100"])}
1,[p(u(F),{class:"size-3.5","aria-hidden":"true"}),s[0]||(s[0]=a("span",null,"ÐÑеÑенденÑ",-1))],2)])):(l(),i("div",{key:1,class:m(["flex w-full flex-col items-center justify-center text-xl font-bold leading-none sm:text-2xl",c(t)?"text-white/85":"text-primaryBlue60"])},[t.trend==="up"&&t.trendPlacement==="top"?(l(),H(u(ce),{key:0,class:"size-6 stroke-[3.25] text-emerald-500","aria-hidden":"true"})):w("",!0),t.trend==="down"&&t.trendPlacement==="top"?(l(),H(u(ie),{key:1,class:"size-6 stroke-[3.25] text-red-500","aria-hidden":"true"})):w("",!0),a("span",null,f(t.rank),1),t.trend==="up"&&t.trendPlacement==="bottom"?(l(),H(u(ce),{key:2,class:"size-6 stroke-[3.25] text-emerald-500","aria-hidden":"true"})):w("",!0),t.trend==="down"&&t.trendPlacement==="bottom"?(l(),H(u(ie),{key:3,class:"size-6 stroke-[3.25] text-red-500","aria-hidden":"true"})):w("",!0)],2))]),a("div",{class:m(["h-12 w-12 overflow-hidden rounded-xl",c(t)?"bg-white/20":"bg-primaryBlue3"])},[p(C,{provider:"none",src:t.image,alt:t.artist,class:"h-full w-full object-cover"},null,8,["src","alt"])],2),a("div",xt,[a("p",{class:m(["truncate text-sm font-semibold sm:text-base",c(t)?"text-white":"text-primaryBlue100"])},f(t.title),3),a("p",{class:m(["truncate text-xs sm:text-sm",c(t)?"text-white/80":"text-primaryBlue60"])},[t.artistLinks?.length?(l(!0),i($,{key:0},q(t.artistLinks,(k,je)=>(l(),i($,{key:k.code},[je?(l(),i("span",gt,", ")):w("",!0),p(ne,{to:`/artist/${k.code}`,class:"transition hover:underline"},{default:oe(()=>[D(f(k.title),1)]),_:2},1032,["to"])],64))),128)):(l(),i($,{key:1},[D(f(t.artist),1)],64))],2)])]),a("button",{type:"button",class:m(["inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full text-white shadow-sm transition disabled:cursor-not-allowed disabled:opacity-45 sm:hidden",c(t)?"bg-primaryBlue100 hover:bg-primaryBlue60":"bg-primaryRed100 hover:bg-primaryRed100/90"]),"aria-label":c(t)?`УбÑаÑÑ Ð³Ð¾Ð»Ð¾Ñ Ð·Ð° ${t.artist}`:`ÐолоÑоваÑÑ Ð·Ð° ${t.artist}`,disabled:!U.value||!t.playlistSongId||B.value===t.id,onClick:k=>t.playlistSongId&&ae(t.playlistSongId)},[p(u(de),{class:"size-5","aria-hidden":"true"})],10,ft)]),a("div",wt,[a("div",bt,[ee(t)?w("",!0):(l(),i("div",kt,[a("div",{class:m(["inline-flex items-center gap-1 rounded-full border px-2.5 py-1.5 text-xs font-semibold leading-none sm:gap-1.5 sm:px-3.5 sm:py-2 sm:text-sm sm:font-bold",c(t)?"border-white/45 text-white":"border-slate-200 text-primaryBlue60"])},[s[1]||(s[1]=a("span",{"aria-hidden":"true"},"â
",-1)),a("span",_t,f(Be(t)),1)],2),s[2]||(s[2]=a("div",{class:"pointer-events-none absolute bottom-full left-1/2 z-40 mb-2 hidden w-max -translate-x-1/2 rounded-md bg-primaryBlue100 px-2 py-1 text-[10px] font-semibold text-white shadow-sm sm:block sm:opacity-0 sm:transition-opacity sm:duration-150 sm:group-hover:opacity-100"}," ÐаивÑÑÑее меÑÑо в Ñ
иÑ-паÑаде за вÑе вÑÐµÐ¼Ñ ",-1))])),a("div",Pt,[a("div",{class:m(["inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1.5 text-xs font-semibold leading-none sm:gap-2 sm:px-3.5 sm:py-2 sm:text-sm sm:font-bold",c(t)?"border-white/45 text-white":"border-slate-200 text-primaryBlue60"])},[p(u(ue),{class:"size-4 sm:size-5","aria-hidden":"true"}),a("span",It,f(t.weeksInChart),1)],2),s[3]||(s[3]=a("div",{class:"pointer-events-none absolute bottom-full left-1/2 z-40 mb-2 hidden w-max -translate-x-1/2 rounded-md bg-primaryBlue100 px-2 py-1 text-[10px] font-semibold text-white shadow-sm sm:block sm:opacity-0 sm:transition-opacity sm:duration-150 sm:group-hover:opacity-100"}," ÐÐµÐ´ÐµÐ»Ñ Ð² Ñ
иÑ-паÑаде ",-1))])]),a("button",{type:"button",class:m(["hidden h-10 w-10 items-center justify-center rounded-full text-white shadow-sm transition disabled:cursor-not-allowed disabled:opacity-45 sm:inline-flex",c(t)?"bg-primaryBlue100 hover:bg-primaryBlue60":"bg-primaryRed100 hover:bg-primaryRed100/90"]),"aria-label":c(t)?`УбÑаÑÑ Ð³Ð¾Ð»Ð¾Ñ Ð·Ð° ${t.artist}`:`ÐолоÑоваÑÑ Ð·Ð° ${t.artist}`,disabled:!U.value||!t.playlistSongId||B.value===t.id,onClick:k=>t.playlistSongId&&ae(t.playlistSongId)},[p(u(de),{class:"size-5","aria-hidden":"true"})],10,Bt)]),T.value===t.id?(l(),i("div",Ct,[s[4]||(s[4]=a("p",{class:"text-xs font-semibold text-primaryBlue100 sm:text-sm"}," СпаÑибо! ÐÐ°Ñ Ð³Ð¾Ð»Ð¾Ñ Ð¿ÑинÑÑ! ",-1)),a("button",{type:"button",class:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-slate-300 text-primaryBlue60 transition hover:text-primaryBlue100","aria-label":"ÐакÑÑÑÑ Ñведомление",onClick:re(le,["stop"])},[p(u(tt),{class:"size-4","aria-hidden":"true"})])])):w("",!0)],10,ut))),128))]))]),a("div",St,[s[5]||(s[5]=a("p",{class:"text-sm font-semibold text-primaryBlue100"}
1,"ÐÑÐ±Ð¾Ñ Ð½ÐµÐ´ÐµÐ»Ð¸",-1)),a("div",$t,[(l(!0),i($,null,q(b.value,t=>(l(),H(ne,{key:t.value,to:{path:"/hit-parade",query:{week:t.value}},class:m(["rounded-full border px-4 py-2 text-sm font-semibold transition",t.value===y.value?.value?"border-primaryRed100 text-primaryRed100":"border-slate-200 text-primaryBlue100 hover:border-primaryBlue60"])},{default:oe(()=>[D(f(t.label),1)]),_:2},1032,["to","class"]))),128))])]),a("div",Ht,[a("ul",zt,[s[8]||(s[8]=a("li",{class:"flex items-center gap-2"},[a("span",{class:"text-primaryBlue100","aria-hidden":"true"},"â
"),a("span",null," â ÐаивÑÑÑее меÑÑо в Ñ
иÑ-паÑаде")],-1)),a("li",jt,[p(u(ue),{class:"size-4 text-primaryBlue100","aria-hidden":"true"}),s[6]||(s[6]=a("span",null," â Ðол-во ÐÐµÐ´ÐµÐ»Ñ Ð² Ñ
иÑ-паÑаде ",-1))]),a("li",Tt,[p(u(F),{class:"size-4 text-primaryBlue100","aria-hidden":"true"}),s[7]||(s[7]=a("span",null," â ÐÑеÑенденÑ",-1))])])])])])}}});export{Ft as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.