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