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