utxo22-web/_app/chunks/Event-ea7c2ae0.js

2 řádky
10 KiB
JavaScript

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