UNPKG

@getontime/cli

Version:

Time keeping for live events

2 lines 21.2 kB
System.register(["./jsx-runtime-legacy-DMkDNnVj.js","./useSocket-legacy-C772wu7w.js","./Button-legacy-DpgzgT04.js","./useIsSmallScreen-legacy-DavgXfPB.js","./Select-legacy-DHLEukf3.js","./constants-legacy-CvecvM28.js","./SwatchPicker-legacy-DpR2sNl5.js","./viewParamsEditor.store-legacy-BGER9MKV.js","./useSettings-legacy-CmEM1qbK.js","./useRundown-legacy-zes2lKPp.js","./Input-legacy-CNt711cd.js","./PresetContext-legacy-DMyxIOHO.js","./viewOptions-legacy-C48HYPwV.js","./assets-legacy-CsCyioqi.js","./index-legacy-NWDCUII5.js","./Info-legacy-6yM0-oGU.js","./Empty-legacy-ZRfHevNV.js","./ViewParamsEditor-legacy-5MW9MZnc.js","./viewUtils-legacy-djI28uVO.js","./useWindowTitle-legacy-2YHQ5qMQ.js","./useAutoTickingClock-legacy-CkfIpBWe.js","./SuperscriptPeriod-legacy-NlsBX--E.js","./common.options-legacy-BserooSS.js","./useAnimatedProgress-legacy-Dqk_a2jt.js","./offset-legacy-DV3hCcrF.js","./useCustomFields-legacy-B9FQxHWS.js","./viewLoader.utils-legacy-ydrboL-R.js","./QrCode-legacy-CyNmwHds.js","./TitleCard-legacy-BSpAiMWv.js","./ViewLogo-legacy-BZNOVq3q.js","./SuperscriptTime-legacy-DRiHY36H.js","./useProjectData-legacy-BeF8hAuC.js"],function(e,t){var a,n,i,s,r,o,c,l,d,m,u,g,p,x,h,v,f,y,b,j,_,w,k,N,S,E,T,I,C,L,z,M,P,R,V,D,H,O,F,$,A,G,U,W,B,K,q,Q,Y,J,X,Z,ee,te,ae,ne,ie;function se({current:e,duration:t,eventId:a,className:n}){const i=F(e,t,a);return(0,J.jsx)("div",{className:`progress-bar__bg ${n}`,children:(0,J.jsx)("div",{className:"progress-bar__indicator",style:{width:`${i}%`}})})}function re(){const[e]=v();return(0,Y.useMemo)(()=>function(e){return{filter:e.get("filter"),cycleInterval:Number(e.get("cycleInterval"))||10,stopCycle:M(e.get("stopCycle")),showExpected:M(e.get("showExpected"))}}(e),[e])}function oe({timeStart:e,dayOffset:t,delay:a,totalGap:n,isLinkedToLoaded:i,countToEnd:s,colour:r,duration:o,skip:c,title:l,timeEnd:d,cue:m}){const{showExpected:u}=re();return(0,J.jsxs)("li",{className:f(["entry",c&&"entry--skip"]),"data-testid":m,children:[(0,J.jsx)("div",{className:"entry-times",children:u?(0,J.jsx)(de,{timeStart:e,dayOffset:t,delay:a,totalGap:n,isLinkedToLoaded:i,countToEnd:s,duration:o,colour:r}):a>0?(0,J.jsx)(le,{timeStart:e,delay:a,colour:r,timeEnd:d}):(0,J.jsx)(ce,{timeStart:e,timeEnd:d,colour:r})}),(0,J.jsx)("div",{className:"entry-title",children:l})]})}function ce({timeStart:e,timeEnd:t,colour:a}){const n=s(e,ae),i=s(t,ae);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)("span",{className:"entry-colour",style:{backgroundColor:a}}),(0,J.jsx)(D,{time:n}),"→",(0,J.jsx)(D,{time:i})]})}function le({timeStart:e,timeEnd:t,colour:a,delay:n}){const i=s(e,ae),r=s(t,ae),o=s(e+n,ae),c=s(t+n,ae);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)("span",{className:"entry-times--delayed",children:[(0,J.jsx)("span",{className:"entry-colour",style:{backgroundColor:a}}),(0,J.jsx)(D,{time:i}),"→",(0,J.jsx)(D,{time:r})]}),(0,J.jsxs)("span",{className:"entry-times--delay",children:[(0,J.jsx)(D,{time:o}),"→",(0,J.jsx)(D,{time:c})]})]})}function de({timeStart:e,dayOffset:t,delay:a,totalGap:n,isLinkedToLoaded:i,countToEnd:s,colour:r,duration:o}){const c=u(),{expectedStart:l,expectedEnd:d,plannedEnd:m}=g({timeStart:e,dayOffset:t,delay:a,totalGap:n,isLinkedToLoaded:i,countToEnd:s,duration:o},c);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)("span",{className:"entry-colour",style:{backgroundColor:r}}),(0,J.jsx)(me,{expectedTime:l,plannedTime:e}),"→",(0,J.jsx)(me,{expectedTime:d,plannedTime:m})]})}function me({expectedTime:e,plannedTime:t}){const a=s(e);return(0,J.jsx)(D,{className:`entry-times--${$(e-t)}`,time:a})}function ue({className:e}){const{events:t,containerRef:a}=te();return t?.length<1?null:(0,J.jsx)("ul",{className:f(["schedule",e]),ref:a,children:t.map(e=>(0,J.jsx)(oe,{timeStart:e.timeStart,dayOffset:e.dayOffset,delay:e.delay,totalGap:e.totalGap,isLinkedToLoaded:e.isLinkedToLoaded,countToEnd:e.countToEnd,duration:e.duration,colour:e.colour,skip:e.skip,title:e.title,timeEnd:e.timeEnd,cue:e.cue},e.id))})}function ge({className:e}){const{numPages:t,visiblePage:a}=te();return t>10?(0,J.jsxs)("div",{className:f(["schedule-nav",e]),children:[(0,J.jsx)("div",{className:f(["schedule-nav__item",1===a&&"schedule-nav__item--selected"])}),(0,J.jsx)("div",{className:f(["schedule-nav__item",2===a&&"schedule-nav__item--selected"])}),(0,J.jsx)("div",{className:f(["schedule-nav__item",3===a&&"schedule-nav__item--selected"])}),(0,J.jsx)("div",{className:f(["schedule-nav__item",4===a&&"schedule-nav__item--selected"])}),(0,J.jsx)("div",{className:f(["schedule-nav__item",5===a&&"schedule-nav__item--selected"])}),(0,J.jsx)("div",{className:f(["schedule-nav__item","schedule-nav__item--indeterminate",a>5&&a<t-4&&"schedule-nav__item--selected"])}),(0,J.jsx)("div",{className:f(["schedule-nav__item",a===t-4&&"schedule-nav__item--selected"])}),(0,J.jsx)("div",{className:f(["schedule-nav__item",a===t-3&&"schedule-nav__item--selected"])}),(0,J.jsx)("div",{className:f(["schedule-nav__item",a===t-2&&"schedule-nav__item--selected"])}),(0,J.jsx)("div",{className:f(["schedule-nav__item",a===t-1&&"schedule-nav__item--selected"])}),(0,J.jsx)("div",{className:f(["schedule-nav__item",a===t&&"schedule-nav__item--selected"])})]}):(0,J.jsx)("div",{className:f(["schedule-nav",e]),children:t>1&&[...Array(t).keys()].map(e=>(0,J.jsx)("div",{className:f(["schedule-nav__item",e+1===a&&"schedule-nav__item--selected"])},e))})}function pe(e){const{selectedId:t}=e;return(0,J.jsxs)(ee,{selectedEventId:t,children:[(0,J.jsx)(ge,{className:"schedule-nav-container"}),(0,J.jsx)(ue,{className:"schedule-container"})]})}function xe(){const[e]=v(),t=(0,Y.use)(w);return(0,Y.useMemo)(()=>function(e,t){const a=a=>t?.get(a)??e.get(a);return{mainSource:a("main"),secondarySource:a("secondary-src"),extraInfo:a("extra-info"),timeformat:H(e,t)}}(e,t?new URLSearchParams(t.search):void 0),[t,e])}function he({events:e,customFields:t,projectData:a,isMirrored:n,settings:i}){const{getLocalizedString:o}=S(),{mainSource:u,secondarySource:g,extraInfo:v,timeformat:b}=xe(),{eventNext:j,eventNow:_,rundown:w,selectedEventId:k,time:N}=p(),[T,I]=(0,Y.useState)(!1),{height:C}=h();(0,Y.useEffect)(()=>{I(!1);const e=setTimeout(()=>{I(!0)},10);return()=>clearTimeout(e)},[k]);const L=e.length>0,{showNow:M,nowMain:R,nowSecondary:V,showNext:D,nextMain:H,nextSecondary:O}=function(e,t,a,n,i){return i===l.Stop?{showNow:!1,nowMain:void 0,nowSecondary:void 0,showNext:!1,nextMain:void 0,nextSecondary:void 0}:{showNow:null!==e,nowMain:P(e,a??"title")||"–",nowSecondary:P(e,n),showNext:null!==t,nextMain:P(t,a??"title")||"–",nextSecondary:P(t,n)}}(_,j,u,g,N.playback),F=($=N.playback,A=N.phase,$===l.Roll&&A===c.Pending);var $,A;const G=s(F?N.secondaryTimer:N.startedAt,{override:b}),q=(()=>{if(!M&&L)return s(w.plannedStart,{format12:"h:mm a",format24:"HH:mm",override:b})})(),Q=(()=>{if(!M&&L)return s(w.plannedEnd,{format12:"h:mm a",format24:"HH:mm",override:b})})();let X=d(N.current,{fallback:y});X=x(X);const Z=Math.max(window.innerWidth/15,72),ee=function(e){return e!==l.Stop}(N.playback),te=L&&C>420,ae=q&&Q,re=m(i?.timeFormat),oe=(0,Y.useMemo)(()=>ie(re,t,a),[re,t,a]);return(0,J.jsxs)("div",{className:"backstage "+(n?"mirror":""),"data-testid":"backstage-view",children:[(0,J.jsx)(z,{target:r.Backstage,viewOptions:oe}),(0,J.jsxs)("div",{className:"project-header",children:[(0,J.jsxs)("div",{className:f(["project-header__brand",!a?.logo&&"project-header__brand--without-logo"]),children:[a?.logo&&(0,J.jsx)(B,{name:a.logo,className:"logo"}),(0,J.jsx)("div",{className:"title",children:a.title})]}),(0,J.jsx)(fe,{timeformat:b})]}),ee&&(0,J.jsx)(se,{className:"progress-container",current:N.current,duration:N.duration,eventId:k}),!L&&(0,J.jsx)(E,{text:o("common.no_data"),className:"empty-container"}),(0,J.jsxs)("div",{className:"card-container",children:[M&&(0,J.jsxs)("div",{className:f(["event","now",T&&"blink"]),children:[(0,J.jsx)(W,{title:R,secondary:V}),(0,J.jsxs)("div",{className:"timer-group",children:[(0,J.jsxs)("div",{className:"time-entry",children:[(0,J.jsx)("div",{className:f(["time-entry__label",F&&"time-entry--pending"]),children:o(F?"countdown.waiting":"common.started_at")}),(0,J.jsx)(K,{time:G,className:"time-entry__value"})]}),(0,J.jsx)("div",{className:"timer-gap"}),(0,J.jsxs)("div",{className:"time-entry",children:[(0,J.jsx)("div",{className:"time-entry__label",children:o("common.expected_finish")}),(ce=N.current,(ce??0)<0?(0,J.jsx)("div",{className:"time-entry__value",children:o("countdown.overtime")}):(0,J.jsx)(K,{time:s(N.expectedFinish,{override:b}),className:"time-entry__value"}))]}),(0,J.jsx)("div",{className:"timer-gap"}),(0,J.jsxs)("div",{className:"time-entry",children:[(0,J.jsx)("div",{className:"time-entry__label",children:o("common.stage_timer")}),(0,J.jsx)("div",{className:"time-entry__value",children:X})]})]})]}),ae&&(0,J.jsxs)("div",{className:"event",children:[(0,J.jsx)("div",{className:"title-card__placeholder",children:o("countdown.waiting")}),(0,J.jsxs)("div",{className:"timer-group",children:[(0,J.jsxs)("div",{className:"time-entry",children:[(0,J.jsx)("div",{className:f(["time-entry__label",F&&"time-entry--pending"]),children:o("common.scheduled_start")}),(0,J.jsx)(K,{time:q,className:"time-entry__value"})]}),(0,J.jsx)("div",{className:"timer-gap"}),(0,J.jsxs)("div",{className:"time-entry",children:[(0,J.jsx)("div",{className:"time-entry__label",children:o("common.scheduled_end")}),(0,J.jsx)(K,{time:Q,className:"time-entry__value"})]})]})]}),D&&L&&(0,J.jsx)(W,{className:"event",label:"next",title:H,secondary:O})]}),te&&(0,J.jsx)(ne,{selectedId:k}),(0,J.jsxs)("div",{className:f(["info",!te&&"info--stretch"]),children:[v&&(0,J.jsx)(ve,{projectData:a,size:Z,source:v}),(0,J.jsxs)("div",{className:"info-card",children:[a.url&&(0,J.jsx)(U,{value:a.url,size:Z}),a.info&&(0,J.jsx)("div",{className:"info-card__message",children:a.info})]})]})]});var ce}function ve({projectData:e,size:t,source:a}){const n=e.custom.find((e,t)=>`${t}-${e.title}`===a);return n?(0,J.jsxs)("div",{className:"info-card",children:[n.url&&(0,J.jsx)("img",{className:"info-card__img",width:t,src:n.url,onError:e=>e.currentTarget.style.display="none"}),(0,J.jsxs)("div",{className:"info__column",children:[n.title&&(0,J.jsx)("div",{className:"info-card__label",children:n.title}),n.value&&(0,J.jsx)("div",{className:"info-card__message",children:n.value})]})]}):null}function fe({timeformat:e}){const{getLocalizedString:t}=S(),a=s(V(),{override:e});return(0,J.jsxs)("div",{className:"clock-container",children:[(0,J.jsx)("div",{className:"label",children:t("common.time_now")}),(0,J.jsx)(K,{time:a,className:"time"})]})}return e("default",function(){const{data:e,status:t}=function(){const e=k(e=>e.mirror),{data:t,status:a}=_(),{data:n,status:i}=q(),{data:s,status:r}=b(),{data:o,status:c}=A();return{data:{events:t,customFields:o,projectData:n,isMirrored:e,settings:s},status:G([a,i,r,c])}}();return R("Backstage"),"pending"===t?(0,J.jsx)(N,{}):"error"===t?(0,J.jsx)(L,{variant:"error",text:"There was an error fetching data, please refresh the page."}):(0,J.jsx)(he,{...e})}),{setters:[function(e){a=e.a,n=e.n,i=e.t},function(e){s=e.$,r=e.Kt,o=e.Pt,c=e.Rt,l=e.Ut,d=e._t,m=e.et,u=e.p,g=e.tt,p=e.u,x=e.vt},function(e){},function(e){h=e.g,v=e.y},function(e){},function(e){f=e.K,y=e.Y},function(e){},function(e){},function(e){b=e.t},function(e){j=e.i,_=e.n},function(e){},function(e){w=e.t},function(e){k=e.t},function(e){},function(e){N=e.s,S=e.t},function(e){},function(e){E=e.t},function(e){T=e.a,I=e.i,C=e.n,L=e.o,z=e.t},function(e){M=e.i,P=e.n},function(e){R=e.t},function(e){V=e.t},function(e){D=e.t},function(e){H=e.n,O=e.t},function(e){F=e.t},function(e){$=e.t},function(e){A=e.t},function(e){G=e.t},function(e){U=e.t},function(e){W=e.t},function(e){B=e.t},function(e){K=e.t},function(e){q=e.t}],execute:function(){(Q=document.createElement("style")).textContent='@keyframes blink{0%{background-color:var(--card-background-color-override,rgba(255,255,255,.05))}50%{background-color:var(--card-background-color-blink-override,#339e4e)}to{background-color:var(--card-background-color-override,rgba(255,255,255,.05))}}.progress-bar__bg{background-color:var(--timer-progress-bg-override,rgba(255,255,255,.05));border-radius:3px;width:100%;height:12px;overflow:clip}.progress-bar__indicator{background-color:var(--timer-progress-override,#fa5656);height:12px}.schedule{width:100%;list-style:none;position:relative}.schedule .entry{padding-bottom:1em;position:absolute}.schedule .entry--skip{text-decoration:line-through;text-decoration-color:var(--secondary-color-override,rgba(255,255,255,.45))}.schedule .entry-colour{background-color:var(--card-background-color-override,rgba(255,255,255,.05));border-radius:99px;width:max(8px,min(.75vw,12px));height:max(8px,min(.75vw,12px));margin-right:.25rem}.schedule .entry-times{color:var(--secondary-color-override,rgba(255,255,255,.45));letter-spacing:.05em;align-items:center;gap:.2rem;font-size:max(12px,min(1.25vw,20px));display:flex}.schedule .entry-times--delayed,.schedule .entry-times--delay{align-items:center;gap:.25rem;display:flex}.schedule .entry-times--delayed{text-decoration:line-through #f57c13}.schedule .entry-times--delay{color:#e69056}.schedule .entry-times--over{color:#f57c13}.schedule .entry-times--under{color:#55b469}.schedule .entry-title{font-size:max(15px,min(1.5vw,28px));line-height:1.2em}.schedule-nav{display:flex}.schedule-nav .schedule-nav__item{background-color:var(--color-override,rgba(255,255,255,.8));opacity:.2;border-radius:99px;width:max(8px,min(.75vw,12px));height:max(8px,min(.75vw,12px));margin-right:.5em;transition-property:opacity;transition-duration:1s}.schedule-nav .schedule-nav__item--selected{opacity:1;transition-property:opacity;transition-duration:.5s}.schedule-nav .schedule-nav__item--indeterminate{width:max(32px,min(3vw,48px))}.blink{animation:1s step-start infinite blink}.fourtyfive{transform:rotate(45deg)}.mirror{transform:rotate(180deg)}.backstage{box-sizing:border-box;width:100%;height:100vh;font-family:var(--font-family-override,"Open Sans", "Segoe UI", sans-serif);background:var(--background-color-override,#101010);color:var(--color-override,rgba(255,255,255,.8));grid-template:"header header""progress schedule-nav"12px"card schedule"1fr"info schedule"/1fr 40vw;gap:min(2vh,16px);margin:0;padding:min(2vh,16px) max(16px,min(2vw,24px));font-size:max(15px,min(1.5vw,28px));display:grid;overflow:hidden}.backstage .empty-container{color:var(--label-color-override,rgba(255,255,255,.25));margin-top:25vh;position:absolute;top:0;left:0;right:0}.backstage .project-header{grid-area:header;align-items:center;gap:1rem;font-size:max(24px,min(2.5vw,48px));font-weight:600;display:flex}.backstage .project-header__brand{align-items:center;gap:1rem;min-width:0;display:flex}.backstage .project-header__brand--without-logo{align-self:baseline}.backstage .logo{max-width:min(200px,20vw)}.backstage .title{line-height:1.1em}.backstage .clock-container{margin-left:auto;font-weight:600}.backstage .clock-container .label{color:var(--label-color-override,rgba(255,255,255,.25));text-transform:uppercase;font-size:max(12px,min(1.25vw,20px))}.backstage .clock-container .time{color:var(--secondary-color-override,rgba(255,255,255,.45));letter-spacing:.05em;font-size:max(24px,min(2.5vw,48px));line-height:.95em}.backstage .progress-container{grid-area:progress;width:100%;margin:0 auto -8px}.backstage .card-container{flex-direction:column;grid-area:card;gap:min(2vh,16px);display:flex}.backstage .event{background-color:var(--card-background-color-override,rgba(255,255,255,.05));border-radius:4px;padding:min(2vh,8px) max(16px,min(2vw,24px))}.backstage .event.blink{animation-name:blink;animation-duration:1s;animation-timing-function:ease-in-out;animation-iteration-count:3}.backstage .timer-group{border-top:2px solid var(--background-color-override,#101010);row-gap:.5em;margin-top:max(1vh,16px);padding-top:max(1vh,16px);display:flex}.backstage .timer-gap{flex:1;max-width:7.5em}.backstage .time-entry__label{color:var(--label-color-override,rgba(255,255,255,.25));text-transform:uppercase;font-size:max(12px,min(1.25vw,20px));font-weight:600}.backstage .time-entry__value{color:var(--secondary-color-override,rgba(255,255,255,.45));letter-spacing:.05em;font-size:max(15px,min(1.5vw,28px));line-height:.95em}.backstage .time-entry--pending{color:var(--timer-pending-color-override,#22a0e9)}.backstage .schedule-container{grid-area:schedule;height:100%;padding-left:max(16px,min(4vw,64px));overflow:hidden}.backstage .schedule-nav-container{grid-area:schedule-nav;padding-left:max(16px,min(4vw,64px))}.backstage .info{flex-direction:column;grid-area:info;align-self:end;gap:min(2vh,16px);display:flex;overflow:hidden}.backstage .info__column{flex-direction:column;display:flex}.backstage .info-card{gap:min(2vh,16px);display:flex}.backstage .info-card__label{color:var(--label-color-override,rgba(255,255,255,.25));text-transform:uppercase;font-size:max(12px,min(1.25vw,20px));font-weight:600}.backstage .info-card__message{white-space:pre-line;flex:1;font-size:max(15px,min(1.5vw,28px));line-height:1.2em;overflow:hidden}.backstage .info-card__img{border-radius:2px;padding:.5rem}@media screen and (max-width:768px){.backstage{flex-direction:column;display:flex;overflow-y:auto}.backstage .project-header{flex-direction:column;align-items:flex-start;gap:.5rem;position:relative}.backstage .project-header__brand--without-logo{align-self:flex-start}.backstage .logo img{height:min(50px,10vh)}.backstage .timer-group{flex-wrap:wrap}.backstage .clock-container{position:absolute;top:0;right:0}.backstage .schedule-nav-container{justify-content:center;padding-left:0}.backstage .schedule-container{flex:1;padding-left:0}.backstage .info{text-align:right;width:100%}.backstage .qr{display:none}.backstage .info--stretch{flex:1}}\n/*$vite$:1*/',document.head.appendChild(Q),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]="b789f0f7-1eae-4e88-952a-1589745c967e",e._sentryDebugIdIdentifier="sentry-dbid-b789f0f7-1eae-4e88-952a-1589745c967e")}catch(e){}}(),Y=a(n(),1),J=i(),X=e=>({title:C.Schedule,collapsible:!0,options:[{id:"filter",title:"Filter",description:"Hide events without data in the selected custom field",type:"option",values:e,defaultValue:"none"},{id:"stopCycle",title:"Stop cycling through event pages",description:"Schedule will not auto-cycle through events",type:"boolean",defaultValue:!1},{id:"cycleInterval",title:"Cycle interval",description:"How long (in seconds) should each schedule page be shown.",type:"number",defaultValue:10},{id:"showExpected",title:"Show expected time",description:"Whether the times shown should account for the runtime offset.",type:"boolean",defaultValue:!1}]}),Z=(0,Y.createContext)(void 0),ee=({children:e,selectedEventId:t})=>{const{cycleInterval:a,stopCycle:n,filter:i}=re(),{data:s}=j((0,Y.useCallback)(e=>{if(i){const t=i.startsWith("custom-")?i.slice(7):i;return o(e)&&Boolean(e.custom[t])}return o(e)},[i])),[r,c]=(0,Y.useState)(-1),[l,d]=(0,Y.useState)(0),[m,u]=(0,Y.useState)(0),g=(0,Y.useRef)(-1),p=(0,Y.useRef)(void 0),x=(0,Y.useRef)(null);(0,Y.useLayoutEffect)(()=>{if(!x.current)return;const e=Array.from(x.current.children);if(0===e.length)return;const t=x.current.clientHeight;let a=0,n=1,i=1,s=-1,o=!1;for(let d=0;d<e.length;d++){const m=e[d].clientHeight,u=a+m>t;u&&(a=0,i+=1),d<r?l(e[d]):-1===s?(o=!0,n=i):u&&(o=!1),o?(s=d,c(e[d],a)):l(e[d]),a+=m}function c(e,t){e.style.top=`${t}px`}function l(e){e.style.top="-1000px"}u(n),d(i),g.current=s},[r,s]),(0,Y.useEffect)(()=>n?(u(1),void c(0)):(p.current&&clearInterval(p.current),p.current=setInterval(()=>{c(m===l?0:g.current+1)},1e3*a),()=>clearInterval(p.current)),[a,l,n,m]);const h=(0,Y.useMemo)(()=>{const e=s.findIndex(e=>e.id===t);return s.slice(e+1)},[s,t]);return(0,J.jsx)(Z,{value:(0,Y.useMemo)(()=>({events:h,selectedEventId:t,numPages:l,visiblePage:m,containerRef:x}),[h,t,l,m,x]),children:e})},te=()=>{const e=(0,Y.use)(Z);if(!e)throw new Error("useSchedule() can only be used inside a ScheduleContext");return e},ae={format12:"h:mm a",format24:"HH:mm"},ne=(0,Y.memo)(pe),ie=(e,t,a)=>{const n=I(t,[{value:"none",label:"None"}]),i=I(t,[{value:"none",label:"None"},{value:"note",label:"Note"}]),s=T(a,[{value:"none",label:"None"}]),r=I(t,[{value:"title",label:"Title"}]);return[{title:C.ClockOptions,collapsible:!0,options:[O(e)]},{title:C.DataSources,collapsible:!0,options:[{id:"main",title:"Main text",description:"Select the data source for the main text",type:"option",values:r,defaultValue:"title"},{id:"secondary-src",title:"Event secondary text",description:"Select the data source for auxiliary text shown in now and next cards",type:"option",values:i,defaultValue:"none"}]},X(n),{title:C.ElementVisibility,collapsible:!0,options:[{id:"extra-info",title:"Extra info",description:"Select a project data source to show in the view",type:"option",values:s,defaultValue:"none"}]}]}}}}); //# sourceMappingURL=Backstage-legacy-jhu0hMur.js.map