@getontime/cli 4.0.0-beta.5 → 4.0.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.
Files changed (366) hide show
  1. package/client/assets/Backstage-ZSqb8OU6.js +2 -0
  2. package/client/assets/Backstage-ZSqb8OU6.js.br +0 -0
  3. package/client/assets/Backstage-ZSqb8OU6.js.gz +0 -0
  4. package/client/assets/Backstage-ZSqb8OU6.js.map +1 -0
  5. package/client/assets/Countdown-DVRZbeRP.js +2 -0
  6. package/client/assets/Countdown-DVRZbeRP.js.br +0 -0
  7. package/client/assets/Countdown-DVRZbeRP.js.gz +0 -0
  8. package/client/assets/{Countdown-BaaR4j9x.js.map → Countdown-DVRZbeRP.js.map} +1 -1
  9. package/client/assets/CustomTranslationModal-D_Cy0d_H.js +2 -0
  10. package/client/assets/CustomTranslationModal-D_Cy0d_H.js.br +0 -0
  11. package/client/assets/CustomTranslationModal-D_Cy0d_H.js.gz +0 -0
  12. package/client/assets/{CustomTranslationModal-CcNNjbmZ.js.map → CustomTranslationModal-D_Cy0d_H.js.map} +1 -1
  13. package/client/assets/{DelayIndicator-DXDACqpc.js → DelayIndicator-B_JKLKYW.js} +2 -2
  14. package/client/assets/DelayIndicator-B_JKLKYW.js.br +0 -0
  15. package/client/assets/DelayIndicator-B_JKLKYW.js.gz +0 -0
  16. package/client/assets/{DelayIndicator-DXDACqpc.js.map → DelayIndicator-B_JKLKYW.js.map} +1 -1
  17. package/client/assets/{EditorFeatureWrapper-CX6wzTmM.js → EditorFeatureWrapper-DzBxDvRn.js} +2 -2
  18. package/client/assets/EditorFeatureWrapper-DzBxDvRn.js.br +0 -0
  19. package/client/assets/EditorFeatureWrapper-DzBxDvRn.js.gz +0 -0
  20. package/client/assets/{EditorFeatureWrapper-CX6wzTmM.js.map → EditorFeatureWrapper-DzBxDvRn.js.map} +1 -1
  21. package/client/assets/{EditorUtils-DxjFOwpn.js → EditorUtils-De0umjb-.js} +2 -2
  22. package/client/assets/EditorUtils-De0umjb-.js.br +0 -0
  23. package/client/assets/EditorUtils-De0umjb-.js.gz +0 -0
  24. package/client/assets/{EditorUtils-DxjFOwpn.js.map → EditorUtils-De0umjb-.js.map} +1 -1
  25. package/client/assets/{Empty-DiBXyIA8.js → Empty-BYF0tVRk.js} +2 -2
  26. package/client/assets/Empty-BYF0tVRk.js.br +2 -0
  27. package/client/assets/Empty-BYF0tVRk.js.gz +0 -0
  28. package/client/assets/{Empty-DiBXyIA8.js.map → Empty-BYF0tVRk.js.map} +1 -1
  29. package/client/assets/{EmptyPage-X6EO1Y5W.js → EmptyPage-DYH2bswA.js} +2 -2
  30. package/client/assets/EmptyPage-DYH2bswA.js.br +0 -0
  31. package/client/assets/EmptyPage-DYH2bswA.js.gz +0 -0
  32. package/client/assets/{EmptyPage-X6EO1Y5W.js.map → EmptyPage-DYH2bswA.js.map} +1 -1
  33. package/client/assets/{FollowButton-Cr-HA2-6.js → FollowButton-DyWsvyFF.js} +2 -2
  34. package/client/assets/FollowButton-DyWsvyFF.js.br +0 -0
  35. package/client/assets/FollowButton-DyWsvyFF.js.gz +0 -0
  36. package/client/assets/{FollowButton-Cr-HA2-6.js.map → FollowButton-DyWsvyFF.js.map} +1 -1
  37. package/client/assets/{MessageControlExport-VUkIayAJ.js → MessageControlExport-yLGU2dMq.js} +2 -2
  38. package/client/assets/MessageControlExport-yLGU2dMq.js.br +0 -0
  39. package/client/assets/MessageControlExport-yLGU2dMq.js.gz +0 -0
  40. package/client/assets/{MessageControlExport-VUkIayAJ.js.map → MessageControlExport-yLGU2dMq.js.map} +1 -1
  41. package/client/assets/MilestoneEditor-GkzJ-h1C.js +2 -0
  42. package/client/assets/MilestoneEditor-GkzJ-h1C.js.br +0 -0
  43. package/client/assets/MilestoneEditor-GkzJ-h1C.js.gz +0 -0
  44. package/client/assets/{MilestoneEditor-Da8oxrHI.js.map → MilestoneEditor-GkzJ-h1C.js.map} +1 -1
  45. package/client/assets/Modal-BKL-5GzU.js +2 -0
  46. package/client/assets/Modal-BKL-5GzU.js.br +0 -0
  47. package/client/assets/Modal-BKL-5GzU.js.gz +0 -0
  48. package/client/assets/Modal-BKL-5GzU.js.map +1 -0
  49. package/client/assets/Modal-BgJx3SNK.css +1 -0
  50. package/client/assets/Modal-BgJx3SNK.css.br +0 -0
  51. package/client/assets/Modal-BgJx3SNK.css.gz +0 -0
  52. package/client/assets/{MultiPartProgressBar-mGPuP1Wd.js → MultiPartProgressBar-BITERKS0.js} +2 -2
  53. package/client/assets/MultiPartProgressBar-BITERKS0.js.br +0 -0
  54. package/client/assets/MultiPartProgressBar-BITERKS0.js.gz +0 -0
  55. package/client/assets/{MultiPartProgressBar-mGPuP1Wd.js.map → MultiPartProgressBar-BITERKS0.js.map} +1 -1
  56. package/client/assets/OperatorExport-DMZ6eQfT.js +2 -0
  57. package/client/assets/OperatorExport-DMZ6eQfT.js.br +0 -0
  58. package/client/assets/OperatorExport-DMZ6eQfT.js.gz +0 -0
  59. package/client/assets/OperatorExport-DMZ6eQfT.js.map +1 -0
  60. package/client/assets/{OverviewWrapper-BMuW_wiO.js → OverviewWrapper-riM6vPno.js} +2 -2
  61. package/client/assets/OverviewWrapper-riM6vPno.js.br +0 -0
  62. package/client/assets/OverviewWrapper-riM6vPno.js.gz +0 -0
  63. package/client/assets/{OverviewWrapper-BMuW_wiO.js.map → OverviewWrapper-riM6vPno.js.map} +1 -1
  64. package/client/assets/{ProjectInfo-BYi1lzPk.js → ProjectInfo-DxtMq70a.js} +2 -2
  65. package/client/assets/ProjectInfo-DxtMq70a.js.br +0 -0
  66. package/client/assets/ProjectInfo-DxtMq70a.js.gz +0 -0
  67. package/client/assets/{ProjectInfo-BYi1lzPk.js.map → ProjectInfo-DxtMq70a.js.map} +1 -1
  68. package/client/assets/{ProtectRoute-DnUCrlh6.js → ProtectRoute-p1fmtLeu.js} +2 -2
  69. package/client/assets/ProtectRoute-p1fmtLeu.js.br +0 -0
  70. package/client/assets/ProtectRoute-p1fmtLeu.js.gz +0 -0
  71. package/client/assets/{ProtectRoute-DnUCrlh6.js.map → ProtectRoute-p1fmtLeu.js.map} +1 -1
  72. package/client/assets/ProtectedCuesheet-CvRnqT0z.js +2 -0
  73. package/client/assets/ProtectedCuesheet-CvRnqT0z.js.br +0 -0
  74. package/client/assets/ProtectedCuesheet-CvRnqT0z.js.gz +0 -0
  75. package/client/assets/ProtectedCuesheet-CvRnqT0z.js.map +1 -0
  76. package/client/assets/ProtectedEditor-BoiAT_IR.css +1 -0
  77. package/client/assets/ProtectedEditor-BoiAT_IR.css.br +0 -0
  78. package/client/assets/ProtectedEditor-BoiAT_IR.css.gz +0 -0
  79. package/client/assets/ProtectedEditor-D4UXj1xL.js +3 -0
  80. package/client/assets/ProtectedEditor-D4UXj1xL.js.br +0 -0
  81. package/client/assets/ProtectedEditor-D4UXj1xL.js.gz +0 -0
  82. package/client/assets/ProtectedEditor-D4UXj1xL.js.map +1 -0
  83. package/client/assets/RundownEntry-B1dSz1wu.js +2 -0
  84. package/client/assets/RundownEntry-B1dSz1wu.js.br +0 -0
  85. package/client/assets/RundownEntry-B1dSz1wu.js.gz +0 -0
  86. package/client/assets/{RundownEntry-Dl4Cb_pZ.js.map → RundownEntry-B1dSz1wu.js.map} +1 -1
  87. package/client/assets/RundownExport-WjLpncYT.js +3 -0
  88. package/client/assets/RundownExport-WjLpncYT.js.br +0 -0
  89. package/client/assets/RundownExport-WjLpncYT.js.gz +0 -0
  90. package/client/assets/{RundownExport-BPDLhvsM.js.map → RundownExport-WjLpncYT.js.map} +1 -1
  91. package/client/assets/{Select-CUjlJirY.js → Select-niU9Razm.js} +2 -2
  92. package/client/assets/Select-niU9Razm.js.br +0 -0
  93. package/client/assets/Select-niU9Razm.js.gz +0 -0
  94. package/client/assets/{Select-CUjlJirY.js.map → Select-niU9Razm.js.map} +1 -1
  95. package/client/assets/Studio-CWdJq4bx.js +2 -0
  96. package/client/assets/Studio-CWdJq4bx.js.br +0 -0
  97. package/client/assets/Studio-CWdJq4bx.js.gz +0 -0
  98. package/client/assets/{Studio-BLCIas53.js.map → Studio-CWdJq4bx.js.map} +1 -1
  99. package/client/assets/{StyleEditor-DTNiR-0P.js → StyleEditor-BIFjHsgD.js} +2 -2
  100. package/client/assets/StyleEditor-BIFjHsgD.js.br +0 -0
  101. package/client/assets/StyleEditor-BIFjHsgD.js.gz +0 -0
  102. package/client/assets/{StyleEditor-DTNiR-0P.js.map → StyleEditor-BIFjHsgD.js.map} +1 -1
  103. package/client/assets/SuperscriptTime-DCTyUARx.js +2 -0
  104. package/client/assets/SuperscriptTime-DCTyUARx.js.br +0 -0
  105. package/client/assets/SuperscriptTime-DCTyUARx.js.gz +0 -0
  106. package/client/assets/SuperscriptTime-DCTyUARx.js.map +1 -0
  107. package/client/assets/TimeElements-DBVGVx71.js +2 -0
  108. package/client/assets/TimeElements-DBVGVx71.js.br +0 -0
  109. package/client/assets/TimeElements-DBVGVx71.js.gz +0 -0
  110. package/client/assets/{TimeElements-rlwX9Mgy.js.map → TimeElements-DBVGVx71.js.map} +1 -1
  111. package/client/assets/{TimeInput-C0_Nl63x.js → TimeInput-wQ67FbW6.js} +2 -2
  112. package/client/assets/TimeInput-wQ67FbW6.js.br +0 -0
  113. package/client/assets/TimeInput-wQ67FbW6.js.gz +0 -0
  114. package/client/assets/{TimeInput-C0_Nl63x.js.map → TimeInput-wQ67FbW6.js.map} +1 -1
  115. package/client/assets/TimelinePage-DZefE2vQ.js +2 -0
  116. package/client/assets/TimelinePage-DZefE2vQ.js.br +0 -0
  117. package/client/assets/TimelinePage-DZefE2vQ.js.gz +0 -0
  118. package/client/assets/{TimelinePage-BC-pnISF.js.map → TimelinePage-DZefE2vQ.js.map} +1 -1
  119. package/client/assets/Timer-Bs450x86.js +2 -0
  120. package/client/assets/Timer-Bs450x86.js.br +0 -0
  121. package/client/assets/Timer-Bs450x86.js.gz +0 -0
  122. package/client/assets/Timer-Bs450x86.js.map +1 -0
  123. package/client/assets/{TimerControlExport-C_Jbwxog.js → TimerControlExport-C1C_vBX4.js} +2 -2
  124. package/client/assets/TimerControlExport-C1C_vBX4.js.br +0 -0
  125. package/client/assets/TimerControlExport-C1C_vBX4.js.gz +0 -0
  126. package/client/assets/{TimerControlExport-C_Jbwxog.js.map → TimerControlExport-C1C_vBX4.js.map} +1 -1
  127. package/client/assets/{TitleCard-C-Tw72nZ.js → TitleCard-B4N-kCM3.js} +2 -2
  128. package/client/assets/TitleCard-B4N-kCM3.js.br +0 -0
  129. package/client/assets/TitleCard-B4N-kCM3.js.gz +0 -0
  130. package/client/assets/{TitleCard-C-Tw72nZ.js.map → TitleCard-B4N-kCM3.js.map} +1 -1
  131. package/client/assets/{Tooltip-BZrLdTBU.js → Tooltip-DJ8Y4CO4.js} +2 -2
  132. package/client/assets/Tooltip-DJ8Y4CO4.js.br +0 -0
  133. package/client/assets/Tooltip-DJ8Y4CO4.js.gz +0 -0
  134. package/client/assets/{Tooltip-BZrLdTBU.js.map → Tooltip-DJ8Y4CO4.js.map} +1 -1
  135. package/client/assets/{ViewLogo-CdsW41HC.js → ViewLogo-Dd60EREE.js} +2 -2
  136. package/client/assets/ViewLogo-Dd60EREE.js.br +0 -0
  137. package/client/assets/ViewLogo-Dd60EREE.js.gz +0 -0
  138. package/client/assets/{ViewLogo-CdsW41HC.js.map → ViewLogo-Dd60EREE.js.map} +1 -1
  139. package/client/assets/{ViewParamsEditor-kNKEOAwm.css → ViewParamsEditor-1Ok39npF.css} +1 -1
  140. package/client/assets/ViewParamsEditor-1Ok39npF.css.br +0 -0
  141. package/client/assets/ViewParamsEditor-1Ok39npF.css.gz +0 -0
  142. package/client/assets/{ViewParamsEditor-YoYxps2g.js → ViewParamsEditor-BWEYbq_S.js} +2 -2
  143. package/client/assets/ViewParamsEditor-BWEYbq_S.js.br +0 -0
  144. package/client/assets/ViewParamsEditor-BWEYbq_S.js.gz +0 -0
  145. package/client/assets/{ViewParamsEditor-YoYxps2g.js.map → ViewParamsEditor-BWEYbq_S.js.map} +1 -1
  146. package/client/assets/{dateConfig-CqC6Ta_8.js → dateConfig-8rhb0Dbh.js} +2 -2
  147. package/client/assets/dateConfig-8rhb0Dbh.js.br +0 -0
  148. package/client/assets/dateConfig-8rhb0Dbh.js.gz +0 -0
  149. package/client/assets/{dateConfig-CqC6Ta_8.js.map → dateConfig-8rhb0Dbh.js.map} +1 -1
  150. package/client/assets/{editorSettings-CL1TjKzU.js → editorSettings-LMnfWux6.js} +2 -2
  151. package/client/assets/editorSettings-LMnfWux6.js.br +0 -0
  152. package/client/assets/editorSettings-LMnfWux6.js.gz +0 -0
  153. package/client/assets/{editorSettings-CL1TjKzU.js.map → editorSettings-LMnfWux6.js.map} +1 -1
  154. package/client/assets/{getProgress-Dh-Yy44B.js → getProgress-CyJTu6f5.js} +2 -2
  155. package/client/assets/getProgress-CyJTu6f5.js.br +0 -0
  156. package/client/assets/getProgress-CyJTu6f5.js.gz +0 -0
  157. package/client/assets/{getProgress-Dh-Yy44B.js.map → getProgress-CyJTu6f5.js.map} +1 -1
  158. package/client/assets/index-5QAOtSTh.js +3 -0
  159. package/client/assets/index-5QAOtSTh.js.br +0 -0
  160. package/client/assets/index-5QAOtSTh.js.gz +0 -0
  161. package/client/assets/index-5QAOtSTh.js.map +1 -0
  162. package/client/assets/{index-pvMSlFrO.css → index-De0uf0Ta.css} +1 -1
  163. package/client/assets/index-De0uf0Ta.css.br +0 -0
  164. package/client/assets/index-De0uf0Ta.css.gz +0 -0
  165. package/client/assets/{offset-BnfjZ6JI.js → offset-CLDSqOP5.js} +2 -2
  166. package/client/assets/offset-CLDSqOP5.js.br +0 -0
  167. package/client/assets/offset-CLDSqOP5.js.gz +0 -0
  168. package/client/assets/{offset-BnfjZ6JI.js.map → offset-CLDSqOP5.js.map} +1 -1
  169. package/client/assets/{parseUserTime-DNXIMX9s.js → parseUserTime-CCDHpp7D.js} +2 -2
  170. package/client/assets/parseUserTime-CCDHpp7D.js.br +0 -0
  171. package/client/assets/parseUserTime-CCDHpp7D.js.gz +0 -0
  172. package/client/assets/{parseUserTime-DNXIMX9s.js.map → parseUserTime-CCDHpp7D.js.map} +1 -1
  173. package/client/assets/{playbackstate-DzSEaiNW.js → playbackstate-6lBh6omZ.js} +2 -2
  174. package/client/assets/playbackstate-6lBh6omZ.js.br +0 -0
  175. package/client/assets/playbackstate-6lBh6omZ.js.gz +0 -0
  176. package/client/assets/{playbackstate-DzSEaiNW.js.map → playbackstate-6lBh6omZ.js.map} +1 -1
  177. package/client/assets/{presentation.utils-BfcniGcl.js → presentation.utils-BUIuV_2e.js} +2 -2
  178. package/client/assets/presentation.utils-BUIuV_2e.js.br +0 -0
  179. package/client/assets/presentation.utils-BUIuV_2e.js.gz +0 -0
  180. package/client/assets/{presentation.utils-BfcniGcl.js.map → presentation.utils-BUIuV_2e.js.map} +1 -1
  181. package/client/assets/{rundownUtils-CPBsEZ2m.js → rundownUtils-Cnd2prRX.js} +2 -2
  182. package/client/assets/rundownUtils-Cnd2prRX.js.br +0 -0
  183. package/client/assets/rundownUtils-Cnd2prRX.js.gz +0 -0
  184. package/client/assets/{rundownUtils-CPBsEZ2m.js.map → rundownUtils-Cnd2prRX.js.map} +1 -1
  185. package/client/assets/{useCustomFields-DY13Ir96.js → useCustomFields-BuxKsqGS.js} +2 -2
  186. package/client/assets/useCustomFields-BuxKsqGS.js.br +0 -0
  187. package/client/assets/useCustomFields-BuxKsqGS.js.gz +0 -0
  188. package/client/assets/{useCustomFields-DY13Ir96.js.map → useCustomFields-BuxKsqGS.js.map} +1 -1
  189. package/client/assets/{useFollowComponent-C42-1XCu.js → useFollowComponent-iGQv4zoS.js} +2 -2
  190. package/client/assets/useFollowComponent-iGQv4zoS.js.br +0 -0
  191. package/client/assets/useFollowComponent-iGQv4zoS.js.gz +0 -0
  192. package/client/assets/{useFollowComponent-C42-1XCu.js.map → useFollowComponent-iGQv4zoS.js.map} +1 -1
  193. package/client/assets/{useProjectData-BF2F6qPB.js → useProjectData-CetvEK9E.js} +2 -2
  194. package/client/assets/useProjectData-CetvEK9E.js.br +0 -0
  195. package/client/assets/useProjectData-CetvEK9E.js.gz +0 -0
  196. package/client/assets/{useProjectData-BF2F6qPB.js.map → useProjectData-CetvEK9E.js.map} +1 -1
  197. package/client/assets/useReport-PEFRsOhF.js +2 -0
  198. package/client/assets/useReport-PEFRsOhF.js.br +0 -0
  199. package/client/assets/useReport-PEFRsOhF.js.gz +0 -0
  200. package/client/assets/{useReport-DPqY9XXp.js.map → useReport-PEFRsOhF.js.map} +1 -1
  201. package/client/assets/{useRundown-uuXixjnX.js → useRundown-D8CYATNi.js} +2 -2
  202. package/client/assets/useRundown-D8CYATNi.js.br +0 -0
  203. package/client/assets/useRundown-D8CYATNi.js.gz +0 -0
  204. package/client/assets/{useRundown-uuXixjnX.js.map → useRundown-D8CYATNi.js.map} +1 -1
  205. package/client/assets/{useWindowTitle-BQ1kqXfk.js → useWindowTitle-b5fN0StF.js} +2 -2
  206. package/client/assets/useWindowTitle-b5fN0StF.js.br +0 -0
  207. package/client/assets/useWindowTitle-b5fN0StF.js.gz +0 -0
  208. package/client/assets/{useWindowTitle-BQ1kqXfk.js.map → useWindowTitle-b5fN0StF.js.map} +1 -1
  209. package/client/assets/{validateEvent-Cy-jEiwB.js → validateEvent-Bvgk1E-Y.js} +2 -2
  210. package/client/assets/validateEvent-Bvgk1E-Y.js.br +0 -0
  211. package/client/assets/validateEvent-Bvgk1E-Y.js.gz +0 -0
  212. package/client/assets/{validateEvent-Cy-jEiwB.js.map → validateEvent-Bvgk1E-Y.js.map} +1 -1
  213. package/client/assets/{vendor-Cnciq4o_.js → vendor-Cu5xgv5K.js} +3 -3
  214. package/client/assets/vendor-Cu5xgv5K.js.br +0 -0
  215. package/client/assets/vendor-Cu5xgv5K.js.gz +0 -0
  216. package/client/assets/{vendor-Cnciq4o_.js.map → vendor-Cu5xgv5K.js.map} +1 -1
  217. package/client/assets/{common.options-p5f_zJ2-.js → viewLoader.utils-BPhACxyG.js} +2 -2
  218. package/client/assets/viewLoader.utils-BPhACxyG.js.br +0 -0
  219. package/client/assets/viewLoader.utils-BPhACxyG.js.gz +0 -0
  220. package/client/assets/viewLoader.utils-BPhACxyG.js.map +1 -0
  221. package/client/index.html +3 -3
  222. package/package.json +1 -1
  223. package/server/index.cjs +103 -103
  224. package/client/assets/Backstage-B-_iTDRg.js +0 -2
  225. package/client/assets/Backstage-B-_iTDRg.js.br +0 -0
  226. package/client/assets/Backstage-B-_iTDRg.js.gz +0 -0
  227. package/client/assets/Backstage-B-_iTDRg.js.map +0 -1
  228. package/client/assets/Countdown-BaaR4j9x.js +0 -2
  229. package/client/assets/Countdown-BaaR4j9x.js.br +0 -0
  230. package/client/assets/Countdown-BaaR4j9x.js.gz +0 -0
  231. package/client/assets/CustomTranslationModal-CcNNjbmZ.js +0 -2
  232. package/client/assets/CustomTranslationModal-CcNNjbmZ.js.br +0 -0
  233. package/client/assets/CustomTranslationModal-CcNNjbmZ.js.gz +0 -0
  234. package/client/assets/DelayIndicator-DXDACqpc.js.br +0 -0
  235. package/client/assets/DelayIndicator-DXDACqpc.js.gz +0 -0
  236. package/client/assets/DropdownMenu-Bn0VHzKx.js +0 -2
  237. package/client/assets/DropdownMenu-Bn0VHzKx.js.br +0 -0
  238. package/client/assets/DropdownMenu-Bn0VHzKx.js.gz +0 -0
  239. package/client/assets/DropdownMenu-Bn0VHzKx.js.map +0 -1
  240. package/client/assets/DropdownMenu-ByBDeesm.css +0 -1
  241. package/client/assets/DropdownMenu-ByBDeesm.css.br +0 -0
  242. package/client/assets/DropdownMenu-ByBDeesm.css.gz +0 -0
  243. package/client/assets/EditorFeatureWrapper-CX6wzTmM.js.br +0 -0
  244. package/client/assets/EditorFeatureWrapper-CX6wzTmM.js.gz +0 -0
  245. package/client/assets/EditorUtils-DxjFOwpn.js.br +0 -0
  246. package/client/assets/EditorUtils-DxjFOwpn.js.gz +0 -0
  247. package/client/assets/Empty-DiBXyIA8.js.br +0 -2
  248. package/client/assets/Empty-DiBXyIA8.js.gz +0 -0
  249. package/client/assets/EmptyPage-X6EO1Y5W.js.br +0 -0
  250. package/client/assets/EmptyPage-X6EO1Y5W.js.gz +0 -0
  251. package/client/assets/FollowButton-Cr-HA2-6.js.br +0 -0
  252. package/client/assets/FollowButton-Cr-HA2-6.js.gz +0 -0
  253. package/client/assets/MessageControlExport-VUkIayAJ.js.br +0 -0
  254. package/client/assets/MessageControlExport-VUkIayAJ.js.gz +0 -0
  255. package/client/assets/MilestoneEditor-Da8oxrHI.js +0 -2
  256. package/client/assets/MilestoneEditor-Da8oxrHI.js.br +0 -0
  257. package/client/assets/MilestoneEditor-Da8oxrHI.js.gz +0 -0
  258. package/client/assets/MultiPartProgressBar-mGPuP1Wd.js.br +0 -0
  259. package/client/assets/MultiPartProgressBar-mGPuP1Wd.js.gz +0 -0
  260. package/client/assets/OperatorExport-BeuWuV6I.js +0 -2
  261. package/client/assets/OperatorExport-BeuWuV6I.js.br +0 -0
  262. package/client/assets/OperatorExport-BeuWuV6I.js.gz +0 -0
  263. package/client/assets/OperatorExport-BeuWuV6I.js.map +0 -1
  264. package/client/assets/OverviewWrapper-BMuW_wiO.js.br +0 -0
  265. package/client/assets/OverviewWrapper-BMuW_wiO.js.gz +0 -0
  266. package/client/assets/ProjectInfo-BYi1lzPk.js.br +0 -0
  267. package/client/assets/ProjectInfo-BYi1lzPk.js.gz +0 -0
  268. package/client/assets/ProtectRoute-DnUCrlh6.js.br +0 -0
  269. package/client/assets/ProtectRoute-DnUCrlh6.js.gz +0 -0
  270. package/client/assets/ProtectedCuesheet-CQOB7ipQ.js +0 -2
  271. package/client/assets/ProtectedCuesheet-CQOB7ipQ.js.br +0 -0
  272. package/client/assets/ProtectedCuesheet-CQOB7ipQ.js.gz +0 -0
  273. package/client/assets/ProtectedCuesheet-CQOB7ipQ.js.map +0 -1
  274. package/client/assets/ProtectedEditor-C4beOxz1.css +0 -1
  275. package/client/assets/ProtectedEditor-C4beOxz1.css.br +0 -0
  276. package/client/assets/ProtectedEditor-C4beOxz1.css.gz +0 -0
  277. package/client/assets/ProtectedEditor-KcsoZKKo.js +0 -3
  278. package/client/assets/ProtectedEditor-KcsoZKKo.js.br +0 -0
  279. package/client/assets/ProtectedEditor-KcsoZKKo.js.gz +0 -0
  280. package/client/assets/ProtectedEditor-KcsoZKKo.js.map +0 -1
  281. package/client/assets/RundownEntry-Dl4Cb_pZ.js +0 -2
  282. package/client/assets/RundownEntry-Dl4Cb_pZ.js.br +0 -0
  283. package/client/assets/RundownEntry-Dl4Cb_pZ.js.gz +0 -0
  284. package/client/assets/RundownExport-BPDLhvsM.js +0 -3
  285. package/client/assets/RundownExport-BPDLhvsM.js.br +0 -0
  286. package/client/assets/RundownExport-BPDLhvsM.js.gz +0 -0
  287. package/client/assets/Select-CUjlJirY.js.br +0 -0
  288. package/client/assets/Select-CUjlJirY.js.gz +0 -0
  289. package/client/assets/Studio-BLCIas53.js +0 -2
  290. package/client/assets/Studio-BLCIas53.js.br +0 -0
  291. package/client/assets/Studio-BLCIas53.js.gz +0 -0
  292. package/client/assets/StyleEditor-DTNiR-0P.js.br +0 -0
  293. package/client/assets/StyleEditor-DTNiR-0P.js.gz +0 -0
  294. package/client/assets/TimeElements-rlwX9Mgy.js +0 -2
  295. package/client/assets/TimeElements-rlwX9Mgy.js.br +0 -0
  296. package/client/assets/TimeElements-rlwX9Mgy.js.gz +0 -0
  297. package/client/assets/TimeInput-C0_Nl63x.js.br +0 -0
  298. package/client/assets/TimeInput-C0_Nl63x.js.gz +0 -0
  299. package/client/assets/TimelinePage-BC-pnISF.js +0 -2
  300. package/client/assets/TimelinePage-BC-pnISF.js.br +0 -0
  301. package/client/assets/TimelinePage-BC-pnISF.js.gz +0 -0
  302. package/client/assets/Timer-DgmA0De-.js +0 -2
  303. package/client/assets/Timer-DgmA0De-.js.br +0 -0
  304. package/client/assets/Timer-DgmA0De-.js.gz +0 -0
  305. package/client/assets/Timer-DgmA0De-.js.map +0 -1
  306. package/client/assets/TimerControlExport-C_Jbwxog.js.br +0 -0
  307. package/client/assets/TimerControlExport-C_Jbwxog.js.gz +0 -0
  308. package/client/assets/TitleCard-C-Tw72nZ.js.br +0 -0
  309. package/client/assets/TitleCard-C-Tw72nZ.js.gz +0 -0
  310. package/client/assets/Tooltip-BZrLdTBU.js.br +0 -0
  311. package/client/assets/Tooltip-BZrLdTBU.js.gz +0 -0
  312. package/client/assets/ViewLogo-CdsW41HC.js.br +0 -0
  313. package/client/assets/ViewLogo-CdsW41HC.js.gz +0 -0
  314. package/client/assets/ViewParamsEditor-YoYxps2g.js.br +0 -0
  315. package/client/assets/ViewParamsEditor-YoYxps2g.js.gz +0 -0
  316. package/client/assets/ViewParamsEditor-kNKEOAwm.css.br +0 -0
  317. package/client/assets/ViewParamsEditor-kNKEOAwm.css.gz +0 -0
  318. package/client/assets/common.options-p5f_zJ2-.js.br +0 -0
  319. package/client/assets/common.options-p5f_zJ2-.js.gz +0 -0
  320. package/client/assets/common.options-p5f_zJ2-.js.map +0 -1
  321. package/client/assets/dateConfig-CqC6Ta_8.js.br +0 -0
  322. package/client/assets/dateConfig-CqC6Ta_8.js.gz +0 -0
  323. package/client/assets/editorSettings-CL1TjKzU.js.br +0 -0
  324. package/client/assets/editorSettings-CL1TjKzU.js.gz +0 -0
  325. package/client/assets/getProgress-Dh-Yy44B.js.br +0 -0
  326. package/client/assets/getProgress-Dh-Yy44B.js.gz +0 -0
  327. package/client/assets/index-DdPXqLQ6.js +0 -3
  328. package/client/assets/index-DdPXqLQ6.js.br +0 -0
  329. package/client/assets/index-DdPXqLQ6.js.gz +0 -0
  330. package/client/assets/index-DdPXqLQ6.js.map +0 -1
  331. package/client/assets/index-pvMSlFrO.css.br +0 -0
  332. package/client/assets/index-pvMSlFrO.css.gz +0 -0
  333. package/client/assets/offset-BnfjZ6JI.js.br +0 -2
  334. package/client/assets/offset-BnfjZ6JI.js.gz +0 -0
  335. package/client/assets/parseUserTime-DNXIMX9s.js.br +0 -0
  336. package/client/assets/parseUserTime-DNXIMX9s.js.gz +0 -0
  337. package/client/assets/playbackstate-DzSEaiNW.js.br +0 -0
  338. package/client/assets/playbackstate-DzSEaiNW.js.gz +0 -0
  339. package/client/assets/presentation.utils-BfcniGcl.js.br +0 -0
  340. package/client/assets/presentation.utils-BfcniGcl.js.gz +0 -0
  341. package/client/assets/rundownUtils-CPBsEZ2m.js.br +0 -0
  342. package/client/assets/rundownUtils-CPBsEZ2m.js.gz +0 -0
  343. package/client/assets/useCustomFields-DY13Ir96.js.br +0 -0
  344. package/client/assets/useCustomFields-DY13Ir96.js.gz +0 -0
  345. package/client/assets/useFollowComponent-C42-1XCu.js.br +0 -0
  346. package/client/assets/useFollowComponent-C42-1XCu.js.gz +0 -0
  347. package/client/assets/useProjectData-BF2F6qPB.js.br +0 -0
  348. package/client/assets/useProjectData-BF2F6qPB.js.gz +0 -0
  349. package/client/assets/useReport-DPqY9XXp.js +0 -2
  350. package/client/assets/useReport-DPqY9XXp.js.br +0 -0
  351. package/client/assets/useReport-DPqY9XXp.js.gz +0 -0
  352. package/client/assets/useRundown-uuXixjnX.js.br +0 -0
  353. package/client/assets/useRundown-uuXixjnX.js.gz +0 -0
  354. package/client/assets/useWindowTitle-BQ1kqXfk.js.br +0 -0
  355. package/client/assets/useWindowTitle-BQ1kqXfk.js.gz +0 -0
  356. package/client/assets/validateEvent-Cy-jEiwB.js.br +0 -0
  357. package/client/assets/validateEvent-Cy-jEiwB.js.gz +0 -0
  358. package/client/assets/vendor-Cnciq4o_.js.br +0 -0
  359. package/client/assets/vendor-Cnciq4o_.js.gz +0 -0
  360. package/client/assets/viewLoader.utils-CYlNKkLE.js +0 -2
  361. package/client/assets/viewLoader.utils-CYlNKkLE.js.br +0 -0
  362. package/client/assets/viewLoader.utils-CYlNKkLE.js.gz +0 -0
  363. package/client/assets/viewLoader.utils-CYlNKkLE.js.map +0 -1
  364. /package/client/assets/{viewLoader-Bk5IU6zG.css → SuperscriptTime-Bk5IU6zG.css} +0 -0
  365. /package/client/assets/{viewLoader-Bk5IU6zG.css.br → SuperscriptTime-Bk5IU6zG.css.br} +0 -0
  366. /package/client/assets/{viewLoader-Bk5IU6zG.css.gz → SuperscriptTime-Bk5IU6zG.css.gz} +0 -0
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CustomTranslationModal-CcNNjbmZ.js","./vendor-Cnciq4o_.js","./vendor-4xP-6xVS.css","./index-DdPXqLQ6.js","./index-pvMSlFrO.css","./useWindowTitle-BQ1kqXfk.js","./useWindowTitle-DrFGLRMI.css","./DropdownMenu-Bn0VHzKx.js","./useProjectData-BF2F6qPB.js","./useProjectData-Cw1aXCwD.css","./DropdownMenu-ByBDeesm.css","./StyleEditor-DTNiR-0P.js","./StyleEditor-Bie84LSc.css","./RundownExport-BPDLhvsM.js","./EditorUtils-DxjFOwpn.js","./EditorUtils-BXko-IuN.css","./ProtectRoute-DnUCrlh6.js","./ProtectRoute-Bm5sjStK.css","./useRundown-uuXixjnX.js","./MilestoneEditor-Da8oxrHI.js","./TimeInput-C0_Nl63x.js","./parseUserTime-DNXIMX9s.js","./TimeInput-BrVdiuOQ.css","./dateConfig-CqC6Ta_8.js","./validateEvent-Cy-jEiwB.js","./editorSettings-CL1TjKzU.js","./editorSettings-BqHbWs9b.css","./rundownUtils-CPBsEZ2m.js","./useCustomFields-DY13Ir96.js","./Select-CUjlJirY.js","./Select-Cd08aEcf.css","./Tooltip-BZrLdTBU.js","./Tooltip-CKb7gU2M.css","./offset-BnfjZ6JI.js","./MilestoneEditor-906SVj5M.css","./Empty-DiBXyIA8.js","./Empty-DvR62o5B.css","./useFollowComponent-C42-1XCu.js","./RundownExport-CUtaG16H.css","./TimerControlExport-C_Jbwxog.js","./useReport-DPqY9XXp.js","./Editor.module-DvV2efYs.js","./Editor-B_NlyOLw.css","./TimerControlExport-D8kqHQB0.css","./MessageControlExport-VUkIayAJ.js","./MessageControlExport-DPgqVb-4.css"])))=>i.map(i=>d[i]);
2
- import{h as j,j as e,ac as Jt,e as Q,k as St,ad as ce,ae as Ds,af as Ns,ag as Xe,ah as he,T as me,aa as st,ai as Ps,x as Xt,aj as Rs,ak as Tt,f as Es,O as Ct,A as Os,al as Ts,am as As,an as Ze,ao as Fs,P as ot,C as Ce,ap as At,aq as Is,ar as Ls,as as $s,at as Vs,l as Zt,au as Ws,$ as Ge,t as _t,av as Ms,v as qs,M as Us,I as zs,m as Bs}from"./vendor-Cnciq4o_.js";import{P as Ks}from"./ProtectRoute-DnUCrlh6.js";import{i as ge,N as kt,Q as Gs,R as Hs,S as et,r as Qs,U as Ys,V as _e,W as Je,X as N,Y as Ie,Z as Re,_ as R,$ as ee,a0 as H,a1 as gt,a2 as Js,a3 as Xs,a4 as Dt,a5 as Zs,a6 as es,a7 as O,B as g,a8 as ie,a9 as we,aa as Ae,ab as fe,ac as oe,ad as M,ae as q,af as $,ag as V,ah as $e,ai as Z,aj as ve,ak as nt,al as en,am as tn,an as Nt,g as Ne,ao as ts,ap as ss,aq as ns,ar as re,O as Se,as as sn,at as Ft,au as rs,av as as,aw as Pt,ax as nn,ay as rn,az as is,aA as ct,y as qe,aB as an,aC as ln,aD as Oe,aE as ls,aF as ft,T as He,aG as on,aH as os,aI as It,aJ as cn,aK as dn,aL as un,aM as Le,aN as hn,aO as mn,d as xn,aP as jn,K as pn,aQ as gn,aR as fn,aS as vn,c as yn,aT as bn,aU as wn,aV as Lt,aW as Sn,aX as $t,aY as Cn,aZ as _n}from"./index-DdPXqLQ6.js";import{I as je,C as kn,u as Dn}from"./useWindowTitle-BQ1kqXfk.js";import{e as Nn,u as rt,T as B,t as dt,a as Pn,b as Rn,d as En,c as On,f as Tn,g as An,S as Fn,h as In,M as at,D as Ln}from"./DropdownMenu-Bn0VHzKx.js";import{S as be,u as $n,a as Vn,b as Wn,c as ut}from"./useProjectData-BF2F6qPB.js";import{i as cs,R as ds,s as Mn,G as qn,a as Un,O as zn,T as Bn}from"./OverviewWrapper-BMuW_wiO.js";import{e as Kn,f as Gn,g as Hn,i as us,h as hs,j as Qn,k as Yn,l as Jn,m as Xn,n as Zn,o as er,p as tr}from"./useRundown-uuXixjnX.js";import{S as ne}from"./Select-CUjlJirY.js";import{u as it,p as sr,e as nr,d as rr}from"./useCustomFields-DY13Ir96.js";import{u as ar,d as ir}from"./useReport-DPqY9XXp.js";import{T as vt,u as ms,e as ze}from"./editorSettings-CL1TjKzU.js";import{S as lr,L as or,T as cr}from"./EditorUtils-DxjFOwpn.js";import{T as xs}from"./Tooltip-BZrLdTBU.js";import{A as js,T as Be}from"./TimeInput-C0_Nl63x.js";import{T as Vt,E as ht}from"./validateEvent-Cy-jEiwB.js";import{p as Ke}from"./parseUserTime-DNXIMX9s.js";import{S as dr,P as ur,O as hr,M as mr,C as xr}from"./TimeElements-rlwX9Mgy.js";import{s as mt}from"./Editor.module-DvV2efYs.js";import"./offset-BnfjZ6JI.js";import"./playbackstate-DzSEaiNW.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof wt<"u"?wt:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="740f094e-ffa9-4142-8274-5c1acfe6a01e",t._sentryDebugIdIdentifier="sentry-dbid-740f094e-ffa9-4142-8274-5c1acfe6a01e")}catch{}})();function jr(t){return t.trim().replaceAll(" ","_")}const pr={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:{},entryId:"id"},gr=(t,s,n={})=>{const{isDisabled:r=!1}=n,a=j.useCallback(l=>{l.key===s&&!l.repeat&&!r&&(l.preventDefault(),t())},[t,r,s]);j.useEffect(()=>(document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}),[a])},fr="_link_70oau_17",vr="_inline_70oau_27",Wt={link:fr,inline:vr};function se({href:t,inline:s,children:n}){const r=a=>{a.preventDefault(),kt(t)};return e.jsxs("a",{href:"#!",target:"_blank",rel:"noreferrer",className:ge([Wt.link,s&&Wt.inline]),onClick:r,children:[n," ",e.jsx(Jt,{style:{fontSize:"1em"}})]})}async function yr(){const t=await Q.get(Gs);return{url:t.data.html_url,version:t.data.tag_name}}const Mt={url:"",version:"",hasUpdates:!1};function ps(){const{data:t,status:s,isFetching:n,isError:r,refetch:a}=St({queryKey:Ys,queryFn:yr,placeholderData:(i,h)=>i,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:!1,staleTime:Qs,enabled:et}),l=(t==null?void 0:t.version)&&!t.version.includes(Hs);return{data:t?{...t,hasUpdates:l}:Mt,placeholder:Mt,status:s,isFetching:n,isError:r,refetch:a}}function br(){const{data:t,isError:s}=ps();return s?e.jsxs(_e,{children:[`You are currently using Ontime version ${Je}`,e.jsx(N,{children:`Could not fetch version information: ${s}`})]}):t.hasUpdates?e.jsxs(_e,{children:[`You are currently using Ontime version ${Je}.`,e.jsx("br",{}),e.jsx("br",{}),`A new version ${t.version} is available.`," ",e.jsx("br",{}),Ie?"You can restart your stage to get the latest available version.":e.jsx(se,{href:t.url,children:"Please visit the release page to download"})]}):e.jsx(_e,{children:`You are currently using the latest version of Ontime: ${Je}`})}function wr(){return e.jsxs(e.Fragment,{children:[e.jsx(Re,{children:"About Ontime"}),e.jsxs(R,{children:[e.jsxs(ee,{children:[e.jsx(H,{children:"Ontime"}),e.jsxs(_e,{children:["Free, open-source software for managing rundowns and event timers",e.jsx(se,{href:gt,children:"www.getontime.no"})]}),e.jsxs(_e,{children:["Considering sponsoring our work",e.jsx(se,{href:Js,children:"GitHub Sponsors"}),e.jsx(se,{href:Xs,children:"Buy Me a Coffee"})]}),e.jsxs(_e,{children:["If you are looking for an online version of Ontime, consider trying out our cloud service",e.jsx(se,{href:gt,children:"www.getontime.no"})]})]}),e.jsx(H,{children:"Current version"}),e.jsx(br,{}),e.jsx(H,{children:"Links"}),e.jsx(se,{href:Dt,children:"Read the docs"}),e.jsx(se,{href:Zs,children:"Follow the project on GitHub"}),e.jsx(se,{href:es,children:"Discord server"})]})]})}function ae(t,s){const n=j.useRef(null);return j.useEffect(()=>{s&&n.current&&s===t&&n.current.scrollIntoView({behavior:"smooth",block:"center"})},[s,t]),n}const Sr="https://docs.getontime.no/api/protocols/osc/";function Cr({enabledAutomations:t,enabledOscIn:s,oscPortIn:n}){var b,y,v;const{handleSubmit:r,reset:a,register:l,setError:c,watch:i,setValue:h,formState:{errors:o,isSubmitting:d,isDirty:m,isValid:u}}=ce({mode:"onChange",defaultValues:{enabledAutomations:t,enabledOscIn:s,oscPortIn:n},resetOptions:{keepDirtyValues:!1}}),f=async w=>{try{await Nn(w),a(w)}catch(I){const S=V(I);c("root",{message:S})}},x=()=>{a({enabledAutomations:t,enabledOscIn:s,oscPortIn:n})},p=!d&&m&&u;return e.jsxs(ee,{children:[e.jsxs(H,{children:["Automation settings",e.jsxs(O,{children:[e.jsx(g,{variant:"ghosted",onClick:x,disabled:!p,children:"Revert to saved"}),e.jsx(g,{variant:"primary",type:"submit",form:"automation-settings-form",disabled:!p,loading:d,children:"Save"})]})]}),(o==null?void 0:o.root)&&e.jsx(N,{children:o.root.message}),e.jsx(ie,{}),e.jsx(R,{children:e.jsxs(je,{children:[e.jsx("p",{children:"Control Ontime and share its data with external systems in your workflow."}),e.jsx("p",{children:"- Automations allow Ontime to send its data on lifecycle triggers."}),e.jsx("p",{children:"- OSC Input tells Ontime to listen to messages on the specific port."}),e.jsx("br",{}),e.jsx(se,{href:Sr,children:"See the docs"})]})}),e.jsxs(R,{as:"form",id:"automation-settings-form",onSubmit:r(f),onKeyDown:w=>we(w,x),children:[e.jsx(Ae,{isLoading:!1}),e.jsx(fe,{children:"Automation"}),e.jsx(oe,{children:e.jsxs(M,{children:[e.jsx(q,{title:"Enable automations",description:"Allow Ontime to send messages on lifecycle triggers",error:(b=o.enabledAutomations)==null?void 0:b.message}),e.jsx(be,{size:"large",checked:i("enabledAutomations"),onCheckedChange:w=>h("enabledAutomations",w,{shouldDirty:!0,shouldValidate:!0})})]})}),e.jsx(fe,{children:"OSC Input"}),e.jsxs(oe,{children:[Ie&&e.jsx(je,{children:"For security reasons OSC integrations are not available in the cloud service."}),e.jsxs(M,{children:[e.jsx(q,{title:"OSC input",description:"Allow control of Ontime through OSC",error:(y=o.enabledOscIn)==null?void 0:y.message}),e.jsx(be,{size:"large",checked:i("enabledOscIn"),onCheckedChange:w=>h("enabledOscIn",w,{shouldDirty:!0,shouldValidate:!0})})]}),e.jsxs(M,{children:[e.jsx(q,{title:"Listen on port",description:"Port for incoming OSC. Default: 8888",error:(v=o.oscPortIn)==null?void 0:v.message}),e.jsx($,{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:cs,message:"Value should be numeric"}})})]})]})]})]})}const _r=["{{human.clock}}","{{human.duration}}","{{human.expectedEnd}}","{{human.runningTimer}}","{{human.elapsedTime}}","{{human.startedAt}}"],kr=["{{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}}"],Dr=["{{eventNow.id}}","{{eventNow.cue}}","{{eventNow.title}}","{{eventNow.note}}","{{eventNow.timeStart}}","{{eventNow.timeEnd}}","{{eventNow.duration}}","{{eventNow.colour}}","{{eventNow.delay}}"],Nr=["{{eventNext.id}}","{{eventNext.cue}}","{{eventNext.title}}","{{eventNext.note}}","{{eventNext.timeStart}}","{{eventNext.timeEnd}}","{{eventNext.duration}}","{{eventNext.colour}}","{{eventNext.delay}}"];function Pr(t){return[..._r,...kr,...Dr,...Object.entries(t).map(([s])=>`{{eventNow.custom.${s}}}`),...Nr,...Object.entries(t).map(([s])=>`{{eventNext.custom.${s}}}`)]}function Rr(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 Er(t){const s=t.lastIndexOf("{{");return s!==-1?t.slice(s):""}const Or="_wrapper_11839_17",Tr="_suggestions_11839_21",qt={wrapper:Or,suggestions:Tr},Ar=j.forwardRef(function(s,n){const{value:r,onChange:a,...l}=s,{data:c}=it(),i=Ds(()=>x(!1)),h=j.useMemo(()=>Pr(c),[c]),[o,d]=j.useState(r||""),[m,u]=j.useState([]),[f,x]=j.useState(!1),p=v=>{const w=Er(v);return h.filter(I=>I.startsWith(w))},b=v=>{d(v.target.value),v.target.value.endsWith("{")?(x(!0),u(p(v.target.value))):v.target.value===""||v.target.value.endsWith("}}")?x(!1):f&&u(p(v.target.value)),a==null||a(v)},y=v=>{d(w=>{const I=Rr(w,v);return w+I}),x(!1)};return e.jsxs("div",{className:qt.wrapper,ref:Ns(i,n),children:[e.jsx($,{value:o,...l,onChange:b,fluid:!0}),f&&m.length>0&&e.jsx("ul",{className:qt.suggestions,children:m.map(v=>e.jsx("li",{onClick:()=>y(v),children:v},v))})]})}),yt=[{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 Ut(t){return Object.hasOwn(t,"id")}const Fr=[{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"}],Ir=[{value:"eventNext.id",label:"Next ID"},{value:"eventNext.title",label:"Next Title"},{value:"eventNext.cue",label:"Next Cue"}];function Lr(t){return[...Fr,...Object.entries(t).map(([s,{label:n}])=>({value:`eventNow.custom.${s}`,label:`Custom: ${n}`})),...Ir,...Object.entries(t).map(([s,{label:n}])=>({value:`eventNext.custom.${s}`,label:`Next custom: ${n}`}))]}function $r(t){const s={},n=[];for(let r=0;r<t.length;r++){const a=t[r];Object.hasOwn(s,a.trigger)||(s[a.trigger]=[]),s[a.trigger].includes(a.automationId)?n.push(r):s[a.trigger].push(a.automationId)}return n.length>0?n:void 0}const Vr="_outerColumn_dem8v_17",Wr="_innerColumn_dem8v_25",Mr="_ruleSection_dem8v_31",qr="_titleSection_dem8v_37",Ur="_filterSection_dem8v_38",zr="_oscSection_dem8v_39",Br="_httpSection_dem8v_40",Kr="_actionSection_dem8v_41",Gr="_test_dem8v_95",Hr="_outputCard_dem8v_99",le={outerColumn:Vr,innerColumn:Wr,ruleSection:Mr,titleSection:qr,filterSection:Ur,oscSection:zr,httpSection:Br,actionSection:Kr,test:Gr,outputCard:Hr};function Qr({index:t,register:s,setValue:n,rowErrors:r,value:a,children:l,watch:c}){var d,m,u,f,x;const[i,h]=j.useState(a),o=p=>{n(`outputs.${t}.action`,p,{shouldDirty:!0}),h(p)};return e.jsxs("div",{className:le.actionSection,children:[e.jsxs("label",{children:["Action",e.jsx(ne,{onValueChange:p=>{o(p)},value:c(`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:(d=r==null?void 0:r.action)==null?void 0:d.message})]}),i.startsWith("aux")&&i.endsWith("set")&&e.jsxs("label",{children:["New time",e.jsx($,{...s(`outputs.${t}.time`,{required:{value:!0,message:"Required field"}}),fluid:!0,placeholder:"eg: 10m5s"}),e.jsx(N,{children:(m=r==null?void 0:r.time)==null?void 0:m.message})]}),i==="message-set"&&e.jsxs(e.Fragment,{children:[e.jsxs("label",{children:["Text (leave empty for no change)",e.jsx($,{...s(`outputs.${t}.text`),fluid:!0,placeholder:"eg: Timer is finished"}),e.jsx(N,{children:(u=r==null?void 0:r.text)==null?void 0:u.message})]}),e.jsxs("label",{children:["Visibility",e.jsx(ne,{onValueChange:p=>{const b=p==="untouched"?void 0:p;n(`outputs.${t}.visible`,b,{shouldDirty:!0})},value:c(`outputs.${t}.visible`)===void 0?"untouched":c(`outputs.${t}.visible`),options:[{value:"untouched",label:"Untouched"},{value:!0,label:"Show"},{value:!1,label:"Hide"}]}),e.jsx(N,{children:(f=r==null?void 0:r.visible)==null?void 0:f.message})]})]}),i==="message-secondary"&&e.jsxs("label",{children:["Timer secondary source",e.jsx(ne,{onValueChange:p=>{n(`outputs.${t}.secondarySource`,p,{shouldDirty:!0})},value:c(`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:"external",label:"External"},{value:"null",label:"None"}]}),e.jsx(N,{children:(x=r==null?void 0:r.secondarySource)==null?void 0:x.message})]}),e.jsx("div",{className:le.test,children:l})]})}const Yr="https://docs.getontime.no/api/automation/#using-variables-in-automation";function Jr({automation:t,onClose:s}){var K;const n=Ut(t),{data:r}=it(),{refetch:a}=rt(),l=j.useMemo(()=>Lr(r),[r]),{control:c,handleSubmit:i,getValues:h,register:o,setError:d,setFocus:m,setValue:u,watch:f,formState:{errors:x,isSubmitting:p,isDirty:b,isValid:y}}=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:w,remove:I}=Xe({name:"filters",control:c}),{fields:S,append:E,remove:T}=Xe({name:"outputs",control:c});j.useEffect(()=>{m("title")},[m]);const C=()=>{w({field:"",operator:"equals",value:""})},U=()=>{E({type:"osc",targetIP:"",targetPort:void 0,address:"",args:""})},z=()=>{E({type:"http",url:""})},de=()=>{E({type:"ontime",action:"aux1-start"})},Y=async F=>{try{const _=h(`outputs.${F}`);if(!_.targetIP||!_.targetPort||!_.address)return;await dt({type:"osc",targetIP:_.targetIP,targetPort:_.targetPort,address:_.address,args:_.args})}catch{}},L=async F=>{try{const _=h(`outputs.${F}`);if(!_.url)return;await dt({type:"http",url:_.url})}catch{}},P=async F=>{try{const _=h(`outputs.${F}`);await dt({..._,type:"ontime"})}catch{}},A=async F=>{Ut(t)?await _(t.id,{id:t.id,...F}):await k(F),a();async function _(W,te){try{await Pn(W,te),s()}catch(ue){d("root",{message:V(ue)})}}async function k(W){try{await Rn(W),s()}catch(te){d("root",{message:V(te)})}}},D=!p&&b&&y;return e.jsxs($e,{as:"form",name:"automation-form",onSubmit:i(A),className:le.outerColumn,onKeyDown:F=>we(F,s),children:[e.jsx(H,{children:n?"Edit automation":"Create automation"}),e.jsxs("div",{className:le.innerSection,children:[e.jsx("h3",{children:"Automation options"}),e.jsxs("div",{className:le.titleSection,children:[e.jsxs("label",{children:["Title",e.jsx($,{...o("title",{required:{value:!0,message:"Required field"}}),fluid:!0,placeholder:"Load preset"})]}),e.jsx(N,{children:(K=x.title)==null?void 0:K.message})]})]}),e.jsxs("div",{className:le.innerSection,children:[e.jsx("h3",{children:"Filters (optional)"}),e.jsxs("div",{className:le.ruleSection,children:[e.jsxs("label",{children:["Trigger outputs if",e.jsx(ds,{orientation:"horizontal",value:f("filterRule"),onValueChange:F=>u("filterRule",F,{shouldDirty:!0}),items:[{value:"all",label:"All filters pass"},{value:"any",label:"Any filter passes"}]})]}),v.map((F,_)=>{var W,te,ue,Ee,We,Me;const k=`filters.${_}.field.${F.id}`;return e.jsxs("div",{className:le.filterSection,children:[e.jsxs("label",{children:["Runtime data source",e.jsx(ne,{value:f(`filters.${_}.field`),onValueChange:ke=>u(`filters.${_}.field`,ke,{shouldDirty:!0}),options:l.map(({value:ke,label:J})=>({value:ke,label:J})),"aria-label":"Event field"}),e.jsx(N,{children:(ue=(te=(W=x.filters)==null?void 0:W[_])==null?void 0:te.field)==null?void 0:ue.message})]}),e.jsxs("label",{children:["Matching condition",e.jsx(ne,{value:f(`filters.${_}.operator`),onValueChange:ke=>u(`filters.${_}.operator`,ke,{shouldDirty:!0}),options:[{value:"equals",label:"equals"},{value:"not_equals",label:"not equals"},{value:"contains",label:"contains"}],"aria-label":"Operator"}),e.jsx(N,{children:(Me=(We=(Ee=x.filters)==null?void 0:Ee[_])==null?void 0:We.operator)==null?void 0:Me.message})]}),e.jsxs("label",{children:["Value to match",e.jsx($,{...o(`filters.${_}.value`),fluid:!0,placeholder:"<empty / no value>"})]}),e.jsxs("div",{children:[e.jsx("span",{children:" "}),e.jsx("div",{children:e.jsx(Z,{"aria-label":"Delete",variant:"ghosted-destructive",onClick:()=>I(_),children:e.jsx(he,{})})})]})]},k)}),e.jsx("div",{children:e.jsxs(g,{type:"submit",onClick:C,children:["Add filter ",e.jsx(me,{})]})})]})]}),e.jsxs("div",{className:le.innerColumn,children:[e.jsx("h3",{children:"Outputs"}),e.jsxs(je,{children:["Automation outputs can be used to send data from Ontime to external software.",e.jsx(se,{href:Yr,children:"See the documentation for templates"})]}),S.map((F,_)=>{var k,W,te,ue,Ee,We,Me,ke;if(Kn(F)){const J=(k=x.outputs)==null?void 0:k[_];return e.jsxs("div",{className:le.outputCard,children:[e.jsx(B,{children:"OSC"}),e.jsxs("div",{className:le.oscSection,children:[e.jsxs("label",{children:["Target IP",e.jsx($,{...o(`outputs.${_}.targetIP`,{required:{value:!0,message:"Required field"}}),fluid:!0,placeholder:"127.0.0.1"}),e.jsx(N,{children:(W=J==null?void 0:J.targetIP)==null?void 0:W.message})]}),e.jsxs("label",{children:["Target Port",e.jsx($,{...o(`outputs.${_}.targetPort`,{required:{value:!0,message:"Required field"},setValueAs:Ot=>Ot===""?0:Number(Ot),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:(te=J==null?void 0:J.targetPort)==null?void 0:te.message})]}),e.jsxs("label",{children:["Address",e.jsx($,{...o(`outputs.${_}.address`),fluid:!0,placeholder:"/cue/start"}),e.jsx(N,{children:(ue=J==null?void 0:J.address)==null?void 0:ue.message})]}),e.jsxs("label",{children:["Arguments",e.jsx(Ar,{...o(`outputs.${_}.args`),value:F.args,placeholder:"1"}),e.jsx(N,{children:(Ee=J==null?void 0:J.args)==null?void 0:Ee.message})]}),e.jsxs("div",{children:[e.jsx("span",{children:" "}),e.jsxs(O,{relation:"inner",children:[e.jsx(g,{variant:"ghosted-white",onClick:()=>Y(_),children:"Test"}),e.jsx(Z,{"aria-label":"Delete",variant:"ghosted-destructive",onClick:()=>T(_),children:e.jsx(he,{})})]})]})]})]},F.id)}if(Gn(F)){const J=(We=x.outputs)==null?void 0:We[_];return e.jsxs("div",{className:le.outputCard,children:[e.jsx(B,{children:"HTTP"}),e.jsxs("div",{className:le.httpSection,children:[e.jsxs("label",{children:["Target URL",e.jsx($,{...o(`outputs.${_}.url`,{required:{value:!0,message:"Required field"},pattern:{value:Mn,message:"HTTP messages should target http:// or https://"}}),fluid:!0,placeholder:"http://127.0.0.1/start/1"}),e.jsx(N,{children:(Me=J==null?void 0:J.url)==null?void 0:Me.message})]}),e.jsxs("div",{children:[e.jsx("span",{children:" "}),e.jsxs(O,{relation:"inner",children:[e.jsx(g,{variant:"ghosted-white",onClick:()=>L(_),children:"Test"}),e.jsx(Z,{"aria-label":"Delete",variant:"ghosted-destructive",onClick:()=>T(_),children:e.jsx(he,{})})]})]})]})]},F.id)}if(Hn(F)){const J=(ke=x.outputs)==null?void 0:ke[_];return e.jsxs("div",{className:le.outputCard,children:[e.jsx(B,{children:"Ontime action"}),e.jsxs(Qr,{value:F.action,index:_,register:o,rowErrors:J,setValue:u,watch:f,children:[e.jsx("span",{children:" "}),e.jsxs(O,{relation:"inner",children:[e.jsx(g,{variant:"ghosted-white",onClick:()=>P(_),children:"Test"}),e.jsx(Z,{"aria-label":"Delete",variant:"ghosted-destructive",onClick:()=>T(_),children:e.jsx(he,{})})]})]})]},F.id)}return null}),e.jsxs(O,{relation:"inner",children:[e.jsxs(g,{onClick:U,children:["OSC ",e.jsx(me,{})]}),e.jsxs(g,{onClick:z,children:["HTTP ",e.jsx(me,{})]}),e.jsxs(g,{onClick:de,children:["Ontime action ",e.jsx(me,{})]})]})]}),e.jsxs(O,{align:"end",children:[(x==null?void 0:x.root)&&e.jsx(N,{children:x.root.message}),e.jsx(g,{onClick:s,children:"Cancel"}),e.jsx(g,{variant:"primary",type:"submit",disabled:!D,loading:p,children:"Save"})]})]})}const zt={title:"",filterRule:"all",filters:[],outputs:[]};function Xr(t){const{automations:s}=t,{refetch:n}=rt(),[r,a]=j.useState(null),[l,c]=j.useState(null),i=async o=>{try{c(null),await En(o)}catch(d){c(V(d))}finally{n()}},h=Object.keys(s);return e.jsxs(ee,{children:[e.jsxs(H,{children:["Manage automations",e.jsxs(g,{type:"submit",disabled:!!r,onClick:()=>a(zt),children:["New ",e.jsx(me,{})]})]}),e.jsx(ie,{}),r!==null&&e.jsx(Jr,{automation:r,onClose:()=>a(null)}),e.jsxs(ve,{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:[h.length===0&&e.jsx(nt,{handleClick:r?void 0:()=>a(zt)}),h.map(o=>Object.hasOwn(s,o)?e.jsx(j.Fragment,{children:e.jsxs("tr",{children:[e.jsx("td",{children:s[o].title}),e.jsx("td",{children:e.jsx(B,{children:s[o].filterRule})}),e.jsx("td",{children:s[o].filters.length}),e.jsx("td",{children:s[o].outputs.length}),e.jsxs(O,{align:"end",relation:"inner",as:"td",children:[e.jsx(Z,{variant:"ghosted-white","aria-label":"Edit entry",onClick:()=>a(s[o]),children:e.jsx(st,{})}),e.jsx(Z,{variant:"ghosted-destructive","aria-label":"Delete entry",onClick:()=>i(o),children:e.jsx(he,{})})]})]})},o):null),l&&e.jsx("tr",{children:e.jsx("td",{colSpan:5,children:e.jsx(N,{children:l})})})]})]})]})}function gs({automations:t,initialId:s,initialTitle:n,initialAutomationId:r,initialTrigger:a,onCancel:l,postSubmit:c}){var I,S,E,T;const{handleSubmit:i,register:h,setFocus:o,setError:d,watch:m,setValue:u,formState:{errors:f,isSubmitting:x,isValid:p,isDirty:b}}=ce({defaultValues:{title:n,trigger:a??yt[0].value,automationId:r??((I=t==null?void 0:t[Object.keys(t)[0]])==null?void 0:I.id)},resetOptions:{keepDirtyValues:!0}});j.useEffect(()=>{o("title")},[o]);const y=async C=>{if(s){try{await On(s,{id:s,...C}),c()}catch(U){d("root",{message:`Failed to save changes to trigger ${V(U)}`})}return}try{await Tn(C),c()}catch(U){d("root",{message:`Failed to save trigger ${V(U)}`})}},v=Object.keys(t).map(C=>({value:C,label:t[C].title})),w=b&&p;return e.jsxs($e,{as:"form",name:"trigger-form",onSubmit:i(y),onKeyDown:C=>we(C,l),children:[e.jsx(H,{children:s?"Edit trigger":"Create trigger"}),e.jsxs("label",{children:["Title",e.jsx($,{...h("title",{required:{value:!0,message:"Required field"}}),fluid:!0,defaultValue:n}),e.jsx(N,{children:(S=f.title)==null?void 0:S.message})]}),e.jsxs("label",{children:["Lifecycle trigger",e.jsx(ne,{value:m("trigger"),onValueChange:C=>u("trigger",C,{shouldDirty:!0}),options:yt.map(C=>({value:C.value,label:C.label})),"aria-label":"Lifecycle trigger"}),e.jsx(N,{children:(E=f.trigger)==null?void 0:E.message})]}),e.jsxs("label",{children:["Automation title",e.jsx(ne,{value:m("automationId"),onValueChange:C=>u("automationId",C,{shouldDirty:!0}),options:v,"aria-label":"Automation title"}),e.jsx(N,{children:(T=f.automationId)==null?void 0:T.message})]}),e.jsxs(O,{align:"end",children:[e.jsx(g,{disabled:x,onClick:l,children:"Cancel"}),e.jsx(g,{type:"submit",variant:"primary",disabled:!w,loading:x,children:"Save"})]})]})}function Zr(t){var m,u;const{automations:s,id:n,title:r,trigger:a,automationId:l,duplicate:c,handleDelete:i,postSubmit:h}=t,[o,d]=j.useState(!1);return o?e.jsx("tr",{children:e.jsx("td",{colSpan:99,children:e.jsx(gs,{automations:s,initialId:n,initialTitle:r,initialTrigger:a,initialAutomationId:l,onCancel:()=>d(!1),postSubmit:()=>{d(!1),h()}})})}):e.jsxs("tr",{"data-warn":c,children:[e.jsxs(O,{as:"td",relation:"inner",children:[c&&e.jsx(Ps,{color:"#FFBC56"}),r]}),e.jsx("td",{children:e.jsx(B,{children:(m=yt.find(f=>f.value===a))==null?void 0:m.label})}),e.jsx("td",{children:e.jsx(B,{children:(u=s==null?void 0:s[l])==null?void 0:u.title})}),e.jsxs(O,{align:"end",relation:"inner",as:"td",children:[e.jsx(Z,{variant:"ghosted-white","aria-label":"Edit entry",onClick:()=>d(!0),children:e.jsx(st,{})}),e.jsx(Z,{variant:"ghosted-destructive","aria-label":"Delete entry",onClick:i,children:e.jsx(he,{})})]})]})}function ea(t){const{triggers:s,automations:n}=t,[r,a]=j.useState(!1),{refetch:l}=rt(),[c,i]=j.useState(null),h=async u=>{try{await An(u)}catch(f){i(V(f))}finally{l()}},o=()=>{a(!1),l()},d=j.useMemo(()=>$r(s),[s]),m=Object.keys(n).length>0;return e.jsxs(ee,{children:[e.jsxs(H,{children:["Manage triggers",e.jsxs(g,{type:"submit",form:"trigger-form",disabled:!m,loading:!1,onClick:()=>a(!0),children:["New ",e.jsx(me,{})]})]}),e.jsx(ie,{}),e.jsxs(R,{children:[d&&e.jsx(N,{children:"You have created multiple links between the same trigger and automation which can performance issues."}),r&&e.jsx(gs,{automations:n,onCancel:()=>a(!1),postSubmit:o}),e.jsxs(ve,{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(nt,{label:"Create an automation to attach triggers to",handleClick:m?()=>a(!0):void 0}),s.map((u,f)=>e.jsxs(j.Fragment,{children:[e.jsx(Zr,{automations:n,id:u.id,title:u.title,trigger:u.trigger,automationId:u.automationId,duplicate:d==null?void 0:d.includes(f),handleDelete:()=>h(u.id),postSubmit:o}),c&&e.jsx("tr",{children:e.jsx("td",{colSpan:5,children:e.jsx(N,{children:c})})})]},u.id))]})]})]})]})}function ta({location:t}){const{data:s,status:n}=rt(),r=ae("settings",t),a=ae("triggers",t),l=ae("automations",t),c=n==="pending";return e.jsxs(e.Fragment,{children:[e.jsx(Re,{children:"Automation"}),e.jsxs(R,{children:[e.jsx(Ae,{isLoading:c}),e.jsx("div",{ref:r,children:e.jsx(Cr,{enabledAutomations:s.enabledAutomations,enabledOscIn:s.enabledOscIn,oscPortIn:s.oscPortIn})}),e.jsx("div",{ref:l,children:e.jsx(Xr,{automations:s.automations})}),e.jsx("div",{ref:a,children:e.jsx(ea,{triggers:s.triggers,automations:s.automations})})]})]})}const sa="_goIcon_1fzu7_17",na={goIcon:sa};function ra(){const{data:t}=en(),s=n=>kt(n);return e.jsx(O,{children:t.networkInterfaces.map(n=>{if(n.name==="localhost"&&!et)return null;const r=tn(n.address);return e.jsxs(Nt,{copyValue:r,onClick:()=>s(r),children:[`${n.name} - ${n.address}`," ",e.jsx(Xt,{className:na.goIcon})]},n.name)})})}function aa(t){return Rs(t)}function ia(t,s,n){if(Object.keys(t).length===0)return[];if(n.length===0)return[];const r=[];let a=1;for(let l=0;l<n.length;l++){const c=n[l],i=s[c];!i||!us(i)||(c in t||r.push({id:c,index:a,title:i.title,cue:i.cue,scheduledStart:i.timeStart,actualEnd:null,scheduledEnd:i.timeEnd,actualStart:null}),c in t&&r.push({id:c,index:a,title:i.title,cue:i.cue,scheduledStart:i.timeStart,actualEnd:t[c].endedAt,scheduledEnd:i.timeEnd,actualStart:t[c].startedAt}),a++)}return r}const la=["Index","Title","Cue","Scheduled Start","Actual Start","Scheduled End","Actual End"];function oa(t){const s=[];s.push(la);for(const n of t)s.push([String(n.index),n.title,n.cue,Ne(n.scheduledStart),Ne(n.actualStart),Ne(n.scheduledEnd),Ne(n.actualEnd)]);return aa(s)}const ca="_blink_15peo_1",da="_fourtyfive_15peo_13",ua="_over_15peo_17",ha="_under_15peo_21",Qe={blink:ca,fourtyfive:da,over:ua,under:ha};function ma(){const{data:t}=ar(),{data:s}=hs(),n=async()=>await ir(),r=l=>{if(!l)return;const c=oa(l),i=ts(c,"text/csv;charset=utf-8;");ss(i,"ontime-report.csv")},a=j.useMemo(()=>ia(t,s.entries,s.flatOrder),[t,s.entries,s.flatOrder]);return e.jsx(R,{children:e.jsxs(ee,{children:[e.jsx(H,{children:"Report"}),e.jsx(ie,{}),e.jsx(R,{children:e.jsxs(fe,{children:["Manage report",e.jsxs(O,{children:[e.jsxs(g,{onClick:()=>r(a),disabled:a.length===0,children:[e.jsx(Tt,{}),"Export CSV"]}),e.jsxs(g,{variant:"subtle-destructive",onClick:n,disabled:a.length===0,children:[e.jsx(Tt,{}),"Clear All"]})]})]})}),e.jsx(R,{children:e.jsxs(ve,{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:[a.length===0&&e.jsx(nt,{label:"Reports are generated when running through the show."}),a.map(l=>{const c=l.actualStart===null?null:l.actualStart<=l.scheduledStart?"under":"over",i=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:ge([c&&Qe[c]]),children:Ne(l.scheduledStart)}),e.jsx("th",{className:ge([c&&Qe[c]]),children:Ne(l.actualStart)}),e.jsx("th",{className:ge([i&&Qe[i]]),children:Ne(l.scheduledEnd)}),e.jsx("th",{className:ge([i&&Qe[i]]),children:Ne(l.actualEnd)})]},l.id)})]})]})})]})})}const xa="_expand_1sy0c_17",ja="_column_1sy0c_21",Bt={expand:xa,column:ja},pa=[{value:Se.Cuesheet,label:"Cuesheet"},{value:Se.Operator,label:"Operator"},{value:Se.Timer,label:"Timer"},{value:Se.Backstage,label:"Backstage"},{value:Se.Timeline,label:"Timeline"},{value:Se.StudioClock,label:"Studio Clock"},{value:Se.Countdown,label:"Countdown"},{value:Se.ProjectInfo,label:"Project Info"}],ga={alias:"",target:Se.Timer,search:"",enabled:!0};function fa({urlPreset:t,onClose:s}){var S,E;const{addPreset:n,updatePreset:r,isMutating:a}=ns(),{handleSubmit:l,register:c,setFocus:i,setError:h,clearErrors:o,setValue:d,getValues:m,watch:u,formState:{errors:f,isSubmitting:x,isValid:p,isDirty:b}}=ce({defaultValues:t??ga,resetOptions:{keepDirtyValues:!0}}),y=j.useRef(null),v=async T=>{try{t?await r(t.alias,T):await n(T),s()}catch(C){h("root",{message:V(C)})}};j.useEffect(()=>{i("alias")},[i]);const w=()=>{var T;o();try{const C=sn(m("alias"),((T=y.current)==null?void 0:T.value.trim())??"");d("target",C.target,{shouldDirty:!0,shouldValidate:!0}),d("search",C.search,{shouldDirty:!0,shouldValidate:!0})}catch(C){h("root",{message:Ft(C)});return}},I=T=>{try{return new URLSearchParams(T),!0}catch(C){return Ft(C)||"Invalid URL parameters"}};return e.jsxs($e,{as:"form",onSubmit:l(v),onKeyDown:T=>we(T,s),className:Bt.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(O,{children:[e.jsxs("div",{children:[e.jsx(re,{children:"Alias"}),e.jsx($,{...c("alias",{required:"Alias is required"})})]}),e.jsxs("div",{className:Bt.expand,children:[e.jsx(re,{children:"Generate options (paste URL to generate options)"}),e.jsxs(O,{children:[e.jsx($,{placeholder:"Paste URL",fluid:!0,ref:y}),e.jsx(g,{onClick:w,children:"Generate"})]})]})]}),e.jsx("div",{children:" - or -"}),e.jsx("div",{children:"2. Choose a view and its parameters"}),e.jsxs("div",{children:[e.jsx(re,{children:"Target"}),e.jsx(ne,{options:pa,...c("target",{required:"Target is required"}),value:u("target"),onValueChange:T=>d("target",T,{shouldDirty:!0})})]}),e.jsxs("div",{children:[e.jsx(re,{children:"Parameters"}),e.jsx(vt,{fluid:!0,rows:3,...c("search",{validate:I})}),e.jsx(N,{children:(S=f.search)==null?void 0:S.message})]}),e.jsxs("div",{children:[e.jsx(N,{children:(E=f.root)==null?void 0:E.message}),e.jsxs(O,{align:"end",children:[e.jsx(g,{onClick:s,children:"Cancel"}),e.jsx(g,{variant:"primary",type:"submit",disabled:!p||!b,loading:x||a,children:"Save"})]})]})]})}const va="https://docs.getontime.no/features/url-presets/";function ya(){const[t,s]=j.useState({isOpen:!1,preset:void 0}),{data:n,status:r}=rs(),{deletePreset:a,isMutating:l}=ns(),c=()=>s({isOpen:!0}),i=o=>s({isOpen:!0,preset:o}),h=()=>s({isOpen:!1,preset:void 0});return e.jsx(R,{children:e.jsxs(ee,{children:[e.jsxs(H,{children:["URL presets",e.jsxs(g,{onClick:c,children:["New ",e.jsx(me,{})]})]}),e.jsx(ie,{}),e.jsx(R,{children:e.jsxs(je,{children:["URL presets are user pre-defined aliases to Ontime URLs.",e.jsx("br",{}),"This URL can contain full configuration including parameters, or simply route to a specific view.",e.jsx("br",{}),e.jsx("br",{}),"The easiest way to get started is to copy an URL from your browser and paste it into the form.",e.jsx(se,{href:va,children:"See the docs"})]})}),e.jsxs(R,{children:[e.jsx(Ae,{isLoading:r==="pending"}),t.isOpen&&e.jsx(fa,{urlPreset:t.preset,onClose:h}),e.jsxs(ve,{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(nt,{handleClick:c}),n.map((o,d)=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx(be,{defaultChecked:o.enabled,onCheckedChange:()=>{}})}),e.jsx("td",{children:e.jsx(B,{children:o.target})}),e.jsx("td",{style:{width:"100%"},children:o.alias}),e.jsxs(O,{relation:"inner",as:"td",children:[e.jsx(Z,{variant:"ghosted-white",onClick:m=>as(o.alias,m),disabled:l,children:e.jsx(Jt,{})}),e.jsx(Z,{onClick:()=>i(o),variant:"ghosted-white","aria-label":"Edit entry","data-testid":`field__edit_${d}`,disabled:l,children:e.jsx(st,{})}),e.jsx(Z,{onClick:()=>a(o.alias),variant:"ghosted-destructive","aria-label":"Delete entry","data-testid":`field__delete_${d}`,disabled:l,children:e.jsx(he,{})})]})]},o.alias))]})]})]})]})})}function ba({location:t}){const s=ae("presets",t),n=ae("link",t),r=ae("report",t);return e.jsxs(e.Fragment,{children:[e.jsx(Re,{children:"Sharing and reporting"}),e.jsx("div",{ref:s,children:e.jsx(ya,{})}),e.jsx("div",{ref:n,children:e.jsx(R,{children:e.jsxs(ee,{children:[e.jsx(H,{children:"Share Ontime Link"}),!Ie&&e.jsxs(e.Fragment,{children:[e.jsx(_e,{children:"Ontime is streaming on the following network interfaces"}),e.jsx(ra,{})]}),e.jsx(ie,{}),e.jsx(qn,{})]})})}),e.jsx("div",{ref:r,children:e.jsx(ma,{})})]})}const Rt=`${Pt}/excel`;async function wa(t){const s=new FormData;s.append("excel",t),await Q.post(`${Rt}/upload`,s,{headers:{"Content-Type":"multipart/form-data"}})}async function Sa(){return(await Q.get(`${Rt}/worksheets`)).data}async function Ca(t){return(await Q.post(`${Rt}/preview`,{options:t})).data}const Ve=`${Pt}/sheets`,_a=async()=>(await Q.get(`${Ve}/connect`)).data,ka=async(t,s)=>{const n=new FormData;return n.append("client_secret",t),(await Q.post(`${Ve}/${s}/connect`,n,{headers:{"Content-Type":"multipart/form-data"}})).data},Da=async()=>(await Q.post(`${Ve}/revoke`)).data,Na=async(t,s)=>(await Q.post(`${Ve}/${t}/read`,{options:s})).data,fs=async t=>(await Q.post(`${Ve}/${t}/worksheets`)).data,Pa=async(t,s)=>(await Q.post(`${Ve}/${t}/write`,{options:s})).data;function Ra(t){if(!Ea(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 vs(t){if(!Oa(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 Ea(t){return t==null?void 0:t.name.endsWith(".xlsx")}function Oa(t){return t==null?void 0:t.name.endsWith(".json")}function Ta(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 ye=`${Pt}/db`;function ys(t){return Q.post(`${ye}/download`,{filename:t})}async function Aa(t){try{const{data:s,name:n}=await qa(t),r=JSON.stringify(s,null,2),a=ts(r,"application/json;charset=utf-8;");ss(a,`${n}.json`)}catch(s){console.error(s)}}async function bs(t){const s=new FormData;return s.append("project",t),(await Q.post(`${ye}/upload`,s,{headers:{"Content-Type":"multipart/form-data"}})).data}async function ws(t){return await Q.patch(ye,t)}async function Fa(t){return(await Q.post(`${ye}/new`,t)).data}async function Ia(t){return(await Q.post(`${ye}/quick`,t)).data}async function La(){return(await Q.get(`${ye}/all`)).data}async function Ss(t){return(await Q.post(`${ye}/load`,{filename:t})).data}async function $a(){return(await Q.post(`${ye}/demo`)).data}async function Va(t,s){const n=`${ye}/${t}/duplicate`,r=decodeURIComponent(n);return(await Q.post(r,{newFilename:s})).data}async function Wa(t,s){const n=`${ye}/${t}/rename`,r=decodeURIComponent(n);return(await Q.put(r,{newFilename:s})).data}async function Ma(t){const s=`${ye}/${t}`,n=decodeURIComponent(s);return(await Q.delete(n)).data}async function qa(t){const s=await ys(t),n=s.headers["Content-Disposition"];let r=t;if(n!=null){const a=n.indexOf('"')+1,l=n.lastIndexOf('"');r=n.substring(a,l)}return{data:s.data,name:r}}const Ua={authenticate:{available:!1,error:""},sheetId:{available:!1,error:""},worksheet:{available:!1,error:""},pullPush:{available:!1,error:""}},Kt={stepData:Ua,worksheetNames:null,sheetId:null,authenticationStatus:"not_authenticated",rundown:null,customFields:null,spreadsheetImportMap:pr},G=Es((t,s)=>({...Kt,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}),patchSpreadsheetImportMap:(n,r)=>{const a=s().spreadsheetImportMap;a[n]!==r&&(a[n]=r)},reset:()=>t(Kt),resetPreview:()=>t({rundown:null,customFields:null})}));function lt(){const t=Ct(),s=G(d=>d.patchStepData),n=G(d=>d.setRundown),r=G(d=>d.setCustomFields);return{connect:async(d,m)=>{try{return await ka(d,m)}catch(u){s({authenticate:{available:!1,error:V(u)}})}},revoke:async()=>{try{return await Da()}catch(d){s({authenticate:{available:!1,error:V(d)}})}},verifyAuth:async()=>{try{return await _a()}catch(d){s({authenticate:{available:!1,error:V(d)}})}},importRundownPreview:async(d,m)=>{try{const u=await Na(d,m);n(u.rundown),r(u.customFields)}catch(u){s({pullPush:{available:!0,error:V(u)}})}},importRundown:async(d,m)=>{try{await ws({rundowns:d,customFields:m}),await t.invalidateQueries({queryKey:[nn,rn]})}catch(u){s({pullPush:{available:!0,error:V(u)}})}},exportRundown:async(d,m)=>{try{await Pa(d,m),s({pullPush:{available:!1,error:""}})}catch(u){s({pullPush:{available:!0,error:V(u)}})}}}}const bt={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(bt).every(n=>Object.hasOwn(t,n))}function Gt(t){const s=t.custom.reduce((n,{ontimeName:r,importName:a})=>(r&&a&&(n[r.trim()]=a.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,entryId:t.ID}}function Ba(t){localStorage.setItem("import-options",JSON.stringify(t))}function Ka(){const t=localStorage.getItem("import-options");if(!t)throw new Error("no import options found");return JSON.parse(t)}function Ga(){try{const t=Ka();return za(t)?t:bt}catch{return bt}}const Ha="_uploadSection_10owf_17",Qa="_finishSection_10owf_18",Ya="_error_10owf_40",Ja="_success_10owf_43",Xa="_singleActionCell_10owf_47",Pe={uploadSection:Ha,finishSection:Qa,error:Ya,success:Ja,singleActionCell:Xa};function Za({hasErrors:t,isSpreadsheet:s,onCancel:n,onSubmitExport:r,onSubmitImport:a}){const l=Ga(),{revoke:c}=lt(),{control:i,handleSubmit:h,register:o,setValue:d,watch:m,formState:{errors:u,isValid:f}}=ce({mode:"onChange",defaultValues:l,values:l}),{fields:x,append:p,remove:b}=Xe({control:i,name:"custom"}),y=G(P=>P.stepData),v=G(P=>P.worksheetNames),[w,I]=j.useState("");j.useEffect(()=>{!v||v.length===0||v.includes(l.Worksheet)||d("Worksheet",v[0],{shouldValidate:!0,shouldDirty:!0})},[v,d,l.Worksheet]);const S=async P=>{I("export");const A=Gt(P);await r(A),I("")},E=async()=>{await c(),n()},T=async P=>{I("import");const A=Gt(P);Ba(P),await a(A),I("")},C=P=>{b(P)},U=()=>{p({})},z=!!w,de=s&&!z,Y=!z&&!y.worksheet.error,L=!t&&f&&(de||Y);return e.jsxs(R,{as:"form",id:"import-map",children:[e.jsxs(fe,{children:["Import options",e.jsxs(O,{children:[!s&&e.jsx(xs,{text:"Revoke the google authentication",render:e.jsx(g,{}),onClick:E,disabled:z,children:"Revoke"}),e.jsx(g,{onClick:n,disabled:z,children:"Cancel"}),!s&&e.jsx(g,{variant:"primary",onClick:h(S),disabled:!Y,loading:w==="export",children:"Export"}),e.jsx(g,{variant:"primary",onClick:h(T),disabled:!L,loading:w==="import",children:"Import preview"})]})]}),e.jsxs(ve,{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:Pe.singleActionCell})]})}),e.jsxs("tbody",{children:[Object.entries(l).map(([P,A])=>P==="custom"?null:P==="Worksheet"?e.jsxs("tr",{children:[e.jsx("td",{children:P}),e.jsx("td",{children:e.jsx(ne,{id:A,value:m(P),onValueChange:D=>d(P,D,{shouldDirty:!0}),options:(v==null?void 0:v.map(D=>({value:D,label:D})))||[]})}),e.jsx("td",{className:Pe.singleActionCell})]},A):e.jsxs("tr",{children:[e.jsx("td",{children:P}),e.jsx("td",{children:e.jsx($,{id:A,fluid:!0,maxLength:25,defaultValue:A,placeholder:"Use default column name",...o(P)})}),e.jsx("td",{className:Pe.singleActionCell})]},A)),x.map((P,A)=>{var k,W,te;const D=P.ontimeName,K=P.importName,F=(te=(W=(k=u.custom)==null?void 0:k[A])==null?void 0:W.ontimeName)==null?void 0:te.message,_=`custom.${A}.ontimeName`;return e.jsxs("tr",{children:[e.jsxs("td",{children:[e.jsx($,{maxLength:25,fluid:!0,defaultValue:D,placeholder:"Name of the field as shown in Ontime",...o(`custom.${A}.ontimeName`,{validate:ue=>is.isAlphanumericWithSpace(ue)?!0:"Only alphanumeric characters and space are allowed"})}),F&&e.jsx(N,{children:F})]}),e.jsx("td",{children:e.jsx($,{maxLength:25,fluid:!0,defaultValue:K,placeholder:"Name of the column in the spreadsheet",...o(`custom.${A}.importName`)})}),e.jsx("td",{className:Pe.singleActionCell,children:e.jsx(Z,{variant:"ghosted-destructive","aria-label":"Delete entry",onClick:()=>C(A),children:e.jsx(he,{})})})]},_)}),e.jsxs("tr",{children:[e.jsx("td",{}),e.jsx(O,{as:"td",align:"end",children:e.jsxs(g,{onClick:U,children:["Add custom field ",e.jsx(me,{})]})}),e.jsx("td",{})]})]})]}),e.jsx(N,{children:y.worksheet.error})]})}const ei="https://docs.getontime.no/features/import-spreadsheet-gsheet/";function ti(){return e.jsxs(je,{children:["Ontime can import data from spreadsheets by: ",e.jsx("br",{}),"- importing the spreadsheet file in Ontime ",e.jsx("br",{}),"- synchronising your project with a Google Sheet",e.jsx("br",{}),e.jsx("br",{}),"To synchronise with a Google Sheet, you will need to allow Ontime to authenticate with your Google account.",e.jsx(se,{href:ei,children:"See the docs"})]})}function si(t){const{onCancel:s}=t,{revoke:n,connect:r,verifyAuth:a}=lt(),[l,c]=j.useState(null),[i,h]=j.useState(null),[o,d]=j.useState(""),[m,u]=j.useState(""),f=G(D=>D.sheetId),x=G(D=>D.setSheetId),p=G(D=>D.setWorksheets),b=G(D=>D.patchStepData),y=G(D=>D.authenticationStatus),v=G(D=>D.setAuthenticationStatus),w=G(D=>D.stepData.authenticate.error),I=async()=>{const D=await a();D&&v(D.authenticated)};j.useEffect(()=>{b({authenticate:{available:!1,error:""}}),U()},[]);const S=async()=>{d("cancel"),await n(),await I(),d("")},E=()=>{s()},T=D=>{var K;(K=D.target.files)!=null&&K.length&&c(D.target.files[0])},C=async()=>{if(!l||!f)return;b({worksheet:{available:!1,error:""}}),d("connect");const D=await r(l,f);D&&(u(D.verification_url),h(D.user_code)),d("")},U=async(D=0)=>{const K=await a();if(K!=null&&K.authenticated&&(v(K.authenticated),K.authenticated!=="pending")){if(K.authenticated=="authenticated")try{const F=await fs(K.sheetId);p(F)}catch(F){const _=V(F);b({worksheet:{available:!1,error:_}})}d("");return}if(D<=10){setTimeout(()=>U(D+1),2e3);return}d("")},z=async()=>{d("authenticate"),kt(m),window.addEventListener("focus",async()=>{U()},{once:!0})},de=l&&f,Y=!!i&&!!m,L=!!o,P=y==="authenticated",A=y==="pending";return e.jsxs(R,{children:[e.jsxs(fe,{children:["Sync with Google Sheet (experimental)",P?e.jsx(g,{onClick:S,loading:o==="cancel",children:"Revoke Authentication"}):e.jsx(g,{onClick:E,children:"Go Back"})]}),e.jsxs(oe,{children:[e.jsx(re,{children:"Upload Client Secret provided by Google"}),e.jsx(N,{children:w}),e.jsx($,{fluid:!0,type:"file",onChange:T,accept:".json",disabled:L||Y})]}),e.jsxs(oe,{children:[e.jsx(re,{children:"Enter ID of sheet to synchronise"}),e.jsx(N,{children:void 0}),e.jsx($,{fluid:!0,placeholder:"Sheet ID",onChange:D=>x(D.target.value),disabled:L||Y})]}),Y?e.jsx(oe,{children:e.jsxs(O,{children:[A&&e.jsx("span",{children:"Authenticating..."}),e.jsx(Nt,{copyValue:i??"",disabled:!Y,children:i||"Upload files to generate Auth Key"}),e.jsxs(g,{onClick:z,disabled:!Y,children:[e.jsx(Ts,{}),"Authenticate"]})]})}):e.jsx(oe,{children:e.jsx(O,{children:e.jsxs(g,{onClick:C,disabled:!de||L,loading:o==="connect",children:[e.jsx(Os,{}),"Connect"]})})})]})}const ni="_center_1q0ge_17",ri="_nowrap_1q0ge_21",ai="_secondaryRow_1q0ge_25",ii="_linkStartActive_1q0ge_30",li="_flex_1q0ge_36",oi="_subdued_1q0ge_42",X={center:ni,nowrap:ri,secondaryRow:ai,linkStartActive:ii,flex:li,subdued:oi};function xt(t){return t?"Yes":void 0}function ci(t){const{rundown:s,customFields:n}=t;let r=0;const a=Object.keys(n),l=a.map(c=>n[c].label);return e.jsxs(ve,{className:X.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"}),l.map(c=>e.jsx("th",{children:c},c)),e.jsx("th",{children:"ID"})]})}),e.jsx("tbody",{children:s.flatOrder.map(c=>{const i=s.entries[c];if(Qn(i)){const u=i.colour?ct(i.colour):{};return e.jsxs("tr",{children:[e.jsx("td",{className:X.center,children:e.jsx(B,{children:"-"})}),e.jsx("td",{className:X.center,children:e.jsx(B,{children:i.type})}),e.jsx("td",{})," ",e.jsx("td",{children:i.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:{...u},children:i.colour}),e.jsx("td",{})," ",e.jsx("td",{})," ",a.map(f=>{let x="";return f in i.custom&&(x=i.custom[f]),e.jsx("td",{children:x},f)}),e.jsx("td",{className:X.center,children:e.jsx(B,{children:i.id})})]},i.id)}if(Yn(i)){const u=i.colour?ct(i.colour):{};return e.jsxs(j.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{})," ",e.jsx("td",{className:X.center,children:e.jsx(B,{children:i.type})}),e.jsx("td",{className:X.nowrap,children:i.cue}),e.jsx("td",{children:i.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:{...u},children:i.colour}),e.jsx("td",{})," ",e.jsx("td",{})," ",a.map(f=>{let x="";return f in i.custom&&(x=i.custom[f]),e.jsx("td",{children:x},f)}),e.jsx("td",{className:X.center,children:e.jsx(B,{children:i.id})})]}),i.note&&e.jsx("tr",{children:e.jsxs("td",{colSpan:99,className:X.secondaryRow,children:["Note: ",i.note]})})]},i.id)}if(!us(i))return null;r+=1;const h=i.colour?ct(i.colour):{},o=xt(i.countToEnd),d=xt(i.skip),m=xt(i.flag);return e.jsxs(j.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{className:X.center,children:e.jsx(B,{children:r})}),e.jsx("td",{className:X.center,children:e.jsx(B,{children:i.type})}),e.jsx("td",{className:X.nowrap,children:i.cue}),e.jsx("td",{children:i.title}),e.jsx("td",{className:X.center,children:m&&e.jsx(B,{children:m})}),e.jsxs("td",{className:X.flex,children:[e.jsx("span",{className:i.linkStart?X.subdued:void 0,children:qe(i.timeStart)}),i.linkStart&&e.jsx(As,{className:X.linkStartActive})]}),e.jsx("td",{children:qe(i.timeEnd)}),e.jsx("td",{children:qe(i.duration)}),e.jsx("td",{children:qe(i.timeWarning)}),e.jsx("td",{children:qe(i.timeDanger)}),e.jsx("td",{className:X.center,children:o&&e.jsx(B,{children:o})}),e.jsx("td",{children:d&&e.jsx(B,{children:d})}),e.jsx("td",{style:{...h},children:i.colour}),e.jsx("td",{className:X.center,children:e.jsx(B,{children:i.timerType})}),e.jsx("td",{className:X.center,children:e.jsx(B,{children:i.endAction})}),a.map(u=>{let f="";return u in i.custom&&(f=i.custom[u]),e.jsx("td",{children:f},u)}),e.jsx("td",{className:X.center,children:e.jsx(B,{children:i.id})})]}),i.note&&e.jsx("tr",{children:e.jsxs("td",{colSpan:99,className:X.secondaryRow,children:["Note: ",i.note]})})]},i.id)})})]})}function di(t){const{rundown:s,customFields:n,onFinished:r,onCancel:a}=t,{data:l}=hs(),[c,i]=j.useState(!1),{importRundown:h}=lt(),o=G(u=>u.resetPreview),d=()=>{o(),a()},m=async()=>{i(!0),await h({[l.id]:{...s,id:l.id,title:l.title}},n),i(!1),r()};return e.jsxs(R,{children:[e.jsxs(fe,{children:["Review Rundown",e.jsxs(O,{children:[e.jsx(g,{onClick:d,variant:"ghosted",disabled:c,children:"Cancel"}),e.jsx(g,{onClick:m,variant:"primary",loading:c,children:"Apply"})]})]}),e.jsx(ci,{rundown:s,customFields:n})]})}function ui(){const[t,s]=j.useState("none"),[n,r]=j.useState(""),[a,l]=j.useState("none"),{exportRundown:c,importRundownPreview:i,verifyAuth:h}=lt(),o=G(k=>k.setWorksheets),d=G(k=>k.authenticationStatus),m=G(k=>k.setAuthenticationStatus),u=G(k=>k.rundown),f=G(k=>k.setRundown),x=G(k=>k.customFields),p=G(k=>k.setCustomFields),b=G(k=>k.setSheetId),y=G(k=>k.sheetId),v=j.useRef(null),w=async k=>{var te;const W=(te=k.target.files)==null?void 0:te[0];if(!W){o(null),l("none");return}try{l("loading"),Ra(W),await wa(W);const ue=await Sa();o(ue),s("excel"),l("done")}catch(ue){const Ee=an(ue);r(`Error uploading file: ${Ee}`),o(null),l("none")}},I=()=>{var k;(k=v.current)==null||k.click()},S=()=>{s("none"),f(null),l("none"),o(null),p(null),r(""),b(null)},E=async()=>{const k=await h();if(k&&(m(k.authenticated),b(k.sheetId),k.authenticated==="authenticated"&&k.sheetId))try{const W=await fs(k.sheetId);o(W)}catch(W){const te=V(W);r(`Error getting worksheets: ${te}`)}s("gsheet")},T=()=>{S()},C=async k=>{if(r(""),t==="excel")try{const W=await Ca(k);f(W.rundown),p(W.customFields)}catch(W){r(V(W))}if(t==="gsheet"){if(!y)return;await i(y,k)}},U=async()=>{if(S(),d==="authenticated"){const k=await h();k&&m(k.authenticated)}},z=()=>{s("finished"),f(null),l("none"),o(null),p(null),r("")},de=async k=>{y&&await c(y,k)},Y=t==="excel",L=t==="gsheet",P=d==="authenticated",A=t==="none",D=t==="finished",K=L&&!P,F=L&&P||Y&&a==="done",_=u!==null&&x!==null;return e.jsx(R,{children:e.jsxs(ee,{children:[e.jsx(H,{children:"Synchronise your rundown with an external source"}),n&&e.jsx(N,{children:n}),A&&e.jsxs(e.Fragment,{children:[e.jsx(ti,{}),e.jsx("input",{ref:v,style:{display:"none"},type:"file",onChange:w,accept:".xlsx","data-testid":"file-input"}),e.jsxs("div",{className:Pe.uploadSection,children:[e.jsxs("div",{children:[e.jsxs(g,{variant:"primary",onClick:I,loading:a==="loading",children:[e.jsx(Ze,{}),"Import from spreadsheet"]}),e.jsx(re,{children:"Accepts .xlsx files"})]}),e.jsx(lr,{orientation:"vertical"}),e.jsxs("div",{children:[e.jsxs(g,{variant:"primary",onClick:E,disabled:a!=="none",children:[e.jsx(Fs,{}),"Synchronise with Google"]}),e.jsx(re,{children:"Start authentication process"})]})]})]}),D&&e.jsxs("div",{className:Pe.finishSection,children:[n?e.jsx("span",{className:Pe.error,children:"Import failed"},"finish__error"):e.jsx("span",{className:Pe.success,children:"Import successful"},"finish__success"),e.jsx(g,{variant:"primary",onClick:S,children:"Return"})]}),K&&e.jsx(si,{onCancel:T}),F&&!_&&e.jsx(Za,{hasErrors:!!n,isSpreadsheet:Y,onCancel:U,onSubmitExport:de,onSubmitImport:C}),_&&e.jsx(di,{rundown:u,customFields:x,onFinished:z,onCancel:U})]})})}const hi="_halfWidth_qual8_17",mi="_fullWidth_qual8_21",xi="_twoCols_qual8_25",ji="_current_qual8_31",tt={halfWidth:hi,fullWidth:mi,twoCols:xi,current:ji};function Cs({onSubmit:t,onCancel:s,initialColour:n,initialLabel:r,initialKey:a}){const{data:l}=it(),[c,i]=j.useState(n||""),{handleSubmit:h,register:o,setFocus:d,setError:m,setValue:u,getValues:f,watch:x,formState:{errors:p,isSubmitting:b,isValid:y,isDirty:v}}=ce({defaultValues:{type:"text",label:r||"",colour:n||""},resetOptions:{keepDirtyValues:!0}}),w=async C=>{const{type:U,label:z,colour:de}=C,Y={type:U,colour:de,label:z};try{await t(Y)}catch(L){m("root",{type:"custom",message:V(L)})}};j.useEffect(()=>{d("label")},[d]);const I=C=>{i(C),u("colour",C,{shouldDirty:!0})},S=f("colour"),E=v&&y,T=a!==void 0;return e.jsxs($e,{as:"form",onSubmit:h(w),onKeyDown:C=>we(C,s),children:[e.jsxs(je,{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(re,{children:"Type"}),e.jsx(ds,{orientation:"horizontal",disabled:T,onValueChange:C=>u("type",C,{shouldDirty:!0}),value:x("type"),items:[{value:"text",label:"Text"},{value:"image",label:"Image"}]})]}),e.jsxs("div",{className:tt.twoCols,children:[e.jsxs("label",{children:[e.jsx(re,{children:"Label (only alphanumeric characters are allowed)"}),p.label&&e.jsx(N,{children:p.label.message}),e.jsx($,{...o("label",{required:{value:!0,message:"Required field"},onChange:()=>u("key",jr(f("label"))??"N/A"),validate:C=>C.trim().length===0?"Required field":is.isAlphanumericWithSpace(C)?!T&&T&&Object.keys(l).includes(C)?"Custom fields must be unique":!0:"Only alphanumeric characters and space are allowed"}),fluid:!0})]}),e.jsxs("label",{children:[e.jsx(re,{children:"Key (use in Integrations and API)"}),e.jsx($,{...o("key"),variant:"ghosted",readOnly:!0,fluid:!0})]})]}),e.jsxs("label",{children:[e.jsx(re,{children:"Colour"}),e.jsx(Fn,{name:"colour",value:S,handleChange:(C,U)=>I(U)})]}),p.root&&e.jsx(N,{children:p.root.message}),e.jsxs(O,{relation:"inner",align:"end",children:[e.jsx(g,{variant:"ghosted",onClick:s,children:"Cancel"}),e.jsx(g,{type:"submit",variant:"primary",disabled:!E,loading:b,children:"Save"})]})]})}function pi(t){const{colour:s,label:n,fieldKey:r,type:a,onEdit:l,onDelete:c}=t,[i,h]=j.useState(!1),o=async d=>{await l(r,d),h(!1)};return i?e.jsx("tr",{children:e.jsx("td",{colSpan:99,children:e.jsx(Cs,{onCancel:()=>h(!1),onSubmit:o,initialColour:s,initialLabel:n,initialKey:r})})}):e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx(In,{color:s})}),e.jsx("td",{children:e.jsx(B,{children:a})}),e.jsx("td",{className:tt.halfWidth,children:n}),e.jsx("td",{className:tt.fullWidth,children:e.jsx(Nt,{size:"small",copyValue:r,children:r})}),e.jsxs(O,{relation:"inner",as:"td",children:[e.jsx(Z,{variant:"ghosted-white","aria-label":"Edit entry",onClick:()=>h(!0),children:e.jsx(st,{})}),e.jsx(Z,{variant:"ghosted-destructive","aria-label":"Delete entry",onClick:()=>c(r),children:e.jsx(he,{})})]})]})}function gi(){const{data:t,refetch:s}=it(),[n,r]=j.useState(!1),a=()=>{r(!0)},l=()=>{r(!1)},c=async o=>{await sr(o),s(),r(!1)},i=async(o,d)=>{await nr(o,d),s()},h=async o=>{try{await rr(o),s()}catch{}};return e.jsx(R,{children:e.jsxs(ee,{children:[e.jsxs(H,{children:["Custom fields",e.jsxs(g,{onClick:a,children:["New ",e.jsx(me,{})]})]}),e.jsx(ie,{}),e.jsx(R,{children:e.jsxs(je,{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(js,{search:"settings=automation__automations",children:"Automation"}),", please note the generated key.",e.jsx(se,{href:ln,children:"See the docs"})]})}),e.jsxs(R,{children:[n&&e.jsx(Cs,{onSubmit:c,onCancel:l}),e.jsxs(ve,{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:d,label:m,type:u}])=>e.jsx(pi,{fieldKey:o,colour:d,label:m,type:u,onEdit:i,onDelete:h},o))})]})]})]})})}function fi(){const{data:t,status:s,isError:n,refetch:r,isFetching:a}=St({queryKey:Oe,queryFn:er,placeholderData:(l,c)=>l,refetchInterval:ls});return{data:t??{loaded:"",rundowns:[]},status:s,isError:n,refetch:r,isFetching:a}}function _s(){const t=Ct(),{mutateAsync:s}=ot({mutationFn:Jn,onMutate:()=>{t.cancelQueries({queryKey:Oe})},onSuccess:a=>{t.setQueryData(Oe,a.data)}}),{mutateAsync:n}=ot({mutationFn:Xn,onMutate:()=>{t.cancelQueries({queryKey:Oe})},onSuccess:a=>{t.setQueryData(Oe,a.data)}}),{mutateAsync:r}=ot({mutationFn:Zn,onMutate:()=>{t.cancelQueries({queryKey:Oe})},onSuccess:a=>{t.setQueryData(Oe,a.data)}});return{create:s,remove:n,load:r}}function vi({onClose:t}){const{create:s}=_s(),{handleSubmit:n,register:r,setFocus:a,setError:l,formState:{errors:c,isSubmitting:i}}=ce({defaultValues:{title:""}}),h=async o=>{try{await s(o.title||"untitled"),t()}catch(d){l("root",{message:`Failed to create rundown. ${d}`})}};return j.useEffect(()=>{a("title")},[a]),e.jsxs($e,{as:"form",onSubmit:n(h),children:[e.jsx(R,{children:e.jsxs("label",{children:[e.jsx(re,{children:"Rundown title"}),e.jsx($,{...r("title"),fluid:!0,placeholder:"Your rundown name"})]})}),e.jsxs(O,{relation:"inner",align:"end",children:[e.jsx(g,{variant:"ghosted",disabled:i,onClick:t,children:"Cancel"}),e.jsx(g,{type:"submit",variant:"primary",disabled:i,children:"Create rundown"})]}),c.root&&e.jsx(N,{children:c.root.message})]})}function yi(){var y;const{data:t}=fi(),{remove:s,load:n}=_s(),[r,a]=Ce(),[l,c]=Ce(),[i,h]=Ce(),[o,d]=j.useState(""),[m,u]=j.useState(null),f=v=>{u(null),d(v),c.open()},x=v=>{u(null),d(v),a.open()},p=async()=>{try{await n(o)}catch(v){u(`Failed to load rundown. ${V(v)}`)}finally{c.close()}},b=async()=>{try{await s(o)}catch(v){u(`Failed to delete rundown. ${V(v)}`)}finally{a.close()}};return e.jsxs(e.Fragment,{children:[e.jsx(R,{children:e.jsxs(ee,{children:[e.jsxs(H,{children:["Manage project rundowns",e.jsx(O,{children:e.jsxs(g,{onClick:()=>{u(null),h.open()},children:["New ",e.jsx(me,{})]})})]}),e.jsx(ie,{}),e.jsxs(R,{children:[i&&e.jsx(vi,{onClose:h.close}),m&&e.jsx(N,{children:m}),e.jsxs(ve,{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:(y=t==null?void 0:t.rundowns)==null?void 0:y.map(({id:v,numEntries:w,title:I})=>{const S=t.loaded===v;return e.jsxs("tr",{className:ge([S&&tt.current]),children:[e.jsx("td",{children:w}),e.jsxs("td",{children:[I," ",S&&e.jsx(B,{children:"Loaded"})]}),e.jsxs(O,{as:"td",children:[e.jsx(g,{size:"small",onClick:()=>f(v),disabled:S,children:"Load"}),e.jsx(g,{size:"small",variant:"subtle-destructive",onClick:()=>x(v),disabled:S,children:"Delete"})]})]},v)})})]})]})]})}),e.jsx(ft,{isOpen:r,onClose:a.close,title:"Load 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(g,{size:"large",onClick:a.close,children:"Cancel"}),e.jsx(g,{variant:"destructive",size:"large",onClick:b,children:"Delete rundown"})]})}),e.jsx(ft,{isOpen:l,onClose:c.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(g,{size:"large",onClick:c.close,children:"Cancel"}),e.jsx(g,{variant:"primary",size:"large",onClick:p,children:"Load rundown"})]})})]})}function bi(){const{defaultDuration:t,linkPrevious:s,defaultTimeStrategy:n,defaultWarnTime:r,defaultDangerTime:a,defaultTimerType:l,defaultEndAction:c,setDefaultDuration:i,setLinkPrevious:h,setTimeStrategy:o,setWarnTime:d,setDangerTime:m,setDefaultTimerType:u,setDefaultEndAction:f}=ms(y=>y),x=Ke(t),p=Ke(r),b=Ke(a);return e.jsx(R,{children:e.jsxs(ee,{children:[e.jsx(H,{children:"Rundown defaults"}),e.jsx(ie,{}),e.jsxs(R,{children:[e.jsx(fe,{children:"Default settings for new events"}),e.jsxs(oe,{children:[e.jsxs(M,{children:[e.jsx(q,{title:"Link previous",description:"Whether the start time of new events should be linked to the previous event end time"}),e.jsx(be,{size:"large",checked:s,onCheckedChange:h})]}),e.jsxs(M,{children:[e.jsx(q,{title:"Timer strategy",description:"Which time should be maintained when event schedule is recalculated"}),e.jsx(ne,{value:n,onValueChange:y=>o(y),options:[{value:Vt.LockDuration,label:"Duration"},{value:Vt.LockEnd,label:"End Time"}]})]})]}),e.jsxs(oe,{children:[e.jsxs(M,{children:[e.jsx(q,{title:"Default duration",description:"Default duration for new events"}),e.jsx(Be,{name:"defaultDuration",submitHandler:(y,v)=>i(v),time:x,placeholder:ze.duration})]}),e.jsxs(M,{children:[e.jsx(q,{title:"Timer type",description:"Default type of timer for new events"}),e.jsx(ne,{value:l,onValueChange:y=>u(y),options:[{value:He.CountDown,label:"Count down"},{value:He.CountUp,label:"Count up"},{value:He.Clock,label:"Clock"},{value:He.None,label:"None"}]})]}),e.jsxs(M,{children:[e.jsx(q,{title:"End Action",description:"Default end action for new events"}),e.jsx(ne,{value:c,onValueChange:y=>f(y),options:[{value:ht.None,label:"None"},{value:ht.LoadNext,label:"Load next"},{value:ht.PlayNext,label:"Play next"}]})]})]}),e.jsxs(oe,{children:[e.jsxs(M,{children:[e.jsx(q,{title:"Warning time",description:"Default threshold for warning time in an event"}),e.jsx(Be,{name:"warnTime",submitHandler:(y,v)=>d(v),time:p,placeholder:ze.warnTime})]}),e.jsxs(M,{children:[e.jsx(q,{title:"Danger time",description:"Default threshold for danger time in an event"}),e.jsx(Be,{name:"dangerTime",submitHandler:(y,v)=>m(v),time:b,placeholder:ze.dangerTime})]})]})]})]})})}function wi({location:t}){const s=ae("defaults",t),n=ae("custom",t),r=ae("rundowns",t),a=ae("sheets",t);return e.jsxs(e.Fragment,{children:[e.jsx(Re,{children:"Project data"}),e.jsx("div",{ref:s,children:e.jsx(bi,{})}),e.jsx("div",{ref:n,children:e.jsx(gi,{})}),e.jsx("div",{ref:r,children:e.jsx(yi,{})}),e.jsx("div",{ref:a,children:e.jsx(ui,{})})]})}const Si="_textEntry_dpb46_17",Ci="_inlineEntry_dpb46_25",_i="_redirect_dpb46_32",ki="_label_dpb46_36",De={textEntry:Si,inlineEntry:Ci,redirect:_i,label:ki};function Di({id:t,isOpen:s,name:n,currentPath:r,origin:a,onClose:l}){const{data:c}=rs(),[i,h]=j.useState(r),[o,d]=j.useState("/"),{setRedirect:m}=os,u=p=>{p==="/"||p===r||(p.startsWith("preset-")?m({target:t,redirect:p.slice(7)}):m({target:t,redirect:p}),l())},f=c.filter(p=>p.enabled),x=[...on.map(p=>({value:`/${p.url}`,label:p.label})),...f.map(p=>({value:`preset-${p.alias}`,label:`URL Preset: ${p.alias}`}))];return e.jsx(at,{isOpen:s,onClose:l,showCloseButton:!0,showBackdrop:!0,title:`Redirect: ${n}`,bodyElements:e.jsxs(e.Fragment,{children:[e.jsxs(je,{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(js,{search:"settings=sharing__presets",children:"Manage URL Presets"})]}),e.jsxs("div",{className:De.inlineEntry,children:[e.jsx("span",{className:De.label,children:"Enter custom path"}),e.jsxs("label",{className:De.textEntry,children:[a,e.jsx($,{placeholder:"eg. /timer",fluid:!0,value:i,onChange:p=>h(p.target.value)})]}),e.jsxs(g,{variant:"primary","aria-label":"Redirect",disabled:i===r||i==="",className:De.redirect,onClick:()=>u(i),children:["Redirect",e.jsx(At,{})]})]}),e.jsxs("div",{children:[e.jsx("span",{className:De.label,children:"Select View or URL Preset"}),e.jsxs("div",{className:De.inlineEntry,children:[e.jsxs("label",{className:De.textEntry,children:[a,e.jsx(ne,{fluid:!0,options:x,defaultValue:x[0].value,onValueChange:p=>d(p),disabled:f.length===0})]}),e.jsxs(g,{variant:"primary","aria-label":"Redirect to preset",className:De.redirect,disabled:f.length===0||o==="/",onClick:()=>u(o),children:["Redirect ",e.jsx(At,{})]})]})]})]})})}const Ni="_blink_vtewd_1",Pi="_halfWidthNoWrap_vtewd_25",Ri="_copiable_vtewd_30",wt="_self_vtewd_35",Ue={blink:Ni,halfWidthNoWrap:Pi,copiable:Ri,self:wt};function Ei(){const t=It(x=>x.id),s=It(x=>x.clients),[n,r]=Ce(),[a,l]=Ce(),{setIdentify:c}=os,[i,h]=j.useState(""),o=x=>{h(x),l.open()},d=x=>{h(x),r.open()},m=Object.entries(s).filter(([x,{type:p}])=>p==="ontime"),u=Object.entries(s).filter(([x,{type:p}])=>p!=="ontime"),f=s[i];return e.jsxs(e.Fragment,{children:[n&&f!==void 0&&e.jsx(Di,{id:i,name:f.name,origin:f.origin,currentPath:f.path,isOpen:n,onClose:r.close}),a&&e.jsx(cn,{id:i,name:f==null?void 0:f.name,isOpen:a,onClose:l.close}),e.jsxs(R,{children:[e.jsxs(fe,{children:["Ontime Clients (",m.length,")"]}),e.jsxs(ve,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:{width:"20%"},children:"Client Name"}),e.jsx("td",{children:"Path"}),e.jsx("td",{})]})}),e.jsx("tbody",{children:m.map(([x,p])=>{const{identify:b,name:y,path:v}=p,w=t===x;return e.jsxs("tr",{className:ge([w&&Ue.self]),children:[e.jsxs(O,{relation:"inner",as:"td",children:[w&&e.jsx(B,{children:"SELF"}),y]}),e.jsx("td",{className:Ue.copiable,children:v}),e.jsxs(O,{relation:"inner",as:"td",children:[e.jsx(g,{size:"small",className:`${b?Ue.blink:""}`,disabled:w,variant:b?"primary":"subtle","data-testid":w?"":"not-self-identify",onClick:()=>{c({target:x,identify:!b})},children:"Identify"}),e.jsx(g,{size:"small","data-testid":w?"":"not-self-rename",onClick:()=>o(x),children:"Rename"}),e.jsx(g,{size:"small",disabled:w,"data-testid":w?"":"not-self-redirect",onClick:()=>d(x),children:"Redirect"})]})]},x)})})]})]}),e.jsx(ie,{}),e.jsxs(R,{children:[e.jsxs(fe,{children:["Other Clients (",u.length,")"]}),e.jsxs(ve,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:Ue.halfWidthNoWrap,children:"Client Name"}),e.jsx("td",{className:Ue.halfWidthNoWrap,children:"Client type"})]})}),e.jsx("tbody",{children:u.map(([x,p])=>{const{name:b,type:y}=p;return e.jsxs("tr",{children:[e.jsx("td",{children:b}),e.jsx("td",{children:y})]},x)})})]})]})]})}function Oi(){return e.jsx(R,{children:e.jsxs(ee,{children:[e.jsx(H,{children:"Manage clients"}),e.jsx(ie,{}),e.jsx(Ei,{})]})})}const Ti="_iconRotate_l21m9_17",Ai={iconRotate:Ti};function Fi(){const t=s=>{as("log",s)};return e.jsx(R,{children:e.jsxs(ee,{children:[e.jsxs(H,{children:["Event log",e.jsxs(g,{onClick:t,children:["Extract ",e.jsx(Xt,{className:Ai.iconRotate})]})]}),e.jsx(ie,{}),e.jsx(dn,{})]})})}function Ii({location:t}){const s=ae("clients",t),n=ae("log",t);return e.jsxs(e.Fragment,{children:[e.jsx(Re,{children:"Network"}),un,e.jsx("div",{ref:n,children:e.jsx(Fi,{})}),e.jsx("div",{ref:s,children:e.jsx(Oi,{})})]})}const Ht={project:{title:""},settings:{timeFormat:"24",language:"en"}};function Li({isOpen:t,onClose:s}){var y,v,w,I;const{defaultWarnTime:n,defaultDangerTime:r,setDangerTime:a,setWarnTime:l}=ms(),{handleSubmit:c,register:i,formState:{errors:h,isSubmitting:o,isValid:d},watch:m,setError:u,setValue:f}=ce({defaultValues:Ht,values:Ht,resetOptions:{keepDirtyValues:!0}}),x=async S=>{try{S.project.title===""&&(S.project.title="untitled"),await Ia(S),await Le(),s()}catch(E){u("root",{message:V(E)})}},p=Ke(n),b=Ke(r);return e.jsx(at,{isOpen:t,onClose:s,showBackdrop:!0,showCloseButton:!0,title:"Create new project...",bodyElements:e.jsxs("form",{onSubmit:c(x),id:"quick-start",children:[e.jsxs(oe,{children:[e.jsxs(M,{children:[e.jsx(q,{title:"Project title",description:"Shown as the title in some views"}),e.jsx($,{maxLength:150,placeholder:"Project title",fluid:!0,...i("project.title")})]}),e.jsxs(M,{children:[e.jsx(q,{title:"Time format",description:"Default time format to show in views 12 /24 hours",error:(v=(y=h.settings)==null?void 0:y.timeFormat)==null?void 0:v.message}),e.jsx(ne,{value:m("settings.timeFormat"),onValueChange:S=>f("settings.timeFormat",S,{shouldDirty:!0}),defaultValue:"24",options:[{value:"12",label:"12 hours 11:00:10 PM"},{value:"24",label:"24 hours 23:00:10"}]})]}),e.jsxs(M,{children:[e.jsx(q,{title:"Views language",description:"Language to be displayed in views",error:(I=(w=h.settings)==null?void 0:w.language)==null?void 0:I.message}),e.jsx(ne,{value:m("settings.language"),onValueChange:S=>f("settings.language",S,{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(M,{children:[e.jsx(q,{title:"Warning time",description:"Default threshold for warning time in an event"}),e.jsx(Be,{name:"warnTime",submitHandler:(S,E)=>l(E),time:p,placeholder:ze.warnTime})]}),e.jsxs(M,{children:[e.jsx(q,{title:"Danger time",description:"Default threshold for danger time in an event"}),e.jsx(Be,{name:"dangerTime",submitHandler:(S,E)=>a(E),time:b,placeholder:ze.dangerTime})]})]})]}),footerElements:e.jsxs(e.Fragment,{children:[(h==null?void 0:h.root)&&e.jsx(N,{children:h.root.message}),e.jsx(g,{variant:"ghosted",onClick:s,disabled:!1,children:"Cancel"}),e.jsx(g,{variant:"primary",type:"submit",form:"quick-start",disabled:!d,loading:o,children:"Create project"})]})})}const $i="_current_1iru7_17",Vi="_isEditing_1iru7_21",Wi="_form_1iru7_25",Mi="_formInput_1iru7_33",qi="_saveButton_1iru7_37",Ui="_containCell_1iru7_41",zi="_innerColumn_1iru7_49",Bi="_inlineLabels_1iru7_57",Ki="_warningInfo_1iru7_62",Gi="_empty_1iru7_66",xe={current:$i,isEditing:Vi,form:Wi,formInput:Mi,saveButton:qi,containCell:Ui,innerColumn:zi,inlineLabels:Bi,warningInfo:Ki,empty:Gi};function Hi({onClose:t}){const[s,n]=j.useState(null),{handleSubmit:r,register:a,formState:{isSubmitting:l,isValid:c},setFocus:i}=ce({defaultValues:{title:""},values:{title:""},resetOptions:{keepDirtyValues:!0}});j.useEffect(()=>{i("title")},[i]);const h=async o=>{try{n(null);const d=o.title??"untitled";await Fa({filename:d}),t()}catch(d){n(V(d))}};return e.jsxs($e,{as:"form",onSubmit:r(h),onKeyDown:o=>we(o,t),children:[e.jsxs(fe,{children:["Create new project",e.jsxs(O,{children:[e.jsx(g,{onClick:t,variant:"ghosted",disabled:l,children:"Cancel"}),e.jsx(g,{disabled:!c,type:"submit",loading:l,variant:"primary",children:"Create project"})]})]}),s&&e.jsx(N,{children:s}),e.jsxs(R,{className:xe.innerColumn,children:[e.jsx(re,{children:"Project title"}),e.jsx($,{fluid:!0,placeholder:"Your project name",...a("title")})]})]})}const Qi={files:[],lastLoadedProject:""};function Yi(){const{data:t,status:s,refetch:n}=St({queryKey:hn,queryFn:La,placeholderData:(r,a)=>r,retry:5,retryDelay:r=>r*2500,refetchInterval:ls,networkMode:"always"});return{data:t??Qi,status:s,refetch:n}}function ks(){const t=Yi(),{files:s,lastLoadedProject:n}=t.data,r=j.useMemo(()=>{if(!s.length)return[];const a=s.findIndex(i=>i.filename===n);if(a===-1)return s;const l=[...s];return[l.splice(a,1)[0],...l]},[s,n]);return{...t,data:{reorderedProjectFiles:r,lastLoadedProject:t.data.lastLoadedProject}}}function Ji({action:t,filename:s,onSubmit:n,onCancel:r}){const{handleSubmit:a,register:l,formState:{isSubmitting:c,isDirty:i,isValid:h},setFocus:o}=ce({defaultValues:{filename:s},values:{filename:s},resetOptions:{keepDirtyValues:!0}});return j.useEffect(()=>{o("filename")},[o]),e.jsxs("form",{onSubmit:a(n),onKeyDown:d=>we(d,r),className:xe.form,children:[e.jsx($,{className:xe.formInput,id:"filename",placeholder:"Enter new name",...l("filename",{required:!0})}),e.jsxs(O,{relation:"inner",children:[e.jsx(g,{onClick:r,variant:"ghosted",disabled:c,children:"Cancel"}),e.jsx(g,{variant:"primary",disabled:!i||!h||c,type:"submit",className:xe.saveButton,children:t})]})]})}async function Xi(t,s){const n={};for(const r in s)tr(r,t)&&s[r]&&(r==="rundowns"&&(n.customFields=t.customFields),Object.assign(n,{[r]:t[r]}));return n}function Zi({onClose:t,fileName:s}){const[n,r]=j.useState(null),a=Ct(),{handleSubmit:l,watch:c,setValue:i,formState:{isSubmitting:h,isValid:o,isDirty:d}}=ce({defaultValues:{project:!1,rundowns:!1,viewSettings:!1,urlPresets:!1,automation:!1},resetOptions:{keepDirtyValues:!0}}),m=async u=>{if(Object.values(u).every(x=>!x)){r("At least one option must be selected");return}try{r(null);const{data:x}=await ys(s);if(!x.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 Xi(x,u);await ws(p),await a.invalidateQueries({queryKey:mn}),t()}catch(x){r(V(x))}};return e.jsxs(R,{as:"form",onSubmit:l(m),children:[e.jsxs(fe,{children:["Partial project merge",e.jsxs(O,{children:[e.jsx(g,{onClick:t,variant:"ghosted",disabled:h,children:"Cancel"}),e.jsx(g,{type:"submit",disabled:!o||!d,loading:h,variant:"primary",children:"Merge"})]})]}),n&&e.jsx(N,{children:n}),e.jsxs(R,{className:ge([xe.innerColumn,xe.inlineLabels]),children:[e.jsxs(re,{children:["Select data from ",e.jsx("i",{children:`"${s}"`})," to merge into the current project."]}),e.jsxs(je,{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(be,{size:"large",checked:c("project"),onCheckedChange:u=>i("project",u,{shouldDirty:!0})}),"Project data"]}),e.jsxs("label",{children:[e.jsx(be,{size:"large",checked:c("rundowns"),onCheckedChange:u=>i("rundowns",u,{shouldDirty:!0})}),"Rundown + Custom Fields"]}),e.jsxs("label",{children:[e.jsx(be,{size:"large",checked:c("viewSettings"),onCheckedChange:u=>i("viewSettings",u,{shouldDirty:!0})}),"View Settings"]}),e.jsxs("label",{children:[e.jsx(be,{size:"large",checked:c("urlPresets"),onCheckedChange:u=>i("urlPresets",u,{shouldDirty:!0})}),"URL Presets"]}),e.jsxs("label",{children:[e.jsx(be,{size:"large",checked:c("automation"),onCheckedChange:u=>i("automation",u,{shouldDirty:!0})}),"Automation Settings"]})]})]})}function el({current:t,updatedAt:s,editingFilename:n,editingMode:r,filename:a,onRefetch:l,onSubmit:c,onToggleEditMode:i}){const[h,o]=j.useState(null),[d,m]=j.useState(!1),u=S=>async E=>{m(!0),o(null);try{if(!E.filename){o("Filename cannot be blank");return}await(S==="rename"?Wa:Va)(a,E.filename),await l(),c()}catch(T){o(V(T))}finally{m(!1)}},f=async S=>{m(!0),o(null);try{await Ss(S),await l(),await Le()}catch(E){o(V(E))}finally{m(!1)}},x=async S=>{m(!0),o(null);try{await Ma(S),await l()}catch(E){o(V(E))}finally{m(!1)}},p=(S,E)=>{o(null),i(S,E)},b=()=>{p(null,null)},y=a===n,v=(r==="rename"||r==="duplicate")&&a===n,w=r==="merge"&&y,I=ge([t&&!y&&xe.current,y&&xe.isEditing]);return e.jsxs(e.Fragment,{children:[h&&e.jsx("tr",{children:e.jsx("td",{colSpan:99,children:e.jsx(N,{children:h})})},"filename-error"),e.jsx("tr",{className:I,children:v?e.jsx("td",{colSpan:99,children:e.jsx(Ji,{action:r,filename:a,onSubmit:u(r==="duplicate"?"duplicate":"rename"),onCancel:b})}):e.jsxs(e.Fragment,{children:[e.jsx("td",{className:xe.containCell,children:a}),e.jsx("td",{children:t?"Currently loaded":new Date(s).toLocaleString()}),e.jsx("td",{children:e.jsx(tl,{current:t,filename:a,onChangeEditMode:p,onDelete:x,onLoad:f,isDisabled:d||w,onMerge:S=>p("merge",S)})})]})},a),w&&e.jsx("tr",{children:e.jsx("td",{colSpan:99,children:e.jsx(Zi,{onClose:b,fileName:a})})})]})}function tl(t){const{current:s,filename:n,isDisabled:r,onChangeEditMode:a,onDelete:l,onLoad:c,onMerge:i}=t,h=()=>{a("rename",n)},o=()=>{a("duplicate",n)},d=async()=>{await Aa(n)};return e.jsx(Ln,{render:e.jsx(Z,{variant:"ghosted-white"}),disabled:r,items:[{type:"item",icon:Ze,label:"Load",onClick:()=>c(n),disabled:s},{type:"item",icon:Ze,label:"Partial Load",onClick:()=>i(n),disabled:s},{type:"item",icon:Is,label:"Rename",onClick:h},{type:"item",icon:Ls,label:"Duplicate",onClick:o},{type:"item",icon:$s,label:"Download",onClick:d},{type:"divider"},{type:"item",icon:he,label:"Delete",onClick:()=>l(n),disabled:s}],children:e.jsx(Vs,{})})}function sl(){const{data:t,refetch:s,status:n}=ks(),[r,a]=j.useState(null),[l,c]=j.useState(null),i=(m,u)=>{a(f=>f===m&&u===l?null:m),c(u)},h=()=>{a(null),c(null)},o=async()=>{await s()};if(n==="pending")return e.jsx("div",{className:xe.empty,children:e.jsx(Ae,{isLoading:!0})});const d=t.reorderedProjectFiles.length;return e.jsxs(e.Fragment,{children:[d>20&&e.jsxs(je,{className:xe.warningInfo,type:"warning",children:["You have ",d," projects. Consider deleting unused projects to improve performance."]}),e.jsxs(ve,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:xe.containCell,children:"File Name"}),e.jsx("th",{children:"Last Used"}),e.jsx("th",{})]})}),e.jsx("tbody",{children:t.reorderedProjectFiles.map(m=>e.jsx(el,{filename:m.filename,updatedAt:m.updatedAt,onToggleEditMode:i,onSubmit:h,onRefetch:o,editingFilename:l,editingMode:r,current:m.filename===t.lastLoadedProject},m.filename))})]})]})}function nl(){const[t,s]=Zt(),[n,r]=j.useState(""),[a,l]=j.useState(null),c=j.useRef(null),i=t.get("new")==="true",h=()=>{t.set("new",i?"false":"true"),s(t)},o=()=>{var u;(u=c.current)==null||u.click()},d=async u=>{var x,p;const f=(p=(x=u.target)==null?void 0:x.files)==null?void 0:p[0];if(f){l("import");try{vs(f),await bs(f)}catch(b){const y=V(b);r(`Error uploading file: ${y}`)}finally{await Le()}l(null)}},m=()=>{t.delete("new"),s(t)};return e.jsxs(R,{children:[e.jsx("input",{ref:c,style:{display:"none"},type:"file",onChange:d,accept:".json","data-testid":"file-input"}),e.jsxs(ee,{children:[e.jsxs(H,{children:["Manage projects",e.jsxs(O,{children:[e.jsx(g,{onClick:o,disabled:!!a||i,loading:a==="import",children:"Import"}),e.jsxs(g,{onClick:h,disabled:!!a||i,children:["New ",e.jsx(me,{})]})]})]}),n&&e.jsx(N,{children:n}),e.jsx(ie,{}),i&&e.jsx(Hi,{onClose:m}),e.jsx(sl,{})]})]})}function rl({location:t,setLocation:s}){const n=ae("list",t),r=()=>{s("project")};return e.jsxs(e.Fragment,{children:[e.jsx(Re,{children:"Project"}),e.jsx(Li,{isOpen:t==="create",onClose:r}),e.jsx("div",{ref:n,children:e.jsx(nl,{})})]})}const al="_container_cq029_17",il={container:al};function Qt({register:t,formName:s,disabled:n}){const[r,a]=j.useState(!1);return e.jsxs("div",{className:il.container,children:[e.jsx($,{type:r?"text":"password",maxLength:4,...t(s,{pattern:{value:Un,message:"Only alphanumeric characters are allowed"}}),placeholder:"-",disabled:n}),e.jsx(Z,{onMouseDown:()=>a(!0),onMouseUp:()=>a(!1),variant:"ghosted","aria-label":"Show pin code",children:e.jsx(Ws,{})})]})}const ll=j.lazy(()=>Ge(()=>import("./CustomTranslationModal-CcNNjbmZ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url));function ol(){var S,E,T,C,U;const{data:t,status:s,refetch:n}=xn(),{handleSubmit:r,register:a,reset:l,setError:c,watch:i,setValue:h,formState:{isSubmitting:o,isDirty:d,isValid:m,errors:u}}=ce({mode:"onChange",defaultValues:t,values:t,resetOptions:{keepDirtyValues:!0}}),[f,x]=Ce();j.useEffect(()=>{t&&l(t)},[t,l]);const p=async z=>{try{await jn(z)}catch(de){const Y=V(de);c("root",{message:Y})}finally{await n()}},b=s==="pending",y=o||!d||!m,v="",w=()=>{l(t)},I=s==="pending";return e.jsxs(e.Fragment,{children:[e.jsx(ll,{isOpen:f,onClose:x.close}),e.jsx(R,{as:"form",onSubmit:r(p),onKeyDown:z=>we(z,w),id:"app-settings",children:e.jsxs(ee,{children:[e.jsxs(H,{children:["General settings",e.jsxs(O,{children:[e.jsx(g,{disabled:!d||o,variant:"ghosted",onClick:w,children:"Revert to saved"}),e.jsx(g,{type:"submit",form:"app-settings",name:"general-settings-submit",loading:o,disabled:y,variant:"primary",children:"Save"})]})]}),v,e.jsx(ie,{}),e.jsxs(R,{children:[e.jsx(Ae,{isLoading:I}),e.jsxs(oe,{children:[e.jsxs(M,{children:[e.jsx(q,{title:"Ontime server port",description:Ie?"Server port disabled for Ontime Cloud":"Port ontime server listens in. Defaults to 4001 (needs app restart)",error:(S=u.serverPort)==null?void 0:S.message}),e.jsx($,{id:"serverPort",type:"number",maxLength:5,style:{width:"75px"},disabled:Ie,...a("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:cs,message:"Value should be numeric"}})})]}),e.jsxs(M,{children:[e.jsx(q,{title:"Editor pin code",description:"Protect the editor view with a pin code",error:(E=u.editorKey)==null?void 0:E.message}),e.jsx(Qt,{register:a,formName:"editorKey",disabled:b})]}),e.jsxs(M,{children:[e.jsx(q,{title:"Operator pin code",description:"Protect the operator and cuesheet views with a pin code",error:(T=u.operatorKey)==null?void 0:T.message}),e.jsx(Qt,{register:a,formName:"operatorKey",disabled:b})]}),e.jsxs(M,{children:[e.jsx(q,{title:"Time format",description:"Default time format to show in views 12 /24 hours",error:(C=u.timeFormat)==null?void 0:C.message}),e.jsx(ne,{value:i("timeFormat"),onValueChange:z=>h("timeFormat",z,{shouldDirty:!0}),defaultValue:"24",options:[{value:"12",label:"12 hours 11:00:10 PM"},{value:"24",label:"24 hours 23:00:10"}]})]}),e.jsxs(M,{children:[e.jsx(q,{title:"Views language",description:"Language to be displayed in views",error:(U=u.language)==null?void 0:U.message}),e.jsx(ne,{value:i("language"),onValueChange:z=>h("language",z,{shouldDirty:!0}),disabled:b,defaultValue:"en",options:[{value:"en",label:"English"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"it",label:"Italian"},{value:"pt",label:"Portuguese"},{value:"es",label:"Spanish"},{value:"custom",label:"Custom"}]}),e.jsx(g,{onClick:x.open,children:"Edit custom translation"})]})]})]})]})})]})}const cl="_uploadLogoCard_m5263_17",dl="_customDataItem_m5263_32",ul="_titleRow_m5263_39",hl="_customImage_m5263_48",ml="_imageContainer_m5263_54",Fe={uploadLogoCard:cl,customDataItem:dl,titleRow:ul,customImage:hl,imageContainer:ml};function xl(){var Y;const{data:t,status:s}=$n(),{updateProjectData:n}=Vn(),{handleSubmit:r,register:a,reset:l,formState:{isSubmitting:c,isValid:i,isDirty:h,errors:o},setError:d,clearErrors:m,watch:u,control:f,setValue:x}=ce({defaultValues:t,values:t,resetOptions:{keepDirtyValues:!0},mode:"onChange"}),{fields:p,append:b,remove:y}=Xe({control:f,name:"custom"});j.useEffect(()=>{t&&l(t)},[t,l]);const v=async L=>{var A;const P=(A=L.target.files)==null?void 0:A[0];if(m("logo"),!!P)try{Ta(P);const D=await Wn(P);x("logo",D.data.logoFilename,{shouldDirty:!0})}catch(D){const K=V(D);d("logo",{message:K})}},{ref:w,...I}=a("logo"),S=j.useRef(null),E=()=>{var L;(L=S.current)==null||L.click()},T=L=>{L.preventDefault(),L.stopPropagation(),x("logo",null,{shouldDirty:!0})},C=()=>{b({title:"",value:"",url:""})},U=async L=>{try{m(),await n(L)}catch(P){const A=V(P);d("root",{message:A})}},z=()=>{l(t)},de=s==="pending";return e.jsx(R,{as:"form",onSubmit:r(U),onKeyDown:L=>we(L,z),children:e.jsxs(ee,{children:[e.jsxs(H,{children:["Project data",e.jsxs(O,{children:[e.jsx(g,{onClick:z,disabled:c||!h,children:"Revert to saved"}),e.jsx(g,{variant:"primary",type:"submit",disabled:!h||!i,loading:c,children:"Save"})]})]}),e.jsx(ie,{}),e.jsxs(R,{children:[e.jsx(Ae,{isLoading:de}),e.jsxs("label",{children:["Project title",e.jsx($,{fluid:!0,maxLength:50,placeholder:"Project title is shown in production views",...a("title")})]}),e.jsx(R,{style:{marginTop:0},children:e.jsxs("label",{children:["Project logo",e.jsx("input",{type:"file",style:{display:"none"},accept:"image/*",...I,ref:L=>{w(L),S.current=L},onChange:v}),e.jsxs(ee,{className:Fe.uploadLogoCard,children:[u("logo")?e.jsxs(e.Fragment,{children:[e.jsx("img",{src:`${pn}/${u("logo")}`}),e.jsxs(g,{variant:"subtle-destructive",disabled:c||!u("logo"),onClick:T,children:[e.jsx(he,{}),"Delete"]})]}):e.jsxs(g,{disabled:c,onClick:E,type:"button",children:[e.jsx(Ze,{}),"Upload logo"]}),((Y=o==null?void 0:o.logo)==null?void 0:Y.message)&&e.jsx(N,{children:o.logo.message})]})]})}),e.jsxs("label",{children:["Project description",e.jsx($,{fluid:!0,maxLength:100,placeholder:"Euro Love, Malmö 2024",...a("description")})]}),e.jsxs("label",{children:["Project info",e.jsx(vt,{fluid:!0,maxLength:150,placeholder:"Wi-Fi password: 1234",resize:"vertical",...a("info")})]}),e.jsxs("label",{children:["Project QR code URL",e.jsx($,{fluid:!0,placeholder:Dt,...a("url")})]}),e.jsxs(R,{style:{marginTop:0},children:[e.jsxs(M,{children:[e.jsx(q,{title:"Custom data",description:""}),e.jsxs(g,{onClick:C,children:["Add ",e.jsx(me,{})]})]}),p.length>0&&p.map((L,P)=>{var D,K,F;const A=(D=o.custom)==null?void 0:D[P];return e.jsxs("div",{className:Fe.customDataItem,children:[e.jsxs("div",{className:Fe.titleRow,children:[e.jsxs("label",{className:Fe.title,children:["Title",e.jsx($,{fluid:!0,defaultValue:L.title,placeholder:"Title of your custom data",...a(`custom.${P}.title`,{required:{value:!0,message:"Field cannot be empty"}})})]}),e.jsxs(g,{variant:"subtle-destructive",onClick:()=>y(P),children:[e.jsx(he,{}),"Delete"]})]}),((K=A==null?void 0:A.title)==null?void 0:K.message)&&e.jsx(N,{children:A.title.message}),e.jsxs("label",{children:["Text",e.jsx(vt,{fluid:!0,rows:3,resize:"vertical",defaultValue:L.value,placeholder:"Text of your custom data",...a(`custom.${P}.value`,{required:{value:!0,message:"Field cannot be empty"}})}),((F=A==null?void 0:A.value)==null?void 0:F.message)&&e.jsx(N,{children:A.value.message})]}),e.jsxs("label",{children:["Image URL (optional)",e.jsxs("div",{className:Fe.customImage,children:[e.jsx($,{fluid:!0,defaultValue:L.url,placeholder:"Paste image URL (optional)",...a(`custom.${P}.url`)}),e.jsx("div",{className:Fe.imageContainer,children:u(`custom.${P}.url`)&&e.jsx("img",{src:u(`custom.${P}.url`),alt:"",loading:"lazy",className:"info__image"})})]})]})]},L.id)})]})]})]})})}const jl="_editorActions_18rtd_17",pl="_right_18rtd_21",gl="_column_18rtd_26",jt={editorActions:jl,right:pl,column:gl},fl=j.lazy(()=>Ge(()=>import("./StyleEditor-DTNiR-0P.js"),__vite__mapDeps([11,1,2,12]),import.meta.url));function vl({isOpen:t,onClose:s}){const[n,r]=j.useState(""),[a,l]=j.useState(!1),[c,i]=j.useState(!1),[h,o]=j.useState(!1),[d,m]=j.useState(null),u=j.useRef(null),f=async()=>{try{o(!0);const b=await gn();r(b)}catch{}finally{o(!1)}},x=async()=>{try{i(!0),u.current&&(await fn(u.current.getCss()),r(u.current.getCss()),l(!1))}catch{}finally{i(!1)}},p=()=>r("");return j.useEffect(()=>{async function b(){if(t)try{const y=await vn();r(y)}catch{m("Failed to load CSS from server")}}b()},[t]),e.jsx(at,{title:"Edit CSS override",isOpen:t,onClose:s,showCloseButton:!0,showBackdrop:!0,bodyElements:e.jsx(fl,{ref:u,initialValue:n,language:"css",isDirty:a,setIsDirty:l}),footerElements:e.jsxs("div",{className:jt.column,children:[e.jsx(je,{children:"Invalid CSS will be refused by the browser"}),d&&e.jsx(N,{className:jt.right,children:`Error: ${d}`}),e.jsxs(O,{align:"apart",className:jt.editorActions,children:[e.jsx(g,{variant:"ghosted",size:"large",onClick:f,disabled:c||h,children:"Reset to example"}),e.jsxs(O,{children:[e.jsx(g,{variant:"ghosted",size:"large",onClick:p,children:"Clear"}),e.jsx(g,{size:"large",onClick:s,children:"Cancel"}),e.jsx(g,{variant:"primary",size:"large",onClick:x,disabled:c||h||!a,loading:c,children:"Save changes"})]})]})]})})}const yl="https://docs.getontime.no/features/custom-styling/";function bl(){var b;const{data:t,status:s,mutateAsync:n}=yn(),[r,a]=Ce(),{control:l,handleSubmit:c,setError:i,reset:h,setValue:o,watch:d,formState:{isSubmitting:m,isDirty:u,errors:f}}=ce({defaultValues:t,values:t,resetOptions:{keepDirtyValues:!0}});j.useEffect(()=>{t&&h(t)},[t,h]);const x=async y=>{try{n(y)}catch(v){const w=V(v);i("root",{message:w})}},p=()=>{h(t)};return l?e.jsx(R,{as:"form",onSubmit:c(x),onKeyDown:y=>we(y,p),id:"view-settings",children:e.jsxs(ee,{children:[e.jsxs(H,{children:["View settings",e.jsxs(O,{children:[e.jsx(g,{disabled:!u,variant:"ghosted",onClick:p,children:"Revert to saved"}),e.jsx(g,{type:"submit",loading:m,disabled:!u,variant:"primary",children:"Save"})]})]}),e.jsx(ie,{}),e.jsxs(je,{children:["You can customise the styles applied to Ontime views by providing overriding CSS rules.",e.jsx("br",{}),e.jsx(se,{href:yl,children:"See the docs"})]}),e.jsxs(R,{children:[e.jsx(Ae,{isLoading:s==="pending"}),e.jsx(N,{children:(b=f.root)==null?void 0:b.message}),e.jsxs(oe,{children:[e.jsx(vl,{isOpen:r,onClose:a.close}),e.jsxs(M,{children:[e.jsx(q,{title:"Override CSS styles",description:"Enables overriding view styles with custom stylesheet"}),e.jsx(be,{size:"large",checked:d("overrideStyles"),onCheckedChange:y=>o("overrideStyles",y,{shouldDirty:!0})}),e.jsx(g,{onClick:a.open,disabled:m,children:"Edit CSS override"})]})]}),e.jsxs(oe,{children:[e.jsxs(M,{children:[e.jsx(q,{title:"Timer colour",description:"Default colour of a running timer"}),e.jsx(ut,{name:"normalColor",control:l})]}),e.jsxs(M,{children:[e.jsx(q,{title:"Warning colour",description:"Colour of a running timer in warning mode"}),e.jsx(ut,{name:"warningColor",control:l})]}),e.jsxs(M,{children:[e.jsx(q,{title:"Danger colour",description:"Colour of a running timer in danger mode"}),e.jsx(ut,{name:"dangerColor",control:l})]})]})]})]})}):null}function wl({location:t}){const s=ae("data",t),n=ae("general",t),r=ae("view",t);return e.jsxs(e.Fragment,{children:[e.jsx(Re,{children:"Settings"}),e.jsx("div",{ref:s,children:e.jsx(xl,{})}),e.jsx("div",{ref:n,children:e.jsx(ol,{})}),e.jsx("div",{ref:r,children:e.jsx(bl,{})})]})}function Sl(){const{isElectron:t,sendToElectron:s}=bn(),[n,r]=Ce(),a=j.useRef(null),l=()=>{s("shutdown","now"),r.close()},c=t||et;return e.jsxs(e.Fragment,{children:[e.jsx(Re,{children:"Shutdown Ontime"}),e.jsxs(R,{children:[Ie?e.jsx(wn,{children:"For security reasons, shutting down the server must be done from the Ontime Cloud dashboard."}):e.jsxs(_e,{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(g,{variant:"destructive",onClick:r.open,disabled:!(t||et),children:"Shutdown ontime"}),!c&&e.jsx(re,{children:"Note: Ontime can only be shutdown from the machine it is running in."}),e.jsx(ft,{isOpen:n,title:"Shutdown Ontime",showCloseButton:!0,onClose:r.close,bodyElements:e.jsxs(_e,{children:["This will shutdown the Ontime server. ",e.jsx("br",{})," Are you sure?"]}),footerElements:e.jsxs(e.Fragment,{children:[e.jsx(g,{ref:a,onClick:r.close,variant:"ghosted-white",children:"Cancel"}),e.jsx(g,{variant:"destructive",onClick:l,disabled:!c,children:"Shutdown"})]})})]})]})}const Cl="_corner_1dxip_17",_l="_contentWrapper_1dxip_24",kl="_content_1dxip_24",pt={corner:Cl,contentWrapper:_l,content:kl};function Dl({onClose:t,children:s}){return e.jsxs("div",{className:pt.contentWrapper,children:[e.jsx("div",{className:pt.content,children:s}),e.jsx("div",{className:pt.corner,children:e.jsxs(g,{size:"large",onClick:t,children:["Close settings ",e.jsx(_t,{})]})})]})}const Nl=[{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 Pl(){const{data:t}=ps();return{options:j.useMemo(()=>Nl.map(n=>({...n,highlight:n.id==="about"&&t.hasUpdates?"New version available":void 0})),[t])}}const Ye="settings";function Et(){const[t,s]=Zt(),n=j.useMemo(()=>t.get(Ye)??"project",[t]),r=j.useMemo(()=>!!t.get(Ye),[t]),[a,l]=n.split("__"),c=j.useCallback(()=>{t.delete(Ye),s(t)},[t,s]),i=j.useCallback(h=>{t.set(Ye,h),s(t)},[t,s]);return{isOpen:r,panel:a,location:l,setLocation:i,close:c}}const Rl="_tabs_86c70_17",El="_primary_86c70_31",Ol="_secondary_86c70_32",Tl="_active_86c70_54",Al="_highlight_86c70_58",Fl="_split_86c70_68",Te={tabs:Rl,primary:El,secondary:Ol,active:Tl,highlight:Al,split:Fl};function Il({selectedPanel:t,location:s}){const{options:n}=Pl();return e.jsx("ul",{className:Te.tabs,children:n.map(r=>{const a=t===r.id;return r.highlight?e.jsx(xs,{text:r.highlight,render:e.jsx("span",{}),children:e.jsx(Yt,{panel:r,location:s,isSelected:a})},r.id):e.jsx(Yt,{panel:r,location:s,isSelected:a},r.id)})})}function Yt(t){var c;const{panel:s,isSelected:n,location:r}=t,{setLocation:a}=Et(),l=ge([Te.primary,n&&Te.active,s.split&&Te.split,s.highlight&&Te.highlight]);return e.jsxs(j.Fragment,{children:[e.jsx("li",{onClick:()=>a(s.id),onKeyDown:i=>{Lt(i)&&a(s.id)},className:l,tabIndex:0,role:"button",children:s.label},s.id),(c=s.secondary)==null?void 0:c.map((i,h)=>{const o=i.id.split("__")[1],d=ge([Te.secondary,n&&r===o?Te.active:null]);return e.jsx("li",{onClick:()=>a(i.id),onKeyDown:m=>{Lt(m)&&a(i.id)},className:d,role:"button",children:i.label},i.id+h)})]},s.id)}const Ll="_container_1fy3l_17",$l={container:Ll};function Vl(){const{close:t,panel:s,location:n,setLocation:r}=Et();return gr(t,"Escape"),e.jsx("div",{className:$l.container,children:e.jsxs(Ms,{children:[e.jsx(Il,{selectedPanel:s,location:n}),e.jsxs(Dl,{onClose:t,children:[s==="settings"&&e.jsx(wl,{location:n}),s==="project"&&e.jsx(rl,{location:n,setLocation:r}),s==="manage"&&e.jsx(wi,{location:n}),s==="automation"&&e.jsx(ta,{location:n}),s==="sharing"&&e.jsx(ba,{location:n}),s==="network"&&e.jsx(Ii,{location:n}),s==="about"&&e.jsx(wr,{}),s==="shutdown"&&e.jsx(Sl,{})]})]})})}const Wl=j.memo(Ml);function Ml({children:t}){return e.jsxs(zn,{navElements:t,children:[e.jsx(Bn,{}),e.jsx(dr,{}),e.jsx(ur,{}),e.jsx(hr,{}),e.jsx(mr,{}),e.jsx(xr,{})]})}function ql({onFinish:t}){const s=j.useRef(null),n=()=>{var a;(a=s.current)==null||a.click()},r=async a=>{var c,i;const l=(i=(c=a.target)==null?void 0:c.files)==null?void 0:i[0];if(l)try{vs(l),await bs(l)}catch{}finally{await Le(),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(g,{onClick:n,children:"Import project"})]})}const Ul="_sections_khqv6_17",zl="_column_khqv6_23",Bl="_about_khqv6_23",Kl="_inline_khqv6_35",Gl="_header_khqv6_41",Hl="_logo_khqv6_48",Ql="_buttonRow_khqv6_53",Yl="_tableContainer_khqv6_62",Jl="_table_khqv6_62",Xl="_current_khqv6_75",pe={sections:Ul,column:zl,about:Bl,inline:Kl,header:Gl,logo:Hl,buttonRow:Ql,tableContainer:Yl,table:Jl,current:Xl};function Zl(t){const{loadProject:s,onClose:n}=t,{data:r}=ks();return e.jsx("tbody",{children:r.reorderedProjectFiles.map(a=>a.filename===r.lastLoadedProject?e.jsxs("tr",{className:pe.current,onClick:n,children:[e.jsx("td",{children:a.filename}),e.jsx("td",{children:"Loaded from last session"})]},a.filename):e.jsxs("tr",{onClick:()=>s(a.filename),children:[e.jsx("td",{children:a.filename}),e.jsx("td",{children:new Date(a.updatedAt).toLocaleString()})]},a.filename))})}function eo({onClose:t}){const s=qs(),n=async l=>{try{await Ss(l),await Le(),t()}catch{}},r=async()=>{try{await $a(),await Le(),t()}catch{}},a=()=>{s("/editor?settings=project__create"),t()};return e.jsx(at,{isOpen:!0,onClose:()=>t(),showBackdrop:!0,bodyElements:e.jsxs("div",{className:pe.sections,children:[e.jsxs("div",{className:pe.about,children:[e.jsx("img",{src:"ontime-logo.png",alt:"ontime",className:pe.logo}),e.jsxs("div",{children:["Ontime v",Je]}),e.jsx(se,{href:gt,children:"Website"}),e.jsx(se,{href:Dt,children:"Read the docs"}),e.jsx(se,{href:es,children:"Discord server"})]}),e.jsxs("div",{className:pe.column,children:[e.jsxs("div",{className:pe.header,children:["Welcome to Ontime",e.jsx(Z,{"aria-label":"close welcome modal",variant:"subtle-white",onClick:()=>t(),children:e.jsx(_t,{})})]}),e.jsx(cr,{children:"Select project"}),e.jsx("div",{className:pe.tableContainer,children:e.jsxs("table",{className:pe.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"File Name"}),e.jsx("th",{children:"Last Used"})]})}),e.jsx(Zl,{loadProject:n,onClose:()=>t()})]})})]})]}),footerElements:e.jsxs("div",{className:pe.column,children:[e.jsxs("div",{className:pe.buttonRow,children:[e.jsx(g,{onClick:r,children:"Load demo project"}),e.jsx(ql,{onFinish:()=>t()}),e.jsx(g,{variant:"primary",onClick:a,children:"Create new..."})]}),e.jsxs(or,{className:pe.inline,children:[e.jsx(kn,{defaultChecked:!0,onCheckedChange:l=>Sn(l)}),"Show this modal on next startup"]})]})})}function to(){const t=$t(n=>n.showDialog),s=$t(n=>n.clearDialog);return t?e.jsx(eo,{onClose:s}):null}const so=j.lazy(()=>Ge(()=>import("./RundownExport-BPDLhvsM.js").then(t=>t.R),__vite__mapDeps([13,1,2,14,3,4,15,16,17,18,8,9,19,20,21,22,23,24,25,26,27,28,29,30,31,32,7,10,33,34,35,36,37,38]),import.meta.url)),no=j.lazy(()=>Ge(()=>import("./TimerControlExport-C_Jbwxog.js"),__vite__mapDeps([39,1,2,14,3,4,15,16,17,20,21,22,31,32,40,41,42,43]),import.meta.url)),ro=j.lazy(()=>Ge(()=>import("./MessageControlExport-VUkIayAJ.js"),__vite__mapDeps([44,1,2,14,3,4,15,16,17,29,30,31,32,41,42,45]),import.meta.url));function ao(){const{isOpen:t,setLocation:s,close:n}=Et(),[r,a]=Ce();Dn("Editor"),Cn(),j.useEffect(()=>{var c;((c=window.process)==null?void 0:c.type)==="renderer"&&window.ipcRenderer.on("user-request-shutdown",()=>{s("shutdown")})},[s]);const l=j.useCallback(()=>{t?n():s("settings")},[n,t,s]);return Us([["mod + ,",l]]),e.jsxs("div",{className:mt.mainContainer,"data-testid":"event-editor",children:[e.jsx(to,{}),e.jsx(_n,{isOpen:r,onClose:a.close}),e.jsxs(Wl,{children:[e.jsx(Z,{"aria-label":"Toggle navigation",variant:"subtle-white",size:"xlarge",onClick:a.open,children:e.jsx(zs,{})}),e.jsx(Z,{"aria-label":"Toggle settings",variant:"subtle-white",size:"xlarge",onClick:l,children:t?e.jsx(_t,{}):e.jsx(Bs,{})})]}),t?e.jsx(Vl,{}):e.jsxs("div",{id:"panels",className:mt.panelContainer,children:[e.jsxs("div",{className:mt.left,children:[e.jsx(no,{}),e.jsx(ro,{})]}),e.jsx(so,{})]})]})}function No(){return e.jsx(Ks,{permission:"editor",children:e.jsx(ao,{})})}export{No as default};
3
- //# sourceMappingURL=ProtectedEditor-KcsoZKKo.js.map