utxo22-web/_app/chunks/Event-69e41fab.js

2 řádky
10 KiB
JavaScript

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-58fcac11.js";import{A as me}from"./Avatar-e800cc1c.js";import{b as ge,a as N}from"./stores-44b92a1a.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;o<s.length;o+=1)t[o]=oe(ne(l,s,o));const i=o=>T(t[o],1,1,()=>{t[o]=null});return{c(){e=m("div");for(let o=0;o<t.length;o+=1)t[o].c();this.h()},l(o){e=g(o,"DIV",{class:!0});var r=b(e);for(let n=0;n<t.length;n+=1)t[n].l(r);r.forEach(h),this.h()},h(){p(e,"class","mt-1 mb-2 flex flex-wrap gap-2")},m(o,r){j(o,e,r);for(let n=0;n<t.length;n+=1)t[n].m(e,null);a=!0},p(o,r){if(r&12){s=o[3](o[2].speakers);let n;for(n=0;n<s.length;n+=1){const c=ne(o,s,n);t[n]?(t[n].p(c,r),V(t[n],1)):(t[n]=oe(c),t[n].c(),V(t[n],1),t[n].m(e,null))}for(U(),n=s.length;n<t.length;n+=1)i(n);X()}},i(o){if(!a){for(let r=0;r<s.length;r+=1)V(t[r]);a=!0}},o(o){t=t.filter(Boolean);for(let r=0;r<t.length;r+=1)T(t[r]);a=!1},d(o){o&&h(e),Y(t,o)}}}function oe(l){let e,a,s,t,i,o=l[13].name+"",r,n,c,v;return a=new me({props:{speaker:l[13],size:"extra-small"}}),{c(){e=m("div"),R(a.$$.fragment),s=$(),t=m("div"),i=m("a"),r=q(o),c=$(),this.h()},l(f){e=g(f,"DIV",{class:!0});var d=b(e);W(a.$$.fragment,d),s=z(d),t=g(d,"DIV",{class:!0});var _=b(t);i=g(_,"A",{href:!0});var E=b(i);r=C(E,o),E.forEach(h),_.forEach(h),c=z(d),d.forEach(h),this.h()},h(){p(i,"href",n="/lide?id="+l[13].id),p(t,"class","m-auto"),p(e,"class","flex gap-1.5")},m(f,d){j(f,e,d),K(a,e,null),u(e,s),u(e,t),u(t,i),u(i,r),u(e,c),v=!0},p:L,i(f){v||(V(a.$$.fragment,f),v=!0)},o(f){T(a.$$.fragment,f),v=!1},d(f){f&&h(e),Q(a)}}}function we(l){let e,a=l[4](l[2].track)+"",s;return{c(){e=m("div"),s=q(a),this.h()},l(t){e=g(t,"DIV",{class:!0});var i=b(e);s=C(i,a),i.forEach(h),this.h()},h(){p(e,"class","text-sm my-auto")},m(t,i){j(t,e,i),u(e,s)},p:L,d(t){t&&h(e)}}}function ce(l){let e,a,s;return{c(){e=m("div"),a=q(l[0]),s=q("m"),this.h()},l(t){e=g(t,"DIV",{class:!0});var i=b(e);a=C(i,l[0]),s=C(i,"m"),i.forEach(h),this.h()},h(){p(e,"class","text-xs my-auto")},m(t,i){j(t,e,i),u(e,a),u(e,s)},p(t,i){i&1&&_e(a,t[0])},d(t){t&&h(e)}}}function Ie(l){let e,a,s,t=l[5](l[2]),i=[];for(let r=0;r<t.length;r+=1)i[r]=ue(se(l,t,r));const o=r=>T(i[r],1,1,()=>{i[r]=null});return{c(){e=m("div"),a=m("div");for(let r=0;r<i.length;r+=1)i[r].c();this.h()},l(r){e=g(r,"DIV",{class:!0});var n=b(e);a=g(n,"DIV",{class:!0,cellpadding:!0});var c=b(a);for(let v=0;v<i.length;v+=1)i[v].l(c);c.forEach(h),n.forEach(h),this.h()},h(){p(a,"class","flex flex-wrap gap-2"),p(a,"cellpadding","5"),p(e,"class","mt-4 w-auto mb-2")},m(r,n){j(r,e,n),u(e,a);for(let c=0;c<i.length;c+=1)i[c].m(a,null);s=!0},p(r,n){if(n&46){t=r[5](r[2]);let c;for(c=0;c<t.length;c+=1){const v=se(r,t,c);i[c]?(i[c].p(v,n),V(i[c],1)):(i[c]=ue(v),i[c].c(),V(i[c],1),i[c].m(a,null))}for(U(),c=t.length;c<i.length;c+=1)o(c);X()}},i(r){if(!s){for(let n=0;n<t.length;n+=1)V(i[n]);s=!0}},o(r){i=i.filter(Boolean);for(let n=0;n<i.length;n+=1)T(i[n]);s=!1},d(r){r&&h(e),Y(i,r)}}}function Ve(l){let e,a,s=l[3](l[10].speakers),t=[];for(let o=0;o<s.length;o+=1)t[o]=fe(ie(l,s,o));const i=o=>T(t[o],1,1,()=>{t[o]=null});return{c(){for(let o=0;o<t.length;o+=1)t[o].c();e=ae()},l(o){for(let r=0;r<t.length;r+=1)t[r].l(o);e=ae()},m(o,r){for(let n=0;n<t.length;n+=1)t[n].m(o,r);j(o,e,r),a=!0},p(o,r){if(r&44){s=o[3](o[10].speakers);let n;for(n=0;n<s.length;n+=1){const c=ie(o,s,n);t[n]?(t[n].p(c,r),V(t[n],1)):(t[n]=fe(c),t[n].c(),V(t[n],1),t[n].m(e.parentNode,e))}for(U(),n=s.length;n<t.length;n+=1)i(n);X()}},i(o){if(!a){for(let r=0;r<s.length;r+=1)V(t[r]);a=!0}},o(o){t=t.filter(Boolean);for(let r=0;r<t.length;r+=1)T(t[r]);a=!1},d(o){Y(t,o),o&&h(e)}}}function Ae(l){let e,a;return{c(){e=m("div"),a=q("TBA")},l(s){e=g(s,"DIV",{});var t=b(e);a=C(t,"TBA"),t.forEach(h)},m(s,t){j(s,e,t),u(e,a)},p:L,i:L,o:L,d(s){s&&h(e)}}}function fe(l){let e,a,s,t,i,o=l[13].name+"",r,n,c,v;return a=new me({props:{speaker:l[13],size:"micro"}}),{c(){e=m("div"),R(a.$$.fragment),s=$(),t=m("div"),i=m("a"),r=q(o),c=$(),this.h()},l(f){e=g(f,"DIV",{class:!0});var d=b(e);W(a.$$.fragment,d),s=z(d),t=g(d,"DIV",{});var _=b(t);i=g(_,"A",{href:!0});var E=b(i);r=C(E,o),E.forEach(h),_.forEach(h),c=z(d),d.forEach(h),this.h()},h(){p(i,"href",n="/lide?id="+l[13].id),p(e,"class","flex gap-1")},m(f,d){j(f,e,d),K(a,e,null),u(e,s),u(e,t),u(t,i),u(i,r),u(e,c),v=!0},p:L,i(f){v||(V(a.$$.fragment,f),v=!0)},o(f){T(a.$$.fragment,f),v=!1},d(f){f&&h(e),Q(a)}}}function ue(l){let e,a,s,t=l[10].name+"",i,o,r,n,c,v,f,d,_,E,B,O,P,J;function G(){return l[9](l[10])}const F=[Ae,Ve],S=[];function M(y,D){return y[10].speakers.length===0?0:1}return d=M(l),_=S[d]=F[d](l),{c(){e=m("div"),a=m("div"),s=m("a"),i=q(t),r=$(),n=m("i"),v=$(),f=m("div"),_.c(),E=$(),this.h()},l(y){e=g(y,"DIV",{class:!0});var D=b(e);a=g(D,"DIV",{class:!0});var w=b(a);s=g(w,"A",{href:!0});var A=b(s);i=C(A,t),A.forEach(h),r=z(w),n=g(w,"I",{class:!0}),b(n).forEach(h),w.forEach(h),v=z(D),f=g(D,"DIV",{class:!0});var k=b(f);_.l(k),k.forEach(h),E=z(D),D.forEach(h),this.h()},h(){p(s,"href",o="/udalosti?id="+l[10].id),p(n,"class",c="fa-star "+(l[1].favoriteEvents.includes(l[10].id)?"fa-solid":"fa-regular")+" cursor-pointer"),p(a,"class","font-bold"),p(f,"class","mt-1"),p(e,"class",B="border rounded py-1.5 px-2.5 text-sm transition-all "+(l[1].favoriteEvents.includes(l[10].id)?"bg-yellow-100":"bg-gray-100"))},m(y,D){j(y,e,D),u(e,a),u(a,s),u(s,i),u(a,r),u(a,n),u(e,v),u(e,f),S[d].m(f,null),u(e,E),O=!0,P||(J=pe(n,"click",G),P=!0)},p(y,D){l=y,(!O||D&2&&c!==(c="fa-star "+(l[1].favoriteEvents.includes(l[10].id)?"fa-solid":"fa-regular")+" cursor-pointer"))&&p(n,"class",c),_.p(l,D),(!O||D&2&&B!==(B="border rounded py-1.5 px-2.5 text-sm transition-all "+(l[1].favoriteEvents.includes(l[10].id)?"bg-yellow-100":"bg-gray-100")))&&p(e,"class",B)},i(y){O||(V(_),O=!0)},o(y){T(_),O=!1},d(y){y&&h(e),S[d].d(),P=!1,J()}}}function $e(l){let e,a,s,t,i,o,r,n=l[2].name+"",c,v,f,d,_,E,B,O,P,J=l[5](l[2]).length>0,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};