import{S as ve,i as _e,s as pe,e as m,k as z,t as F,c as g,a as b,d as h,m as B,h as L,b as _,g as C,F as d,j as me,E as G,q as A,w as W,x as J,y as Q,o as j,B as U,n as X,p as Y,G as Z,K as ge,H as se,l as re}from"./index-e45cd9d1.js";import{A as be}from"./Avatar-f71fd69a.js";import{a as ie,b as ke}from"./stores-adaa4006.js";function Ee(r){let e,a,i,t,o,n=r[1].title+"",l,s,c;return{c(){e=m("div"),a=m("div"),t=z(),o=m("div"),l=F(n),this.h()},l(v){e=g(v,"DIV",{class:!0});var u=b(e);a=g(u,"DIV",{class:!0}),b(a).forEach(h),t=B(u),o=g(u,"DIV",{class:!0});var f=b(o);l=L(f,n),f.forEach(h),u.forEach(h),this.h()},h(){_(a,"class",i="w-1 rounded-l-sm "+r[1].style),_(o,"class",s=(r[0]==="big"?"px-2 py-0.5":"px-1.5 py-0.5")+" rounded-r-sm bg-gray-100 uppercase"),_(e,"class",c="flex "+(r[0]==="big"?"h-6 text-sm":"h-5 text-xs"))},m(v,u){C(v,e,u),d(e,a),d(e,t),d(e,o),d(o,l)},p(v,[u]){u&2&&i!==(i="w-1 rounded-l-sm "+v[1].style)&&_(a,"class",i),u&2&&n!==(n=v[1].title+"")&&me(l,n),u&1&&s!==(s=(v[0]==="big"?"px-2 py-0.5":"px-1.5 py-0.5")+" rounded-r-sm bg-gray-100 uppercase")&&_(o,"class",s),u&1&&c!==(c="flex "+(v[0]==="big"?"h-6 text-sm":"h-5 text-xs"))&&_(e,"class",c)},i:G,o:G,d(v){v&&h(e)}}}function ye(r,e,a){let i,{event:t={}}=e,{size:o=null}=e;const n={panel:{title:"Panelov\xE1 debata",style:"bg-custom-red text-white"},talk:{title:"P\u0159edn\xE1\u0161ka",style:"bg-custom-green text-white"},workshop:{title:"Workshop",style:"bg-custom-blue text-white"},other:{title:"Ostatn\xED",style:"bg-custom-yellow"},lightning:{title:"Lightning talk",style:"bg-pink-400"}};return r.$$set=l=>{"event"in l&&a(2,t=l.event),"size"in l&&a(0,o=l.size)},r.$$.update=()=>{r.$$.dirty&4&&a(1,i=n[t.type])},[o,i,t]}class De extends ve{constructor(e){super();_e(this,e,ye,Ee,pe,{event:2,size:0})}}function Ie(r,e){if(!e)return 0;if(r.duration)return r.duration;const a=e.spec.events.filter(i=>i.parent===r.id);if(a.length>0){let i=a.reduce((t,o)=>t+(o.duration?o.duration:0),0);return i+=5*(a.length-1),i}}function ne(r,e,a){const i=r.slice();return i[9]=e[a],i}function oe(r,e,a){const i=r.slice();return i[12]=e[a],i}function fe(r,e,a){const i=r.slice();return i[12]=e[a],i}function we(r){let e,a,i=r[3](r[2].speakers),t=[];for(let n=0;nj(t[n],1,1,()=>{t[n]=null});return{c(){e=m("div");for(let n=0;nj(o[l],1,1,()=>{o[l]=null});return{c(){e=m("div"),a=m("div");for(let l=0;lj(t[n],1,1,()=>{t[n]=null});return{c(){for(let n=0;n0,M,E,w,S,$=r[2].speakers&&r[2].speakers.length>0&&we(r);k=new De({props:{event:r[2]}});let D=r[0]&&ue(r),q=K&&Ve(r);return{c(){e=m("div"),a=m("div"),i=m("i"),o=z(),n=m("div"),l=m("a"),c=F(s),v=z(),$&&$.c(),u=z(),f=m("div"),p=m("div"),W(k.$$.fragment),T=z(),V=m("div"),P=F(O),H=z(),D&&D.c(),R=z(),q&&q.c(),this.h()},l(y){e=g(y,"DIV",{class:!0});var I=b(e);a=g(I,"DIV",{class:!0});var x=b(a);i=g(x,"I",{class:!0,"utxo-event-id":!0}),b(i).forEach(h),x.forEach(h),o=B(I),n=g(I,"DIV",{class:!0});var ee=b(n);l=g(ee,"A",{href:!0});var te=b(l);c=L(te,s),te.forEach(h),ee.forEach(h),v=B(I),$&&$.l(I),u=B(I),f=g(I,"DIV",{class:!0});var N=b(f);p=g(N,"DIV",{});var le=b(p);J(k.$$.fragment,le),le.forEach(h),T=B(N),V=g(N,"DIV",{class:!0});var ae=b(V);P=L(ae,O),ae.forEach(h),H=B(N),D&&D.l(N),N.forEach(h),R=B(I),q&&q.l(I),I.forEach(h),this.h()},h(){_(i,"class",t="fa-star "+(r[1].favoriteEvents.includes(r[2].id)?"fa-solid":"fa-regular")+" cursor-pointer"),_(i,"utxo-event-id",r[2].id),_(a,"class","float-right"),_(l,"href","/udalosti?id="+r[2].id),_(n,"class","text-lg font-semibold"),_(V,"class","text-sm my-auto"),_(f,"class","mt-2 text-sm flex flex-wrap gap-2"),_(e,"class",M="transition-all mb-4 border px-3 py-2 rounded-md shadow "+(r[1].favoriteEvents.includes(r[2].id)?"bg-yellow-100":""))},m(y,I){C(y,e,I),d(e,a),d(a,i),d(e,o),d(e,n),d(n,l),d(l,c),d(e,v),$&&$.m(e,null),d(e,u),d(e,f),d(f,p),Q(k,p,null),d(f,T),d(f,V),d(V,P),d(f,H),D&&D.m(f,null),d(e,R),q&&q.m(e,null),E=!0,w||(S=ge(i,"click",r[6]),w=!0)},p(y,[I]){(!E||I&2&&t!==(t="fa-star "+(y[1].favoriteEvents.includes(y[2].id)?"fa-solid":"fa-regular")+" cursor-pointer"))&&_(i,"class",t),y[2].speakers&&y[2].speakers.length>0&&$.p(y,I),y[0]?D?D.p(y,I):(D=ue(y),D.c(),D.m(f,null)):D&&(D.d(1),D=null),K&&q.p(y,I),(!E||I&2&&M!==(M="transition-all mb-4 border px-3 py-2 rounded-md shadow "+(y[1].favoriteEvents.includes(y[2].id)?"bg-yellow-100":"")))&&_(e,"class",M)},i(y){E||(A($),A(k.$$.fragment,y),A(q),E=!0)},o(y){j($),j(k.$$.fragment,y),j(q),E=!1},d(y){y&&h(e),$&&$.d(),U(k),D&&D.d(),q&&q.d(),w=!1,S()}}}function Be(r,e,a){let i,t,o;se(r,ie,f=>a(1,t=f)),se(r,ke,f=>a(8,o=f));let{event:n}=e;const l=n;function s(f){if(!!f)return f.map(p=>o.spec.speakers.find(k=>k.id===p))}function c(f){const p=o.spec.tracks.find(k=>k.id===f);return p.shortname||p.name}function v(f){return o.spec.events.filter(p=>p.parent===f.id)}function u(f){const p=f.target.getAttribute("utxo-event-id");ie.update(k=>{const T=k.favoriteEvents;let V=null;return T.includes(p)?V=Object.assign(t,{favoriteEvents:T.filter(O=>O!==p)}):(T.push(p),V=Object.assign(t,{favoriteEvents:T})),V})}return r.$$set=f=>{"event"in f&&a(7,n=f.event)},r.$$.update=()=>{r.$$.dirty&256&&a(0,i=Ie(l,o))},[i,t,l,s,c,v,u,n,o]}class qe extends ve{constructor(e){super();_e(this,e,Be,ze,pe,{event:7})}}export{De as E,qe as a,Ie as c};