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