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