@getontime/cli 4.4.0 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/assets/{Backstage-ScLTYJAt.js → Backstage-BY9GL_rk.js} +2 -2
- package/client/assets/Backstage-BY9GL_rk.js.br +0 -0
- package/client/assets/Backstage-BY9GL_rk.js.gz +0 -0
- package/client/assets/{Backstage-ScLTYJAt.js.map → Backstage-BY9GL_rk.js.map} +1 -1
- package/client/assets/{Countdown-DA_Lph2k.js → Countdown-CXFgDHND.js} +2 -2
- package/client/assets/Countdown-CXFgDHND.js.br +0 -0
- package/client/assets/Countdown-CXFgDHND.js.gz +0 -0
- package/client/assets/{Countdown-DA_Lph2k.js.map → Countdown-CXFgDHND.js.map} +1 -1
- package/client/assets/{CuesheetTable-C7hP6tMi.js → CuesheetTable-BLICUNky.js} +2 -2
- package/client/assets/CuesheetTable-BLICUNky.js.br +0 -0
- package/client/assets/CuesheetTable-BLICUNky.js.gz +0 -0
- package/client/assets/{CuesheetTable-C7hP6tMi.js.map → CuesheetTable-BLICUNky.js.map} +1 -1
- package/client/assets/CustomTranslationModal-4PVZBtkC.js +2 -0
- package/client/assets/CustomTranslationModal-4PVZBtkC.js.br +0 -0
- package/client/assets/CustomTranslationModal-4PVZBtkC.js.gz +0 -0
- package/client/assets/{CustomTranslationModal-0ROtCxPC.js.map → CustomTranslationModal-4PVZBtkC.js.map} +1 -1
- package/client/assets/DelayIndicator-DUbpd6DG.js +2 -0
- package/client/assets/DelayIndicator-DUbpd6DG.js.br +0 -0
- package/client/assets/DelayIndicator-DUbpd6DG.js.gz +0 -0
- package/client/assets/DelayIndicator-DUbpd6DG.js.map +1 -0
- package/client/assets/{EditorFeatureWrapper-B_KH_YqU.js → EditorFeatureWrapper-CV_zaDoG.js} +2 -2
- package/client/assets/EditorFeatureWrapper-CV_zaDoG.js.br +0 -0
- package/client/assets/EditorFeatureWrapper-CV_zaDoG.js.gz +0 -0
- package/client/assets/{EditorFeatureWrapper-B_KH_YqU.js.map → EditorFeatureWrapper-CV_zaDoG.js.map} +1 -1
- package/client/assets/{EditorUtils-BxN0w0-D.js → EditorUtils-CLBWDP4k.js} +2 -2
- package/client/assets/EditorUtils-CLBWDP4k.js.br +0 -0
- package/client/assets/EditorUtils-CLBWDP4k.js.gz +0 -0
- package/client/assets/{EditorUtils-BxN0w0-D.js.map → EditorUtils-CLBWDP4k.js.map} +1 -1
- package/client/assets/{EmptyPage-CcO33dlE.js → EmptyPage-DmpOAg7R.js} +2 -2
- package/client/assets/EmptyPage-DmpOAg7R.js.br +2 -0
- package/client/assets/EmptyPage-DmpOAg7R.js.gz +0 -0
- package/client/assets/{EmptyPage-CcO33dlE.js.map → EmptyPage-DmpOAg7R.js.map} +1 -1
- package/client/assets/{FollowButton-DJCtYYXt.js → FollowButton-CAUWz5Ma.js} +2 -2
- package/client/assets/FollowButton-CAUWz5Ma.js.br +0 -0
- package/client/assets/FollowButton-CAUWz5Ma.js.gz +0 -0
- package/client/assets/{FollowButton-DJCtYYXt.js.map → FollowButton-CAUWz5Ma.js.map} +1 -1
- package/client/assets/{MessageControlExport-DGo2ZNMw.js → MessageControlExport-Dm8IjSr4.js} +3 -3
- package/client/assets/MessageControlExport-Dm8IjSr4.js.br +0 -0
- package/client/assets/MessageControlExport-Dm8IjSr4.js.gz +0 -0
- package/client/assets/{MessageControlExport-DGo2ZNMw.js.map → MessageControlExport-Dm8IjSr4.js.map} +1 -1
- package/client/assets/{MultiPartProgressBar-IIU35-x9.js → MultiPartProgressBar-Fp-sTN2u.js} +2 -2
- package/client/assets/MultiPartProgressBar-Fp-sTN2u.js.br +0 -0
- package/client/assets/MultiPartProgressBar-Fp-sTN2u.js.gz +0 -0
- package/client/assets/{MultiPartProgressBar-IIU35-x9.js.map → MultiPartProgressBar-Fp-sTN2u.js.map} +1 -1
- package/client/assets/{OperatorExport-C-KafSVE.js → OperatorExport-CE4ajLPS.js} +2 -2
- package/client/assets/OperatorExport-CE4ajLPS.js.br +0 -0
- package/client/assets/OperatorExport-CE4ajLPS.js.gz +0 -0
- package/client/assets/{OperatorExport-C-KafSVE.js.map → OperatorExport-CE4ajLPS.js.map} +1 -1
- package/client/assets/{OverviewWrapper-B6AeBRb6.js → OverviewWrapper-BNnAIUP1.js} +2 -2
- package/client/assets/OverviewWrapper-BNnAIUP1.js.br +0 -0
- package/client/assets/OverviewWrapper-BNnAIUP1.js.gz +0 -0
- package/client/assets/{OverviewWrapper-B6AeBRb6.js.map → OverviewWrapper-BNnAIUP1.js.map} +1 -1
- package/client/assets/{PipHost-BueqKsmJ.js → PipHost-CbNFsfqp.js} +2 -2
- package/client/assets/PipHost-CbNFsfqp.js.br +0 -0
- package/client/assets/PipHost-CbNFsfqp.js.gz +0 -0
- package/client/assets/{PipHost-BueqKsmJ.js.map → PipHost-CbNFsfqp.js.map} +1 -1
- package/client/assets/{ProjectInfo-DiD9lzzx.js → ProjectInfo-Bf5z4Xsv.js} +2 -2
- package/client/assets/ProjectInfo-Bf5z4Xsv.js.br +0 -0
- package/client/assets/ProjectInfo-Bf5z4Xsv.js.gz +0 -0
- package/client/assets/{ProjectInfo-DiD9lzzx.js.map → ProjectInfo-Bf5z4Xsv.js.map} +1 -1
- package/client/assets/{ProtectRoute-CcDK6JVA.js → ProtectRoute-CCHzyy0I.js} +2 -2
- package/client/assets/ProtectRoute-CCHzyy0I.js.br +0 -0
- package/client/assets/ProtectRoute-CCHzyy0I.js.gz +0 -0
- package/client/assets/{ProtectRoute-CcDK6JVA.js.map → ProtectRoute-CCHzyy0I.js.map} +1 -1
- package/client/assets/ProtectedCuesheet-COI1W_V3.js +2 -0
- package/client/assets/ProtectedCuesheet-COI1W_V3.js.br +0 -0
- package/client/assets/ProtectedCuesheet-COI1W_V3.js.gz +0 -0
- package/client/assets/{ProtectedCuesheet-D19INqhI.js.map → ProtectedCuesheet-COI1W_V3.js.map} +1 -1
- package/client/assets/ProtectedEditor-BvTFmv-F.js +3 -0
- package/client/assets/ProtectedEditor-BvTFmv-F.js.br +0 -0
- package/client/assets/ProtectedEditor-BvTFmv-F.js.gz +0 -0
- package/client/assets/ProtectedEditor-BvTFmv-F.js.map +1 -0
- package/client/assets/RundownExport-C_q3KYN_.js +2 -0
- package/client/assets/RundownExport-C_q3KYN_.js.br +0 -0
- package/client/assets/RundownExport-C_q3KYN_.js.gz +0 -0
- package/client/assets/RundownExport-C_q3KYN_.js.map +1 -0
- package/client/assets/RundownExport-CzaSrbaj.css +1 -0
- package/client/assets/RundownExport-CzaSrbaj.css.br +0 -0
- package/client/assets/RundownExport-CzaSrbaj.css.gz +0 -0
- package/client/assets/Select-DQwYPDyI.js +2 -0
- package/client/assets/Select-DQwYPDyI.js.br +0 -0
- package/client/assets/Select-DQwYPDyI.js.gz +0 -0
- package/client/assets/{Select-B3zdv0Ng.js.map → Select-DQwYPDyI.js.map} +1 -1
- package/client/assets/{Studio-DS_uXtgn.js → Studio-DzXTmBx4.js} +2 -2
- package/client/assets/Studio-DzXTmBx4.js.br +0 -0
- package/client/assets/Studio-DzXTmBx4.js.gz +0 -0
- package/client/assets/{Studio-DS_uXtgn.js.map → Studio-DzXTmBx4.js.map} +1 -1
- package/client/assets/StyleEditor-ClMEMaWh.js +2 -0
- package/client/assets/StyleEditor-ClMEMaWh.js.br +0 -0
- package/client/assets/StyleEditor-ClMEMaWh.js.gz +0 -0
- package/client/assets/{StyleEditor-DcyJgmAF.js.map → StyleEditor-ClMEMaWh.js.map} +1 -1
- package/client/assets/{SuperscriptPeriod-DswX2aei.js → SuperscriptPeriod-CBiZU34J.js} +2 -2
- package/client/assets/SuperscriptPeriod-CBiZU34J.js.br +0 -0
- package/client/assets/SuperscriptPeriod-CBiZU34J.js.gz +0 -0
- package/client/assets/{SuperscriptPeriod-DswX2aei.js.map → SuperscriptPeriod-CBiZU34J.js.map} +1 -1
- package/client/assets/{SuperscriptTime-COS4JWHJ.js → SuperscriptTime-DP1CDlOX.js} +2 -2
- package/client/assets/SuperscriptTime-DP1CDlOX.js.br +0 -0
- package/client/assets/SuperscriptTime-DP1CDlOX.js.gz +0 -0
- package/client/assets/{SuperscriptTime-COS4JWHJ.js.map → SuperscriptTime-DP1CDlOX.js.map} +1 -1
- package/client/assets/SwatchPicker-Dyxkxf3_.js +2 -0
- package/client/assets/SwatchPicker-Dyxkxf3_.js.br +0 -0
- package/client/assets/SwatchPicker-Dyxkxf3_.js.gz +0 -0
- package/client/assets/{SwatchPicker-DPyJv7aS.js.map → SwatchPicker-Dyxkxf3_.js.map} +1 -1
- package/client/assets/TimeElements-pDYJeFbV.js +2 -0
- package/client/assets/TimeElements-pDYJeFbV.js.br +0 -0
- package/client/assets/TimeElements-pDYJeFbV.js.gz +0 -0
- package/client/assets/{TimeElements-8rNLGU60.js.map → TimeElements-pDYJeFbV.js.map} +1 -1
- package/client/assets/{TimeInput-OX4LMRQl.js → TimeInput-DTWDnaum.js} +2 -2
- package/client/assets/TimeInput-DTWDnaum.js.br +0 -0
- package/client/assets/TimeInput-DTWDnaum.js.gz +0 -0
- package/client/assets/{TimeInput-OX4LMRQl.js.map → TimeInput-DTWDnaum.js.map} +1 -1
- package/client/assets/{TimelinePage-7kRpUl6P.js → TimelinePage-DbLt9rQi.js} +2 -2
- package/client/assets/TimelinePage-DbLt9rQi.js.br +0 -0
- package/client/assets/TimelinePage-DbLt9rQi.js.gz +0 -0
- package/client/assets/{TimelinePage-7kRpUl6P.js.map → TimelinePage-DbLt9rQi.js.map} +1 -1
- package/client/assets/{Timer-Bg9pVhup.js → Timer-BfyVKQ8U.js} +2 -2
- package/client/assets/Timer-BfyVKQ8U.js.br +0 -0
- package/client/assets/Timer-BfyVKQ8U.js.gz +0 -0
- package/client/assets/{Timer-Bg9pVhup.js.map → Timer-BfyVKQ8U.js.map} +1 -1
- package/client/assets/TimerControlExport-BJfhJc07.js +2 -0
- package/client/assets/TimerControlExport-BJfhJc07.js.br +0 -0
- package/client/assets/TimerControlExport-BJfhJc07.js.gz +0 -0
- package/client/assets/{TimerControlExport-BNfZ99Im.js.map → TimerControlExport-BJfhJc07.js.map} +1 -1
- package/client/assets/TimerDisplay-Dgmbqf65.js +2 -0
- package/client/assets/TimerDisplay-Dgmbqf65.js.br +0 -0
- package/client/assets/TimerDisplay-Dgmbqf65.js.gz +0 -0
- package/client/assets/{TimerDisplay-DQQ7sMDc.js.map → TimerDisplay-Dgmbqf65.js.map} +1 -1
- package/client/assets/{TitleCard-De0WhlN2.js → TitleCard-MUurHeZ7.js} +2 -2
- package/client/assets/TitleCard-MUurHeZ7.js.br +0 -0
- package/client/assets/TitleCard-MUurHeZ7.js.gz +0 -0
- package/client/assets/{TitleCard-De0WhlN2.js.map → TitleCard-MUurHeZ7.js.map} +1 -1
- package/client/assets/Tooltip-DXph8P8p.js +2 -0
- package/client/assets/Tooltip-DXph8P8p.js.br +0 -0
- package/client/assets/Tooltip-DXph8P8p.js.gz +0 -0
- package/client/assets/{Tooltip-B4PEP32j.js.map → Tooltip-DXph8P8p.js.map} +1 -1
- package/client/assets/{ViewLogo-CHqiH4C0.js → ViewLogo-Ckp7i75x.js} +2 -2
- package/client/assets/ViewLogo-Ckp7i75x.js.br +0 -0
- package/client/assets/ViewLogo-Ckp7i75x.js.gz +0 -0
- package/client/assets/{ViewLogo-CHqiH4C0.js.map → ViewLogo-Ckp7i75x.js.map} +1 -1
- package/client/assets/{ViewParamsEditor-BHIK3qtx.js → ViewParamsEditor-Cxngd15h.js} +2 -2
- package/client/assets/ViewParamsEditor-Cxngd15h.js.br +0 -0
- package/client/assets/ViewParamsEditor-Cxngd15h.js.gz +0 -0
- package/client/assets/{ViewParamsEditor-BHIK3qtx.js.map → ViewParamsEditor-Cxngd15h.js.map} +1 -1
- package/client/assets/{editorSettings-VcitNPq1.js → editorSettings-D4jfu68W.js} +2 -2
- package/client/assets/editorSettings-D4jfu68W.js.br +0 -0
- package/client/assets/editorSettings-D4jfu68W.js.gz +0 -0
- package/client/assets/{editorSettings-VcitNPq1.js.map → editorSettings-D4jfu68W.js.map} +1 -1
- package/client/assets/{getProgress-mRMYlU96.js → getProgress-B9UANc25.js} +2 -2
- package/client/assets/getProgress-B9UANc25.js.br +0 -0
- package/client/assets/getProgress-B9UANc25.js.gz +0 -0
- package/client/assets/{getProgress-mRMYlU96.js.map → getProgress-B9UANc25.js.map} +1 -1
- package/client/assets/index-2lQ-45a9.js +3 -0
- package/client/assets/index-2lQ-45a9.js.br +0 -0
- package/client/assets/index-2lQ-45a9.js.gz +0 -0
- package/client/assets/index-2lQ-45a9.js.map +1 -0
- package/client/assets/{offset-Bs6CY1IK.js → offset-DAyBfv5b.js} +2 -2
- package/client/assets/offset-DAyBfv5b.js.br +4 -0
- package/client/assets/offset-DAyBfv5b.js.gz +0 -0
- package/client/assets/{offset-Bs6CY1IK.js.map → offset-DAyBfv5b.js.map} +1 -1
- package/client/assets/{parseUserTime-CI7s8pYc.js → parseUserTime-WkVNjkkE.js} +2 -2
- package/client/assets/parseUserTime-WkVNjkkE.js.br +0 -0
- package/client/assets/parseUserTime-WkVNjkkE.js.gz +0 -0
- package/client/assets/{parseUserTime-CI7s8pYc.js.map → parseUserTime-WkVNjkkE.js.map} +1 -1
- package/client/assets/{playbackstate-DisgQbHM.js → playbackstate-znZk3SSJ.js} +2 -2
- package/client/assets/playbackstate-znZk3SSJ.js.br +0 -0
- package/client/assets/playbackstate-znZk3SSJ.js.gz +0 -0
- package/client/assets/{playbackstate-DisgQbHM.js.map → playbackstate-znZk3SSJ.js.map} +1 -1
- package/client/assets/{presentation.utils-Bv3PuMWv.js → presentation.utils-CjjYs5II.js} +2 -2
- package/client/assets/presentation.utils-CjjYs5II.js.br +0 -0
- package/client/assets/presentation.utils-CjjYs5II.js.gz +0 -0
- package/client/assets/{presentation.utils-Bv3PuMWv.js.map → presentation.utils-CjjYs5II.js.map} +1 -1
- package/client/assets/rundownUtils-BTQ3EeqN.js +2 -0
- package/client/assets/rundownUtils-BTQ3EeqN.js.br +0 -0
- package/client/assets/rundownUtils-BTQ3EeqN.js.gz +0 -0
- package/client/assets/rundownUtils-BTQ3EeqN.js.map +1 -0
- package/client/assets/{timer.utils-P25ngopd.js → timer.utils-B-Ui91P7.js} +2 -2
- package/client/assets/timer.utils-B-Ui91P7.js.br +0 -0
- package/client/assets/timer.utils-B-Ui91P7.js.gz +0 -0
- package/client/assets/{timer.utils-P25ngopd.js.map → timer.utils-B-Ui91P7.js.map} +1 -1
- package/client/assets/useCustomFields-zr9SUl5o.js +2 -0
- package/client/assets/useCustomFields-zr9SUl5o.js.br +0 -0
- package/client/assets/useCustomFields-zr9SUl5o.js.gz +0 -0
- package/client/assets/useCustomFields-zr9SUl5o.js.map +1 -0
- package/client/assets/useEventSelection-B9mbj1cM.js +2 -0
- package/client/assets/useEventSelection-B9mbj1cM.js.br +0 -0
- package/client/assets/useEventSelection-B9mbj1cM.js.gz +0 -0
- package/client/assets/useEventSelection-B9mbj1cM.js.map +1 -0
- package/client/assets/useProjectData-DD_BQ9eJ.js +2 -0
- package/client/assets/useProjectData-DD_BQ9eJ.js.br +0 -0
- package/client/assets/useProjectData-DD_BQ9eJ.js.gz +0 -0
- package/client/assets/useProjectData-DD_BQ9eJ.js.map +1 -0
- package/client/assets/useReport-DozG5uz5.js +2 -0
- package/client/assets/useReport-DozG5uz5.js.br +0 -0
- package/client/assets/useReport-DozG5uz5.js.gz +0 -0
- package/client/assets/useReport-DozG5uz5.js.map +1 -0
- package/client/assets/useRundown-D6vokFHi.js +2 -0
- package/client/assets/useRundown-D6vokFHi.js.br +0 -0
- package/client/assets/useRundown-D6vokFHi.js.gz +0 -0
- package/client/assets/useRundown-D6vokFHi.js.map +1 -0
- package/client/assets/{useSelectAndRevealEntry-CzSIOtzH.js → useSelectAndRevealEntry-Dd6MpVHe.js} +2 -2
- package/client/assets/useSelectAndRevealEntry-Dd6MpVHe.js.br +0 -0
- package/client/assets/useSelectAndRevealEntry-Dd6MpVHe.js.gz +0 -0
- package/client/assets/{useSelectAndRevealEntry-CzSIOtzH.js.map → useSelectAndRevealEntry-Dd6MpVHe.js.map} +1 -1
- package/client/assets/{useWindowTitle-Cl1AVD9_.js → useWindowTitle-bg-fLPOk.js} +2 -2
- package/client/assets/useWindowTitle-bg-fLPOk.js.br +0 -0
- package/client/assets/useWindowTitle-bg-fLPOk.js.gz +0 -0
- package/client/assets/{useWindowTitle-Cl1AVD9_.js.map → useWindowTitle-bg-fLPOk.js.map} +1 -1
- package/client/assets/validateEvent-BUgLWn7x.js +2 -0
- package/client/assets/validateEvent-BUgLWn7x.js.br +0 -0
- package/client/assets/validateEvent-BUgLWn7x.js.gz +0 -0
- package/client/assets/{validateEvent-DhFtLvz_.js.map → validateEvent-BUgLWn7x.js.map} +1 -1
- package/client/assets/{vendor-dQa48psh.js → vendor-CKDP5hij.js} +12 -12
- package/client/assets/vendor-CKDP5hij.js.br +0 -0
- package/client/assets/vendor-CKDP5hij.js.gz +0 -0
- package/client/assets/{vendor-dQa48psh.js.map → vendor-CKDP5hij.js.map} +1 -1
- package/client/assets/{viewLoader.utils-ndDejZHN.js → viewLoader.utils-Bn5zu5sz.js} +2 -2
- package/client/assets/viewLoader.utils-Bn5zu5sz.js.br +0 -0
- package/client/assets/viewLoader.utils-Bn5zu5sz.js.gz +0 -0
- package/client/assets/{viewLoader.utils-ndDejZHN.js.map → viewLoader.utils-Bn5zu5sz.js.map} +1 -1
- package/client/assets/{viewUtils-rcOl1-o8.js → viewUtils-DQFwr7hm.js} +2 -2
- package/client/assets/viewUtils-DQFwr7hm.js.br +0 -0
- package/client/assets/viewUtils-DQFwr7hm.js.gz +0 -0
- package/client/assets/{viewUtils-rcOl1-o8.js.map → viewUtils-DQFwr7hm.js.map} +1 -1
- package/client/index.html +2 -2
- package/package.json +1 -1
- package/server/index.cjs +87 -87
- package/client/assets/Backstage-ScLTYJAt.js.br +0 -0
- package/client/assets/Backstage-ScLTYJAt.js.gz +0 -0
- package/client/assets/Countdown-DA_Lph2k.js.br +0 -0
- package/client/assets/Countdown-DA_Lph2k.js.gz +0 -0
- package/client/assets/CuesheetTable-C7hP6tMi.js.br +0 -0
- package/client/assets/CuesheetTable-C7hP6tMi.js.gz +0 -0
- package/client/assets/CustomTranslationModal-0ROtCxPC.js +0 -2
- package/client/assets/CustomTranslationModal-0ROtCxPC.js.br +0 -0
- package/client/assets/CustomTranslationModal-0ROtCxPC.js.gz +0 -0
- package/client/assets/DelayIndicator-OEjcqoIx.js +0 -2
- package/client/assets/DelayIndicator-OEjcqoIx.js.br +0 -0
- package/client/assets/DelayIndicator-OEjcqoIx.js.gz +0 -0
- package/client/assets/DelayIndicator-OEjcqoIx.js.map +0 -1
- package/client/assets/EditorFeatureWrapper-B_KH_YqU.js.br +0 -0
- package/client/assets/EditorFeatureWrapper-B_KH_YqU.js.gz +0 -0
- package/client/assets/EditorUtils-BxN0w0-D.js.br +0 -0
- package/client/assets/EditorUtils-BxN0w0-D.js.gz +0 -0
- package/client/assets/EmptyPage-CcO33dlE.js.br +0 -0
- package/client/assets/EmptyPage-CcO33dlE.js.gz +0 -0
- package/client/assets/FollowButton-DJCtYYXt.js.br +0 -0
- package/client/assets/FollowButton-DJCtYYXt.js.gz +0 -0
- package/client/assets/MessageControlExport-DGo2ZNMw.js.br +0 -0
- package/client/assets/MessageControlExport-DGo2ZNMw.js.gz +0 -0
- package/client/assets/MultiPartProgressBar-IIU35-x9.js.br +0 -0
- package/client/assets/MultiPartProgressBar-IIU35-x9.js.gz +0 -0
- package/client/assets/OperatorExport-C-KafSVE.js.br +0 -0
- package/client/assets/OperatorExport-C-KafSVE.js.gz +0 -0
- package/client/assets/OverviewWrapper-B6AeBRb6.js.br +0 -0
- package/client/assets/OverviewWrapper-B6AeBRb6.js.gz +0 -0
- package/client/assets/PipHost-BueqKsmJ.js.br +0 -0
- package/client/assets/PipHost-BueqKsmJ.js.gz +0 -0
- package/client/assets/ProjectInfo-DiD9lzzx.js.br +0 -0
- package/client/assets/ProjectInfo-DiD9lzzx.js.gz +0 -0
- package/client/assets/ProtectRoute-CcDK6JVA.js.br +0 -0
- package/client/assets/ProtectRoute-CcDK6JVA.js.gz +0 -0
- package/client/assets/ProtectedCuesheet-D19INqhI.js +0 -2
- package/client/assets/ProtectedCuesheet-D19INqhI.js.br +0 -0
- package/client/assets/ProtectedCuesheet-D19INqhI.js.gz +0 -0
- package/client/assets/ProtectedEditor-BVabJfIz.js +0 -3
- package/client/assets/ProtectedEditor-BVabJfIz.js.br +0 -0
- package/client/assets/ProtectedEditor-BVabJfIz.js.gz +0 -0
- package/client/assets/ProtectedEditor-BVabJfIz.js.map +0 -1
- package/client/assets/RundownEntry-C5kdIHbb.js +0 -2
- package/client/assets/RundownEntry-C5kdIHbb.js.br +0 -0
- package/client/assets/RundownEntry-C5kdIHbb.js.gz +0 -0
- package/client/assets/RundownEntry-C5kdIHbb.js.map +0 -1
- package/client/assets/RundownEntry-jE09YkV2.css +0 -1
- package/client/assets/RundownEntry-jE09YkV2.css.br +0 -0
- package/client/assets/RundownEntry-jE09YkV2.css.gz +0 -0
- package/client/assets/RundownExport-BFn7H24P.css +0 -1
- package/client/assets/RundownExport-BFn7H24P.css.br +0 -0
- package/client/assets/RundownExport-BFn7H24P.css.gz +0 -0
- package/client/assets/RundownExport-DhzzqPCD.js +0 -3
- package/client/assets/RundownExport-DhzzqPCD.js.br +0 -0
- package/client/assets/RundownExport-DhzzqPCD.js.gz +0 -0
- package/client/assets/RundownExport-DhzzqPCD.js.map +0 -1
- package/client/assets/Select-B3zdv0Ng.js +0 -2
- package/client/assets/Select-B3zdv0Ng.js.br +0 -0
- package/client/assets/Select-B3zdv0Ng.js.gz +0 -0
- package/client/assets/Studio-DS_uXtgn.js.br +0 -0
- package/client/assets/Studio-DS_uXtgn.js.gz +0 -0
- package/client/assets/StyleEditor-DcyJgmAF.js +0 -2
- package/client/assets/StyleEditor-DcyJgmAF.js.br +0 -0
- package/client/assets/StyleEditor-DcyJgmAF.js.gz +0 -0
- package/client/assets/SuperscriptPeriod-DswX2aei.js.br +0 -0
- package/client/assets/SuperscriptPeriod-DswX2aei.js.gz +0 -0
- package/client/assets/SuperscriptTime-COS4JWHJ.js.br +0 -0
- package/client/assets/SuperscriptTime-COS4JWHJ.js.gz +0 -0
- package/client/assets/SwatchPicker-DPyJv7aS.js +0 -2
- package/client/assets/SwatchPicker-DPyJv7aS.js.br +0 -0
- package/client/assets/SwatchPicker-DPyJv7aS.js.gz +0 -0
- package/client/assets/TimeElements-8rNLGU60.js +0 -2
- package/client/assets/TimeElements-8rNLGU60.js.br +0 -0
- package/client/assets/TimeElements-8rNLGU60.js.gz +0 -0
- package/client/assets/TimeInput-OX4LMRQl.js.br +0 -0
- package/client/assets/TimeInput-OX4LMRQl.js.gz +0 -0
- package/client/assets/TimelinePage-7kRpUl6P.js.br +0 -0
- package/client/assets/TimelinePage-7kRpUl6P.js.gz +0 -0
- package/client/assets/Timer-Bg9pVhup.js.br +0 -0
- package/client/assets/Timer-Bg9pVhup.js.gz +0 -0
- package/client/assets/TimerControlExport-BNfZ99Im.js +0 -2
- package/client/assets/TimerControlExport-BNfZ99Im.js.br +0 -0
- package/client/assets/TimerControlExport-BNfZ99Im.js.gz +0 -0
- package/client/assets/TimerDisplay-DQQ7sMDc.js +0 -2
- package/client/assets/TimerDisplay-DQQ7sMDc.js.br +0 -0
- package/client/assets/TimerDisplay-DQQ7sMDc.js.gz +0 -0
- package/client/assets/TitleCard-De0WhlN2.js.br +0 -0
- package/client/assets/TitleCard-De0WhlN2.js.gz +0 -0
- package/client/assets/Tooltip-B4PEP32j.js +0 -2
- package/client/assets/Tooltip-B4PEP32j.js.br +0 -0
- package/client/assets/Tooltip-B4PEP32j.js.gz +0 -0
- package/client/assets/ViewLogo-CHqiH4C0.js.br +0 -0
- package/client/assets/ViewLogo-CHqiH4C0.js.gz +0 -0
- package/client/assets/ViewParamsEditor-BHIK3qtx.js.br +0 -0
- package/client/assets/ViewParamsEditor-BHIK3qtx.js.gz +0 -0
- package/client/assets/editorSettings-VcitNPq1.js.br +0 -0
- package/client/assets/editorSettings-VcitNPq1.js.gz +0 -0
- package/client/assets/getProgress-mRMYlU96.js.br +0 -0
- package/client/assets/getProgress-mRMYlU96.js.gz +0 -0
- package/client/assets/index-DYkg-xOk.js +0 -3
- package/client/assets/index-DYkg-xOk.js.br +0 -0
- package/client/assets/index-DYkg-xOk.js.gz +0 -0
- package/client/assets/index-DYkg-xOk.js.map +0 -1
- package/client/assets/offset-Bs6CY1IK.js.br +0 -3
- package/client/assets/offset-Bs6CY1IK.js.gz +0 -0
- package/client/assets/parseUserTime-CI7s8pYc.js.br +0 -0
- package/client/assets/parseUserTime-CI7s8pYc.js.gz +0 -0
- package/client/assets/playbackstate-DisgQbHM.js.br +0 -0
- package/client/assets/playbackstate-DisgQbHM.js.gz +0 -0
- package/client/assets/presentation.utils-Bv3PuMWv.js.br +0 -0
- package/client/assets/presentation.utils-Bv3PuMWv.js.gz +0 -0
- package/client/assets/rundownUtils-CJxEqFha.js +0 -2
- package/client/assets/rundownUtils-CJxEqFha.js.br +0 -0
- package/client/assets/rundownUtils-CJxEqFha.js.gz +0 -0
- package/client/assets/rundownUtils-CJxEqFha.js.map +0 -1
- package/client/assets/timer.utils-P25ngopd.js.br +0 -0
- package/client/assets/timer.utils-P25ngopd.js.gz +0 -0
- package/client/assets/useCustomFields-DUYgd-E7.js +0 -2
- package/client/assets/useCustomFields-DUYgd-E7.js.br +0 -0
- package/client/assets/useCustomFields-DUYgd-E7.js.gz +0 -0
- package/client/assets/useCustomFields-DUYgd-E7.js.map +0 -1
- package/client/assets/useEventSelection-R7JdgAzy.js +0 -2
- package/client/assets/useEventSelection-R7JdgAzy.js.br +0 -0
- package/client/assets/useEventSelection-R7JdgAzy.js.gz +0 -0
- package/client/assets/useEventSelection-R7JdgAzy.js.map +0 -1
- package/client/assets/useProjectData-DdITd09M.js +0 -2
- package/client/assets/useProjectData-DdITd09M.js.br +0 -0
- package/client/assets/useProjectData-DdITd09M.js.gz +0 -0
- package/client/assets/useProjectData-DdITd09M.js.map +0 -1
- package/client/assets/useReport-CR0k0b85.js +0 -2
- package/client/assets/useReport-CR0k0b85.js.br +0 -0
- package/client/assets/useReport-CR0k0b85.js.gz +0 -0
- package/client/assets/useReport-CR0k0b85.js.map +0 -1
- package/client/assets/useRundown-CR9Ah1Fa.js +0 -2
- package/client/assets/useRundown-CR9Ah1Fa.js.br +0 -0
- package/client/assets/useRundown-CR9Ah1Fa.js.gz +0 -0
- package/client/assets/useRundown-CR9Ah1Fa.js.map +0 -1
- package/client/assets/useSelectAndRevealEntry-CzSIOtzH.js.br +0 -0
- package/client/assets/useSelectAndRevealEntry-CzSIOtzH.js.gz +0 -0
- package/client/assets/useWindowTitle-Cl1AVD9_.js.br +0 -0
- package/client/assets/useWindowTitle-Cl1AVD9_.js.gz +0 -0
- package/client/assets/validateEvent-DhFtLvz_.js +0 -2
- package/client/assets/validateEvent-DhFtLvz_.js.br +0 -0
- package/client/assets/validateEvent-DhFtLvz_.js.gz +0 -0
- package/client/assets/vendor-dQa48psh.js.br +0 -0
- package/client/assets/vendor-dQa48psh.js.gz +0 -0
- package/client/assets/viewLoader.utils-ndDejZHN.js.br +0 -0
- package/client/assets/viewLoader.utils-ndDejZHN.js.gz +0 -0
- package/client/assets/viewUtils-rcOl1-o8.js.br +0 -0
- package/client/assets/viewUtils-rcOl1-o8.js.gz +0 -0
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CustomTranslationModal-0ROtCxPC.js","./vendor-dQa48psh.js","./vendor-4xP-6xVS.css","./index-DYkg-xOk.js","./index-Cm69j2Ld.css","./SwatchPicker-DPyJv7aS.js","./SwatchPicker-DxatRu17.css","./useEventSelection-R7JdgAzy.js","./Select-B3zdv0Ng.js","./Select-Cd08aEcf.css","./useCustomFields-DUYgd-E7.js","./useRundown-CR9Ah1Fa.js","./useEventSelection-D_Et8xSN.css","./StyleEditor-DcyJgmAF.js","./StyleEditor-Bie84LSc.css","./RundownExport-DhzzqPCD.js","./EditorUtils-BxN0w0-D.js","./EditorUtils-L4Sg72o_.css","./ProtectRoute-CcDK6JVA.js","./ProtectRoute-Bm5sjStK.css","./CuesheetTable-C7hP6tMi.js","./TimeInput-OX4LMRQl.js","./parseUserTime-CI7s8pYc.js","./TimeInput-Cu-N5DmX.css","./validateEvent-DhFtLvz_.js","./Tooltip-B4PEP32j.js","./Tooltip-CKb7gU2M.css","./DelayIndicator-OEjcqoIx.js","./editorSettings-VcitNPq1.js","./editorSettings-BqHbWs9b.css","./rundownUtils-CJxEqFha.js","./DelayIndicator-VuYhhwTj.css","./offset-Bs6CY1IK.js","./EmptyPage-CcO33dlE.js","./EmptyPage-Ci10HwDK.css","./CuesheetTable-BJ30G538.css","./useSelectAndRevealEntry-CzSIOtzH.js","./RundownExport-BFn7H24P.css","./TimerControlExport-BNfZ99Im.js","./TimerDisplay-DQQ7sMDc.js","./TimerDisplay-B-FvT2T-.css","./useReport-CR0k0b85.js","./TimerControlExport-X_cQKSFg.css","./MessageControlExport-DGo2ZNMw.js","./MessageControlExport-D_pNX6Vj.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{h as p,j as e,ac as Ns,e as X,k as At,ad as de,ae as on,af as cn,ag as ht,ah as pe,T as ge,aa as pt,ai as dn,y as gt,aj as un,ak as as,f as hn,O as Ft,A as dt,al as mn,am as xn,an as it,ao as jn,P as Je,C as Ee,ap as Ts,aq as Ds,ar as pn,as as Ps,at as is,au as gn,av as Rs,l as fn,aw as bn,$ as rt,v as $t,ax as yn,x as vn,ay as wn,M as Es,az as Sn,aA as rs,aB as Cn,aC as _n,aD as kn,aE as Nn,aF as Tn,I as Dn,m as Pn}from"./vendor-dQa48psh.js";import{e as Se,Q as Vt,R as Rn,S as En,U as mt,s as In,V as Ln,W as Ie,X as ut,Y as D,Z as He,_ as Ve,$ as E,a0 as ne,a1 as J,a2 as Pt,a3 as On,a4 as An,a5 as Mt,a6 as Fn,a7 as Is,a8 as $n,a9 as L,B as f,aa as le,ab as ke,ac as Ue,ad as Ce,ae as ce,af as U,ag as z,ah as M,ai as V,aj as Be,ak as Y,al as _e,am as ft,an as Vn,ao as Mn,ap as Wt,f as Fe,aq as Ls,ar as Ut,as as Os,at as ae,x as Rt,O as Re,au as Wn,av as ls,aw as As,ax as Fs,ay as Bt,az as Un,aA as Bn,aB as qt,aC as wt,m as Ae,k as zt,aD as qn,aE as zn,aF as ye,aG as $s,aH as xt,T as lt,aI as Gn,aJ as Vs,aK as os,aL as Kn,aM as Hn,aN as Qn,aO as Qe,aP as Yn,aQ as Jn,b as Xn,aR as Zn,N as ea,aS as ta,aT as sa,aU as na,a as aa,aV as ia,aW as ra,aX as cs,aY as la,aZ as ds,K as oa,a_ as ca,a$ as da,b0 as ua,b1 as qe,h as Xe,y as us,b2 as Ze,b3 as ot,b4 as et,b5 as We,b6 as ha,M as ma,b7 as xa,o as ja,b8 as pa,b9 as ga}from"./index-DYkg-xOk.js";import{P as fa}from"./ProtectRoute-CcDK6JVA.js";import{u as ba}from"./useWindowTitle-Cl1AVD9_.js";import{i as Ms,e as ya,u as bt,R as Ws,T as K,s as va,t as St,a as wa,b as Sa,d as Ca,c as _a,f as ka,g as Na,h as Ta,G as Da,S as Pa,j as Ra,D as Gt,M as Kt,k as Ea,l as Ia}from"./useEventSelection-R7JdgAzy.js";import{I as xe,S as De,a as Ct,C as La}from"./SwatchPicker-DPyJv7aS.js";import{f as Oa,g as Aa,h as Fa,i as Ht,u as Qt,j as $a,k as Va,l as Ma,m as Wa,r as Ua,n as Ba,o as qa,p as za,q as Ga,s as Ka}from"./useRundown-CR9Ah1Fa.js";import{S as ie}from"./Select-B3zdv0Ng.js";import{u as yt,p as Ha,e as Qa,d as Ya}from"./useCustomFields-DUYgd-E7.js";import{u as Ja,d as Xa}from"./useReport-CR0k0b85.js";import{T as Et,u as Us,e as nt}from"./editorSettings-VcitNPq1.js";import{S as Za,L as ei,T as ti}from"./EditorUtils-BxN0w0-D.js";import{T as Yt}from"./Tooltip-B4PEP32j.js";import{A as Bs,T as Ge}from"./TimeInput-OX4LMRQl.js";import{T as hs,E as _t}from"./validateEvent-DhFtLvz_.js";import{p as Ke}from"./parseUserTime-CI7s8pYc.js";import{u as si,a as ni,b as ai}from"./useProjectData-DdITd09M.js";import{u as Jt,a as Xt,E as we,b as ii}from"./useSelectAndRevealEntry-CzSIOtzH.js";import{S as ri,P as li,C as Zt,a as qs,b as zs,O as Gs,M as Ks}from"./TimeElements-8rNLGU60.js";import{O as oi,s as es,T as Hs,S as ci}from"./OverviewWrapper-B6AeBRb6.js";import{g as di,T as Le,a as ui}from"./TimerDisplay-DQQ7sMDc.js";import"./offset-Bs6CY1IK.js";import"./SuperscriptPeriod-DswX2aei.js";/* empty css */import"./playbackstate-DisgQbHM.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof Ot<"u"?Ot:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="b5989136-3ba5-405a-8ba5-ea849fa0fe0e",t._sentryDebugIdIdentifier="sentry-dbid-b5989136-3ba5-405a-8ba5-ea849fa0fe0e")}catch{}})();function hi(t){return t.trim().replaceAll(" ","_")}const mi={worksheet:"event schedule",flag:"flag",timeStart:"time start",linkStart:"link start",timeEnd:"time end",duration:"duration",cue:"cue",title:"title",countToEnd:"count to end",skip:"skip",note:"note",colour:"colour",endAction:"end action",timerType:"timer type",timeWarning:"warning time",timeDanger:"danger time",custom:{},id:"id"},xi=(t,s,n={})=>{const{isDisabled:a=!1}=n,i=p.useCallback(l=>{l.key===s&&!l.repeat&&!a&&(l.preventDefault(),t())},[t,a,s]);p.useEffect(()=>(document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i)}),[i])},ji="_link_70oau_17",pi="_inline_70oau_27",ms={link:ji,inline:pi};function se({href:t,inline:s,children:n}){const a=i=>{i.preventDefault(),Vt(t)};return e.jsxs("a",{href:"#!",target:"_blank",rel:"noreferrer",className:Se([ms.link,s&&ms.inline]),onClick:a,children:[n," ",e.jsx(Ns,{style:{fontSize:"1em"}})]})}async function gi(){const t=await X.get(Rn);return{url:t.data.html_url,version:t.data.tag_name}}const xs={url:"",version:"",hasUpdates:!1};function Qs(){const{data:t,status:s,isFetching:n,isError:a,refetch:i}=At({queryKey:Ln,queryFn:gi,placeholderData:(c,u)=>c,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:!1,staleTime:In,enabled:mt}),l=(t==null?void 0:t.version)&&!t.version.includes(En);return{data:t?{...t,hasUpdates:l}:xs,placeholder:xs,status:s,isFetching:n,isError:a,refetch:i}}function fi(){const{data:t,isError:s}=Qs();return s?e.jsxs(Ie,{children:[`You are currently using Ontime version ${ut}`,e.jsx(D,{children:"Could not fetch version information"})]}):t.hasUpdates?e.jsxs(Ie,{children:[`You are currently using Ontime version ${ut}.`,e.jsx("br",{}),e.jsx("br",{}),`A new version ${t.version} is available.`," ",e.jsx("br",{}),He?"You can restart your stage to get the latest available version.":e.jsx(se,{href:t.url,children:"Please visit the release page to download"})]}):e.jsx(Ie,{children:`You are currently using the latest version of Ontime: ${ut}`})}function bi(){return e.jsxs(e.Fragment,{children:[e.jsx(Ve,{children:"About Ontime"}),e.jsxs(E,{children:[e.jsxs(ne,{children:[e.jsx(J,{children:"Ontime"}),e.jsxs(Ie,{children:["Free, open-source software for managing rundowns and event timers",e.jsx(se,{href:Pt,children:"www.getontime.no"})]}),e.jsxs(Ie,{children:["Considering sponsoring our work",e.jsx(se,{href:On,children:"GitHub Sponsors"}),e.jsx(se,{href:An,children:"Buy Me a Coffee"})]}),e.jsxs(Ie,{children:["If you are looking for an online version of Ontime, consider trying out our cloud service",e.jsx(se,{href:Pt,children:"www.getontime.no"})]})]}),e.jsx(J,{children:"Current version"}),e.jsx(fi,{}),e.jsx(J,{children:"Links"}),e.jsx(se,{href:Mt,children:"Read the docs"}),e.jsx(se,{href:Fn,children:"Follow the project on GitHub"}),e.jsx(se,{href:Is,children:"Discord server"}),e.jsx(se,{href:$n,children:"Subreddit"})]})]})}function re(t,s){const n=p.useRef(null);return p.useEffect(()=>{s&&n.current&&s===t&&n.current.scrollIntoView({behavior:"smooth",block:"center"})},[s,t]),n}const yi="https://docs.getontime.no/api/protocols/osc/";function vi({enabledAutomations:t,enabledOscIn:s,oscPortIn:n}){var b,y,w;const{handleSubmit:a,reset:i,register:l,setError:r,watch:c,setValue:u,formState:{errors:o,isSubmitting:h,isDirty:m,isValid:d}}=de({mode:"onChange",defaultValues:{enabledAutomations:t,enabledOscIn:s,oscPortIn:n},resetOptions:{keepDirtyValues:!1}}),x=async S=>{try{await ya(S),i(S)}catch(O){const k=V(O);r("root",{message:k})}},j=()=>{i({enabledAutomations:t,enabledOscIn:s,oscPortIn:n})},g=!h&&m&&d;return e.jsxs(ne,{children:[e.jsxs(J,{children:["Automation settings",e.jsxs(L,{children:[e.jsx(f,{variant:"ghosted",onClick:j,disabled:!g,children:"Revert to saved"}),e.jsx(f,{variant:"primary",type:"submit",form:"automation-settings-form",disabled:!g,loading:h,children:"Save"})]})]}),(o==null?void 0:o.root)&&e.jsx(D,{children:o.root.message}),e.jsx(le,{}),e.jsx(E,{children:e.jsxs(xe,{children:[e.jsx("p",{children:"Control Ontime and share its data with external systems in your workflow."}),e.jsx("p",{children:"- Automations allow Ontime to send its data on lifecycle triggers."}),e.jsx("p",{children:"- OSC Input tells Ontime to listen to messages on the specific port."}),e.jsx("br",{}),e.jsx(se,{href:yi,children:"See the docs"})]})}),e.jsxs(E,{as:"form",id:"automation-settings-form",onSubmit:a(x),onKeyDown:S=>ke(S,j),children:[e.jsx(Ue,{isLoading:!1}),e.jsx(Ce,{children:"Automation"}),e.jsx(ce,{children:e.jsxs(U,{children:[e.jsx(z,{title:"Enable automations",description:"Allow Ontime to send messages on lifecycle triggers",error:(b=o.enabledAutomations)==null?void 0:b.message}),e.jsx(De,{size:"large",checked:c("enabledAutomations"),onCheckedChange:S=>u("enabledAutomations",S,{shouldDirty:!0,shouldValidate:!0})})]})}),e.jsx(Ce,{children:"OSC Input"}),e.jsxs(ce,{children:[He&&e.jsx(xe,{children:"For security reasons OSC integrations are not available in the cloud service."}),e.jsxs(U,{children:[e.jsx(z,{title:"OSC input",description:"Allow control of Ontime through OSC",error:(y=o.enabledOscIn)==null?void 0:y.message}),e.jsx(De,{size:"large",checked:c("enabledOscIn"),onCheckedChange:S=>u("enabledOscIn",S,{shouldDirty:!0,shouldValidate:!0})})]}),e.jsxs(U,{children:[e.jsx(z,{title:"Listen on port",description:"Port for incoming OSC. Default: 8888",error:(w=o.oscPortIn)==null?void 0:w.message}),e.jsx(M,{id:"oscPortIn",placeholder:"8888",maxLength:5,style:{textAlign:"right",width:"5rem"},type:"number",fluid:!0,...l("oscPortIn",{required:{value:!0,message:"Required field"},max:{value:65535,message:"Port must be within range 1024 - 65535"},min:{value:1024,message:"Port must be within range 1024 - 65535"},pattern:{value:Ms,message:"Value should be numeric"}})})]})]})]})]})}const wi=["{{human.clock}}","{{human.duration}}","{{human.expectedEnd}}","{{human.runningTimer}}","{{human.elapsedTime}}","{{human.startedAt}}"],Si=["{{clock}}","{{timer.addedTime}}","{{timer.current}}","{{timer.duration}}","{{timer.elapsed}}","{{timer.expectedFinish}}","{{timer.secondaryTimer}}","{{timer.startedAt}}","{{rundown.selectedEventIndex}}","{{rundown.numEvents}}","{{rundown.plannedStart}}","{{rundown.plannedEnd}}","{{rundown.actualStart}}","{{offset.absolute}}","{{offset.relative}}","{{offset.expectedRundownEnd}}","{{offset.expectedGroupEnd}}","{{offset.expectedFlagStart}}"],Ci=["{{eventNow.id}}","{{eventNow.cue}}","{{eventNow.title}}","{{eventNow.note}}","{{eventNow.timeStart}}","{{eventNow.timeEnd}}","{{eventNow.duration}}","{{eventNow.colour}}","{{eventNow.delay}}"],_i=["{{eventNext.id}}","{{eventNext.cue}}","{{eventNext.title}}","{{eventNext.note}}","{{eventNext.timeStart}}","{{eventNext.timeEnd}}","{{eventNext.duration}}","{{eventNext.colour}}","{{eventNext.delay}}"];function ki(t){return[...wi,...Si,...Ci,...Object.entries(t).map(([s])=>`{{eventNow.custom.${s}}}`),..._i,...Object.entries(t).map(([s])=>`{{eventNext.custom.${s}}}`)]}function Ni(t,s){if(t===s)return"";if(t.endsWith("{{")&&s.startsWith("{{"))return s.substring(2);if(t.endsWith("{")&&s.startsWith("{{"))return s.substring(1);for(let n=0;n<s.length;n++){const a=s.substring(0,n+1);if(t.endsWith(a))return s.substring(n+1)}return""}function Ti(t){const s=t.lastIndexOf("{{");return s!==-1?t.slice(s):""}const Di="_wrapper_1dmtf_17",Pi="_suggestions_1dmtf_21",js={wrapper:Di,suggestions:Pi},Ri=p.forwardRef(function(s,n){const{value:a,onChange:i,...l}=s,{data:r}=yt(),c=on(()=>j(!1)),u=p.useMemo(()=>ki(r),[r]),[o,h]=p.useState(a||""),[m,d]=p.useState([]),[x,j]=p.useState(!1),g=w=>{const S=Ti(w);return u.filter(O=>O.startsWith(S))},b=w=>{h(w.target.value),w.target.value.endsWith("{")?(j(!0),d(g(w.target.value))):w.target.value===""||w.target.value.endsWith("}}")?j(!1):x&&d(g(w.target.value)),i==null||i(w)},y=w=>{h(S=>{const O=Ni(S,w);return S+O}),j(!1)};return e.jsxs("div",{className:js.wrapper,ref:cn(c,n),children:[e.jsx(M,{value:o,...l,onChange:b,fluid:!0}),x&&m.length>0&&e.jsx("ul",{className:js.suggestions,children:m.map(w=>e.jsx("li",{onClick:()=>y(w),children:w},w))})]})}),It=[{id:1,label:"On Load",value:"onLoad"},{id:2,label:"On Start",value:"onStart"},{id:3,label:"On Pause",value:"onPause"},{id:4,label:"On Stop",value:"onStop"},{id:5,label:"Every second",value:"onClock"},{id:6,label:"On Timer Update",value:"onUpdate"},{id:7,label:"On Finish",value:"onFinish"},{id:8,label:"On Warning",value:"onWarning"},{id:9,label:"On Danger",value:"onDanger"}];function ps(t){return Object.hasOwn(t,"id")}const Ei=[{value:null,label:"Select field"},{value:"eventNow.id",label:"ID"},{value:"eventNow.title",label:"Title"},{value:"eventNow.cue",label:"Cue"},{value:"eventNow.countToEnd",label:"Count to end"},{value:"eventNow.note",label:"Note"},{value:"eventNow.colour",label:"Colour"}],Ii=[{value:"eventNext.id",label:"Next ID"},{value:"eventNext.title",label:"Next Title"},{value:"eventNext.cue",label:"Next Cue"}];function Li(t){return[...Ei,...Object.entries(t).map(([s,{label:n}])=>({value:`eventNow.custom.${s}`,label:`Custom: ${n}`})),...Ii,...Object.entries(t).map(([s,{label:n}])=>({value:`eventNext.custom.${s}`,label:`Next custom: ${n}`}))]}function Oi(t){const s={},n=[];for(let a=0;a<t.length;a++){const i=t[a];Object.hasOwn(s,i.trigger)||(s[i.trigger]=[]),s[i.trigger].includes(i.automationId)?n.push(a):s[i.trigger].push(i.automationId)}return n.length>0?n:void 0}const Ai="_outerColumn_1klj0_17",Fi="_innerColumn_1klj0_25",$i="_ruleSection_1klj0_31",Vi="_titleSection_1klj0_37",Mi="_filterSection_1klj0_38",Wi="_oscSection_1klj0_39",Ui="_httpSection_1klj0_40",Bi="_actionSection_1klj0_41",qi="_test_1klj0_95",zi="_outputCard_1klj0_99",he={outerColumn:Ai,innerColumn:Fi,ruleSection:$i,titleSection:Vi,filterSection:Mi,oscSection:Wi,httpSection:Ui,actionSection:Bi,test:qi,outputCard:zi};function Gi({index:t,register:s,setValue:n,rowErrors:a,value:i,children:l,watch:r}){var h,m,d,x,j;const[c,u]=p.useState(i),o=g=>{n(`outputs.${t}.action`,g,{shouldDirty:!0}),u(g)};return e.jsxs("div",{className:he.actionSection,children:[e.jsxs("label",{children:["Action",e.jsx(ie,{onValueChange:g=>{g!==null&&o(g)},value:r(`outputs.${t}.action`),options:[{value:"aux1-pause",label:"Aux 1: pause"},{value:"aux2-pause",label:"Aux 2: pause"},{value:"aux3-pause",label:"Aux 3: pause"},{value:"aux1-start",label:"Aux 1: start"},{value:"aux2-start",label:"Aux 2: start"},{value:"aux3-start",label:"Aux 3: start"},{value:"aux1-stop",label:"Aux 1: stop"},{value:"aux2-stop",label:"Aux 2: stop"},{value:"aux3-stop",label:"Aux 3: stop"},{value:"aux1-set",label:"Aux 1: set"},{value:"aux2-set",label:"Aux 2: set"},{value:"aux3-set",label:"Aux 3: set"},{value:"message-set",label:"Primary Message: set"},{value:"message-secondary",label:"Secondary Message: source"}]}),e.jsx(D,{children:(h=a==null?void 0:a.action)==null?void 0:h.message})]}),c.startsWith("aux")&&c.endsWith("set")&&e.jsxs("label",{children:["New time",e.jsx(M,{...s(`outputs.${t}.time`,{required:{value:!0,message:"Required field"}}),fluid:!0,placeholder:"eg: 10m5s"}),e.jsx(D,{children:(m=a==null?void 0:a.time)==null?void 0:m.message})]}),c==="message-set"&&e.jsxs(e.Fragment,{children:[e.jsxs("label",{children:["Text (leave empty for no change)",e.jsx(M,{...s(`outputs.${t}.text`),fluid:!0,placeholder:"eg: Timer is finished"}),e.jsx(D,{children:(d=a==null?void 0:a.text)==null?void 0:d.message})]}),e.jsxs("label",{children:["Visibility",e.jsx(ie,{onValueChange:g=>{const b=g===null?void 0:g;n(`outputs.${t}.visible`,b,{shouldDirty:!0})},value:r(`outputs.${t}.visible`),options:[{value:null,label:"Untouched"},{value:!0,label:"Show"},{value:!1,label:"Hide"}]}),e.jsx(D,{children:(x=a==null?void 0:a.visible)==null?void 0:x.message})]})]}),c==="message-secondary"&&e.jsxs("label",{children:["Timer secondary source",e.jsx(ie,{onValueChange:g=>{if(g!==null){if(g==="null"){n(`outputs.${t}.secondarySource`,null,{shouldDirty:!0});return}n(`outputs.${t}.secondarySource`,g,{shouldDirty:!0})}},value:r(`outputs.${t}.secondarySource`),options:[{value:null,label:"Select secondary source"},{value:"aux1",label:"Auxiliary timer 1"},{value:"aux2",label:"Auxiliary timer 2"},{value:"aux3",label:"Auxiliary timer 3"},{value:"secondary",label:"Secondary"},{value:"null",label:"None"}]}),e.jsx(D,{children:(j=a==null?void 0:a.secondarySource)==null?void 0:j.message})]}),e.jsx("div",{className:he.test,children:l})]})}const Ki="https://docs.getontime.no/api/automation/#using-variables-in-automation";function Hi({automation:t,onClose:s}){var G;const n=ps(t),{data:a}=yt(),{refetch:i}=bt(),l=p.useMemo(()=>Li(a),[a]),{control:r,handleSubmit:c,getValues:u,register:o,setError:h,setFocus:m,setValue:d,watch:x,formState:{errors:j,isSubmitting:g,isDirty:b,isValid:y}}=de({mode:"onChange",defaultValues:{title:(t==null?void 0:t.title)??"",filterRule:(t==null?void 0:t.filterRule)??"all",filters:(t==null?void 0:t.filters)??[],outputs:(t==null?void 0:t.outputs)??[]},resetOptions:{keepDirtyValues:!0}}),{fields:w,append:S,remove:O}=ht({name:"filters",control:r}),{fields:k,append:R,remove:W}=ht({name:"outputs",control:r});p.useEffect(()=>{m("title")},[m]);const v=()=>{S({field:"",operator:"equals",value:""})},A=()=>{R({type:"osc",targetIP:"",targetPort:void 0,address:"",args:""})},C=()=>{R({type:"http",url:""})},H=()=>{R({type:"ontime",action:"aux1-start"})},B=async $=>{try{const N=u(`outputs.${$}`);if(!N.targetIP||!N.targetPort||!N.address)return;await St({type:"osc",targetIP:N.targetIP,targetPort:N.targetPort,address:N.address,args:N.args})}catch{}},F=async $=>{try{const N=u(`outputs.${$}`);if(!N.url)return;await St({type:"http",url:N.url})}catch{}},P=async $=>{try{const N=u(`outputs.${$}`);await St({...N,type:"ontime"})}catch{}},I=async $=>{ps(t)?await N(t.id,{id:t.id,...$}):await fe($),i();async function N(ue,oe){try{await wa(ue,oe),s()}catch(_){h("root",{message:V(_)})}}async function fe(ue){try{await Sa(ue),s()}catch(oe){h("root",{message:V(oe)})}}},T=!g&&b&&y;return e.jsxs(Be,{as:"form",name:"automation-form",onSubmit:c(I),className:he.outerColumn,onKeyDown:$=>ke($,s),children:[e.jsx(J,{children:n?"Edit automation":"Create automation"}),e.jsxs("div",{className:he.innerSection,children:[e.jsx("h3",{children:"Automation options"}),e.jsxs("div",{className:he.titleSection,children:[e.jsxs("label",{children:["Title",e.jsx(M,{...o("title",{required:{value:!0,message:"Required field"}}),fluid:!0,placeholder:"Load preset"})]}),e.jsx(D,{children:(G=j.title)==null?void 0:G.message})]})]}),e.jsxs("div",{className:he.innerSection,children:[e.jsx("h3",{children:"Filters (optional)"}),e.jsxs("div",{className:he.ruleSection,children:[e.jsxs("label",{children:["Trigger outputs if",e.jsx(Ws,{orientation:"horizontal",value:x("filterRule"),onValueChange:$=>d("filterRule",$,{shouldDirty:!0}),items:[{value:"all",label:"All filters pass"},{value:"any",label:"Any filter passes"}]})]}),w.map(($,N)=>{var ue,oe,_,ee,Te,Pe;const fe=`filters.${N}.field.${$.id}`;return e.jsxs("div",{className:he.filterSection,children:[e.jsxs("label",{children:["Runtime data source",e.jsx(ie,{value:x(`filters.${N}.field`)||null,onValueChange:je=>{je!==null&&d(`filters.${N}.field`,je,{shouldDirty:!0})},options:l.map(({value:je,label:Z})=>({value:je,label:Z,disabled:je===null})),"aria-label":"Event field"}),e.jsx(D,{children:(_=(oe=(ue=j.filters)==null?void 0:ue[N])==null?void 0:oe.field)==null?void 0:_.message})]}),e.jsxs("label",{children:["Matching condition",e.jsx(ie,{value:x(`filters.${N}.operator`),onValueChange:je=>{je!==null&&d(`filters.${N}.operator`,je,{shouldDirty:!0})},options:[{value:"equals",label:"equals"},{value:"not_equals",label:"not equals"},{value:"contains",label:"contains"}],"aria-label":"Operator"}),e.jsx(D,{children:(Pe=(Te=(ee=j.filters)==null?void 0:ee[N])==null?void 0:Te.operator)==null?void 0:Pe.message})]}),e.jsxs("label",{children:["Value to match",e.jsx(M,{...o(`filters.${N}.value`),fluid:!0,placeholder:"<empty / no value>"})]}),e.jsxs("div",{children:[e.jsx("span",{children:" "}),e.jsx("div",{children:e.jsx(Y,{"aria-label":"Delete",variant:"ghosted-destructive",onClick:()=>O(N),children:e.jsx(pe,{})})})]})]},fe)}),e.jsx("div",{children:e.jsxs(f,{type:"submit",onClick:v,children:["Add filter ",e.jsx(ge,{})]})})]})]}),e.jsxs("div",{className:he.innerColumn,children:[e.jsx("h3",{children:"Outputs"}),e.jsxs(xe,{children:["Automation outputs can be used to send data from Ontime to external software ",e.jsx("br",{}),"or to change properties of Ontime itself.",e.jsx(se,{href:Ki,children:"See the documentation for templates"})]}),k.map(($,N)=>{var fe,ue,oe,_,ee,Te,Pe,je;if(Oa($)){const Z=(fe=j.outputs)==null?void 0:fe[N];return e.jsxs("div",{className:he.outputCard,children:[e.jsx(K,{children:"OSC"}),e.jsxs("div",{className:he.oscSection,children:[e.jsxs("label",{children:["Target IP",e.jsx(M,{...o(`outputs.${N}.targetIP`,{required:{value:!0,message:"Required field"}}),fluid:!0,placeholder:"127.0.0.1"}),e.jsx(D,{children:(ue=Z==null?void 0:Z.targetIP)==null?void 0:ue.message})]}),e.jsxs("label",{children:["Target Port",e.jsx(M,{...o(`outputs.${N}.targetPort`,{required:{value:!0,message:"Required field"},setValueAs:ns=>ns===""?0:Number(ns),max:{value:65535,message:"Port must be within range 1024 - 65535"},min:{value:1024,message:"Port must be within range 1024 - 65535"}}),fluid:!0,type:"number",maxLength:5,placeholder:"8000"}),e.jsx(D,{children:(oe=Z==null?void 0:Z.targetPort)==null?void 0:oe.message})]}),e.jsxs("label",{children:["Address",e.jsx(M,{...o(`outputs.${N}.address`),fluid:!0,placeholder:"/cue/start"}),e.jsx(D,{children:(_=Z==null?void 0:Z.address)==null?void 0:_.message})]}),e.jsxs("label",{children:["Arguments",e.jsx(Ri,{...o(`outputs.${N}.args`),value:$.args,placeholder:"1"}),e.jsx(D,{children:(ee=Z==null?void 0:Z.args)==null?void 0:ee.message})]}),e.jsxs("div",{children:[e.jsx("span",{children:" "}),e.jsxs(L,{relation:"inner",children:[e.jsx(f,{variant:"ghosted-white",onClick:()=>B(N),children:"Test"}),e.jsx(Y,{"aria-label":"Delete",variant:"ghosted-destructive",onClick:()=>W(N),children:e.jsx(pe,{})})]})]})]})]},$.id)}if(Aa($)){const Z=(Te=j.outputs)==null?void 0:Te[N];return e.jsxs("div",{className:he.outputCard,children:[e.jsx(K,{children:"HTTP"}),e.jsxs("div",{className:he.httpSection,children:[e.jsxs("label",{children:["Target URL",e.jsx(M,{...o(`outputs.${N}.url`,{required:{value:!0,message:"Required field"},pattern:{value:va,message:"HTTP messages should target http:// or https://"}}),fluid:!0,placeholder:"http://127.0.0.1/start/1"}),e.jsx(D,{children:(Pe=Z==null?void 0:Z.url)==null?void 0:Pe.message})]}),e.jsxs("div",{children:[e.jsx("span",{children:" "}),e.jsxs(L,{relation:"inner",children:[e.jsx(f,{variant:"ghosted-white",onClick:()=>F(N),children:"Test"}),e.jsx(Y,{"aria-label":"Delete",variant:"ghosted-destructive",onClick:()=>W(N),children:e.jsx(pe,{})})]})]})]})]},$.id)}if(Fa($)){const Z=(je=j.outputs)==null?void 0:je[N];return e.jsxs("div",{className:he.outputCard,children:[e.jsx(K,{children:"Ontime action"}),e.jsxs(Gi,{value:$.action,index:N,register:o,rowErrors:Z,setValue:d,watch:x,children:[e.jsx("span",{children:" "}),e.jsxs(L,{relation:"inner",children:[e.jsx(f,{variant:"ghosted-white",onClick:()=>P(N),children:"Test"}),e.jsx(Y,{"aria-label":"Delete",variant:"ghosted-destructive",onClick:()=>W(N),children:e.jsx(pe,{})})]})]})]},$.id)}return null}),e.jsxs(L,{relation:"inner",children:[e.jsxs(f,{onClick:A,children:["OSC ",e.jsx(ge,{})]}),e.jsxs(f,{onClick:C,children:["HTTP ",e.jsx(ge,{})]}),e.jsxs(f,{onClick:H,children:["Ontime action ",e.jsx(ge,{})]})]})]}),e.jsxs(L,{align:"end",children:[(j==null?void 0:j.root)&&e.jsx(D,{children:j.root.message}),e.jsx(f,{onClick:s,children:"Cancel"}),e.jsx(f,{variant:"primary",type:"submit",disabled:!T,loading:g,children:"Save"})]})]})}const gs={title:"",filterRule:"all",filters:[],outputs:[]};function Qi(t){const{automations:s}=t,{refetch:n}=bt(),[a,i]=p.useState(null),[l,r]=p.useState(null),c=async o=>{try{r(null),await Ca(o)}catch(h){r(V(h))}finally{n()}},u=Object.keys(s);return e.jsxs(ne,{children:[e.jsxs(J,{children:["Manage automations",e.jsxs(f,{type:"submit",disabled:!!a,onClick:()=>i(gs),children:["New ",e.jsx(ge,{})]})]}),e.jsx(le,{}),a!==null&&e.jsx(Hi,{automation:a,onClose:()=>i(null)}),e.jsxs(_e,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{width:"45%"},children:"Title"}),e.jsx("th",{style:{width:"15%"},children:"Trigger rule"}),e.jsx("th",{style:{width:"15%"},children:"Filters"}),e.jsx("th",{style:{width:"15%"},children:"Outputs"}),e.jsx("th",{})]})}),e.jsxs("tbody",{children:[u.length===0&&e.jsx(ft,{handleClick:a?void 0:()=>i(gs)}),u.map(o=>Object.hasOwn(s,o)?e.jsx(p.Fragment,{children:e.jsxs("tr",{children:[e.jsx("td",{children:s[o].title}),e.jsx("td",{children:e.jsx(K,{children:s[o].filterRule})}),e.jsx("td",{children:s[o].filters.length}),e.jsx("td",{children:s[o].outputs.length}),e.jsxs(L,{align:"end",relation:"inner",as:"td",children:[e.jsx(Y,{variant:"ghosted-white","aria-label":"Edit entry",onClick:()=>i(s[o]),children:e.jsx(pt,{})}),e.jsx(Y,{variant:"ghosted-destructive","aria-label":"Delete entry",onClick:()=>c(o),children:e.jsx(pe,{})})]})]})},o):null),l&&e.jsx("tr",{children:e.jsx("td",{colSpan:5,children:e.jsx(D,{children:l})})})]})]})]})}function Ys({automations:t,initialId:s,initialTitle:n,initialAutomationId:a,initialTrigger:i,onCancel:l,postSubmit:r}){var O,k,R,W;const{handleSubmit:c,register:u,setFocus:o,setError:h,watch:m,setValue:d,formState:{errors:x,isSubmitting:j,isValid:g,isDirty:b}}=de({defaultValues:{title:n,trigger:i??It[0].value,automationId:a??((O=t==null?void 0:t[Object.keys(t)[0]])==null?void 0:O.id)},resetOptions:{keepDirtyValues:!0}});p.useEffect(()=>{o("title")},[o]);const y=async v=>{if(s){try{await _a(s,{id:s,...v}),r()}catch(A){h("root",{message:`Failed to save changes to trigger ${V(A)}`})}return}try{await ka(v),r()}catch(A){h("root",{message:`Failed to save trigger ${V(A)}`})}},w=Object.keys(t).map(v=>({value:v,label:t[v].title})),S=b&&g;return e.jsxs(Be,{as:"form",name:"trigger-form",onSubmit:c(y),onKeyDown:v=>ke(v,l),children:[e.jsx(J,{children:s?"Edit trigger":"Create trigger"}),e.jsxs("label",{children:["Title",e.jsx(M,{...u("title",{required:{value:!0,message:"Required field"}}),fluid:!0,defaultValue:n}),e.jsx(D,{children:(k=x.title)==null?void 0:k.message})]}),e.jsxs("label",{children:["Lifecycle trigger",e.jsx(ie,{value:m("trigger"),onValueChange:v=>{v!==null&&d("trigger",v,{shouldDirty:!0})},options:It.map(v=>({value:v.value,label:v.label})),"aria-label":"Lifecycle trigger"}),e.jsx(D,{children:(R=x.trigger)==null?void 0:R.message})]}),e.jsxs("label",{children:["Automation title",e.jsx(ie,{value:m("automationId"),onValueChange:v=>{v!==null&&d("automationId",v,{shouldDirty:!0})},options:w,"aria-label":"Automation title"}),e.jsx(D,{children:(W=x.automationId)==null?void 0:W.message})]}),e.jsxs(L,{align:"end",children:[e.jsx(f,{disabled:j,onClick:l,children:"Cancel"}),e.jsx(f,{type:"submit",variant:"primary",disabled:!S,loading:j,children:"Save"})]})]})}function Yi(t){var m,d;const{automations:s,id:n,title:a,trigger:i,automationId:l,duplicate:r,handleDelete:c,postSubmit:u}=t,[o,h]=p.useState(!1);return o?e.jsx("tr",{children:e.jsx("td",{colSpan:99,children:e.jsx(Ys,{automations:s,initialId:n,initialTitle:a,initialTrigger:i,initialAutomationId:l,onCancel:()=>h(!1),postSubmit:()=>{h(!1),u()}})})}):e.jsxs("tr",{"data-warn":r,children:[e.jsxs(L,{as:"td",relation:"inner",children:[r&&e.jsx(dn,{color:"#FFBC56"}),a]}),e.jsx("td",{children:e.jsx(K,{children:(m=It.find(x=>x.value===i))==null?void 0:m.label})}),e.jsx("td",{children:e.jsx(K,{children:(d=s==null?void 0:s[l])==null?void 0:d.title})}),e.jsxs(L,{align:"end",relation:"inner",as:"td",children:[e.jsx(Y,{variant:"ghosted-white","aria-label":"Edit entry",onClick:()=>h(!0),children:e.jsx(pt,{})}),e.jsx(Y,{variant:"ghosted-destructive","aria-label":"Delete entry",onClick:c,children:e.jsx(pe,{})})]})]})}function Ji(t){const{triggers:s,automations:n}=t,[a,i]=p.useState(!1),{refetch:l}=bt(),[r,c]=p.useState(null),u=async d=>{try{await Na(d)}catch(x){c(V(x))}finally{l()}},o=()=>{i(!1),l()},h=p.useMemo(()=>Oi(s),[s]),m=Object.keys(n).length>0;return e.jsxs(ne,{children:[e.jsxs(J,{children:["Manage triggers",e.jsxs(f,{type:"submit",form:"trigger-form",disabled:!m,loading:!1,onClick:()=>i(!0),children:["New ",e.jsx(ge,{})]})]}),e.jsx(le,{}),e.jsxs(E,{children:[h&&e.jsx(D,{children:"You have created multiple links between the same trigger and automation which can performance issues."}),a&&e.jsx(Ys,{automations:n,onCancel:()=>i(!1),postSubmit:o}),e.jsxs(_e,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{width:"35%"},children:"Title"}),e.jsx("th",{style:{width:"25%"},children:"Lifecycle trigger"}),e.jsx("th",{style:{width:"25%"},children:"Automation"}),e.jsx("th",{})]})}),e.jsxs("tbody",{children:[!a&&s.length===0&&e.jsx(ft,{label:"Create an automation to attach triggers to",handleClick:m?()=>i(!0):void 0}),s.map((d,x)=>e.jsxs(p.Fragment,{children:[e.jsx(Yi,{automations:n,id:d.id,title:d.title,trigger:d.trigger,automationId:d.automationId,duplicate:h==null?void 0:h.includes(x),handleDelete:()=>u(d.id),postSubmit:o}),r&&e.jsx("tr",{children:e.jsx("td",{colSpan:5,children:e.jsx(D,{children:r})})})]},d.id))]})]})]})]})}function Xi({location:t}){const{data:s,status:n}=bt(),a=re("settings",t),i=re("triggers",t),l=re("automations",t),r=n==="pending";return e.jsxs(e.Fragment,{children:[e.jsx(Ve,{children:"Automation"}),e.jsxs(E,{children:[e.jsx(Ue,{isLoading:r}),e.jsx("div",{ref:a,children:e.jsx(vi,{enabledAutomations:s.enabledAutomations,enabledOscIn:s.enabledOscIn,oscPortIn:s.oscPortIn})}),e.jsx("div",{ref:l,children:e.jsx(Qi,{automations:s.automations})}),e.jsx("div",{ref:i,children:e.jsx(Ji,{triggers:s.triggers,automations:s.automations})})]})]})}const Zi="_goIcon_1fzu7_17",er={goIcon:Zi};function tr(){const{data:t}=Vn(),s=n=>Vt(n);return e.jsx(L,{wrap:"wrap",children:t.networkInterfaces.map(n=>{if(n.name==="localhost"&&!mt)return null;const a=Mn(n.address);return e.jsxs(Wt,{copyValue:a,onClick:()=>s(a),children:[`${n.name} - ${n.address}`," ",e.jsx(gt,{className:er.goIcon})]},n.name)})})}function sr(t){return un(t)}function nr(t,s,n){if(Object.keys(t).length===0)return[];if(n.length===0)return[];const a=[];let i=1;for(let l=0;l<n.length;l++){const r=n[l],c=s[r];!c||!Ht(c)||(r in t||a.push({id:r,index:i,title:c.title,cue:c.cue,scheduledStart:c.timeStart,actualEnd:null,scheduledEnd:c.timeEnd,actualStart:null}),r in t&&a.push({id:r,index:i,title:c.title,cue:c.cue,scheduledStart:c.timeStart,actualEnd:t[r].endedAt,scheduledEnd:c.timeEnd,actualStart:t[r].startedAt}),i++)}return a}const ar=["Index","Title","Cue","Scheduled Start","Actual Start","Scheduled End","Actual End"];function ir(t){const s=[];s.push(ar);for(const n of t)s.push([String(n.index),n.title,n.cue,Fe(n.scheduledStart),Fe(n.actualStart),Fe(n.scheduledEnd),Fe(n.actualEnd)]);return sr(s)}const rr="_blink_15peo_1",lr="_fourtyfive_15peo_13",or="_over_15peo_17",cr="_under_15peo_21",ct={blink:rr,fourtyfive:lr,over:or,under:cr};function dr(){const{data:t}=Ja(),{data:s}=Qt(),n=async()=>await Xa(),a=l=>{if(!l)return;const r=ir(l),c=Ls(r,"text/csv;charset=utf-8;");Ut(c,"ontime-report.csv")},i=p.useMemo(()=>nr(t,s.entries,s.flatOrder),[t,s.entries,s.flatOrder]);return e.jsx(E,{children:e.jsxs(ne,{children:[e.jsx(J,{children:"Report"}),e.jsx(le,{}),e.jsx(E,{children:e.jsxs(Ce,{children:["Manage report",e.jsxs(L,{children:[e.jsxs(f,{onClick:()=>a(i),disabled:i.length===0,children:[e.jsx(as,{}),"Export CSV"]}),e.jsxs(f,{variant:"subtle-destructive",onClick:n,disabled:i.length===0,children:[e.jsx(as,{}),"Clear All"]})]})]})}),e.jsx(E,{children:e.jsxs(_e,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"#"}),e.jsx("th",{children:"Cue"}),e.jsx("th",{children:"Title"}),e.jsx("th",{children:"Scheduled Start"}),e.jsx("th",{children:"Actual Start"}),e.jsx("th",{children:"Scheduled End"}),e.jsx("th",{children:"Actual End"})]})}),e.jsxs("tbody",{children:[i.length===0&&e.jsx(ft,{label:"Reports are generated when running through the show."}),i.map(l=>{const r=l.actualStart===null?null:l.actualStart<=l.scheduledStart?"under":"over",c=l.actualEnd===null?null:l.actualEnd<=l.scheduledEnd?"under":"over";return e.jsxs("tr",{children:[e.jsx("th",{children:l.index}),e.jsx("th",{children:l.cue}),e.jsx("th",{children:l.title}),e.jsx("th",{className:Se([r&&ct[r]]),children:Fe(l.scheduledStart)}),e.jsx("th",{className:Se([r&&ct[r]]),children:Fe(l.actualStart)}),e.jsx("th",{className:Se([c&&ct[c]]),children:Fe(l.scheduledEnd)}),e.jsx("th",{className:Se([c&&ct[c]]),children:Fe(l.actualEnd)})]},l.id)})]})]})})]})})}const ur="_expand_1sy0c_17",hr="_column_1sy0c_21",fs={expand:ur,column:hr},mr=[{value:Re.Cuesheet,label:"Cuesheet"},{value:Re.Operator,label:"Operator"},{value:Re.Timer,label:"Timer"},{value:Re.Backstage,label:"Backstage"},{value:Re.Timeline,label:"Timeline"},{value:Re.StudioClock,label:"Studio Clock"},{value:Re.Countdown,label:"Countdown"},{value:Re.ProjectInfo,label:"Project Info"}],xr={alias:"",target:Re.Timer,search:"",enabled:!0};function jr({urlPreset:t,onClose:s}){var k,R,W;const{addPreset:n,updatePreset:a,isMutating:i}=Os(),{handleSubmit:l,register:r,setFocus:c,setError:u,clearErrors:o,setValue:h,getValues:m,watch:d,formState:{errors:x,isSubmitting:j,isValid:g,isDirty:b}}=de({defaultValues:t??xr,mode:"onChange",resetOptions:{keepDirtyValues:!0}}),y=p.useRef(null),w=async v=>{try{t?await a(t.alias,v):await n(v),s()}catch(A){u("root",{message:V(A)})}};p.useEffect(()=>{c("alias")},[c]);const S=()=>{var v;o();try{const A=Wn(m("alias"),((v=y.current)==null?void 0:v.value.trim())??"");h("target",A.target,{shouldDirty:!0,shouldValidate:!0}),h("search",A.search,{shouldDirty:!0,shouldValidate:!0})}catch(A){u("root",{message:ls(A)});return}},O=v=>{try{return new URLSearchParams(v),!0}catch(A){return ls(A)||"Invalid URL parameters"}};return e.jsxs(Be,{as:"form",onSubmit:l(w),onKeyDown:v=>ke(v,s),className:fs.column,children:[e.jsx("input",{hidden:!0,name:"enabled",value:"true"}),e.jsx("div",{children:"1. Enter URL and let Ontime generate the preset options"}),e.jsxs(L,{children:[e.jsxs("div",{children:[e.jsx(ae,{children:"Alias"}),e.jsx(M,{...r("alias",{required:"Alias is required",pattern:{value:Ta,message:"Field can only contain URL safe characters (a-z, 0-9, _ and -)"}})})]}),e.jsxs("div",{className:fs.expand,children:[e.jsx(ae,{children:"Generate options (paste URL to generate options)"}),e.jsxs(L,{children:[e.jsx(M,{placeholder:"Paste URL",fluid:!0,ref:y}),e.jsx(f,{onClick:S,children:"Generate"})]})]})]}),((k=x.alias)==null?void 0:k.message)&&e.jsx(D,{children:x.alias.message}),e.jsxs("div",{children:[Rt," or ",Rt]}),e.jsx("div",{children:"2. Choose a view and its parameters"}),e.jsxs("div",{children:[e.jsx(ae,{children:"Target"}),e.jsx(ie,{options:mr,...r("target",{required:"Target is required"}),value:d("target"),onValueChange:v=>{v!==null&&h("target",v,{shouldDirty:!0})}})]}),e.jsxs("div",{children:[e.jsx(ae,{children:"Parameters"}),e.jsx(Et,{fluid:!0,rows:3,...r("search",{validate:O})}),e.jsx(D,{children:(R=x.search)==null?void 0:R.message})]}),e.jsxs("div",{children:[e.jsx(D,{children:(W=x.root)==null?void 0:W.message}),e.jsxs(L,{align:"end",children:[e.jsx(f,{onClick:s,children:"Cancel"}),e.jsx(f,{variant:"primary",type:"submit",disabled:!g||!b,loading:j||i,children:"Save"})]})]})]})}const pr="https://docs.getontime.no/features/url-presets/";function gr(){const[t,s]=p.useState({isOpen:!1,preset:void 0}),{data:n,status:a}=As(),{deletePreset:i,isMutating:l}=Os(),r=()=>s({isOpen:!0}),c=o=>s({isOpen:!0,preset:o}),u=()=>s({isOpen:!1,preset:void 0});return e.jsx(E,{children:e.jsxs(ne,{children:[e.jsxs(J,{children:["URL presets",e.jsxs(f,{onClick:r,children:["New ",e.jsx(ge,{})]})]}),e.jsx(le,{}),e.jsx(E,{children:e.jsxs(xe,{children:["URL presets are user pre-defined aliases to Ontime URLs.",e.jsx("br",{}),"This URL can contain full configuration including parameters, or simply route to a specific view.",e.jsx("br",{}),e.jsx("br",{}),"The easiest way to get started is to copy an URL from your browser and paste it into the form.",e.jsx(se,{href:pr,children:"See the docs"})]})}),e.jsxs(E,{children:[e.jsx(Ue,{isLoading:a==="pending"}),t.isOpen&&e.jsx(jr,{urlPreset:t.preset,onClose:u}),e.jsxs(_e,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Enabled"}),e.jsx("th",{children:"Target view"}),e.jsx("th",{children:"Alias"}),e.jsx("th",{})]})}),e.jsxs("tbody",{children:[n.length===0&&e.jsx(ft,{handleClick:r}),n.map((o,h)=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx(De,{defaultChecked:o.enabled,onCheckedChange:()=>{}})}),e.jsx("td",{children:e.jsx(K,{children:o.target})}),e.jsx("td",{style:{width:"100%"},children:o.alias}),e.jsxs(L,{relation:"inner",as:"td",children:[e.jsx(Y,{variant:"ghosted-white",onClick:m=>Fs(o.alias,m),disabled:l,children:e.jsx(Ns,{})}),e.jsx(Y,{onClick:()=>c(o),variant:"ghosted-white","aria-label":"Edit entry","data-testid":`field__edit_${h}`,disabled:l,children:e.jsx(pt,{})}),e.jsx(Y,{onClick:()=>i(o.alias),variant:"ghosted-destructive","aria-label":"Delete entry","data-testid":`field__delete_${h}`,disabled:l,children:e.jsx(pe,{})})]})]},o.alias))]})]})]})]})})}function fr({location:t}){const s=re("presets",t),n=re("link",t),a=re("report",t);return e.jsxs(e.Fragment,{children:[e.jsx(Ve,{children:"Sharing and reporting"}),e.jsx("div",{ref:s,children:e.jsx(gr,{})}),e.jsx("div",{ref:n,children:e.jsx(E,{children:e.jsxs(ne,{children:[e.jsx(J,{children:"Share Ontime Link"}),!He&&e.jsxs(e.Fragment,{children:[e.jsx(Ie,{children:"Ontime is streaming on the following network interfaces"}),e.jsx(tr,{})]}),e.jsx(le,{}),e.jsx(Da,{})]})})}),e.jsx("div",{ref:a,children:e.jsx(dr,{})})]})}const ts=`${Bt}/excel`;async function br(t){const s=new FormData;return s.append("excel",t),(await X.post(`${ts}/upload`,s,{headers:{"Content-Type":"multipart/form-data"}})).data}async function yr(t){return(await X.post(`${ts}/preview`,{options:t})).data}async function vr(t,s){try{const n=await X.get(`${ts}/${t}/export`,{responseType:"blob"});Ut(n.data,`${s??"Ontime_rundown"}.xlsx`)}catch(n){console.error("Error downloading file:",n)}}const Ye=`${Bt}/sheets`,wr=async()=>(await X.get(`${Ye}/connect`)).data,Sr=async(t,s)=>{const n=new FormData;return n.append("client_secret",t),(await X.post(`${Ye}/${s}/connect`,n,{headers:{"Content-Type":"multipart/form-data"}})).data},Cr=async()=>(await X.post(`${Ye}/revoke`)).data,_r=async(t,s)=>(await X.post(`${Ye}/${t}/read`,{options:s})).data,Js=async t=>(await X.post(`${Ye}/${t}/worksheets`)).data,kr=async(t,s)=>(await X.post(`${Ye}/${t}/write`,{options:s})).data;function Nr(t){if(!Tr(t))throw new Error("Unknown file type");if(t.size===0)throw new Error("File is empty");if(t.size>1e7)throw new Error("File size limit (10MB) exceeded")}function Xs(t){if(!Dr(t))throw new Error("Unknown file type");if(t.size===0)throw new Error("File is empty");if(t.size>2e6)throw new Error("File size limit (2MB) exceeded")}function Tr(t){return t==null?void 0:t.name.endsWith(".xlsx")}function Dr(t){return t==null?void 0:t.name.endsWith(".json")}function Pr(t){if(t.size===0)throw new Error("File is empty");if(t.size>15e5)throw new Error("File size limit (1.5MB) exceeded")}const Ne=`${Bt}/db`;function Zs(t){return X.post(`${Ne}/download`,{filename:t})}async function Rr(t){try{const{data:s,name:n}=await Vr(t),a=JSON.stringify(s,null,2),i=Ls(a,"application/json;charset=utf-8;");Ut(i,`${n}.json`)}catch(s){console.error(s)}}async function en(t){const s=new FormData;return s.append("project",t),(await X.post(`${Ne}/upload`,s,{headers:{"Content-Type":"multipart/form-data"}})).data}async function tn(t){return await X.patch(Ne,t)}async function Er(t){return(await X.post(`${Ne}/new`,t)).data}async function Ir(t){return(await X.post(`${Ne}/quick`,t)).data}async function Lr(){return(await X.get(`${Ne}/all`)).data}async function sn(t){return(await X.post(`${Ne}/load`,{filename:t})).data}async function Or(){return(await X.post(`${Ne}/demo`)).data}async function Ar(t,s){const n=`${Ne}/${t}/duplicate`,a=decodeURIComponent(n);return(await X.post(a,{newFilename:s})).data}async function Fr(t,s){const n=`${Ne}/${t}/rename`,a=decodeURIComponent(n);return(await X.put(a,{newFilename:s})).data}async function $r(t){const s=`${Ne}/${t}`,n=decodeURIComponent(s);return(await X.delete(n)).data}async function Vr(t){const s=await Zs(t),n=s.headers["Content-Disposition"];let a=t;if(n!=null){const i=n.indexOf('"')+1,l=n.lastIndexOf('"');a=n.substring(i,l)}return{data:s.data,name:a}}const Mr={authenticate:{available:!1,error:""},sheetId:{available:!1,error:""},worksheet:{available:!1,error:""},pullPush:{available:!1,error:""}},bs={stepData:Mr,worksheetNames:null,sheetId:null,authenticationStatus:"not_authenticated",rundown:null,customFields:null,summary:null,spreadsheetImportMap:mi},q=hn((t,s)=>({...bs,patchStepData:n=>{const a=s().stepData;t({stepData:{...a,...n}})},setWorksheets:n=>t({worksheetNames:n}),setSheetId:n=>t({sheetId:n}),setAuthenticationStatus:n=>t({authenticationStatus:n}),setRundown:n=>t({rundown:n}),setCustomFields:n=>t({customFields:n}),setSummary:n=>t({summary:n}),patchSpreadsheetImportMap:(n,a)=>{const i=s().spreadsheetImportMap;i[n]!==a&&(i[n]=a)},reset:()=>t(bs),resetPreview:()=>t({rundown:null,customFields:null,summary:null})}));function vt(){const t=Ft(),s=q(m=>m.patchStepData),n=q(m=>m.setRundown),a=q(m=>m.setCustomFields),i=q(m=>m.setSummary);return{connect:async(m,d)=>{try{return await Sr(m,d)}catch(x){s({authenticate:{available:!1,error:V(x)}})}},revoke:async()=>{try{return await Cr()}catch(m){s({authenticate:{available:!1,error:V(m)}})}},verifyAuth:async()=>{try{return await wr()}catch(m){s({authenticate:{available:!1,error:V(m)}})}},importRundownPreview:async(m,d)=>{try{const x=await _r(m,d);n(x.rundown),a(x.customFields),i(x.summary)}catch(x){s({pullPush:{available:!0,error:V(x)}})}},importRundown:async(m,d)=>{try{await tn({rundowns:m,customFields:d}),await t.invalidateQueries({queryKey:[Un,Bn]})}catch(x){s({pullPush:{available:!0,error:V(x)}})}},exportRundown:async(m,d)=>{try{await kr(m,d),s({pullPush:{available:!1,error:""}})}catch(x){s({pullPush:{available:!0,error:V(x)}})}}}}const Lt={Worksheet:"event schedule",Flag:"flag",Start:"time start","Link start":"link start",End:"time end",Duration:"duration",Cue:"cue",Title:"title","Count to end":"count to end",Skip:"skip",Note:"notes",Colour:"colour","End action":"end action","Timer type":"timer type","Time warning":"warning time","Time danger":"danger time",ID:"id",custom:[]};function Wr(t){return typeof t!="object"||t===null?!1:Object.keys(Lt).every(n=>Object.hasOwn(t,n))}function ys(t){const s=t.custom.reduce((n,{ontimeName:a,importName:i})=>(a&&i&&(n[a.trim()]=i.trim()),n),{});return{worksheet:t.Worksheet,flag:t.Flag,timeStart:t.Start,linkStart:t["Link start"],timeEnd:t.End,duration:t.Duration,cue:t.Cue,title:t.Title,countToEnd:t["Count to end"],skip:t.Skip,note:t.Note,colour:t.Colour,endAction:t["End action"],timerType:t["Timer type"],timeWarning:t["Time warning"],timeDanger:t["Time danger"],custom:s,id:t.ID}}function Ur(t){localStorage.setItem("import-options",JSON.stringify(t))}function Br(){const t=localStorage.getItem("import-options");if(!t)throw new Error("no import options found");return JSON.parse(t)}function qr(){try{const t=Br();return Wr(t)?t:Lt}catch{return Lt}}const zr="_uploadSection_10owf_17",Gr="_finishSection_10owf_18",Kr="_error_10owf_40",Hr="_success_10owf_43",Qr="_singleActionCell_10owf_47",$e={uploadSection:zr,finishSection:Gr,error:Kr,success:Hr,singleActionCell:Qr};function Yr({hasErrors:t,isSpreadsheet:s,onCancel:n,onSubmitExport:a,onSubmitImport:i}){const l=qr(),{revoke:r}=vt(),{control:c,handleSubmit:u,register:o,setValue:h,watch:m,formState:{errors:d,isValid:x}}=de({mode:"onChange",defaultValues:l,values:l}),{fields:j,append:g,remove:b}=ht({control:c,name:"custom"}),y=q(P=>P.stepData),w=q(P=>P.worksheetNames),[S,O]=p.useState("");p.useEffect(()=>{!w||w.length===0||w.includes(l.Worksheet)||h("Worksheet",w[0],{shouldValidate:!0,shouldDirty:!0})},[w,h,l.Worksheet]);const k=async P=>{O("export");const I=ys(P);await a(I),O("")},R=async()=>{await r(),n()},W=async P=>{O("import");const I=ys(P);Ur(P),await i(I),O("")},v=P=>{b(P)},A=()=>{g({})},C=!!S,H=s&&!C,B=!C&&!y.worksheet.error,F=!t&&x&&(H||B);return e.jsxs(E,{as:"form",id:"import-map",children:[e.jsxs(Ce,{children:["Import options",e.jsxs(L,{children:[!s&&e.jsx(Yt,{text:"Revoke the google authentication",render:e.jsx(f,{}),onClick:R,disabled:C,children:"Revoke"}),e.jsx(f,{onClick:n,disabled:C,children:"Cancel"}),!s&&e.jsx(f,{variant:"primary",onClick:u(k),disabled:!B,loading:S==="export",children:"Export"}),e.jsx(f,{variant:"primary",onClick:u(W),disabled:!F,loading:S==="import",children:"Import preview"})]})]}),e.jsxs(xe,{children:["Match your spreadsheet columns to Ontime fields. ",e.jsx("br",{}),"You can also add Custom Fields by providing a name for Ontime and the spreadsheet column name."]}),e.jsxs(_e,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Ontime field"}),e.jsx("th",{children:"Column name in spreadsheet"}),e.jsx("th",{className:$e.singleActionCell})]})}),e.jsxs("tbody",{children:[Object.entries(l).map(([P,I])=>P==="custom"?null:P==="Worksheet"?e.jsxs("tr",{children:[e.jsx("td",{children:P}),e.jsx("td",{children:e.jsx(ie,{id:I,value:m(P),onValueChange:T=>{T!==null&&h(P,T,{shouldDirty:!0})},options:(w==null?void 0:w.map(T=>({value:T,label:T})))||[]})}),e.jsx("td",{className:$e.singleActionCell})]},I):e.jsxs("tr",{children:[e.jsx("td",{children:P}),e.jsx("td",{children:e.jsx(M,{id:I,fluid:!0,maxLength:25,defaultValue:I,placeholder:"Use default column name",...o(P)})}),e.jsx("td",{className:$e.singleActionCell})]},I)),j.map((P,I)=>{var fe,ue,oe;const T=P.ontimeName,G=P.importName,$=(oe=(ue=(fe=d.custom)==null?void 0:fe[I])==null?void 0:ue.ontimeName)==null?void 0:oe.message,N=`custom.${I}.ontimeName`;return e.jsxs("tr",{children:[e.jsxs("td",{children:[e.jsx(M,{maxLength:25,fluid:!0,defaultValue:T,placeholder:"Name of the field as shown in Ontime",...o(`custom.${I}.ontimeName`,{validate:_=>qt.isAlphanumericWithSpace(_)?!0:"Only alphanumeric characters and space are allowed"})}),$&&e.jsx(D,{children:$})]}),e.jsx("td",{children:e.jsx(M,{maxLength:25,fluid:!0,defaultValue:G,placeholder:"Name of the column in the spreadsheet",...o(`custom.${I}.importName`)})}),e.jsx("td",{className:$e.singleActionCell,children:e.jsx(Y,{variant:"ghosted-destructive","aria-label":"Delete entry",onClick:()=>v(I),children:e.jsx(pe,{})})})]},N)}),e.jsxs("tr",{children:[e.jsx("td",{}),e.jsx(L,{as:"td",align:"end",children:e.jsxs(f,{onClick:A,children:["Add custom field ",e.jsx(ge,{})]})}),e.jsx("td",{})]})]})]}),e.jsx(D,{children:y.worksheet.error})]})}const Jr="https://docs.getontime.no/features/import-spreadsheet-gsheet/";function Xr(){return e.jsxs(xe,{children:["Ontime can import data from spreadsheets by: ",e.jsx("br",{}),"- importing the spreadsheet file in Ontime ",e.jsx("br",{}),"- synchronising your project with a Google Sheet",e.jsx("br",{}),e.jsx("br",{}),"To synchronise with a Google Sheet, you will need to allow Ontime to authenticate with your Google account.",e.jsx(se,{href:Jr,children:"See the docs"})]})}function Zr(t){const{onCancel:s}=t,{revoke:n,connect:a,verifyAuth:i}=vt(),[l,r]=p.useState(null),[c,u]=p.useState(null),[o,h]=p.useState(""),[m,d]=p.useState(""),x=q(T=>T.sheetId),j=q(T=>T.setSheetId),g=q(T=>T.setWorksheets),b=q(T=>T.patchStepData),y=q(T=>T.authenticationStatus),w=q(T=>T.setAuthenticationStatus),S=q(T=>T.stepData.authenticate.error),O=async()=>{const T=await i();T&&w(T.authenticated)};p.useEffect(()=>{b({authenticate:{available:!1,error:""}}),A()},[]);const k=async()=>{h("cancel"),await n(),await O(),h("")},R=()=>{s()},W=T=>{var G;(G=T.target.files)!=null&&G.length&&r(T.target.files[0])},v=async()=>{if(!l||!x)return;b({worksheet:{available:!1,error:""}}),h("connect");const T=await a(l,x);T&&(d(T.verification_url),u(T.user_code)),h("")},A=async(T=0)=>{const G=await i();if(G!=null&&G.authenticated&&(w(G.authenticated),G.authenticated!=="pending")){if(G.authenticated=="authenticated")try{const $=await Js(G.sheetId);g($)}catch($){const N=V($);b({worksheet:{available:!1,error:N}})}h("");return}if(T<=10){setTimeout(()=>A(T+1),2e3);return}h("")},C=async()=>{h("authenticate"),Vt(m),window.addEventListener("focus",async()=>{A()},{once:!0})},H=l&&x,B=!!c&&!!m,F=!!o,P=y==="authenticated",I=y==="pending";return e.jsxs(E,{children:[e.jsxs(Ce,{children:["Sync with Google Sheet (experimental)",P?e.jsx(f,{onClick:k,loading:o==="cancel",children:"Revoke Authentication"}):e.jsx(f,{onClick:R,children:"Go Back"})]}),e.jsxs(ce,{children:[e.jsx(ae,{children:"Upload Client Secret provided by Google"}),e.jsx(D,{children:S}),e.jsx(M,{fluid:!0,type:"file",onChange:W,accept:".json",disabled:F||B})]}),e.jsxs(ce,{children:[e.jsx(ae,{children:"Enter ID of sheet to synchronise"}),e.jsx(D,{children:void 0}),e.jsx(M,{fluid:!0,placeholder:"Sheet ID",onChange:T=>j(T.target.value),disabled:F||B})]}),B?e.jsx(ce,{children:e.jsxs(L,{children:[I&&e.jsx("span",{children:"Authenticating..."}),e.jsx(Wt,{copyValue:c??"",disabled:!B,children:c||"Upload files to generate Auth Key"}),e.jsxs(f,{onClick:C,disabled:!B,children:[e.jsx(mn,{}),"Authenticate"]})]})}):e.jsx(ce,{children:e.jsx(L,{children:e.jsxs(f,{onClick:v,disabled:!H||F,loading:o==="connect",children:[e.jsx(dt,{}),"Connect"]})})})]})}const el="_center_l8uww_17",tl="_nowrap_l8uww_21",sl="_secondaryRow_l8uww_25",nl="_linkStartActive_l8uww_30",al="_flex_l8uww_36",il="_subdued_l8uww_42",te={center:el,nowrap:tl,secondaryRow:sl,linkStartActive:nl,flex:al,subdued:il};function kt(t){return t?"Yes":void 0}function rl({rundown:t,customFields:s}){let n=0;const a=Object.keys(s),i=a.map(l=>s[l].label);return e.jsxs(_e,{className:te.nowrap,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"#"}),e.jsx("th",{children:"Type"}),e.jsx("th",{children:"Cue"}),e.jsx("th",{children:"Title"}),e.jsx("th",{children:"Flag"}),e.jsx("th",{children:"Time Start"}),e.jsx("th",{children:"Time End"}),e.jsx("th",{children:"Duration"}),e.jsx("th",{children:"Warning Time"}),e.jsx("th",{children:"Danger Time"}),e.jsx("th",{children:"Count to end"}),e.jsx("th",{children:"Skip"}),e.jsx("th",{children:"Colour"}),e.jsx("th",{children:"Timer Type"}),e.jsx("th",{children:"End Action"}),i.map(l=>e.jsx("th",{children:l},l)),e.jsx("th",{children:"ID"})]})}),e.jsx("tbody",{children:t.flatOrder.map(l=>{const r=t.entries[l];if($a(r)){const m=r.colour?wt(r.colour):{};return e.jsxs("tr",{children:[e.jsx("td",{})," ",e.jsx("td",{className:te.center,children:e.jsx(K,{children:r.type})}),e.jsx("td",{})," ",e.jsx("td",{children:r.title}),e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{style:{...m},children:r.colour}),e.jsx("td",{})," ",e.jsx("td",{})," ",a.map(d=>{let x="";return d in r.custom&&(x=r.custom[d]),e.jsx("td",{children:x},d)}),e.jsx("td",{className:te.center,children:e.jsx(K,{children:r.id})})]},r.id)}if(Va(r)){const m=r.colour?wt(r.colour):{};return e.jsxs(p.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{})," ",e.jsx("td",{className:te.center,children:e.jsx(K,{children:r.type})}),e.jsx("td",{className:te.nowrap,children:r.cue}),e.jsx("td",{children:r.title}),e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{})," ",e.jsx("td",{style:{...m},children:r.colour}),e.jsx("td",{})," ",e.jsx("td",{})," ",a.map(d=>{let x="";return d in r.custom&&(x=r.custom[d]),e.jsx("td",{children:x},d)}),e.jsx("td",{className:te.center,children:e.jsx(K,{children:r.id})})]}),r.note&&e.jsx("tr",{children:e.jsxs("td",{colSpan:99,className:te.secondaryRow,children:["Note: ",r.note]})})]},r.id)}if(!Ht(r))return null;n+=1;const c=r.colour?wt(r.colour):{},u=kt(r.countToEnd),o=kt(r.skip),h=kt(r.flag);return e.jsxs(p.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{className:te.center,children:e.jsx(K,{children:n})}),e.jsx("td",{className:te.center,children:e.jsx(K,{children:r.type})}),e.jsx("td",{className:te.nowrap,children:r.cue}),e.jsx("td",{children:r.title}),e.jsx("td",{className:te.center,children:h&&e.jsx(K,{children:h})}),e.jsxs("td",{className:te.flex,children:[e.jsx("span",{className:r.linkStart?te.subdued:void 0,children:Ae(r.timeStart)}),r.linkStart&&e.jsx(xn,{className:te.linkStartActive})]}),e.jsx("td",{children:Ae(r.timeEnd)}),e.jsx("td",{children:Ae(r.duration)}),e.jsx("td",{children:Ae(r.timeWarning)}),e.jsx("td",{children:Ae(r.timeDanger)}),e.jsx("td",{className:te.center,children:u&&e.jsx(K,{children:u})}),e.jsx("td",{children:o&&e.jsx(K,{children:o})}),e.jsx("td",{style:{...c},children:r.colour}),e.jsx("td",{className:te.center,children:e.jsx(K,{children:r.timerType})}),e.jsx("td",{className:te.center,children:e.jsx(K,{children:r.endAction})}),a.map(m=>{let d="";return m in r.custom&&(d=r.custom[m]),e.jsx("td",{children:d},m)}),e.jsx("td",{className:te.center,children:e.jsx(K,{children:r.id})})]}),r.note&&e.jsx("tr",{children:e.jsxs("td",{colSpan:99,className:te.secondaryRow,children:["Note: ",r.note]})})]},r.id)})})]})}function ll({rundown:t,customFields:s,summary:n,onFinished:a,onCancel:i,onBack:l}){const{data:r}=Qt(),[c,u]=p.useState(!1),{importRundown:o}=vt(),h=q(x=>x.resetPreview),m=()=>{h(),i()},d=async()=>{u(!0),await o({[r.id]:{...t,id:r.id,title:r.title}},s),u(!1),a()};return e.jsxs(E,{children:[e.jsxs(Ce,{children:["Review Rundown",e.jsxs(L,{children:[e.jsx(f,{onClick:m,variant:"ghosted",disabled:c,children:"Cancel"}),e.jsx(f,{onClick:l,variant:"subtle",disabled:c,children:"Back"}),e.jsx(f,{onClick:d,variant:"primary",loading:c,children:"Apply"})]})]}),e.jsxs(ce,{children:[e.jsxs(U,{children:[e.jsx("b",{children:"Title"})," ",t.title]}),e.jsxs(U,{children:[e.jsx("b",{children:"Number of entries"})," ",t.flatOrder.length]}),e.jsxs(U,{children:[e.jsx("b",{children:"Start time"})," ",Ae(n.start)]}),e.jsxs(U,{children:[e.jsx("b",{children:"End time"})," ",Ae(n.end)]}),e.jsxs(U,{children:[e.jsx("b",{children:"Total duration"})," ",zt(n.duration)]})]}),e.jsx(rl,{rundown:t,customFields:s})]})}function ol(){const[t,s]=p.useState("none"),[n,a]=p.useState(""),[i,l]=p.useState("none"),{exportRundown:r,importRundownPreview:c,verifyAuth:u}=vt(),o=q(_=>_.setWorksheets),h=q(_=>_.authenticationStatus),m=q(_=>_.setAuthenticationStatus),d=q(_=>_.rundown),x=q(_=>_.setRundown),j=q(_=>_.customFields),g=q(_=>_.setCustomFields),b=q(_=>_.summary),y=q(_=>_.setSummary),w=q(_=>_.setSheetId),S=q(_=>_.sheetId),O=q(_=>_.resetPreview),k=p.useRef(null),R=async _=>{var Te;const ee=(Te=_.target.files)==null?void 0:Te[0];if(!ee){o(null),l("none");return}try{l("loading"),Nr(ee);const Pe=await br(ee);o(Pe),s("excel"),l("done")}catch(Pe){const je=qn(Pe);a(`Error uploading file: ${je}`),o(null),l("none")}},W=()=>{var _;(_=k.current)==null||_.click()},v=()=>{s("none"),x(null),l("none"),o(null),g(null),y(null),a(""),w(null)},A=async()=>{const _=await u();if(_&&(m(_.authenticated),w(_.sheetId),_.authenticated==="authenticated"&&_.sheetId))try{const ee=await Js(_.sheetId);o(ee)}catch(ee){const Te=V(ee);a(`Error getting worksheets: ${Te}`)}s("gsheet")},C=()=>{v()},H=async _=>{if(a(""),t==="excel")try{const ee=await yr(_);x(ee.rundown),g(ee.customFields),y(ee.summary)}catch(ee){a(V(ee))}if(t==="gsheet"){if(!S)return;await c(S,_)}},B=async()=>{if(v(),h==="authenticated"){const _=await u();_&&m(_.authenticated)}},F=()=>{s("finished"),x(null),l("none"),o(null),g(null),a("")},P=async _=>{S&&await r(S,_)},I=t==="excel",T=t==="gsheet",G=h==="authenticated",$=t==="none",N=t==="finished",fe=T&&!G,ue=T&&G||I&&i==="done",oe=d!==null&&j!==null&&b!==null;return e.jsx(E,{children:e.jsxs(ne,{children:[e.jsx(J,{children:"Synchronise your rundown with an external source"}),n&&e.jsx(D,{children:n}),$&&e.jsxs(e.Fragment,{children:[e.jsx(Xr,{}),e.jsx("input",{ref:k,style:{display:"none"},type:"file",onChange:R,accept:".xlsx","data-testid":"file-input"}),e.jsxs("div",{className:$e.uploadSection,children:[e.jsxs("div",{children:[e.jsxs(f,{variant:"primary",onClick:W,loading:i==="loading",children:[e.jsx(it,{}),"Import from spreadsheet"]}),e.jsx(ae,{children:"Accepts .xlsx files"})]}),e.jsx(Za,{orientation:"vertical"}),e.jsxs("div",{children:[e.jsxs(f,{variant:"primary",onClick:A,disabled:i!=="none",children:[e.jsx(jn,{}),"Synchronise with Google"]}),e.jsx(ae,{children:"Start authentication process"})]})]})]}),N&&e.jsxs("div",{className:$e.finishSection,children:[n?e.jsx("span",{className:$e.error,children:"Import failed"},"finish__error"):e.jsx("span",{className:$e.success,children:"Import successful"},"finish__success"),e.jsx(f,{variant:"primary",onClick:v,children:"Return"})]}),fe&&e.jsx(Zr,{onCancel:C}),ue&&!oe&&e.jsx(Yr,{hasErrors:!!n,isSpreadsheet:I,onCancel:B,onSubmitExport:P,onSubmitImport:H}),oe&&e.jsx(ll,{rundown:d,customFields:j,summary:b,onFinished:F,onCancel:B,onBack:O})]})})}const cl="_halfWidth_6p65m_17",dl="_fullWidth_6p65m_21",ul="_twoCols_6p65m_25",hl="_current_6p65m_31",jt={halfWidth:cl,fullWidth:dl,twoCols:ul,current:hl};function nn({onSubmit:t,onCancel:s,initialColour:n,initialLabel:a,initialKey:i}){const{data:l}=yt(),[r,c]=p.useState(n||""),{handleSubmit:u,register:o,setFocus:h,setError:m,setValue:d,getValues:x,watch:j,formState:{errors:g,isSubmitting:b,isValid:y,isDirty:w}}=de({defaultValues:{type:"text",label:a||"",colour:n||""},resetOptions:{keepDirtyValues:!0}}),S=async v=>{const{type:A,label:C,colour:H}=v,B={type:A,colour:H,label:C};try{await t(B)}catch(F){m("root",{type:"custom",message:V(F)})}};p.useEffect(()=>{h("label")},[h]);const O=v=>{c(v),d("colour",v,{shouldDirty:!0})},k=x("colour"),R=w&&y,W=i!==void 0;return e.jsxs(Be,{as:"form",onSubmit:u(S),onKeyDown:v=>ke(v,s),children:[e.jsxs(xe,{children:["Please note that images can quickly deteriorate your app's performance.",e.jsx("br",{}),"Prefer using small, and compressed images."]}),e.jsxs("div",{children:[e.jsx(ae,{children:"Type"}),e.jsx(Ws,{orientation:"horizontal",disabled:W,onValueChange:v=>d("type",v,{shouldDirty:!0}),value:j("type"),items:[{value:"text",label:"Text"},{value:"image",label:"Image"}]})]}),e.jsxs("div",{className:jt.twoCols,children:[e.jsxs("label",{children:[e.jsx(ae,{children:"Label (only alphanumeric characters are allowed)"}),g.label&&e.jsx(D,{children:g.label.message}),e.jsx(M,{...o("label",{required:{value:!0,message:"Required field"},onChange:()=>d("key",hi(x("label"))??"N/A"),validate:v=>v.trim().length===0?"Required field":qt.isAlphanumericWithSpace(v)?!W&&W&&Object.keys(l).includes(v)?"Custom fields must be unique":!0:"Only alphanumeric characters and space are allowed"}),fluid:!0})]}),e.jsxs("label",{children:[e.jsx(ae,{children:"Key (use in Integrations and API)"}),e.jsx(M,{...o("key"),variant:"ghosted",readOnly:!0,fluid:!0})]})]}),e.jsxs("label",{children:[e.jsx(ae,{children:"Colour"}),e.jsx(Pa,{name:"colour",value:k,handleChange:(v,A)=>O(A)})]}),g.root&&e.jsx(D,{children:g.root.message}),e.jsxs(L,{relation:"inner",align:"end",children:[e.jsx(f,{variant:"ghosted",onClick:s,children:"Cancel"}),e.jsx(f,{type:"submit",variant:"primary",disabled:!R,loading:b,children:"Save"})]})]})}function ml(t){const{colour:s,label:n,fieldKey:a,type:i,onEdit:l,onDelete:r}=t,[c,u]=p.useState(!1),o=async h=>{await l(a,h),u(!1)};return c?e.jsx("tr",{children:e.jsx("td",{colSpan:99,children:e.jsx(nn,{onCancel:()=>u(!1),onSubmit:o,initialColour:s,initialLabel:n,initialKey:a})})}):e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx(Ra,{color:s})}),e.jsx("td",{children:e.jsx(K,{children:i})}),e.jsx("td",{className:jt.halfWidth,children:n}),e.jsx("td",{className:jt.fullWidth,children:e.jsx(Wt,{size:"small",copyValue:a,children:a})}),e.jsxs(L,{relation:"inner",as:"td",children:[e.jsx(Y,{variant:"ghosted-white","aria-label":"Edit entry",onClick:()=>u(!0),children:e.jsx(pt,{})}),e.jsx(Y,{variant:"ghosted-destructive","aria-label":"Delete entry",onClick:()=>r(a),children:e.jsx(pe,{})})]})]})}function xl(){const{data:t,refetch:s}=yt(),[n,a]=p.useState(!1),i=()=>{a(!0)},l=()=>{a(!1)},r=async o=>{await Ha(o),s(),a(!1)},c=async(o,h)=>{await Qa(o,h),s()},u=async o=>{try{await Ya(o),s()}catch{}};return e.jsx(E,{children:e.jsxs(ne,{children:[e.jsxs(J,{children:["Custom fields",e.jsxs(f,{onClick:i,children:["New ",e.jsx(ge,{})]})]}),e.jsx(le,{}),e.jsx(E,{children:e.jsxs(xe,{children:["Custom fields allow for additional information to be added to an event.",e.jsx("br",{}),e.jsx("br",{}),"To use custom fields as a data source in an"," ",e.jsx(Bs,{search:"settings=automation__automations",children:"Automation"}),", please note the generated key.",e.jsx(se,{href:zn,children:"See the docs"})]})}),e.jsxs(E,{children:[n&&e.jsx(nn,{onSubmit:r,onCancel:l}),e.jsxs(_e,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Colour"}),e.jsx("th",{children:"Type"}),e.jsx("th",{children:"Name"}),e.jsx("th",{children:"Key (used in Automations)"}),e.jsx("th",{})]})}),e.jsx("tbody",{children:Object.entries(t).map(([o,{colour:h,label:m,type:d}])=>e.jsx(ml,{fieldKey:o,colour:h,label:m,type:d,onEdit:c,onDelete:u},o))})]})]})]})})}function jl(){const{data:t,status:s,isError:n,refetch:a,isFetching:i}=At({queryKey:ye,queryFn:za,placeholderData:(l,r)=>l,refetchInterval:$s});return{data:t??{loaded:"",rundowns:[]},status:s,isError:n,refetch:a,isFetching:i}}function an(){const t=Ft(),{mutateAsync:s}=Je({mutationFn:Ma,onMutate:()=>{t.cancelQueries({queryKey:ye})},onSuccess:r=>{t.setQueryData(ye,r.data)}}),{mutateAsync:n}=Je({mutationFn:Wa,onMutate:()=>{t.cancelQueries({queryKey:ye})},onSuccess:r=>{t.setQueryData(ye,r.data)}}),{mutateAsync:a}=Je({mutationFn:([r,c])=>Ua(r,c),onMutate:()=>{t.cancelQueries({queryKey:ye})},onSuccess:r=>{t.setQueryData(ye,r.data)}}),{mutateAsync:i}=Je({mutationFn:Ba,onMutate:()=>{t.cancelQueries({queryKey:ye})},onSuccess:r=>{t.setQueryData(ye,r.data)}}),{mutateAsync:l}=Je({mutationFn:qa,onMutate:()=>{t.cancelQueries({queryKey:ye})},onSuccess:r=>{t.setQueryData(ye,r.data)}});return{create:s,duplicate:n,remove:i,load:l,rename:a}}function pl({onSubmit:t,onCancel:s,initialTitle:n}){const{handleSubmit:a,register:i,setFocus:l,setError:r,formState:{errors:c,isSubmitting:u,isValid:o,isDirty:h}}=de({defaultValues:{title:n},mode:"onChange"}),m=async x=>{try{await t(x.title)}catch(j){r("root",{type:"custom",message:V(j)})}};p.useEffect(()=>{l("title")},[l]);const d=h&&o;return e.jsxs(Be,{as:"form",onSubmit:a(m),onKeyDown:x=>ke(x,s),children:[e.jsxs("label",{children:[e.jsx(ae,{children:"Rundown title"}),e.jsx(M,{...i("title",{required:{value:!0,message:"Title is required"},validate:x=>x.trim().length===0?"Title cannot be empty":qt.isAlphanumericWithSpace(x)===!1?"Title can only contain alphanumeric characters, spaces and underscores":!0}),fluid:!0}),c.title&&e.jsx(D,{children:c.title.message})]}),c.root&&e.jsx(D,{children:c.root.message}),e.jsxs(L,{relation:"inner",align:"end",children:[e.jsx(f,{variant:"ghosted",onClick:s,children:"Cancel"}),e.jsx(f,{type:"submit",variant:"primary",disabled:!d,loading:u,children:"Save"})]})]})}function gl({onClose:t}){const{create:s}=an(),{handleSubmit:n,register:a,setFocus:i,setError:l,formState:{errors:r,isSubmitting:c}}=de({defaultValues:{title:""}}),u=async o=>{try{await s(o.title||"untitled"),t()}catch(h){l("root",{message:`Failed to create rundown. ${h}`})}};return p.useEffect(()=>{i("title")},[i]),e.jsxs(Be,{as:"form",onSubmit:n(u),children:[e.jsx(E,{children:e.jsxs("label",{children:[e.jsx(ae,{children:"Rundown title"}),e.jsx(M,{...a("title"),fluid:!0,placeholder:"Your rundown name"})]})}),e.jsxs(L,{relation:"inner",align:"end",children:[e.jsx(f,{variant:"ghosted",disabled:c,onClick:t,children:"Cancel"}),e.jsx(f,{type:"submit",variant:"primary",disabled:c,children:"Create rundown"})]}),r.root&&e.jsx(D,{children:r.root.message})]})}function fl(){var A;const{data:t}=jl(),{duplicate:s,remove:n,load:a,rename:i}=an(),[l,r]=Ee(),[c,u]=Ee(),[o,h]=Ee(),[m,d]=p.useState(""),[x,j]=p.useState(null),[g,b]=p.useState(null),y=C=>{b(null),d(C),u.open()},w=C=>{b(null),d(C),r.open()},S=C=>{b(null),j(C)},O=async()=>{try{await a(m)}catch(C){b(`Failed to load rundown. ${V(C)}`)}finally{u.close()}},k=async C=>{b(null),j(null),d("");try{await s(C)}catch(H){b(`Failed to duplicate rundown. ${V(H)}`)}},R=async(C,H)=>{try{await i([C,H]),j(null)}catch(B){b(`Failed to rename rundown. ${V(B)}`)}},W=async()=>{try{await n(m)}catch(C){b(`Failed to delete rundown. ${V(C)}`)}finally{r.close()}},v=async(C,H)=>{await vr(C,H)};return e.jsxs(e.Fragment,{children:[e.jsx(E,{children:e.jsxs(ne,{children:[e.jsxs(J,{children:["Manage project rundowns",e.jsx(L,{children:e.jsxs(f,{onClick:()=>{b(null),h.open()},children:["New ",e.jsx(ge,{})]})})]}),e.jsx(le,{}),e.jsxs(E,{children:[o&&e.jsx(gl,{onClose:h.close}),g&&e.jsx(D,{children:g}),e.jsxs(_e,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"# Entries"}),e.jsx("th",{style:{width:"100%"},children:"Title"}),e.jsx("th",{})]})}),e.jsx("tbody",{children:(A=t==null?void 0:t.rundowns)==null?void 0:A.map(({id:C,numEntries:H,title:B})=>{const F=t.loaded===C;return x===C?e.jsx("tr",{children:e.jsx("td",{colSpan:3,children:e.jsx(pl,{onCancel:()=>j(null),onSubmit:I=>R(C,I),initialTitle:B})})},C):e.jsxs("tr",{className:Se([F&&jt.current]),children:[e.jsx("td",{children:H}),e.jsxs("td",{children:[B," ",F&&e.jsx(K,{children:"Loaded"})]}),e.jsx("td",{children:e.jsx(Gt,{render:e.jsx(Y,{variant:"ghosted-white"}),items:[{type:"item",icon:Ts,label:"Rename",onClick:()=>S(C)},{type:"item",icon:it,label:"Load",onClick:()=>y(C),disabled:F},{type:"item",icon:Ds,label:"Download .xlsx",onClick:()=>v(C,B)},{type:"item",icon:pn,label:"Duplicate",onClick:()=>k(C)},{type:"divider"},{type:"destructive",icon:pe,label:"Delete",onClick:()=>w(C),disabled:F}],children:e.jsx(Ps,{})})})]},C)})})]})]})]})}),e.jsx(xt,{isOpen:l,onClose:r.close,title:"Delete rundown",showBackdrop:!0,showCloseButton:!0,bodyElements:e.jsxs(e.Fragment,{children:["You will lose all data in your rundown. ",e.jsx("br",{})," Are you sure?"]}),footerElements:e.jsxs(e.Fragment,{children:[e.jsx(f,{size:"large",onClick:r.close,children:"Cancel"}),e.jsx(f,{variant:"destructive",size:"large",onClick:W,children:"Delete rundown"})]})}),e.jsx(xt,{isOpen:c,onClose:u.close,title:"Load rundown",showBackdrop:!0,showCloseButton:!0,bodyElements:e.jsxs(e.Fragment,{children:["The current playback will be stopped. ",e.jsx("br",{})," Are you sure?"]}),footerElements:e.jsxs(e.Fragment,{children:[e.jsx(f,{size:"large",onClick:u.close,children:"Cancel"}),e.jsx(f,{variant:"primary",size:"large",onClick:O,children:"Load rundown"})]})})]})}function bl(){const{defaultDuration:t,linkPrevious:s,defaultTimeStrategy:n,defaultWarnTime:a,defaultDangerTime:i,defaultTimerType:l,defaultEndAction:r,setDefaultDuration:c,setLinkPrevious:u,setTimeStrategy:o,setWarnTime:h,setDangerTime:m,setDefaultTimerType:d,setDefaultEndAction:x}=Us(y=>y),j=Ke(t),g=Ke(a),b=Ke(i);return e.jsx(E,{children:e.jsxs(ne,{children:[e.jsx(J,{children:"Rundown defaults"}),e.jsx(le,{}),e.jsxs(E,{children:[e.jsx(Ce,{children:"Default settings for new events"}),e.jsxs(ce,{children:[e.jsxs(U,{children:[e.jsx(z,{title:"Link previous",description:"Whether the start time of new events should be linked to the previous event end time"}),e.jsx(De,{size:"large",checked:s,onCheckedChange:u})]}),e.jsxs(U,{children:[e.jsx(z,{title:"Timer strategy",description:"Which time should be maintained when event schedule is recalculated"}),e.jsx(ie,{value:n,onValueChange:y=>{y!==null&&o(y)},options:[{value:hs.LockDuration,label:"Duration"},{value:hs.LockEnd,label:"End Time"}]})]})]}),e.jsxs(ce,{children:[e.jsxs(U,{children:[e.jsx(z,{title:"Default duration",description:"Default duration for new events"}),e.jsx(Ge,{name:"defaultDuration",submitHandler:(y,w)=>c(w),time:j,placeholder:nt.duration})]}),e.jsxs(U,{children:[e.jsx(z,{title:"Timer type",description:"Default type of timer for new events"}),e.jsx(ie,{value:l,onValueChange:y=>{y!==null&&d(y)},options:[{value:lt.CountDown,label:"Count down"},{value:lt.CountUp,label:"Count up"},{value:lt.Clock,label:"Clock"},{value:lt.None,label:"None"}]})]}),e.jsxs(U,{children:[e.jsx(z,{title:"End Action",description:"Default end action for new events"}),e.jsx(ie,{value:r,onValueChange:y=>{y!==null&&x(y)},options:[{value:_t.None,label:"None"},{value:_t.LoadNext,label:"Load next"},{value:_t.PlayNext,label:"Play next"}]})]})]}),e.jsxs(ce,{children:[e.jsxs(U,{children:[e.jsx(z,{title:"Warning time",description:"Default threshold for warning time in an event"}),e.jsx(Ge,{name:"warnTime",submitHandler:(y,w)=>h(w),time:g,placeholder:nt.warnTime})]}),e.jsxs(U,{children:[e.jsx(z,{title:"Danger time",description:"Default threshold for danger time in an event"}),e.jsx(Ge,{name:"dangerTime",submitHandler:(y,w)=>m(w),time:b,placeholder:nt.dangerTime})]})]})]})]})})}function yl({location:t}){const s=re("defaults",t),n=re("custom",t),a=re("rundowns",t),i=re("sheets",t);return e.jsxs(e.Fragment,{children:[e.jsx(Ve,{children:"Project data"}),e.jsx("div",{ref:s,children:e.jsx(bl,{})}),e.jsx("div",{ref:n,children:e.jsx(xl,{})}),e.jsx("div",{ref:a,children:e.jsx(fl,{})}),e.jsx("div",{ref:i,children:e.jsx(ol,{})})]})}const vl="_textEntry_1xa10_17",wl="_inlineEntry_1xa10_25",Sl="_redirect_1xa10_32",Cl="_label_1xa10_36",Oe={textEntry:vl,inlineEntry:wl,redirect:Sl,label:Cl};function _l({id:t,isOpen:s,name:n,currentPath:a,origin:i,onClose:l}){const{data:r}=As(),[c,u]=p.useState(a),[o,h]=p.useState("/"),{setRedirect:m}=Vs,d=g=>{g==="/"||g===a||(g.startsWith("preset-")?m({target:t,redirect:g.slice(7)}):m({target:t,redirect:g}),l())},x=r.filter(g=>g.enabled),j=[...Gn.map(g=>({value:`/${g.url}`,label:g.label})),...x.map(g=>({value:`preset-${g.alias}`,label:`URL Preset: ${g.alias}`}))];return e.jsx(xt,{isOpen:s,onClose:l,showCloseButton:!0,showBackdrop:!0,title:`Redirect: ${n}`,bodyElements:e.jsxs(e.Fragment,{children:[e.jsxs(xe,{children:["Remotely redirect the client to a different URL. ",e.jsx("br",{}),"Either by entering a custom path or selecting a URL Preset.",e.jsx("br",{}),e.jsx("br",{}),e.jsx(Bs,{search:"settings=sharing__presets",children:"Manage URL Presets"})]}),e.jsxs("div",{className:Oe.inlineEntry,children:[e.jsx("span",{className:Oe.label,children:"Enter custom path"}),e.jsxs("label",{className:Oe.textEntry,children:[i,e.jsx(M,{placeholder:"eg. /timer",fluid:!0,value:c,onChange:g=>u(g.target.value)})]}),e.jsxs(f,{variant:"primary","aria-label":"Redirect",disabled:c===a||c==="",className:Oe.redirect,onClick:()=>d(c),children:["Redirect",e.jsx(is,{})]})]}),e.jsxs("div",{children:[e.jsx("span",{className:Oe.label,children:"Select View or URL Preset"}),e.jsxs("div",{className:Oe.inlineEntry,children:[e.jsxs("label",{className:Oe.textEntry,children:[i,e.jsx(ie,{fluid:!0,options:j,defaultValue:j[0].value,onValueChange:g=>{g!==null&&h(g)},disabled:x.length===0})]}),e.jsxs(f,{variant:"primary","aria-label":"Redirect to preset",className:Oe.redirect,disabled:x.length===0||o==="/",onClick:()=>d(o),children:["Redirect ",e.jsx(is,{})]})]})]})]})})}const kl="_blink_vtewd_1",Nl="_halfWidthNoWrap_vtewd_25",Tl="_copiable_vtewd_30",Ot="_self_vtewd_35",tt={blink:kl,halfWidthNoWrap:Nl,copiable:Tl,self:Ot};function Dl(){const t=os(j=>j.id),s=os(j=>j.clients),[n,a]=Ee(),[i,l]=Ee(),{setIdentify:r}=Vs,[c,u]=p.useState(""),o=j=>{u(j),l.open()},h=j=>{u(j),a.open()},m=Object.entries(s).filter(([j,{type:g}])=>g==="ontime"),d=Object.entries(s).filter(([j,{type:g}])=>g!=="ontime"),x=s[c];return e.jsxs(e.Fragment,{children:[n&&x!==void 0&&e.jsx(_l,{id:c,name:x.name,origin:x.origin,currentPath:x.path,isOpen:n,onClose:a.close}),i&&e.jsx(Kn,{id:c,name:x==null?void 0:x.name,isOpen:i,onClose:l.close}),e.jsxs(E,{children:[e.jsxs(Ce,{children:["Ontime Clients (",m.length,")"]}),e.jsxs(_e,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:{width:"20%"},children:"Client Name"}),e.jsx("td",{children:"Path"}),e.jsx("td",{})]})}),e.jsx("tbody",{children:m.map(([j,g])=>{const{identify:b,name:y,path:w}=g,S=t===j;return e.jsxs("tr",{className:Se([S&&tt.self]),children:[e.jsxs(L,{relation:"inner",as:"td",children:[S&&e.jsx(K,{children:"SELF"}),y]}),e.jsx("td",{className:tt.copiable,children:w}),e.jsxs(L,{relation:"inner",as:"td",children:[e.jsx(f,{size:"small",className:`${b?tt.blink:""}`,disabled:S,variant:b?"primary":"subtle","data-testid":S?"":"not-self-identify",onClick:()=>{r({target:j,identify:!b})},children:"Identify"}),e.jsx(f,{size:"small","data-testid":S?"":"not-self-rename",onClick:()=>o(j),children:"Rename"}),e.jsx(f,{size:"small",disabled:S,"data-testid":S?"":"not-self-redirect",onClick:()=>h(j),children:"Redirect"})]})]},j)})})]})]}),e.jsx(le,{}),e.jsxs(E,{children:[e.jsxs(Ce,{children:["Other Clients (",d.length,")"]}),e.jsxs(_e,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:tt.halfWidthNoWrap,children:"Client Name"}),e.jsx("td",{className:tt.halfWidthNoWrap,children:"Client type"})]})}),e.jsx("tbody",{children:d.map(([j,g])=>{const{name:b,type:y}=g;return e.jsxs("tr",{children:[e.jsx("td",{children:b}),e.jsx("td",{children:y})]},j)})})]})]})]})}function Pl(){return e.jsx(E,{children:e.jsxs(ne,{children:[e.jsx(J,{children:"Manage clients"}),e.jsx(le,{}),e.jsx(Dl,{})]})})}const Rl="_iconRotate_l21m9_17",El={iconRotate:Rl};function Il(){const t=s=>{Fs("log",s)};return e.jsx(E,{children:e.jsxs(ne,{children:[e.jsxs(J,{children:["Event log",e.jsxs(f,{onClick:t,children:["Extract ",e.jsx(gt,{className:El.iconRotate})]})]}),e.jsx(le,{}),e.jsx(Hn,{})]})})}function Ll({location:t}){const s=re("clients",t),n=re("log",t);return e.jsxs(e.Fragment,{children:[e.jsx(Ve,{children:"Network"}),Qn,e.jsx("div",{ref:n,children:e.jsx(Il,{})}),e.jsx("div",{ref:s,children:e.jsx(Pl,{})})]})}const vs={project:{title:""},settings:{timeFormat:"24",language:"en"}};function Ol({isOpen:t,onClose:s}){var y,w,S,O;const{defaultWarnTime:n,defaultDangerTime:a,setDangerTime:i,setWarnTime:l}=Us(),{handleSubmit:r,register:c,formState:{errors:u,isSubmitting:o,isValid:h},watch:m,setError:d,setValue:x}=de({defaultValues:vs,values:vs,resetOptions:{keepDirtyValues:!0}}),j=async k=>{try{k.project.title===""&&(k.project.title="untitled"),await Ir(k),await Qe(),s()}catch(R){d("root",{message:V(R)})}},g=Ke(n),b=Ke(a);return e.jsx(Kt,{isOpen:t,onClose:s,showBackdrop:!0,showCloseButton:!0,title:"Create new project...",bodyElements:e.jsxs("form",{onSubmit:r(j),id:"quick-start",children:[e.jsxs(ce,{children:[e.jsxs(U,{children:[e.jsx(z,{title:"Project title",description:"Shown as the title in some views"}),e.jsx(M,{maxLength:150,placeholder:"Project title",fluid:!0,...c("project.title")})]}),e.jsxs(U,{children:[e.jsx(z,{title:"Time format",description:"Default time format to show in views 12 / 24 hours (does not affect editor)",error:(w=(y=u.settings)==null?void 0:y.timeFormat)==null?void 0:w.message}),e.jsx(ie,{value:m("settings.timeFormat"),onValueChange:k=>{k!==null&&x("settings.timeFormat",k,{shouldDirty:!0})},defaultValue:"24",options:[{value:"12",label:"12 hours 11:00:10 PM"},{value:"24",label:"24 hours 23:00:10"}]})]}),e.jsxs(U,{children:[e.jsx(z,{title:"Views language",description:"Language to be displayed in views",error:(O=(S=u.settings)==null?void 0:S.language)==null?void 0:O.message}),e.jsx(ie,{value:m("settings.language"),onValueChange:k=>{k!==null&&x("settings.language",k,{shouldDirty:!0})},defaultValue:"en",options:[{value:"en",label:"English"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"it",label:"Italian"},{value:"pt",label:"Portuguese"},{value:"es",label:"Spanish"}]})]})]}),e.jsxs(ce,{children:[e.jsxs(U,{children:[e.jsx(z,{title:"Warning time",description:"Default threshold for warning time in an event"}),e.jsx(Ge,{name:"warnTime",submitHandler:(k,R)=>l(R),time:g,placeholder:nt.warnTime})]}),e.jsxs(U,{children:[e.jsx(z,{title:"Danger time",description:"Default threshold for danger time in an event"}),e.jsx(Ge,{name:"dangerTime",submitHandler:(k,R)=>i(R),time:b,placeholder:nt.dangerTime})]})]})]}),footerElements:e.jsxs(e.Fragment,{children:[(u==null?void 0:u.root)&&e.jsx(D,{children:u.root.message}),e.jsx(f,{variant:"ghosted",onClick:s,disabled:!1,children:"Cancel"}),e.jsx(f,{variant:"primary",type:"submit",form:"quick-start",disabled:!h,loading:o,children:"Create project"})]})})}const Al="_current_13n43_17",Fl="_isEditing_13n43_21",$l="_form_13n43_25",Vl="_formInput_13n43_33",Ml="_saveButton_13n43_37",Wl="_containCell_13n43_41",Ul="_sortableHeader_13n43_45",Bl="_innerColumn_13n43_55",ql="_inlineLabels_13n43_63",zl="_warningInfo_13n43_68",Gl="_empty_13n43_72",me={current:Al,isEditing:Fl,form:$l,formInput:Vl,saveButton:Ml,containCell:Wl,sortableHeader:Ul,innerColumn:Bl,inlineLabels:ql,warningInfo:zl,empty:Gl};function Kl({onClose:t}){const[s,n]=p.useState(null),{handleSubmit:a,register:i,formState:{isSubmitting:l,isValid:r},setFocus:c}=de({defaultValues:{title:""},values:{title:""},resetOptions:{keepDirtyValues:!0}});p.useEffect(()=>{c("title")},[c]);const u=async o=>{try{n(null);const h=o.title??"untitled";await Er({filename:h}),t()}catch(h){n(V(h))}};return e.jsxs(Be,{as:"form",onSubmit:a(u),onKeyDown:o=>ke(o,t),children:[e.jsxs(Ce,{children:["Create new project",e.jsxs(L,{children:[e.jsx(f,{onClick:t,variant:"ghosted",disabled:l,children:"Cancel"}),e.jsx(f,{disabled:!r,type:"submit",loading:l,variant:"primary",children:"Create project"})]})]}),s&&e.jsx(D,{children:s}),e.jsxs(E,{className:me.innerColumn,children:[e.jsx(ae,{children:"Project title"}),e.jsx(M,{fluid:!0,placeholder:"Your project name",...i("title")})]})]})}const Hl={files:[],lastLoadedProject:""};function Ql(){const{data:t,status:s,refetch:n}=At({queryKey:Yn,queryFn:Lr,placeholderData:(a,i)=>a,retry:5,retryDelay:a=>a*2500,refetchInterval:$s,networkMode:"always"});return{data:t??Hl,status:s,refetch:n}}const Yl={"alphabetical-asc":(t,s)=>t.filename.localeCompare(s.filename),"alphabetical-desc":(t,s)=>s.filename.localeCompare(t.filename),"modified-asc":(t,s)=>new Date(t.updatedAt).getTime()-new Date(s.updatedAt).getTime(),"modified-desc":(t,s)=>new Date(s.updatedAt).getTime()-new Date(t.updatedAt).getTime()};function rn(t="modified-desc"){const s=Ql(),{files:n,lastLoadedProject:a}=s.data,i=p.useMemo(()=>{if(!n.length)return[];const l=[...n].sort(Yl[t]),r=l.findIndex(c=>c.filename===a);if(r>0){const[c]=l.splice(r,1);l.unshift(c)}return l},[n,a,t]);return{...s,data:{reorderedProjectFiles:i,lastLoadedProject:s.data.lastLoadedProject}}}function Jl({action:t,filename:s,onSubmit:n,onCancel:a}){const{handleSubmit:i,register:l,formState:{isSubmitting:r,isDirty:c,isValid:u},setFocus:o}=de({defaultValues:{filename:s},values:{filename:s},resetOptions:{keepDirtyValues:!0}});return p.useEffect(()=>{o("filename")},[o]),e.jsxs("form",{onSubmit:i(n),onKeyDown:h=>ke(h,a),className:me.form,children:[e.jsx(M,{className:me.formInput,id:"filename",placeholder:"Enter new name",...l("filename",{required:!0})}),e.jsxs(L,{relation:"inner",children:[e.jsx(f,{onClick:a,variant:"ghosted",disabled:r,children:"Cancel"}),e.jsx(f,{variant:"primary",disabled:!c||!u||r,type:"submit",className:me.saveButton,children:t})]})]})}async function Xl(t,s){const n={};for(const a in s)Ga(a,t)&&s[a]&&(a==="rundowns"&&(n.customFields=t.customFields),Object.assign(n,{[a]:t[a]}));return n}function Zl({onClose:t,fileName:s}){const[n,a]=p.useState(null),i=Ft(),{handleSubmit:l,watch:r,setValue:c,formState:{isSubmitting:u,isValid:o,isDirty:h}}=de({defaultValues:{project:!1,rundowns:!1,viewSettings:!1,urlPresets:!1,automation:!1},resetOptions:{keepDirtyValues:!0}}),m=async d=>{if(Object.values(d).every(j=>!j)){a("At least one option must be selected");return}try{a(null);const{data:j}=await Zs(s);if(!j.settings.version.startsWith("4.")){a("The project you are attempting to merge is from an older version and it need to be migrated first");return}const g=await Xl(j,d);await tn(g),await i.invalidateQueries({queryKey:Jn}),t()}catch(j){a(V(j))}};return e.jsxs(E,{as:"form",onSubmit:l(m),children:[e.jsxs(Ce,{children:["Partial project merge",e.jsxs(L,{children:[e.jsx(f,{onClick:t,variant:"ghosted",disabled:u,children:"Cancel"}),e.jsx(f,{type:"submit",disabled:!o||!h,loading:u,variant:"primary",children:"Merge"})]})]}),n&&e.jsx(D,{children:n}),e.jsxs(E,{className:Se([me.innerColumn,me.inlineLabels]),children:[e.jsxs(ae,{children:["Select data from ",e.jsx("i",{children:`"${s}"`})," to merge into the current project."]}),e.jsxs(xe,{type:"warning",children:["This process is irreversible and can result in data loss. ",e.jsx("br",{}),"You may want to create a duplicate backup beforehand."]}),e.jsxs("label",{children:[e.jsx(De,{size:"large",checked:r("project"),onCheckedChange:d=>c("project",d,{shouldDirty:!0})}),"Project data"]}),e.jsxs("label",{children:[e.jsx(De,{size:"large",checked:r("rundowns"),onCheckedChange:d=>c("rundowns",d,{shouldDirty:!0})}),"Rundown + Custom Fields"]}),e.jsxs("label",{children:[e.jsx(De,{size:"large",checked:r("viewSettings"),onCheckedChange:d=>c("viewSettings",d,{shouldDirty:!0})}),"View Settings"]}),e.jsxs("label",{children:[e.jsx(De,{size:"large",checked:r("urlPresets"),onCheckedChange:d=>c("urlPresets",d,{shouldDirty:!0})}),"URL Presets"]}),e.jsxs("label",{children:[e.jsx(De,{size:"large",checked:r("automation"),onCheckedChange:d=>c("automation",d,{shouldDirty:!0})}),"Automation Settings"]})]})]})}function eo({current:t,updatedAt:s,editingFilename:n,editingMode:a,filename:i,onRefetch:l,onSubmit:r,onToggleEditMode:c}){const[u,o]=p.useState(null),[h,m]=p.useState(!1),d=k=>async R=>{m(!0),o(null);try{if(!R.filename){o("Filename cannot be blank");return}await(k==="rename"?Fr:Ar)(i,R.filename),await l(),r()}catch(W){o(V(W))}finally{m(!1)}},x=async k=>{m(!0),o(null);try{await sn(k),await l(),await Qe()}catch(R){o(V(R))}finally{m(!1)}},j=async k=>{m(!0),o(null);try{await $r(k),await l()}catch(R){o(V(R))}finally{m(!1)}},g=(k,R)=>{o(null),c(k,R)},b=()=>{g(null,null)},y=i===n,w=(a==="rename"||a==="duplicate")&&i===n,S=a==="merge"&&y,O=Se([t&&!y&&me.current,y&&me.isEditing]);return e.jsxs(e.Fragment,{children:[u&&e.jsx("tr",{children:e.jsx("td",{colSpan:99,children:e.jsx(D,{children:u})})},"filename-error"),e.jsx("tr",{className:O,children:w?e.jsx("td",{colSpan:99,children:e.jsx(Jl,{action:a,filename:i,onSubmit:d(a==="duplicate"?"duplicate":"rename"),onCancel:b})}):e.jsxs(e.Fragment,{children:[e.jsx("td",{className:me.containCell,children:i}),e.jsx("td",{children:t?"Currently loaded":new Date(s).toLocaleString()}),e.jsx("td",{children:e.jsx(to,{current:t,filename:i,onChangeEditMode:g,onDelete:j,onLoad:x,isDisabled:h||S,onMerge:k=>g("merge",k)})})]})},i),S&&e.jsx("tr",{children:e.jsx("td",{colSpan:99,children:e.jsx(Zl,{onClose:b,fileName:i})})})]})}function to(t){const{current:s,filename:n,isDisabled:a,onChangeEditMode:i,onDelete:l,onLoad:r,onMerge:c}=t,u=()=>{i("rename",n)},o=()=>{i("duplicate",n)},h=async()=>{await Rr(n)};return e.jsx(Gt,{render:e.jsx(Y,{variant:"ghosted-white"}),disabled:a,items:[{type:"item",icon:it,label:"Load",onClick:()=>r(n),disabled:s},{type:"item",icon:it,label:"Partial Load",onClick:()=>c(n),disabled:s},{type:"item",icon:Ts,label:"Rename",onClick:u},{type:"item",icon:gn,label:"Duplicate",onClick:o},{type:"item",icon:Ds,label:"Download",onClick:h},{type:"divider"},{type:"item",icon:pe,label:"Delete",onClick:()=>l(n),disabled:s}],children:e.jsx(Ps,{})})}function so(){const[t,s]=p.useState(null),[n,a]=p.useState(null),[i,l]=p.useState("modified-desc"),{data:r,refetch:c,status:u}=rn(i),o=(j,g)=>{s(b=>b===j&&g===n?null:j),a(g)},h=()=>{s(null),a(null)},m=async()=>{await c()},d=j=>{l(g=>{const b=g===`${j}-asc`;return`${j}-${b?"desc":"asc"}`})};if(u==="pending")return e.jsx("div",{className:me.empty,children:e.jsx(Ue,{isLoading:!0})});const x=r.reorderedProjectFiles.length;return e.jsxs(e.Fragment,{children:[x>20&&e.jsxs(xe,{className:me.warningInfo,type:"warning",children:["You have ",x," projects. Consider deleting unused projects to improve performance."]}),e.jsxs(_e,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:me.containCell,onClick:()=>d("alphabetical"),children:e.jsxs("span",{className:me.sortableHeader,children:["File Name",e.jsx(ws,{sortMode:i,type:"alphabetical"})]})}),e.jsx("th",{onClick:()=>d("modified"),children:e.jsxs("span",{className:me.sortableHeader,children:["Last Used",e.jsx(ws,{sortMode:i,type:"modified"})]})}),e.jsx("th",{})]})}),e.jsx("tbody",{children:r.reorderedProjectFiles.map(j=>e.jsx(eo,{filename:j.filename,updatedAt:j.updatedAt,onToggleEditMode:o,onSubmit:h,onRefetch:m,editingFilename:n,editingMode:t,current:j.filename===r.lastLoadedProject},j.filename))})]})]})}function ws({sortMode:t,type:s}){const n=`${s}-`;return t===`${n}asc`?e.jsx(Rs,{}):t===`${n}desc`?e.jsx(gt,{}):null}function no(){const[t,s]=fn(),[n,a]=p.useState(""),[i,l]=p.useState(null),r=p.useRef(null),c=t.get("new")==="true",u=()=>{t.set("new",c?"false":"true"),s(t)},o=()=>{var d;(d=r.current)==null||d.click()},h=async d=>{var j,g;const x=(g=(j=d.target)==null?void 0:j.files)==null?void 0:g[0];if(x){l("import");try{Xs(x),await en(x)}catch(b){const y=V(b);a(`Error uploading file: ${y}`)}finally{await Qe()}l(null)}},m=()=>{t.delete("new"),s(t)};return e.jsxs(E,{children:[e.jsx("input",{ref:r,style:{display:"none"},type:"file",onChange:h,accept:".json","data-testid":"file-input"}),e.jsxs(ne,{children:[e.jsxs(J,{children:["Manage projects",e.jsxs(L,{children:[e.jsx(f,{onClick:o,disabled:!!i||c,loading:i==="import",children:"Import"}),e.jsxs(f,{onClick:u,disabled:!!i||c,children:["New ",e.jsx(ge,{})]})]})]}),n&&e.jsx(D,{children:n}),e.jsx(le,{}),c&&e.jsx(Kl,{onClose:m}),e.jsx(so,{})]})]})}function ao({location:t,setLocation:s}){const n=re("list",t),a=()=>{s("project")};return e.jsxs(e.Fragment,{children:[e.jsx(Ve,{children:"Project"}),e.jsx(Ol,{isOpen:t==="create",onClose:a}),e.jsx("div",{ref:n,children:e.jsx(no,{})})]})}const io="_container_cq029_17",ro={container:io};function Ss({register:t,formName:s,disabled:n}){const[a,i]=p.useState(!1);return e.jsxs("div",{className:ro.container,children:[e.jsx(M,{type:a?"text":"password",maxLength:4,...t(s,{pattern:{value:Ea,message:"Only alphanumeric characters are allowed"}}),placeholder:"-",disabled:n}),e.jsx(Y,{onMouseDown:()=>i(!0),onMouseUp:()=>i(!1),variant:"ghosted","aria-label":"Show pin code",children:e.jsx(bn,{})})]})}const lo=p.lazy(()=>rt(()=>import("./CustomTranslationModal-0ROtCxPC.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url));function oo(){var k,R,W,v,A;const{data:t,status:s,refetch:n}=Xn(),{handleSubmit:a,register:i,reset:l,setError:r,watch:c,setValue:u,formState:{isSubmitting:o,isDirty:h,isValid:m,errors:d}}=de({mode:"onChange",defaultValues:t,values:t,resetOptions:{keepDirtyValues:!0}}),[x,j]=Ee();p.useEffect(()=>{t&&l(t)},[t,l]);const g=async C=>{try{await Zn(C)}catch(H){const B=V(H);r("root",{message:B})}finally{await n()}},b=s==="pending",y=o||!h||!m,w="",S=()=>{l(t)},O=s==="pending";return e.jsxs(e.Fragment,{children:[e.jsx(lo,{isOpen:x,onClose:j.close}),e.jsx(E,{as:"form",onSubmit:a(g),onKeyDown:C=>ke(C,S),id:"app-settings",children:e.jsxs(ne,{children:[e.jsxs(J,{children:["General settings",e.jsxs(L,{children:[e.jsx(f,{disabled:!h||o,variant:"ghosted",onClick:S,children:"Revert to saved"}),e.jsx(f,{type:"submit",form:"app-settings",name:"general-settings-submit",loading:o,disabled:y,variant:"primary",children:"Save"})]})]}),w,e.jsx(le,{}),e.jsxs(E,{children:[e.jsx(xe,{children:"Changes to the time format and views language do not affect the editor view"}),e.jsx(Ue,{isLoading:O}),e.jsxs(ce,{children:[e.jsxs(U,{children:[e.jsx(z,{title:"Ontime server port",description:He?"Server port disabled for Ontime Cloud":"Port ontime server listens in. Defaults to 4001 (needs app restart)",error:(k=d.serverPort)==null?void 0:k.message}),e.jsx(M,{id:"serverPort",type:"number",maxLength:5,style:{width:"75px"},disabled:He,...i("serverPort",{required:{value:!0,message:"Required field"},max:{value:65535,message:"Port must be within range 1024 - 65535"},min:{value:1024,message:"Port must be within range 1024 - 65535"},pattern:{value:Ms,message:"Value should be numeric"}})})]}),e.jsxs(U,{children:[e.jsx(z,{title:"Editor pin code",description:"Protect the editor view with a pin code",error:(R=d.editorKey)==null?void 0:R.message}),e.jsx(Ss,{register:i,formName:"editorKey",disabled:b})]}),e.jsxs(U,{children:[e.jsx(z,{title:"Operator pin code",description:"Protect the operator and cuesheet views with a pin code",error:(W=d.operatorKey)==null?void 0:W.message}),e.jsx(Ss,{register:i,formName:"operatorKey",disabled:b})]}),e.jsxs(U,{children:[e.jsx(z,{title:"Time format",description:"Default time format to show in views 12 / 24 hours",error:(v=d.timeFormat)==null?void 0:v.message}),e.jsx(ie,{value:c("timeFormat"),onValueChange:C=>{C!==null&&u("timeFormat",C,{shouldDirty:!0})},defaultValue:"24",options:[{value:"12",label:"12 hours 11:00:10 PM"},{value:"24",label:"24 hours 23:00:10"}]})]}),e.jsxs(U,{children:[e.jsx(z,{title:"Views language",description:"Language to be displayed in views",error:(A=d.language)==null?void 0:A.message}),e.jsx(ie,{value:c("language"),onValueChange:C=>{C!==null&&u("language",C,{shouldDirty:!0})},disabled:b,defaultValue:"en",options:[{value:"en",label:"English"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"it",label:"Italian"},{value:"pt",label:"Portuguese"},{value:"es",label:"Spanish"},{value:"custom",label:"Custom"}]}),e.jsx(f,{onClick:j.open,children:"Edit custom translation"})]})]})]})]})})]})}const co="_uploadLogoCard_m5263_17",uo="_customDataItem_m5263_32",ho="_titleRow_m5263_39",mo="_customImage_m5263_48",xo="_imageContainer_m5263_54",ze={uploadLogoCard:co,customDataItem:uo,titleRow:ho,customImage:mo,imageContainer:xo};function jo(){var B;const{data:t,status:s}=si(),{updateProjectData:n}=ni(),{handleSubmit:a,register:i,reset:l,formState:{isSubmitting:r,isValid:c,isDirty:u,errors:o},setError:h,clearErrors:m,watch:d,control:x,setValue:j}=de({defaultValues:t,resetOptions:{keepDirtyValues:!0},mode:"onChange"}),{fields:g,append:b,remove:y}=ht({control:x,name:"custom"});p.useEffect(()=>{t&&l(t)},[t,l]);const w=async F=>{var I;const P=(I=F.target.files)==null?void 0:I[0];if(m("logo"),!!P)try{Pr(P);const T=await ai(P);j("logo",T.data.logoFilename,{shouldDirty:!0})}catch(T){const G=V(T);h("logo",{message:G})}},{ref:S,...O}=i("logo"),k=p.useRef(null),R=()=>{var F;(F=k.current)==null||F.click()},W=F=>{F.preventDefault(),F.stopPropagation(),j("logo",null,{shouldDirty:!0})},v=()=>{b({title:"",value:"",url:""})},A=async F=>{try{m(),await n(F)}catch(P){const I=V(P);h("root",{message:I})}},C=()=>{l(t)},H=s==="pending";return e.jsx(E,{as:"form",onSubmit:a(A),onKeyDown:F=>ke(F,C),children:e.jsxs(ne,{children:[e.jsxs(J,{children:["Project data",e.jsxs(L,{children:[e.jsx(f,{onClick:C,disabled:r||!u,children:"Revert to saved"}),e.jsx(f,{variant:"primary",type:"submit",disabled:!u||!c,loading:r,children:"Save"})]})]}),e.jsx(le,{}),e.jsxs(E,{children:[e.jsx(Ue,{isLoading:H}),e.jsxs("label",{children:["Project title",e.jsx(M,{fluid:!0,maxLength:50,placeholder:"Project title is shown in production views",...i("title")})]}),e.jsx(E,{style:{marginTop:0},children:e.jsxs("label",{children:["Project logo",e.jsx("input",{type:"file",style:{display:"none"},accept:"image/*",...O,ref:F=>{S(F),k.current=F},onChange:w}),e.jsxs(ne,{className:ze.uploadLogoCard,children:[d("logo")?e.jsxs(e.Fragment,{children:[e.jsx("img",{src:`${ea}/${d("logo")}`}),e.jsxs(f,{variant:"subtle-destructive",disabled:r||!d("logo"),onClick:W,children:[e.jsx(pe,{}),"Delete"]})]}):e.jsxs(f,{disabled:r,onClick:R,type:"button",children:[e.jsx(it,{}),"Upload logo"]}),((B=o==null?void 0:o.logo)==null?void 0:B.message)&&e.jsx(D,{children:o.logo.message})]})]})}),e.jsxs("label",{children:["Project description",e.jsx(M,{fluid:!0,maxLength:100,placeholder:"Euro Love, Malmö 2024",...i("description")})]}),e.jsxs("label",{children:["Project info",e.jsx(Et,{fluid:!0,maxLength:150,placeholder:"Wi-Fi password: 1234",resize:"vertical",...i("info")})]}),e.jsxs("label",{children:["Project QR code URL",e.jsx(M,{fluid:!0,placeholder:Mt,...i("url")})]}),e.jsxs(E,{style:{marginTop:0},children:[e.jsxs(U,{children:[e.jsx(z,{title:"Custom data",description:""}),e.jsxs(f,{onClick:v,children:["Add ",e.jsx(ge,{})]})]}),g.length>0&&g.map((F,P)=>{var T,G,$;const I=(T=o.custom)==null?void 0:T[P];return e.jsxs("div",{className:ze.customDataItem,children:[e.jsxs("div",{className:ze.titleRow,children:[e.jsxs("label",{className:ze.title,children:["Title",e.jsx(M,{fluid:!0,defaultValue:F.title,placeholder:"Title of your custom data",...i(`custom.${P}.title`,{required:{value:!0,message:"Field cannot be empty"}})})]}),e.jsxs(f,{variant:"subtle-destructive",onClick:()=>y(P),children:[e.jsx(pe,{}),"Delete"]})]}),((G=I==null?void 0:I.title)==null?void 0:G.message)&&e.jsx(D,{children:I.title.message}),e.jsxs("label",{children:["Text",e.jsx(Et,{fluid:!0,rows:3,resize:"vertical",defaultValue:F.value,placeholder:"Text of your custom data",...i(`custom.${P}.value`,{required:{value:!0,message:"Field cannot be empty"}})}),(($=I==null?void 0:I.value)==null?void 0:$.message)&&e.jsx(D,{children:I.value.message})]}),e.jsxs("label",{children:["Image URL (optional)",e.jsxs("div",{className:ze.customImage,children:[e.jsx(M,{fluid:!0,defaultValue:F.url,placeholder:"Paste image URL (optional)",...i(`custom.${P}.url`)}),e.jsx("div",{className:ze.imageContainer,children:d(`custom.${P}.url`)&&e.jsx("img",{src:d(`custom.${P}.url`),alt:"",loading:"lazy",className:"info__image"})})]})]})]},F.id)})]})]})]})})}const po="_editorActions_18rtd_17",go="_right_18rtd_21",fo="_column_18rtd_26",Nt={editorActions:po,right:go,column:fo},bo=p.lazy(()=>rt(()=>import("./StyleEditor-DcyJgmAF.js"),__vite__mapDeps([13,1,2,14]),import.meta.url));function yo({isOpen:t,onClose:s}){const[n,a]=p.useState(""),[i,l]=p.useState(!1),[r,c]=p.useState(!1),[u,o]=p.useState(!1),[h,m]=p.useState(null),d=p.useRef(null),x=async()=>{try{o(!0);const b=await ta();a(b)}catch{}finally{o(!1)}},j=async()=>{try{c(!0),d.current&&(await sa(d.current.getCss()),a(d.current.getCss()),l(!1))}catch{}finally{c(!1)}},g=()=>a("");return p.useEffect(()=>{async function b(){if(t)try{const y=await na();a(y)}catch{m("Failed to load CSS from server")}}b()},[t]),e.jsx(Kt,{title:"Edit CSS override",isOpen:t,onClose:s,showCloseButton:!0,showBackdrop:!0,bodyElements:e.jsx(bo,{ref:d,initialValue:n,language:"css",isDirty:i,setIsDirty:l}),footerElements:e.jsxs("div",{className:Nt.column,children:[e.jsx(xe,{children:"Invalid CSS will be refused by the browser"}),h&&e.jsx(D,{className:Nt.right,children:`Error: ${h}`}),e.jsxs(L,{align:"apart",className:Nt.editorActions,children:[e.jsx(f,{variant:"ghosted",size:"large",onClick:x,disabled:r||u,children:"Reset to example"}),e.jsxs(L,{children:[e.jsx(f,{variant:"ghosted",size:"large",onClick:g,children:"Clear"}),e.jsx(f,{size:"large",onClick:s,children:"Cancel"}),e.jsx(f,{variant:"primary",size:"large",onClick:j,disabled:r||u||!i,loading:r,children:"Save changes"})]})]})]})})}const vo="https://docs.getontime.no/features/custom-styling/";function wo(){var b;const{data:t,status:s,mutateAsync:n}=aa(),[a,i]=Ee(),{control:l,handleSubmit:r,setError:c,reset:u,setValue:o,watch:h,formState:{isSubmitting:m,isDirty:d,errors:x}}=de({defaultValues:t,values:t,resetOptions:{keepDirtyValues:!0}});p.useEffect(()=>{t&&u(t)},[t,u]);const j=async y=>{try{n(y)}catch(w){const S=V(w);c("root",{message:S})}},g=()=>{u(t)};return l?e.jsx(E,{as:"form",onSubmit:r(j),onKeyDown:y=>ke(y,g),id:"view-settings",children:e.jsxs(ne,{children:[e.jsxs(J,{children:["View settings",e.jsxs(L,{children:[e.jsx(f,{disabled:!d,variant:"ghosted",onClick:g,children:"Revert to saved"}),e.jsx(f,{type:"submit",loading:m,disabled:!d,variant:"primary",children:"Save"})]})]}),e.jsx(le,{}),e.jsxs(xe,{children:["You can customise the styles applied to Ontime views by providing overriding CSS rules.",e.jsx("br",{}),e.jsx(se,{href:vo,children:"See the docs"})]}),e.jsxs(E,{children:[e.jsx(Ue,{isLoading:s==="pending"}),e.jsx(D,{children:(b=x.root)==null?void 0:b.message}),e.jsxs(ce,{children:[e.jsx(yo,{isOpen:a,onClose:i.close}),e.jsxs(U,{children:[e.jsx(z,{title:"Override CSS styles",description:"Enables overriding view styles with custom stylesheet"}),e.jsx(De,{size:"large",checked:h("overrideStyles"),onCheckedChange:y=>o("overrideStyles",y,{shouldDirty:!0})}),e.jsx(f,{onClick:i.open,disabled:m,children:"Edit CSS override"})]})]}),e.jsxs(ce,{children:[e.jsxs(U,{children:[e.jsx(z,{title:"Timer colour",description:"Default colour of a running timer"}),e.jsx(Ct,{name:"normalColor",control:l})]}),e.jsxs(U,{children:[e.jsx(z,{title:"Warning colour",description:"Colour of a running timer in warning mode"}),e.jsx(Ct,{name:"warningColor",control:l})]}),e.jsxs(U,{children:[e.jsx(z,{title:"Danger colour",description:"Colour of a running timer in danger mode"}),e.jsx(Ct,{name:"dangerColor",control:l})]})]})]})]})}):null}function So({location:t}){const s=re("data",t),n=re("general",t),a=re("view",t);return e.jsxs(e.Fragment,{children:[e.jsx(Ve,{children:"Settings"}),e.jsx("div",{ref:s,children:e.jsx(jo,{})}),e.jsx("div",{ref:n,children:e.jsx(oo,{})}),e.jsx("div",{ref:a,children:e.jsx(wo,{})})]})}function Co(){const{isElectron:t,sendToElectron:s}=ia(),[n,a]=Ee(),i=p.useRef(null),l=()=>{s("shutdown","now"),a.close()},r=t||mt;return e.jsxs(e.Fragment,{children:[e.jsx(Ve,{children:"Shutdown Ontime"}),e.jsxs(E,{children:[He?e.jsx(ra,{children:"For security reasons, shutting down the server must be done from the Ontime Cloud dashboard."}):e.jsxs(Ie,{children:["This will shutdown the Ontime server. ",e.jsx("br",{}),"The runtime state will be lost, but your project is kept for next time."]}),e.jsx(f,{variant:"destructive",onClick:a.open,disabled:!(t||mt),children:"Shutdown ontime"}),!r&&e.jsx(ae,{children:"Note: Ontime can only be shutdown from the machine it is running in."}),e.jsx(xt,{isOpen:n,title:"Shutdown Ontime",showCloseButton:!0,onClose:a.close,bodyElements:e.jsxs(Ie,{children:["This will shutdown the Ontime server. ",e.jsx("br",{})," Are you sure?"]}),footerElements:e.jsxs(e.Fragment,{children:[e.jsx(f,{ref:i,onClick:a.close,variant:"ghosted-white",children:"Cancel"}),e.jsx(f,{variant:"destructive",onClick:l,disabled:!r,children:"Shutdown"})]})})]})]})}const _o="_corner_1dxip_17",ko="_contentWrapper_1dxip_24",No="_content_1dxip_24",Tt={corner:_o,contentWrapper:ko,content:No};function To({onClose:t,children:s}){return e.jsxs("div",{className:Tt.contentWrapper,children:[e.jsx("div",{className:Tt.content,children:s}),e.jsx("div",{className:Tt.corner,children:e.jsxs(f,{size:"large",onClick:t,children:["Close settings ",e.jsx($t,{})]})})]})}const Do=[{id:"settings",label:"Settings",secondary:[{id:"settings__data",label:"Project data"},{id:"settings__general",label:"General settings"},{id:"settings__view",label:"View settings"}]},{id:"project",label:"Project",split:!0,secondary:[{id:"project__create",label:"Create..."},{id:"project__list",label:"Manage projects"}]},{id:"manage",label:"Project settings",secondary:[{id:"manage__defaults",label:"Rundown defaults"},{id:"manage__custom",label:"Custom fields"},{id:"manage__rundowns",label:"Manage rundowns"},{id:"manage__sheets",label:"Import spreadsheet"},{id:"manage__sheets",label:"Sync with Google Sheet"}]},{id:"automation",label:"Automation",split:!0,secondary:[{id:"automation__settings",label:"Automation settings"},{id:"automation__automations",label:"Manage automations"},{id:"automation__triggers",label:"Manage triggers"}]},{id:"sharing",label:"Sharing and reporting",split:!0,secondary:[{id:"sharing__presets",label:"URL Presets"},{id:"sharing__link",label:"Share link"},{id:"sharing__report",label:"Runtime report"}]},{id:"network",label:"Network",split:!0,secondary:[{id:"network__log",label:"Event log"},{id:"network__clients",label:"Manage clients"}]},{id:"about",label:"About",split:!0},{id:"shutdown",label:"Shutdown",split:!0}];function Po(){const{data:t}=Qs();return{options:p.useMemo(()=>Do.map(n=>({...n,highlight:n.id==="about"&&t.hasUpdates?"New version available":void 0})),[t])}}const Ro="_tabs_86c70_17",Eo="_primary_86c70_31",Io="_secondary_86c70_32",Lo="_active_86c70_54",Oo="_highlight_86c70_58",Ao="_split_86c70_68",Me={tabs:Ro,primary:Eo,secondary:Io,active:Lo,highlight:Oo,split:Ao};function Fo({selectedPanel:t,location:s}){const{options:n}=Po();return e.jsx("ul",{className:Me.tabs,children:n.map(a=>{const i=t===a.id;return a.highlight?e.jsx(Yt,{text:a.highlight,render:e.jsx("span",{}),children:e.jsx(Cs,{panel:a,location:s,isSelected:i})},a.id):e.jsx(Cs,{panel:a,location:s,isSelected:i},a.id)})})}function Cs(t){var r;const{panel:s,isSelected:n,location:a}=t,{setLocation:i}=Jt(),l=Se([Me.primary,n&&Me.active,s.split&&Me.split,s.highlight&&Me.highlight]);return e.jsxs(p.Fragment,{children:[e.jsx("li",{onClick:()=>i(s.id),onKeyDown:c=>{cs(c)&&i(s.id)},className:l,tabIndex:0,role:"button",children:s.label},s.id),(r=s.secondary)==null?void 0:r.map((c,u)=>{const o=c.id.split("__")[1],h=Se([Me.secondary,n&&a===o?Me.active:null]);return e.jsx("li",{onClick:()=>i(c.id),onKeyDown:m=>{cs(m)&&i(c.id)},className:h,role:"button",children:c.label},c.id+u)})]},s.id)}const $o="_container_1fy3l_17",Vo={container:$o};function Mo(){const{close:t,panel:s,location:n,setLocation:a}=Jt();return xi(t,"Escape"),e.jsx("div",{className:Vo.container,children:e.jsxs(yn,{children:[e.jsx(Fo,{selectedPanel:s,location:n}),e.jsxs(To,{onClose:t,children:[s==="settings"&&e.jsx(So,{location:n}),s==="project"&&e.jsx(ao,{location:n,setLocation:a}),s==="manage"&&e.jsx(yl,{location:n}),s==="automation"&&e.jsx(Xi,{location:n}),s==="sharing"&&e.jsx(fr,{location:n}),s==="network"&&e.jsx(Ll,{location:n}),s==="about"&&e.jsx(bi,{}),s==="shutdown"&&e.jsx(Co,{})]})]})})}const Wo=p.memo(Uo);function Uo({children:t}){const{layoutMode:s}=Xt();return e.jsxs(oi,{navElements:t,children:[s===we.PLANNING&&e.jsx(Bo,{}),s===we.TRACKING&&e.jsx(qo,{}),s===we.CONTROL&&e.jsx(zo,{})]})}function Bo(){return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:es.inline,children:[e.jsx(Hs,{}),e.jsx(ri,{}),e.jsx(li,{})]}),e.jsx(Zt,{})]})}function qo(){return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:es.inline,children:[e.jsx(qs,{}),e.jsx(zs,{}),e.jsx(Gs,{})]}),e.jsx(Ks,{}),e.jsx(Zt,{})]})}function zo(){return e.jsxs(e.Fragment,{children:[e.jsx(Hs,{}),e.jsxs("div",{className:es.inline,children:[e.jsx(qs,{}),e.jsx(zs,{}),e.jsx(Gs,{})]}),e.jsx(Ks,{}),e.jsx(Zt,{})]})}function Go({onFinish:t}){const s=p.useRef(null),n=()=>{var i;(i=s.current)==null||i.click()},a=async i=>{var r,c;const l=(c=(r=i.target)==null?void 0:r.files)==null?void 0:c[0];if(l)try{Xs(l),await en(l)}catch{}finally{await Qe(),t()}};return e.jsxs(e.Fragment,{children:[e.jsx("input",{ref:s,style:{display:"none"},type:"file",onChange:a,accept:".json","data-testid":"file-input"}),e.jsx(f,{onClick:n,children:"Import project"})]})}const Ko="_sections_ar7bf_17",Ho="_column_ar7bf_23",Qo="_about_ar7bf_23",Yo="_inline_ar7bf_35",Jo="_header_ar7bf_41",Xo="_logo_ar7bf_48",Zo="_buttonRow_ar7bf_53",ec="_tableContainer_ar7bf_62",tc="_table_ar7bf_62",sc="_current_ar7bf_75",ve={sections:Ko,column:Ho,about:Qo,inline:Yo,header:Jo,logo:Xo,buttonRow:Zo,tableContainer:ec,table:tc,current:sc};function nc(t){const{loadProject:s,onClose:n}=t,{data:a}=rn();return e.jsx("tbody",{children:a.reorderedProjectFiles.map(i=>i.filename===a.lastLoadedProject?e.jsxs("tr",{className:ve.current,onClick:n,children:[e.jsx("td",{children:i.filename}),e.jsx("td",{children:"Loaded from last session"})]},i.filename):e.jsxs("tr",{onClick:()=>s(i.filename),children:[e.jsx("td",{children:i.filename}),e.jsx("td",{children:new Date(i.updatedAt).toLocaleString()})]},i.filename))})}function ac({onClose:t}){const s=vn(),n=async l=>{try{await sn(l),await Qe(),t()}catch{}},a=async()=>{try{await Or(),await Qe(),t()}catch{}},i=()=>{s("/editor?settings=project__create"),t()};return e.jsx(Kt,{isOpen:!0,onClose:()=>t(),showBackdrop:!0,bodyElements:e.jsxs("div",{className:ve.sections,children:[e.jsxs("div",{className:ve.about,children:[e.jsx("img",{src:"ontime-logo.png",alt:"ontime",className:ve.logo}),e.jsxs("div",{children:["Ontime v",ut]}),e.jsx(se,{href:Pt,children:"Website"}),e.jsx(se,{href:Mt,children:"Read the docs"}),e.jsx(se,{href:Is,children:"Discord server"})]}),e.jsxs("div",{className:ve.column,children:[e.jsxs("div",{className:ve.header,children:["Welcome to Ontime",e.jsx(Y,{"aria-label":"close welcome modal",variant:"subtle-white",onClick:()=>t(),children:e.jsx($t,{})})]}),e.jsx(ti,{children:"Select project"}),e.jsx("div",{className:ve.tableContainer,children:e.jsxs("table",{className:ve.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"File Name"}),e.jsx("th",{children:"Last Used"})]})}),e.jsx(nc,{loadProject:n,onClose:()=>t()})]})})]})]}),footerElements:e.jsxs("div",{className:ve.column,children:[e.jsxs("div",{className:ve.buttonRow,children:[e.jsx(f,{onClick:a,children:"Load demo project"}),e.jsx(Go,{onFinish:()=>t()}),e.jsx(f,{variant:"primary",onClick:i,children:"Create new..."})]}),e.jsxs(ei,{className:ve.inline,children:[e.jsx(La,{defaultChecked:!0,onCheckedChange:l=>la(l)}),"Show this modal on next startup"]})]})})}function ic(){const t=ds(n=>n.showDialog),s=ds(n=>n.clearDialog);return t?e.jsx(ac,{onClose:s}):null}const rc="_container_12ac0_17",lc="_itemGroup_12ac0_27",oc="_goButton_12ac0_34",cc="_iconButtonWithLabel_12ac0_35",dc="_iconButton_12ac0_35",uc="_goLabel_12ac0_55",hc="_shortcutHint_12ac0_61",mc="_addSection_12ac0_66",xc="_separator_12ac0_70",jc="_timerSection_12ac0_77",pc="_negativeIndicator_12ac0_84",gc="_auxSection_12ac0_95",fc="_auxTimeInput_12ac0_108",bc="_auxTimeDisplay_12ac0_109",Q={container:rc,itemGroup:lc,goButton:oc,iconButtonWithLabel:cc,iconButton:dc,goLabel:uc,shortcutHint:hc,addSection:mc,separator:xc,timerSection:jc,negativeIndicator:pc,auxSection:gc,auxTimeInput:fc,auxTimeDisplay:bc};function yc(){const t=oa(),{playback:s,numEvents:n,selectedEventIndex:a}=ca(),{playback:i,direction:l}=da(1),r=ua(1),[c]=wn({key:"add-time",defaultValue:3e5}),{disableGo:u,disableNext:o,disableAddTime:h,isPlaying:m,goAction:d,goLabel:x}=di({playback:s,numEvents:n,selectedEventIndex:a,timerPhase:t.phase}),j=h||c===0,g=v=>{j||(v==="add"?qe.addTime(c):qe.addTime(-1*c))},b=()=>{i===Ze.Start?et.pause(1):et.start(1)},y=()=>{et.stop(1)},w=()=>{const v=l===ot.CountDown?ot.CountUp:ot.CountDown;et.setDirection(1,v)},S=(v,A)=>{const C=Ke(A);et.setDuration(1,C)};Es([["Space",()=>!u&&d(),{preventDefault:!0}],["N",()=>!o&&qe.next(),{preventDefault:!0}],["Escape",()=>s!==Xe.Stop&&qe.stop(),{preventDefault:!0}]]);const O=t.phase===us.Pending,k=t.phase===us.Overtime,R=O?t.secondaryTimer:t.current,W=zt(c);return e.jsxs("div",{className:Q.container,children:[e.jsxs("div",{className:Q.itemGroup,children:[e.jsxs(Le,{onClick:d,disabled:u,theme:Xe.Play,active:m,className:Q.goButton,children:[e.jsx("span",{className:Q.goLabel,children:x}),e.jsx("span",{className:Q.shortcutHint,children:"[space]"})]}),e.jsxs(Le,{onClick:qe.next,disabled:o,className:Q.iconButtonWithLabel,aspect:"square",children:[e.jsx(Sn,{}),e.jsx("span",{className:Q.shortcutHint,children:"[n]"})]}),e.jsxs(Le,{onClick:qe.stop,disabled:s===Xe.Stop,className:Q.iconButtonWithLabel,aspect:"square",children:[e.jsx(rs,{}),e.jsx("span",{className:Q.shortcutHint,children:"[esc]"})]}),e.jsxs("div",{className:Q.addSection,children:[e.jsx("div",{className:Q.separator}),e.jsxs(Le,{onClick:()=>g("remove"),disabled:j,className:Q.iconButtonWithLabel,aspect:"square",children:[e.jsx(Cn,{}),W]}),e.jsxs(Le,{onClick:()=>g("add"),disabled:j,className:Q.iconButtonWithLabel,aspect:"square",children:[e.jsx(ge,{}),W]})]})]}),e.jsxs("div",{className:Q.timerSection,children:[e.jsx("span",{className:Q.negativeIndicator,"data-active":k,children:Rt}),e.jsx(ui,{time:R,phase:t.phase})]}),e.jsxs("div",{className:Q.auxSection,children:[e.jsx(Le,{onClick:b,className:Q.iconButton,theme:Xe.Play,aspect:"square",children:i===Ze.Start?e.jsx(_n,{}):e.jsx(kn,{})}),e.jsx(Le,{onClick:y,disabled:i===Ze.Stop,className:Q.iconButton,theme:Xe.Stop,aspect:"square",children:e.jsx(rs,{})}),i!==Ze.Stop?e.jsx("div",{className:Q.auxTimeDisplay,children:Ae(r)}):e.jsx(Ge,{name:"aux1-tracking",submitHandler:S,time:r,className:Q.auxTimeInput}),e.jsx(Le,{onClick:w,disabled:i!==Ze.Stop,className:Q.iconButton,aspect:"square",children:l===ot.CountDown?e.jsx(Rs,{}):e.jsx(gt,{})})]})]})}const _s=5;function vc(t){const s=t.findIndex(i=>i.isLoaded),n=s!==-1?t[s]:null,a=(n==null?void 0:n.eventIndex)??0;return{index:s,id:(n==null?void 0:n.id)??null,eventIndex:a,upcomingChipLimit:a>0?a+_s:_s}}const wc="_container_qfgjn_17",Sc="_emptyState_qfgjn_22",Cc="_emptyMessage_qfgjn_30",_c="_emptyTitle_qfgjn_36",kc="_emptyBody_qfgjn_43",st={container:wc,emptyState:Sc,emptyMessage:Cc,emptyTitle:_c,emptyBody:kc};function Nc(){return e.jsx("div",{className:st.container,children:e.jsx("div",{className:st.emptyState,children:e.jsxs("div",{className:st.emptyMessage,children:[e.jsx("h3",{className:st.emptyTitle,children:"No events yet"}),e.jsx("p",{className:st.emptyBody,children:"Add events in the rundown to populate this list."})]})})})}const Tc="_item_1nasm_17",Dc="_title_1nasm_36",Pc="_colourBar_1nasm_76",Rc="_chipSlot_1nasm_100",Ec="_chipText_1nasm_121",at={item:Tc,title:Dc,colourBar:Pc,chipSlot:Rc,chipText:Ec},Ic=p.memo(Lc);function Lc({entry:t,currentEventIndex:s,upcomingChipLimit:n,isRunning:a,mode:i,isGroupEnd:l,onSelect:r}){const c=p.useCallback(()=>{r({id:t.id,index:t.eventIndex-1,parent:t.parent??void 0})},[r,t.id,t.eventIndex,t.parent]),u=s>0&&t.eventIndex>s&&t.eventIndex<=s+2,o=i===We.Run&&t.isPast,h=t.isLoaded?i===We.Run?"running":"selected":o?"past":u?"next":"default",m=a&&!t.isLoaded&&!t.isPast&&!t.skip,d=m&&t.eventIndex<=n;return e.jsxs("li",{"data-state":h,"data-skipped":t.skip||void 0,"data-group-end":l||void 0,className:at.item,onClick:c,children:[e.jsx("div",{className:at.colourBar,style:{backgroundColor:t.groupColour||"transparent"}}),e.jsx("span",{className:at.title,children:t.title||"Untitled"}),m&&e.jsx(Oc,{timeStart:t.timeStart,delay:t.delay,dayOffset:t.dayOffset,totalGap:t.totalGap,isLinkedToLoaded:t.isLinkedToLoaded,isLoaded:t.isLoaded,showOnHover:!d})]})}const Oc=p.memo(Ac);function Ac({timeStart:t,delay:s,dayOffset:n,totalGap:a,isLinkedToLoaded:i,isLoaded:l,showOnHover:r}){const c=ha({timeStart:t,delay:s,dayOffset:n},{totalGap:a,isLinkedToLoaded:i}),u=!l&&c<xa;let o="LIVE";l||(o=u?"DUE":zt(Math.abs(c),c>2*ma));const h=l?"live":u?"due":"pending";return e.jsx(Yt,{text:"Expected time until start",className:at.chipSlot,"data-hover-only":r||void 0,children:e.jsx("span",{"data-chip-status":h,className:at.chipText,children:o})})}const Fc="_container_kcrvg_17",$c="_list_kcrvg_24",Vc="_bottomSpacer_kcrvg_30",ss={container:Fc,list:$c,bottomSpacer:Vc};function ks({mode:t}){const{data:s}=Qt(),n=ja(),a=Ia(r=>r.cursor),i=p.useMemo(()=>t===We.Run?n:a,[t,n,a]),l=p.useMemo(()=>Ka(s,i).filter(Ht),[s,i]);return l.length===0?e.jsx(Nc,{}):e.jsx(Mc,{mode:t,eventData:l,selectedEventId:n,resolvedFollowEventId:i,rundownId:s.id})}function Mc({mode:t,eventData:s,selectedEventId:n,resolvedFollowEventId:a,rundownId:i}){"use memo";const l=p.useRef(null),r=p.useRef(null),c=ii(i),u=p.useMemo(()=>vc(s),[s]),o=p.useMemo(()=>a?s.findIndex(d=>d.id===a):-1,[s,a]),h=p.useCallback(d=>{c(d)},[c]);p.useEffect(()=>{if(!l.current)return;const d=o!==-1?o:u.index;d!==-1&&(t===We.Edit&&d<=3||l.current.scrollToIndex({index:d,align:"start",behavior:"smooth",offset:-50}))},[u.index,o,t]);const m=p.useCallback((d,x)=>{const j=s[d+1],g=!!x.parent&&x.parent!==((j==null?void 0:j.parent)??null);return e.jsx(Ic,{entry:x,currentEventIndex:u.eventIndex,upcomingChipLimit:u.upcomingChipLimit,isRunning:t===We.Run&&n!==null,mode:t,onSelect:h,isGroupEnd:g},x.id)},[s,u.eventIndex,u.upcomingChipLimit,t,n,h]);return e.jsx(ci,{className:ss.container,ref:r,children:e.jsx(Nn,{ref:l,data:s,computeItemKey:(d,x)=>x.id,itemContent:m,increaseViewportBy:{top:200,bottom:200},customScrollParent:r.current??void 0,components:{List:ln,Footer:Wc}})})}function ln({children:t,...s}){return e.jsx("ul",{...s,className:ss.list,children:t})}ln.displayName="VirtuosoListComponent";function Wc(){return e.jsx("div",{className:ss.bottomSpacer})}const Uc="_panelContainer_1exbp_17",Bc="_panelContainerTracking_1exbp_26",qc="_left_1exbp_31",zc="_rundownLayout_1exbp_40",Gc="_rundownPanel_1exbp_48",Kc="_titlesPanel_1exbp_55",be={panelContainer:Uc,panelContainerTracking:Bc,left:qc,rundownLayout:zc,rundownPanel:Gc,titlesPanel:Kc},Dt=p.lazy(()=>rt(()=>import("./RundownExport-DhzzqPCD.js").then(t=>t.R),__vite__mapDeps([15,1,2,16,3,4,17,18,19,20,7,5,6,8,9,10,11,12,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37]),import.meta.url)),Hc=p.lazy(()=>rt(()=>import("./TimerControlExport-BNfZ99Im.js"),__vite__mapDeps([38,1,2,16,3,4,17,18,19,21,22,23,39,40,25,26,41,42]),import.meta.url)),Qc=p.lazy(()=>rt(()=>import("./MessageControlExport-DGo2ZNMw.js"),__vite__mapDeps([43,1,2,16,3,4,17,18,19,8,9,25,26,44]),import.meta.url));function Yc(){const{layoutMode:t}=Xt();return t===we.CONTROL?e.jsxs("div",{id:"panels",className:be.panelContainer,children:[e.jsxs("div",{className:be.left,children:[e.jsx(Hc,{}),e.jsx(Qc,{})]}),e.jsx(Dt,{})]}):t===we.TRACKING?e.jsxs("div",{id:"panels",className:`${be.panelContainer} ${be.panelContainerTracking}`,children:[e.jsxs("div",{className:be.rundownLayout,children:[e.jsx("div",{className:be.titlesPanel,children:e.jsx(ks,{mode:We.Run})}),e.jsx("div",{className:be.rundownPanel,children:e.jsx(Dt,{})})]}),e.jsx(yc,{})]}):e.jsx("div",{id:"panels",className:be.panelContainer,children:e.jsxs("div",{className:be.rundownLayout,children:[e.jsx("div",{className:be.titlesPanel,children:e.jsx(ks,{mode:We.Edit})}),e.jsx("div",{className:be.rundownPanel,children:e.jsx(Dt,{})})]})})}const Jc=p.memo(Xc);function Xc(){const{layoutMode:t,setLayoutMode:s}=Xt(),n=p.useMemo(()=>[{type:"item",label:"Planning",description:"Edit-focused list with planning stats",icon:t===we.PLANNING?dt:void 0,onClick:()=>s(we.PLANNING)},{type:"item",label:"Tracking",description:"Live timing view with progress and offsets",icon:t===we.TRACKING?dt:void 0,onClick:()=>s(we.TRACKING)},{type:"item",label:"Control",description:"All controls and rundown together",icon:t===we.CONTROL?dt:void 0,onClick:()=>s(we.CONTROL)}],[t,s]);return e.jsx(Gt,{render:e.jsx(Y,{"aria-label":"Layout mode",variant:"subtle-white",size:"xlarge"}),items:n,children:e.jsx(Tn,{})})}const Zc="_mainContainer_1m0yz_17",ed={mainContainer:Zc};function kd(){const{isOpen:t,setLocation:s,close:n}=Jt(),[a,i]=Ee();ba("Editor"),pa(),p.useEffect(()=>{var r;((r=window.process)==null?void 0:r.type)==="renderer"&&window.ipcRenderer.on("user-request-shutdown",()=>{s("shutdown")})},[s]);const l=p.useCallback(()=>{t?n():s("settings")},[n,t,s]);return Es([["mod + ,",l]]),e.jsx(fa,{permission:"editor",children:e.jsxs("div",{className:ed.mainContainer,"data-testid":"event-editor",children:[e.jsx(ic,{}),e.jsx(ga,{isOpen:a,onClose:i.close}),t?e.jsx(Mo,{}):e.jsx(Yc,{}),e.jsxs(Wo,{children:[e.jsx(Y,{"aria-label":"Toggle navigation",variant:"subtle-white",size:"xlarge",onClick:i.open,children:e.jsx(Dn,{})}),e.jsx(Y,{"aria-label":"Toggle settings",variant:"subtle-white",size:"xlarge",onClick:l,children:t?e.jsx($t,{}):e.jsx(Pn,{})}),e.jsx(Jc,{})]})]})})}export{kd as default};
|
|
3
|
-
//# sourceMappingURL=ProtectedEditor-BVabJfIz.js.map
|
|
Binary file
|
|
Binary file
|