utxo22-web/_app/chunks/Event-4db528b6.js

4 řádky
15 KiB
JavaScript
Surový Normální zobrazení Historie

import{S as Me,i as je,s as ye,e as b,t as A,k as y,c as E,a as D,h as S,m as C,d,b as m,g as B,J as c,j as P,E as le,q as I,w as te,x as ie,y as re,o as $,B as ae,n as Q,p as U,K as ne,N as Ce,L as he,l as _e}from"./index-9987666b.js";import{A as Ne}from"./Avatar-646b3763.js";import{S as Oe,L as qe}from"./Link-57e97f60.js";import{E as Ze}from"./EventTypeLabel-ca431df3.js";import{f as se}from"./utils-a05be307.js";import{b as Fe,c as fe}from"./stores-af76d038.js";function Je(n){let e,a=se(n[1],"yyyy-MM-dd")==="2022-06-04"?"SO":"NE",t,l,r=se(n[1],"HH:mm")+"",i,s,f=se(n[2],"HH:mm")+"",o,g,h=(n[0]?n[0].name:"n/a")+"",u,_;return{c(){e=b("div"),t=A(a),l=y(),i=A(r),s=A("-"),o=A(f),g=A(" ("),u=A(h),_=A(")"),this.h()},l(v){e=E(v,"DIV",{class:!0});var k=D(e);t=S(k,a),l=C(k),i=S(k,r),s=S(k,"-"),o=S(k,f),g=S(k," ("),u=S(k,h),_=S(k,")"),k.forEach(d),this.h()},h(){m(e,"class","font-semibold")},m(v,k){B(v,e,k),c(e,t),c(e,l),c(e,i),c(e,s),c(e,o),c(e,g),c(e,u),c(e,_)},p(v,[k]){k&1&&h!==(h=(v[0]?v[0].name:"n/a")+"")&&P(u,h)},i:le,o:le,d(v){v&&d(e)}}}function Ke(n,e,a){let t,{item:l}=e,{e:r}=e,{bundle:i}=e;const s=typeof l.period.start=="string"?new Date(l.period.start):l.period.start,f=typeof l.period.end=="string"?new Date(l.period.end):l.period.end;return n.$$set=o=>{"item"in o&&a(3,l=o.item),"e"in o&&a(4,r=o.e),"bundle"in o&&a(5,i=o.bundle)},n.$$.update=()=>{n.$$.dirty&40&&a(0,t=i?i.spec.stages.find(o=>o.id===l.stage):null)},[t,s,f,l,r,i]}class Re extends Me{constructor(e){super();je(this,e,Ke,Je,ye,{item:3,e:4,bundle:5})}}function Ge(n,e){if(!e)return 0;if(n.duration)return n.duration;const a=e.spec.events.filter(t=>t.parent===n.id);if(a.length>0){let t=a.reduce((l,r)=>l+(r.duration?r.duration:0),0);return t+=5*(a.length-1),t}}function ve(n,e){e.update(a=>{const t=a.favoriteEvents;let l=null;return t.includes(n)?l=Object.assign({},a,{favoriteEvents:t.filter(r=>r!==n)}):(t.push(n),l=Object.assign(a,{favoriteEvents:t})),l})}function me(n,e,a){const t=n.slice();return t[14]=e[a],t}function pe(n,e,a){const t=n.slice();return t[17]=e[a],t}function ge(n,e,a){const t=n.slice();return t[20]=e[a],t}function ke(n,e,a){const t=n.slice();return t[17]=e[a],t}function be(n){let e,a,t=n[8](n[1].speakers),l=[];for(let i=0;i<t.length;i+=1)l[i]=De(ke(n,t,i));const r=i=>$(l[i],1,1,()=>{l[i]=null});return{c(){e=b("div");for(let i=0;i<l.length;i+=1)l[i].c();this.h()},l(i){e=E(i,"DIV",{class:!0});var s=D(e);for(let f=0;f<l.length;f+=1)l[f].l(s);s.forEach(d),this.h()},h(){m(e,"class","mt-1 mb-2 flex flex-wrap gap-2")},m(i,s){B(i,e,s);for(let f=0;f<l.length;f+=1)l[f].m(e,null);a=!0},p(i,s){if(s&258){t=i[8](i[1].speakers);let f;for(f=0;f<t.length;f+=1){const o=ke(i,t,f);l[f]?(l[f].p(o,s),I(l[f],1)):(l[f]=De(o),l[f].c(),I(l[f],1),l[f].m(e,null))}for(Q(),f=t.length;f<l.length;f+=1)r(f);U()}},i(i){if(!a){for(let s=0;s<t.length;s+=1)I(l[s]);a=!0}},o(i){l=l.filter(Boolean);for(let s=0;s<l.length;s+=1)$(l[s]);a=!1},d(i){i&&d(e),ne(l,i)}}}function Ee(n){let e,a=n[17].nickname+"",t,l;return{c(){e=A("\xA0("),t=A(a),l=A(")")},l(r){e=S(r,"\xA0("),t=S(r,a),l=S(r,")")},m(r,i){B(r,e,i),B(r,t,i),B(r,l,i)},p(r,i){i&2&&a!==(a=r[17].nickname+"")&&P(t,a)},d(r){r&&d(e),r&&d(t),r&&d(l)}}}function De(n){let e,a,t,l,r,i=n[17].name+"",s,f,o,g;a=new Ne({props:{speaker:n[17],size:"extra-small"}});let h=n[17].nickname&&Ee(n);return{c(){e=b("div"),te(a.$$.fragment),t=y(),l=b("div"),r=b("a"),s=A(i),h&&h.c(),o=y(),this.h()},l(u){e=E(u,"DIV",{class:!0});var _=D(e);ie(a.$$.fragment,_),t=C(_),l=E(_,"DIV",{class:!0});var v=D(l);r=E(v,"A",{href:!0});var k=D(r);s=S(k,i),h&&h.l(k),k.forEach(d),v.forEach(d),o=C(_),_.forEach(d),this.h()},h(){m(r,"href",f="/lide?id="+n[17].id),m(l,"class","m-auto"),m(e,"class","flex gap-1.5")},m(u,_){B(u,e,_),re(a,e,null),c(e,t),c(e,l),c(l,r),c(r,s),h&&h.m(r,null),c(e,o),g=!0},p(u,_){const v={};_&2&&(v.speaker=u[17]),a.$set(v),(!g||_&2)&&i!==(i=u[17].name+"")&&P(s,i),u[17].nickname?h?h.p(u,_):(h=Ee(u),h.c(),h.m(r,null)):h&&(h.d(1),h=null),(!g||_&2&&f!==(f="/lide?id="+u[17].id))&&m(r,"href",f)},i(u){g||(I(a.$$.fragment,u),g=!0)},o(u){$(a.$$.fragment,u),g=!1},d(u){u
`),a=e.length>1;return{md:e[0],stripped:a}}function Xe(n,e,a){let t,l,r,i,s,f;he(n,Fe,V=>a(2,s=V)),he(n,fe,V=>a(6,f=V));let{event:o}=e,{hideDate:g=!1}=e;const h={link:qe};function u(V){if(!!V)return V.map(J=>s.spec.speakers.find(R=>R.id===J))}function _(V){const J=s.spec.tracks.find(R=>R.id===V);return J.shortname||J.name}function v(V){return s.spec.events.filter(J=>J.parent===V.id)}const k=()=>ve(t.id,fe),j=V=>ve(V.id,fe);return n.$$set=V=>{"event"in V&&a(11,o=V.event),"hideDate"in V&&a(0,g=V.hideDate)},n.$$.update=()=>{n.$$.dirty&2048&&a(1,t=o),n.$$.dirty&6&&a(5,l=Ge(t,s)),n.$$.dirty&2&&a(4,r=We(t)),n.$$.dirty&6&&a(3,i=s?s.spec.schedule.find(V=>V.event===t.id):null)},[g,t,s,i,r,l,f,h,u,_,v,o,k,j]}class rl extends Me{constructor(e){super();je(this,e,Xe,Ue,ye,{event:11,hideDate:0})}}export{rl as E,Re as a,ve as b,Ge as c};