UNPKG

@getontime/cli

Version:

Time keeping for live events

2 lines 9.32 kB
System.register(["./jsx-runtime-legacy-DMkDNnVj.js","./useSocket-legacy-C772wu7w.js","./Button-legacy-DpgzgT04.js","./Tooltip-legacy-DEkL5laM.js","./useIsSmallScreen-legacy-DavgXfPB.js","./Select-legacy-DHLEukf3.js","./constants-legacy-CvecvM28.js","./NavigationMenu-legacy-AAR54e_T.js","./viewParamsEditor.store-legacy-BGER9MKV.js","./useFadeOutOnInactivity-legacy-BEtgAp2p.js","./useSettings-legacy-CmEM1qbK.js","./Input-legacy-CNt711cd.js","./PresetContext-legacy-DMyxIOHO.js","./viewOptions-legacy-C48HYPwV.js","./index-legacy-NWDCUII5.js","./ProtectRoute-legacy-DKYjVKxt.js","./EditorUtils-legacy-CWdX_BN4.js"],function(e,t){var n,a,i,r,o,s,l,c,u,d,_,f,m,y,x,g,p,v,b,j,h,k,w,C,S,q,I,N,E,T,P,A,D,L,M,F,R,O,B,z,H,V,U,$,J,K;function W(e){const{label:t,placeholder:n,text:a,visible:i,changeHandler:r,children:o}=e,[s,l]=(0,R.useState)(a),c=(0,R.useRef)(null),u=(0,R.useRef)(0);return(0,R.useEffect)(()=>{c.current&&c.current!==document.activeElement&&(c.current.selectionStart=u.current,c.current.selectionEnd=u.current)},[a]),(0,R.useEffect)(()=>{c.current!==document.activeElement&&l(a)},[a]),(0,B.jsxs)("div",{children:[(0,B.jsx)("label",{className:v([O.label,i??O.active]),htmlFor:t,children:t}),(0,B.jsxs)("div",{className:O.inputItems,children:[(0,B.jsx)(I,{id:t,ref:c,value:s,onChange:e=>{u.current=e.target.selectionStart??0,l(e.target.value),r(e.target.value)},placeholder:n}),o]})]})}function Y(){return z?(0,B.jsx)(R.Suspense,{fallback:null,children:(0,B.jsx)(H,{})}):null}function G(){const{blink:e,blackout:t,countToEnd:n,phase:a,secondarySource:i,showTimerMessage:r,timerType:o}=d(),{data:l}=N(),c=r?"Message":o===u.None?p:a===s.Pending?"Standby to start":a===s.Overtime?"Timer Overtime":o===u.Clock?"Clock":n?"Count to End":"Timer",_=r||!i?null:$[i],m=a===s.Warning?l.warningColor??"#ffa528":a===s.Danger?l.dangerColor??"#ff7300":l.normalColor??"#FFFC",x="Timer"==c,g=v([e&&U.blink,t&&U.blackout]);return(0,B.jsxs)("div",{className:U.preview,children:[(0,B.jsx)(L,{onExtractClick:e=>S("timer",e),pipElement:(0,B.jsx)(V,{})}),(0,B.jsxs)("div",{className:g,children:[(0,B.jsx)("div",{className:U.mainContent,"data-phase":x&&a,style:x?{"--override-colour":m}:{},children:c}),null!==_&&(0,B.jsx)("div",{className:U.secondaryContent,children:_})]}),(0,B.jsxs)("div",{className:U.eventStatus,children:[(0,B.jsx)(f,{text:"Time type: Count down",render:(0,B.jsx)("span",{}),className:U.statusIcon,"data-active":o===u.CountDown,children:(0,B.jsx)(k,{})}),(0,B.jsx)(f,{text:"Time type: Count up",render:(0,B.jsx)("span",{}),className:U.statusIcon,"data-active":o===u.CountUp,children:(0,B.jsx)(b,{})}),(0,B.jsx)(f,{text:"Time type: Clock",render:(0,B.jsx)("span",{}),className:U.statusIcon,"data-active":o===u.Clock,children:(0,B.jsx)(C,{})}),(0,B.jsx)(f,{text:"Time type: None",render:(0,B.jsx)("span",{}),className:U.statusIcon,"data-active":o===u.None,children:(0,B.jsx)(w,{})}),(0,B.jsx)(f,{text:n?"Count to end":"Count duration",render:(0,B.jsx)("span",{}),className:U.statusIcon,"data-active":n,children:(0,B.jsx)(y,{})})]})]})}function Q(){const{blackout:e,blink:t}=r();return(0,B.jsxs)("div",{className:J.previewContainer,children:[(0,B.jsx)(G,{}),(0,B.jsxs)("div",{className:J.options,children:[(0,B.jsx)(X,{}),(0,B.jsx)(D,{orientation:"horizontal"}),(0,B.jsx)(_,{variant:t?"primary":"subtle",fluid:!0,onClick:()=>l.timerBlink(!t),"data-testid":"toggle timer blink",children:"Blink"}),(0,B.jsx)(_,{variant:e?"primary":"subtle",fluid:!0,onClick:()=>l.timerBlackout(!e),"data-testid":"toggle timer blackout",children:"Blackout screen"})]})]})}function X(){const{secondarySource:e}=r(),[t,n]=(0,R.useState)("aux1");return(0,R.useEffect)(()=>{null!==e&&n(e)},[e]),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(x,{value:t,options:[{value:"aux1",label:"Aux 1"},{value:"aux2",label:"Aux 2"},{value:"aux3",label:"Aux 3"},{value:"secondary",label:"Secondary message"}],onValueChange:t=>{null!==t&&(null!==e&&l.timerSecondarySource(t),n(t))}}),(0,B.jsx)(_,{variant:null!==e?"primary":"subtle",fluid:!0,onClick:()=>{e===t?l.timerSecondarySource(null):l.timerSecondarySource(t)},"data-testid":"toggle secondary",children:"Show secondary"})]})}function Z(){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Q,{}),(0,B.jsx)(ee,{}),(0,B.jsx)(te,{})]})}function ee(){const{text:e,visible:t}=o();return(0,B.jsx)(W,{label:"Timer Message",placeholder:"Message shown fullscreen in stage timer",text:e,visible:t,changeHandler:e=>l.timerText(e),children:(0,B.jsx)(q,{"aria-label":"Toggle timer message visibility",onClick:()=>l.timerVisible(!t),variant:t?"primary":"subtle",children:t?(0,B.jsx)(h,{}):(0,B.jsx)(g,{})})})}function te(){const{text:e,visible:t}=c();return(0,B.jsx)(W,{label:"Secondary Message",placeholder:"Message shown as secondary text in stage timer",text:e,visible:t,changeHandler:e=>l.secondaryMessage(e),children:(0,B.jsx)(q,{"aria-label":"Toggle secondary message visibility",onClick:()=>{t?l.timerSecondarySource(null):l.timerSecondarySource("secondary")},variant:t?"primary":"subtle",children:t?(0,B.jsx)(h,{}):(0,B.jsx)(g,{})})})}function ne(){const e=window.location.pathname.includes("/messagecontrol");return(0,B.jsx)(P,{permission:"editor",children:(0,B.jsxs)(A,{className:K.growPanel,"data-testid":"panel-messages-control",children:[!e&&(0,B.jsx)(M,{onClick:e=>S("messagecontrol",e)}),e&&(0,B.jsx)(E,{suppressSettings:!0,isNavigationLocked:j()}),(0,B.jsx)("div",{className:K.contentLayout,children:(0,B.jsx)(T,{children:(0,B.jsx)(Z,{})})})]})})}return{setters:[function(e){n=e.a,a=e.n,i=e.t},function(e){r=e.L,o=e.P,s=e.Rt,l=e.i,c=e.m,u=e.qt,d=e.v},function(e){_=e.t},function(e){f=e.t},function(e){m=e.A,y=e.c},function(e){x=e.t},function(e){g=e.At,p=e.J,v=e.K,b=e.at,j=e.j,h=e.kt,k=e.rt,w=e.st,C=e.un},function(e){S=e.l},function(e){},function(e){},function(e){},function(e){q=e.r,I=e.t},function(e){},function(e){},function(e){N=e.i,E=e.j,T=e.r},function(e){P=e.t},function(e){A=e.a,D=e.o,L=e.r,M=e.t}],execute:function(){(F=document.createElement("style")).textContent="._blink_fnxow_1{animation:1s step-start infinite _blink_fnxow_1}@keyframes _blink_fnxow_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_fnxow_13{transform:rotate(45deg)}._inputItems_fnxow_17{grid-template-columns:1fr auto;gap:.5rem;margin-top:.25rem;display:grid}._label_fnxow_24{color:#8a8a8a;font-size:calc(1rem - 2px)}._label_fnxow_24._active_fnxow_28{color:#779be7}._blink_8qr2e_1{animation:1s step-start infinite _blink_8qr2e_1}@keyframes _blink_8qr2e_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_8qr2e_13{transform:rotate(45deg)}._preview_8qr2e_17{text-align:center;background-color:#101010;place-content:center;display:grid;position:relative}._mainContent_8qr2e_25{width:100%;color:var(--override-colour,#f6f6f6);font-size:1rem;font-weight:600}._mainContent_8qr2e_25[data-phase=pending]{color:#22a0e9}._mainContent_8qr2e_25[data-phase=overtime]{color:#fa5656}._mainContent_8qr2e_25[data-phase=none]{opacity:.4}._secondaryContent_8qr2e_41{border-top:1px solid rgba(255,255,255,.07)}._blackout_8qr2e_45{display:none}._eventStatus_8qr2e_49{flex-direction:column;gap:.25rem;margin:.5rem .25rem;display:flex;position:absolute;left:0}._statusIcon_8qr2e_58{color:#404040}._statusIcon_8qr2e_58[data-active=true]{color:#77c785}._blink_ytrng_1{animation:1s step-start infinite _blink_ytrng_1}@keyframes _blink_ytrng_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_ytrng_13{transform:rotate(45deg)}._previewContainer_ytrng_17{grid-template-columns:3fr 2fr;gap:.5rem;display:grid}._options_ytrng_23{flex-direction:column;gap:.5rem;display:flex}._blink_9ahya_1{animation:1s step-start infinite _blink_9ahya_1}@keyframes _blink_9ahya_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_9ahya_13{transform:rotate(45deg)}._growPanel_9ahya_17{flex:1}._contentLayout_9ahya_21{color:#f6f6f6;flex-direction:column;gap:1rem;padding-top:1.5rem;display:flex}\n/*$vite$:1*/",document.head.appendChild(F),function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"f14ad0099eab1969fdd065b56af5fdd3cf530de6"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7c8973b7-649a-4063-9398-50907f0c2f08",e._sentryDebugIdIdentifier="sentry-dbid-7c8973b7-649a-4063-9398-50907f0c2f08")}catch(e){}}(),R=n(a(),1),O={blink:"_blink_fnxow_1",fourtyfive:"_fourtyfive_fnxow_13",inputItems:"_inputItems_fnxow_17",label:"_label_fnxow_24",active:"_active_fnxow_28"},B=i(),z="documentPictureInPicture"in window,H=(0,R.lazy)(()=>m(()=>t.import("./PipHost-legacy-ByrXHggK.js"),void 0,t.meta.url)),V=(0,R.memo)(Y),U={blink:"_blink_8qr2e_1",fourtyfive:"_fourtyfive_8qr2e_13",preview:"_preview_8qr2e_17",mainContent:"_mainContent_8qr2e_25",secondaryContent:"_secondaryContent_8qr2e_41",blackout:"_blackout_8qr2e_45",eventStatus:"_eventStatus_8qr2e_49",statusIcon:"_statusIcon_8qr2e_58"},$={aux1:"Aux 1",aux2:"Aux 2",aux3:"Aux 3",secondary:"Secondary message"},J={blink:"_blink_ytrng_1",fourtyfive:"_fourtyfive_ytrng_13",previewContainer:"_previewContainer_ytrng_17",options:"_options_ytrng_23"},K={blink:"_blink_9ahya_1",fourtyfive:"_fourtyfive_9ahya_13",growPanel:"_growPanel_9ahya_17",contentLayout:"_contentLayout_9ahya_21"},e("default",(0,R.memo)(ne))}}}); //# sourceMappingURL=MessageControlExport-legacy-BysmdwbE.js.map