UNPKG

@getontime/cli

Version:

Time keeping for live events

2 lines 1.53 kB
(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`f14ad0099eab1969fdd065b56af5fdd3cf530de6`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`3f2409d9-7b41-49dd-af91-00456ae1e385`,e._sentryDebugIdIdentifier=`sentry-dbid-3f2409d9-7b41-49dd-af91-00456ae1e385`)}catch{}})();import{$ as e,Ct as t,_t as n,qt as r,vt as i,yt as a}from"./useSocket-B9-0Z7zf.js";import{J as o,Y as s}from"./constants-8b9Q9Bj6.js";function c(e,t,n,i,a){if(!i)return null;switch(a??t){case r.CountDown:return i.current===null?null:e?Math.max(i.current,0):i.current;case r.CountUp:return i.elapsed;case r.Clock:return n;case r.None:return null;default:return null}}function l(e){return e===null?!1:e?.toLowerCase()===`true`||e===`1`}function u(e){if(e)return e.startsWith(`#`)?e:`#${e}`}function d(e,t,n){if(!(!e||typeof t!=`string`||t===`none`)){if(t===`parent`)return!n||!e.parent?void 0:n[e.parent]?.title;if(t.startsWith(`custom-`)){let n=t.split(`custom-`)[1];return e.custom?.[n]}return e[t]}}function f(a,c,l,u){if(a==null||c===r.None)return u.removeSeconds?s:o;if(c===r.Clock)return e(a,{override:u?.clockFormat});let d=a;u.removeSeconds&&d<-1e3&&c!==r.CountUp&&(d-=t);let f=n(d,{direction:c});return u.removeLeadingZero&&(f=i(f)),u.removeSeconds&&(f=p(f,l)),f}function p(e,t){return e=a(e),e.length<3?`${e} ${t}`:e}export{u as a,l as i,d as n,c as r,f as t}; //# sourceMappingURL=viewUtils-CulstVIy.js.map