utxo22-web/_app/pages/tv.svelte-dd75544e.js

7 řádky
43 KiB
JavaScript
Surový Normální zobrazení Historie

var fr=Object.defineProperty;var Et=Object.getOwnPropertySymbols;var dr=Object.prototype.hasOwnProperty,vr=Object.prototype.propertyIsEnumerable;var kt=(e,t,r)=>t in e?fr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Je=(e,t)=>{for(var r in t||(t={}))dr.call(t,r)&&kt(e,r,t[r]);if(Et)for(var r of Et(t))vr.call(t,r)&&kt(e,r,t[r]);return e};import{S as Xt,i as xt,s as er,e as I,c as O,a as D,d as v,b as P,g as A,J as m,E as de,v as tr,$ as hr,a9 as rr,aa as _r,ab as pr,k as R,Y as mr,m as j,n as ce,o as Q,p as fe,q as B,L as gr,T as br,t as H,h as L,ac as Xe,N as nr,j as re,l as Re,H as xe,K as we,G as lr,w as Me,x as Te,y as Ve,ad as yr,B as Ae,ae as wr,f as je}from"../chunks/index-9987666b.js";import{b as Pt}from"../chunks/stores-af76d038.js";import{f as ye}from"../chunks/utils-1595b72e.js";import{p as Er}from"../chunks/periods-3c9faf13.js";import{E as ar}from"../chunks/EventTypeLabel-ca431df3.js";import{A as kr}from"../chunks/Avatar-646b3763.js";import{a as Pr,g as ct,c as me}from"../chunks/_commonjsHelpers-15fb5e92.js";import{L as Ir,S as Or}from"../chunks/Link-57e97f60.js";import{s as Dr}from"../chunks/index-4049ca3c.js";import{f as ie}from"../chunks/index-14ac584d.js";var et={exports:{}},or;/**
* @link https://github.com/gajus/sister for the canonical source repository
* @license https://github.com/gajus/sister/blob/master/LICENSE BSD 3-Clause
*/or=function(){var e={},t={};return e.on=function(r,n){var l={name:r,handler:n};return t[r]=t[r]||[],t[r].unshift(l),l},e.off=function(r){var n=t[r.name].indexOf(r);n!==-1&&t[r.name].splice(n,1)},e.trigger=function(r,n){var l=t[r],a;if(l)for(a=l.length;a--;)l[a].handler(n)},e};var Sr=or,tt={exports:{}},Mr=function(t,r,n){var l=document.head||document.getElementsByTagName("head")[0],a=document.createElement("script");typeof r=="function"&&(n=r,r={}),r=r||{},n=n||function(){},a.type=r.type||"text/javascript",a.charset=r.charset||"utf8",a.async="async"in r?!!r.async:!0,a.src=t,r.attrs&&Tr(a,r.attrs),r.text&&(a.text=""+r.text);var i="onload"in a?It:Vr;i(a,n),a.onload||It(a,n),l.appendChild(a)};function Tr(e,t){for(var r in t)e.setAttribute(r,t[r])}function It(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function Vr(e,t){e.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,t(null,e))}}(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=Mr,n=l(r);function l(a){return a&&a.__esModule?a:{default:a}}t.default=function(a){var i=new Promise(function(u){if(window.YT&&window.YT.Player&&window.YT.Player instanceof Function){u(window.YT);return}else{var o=window.location.protocol==="http:"?"http:":"https:";(0,n.default)(o+"//www.youtube.com/iframe_api",function(c){c&&a.trigger("error",c)})}var s=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=function(){s&&s(),u(window.YT)}});return i},e.exports=t.default})(tt,tt.exports);var rt={exports:{}},nt={exports:{}},lt={exports:{}},Ie=1e3,Oe=Ie*60,De=Oe*60,Se=De*24,Ar=Se*365.25,Cr=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return $r(e);if(r==="number"&&isNaN(e)===!1)return t.long?Hr(e):qr(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function $r(e){if(e=String(e),!(e.length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!!t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Ar;case"days":case"day":case"d":return r*Se;case"hours":case"hour":case"hrs":case"hr":case"h":return r*De;case"minutes":case"minute":case"mins":case"min":case"m":return r*Oe;case"seconds":case"second":case"secs":case"sec":case"s":return r*Ie;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function qr(e){return e>=Se?Math.round(e/Se)+"d":e>=De?Math.round(e/De)+"h":e>=Oe?Math.round(e/Oe)+"m":e>=Ie?Math.round(e/Ie)+"s":e+"ms"}function Hr(e){return Le(e,Se,"day")||Le(e,De,"hour")||Le(e,Oe,"minute")||Le(e,Ie,"second")||e+" ms"}function Le(e,t,r){if(!(e<t))return e<t*1.5?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}(function(e,t){t=e.exports=l.debug=l.default=l,t.coerce=o,t.disable=i,t.enable=a,t.enabled=u,t.humanize=Cr,t.names=[],t.skips=[],t.formatters={};var r;function n(s){var c=0,d;for(d in s)c=(c<<5)-c+s.charCodeAt(d),c|=0;return t.colors[Math.abs(c)%t.colors.length]}function l(s){function c(){if(!!c.enabled){var d=c,_=+new Date,p=_-(r||_);d.diff=p,d.prev=r,d.curr=_,r=_;for(var E=new Array(arguments.length),f=0;f<E.length;f++)E[f]=arguments[f];E[0]=t.coerce(E[0]),typeof E[0]!="string"&&E.unshift("%O");var k=0;E[0]=E[0].replace(/%([a-zA-Z%])/g,function(h,w){if(h==="%%")return h;k++;var g=t.formatters[w];if(typeof g=="function"){var C=E[k];h=g.call(d,C),E.splice(k,1),k--}return h}),t.formatArgs.call(d,E);var y=c.log||t.log||console.log.bind(console);y.apply(d,E)}}return c.namespace=s,c.enabled=t.enabled(s),c.useColors=t.useColors(),c.color=n(s),typeof t.init=="function"&&t.init(c),c}function a(s){t.save(s),t.names=[],t.skips=[];for(var c=(typeof s=="string"?s:"").split(/[\s,]+/),d=c.length,_=0;_<d;_++)!c[_]||(s=c[_].replace(/\*/g,".*?"),s[0]==="-"?t.skips.push(new RegExp("^"+s.substr(1)+"$")):t.names.push(new RegExp("^"+s+"$")))}func
`),r=t.length>1;return{md:t[0],stripped:r}}const Jt=e=>e.livestream,Kt=e=>e.livestream,Wt=e=>`<a href="/seznam-udalosti?tag=${e}" target="_blank" class="hover:underline">#${e}</a>`;function sl(e,t,r){let n;gr(e,Pt,w=>r(2,n=w));const l={link:Ir},a={playerVars:{autoplay:0}},i={},u={};let o=[],s=[];Pt.subscribe(w=>{o=w.spec.schedule,s=w,p(s)});let c=null;tr(()=>{c=setInterval(()=>{p(s)},5e3)}),br(()=>{clearInterval(c)});function d(w){const g=u[w];if(!g)return null;g.playVideo()}function _(w){for(const g of Object.keys(u))g!==w&&(console.log(`stopping player: ${g}`),u[g].stopVideo())}function p(w){const g=new Date;let C=o.filter($=>new Date($.period.end).getTime()>g.getTime());const S=w.spec.stages;for(const $ of S.filter(N=>N.livestream)){let N=[...C.filter(V=>V.stage===$.id)],M=null;N.length>0&&new Date(N[0].period.start).getTime()<=g.getTime()&&(M=N[0],N=N.slice(1));const Z=$.streams.map(V=>Er(w,V)),F=Z.filter(V=>V.period.end.getTime()>=g.getTime());F.length===0&&F.push(Z[Z.length-1]);let Y=null;if(M){let V=(new Date(M.period.end).getTime()-new Date(M.period.start).getTime())/1e3;Y=Math.floor((g.getTime()-new Date(M.period.start).getTime())/1e3)/(V/100)}const W=ye(new Date(F[0].period.start),"yyyy-MM-dd");let K=0;W==="2022-06-05"&&(K=2);const ee=`/program?time=${K}&stage=${$.id}&desc=true`;r(0,i[$.id]={current:M?Qt([M],w)[0]:null,currentPercentage:Y,next:Qt(N.slice(0,2),w),stream:F[0],scheduleLink:ee},i)}console.log(i)}const E=w=>d(w.id),f=w=>d(w.id);function k(w,g){e.$$.not_equal(u[g.id],w)&&(u[g.id]=w,r(1,u))}return[i,u,n,l,a,d,_,E,f,k,w=>_(w.id),w=>il(w,n)]}class wl extends Xt{constructor(t){super();xt(this,t,sl,ol,er,{},null,[-1,-1])}}export{wl as default,yl as prerender};