@getontime/cli 4.2.1 → 4.3.0
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-CDH53Q_N.js +2 -0
- package/client/assets/Backstage-CDH53Q_N.js.br +0 -0
- package/client/assets/Backstage-CDH53Q_N.js.gz +0 -0
- package/client/assets/Backstage-CDH53Q_N.js.map +1 -0
- package/client/assets/Countdown-B-MuMf1C.js +2 -0
- package/client/assets/Countdown-B-MuMf1C.js.br +0 -0
- package/client/assets/Countdown-B-MuMf1C.js.gz +0 -0
- package/client/assets/Countdown-B-MuMf1C.js.map +1 -0
- package/client/assets/CustomTranslationModal-DiQbmcgD.js +2 -0
- package/client/assets/CustomTranslationModal-DiQbmcgD.js.br +0 -0
- package/client/assets/CustomTranslationModal-DiQbmcgD.js.gz +0 -0
- package/client/assets/{CustomTranslationModal-CtBvokyt.js.map → CustomTranslationModal-DiQbmcgD.js.map} +1 -1
- package/client/assets/DelayIndicator-D--91EO3.js +2 -0
- package/client/assets/DelayIndicator-D--91EO3.js.br +0 -0
- package/client/assets/DelayIndicator-D--91EO3.js.gz +0 -0
- package/client/assets/{DelayIndicator-BFZFpsY5.js.map → DelayIndicator-D--91EO3.js.map} +1 -1
- package/client/assets/EditorFeatureWrapper-DwXUAV4k.js +2 -0
- package/client/assets/EditorFeatureWrapper-DwXUAV4k.js.br +0 -0
- package/client/assets/EditorFeatureWrapper-DwXUAV4k.js.gz +0 -0
- package/client/assets/{EditorFeatureWrapper-DaMxgBMP.js.map → EditorFeatureWrapper-DwXUAV4k.js.map} +1 -1
- package/client/assets/EditorUtils-DuKjlUkF.js +2 -0
- package/client/assets/EditorUtils-DuKjlUkF.js.br +0 -0
- package/client/assets/EditorUtils-DuKjlUkF.js.gz +0 -0
- package/client/assets/{EditorUtils-DoaSwWiz.js.map → EditorUtils-DuKjlUkF.js.map} +1 -1
- package/client/assets/EditorUtils-L4Sg72o_.css +1 -0
- package/client/assets/EditorUtils-L4Sg72o_.css.br +0 -0
- package/client/assets/EditorUtils-L4Sg72o_.css.gz +0 -0
- package/client/assets/{Empty-D1UteOYj.js → Empty-CJbZxh45.js} +2 -2
- package/client/assets/Empty-CJbZxh45.js.br +0 -0
- package/client/assets/Empty-CJbZxh45.js.gz +0 -0
- package/client/assets/{Empty-D1UteOYj.js.map → Empty-CJbZxh45.js.map} +1 -1
- package/client/assets/{EmptyPage-DeRjpRKZ.js → EmptyPage-Bc358YpE.js} +2 -2
- package/client/assets/EmptyPage-Bc358YpE.js.br +5 -0
- package/client/assets/EmptyPage-Bc358YpE.js.gz +0 -0
- package/client/assets/{EmptyPage-DeRjpRKZ.js.map → EmptyPage-Bc358YpE.js.map} +1 -1
- package/client/assets/{FollowButton-FodezDem.js → FollowButton-C6Fvaqh0.js} +2 -2
- package/client/assets/FollowButton-C6Fvaqh0.js.br +0 -0
- package/client/assets/FollowButton-C6Fvaqh0.js.gz +0 -0
- package/client/assets/{FollowButton-FodezDem.js.map → FollowButton-C6Fvaqh0.js.map} +1 -1
- package/client/assets/MessageControlExport-D_pNX6Vj.css +1 -0
- package/client/assets/MessageControlExport-D_pNX6Vj.css.br +0 -0
- package/client/assets/MessageControlExport-D_pNX6Vj.css.gz +0 -0
- package/client/assets/MessageControlExport-GmOrvUik.js +3 -0
- package/client/assets/MessageControlExport-GmOrvUik.js.br +0 -0
- package/client/assets/MessageControlExport-GmOrvUik.js.gz +0 -0
- package/client/assets/MessageControlExport-GmOrvUik.js.map +1 -0
- package/client/assets/MilestoneEditor-BA0PVIQh.js +2 -0
- package/client/assets/MilestoneEditor-BA0PVIQh.js.br +0 -0
- package/client/assets/MilestoneEditor-BA0PVIQh.js.gz +0 -0
- package/client/assets/MilestoneEditor-BA0PVIQh.js.map +1 -0
- package/client/assets/Modal-BKx0PDGT.js +2 -0
- package/client/assets/Modal-BKx0PDGT.js.br +0 -0
- package/client/assets/Modal-BKx0PDGT.js.gz +0 -0
- package/client/assets/Modal-BKx0PDGT.js.map +1 -0
- package/client/assets/{MultiPartProgressBar-BKHk19Hb.js → MultiPartProgressBar-BXdLxJpy.js} +2 -2
- package/client/assets/MultiPartProgressBar-BXdLxJpy.js.br +0 -0
- package/client/assets/MultiPartProgressBar-BXdLxJpy.js.gz +0 -0
- package/client/assets/{MultiPartProgressBar-BKHk19Hb.js.map → MultiPartProgressBar-BXdLxJpy.js.map} +1 -1
- package/client/assets/OperatorExport-CA5WcIt5.css +1 -0
- package/client/assets/OperatorExport-CA5WcIt5.css.br +0 -0
- package/client/assets/OperatorExport-CA5WcIt5.css.gz +0 -0
- package/client/assets/OperatorExport-X7-qi2jv.js +2 -0
- package/client/assets/OperatorExport-X7-qi2jv.js.br +0 -0
- package/client/assets/OperatorExport-X7-qi2jv.js.gz +0 -0
- package/client/assets/OperatorExport-X7-qi2jv.js.map +1 -0
- package/client/assets/OverviewWrapper-BQb2xl_N.js +2 -0
- package/client/assets/OverviewWrapper-BQb2xl_N.js.br +0 -0
- package/client/assets/OverviewWrapper-BQb2xl_N.js.gz +0 -0
- package/client/assets/OverviewWrapper-BQb2xl_N.js.map +1 -0
- package/client/assets/{PipHost-B9-cZ8Lm.js → PipHost-CvtlZIn7.js} +2 -2
- package/client/assets/PipHost-CvtlZIn7.js.br +0 -0
- package/client/assets/PipHost-CvtlZIn7.js.gz +0 -0
- package/client/assets/PipHost-CvtlZIn7.js.map +1 -0
- package/client/assets/ProjectInfo-1tw48NHZ.js +2 -0
- package/client/assets/ProjectInfo-1tw48NHZ.js.br +0 -0
- package/client/assets/ProjectInfo-1tw48NHZ.js.gz +0 -0
- package/client/assets/{ProjectInfo-Dp1TZyBd.js.map → ProjectInfo-1tw48NHZ.js.map} +1 -1
- package/client/assets/{ProtectRoute-EejQ5o_H.js → ProtectRoute-BH-QvsU0.js} +2 -2
- package/client/assets/ProtectRoute-BH-QvsU0.js.br +0 -0
- package/client/assets/ProtectRoute-BH-QvsU0.js.gz +0 -0
- package/client/assets/{ProtectRoute-EejQ5o_H.js.map → ProtectRoute-BH-QvsU0.js.map} +1 -1
- package/client/assets/ProtectedCuesheet-CYBIcg1c.js +2 -0
- package/client/assets/ProtectedCuesheet-CYBIcg1c.js.br +0 -0
- package/client/assets/ProtectedCuesheet-CYBIcg1c.js.gz +0 -0
- package/client/assets/ProtectedCuesheet-CYBIcg1c.js.map +1 -0
- package/client/assets/ProtectedCuesheet-DPO7xYMb.css +1 -0
- package/client/assets/ProtectedCuesheet-DPO7xYMb.css.br +0 -0
- package/client/assets/ProtectedCuesheet-DPO7xYMb.css.gz +0 -0
- package/client/assets/{ProtectedEditor-Dw0pWw0J.css → ProtectedEditor-BtSuTFlT.css} +1 -1
- package/client/assets/ProtectedEditor-BtSuTFlT.css.br +0 -0
- package/client/assets/{ProtectedEditor-Dw0pWw0J.css.gz → ProtectedEditor-BtSuTFlT.css.gz} +0 -0
- package/client/assets/ProtectedEditor-D_A75byA.js +3 -0
- package/client/assets/ProtectedEditor-D_A75byA.js.br +0 -0
- package/client/assets/ProtectedEditor-D_A75byA.js.gz +0 -0
- package/client/assets/ProtectedEditor-D_A75byA.js.map +1 -0
- package/client/assets/RundownEntry-bkqwx57t.js +2 -0
- package/client/assets/RundownEntry-bkqwx57t.js.br +0 -0
- package/client/assets/RundownEntry-bkqwx57t.js.gz +0 -0
- package/client/assets/RundownEntry-bkqwx57t.js.map +1 -0
- package/client/assets/{RundownExport-DtSvAfBG.css → RundownExport-Bgtg_idR.css} +1 -1
- package/client/assets/RundownExport-Bgtg_idR.css.br +0 -0
- package/client/assets/RundownExport-Bgtg_idR.css.gz +0 -0
- package/client/assets/RundownExport-EorsanA0.js +3 -0
- package/client/assets/RundownExport-EorsanA0.js.br +0 -0
- package/client/assets/RundownExport-EorsanA0.js.gz +0 -0
- package/client/assets/RundownExport-EorsanA0.js.map +1 -0
- package/client/assets/{Select-cHK8JrMG.js → Select-BGGVCKqU.js} +2 -2
- package/client/assets/Select-BGGVCKqU.js.br +0 -0
- package/client/assets/Select-BGGVCKqU.js.gz +0 -0
- package/client/assets/Select-BGGVCKqU.js.map +1 -0
- package/client/assets/Studio-BjNZ4l-W.js +2 -0
- package/client/assets/Studio-BjNZ4l-W.js.br +0 -0
- package/client/assets/Studio-BjNZ4l-W.js.gz +0 -0
- package/client/assets/Studio-BjNZ4l-W.js.map +1 -0
- package/client/assets/{StyleEditor-RZvkKHdf.js → StyleEditor-CpciRLYh.js} +2 -2
- package/client/assets/StyleEditor-CpciRLYh.js.br +0 -0
- package/client/assets/StyleEditor-CpciRLYh.js.gz +0 -0
- package/client/assets/{StyleEditor-RZvkKHdf.js.map → StyleEditor-CpciRLYh.js.map} +1 -1
- package/client/assets/{SuperscriptPeriod-DaZq1rr6.js → SuperscriptPeriod-DsPdWN_s.js} +2 -2
- package/client/assets/SuperscriptPeriod-DsPdWN_s.js.br +0 -0
- package/client/assets/SuperscriptPeriod-DsPdWN_s.js.gz +0 -0
- package/client/assets/SuperscriptPeriod-DsPdWN_s.js.map +1 -0
- package/client/assets/SuperscriptTime-CA6S2R55.js +2 -0
- package/client/assets/SuperscriptTime-CA6S2R55.js.br +0 -0
- package/client/assets/SuperscriptTime-CA6S2R55.js.gz +0 -0
- package/client/assets/SuperscriptTime-CA6S2R55.js.map +1 -0
- package/client/assets/SwatchPicker-Cm5Eicvv.js +2 -0
- package/client/assets/SwatchPicker-Cm5Eicvv.js.br +0 -0
- package/client/assets/SwatchPicker-Cm5Eicvv.js.gz +0 -0
- package/client/assets/SwatchPicker-Cm5Eicvv.js.map +1 -0
- package/client/assets/{TimeElements-dIvFHgcd.js → TimeElements-DbclWDbU.js} +2 -2
- package/client/assets/TimeElements-DbclWDbU.js.br +0 -0
- package/client/assets/TimeElements-DbclWDbU.js.gz +0 -0
- package/client/assets/TimeElements-DbclWDbU.js.map +1 -0
- package/client/assets/TimeInput-C8DQoFXv.js +2 -0
- package/client/assets/TimeInput-C8DQoFXv.js.br +0 -0
- package/client/assets/TimeInput-C8DQoFXv.js.gz +0 -0
- package/client/assets/{TimeInput-Duzx40TC.js.map → TimeInput-C8DQoFXv.js.map} +1 -1
- package/client/assets/TimelinePage-Cgtl1qNp.js +2 -0
- package/client/assets/TimelinePage-Cgtl1qNp.js.br +0 -0
- package/client/assets/TimelinePage-Cgtl1qNp.js.gz +0 -0
- package/client/assets/TimelinePage-Cgtl1qNp.js.map +1 -0
- package/client/assets/Timer-BbixOGdj.js +2 -0
- package/client/assets/Timer-BbixOGdj.js.br +0 -0
- package/client/assets/Timer-BbixOGdj.js.gz +0 -0
- package/client/assets/Timer-BbixOGdj.js.map +1 -0
- package/client/assets/TimerControlExport-Dx3SSGNG.js +2 -0
- package/client/assets/TimerControlExport-Dx3SSGNG.js.br +0 -0
- package/client/assets/TimerControlExport-Dx3SSGNG.js.gz +0 -0
- package/client/assets/{TimerControlExport-GJn4WWdH.js.map → TimerControlExport-Dx3SSGNG.js.map} +1 -1
- package/client/assets/{TimerControlExport-DavNxY9p.css → TimerControlExport-cJRa5GUp.css} +1 -1
- package/client/assets/TimerControlExport-cJRa5GUp.css.br +0 -0
- package/client/assets/{TimerControlExport-DavNxY9p.css.gz → TimerControlExport-cJRa5GUp.css.gz} +0 -0
- package/client/assets/{TitleCard-BqbrUnHO.js → TitleCard-Xdr7xwzU.js} +2 -2
- package/client/assets/TitleCard-Xdr7xwzU.js.br +0 -0
- package/client/assets/TitleCard-Xdr7xwzU.js.gz +0 -0
- package/client/assets/{TitleCard-BqbrUnHO.js.map → TitleCard-Xdr7xwzU.js.map} +1 -1
- package/client/assets/{Tooltip-BQBvaIZx.js → Tooltip-B5vsLcFu.js} +2 -2
- package/client/assets/Tooltip-B5vsLcFu.js.br +0 -0
- package/client/assets/Tooltip-B5vsLcFu.js.gz +0 -0
- package/client/assets/Tooltip-B5vsLcFu.js.map +1 -0
- package/client/assets/{ViewLogo-BdL1hUV1.js → ViewLogo-G7EosFIr.js} +2 -2
- package/client/assets/ViewLogo-G7EosFIr.js.br +0 -0
- package/client/assets/ViewLogo-G7EosFIr.js.gz +0 -0
- package/client/assets/{ViewLogo-BdL1hUV1.js.map → ViewLogo-G7EosFIr.js.map} +1 -1
- package/client/assets/ViewParamsEditor-C2-TRP6e.js +2 -0
- package/client/assets/ViewParamsEditor-C2-TRP6e.js.br +0 -0
- package/client/assets/ViewParamsEditor-C2-TRP6e.js.gz +0 -0
- package/client/assets/ViewParamsEditor-C2-TRP6e.js.map +1 -0
- package/client/assets/{dateConfig-BU1RZfIK.js → dateConfig-D7xim1t4.js} +2 -2
- package/client/assets/dateConfig-D7xim1t4.js.br +0 -0
- package/client/assets/dateConfig-D7xim1t4.js.gz +0 -0
- package/client/assets/{dateConfig-BU1RZfIK.js.map → dateConfig-D7xim1t4.js.map} +1 -1
- package/client/assets/{editorSettings-BMt-7s8I.js → editorSettings-D2f7e1a6.js} +2 -2
- package/client/assets/editorSettings-D2f7e1a6.js.br +0 -0
- package/client/assets/editorSettings-D2f7e1a6.js.gz +0 -0
- package/client/assets/{editorSettings-BMt-7s8I.js.map → editorSettings-D2f7e1a6.js.map} +1 -1
- package/client/assets/{getProgress-sdxPEEPi.js → getProgress-cLuBFPjh.js} +2 -2
- package/client/assets/getProgress-cLuBFPjh.js.br +0 -0
- package/client/assets/getProgress-cLuBFPjh.js.gz +0 -0
- package/client/assets/{getProgress-sdxPEEPi.js.map → getProgress-cLuBFPjh.js.map} +1 -1
- package/client/assets/index-B81u4hxi.js +3 -0
- package/client/assets/index-B81u4hxi.js.br +0 -0
- package/client/assets/index-B81u4hxi.js.gz +0 -0
- package/client/assets/index-B81u4hxi.js.map +1 -0
- package/client/assets/{index-BuJoGGff.css → index-D6S93MXv.css} +1 -1
- package/client/assets/index-D6S93MXv.css.br +0 -0
- package/client/assets/index-D6S93MXv.css.gz +0 -0
- package/client/assets/{offset-BS90Rks2.js → offset-R98EXhWK.js} +2 -2
- package/client/assets/offset-R98EXhWK.js.br +0 -0
- package/client/assets/offset-R98EXhWK.js.gz +0 -0
- package/client/assets/{offset-BS90Rks2.js.map → offset-R98EXhWK.js.map} +1 -1
- package/client/assets/{parseUserTime-DZJMcfuJ.js → parseUserTime-YeFR8t3F.js} +2 -2
- package/client/assets/parseUserTime-YeFR8t3F.js.br +0 -0
- package/client/assets/parseUserTime-YeFR8t3F.js.gz +0 -0
- package/client/assets/{parseUserTime-DZJMcfuJ.js.map → parseUserTime-YeFR8t3F.js.map} +1 -1
- package/client/assets/{playbackstate-CWexoP3a.js → playbackstate-CPQdnF-k.js} +2 -2
- package/client/assets/playbackstate-CPQdnF-k.js.br +0 -0
- package/client/assets/playbackstate-CPQdnF-k.js.gz +0 -0
- package/client/assets/{playbackstate-CWexoP3a.js.map → playbackstate-CPQdnF-k.js.map} +1 -1
- package/client/assets/{presentation.utils-Zo5hNQje.js → presentation.utils-Cl-L3pHN.js} +2 -2
- package/client/assets/presentation.utils-Cl-L3pHN.js.br +0 -0
- package/client/assets/presentation.utils-Cl-L3pHN.js.gz +0 -0
- package/client/assets/{presentation.utils-Zo5hNQje.js.map → presentation.utils-Cl-L3pHN.js.map} +1 -1
- package/client/assets/rundownUtils-CtVGQDQn.js +2 -0
- package/client/assets/rundownUtils-CtVGQDQn.js.br +0 -0
- package/client/assets/rundownUtils-CtVGQDQn.js.gz +0 -0
- package/client/assets/{rundownUtils-Dl1x6NDv.js.map → rundownUtils-CtVGQDQn.js.map} +1 -1
- package/client/assets/{timer.utils-BnMyVO6Z.js → timer.utils-rGyI9NYa.js} +2 -2
- package/client/assets/timer.utils-rGyI9NYa.js.br +0 -0
- package/client/assets/timer.utils-rGyI9NYa.js.gz +0 -0
- package/client/assets/timer.utils-rGyI9NYa.js.map +1 -0
- package/client/assets/{useCustomFields-CcTb-GQM.js → useCustomFields-k4piRt9n.js} +2 -2
- package/client/assets/useCustomFields-k4piRt9n.js.br +0 -0
- package/client/assets/useCustomFields-k4piRt9n.js.gz +0 -0
- package/client/assets/{useCustomFields-CcTb-GQM.js.map → useCustomFields-k4piRt9n.js.map} +1 -1
- package/client/assets/{useFollowComponent-BjhV6Uv8.js → useFollowComponent-B7vvPzG2.js} +2 -2
- package/client/assets/useFollowComponent-B7vvPzG2.js.br +0 -0
- package/client/assets/useFollowComponent-B7vvPzG2.js.gz +0 -0
- package/client/assets/{useFollowComponent-BjhV6Uv8.js.map → useFollowComponent-B7vvPzG2.js.map} +1 -1
- package/client/assets/useProjectData-DdgKoYzk.js +2 -0
- package/client/assets/useProjectData-DdgKoYzk.js.br +0 -0
- package/client/assets/useProjectData-DdgKoYzk.js.gz +0 -0
- package/client/assets/useProjectData-DdgKoYzk.js.map +1 -0
- package/client/assets/{useReport-zMbyWwpn.js → useReport-DSuFnUb9.js} +2 -2
- package/client/assets/useReport-DSuFnUb9.js.br +0 -0
- package/client/assets/useReport-DSuFnUb9.js.gz +0 -0
- package/client/assets/{useReport-zMbyWwpn.js.map → useReport-DSuFnUb9.js.map} +1 -1
- package/client/assets/useRundown-Bn6ZPsz0.js +2 -0
- package/client/assets/useRundown-Bn6ZPsz0.js.br +0 -0
- package/client/assets/useRundown-Bn6ZPsz0.js.gz +0 -0
- package/client/assets/useRundown-Bn6ZPsz0.js.map +1 -0
- package/client/assets/{useWindowTitle-mLKt65i7.js → useWindowTitle-Bpmo_HzW.js} +2 -2
- package/client/assets/useWindowTitle-Bpmo_HzW.js.br +0 -0
- package/client/assets/useWindowTitle-Bpmo_HzW.js.gz +0 -0
- package/client/assets/useWindowTitle-Bpmo_HzW.js.map +1 -0
- package/client/assets/{validateEvent-CUmvjN95.js → validateEvent-Do8yE_DJ.js} +2 -2
- package/client/assets/validateEvent-Do8yE_DJ.js.br +3 -0
- package/client/assets/validateEvent-Do8yE_DJ.js.gz +0 -0
- package/client/assets/{validateEvent-CUmvjN95.js.map → validateEvent-Do8yE_DJ.js.map} +1 -1
- package/client/assets/vendor-q6fv0YT2.js +74 -0
- package/client/assets/vendor-q6fv0YT2.js.br +0 -0
- package/client/assets/vendor-q6fv0YT2.js.gz +0 -0
- package/client/assets/{vendor-Cdwxo8bP.js.map → vendor-q6fv0YT2.js.map} +1 -1
- package/client/assets/{viewLoader.utils-DuXjY5zb.js → viewLoader.utils-b42scp-I.js} +2 -2
- package/client/assets/viewLoader.utils-b42scp-I.js.br +0 -0
- package/client/assets/viewLoader.utils-b42scp-I.js.gz +0 -0
- package/client/assets/{viewLoader.utils-DuXjY5zb.js.map → viewLoader.utils-b42scp-I.js.map} +1 -1
- package/client/assets/{viewUtils-dKRKkb_F.js → viewUtils-B8Dr4GHH.js} +2 -2
- package/client/assets/viewUtils-B8Dr4GHH.js.br +0 -0
- package/client/assets/viewUtils-B8Dr4GHH.js.gz +0 -0
- package/client/assets/viewUtils-B8Dr4GHH.js.map +1 -0
- package/client/index.html +3 -3
- package/package.json +1 -1
- package/server/index.cjs +100 -100
- package/client/assets/Backstage-WSlbFC9X.js +0 -2
- package/client/assets/Backstage-WSlbFC9X.js.br +0 -0
- package/client/assets/Backstage-WSlbFC9X.js.gz +0 -0
- package/client/assets/Backstage-WSlbFC9X.js.map +0 -1
- package/client/assets/Countdown-B32qlxYT.js +0 -2
- package/client/assets/Countdown-B32qlxYT.js.br +0 -0
- package/client/assets/Countdown-B32qlxYT.js.gz +0 -0
- package/client/assets/Countdown-B32qlxYT.js.map +0 -1
- package/client/assets/CustomTranslationModal-CtBvokyt.js +0 -2
- package/client/assets/CustomTranslationModal-CtBvokyt.js.br +0 -0
- package/client/assets/CustomTranslationModal-CtBvokyt.js.gz +0 -0
- package/client/assets/DelayIndicator-BFZFpsY5.js +0 -2
- package/client/assets/DelayIndicator-BFZFpsY5.js.br +0 -0
- package/client/assets/DelayIndicator-BFZFpsY5.js.gz +0 -0
- package/client/assets/Editor-B_NlyOLw.css +0 -1
- package/client/assets/Editor-B_NlyOLw.css.br +0 -0
- package/client/assets/Editor-B_NlyOLw.css.gz +0 -0
- package/client/assets/Editor.module-DvV2efYs.js +0 -2
- package/client/assets/Editor.module-DvV2efYs.js.br +0 -0
- package/client/assets/Editor.module-DvV2efYs.js.gz +0 -0
- package/client/assets/Editor.module-DvV2efYs.js.map +0 -1
- package/client/assets/EditorFeatureWrapper-DaMxgBMP.js +0 -2
- package/client/assets/EditorFeatureWrapper-DaMxgBMP.js.br +0 -0
- package/client/assets/EditorFeatureWrapper-DaMxgBMP.js.gz +0 -0
- package/client/assets/EditorUtils-CgF7UfHP.css +0 -1
- package/client/assets/EditorUtils-CgF7UfHP.css.br +0 -0
- package/client/assets/EditorUtils-CgF7UfHP.css.gz +0 -0
- package/client/assets/EditorUtils-DoaSwWiz.js +0 -2
- package/client/assets/EditorUtils-DoaSwWiz.js.br +0 -0
- package/client/assets/EditorUtils-DoaSwWiz.js.gz +0 -0
- package/client/assets/Empty-D1UteOYj.js.br +0 -0
- package/client/assets/Empty-D1UteOYj.js.gz +0 -0
- package/client/assets/EmptyPage-DeRjpRKZ.js.br +0 -0
- package/client/assets/EmptyPage-DeRjpRKZ.js.gz +0 -0
- package/client/assets/FollowButton-FodezDem.js.br +0 -0
- package/client/assets/FollowButton-FodezDem.js.gz +0 -0
- package/client/assets/MessageControlExport-CFGgiwk_.js +0 -3
- package/client/assets/MessageControlExport-CFGgiwk_.js.br +0 -0
- package/client/assets/MessageControlExport-CFGgiwk_.js.gz +0 -0
- package/client/assets/MessageControlExport-CFGgiwk_.js.map +0 -1
- package/client/assets/MessageControlExport-DjoUioWA.css +0 -1
- package/client/assets/MessageControlExport-DjoUioWA.css.br +0 -0
- package/client/assets/MessageControlExport-DjoUioWA.css.gz +0 -0
- package/client/assets/MilestoneEditor-B5BdJ5ju.js +0 -2
- package/client/assets/MilestoneEditor-B5BdJ5ju.js.br +0 -0
- package/client/assets/MilestoneEditor-B5BdJ5ju.js.gz +0 -0
- package/client/assets/MilestoneEditor-B5BdJ5ju.js.map +0 -1
- package/client/assets/Modal-B8ZZbVMg.js +0 -2
- package/client/assets/Modal-B8ZZbVMg.js.br +0 -0
- package/client/assets/Modal-B8ZZbVMg.js.gz +0 -0
- package/client/assets/Modal-B8ZZbVMg.js.map +0 -1
- package/client/assets/MultiPartProgressBar-BKHk19Hb.js.br +0 -0
- package/client/assets/MultiPartProgressBar-BKHk19Hb.js.gz +0 -0
- package/client/assets/OperatorExport-BiBcgVKc.css +0 -1
- package/client/assets/OperatorExport-BiBcgVKc.css.br +0 -0
- package/client/assets/OperatorExport-BiBcgVKc.css.gz +0 -0
- package/client/assets/OperatorExport-DQM14DsN.js +0 -2
- package/client/assets/OperatorExport-DQM14DsN.js.br +0 -0
- package/client/assets/OperatorExport-DQM14DsN.js.gz +0 -0
- package/client/assets/OperatorExport-DQM14DsN.js.map +0 -1
- package/client/assets/OverviewWrapper-D1hUkrRi.js +0 -2
- package/client/assets/OverviewWrapper-D1hUkrRi.js.br +0 -0
- package/client/assets/OverviewWrapper-D1hUkrRi.js.gz +0 -0
- package/client/assets/OverviewWrapper-D1hUkrRi.js.map +0 -1
- package/client/assets/PipHost-B9-cZ8Lm.js.br +0 -0
- package/client/assets/PipHost-B9-cZ8Lm.js.gz +0 -0
- package/client/assets/PipHost-B9-cZ8Lm.js.map +0 -1
- package/client/assets/ProjectInfo-Dp1TZyBd.js +0 -2
- package/client/assets/ProjectInfo-Dp1TZyBd.js.br +0 -0
- package/client/assets/ProjectInfo-Dp1TZyBd.js.gz +0 -0
- package/client/assets/ProtectRoute-EejQ5o_H.js.br +0 -0
- package/client/assets/ProtectRoute-EejQ5o_H.js.gz +0 -0
- package/client/assets/ProtectedCuesheet-C_tKodwo.css +0 -1
- package/client/assets/ProtectedCuesheet-C_tKodwo.css.br +0 -0
- package/client/assets/ProtectedCuesheet-C_tKodwo.css.gz +0 -0
- package/client/assets/ProtectedCuesheet-DvYSgueA.js +0 -2
- package/client/assets/ProtectedCuesheet-DvYSgueA.js.br +0 -0
- package/client/assets/ProtectedCuesheet-DvYSgueA.js.gz +0 -0
- package/client/assets/ProtectedCuesheet-DvYSgueA.js.map +0 -1
- package/client/assets/ProtectedEditor-B0l0X3QP.js +0 -3
- package/client/assets/ProtectedEditor-B0l0X3QP.js.br +0 -0
- package/client/assets/ProtectedEditor-B0l0X3QP.js.gz +0 -0
- package/client/assets/ProtectedEditor-B0l0X3QP.js.map +0 -1
- package/client/assets/ProtectedEditor-Dw0pWw0J.css.br +0 -0
- package/client/assets/RundownEntry-CwiStTnR.js +0 -2
- package/client/assets/RundownEntry-CwiStTnR.js.br +0 -0
- package/client/assets/RundownEntry-CwiStTnR.js.gz +0 -0
- package/client/assets/RundownEntry-CwiStTnR.js.map +0 -1
- package/client/assets/RundownExport-CCaOfHIr.js +0 -3
- package/client/assets/RundownExport-CCaOfHIr.js.br +0 -0
- package/client/assets/RundownExport-CCaOfHIr.js.gz +0 -0
- package/client/assets/RundownExport-CCaOfHIr.js.map +0 -1
- package/client/assets/RundownExport-DtSvAfBG.css.br +0 -0
- package/client/assets/RundownExport-DtSvAfBG.css.gz +0 -0
- package/client/assets/Select-cHK8JrMG.js.br +0 -0
- package/client/assets/Select-cHK8JrMG.js.gz +0 -0
- package/client/assets/Select-cHK8JrMG.js.map +0 -1
- package/client/assets/Studio-BzwFDYzk.js +0 -2
- package/client/assets/Studio-BzwFDYzk.js.br +0 -0
- package/client/assets/Studio-BzwFDYzk.js.gz +0 -0
- package/client/assets/Studio-BzwFDYzk.js.map +0 -1
- package/client/assets/StyleEditor-RZvkKHdf.js.br +0 -0
- package/client/assets/StyleEditor-RZvkKHdf.js.gz +0 -0
- package/client/assets/SuperscriptPeriod-DaZq1rr6.js.br +0 -0
- package/client/assets/SuperscriptPeriod-DaZq1rr6.js.gz +0 -0
- package/client/assets/SuperscriptPeriod-DaZq1rr6.js.map +0 -1
- package/client/assets/SuperscriptTime-Mc0ZGBMo.js +0 -2
- package/client/assets/SuperscriptTime-Mc0ZGBMo.js.br +0 -0
- package/client/assets/SuperscriptTime-Mc0ZGBMo.js.gz +0 -0
- package/client/assets/SuperscriptTime-Mc0ZGBMo.js.map +0 -1
- package/client/assets/TimeElements-dIvFHgcd.js.br +0 -0
- package/client/assets/TimeElements-dIvFHgcd.js.gz +0 -0
- package/client/assets/TimeElements-dIvFHgcd.js.map +0 -1
- package/client/assets/TimeInput-Duzx40TC.js +0 -2
- package/client/assets/TimeInput-Duzx40TC.js.br +0 -0
- package/client/assets/TimeInput-Duzx40TC.js.gz +0 -0
- package/client/assets/TimelinePage-C-OHrCR8.js +0 -2
- package/client/assets/TimelinePage-C-OHrCR8.js.br +0 -0
- package/client/assets/TimelinePage-C-OHrCR8.js.gz +0 -0
- package/client/assets/TimelinePage-C-OHrCR8.js.map +0 -1
- package/client/assets/Timer-CGqVtVEC.js +0 -2
- package/client/assets/Timer-CGqVtVEC.js.br +0 -0
- package/client/assets/Timer-CGqVtVEC.js.gz +0 -0
- package/client/assets/Timer-CGqVtVEC.js.map +0 -1
- package/client/assets/TimerControlExport-DavNxY9p.css.br +0 -0
- package/client/assets/TimerControlExport-GJn4WWdH.js +0 -2
- package/client/assets/TimerControlExport-GJn4WWdH.js.br +0 -0
- package/client/assets/TimerControlExport-GJn4WWdH.js.gz +0 -0
- package/client/assets/TitleCard-BqbrUnHO.js.br +0 -0
- package/client/assets/TitleCard-BqbrUnHO.js.gz +0 -0
- package/client/assets/Tooltip-BQBvaIZx.js.br +0 -0
- package/client/assets/Tooltip-BQBvaIZx.js.gz +0 -0
- package/client/assets/Tooltip-BQBvaIZx.js.map +0 -1
- package/client/assets/ViewLogo-BdL1hUV1.js.br +0 -0
- package/client/assets/ViewLogo-BdL1hUV1.js.gz +0 -0
- package/client/assets/ViewParamsEditor-CFedpp6w.js +0 -2
- package/client/assets/ViewParamsEditor-CFedpp6w.js.br +0 -0
- package/client/assets/ViewParamsEditor-CFedpp6w.js.gz +0 -0
- package/client/assets/ViewParamsEditor-CFedpp6w.js.map +0 -1
- package/client/assets/dateConfig-BU1RZfIK.js.br +0 -0
- package/client/assets/dateConfig-BU1RZfIK.js.gz +0 -0
- package/client/assets/editorSettings-BMt-7s8I.js.br +0 -0
- package/client/assets/editorSettings-BMt-7s8I.js.gz +0 -0
- package/client/assets/getProgress-sdxPEEPi.js.br +0 -0
- package/client/assets/getProgress-sdxPEEPi.js.gz +0 -0
- package/client/assets/index-BuJoGGff.css.br +0 -0
- package/client/assets/index-BuJoGGff.css.gz +0 -0
- package/client/assets/index-CoGiopcb.js +0 -3
- package/client/assets/index-CoGiopcb.js.br +0 -0
- package/client/assets/index-CoGiopcb.js.gz +0 -0
- package/client/assets/index-CoGiopcb.js.map +0 -1
- package/client/assets/offset-BS90Rks2.js.br +0 -0
- package/client/assets/offset-BS90Rks2.js.gz +0 -0
- package/client/assets/parseUserTime-DZJMcfuJ.js.br +0 -0
- package/client/assets/parseUserTime-DZJMcfuJ.js.gz +0 -0
- package/client/assets/playbackstate-CWexoP3a.js.br +0 -0
- package/client/assets/playbackstate-CWexoP3a.js.gz +0 -0
- package/client/assets/presentation.utils-Zo5hNQje.js.br +0 -0
- package/client/assets/presentation.utils-Zo5hNQje.js.gz +0 -0
- package/client/assets/rundownUtils-Dl1x6NDv.js +0 -2
- package/client/assets/rundownUtils-Dl1x6NDv.js.br +0 -0
- package/client/assets/rundownUtils-Dl1x6NDv.js.gz +0 -0
- package/client/assets/timer.utils-BnMyVO6Z.js.br +0 -0
- package/client/assets/timer.utils-BnMyVO6Z.js.gz +0 -0
- package/client/assets/timer.utils-BnMyVO6Z.js.map +0 -1
- package/client/assets/useCustomFields-CcTb-GQM.js.br +0 -0
- package/client/assets/useCustomFields-CcTb-GQM.js.gz +0 -0
- package/client/assets/useFollowComponent-BjhV6Uv8.js.br +0 -0
- package/client/assets/useFollowComponent-BjhV6Uv8.js.gz +0 -0
- package/client/assets/useProjectData-B5mjXsMj.js +0 -2
- package/client/assets/useProjectData-B5mjXsMj.js.br +0 -0
- package/client/assets/useProjectData-B5mjXsMj.js.gz +0 -0
- package/client/assets/useProjectData-B5mjXsMj.js.map +0 -1
- package/client/assets/useReport-zMbyWwpn.js.br +0 -0
- package/client/assets/useReport-zMbyWwpn.js.gz +0 -0
- package/client/assets/useRundown-CHsh5rnl.js +0 -2
- package/client/assets/useRundown-CHsh5rnl.js.br +0 -0
- package/client/assets/useRundown-CHsh5rnl.js.gz +0 -0
- package/client/assets/useRundown-CHsh5rnl.js.map +0 -1
- package/client/assets/useWindowTitle-mLKt65i7.js.br +0 -0
- package/client/assets/useWindowTitle-mLKt65i7.js.gz +0 -0
- package/client/assets/useWindowTitle-mLKt65i7.js.map +0 -1
- package/client/assets/validateEvent-CUmvjN95.js.br +0 -0
- package/client/assets/validateEvent-CUmvjN95.js.gz +0 -0
- package/client/assets/vendor-Cdwxo8bP.js +0 -75
- package/client/assets/vendor-Cdwxo8bP.js.br +0 -0
- package/client/assets/vendor-Cdwxo8bP.js.gz +0 -0
- package/client/assets/viewLoader.utils-DuXjY5zb.js.br +0 -0
- package/client/assets/viewLoader.utils-DuXjY5zb.js.gz +0 -0
- package/client/assets/viewUtils-dKRKkb_F.js.br +0 -0
- package/client/assets/viewUtils-dKRKkb_F.js.gz +0 -0
- package/client/assets/viewUtils-dKRKkb_F.js.map +0 -1
- /package/client/assets/{useProjectData-Cw1aXCwD.css → SwatchPicker-Cw1aXCwD.css} +0 -0
- /package/client/assets/{useProjectData-Cw1aXCwD.css.br → SwatchPicker-Cw1aXCwD.css.br} +0 -0
- /package/client/assets/{useProjectData-Cw1aXCwD.css.gz → SwatchPicker-Cw1aXCwD.css.gz} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CustomTranslationModal-DiQbmcgD.js","./vendor-q6fv0YT2.js","./vendor-4xP-6xVS.css","./index-B81u4hxi.js","./index-D6S93MXv.css","./useWindowTitle-Bpmo_HzW.js","./useWindowTitle-DrFGLRMI.css","./Modal-BKx0PDGT.js","./SwatchPicker-Cm5Eicvv.js","./SwatchPicker-Cw1aXCwD.css","./Modal-D3tAPV2u.css","./StyleEditor-CpciRLYh.js","./StyleEditor-Bie84LSc.css","./RundownExport-EorsanA0.js","./EditorUtils-DuKjlUkF.js","./EditorUtils-L4Sg72o_.css","./ProtectRoute-BH-QvsU0.js","./ProtectRoute-Bm5sjStK.css","./useRundown-Bn6ZPsz0.js","./MilestoneEditor-BA0PVIQh.js","./TimeInput-C8DQoFXv.js","./parseUserTime-YeFR8t3F.js","./TimeInput-Cu-N5DmX.css","./dateConfig-D7xim1t4.js","./validateEvent-Do8yE_DJ.js","./editorSettings-D2f7e1a6.js","./editorSettings-BqHbWs9b.css","./rundownUtils-CtVGQDQn.js","./useCustomFields-k4piRt9n.js","./Select-BGGVCKqU.js","./Select-Cd08aEcf.css","./Tooltip-B5vsLcFu.js","./Tooltip-CKb7gU2M.css","./offset-R98EXhWK.js","./MilestoneEditor-BqNKKlvI.css","./Empty-CJbZxh45.js","./Empty-DvR62o5B.css","./useFollowComponent-B7vvPzG2.js","./RundownExport-Bgtg_idR.css","./TimerControlExport-Dx3SSGNG.js","./useReport-DSuFnUb9.js","./TimerControlExport-cJRa5GUp.css","./MessageControlExport-GmOrvUik.js","./MessageControlExport-D_pNX6Vj.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{h as g,j as e,ac as ss,e as Y,k as vt,ad as ce,ae as Ts,af as As,ag as et,ah as je,T as pe,aa as rt,ai as Fs,y as wt,aj as Is,ak as Ft,f as Ls,O as St,A as $s,al as Vs,am as Ms,an as Ge,ao as Ws,P as qe,C as Ne,ap as ns,aq as rs,ar as Us,as,at as It,au as qs,av as zs,l as is,aw as Bs,$ as Qe,v as Ct,ax as Ks,x as Hs,M as Gs,I as Qs,m as Ys}from"./vendor-q6fv0YT2.js";import{e as be,Q as _t,R as Js,S as Xs,U as tt,s as Zs,V as en,W as Ee,X as Ze,Y as N,Z as Me,_ as Ae,$ as P,a0 as se,a1 as Q,a2 as pt,a3 as tn,a4 as sn,a5 as kt,a6 as nn,a7 as ls,a8 as rn,a9 as A,B as f,aa as ie,ab as Se,ac as Le,ad as ve,ae as oe,af as W,ag as B,ah as M,ai as V,aj as $e,ak as X,al as we,am as at,an,ao as ln,ap as Dt,f as Oe,aq as os,ar as Rt,as as cs,at as ne,x as Lt,O as Re,au as on,av as $t,aw as ds,ax as us,ay as Nt,az as cn,aA as dn,aB as Et,aC as ct,m as Ie,k as un,aD as hn,aE as mn,aF as fe,aG as hs,aH as st,T as Ye,aI as xn,aJ as ms,aK as Vt,aL as jn,aM as pn,aN as gn,aO as We,aP as fn,aQ as yn,b as bn,aR as vn,N as wn,aS as Sn,aT as Cn,aU as _n,a as kn,aV as Dn,aW as Rn,aX as Mt,aY as Nn,aZ as Wt,a_ as En,a$ as Pn}from"./index-B81u4hxi.js";import{P as On}from"./ProtectRoute-BH-QvsU0.js";import{I as me,C as Tn,u as An}from"./useWindowTitle-Bpmo_HzW.js";import{e as Fn,u as it,T as H,t as dt,a as In,b as Ln,d as $n,c as Vn,f as Mn,g as Wn,S as Un,h as qn,D as xs,M as Pt}from"./Modal-BKx0PDGT.js";import{S as ke,a as ut}from"./SwatchPicker-Cm5Eicvv.js";import{i as js,R as ps,s as zn,a as Bn,G as Kn,b as Hn,O as Gn,T as Qn}from"./OverviewWrapper-BQb2xl_N.js";import{e as Yn,f as Jn,g as Xn,i as gs,h as fs,j as Zn,k as er,l as tr,m as sr,r as nr,n as rr,o as ar,p as ir,q as lr}from"./useRundown-Bn6ZPsz0.js";import{S as re}from"./Select-BGGVCKqU.js";import{u as lt,p as or,e as cr,d as dr}from"./useCustomFields-k4piRt9n.js";import{u as ur,d as hr}from"./useReport-DSuFnUb9.js";import{T as gt,u as ys,e as Be}from"./editorSettings-D2f7e1a6.js";import{S as mr,L as xr,T as jr}from"./EditorUtils-DuKjlUkF.js";import{T as bs}from"./Tooltip-B5vsLcFu.js";import{A as vs,T as Ke}from"./TimeInput-C8DQoFXv.js";import{T as Ut,E as ht}from"./validateEvent-Do8yE_DJ.js";import{p as He}from"./parseUserTime-YeFR8t3F.js";import{u as pr,a as gr,b as fr}from"./useProjectData-DdgKoYzk.js";import{S as yr,P as br,O as vr,M as wr,C as Sr}from"./TimeElements-DbclWDbU.js";import"./offset-R98EXhWK.js";import"./SuperscriptPeriod-DsPdWN_s.js";/* empty css */import"./playbackstate-CPQdnF-k.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof bt<"u"?bt:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="2e8249d1-0d18-40a3-bb07-442d7b2a76ea",t._sentryDebugIdIdentifier="sentry-dbid-2e8249d1-0d18-40a3-bb07-442d7b2a76ea")}catch{}})();function Cr(t){return t.trim().replaceAll(" ","_")}const _r={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"},kr=(t,s,n={})=>{const{isDisabled:r=!1}=n,i=g.useCallback(l=>{l.key===s&&!l.repeat&&!r&&(l.preventDefault(),t())},[t,r,s]);g.useEffect(()=>(document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i)}),[i])},Dr="_link_70oau_17",Rr="_inline_70oau_27",qt={link:Dr,inline:Rr};function te({href:t,inline:s,children:n}){const r=i=>{i.preventDefault(),_t(t)};return e.jsxs("a",{href:"#!",target:"_blank",rel:"noreferrer",className:be([qt.link,s&&qt.inline]),onClick:r,children:[n," ",e.jsx(ss,{style:{fontSize:"1em"}})]})}async function Nr(){const t=await Y.get(Js);return{url:t.data.html_url,version:t.data.tag_name}}const zt={url:"",version:"",hasUpdates:!1};function ws(){const{data:t,status:s,isFetching:n,isError:r,refetch:i}=vt({queryKey:en,queryFn:Nr,placeholderData:(c,m)=>c,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:!1,staleTime:Zs,enabled:tt}),l=(t==null?void 0:t.version)&&!t.version.includes(Xs);return{data:t?{...t,hasUpdates:l}:zt,placeholder:zt,status:s,isFetching:n,isError:r,refetch:i}}function Er(){const{data:t,isError:s}=ws();return s?e.jsxs(Ee,{children:[`You are currently using Ontime version ${Ze}`,e.jsx(N,{children:"Could not fetch version information"})]}):t.hasUpdates?e.jsxs(Ee,{children:[`You are currently using Ontime version ${Ze}.`,e.jsx("br",{}),e.jsx("br",{}),`A new version ${t.version} is available.`," ",e.jsx("br",{}),Me?"You can restart your stage to get the latest available version.":e.jsx(te,{href:t.url,children:"Please visit the release page to download"})]}):e.jsx(Ee,{children:`You are currently using the latest version of Ontime: ${Ze}`})}function Pr(){return e.jsxs(e.Fragment,{children:[e.jsx(Ae,{children:"About Ontime"}),e.jsxs(P,{children:[e.jsxs(se,{children:[e.jsx(Q,{children:"Ontime"}),e.jsxs(Ee,{children:["Free, open-source software for managing rundowns and event timers",e.jsx(te,{href:pt,children:"www.getontime.no"})]}),e.jsxs(Ee,{children:["Considering sponsoring our work",e.jsx(te,{href:tn,children:"GitHub Sponsors"}),e.jsx(te,{href:sn,children:"Buy Me a Coffee"})]}),e.jsxs(Ee,{children:["If you are looking for an online version of Ontime, consider trying out our cloud service",e.jsx(te,{href:pt,children:"www.getontime.no"})]})]}),e.jsx(Q,{children:"Current version"}),e.jsx(Er,{}),e.jsx(Q,{children:"Links"}),e.jsx(te,{href:kt,children:"Read the docs"}),e.jsx(te,{href:nn,children:"Follow the project on GitHub"}),e.jsx(te,{href:ls,children:"Discord server"}),e.jsx(te,{href:rn,children:"Subreddit"})]})]})}function ae(t,s){const n=g.useRef(null);return g.useEffect(()=>{s&&n.current&&s===t&&n.current.scrollIntoView({behavior:"smooth",block:"center"})},[s,t]),n}const Or="https://docs.getontime.no/api/protocols/osc/";function Tr({enabledAutomations:t,enabledOscIn:s,oscPortIn:n}){var y,b,v;const{handleSubmit:r,reset:i,register:l,setError:a,watch:c,setValue:m,formState:{errors:o,isSubmitting:u,isDirty:h,isValid:d}}=ce({mode:"onChange",defaultValues:{enabledAutomations:t,enabledOscIn:s,oscPortIn:n},resetOptions:{keepDirtyValues:!1}}),x=async S=>{try{await Fn(S),i(S)}catch(L){const D=V(L);a("root",{message:D})}},j=()=>{i({enabledAutomations:t,enabledOscIn:s,oscPortIn:n})},p=!u&&h&&d;return e.jsxs(se,{children:[e.jsxs(Q,{children:["Automation settings",e.jsxs(A,{children:[e.jsx(f,{variant:"ghosted",onClick:j,disabled:!p,children:"Revert to saved"}),e.jsx(f,{variant:"primary",type:"submit",form:"automation-settings-form",disabled:!p,loading:u,children:"Save"})]})]}),(o==null?void 0:o.root)&&e.jsx(N,{children:o.root.message}),e.jsx(ie,{}),e.jsx(P,{children:e.jsxs(me,{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(te,{href:Or,children:"See the docs"})]})}),e.jsxs(P,{as:"form",id:"automation-settings-form",onSubmit:r(x),onKeyDown:S=>Se(S,j),children:[e.jsx(Le,{isLoading:!1}),e.jsx(ve,{children:"Automation"}),e.jsx(oe,{children:e.jsxs(W,{children:[e.jsx(B,{title:"Enable automations",description:"Allow Ontime to send messages on lifecycle triggers",error:(y=o.enabledAutomations)==null?void 0:y.message}),e.jsx(ke,{size:"large",checked:c("enabledAutomations"),onCheckedChange:S=>m("enabledAutomations",S,{shouldDirty:!0,shouldValidate:!0})})]})}),e.jsx(ve,{children:"OSC Input"}),e.jsxs(oe,{children:[Me&&e.jsx(me,{children:"For security reasons OSC integrations are not available in the cloud service."}),e.jsxs(W,{children:[e.jsx(B,{title:"OSC input",description:"Allow control of Ontime through OSC",error:(b=o.enabledOscIn)==null?void 0:b.message}),e.jsx(ke,{size:"large",checked:c("enabledOscIn"),onCheckedChange:S=>m("enabledOscIn",S,{shouldDirty:!0,shouldValidate:!0})})]}),e.jsxs(W,{children:[e.jsx(B,{title:"Listen on port",description:"Port for incoming OSC. Default: 8888",error:(v=o.oscPortIn)==null?void 0:v.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:js,message:"Value should be numeric"}})})]})]})]})]})}const Ar=["{{human.clock}}","{{human.duration}}","{{human.expectedEnd}}","{{human.runningTimer}}","{{human.elapsedTime}}","{{human.startedAt}}"],Fr=["{{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}}"],Ir=["{{eventNow.id}}","{{eventNow.cue}}","{{eventNow.title}}","{{eventNow.note}}","{{eventNow.timeStart}}","{{eventNow.timeEnd}}","{{eventNow.duration}}","{{eventNow.colour}}","{{eventNow.delay}}"],Lr=["{{eventNext.id}}","{{eventNext.cue}}","{{eventNext.title}}","{{eventNext.note}}","{{eventNext.timeStart}}","{{eventNext.timeEnd}}","{{eventNext.duration}}","{{eventNext.colour}}","{{eventNext.delay}}"];function $r(t){return[...Ar,...Fr,...Ir,...Object.entries(t).map(([s])=>`{{eventNow.custom.${s}}}`),...Lr,...Object.entries(t).map(([s])=>`{{eventNext.custom.${s}}}`)]}function Vr(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 r=s.substring(0,n+1);if(t.endsWith(r))return s.substring(n+1)}return""}function Mr(t){const s=t.lastIndexOf("{{");return s!==-1?t.slice(s):""}const Wr="_wrapper_1dmtf_17",Ur="_suggestions_1dmtf_21",Bt={wrapper:Wr,suggestions:Ur},qr=g.forwardRef(function(s,n){const{value:r,onChange:i,...l}=s,{data:a}=lt(),c=Ts(()=>j(!1)),m=g.useMemo(()=>$r(a),[a]),[o,u]=g.useState(r||""),[h,d]=g.useState([]),[x,j]=g.useState(!1),p=v=>{const S=Mr(v);return m.filter(L=>L.startsWith(S))},y=v=>{u(v.target.value),v.target.value.endsWith("{")?(j(!0),d(p(v.target.value))):v.target.value===""||v.target.value.endsWith("}}")?j(!1):x&&d(p(v.target.value)),i==null||i(v)},b=v=>{u(S=>{const L=Vr(S,v);return S+L}),j(!1)};return e.jsxs("div",{className:Bt.wrapper,ref:As(c,n),children:[e.jsx(M,{value:o,...l,onChange:y,fluid:!0}),x&&h.length>0&&e.jsx("ul",{className:Bt.suggestions,children:h.map(v=>e.jsx("li",{onClick:()=>b(v),children:v},v))})]})}),ft=[{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 Kt(t){return Object.hasOwn(t,"id")}const zr=[{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"}],Br=[{value:"eventNext.id",label:"Next ID"},{value:"eventNext.title",label:"Next Title"},{value:"eventNext.cue",label:"Next Cue"}];function Kr(t){return[...zr,...Object.entries(t).map(([s,{label:n}])=>({value:`eventNow.custom.${s}`,label:`Custom: ${n}`})),...Br,...Object.entries(t).map(([s,{label:n}])=>({value:`eventNext.custom.${s}`,label:`Next custom: ${n}`}))]}function Hr(t){const s={},n=[];for(let r=0;r<t.length;r++){const i=t[r];Object.hasOwn(s,i.trigger)||(s[i.trigger]=[]),s[i.trigger].includes(i.automationId)?n.push(r):s[i.trigger].push(i.automationId)}return n.length>0?n:void 0}const Gr="_outerColumn_1klj0_17",Qr="_innerColumn_1klj0_25",Yr="_ruleSection_1klj0_31",Jr="_titleSection_1klj0_37",Xr="_filterSection_1klj0_38",Zr="_oscSection_1klj0_39",ea="_httpSection_1klj0_40",ta="_actionSection_1klj0_41",sa="_test_1klj0_95",na="_outputCard_1klj0_99",ue={outerColumn:Gr,innerColumn:Qr,ruleSection:Yr,titleSection:Jr,filterSection:Xr,oscSection:Zr,httpSection:ea,actionSection:ta,test:sa,outputCard:na};function ra({index:t,register:s,setValue:n,rowErrors:r,value:i,children:l,watch:a}){var u,h,d,x,j;const[c,m]=g.useState(i),o=p=>{n(`outputs.${t}.action`,p,{shouldDirty:!0}),m(p)};return e.jsxs("div",{className:ue.actionSection,children:[e.jsxs("label",{children:["Action",e.jsx(re,{onValueChange:p=>{p!==null&&o(p)},value:a(`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(N,{children:(u=r==null?void 0:r.action)==null?void 0:u.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(N,{children:(h=r==null?void 0:r.time)==null?void 0:h.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(N,{children:(d=r==null?void 0:r.text)==null?void 0:d.message})]}),e.jsxs("label",{children:["Visibility",e.jsx(re,{onValueChange:p=>{const y=p===null?void 0:p;n(`outputs.${t}.visible`,y,{shouldDirty:!0})},value:a(`outputs.${t}.visible`),options:[{value:null,label:"Untouched"},{value:!0,label:"Show"},{value:!1,label:"Hide"}]}),e.jsx(N,{children:(x=r==null?void 0:r.visible)==null?void 0:x.message})]})]}),c==="message-secondary"&&e.jsxs("label",{children:["Timer secondary source",e.jsx(re,{onValueChange:p=>{if(p!==null){if(p==="null"){n(`outputs.${t}.secondarySource`,null,{shouldDirty:!0});return}n(`outputs.${t}.secondarySource`,p,{shouldDirty:!0})}},value:a(`outputs.${t}.secondarySource`),options:[{value:null,label:"Select secondary source",disabled:!0},{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(N,{children:(j=r==null?void 0:r.secondarySource)==null?void 0:j.message})]}),e.jsx("div",{className:ue.test,children:l})]})}const aa="https://docs.getontime.no/api/automation/#using-variables-in-automation";function ia({automation:t,onClose:s}){var K;const n=Kt(t),{data:r}=lt(),{refetch:i}=it(),l=g.useMemo(()=>Kr(r),[r]),{control:a,handleSubmit:c,getValues:m,register:o,setError:u,setFocus:h,setValue:d,watch:x,formState:{errors:j,isSubmitting:p,isDirty:y,isValid:b}}=ce({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:v,append:S,remove:L}=et({name:"filters",control:a}),{fields:D,append:O,remove:U}=et({name:"outputs",control:a});g.useEffect(()=>{h("title")},[h]);const w=()=>{S({field:"",operator:"equals",value:""})},$=()=>{O({type:"osc",targetIP:"",targetPort:void 0,address:"",args:""})},_=()=>{O({type:"http",url:""})},G=()=>{O({type:"ontime",action:"aux1-start"})},q=async I=>{try{const k=m(`outputs.${I}`);if(!k.targetIP||!k.targetPort||!k.address)return;await dt({type:"osc",targetIP:k.targetIP,targetPort:k.targetPort,address:k.address,args:k.args})}catch{}},F=async I=>{try{const k=m(`outputs.${I}`);if(!k.url)return;await dt({type:"http",url:k.url})}catch{}},E=async I=>{try{const k=m(`outputs.${I}`);await dt({...k,type:"ontime"})}catch{}},T=async I=>{Kt(t)?await k(t.id,{id:t.id,...I}):await ge(I),i();async function k(de,le){try{await In(de,le),s()}catch(C){u("root",{message:V(C)})}}async function ge(de){try{await Ln(de),s()}catch(le){u("root",{message:V(le)})}}},R=!p&&y&&b;return e.jsxs($e,{as:"form",name:"automation-form",onSubmit:c(T),className:ue.outerColumn,onKeyDown:I=>Se(I,s),children:[e.jsx(Q,{children:n?"Edit automation":"Create automation"}),e.jsxs("div",{className:ue.innerSection,children:[e.jsx("h3",{children:"Automation options"}),e.jsxs("div",{className:ue.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(N,{children:(K=j.title)==null?void 0:K.message})]})]}),e.jsxs("div",{className:ue.innerSection,children:[e.jsx("h3",{children:"Filters (optional)"}),e.jsxs("div",{className:ue.ruleSection,children:[e.jsxs("label",{children:["Trigger outputs if",e.jsx(ps,{orientation:"horizontal",value:x("filterRule"),onValueChange:I=>d("filterRule",I,{shouldDirty:!0}),items:[{value:"all",label:"All filters pass"},{value:"any",label:"Any filter passes"}]})]}),v.map((I,k)=>{var de,le,C,Z,_e,De;const ge=`filters.${k}.field.${I.id}`;return e.jsxs("div",{className:ue.filterSection,children:[e.jsxs("label",{children:["Runtime data source",e.jsx(re,{value:x(`filters.${k}.field`)||null,onValueChange:xe=>{xe!==null&&d(`filters.${k}.field`,xe,{shouldDirty:!0})},options:l.map(({value:xe,label:J})=>({value:xe,label:J,disabled:xe===null})),"aria-label":"Event field"}),e.jsx(N,{children:(C=(le=(de=j.filters)==null?void 0:de[k])==null?void 0:le.field)==null?void 0:C.message})]}),e.jsxs("label",{children:["Matching condition",e.jsx(re,{value:x(`filters.${k}.operator`),onValueChange:xe=>{xe!==null&&d(`filters.${k}.operator`,xe,{shouldDirty:!0})},options:[{value:"equals",label:"equals"},{value:"not_equals",label:"not equals"},{value:"contains",label:"contains"}],"aria-label":"Operator"}),e.jsx(N,{children:(De=(_e=(Z=j.filters)==null?void 0:Z[k])==null?void 0:_e.operator)==null?void 0:De.message})]}),e.jsxs("label",{children:["Value to match",e.jsx(M,{...o(`filters.${k}.value`),fluid:!0,placeholder:"<empty / no value>"})]}),e.jsxs("div",{children:[e.jsx("span",{children:" "}),e.jsx("div",{children:e.jsx(X,{"aria-label":"Delete",variant:"ghosted-destructive",onClick:()=>L(k),children:e.jsx(je,{})})})]})]},ge)}),e.jsx("div",{children:e.jsxs(f,{type:"submit",onClick:w,children:["Add filter ",e.jsx(pe,{})]})})]})]}),e.jsxs("div",{className:ue.innerColumn,children:[e.jsx("h3",{children:"Outputs"}),e.jsxs(me,{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(te,{href:aa,children:"See the documentation for templates"})]}),D.map((I,k)=>{var ge,de,le,C,Z,_e,De,xe;if(Yn(I)){const J=(ge=j.outputs)==null?void 0:ge[k];return e.jsxs("div",{className:ue.outputCard,children:[e.jsx(H,{children:"OSC"}),e.jsxs("div",{className:ue.oscSection,children:[e.jsxs("label",{children:["Target IP",e.jsx(M,{...o(`outputs.${k}.targetIP`,{required:{value:!0,message:"Required field"}}),fluid:!0,placeholder:"127.0.0.1"}),e.jsx(N,{children:(de=J==null?void 0:J.targetIP)==null?void 0:de.message})]}),e.jsxs("label",{children:["Target Port",e.jsx(M,{...o(`outputs.${k}.targetPort`,{required:{value:!0,message:"Required field"},setValueAs:At=>At===""?0:Number(At),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(N,{children:(le=J==null?void 0:J.targetPort)==null?void 0:le.message})]}),e.jsxs("label",{children:["Address",e.jsx(M,{...o(`outputs.${k}.address`),fluid:!0,placeholder:"/cue/start"}),e.jsx(N,{children:(C=J==null?void 0:J.address)==null?void 0:C.message})]}),e.jsxs("label",{children:["Arguments",e.jsx(qr,{...o(`outputs.${k}.args`),value:I.args,placeholder:"1"}),e.jsx(N,{children:(Z=J==null?void 0:J.args)==null?void 0:Z.message})]}),e.jsxs("div",{children:[e.jsx("span",{children:" "}),e.jsxs(A,{relation:"inner",children:[e.jsx(f,{variant:"ghosted-white",onClick:()=>q(k),children:"Test"}),e.jsx(X,{"aria-label":"Delete",variant:"ghosted-destructive",onClick:()=>U(k),children:e.jsx(je,{})})]})]})]})]},I.id)}if(Jn(I)){const J=(_e=j.outputs)==null?void 0:_e[k];return e.jsxs("div",{className:ue.outputCard,children:[e.jsx(H,{children:"HTTP"}),e.jsxs("div",{className:ue.httpSection,children:[e.jsxs("label",{children:["Target URL",e.jsx(M,{...o(`outputs.${k}.url`,{required:{value:!0,message:"Required field"},pattern:{value:zn,message:"HTTP messages should target http:// or https://"}}),fluid:!0,placeholder:"http://127.0.0.1/start/1"}),e.jsx(N,{children:(De=J==null?void 0:J.url)==null?void 0:De.message})]}),e.jsxs("div",{children:[e.jsx("span",{children:" "}),e.jsxs(A,{relation:"inner",children:[e.jsx(f,{variant:"ghosted-white",onClick:()=>F(k),children:"Test"}),e.jsx(X,{"aria-label":"Delete",variant:"ghosted-destructive",onClick:()=>U(k),children:e.jsx(je,{})})]})]})]})]},I.id)}if(Xn(I)){const J=(xe=j.outputs)==null?void 0:xe[k];return e.jsxs("div",{className:ue.outputCard,children:[e.jsx(H,{children:"Ontime action"}),e.jsxs(ra,{value:I.action,index:k,register:o,rowErrors:J,setValue:d,watch:x,children:[e.jsx("span",{children:" "}),e.jsxs(A,{relation:"inner",children:[e.jsx(f,{variant:"ghosted-white",onClick:()=>E(k),children:"Test"}),e.jsx(X,{"aria-label":"Delete",variant:"ghosted-destructive",onClick:()=>U(k),children:e.jsx(je,{})})]})]})]},I.id)}return null}),e.jsxs(A,{relation:"inner",children:[e.jsxs(f,{onClick:$,children:["OSC ",e.jsx(pe,{})]}),e.jsxs(f,{onClick:_,children:["HTTP ",e.jsx(pe,{})]}),e.jsxs(f,{onClick:G,children:["Ontime action ",e.jsx(pe,{})]})]})]}),e.jsxs(A,{align:"end",children:[(j==null?void 0:j.root)&&e.jsx(N,{children:j.root.message}),e.jsx(f,{onClick:s,children:"Cancel"}),e.jsx(f,{variant:"primary",type:"submit",disabled:!R,loading:p,children:"Save"})]})]})}const Ht={title:"",filterRule:"all",filters:[],outputs:[]};function la(t){const{automations:s}=t,{refetch:n}=it(),[r,i]=g.useState(null),[l,a]=g.useState(null),c=async o=>{try{a(null),await $n(o)}catch(u){a(V(u))}finally{n()}},m=Object.keys(s);return e.jsxs(se,{children:[e.jsxs(Q,{children:["Manage automations",e.jsxs(f,{type:"submit",disabled:!!r,onClick:()=>i(Ht),children:["New ",e.jsx(pe,{})]})]}),e.jsx(ie,{}),r!==null&&e.jsx(ia,{automation:r,onClose:()=>i(null)}),e.jsxs(we,{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:[m.length===0&&e.jsx(at,{handleClick:r?void 0:()=>i(Ht)}),m.map(o=>Object.hasOwn(s,o)?e.jsx(g.Fragment,{children:e.jsxs("tr",{children:[e.jsx("td",{children:s[o].title}),e.jsx("td",{children:e.jsx(H,{children:s[o].filterRule})}),e.jsx("td",{children:s[o].filters.length}),e.jsx("td",{children:s[o].outputs.length}),e.jsxs(A,{align:"end",relation:"inner",as:"td",children:[e.jsx(X,{variant:"ghosted-white","aria-label":"Edit entry",onClick:()=>i(s[o]),children:e.jsx(rt,{})}),e.jsx(X,{variant:"ghosted-destructive","aria-label":"Delete entry",onClick:()=>c(o),children:e.jsx(je,{})})]})]})},o):null),l&&e.jsx("tr",{children:e.jsx("td",{colSpan:5,children:e.jsx(N,{children:l})})})]})]})]})}function Ss({automations:t,initialId:s,initialTitle:n,initialAutomationId:r,initialTrigger:i,onCancel:l,postSubmit:a}){var L,D,O,U;const{handleSubmit:c,register:m,setFocus:o,setError:u,watch:h,setValue:d,formState:{errors:x,isSubmitting:j,isValid:p,isDirty:y}}=ce({defaultValues:{title:n,trigger:i??ft[0].value,automationId:r??((L=t==null?void 0:t[Object.keys(t)[0]])==null?void 0:L.id)},resetOptions:{keepDirtyValues:!0}});g.useEffect(()=>{o("title")},[o]);const b=async w=>{if(s){try{await Vn(s,{id:s,...w}),a()}catch($){u("root",{message:`Failed to save changes to trigger ${V($)}`})}return}try{await Mn(w),a()}catch($){u("root",{message:`Failed to save trigger ${V($)}`})}},v=Object.keys(t).map(w=>({value:w,label:t[w].title})),S=y&&p;return e.jsxs($e,{as:"form",name:"trigger-form",onSubmit:c(b),onKeyDown:w=>Se(w,l),children:[e.jsx(Q,{children:s?"Edit trigger":"Create trigger"}),e.jsxs("label",{children:["Title",e.jsx(M,{...m("title",{required:{value:!0,message:"Required field"}}),fluid:!0,defaultValue:n}),e.jsx(N,{children:(D=x.title)==null?void 0:D.message})]}),e.jsxs("label",{children:["Lifecycle trigger",e.jsx(re,{value:h("trigger"),onValueChange:w=>{w!==null&&d("trigger",w,{shouldDirty:!0})},options:ft.map(w=>({value:w.value,label:w.label})),"aria-label":"Lifecycle trigger"}),e.jsx(N,{children:(O=x.trigger)==null?void 0:O.message})]}),e.jsxs("label",{children:["Automation title",e.jsx(re,{value:h("automationId"),onValueChange:w=>{w!==null&&d("automationId",w,{shouldDirty:!0})},options:v,"aria-label":"Automation title"}),e.jsx(N,{children:(U=x.automationId)==null?void 0:U.message})]}),e.jsxs(A,{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 oa(t){var h,d;const{automations:s,id:n,title:r,trigger:i,automationId:l,duplicate:a,handleDelete:c,postSubmit:m}=t,[o,u]=g.useState(!1);return o?e.jsx("tr",{children:e.jsx("td",{colSpan:99,children:e.jsx(Ss,{automations:s,initialId:n,initialTitle:r,initialTrigger:i,initialAutomationId:l,onCancel:()=>u(!1),postSubmit:()=>{u(!1),m()}})})}):e.jsxs("tr",{"data-warn":a,children:[e.jsxs(A,{as:"td",relation:"inner",children:[a&&e.jsx(Fs,{color:"#FFBC56"}),r]}),e.jsx("td",{children:e.jsx(H,{children:(h=ft.find(x=>x.value===i))==null?void 0:h.label})}),e.jsx("td",{children:e.jsx(H,{children:(d=s==null?void 0:s[l])==null?void 0:d.title})}),e.jsxs(A,{align:"end",relation:"inner",as:"td",children:[e.jsx(X,{variant:"ghosted-white","aria-label":"Edit entry",onClick:()=>u(!0),children:e.jsx(rt,{})}),e.jsx(X,{variant:"ghosted-destructive","aria-label":"Delete entry",onClick:c,children:e.jsx(je,{})})]})]})}function ca(t){const{triggers:s,automations:n}=t,[r,i]=g.useState(!1),{refetch:l}=it(),[a,c]=g.useState(null),m=async d=>{try{await Wn(d)}catch(x){c(V(x))}finally{l()}},o=()=>{i(!1),l()},u=g.useMemo(()=>Hr(s),[s]),h=Object.keys(n).length>0;return e.jsxs(se,{children:[e.jsxs(Q,{children:["Manage triggers",e.jsxs(f,{type:"submit",form:"trigger-form",disabled:!h,loading:!1,onClick:()=>i(!0),children:["New ",e.jsx(pe,{})]})]}),e.jsx(ie,{}),e.jsxs(P,{children:[u&&e.jsx(N,{children:"You have created multiple links between the same trigger and automation which can performance issues."}),r&&e.jsx(Ss,{automations:n,onCancel:()=>i(!1),postSubmit:o}),e.jsxs(we,{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:[!r&&s.length===0&&e.jsx(at,{label:"Create an automation to attach triggers to",handleClick:h?()=>i(!0):void 0}),s.map((d,x)=>e.jsxs(g.Fragment,{children:[e.jsx(oa,{automations:n,id:d.id,title:d.title,trigger:d.trigger,automationId:d.automationId,duplicate:u==null?void 0:u.includes(x),handleDelete:()=>m(d.id),postSubmit:o}),a&&e.jsx("tr",{children:e.jsx("td",{colSpan:5,children:e.jsx(N,{children:a})})})]},d.id))]})]})]})]})}function da({location:t}){const{data:s,status:n}=it(),r=ae("settings",t),i=ae("triggers",t),l=ae("automations",t),a=n==="pending";return e.jsxs(e.Fragment,{children:[e.jsx(Ae,{children:"Automation"}),e.jsxs(P,{children:[e.jsx(Le,{isLoading:a}),e.jsx("div",{ref:r,children:e.jsx(Tr,{enabledAutomations:s.enabledAutomations,enabledOscIn:s.enabledOscIn,oscPortIn:s.oscPortIn})}),e.jsx("div",{ref:l,children:e.jsx(la,{automations:s.automations})}),e.jsx("div",{ref:i,children:e.jsx(ca,{triggers:s.triggers,automations:s.automations})})]})]})}const ua="_goIcon_1fzu7_17",ha={goIcon:ua};function ma(){const{data:t}=an(),s=n=>_t(n);return e.jsx(A,{children:t.networkInterfaces.map(n=>{if(n.name==="localhost"&&!tt)return null;const r=ln(n.address);return e.jsxs(Dt,{copyValue:r,onClick:()=>s(r),children:[`${n.name} - ${n.address}`," ",e.jsx(wt,{className:ha.goIcon})]},n.name)})})}function xa(t){return Is(t)}function ja(t,s,n){if(Object.keys(t).length===0)return[];if(n.length===0)return[];const r=[];let i=1;for(let l=0;l<n.length;l++){const a=n[l],c=s[a];!c||!gs(c)||(a in t||r.push({id:a,index:i,title:c.title,cue:c.cue,scheduledStart:c.timeStart,actualEnd:null,scheduledEnd:c.timeEnd,actualStart:null}),a in t&&r.push({id:a,index:i,title:c.title,cue:c.cue,scheduledStart:c.timeStart,actualEnd:t[a].endedAt,scheduledEnd:c.timeEnd,actualStart:t[a].startedAt}),i++)}return r}const pa=["Index","Title","Cue","Scheduled Start","Actual Start","Scheduled End","Actual End"];function ga(t){const s=[];s.push(pa);for(const n of t)s.push([String(n.index),n.title,n.cue,Oe(n.scheduledStart),Oe(n.actualStart),Oe(n.scheduledEnd),Oe(n.actualEnd)]);return xa(s)}const fa="_blink_15peo_1",ya="_fourtyfive_15peo_13",ba="_over_15peo_17",va="_under_15peo_21",Je={blink:fa,fourtyfive:ya,over:ba,under:va};function wa(){const{data:t}=ur(),{data:s}=fs(),n=async()=>await hr(),r=l=>{if(!l)return;const a=ga(l),c=os(a,"text/csv;charset=utf-8;");Rt(c,"ontime-report.csv")},i=g.useMemo(()=>ja(t,s.entries,s.flatOrder),[t,s.entries,s.flatOrder]);return e.jsx(P,{children:e.jsxs(se,{children:[e.jsx(Q,{children:"Report"}),e.jsx(ie,{}),e.jsx(P,{children:e.jsxs(ve,{children:["Manage report",e.jsxs(A,{children:[e.jsxs(f,{onClick:()=>r(i),disabled:i.length===0,children:[e.jsx(Ft,{}),"Export CSV"]}),e.jsxs(f,{variant:"subtle-destructive",onClick:n,disabled:i.length===0,children:[e.jsx(Ft,{}),"Clear All"]})]})]})}),e.jsx(P,{children:e.jsxs(we,{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(at,{label:"Reports are generated when running through the show."}),i.map(l=>{const a=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:be([a&&Je[a]]),children:Oe(l.scheduledStart)}),e.jsx("th",{className:be([a&&Je[a]]),children:Oe(l.actualStart)}),e.jsx("th",{className:be([c&&Je[c]]),children:Oe(l.scheduledEnd)}),e.jsx("th",{className:be([c&&Je[c]]),children:Oe(l.actualEnd)})]},l.id)})]})]})})]})})}const Sa="_expand_1sy0c_17",Ca="_column_1sy0c_21",Gt={expand:Sa,column:Ca},_a=[{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"}],ka={alias:"",target:Re.Timer,search:"",enabled:!0};function Da({urlPreset:t,onClose:s}){var D,O,U;const{addPreset:n,updatePreset:r,isMutating:i}=cs(),{handleSubmit:l,register:a,setFocus:c,setError:m,clearErrors:o,setValue:u,getValues:h,watch:d,formState:{errors:x,isSubmitting:j,isValid:p,isDirty:y}}=ce({defaultValues:t??ka,mode:"onChange",resetOptions:{keepDirtyValues:!0}}),b=g.useRef(null),v=async w=>{try{t?await r(t.alias,w):await n(w),s()}catch($){m("root",{message:V($)})}};g.useEffect(()=>{c("alias")},[c]);const S=()=>{var w;o();try{const $=on(h("alias"),((w=b.current)==null?void 0:w.value.trim())??"");u("target",$.target,{shouldDirty:!0,shouldValidate:!0}),u("search",$.search,{shouldDirty:!0,shouldValidate:!0})}catch($){m("root",{message:$t($)});return}},L=w=>{try{return new URLSearchParams(w),!0}catch($){return $t($)||"Invalid URL parameters"}};return e.jsxs($e,{as:"form",onSubmit:l(v),onKeyDown:w=>Se(w,s),className:Gt.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(A,{children:[e.jsxs("div",{children:[e.jsx(ne,{children:"Alias"}),e.jsx(M,{...a("alias",{required:"Alias is required",pattern:{value:Bn,message:"Field can only contain URL safe characters (a-z, 0-9, _ and -)"}})})]}),e.jsxs("div",{className:Gt.expand,children:[e.jsx(ne,{children:"Generate options (paste URL to generate options)"}),e.jsxs(A,{children:[e.jsx(M,{placeholder:"Paste URL",fluid:!0,ref:b}),e.jsx(f,{onClick:S,children:"Generate"})]})]})]}),((D=x.alias)==null?void 0:D.message)&&e.jsx(N,{children:x.alias.message}),e.jsxs("div",{children:[Lt," or ",Lt]}),e.jsx("div",{children:"2. Choose a view and its parameters"}),e.jsxs("div",{children:[e.jsx(ne,{children:"Target"}),e.jsx(re,{options:_a,...a("target",{required:"Target is required"}),value:d("target"),onValueChange:w=>{w!==null&&u("target",w,{shouldDirty:!0})}})]}),e.jsxs("div",{children:[e.jsx(ne,{children:"Parameters"}),e.jsx(gt,{fluid:!0,rows:3,...a("search",{validate:L})}),e.jsx(N,{children:(O=x.search)==null?void 0:O.message})]}),e.jsxs("div",{children:[e.jsx(N,{children:(U=x.root)==null?void 0:U.message}),e.jsxs(A,{align:"end",children:[e.jsx(f,{onClick:s,children:"Cancel"}),e.jsx(f,{variant:"primary",type:"submit",disabled:!p||!y,loading:j||i,children:"Save"})]})]})]})}const Ra="https://docs.getontime.no/features/url-presets/";function Na(){const[t,s]=g.useState({isOpen:!1,preset:void 0}),{data:n,status:r}=ds(),{deletePreset:i,isMutating:l}=cs(),a=()=>s({isOpen:!0}),c=o=>s({isOpen:!0,preset:o}),m=()=>s({isOpen:!1,preset:void 0});return e.jsx(P,{children:e.jsxs(se,{children:[e.jsxs(Q,{children:["URL presets",e.jsxs(f,{onClick:a,children:["New ",e.jsx(pe,{})]})]}),e.jsx(ie,{}),e.jsx(P,{children:e.jsxs(me,{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(te,{href:Ra,children:"See the docs"})]})}),e.jsxs(P,{children:[e.jsx(Le,{isLoading:r==="pending"}),t.isOpen&&e.jsx(Da,{urlPreset:t.preset,onClose:m}),e.jsxs(we,{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(at,{handleClick:a}),n.map((o,u)=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx(ke,{defaultChecked:o.enabled,onCheckedChange:()=>{}})}),e.jsx("td",{children:e.jsx(H,{children:o.target})}),e.jsx("td",{style:{width:"100%"},children:o.alias}),e.jsxs(A,{relation:"inner",as:"td",children:[e.jsx(X,{variant:"ghosted-white",onClick:h=>us(o.alias,h),disabled:l,children:e.jsx(ss,{})}),e.jsx(X,{onClick:()=>c(o),variant:"ghosted-white","aria-label":"Edit entry","data-testid":`field__edit_${u}`,disabled:l,children:e.jsx(rt,{})}),e.jsx(X,{onClick:()=>i(o.alias),variant:"ghosted-destructive","aria-label":"Delete entry","data-testid":`field__delete_${u}`,disabled:l,children:e.jsx(je,{})})]})]},o.alias))]})]})]})]})})}function Ea({location:t}){const s=ae("presets",t),n=ae("link",t),r=ae("report",t);return e.jsxs(e.Fragment,{children:[e.jsx(Ae,{children:"Sharing and reporting"}),e.jsx("div",{ref:s,children:e.jsx(Na,{})}),e.jsx("div",{ref:n,children:e.jsx(P,{children:e.jsxs(se,{children:[e.jsx(Q,{children:"Share Ontime Link"}),!Me&&e.jsxs(e.Fragment,{children:[e.jsx(Ee,{children:"Ontime is streaming on the following network interfaces"}),e.jsx(ma,{})]}),e.jsx(ie,{}),e.jsx(Kn,{})]})})}),e.jsx("div",{ref:r,children:e.jsx(wa,{})})]})}const Ot=`${Nt}/excel`;async function Pa(t){const s=new FormData;return s.append("excel",t),(await Y.post(`${Ot}/upload`,s,{headers:{"Content-Type":"multipart/form-data"}})).data}async function Oa(t){return(await Y.post(`${Ot}/preview`,{options:t})).data}async function Ta(t,s){try{const n=await Y.get(`${Ot}/${t}/export`,{responseType:"blob"});Rt(n.data,`${s??"Ontime_rundown"}.xlsx`)}catch(n){console.error("Error downloading file:",n)}}const Ue=`${Nt}/sheets`,Aa=async()=>(await Y.get(`${Ue}/connect`)).data,Fa=async(t,s)=>{const n=new FormData;return n.append("client_secret",t),(await Y.post(`${Ue}/${s}/connect`,n,{headers:{"Content-Type":"multipart/form-data"}})).data},Ia=async()=>(await Y.post(`${Ue}/revoke`)).data,La=async(t,s)=>(await Y.post(`${Ue}/${t}/read`,{options:s})).data,Cs=async t=>(await Y.post(`${Ue}/${t}/worksheets`)).data,$a=async(t,s)=>(await Y.post(`${Ue}/${t}/write`,{options:s})).data;function Va(t){if(!Ma(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 _s(t){if(!Wa(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 Ma(t){return t==null?void 0:t.name.endsWith(".xlsx")}function Wa(t){return t==null?void 0:t.name.endsWith(".json")}function Ua(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 Ce=`${Nt}/db`;function ks(t){return Y.post(`${Ce}/download`,{filename:t})}async function qa(t){try{const{data:s,name:n}=await Ja(t),r=JSON.stringify(s,null,2),i=os(r,"application/json;charset=utf-8;");Rt(i,`${n}.json`)}catch(s){console.error(s)}}async function Ds(t){const s=new FormData;return s.append("project",t),(await Y.post(`${Ce}/upload`,s,{headers:{"Content-Type":"multipart/form-data"}})).data}async function Rs(t){return await Y.patch(Ce,t)}async function za(t){return(await Y.post(`${Ce}/new`,t)).data}async function Ba(t){return(await Y.post(`${Ce}/quick`,t)).data}async function Ka(){return(await Y.get(`${Ce}/all`)).data}async function Ns(t){return(await Y.post(`${Ce}/load`,{filename:t})).data}async function Ha(){return(await Y.post(`${Ce}/demo`)).data}async function Ga(t,s){const n=`${Ce}/${t}/duplicate`,r=decodeURIComponent(n);return(await Y.post(r,{newFilename:s})).data}async function Qa(t,s){const n=`${Ce}/${t}/rename`,r=decodeURIComponent(n);return(await Y.put(r,{newFilename:s})).data}async function Ya(t){const s=`${Ce}/${t}`,n=decodeURIComponent(s);return(await Y.delete(n)).data}async function Ja(t){const s=await ks(t),n=s.headers["Content-Disposition"];let r=t;if(n!=null){const i=n.indexOf('"')+1,l=n.lastIndexOf('"');r=n.substring(i,l)}return{data:s.data,name:r}}const Xa={authenticate:{available:!1,error:""},sheetId:{available:!1,error:""},worksheet:{available:!1,error:""},pullPush:{available:!1,error:""}},Qt={stepData:Xa,worksheetNames:null,sheetId:null,authenticationStatus:"not_authenticated",rundown:null,customFields:null,summary:null,spreadsheetImportMap:_r},z=Ls((t,s)=>({...Qt,patchStepData:n=>{const r=s().stepData;t({stepData:{...r,...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,r)=>{const i=s().spreadsheetImportMap;i[n]!==r&&(i[n]=r)},reset:()=>t(Qt),resetPreview:()=>t({rundown:null,customFields:null,summary:null})}));function ot(){const t=St(),s=z(h=>h.patchStepData),n=z(h=>h.setRundown),r=z(h=>h.setCustomFields),i=z(h=>h.setSummary);return{connect:async(h,d)=>{try{return await Fa(h,d)}catch(x){s({authenticate:{available:!1,error:V(x)}})}},revoke:async()=>{try{return await Ia()}catch(h){s({authenticate:{available:!1,error:V(h)}})}},verifyAuth:async()=>{try{return await Aa()}catch(h){s({authenticate:{available:!1,error:V(h)}})}},importRundownPreview:async(h,d)=>{try{const x=await La(h,d);n(x.rundown),r(x.customFields),i(x.summary)}catch(x){s({pullPush:{available:!0,error:V(x)}})}},importRundown:async(h,d)=>{try{await Rs({rundowns:h,customFields:d}),await t.invalidateQueries({queryKey:[cn,dn]})}catch(x){s({pullPush:{available:!0,error:V(x)}})}},exportRundown:async(h,d)=>{try{await $a(h,d),s({pullPush:{available:!1,error:""}})}catch(x){s({pullPush:{available:!0,error:V(x)}})}}}}const yt={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 Za(t){return typeof t!="object"||t===null?!1:Object.keys(yt).every(n=>Object.hasOwn(t,n))}function Yt(t){const s=t.custom.reduce((n,{ontimeName:r,importName:i})=>(r&&i&&(n[r.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 ei(t){localStorage.setItem("import-options",JSON.stringify(t))}function ti(){const t=localStorage.getItem("import-options");if(!t)throw new Error("no import options found");return JSON.parse(t)}function si(){try{const t=ti();return Za(t)?t:yt}catch{return yt}}const ni="_uploadSection_10owf_17",ri="_finishSection_10owf_18",ai="_error_10owf_40",ii="_success_10owf_43",li="_singleActionCell_10owf_47",Te={uploadSection:ni,finishSection:ri,error:ai,success:ii,singleActionCell:li};function oi({hasErrors:t,isSpreadsheet:s,onCancel:n,onSubmitExport:r,onSubmitImport:i}){const l=si(),{revoke:a}=ot(),{control:c,handleSubmit:m,register:o,setValue:u,watch:h,formState:{errors:d,isValid:x}}=ce({mode:"onChange",defaultValues:l,values:l}),{fields:j,append:p,remove:y}=et({control:c,name:"custom"}),b=z(E=>E.stepData),v=z(E=>E.worksheetNames),[S,L]=g.useState("");g.useEffect(()=>{!v||v.length===0||v.includes(l.Worksheet)||u("Worksheet",v[0],{shouldValidate:!0,shouldDirty:!0})},[v,u,l.Worksheet]);const D=async E=>{L("export");const T=Yt(E);await r(T),L("")},O=async()=>{await a(),n()},U=async E=>{L("import");const T=Yt(E);ei(E),await i(T),L("")},w=E=>{y(E)},$=()=>{p({})},_=!!S,G=s&&!_,q=!_&&!b.worksheet.error,F=!t&&x&&(G||q);return e.jsxs(P,{as:"form",id:"import-map",children:[e.jsxs(ve,{children:["Import options",e.jsxs(A,{children:[!s&&e.jsx(bs,{text:"Revoke the google authentication",render:e.jsx(f,{}),onClick:O,disabled:_,children:"Revoke"}),e.jsx(f,{onClick:n,disabled:_,children:"Cancel"}),!s&&e.jsx(f,{variant:"primary",onClick:m(D),disabled:!q,loading:S==="export",children:"Export"}),e.jsx(f,{variant:"primary",onClick:m(U),disabled:!F,loading:S==="import",children:"Import preview"})]})]}),e.jsxs(me,{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(we,{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:Te.singleActionCell})]})}),e.jsxs("tbody",{children:[Object.entries(l).map(([E,T])=>E==="custom"?null:E==="Worksheet"?e.jsxs("tr",{children:[e.jsx("td",{children:E}),e.jsx("td",{children:e.jsx(re,{id:T,value:h(E),onValueChange:R=>{R!==null&&u(E,R,{shouldDirty:!0})},options:(v==null?void 0:v.map(R=>({value:R,label:R})))||[]})}),e.jsx("td",{className:Te.singleActionCell})]},T):e.jsxs("tr",{children:[e.jsx("td",{children:E}),e.jsx("td",{children:e.jsx(M,{id:T,fluid:!0,maxLength:25,defaultValue:T,placeholder:"Use default column name",...o(E)})}),e.jsx("td",{className:Te.singleActionCell})]},T)),j.map((E,T)=>{var ge,de,le;const R=E.ontimeName,K=E.importName,I=(le=(de=(ge=d.custom)==null?void 0:ge[T])==null?void 0:de.ontimeName)==null?void 0:le.message,k=`custom.${T}.ontimeName`;return e.jsxs("tr",{children:[e.jsxs("td",{children:[e.jsx(M,{maxLength:25,fluid:!0,defaultValue:R,placeholder:"Name of the field as shown in Ontime",...o(`custom.${T}.ontimeName`,{validate:C=>Et.isAlphanumericWithSpace(C)?!0:"Only alphanumeric characters and space are allowed"})}),I&&e.jsx(N,{children:I})]}),e.jsx("td",{children:e.jsx(M,{maxLength:25,fluid:!0,defaultValue:K,placeholder:"Name of the column in the spreadsheet",...o(`custom.${T}.importName`)})}),e.jsx("td",{className:Te.singleActionCell,children:e.jsx(X,{variant:"ghosted-destructive","aria-label":"Delete entry",onClick:()=>w(T),children:e.jsx(je,{})})})]},k)}),e.jsxs("tr",{children:[e.jsx("td",{}),e.jsx(A,{as:"td",align:"end",children:e.jsxs(f,{onClick:$,children:["Add custom field ",e.jsx(pe,{})]})}),e.jsx("td",{})]})]})]}),e.jsx(N,{children:b.worksheet.error})]})}const ci="https://docs.getontime.no/features/import-spreadsheet-gsheet/";function di(){return e.jsxs(me,{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(te,{href:ci,children:"See the docs"})]})}function ui(t){const{onCancel:s}=t,{revoke:n,connect:r,verifyAuth:i}=ot(),[l,a]=g.useState(null),[c,m]=g.useState(null),[o,u]=g.useState(""),[h,d]=g.useState(""),x=z(R=>R.sheetId),j=z(R=>R.setSheetId),p=z(R=>R.setWorksheets),y=z(R=>R.patchStepData),b=z(R=>R.authenticationStatus),v=z(R=>R.setAuthenticationStatus),S=z(R=>R.stepData.authenticate.error),L=async()=>{const R=await i();R&&v(R.authenticated)};g.useEffect(()=>{y({authenticate:{available:!1,error:""}}),$()},[]);const D=async()=>{u("cancel"),await n(),await L(),u("")},O=()=>{s()},U=R=>{var K;(K=R.target.files)!=null&&K.length&&a(R.target.files[0])},w=async()=>{if(!l||!x)return;y({worksheet:{available:!1,error:""}}),u("connect");const R=await r(l,x);R&&(d(R.verification_url),m(R.user_code)),u("")},$=async(R=0)=>{const K=await i();if(K!=null&&K.authenticated&&(v(K.authenticated),K.authenticated!=="pending")){if(K.authenticated=="authenticated")try{const I=await Cs(K.sheetId);p(I)}catch(I){const k=V(I);y({worksheet:{available:!1,error:k}})}u("");return}if(R<=10){setTimeout(()=>$(R+1),2e3);return}u("")},_=async()=>{u("authenticate"),_t(h),window.addEventListener("focus",async()=>{$()},{once:!0})},G=l&&x,q=!!c&&!!h,F=!!o,E=b==="authenticated",T=b==="pending";return e.jsxs(P,{children:[e.jsxs(ve,{children:["Sync with Google Sheet (experimental)",E?e.jsx(f,{onClick:D,loading:o==="cancel",children:"Revoke Authentication"}):e.jsx(f,{onClick:O,children:"Go Back"})]}),e.jsxs(oe,{children:[e.jsx(ne,{children:"Upload Client Secret provided by Google"}),e.jsx(N,{children:S}),e.jsx(M,{fluid:!0,type:"file",onChange:U,accept:".json",disabled:F||q})]}),e.jsxs(oe,{children:[e.jsx(ne,{children:"Enter ID of sheet to synchronise"}),e.jsx(N,{children:void 0}),e.jsx(M,{fluid:!0,placeholder:"Sheet ID",onChange:R=>j(R.target.value),disabled:F||q})]}),q?e.jsx(oe,{children:e.jsxs(A,{children:[T&&e.jsx("span",{children:"Authenticating..."}),e.jsx(Dt,{copyValue:c??"",disabled:!q,children:c||"Upload files to generate Auth Key"}),e.jsxs(f,{onClick:_,disabled:!q,children:[e.jsx(Vs,{}),"Authenticate"]})]})}):e.jsx(oe,{children:e.jsx(A,{children:e.jsxs(f,{onClick:w,disabled:!G||F,loading:o==="connect",children:[e.jsx($s,{}),"Connect"]})})})]})}const hi="_center_l8uww_17",mi="_nowrap_l8uww_21",xi="_secondaryRow_l8uww_25",ji="_linkStartActive_l8uww_30",pi="_flex_l8uww_36",gi="_subdued_l8uww_42",ee={center:hi,nowrap:mi,secondaryRow:xi,linkStartActive:ji,flex:pi,subdued:gi};function mt(t){return t?"Yes":void 0}function fi({rundown:t,customFields:s}){let n=0;const r=Object.keys(s),i=r.map(l=>s[l].label);return e.jsxs(we,{className:ee.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 a=t.entries[l];if(Zn(a)){const h=a.colour?ct(a.colour):{};return e.jsxs("tr",{children:[e.jsx("td",{})," ",e.jsx("td",{className:ee.center,children:e.jsx(H,{children:a.type})}),e.jsx("td",{})," ",e.jsx("td",{children:a.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:{...h},children:a.colour}),e.jsx("td",{})," ",e.jsx("td",{})," ",r.map(d=>{let x="";return d in a.custom&&(x=a.custom[d]),e.jsx("td",{children:x},d)}),e.jsx("td",{className:ee.center,children:e.jsx(H,{children:a.id})})]},a.id)}if(er(a)){const h=a.colour?ct(a.colour):{};return e.jsxs(g.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{})," ",e.jsx("td",{className:ee.center,children:e.jsx(H,{children:a.type})}),e.jsx("td",{className:ee.nowrap,children:a.cue}),e.jsx("td",{children:a.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:{...h},children:a.colour}),e.jsx("td",{})," ",e.jsx("td",{})," ",r.map(d=>{let x="";return d in a.custom&&(x=a.custom[d]),e.jsx("td",{children:x},d)}),e.jsx("td",{className:ee.center,children:e.jsx(H,{children:a.id})})]}),a.note&&e.jsx("tr",{children:e.jsxs("td",{colSpan:99,className:ee.secondaryRow,children:["Note: ",a.note]})})]},a.id)}if(!gs(a))return null;n+=1;const c=a.colour?ct(a.colour):{},m=mt(a.countToEnd),o=mt(a.skip),u=mt(a.flag);return e.jsxs(g.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{className:ee.center,children:e.jsx(H,{children:n})}),e.jsx("td",{className:ee.center,children:e.jsx(H,{children:a.type})}),e.jsx("td",{className:ee.nowrap,children:a.cue}),e.jsx("td",{children:a.title}),e.jsx("td",{className:ee.center,children:u&&e.jsx(H,{children:u})}),e.jsxs("td",{className:ee.flex,children:[e.jsx("span",{className:a.linkStart?ee.subdued:void 0,children:Ie(a.timeStart)}),a.linkStart&&e.jsx(Ms,{className:ee.linkStartActive})]}),e.jsx("td",{children:Ie(a.timeEnd)}),e.jsx("td",{children:Ie(a.duration)}),e.jsx("td",{children:Ie(a.timeWarning)}),e.jsx("td",{children:Ie(a.timeDanger)}),e.jsx("td",{className:ee.center,children:m&&e.jsx(H,{children:m})}),e.jsx("td",{children:o&&e.jsx(H,{children:o})}),e.jsx("td",{style:{...c},children:a.colour}),e.jsx("td",{className:ee.center,children:e.jsx(H,{children:a.timerType})}),e.jsx("td",{className:ee.center,children:e.jsx(H,{children:a.endAction})}),r.map(h=>{let d="";return h in a.custom&&(d=a.custom[h]),e.jsx("td",{children:d},h)}),e.jsx("td",{className:ee.center,children:e.jsx(H,{children:a.id})})]}),a.note&&e.jsx("tr",{children:e.jsxs("td",{colSpan:99,className:ee.secondaryRow,children:["Note: ",a.note]})})]},a.id)})})]})}function yi({rundown:t,customFields:s,summary:n,onFinished:r,onCancel:i,onBack:l}){const{data:a}=fs(),[c,m]=g.useState(!1),{importRundown:o}=ot(),u=z(x=>x.resetPreview),h=()=>{u(),i()},d=async()=>{m(!0),await o({[a.id]:{...t,id:a.id,title:a.title}},s),m(!1),r()};return e.jsxs(P,{children:[e.jsxs(ve,{children:["Review Rundown",e.jsxs(A,{children:[e.jsx(f,{onClick:h,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(oe,{children:[e.jsxs(W,{children:[e.jsx("b",{children:"Title"})," ",t.title]}),e.jsxs(W,{children:[e.jsx("b",{children:"Number of entries"})," ",t.flatOrder.length]}),e.jsxs(W,{children:[e.jsx("b",{children:"Start time"})," ",Ie(n.start)]}),e.jsxs(W,{children:[e.jsx("b",{children:"End time"})," ",Ie(n.end)]}),e.jsxs(W,{children:[e.jsx("b",{children:"Total duration"})," ",un(n.duration)]})]}),e.jsx(fi,{rundown:t,customFields:s})]})}function bi(){const[t,s]=g.useState("none"),[n,r]=g.useState(""),[i,l]=g.useState("none"),{exportRundown:a,importRundownPreview:c,verifyAuth:m}=ot(),o=z(C=>C.setWorksheets),u=z(C=>C.authenticationStatus),h=z(C=>C.setAuthenticationStatus),d=z(C=>C.rundown),x=z(C=>C.setRundown),j=z(C=>C.customFields),p=z(C=>C.setCustomFields),y=z(C=>C.summary),b=z(C=>C.setSummary),v=z(C=>C.setSheetId),S=z(C=>C.sheetId),L=z(C=>C.resetPreview),D=g.useRef(null),O=async C=>{var _e;const Z=(_e=C.target.files)==null?void 0:_e[0];if(!Z){o(null),l("none");return}try{l("loading"),Va(Z);const De=await Pa(Z);o(De),s("excel"),l("done")}catch(De){const xe=hn(De);r(`Error uploading file: ${xe}`),o(null),l("none")}},U=()=>{var C;(C=D.current)==null||C.click()},w=()=>{s("none"),x(null),l("none"),o(null),p(null),b(null),r(""),v(null)},$=async()=>{const C=await m();if(C&&(h(C.authenticated),v(C.sheetId),C.authenticated==="authenticated"&&C.sheetId))try{const Z=await Cs(C.sheetId);o(Z)}catch(Z){const _e=V(Z);r(`Error getting worksheets: ${_e}`)}s("gsheet")},_=()=>{w()},G=async C=>{if(r(""),t==="excel")try{const Z=await Oa(C);x(Z.rundown),p(Z.customFields),b(Z.summary)}catch(Z){r(V(Z))}if(t==="gsheet"){if(!S)return;await c(S,C)}},q=async()=>{if(w(),u==="authenticated"){const C=await m();C&&h(C.authenticated)}},F=()=>{s("finished"),x(null),l("none"),o(null),p(null),r("")},E=async C=>{S&&await a(S,C)},T=t==="excel",R=t==="gsheet",K=u==="authenticated",I=t==="none",k=t==="finished",ge=R&&!K,de=R&&K||T&&i==="done",le=d!==null&&j!==null&&y!==null;return e.jsx(P,{children:e.jsxs(se,{children:[e.jsx(Q,{children:"Synchronise your rundown with an external source"}),n&&e.jsx(N,{children:n}),I&&e.jsxs(e.Fragment,{children:[e.jsx(di,{}),e.jsx("input",{ref:D,style:{display:"none"},type:"file",onChange:O,accept:".xlsx","data-testid":"file-input"}),e.jsxs("div",{className:Te.uploadSection,children:[e.jsxs("div",{children:[e.jsxs(f,{variant:"primary",onClick:U,loading:i==="loading",children:[e.jsx(Ge,{}),"Import from spreadsheet"]}),e.jsx(ne,{children:"Accepts .xlsx files"})]}),e.jsx(mr,{orientation:"vertical"}),e.jsxs("div",{children:[e.jsxs(f,{variant:"primary",onClick:$,disabled:i!=="none",children:[e.jsx(Ws,{}),"Synchronise with Google"]}),e.jsx(ne,{children:"Start authentication process"})]})]})]}),k&&e.jsxs("div",{className:Te.finishSection,children:[n?e.jsx("span",{className:Te.error,children:"Import failed"},"finish__error"):e.jsx("span",{className:Te.success,children:"Import successful"},"finish__success"),e.jsx(f,{variant:"primary",onClick:w,children:"Return"})]}),ge&&e.jsx(ui,{onCancel:_}),de&&!le&&e.jsx(oi,{hasErrors:!!n,isSpreadsheet:T,onCancel:q,onSubmitExport:E,onSubmitImport:G}),le&&e.jsx(yi,{rundown:d,customFields:j,summary:y,onFinished:F,onCancel:q,onBack:L})]})})}const vi="_halfWidth_6p65m_17",wi="_fullWidth_6p65m_21",Si="_twoCols_6p65m_25",Ci="_current_6p65m_31",nt={halfWidth:vi,fullWidth:wi,twoCols:Si,current:Ci};function Es({onSubmit:t,onCancel:s,initialColour:n,initialLabel:r,initialKey:i}){const{data:l}=lt(),[a,c]=g.useState(n||""),{handleSubmit:m,register:o,setFocus:u,setError:h,setValue:d,getValues:x,watch:j,formState:{errors:p,isSubmitting:y,isValid:b,isDirty:v}}=ce({defaultValues:{type:"text",label:r||"",colour:n||""},resetOptions:{keepDirtyValues:!0}}),S=async w=>{const{type:$,label:_,colour:G}=w,q={type:$,colour:G,label:_};try{await t(q)}catch(F){h("root",{type:"custom",message:V(F)})}};g.useEffect(()=>{u("label")},[u]);const L=w=>{c(w),d("colour",w,{shouldDirty:!0})},D=x("colour"),O=v&&b,U=i!==void 0;return e.jsxs($e,{as:"form",onSubmit:m(S),onKeyDown:w=>Se(w,s),children:[e.jsxs(me,{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(ne,{children:"Type"}),e.jsx(ps,{orientation:"horizontal",disabled:U,onValueChange:w=>d("type",w,{shouldDirty:!0}),value:j("type"),items:[{value:"text",label:"Text"},{value:"image",label:"Image"}]})]}),e.jsxs("div",{className:nt.twoCols,children:[e.jsxs("label",{children:[e.jsx(ne,{children:"Label (only alphanumeric characters are allowed)"}),p.label&&e.jsx(N,{children:p.label.message}),e.jsx(M,{...o("label",{required:{value:!0,message:"Required field"},onChange:()=>d("key",Cr(x("label"))??"N/A"),validate:w=>w.trim().length===0?"Required field":Et.isAlphanumericWithSpace(w)?!U&&U&&Object.keys(l).includes(w)?"Custom fields must be unique":!0:"Only alphanumeric characters and space are allowed"}),fluid:!0})]}),e.jsxs("label",{children:[e.jsx(ne,{children:"Key (use in Integrations and API)"}),e.jsx(M,{...o("key"),variant:"ghosted",readOnly:!0,fluid:!0})]})]}),e.jsxs("label",{children:[e.jsx(ne,{children:"Colour"}),e.jsx(Un,{name:"colour",value:D,handleChange:(w,$)=>L($)})]}),p.root&&e.jsx(N,{children:p.root.message}),e.jsxs(A,{relation:"inner",align:"end",children:[e.jsx(f,{variant:"ghosted",onClick:s,children:"Cancel"}),e.jsx(f,{type:"submit",variant:"primary",disabled:!O,loading:y,children:"Save"})]})]})}function _i(t){const{colour:s,label:n,fieldKey:r,type:i,onEdit:l,onDelete:a}=t,[c,m]=g.useState(!1),o=async u=>{await l(r,u),m(!1)};return c?e.jsx("tr",{children:e.jsx("td",{colSpan:99,children:e.jsx(Es,{onCancel:()=>m(!1),onSubmit:o,initialColour:s,initialLabel:n,initialKey:r})})}):e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx(qn,{color:s})}),e.jsx("td",{children:e.jsx(H,{children:i})}),e.jsx("td",{className:nt.halfWidth,children:n}),e.jsx("td",{className:nt.fullWidth,children:e.jsx(Dt,{size:"small",copyValue:r,children:r})}),e.jsxs(A,{relation:"inner",as:"td",children:[e.jsx(X,{variant:"ghosted-white","aria-label":"Edit entry",onClick:()=>m(!0),children:e.jsx(rt,{})}),e.jsx(X,{variant:"ghosted-destructive","aria-label":"Delete entry",onClick:()=>a(r),children:e.jsx(je,{})})]})]})}function ki(){const{data:t,refetch:s}=lt(),[n,r]=g.useState(!1),i=()=>{r(!0)},l=()=>{r(!1)},a=async o=>{await or(o),s(),r(!1)},c=async(o,u)=>{await cr(o,u),s()},m=async o=>{try{await dr(o),s()}catch{}};return e.jsx(P,{children:e.jsxs(se,{children:[e.jsxs(Q,{children:["Custom fields",e.jsxs(f,{onClick:i,children:["New ",e.jsx(pe,{})]})]}),e.jsx(ie,{}),e.jsx(P,{children:e.jsxs(me,{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(vs,{search:"settings=automation__automations",children:"Automation"}),", please note the generated key.",e.jsx(te,{href:mn,children:"See the docs"})]})}),e.jsxs(P,{children:[n&&e.jsx(Es,{onSubmit:a,onCancel:l}),e.jsxs(we,{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:u,label:h,type:d}])=>e.jsx(_i,{fieldKey:o,colour:u,label:h,type:d,onEdit:c,onDelete:m},o))})]})]})]})})}function Di(){const{data:t,status:s,isError:n,refetch:r,isFetching:i}=vt({queryKey:fe,queryFn:ir,placeholderData:(l,a)=>l,refetchInterval:hs});return{data:t??{loaded:"",rundowns:[]},status:s,isError:n,refetch:r,isFetching:i}}function Ps(){const t=St(),{mutateAsync:s}=qe({mutationFn:tr,onMutate:()=>{t.cancelQueries({queryKey:fe})},onSuccess:a=>{t.setQueryData(fe,a.data)}}),{mutateAsync:n}=qe({mutationFn:sr,onMutate:()=>{t.cancelQueries({queryKey:fe})},onSuccess:a=>{t.setQueryData(fe,a.data)}}),{mutateAsync:r}=qe({mutationFn:([a,c])=>nr(a,c),onMutate:()=>{t.cancelQueries({queryKey:fe})},onSuccess:a=>{t.setQueryData(fe,a.data)}}),{mutateAsync:i}=qe({mutationFn:rr,onMutate:()=>{t.cancelQueries({queryKey:fe})},onSuccess:a=>{t.setQueryData(fe,a.data)}}),{mutateAsync:l}=qe({mutationFn:ar,onMutate:()=>{t.cancelQueries({queryKey:fe})},onSuccess:a=>{t.setQueryData(fe,a.data)}});return{create:s,duplicate:n,remove:i,load:l,rename:r}}function Ri({onSubmit:t,onCancel:s,initialTitle:n}){const{handleSubmit:r,register:i,setFocus:l,setError:a,formState:{errors:c,isSubmitting:m,isValid:o,isDirty:u}}=ce({defaultValues:{title:n},mode:"onChange"}),h=async x=>{try{await t(x.title)}catch(j){a("root",{type:"custom",message:V(j)})}};g.useEffect(()=>{l("title")},[l]);const d=u&&o;return e.jsxs($e,{as:"form",onSubmit:r(h),onKeyDown:x=>Se(x,s),children:[e.jsxs("label",{children:[e.jsx(ne,{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":Et.isAlphanumericWithSpace(x)===!1?"Title can only contain alphanumeric characters, spaces and underscores":!0}),fluid:!0}),c.title&&e.jsx(N,{children:c.title.message})]}),c.root&&e.jsx(N,{children:c.root.message}),e.jsxs(A,{relation:"inner",align:"end",children:[e.jsx(f,{variant:"ghosted",onClick:s,children:"Cancel"}),e.jsx(f,{type:"submit",variant:"primary",disabled:!d,loading:m,children:"Save"})]})]})}function Ni({onClose:t}){const{create:s}=Ps(),{handleSubmit:n,register:r,setFocus:i,setError:l,formState:{errors:a,isSubmitting:c}}=ce({defaultValues:{title:""}}),m=async o=>{try{await s(o.title||"untitled"),t()}catch(u){l("root",{message:`Failed to create rundown. ${u}`})}};return g.useEffect(()=>{i("title")},[i]),e.jsxs($e,{as:"form",onSubmit:n(m),children:[e.jsx(P,{children:e.jsxs("label",{children:[e.jsx(ne,{children:"Rundown title"}),e.jsx(M,{...r("title"),fluid:!0,placeholder:"Your rundown name"})]})}),e.jsxs(A,{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"})]}),a.root&&e.jsx(N,{children:a.root.message})]})}function Ei(){var $;const{data:t}=Di(),{duplicate:s,remove:n,load:r,rename:i}=Ps(),[l,a]=Ne(),[c,m]=Ne(),[o,u]=Ne(),[h,d]=g.useState(""),[x,j]=g.useState(null),[p,y]=g.useState(null),b=_=>{y(null),d(_),m.open()},v=_=>{y(null),d(_),a.open()},S=_=>{y(null),j(_)},L=async()=>{try{await r(h)}catch(_){y(`Failed to load rundown. ${V(_)}`)}finally{m.close()}},D=async _=>{y(null),j(null),d("");try{await s(_)}catch(G){y(`Failed to duplicate rundown. ${V(G)}`)}},O=async(_,G)=>{try{await i([_,G]),j(null)}catch(q){y(`Failed to rename rundown. ${V(q)}`)}},U=async()=>{try{await n(h)}catch(_){y(`Failed to delete rundown. ${V(_)}`)}finally{a.close()}},w=async(_,G)=>{await Ta(_,G)};return e.jsxs(e.Fragment,{children:[e.jsx(P,{children:e.jsxs(se,{children:[e.jsxs(Q,{children:["Manage project rundowns",e.jsx(A,{children:e.jsxs(f,{onClick:()=>{y(null),u.open()},children:["New ",e.jsx(pe,{})]})})]}),e.jsx(ie,{}),e.jsxs(P,{children:[o&&e.jsx(Ni,{onClose:u.close}),p&&e.jsx(N,{children:p}),e.jsxs(we,{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:($=t==null?void 0:t.rundowns)==null?void 0:$.map(({id:_,numEntries:G,title:q})=>{const F=t.loaded===_;return x===_?e.jsx("tr",{children:e.jsx("td",{colSpan:3,children:e.jsx(Ri,{onCancel:()=>j(null),onSubmit:T=>O(_,T),initialTitle:q})})},_):e.jsxs("tr",{className:be([F&&nt.current]),children:[e.jsx("td",{children:G}),e.jsxs("td",{children:[q," ",F&&e.jsx(H,{children:"Loaded"})]}),e.jsx("td",{children:e.jsx(xs,{render:e.jsx(X,{variant:"ghosted-white"}),items:[{type:"item",icon:ns,label:"Rename",onClick:()=>S(_)},{type:"item",icon:Ge,label:"Load",onClick:()=>b(_),disabled:F},{type:"item",icon:rs,label:"Download .xlsx",onClick:()=>w(_,q)},{type:"item",icon:Us,label:"Duplicate",onClick:()=>D(_)},{type:"divider"},{type:"destructive",icon:je,label:"Delete",onClick:()=>v(_),disabled:F}],children:e.jsx(as,{})})})]},_)})})]})]})]})}),e.jsx(st,{isOpen:l,onClose:a.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:a.close,children:"Cancel"}),e.jsx(f,{variant:"destructive",size:"large",onClick:U,children:"Delete rundown"})]})}),e.jsx(st,{isOpen:c,onClose:m.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:m.close,children:"Cancel"}),e.jsx(f,{variant:"primary",size:"large",onClick:L,children:"Load rundown"})]})})]})}function Pi(){const{defaultDuration:t,linkPrevious:s,defaultTimeStrategy:n,defaultWarnTime:r,defaultDangerTime:i,defaultTimerType:l,defaultEndAction:a,setDefaultDuration:c,setLinkPrevious:m,setTimeStrategy:o,setWarnTime:u,setDangerTime:h,setDefaultTimerType:d,setDefaultEndAction:x}=ys(b=>b),j=He(t),p=He(r),y=He(i);return e.jsx(P,{children:e.jsxs(se,{children:[e.jsx(Q,{children:"Rundown defaults"}),e.jsx(ie,{}),e.jsxs(P,{children:[e.jsx(ve,{children:"Default settings for new events"}),e.jsxs(oe,{children:[e.jsxs(W,{children:[e.jsx(B,{title:"Link previous",description:"Whether the start time of new events should be linked to the previous event end time"}),e.jsx(ke,{size:"large",checked:s,onCheckedChange:m})]}),e.jsxs(W,{children:[e.jsx(B,{title:"Timer strategy",description:"Which time should be maintained when event schedule is recalculated"}),e.jsx(re,{value:n,onValueChange:b=>{b!==null&&o(b)},options:[{value:Ut.LockDuration,label:"Duration"},{value:Ut.LockEnd,label:"End Time"}]})]})]}),e.jsxs(oe,{children:[e.jsxs(W,{children:[e.jsx(B,{title:"Default duration",description:"Default duration for new events"}),e.jsx(Ke,{name:"defaultDuration",submitHandler:(b,v)=>c(v),time:j,placeholder:Be.duration})]}),e.jsxs(W,{children:[e.jsx(B,{title:"Timer type",description:"Default type of timer for new events"}),e.jsx(re,{value:l,onValueChange:b=>{b!==null&&d(b)},options:[{value:Ye.CountDown,label:"Count down"},{value:Ye.CountUp,label:"Count up"},{value:Ye.Clock,label:"Clock"},{value:Ye.None,label:"None"}]})]}),e.jsxs(W,{children:[e.jsx(B,{title:"End Action",description:"Default end action for new events"}),e.jsx(re,{value:a,onValueChange:b=>{b!==null&&x(b)},options:[{value:ht.None,label:"None"},{value:ht.LoadNext,label:"Load next"},{value:ht.PlayNext,label:"Play next"}]})]})]}),e.jsxs(oe,{children:[e.jsxs(W,{children:[e.jsx(B,{title:"Warning time",description:"Default threshold for warning time in an event"}),e.jsx(Ke,{name:"warnTime",submitHandler:(b,v)=>u(v),time:p,placeholder:Be.warnTime})]}),e.jsxs(W,{children:[e.jsx(B,{title:"Danger time",description:"Default threshold for danger time in an event"}),e.jsx(Ke,{name:"dangerTime",submitHandler:(b,v)=>h(v),time:y,placeholder:Be.dangerTime})]})]})]})]})})}function Oi({location:t}){const s=ae("defaults",t),n=ae("custom",t),r=ae("rundowns",t),i=ae("sheets",t);return e.jsxs(e.Fragment,{children:[e.jsx(Ae,{children:"Project data"}),e.jsx("div",{ref:s,children:e.jsx(Pi,{})}),e.jsx("div",{ref:n,children:e.jsx(ki,{})}),e.jsx("div",{ref:r,children:e.jsx(Ei,{})}),e.jsx("div",{ref:i,children:e.jsx(bi,{})})]})}const Ti="_textEntry_1xa10_17",Ai="_inlineEntry_1xa10_25",Fi="_redirect_1xa10_32",Ii="_label_1xa10_36",Pe={textEntry:Ti,inlineEntry:Ai,redirect:Fi,label:Ii};function Li({id:t,isOpen:s,name:n,currentPath:r,origin:i,onClose:l}){const{data:a}=ds(),[c,m]=g.useState(r),[o,u]=g.useState("/"),{setRedirect:h}=ms,d=p=>{p==="/"||p===r||(p.startsWith("preset-")?h({target:t,redirect:p.slice(7)}):h({target:t,redirect:p}),l())},x=a.filter(p=>p.enabled),j=[...xn.map(p=>({value:`/${p.url}`,label:p.label})),...x.map(p=>({value:`preset-${p.alias}`,label:`URL Preset: ${p.alias}`}))];return e.jsx(st,{isOpen:s,onClose:l,showCloseButton:!0,showBackdrop:!0,title:`Redirect: ${n}`,bodyElements:e.jsxs(e.Fragment,{children:[e.jsxs(me,{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(vs,{search:"settings=sharing__presets",children:"Manage URL Presets"})]}),e.jsxs("div",{className:Pe.inlineEntry,children:[e.jsx("span",{className:Pe.label,children:"Enter custom path"}),e.jsxs("label",{className:Pe.textEntry,children:[i,e.jsx(M,{placeholder:"eg. /timer",fluid:!0,value:c,onChange:p=>m(p.target.value)})]}),e.jsxs(f,{variant:"primary","aria-label":"Redirect",disabled:c===r||c==="",className:Pe.redirect,onClick:()=>d(c),children:["Redirect",e.jsx(It,{})]})]}),e.jsxs("div",{children:[e.jsx("span",{className:Pe.label,children:"Select View or URL Preset"}),e.jsxs("div",{className:Pe.inlineEntry,children:[e.jsxs("label",{className:Pe.textEntry,children:[i,e.jsx(re,{fluid:!0,options:j,defaultValue:j[0].value,onValueChange:p=>{p!==null&&u(p)},disabled:x.length===0})]}),e.jsxs(f,{variant:"primary","aria-label":"Redirect to preset",className:Pe.redirect,disabled:x.length===0||o==="/",onClick:()=>d(o),children:["Redirect ",e.jsx(It,{})]})]})]})]})})}const $i="_blink_vtewd_1",Vi="_halfWidthNoWrap_vtewd_25",Mi="_copiable_vtewd_30",bt="_self_vtewd_35",ze={blink:$i,halfWidthNoWrap:Vi,copiable:Mi,self:bt};function Wi(){const t=Vt(j=>j.id),s=Vt(j=>j.clients),[n,r]=Ne(),[i,l]=Ne(),{setIdentify:a}=ms,[c,m]=g.useState(""),o=j=>{m(j),l.open()},u=j=>{m(j),r.open()},h=Object.entries(s).filter(([j,{type:p}])=>p==="ontime"),d=Object.entries(s).filter(([j,{type:p}])=>p!=="ontime"),x=s[c];return e.jsxs(e.Fragment,{children:[n&&x!==void 0&&e.jsx(Li,{id:c,name:x.name,origin:x.origin,currentPath:x.path,isOpen:n,onClose:r.close}),i&&e.jsx(jn,{id:c,name:x==null?void 0:x.name,isOpen:i,onClose:l.close}),e.jsxs(P,{children:[e.jsxs(ve,{children:["Ontime Clients (",h.length,")"]}),e.jsxs(we,{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:h.map(([j,p])=>{const{identify:y,name:b,path:v}=p,S=t===j;return e.jsxs("tr",{className:be([S&&ze.self]),children:[e.jsxs(A,{relation:"inner",as:"td",children:[S&&e.jsx(H,{children:"SELF"}),b]}),e.jsx("td",{className:ze.copiable,children:v}),e.jsxs(A,{relation:"inner",as:"td",children:[e.jsx(f,{size:"small",className:`${y?ze.blink:""}`,disabled:S,variant:y?"primary":"subtle","data-testid":S?"":"not-self-identify",onClick:()=>{a({target:j,identify:!y})},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:()=>u(j),children:"Redirect"})]})]},j)})})]})]}),e.jsx(ie,{}),e.jsxs(P,{children:[e.jsxs(ve,{children:["Other Clients (",d.length,")"]}),e.jsxs(we,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:ze.halfWidthNoWrap,children:"Client Name"}),e.jsx("td",{className:ze.halfWidthNoWrap,children:"Client type"})]})}),e.jsx("tbody",{children:d.map(([j,p])=>{const{name:y,type:b}=p;return e.jsxs("tr",{children:[e.jsx("td",{children:y}),e.jsx("td",{children:b})]},j)})})]})]})]})}function Ui(){return e.jsx(P,{children:e.jsxs(se,{children:[e.jsx(Q,{children:"Manage clients"}),e.jsx(ie,{}),e.jsx(Wi,{})]})})}const qi="_iconRotate_l21m9_17",zi={iconRotate:qi};function Bi(){const t=s=>{us("log",s)};return e.jsx(P,{children:e.jsxs(se,{children:[e.jsxs(Q,{children:["Event log",e.jsxs(f,{onClick:t,children:["Extract ",e.jsx(wt,{className:zi.iconRotate})]})]}),e.jsx(ie,{}),e.jsx(pn,{})]})})}function Ki({location:t}){const s=ae("clients",t),n=ae("log",t);return e.jsxs(e.Fragment,{children:[e.jsx(Ae,{children:"Network"}),gn,e.jsx("div",{ref:n,children:e.jsx(Bi,{})}),e.jsx("div",{ref:s,children:e.jsx(Ui,{})})]})}const Jt={project:{title:""},settings:{timeFormat:"24",language:"en"}};function Hi({isOpen:t,onClose:s}){var b,v,S,L;const{defaultWarnTime:n,defaultDangerTime:r,setDangerTime:i,setWarnTime:l}=ys(),{handleSubmit:a,register:c,formState:{errors:m,isSubmitting:o,isValid:u},watch:h,setError:d,setValue:x}=ce({defaultValues:Jt,values:Jt,resetOptions:{keepDirtyValues:!0}}),j=async D=>{try{D.project.title===""&&(D.project.title="untitled"),await Ba(D),await We(),s()}catch(O){d("root",{message:V(O)})}},p=He(n),y=He(r);return e.jsx(Pt,{isOpen:t,onClose:s,showBackdrop:!0,showCloseButton:!0,title:"Create new project...",bodyElements:e.jsxs("form",{onSubmit:a(j),id:"quick-start",children:[e.jsxs(oe,{children:[e.jsxs(W,{children:[e.jsx(B,{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(W,{children:[e.jsx(B,{title:"Time format",description:"Default time format to show in views 12 / 24 hours (does not affect editor)",error:(v=(b=m.settings)==null?void 0:b.timeFormat)==null?void 0:v.message}),e.jsx(re,{value:h("settings.timeFormat"),onValueChange:D=>{D!==null&&x("settings.timeFormat",D,{shouldDirty:!0})},defaultValue:"24",options:[{value:"12",label:"12 hours 11:00:10 PM"},{value:"24",label:"24 hours 23:00:10"}]})]}),e.jsxs(W,{children:[e.jsx(B,{title:"Views language",description:"Language to be displayed in views",error:(L=(S=m.settings)==null?void 0:S.language)==null?void 0:L.message}),e.jsx(re,{value:h("settings.language"),onValueChange:D=>{D!==null&&x("settings.language",D,{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(oe,{children:[e.jsxs(W,{children:[e.jsx(B,{title:"Warning time",description:"Default threshold for warning time in an event"}),e.jsx(Ke,{name:"warnTime",submitHandler:(D,O)=>l(O),time:p,placeholder:Be.warnTime})]}),e.jsxs(W,{children:[e.jsx(B,{title:"Danger time",description:"Default threshold for danger time in an event"}),e.jsx(Ke,{name:"dangerTime",submitHandler:(D,O)=>i(O),time:y,placeholder:Be.dangerTime})]})]})]}),footerElements:e.jsxs(e.Fragment,{children:[(m==null?void 0:m.root)&&e.jsx(N,{children:m.root.message}),e.jsx(f,{variant:"ghosted",onClick:s,disabled:!1,children:"Cancel"}),e.jsx(f,{variant:"primary",type:"submit",form:"quick-start",disabled:!u,loading:o,children:"Create project"})]})})}const Gi="_current_13n43_17",Qi="_isEditing_13n43_21",Yi="_form_13n43_25",Ji="_formInput_13n43_33",Xi="_saveButton_13n43_37",Zi="_containCell_13n43_41",el="_sortableHeader_13n43_45",tl="_innerColumn_13n43_55",sl="_inlineLabels_13n43_63",nl="_warningInfo_13n43_68",rl="_empty_13n43_72",he={current:Gi,isEditing:Qi,form:Yi,formInput:Ji,saveButton:Xi,containCell:Zi,sortableHeader:el,innerColumn:tl,inlineLabels:sl,warningInfo:nl,empty:rl};function al({onClose:t}){const[s,n]=g.useState(null),{handleSubmit:r,register:i,formState:{isSubmitting:l,isValid:a},setFocus:c}=ce({defaultValues:{title:""},values:{title:""},resetOptions:{keepDirtyValues:!0}});g.useEffect(()=>{c("title")},[c]);const m=async o=>{try{n(null);const u=o.title??"untitled";await za({filename:u}),t()}catch(u){n(V(u))}};return e.jsxs($e,{as:"form",onSubmit:r(m),onKeyDown:o=>Se(o,t),children:[e.jsxs(ve,{children:["Create new project",e.jsxs(A,{children:[e.jsx(f,{onClick:t,variant:"ghosted",disabled:l,children:"Cancel"}),e.jsx(f,{disabled:!a,type:"submit",loading:l,variant:"primary",children:"Create project"})]})]}),s&&e.jsx(N,{children:s}),e.jsxs(P,{className:he.innerColumn,children:[e.jsx(ne,{children:"Project title"}),e.jsx(M,{fluid:!0,placeholder:"Your project name",...i("title")})]})]})}const il={files:[],lastLoadedProject:""};function ll(){const{data:t,status:s,refetch:n}=vt({queryKey:fn,queryFn:Ka,placeholderData:(r,i)=>r,retry:5,retryDelay:r=>r*2500,refetchInterval:hs,networkMode:"always"});return{data:t??il,status:s,refetch:n}}const ol={"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 Os(t="modified-desc"){const s=ll(),{files:n,lastLoadedProject:r}=s.data,i=g.useMemo(()=>{if(!n.length)return[];const l=[...n].sort(ol[t]),a=l.findIndex(c=>c.filename===r);if(a>0){const[c]=l.splice(a,1);l.unshift(c)}return l},[n,r,t]);return{...s,data:{reorderedProjectFiles:i,lastLoadedProject:s.data.lastLoadedProject}}}function cl({action:t,filename:s,onSubmit:n,onCancel:r}){const{handleSubmit:i,register:l,formState:{isSubmitting:a,isDirty:c,isValid:m},setFocus:o}=ce({defaultValues:{filename:s},values:{filename:s},resetOptions:{keepDirtyValues:!0}});return g.useEffect(()=>{o("filename")},[o]),e.jsxs("form",{onSubmit:i(n),onKeyDown:u=>Se(u,r),className:he.form,children:[e.jsx(M,{className:he.formInput,id:"filename",placeholder:"Enter new name",...l("filename",{required:!0})}),e.jsxs(A,{relation:"inner",children:[e.jsx(f,{onClick:r,variant:"ghosted",disabled:a,children:"Cancel"}),e.jsx(f,{variant:"primary",disabled:!c||!m||a,type:"submit",className:he.saveButton,children:t})]})]})}async function dl(t,s){const n={};for(const r in s)lr(r,t)&&s[r]&&(r==="rundowns"&&(n.customFields=t.customFields),Object.assign(n,{[r]:t[r]}));return n}function ul({onClose:t,fileName:s}){const[n,r]=g.useState(null),i=St(),{handleSubmit:l,watch:a,setValue:c,formState:{isSubmitting:m,isValid:o,isDirty:u}}=ce({defaultValues:{project:!1,rundowns:!1,viewSettings:!1,urlPresets:!1,automation:!1},resetOptions:{keepDirtyValues:!0}}),h=async d=>{if(Object.values(d).every(j=>!j)){r("At least one option must be selected");return}try{r(null);const{data:j}=await ks(s);if(!j.settings.version.startsWith("4.")){r("The project you are attempting to merge is from an older version and it need to be migrated first");return}const p=await dl(j,d);await Rs(p),await i.invalidateQueries({queryKey:yn}),t()}catch(j){r(V(j))}};return e.jsxs(P,{as:"form",onSubmit:l(h),children:[e.jsxs(ve,{children:["Partial project merge",e.jsxs(A,{children:[e.jsx(f,{onClick:t,variant:"ghosted",disabled:m,children:"Cancel"}),e.jsx(f,{type:"submit",disabled:!o||!u,loading:m,variant:"primary",children:"Merge"})]})]}),n&&e.jsx(N,{children:n}),e.jsxs(P,{className:be([he.innerColumn,he.inlineLabels]),children:[e.jsxs(ne,{children:["Select data from ",e.jsx("i",{children:`"${s}"`})," to merge into the current project."]}),e.jsxs(me,{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(ke,{size:"large",checked:a("project"),onCheckedChange:d=>c("project",d,{shouldDirty:!0})}),"Project data"]}),e.jsxs("label",{children:[e.jsx(ke,{size:"large",checked:a("rundowns"),onCheckedChange:d=>c("rundowns",d,{shouldDirty:!0})}),"Rundown + Custom Fields"]}),e.jsxs("label",{children:[e.jsx(ke,{size:"large",checked:a("viewSettings"),onCheckedChange:d=>c("viewSettings",d,{shouldDirty:!0})}),"View Settings"]}),e.jsxs("label",{children:[e.jsx(ke,{size:"large",checked:a("urlPresets"),onCheckedChange:d=>c("urlPresets",d,{shouldDirty:!0})}),"URL Presets"]}),e.jsxs("label",{children:[e.jsx(ke,{size:"large",checked:a("automation"),onCheckedChange:d=>c("automation",d,{shouldDirty:!0})}),"Automation Settings"]})]})]})}function hl({current:t,updatedAt:s,editingFilename:n,editingMode:r,filename:i,onRefetch:l,onSubmit:a,onToggleEditMode:c}){const[m,o]=g.useState(null),[u,h]=g.useState(!1),d=D=>async O=>{h(!0),o(null);try{if(!O.filename){o("Filename cannot be blank");return}await(D==="rename"?Qa:Ga)(i,O.filename),await l(),a()}catch(U){o(V(U))}finally{h(!1)}},x=async D=>{h(!0),o(null);try{await Ns(D),await l(),await We()}catch(O){o(V(O))}finally{h(!1)}},j=async D=>{h(!0),o(null);try{await Ya(D),await l()}catch(O){o(V(O))}finally{h(!1)}},p=(D,O)=>{o(null),c(D,O)},y=()=>{p(null,null)},b=i===n,v=(r==="rename"||r==="duplicate")&&i===n,S=r==="merge"&&b,L=be([t&&!b&&he.current,b&&he.isEditing]);return e.jsxs(e.Fragment,{children:[m&&e.jsx("tr",{children:e.jsx("td",{colSpan:99,children:e.jsx(N,{children:m})})},"filename-error"),e.jsx("tr",{className:L,children:v?e.jsx("td",{colSpan:99,children:e.jsx(cl,{action:r,filename:i,onSubmit:d(r==="duplicate"?"duplicate":"rename"),onCancel:y})}):e.jsxs(e.Fragment,{children:[e.jsx("td",{className:he.containCell,children:i}),e.jsx("td",{children:t?"Currently loaded":new Date(s).toLocaleString()}),e.jsx("td",{children:e.jsx(ml,{current:t,filename:i,onChangeEditMode:p,onDelete:j,onLoad:x,isDisabled:u||S,onMerge:D=>p("merge",D)})})]})},i),S&&e.jsx("tr",{children:e.jsx("td",{colSpan:99,children:e.jsx(ul,{onClose:y,fileName:i})})})]})}function ml(t){const{current:s,filename:n,isDisabled:r,onChangeEditMode:i,onDelete:l,onLoad:a,onMerge:c}=t,m=()=>{i("rename",n)},o=()=>{i("duplicate",n)},u=async()=>{await qa(n)};return e.jsx(xs,{render:e.jsx(X,{variant:"ghosted-white"}),disabled:r,items:[{type:"item",icon:Ge,label:"Load",onClick:()=>a(n),disabled:s},{type:"item",icon:Ge,label:"Partial Load",onClick:()=>c(n),disabled:s},{type:"item",icon:ns,label:"Rename",onClick:m},{type:"item",icon:qs,label:"Duplicate",onClick:o},{type:"item",icon:rs,label:"Download",onClick:u},{type:"divider"},{type:"item",icon:je,label:"Delete",onClick:()=>l(n),disabled:s}],children:e.jsx(as,{})})}function xl(){const[t,s]=g.useState(null),[n,r]=g.useState(null),[i,l]=g.useState("modified-desc"),{data:a,refetch:c,status:m}=Os(i),o=(j,p)=>{s(y=>y===j&&p===n?null:j),r(p)},u=()=>{s(null),r(null)},h=async()=>{await c()},d=j=>{l(p=>{const y=p===`${j}-asc`;return`${j}-${y?"desc":"asc"}`})};if(m==="pending")return e.jsx("div",{className:he.empty,children:e.jsx(Le,{isLoading:!0})});const x=a.reorderedProjectFiles.length;return e.jsxs(e.Fragment,{children:[x>20&&e.jsxs(me,{className:he.warningInfo,type:"warning",children:["You have ",x," projects. Consider deleting unused projects to improve performance."]}),e.jsxs(we,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:he.containCell,onClick:()=>d("alphabetical"),children:e.jsxs("span",{className:he.sortableHeader,children:["File Name",e.jsx(Xt,{sortMode:i,type:"alphabetical"})]})}),e.jsx("th",{onClick:()=>d("modified"),children:e.jsxs("span",{className:he.sortableHeader,children:["Last Used",e.jsx(Xt,{sortMode:i,type:"modified"})]})}),e.jsx("th",{})]})}),e.jsx("tbody",{children:a.reorderedProjectFiles.map(j=>e.jsx(hl,{filename:j.filename,updatedAt:j.updatedAt,onToggleEditMode:o,onSubmit:u,onRefetch:h,editingFilename:n,editingMode:t,current:j.filename===a.lastLoadedProject},j.filename))})]})]})}function Xt({sortMode:t,type:s}){const n=`${s}-`;return t===`${n}asc`?e.jsx(zs,{}):t===`${n}desc`?e.jsx(wt,{}):null}function jl(){const[t,s]=is(),[n,r]=g.useState(""),[i,l]=g.useState(null),a=g.useRef(null),c=t.get("new")==="true",m=()=>{t.set("new",c?"false":"true"),s(t)},o=()=>{var d;(d=a.current)==null||d.click()},u=async d=>{var j,p;const x=(p=(j=d.target)==null?void 0:j.files)==null?void 0:p[0];if(x){l("import");try{_s(x),await Ds(x)}catch(y){const b=V(y);r(`Error uploading file: ${b}`)}finally{await We()}l(null)}},h=()=>{t.delete("new"),s(t)};return e.jsxs(P,{children:[e.jsx("input",{ref:a,style:{display:"none"},type:"file",onChange:u,accept:".json","data-testid":"file-input"}),e.jsxs(se,{children:[e.jsxs(Q,{children:["Manage projects",e.jsxs(A,{children:[e.jsx(f,{onClick:o,disabled:!!i||c,loading:i==="import",children:"Import"}),e.jsxs(f,{onClick:m,disabled:!!i||c,children:["New ",e.jsx(pe,{})]})]})]}),n&&e.jsx(N,{children:n}),e.jsx(ie,{}),c&&e.jsx(al,{onClose:h}),e.jsx(xl,{})]})]})}function pl({location:t,setLocation:s}){const n=ae("list",t),r=()=>{s("project")};return e.jsxs(e.Fragment,{children:[e.jsx(Ae,{children:"Project"}),e.jsx(Hi,{isOpen:t==="create",onClose:r}),e.jsx("div",{ref:n,children:e.jsx(jl,{})})]})}const gl="_container_cq029_17",fl={container:gl};function Zt({register:t,formName:s,disabled:n}){const[r,i]=g.useState(!1);return e.jsxs("div",{className:fl.container,children:[e.jsx(M,{type:r?"text":"password",maxLength:4,...t(s,{pattern:{value:Hn,message:"Only alphanumeric characters are allowed"}}),placeholder:"-",disabled:n}),e.jsx(X,{onMouseDown:()=>i(!0),onMouseUp:()=>i(!1),variant:"ghosted","aria-label":"Show pin code",children:e.jsx(Bs,{})})]})}const yl=g.lazy(()=>Qe(()=>import("./CustomTranslationModal-DiQbmcgD.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url));function bl(){var D,O,U,w,$;const{data:t,status:s,refetch:n}=bn(),{handleSubmit:r,register:i,reset:l,setError:a,watch:c,setValue:m,formState:{isSubmitting:o,isDirty:u,isValid:h,errors:d}}=ce({mode:"onChange",defaultValues:t,values:t,resetOptions:{keepDirtyValues:!0}}),[x,j]=Ne();g.useEffect(()=>{t&&l(t)},[t,l]);const p=async _=>{try{await vn(_)}catch(G){const q=V(G);a("root",{message:q})}finally{await n()}},y=s==="pending",b=o||!u||!h,v="",S=()=>{l(t)},L=s==="pending";return e.jsxs(e.Fragment,{children:[e.jsx(yl,{isOpen:x,onClose:j.close}),e.jsx(P,{as:"form",onSubmit:r(p),onKeyDown:_=>Se(_,S),id:"app-settings",children:e.jsxs(se,{children:[e.jsxs(Q,{children:["General settings",e.jsxs(A,{children:[e.jsx(f,{disabled:!u||o,variant:"ghosted",onClick:S,children:"Revert to saved"}),e.jsx(f,{type:"submit",form:"app-settings",name:"general-settings-submit",loading:o,disabled:b,variant:"primary",children:"Save"})]})]}),v,e.jsx(ie,{}),e.jsxs(P,{children:[e.jsx(me,{children:"Changes to the time format and views language do not affect the editor view"}),e.jsx(Le,{isLoading:L}),e.jsxs(oe,{children:[e.jsxs(W,{children:[e.jsx(B,{title:"Ontime server port",description:Me?"Server port disabled for Ontime Cloud":"Port ontime server listens in. Defaults to 4001 (needs app restart)",error:(D=d.serverPort)==null?void 0:D.message}),e.jsx(M,{id:"serverPort",type:"number",maxLength:5,style:{width:"75px"},disabled:Me,...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:js,message:"Value should be numeric"}})})]}),e.jsxs(W,{children:[e.jsx(B,{title:"Editor pin code",description:"Protect the editor view with a pin code",error:(O=d.editorKey)==null?void 0:O.message}),e.jsx(Zt,{register:i,formName:"editorKey",disabled:y})]}),e.jsxs(W,{children:[e.jsx(B,{title:"Operator pin code",description:"Protect the operator and cuesheet views with a pin code",error:(U=d.operatorKey)==null?void 0:U.message}),e.jsx(Zt,{register:i,formName:"operatorKey",disabled:y})]}),e.jsxs(W,{children:[e.jsx(B,{title:"Time format",description:"Default time format to show in views 12 / 24 hours",error:(w=d.timeFormat)==null?void 0:w.message}),e.jsx(re,{value:c("timeFormat"),onValueChange:_=>{_!==null&&m("timeFormat",_,{shouldDirty:!0})},defaultValue:"24",options:[{value:"12",label:"12 hours 11:00:10 PM"},{value:"24",label:"24 hours 23:00:10"}]})]}),e.jsxs(W,{children:[e.jsx(B,{title:"Views language",description:"Language to be displayed in views",error:($=d.language)==null?void 0:$.message}),e.jsx(re,{value:c("language"),onValueChange:_=>{_!==null&&m("language",_,{shouldDirty:!0})},disabled:y,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 vl="_uploadLogoCard_m5263_17",wl="_customDataItem_m5263_32",Sl="_titleRow_m5263_39",Cl="_customImage_m5263_48",_l="_imageContainer_m5263_54",Ve={uploadLogoCard:vl,customDataItem:wl,titleRow:Sl,customImage:Cl,imageContainer:_l};function kl(){var q;const{data:t,status:s}=pr(),{updateProjectData:n}=gr(),{handleSubmit:r,register:i,reset:l,formState:{isSubmitting:a,isValid:c,isDirty:m,errors:o},setError:u,clearErrors:h,watch:d,control:x,setValue:j}=ce({defaultValues:t,values:t,resetOptions:{keepDirtyValues:!0},mode:"onChange"}),{fields:p,append:y,remove:b}=et({control:x,name:"custom"});g.useEffect(()=>{t&&l(t)},[t,l]);const v=async F=>{var T;const E=(T=F.target.files)==null?void 0:T[0];if(h("logo"),!!E)try{Ua(E);const R=await fr(E);j("logo",R.data.logoFilename,{shouldDirty:!0})}catch(R){const K=V(R);u("logo",{message:K})}},{ref:S,...L}=i("logo"),D=g.useRef(null),O=()=>{var F;(F=D.current)==null||F.click()},U=F=>{F.preventDefault(),F.stopPropagation(),j("logo",null,{shouldDirty:!0})},w=()=>{y({title:"",value:"",url:""})},$=async F=>{try{h(),await n(F)}catch(E){const T=V(E);u("root",{message:T})}},_=()=>{l(t)},G=s==="pending";return e.jsx(P,{as:"form",onSubmit:r($),onKeyDown:F=>Se(F,_),children:e.jsxs(se,{children:[e.jsxs(Q,{children:["Project data",e.jsxs(A,{children:[e.jsx(f,{onClick:_,disabled:a||!m,children:"Revert to saved"}),e.jsx(f,{variant:"primary",type:"submit",disabled:!m||!c,loading:a,children:"Save"})]})]}),e.jsx(ie,{}),e.jsxs(P,{children:[e.jsx(Le,{isLoading:G}),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(P,{style:{marginTop:0},children:e.jsxs("label",{children:["Project logo",e.jsx("input",{type:"file",style:{display:"none"},accept:"image/*",...L,ref:F=>{S(F),D.current=F},onChange:v}),e.jsxs(se,{className:Ve.uploadLogoCard,children:[d("logo")?e.jsxs(e.Fragment,{children:[e.jsx("img",{src:`${wn}/${d("logo")}`}),e.jsxs(f,{variant:"subtle-destructive",disabled:a||!d("logo"),onClick:U,children:[e.jsx(je,{}),"Delete"]})]}):e.jsxs(f,{disabled:a,onClick:O,type:"button",children:[e.jsx(Ge,{}),"Upload logo"]}),((q=o==null?void 0:o.logo)==null?void 0:q.message)&&e.jsx(N,{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(gt,{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:kt,...i("url")})]}),e.jsxs(P,{style:{marginTop:0},children:[e.jsxs(W,{children:[e.jsx(B,{title:"Custom data",description:""}),e.jsxs(f,{onClick:w,children:["Add ",e.jsx(pe,{})]})]}),p.length>0&&p.map((F,E)=>{var R,K,I;const T=(R=o.custom)==null?void 0:R[E];return e.jsxs("div",{className:Ve.customDataItem,children:[e.jsxs("div",{className:Ve.titleRow,children:[e.jsxs("label",{className:Ve.title,children:["Title",e.jsx(M,{fluid:!0,defaultValue:F.title,placeholder:"Title of your custom data",...i(`custom.${E}.title`,{required:{value:!0,message:"Field cannot be empty"}})})]}),e.jsxs(f,{variant:"subtle-destructive",onClick:()=>b(E),children:[e.jsx(je,{}),"Delete"]})]}),((K=T==null?void 0:T.title)==null?void 0:K.message)&&e.jsx(N,{children:T.title.message}),e.jsxs("label",{children:["Text",e.jsx(gt,{fluid:!0,rows:3,resize:"vertical",defaultValue:F.value,placeholder:"Text of your custom data",...i(`custom.${E}.value`,{required:{value:!0,message:"Field cannot be empty"}})}),((I=T==null?void 0:T.value)==null?void 0:I.message)&&e.jsx(N,{children:T.value.message})]}),e.jsxs("label",{children:["Image URL (optional)",e.jsxs("div",{className:Ve.customImage,children:[e.jsx(M,{fluid:!0,defaultValue:F.url,placeholder:"Paste image URL (optional)",...i(`custom.${E}.url`)}),e.jsx("div",{className:Ve.imageContainer,children:d(`custom.${E}.url`)&&e.jsx("img",{src:d(`custom.${E}.url`),alt:"",loading:"lazy",className:"info__image"})})]})]})]},F.id)})]})]})]})})}const Dl="_editorActions_18rtd_17",Rl="_right_18rtd_21",Nl="_column_18rtd_26",xt={editorActions:Dl,right:Rl,column:Nl},El=g.lazy(()=>Qe(()=>import("./StyleEditor-CpciRLYh.js"),__vite__mapDeps([11,1,2,12]),import.meta.url));function Pl({isOpen:t,onClose:s}){const[n,r]=g.useState(""),[i,l]=g.useState(!1),[a,c]=g.useState(!1),[m,o]=g.useState(!1),[u,h]=g.useState(null),d=g.useRef(null),x=async()=>{try{o(!0);const y=await Sn();r(y)}catch{}finally{o(!1)}},j=async()=>{try{c(!0),d.current&&(await Cn(d.current.getCss()),r(d.current.getCss()),l(!1))}catch{}finally{c(!1)}},p=()=>r("");return g.useEffect(()=>{async function y(){if(t)try{const b=await _n();r(b)}catch{h("Failed to load CSS from server")}}y()},[t]),e.jsx(Pt,{title:"Edit CSS override",isOpen:t,onClose:s,showCloseButton:!0,showBackdrop:!0,bodyElements:e.jsx(El,{ref:d,initialValue:n,language:"css",isDirty:i,setIsDirty:l}),footerElements:e.jsxs("div",{className:xt.column,children:[e.jsx(me,{children:"Invalid CSS will be refused by the browser"}),u&&e.jsx(N,{className:xt.right,children:`Error: ${u}`}),e.jsxs(A,{align:"apart",className:xt.editorActions,children:[e.jsx(f,{variant:"ghosted",size:"large",onClick:x,disabled:a||m,children:"Reset to example"}),e.jsxs(A,{children:[e.jsx(f,{variant:"ghosted",size:"large",onClick:p,children:"Clear"}),e.jsx(f,{size:"large",onClick:s,children:"Cancel"}),e.jsx(f,{variant:"primary",size:"large",onClick:j,disabled:a||m||!i,loading:a,children:"Save changes"})]})]})]})})}const Ol="https://docs.getontime.no/features/custom-styling/";function Tl(){var y;const{data:t,status:s,mutateAsync:n}=kn(),[r,i]=Ne(),{control:l,handleSubmit:a,setError:c,reset:m,setValue:o,watch:u,formState:{isSubmitting:h,isDirty:d,errors:x}}=ce({defaultValues:t,values:t,resetOptions:{keepDirtyValues:!0}});g.useEffect(()=>{t&&m(t)},[t,m]);const j=async b=>{try{n(b)}catch(v){const S=V(v);c("root",{message:S})}},p=()=>{m(t)};return l?e.jsx(P,{as:"form",onSubmit:a(j),onKeyDown:b=>Se(b,p),id:"view-settings",children:e.jsxs(se,{children:[e.jsxs(Q,{children:["View settings",e.jsxs(A,{children:[e.jsx(f,{disabled:!d,variant:"ghosted",onClick:p,children:"Revert to saved"}),e.jsx(f,{type:"submit",loading:h,disabled:!d,variant:"primary",children:"Save"})]})]}),e.jsx(ie,{}),e.jsxs(me,{children:["You can customise the styles applied to Ontime views by providing overriding CSS rules.",e.jsx("br",{}),e.jsx(te,{href:Ol,children:"See the docs"})]}),e.jsxs(P,{children:[e.jsx(Le,{isLoading:s==="pending"}),e.jsx(N,{children:(y=x.root)==null?void 0:y.message}),e.jsxs(oe,{children:[e.jsx(Pl,{isOpen:r,onClose:i.close}),e.jsxs(W,{children:[e.jsx(B,{title:"Override CSS styles",description:"Enables overriding view styles with custom stylesheet"}),e.jsx(ke,{size:"large",checked:u("overrideStyles"),onCheckedChange:b=>o("overrideStyles",b,{shouldDirty:!0})}),e.jsx(f,{onClick:i.open,disabled:h,children:"Edit CSS override"})]})]}),e.jsxs(oe,{children:[e.jsxs(W,{children:[e.jsx(B,{title:"Timer colour",description:"Default colour of a running timer"}),e.jsx(ut,{name:"normalColor",control:l})]}),e.jsxs(W,{children:[e.jsx(B,{title:"Warning colour",description:"Colour of a running timer in warning mode"}),e.jsx(ut,{name:"warningColor",control:l})]}),e.jsxs(W,{children:[e.jsx(B,{title:"Danger colour",description:"Colour of a running timer in danger mode"}),e.jsx(ut,{name:"dangerColor",control:l})]})]})]})]})}):null}function Al({location:t}){const s=ae("data",t),n=ae("general",t),r=ae("view",t);return e.jsxs(e.Fragment,{children:[e.jsx(Ae,{children:"Settings"}),e.jsx("div",{ref:s,children:e.jsx(kl,{})}),e.jsx("div",{ref:n,children:e.jsx(bl,{})}),e.jsx("div",{ref:r,children:e.jsx(Tl,{})})]})}function Fl(){const{isElectron:t,sendToElectron:s}=Dn(),[n,r]=Ne(),i=g.useRef(null),l=()=>{s("shutdown","now"),r.close()},a=t||tt;return e.jsxs(e.Fragment,{children:[e.jsx(Ae,{children:"Shutdown Ontime"}),e.jsxs(P,{children:[Me?e.jsx(Rn,{children:"For security reasons, shutting down the server must be done from the Ontime Cloud dashboard."}):e.jsxs(Ee,{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:r.open,disabled:!(t||tt),children:"Shutdown ontime"}),!a&&e.jsx(ne,{children:"Note: Ontime can only be shutdown from the machine it is running in."}),e.jsx(st,{isOpen:n,title:"Shutdown Ontime",showCloseButton:!0,onClose:r.close,bodyElements:e.jsxs(Ee,{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:r.close,variant:"ghosted-white",children:"Cancel"}),e.jsx(f,{variant:"destructive",onClick:l,disabled:!a,children:"Shutdown"})]})})]})]})}const Il="_corner_1dxip_17",Ll="_contentWrapper_1dxip_24",$l="_content_1dxip_24",jt={corner:Il,contentWrapper:Ll,content:$l};function Vl({onClose:t,children:s}){return e.jsxs("div",{className:jt.contentWrapper,children:[e.jsx("div",{className:jt.content,children:s}),e.jsx("div",{className:jt.corner,children:e.jsxs(f,{size:"large",onClick:t,children:["Close settings ",e.jsx(Ct,{})]})})]})}const Ml=[{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 Wl(){const{data:t}=ws();return{options:g.useMemo(()=>Ml.map(n=>({...n,highlight:n.id==="about"&&t.hasUpdates?"New version available":void 0})),[t])}}const Xe="settings";function Tt(){const[t,s]=is(),n=g.useMemo(()=>t.get(Xe)??"project",[t]),r=g.useMemo(()=>!!t.get(Xe),[t]),[i,l]=n.split("__"),a=g.useCallback(()=>{t.delete(Xe),s(t)},[t,s]),c=g.useCallback(m=>{t.set(Xe,m),s(t)},[t,s]);return{isOpen:r,panel:i,location:l,setLocation:c,close:a}}const Ul="_tabs_86c70_17",ql="_primary_86c70_31",zl="_secondary_86c70_32",Bl="_active_86c70_54",Kl="_highlight_86c70_58",Hl="_split_86c70_68",Fe={tabs:Ul,primary:ql,secondary:zl,active:Bl,highlight:Kl,split:Hl};function Gl({selectedPanel:t,location:s}){const{options:n}=Wl();return e.jsx("ul",{className:Fe.tabs,children:n.map(r=>{const i=t===r.id;return r.highlight?e.jsx(bs,{text:r.highlight,render:e.jsx("span",{}),children:e.jsx(es,{panel:r,location:s,isSelected:i})},r.id):e.jsx(es,{panel:r,location:s,isSelected:i},r.id)})})}function es(t){var a;const{panel:s,isSelected:n,location:r}=t,{setLocation:i}=Tt(),l=be([Fe.primary,n&&Fe.active,s.split&&Fe.split,s.highlight&&Fe.highlight]);return e.jsxs(g.Fragment,{children:[e.jsx("li",{onClick:()=>i(s.id),onKeyDown:c=>{Mt(c)&&i(s.id)},className:l,tabIndex:0,role:"button",children:s.label},s.id),(a=s.secondary)==null?void 0:a.map((c,m)=>{const o=c.id.split("__")[1],u=be([Fe.secondary,n&&r===o?Fe.active:null]);return e.jsx("li",{onClick:()=>i(c.id),onKeyDown:h=>{Mt(h)&&i(c.id)},className:u,role:"button",children:c.label},c.id+m)})]},s.id)}const Ql="_container_1fy3l_17",Yl={container:Ql};function Jl(){const{close:t,panel:s,location:n,setLocation:r}=Tt();return kr(t,"Escape"),e.jsx("div",{className:Yl.container,children:e.jsxs(Ks,{children:[e.jsx(Gl,{selectedPanel:s,location:n}),e.jsxs(Vl,{onClose:t,children:[s==="settings"&&e.jsx(Al,{location:n}),s==="project"&&e.jsx(pl,{location:n,setLocation:r}),s==="manage"&&e.jsx(Oi,{location:n}),s==="automation"&&e.jsx(da,{location:n}),s==="sharing"&&e.jsx(Ea,{location:n}),s==="network"&&e.jsx(Ki,{location:n}),s==="about"&&e.jsx(Pr,{}),s==="shutdown"&&e.jsx(Fl,{})]})]})})}const Xl=g.memo(Zl);function Zl({children:t}){return e.jsxs(Gn,{navElements:t,children:[e.jsx(Qn,{}),e.jsx(yr,{}),e.jsx(br,{}),e.jsx(vr,{}),e.jsx(wr,{}),e.jsx(Sr,{})]})}function eo({onFinish:t}){const s=g.useRef(null),n=()=>{var i;(i=s.current)==null||i.click()},r=async i=>{var a,c;const l=(c=(a=i.target)==null?void 0:a.files)==null?void 0:c[0];if(l)try{_s(l),await Ds(l)}catch{}finally{await We(),t()}};return e.jsxs(e.Fragment,{children:[e.jsx("input",{ref:s,style:{display:"none"},type:"file",onChange:r,accept:".json","data-testid":"file-input"}),e.jsx(f,{onClick:n,children:"Import project"})]})}const to="_sections_ar7bf_17",so="_column_ar7bf_23",no="_about_ar7bf_23",ro="_inline_ar7bf_35",ao="_header_ar7bf_41",io="_logo_ar7bf_48",lo="_buttonRow_ar7bf_53",oo="_tableContainer_ar7bf_62",co="_table_ar7bf_62",uo="_current_ar7bf_75",ye={sections:to,column:so,about:no,inline:ro,header:ao,logo:io,buttonRow:lo,tableContainer:oo,table:co,current:uo};function ho(t){const{loadProject:s,onClose:n}=t,{data:r}=Os();return e.jsx("tbody",{children:r.reorderedProjectFiles.map(i=>i.filename===r.lastLoadedProject?e.jsxs("tr",{className:ye.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 mo({onClose:t}){const s=Hs(),n=async l=>{try{await Ns(l),await We(),t()}catch{}},r=async()=>{try{await Ha(),await We(),t()}catch{}},i=()=>{s("/editor?settings=project__create"),t()};return e.jsx(Pt,{isOpen:!0,onClose:()=>t(),showBackdrop:!0,bodyElements:e.jsxs("div",{className:ye.sections,children:[e.jsxs("div",{className:ye.about,children:[e.jsx("img",{src:"ontime-logo.png",alt:"ontime",className:ye.logo}),e.jsxs("div",{children:["Ontime v",Ze]}),e.jsx(te,{href:pt,children:"Website"}),e.jsx(te,{href:kt,children:"Read the docs"}),e.jsx(te,{href:ls,children:"Discord server"})]}),e.jsxs("div",{className:ye.column,children:[e.jsxs("div",{className:ye.header,children:["Welcome to Ontime",e.jsx(X,{"aria-label":"close welcome modal",variant:"subtle-white",onClick:()=>t(),children:e.jsx(Ct,{})})]}),e.jsx(jr,{children:"Select project"}),e.jsx("div",{className:ye.tableContainer,children:e.jsxs("table",{className:ye.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"File Name"}),e.jsx("th",{children:"Last Used"})]})}),e.jsx(ho,{loadProject:n,onClose:()=>t()})]})})]})]}),footerElements:e.jsxs("div",{className:ye.column,children:[e.jsxs("div",{className:ye.buttonRow,children:[e.jsx(f,{onClick:r,children:"Load demo project"}),e.jsx(eo,{onFinish:()=>t()}),e.jsx(f,{variant:"primary",onClick:i,children:"Create new..."})]}),e.jsxs(xr,{className:ye.inline,children:[e.jsx(Tn,{defaultChecked:!0,onCheckedChange:l=>Nn(l)}),"Show this modal on next startup"]})]})})}function xo(){const t=Wt(n=>n.showDialog),s=Wt(n=>n.clearDialog);return t?e.jsx(mo,{onClose:s}):null}const jo="_panelContainer_14rka_17",po="_left_14rka_24",ts={panelContainer:jo,left:po},go=g.lazy(()=>Qe(()=>import("./RundownExport-EorsanA0.js").then(t=>t.R),__vite__mapDeps([13,1,2,14,3,4,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,8,9,31,32,7,10,33,34,35,36,37,38]),import.meta.url)),fo=g.lazy(()=>Qe(()=>import("./TimerControlExport-Dx3SSGNG.js"),__vite__mapDeps([39,1,2,14,3,4,15,16,17,20,21,22,31,32,40,41]),import.meta.url)),yo=g.lazy(()=>Qe(()=>import("./MessageControlExport-GmOrvUik.js"),__vite__mapDeps([42,1,2,14,3,4,15,16,17,29,30,31,32,43]),import.meta.url));function bo(){return e.jsxs("div",{id:"panels",className:ts.panelContainer,children:[e.jsxs("div",{className:ts.left,children:[e.jsx(fo,{}),e.jsx(yo,{})]}),e.jsx(go,{})]})}const vo="_mainContainer_1m0yz_17",wo={mainContainer:vo};function Ko(){const{isOpen:t,setLocation:s,close:n}=Tt(),[r,i]=Ne();An("Editor"),En(),g.useEffect(()=>{var a;((a=window.process)==null?void 0:a.type)==="renderer"&&window.ipcRenderer.on("user-request-shutdown",()=>{s("shutdown")})},[s]);const l=g.useCallback(()=>{t?n():s("settings")},[n,t,s]);return Gs([["mod + ,",l]]),e.jsx(On,{permission:"editor",children:e.jsxs("div",{className:wo.mainContainer,"data-testid":"event-editor",children:[e.jsx(xo,{}),e.jsx(Pn,{isOpen:r,onClose:i.close}),e.jsxs(Xl,{children:[e.jsx(X,{"aria-label":"Toggle navigation",variant:"subtle-white",size:"xlarge",onClick:i.open,children:e.jsx(Qs,{})}),e.jsx(X,{"aria-label":"Toggle settings",variant:"subtle-white",size:"xlarge",onClick:l,children:t?e.jsx(Ct,{}):e.jsx(Ys,{})})]}),t?e.jsx(Jl,{}):e.jsx(bo,{})]})})}export{Ko as default};
|
|
3
|
+
//# sourceMappingURL=ProtectedEditor-D_A75byA.js.map
|
|
Binary file
|
|
Binary file
|