@rr0/ufoathome 0.202.0 → 0.203.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 (274) hide show
  1. package/dist-embed-interview/InterviewMessages_en-Ikx6GjEd.js +3 -0
  2. package/dist-embed-interview/InterviewMessages_es-DKWWyrnb.js +3 -0
  3. package/dist-embed-interview/InterviewMessages_fr-DT0gXAKD.js +3 -0
  4. package/dist-embed-interview/InterviewMessages_it-CF_9MYPt.js +3 -0
  5. package/dist-embed-interview/rr0-interview.mjs +1 -1
  6. package/dist-embed-scene/{AirshipEditor-BnRmKeVs.js → AirshipEditor-guE_ib3z.js} +1 -1
  7. package/dist-embed-scene/{AirshipFlight-C9DSPGwk.js → AirshipFlight-DzW0313e.js} +1 -1
  8. package/dist-embed-scene/{BalloonEditor-BehJs6H-.js → BalloonEditor-BIsCy_y4.js} +2 -2
  9. package/dist-embed-scene/{BalloonFlight-BYn4diw1.js → BalloonFlight-gunghgAq.js} +1 -1
  10. package/dist-embed-scene/{BirdEditor-dOp1sGsz.js → BirdEditor-CuLv4Ij5.js} +1 -1
  11. package/dist-embed-scene/{BirdFlock-CfJeXvWu.js → BirdFlock-L3dYU2K_.js} +1 -1
  12. package/dist-embed-scene/{DroneEditor-CBoR4fJ_.js → DroneEditor-BQWPhTyf.js} +1 -1
  13. package/dist-embed-scene/{DroneFlight-DSE1OXqh.js → DroneFlight-ERYah68l.js} +1 -1
  14. package/dist-embed-scene/{DroneParameters-D3EOg4oe.js → DroneParameters-CoWQympS.js} +1 -1
  15. package/dist-embed-scene/{LanternEditor-CbcA7K8y.js → LanternEditor-BpCyb79i.js} +1 -1
  16. package/dist-embed-scene/ModuleSession-Bh6KaOGK.js +3 -0
  17. package/dist-embed-scene/ModuleThree-DRsA8rtL.js +1 -0
  18. package/dist-embed-scene/SearchlightSystem-Ddws2hQY.js +1 -0
  19. package/dist-embed-scene/{SkyLantern-Dp_B40X0.js → SkyLantern-C3BSxHtq.js} +1 -1
  20. package/dist-embed-scene/rr0-scene.mjs +113 -92
  21. package/dist-embed-sighting/{CaseReportExport-CkWf0HNx.js → CaseReportExport--iqqhu1e.js} +1 -1
  22. package/dist-embed-sighting/HvsMessages_en-BiLhEAxJ.js +1 -0
  23. package/dist-embed-sighting/HvsMessages_es-Cbj_6eFs.js +1 -0
  24. package/dist-embed-sighting/HvsMessages_fr-DkvE2qm1.js +1 -0
  25. package/dist-embed-sighting/HvsMessages_it-BIJ87Uyb.js +1 -0
  26. package/dist-embed-sighting/InterviewMessages_en-Ikx6GjEd.js +3 -0
  27. package/dist-embed-sighting/InterviewMessages_es-DKWWyrnb.js +3 -0
  28. package/dist-embed-sighting/InterviewMessages_fr-DT0gXAKD.js +3 -0
  29. package/dist-embed-sighting/InterviewMessages_it-CF_9MYPt.js +3 -0
  30. package/dist-embed-sighting/ModuleSession-_kHZ7Tx3.js +3 -0
  31. package/dist-embed-sighting/{ModuleThree-whEZoXYF.js → ModuleThree-BLNSm2eY.js} +1 -1
  32. package/dist-embed-sighting/ReadingCheckTexts_en-C5qzU8K7.js +1 -0
  33. package/dist-embed-sighting/ReadingCheckTexts_es-DdhtmSew.js +1 -0
  34. package/dist-embed-sighting/ReadingCheckTexts_fr-COtovvqc.js +1 -0
  35. package/dist-embed-sighting/ReadingCheckTexts_it-Bz32XGh6.js +1 -0
  36. package/dist-embed-sighting/SearchlightSystem-PEMBDW1s.js +1 -0
  37. package/dist-embed-sighting/rr0-sighting.mjs +432 -366
  38. package/dist-embed-sighting-editor/{AdsbLolArchiveProvider-Bz1OjSjY.js → AdsbLolArchiveProvider-DNYpHE9t.js} +1 -1
  39. package/dist-embed-sighting-editor/{AirshipEditor-BlJXyxlr.js → AirshipEditor-B_TQEcNk.js} +1 -1
  40. package/dist-embed-sighting-editor/{AirshipFlight-Cx40Y8JT.js → AirshipFlight-zrtPXNvX.js} +1 -1
  41. package/dist-embed-sighting-editor/{Aurora-Ldk66p1A.js → Aurora-wHi_XgNK.js} +1 -1
  42. package/dist-embed-sighting-editor/{AuroraEditor-CGSomAFk.js → AuroraEditor-CHAo9LbG.js} +1 -1
  43. package/dist-embed-sighting-editor/{AuroraSimulation-vKcv2Hue.js → AuroraSimulation-CMoKbd0k.js} +2 -2
  44. package/dist-embed-sighting-editor/{BalloonEditor-CgO4LaWn.js → BalloonEditor-DOmOj25v.js} +1 -1
  45. package/dist-embed-sighting-editor/{BalloonFlight-hLr_4TFU.js → BalloonFlight-DkhpbdZV.js} +1 -1
  46. package/dist-embed-sighting-editor/{BeamEditor-B8qreA3j.js → BeamEditor-CwC6pRPq.js} +1 -1
  47. package/dist-embed-sighting-editor/{BeamSystem-D0hrju5J.js → BeamSystem-Zsq9zuJa.js} +1 -1
  48. package/dist-embed-sighting-editor/{BirdEditor-BNzrfSqX.js → BirdEditor-DslUOI4x.js} +1 -1
  49. package/dist-embed-sighting-editor/{BirdFlock-iSovVEZd.js → BirdFlock-BoXaV-S_.js} +1 -1
  50. package/dist-embed-sighting-editor/{CaseElement-DPlro-7S.js → CaseElement-DFnjs2AU.js} +6 -5
  51. package/dist-embed-sighting-editor/{CaseReportExport-C1g5C8hi.js → CaseReportExport-CX87uNr9.js} +1 -1
  52. package/dist-embed-sighting-editor/{ContrailSystem-D3tXAg2r.js → ContrailSystem-hUtlCEq-.js} +1 -1
  53. package/dist-embed-sighting-editor/{ControlPasses-BMEmppip.js → ControlPasses-C8qq_tSL.js} +1 -1
  54. package/dist-embed-sighting-editor/{DroneEditor-BFsArPKi.js → DroneEditor-M2V3FKbS.js} +1 -1
  55. package/dist-embed-sighting-editor/{DroneFlight-B96pVrY1.js → DroneFlight-C1bur42A.js} +1 -1
  56. package/dist-embed-sighting-editor/{DroneParameters-DW-enQUo.js → DroneParameters-DRfoxMx8.js} +1 -1
  57. package/dist-embed-sighting-editor/{Flightradar24Provider-CBGkjw03.js → Flightradar24Provider-BJDB9e9p.js} +1 -1
  58. package/dist-embed-sighting-editor/{GLTFLoader-2Zbfb3kh.js → GLTFLoader-CQrldtm5.js} +1 -1
  59. package/dist-embed-sighting-editor/{HeadlightSystem-CBmEcC9f.js → HeadlightSystem-BzXjwGDi.js} +1 -1
  60. package/dist-embed-sighting-editor/HvsMessages_en-BiLhEAxJ.js +1 -0
  61. package/dist-embed-sighting-editor/HvsMessages_es-Cbj_6eFs.js +1 -0
  62. package/dist-embed-sighting-editor/HvsMessages_fr-DkvE2qm1.js +1 -0
  63. package/dist-embed-sighting-editor/HvsMessages_it-BIJ87Uyb.js +1 -0
  64. package/dist-embed-sighting-editor/{HynekAssessor-uub2VxTi.js → HynekAssessor-Bpze0IeH.js} +1 -1
  65. package/dist-embed-sighting-editor/{InterviewEditorElement-_1fa2bG7.js → InterviewEditorElement-C6y-8Wze.js} +6 -6
  66. package/dist-embed-sighting-editor/InterviewMessages_en-Ikx6GjEd.js +3 -0
  67. package/dist-embed-sighting-editor/InterviewMessages_es-DKWWyrnb.js +3 -0
  68. package/dist-embed-sighting-editor/InterviewMessages_fr-DT0gXAKD.js +3 -0
  69. package/dist-embed-sighting-editor/InterviewMessages_it-CF_9MYPt.js +3 -0
  70. package/dist-embed-sighting-editor/{LanternEditor-CjQVFowY.js → LanternEditor-6fXL9oHW.js} +1 -1
  71. package/dist-embed-sighting-editor/{LaserBeam-BVc8Mvhr.js → LaserBeam-Cl4c8oJt.js} +1 -1
  72. package/dist-embed-sighting-editor/{LaunchEditor-Cz8Mzo4a.js → LaunchEditor-C9swLaSJ.js} +1 -1
  73. package/dist-embed-sighting-editor/{LaunchPlume-CvBhTPgN.js → LaunchPlume-CPBS4JLE.js} +1 -1
  74. package/dist-embed-sighting-editor/{LaunchSimulation-CkZIG-3P.js → LaunchSimulation-zjImyFHC.js} +1 -1
  75. package/dist-embed-sighting-editor/{ModelSource-B153oeTu.js → ModelSource-ZiTya13j.js} +1 -1
  76. package/dist-embed-sighting-editor/{ModelThumbnails-BUL_OLFv.js → ModelThumbnails-BKl0Wk33.js} +1 -1
  77. package/dist-embed-sighting-editor/{ModelViewer-BzBLcY9s.js → ModelViewer-ZZnOiYz4.js} +1 -1
  78. package/dist-embed-sighting-editor/{ModuleConformance-Cr6fM28A.js → ModuleConformance-CYQ-Mn8w.js} +2 -2
  79. package/dist-embed-sighting-editor/ModuleSession-BklqVucx.js +3 -0
  80. package/dist-embed-sighting-editor/ModuleThree-jNUgMjnf.js +1 -0
  81. package/dist-embed-sighting-editor/ModulesPanelElement-MEFltyZr.js +26 -0
  82. package/dist-embed-sighting-editor/ModulesPanelMessages_en-CXQhQMyu.js +1 -0
  83. package/dist-embed-sighting-editor/ModulesPanelMessages_es-Bj-cT3f4.js +1 -0
  84. package/dist-embed-sighting-editor/ModulesPanelMessages_fr-B-eaMXQz.js +1 -0
  85. package/dist-embed-sighting-editor/ModulesPanelMessages_it-C3fS8UFN.js +1 -0
  86. package/dist-embed-sighting-editor/{RailwaySystem-6bwbv8UB.js → RailwaySystem-Dn-v2OAb.js} +1 -1
  87. package/dist-embed-sighting-editor/ReadingCheckTexts_en-C5qzU8K7.js +1 -0
  88. package/dist-embed-sighting-editor/ReadingCheckTexts_es-DdhtmSew.js +1 -0
  89. package/dist-embed-sighting-editor/ReadingCheckTexts_fr-COtovvqc.js +1 -0
  90. package/dist-embed-sighting-editor/ReadingCheckTexts_it-Bz32XGh6.js +1 -0
  91. package/dist-embed-sighting-editor/{ReentryEditor-BWCK2g_s.js → ReentryEditor-DPt4At81.js} +1 -1
  92. package/dist-embed-sighting-editor/{ReentrySimulation-B09JXMu5.js → ReentrySimulation-DwaQrNN5.js} +1 -1
  93. package/dist-embed-sighting-editor/{ReferenceSystem-8QgwbbAG.js → ReferenceSystem-DlaF5KWz.js} +1 -1
  94. package/dist-embed-sighting-editor/{SearchlightEditor-BpwPOhJ6.js → SearchlightEditor-CdTMwgER.js} +1 -1
  95. package/dist-embed-sighting-editor/SearchlightSystem-jipCae7J.js +1 -0
  96. package/dist-embed-sighting-editor/SightingEditorMessages_en-BmqJK2u_.js +12 -0
  97. package/dist-embed-sighting-editor/SightingEditorMessages_es-avQMqPMq.js +12 -0
  98. package/dist-embed-sighting-editor/SightingEditorMessages_fr-ClEadK1E.js +12 -0
  99. package/dist-embed-sighting-editor/SightingEditorMessages_it-Co5behaA.js +12 -0
  100. package/dist-embed-sighting-editor/{SightingElement-BQdiez39.js → SightingElement-C6CT6DBZ.js} +2 -2
  101. package/dist-embed-sighting-editor/{SkyLantern-D6bru_e_.js → SkyLantern-CYhqKOnv.js} +1 -1
  102. package/dist-embed-sighting-editor/{TraceSystem-DZMUxSn-.js → TraceSystem-Bj0G3fL7.js} +1 -1
  103. package/dist-embed-sighting-editor/{WaterSystem-CB5jE7qB.js → WaterSystem-Cv4v7PXz.js} +2 -2
  104. package/{dist-embed-ufoathome/caseSchema-BEJTs2Ld.js → dist-embed-sighting-editor/caseSchema-Cukbjeex.js} +1 -1
  105. package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +521 -452
  106. package/dist-embed-sighting-editor/{trafficRuntime-Bu3my6S4.js → trafficRuntime-BdBceXei.js} +1 -1
  107. package/dist-embed-ufoathome/{AdsbLolArchiveProvider-KbJPyJ97.js → AdsbLolArchiveProvider-D169IKdZ.js} +1 -1
  108. package/dist-embed-ufoathome/{AirshipEditor-CBSrQM3J.js → AirshipEditor-EBfUtSiB.js} +1 -1
  109. package/dist-embed-ufoathome/{AirshipFlight-Dzpw8HRM.js → AirshipFlight-6yYGIRn8.js} +1 -1
  110. package/dist-embed-ufoathome/{Aurora-C_mCH4JM.js → Aurora-CP_Xi-9o.js} +1 -1
  111. package/dist-embed-ufoathome/{AuroraEditor-Dzvgh6e0.js → AuroraEditor-B_Rxo_6I.js} +1 -1
  112. package/dist-embed-ufoathome/{AuroraSimulation-BRUnHmlp.js → AuroraSimulation-KHkJyuus.js} +1 -1
  113. package/dist-embed-ufoathome/{BallesterGuaspAssessor-DurdUgbG.js → BallesterGuaspAssessor-58lmGHUw.js} +1 -1
  114. package/dist-embed-ufoathome/{BalloonEditor-dCIjTsIz.js → BalloonEditor-CAKXO8DQ.js} +2 -2
  115. package/dist-embed-ufoathome/{BalloonFlight-CztT6ddg.js → BalloonFlight-CvE7AHlm.js} +1 -1
  116. package/dist-embed-ufoathome/{BeamEditor-Ccvx7l7x.js → BeamEditor-BOsTgbHL.js} +1 -1
  117. package/dist-embed-ufoathome/{BeamSystem-CPM8m17q.js → BeamSystem-C7OL1VWr.js} +1 -1
  118. package/dist-embed-ufoathome/{BirdEditor-Dk3huwHa.js → BirdEditor-CBVGyUnK.js} +1 -1
  119. package/dist-embed-ufoathome/{BodyEditor-BG--NjnZ.js → BodyEditor-DZ9-YBfo.js} +1 -1
  120. package/dist-embed-ufoathome/{CaseEditorElement-0J_TCeiq.js → CaseEditorElement-BgT6HnpX.js} +73 -69
  121. package/dist-embed-ufoathome/CaseElement-DVXLO8mr.js +132 -0
  122. package/dist-embed-ufoathome/{CaseReportExport-DKrBXPgZ.js → CaseReportExport-Dui5KDc5.js} +3 -3
  123. package/dist-embed-ufoathome/ColumnResize-CO4e1m-q.js +208 -0
  124. package/dist-embed-ufoathome/ConsentMessages_en-DBKCeDAn.js +1 -0
  125. package/dist-embed-ufoathome/ConsentMessages_es-Dby74lUq.js +1 -0
  126. package/dist-embed-ufoathome/ConsentMessages_fr-FGSpqzMc.js +1 -0
  127. package/dist-embed-ufoathome/ConsentMessages_it-BJWfXH6I.js +1 -0
  128. package/dist-embed-ufoathome/{ControlPasses-CKvTCqTI.js → ControlPasses-CJ2jMdlf.js} +1 -1
  129. package/dist-embed-ufoathome/{CoverageAssessor-MeOMUjkZ.js → CoverageAssessor-CzhOt6fv.js} +1 -1
  130. package/dist-embed-ufoathome/{DroneEditor-D60uhSHO.js → DroneEditor-7X9CM_3H.js} +1 -1
  131. package/dist-embed-ufoathome/{Flightradar24Provider-DxTfswSh.js → Flightradar24Provider-TCNh_VXc.js} +1 -1
  132. package/dist-embed-ufoathome/{GLTFLoader-pi-JKaNa.js → GLTFLoader-BaIfBICM.js} +1 -1
  133. package/dist-embed-ufoathome/{GeoJsonExport-iyhoKOUU.js → GeoJsonExport-B5AFUVEM.js} +1 -1
  134. package/dist-embed-ufoathome/GeographicFigures-DrlbDt4f.js +1 -0
  135. package/dist-embed-ufoathome/HvsMessages_en-BiLhEAxJ.js +1 -0
  136. package/dist-embed-ufoathome/HvsMessages_es-Cbj_6eFs.js +1 -0
  137. package/dist-embed-ufoathome/HvsMessages_fr-DkvE2qm1.js +1 -0
  138. package/dist-embed-ufoathome/HvsMessages_it-BIJ87Uyb.js +1 -0
  139. package/dist-embed-ufoathome/{HynekAssessor-Bda6csgM.js → HynekAssessor-DaCcWwTH.js} +1 -1
  140. package/dist-embed-ufoathome/{InterviewEditorElement-BA060rqJ.js → InterviewEditorElement-o21YUvNz.js} +6 -6
  141. package/dist-embed-ufoathome/{InterviewElement-DvqsCA3I.js → InterviewElement-K_oIXneA.js} +2 -2
  142. package/dist-embed-ufoathome/InterviewMessages_en-Ikx6GjEd.js +3 -0
  143. package/dist-embed-ufoathome/InterviewMessages_es-DKWWyrnb.js +3 -0
  144. package/dist-embed-ufoathome/InterviewMessages_fr-DT0gXAKD.js +3 -0
  145. package/dist-embed-ufoathome/InterviewMessages_it-CF_9MYPt.js +3 -0
  146. package/dist-embed-ufoathome/{KmlExport-DEPgRRWe.js → KmlExport-BfiqE1s2.js} +1 -1
  147. package/dist-embed-ufoathome/{LanternEditor-BapUZdog.js → LanternEditor-CepeoImr.js} +1 -1
  148. package/dist-embed-ufoathome/{LaserBeam--dquPX_h.js → LaserBeam-IRXmv6wc.js} +1 -1
  149. package/dist-embed-ufoathome/{LaunchEditor-D3P0GkLr.js → LaunchEditor-C4hq0VUw.js} +1 -1
  150. package/dist-embed-ufoathome/{LaunchPlume-w4l4TR4A.js → LaunchPlume-CujlF3wZ.js} +1 -1
  151. package/dist-embed-ufoathome/{LaunchSimulation-BpZd-Nov.js → LaunchSimulation-58_ZZy8q.js} +1 -1
  152. package/dist-embed-ufoathome/{ModelSource-Csnm3RH_.js → ModelSource-Bz25TN6e.js} +1 -1
  153. package/dist-embed-ufoathome/{ModelThumbnails-Cnt2GxTb.js → ModelThumbnails-CcYlw6gA.js} +1 -1
  154. package/dist-embed-ufoathome/{ModelViewer-DOfAkPgK.js → ModelViewer-CD90RTYi.js} +1 -1
  155. package/dist-embed-ufoathome/ModuleSession-Dac4fD0X.js +3 -0
  156. package/dist-embed-ufoathome/ModulesPanelElement-DZxFsuuG.js +18 -0
  157. package/dist-embed-ufoathome/ModulesPanelMessages_en-Dir0ADQe.js +1 -0
  158. package/dist-embed-ufoathome/ModulesPanelMessages_es-B_ITNG5N.js +1 -0
  159. package/dist-embed-ufoathome/ModulesPanelMessages_fr-DbKLtD8s.js +1 -0
  160. package/dist-embed-ufoathome/ModulesPanelMessages_it-CE0q7D2c.js +1 -0
  161. package/dist-embed-ufoathome/NearestApproach-DsszB5Rd.js +1 -0
  162. package/dist-embed-ufoathome/{PoherAssessor-4zSdFnFp.js → PoherAssessor-BkCJ1UTQ.js} +1 -1
  163. package/dist-embed-ufoathome/QuestionnaireFeed-DmyYcwwf.js +1 -0
  164. package/dist-embed-ufoathome/QuestionnaireForm-vT3C3qXt.js +1 -0
  165. package/dist-embed-ufoathome/QuestionnaireImport-BlTDOHWj.js +5 -0
  166. package/dist-embed-ufoathome/ReadingCheckTexts_en-C5qzU8K7.js +1 -0
  167. package/dist-embed-ufoathome/ReadingCheckTexts_es-DdhtmSew.js +1 -0
  168. package/dist-embed-ufoathome/ReadingCheckTexts_fr-COtovvqc.js +1 -0
  169. package/dist-embed-ufoathome/ReadingCheckTexts_it-Bz32XGh6.js +1 -0
  170. package/dist-embed-ufoathome/{ReentryEditor-DEi9nT0z.js → ReentryEditor-BjyUUZGU.js} +1 -1
  171. package/dist-embed-ufoathome/{ReentrySimulation-CSO1vgro.js → ReentrySimulation-5VI9Dla4.js} +1 -1
  172. package/dist-embed-ufoathome/{ReferenceSystem--tiMGm4e.js → ReferenceSystem-C0ZXvatV.js} +1 -1
  173. package/dist-embed-ufoathome/ScenarioReadings-CBWjF8TY.js +1 -0
  174. package/dist-embed-ufoathome/ScenarioSweep-MaryBOLs.js +1 -0
  175. package/dist-embed-ufoathome/{SearchlightEditor--1uL8bTa.js → SearchlightEditor-DPU1PgfT.js} +1 -1
  176. package/dist-embed-ufoathome/SearchlightSystem-m0a11CEu.js +1 -0
  177. package/dist-embed-ufoathome/{ShareDialogElement-Dlfy9NCE.js → ShareDialogElement-DqCoQwtn.js} +97 -76
  178. package/dist-embed-ufoathome/{Sighting-B7bsiTIQ.js → Sighting-D-_IYi9n.js} +1 -1
  179. package/dist-embed-ufoathome/SightingEditorMessages_en-BmqJK2u_.js +12 -0
  180. package/dist-embed-ufoathome/SightingEditorMessages_es-avQMqPMq.js +12 -0
  181. package/dist-embed-ufoathome/SightingEditorMessages_fr-ClEadK1E.js +12 -0
  182. package/dist-embed-ufoathome/SightingEditorMessages_it-Co5behaA.js +12 -0
  183. package/dist-embed-ufoathome/{SightingElement-BJSNmFM6.js → SightingElement-CUrYpWRD.js} +2 -2
  184. package/dist-embed-ufoathome/{TraceSystem-Cq2TgP-u.js → TraceSystem-BLumvnJD.js} +1 -1
  185. package/dist-embed-ufoathome/UfoAtHomeMessages_en-ByVu39KF.js +1 -0
  186. package/dist-embed-ufoathome/UfoAtHomeMessages_es-D9bLboxq.js +1 -0
  187. package/dist-embed-ufoathome/UfoAtHomeMessages_fr-nTqRf0ZK.js +1 -0
  188. package/dist-embed-ufoathome/UfoAtHomeMessages_it-4cZC5-y5.js +1 -0
  189. package/dist-embed-ufoathome/{VideoButton-MRJlVNm_.js → VideoButton-hYfTEunC.js} +1 -1
  190. package/{dist-embed-sighting-editor/caseSchema-BEJTs2Ld.js → dist-embed-ufoathome/caseSchema-Cukbjeex.js} +1 -1
  191. package/dist-embed-ufoathome/rr0-ufoathome.mjs +35 -17
  192. package/dist-embed-ufoathome/{surroundingsSources--qffL_nJ.js → surroundingsSources-BWHnZ_qg.js} +1 -1
  193. package/dist-embed-ufoathome/{trafficRuntime-CTCGr90P.js → trafficRuntime-Xpncp71U.js} +2 -2
  194. package/package.json +1 -1
  195. package/dist-embed-interview/InterviewMessages_en-BrnxG2rl.js +0 -3
  196. package/dist-embed-interview/InterviewMessages_es-Dxfjqrte.js +0 -3
  197. package/dist-embed-interview/InterviewMessages_fr-DIA-1qu8.js +0 -3
  198. package/dist-embed-interview/InterviewMessages_it-CYBEIKX-.js +0 -3
  199. package/dist-embed-scene/ModuleSession-XnOI5Mcr.js +0 -3
  200. package/dist-embed-scene/ModuleThree-BTQgimAj.js +0 -1
  201. package/dist-embed-scene/SearchlightSystem-CX1_nBkz.js +0 -1
  202. package/dist-embed-sighting/InterviewMessages_en-BrnxG2rl.js +0 -3
  203. package/dist-embed-sighting/InterviewMessages_es-Dxfjqrte.js +0 -3
  204. package/dist-embed-sighting/InterviewMessages_fr-DIA-1qu8.js +0 -3
  205. package/dist-embed-sighting/InterviewMessages_it-CYBEIKX-.js +0 -3
  206. package/dist-embed-sighting/ModuleSession-ChJsGuTn.js +0 -3
  207. package/dist-embed-sighting/ReadingCheckTexts_en-eq6teExJ.js +0 -1
  208. package/dist-embed-sighting/ReadingCheckTexts_es-CR_JJZMV.js +0 -1
  209. package/dist-embed-sighting/ReadingCheckTexts_fr-pcDleIvY.js +0 -1
  210. package/dist-embed-sighting/ReadingCheckTexts_it-MFKeoXnq.js +0 -1
  211. package/dist-embed-sighting/SearchlightSystem-B2-MzG4x.js +0 -1
  212. package/dist-embed-sighting-editor/InterviewMessages_en-BrnxG2rl.js +0 -3
  213. package/dist-embed-sighting-editor/InterviewMessages_es-Dxfjqrte.js +0 -3
  214. package/dist-embed-sighting-editor/InterviewMessages_fr-DIA-1qu8.js +0 -3
  215. package/dist-embed-sighting-editor/InterviewMessages_it-CYBEIKX-.js +0 -3
  216. package/dist-embed-sighting-editor/ModuleSession-WA6lqfV6.js +0 -3
  217. package/dist-embed-sighting-editor/ModuleThree-CB_EjTOI.js +0 -1
  218. package/dist-embed-sighting-editor/ModulesPanelElement-BsRg3mzl.js +0 -15
  219. package/dist-embed-sighting-editor/ModulesPanelMessages_en-DuwrY3Pm.js +0 -1
  220. package/dist-embed-sighting-editor/ModulesPanelMessages_es-Bq5X-XuT.js +0 -1
  221. package/dist-embed-sighting-editor/ModulesPanelMessages_fr-B8cSDc6o.js +0 -1
  222. package/dist-embed-sighting-editor/ModulesPanelMessages_it-BdC626aJ.js +0 -1
  223. package/dist-embed-sighting-editor/ReadingCheckTexts_en-eq6teExJ.js +0 -1
  224. package/dist-embed-sighting-editor/ReadingCheckTexts_es-CR_JJZMV.js +0 -1
  225. package/dist-embed-sighting-editor/ReadingCheckTexts_fr-pcDleIvY.js +0 -1
  226. package/dist-embed-sighting-editor/ReadingCheckTexts_it-MFKeoXnq.js +0 -1
  227. package/dist-embed-sighting-editor/SearchlightSystem-CEG52QDx.js +0 -1
  228. package/dist-embed-sighting-editor/SightingEditorMessages_en-k7_ua2OM.js +0 -12
  229. package/dist-embed-sighting-editor/SightingEditorMessages_es-Drqbbr5_.js +0 -12
  230. package/dist-embed-sighting-editor/SightingEditorMessages_fr-B_K5hsuV.js +0 -12
  231. package/dist-embed-sighting-editor/SightingEditorMessages_it-QCLg1d7x.js +0 -12
  232. package/dist-embed-sighting-editor/angular-size-CxoysZle.png +0 -0
  233. package/dist-embed-sighting-editor/azimuth-CvjiPmz0.png +0 -0
  234. package/dist-embed-sighting-editor/elevation-DPr5S6Jt.png +0 -0
  235. package/dist-embed-sighting-editor/geipan-qt-2025-B_RUiH8B.js +0 -7
  236. package/dist-embed-sighting-editor/protractor-DyE30B87.png +0 -0
  237. package/dist-embed-ufoathome/CaseElement-CRXPyMMR.js +0 -131
  238. package/dist-embed-ufoathome/ColumnResize-DV-byvDt.js +0 -164
  239. package/dist-embed-ufoathome/GeographicFigures-DBmuFlvH.js +0 -1
  240. package/dist-embed-ufoathome/InterviewAttachments-BP6Prvdu.js +0 -1
  241. package/dist-embed-ufoathome/InterviewMessages_en-BrnxG2rl.js +0 -3
  242. package/dist-embed-ufoathome/InterviewMessages_es-Dxfjqrte.js +0 -3
  243. package/dist-embed-ufoathome/InterviewMessages_fr-DIA-1qu8.js +0 -3
  244. package/dist-embed-ufoathome/InterviewMessages_it-CYBEIKX-.js +0 -3
  245. package/dist-embed-ufoathome/ModuleSession-BKDWGSEo.js +0 -3
  246. package/dist-embed-ufoathome/ModulesPanelElement-DH1oroWm.js +0 -15
  247. package/dist-embed-ufoathome/ModulesPanelMessages_en-DuwrY3Pm.js +0 -1
  248. package/dist-embed-ufoathome/ModulesPanelMessages_es-Bq5X-XuT.js +0 -1
  249. package/dist-embed-ufoathome/ModulesPanelMessages_fr-B8cSDc6o.js +0 -1
  250. package/dist-embed-ufoathome/ModulesPanelMessages_it-BdC626aJ.js +0 -1
  251. package/dist-embed-ufoathome/NearestApproach-DJ98M81-.js +0 -1
  252. package/dist-embed-ufoathome/QuestionnaireFeed-W69udpmT.js +0 -1
  253. package/dist-embed-ufoathome/QuestionnaireForm-U78nFPn5.js +0 -1
  254. package/dist-embed-ufoathome/QuestionnaireImport-Q5uHxQwU.js +0 -5
  255. package/dist-embed-ufoathome/ReadingCheckTexts_en-eq6teExJ.js +0 -1
  256. package/dist-embed-ufoathome/ReadingCheckTexts_es-CR_JJZMV.js +0 -1
  257. package/dist-embed-ufoathome/ReadingCheckTexts_fr-pcDleIvY.js +0 -1
  258. package/dist-embed-ufoathome/ReadingCheckTexts_it-MFKeoXnq.js +0 -1
  259. package/dist-embed-ufoathome/ScenarioReadings-Dzdgopl3.js +0 -1
  260. package/dist-embed-ufoathome/ScenarioSweep-CMcleprC.js +0 -1
  261. package/dist-embed-ufoathome/SearchlightSystem-7bntVtp_.js +0 -1
  262. package/dist-embed-ufoathome/SightingEditorMessages_en-k7_ua2OM.js +0 -12
  263. package/dist-embed-ufoathome/SightingEditorMessages_es-Drqbbr5_.js +0 -12
  264. package/dist-embed-ufoathome/SightingEditorMessages_fr-B_K5hsuV.js +0 -12
  265. package/dist-embed-ufoathome/SightingEditorMessages_it-QCLg1d7x.js +0 -12
  266. package/dist-embed-ufoathome/UfoAtHomeMessages_en-BK2qJyZN.js +0 -1
  267. package/dist-embed-ufoathome/UfoAtHomeMessages_es-B1-NDCau.js +0 -1
  268. package/dist-embed-ufoathome/UfoAtHomeMessages_fr-BTG047qo.js +0 -1
  269. package/dist-embed-ufoathome/UfoAtHomeMessages_it-Ryxv4HNU.js +0 -1
  270. package/dist-embed-ufoathome/angular-size-CxoysZle.png +0 -0
  271. package/dist-embed-ufoathome/azimuth-CvjiPmz0.png +0 -0
  272. package/dist-embed-ufoathome/elevation-DPr5S6Jt.png +0 -0
  273. package/dist-embed-ufoathome/geipan-qt-2025-B_RUiH8B.js +0 -7
  274. package/dist-embed-ufoathome/protractor-DyE30B87.png +0 -0
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./SkyLantern-DJT_Ibzh.js","./Obstacles-v9SkfBD7.js","./LanternEditor-BapUZdog.js","./SaidPosition-OJEYhVKN.js","./GeoProjection-DvqDbRIx.js","./SkyEventEditorStyle-CvY_AhbI.js","./Sighting-B7bsiTIQ.js","./VisualAids-DI-hEL46.js","./ParameterForm-XbqxCLRn.js","./BirdFlock-ByBkJV35.js","./BirdEditor-Dk3huwHa.js","./TimelineTracks-Daaqw9ly.js","./DroneFlight-CGNIh9XS.js","./Decor-Dn-cvniW.js","./DroneEditor-D60uhSHO.js","./DroneParameters-CfTAaLCT.js","./BalloonEditor-dCIjTsIz.js","./BalloonFlight-CztT6ddg.js","./AirshipFlight-Dzpw8HRM.js","./AirshipEditor-CBSrQM3J.js","./CaseElement-CRXPyMMR.js","./ColumnResize-DV-byvDt.js","./ShareDialogElement-Dlfy9NCE.js","./three.module-CbaHqYFq.js","./RecordingIssue-BlWT8Xsu.js","./xyzImageryRaster-Dhxs0B26.js","./SightingElement-BJSNmFM6.js","./CaseEditorElement-0J_TCeiq.js","./InterviewAttachments-BP6Prvdu.js","./ReentryArchive-CeXHrU7L.js","./ReferenceTimeline-2kBldQeG.js","./upperAirSources-BU0pD84c.js","./Account-C4jhsVtN.js","./UfoMessages_en-D5OYWJ3K.js","./SightingEditorMessages_en-k7_ua2OM.js","./SightingLabels_en-oIpytoq_.js","./SightingEditorMessages_fr-B_K5hsuV.js","./SightingLabels_fr-D69zENbW.js","./SightingEditorMessages_es-Drqbbr5_.js","./SightingLabels_es-DUh1CTXl.js","./SightingEditorMessages_it-QCLg1d7x.js","./SightingLabels_it-COLZ2Qth.js","./SightingMessages_en-CzICxNU3.js","./SightingMessages_fr-nopOVDa1.js","./SightingMessages_es-CiVFZlgA.js","./SightingMessages_it-Cu0nnPts.js","./SceneNames_en-7OZ7peGc.js","./SceneNames_fr-qzw0QzD0.js","./SceneNames_es-P5-Mavdi.js","./SceneNames_it-Sqf8JFOd.js","./ModuleSession-BKDWGSEo.js"])))=>i.map(i=>d[i]);
2
- const dn="modulepreload",ln=function(n,t){return new URL(n,t).href},je={},d=function(t,e,r){let s=Promise.resolve();if(e&&e.length>0){let i=function(m){return Promise.all(m.map(p=>Promise.resolve(p).then(w=>({status:"fulfilled",value:w}),w=>({status:"rejected",reason:w}))))};const a=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),c=l?.nonce||l?.getAttribute("nonce");s=i(e.map(m=>{if(m=ln(m,r),m in je)return;je[m]=!0;const p=m.endsWith(".css"),w=p?'[rel="stylesheet"]':"";if(!!r)for(let S=a.length-1;S>=0;S--){const D=a[S];if(D.href===m&&(!p||D.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${w}`))return;const _=document.createElement("link");if(_.rel=p?"stylesheet":dn,p||(_.as="script"),_.crossOrigin="",_.href=m,c&&_.setAttribute("nonce",c),document.head.appendChild(_),p)return new Promise((S,D)=>{_.addEventListener("load",S),_.addEventListener("error",()=>D(new Error(`Unable to preload CSS for ${m}`)))})}))}function o(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return s.then(i=>{for(const a of i||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})},mn="rr0-read",hn="rr0-edit",ge="in-place",pn="rr0-mode";class Hs{static ask(t,e,r){const s=new CustomEvent(e,{detail:r,bubbles:!0,composed:!0,cancelable:!0});return t.dispatchEvent(s),s.defaultPrevented}}class j{constructor(t){this.entries=t}static free(t){return t?.basis==="assumed"||t?.basis==="fitted"}static empty(){return new j(new Map)}get size(){return this.entries.size}at(t){return this.entries.get(t)}paths(){return[...this.entries.keys()]}sourced(){return[...this.entries].filter(([,t])=>t.source!==void 0).map(([t,e])=>({path:t,basis:e.basis,source:e.source}))}interviewsCited(){const t=[];for(const{source:e}of this.sourced()){const r=e.said?.interview;r!==void 0&&!t.includes(r)&&t.push(r)}return t}pathsFromInterview(t){return this.sourced().filter(({source:e})=>e.said!==void 0&&e.said.interview===t).map(({path:e})=>e)}set(t,e){e.basis==="stated"&&e.rationale===void 0&&e.how===void 0&&e.range===void 0&&e.source===void 0?this.entries.delete(t):this.entries.set(t,e)}clear(t){for(const e of this.entries.keys())(e===t||e.startsWith(`${t}.`))&&this.entries.delete(e)}static strip(t){const e=new j(new Map);return{recording:j.stripValue(t,[],e),provenance:e}}static restore(t,e){if(e.size===0)return t;const r={...t},s=new Set([r]);for(const o of e.paths()){const i=e.at(o),a=o.split("."),l=j.writableHolderOf(r,a,s);if(!l)continue;const c=a[a.length-1],m=l[c];m!==void 0&&(i.of!==void 0&&JSON.stringify(i.of)!==JSON.stringify(m)||(l[c]={value:m,...i.basis==="stated"?{}:{basis:i.basis},...i.rationale===void 0?{}:{rationale:i.rationale},...i.how===void 0?{}:{how:i.how},...i.range===void 0?{}:{range:i.range},...i.source===void 0?{}:{source:i.source}}))}return r}static isWrapper(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&"value"in t}static stripValue(t,e,r){return j.isWrapper(t)?(r.set(e.join("."),{basis:t.basis??"stated",...t.rationale===void 0?{}:{rationale:t.rationale},...t.how===void 0?{}:{how:t.how},...t.range===void 0?{}:{range:t.range},...t.source===void 0?{}:{source:t.source},of:t.value}),j.stripValue(t.value,e,r)):Array.isArray(t)?t.map((s,o)=>j.stripValue(s,[...e,String(o)],r)):typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t).map(([s,o])=>[s,j.stripValue(o,[...e,s],r)])):t}static writableHolderOf(t,e,r){let s=t;for(const o of e.slice(0,-1)){const i=s[o];if(typeof i!="object"||i===null)return;if(r.has(i)){s=i;continue}const a=Array.isArray(i)?[...i]:{...i};r.add(a),s[o]=a,s=a}return s}}class fn extends Error{constructor(t,e,r){super(typeof e=="number"&&Number.isInteger(e)&&e>=1?`This ${t} file is in version ${e} of its format; this UFO@home reads version ${r}. Read it with the UFO@home that reads its version.`:`This ${t} file states ${JSON.stringify(e)} as its format version, which is not a version.`),this.format=t,this.found=e,this.supported=r,this.name="FormatVersionError"}said(t){return t.replace("{found}",typeof this.found=="number"?String(this.found):JSON.stringify(this.found)).replace("{supported}",String(this.supported))}}class ct{static CURRENT={sighting:4,case:1,interview:1};static SCHEMA_BASE="https://ufoathome.org/schema";static schemaUrl(t,e=ct.CURRENT[t]){return`${ct.SCHEMA_BASE}/${e}/${t}.schema.json`}static of(t){if(typeof t!="object"||t===null)return 1;const e=t.version;return e===void 0?1:typeof e=="object"&&e!==null&&"value"in e?e.value:e}static recording(t){return ct.check(t,"sighting")}static check(t,e){const r=ct.of(t),s=ct.CURRENT[e];if(typeof r!="number"||!Number.isInteger(r)||r!==s)throw new fn(e,r,s);return t}}class N{static built=new WeakMap;static computers=new WeakMap;static loading=new WeakMap;static loaded(t,e){return e.every(r=>N.itemsOf(t,r.key).length===0||N.computers.has(r))}static load(t,e){return Promise.all(e.filter(r=>N.itemsOf(t,r.key).length>0&&!N.computers.has(r)).map(r=>{let s=N.loading.get(r);return s||(s=r.compute().then(o=>{N.computers.set(r,o)}),s.catch(()=>N.loading.delete(r)),N.loading.set(r,s)),s.catch(()=>{})})).then(()=>{})}static of(t){let e=N.built.get(t);return e||(e=t.create(),N.built.set(t,e)),e}static itemsOf(t,e){const r=t?.[e];return Array.isArray(r)?r:[]}static computes(t,e){return e.some(r=>N.itemsOf(t,r.key).length>0)}static expand(t,e,r){return N.expandWithKinds(t,e,r).interpretation}static expandWithKinds(t,e,r){const s=new Map,o=new Map;if(!t||!N.computes(t,e))return{interpretation:t,kindOf:s,phenomenonOf:o};const i=e.flatMap(a=>N.itemsOf(t,a.key).flatMap(l=>{const c=N.computers.get(a);if(!c)return[];const m=c(l,r),p=a.phenomenon?.(l);for(const w of m)s.set(w.id,a),p&&o.set(w.id,p);return m}));return{interpretation:{...t,bodies:[...t.bodies,...i]},kindOf:s,phenomenonOf:o}}static computedPart(t,e){const r={};for(const s of e){const o=N.itemsOf(t,s.key);o.length>0&&(r[s.key]=[...o])}return r}static saysNothing(t,e){return t.bodies.length===0&&t.title===void 0&&t.smoke===void 0&&e.every(r=>t[r.key]===void 0)}}const Ls=Object.freeze(Object.defineProperty({__proto__:null,InterpretationKinds:N},Symbol.toStringTag,{value:"Module"}));class Wr extends Error{constructor(t,e,r,s){super(`Module "${t}" gives "${r}" at ${e}, which module "${s}" already gives`),this.moduleId=t,this.point=e,this.sourceId=r,this.ownerId=s,this.name="ModuleConflictError"}}class gn{constructor(t){this.id=t}sources=[];owners=new Map;ownerOf(t){return this.owners.get(t)}conflict(t,e){for(const r of e){const s=this.owners.get(r.id);if(s!==void 0&&s!==t)return{sourceId:r.id,ownerId:s}}}provide(t,e){const r=this.conflict(t,e);if(r)throw new Wr(t,this.id,r.sourceId,r.ownerId);this.withdraw(t);const s=t===v.BUILT_IN?this.sources.findIndex(o=>this.owners.get(o.id)!==v.BUILT_IN):-1;s<0?this.sources.push(...e):this.sources.splice(s,0,...e);for(const o of e)this.owners.set(o.id,t);return this.sources}withdraw(t){for(let e=this.sources.length-1;e>=0;e--){const r=this.sources[e].id;this.owners.get(r)===t&&(this.sources.splice(e,1),this.owners.delete(r))}}}class v{static BUILT_IN="ufoathome";static changes=new EventTarget;static points=new Map;static modules=new Map;static point(t){let e=v.points.get(t);return e||(e=new gn(t),v.points.set(t,e)),e}static install(t){if(t.id===v.BUILT_IN)throw new Error(`"${v.BUILT_IN}" is the id of the built-in module`);const e=v.contributionsOf(t);for(const[o,i]of e){const a=v.point(o).conflict(t.id,i);if(a)throw new Wr(t.id,o,a.sourceId,a.ownerId)}const r=new Set(e.map(([o])=>o)),s=v.modules.get(t.id);if(s)for(const[o]of v.contributionsOf(s))r.add(o);for(const o of r)v.point(o).withdraw(t.id);for(const[o,i]of e)v.point(o).provide(t.id,i);v.modules.set(t.id,t);for(const o of r)v.announce(o)}static uninstall(t){const e=v.modules.get(t);if(e){v.modules.delete(t);for(const[r]of v.contributionsOf(e))v.point(r).withdraw(t),v.announce(r)}}static installed(){return[...v.modules.values()]}static contributionsOf(t){return Object.entries(t.contributes).filter(e=>Array.isArray(e[1])&&e[1].length>0)}static announce(t){v.changes.dispatchEvent(new CustomEvent("change",{detail:t}))}}const wn=["en","fr","es","it"];class T{static catalog(t){const e=new Map;return{load(r){const s=T.languageOf(r);let o=e.get(s);return o||(o=t[s](),e.set(s,o),o.catch(()=>e.delete(s))),o}}}static none(){return new Proxy({},{get:()=>""})}static blank(){const t=new Proxy(()=>t,{get:(e,r)=>r===Symbol.toPrimitive?()=>"":r===Symbol.iterator?function*(){}:r==="toString"||r==="valueOf"?()=>"":r==="then"?void 0:t,apply:()=>t,has:()=>!1,ownKeys:()=>[],getOwnPropertyDescriptor:()=>{}});return t}static languageOf(t){const e=t.toLowerCase().split("-")[0];return wn.includes(e)?e:"en"}}const bn=T.catalog({en:()=>d(()=>import("./FlareKindMessages_en-j3CY_TxX.js"),[],import.meta.url).then(n=>n.flareKindMessages_en),fr:()=>d(()=>import("./FlareKindMessages_fr-B2MezoN2.js"),[],import.meta.url).then(n=>n.flareKindMessages_fr),es:()=>d(()=>import("./FlareKindMessages_es-CZgrFIOO.js"),[],import.meta.url).then(n=>n.flareKindMessages_es),it:()=>d(()=>import("./FlareKindMessages_it-CmZmb3RP.js"),[],import.meta.url).then(n=>n.flareKindMessages_it)});class J{constructor(t={}){this.options=t,this.fetchImpl=t.fetchImpl??fetch.bind(globalThis),this.wait=t.wait??(e=>new Promise(r=>setTimeout(r,e)))}static URL="https://historical-forecast-api.open-meteo.com/v1/forecast";static CREDIT="Open-Meteo historical forecast";static LEVELS=[850,700,600,500,400,300];static RETRIES=6;static RETRY_MS=2e3;days=new Map;fetchImpl;wait;async profile(t,e,r){const o=new Date(Math.floor(r.getTime()/36e5)*36e5),i=(r.getTime()-o.getTime())/36e5,a=await this.hourly(t,e,o);if(i<1e-6)return a;const l=await this.hourly(t,e,new Date(o.getTime()+36e5));return a.levels.length!==l.levels.length?i<.5?a:l:{...a,hour:r.toISOString().slice(0,16),levels:a.levels.map((c,m)=>{const[p,w]=K.vector(c.wind),[b,_]=K.vector(l.levels[m].wind);return{aboveGroundM:c.aboveGroundM+i*(l.levels[m].aboveGroundM-c.aboveGroundM),wind:K.fromVector(p+i*(b-p),w+i*(_-w))}})}}async hourly(t,e,r){const s=r.toISOString().slice(0,13)+":00",o=s.slice(0,10),i=`${t.toFixed(4)},${e.toFixed(4)},${o}`;let a=this.days.get(i);return a||(a=this.day(t,e,o,i),a.catch(()=>this.days.delete(i)),this.days.set(i,a)),J.profileOf(await a,s)}static profileOf(t,e){const r=t.hourly,s=r.time.indexOf(e);if(s<0)throw new Error(`No wind for ${e} in the archive's answer`);const o=c=>(c+180)%360,i=[],a=r.wind_speed_10m?.[s],l=r.wind_direction_10m?.[s];typeof a=="number"&&typeof l=="number"&&i.push({aboveGroundM:10,wind:{towardDeg:o(l),speedMS:a}});for(const c of J.LEVELS){const m=r[`geopotential_height_${c}hPa`]?.[s],p=r[`wind_speed_${c}hPa`]?.[s],w=r[`wind_direction_${c}hPa`]?.[s];if(typeof m!="number"||typeof p!="number"||typeof w!="number")continue;const b=m-t.elevation;b<=(i[i.length-1]?.aboveGroundM??0)||i.push({aboveGroundM:b,wind:{towardDeg:o(w),speedMS:p}})}if(i.length===0)throw new Error(`No wind for ${e} in the archive's answer`);return{lat:t.latitude,lng:t.longitude,elevationM:t.elevation,hour:e,levels:i,credit:J.CREDIT}}async day(t,e,r,s){const o=await this.options.cache?.get(s);if(o)return JSON.parse(o);const i=["wind_speed_10m","wind_direction_10m",...J.LEVELS.flatMap(c=>[`wind_speed_${c}hPa`,`wind_direction_${c}hPa`,`geopotential_height_${c}hPa`])],a=new URLSearchParams({latitude:String(t),longitude:String(e),start_date:r,end_date:r,hourly:i.join(","),wind_speed_unit:"ms",timezone:"GMT"}),l=`${this.options.url??J.URL}?${a}`;for(let c=0;;c++){const m=await this.fetchImpl(l);if(m.ok){const p=await m.text();return await this.options.cache?.set(s,p),JSON.parse(p)}if((m.status===429||m.status>=500)&&c<J.RETRIES){await this.wait(J.RETRY_MS*2**c);continue}throw new Error(`The wind archive answered ${m.status} for ${s}`)}}}class K{static at(t,e){const r=t.levels;if(e<=r[0].aboveGroundM)return{...r[0].wind};for(let s=1;s<r.length;s++){const o=r[s-1],i=r[s];if(e<=i.aboveGroundM){const a=(e-o.aboveGroundM)/(i.aboveGroundM-o.aboveGroundM),[l,c]=K.vector(o.wind),[m,p]=K.vector(i.wind);return K.fromVector(l+a*(m-l),c+a*(p-c))}}return{...r[r.length-1].wind}}static vector(t){const e=t.towardDeg*Math.PI/180;return[t.speedMS*Math.sin(e),t.speedMS*Math.cos(e)]}static fromVector(t,e){return{towardDeg:(Math.atan2(t,e)*180/Math.PI+360)%360,speedMS:Math.hypot(t,e)}}static rounded(t){return{towardDeg:Math.round(t.towardDeg)%360,speedMS:Math.round(t.speedMS*100)/100}}}const Ks=Object.freeze(Object.defineProperty({__proto__:null,OpenMeteoWindProfiles:J,Winds:K},Symbol.toStringTag,{value:"Module"})),En=K.rounded,He={key:"flares",messages:bn,phenomenon:()=>"DecoyFlare",inWind:(n,t)=>({...n,wind:En(t.at(n.aircraft.altitudeM))}),compute:()=>d(async()=>{const{DecoyFlare:n}=await import("./DecoyFlare-DUt1_LcW.js");return{DecoyFlare:n}},[],import.meta.url).then(({DecoyFlare:n})=>t=>n.bodiesOf(t))},yn=T.catalog({en:()=>d(()=>import("./LanternKindMessages_en-CQXdJ-k6.js"),[],import.meta.url).then(n=>n.lanternKindMessages_en),fr:()=>d(()=>import("./LanternKindMessages_fr-D7tQa_tQ.js"),[],import.meta.url).then(n=>n.lanternKindMessages_fr),es:()=>d(()=>import("./LanternKindMessages_es-BOO6kPjs.js"),[],import.meta.url).then(n=>n.lanternKindMessages_es),it:()=>d(()=>import("./LanternKindMessages_it-B8J-29Mj.js"),[],import.meta.url).then(n=>n.lanternKindMessages_it)}),Le=K.rounded,Ke={key:"lanterns",messages:yn,phenomenon:()=>"SkyLantern",inWind:(n,t)=>{const e=n.site.altitudeM??0,r=n.windAloft?.atM??1e3;return{...n,wind:Le(t.at(10)),windAloft:{...Le(t.at(e+r)),atM:r}}},compute:()=>d(async()=>{const{SkyLantern:n}=await import("./SkyLantern-DJT_Ibzh.js");return{SkyLantern:n}},__vite__mapDeps([0,1]),import.meta.url).then(({SkyLantern:n})=>(t,e)=>n.bodiesOf(t,e?.obstacles)),editor:()=>d(async()=>{const{LanternEditor:n}=await import("./LanternEditor-BapUZdog.js");return{LanternEditor:n}},__vite__mapDeps([2,3,4,5,0,1,6,7,8]),import.meta.url).then(({LanternEditor:n})=>(t,e,r)=>new n(t,e,r))},Sn=T.catalog({en:()=>d(()=>import("./BirdKindMessages_en-c_-L7frF.js"),[],import.meta.url).then(n=>n.birdKindMessages_en),fr:()=>d(()=>import("./BirdKindMessages_fr-C1TuqqEj.js"),[],import.meta.url).then(n=>n.birdKindMessages_fr),es:()=>d(()=>import("./BirdKindMessages_es-8Zo2t0o4.js"),[],import.meta.url).then(n=>n.birdKindMessages_es),it:()=>d(()=>import("./BirdKindMessages_it-DQZcrCkf.js"),[],import.meta.url).then(n=>n.birdKindMessages_it)}),ze={key:"birds",messages:Sn,phenomenon:()=>"Birds",compute:()=>d(async()=>{const{BirdFlock:n}=await import("./BirdFlock-ByBkJV35.js").then(t=>t.b);return{BirdFlock:n}},__vite__mapDeps([9,1]),import.meta.url).then(({BirdFlock:n})=>(t,e)=>n.bodiesOf(t,e?.obstacles)),editor:()=>d(async()=>{const{BirdEditor:n}=await import("./BirdEditor-Dk3huwHa.js");return{BirdEditor:n}},__vite__mapDeps([10,3,4,5,9,1,8,11]),import.meta.url).then(({BirdEditor:n})=>(t,e,r)=>new n(t,e,r))},xn=T.catalog({en:()=>d(()=>import("./DroneKindMessages_en-CLygXcsv.js"),[],import.meta.url).then(n=>n.droneKindMessages_en),fr:()=>d(()=>import("./DroneKindMessages_fr-CAX15_pk.js"),[],import.meta.url).then(n=>n.droneKindMessages_fr),es:()=>d(()=>import("./DroneKindMessages_es-B9XFRYnQ.js"),[],import.meta.url).then(n=>n.droneKindMessages_es),it:()=>d(()=>import("./DroneKindMessages_it-CSGsCaJQ.js"),[],import.meta.url).then(n=>n.droneKindMessages_it)}),qe={quadcopter:"ConsumerDrone",saucer:"ConsumerDrone","fixed-wing":"MilitaryDrone"},We={key:"drones",messages:xn,phenomenon:n=>qe[n.airframe]??qe.quadcopter,compute:()=>d(async()=>{const{DroneFlight:n}=await import("./DroneFlight-CGNIh9XS.js").then(t=>t.c);return{DroneFlight:n}},__vite__mapDeps([12,13]),import.meta.url).then(({DroneFlight:n})=>t=>n.bodiesOf(t)),editor:()=>d(async()=>{const{DroneEditor:n}=await import("./DroneEditor-D60uhSHO.js");return{DroneEditor:n}},__vite__mapDeps([14,3,4,5,15,12,13,8,11]),import.meta.url).then(({DroneEditor:n})=>(t,e,r)=>new n(t,e,r))},Mn=T.catalog({en:()=>d(()=>import("./BalloonKindMessages_en-C6tZ-5gT.js"),[],import.meta.url).then(n=>n.balloonKindMessages_en),fr:()=>d(()=>import("./BalloonKindMessages_fr-C3QJIuDJ.js"),[],import.meta.url).then(n=>n.balloonKindMessages_fr),es:()=>d(()=>import("./BalloonKindMessages_es-BfoEjhe1.js"),[],import.meta.url).then(n=>n.balloonKindMessages_es),it:()=>d(()=>import("./BalloonKindMessages_it-CkO7mqHp.js"),[],import.meta.url).then(n=>n.balloonKindMessages_it)}),zs=["round","star","heart","figure"];class ae{static HELIUM_KG_MOL=.0040026;static ALL=[{id:"hot-air",modelId:"ufoathome-balloon-hot-air",envelope:"open",launchVolumeM3:2550,maxVolumeM3:2550,massKg:540,dragCoefficient:.5,aspect:1.461,widthM:16.5,color:"#c8202f",stripeColor:"#f5c400",albedo:.4,burner:{heatingKS:1.2,coolingS:400,blastS:6,maxExcessK:100,flameCdM2:2e4,envelopeCdM2:40,color:"#ffb347"},phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600},{id:"party",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:.0115,maxVolumeM3:.0335,massKg:.0045,dragCoefficient:.47,aspect:1.13,color:"#d8263a",albedo:.35,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600},{id:"led",modelId:"ufoathome-balloon-led",envelope:"elastic",launchVolumeM3:.0141,maxVolumeM3:.041,massKg:.0075,dragCoefficient:.47,aspect:1.115,color:"#ffffff",albedo:.5,glow:{candela:.5,color:"#ffffff"},phenomenon:"LedBalloon",durationS:3600},{id:"foil",modelId:"ufoathome-balloon-foil",envelope:"vented",launchVolumeM3:.014,maxVolumeM3:.014,massKg:.01,dragCoefficient:.6,aspect:1.034,widthM:.45,depthRatio:.267,color:"#c9cdd2",albedo:.85,finish:"mirror",spins:!0,shapes:{round:{modelId:"ufoathome-balloon-foil",aspect:1.034,widthM:.45,depthRatio:.267,launchVolumeM3:.014,maxVolumeM3:.014,massKg:.01,color:"#c9cdd2"},star:{modelId:"ufoathome-balloon-foil-star",aspect:1.029,widthM:.5,depthRatio:.183,launchVolumeM3:.012,maxVolumeM3:.012,massKg:.009,color:"#e0b83a"},heart:{modelId:"ufoathome-balloon-foil-heart",aspect:.903,widthM:.5,depthRatio:.2,launchVolumeM3:.014,maxVolumeM3:.014,massKg:.01,color:"#d81e3c"},figure:{modelId:"ufoathome-balloon-foil-figure",aspect:1.112,widthM:.8,depthRatio:.127,launchVolumeM3:.05,maxVolumeM3:.05,massKg:.03,color:"#f0a3c8"}},phenomenon:"FoilBalloon",durationS:3600},{id:"pilot",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:.144,maxVolumeM3:.57,massKg:.045,dragCoefficient:.4,aspect:1.13,color:"#f0e6cf",albedo:.55,lamp:{candela:1,color:"#fff1c4"},phenomenon:"WeatherBalloonsOrMongolfieres",durationS:5400},{id:"weather",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:1.75,maxVolumeM3:118.9,massKg:.85,dragCoefficient:.3,aspect:1.13,color:"#f2ece0",albedo:.55,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:7200},{id:"stratospheric",modelId:"ufoathome-balloon-stratospheric",envelope:"vented",launchVolumeM3:219,maxVolumeM3:14e3,massKg:210,dragCoefficient:.4,aspect:.91,color:"#e9eef2",albedo:.8,ballastKg:20,phenomenon:"StratosphericBalloons",durationS:10800},{id:"stratospheric-large",modelId:"ufoathome-balloon-stratospheric",envelope:"vented",launchVolumeM3:730,maxVolumeM3:15e4,massKg:700,dragCoefficient:.4,aspect:.91,color:"#e9eef2",albedo:.8,ballastKg:140,phenomenon:"StratosphericBalloons",durationS:14400},{id:"superpressure",modelId:"ufoathome-balloon-latex",envelope:"superpressure",launchVolumeM3:45,maxVolumeM3:523,massKg:44,dragCoefficient:.4,aspect:1.13,color:"#eef1f4",albedo:.8,phenomenon:"StratosphericBalloons",durationS:10800},{id:"infrared",modelId:"ufoathome-balloon-stratospheric",envelope:"open",launchVolumeM3:2075,maxVolumeM3:45e3,massKg:150,dragCoefficient:.4,aspect:.91,color:"#9aa0a8",albedo:.4,insideExcessK:20,phenomenon:"StratosphericBalloons",durationS:10800},{id:"prank-candles",modelId:"ufoathome-balloon-prank",envelope:"open",launchVolumeM3:.25,maxVolumeM3:.25,massKg:.02,dragCoefficient:.6,aspect:1.515,widthM:.6,color:"#f4f4f4",albedo:.6,insideExcessK:60,spins:!0,sways:!0,flames:{count:4,candela:.5,color:"#ffb347",burnS:720,coolingS:15},phenomenon:"SkyLantern",durationS:1200},{id:"prank-flares",modelId:"ufoathome-balloon-prank",envelope:"open",launchVolumeM3:2,maxVolumeM3:2,massKg:.3,dragCoefficient:.6,aspect:1.515,widthM:1.2,color:"#2b2d30",albedo:.1,insideExcessK:80,spins:!0,sways:!0,flames:{count:1,candela:150,color:"#ff3a20",burnS:900,coolingS:30},phenomenon:"SkyLantern",durationS:1500},{id:"anti-hail",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:.65,maxVolumeM3:8,massKg:.4,dragCoefficient:.35,aspect:1.13,color:"#f2ece0",albedo:.55,torch:{aboveM:600,candela:300,color:"#ff9a3c",burnS:90,fallMS:4},phenomenon:"ParachuteFlare",durationS:1200},{id:"solar",modelId:"ufoathome-balloon-latex",envelope:"open",launchVolumeM3:14,maxVolumeM3:14,massKg:.4,dragCoefficient:.47,aspect:1.13,color:"#151515",albedo:.05,insideExcessK:10,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600},{id:"captive",modelId:"ufoathome-balloon-latex",envelope:"sealed",tethered:!0,launchVolumeM3:14,maxVolumeM3:14,massKg:8,dragCoefficient:.47,aspect:1.13,color:"#f4f4f4",albedo:.7,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600}];static byId(t){return ae.ALL.find(e=>e.id===t)}}const Ye=K.rounded,Xe={key:"balloons",messages:Mn,phenomenon:n=>{const t=typeof n.balloon=="string"?n.balloon:n.balloon?.id;return(ae.byId(t)??ae.ALL[0]).phenomenon},inWind:(n,t)=>{const e=n.site.altitudeM??0;return{...n,wind:Ye(t.at(10)),windsAloft:t.levels.filter(r=>r>e+10).map(r=>({...Ye(t.at(r)),atM:Math.round(r-e)}))}},compute:()=>d(async()=>{const{BalloonFlight:n}=await import("./BalloonFlight-CztT6ddg.js");return{BalloonFlight:n}},[],import.meta.url).then(({BalloonFlight:n})=>t=>n.bodiesOf(t)),editor:()=>d(async()=>{const{BalloonEditor:n}=await import("./BalloonEditor-dCIjTsIz.js");return{BalloonEditor:n}},__vite__mapDeps([16,3,4,5,15,12,13,17,6,7,8]),import.meta.url).then(({BalloonEditor:n})=>(t,e,r)=>new n(t,e,r))},vn=T.catalog({en:()=>d(()=>import("./AirshipKindMessages_en-DzGapVTV.js"),[],import.meta.url).then(n=>n.airshipKindMessages_en),fr:()=>d(()=>import("./AirshipKindMessages_fr-BTXNsW5W.js"),[],import.meta.url).then(n=>n.airshipKindMessages_fr),es:()=>d(()=>import("./AirshipKindMessages_es-TE93uMSC.js"),[],import.meta.url).then(n=>n.airshipKindMessages_es),it:()=>d(()=>import("./AirshipKindMessages_it-Cwa3MnJ-.js"),[],import.meta.url).then(n=>n.airshipKindMessages_it)}),oe=(n,t,e,r=5)=>({"nav-left":{color:"#ff2a1a",candela:r,leds:[{at:n,radiusM:.06}]},"nav-right":{color:"#2aff5a",candela:r,leds:[{at:t,radiusM:.06}]},tail:{color:"#ffffff",candela:r,leds:[{at:e,radiusM:.06}]}});class ue{static ALL=[{id:"blimp",modelId:"ufoathome-airship-blimp",sizeM:{widthM:14.72,lengthM:59.46,heightM:17.59},cruiseMS:15,maxSpeedMS:22,color:"#c9ccd1",finColor:"#1d3f8a",albedo:.6,sign:{color:"#fff4d8",luminanceCdM2:150,lit:!0},lights:{...oe([-1.22,-8.6,-9],[1.22,-8.6,-9],[0,0,29.7]),strobe:{color:"#ffffff",candela:400,hz:1,flashS:.06,leds:[{at:[0,-10.15,-9],radiusM:.08}]}},sound:"light-piston",phenomenon:"Airship"},{id:"zeppelin-nt",modelId:"ufoathome-airship-zeppelin-nt",sizeM:{widthM:18.2,lengthM:75.11,heightM:19.55},cruiseMS:19,maxSpeedMS:35,color:"#eef0f2",finColor:"#eef0f2",albedo:.75,sign:{color:"#fff4d8",luminanceCdM2:150,lit:!1},lights:{...oe([-1.32,-8.4,-14],[1.32,-8.4,-14],[0,0,37.5]),strobe:{color:"#ffffff",candela:400,hz:1,flashS:.06,leds:[{at:[0,-9.65,-14],radiusM:.08}]}},sound:"light-piston",phenomenon:"Airship"},{id:"lightship",modelId:"ufoathome-airship-lightship",sizeM:{widthM:10.16,lengthM:39.66,heightM:11.98},cruiseMS:13,maxSpeedMS:20,color:"#f4f4f2",finColor:"#f4f4f2",albedo:.7,glowCdM2:20,lights:oe([-.82,-5.9,-6],[.82,-5.9,-6],[0,0,19.8]),sound:"light-piston",phenomenon:"Airship"},{id:"aerostat",modelId:"ufoathome-airship-aerostat",sizeM:{widthM:25.14,lengthM:63.6,heightM:27.05},cruiseMS:0,maxSpeedMS:0,tethered:!0,color:"#f2f2f0",finColor:"#f2f2f0",albedo:.7,lights:{nose:{color:"#ff2a1a",candela:2e3,hz:.5,flashS:.6,leds:[{at:[0,-4.2,-30],radiusM:.12}]},stern:{color:"#ff2a1a",candela:2e3,hz:.5,flashS:.6,leds:[{at:[0,-6.3,22],radiusM:.12}]}},phenomenon:"Airship"},{id:"rigid",modelId:"ufoathome-airship-rigid",sizeM:{widthM:33.38,lengthM:236.66,heightM:35.79},cruiseMS:32,maxSpeedMS:36,color:"#b9bcbf",finColor:"#b9bcbf",albedo:.55,lights:oe([-3.02,-16.5,-80],[3.02,-16.5,-80],[0,0,118.3],10),sound:"piston-heavy",phenomenon:"Airship"}];static byId(t){return ue.ALL.find(e=>e.id===t)}}const Je={key:"airships",messages:vn,phenomenon:n=>{const t=typeof n.airship=="string"?n.airship:n.airship?.id;return(ue.byId(t)??ue.ALL[0]).phenomenon},compute:()=>d(async()=>{const{AirshipFlight:n}=await import("./AirshipFlight-Dzpw8HRM.js");return{AirshipFlight:n}},__vite__mapDeps([18,12,13]),import.meta.url).then(({AirshipFlight:n})=>t=>n.bodiesOf(t)),editor:()=>d(async()=>{const{AirshipEditor:n}=await import("./AirshipEditor-CBSrQM3J.js");return{AirshipEditor:n}},__vite__mapDeps([19,3,4,5,15,12,13,18,8,11]),import.meta.url).then(({AirshipEditor:n})=>(t,e,r)=>new n(t,e,r))},Yr=v.point("interpretations").provide(v.BUILT_IN,[{id:He.key,name:"Decoy flares",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>He},{id:Ke.key,name:"Sky lanterns",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>Ke},{id:ze.key,name:"Birds",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>ze},{id:We.key,name:"Drones",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>We},{id:Xe.key,name:"Balloons",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>Xe},{id:Je.key,name:"Airships",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>Je}]);class Ge{static kinds(){return Yr.map(t=>N.of(t))}}const qs=Object.freeze(Object.defineProperty({__proto__:null,INTERPRETATION_SOURCES:Yr,InterpretationRegistry:Ge},Symbol.toStringTag,{value:"Module"}));class H{static SIGHTING_EVENT="sighting";static INTERPRETATION_EVENT="interpretation";static INTERVIEW_EVENT="interview";static check(t){return ct.check(t,"case")}static isCase(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&Array.isArray(t.events)&&!("timeline"in t)}static sightingUrls(t,e){return(t.events??[]).filter(r=>r.eventType===H.SIGHTING_EVENT&&!r.interpretationOf&&typeof r.url=="string"&&r.url!=="").map(r=>new URL(r.url,e).href)}static accountIds(t,e,r,s){const o=(t.events??[]).filter(i=>i.eventType===H.SIGHTING_EVENT&&i.id!==void 0&&typeof i.url=="string"&&r!==void 0&&new URL(i.url,e).href===r).map(i=>i.id);return s!==void 0&&o.push(s),o}static interpretationEvents(t,e){const r=[e].flat().filter(s=>!!s);return r.length===0?[]:(t.events??[]).filter(s=>s.eventType===H.INTERPRETATION_EVENT?s.sighting!==void 0&&r.includes(s.sighting):s.eventType!==H.SIGHTING_EVENT||s.interpretationOf===void 0?!1:[s.interpretationOf].flat().some(o=>r.includes(o))).map(s=>s)}static problems(t,e){const r=t.events??[],s=new Set,o=new Set;for(const a of r)a.id!==void 0&&(s.has(a.id)&&o.add(a.id),s.add(a.id));const i=[];for(const a of r){const l=a.eventType===H.SIGHTING_EVENT?a.interpretationOf:a.eventType===H.INTERVIEW_EVENT?a.interviewOf:void 0;if(l!==void 0)for(const c of[l].flat())!s.has(c)&&!e.includes(c)&&i.push({reading:a.url??a.id??"",reference:c})}return{duplicateIds:[...o],unresolved:i}}static async interpretationOf(t,e,r){if(t.bodies)return H.withModelsFrom(j.strip({title:t.title,bodies:t.bodies??[],smoke:t.smoke,findings:t.findings,...N.computedPart(t,Ge.kinds())}).recording,e);if(!t.url)return{title:t.title,bodies:[]};const s=new URL(t.url,e).href,o=await r(s),i="timeline"in o&&o.interpretation?o.interpretation:o;return H.withModelsFrom(j.strip({title:t.title??i.title,bodies:i.bodies??[],smoke:i.smoke,findings:i.findings,...N.computedPart(i,Ge.kinds())}).recording,s)}static withModelsFrom(t,e){return{...t,bodies:t.bodies.map(r=>r.model?.url?{...r,model:{...r.model,url:new URL(r.model.url,e).href}}:r)}}}class k{static files=new Map;static hold(t){for(const[e,r]of t)k.files.set(k.key(e),r)}static releaseCopies(){for(const[t,e]of k.files)e.local||k.files.delete(t)}static clear(){k.files.clear()}static localBase(){return new URL(`local/${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}/`,location.href).href}static read(t){const e=k.files.get(k.key(t));return e===void 0?void 0:structuredClone(e.json)}static changed(...t){return t.some(e=>e!==void 0&&k.files.get(k.key(e))?.changed===!0)}static local(t){return t!==void 0&&k.files.get(k.key(t))?.local===!0}static key(t){const e=new URL(t,location.href);return e.hash="",e.href}}class q{static NAMES=["weather","place","lightPollution","decor"];static KEYS={weather:["weatherTrack","weatherSource"],place:["place"],lightPollution:["lightPollution"],decor:["decor"]};static annexName(t,e){return`${t}.${e.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`)}.json`}static taken(t,e){const r={};if(t==="decor")return Array.isArray(e.decor)&&(r.decor=e.decor.filter(q.surveyed)),r;for(const s of q.KEYS[t])e[s]!==void 0&&(r[s]=e[s]);return r}static strip(t,e){if(t==="decor"){const r=Array.isArray(e.decor)?e.decor.filter(s=>!q.surveyed(s)):[];r.length>0?e.decor=r:delete e.decor;return}for(const r of q.KEYS[t])delete e[r]}static put(t,e,r){if(t==="decor"){if(!Array.isArray(r.decor))return;const s=Array.isArray(e.decor)?e.decor.filter(o=>!q.surveyed(o)):[];e.decor=[...s,...r.decor];return}for(const s of q.KEYS[t])r[s]!==void 0&&(e[s]=r[s])}static surveyed(t){return typeof t=="object"&&t!==null&&typeof t.origin=="string"}static fromFile(t,e){return t?.[e]!==void 0&&t[e].live!==!0}}class Xr{static NAMES=["relief","imagery","roads","water","railways","upperAir","map"];static TERRAIN=["relief","imagery","roads","water","railways"];static held(t,e){if(!t||t.live)return;const r=t[e];return r&&!r.live&&!r.refresh&&r.src!==void 0?r:void 0}static isLive(t,e){return t?.live===!0||t?.[e]?.live===!0}static annexName(t,e){const r=e==="relief"||e==="imagery"||e==="map"?"zip":"json",s=e.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`);return`${t}.${s}.${r}`}static isEmpty(t){return!t||!t.live&&Xr.NAMES.every(e=>!t[e])&&q.NAMES.every(e=>!t[e])}}class xt extends Error{constructor(t,e,r){super(`${t}: ${e}${r===void 0?"":` (HTTP ${r})`}`),this.kind=t,this.url=e,this.status=r,this.name="SightingFetchError"}}class ce{static async recording(t){const e=k.read(t);if(e!==void 0)return e;const r=await ce.json(t);for(const s of q.NAMES){const o=r?.snapshots?.[s];if(!(!o?.src||o.live))try{const i=ct.recording(await ce.json(new URL(o.src,new URL(t,location.href)).href));q.put(s,r,i)}catch{}}return r}static async json(t){const e=new URL(t,location.href),r=k.read(e.href);if(r!==void 0)return r;if(location.protocol==="https:"&&e.protocol==="http:")throw new xt("mixed-content",t);let s;try{s=await fetch(t)}catch{throw await this.diagnose(t,e)}if(!s.ok)throw new xt("status",t,s.status);try{return await s.json()}catch{throw new xt("malformed",t)}}static async diagnose(t,e){if(e.origin===location.origin)return new xt("unreachable",t);try{return await fetch(t,{mode:"no-cors"}),new xt("cors",t)}catch{return new xt("unreachable",t)}}}class Ve{constructor(t,e,r=()=>{}){this.place=t,this.changed=r,e&&this.adopt(e)}reader;editor;handed;get reading(){return this.reader!==void 0}get editorLoaded(){return this.editor!==void 0}adopt(t){this.editor=t,t.switcher=this,t.hasAttribute(ge)||t.setAttribute(ge,""),t.addEventListener(mn,e=>{e.preventDefault();const r=e.detail;this.handed=r.src,this.read(r)})}async read({src:t,track:e}){const[{register:r,CASE_ELEMENT_NAME:s,OPEN_EVENTS_ATTRIBUTE:o},{registerSighting:i,SIGHTING_ELEMENT_NAME:a}]=await Promise.all([d(()=>import("./CaseElement-CRXPyMMR.js"),__vite__mapDeps([20,21,22,6,7,23,3,4,13,24,25,1,26]),import.meta.url),d(()=>import("./SightingElement-BJSNmFM6.js"),__vite__mapDeps([26,22,6,7,23,3,4,13,24,25,1]),import.meta.url)]);i(),r();const l=H.isCase(k.read(t)??await ce.json(t)),c=document.createElement(l?s:a);c.setAttribute(ge,""),c.setAttribute("show-labels",""),l&&e&&c.setAttribute(o,Ve.fileKey(e)),c.setAttribute("src",t),c.addEventListener(hn,m=>{m.preventDefault(),this.edit(m.detail)}),this.reader?.remove(),this.place(c),this.editor&&(this.editor.hidden=!0),this.reader=c,this.changed({mode:"read",src:t,...e?{track:e}:{}})}async edit(t){const e=this.editor;if(e){if(this.dropReader(),k.releaseCopies(),e.hidden=!1,this.changed({mode:"edit"}),t?.src!==void 0&&t.src!==this.handed){this.load(e,t.src,t.track);return}t?.track&&await e.openTrack(t.track);return}const{register:r,CASE_EDITOR_ELEMENT_NAME:s}=await d(async()=>{const{register:i,CASE_EDITOR_ELEMENT_NAME:a}=await import("./CaseEditorElement-0J_TCeiq.js").then(l=>l.b);return{register:i,CASE_EDITOR_ELEMENT_NAME:a}},__vite__mapDeps([27,3,4,8,21,22,6,7,23,13,24,25,1,28,11,29,30,31,32]),import.meta.url);r();const o=document.createElement(s);this.adopt(o),t?.track&&o.setAttribute("track",t.track),t?.src?o.setAttribute("src",t.src):t?.start&&(o.caseStart=t.start),this.dropReader(),this.place(o),this.changed({mode:"edit"})}async open(t){const e=this.editor;if(this.reading||!e)return this.read({src:t});this.load(e,t)}load(t,e,r){this.handed=void 0,r?t.setAttribute("track",r):t.removeAttribute("track"),t.setAttribute("src",e)}async startNew(t){const e=this.editor;if(!e)return this.edit(t?{start:t}:void 0);this.reading&&await this.edit(),e.askBeforeReplacing(()=>{e.remove(),this.editor=void 0,this.edit(t?{start:t}:void 0)})}dropReader(){this.reader?.remove(),this.reader=void 0}static fileKey(t){return new URL(t,location.href).pathname.split("/").pop().replace(/\.json$/i,"")}}const Ie="rr0-input-file",Jr={inputFileFromFile:"from your disk",inputFileFromUrl:"from an address",inputFileModeHint:"Click to give it the other way: a file of yours, or an address",inputFileLoad:"Load"},An=`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./SkyLantern-DJT_Ibzh.js","./Obstacles-v9SkfBD7.js","./LanternEditor-CepeoImr.js","./SaidPosition-OJEYhVKN.js","./GeoProjection-DvqDbRIx.js","./SkyEventEditorStyle-CvY_AhbI.js","./Sighting-D-_IYi9n.js","./VisualAids-DI-hEL46.js","./ParameterForm-XbqxCLRn.js","./BirdFlock-ByBkJV35.js","./BirdEditor-CBVGyUnK.js","./TimelineTracks-Daaqw9ly.js","./DroneFlight-CGNIh9XS.js","./Decor-Dn-cvniW.js","./DroneEditor-7X9CM_3H.js","./DroneParameters-CfTAaLCT.js","./BalloonEditor-CAKXO8DQ.js","./BalloonFlight-CvE7AHlm.js","./AirshipFlight-6yYGIRn8.js","./AirshipEditor-EBfUtSiB.js","./CaseElement-DVXLO8mr.js","./ColumnResize-CO4e1m-q.js","./ShareDialogElement-DqCoQwtn.js","./three.module-CbaHqYFq.js","./RecordingIssue-BlWT8Xsu.js","./xyzImageryRaster-Dhxs0B26.js","./SightingElement-CUrYpWRD.js","./CaseEditorElement-BgT6HnpX.js","./ReentryArchive-CeXHrU7L.js","./ReferenceTimeline-2kBldQeG.js","./upperAirSources-BU0pD84c.js","./Account-C4jhsVtN.js","./UfoMessages_en-D5OYWJ3K.js","./SightingEditorMessages_en-BmqJK2u_.js","./SightingLabels_en-oIpytoq_.js","./SightingEditorMessages_fr-ClEadK1E.js","./SightingLabels_fr-D69zENbW.js","./SightingEditorMessages_es-avQMqPMq.js","./SightingLabels_es-DUh1CTXl.js","./SightingEditorMessages_it-Co5behaA.js","./SightingLabels_it-COLZ2Qth.js","./SightingMessages_en-CzICxNU3.js","./SightingMessages_fr-nopOVDa1.js","./SightingMessages_es-CiVFZlgA.js","./SightingMessages_it-Cu0nnPts.js","./UfoAtHomeMessages_en-ByVu39KF.js","./ConsentMessages_en-DBKCeDAn.js","./UfoAtHomeMessages_fr-nTqRf0ZK.js","./ConsentMessages_fr-FGSpqzMc.js","./UfoAtHomeMessages_es-D9bLboxq.js","./ConsentMessages_es-Dby74lUq.js","./UfoAtHomeMessages_it-4cZC5-y5.js","./ConsentMessages_it-BJWfXH6I.js","./SceneNames_en-7OZ7peGc.js","./SceneNames_fr-qzw0QzD0.js","./SceneNames_es-P5-Mavdi.js","./SceneNames_it-Sqf8JFOd.js","./ModuleSession-Dac4fD0X.js"])))=>i.map(i=>d[i]);
2
+ const hn="modulepreload",fn=function(n,t){return new URL(n,t).href},ze={},d=function(t,e,r){let s=Promise.resolve();if(e&&e.length>0){let i=function(m){return Promise.all(m.map(p=>Promise.resolve(p).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const a=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),c=l?.nonce||l?.getAttribute("nonce");s=i(e.map(m=>{if(m=fn(m,r),m in ze)return;ze[m]=!0;const p=m.endsWith(".css"),f=p?'[rel="stylesheet"]':"";if(!!r)for(let E=a.length-1;E>=0;E--){const G=a[E];if(G.href===m&&(!p||G.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${f}`))return;const S=document.createElement("link");if(S.rel=p?"stylesheet":hn,p||(S.as="script"),S.crossOrigin="",S.href=m,c&&S.setAttribute("nonce",c),document.head.appendChild(S),p)return new Promise((E,G)=>{S.addEventListener("load",E),S.addEventListener("error",()=>G(new Error(`Unable to preload CSS for ${m}`)))})}))}function o(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return s.then(i=>{for(const a of i||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})},gn="rr0-read",wn="rr0-edit",xe="in-place",yn="rr0-mode";class Xs{static ask(t,e,r){const s=new CustomEvent(e,{detail:r,bubbles:!0,composed:!0,cancelable:!0});return t.dispatchEvent(s),s.defaultPrevented}}class j{constructor(t){this.entries=t}static same(t,e){return typeof t=="number"&&typeof e=="number"?t===e||Math.abs(t-e)<=1e-9*Math.max(1,Math.abs(t),Math.abs(e)):Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((r,s)=>j.same(r,e[s])):typeof t=="object"&&t!==null&&typeof e=="object"&&e!==null&&!Array.isArray(t)&&!Array.isArray(e)?[...new Set([...Object.keys(t),...Object.keys(e)])].every(s=>j.same(t[s],e[s])):t===e}static free(t){return t?.basis==="assumed"||t?.basis==="fitted"}static empty(){return new j(new Map)}get size(){return this.entries.size}at(t){return this.entries.get(t)}paths(){return[...this.entries.keys()]}sourced(){return[...this.entries].filter(([,t])=>t.source!==void 0).map(([t,e])=>({path:t,basis:e.basis,source:e.source}))}interviewsCited(){const t=[];for(const{source:e}of this.sourced()){const r=e.said?.interview;r!==void 0&&!t.includes(r)&&t.push(r)}return t}pathsFromInterview(t){return this.sourced().filter(({source:e})=>e.said!==void 0&&e.said.interview===t).map(({path:e})=>e)}set(t,e){e.basis==="stated"&&e.rationale===void 0&&e.how===void 0&&e.range===void 0&&e.source===void 0?this.entries.delete(t):this.entries.set(t,e)}clear(t){for(const e of this.entries.keys())(e===t||e.startsWith(`${t}.`))&&this.entries.delete(e)}static strip(t){const e=new j(new Map);return{recording:j.stripValue(t,[],e),provenance:e}}static restore(t,e){if(e.size===0)return t;const r={...t},s=new Set([r]);for(const o of e.paths()){const i=e.at(o),a=o.split("."),l=j.writableHolderOf(r,a,s);if(!l)continue;const c=a[a.length-1],m=l[c];m!==void 0&&(i.of!==void 0&&!j.same(i.of,m)||(l[c]={value:m,...i.basis==="stated"?{}:{basis:i.basis},...i.rationale===void 0?{}:{rationale:i.rationale},...i.how===void 0?{}:{how:i.how},...i.range===void 0?{}:{range:i.range},...i.source===void 0?{}:{source:i.source}}))}return r}static isWrapper(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&"value"in t}static stripValue(t,e,r){return j.isWrapper(t)?(r.set(e.join("."),{basis:t.basis??"stated",...t.rationale===void 0?{}:{rationale:t.rationale},...t.how===void 0?{}:{how:t.how},...t.range===void 0?{}:{range:t.range},...t.source===void 0?{}:{source:t.source},of:t.value}),j.stripValue(t.value,e,r)):Array.isArray(t)?t.map((s,o)=>j.stripValue(s,[...e,String(o)],r)):typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t).map(([s,o])=>[s,j.stripValue(o,[...e,s],r)])):t}static writableHolderOf(t,e,r){let s=t;for(const o of e.slice(0,-1)){const i=s[o];if(typeof i!="object"||i===null)return;if(r.has(i)){s=i;continue}const a=Array.isArray(i)?[...i]:{...i};r.add(a),s[o]=a,s=a}return s}}class bn extends Error{constructor(t,e,r){super(typeof e=="number"&&Number.isInteger(e)&&e>=1?`This ${t} file is in version ${e} of its format; this UFO@home reads version ${r}. Read it with the UFO@home that reads its version.`:`This ${t} file states ${JSON.stringify(e)} as its format version, which is not a version.`),this.format=t,this.found=e,this.supported=r,this.name="FormatVersionError"}said(t){return t.replace("{found}",typeof this.found=="number"?String(this.found):JSON.stringify(this.found)).replace("{supported}",String(this.supported))}}class ht{static CURRENT={sighting:4,case:1,interview:1};static SCHEMA_BASE="https://ufoathome.org/schema";static schemaUrl(t,e=ht.CURRENT[t]){return`${ht.SCHEMA_BASE}/${e}/${t}.schema.json`}static of(t){if(typeof t!="object"||t===null)return 1;const e=t.version;return e===void 0?1:typeof e=="object"&&e!==null&&"value"in e?e.value:e}static recording(t){return ht.check(t,"sighting")}static check(t,e){const r=ht.of(t),s=ht.CURRENT[e];if(typeof r!="number"||!Number.isInteger(r)||r!==s)throw new bn(e,r,s);return t}}class _{static built=new WeakMap;static computers=new WeakMap;static loading=new WeakMap;static loaded(t,e){return e.every(r=>_.itemsOf(t,r.key).length===0||_.computers.has(r))}static load(t,e){return Promise.all(e.filter(r=>_.itemsOf(t,r.key).length>0&&!_.computers.has(r)).map(r=>{let s=_.loading.get(r);return s||(s=r.compute().then(o=>{_.computers.set(r,o)}),s.catch(()=>_.loading.delete(r)),_.loading.set(r,s)),s.catch(()=>{})})).then(()=>{})}static of(t){let e=_.built.get(t);return e||(e=t.create(),_.built.set(t,e)),e}static itemsOf(t,e){const r=t?.[e];return Array.isArray(r)?r:[]}static computes(t,e){return e.some(r=>_.itemsOf(t,r.key).length>0)}static expand(t,e,r){return _.expandWithKinds(t,e,r).interpretation}static expandWithKinds(t,e,r){const s=new Map,o=new Map;if(!t||!_.computes(t,e))return{interpretation:t,kindOf:s,phenomenonOf:o};const i=e.flatMap(a=>_.itemsOf(t,a.key).flatMap(l=>{const c=_.computers.get(a);if(!c)return[];const m=c(l,r),p=a.phenomenon?.(l);for(const f of m)s.set(f.id,a),p&&o.set(f.id,p);return m}));return{interpretation:{...t,bodies:[...t.bodies,...i]},kindOf:s,phenomenonOf:o}}static phenomena(t,e){const r=new Set;for(const s of e)for(const o of _.itemsOf(t,s.key)){const i=s.phenomenon?.(o);i&&r.add(i)}return r}static computedPart(t,e){const r={};for(const s of e){const o=_.itemsOf(t,s.key);o.length>0&&(r[s.key]=[...o])}return r}static saysNothing(t,e){return t.bodies.length===0&&t.title===void 0&&t.smoke===void 0&&e.every(r=>t[r.key]===void 0)}}const Js=Object.freeze(Object.defineProperty({__proto__:null,InterpretationKinds:_},Symbol.toStringTag,{value:"Module"}));class Zr extends Error{constructor(t,e,r,s){super(`Module "${t}" gives "${r}" at ${e}, which module "${s}" already gives`),this.moduleId=t,this.point=e,this.sourceId=r,this.ownerId=s,this.name="ModuleConflictError"}}class En{constructor(t){this.id=t}sources=[];owners=new Map;ownerOf(t){return this.owners.get(t)}conflict(t,e){for(const r of e){const s=this.owners.get(r.id);if(s!==void 0&&s!==t)return{sourceId:r.id,ownerId:s}}}provide(t,e){const r=this.conflict(t,e);if(r)throw new Zr(t,this.id,r.sourceId,r.ownerId);this.withdraw(t);const s=t===A.BUILT_IN?this.sources.findIndex(o=>this.owners.get(o.id)!==A.BUILT_IN):-1;s<0?this.sources.push(...e):this.sources.splice(s,0,...e);for(const o of e)this.owners.set(o.id,t);return this.sources}withdraw(t){for(let e=this.sources.length-1;e>=0;e--){const r=this.sources[e].id;this.owners.get(r)===t&&(this.sources.splice(e,1),this.owners.delete(r))}}}class A{static BUILT_IN="ufoathome";static changes=new EventTarget;static points=new Map;static modules=new Map;static point(t){let e=A.points.get(t);return e||(e=new En(t),A.points.set(t,e)),e}static install(t){if(t.id===A.BUILT_IN)throw new Error(`"${A.BUILT_IN}" is the id of the built-in module`);const e=A.contributionsOf(t);for(const[o,i]of e){const a=A.point(o).conflict(t.id,i);if(a)throw new Zr(t.id,o,a.sourceId,a.ownerId)}const r=new Set(e.map(([o])=>o)),s=A.modules.get(t.id);if(s)for(const[o]of A.contributionsOf(s))r.add(o);for(const o of r)A.point(o).withdraw(t.id);for(const[o,i]of e)A.point(o).provide(t.id,i);A.modules.set(t.id,t);for(const o of r)A.announce(o)}static uninstall(t){const e=A.modules.get(t);if(e){A.modules.delete(t);for(const[r]of A.contributionsOf(e))A.point(r).withdraw(t),A.announce(r)}}static installed(){return[...A.modules.values()]}static contributionsOf(t){return Object.entries(t.contributes).filter(e=>Array.isArray(e[1])&&e[1].length>0)}static announce(t){A.changes.dispatchEvent(new CustomEvent("change",{detail:t}))}}const Sn=["en","fr","es","it"];class N{static catalog(t){const e=new Map;return{load(r){const s=N.languageOf(r);let o=e.get(s);return o||(o=t[s](),e.set(s,o),o.catch(()=>e.delete(s))),o}}}static none(){return new Proxy({},{get:()=>""})}static blank(){const t=new Proxy(()=>t,{get:(e,r)=>r===Symbol.toPrimitive?()=>"":r===Symbol.iterator?function*(){}:r==="toString"||r==="valueOf"?()=>"":r==="then"?void 0:t,apply:()=>t,has:()=>!1,ownKeys:()=>[],getOwnPropertyDescriptor:()=>{}});return t}static languageOf(t){const e=t.toLowerCase().split("-")[0];return Sn.includes(e)?e:"en"}}const xn=N.catalog({en:()=>d(()=>import("./FlareKindMessages_en-j3CY_TxX.js"),[],import.meta.url).then(n=>n.flareKindMessages_en),fr:()=>d(()=>import("./FlareKindMessages_fr-B2MezoN2.js"),[],import.meta.url).then(n=>n.flareKindMessages_fr),es:()=>d(()=>import("./FlareKindMessages_es-CZgrFIOO.js"),[],import.meta.url).then(n=>n.flareKindMessages_es),it:()=>d(()=>import("./FlareKindMessages_it-CmZmb3RP.js"),[],import.meta.url).then(n=>n.flareKindMessages_it)});class nt{constructor(t={}){this.options=t,this.fetchImpl=t.fetchImpl??fetch.bind(globalThis),this.wait=t.wait??(e=>new Promise(r=>setTimeout(r,e)))}static URL="https://historical-forecast-api.open-meteo.com/v1/forecast";static CREDIT="Open-Meteo historical forecast";static LEVELS=[850,700,600,500,400,300];static RETRIES=6;static RETRY_MS=2e3;days=new Map;fetchImpl;wait;async profile(t,e,r){const o=new Date(Math.floor(r.getTime()/36e5)*36e5),i=(r.getTime()-o.getTime())/36e5,a=await this.hourly(t,e,o);if(i<1e-6)return a;const l=await this.hourly(t,e,new Date(o.getTime()+36e5));return a.levels.length!==l.levels.length?i<.5?a:l:{...a,hour:r.toISOString().slice(0,16),levels:a.levels.map((c,m)=>{const[p,f]=X.vector(c.wind),[y,S]=X.vector(l.levels[m].wind);return{aboveGroundM:c.aboveGroundM+i*(l.levels[m].aboveGroundM-c.aboveGroundM),wind:X.fromVector(p+i*(y-p),f+i*(S-f))}})}}async hourly(t,e,r){const s=r.toISOString().slice(0,13)+":00",o=s.slice(0,10),i=`${t.toFixed(4)},${e.toFixed(4)},${o}`;let a=this.days.get(i);return a||(a=this.day(t,e,o,i),a.catch(()=>this.days.delete(i)),this.days.set(i,a)),nt.profileOf(await a,s)}static profileOf(t,e){const r=t.hourly,s=r.time.indexOf(e);if(s<0)throw new Error(`No wind for ${e} in the archive's answer`);const o=c=>(c+180)%360,i=[],a=r.wind_speed_10m?.[s],l=r.wind_direction_10m?.[s];typeof a=="number"&&typeof l=="number"&&i.push({aboveGroundM:10,wind:{towardDeg:o(l),speedMS:a}});for(const c of nt.LEVELS){const m=r[`geopotential_height_${c}hPa`]?.[s],p=r[`wind_speed_${c}hPa`]?.[s],f=r[`wind_direction_${c}hPa`]?.[s];if(typeof m!="number"||typeof p!="number"||typeof f!="number")continue;const y=m-t.elevation;y<=(i[i.length-1]?.aboveGroundM??0)||i.push({aboveGroundM:y,wind:{towardDeg:o(f),speedMS:p}})}if(i.length===0)throw new Error(`No wind for ${e} in the archive's answer`);return{lat:t.latitude,lng:t.longitude,elevationM:t.elevation,hour:e,levels:i,credit:nt.CREDIT}}async day(t,e,r,s){const o=await this.options.cache?.get(s);if(o)return JSON.parse(o);const i=["wind_speed_10m","wind_direction_10m",...nt.LEVELS.flatMap(c=>[`wind_speed_${c}hPa`,`wind_direction_${c}hPa`,`geopotential_height_${c}hPa`])],a=new URLSearchParams({latitude:String(t),longitude:String(e),start_date:r,end_date:r,hourly:i.join(","),wind_speed_unit:"ms",timezone:"GMT"}),l=`${this.options.url??nt.URL}?${a}`;for(let c=0;;c++){const m=await this.fetchImpl(l);if(m.ok){const p=await m.text();return await this.options.cache?.set(s,p),JSON.parse(p)}if((m.status===429||m.status>=500)&&c<nt.RETRIES){await this.wait(nt.RETRY_MS*2**c);continue}throw new Error(`The wind archive answered ${m.status} for ${s}`)}}}class X{static at(t,e){const r=t.levels;if(e<=r[0].aboveGroundM)return{...r[0].wind};for(let s=1;s<r.length;s++){const o=r[s-1],i=r[s];if(e<=i.aboveGroundM){const a=(e-o.aboveGroundM)/(i.aboveGroundM-o.aboveGroundM),[l,c]=X.vector(o.wind),[m,p]=X.vector(i.wind);return X.fromVector(l+a*(m-l),c+a*(p-c))}}return{...r[r.length-1].wind}}static vector(t){const e=t.towardDeg*Math.PI/180;return[t.speedMS*Math.sin(e),t.speedMS*Math.cos(e)]}static fromVector(t,e){return{towardDeg:(Math.atan2(t,e)*180/Math.PI+360)%360,speedMS:Math.hypot(t,e)}}static rounded(t){return{towardDeg:Math.round(t.towardDeg)%360,speedMS:Math.round(t.speedMS*100)/100}}}const Zs=Object.freeze(Object.defineProperty({__proto__:null,OpenMeteoWindProfiles:nt,Winds:X},Symbol.toStringTag,{value:"Module"})),vn=X.rounded,We={key:"flares",messages:xn,phenomenon:()=>"DecoyFlare",inWind:(n,t)=>({...n,wind:vn(t.at(n.aircraft.altitudeM))}),compute:()=>d(async()=>{const{DecoyFlare:n}=await import("./DecoyFlare-DUt1_LcW.js");return{DecoyFlare:n}},[],import.meta.url).then(({DecoyFlare:n})=>t=>n.bodiesOf(t))},Mn=N.catalog({en:()=>d(()=>import("./LanternKindMessages_en-CQXdJ-k6.js"),[],import.meta.url).then(n=>n.lanternKindMessages_en),fr:()=>d(()=>import("./LanternKindMessages_fr-D7tQa_tQ.js"),[],import.meta.url).then(n=>n.lanternKindMessages_fr),es:()=>d(()=>import("./LanternKindMessages_es-BOO6kPjs.js"),[],import.meta.url).then(n=>n.lanternKindMessages_es),it:()=>d(()=>import("./LanternKindMessages_it-B8J-29Mj.js"),[],import.meta.url).then(n=>n.lanternKindMessages_it)}),Ye=X.rounded,Xe={key:"lanterns",messages:Mn,phenomenon:()=>"SkyLantern",inWind:(n,t)=>{const e=n.site.altitudeM??0,r=n.windAloft?.atM??1e3;return{...n,wind:Ye(t.at(10)),windAloft:{...Ye(t.at(e+r)),atM:r}}},compute:()=>d(async()=>{const{SkyLantern:n}=await import("./SkyLantern-DJT_Ibzh.js");return{SkyLantern:n}},__vite__mapDeps([0,1]),import.meta.url).then(({SkyLantern:n})=>(t,e)=>n.bodiesOf(t,e?.obstacles)),editor:()=>d(async()=>{const{LanternEditor:n}=await import("./LanternEditor-CepeoImr.js");return{LanternEditor:n}},__vite__mapDeps([2,3,4,5,0,1,6,7,8]),import.meta.url).then(({LanternEditor:n})=>(t,e,r)=>new n(t,e,r))},An=N.catalog({en:()=>d(()=>import("./BirdKindMessages_en-c_-L7frF.js"),[],import.meta.url).then(n=>n.birdKindMessages_en),fr:()=>d(()=>import("./BirdKindMessages_fr-C1TuqqEj.js"),[],import.meta.url).then(n=>n.birdKindMessages_fr),es:()=>d(()=>import("./BirdKindMessages_es-8Zo2t0o4.js"),[],import.meta.url).then(n=>n.birdKindMessages_es),it:()=>d(()=>import("./BirdKindMessages_it-DQZcrCkf.js"),[],import.meta.url).then(n=>n.birdKindMessages_it)}),Je={key:"birds",messages:An,phenomenon:()=>"Birds",compute:()=>d(async()=>{const{BirdFlock:n}=await import("./BirdFlock-ByBkJV35.js").then(t=>t.b);return{BirdFlock:n}},__vite__mapDeps([9,1]),import.meta.url).then(({BirdFlock:n})=>(t,e)=>n.bodiesOf(t,e?.obstacles)),editor:()=>d(async()=>{const{BirdEditor:n}=await import("./BirdEditor-CBVGyUnK.js");return{BirdEditor:n}},__vite__mapDeps([10,3,4,5,9,1,8,11]),import.meta.url).then(({BirdEditor:n})=>(t,e,r)=>new n(t,e,r))},Tn=N.catalog({en:()=>d(()=>import("./DroneKindMessages_en-CLygXcsv.js"),[],import.meta.url).then(n=>n.droneKindMessages_en),fr:()=>d(()=>import("./DroneKindMessages_fr-CAX15_pk.js"),[],import.meta.url).then(n=>n.droneKindMessages_fr),es:()=>d(()=>import("./DroneKindMessages_es-B9XFRYnQ.js"),[],import.meta.url).then(n=>n.droneKindMessages_es),it:()=>d(()=>import("./DroneKindMessages_it-CSGsCaJQ.js"),[],import.meta.url).then(n=>n.droneKindMessages_it)}),Ze={quadcopter:"ConsumerDrone",saucer:"ConsumerDrone","fixed-wing":"MilitaryDrone"},Qe={key:"drones",messages:Tn,phenomenon:n=>Ze[n.airframe]??Ze.quadcopter,compute:()=>d(async()=>{const{DroneFlight:n}=await import("./DroneFlight-CGNIh9XS.js").then(t=>t.c);return{DroneFlight:n}},__vite__mapDeps([12,13]),import.meta.url).then(({DroneFlight:n})=>t=>n.bodiesOf(t)),editor:()=>d(async()=>{const{DroneEditor:n}=await import("./DroneEditor-7X9CM_3H.js");return{DroneEditor:n}},__vite__mapDeps([14,3,4,5,15,12,13,8,11]),import.meta.url).then(({DroneEditor:n})=>(t,e,r)=>new n(t,e,r))},In=N.catalog({en:()=>d(()=>import("./BalloonKindMessages_en-C6tZ-5gT.js"),[],import.meta.url).then(n=>n.balloonKindMessages_en),fr:()=>d(()=>import("./BalloonKindMessages_fr-C3QJIuDJ.js"),[],import.meta.url).then(n=>n.balloonKindMessages_fr),es:()=>d(()=>import("./BalloonKindMessages_es-BfoEjhe1.js"),[],import.meta.url).then(n=>n.balloonKindMessages_es),it:()=>d(()=>import("./BalloonKindMessages_it-CkO7mqHp.js"),[],import.meta.url).then(n=>n.balloonKindMessages_it)}),Qs=["round","star","heart","figure"];class pe{static HELIUM_KG_MOL=.0040026;static ALL=[{id:"hot-air",modelId:"ufoathome-balloon-hot-air",envelope:"open",launchVolumeM3:2550,maxVolumeM3:2550,massKg:540,dragCoefficient:.5,aspect:1.461,widthM:16.5,color:"#c8202f",stripeColor:"#f5c400",albedo:.4,burner:{heatingKS:1.2,coolingS:400,blastS:6,maxExcessK:100,flameCdM2:2e4,envelopeCdM2:40,color:"#ffb347"},phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600},{id:"party",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:.0115,maxVolumeM3:.0335,massKg:.0045,dragCoefficient:.47,aspect:1.13,color:"#d8263a",albedo:.35,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600},{id:"led",modelId:"ufoathome-balloon-led",envelope:"elastic",launchVolumeM3:.0141,maxVolumeM3:.041,massKg:.0075,dragCoefficient:.47,aspect:1.115,color:"#ffffff",albedo:.5,glow:{candela:.5,color:"#ffffff"},phenomenon:"LedBalloon",durationS:3600},{id:"foil",modelId:"ufoathome-balloon-foil",envelope:"vented",launchVolumeM3:.014,maxVolumeM3:.014,massKg:.01,dragCoefficient:.6,aspect:1.034,widthM:.45,depthRatio:.267,color:"#c9cdd2",albedo:.85,finish:"mirror",spins:!0,shapes:{round:{modelId:"ufoathome-balloon-foil",aspect:1.034,widthM:.45,depthRatio:.267,launchVolumeM3:.014,maxVolumeM3:.014,massKg:.01,color:"#c9cdd2"},star:{modelId:"ufoathome-balloon-foil-star",aspect:1.029,widthM:.5,depthRatio:.183,launchVolumeM3:.012,maxVolumeM3:.012,massKg:.009,color:"#e0b83a"},heart:{modelId:"ufoathome-balloon-foil-heart",aspect:.903,widthM:.5,depthRatio:.2,launchVolumeM3:.014,maxVolumeM3:.014,massKg:.01,color:"#d81e3c"},figure:{modelId:"ufoathome-balloon-foil-figure",aspect:1.112,widthM:.8,depthRatio:.127,launchVolumeM3:.05,maxVolumeM3:.05,massKg:.03,color:"#f0a3c8"}},phenomenon:"FoilBalloon",durationS:3600},{id:"pilot",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:.144,maxVolumeM3:.57,massKg:.045,dragCoefficient:.4,aspect:1.13,color:"#f0e6cf",albedo:.55,lamp:{candela:1,color:"#fff1c4"},phenomenon:"WeatherBalloonsOrMongolfieres",durationS:5400},{id:"weather",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:1.75,maxVolumeM3:118.9,massKg:.85,dragCoefficient:.3,aspect:1.13,color:"#f2ece0",albedo:.55,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:7200},{id:"stratospheric",modelId:"ufoathome-balloon-stratospheric",envelope:"vented",launchVolumeM3:219,maxVolumeM3:14e3,massKg:210,dragCoefficient:.4,aspect:.91,color:"#e9eef2",albedo:.8,ballastKg:20,phenomenon:"StratosphericBalloons",durationS:10800},{id:"stratospheric-large",modelId:"ufoathome-balloon-stratospheric",envelope:"vented",launchVolumeM3:730,maxVolumeM3:15e4,massKg:700,dragCoefficient:.4,aspect:.91,color:"#e9eef2",albedo:.8,ballastKg:140,phenomenon:"StratosphericBalloons",durationS:14400},{id:"superpressure",modelId:"ufoathome-balloon-latex",envelope:"superpressure",launchVolumeM3:45,maxVolumeM3:523,massKg:44,dragCoefficient:.4,aspect:1.13,color:"#eef1f4",albedo:.8,phenomenon:"StratosphericBalloons",durationS:10800},{id:"infrared",modelId:"ufoathome-balloon-stratospheric",envelope:"open",launchVolumeM3:2075,maxVolumeM3:45e3,massKg:150,dragCoefficient:.4,aspect:.91,color:"#9aa0a8",albedo:.4,insideExcessK:20,phenomenon:"StratosphericBalloons",durationS:10800},{id:"prank-candles",modelId:"ufoathome-balloon-prank",envelope:"open",launchVolumeM3:.25,maxVolumeM3:.25,massKg:.02,dragCoefficient:.6,aspect:1.515,widthM:.6,color:"#f4f4f4",albedo:.6,insideExcessK:60,spins:!0,sways:!0,flames:{count:4,candela:.5,color:"#ffb347",burnS:720,coolingS:15},phenomenon:"SkyLantern",durationS:1200},{id:"prank-flares",modelId:"ufoathome-balloon-prank",envelope:"open",launchVolumeM3:2,maxVolumeM3:2,massKg:.3,dragCoefficient:.6,aspect:1.515,widthM:1.2,color:"#2b2d30",albedo:.1,insideExcessK:80,spins:!0,sways:!0,flames:{count:1,candela:150,color:"#ff3a20",burnS:900,coolingS:30},phenomenon:"SkyLantern",durationS:1500},{id:"anti-hail",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:.65,maxVolumeM3:8,massKg:.4,dragCoefficient:.35,aspect:1.13,color:"#f2ece0",albedo:.55,torch:{aboveM:600,candela:300,color:"#ff9a3c",burnS:90,fallMS:4},phenomenon:"ParachuteFlare",durationS:1200},{id:"solar",modelId:"ufoathome-balloon-latex",envelope:"open",launchVolumeM3:14,maxVolumeM3:14,massKg:.4,dragCoefficient:.47,aspect:1.13,color:"#151515",albedo:.05,insideExcessK:10,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600},{id:"captive",modelId:"ufoathome-balloon-latex",envelope:"sealed",tethered:!0,launchVolumeM3:14,maxVolumeM3:14,massKg:8,dragCoefficient:.47,aspect:1.13,color:"#f4f4f4",albedo:.7,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600}];static byId(t){return pe.ALL.find(e=>e.id===t)}}const tr=X.rounded,er={key:"balloons",messages:In,phenomenon:n=>{const t=typeof n.balloon=="string"?n.balloon:n.balloon?.id;return(pe.byId(t)??pe.ALL[0]).phenomenon},inWind:(n,t)=>{const e=n.site.altitudeM??0;return{...n,wind:tr(t.at(10)),windsAloft:t.levels.filter(r=>r>e+10).map(r=>({...tr(t.at(r)),atM:Math.round(r-e)}))}},compute:()=>d(async()=>{const{BalloonFlight:n}=await import("./BalloonFlight-CvE7AHlm.js");return{BalloonFlight:n}},[],import.meta.url).then(({BalloonFlight:n})=>t=>n.bodiesOf(t)),editor:()=>d(async()=>{const{BalloonEditor:n}=await import("./BalloonEditor-CAKXO8DQ.js");return{BalloonEditor:n}},__vite__mapDeps([16,3,4,5,15,12,13,17,6,7,8]),import.meta.url).then(({BalloonEditor:n})=>(t,e,r)=>new n(t,e,r))},Nn=N.catalog({en:()=>d(()=>import("./AirshipKindMessages_en-DzGapVTV.js"),[],import.meta.url).then(n=>n.airshipKindMessages_en),fr:()=>d(()=>import("./AirshipKindMessages_fr-BTXNsW5W.js"),[],import.meta.url).then(n=>n.airshipKindMessages_fr),es:()=>d(()=>import("./AirshipKindMessages_es-TE93uMSC.js"),[],import.meta.url).then(n=>n.airshipKindMessages_es),it:()=>d(()=>import("./AirshipKindMessages_it-Cwa3MnJ-.js"),[],import.meta.url).then(n=>n.airshipKindMessages_it)}),de=(n,t,e,r=5)=>({"nav-left":{color:"#ff2a1a",candela:r,leds:[{at:n,radiusM:.06}]},"nav-right":{color:"#2aff5a",candela:r,leds:[{at:t,radiusM:.06}]},tail:{color:"#ffffff",candela:r,leds:[{at:e,radiusM:.06}]}});class he{static ALL=[{id:"blimp",modelId:"ufoathome-airship-blimp",sizeM:{widthM:14.72,lengthM:59.46,heightM:17.59},cruiseMS:15,maxSpeedMS:22,color:"#c9ccd1",finColor:"#1d3f8a",albedo:.6,sign:{color:"#fff4d8",luminanceCdM2:150,lit:!0},lights:{...de([-1.22,-8.6,-9],[1.22,-8.6,-9],[0,0,29.7]),strobe:{color:"#ffffff",candela:400,hz:1,flashS:.06,leds:[{at:[0,-10.15,-9],radiusM:.08}]}},sound:"light-piston",phenomenon:"Airship"},{id:"zeppelin-nt",modelId:"ufoathome-airship-zeppelin-nt",sizeM:{widthM:18.2,lengthM:75.11,heightM:19.55},cruiseMS:19,maxSpeedMS:35,color:"#eef0f2",finColor:"#eef0f2",albedo:.75,sign:{color:"#fff4d8",luminanceCdM2:150,lit:!1},lights:{...de([-1.32,-8.4,-14],[1.32,-8.4,-14],[0,0,37.5]),strobe:{color:"#ffffff",candela:400,hz:1,flashS:.06,leds:[{at:[0,-9.65,-14],radiusM:.08}]}},sound:"light-piston",phenomenon:"Airship"},{id:"lightship",modelId:"ufoathome-airship-lightship",sizeM:{widthM:10.16,lengthM:39.66,heightM:11.98},cruiseMS:13,maxSpeedMS:20,color:"#f4f4f2",finColor:"#f4f4f2",albedo:.7,glowCdM2:20,lights:de([-.82,-5.9,-6],[.82,-5.9,-6],[0,0,19.8]),sound:"light-piston",phenomenon:"Airship"},{id:"aerostat",modelId:"ufoathome-airship-aerostat",sizeM:{widthM:25.14,lengthM:63.6,heightM:27.05},cruiseMS:0,maxSpeedMS:0,tethered:!0,color:"#f2f2f0",finColor:"#f2f2f0",albedo:.7,lights:{nose:{color:"#ff2a1a",candela:2e3,hz:.5,flashS:.6,leds:[{at:[0,-4.2,-30],radiusM:.12}]},stern:{color:"#ff2a1a",candela:2e3,hz:.5,flashS:.6,leds:[{at:[0,-6.3,22],radiusM:.12}]}},phenomenon:"Airship"},{id:"rigid",modelId:"ufoathome-airship-rigid",sizeM:{widthM:33.38,lengthM:236.66,heightM:35.79},cruiseMS:32,maxSpeedMS:36,color:"#b9bcbf",finColor:"#b9bcbf",albedo:.55,lights:de([-3.02,-16.5,-80],[3.02,-16.5,-80],[0,0,118.3],10),sound:"piston-heavy",phenomenon:"Airship"}];static byId(t){return he.ALL.find(e=>e.id===t)}}const rr={key:"airships",messages:Nn,phenomenon:n=>{const t=typeof n.airship=="string"?n.airship:n.airship?.id;return(he.byId(t)??he.ALL[0]).phenomenon},compute:()=>d(async()=>{const{AirshipFlight:n}=await import("./AirshipFlight-6yYGIRn8.js");return{AirshipFlight:n}},__vite__mapDeps([18,12,13]),import.meta.url).then(({AirshipFlight:n})=>t=>n.bodiesOf(t)),editor:()=>d(async()=>{const{AirshipEditor:n}=await import("./AirshipEditor-EBfUtSiB.js");return{AirshipEditor:n}},__vite__mapDeps([19,3,4,5,15,12,13,18,8,11]),import.meta.url).then(({AirshipEditor:n})=>(t,e,r)=>new n(t,e,r))},Qr=A.point("interpretations").provide(A.BUILT_IN,[{id:We.key,name:"Decoy flares",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>We},{id:Xe.key,name:"Sky lanterns",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>Xe},{id:Je.key,name:"Birds",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>Je},{id:Qe.key,name:"Drones",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>Qe},{id:er.key,name:"Balloons",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>er},{id:rr.key,name:"Airships",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>rr}]);class $e{static kinds(){return Qr.map(t=>_.of(t))}}const to=Object.freeze(Object.defineProperty({__proto__:null,INTERPRETATION_SOURCES:Qr,InterpretationRegistry:$e},Symbol.toStringTag,{value:"Module"}));class z{static SIGHTING_EVENT="sighting";static INTERPRETATION_EVENT="interpretation";static INTERVIEW_EVENT="interview";static check(t){return ht.check(t,"case")}static isCase(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&Array.isArray(t.events)&&!("timeline"in t)}static sightingUrls(t,e){return(t.events??[]).filter(r=>r.eventType===z.SIGHTING_EVENT&&!r.interpretationOf&&typeof r.url=="string"&&r.url!=="").map(r=>new URL(r.url,e).href)}static accountIds(t,e,r,s){const o=(t.events??[]).filter(i=>i.eventType===z.SIGHTING_EVENT&&i.id!==void 0&&typeof i.url=="string"&&r!==void 0&&new URL(i.url,e).href===r).map(i=>i.id);return s!==void 0&&o.push(s),o}static interpretationEvents(t,e){const r=[e].flat().filter(s=>!!s);return r.length===0?[]:(t.events??[]).filter(s=>s.eventType===z.INTERPRETATION_EVENT?s.sighting!==void 0&&r.includes(s.sighting):s.eventType!==z.SIGHTING_EVENT||s.interpretationOf===void 0?!1:[s.interpretationOf].flat().some(o=>r.includes(o))).map(s=>s)}static problems(t,e){const r=t.events??[],s=new Set,o=new Set;for(const a of r)a.id!==void 0&&(s.has(a.id)&&o.add(a.id),s.add(a.id));const i=[];for(const a of r){const l=a.eventType===z.SIGHTING_EVENT?a.interpretationOf:a.eventType===z.INTERVIEW_EVENT?a.interviewOf:void 0;if(l!==void 0)for(const c of[l].flat())!s.has(c)&&!e.includes(c)&&i.push({reading:a.url??a.id??"",reference:c})}return{duplicateIds:[...o],unresolved:i}}static async interpretationOf(t,e,r){if(t.bodies)return z.withModelsFrom(j.strip({title:t.title,bodies:t.bodies??[],smoke:t.smoke,findings:t.findings,..._.computedPart(t,$e.kinds())}).recording,e);if(!t.url)return{title:t.title,bodies:[]};const s=new URL(t.url,e).href,o=await r(s),i="timeline"in o&&o.interpretation?o.interpretation:o;return z.withModelsFrom(j.strip({title:t.title??i.title,bodies:i.bodies??[],smoke:i.smoke,findings:i.findings,..._.computedPart(i,$e.kinds())}).recording,s)}static withModelsFrom(t,e){return{...t,bodies:t.bodies.map(r=>r.model?.url?{...r,model:{...r.model,url:new URL(r.model.url,e).href}}:r)}}}class F{static files=new Map;static hold(t){for(const[e,r]of t)F.files.set(F.key(e),r)}static releaseCopies(){for(const[t,e]of F.files)e.local||F.files.delete(t)}static clear(){F.files.clear()}static localBase(){return new URL(`local/${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}/`,location.href).href}static read(t){const e=F.files.get(F.key(t));return e===void 0?void 0:structuredClone(e.json)}static changed(...t){return t.some(e=>e!==void 0&&F.files.get(F.key(e))?.changed===!0)}static local(t){return t!==void 0&&F.files.get(F.key(t))?.local===!0}static key(t){const e=new URL(t,location.href);return e.hash="",e.href}}class Q{static NAMES=["weather","place","lightPollution","decor"];static KEYS={weather:["weatherTrack","weatherSource"],place:["place"],lightPollution:["lightPollution"],decor:["decor"]};static annexName(t,e){return`${t}.${e.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`)}.json`}static taken(t,e){const r={};if(t==="decor")return Array.isArray(e.decor)&&(r.decor=e.decor.filter(Q.surveyed)),r;for(const s of Q.KEYS[t])e[s]!==void 0&&(r[s]=e[s]);return r}static strip(t,e){if(t==="decor"){const r=Array.isArray(e.decor)?e.decor.filter(s=>!Q.surveyed(s)):[];r.length>0?e.decor=r:delete e.decor;return}for(const r of Q.KEYS[t])delete e[r]}static put(t,e,r){if(t==="decor"){if(!Array.isArray(r.decor))return;const s=Array.isArray(e.decor)?e.decor.filter(o=>!Q.surveyed(o)):[];e.decor=[...s,...r.decor];return}for(const s of Q.KEYS[t])r[s]!==void 0&&(e[s]=r[s])}static surveyed(t){return typeof t=="object"&&t!==null&&typeof t.origin=="string"}static fromFile(t,e){return t?.[e]!==void 0&&t[e].live!==!0}}class tn{static NAMES=["relief","imagery","roads","water","railways","upperAir","map"];static TERRAIN=["relief","imagery","roads","water","railways"];static held(t,e){if(!t||t.live)return;const r=t[e];return r&&!r.live&&!r.refresh&&r.src!==void 0?r:void 0}static isLive(t,e){return t?.live===!0||t?.[e]?.live===!0}static annexName(t,e){const r=e==="relief"||e==="imagery"||e==="map"?"zip":"json",s=e.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`);return`${t}.${s}.${r}`}static isEmpty(t){return!t||!t.live&&tn.NAMES.every(e=>!t[e])&&Q.NAMES.every(e=>!t[e])}}class It extends Error{constructor(t,e,r){super(`${t}: ${e}${r===void 0?"":` (HTTP ${r})`}`),this.kind=t,this.url=e,this.status=r,this.name="SightingFetchError"}}class fe{static async recording(t){const e=F.read(t);if(e!==void 0)return e;const r=await fe.json(t);for(const s of Q.NAMES){const o=r?.snapshots?.[s];if(!(!o?.src||o.live))try{const i=ht.recording(await fe.json(new URL(o.src,new URL(t,location.href)).href));Q.put(s,r,i)}catch{}}return r}static async json(t){const e=new URL(t,location.href),r=F.read(e.href);if(r!==void 0)return r;if(location.protocol==="https:"&&e.protocol==="http:")throw new It("mixed-content",t);let s;try{s=await fetch(t)}catch{throw await this.diagnose(t,e)}if(!s.ok)throw new It("status",t,s.status);try{return await s.json()}catch{throw new It("malformed",t)}}static async diagnose(t,e){if(e.origin===location.origin)return new It("unreachable",t);try{return await fetch(t,{mode:"no-cors"}),new It("cors",t)}catch{return new It("unreachable",t)}}}class Pe{constructor(t,e,r=()=>{}){this.place=t,this.changed=r,e&&this.adopt(e)}reader;editor;handed;get reading(){return this.reader!==void 0}get editorLoaded(){return this.editor!==void 0}adopt(t){this.editor=t,t.switcher=this,t.hasAttribute(xe)||t.setAttribute(xe,""),t.addEventListener(gn,e=>{e.preventDefault();const r=e.detail;this.handed=r.src,this.read(r)})}async read({src:t,track:e}){const[{register:r,CASE_ELEMENT_NAME:s,OPEN_EVENTS_ATTRIBUTE:o},{registerSighting:i,SIGHTING_ELEMENT_NAME:a}]=await Promise.all([d(()=>import("./CaseElement-DVXLO8mr.js"),__vite__mapDeps([20,21,22,6,7,23,3,4,13,24,25,1,26]),import.meta.url),d(()=>import("./SightingElement-CUrYpWRD.js"),__vite__mapDeps([26,22,6,7,23,3,4,13,24,25,1]),import.meta.url)]);i(),r();const l=z.isCase(F.read(t)??await fe.json(t)),c=document.createElement(l?s:a);c.setAttribute(xe,""),c.setAttribute("show-labels",""),l&&e&&c.setAttribute(o,Pe.fileKey(e)),c.setAttribute("src",t),c.addEventListener(wn,m=>{m.preventDefault(),this.edit(m.detail)}),this.reader?.remove(),this.place(c),this.editor&&(this.editor.hidden=!0),this.reader=c,this.changed({mode:"read",src:t,...e?{track:e}:{}})}async edit(t){const e=this.editor;if(e){if(this.dropReader(),F.releaseCopies(),e.hidden=!1,this.changed({mode:"edit"}),t?.src!==void 0&&t.src!==this.handed){this.load(e,t.src,t.track);return}t?.track&&await e.openTrack(t.track);return}const{register:r,CASE_EDITOR_ELEMENT_NAME:s}=await d(async()=>{const{register:i,CASE_EDITOR_ELEMENT_NAME:a}=await import("./CaseEditorElement-BgT6HnpX.js").then(l=>l.a);return{register:i,CASE_EDITOR_ELEMENT_NAME:a}},__vite__mapDeps([27,3,4,8,21,22,6,7,23,13,24,25,1,11,28,29,30,31]),import.meta.url);r();const o=document.createElement(s);this.adopt(o),t?.track&&o.setAttribute("track",t.track),t?.src?o.setAttribute("src",t.src):t?.start&&(o.caseStart=t.start),this.dropReader(),this.place(o),this.changed({mode:"edit"})}async open(t){const e=this.editor;if(this.reading||!e)return this.read({src:t});this.load(e,t)}load(t,e,r){this.handed=void 0,r?t.setAttribute("track",r):t.removeAttribute("track"),t.setAttribute("src",e)}async startNew(t){const e=this.editor;if(!e)return this.edit(t?{start:t}:void 0);this.reading&&await this.edit(),e.askBeforeReplacing(()=>{e.remove(),this.editor=void 0,this.edit(t?{start:t}:void 0)})}dropReader(){this.reader?.remove(),this.reader=void 0}static fileKey(t){return new URL(t,location.href).pathname.split("/").pop().replace(/\.json$/i,"")}}const Fe="rr0-input-file",en={inputFileFromFile:"from your disk",inputFileFromUrl:"from an address",inputFileModeHint:"Click to give it the other way: a file of yours, or an address",inputFileLoad:"Load"},_n=`
3
3
  rr0-input-file { display: inline-flex; align-items: center; gap: .3em; }
4
4
  /* As the date's own switch (see DateInputElement): it reads as part of the label, before the field. */
5
5
  rr0-input-file .input-file-mode { order: -1; font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-decoration: underline; text-underline-offset: .15em; }
@@ -8,8 +8,8 @@ rr0-input-file .input-file-mode:focus-visible { outline: 2px solid #4af; outline
8
8
  /* As long as the address it holds, from 18em: an annex's is longer than that, and cut it says nothing of where it is. */
9
9
  rr0-input-file input[type="url"] { field-sizing: content; min-width: 18em; max-width: min(100%, 60vw); }
10
10
  rr0-input-file [hidden] { display: none !important; }
11
- `;class Zr extends HTMLElement{fileInput;urlInput;loadButton;modeButton;wording=Jr;shownMode="file";build(){if(this.fileInput)return;const t=this.getAttribute("name"),e=this.ownerDocument,r=e.createElement("style");r.textContent=An;const s=this.fileInput=e.createElement("input");s.type="file";const o=this.getAttribute("accept");o&&(s.accept=o),s.multiple=this.hasAttribute("multiple");const i=this.urlInput=e.createElement("input");i.type="url",i.placeholder=this.getAttribute("placeholder")??"https://…";const a=this.loadButton=e.createElement("button");a.type="button",a.hidden=this.hasAttribute("no-button");const l=this.modeButton=e.createElement("button");l.type="button",l.className="input-file-mode",t&&(s.id=`${t}-file`,i.id=`${t}-url`,a.id=`${t}-url-button`,l.id=`${t}-mode`),this.append(r,s,i,a,l),s.addEventListener("change",()=>{const c=[...s.files??[]];c.length!==0&&(this.pick({file:c[0],files:c}),this.hasAttribute("keep-file")||(s.value=""))}),s.addEventListener("click",c=>{const m=window.showOpenFilePicker;!this.hasAttribute("handles")||typeof m!="function"||(c.preventDefault(),this.pickHandles(m))}),a.addEventListener("click",()=>this.commitUrl()),i.addEventListener("keydown",c=>{c.key==="Enter"&&(c.preventDefault(),this.commitUrl())}),this.hasAttribute("no-button")&&i.addEventListener("change",()=>this.commitUrl()),l.addEventListener("click",()=>{this.mode=this.shownMode==="file"?"url":"file",(this.shownMode==="file"?s:i).focus()}),this.shownMode=this.getAttribute("mode")==="url"?"url":"file",this.render()}connectedCallback(){this.build()}async pickHandles(t){let e;try{const s=(this.getAttribute("accept")??"").split(",").map(o=>o.trim()).filter(o=>o.startsWith("."));e=await t({multiple:this.hasAttribute("multiple"),...s.length?{types:[{accept:{"application/json":s}}]}:{}})}catch{return}if(e.length===0)return;const r=await Promise.all(e.map(s=>s.getFile()));this.pick({file:r[0],files:r,handles:e})}commitUrl(){const t=this.urlInput.value.trim();t&&this.pick({url:t})}pick(t){this.dispatchEvent(new CustomEvent("filepick",{detail:t,bubbles:!0,composed:!0}))}render(){const t=this.shownMode==="file";this.fileInput.hidden=!t,this.urlInput.hidden=t,this.loadButton.hidden=t||this.hasAttribute("no-button"),this.modeButton.textContent=t?this.wording.inputFileFromFile:this.wording.inputFileFromUrl,this.modeButton.title=this.wording.inputFileModeHint,this.loadButton.textContent=this.wording.inputFileLoad}get mode(){return this.shownMode}set mode(t){this.build(),this.shownMode=t,this.render()}get url(){return this.build(),this.urlInput.value.trim()}set url(t){this.build(),this.urlInput.value=t,t&&(this.mode="url")}get file(){return this.build(),this.fileInput.files?.[0]??void 0}get value(){if(this.mode==="file"){const t=this.file;return t?{file:t}:void 0}return this.url?{url:this.url}:void 0}clear(){this.build(),this.fileInput.value="",this.urlInput.value=""}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.build(),this.toggleAttribute("disabled",t);for(const e of[this.fileInput,this.urlInput,this.loadButton,this.modeButton])e.disabled=t}openPicker(){this.build(),this.fileInput.click()}focus(){this.build(),(this.shownMode==="file"?this.fileInput:this.urlInput).focus()}get controls(){return this.build(),{file:this.fileInput,url:this.urlInput,load:this.loadButton,mode:this.modeButton}}set messages(t){this.wording=t,this.fileInput&&this.render()}set placeholder(t){this.build(),this.urlInput.placeholder=t}static async bytesOf(t,e=fetch.bind(globalThis)){if(t.file)return new Uint8Array(await new Promise((s,o)=>{const i=new FileReader;i.onload=()=>s(i.result),i.onerror=()=>o(i.error),i.readAsArrayBuffer(t.file)}));const r=await e(t.url);if(!r.ok)throw new Error(`${r.status} ${t.url}`);return new Uint8Array(await r.arrayBuffer())}}function Qr(){customElements.get(Ie)||customElements.define(Ie,Zr)}const Ws=Object.freeze(Object.defineProperty({__proto__:null,INPUT_FILE_ELEMENT_NAME:Ie,InputFileElement:Zr,inputFileMessages_en:Jr,register:Qr},Symbol.toStringTag,{value:"Module"}));class R{static MAX=12;static DATABASE="rr0-ufoathome";static STORE="recent";static async list(){try{return(await R.request("readonly",e=>e.getAll())).sort((e,r)=>r.openedAt-e.openedAt)}catch{return[]}}static async add(t){try{const e=(await R.list()).filter(r=>R.key(r)!==R.key(t)).slice(0,R.MAX-1);await R.request("readwrite",r=>{r.clear();for(const s of[t,...e])r.put(s,R.key(s));return r.count()})}catch{}}static async remove(t){try{await R.request("readwrite",e=>e.delete(R.key(t)))}catch{}}static async files(t){if(t.kind==="copy")return t.copies.map(e=>new File([e.text],e.name,{type:"application/json"}));if(t.kind!=="address"){for(const e of t.handles){const r=await e.queryPermission?.({mode:"read"});if(r!==void 0&&r!=="granted"&&await e.requestPermission?.({mode:"read"})!=="granted")throw new Error(`${e.name} may not be read again`)}return Promise.all(t.handles.map(e=>e.getFile()))}}static key(t){return t.kind==="address"?`address ${t.url}`:`files ${[...t.kind==="handles"?t.handles.map(r=>r.name):t.copies.map(r=>r.name)].sort().join(`
12
- `)}`}static request(t,e){return new Promise((r,s)=>{const o=indexedDB.open(R.DATABASE,1);o.onupgradeneeded=()=>o.result.createObjectStore(R.STORE),o.onerror=()=>s(o.error),o.onsuccess=()=>{const i=o.result,a=i.transaction(R.STORE,t),l=e(a.objectStore(R.STORE));a.oncomplete=()=>{i.close(),r(l.result)},a.onerror=()=>{i.close(),s(a.error)}}})}}class we{static TOKENS=`
11
+ `;class rn extends HTMLElement{fileInput;urlInput;loadButton;modeButton;wording=en;shownMode="file";build(){if(this.fileInput)return;const t=this.getAttribute("name"),e=this.ownerDocument,r=e.createElement("style");r.textContent=_n;const s=this.fileInput=e.createElement("input");s.type="file";const o=this.getAttribute("accept");o&&(s.accept=o),s.multiple=this.hasAttribute("multiple");const i=this.urlInput=e.createElement("input");i.type="url",i.placeholder=this.getAttribute("placeholder")??"https://…";const a=this.loadButton=e.createElement("button");a.type="button",a.hidden=this.hasAttribute("no-button");const l=this.modeButton=e.createElement("button");l.type="button",l.className="input-file-mode",t&&(s.id=`${t}-file`,i.id=`${t}-url`,a.id=`${t}-url-button`,l.id=`${t}-mode`),this.append(r,s,i,a,l),s.addEventListener("change",()=>{const c=[...s.files??[]];c.length!==0&&(this.pick({file:c[0],files:c}),this.hasAttribute("keep-file")||(s.value=""))}),s.addEventListener("click",c=>{const m=window.showOpenFilePicker;!this.hasAttribute("handles")||typeof m!="function"||(c.preventDefault(),this.pickHandles(m))}),a.addEventListener("click",()=>this.commitUrl()),i.addEventListener("keydown",c=>{c.key==="Enter"&&(c.preventDefault(),this.commitUrl())}),this.hasAttribute("no-button")&&i.addEventListener("change",()=>this.commitUrl()),l.addEventListener("click",()=>{this.mode=this.shownMode==="file"?"url":"file",(this.shownMode==="file"?s:i).focus()}),this.shownMode=this.getAttribute("mode")==="url"?"url":"file",this.render()}connectedCallback(){this.build()}async pickHandles(t){let e;try{const s=(this.getAttribute("accept")??"").split(",").map(o=>o.trim()).filter(o=>o.startsWith("."));e=await t({multiple:this.hasAttribute("multiple"),...s.length?{types:[{accept:{"application/json":s}}]}:{}})}catch{return}if(e.length===0)return;const r=await Promise.all(e.map(s=>s.getFile()));this.pick({file:r[0],files:r,handles:e})}commitUrl(){const t=this.urlInput.value.trim();t&&this.pick({url:t})}pick(t){this.dispatchEvent(new CustomEvent("filepick",{detail:t,bubbles:!0,composed:!0}))}render(){const t=this.shownMode==="file";this.fileInput.hidden=!t,this.urlInput.hidden=t,this.loadButton.hidden=t||this.hasAttribute("no-button"),this.modeButton.textContent=t?this.wording.inputFileFromFile:this.wording.inputFileFromUrl,this.modeButton.title=this.wording.inputFileModeHint,this.loadButton.textContent=this.wording.inputFileLoad}get mode(){return this.shownMode}set mode(t){this.build(),this.shownMode=t,this.render()}get url(){return this.build(),this.urlInput.value.trim()}set url(t){this.build(),this.urlInput.value=t,t&&(this.mode="url")}get file(){return this.build(),this.fileInput.files?.[0]??void 0}get value(){if(this.mode==="file"){const t=this.file;return t?{file:t}:void 0}return this.url?{url:this.url}:void 0}clear(){this.build(),this.fileInput.value="",this.urlInput.value=""}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.build(),this.toggleAttribute("disabled",t);for(const e of[this.fileInput,this.urlInput,this.loadButton,this.modeButton])e.disabled=t}openPicker(){this.build(),this.fileInput.click()}focus(){this.build(),(this.shownMode==="file"?this.fileInput:this.urlInput).focus()}get controls(){return this.build(),{file:this.fileInput,url:this.urlInput,load:this.loadButton,mode:this.modeButton}}set messages(t){this.wording=t,this.fileInput&&this.render()}set placeholder(t){this.build(),this.urlInput.placeholder=t}static async bytesOf(t,e=fetch.bind(globalThis)){if(t.file)return new Uint8Array(await new Promise((s,o)=>{const i=new FileReader;i.onload=()=>s(i.result),i.onerror=()=>o(i.error),i.readAsArrayBuffer(t.file)}));const r=await e(t.url);if(!r.ok)throw new Error(`${r.status} ${t.url}`);return new Uint8Array(await r.arrayBuffer())}}function nn(){customElements.get(Fe)||customElements.define(Fe,rn)}const eo=Object.freeze(Object.defineProperty({__proto__:null,INPUT_FILE_ELEMENT_NAME:Fe,InputFileElement:rn,inputFileMessages_en:en,register:nn},Symbol.toStringTag,{value:"Module"}));class V{static MAX=12;static DATABASE="rr0-ufoathome";static STORE="recent";static async list(){try{return(await V.request("readonly",e=>e.getAll())).sort((e,r)=>r.openedAt-e.openedAt)}catch{return[]}}static async add(t){try{const e=(await V.list()).filter(r=>V.key(r)!==V.key(t)).slice(0,V.MAX-1);await V.request("readwrite",r=>{r.clear();for(const s of[t,...e])r.put(s,V.key(s));return r.count()})}catch{}}static async remove(t){try{await V.request("readwrite",e=>e.delete(V.key(t)))}catch{}}static async files(t){if(t.kind==="copy")return t.copies.map(e=>new File([e.text],e.name,{type:"application/json"}));if(t.kind!=="address"){for(const e of t.handles){const r=await e.queryPermission?.({mode:"read"});if(r!==void 0&&r!=="granted"&&await e.requestPermission?.({mode:"read"})!=="granted")throw new Error(`${e.name} may not be read again`)}return Promise.all(t.handles.map(e=>e.getFile()))}}static key(t){return t.kind==="address"?`address ${t.url}`:`files ${[...t.kind==="handles"?t.handles.map(r=>r.name):t.copies.map(r=>r.name)].sort().join(`
12
+ `)}`}static request(t,e){return new Promise((r,s)=>{const o=indexedDB.open(V.DATABASE,1);o.onupgradeneeded=()=>o.result.createObjectStore(V.STORE),o.onerror=()=>s(o.error),o.onsuccess=()=>{const i=o.result,a=i.transaction(V.STORE,t),l=e(a.objectStore(V.STORE));a.oncomplete=()=>{i.close(),r(l.result)},a.onerror=()=>{i.close(),s(a.error)}}})}}class ve{static TOKENS=`
13
13
  --ink: light-dark(#131a26, #e8ecf4);
14
14
  --ink-dim: light-dark(#4c5a70, #a3adc2);
15
15
  --ink-faint: light-dark(#78859b, #6f7b93);
@@ -108,19 +108,27 @@ ${t} :is(select:not([multiple]):not([size]), .rr0-select) {
108
108
  :where(${t}) :where(.icon-btn) { min-width: 36px; padding: 0; border-radius: 8px; }
109
109
  :where(${t}) input[type="range"] { accent-color: var(--glow-solid); }
110
110
  :where(${t}) input[type="checkbox"], :where(${t}) input[type="radio"] { accent-color: var(--glow-solid); }
111
- `}}class C{static INFO="message-info";static WARNING="message-warning";static ERROR="message-error";static CSS=C.rules();static rules(t=[],e=[],r=[]){const s=(o,i)=>[`.${o}`,...i].join(", ");return`
111
+ `}}class q{static INFO="message-info";static WARNING="message-warning";static ERROR="message-error";static CSS=q.rules();static rules(t=[],e=[],r=[]){const s=(o,i)=>[`.${o}`,...i].join(", ");return`
112
112
  /* A component's messages: information muted, warnings orange, errors red, all three at one smaller size (see MessageStyle). */
113
- :is(${s(C.INFO,t)}, ${s(C.WARNING,e)}, ${s(C.ERROR,r)}) { font-size: var(--rr0-message-font-size, 0.78em); line-height: var(--rr0-message-line-height, 1.3); font-weight: normal; opacity: 1; }
114
- :is(${s(C.INFO,t)}) { color: color-mix(in srgb, CanvasText 62%, transparent); }
115
- :is(${s(C.WARNING,e)}) { color: color-mix(in srgb, #e48a00 72%, CanvasText); }
116
- :is(${s(C.ERROR,r)}) { color: color-mix(in srgb, #e5322d 72%, CanvasText); }
117
- `}static show(t,e,r="info"){t.textContent=e??"",t.hidden=!e,t.classList.toggle(C.INFO,r==="info"),t.classList.toggle(C.WARNING,r==="warning"),t.classList.toggle(C.ERROR,r==="error")}}class z{static FORMAT=1;static read=new Map;static load(t,e=fetch.bind(globalThis)){const r=new URL(t,typeof location>"u"?void 0:location.href).href;let s=z.read.get(r);return s||(s=(async()=>{const o=await e(r);if(!o.ok)throw new Error(`${r}: HTTP ${o.status}`);return z.check(await o.json(),r)})(),s.catch(()=>z.read.delete(r)),z.read.set(r,s)),s}static check(t,e){const r=t;if(r===null||typeof r!="object"||!Array.isArray(r.starts))throw new Error(`${e}: not a UFO@home case template`);if(typeof r.format=="number"&&r.format>z.FORMAT)throw new Error(`${e}: format ${r.format} is newer than ${z.FORMAT}`);const s=a=>new URL(a,e).href,o=z.recipientOf(r.recipient,e),i=r.starts.filter(a=>typeof a?.id=="string").map(a=>({...a,...o?{recipient:o}:{},...a.questionnaires?{questionnaires:a.questionnaires.filter(l=>typeof l=="string").map(l=>z.isAddress(l)?s(l):l)}:{},...a.modules?{modules:a.modules.filter(l=>typeof l=="string").map(s)}:{}}));if(i.length===0)throw new Error(`${e}: a case template offers no start`);return{format:1,id:typeof r.id=="string"?r.id:e,title:r.title??r.id??e,...r.modules?{modules:r.modules.filter(a=>typeof a=="string").map(s)}:{},...o?{recipient:o}:{},starts:i,url:e}}static recipientOf(t,e){if(t===void 0)return;const r=t?.publicKey;if(typeof t.id!="string"||!r||r.kty!=="RSA"||typeof r.n!="string")throw new Error(`${e}: its recipient has no RSA public key`);if(r.d!==void 0)throw new Error(`${e}: its recipient gives a private key, which must never be published`);const{kty:s,n:o,e:i,alg:a}=r;return{id:t.id,name:t.name??t.id,publicKey:{kty:s,n:o,e:i,...a?{alg:a}:{}},...typeof t.email=="string"&&/^[^@\s]+@[^@\s]+$/.test(t.email)?{email:t.email}:{}}}static isAddress(t){return/[/:]|\.json$/i.test(t)}static step(t){return t.start??(t.questionnaires?.length?"questionnaire":"observation")}}class B extends Error{}class le{constructor(t){this.name=t}validate(t){return!0}}class tn extends le{min;max;constructor(t,e,r){super(t),this.min=e,this.max=r}validate(t){if(typeof t!="number")throw new B(`${this.name} value must be a number, but was ${t}`);if(t<this.min||t>this.max)throw new B(`${this.name} value must be >= ${this.min} and <= ${this.max}, but was ${t}`);return super.validate(t)}}class x{name;min;max;duration;subUnit;validator;constructor(t,e,r,s,o=new tn(t,e,r)){this.name=t,this.min=e,this.max=r,this.subUnit=s,this.duration=s?(s.max-s.min+1)*s.duration:1,this.validator=o}validate(t){return this.validator.validate(t)}[Symbol.iterator](){let t=this.min;return{next:()=>{const e={done:t>this.max,value:t};return t++,e}}}}class ke{millisecond;second;minute;hour;day;month;year}class _n extends ke{}class en extends _n{millisecond=new x("millisecond",0,999,void 0);second=new x("second",0,59,this.millisecond);minute=new x("minute",0,59,this.second);hour=new x("hour",0,23,this.minute);day=new x("day",1,31,this.hour);month=new x("month",1,12,this.day);year=new x("year",0,9999,this.month)}const g=new en;class rn extends tn{constructor(t=1,e=12){super("month",t,e)}}class vt extends x{static Month28=new vt(28);static Month29=new vt(29);static ThirtyDays=new vt(30);static ThirtyOneDays=new vt(31);constructor(t,e=new rn(1,t)){super("month",1,t,g.day,e)}static create(t,e){switch(t){case 1:case 3:case 5:case 7:case 8:case 10:case 12:return this.ThirtyOneDays;case 2:return e%4===0?this.Month29:this.Month28;case 4:case 6:case 9:case 11:return this.ThirtyDays;default:throw new B("Unsupported month",t,e)}}}class W{static instance=new W;render(t){return t.value.toString()}}class F{unit;#t;constructor(t,e){this.unit=e,this.value=typeof t=="number"?t:t.value}get value(){return this.#t}set value(t){this.unit.validate(t),this.#t=t}get duration(){return this.value*this.unit.duration}#e(t){if(this.constructor.name!==t.constructor.name)throw new le(`${this.unit.name} "${this.toString()}" cannot be compared with ${t.unit?.name} "${t.toString()}"`)}compare(t){return this.#e(t),this.value-t.value}isEqual(t){return this.compare(t)===0}isBefore(t){return this.compare(t)<0}isAfter(t){return this.compare(t)>0}previous(t=this.unit){const e=this.value-1;return new this.constructor(e,t)}next(t=this.unit){const e=this.value+1;return new this.constructor(e,t)}toString(t=W.instance){return t.render(this)}toSpec(){return{value:this.value}}toJSON(){return this.toSpec()}}class h{static#t=new Map;static register(t,e){h.#t.set(t,e)}static get(t){const e=h.#t.get(t);if(!e)throw new B(`No default parser registered for ${t.name}: import "@rr0/time/defaults" or pass a parser to fromString()`);return e()}}class Nt extends F{constructor(t=new Date().getFullYear(),e=g.year){super(t,e)}static fromString(t,e=h.get(Nt)){return new Nt(e.parse(t))}}class X extends W{static default=new X("0",2);constructor(t,e){super(),this.char=t,this.size=e}render(t){return super.render(t).padStart(this.size,this.char)}}class Gt extends F{constructor(t=new Date().getMonth()+1,e=g.month){super(t,e)}static fromString(t,e=h.get(Gt)){return new Gt(e.parse(t))}toString(t=X.default){return super.toString(t)}}class It extends F{constructor(t=new Date().getDate(),e=g.day){super(t,e)}static fromString(t,e=h.get(It)){const r=e.parse(t);return new It(r)}toString(t=X.default){return super.toString(t)}}class Rt extends F{constructor(t=new Date().getHours(),e=g.hour){super(t,e)}static fromString(t,e=h.get(Rt)){return new Rt(e.parse(t))}toString(t=X.default){return super.toString(t)}}class Vt extends F{constructor(t=new Date().getMinutes(),e=g.minute){super(t,e)}static fromString(t,e=h.get(Vt)){return new Vt(e.parse(t))}toString(t=X.default){return super.toString(t)}}class kt extends F{constructor(t=new Date().getSeconds(),e=g.second){super(t,e)}static fromString(t,e=h.get(kt)){return new kt(e.parse(t),g.second)}toString(t=X.default){return super.toString(t)}}class wt extends F{static renderer=new X("0",3);constructor(t,e=g.millisecond){super(t,e)}static parseFraction(t){return parseInt(t.padEnd(3,"0").substring(0,3),10)}toString(t=wt.renderer){return super.toString(t)}}class Tn{render(t){return t.toString()}}class Nn extends Tn{render(t){const e=t.value,r=Math.abs(e),s=Math.floor(r/60),o=r%60;if(s===0&&o===0)return"Z";{const i=e<0?"-":"+",a=s.toString().padStart(2,"0"),l=o>0?":"+o.toString().padEnd(2,"0"):"";return i+a+l}}}class gt{value;name="timeshift";renderer;constructor(t=0){this.value=t}static fromString(t,e=h.get(gt),r=void 0){const s=e.parse(t,r);return new gt(s)}toString(t=new Nn){return t.render(this)}toSpec(){return{value:this.value}}toJSON(){return this.toSpec()}}class ${static timeshift(t,e){return t+($.isDaylight(e)?60:0)}static isDaylight(t){const{year:e,month:r,day:s}=t,o=t.hour??12;if(![e,r,s].every(Number.isInteger))throw new RangeError("Daylight saving time depends on the year, month and day");const i=$.rule(e);if(!i)return!1;const a=$.rank(r,s,o);return a>=$.rank(i.start.month,i.start.day,2)&&a<$.rank(i.end.month,i.end.day,2)}static rule(t){if(t<1967)return;const e={month:10,day:$.sunday(t,10,-1)};return t>=2007?{start:{month:3,day:$.sunday(t,3,2)},end:{month:11,day:$.sunday(t,11,1)}}:t>=1987?{start:{month:4,day:$.sunday(t,4,1)},end:e}:t===1975?{start:{month:2,day:23},end:e}:t===1974?{start:{month:1,day:6},end:e}:{start:{month:4,day:$.sunday(t,4,-1)},end:e}}static sunday(t,e,r){const s=new Date(Date.UTC(2e3,e-1,1));s.setUTCFullYear(t);const o=1+(7-s.getUTCDay())%7;if(r>0)return o+7*(r-1);const i=[31,$.isLeap(t)?29:28,31,30,31,30,31,31,30,31,30,31][e-1];let a=o;for(;a+7<=i;)a+=7;return a}static isLeap(t){return t%4===0&&(t%100!==0||t%400===0)}static rank(t,e,r){return(t*100+e)*100+r}}const Gn={name:"PST",timeshift:"-08",title:"Pacific Standard Time (US)"},In={name:"PDT",timeshift:"-07",title:"Pacific Daylight Time (US)"},Rn={name:"MDT",timeshift:"-06",title:"Mountain Standard Time (US)"},Vn={name:"MST",timeshift:"-07",title:"Mountain Daylight Time (US)"},kn={name:"PT",timeshift:n=>$.timeshift(-480,n),title:"Pacific Time (US)"},On={name:"MT",timeshift:n=>$.timeshift(-420,n),title:"Mountain Time (US)"},$n={name:"CT",timeshift:n=>$.timeshift(-360,n),title:"Central Time (US)"},Fn={name:"ET",timeshift:n=>$.timeshift(-300,n),title:"Eastern Time (US)"},Dn={name:"CWT",timeshift:"-05",title:"Central War Time (US)"},Pn={name:"CDT",timeshift:"-05",title:"Central Daylight Time"},Un={name:"EST",timeshift:"-05",title:"Eastern Standard Time (US)"},Bn={name:"EDT",timeshift:"-04",title:"Eastern Time (US)"},Cn={name:"AST",timeshift:"-04",title:"Atlantic Standard Time (US)"},jn={name:"ADT",timeshift:"-03",title:"Atlantic Daylight Time (US)"},Hn={name:"UTC",timeshift:"Z",title:"Coordinated Universal Time"},Ln={name:"Z",timeshift:"Z",title:"UTC"},Kn={name:"GMT",timeshift:"Z",title:"Greenwich Mean Time"},zn={name:"BST",timeshift:"+01",title:"British Summer Time"},qn={name:"CEST",timeshift:"+02",title:"Central European Summer Time"},Wn={name:"CET",timeshift:"+01",title:"Central European Time"},Yn={name:"MSK",timeshift:"+03",title:"Moscow Time (RU)"},Xn={name:"IST",timeshift:"+05:30",title:"Indian Standard Time"},Jn={name:"BJT",timeshift:"+08",title:"Beijing Time"},Zn={name:"CST",timeshift:"-06",title:"Central Standard Time"},Qn={name:"JST",timeshift:"+09",title:"Japan Standard Time"},ts={name:"AEST",timeshift:"+10",title:"Australian Eastern Standard Time"},es={name:"NZST",timeshift:"+12",title:"New Zealand Standard Time"},rs={name:"LST",timeshift:"?",title:"Local Sideral Time"},Ze=[jn,ts,Cn,Jn,zn,Zn,Pn,Wn,qn,$n,Dn,Bn,Un,Fn,Kn,Xn,Qn,rs,Rn,Yn,Vn,On,es,In,Gn,kn,Hn,Ln];class me{static instance=new me;renderComponent(t,e){return t[e].toString()}renderSecond(t){return this.renderComponent(t,"second")+(t.millisecond?"."+t.millisecond.toString():"")}render(t){const e=[];t.year&&e.push(this.renderComponent(t,"year")),t.month&&e.push(this.renderComponent(t,"month")),t.day&&e.push(this.renderComponent(t,"day"));const r=[];t.hour&&r.push(this.renderComponent(t,"hour")),t.minute&&r.push(this.renderComponent(t,"minute")),t.second&&r.push(this.renderSecond(t));const s=e.join("-"),o=t.timeshift?t.timeshift.toString():"",i=r.join(":")+o;return s+(i.length>0?"T"+i:"")}}class bt extends B{constructor(t="method is abstract"){super(t)}}class Oe{units;constructor(t){this.units=t}newYear(t){throw new bt}newMonth(t){throw new bt}newDay(t){throw new bt}newHour(t){throw new bt}newMinute(t){throw new bt}newSecond(t){throw new bt}}class ns extends ke{millisecond=new x("milliseconds",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,void 0);second=new x("seconds",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.millisecond);minute=new x("minutes",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.second);hour=new x("hours",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.minutes);day=new x("days",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.hour);month=new x("months",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.day);year=new x("years",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const ne=new ns;class he{static instance=new he;render(t){const e=L.toSpec(t);let r="P";const s=e.years;s&&(r+=s.toString()+"Y");const o=e.months;o&&(r+=o.toString(W.instance)+"MM");const i=e.days;i&&(r+=i.toString(W.instance)+"D");const a=e.hours;a&&(r+=a.toString(W.instance)+"H");const l=e.minutes;l&&(r+=l.toString(W.instance)+"M");const c=e.seconds;return c&&(r+=c.toString(W.instance)+"S"),r}}class L extends F{constructor(t={years:new Date().getFullYear(),months:new Date().getMonth(),days:new Date().getDate(),hours:new Date().getHours(),minutes:new Date().getMinutes(),seconds:new Date().getSeconds(),milliseconds:new Date().getMilliseconds()}){super({value:typeof t=="number"?t:+(t.years?t.years*g.year.duration:0)+(t.months?t.months*g.month.duration:0)+(t.days?t.days*g.day.duration:0)+(t.hours?t.hours*g.hour.duration:0)+(t.minutes?t.minutes*g.minute.duration:0)+(t.seconds?t.seconds*g.second.duration:0)},new x("millisecond",0,Number.MAX_SAFE_INTEGER,void 0))}static toSpec(t,e=os){let r=typeof t=="number"?t:t.value;const s=r>0?1:-1;r=Math.abs(r);const o={},i=r/g.year.duration,a=Math.floor(i);a>0&&(o.years=e.newYear(s*a),r-=a*g.year.duration);const l=r/g.month.duration,c=Math.floor(l);c>0&&(o.months=e.newMonth(s*c),r-=c*g.month.duration);const m=r/g.day.duration,p=Math.floor(m);p>0&&(o.days=e.newDay(s*p),r-=p*g.day.duration);const w=r/g.hour.duration,b=Math.floor(w);b>0&&(o.hours=e.newHour(s*b),r-=b*g.hour.duration);const _=r/g.minute.duration,S=Math.floor(_);S>0&&(o.minutes=e.newMinute(s*S),r-=S*g.minute.duration);const D=r/g.second.duration,at=Math.floor(s*D);return at>0&&(o.seconds=e.newSecond(at)),o}static fromString(t,e=h.get(L)){return new L(e.parse(t))}static between(t,e){const r=e.getTime(),s=t.getTime();return new L(r-s)}toSpec(){return L.toSpec(this)}toString(t=he.instance){return t.render(this)}}class nn extends Oe{constructor(t){super(t)}newYear(t){return new Nt(t,this.units.year)}newMonth(t){return new Gt(t,this.units.month)}newDay(t){return new It(t,this.units.day)}newHour(t){return new Rt(t,this.units.hour)}newMinute(t){return new Vt(t,this.units.minute)}newSecond(t){return new kt(t,this.units.second)}newMillisecond(t){return new wt(t,this.units.millisecond)}newTimeshift(t){return new gt(typeof t=="number"?t:t.value)}}const ss=new nn(g),os=new nn(ne);class O{#t;#e;#r;#n;#s;#o;#i;#a;constructor(t={year:new Date().getFullYear(),month:new Date().getMonth()+1,day:new Date().getDate(),hour:new Date().getHours(),minute:new Date().getMinutes(),second:new Date().getSeconds(),timeshift:O.timeshiftOf(new Date)}){this.year=t.year,this.month=t.month,this.day=t.day,this.hour=t.hour,this.minute=t.minute,this.second=t.second,this.millisecond=t.millisecond,this.timeshift=t.timeshift}get year(){return this.#t}set year(t){const e=typeof t=="number";this.#t&&e?this.#t.value=t:this.#t=e?this.factory.newYear(t):!t||t.start||t instanceof F?t:this.factory.newYear(t)}get month(){return this.#e}set month(t){const e=typeof t=="number";this.#e&&e?this.#e.value=t:this.#e=e?this.factory.newMonth(t):!t||t.start||t instanceof F?t:this.factory.newMonth(t)}get day(){return this.#r}set day(t){const e=typeof t=="number";this.#r&&e?this.#r.value=t:this.#r=e?this.factory.newDay(t):!t||t.start||t instanceof F?t:this.factory.newDay(t)}get hour(){return this.#n}set hour(t){const e=typeof t=="number";this.#n&&e?this.#n.value=t:this.#n=e?this.factory.newHour(t):!t||t.start||t instanceof F?t:this.factory.newHour(t)}get minute(){return this.#s}set minute(t){const e=typeof t=="number";this.#s&&e?this.#s.value=t:this.#s=e?this.factory.newMinute(t):!t||t.start||t instanceof F?t:this.factory.newMinute(t)}get second(){return this.#o}set second(t){const e=typeof t=="number";this.#o&&e?this.#o.value=t:this.#o=e?this.factory.newSecond(t):!t||t.start||t instanceof F?t:this.factory.newSecond(t)}get millisecond(){return this.#i}set millisecond(t){const e=typeof t=="number";this.#i&&e?this.#i.value=t:this.#i=e||t&&!(t instanceof F)?this.factory.newMillisecond(t):t}get timeshift(){return this.#a}set timeshift(t){const e=typeof t=="number";this.#a&&e?this.#a.value=t:this.#a=e||t&&!(t instanceof gt)?this.factory.newTimeshift(t):t}get factory(){return ss}static fromString(t,e=h.get(O)){const{year:r,month:s,day:o,hour:i,minute:a,second:l,millisecond:c,timeshift:m}=e.parse(t);return new O({year:r,month:s,day:o,hour:i,minute:a,second:l,millisecond:c,timeshift:m})}static timeshiftOf(t){return-t.getTimezoneOffset()||0}static fromDate(t){return new O({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:O.timeshiftOf(t)})}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),r=t.substring(0,e)+t.substring(e+4);return O.fromString(r)}#u(t){if(this.constructor.name!==t.constructor.name)throw new le(`Date "${this.toString()}" cannot be compared with "${t.toString()}"`)}compare(t){return this.#u(t),this.getTime()-t.getTime()}delta(t){const e=this.compare(t);return new L(e)}getTime(){return(this.year?.duration||0)+(this.month?.duration||0)+(this.day?.duration||0)+(this.hour?.duration||0)+(this.minute?.duration||0)+(this.second?.duration||0)+(this.millisecond?.duration||0)}isEqual(t){return this.compare(t)===0}isBefore(t){return this.compare(t)<0}isAfter(t){return this.compare(t)>0}clone(){return new O(this.toSpec())}previous(){let t=this.clone();try{t.second=this.second.previous()}catch{try{t.minute=this.minute.previous()}catch{try{t.hour=this.hour.previous()}catch{try{t.day=this.day.previous()}catch{try{t.month=this.month.previous()}catch{t.year=this.year.previous()}}}}}return t}next(){let t=this.clone();try{t.second=this.second.next()}catch{try{t.minute=this.minute.next()}catch{try{t.hour=this.hour.next()}catch{try{t.day=this.day.next()}catch{try{t.month=this.month.next()}catch{t.year=this.year.next()}}}}}return t}toString(t=me.instance){return t.render(this)}toSpec(){const t={},e=this.year?.toSpec();e&&(t.year=e);const r=this.month?.toSpec();r&&(t.month=r);const s=this.day?.toSpec();s&&(t.day=s);const o=this.hour?.toSpec();o&&(t.hour=o);const i=this.minute?.toSpec();i&&(t.minute=i);const a=this.second?.toSpec();a&&(t.second=a);const l=this.millisecond?.toSpec();l&&(t.millisecond=l);const c=this.timeshift?.toSpec();return c&&(t.timeshift=c),t}toJSON(){return this.toSpec()}}class $e{static instance=new $e;render(t){return(t.start?t.start.toString():"")+"/"+(t.end?t.end.toString():"")}}class Dt{constructor(t,e){this.start=t,this.end=e}_start;get start(){return this._start}set start(t){if(typeof t=="string"&&(t=O.fromString(t)),t&&!(t instanceof O)&&!(t instanceof L))throw new B("Interval start is not a level 0 date or duration: "+t);this._start=t}_end;get end(){return this._end}set end(t){if(typeof t=="string"&&(t=O.fromString(t)),t&&!(t instanceof O)&&!(t instanceof L))throw new B("Interval end is not a level 0 date or duration: "+t);this._end=t}static fromString(t,e=h.get(Dt)){const{start:r,end:s}=e.parse(t);return new Dt(r,s)}toString(t=$e.instance){return t.render(this)}[Symbol.iterator](){let t=this.start;return{next:()=>{const e={done:t>this.end,value:t};return t++,e}}}}class se extends W{static instance=new se(X.default);constructor(t){super(),this.valueRenderer=t}render(t){return(this.valueRenderer?this.valueRenderer.render(t):super.render(t))+this.qualifier(t)}qualifier(t){return t.uncertain?t.approximate?"%":"?":t.approximate?"~":""}}class Y extends F{#t;#e;constructor(t,e){super(t,e),this.#t=t.uncertain||!1,this.#e=t.approximate||!1}get uncertain(){return this.#t}set uncertain(t){return this.#t=t}get approximate(){return this.#e}set approximate(t){return this.#e=t}isCertainAndPrecise(){return!this.approximate&&!this.uncertain}isEqual(t){return this.isCertainAndPrecise()&&super.isEqual(t)}isBefore(t){return this.isCertainAndPrecise()&&super.isBefore(t)}isAfter(t){return this.isCertainAndPrecise()&&super.isAfter(t)}toString(t=se.instance){return super.toString(t)}toSpec(){return{...super.toSpec(),uncertain:this.uncertain,approximate:this.approximate}}toJSON(){return this.toSpec()}}class sn extends en{year=new x("year",-9999,9999,this.month);yearExtended=new x("year",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const ie=new sn;class dt extends Y{constructor(t,e=ie.year){super(t,e)}static fromString(t,e=ie.year,r=h.get(dt)){const s=r.parse(t),o=s.value.start;if(t.startsWith("Y")&&(e=ie.yearExtended),o!==void 0){const i=new dt(Object.assign({...s},{value:Math.max(o,e.min)})),a=new dt(Object.assign({...s},{value:Math.min(s.value.end,e.max)}));return{start:i,end:a}}else return new dt(s,e)}}class on extends le{monthValidator=new rn;validate(t){switch(t){case 21:case 22:case 23:case 24:return!0;default:return this.monthValidator.validate(t)}}}class lt extends Y{constructor(t,e=new x(g.month.name,1,24,g.day,new on)){super(t,e)}static fromString(t,e=h.get(lt)){const r=e.parse(t),s=r.value.start;if(s!==void 0){let o=g.month;const i=new lt(Object.assign({...r},{value:Math.max(s,o.min)})),a=new lt(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new lt(r)}toString(t){return super.toString(t).padStart(2,"0")}}class mt extends Y{constructor(t,e=g.day){super(t,e)}static fromString(t,e=h.get(mt)){const r=e.parse(t),s=r.value.start;if(s!==void 0){let o=g.day;const i=new mt(Object.assign({...r},{value:Math.max(s,o.min)})),a=new mt(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new mt(r)}toString(t){return super.toString(t).padStart(2,"0")}}class ht extends Y{constructor(t,e=g.hour){super(t,e)}static fromString(t,e=h.get(ht)){const r=e.parse(t),s=r.value.start;if(s!==void 0){let o=g.hour;const i=new ht(Object.assign({...r},{value:Math.max(s,o.min)})),a=new ht(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new ht(r)}}class pt extends Y{constructor(t,e=g.minute){super(t,e)}static fromString(t,e=h.get(pt)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=g.minute,i=new pt(Object.assign({...r},{value:Math.max(s,o.min)})),a=new pt(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new pt(r)}toString(t=se.instance){return super.toString(t)}}class ft extends Y{constructor(t,e=g.second){super(t,e)}static fromString(t,e=h.get(ft)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=g.second,i=new ft(Object.assign({...r},{value:Math.max(s,o.min)})),a=new ft(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new ft(r)}}class St extends gt{static fromString(t,e=h.get(St),r=void 0){return new St(e.parse(t,r))}}class an extends Oe{constructor(t){super(t)}newYear(t){return new dt(t,this.units.year)}newMonth(t){return new lt(t,this.units.month)}newDay(t){return new mt(t,this.units.day)}newHour(t){return new ht(t,this.units.hour)}newMinute(t){return new pt(t,this.units.minute)}newSecond(t){return new ft(t,this.units.second)}newMillisecond(t){return new wt(t,this.units.millisecond)}newTimeshift(t){return new St(typeof t=="number"?t:t.value)}}const is=new an(ie),as=new an(ne);class P extends O{constructor(t){super(t)}get factory(){return is}get uncertain(){return this.year?.uncertain===!0||this.month?.uncertain===!0||this.day?.uncertain===!0||this.hour?.uncertain===!0||this.minute?.uncertain===!0||this.second?.uncertain===!0}get approximate(){return this.year?.approximate===!0||this.month?.approximate===!0||this.day?.approximate===!0||this.hour?.approximate===!0||this.minute?.approximate===!0||this.second?.approximate===!0}static fromDate(t){return new P({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:O.timeshiftOf(t)})}static fromString(t,e=h.get(P)){const r=e.parse(t);return new P(r)}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),r=t.substring(0,e)+t.substring(e+4);return P.fromString(r)}clone(){return new P(this.toSpec())}}const V=Object.freeze({year:"year",month:"month",day:"day",hour:"hour",minute:"minute",second:"second",timeshift:"timeshift",uncertain:"uncertain",approximate:"approx"});class pe extends he{static instance=new pe;render(t){return super.render(t)}}class I extends Y{constructor(t){super(typeof t=="number"||t.hasOwnProperty("value")?t:{value:I.getValue(t,V.year)+I.getValue(t,V.month)+I.getValue(t,V.day)+I.getValue(t,V.hour)+I.getValue(t,V.minute)+I.getValue(t,V.second),uncertain:I.getBoolean(t,V.uncertain),approximate:I.getBoolean(t,"approximate")},ne.millisecond)}static getBoolean(t,e){return t[e]||t[V.year+"s"]?.[e]||t[V.month+"s"]?.[e]||t[V.day+"s"]?.[e]||t[V.hour+"s"]?.[e]||t[V.minute+"s"]?.[e]||t[V.second+"s"]?.[e]||!1}static getValue(t,e){let r=0,s=t[e+"s"];if(s instanceof Y?s=s.value:typeof t=="number"&&(s=t),s){const o=g[e];r=s*o.duration}return r}static toSpec(t,e=as){return{...L.toSpec(t,e),uncertain:t.uncertain||!1,approximate:t.approximate||!1}}static fromString(t,e=h.get(I)){const r=e.parse(t);return new I(r)}static between(t,e){const r=e.getTime(),s=t.getTime();return new I(r-s)}toString(t=pe.instance){return super.toString(t)}toSpec(){return I.toSpec(this)}}class Pt extends Dt{constructor(t,e){super(t,e)}get start(){return this._start}set start(t){if(typeof t=="string"&&(super.start=P.fromString(t)),t&&!(t instanceof P)&&!(t instanceof I))throw new B("Interval start is not a level 1 date or duration: "+t);this._start=t}get end(){return this._end}set end(t){if(typeof t=="string"&&(t=P.fromString(t)),t&&!(t instanceof P)&&!(t instanceof I))throw new B("Interval end is not a level 1 date or duration: "+t);this._end=t}static fromString(t,e=h.get(Pt)){const{start:r,end:s}=e.parse(t);return new Pt(r,s)}}class $t extends Y{uncertainComponent;approximateComponent;constructor(t,e){super(t,e),this.uncertainComponent=t.uncertainComponent||!1,this.approximateComponent=t.approximateComponent||!1}get uncertain(){return super.uncertain||this.uncertainComponent}set uncertain(t){return super.uncertain=t}get approximate(){return super.approximate||this.approximateComponent}set approximate(t){return super.approximate=t}get uncertainGroup(){return super.uncertain}get approximateGroup(){return super.approximate}toSpec(){return{...super.toSpec(),uncertain:this.uncertainGroup,approximate:this.approximateGroup,uncertainComponent:this.uncertainComponent,approximateComponent:this.approximateComponent}}toJSON(){return this.toSpec()}}class us extends sn{year=new x("year",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const Re=new us;class Q extends $t{constructor(t,e=Re.year){super(t,e)}static fromString(t,e=Re.year,r=h.get(Q)){const s=r.parse(t),o=s.value.start;if(o!==void 0){const i=new Q(Object.assign({...s},{value:Math.max(o,e.min)})),a=new Q(Object.assign({...s},{value:Math.min(s.value.end,e.max)})),l={start:i,end:a},c=s.value.estimate;return c&&(l.estimate=c),l}else return new Q(s)}}class cs extends on{validate(t){switch(t){case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:return!0;default:return super.validate(t)}}}class tt extends $t{constructor(t,e=new x(g.month.name,1,41,g.day,new cs)){super(t,e)}static fromString(t,e=h.get(tt)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=g.month,i=new tt(Object.assign({...r},{value:Math.max(s,o.min)})),a=new tt(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new tt(r)}toString(t){return super.toString(t).padStart(2,"0")}}class et extends $t{constructor(t,e=g.day){super(t,e)}static fromString(t,e=h.get(et)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=g.day,i=new et(Object.assign({...r},{value:Math.max(s,o.min)})),a=new et(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new et(r)}toString(t){return super.toString(t).padStart(2,"0")}}class rt extends $t{constructor(t,e=g.hour){super(t,e)}static fromString(t,e=h.get(rt)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=g.hour,i=new rt(Object.assign({...r},{value:Math.max(s,o.min)})),a=new rt(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new rt(r)}}class nt extends $t{constructor(t,e=g.minute){super(t,e)}static fromString(t,e=h.get(nt)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=g.minute,i=new nt(Object.assign({...r},{value:Math.max(s,o.min)})),a=new nt(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new nt(r)}}class st extends $t{constructor(t,e=g.second){super(t,e)}static fromString(t,e=g.second,r=h.get(st)){const s=r.parse(t),o=s.value.start;if(o!==void 0){const i=new st(Object.assign({...s},{value:Math.max(o,e.min)})),a=new st(Object.assign({...s},{value:Math.min(s.value.end,e.max)}));return{start:i,end:a}}else return new st(s,e)}}class un extends St{}class ds extends se{qualifier(){return""}}class ut extends me{static instance=new ut;static valueRenderer=new ds(X.default);static names=["year","month","day","hour","minute","second"];static qualifier(t,e){return t?e?"%":"?":e?"~":""}renderComponent(t,e){const r=t[e],s=ut.names.slice(ut.names.indexOf(e)+1).map(a=>t[a]).filter(Boolean),o=ut.qualifier(r.uncertainComponent,r.approximateComponent),i=ut.qualifier(r.uncertainGroup&&!r.uncertainComponent&&!s.some(a=>a.uncertain),r.approximateGroup&&!r.approximateComponent&&!s.some(a=>a.approximate));return o+r.toString(ut.valueRenderer)+i}}class cn extends Oe{constructor(t){super(t)}newYear(t){return new Q(t,this.units.year)}newMonth(t){return new tt(t,this.units.month)}newDay(t){return new et(t,this.units.day)}newHour(t){return new rt(t,this.units.hour)}newMinute(t){return new nt(t,this.units.minute)}newSecond(t){return new st(t,this.units.second)}newMillisecond(t){return new wt(t,this.units.millisecond)}newTimeshift(t){return new un(typeof t=="number"?t:t.value)}}const ls=new cn(Re),ms=new cn(ne);class U extends P{constructor(t){super(t)}toString(t=ut.instance){return super.toString(t)}get year(){return super.year}set year(t){super.year=t}get month(){return super.month}set month(t){super.month=t}get factory(){return ls}static fromDate(t){return new U({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:O.timeshiftOf(t)})}static fromString(t,e=h.get(U)){const r=e.parse(t);return new U(r)}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),r=t.substring(0,e)+t.substring(e+4);return U.fromString(r)}clone(){return new U(this.toSpec())}}class ot{regExp;constructor(t,e){this.name=t,this.regExp=new RegExp(`^(?:${e})$`)}regexGroups(t){const e=this.regExp.exec(t);if(!e)throw new B(`Invalid ${this.name} "${t}"`);return e.groups}parseGroups(t){throw new bt(`${this.constructor.name} is abstract`)}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}class At extends pe{static instance=new At;static designators=[["years","Y"],["months","MM"],["days","D"],["hours","H"],["minutes","M"],["seconds","S"]];static qualifier(t,e){return t?e?"%":"?":e?"~":""}render(t){const e=At.qualifier(t.uncertainDuration,t.approximateDuration);if(!t.hasQualifiedComponent)return e+super.render(t);let r=e+"P";for(const[s,o]of At.designators){const i=t.components[s];i&&(r+=At.qualifier(i.uncertainComponent,i.approximateComponent)+i.value+o)}return r}}class G extends I{#t;constructor(t){if(super(typeof t=="number"?t:{value:G.valueFromSpec(t),uncertain:t.uncertain===!0,approximate:t.approximate===!0},ne.millisecond),typeof t!="number"){const e={};for(const r of G.componentNames)t[r]instanceof Y&&(e[r]=t[r]);Object.keys(e).length>0&&(this.#t=e)}}static componentNames=["years","months","days","hours","minutes","seconds"];get components(){return this.#t}#e(t){return this.#t?Object.values(this.#t).some(e=>e[t]):!1}get uncertainDuration(){return super.uncertain}get approximateDuration(){return super.approximate}get uncertain(){return super.uncertain||this.#e("uncertain")}set uncertain(t){super.uncertain=t}get approximate(){return super.approximate||this.#e("approximate")}set approximate(t){super.approximate=t}get hasQualifiedComponent(){return this.#t?Object.values(this.#t).some(t=>t.uncertainComponent||t.approximateComponent):!1}static valueFromSpec(t){return G.getValue(t,V.year)+G.getValue(t,V.month)+G.getValue(t,V.day)+G.getValue(t,V.hour)+G.getValue(t,V.minute)+G.getValue(t,V.second)}static toSpec(t,e=ms){const r=I.toSpec(t,e);if(t instanceof G&&t.hasQualifiedComponent)for(const s of G.componentNames)delete r[s],t.components[s]&&(r[s]=t.components[s]);return r}static fromString(t,e=h.get(G)){const r=e.parse(t);return new G(r)}static between(t,e){const r=e.getTime(),s=t.getTime();return new G(r-s)}toSpec(){return G.toSpec(this)}toString(t=At.instance){return super.toString(t)}}class Ut extends Pt{get start(){return this._start}set start(t){if(typeof t=="string"&&(super.start=U.fromString(t)),t&&!(t instanceof U)&&!(t instanceof G))throw new B("Interval start is not a level 2 date or duration: "+t);this._start=t}get end(){return this._end}set end(t){if(typeof t=="string"&&(t=U.fromString(t)),t&&!(t instanceof U)&&!(t instanceof G))throw new B("Interval end is not a level 2 date or duration: "+t);this._end=t}static fromString(t,e=h.get(Ut)){const{start:r,end:s}=e.parse(t);return new Ut(r,s)}}class de extends Set{constructor(t,e){super(t),this.exclusive=e}has(t){const e=t.toString().replace("..","/");for(const r of this)if(r.toString()===e)return!0;return!1}static fromString(t,e=h.get(de)){const{exclusive:r,values:s}=e.parse(t);return new de(s,r)}}class it extends ot{constructor(t,e){super(t,e)}static read(t){return{value:t?parseInt(t,10):void 0}}parseGroups(t){return it.read(t[this.name])}parse(t){if(t.startsWith("-"))throw new B(`${this.name} cannot be negative`);return super.parse(t)}}class u{static groupName(...t){return t.reduce((e,r)=>e?e+r.charAt(0).toUpperCase()+r.substring(1):r,"")}static group(t,...e){return`(?<${t}>${e.join("")})`}static optional(t){return t+"?"}static nonCapturingGroup(...t){return`(?:${t.join("")})`}static optionalGroup(t,...e){return u.optional(u.group(t,...e))}static optionalNonCapturingGroup(...t){return u.optional(u.nonCapturingGroup(...t))}static numberGroup(t,e,r,s="\\d"){return u.group(t,`${r||""}[${s}]${e}`)}}const Qe="yearValue";class Bt extends it{static format(t=""){return u.numberGroup(u.groupName(t,Qe),"{4}",void 0)}constructor(){super(Qe,Bt.format())}}const tr="monthValue";class Ct extends it{static format(t=""){return u.numberGroup(u.groupName(t,tr),"{1,2}",void 0)}constructor(){super(tr,Ct.format())}}const er="dayValue";class _t extends it{static format(t=""){return u.numberGroup(u.groupName(t,er),"{1,2}",void 0)}constructor(){super(er,_t.format())}}const rr="hourValue";class Tt extends it{static format(t=""){return u.numberGroup(u.groupName(t,rr),"{1,2}",void 0)}constructor(){super(rr,Tt.format())}}const nr="minuteValue";class jt extends it{static format(t=""){return u.numberGroup(u.groupName(t,nr),"{1,2}",void 0)}constructor(){super(nr,jt.format())}}const sr="secondValue";class Ht extends it{static format(t=""){return u.numberGroup(u.groupName(t,sr),"{1,2}",void 0)}constructor(){super(sr,Ht.format())}}const or="timeshiftValue",ir="shiftHour",ar="shiftMinute";class Ot extends ot{static format(t=""){return Ze.map(e=>e.name).join("|")+"|"+u.nonCapturingGroup(u.group(t+ir,u.numberGroup(u.groupName(t,or),"{2}","[+-]")),u.optionalNonCapturingGroup(":?",u.numberGroup(u.groupName(t,ar),"{2}",void 0)))}constructor(){super(or,Ot.format())}parse(t,e){let r=0;const s=Ze.find(o=>o.name===t);if(s){if(typeof s.timeshift=="function")try{return s.timeshift(e??{})}catch(o){throw new B(`The time zone ${t} depends on the date: ${o.message}`)}t=s.timeshift}if(t!=="Z"){const o=this.regexGroups(t),i=o[ir];i&&(r+=parseInt(i,10)*60);const a=o[ar];a&&(r+=parseInt(a,10))}return r}}const ur="year",cr="month",dr="day",lr="hour",mr="minute",hr="second",pr="millisecond",fr="timeshift";class Et extends ot{static format(t=""){return u.group(u.groupName(t,ur),Bt.format(t))+u.optionalNonCapturingGroup("-",u.group(u.groupName(t,cr),Ct.format(t)),u.optionalNonCapturingGroup("-",u.group(u.groupName(t,dr),_t.format(t)),u.optionalNonCapturingGroup("[T ]",u.group(u.groupName(t,lr),Tt.format(t)),":?",u.group(u.groupName(t,mr),jt.format(t)),u.optionalNonCapturingGroup(":",u.group(u.groupName(t,hr),Ht.format(t)),u.optionalNonCapturingGroup("[.,]",u.group(u.groupName(t,pr),"\\d+"))),"\\s*",u.optionalGroup(u.groupName(t,fr),Ot.format(t)))))}constructor(){super("date",Et.format())}parse(t){const e=this.regexGroups(t),r=e[ur],s=e[cr],o=e[dr],i=e[lr],a=e[mr],l=e[hr],c=e[pr],m=e[fr],p=r?new Nt(Bt.read(r)):void 0,w=s?Ct.read(s):void 0;return{year:p,month:w?new Gt(w,vt.create(w.value,p?.value)):void 0,day:o?new It(_t.read(o)):void 0,hour:i?new Rt(Tt.read(i)):void 0,minute:a?new Vt(jt.read(a)):void 0,second:l?new kt(Ht.read(l)):void 0,millisecond:c?wt.parseFraction(c):void 0,timeshift:m?gt.fromString(m,new Ot,{year:p?.value,month:w?.value,day:o?_t.read(o).value:void 0,hour:i?Tt.read(i).value:void 0}):void 0}}}const gr="years",be="months",hs="days",wr="hours",br="minutes",Er="seconds";class Fe extends ot{static format(t=""){return"P"+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,gr),"+",void 0,"\\d"),"Y")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,be),"+",void 0,"\\d"),"MM")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,hs),"+",void 0,"\\d"),"D")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,wr),"+",void 0,"\\d"),"H")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,br),"+",void 0,"\\d"),"M")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Er),"+",void 0,"\\d"),"S")}constructor(){super("duration",Fe.format())}parseGroups(t){return{years:t[gr],months:t[be],days:t[be],hours:t[wr],minutes:t[br],seconds:t[Er]}}}const Ee="start",ye="end";class De extends ot{static format=u.group(Ee,Et.format(Ee))+"/"+u.group(ye,Et.format(ye));constructor(){super("interval",De.format)}parse(t){const e=this.regexGroups(t),r=e[Ee],s=e[ye];return{start:r?O.fromString(r,new Et):void 0,end:s?O.fromString(s,new Et):void 0}}}h.register(O,()=>new Et);h.register(It,()=>new _t);h.register(L,()=>new Fe);h.register(Rt,()=>new Tt);h.register(Dt,()=>new De);h.register(Vt,()=>new jt);h.register(Gt,()=>new Ct);h.register(kt,()=>new Ht);h.register(gt,()=>new Ot);h.register(Nt,()=>new Bt);class M extends it{static uncertainGroup="uncertain";static approximateGroup="approx";static uncertainAndApproximateGroup=M.uncertainGroup+M.approximateGroup;constructor(t,e){super(t,e)}static qualifierFormat(t,e){return u.optionalGroup(t,`\\${e}`)}static formatSuffix(t){return this.qualifierFormat(u.groupName(M.uncertainGroup,t),"?")+this.qualifierFormat(u.groupName(M.approximateGroup,t),"~")+this.qualifierFormat(u.groupName(M.uncertainAndApproximateGroup,t),"%")}static numberFormat(t,e,r){return u.numberGroup(t,e,r,"\\dX")+this.formatSuffix(t)}getValueAndSign(t){let e=t[this.name],r;return e.charAt(0)==="-"?(r=-1,e=e.substring(1)):r=1,{valueStr:e,sign:r}}parseGroups(t){const{valueStr:e,sign:r}=this.getValueAndSign(t);let s=0,o;for(o=0;o<e.length;o++){const c=e[o];if(c==="X")break;s=s*10+parseInt(c,10)}if(o<e.length){let c=1;for(let w=0;w<e.length-o;w++)c*=10;const m=r*s*c,p=m+c-1;s={start:m,end:p}}else s*=r;const i=t[u.groupName(M.uncertainAndApproximateGroup,this.name)],a=t[u.groupName(M.approximateGroup,this.name)]||i,l=t[u.groupName(M.uncertainGroup,this.name)]||i;return{value:s,approximate:a?!!a:!1,uncertain:l?!!l:!1}}}const yr="yearValue";class Lt extends M{constructor(){super(yr,Lt.format())}static format(t=""){return"Y?"+M.numberFormat(u.groupName(t,yr),"+","[-]?")}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}const Sr="monthValue";class Kt extends M{static format(t=""){return M.numberFormat(u.groupName(t,Sr),"{1,2}",void 0)}constructor(){super(Sr,Kt.format())}}const xr="dayValue";class zt extends M{static format(t=""){return M.numberFormat(u.groupName(t,xr),"{1,2}",void 0)}constructor(){super(xr,zt.format())}}const Mr="hourValue";class qt extends M{static format(t=""){return M.numberFormat(u.groupName(t,Mr),"{1,2}",void 0)}constructor(){super(Mr,qt.format())}}const vr="minuteValue";class Wt extends M{static format(t=""){return M.numberFormat(u.groupName(t,vr),"{1,2}",void 0)}constructor(){super(vr,Wt.format())}}const Ar="secondValue";class Yt extends M{static format(t=""){return M.numberFormat(u.groupName(t,Ar),"{1,2}",void 0)}constructor(){super(Ar,Yt.format())}}class Xt extends Ot{}class A extends ot{static yearGroup="year";static monthGroup="month";static dayGroup="day";static hourGroup="hour";static minuteGroup="minute";static secondGroup="second";static millisecondGroup="millisecond";static timeshiftGroup="timeshift";constructor(t=A.format()){super("date",t)}static format(t=""){return u.group(u.groupName(t,A.yearGroup),Lt.format(t))+u.optionalNonCapturingGroup("-",u.group(u.groupName(t,A.monthGroup),Kt.format(t)),u.optionalNonCapturingGroup("-",u.group(u.groupName(t,A.dayGroup),zt.format(t)),u.optionalNonCapturingGroup("[T ]",u.group(u.groupName(t,A.hourGroup),qt.format(t)),":",u.group(u.groupName(t,A.minuteGroup),Wt.format(t)),u.optionalNonCapturingGroup(":",u.group(u.groupName(t,A.secondGroup),Yt.format(t)),u.optionalNonCapturingGroup("[.,]",u.group(u.groupName(t,A.millisecondGroup),"\\d+"))),u.optionalGroup(u.groupName(t,A.timeshiftGroup),Xt.format(t)))))}parseGroups(t){const e=t[A.millisecondGroup],r=e?wt.parseFraction(e):void 0,s=t[A.secondGroup],o=s?ft.fromString(s,new Yt):void 0,i=t[A.minuteGroup];let a;i&&(a=pt.fromString(i,new Wt),a.uncertain=a.uncertain||o?.uncertain||!1,a.approximate=a.approximate||o?.approximate||!1);const l=t[A.hourGroup];let c;l&&(c=ht.fromString(l,new qt),c.uncertain=c.uncertain||a?.uncertain||!1,c.approximate=c.approximate||a?.approximate||!1);const m=t[A.dayGroup];let p;m&&(p=mt.fromString(m,new zt),p.uncertain=p.uncertain||c?.uncertain||!1,p.approximate=p.approximate||c?.approximate||!1);const w=t[A.monthGroup];let b;w&&(b=lt.fromString(w,new Kt),b.uncertain=b.uncertain||p?.uncertain||!1,b.approximate=b.approximate||p?.approximate||!1);const _=t[A.yearGroup];let S;_&&(S=dt.fromString(_,void 0,new Lt),S.uncertain=S.uncertain||b?.uncertain||!1,S.approximate=S.approximate||b?.approximate||!1);const D=t[A.timeshiftGroup],at=D?St.fromString(D,new Xt,{year:S?.value,month:b?.value,day:p?.value,hour:c?.value}):void 0;return{year:S,month:b,day:p,hour:c,minute:a,second:o,millisecond:r,timeshift:at}}}const _r="years",Tr="months",Nr="days",Gr="hours",Ir="minutes",Rr="seconds";class yt extends M{static format(t=""){return"P"+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,_r),"+",void 0,"\\d"),"Y")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Tr),"+",void 0,"\\d"),"MM")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Nr),"+",void 0,"\\d"),"D")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Gr),"+",void 0,"\\d"),"H")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Ir),"+",void 0,"\\d"),"M")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Rr),"+",void 0,"\\d"),"S")+this.formatSuffix(t)}constructor(){super("duration",yt.format())}parseGroups(t){return{years:t[_r],months:t[Tr],days:t[Nr],hours:t[Gr],minutes:t[Ir],seconds:t[Rr],uncertain:!!t[M.uncertainGroup],approximate:!!t[M.approximateGroup]}}}const ps="dates",Se="start",xe="end",Vr="durations",Me="durationMin",ve="durationMax";class Pe extends ot{static format=u.group(ps,u.optionalGroup(Se,u.group("openStart","\\.\\.")+"|"+A.format(Se))+"/"+u.optionalGroup(xe,u.group("openEnd","\\.\\.")+"|"+A.format(xe)))+"|"+u.group(Vr,u.group(Me,yt.format(Me))+"/"+u.group(ve,yt.format(ve)));constructor(t="interval",e=Pe.format){super(t,e)}parseGroups(t){let e,r;if(t[Vr]){const o=t[Me];e=I.fromString(o,new yt);const i=t[ve];r=I.fromString(i,new yt)}else{const o=t[Se];switch(o){case void 0:e=null;break;case"..":e=void 0;break;default:e=P.fromString(o,new A)}const i=t[xe];switch(i){case void 0:r=null;break;case"..":r=void 0;break;default:r=P.fromString(i,new A)}}return{start:e,end:r}}}h.register(P,()=>new A);h.register(mt,()=>new zt);h.register(I,()=>new yt);h.register(ht,()=>new qt);h.register(Pt,()=>new Pe);h.register(pt,()=>new Wt);h.register(lt,()=>new Kt);h.register(ft,()=>new Yt);h.register(St,()=>new Xt);h.register(dt,()=>new Lt);class E extends M{static uncertainGroup="uncertain1";static approximateGroup="approx1";static uncertainAndApproximateGroup=E.uncertainGroup+E.approximateGroup;constructor(t,e){super(t,e)}static numberFormat(t,e,r){return this.qualifierFormat(u.groupName(E.uncertainGroup,t),"?")+this.qualifierFormat(u.groupName(E.approximateGroup,t),"~")+this.qualifierFormat(u.groupName(E.uncertainAndApproximateGroup,t),"%")+M.numberFormat(t,e,r)}parseGroups(t){const e=super.parseGroups(t),r=t[u.groupName(E.uncertainAndApproximateGroup,this.name)];return(t[u.groupName(E.uncertainGroup,this.name)]||r)&&(e.uncertainComponent=!0),(t[u.groupName(E.approximateGroup,this.name)]||r)&&(e.approximateComponent=!0),e}}const Ft="yearValue",kr="exp",Or="signif";class Jt extends E{constructor(){super(Ft,Jt.format())}static format(t=""){return"Y?"+u.nonCapturingGroup(u.group(u.groupName(t,kr),"[-]?\\d+E\\d+")+"|"+E.numberFormat(u.groupName(t,Ft),"+","[-]?")+u.optionalGroup(u.groupName(t,Or),"S\\d+"))}parseGroups(t){const e=t[kr];if(e){const i=e.indexOf("E"),a=parseInt(e.substring(i+1),10),c=parseInt(e.substring(0,i),10)*Math.pow(10,a);t[Ft]=c.toString()}const r=t[Or],s=t[Ft];if(r){const i=parseInt(r.substring(1),10),{valueStr:a,sign:l}=this.getValueAndSign(t);let c="";for(let m=0;m<a.length;m++)c+=m<i?a.charAt(m):"X";t[Ft]=(l<0?"-":"")+c}const o=super.parseGroups(t);return r&&(o.value.estimate=parseInt(s,10)),o}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}const $r="monthValue";class Zt extends E{static format(t=""){return E.numberFormat(u.groupName(t,$r),"{1,2}",void 0)}constructor(){super($r,Zt.format())}}const Fr="dayValue";class Qt extends E{static format(t=""){return E.numberFormat(u.groupName(t,Fr),"{1,2}",void 0)}constructor(){super(Fr,Qt.format())}}const Dr="hourValue";class te extends E{static format(t=""){return E.numberFormat(u.groupName(t,Dr),"{1,2}",void 0)}constructor(){super(Dr,te.format())}}const Pr="secondValue";class ee extends E{static format(t=""){return E.numberFormat(u.groupName(t,Pr),"{1,2}",void 0)}constructor(){super(Pr,ee.format())}}const Ur="minuteValue";class re extends E{static format(t=""){return E.numberFormat(u.groupName(t,Ur),"{1,2}",void 0)}constructor(){super(Ur,re.format())}}class fs extends Xt{}class y extends ot{static yearGroup=A.yearGroup;static monthGroup="month";static dayGroup="day";static hourGroup="hour";static minuteGroup="minute";static secondGroup="second";static millisecondGroup="millisecond";static timeshiftGroup="timeshift";constructor(){super("date",y.format())}static format(t=""){return u.group(u.groupName(t,y.yearGroup),Jt.format(t))+u.optionalNonCapturingGroup("-",u.group(u.groupName(t,y.monthGroup),Zt.format(t)),u.optionalNonCapturingGroup("-",u.group(u.groupName(t,y.dayGroup),Qt.format(t)),u.optionalNonCapturingGroup("[T ]",u.group(u.groupName(t,y.hourGroup),te.format(t)),":",u.group(u.groupName(t,y.minuteGroup),re.format(t)),u.optionalNonCapturingGroup(":",u.group(u.groupName(t,y.secondGroup),ee.format(t)),u.optionalNonCapturingGroup("[.,]",u.group(u.groupName(t,y.millisecondGroup),"\\d+"))),u.optionalGroup(u.groupName(t,y.timeshiftGroup),fs.format(t)))))}parseGroups(t){const e=t[y.millisecondGroup],r=e?wt.parseFraction(e):void 0,s=t[y.secondGroup];let o;s&&(o=st.fromString(s,void 0,new ee),o.uncertain=o?.uncertain||!1,o.approximate=o?.approximate||!1);const i=t[y.minuteGroup];let a;i&&(a=nt.fromString(i,new re),a.uncertain=a.uncertain||o?.uncertain||!1,a.approximate=a.approximate||o?.approximate||!1);const l=t[y.hourGroup];let c;l&&(c=rt.fromString(l,new te),c.uncertain=c.uncertain||a?.uncertain||!1,c.approximate=c.approximate||a?.approximate||!1);const m=t[y.dayGroup];let p;m&&(p=et.fromString(m,new Qt),p.uncertain=p.uncertain||c?.uncertain||!1,p.approximate=p.approximate||c?.approximate||!1);const w=t[y.monthGroup];let b;w&&(b=tt.fromString(w,new Zt),b.uncertain=b.uncertain||p?.uncertain||!1,b.approximate=b.approximate||p?.approximate||!1);const _=t[y.yearGroup];let S;_&&(S=Q.fromString(_,void 0,new Jt),S.uncertain=S.uncertain||b?.uncertain||!1,S.approximate=S.approximate||b?.approximate||!1);const D=t[y.timeshiftGroup],at=D?un.fromString(D,new Xt,{year:S?.value,month:b?.value,day:p?.value,hour:c?.value}):void 0;return{year:S,month:b,day:p,hour:c,minute:a,second:o,millisecond:r,timeshift:at}}}const Br="durationValue";class Ue extends E{static format(t=""){return"^"+E.numberFormat(u.groupName(t,Br),"+",void 0)}constructor(){super(Br,Ue.format())}}class gs extends ke{millisecond=new x("millisecond",0,Number.MAX_SAFE_INTEGER,void 0);second=new x("second",0,Number.MAX_SAFE_INTEGER,this.millisecond);minute=new x("minute",0,Number.MAX_SAFE_INTEGER,this.second);hour=new x("hour",0,Number.MAX_SAFE_INTEGER,this.minute);day=new x("day",1,Number.MAX_SAFE_INTEGER,this.hour);month=new x("month",1,Number.MAX_SAFE_INTEGER,this.day);year=new x("year",0,Number.MAX_SAFE_INTEGER,this.month)}const Mt=new gs;class f extends E{static yearsGroup="years";static monthsGroup="months";static isoMonthsGroup="isoMonths";static daysGroup="days";static hoursGroup="hours";static minutesGroup="minutes";static secondsGroup="seconds";static durationGroup="duration";static suffixGroup="durationSuffix";static componentParser=new Ue;static componentFormat(t,e,r,s,o=""){const i=u.group(u.groupName(t,f.quantityGroup(e)),E.numberFormat(u.groupName(t,r),"+",void 0,"\\d"));return u.group(u.groupName(t,e),i,s,o)}static quantityGroup(t){return t+"Quantity"}static isoMonthsLookahead="(?=[?~%]?\\d+D|T)";constructor(){super("duration",f.format())}static format(t=""){const e=u.groupName(t,f.durationGroup);return this.qualifierFormat(u.groupName(E.uncertainGroup,e),"?")+this.qualifierFormat(u.groupName(E.approximateGroup,e),"~")+this.qualifierFormat(u.groupName(E.uncertainAndApproximateGroup,e),"%")+"P"+u.optional(f.componentFormat(t,f.yearsGroup,y.yearGroup,"Y"))+u.optionalNonCapturingGroup(f.componentFormat(t,f.monthsGroup,y.monthGroup,"MM")+"|"+f.componentFormat(t,f.isoMonthsGroup,"isoMonth","M",f.isoMonthsLookahead))+u.optional(f.componentFormat(t,f.daysGroup,y.dayGroup,"D"))+"T?"+u.optional(f.componentFormat(t,f.hoursGroup,y.hourGroup,"H"))+u.optional(f.componentFormat(t,f.minutesGroup,y.minuteGroup,"M"))+u.optional(f.componentFormat(t,f.secondsGroup,y.secondGroup,"S"))+u.optionalGroup(u.groupName(t,f.suffixGroup),"[?~%]")}static parseComponent(t,e,r){const s=f.componentParser.parse(t);return new e(s,r)}parseGroups(t){const e=t[f.quantityGroup(f.secondsGroup)];let r;e&&(r=f.parseComponent(e,st,Mt.second),r.uncertain=!!t[u.groupName(E.uncertainGroup,f.secondsGroup)]||!1,r.approximate=!!t[u.groupName(E.approximateGroup,f.secondsGroup)]||!1);const s=t[f.quantityGroup(f.minutesGroup)];let o;s&&(o=f.parseComponent(s,nt,Mt.minute),o.uncertain=o.uncertain||r?.uncertain||!1,o.approximate=o.approximate||r?.approximate||!1);const i=t[f.quantityGroup(f.hoursGroup)];let a;i&&(a=f.parseComponent(i,rt,Mt.hour),a.uncertain=a.uncertain||o?.uncertain||!1,a.approximate=a.approximate||o?.approximate||!1);const l=t[f.quantityGroup(f.daysGroup)];let c;l&&(c=f.parseComponent(l,et,Mt.day),c.uncertain=c.uncertain||a?.uncertain||!1,c.approximate=c.approximate||a?.approximate||!1);const m=t[f.quantityGroup(f.monthsGroup)]||t[f.quantityGroup(f.isoMonthsGroup)];let p;m&&(p=f.parseComponent(m,tt,Mt.month),p.uncertain=p.uncertain||c?.uncertain||!1,p.approximate=p.approximate||c?.approximate||!1);const w=t[f.quantityGroup(f.yearsGroup)];let b;w&&(b=f.parseComponent(w,Q,Mt.year),b.uncertain=b.uncertain||p?.uncertain||!1,b.approximate=b.approximate||p?.approximate||!1);const _=t[f.suffixGroup],S=!!t[u.groupName(E.uncertainAndApproximateGroup,f.durationGroup)]||_==="%",D=S||!!t[u.groupName(E.uncertainGroup,f.durationGroup)]||_==="?",at=S||!!t[u.groupName(E.approximateGroup,f.durationGroup)]||_==="~";return{years:b,months:p,days:c,hours:a,minutes:o,seconds:r,uncertain:D,approximate:at}}}const ws="dates",Ae="start",_e="end",Cr="durations",Te="durationMin",Ne="durationMax";class fe extends ot{static format=u.group(ws,u.optionalGroup(Ae,u.group("openStart","\\.\\.")+"|"+y.format(Ae))+"/"+u.optionalGroup(_e,u.group("openEnd","\\.\\.")+"|"+y.format(_e)))+"|"+u.group(Cr,u.group(Te,f.format(Te))+"/"+u.group(Ne,f.format(Ne)));constructor(t="interval",e=fe.format){super(t,e)}parseGroups(t){let e,r;if(t[Cr]){const o=t[Te];e=G.fromString(o,new f);const i=t[Ne];r=G.fromString(i,new f)}else{const o=t[Ae];switch(o){case void 0:e=null;break;case"..":e=void 0;break;default:e=U.fromString(o,new y)}const i=t[_e];switch(i){case void 0:r=null;break;case"..":r=void 0;break;default:r=U.fromString(i,new y)}}return{start:e,end:r}}}class bs{parse(t){t=t.trim();const e=t.startsWith("["),s=t.substring(1,t.length-1).split(","),o=[];for(const i of s){let a;i.includes("..")?a=Ut.fromString(i.replace("..","/"),new fe):a=U.fromString(i,new y),o.push(a)}return{values:o,exclusive:e}}}h.register(U,()=>new y);h.register(et,()=>new Qt);h.register(G,()=>new f);h.register(rt,()=>new te);h.register(Ut,()=>new fe);h.register(nt,()=>new re);h.register(tt,()=>new Zt);h.register(st,()=>new ee);h.register(de,()=>new bs);h.register(Q,()=>new Jt);class Z{constructor(t){this.preferences=t}read(t){var e,r;if(t===void 0)return;if(typeof t=="string")return t===""?void 0:t;for(const o of this.preferences){const i=(e=t[o])!==null&&e!==void 0?e:t[Z.base(o)];if(i)return i}const s=new Set(this.preferences.map(o=>Z.base(o)));for(const[o,i]of Object.entries(t))if(i&&s.has(Z.base(o)))return i;return(r=Object.values(t).find(o=>o))!==null&&r!==void 0?r:void 0}write(t,e,r){var s,o;const i=e?.trim()?e.trim():void 0;if(t===void 0||typeof t=="string")return i;const a={...t},l=(o=(s=Object.keys(a).find(c=>c===r))!==null&&s!==void 0?s:Object.keys(a).find(c=>Z.base(c)===Z.base(r)))!==null&&o!==void 0?o:r;return i===void 0?delete a[l]:a[l]=i,Object.keys(a).length===0?void 0:a}static base(t){return t.toLowerCase().split("-")[0]}}Z.any=new Z([]);var jr;(function(n){n.abductee="abductee",n.actor="actor",n.artist="artist",n.anthropologist="anthropologist",n.archeologist="archeologist",n.astronaut="astronaut",n.astronomer="astronomer",n.astrologist="astrologist",n.astrophysicist="astrophysicist",n.banker="banker",n.barman="barman",n.biologist="biologist",n.biochemist="biochemist",n.biophysicist="biophysicist",n.bishop="bishop",n.businessman="businessman",n.botanist="botanist",n.cameraman="cameraman",n.chemist="chemist",n.contactee="contactee",n.cryptozoologist="cryptozoologist",n.dentist="dentist",n.director="director",n.diplomat="diplomat",n.diver="diver",n.electronics="electronics",n.engineer="engineer",n.ethnologist="ethnologist",n.exobiologist="exobiologist",n.farmer="farmer",n.firefighter="firefighter",n.flightAttendant="flightAttendant",n.geologist="geologist",n.geophysicist="geophysicist",n.geographer="geographer",n.historian="historian",n.houseWife="houseWife",n.hypnotherapist="hypnotherapist",n.illusionist="illusionist",n.journalist="journalist",n.judge="judge",n.lawyer="lawyer",n.leader="leader",n.librarian="librarian",n.logger="logger",n.mathematician="mathematician",n.mechanic="mechanic",n.meteorologist="meteorologist",n.military="military",n.musician="musician",n.neurologist="neurologist",n.neuroscientist="neuroscientist",n.neuropsychiatrist="neuropsychiatrist",n.nurse="nurse",n.oceanographer="oceanographer",n.painter="painter",n.parapsychologist="parapsychologist",n.philosopher="philosopher",n.photographer="photographer",n.physician="physician",n.physicist="physicist",n.pilot="pilot",n.politician="politician",n.policeman="policeman",n.priest="priest",n.producer="producer",n.prospector="prospector",n.psychologist="psychologist",n.psychiatrist="psychiatrist",n.radioastronomer="radioastronomer",n.radioamateur="radioamateur",n.salesman="salesman",n.sailor="sailor",n.sociologist="sociologist",n.softwareEngineer="softwareEngineer",n.stuntman="stuntman",n.taxiDriver="taxiDriver",n.teacher="teacher",n.telegrapher="telegrapher",n.truckDriver="truckDriver",n.ufologist="ufologist",n.ufoWitness="ufoWitness",n.ufoWitness2="ufoWitness2",n.worker="worker",n.writer="writer"})(jr||(jr={}));var Hr;(function(n){n.neutral="neutral",n.male="male",n.female="female"})(Hr||(Hr={}));class Es extends Error{constructor(t,e){super(t),this.cause=e}}class Be extends Es{constructor(t=Be.defaultMessage,e){super(t,e)}}Be.defaultMessage="Assertion failed";var Lr;(function(n){n.country="country",n.region="region",n.department="department",n.city="city",n.company="company"})(Lr||(Lr={}));var Kr;(function(n){n.at="at",n.au="au",n.ar="ar",n.be="be",n.br="br",n.ca="ca",n.ch="ch",n.cn="cn",n.cl="cl",n.co="co",n.cy="cy",n.de="de",n.dk="dk",n.do="do",n.dz="dz",n.gr="gr",n.ec="ec",n.eg="eg",n.es="es",n.fi="fi",n.fr="fr",n.ga="ga",n.ge="ge",n.hu="hu",n.in="in",n.ie="ie",n.ir="ir",n.il="il",n.it="it",n.jp="jp",n.kr="kr",n.ma="ma",n.mx="mx",n.my="my",n.mz="mz",n.nl="nl",n.no="no",n.nz="nz",n.pa="pa",n.pe="pe",n.ph="ph",n.pl="pl",n.pt="pt",n.ro="ro",n.ru="ru",n.sc="sc",n.tr="tr",n.ua="ua",n.uk="uk",n.us="us",n.sa="sa",n.se="se",n.su="su",n.tn="tn",n.tw="tw",n.ve="ve",n.za="za"})(Kr||(Kr={}));function ys(n,t){for(const e of n){const r=e.toLowerCase().split("-")[0];if(t.includes(r))return r}return"en"}class zr{static preferencesFor(t){const e=navigator.languages??[],r=this.declaredFor(t);return r?[r,...e]:e}static declaredFor(t){for(let e=t;e;){const r=e.closest("[lang]")?.getAttribute("lang")?.trim();if(r)return r;const s=e.getRootNode();e=s instanceof ShadowRoot?s.host:void 0}}}const Ss=["en","fr","es","it"],xs={en:()=>d(()=>import("./UfoMessages_en-D5OYWJ3K.js"),__vite__mapDeps([33,24]),import.meta.url).then(n=>n.ufoMessages_en),fr:()=>d(()=>import("./UfoMessages_fr-CGkQBn5r.js"),[],import.meta.url).then(n=>n.ufoMessages_fr),es:()=>d(()=>import("./UfoMessages_es-CO-v8Jl6.js"),[],import.meta.url).then(n=>n.ufoMessages_es),it:()=>d(()=>import("./UfoMessages_it-BScqxIaH.js"),[],import.meta.url).then(n=>n.ufoMessages_it)},Ys=T.catalog(xs),Ms={en:()=>d(()=>import("./SightingEditorMessages_en-k7_ua2OM.js"),__vite__mapDeps([34,35]),import.meta.url).then(n=>n.sightingEditorMessages_en),fr:()=>d(()=>import("./SightingEditorMessages_fr-B_K5hsuV.js"),__vite__mapDeps([36,37]),import.meta.url).then(n=>n.sightingEditorMessages_fr),es:()=>d(()=>import("./SightingEditorMessages_es-Drqbbr5_.js"),__vite__mapDeps([38,39]),import.meta.url).then(n=>n.sightingEditorMessages_es),it:()=>d(()=>import("./SightingEditorMessages_it-QCLg1d7x.js"),__vite__mapDeps([40,41]),import.meta.url).then(n=>n.sightingEditorMessages_it)},vs=T.catalog(Ms);function Xs(n){return vs.load(n)}const As={en:()=>d(()=>import("./SightingMessages_en-CzICxNU3.js"),__vite__mapDeps([42,35]),import.meta.url).then(n=>n.sightingMessages_en),fr:()=>d(()=>import("./SightingMessages_fr-nopOVDa1.js"),__vite__mapDeps([43,37]),import.meta.url).then(n=>n.sightingMessages_fr),es:()=>d(()=>import("./SightingMessages_es-CiVFZlgA.js"),__vite__mapDeps([44,39]),import.meta.url).then(n=>n.sightingMessages_es),it:()=>d(()=>import("./SightingMessages_it-Cu0nnPts.js"),__vite__mapDeps([45,41]),import.meta.url).then(n=>n.sightingMessages_it)},Js=T.catalog(As),_s={en:()=>d(()=>import("./CaseMessages_en-BC0lku35.js"),[],import.meta.url).then(n=>n.caseMessages_en),fr:()=>d(()=>import("./CaseMessages_fr-D_6J6ONO.js"),[],import.meta.url).then(n=>n.caseMessages_fr),es:()=>d(()=>import("./CaseMessages_es-Cbktn5vj.js"),[],import.meta.url).then(n=>n.caseMessages_es),it:()=>d(()=>import("./CaseMessages_it-CYyww4oG.js"),[],import.meta.url).then(n=>n.caseMessages_it)},Ts=T.catalog(_s);function Zs(n){return Ts.load(n)}const Ns={en:()=>d(()=>import("./UfoAtHomeMessages_en-BK2qJyZN.js"),[],import.meta.url).then(n=>n.ufoAtHomeMessages_en),fr:()=>d(()=>import("./UfoAtHomeMessages_fr-BTG047qo.js"),[],import.meta.url).then(n=>n.ufoAtHomeMessages_fr),es:()=>d(()=>import("./UfoAtHomeMessages_es-B1-NDCau.js"),[],import.meta.url).then(n=>n.ufoAtHomeMessages_es),it:()=>d(()=>import("./UfoAtHomeMessages_it-Ryxv4HNU.js"),[],import.meta.url).then(n=>n.ufoAtHomeMessages_it)},Gs=T.catalog(Ns);function Is(n){return Gs.load(n)}const Rs={en:()=>d(()=>import("./ShareMessages_en-B43x8LgJ.js"),[],import.meta.url).then(n=>n.shareMessages_en),fr:()=>d(()=>import("./ShareMessages_fr-CzZyVbbX.js"),[],import.meta.url).then(n=>n.shareMessages_fr),es:()=>d(()=>import("./ShareMessages_es-DZCJojSc.js"),[],import.meta.url).then(n=>n.shareMessages_es),it:()=>d(()=>import("./ShareMessages_it-C_Z6eDQK.js"),[],import.meta.url).then(n=>n.shareMessages_it)},Qs=T.catalog(Rs);function to(n){switch(n){case"fr":return d(()=>import("./TagNames_fr-Dnqq6HQ5.js"),[],import.meta.url).then(t=>t.tagNames_fr);case"es":return d(()=>import("./TagNames_es-BfnMpc3D.js"),[],import.meta.url).then(t=>t.tagNames_es);case"it":return d(()=>import("./TagNames_it-n6E4EGYO.js"),[],import.meta.url).then(t=>t.tagNames_it);default:return Promise.resolve({})}}const Vs={en:()=>d(()=>import("./BodyEditorMessages_en-CckxSS1L.js"),[],import.meta.url).then(n=>n.bodyEditorMessages_en),fr:()=>d(()=>import("./BodyEditorMessages_fr-638ypdqf.js"),[],import.meta.url).then(n=>n.bodyEditorMessages_fr),es:()=>d(()=>import("./BodyEditorMessages_es-B8GlFFBo.js"),[],import.meta.url).then(n=>n.bodyEditorMessages_es),it:()=>d(()=>import("./BodyEditorMessages_it-SKpMkHFI.js"),[],import.meta.url).then(n=>n.bodyEditorMessages_it)},ks={en:()=>d(()=>import("./CaseEditorMessages_en-pog3M_U6.js"),[],import.meta.url).then(n=>n.caseEditorMessages_en),fr:()=>d(()=>import("./CaseEditorMessages_fr-BOKVeIXM.js"),[],import.meta.url).then(n=>n.caseEditorMessages_fr),es:()=>d(()=>import("./CaseEditorMessages_es-Dz1N0VpM.js"),[],import.meta.url).then(n=>n.caseEditorMessages_es),it:()=>d(()=>import("./CaseEditorMessages_it-BKAkbKq-.js"),[],import.meta.url).then(n=>n.caseEditorMessages_it)},Os={en:()=>d(()=>import("./ReadingSensitivityMessages_en-ChQHFyxb.js"),[],import.meta.url).then(n=>n.readingSensitivityMessages_en),fr:()=>d(()=>import("./ReadingSensitivityMessages_fr-Dl4a8udu.js"),[],import.meta.url).then(n=>n.readingSensitivityMessages_fr),es:()=>d(()=>import("./ReadingSensitivityMessages_es-BbFqHsvR.js"),[],import.meta.url).then(n=>n.readingSensitivityMessages_es),it:()=>d(()=>import("./ReadingSensitivityMessages_it-CwiJfUo_.js"),[],import.meta.url).then(n=>n.readingSensitivityMessages_it)},eo=T.catalog(Os),$s={en:()=>d(()=>import("./ScenarioSweepMessages_en-Bf4BscDU.js"),[],import.meta.url).then(n=>n.scenarioSweepMessages_en),fr:()=>d(()=>import("./ScenarioSweepMessages_fr-DlPsO6oI.js"),[],import.meta.url).then(n=>n.scenarioSweepMessages_fr),es:()=>d(()=>import("./ScenarioSweepMessages_es-CBHQfuRB.js"),[],import.meta.url).then(n=>n.scenarioSweepMessages_es),it:()=>d(()=>import("./ScenarioSweepMessages_it-DANW3_la.js"),[],import.meta.url).then(n=>n.scenarioSweepMessages_it)},ro=T.catalog($s),Fs={en:()=>d(()=>import("./CaseExportMessages_en-jHlu58Y7.js"),[],import.meta.url).then(n=>n.caseExportMessages_en),fr:()=>d(()=>import("./CaseExportMessages_fr-sDfEgjWg.js"),[],import.meta.url).then(n=>n.caseExportMessages_fr),es:()=>d(()=>import("./CaseExportMessages_es-dCQQFgjq.js"),[],import.meta.url).then(n=>n.caseExportMessages_es),it:()=>d(()=>import("./CaseExportMessages_it-BJaglZtP.js"),[],import.meta.url).then(n=>n.caseExportMessages_it)},no=T.catalog(Fs),Ds={en:()=>d(()=>import("./InterviewMessages_en-BrnxG2rl.js"),[],import.meta.url).then(n=>n.interviewMessages_en),fr:()=>d(()=>import("./InterviewMessages_fr-DIA-1qu8.js"),[],import.meta.url).then(n=>n.interviewMessages_fr),es:()=>d(()=>import("./InterviewMessages_es-Dxfjqrte.js"),[],import.meta.url).then(n=>n.interviewMessages_es),it:()=>d(()=>import("./InterviewMessages_it-CYBEIKX-.js"),[],import.meta.url).then(n=>n.interviewMessages_it)},so=T.catalog(Ds),oo=T.catalog(ks),io=T.catalog(Vs),Ps=T.catalog({en:()=>d(()=>import("./SceneNames_en-7OZ7peGc.js"),__vite__mapDeps([46,7]),import.meta.url).then(n=>n.sceneNames_en),fr:()=>d(()=>import("./SceneNames_fr-qzw0QzD0.js"),__vite__mapDeps([47,7]),import.meta.url).then(n=>n.sceneNames_fr),es:()=>d(()=>import("./SceneNames_es-P5-Mavdi.js"),__vite__mapDeps([48,7]),import.meta.url).then(n=>n.sceneNames_es),it:()=>d(()=>import("./SceneNames_it-Sqf8JFOd.js"),__vite__mapDeps([49,7]),import.meta.url).then(n=>n.sceneNames_it)});function ao(n){return Ps.load(n)}const uo=T.catalog({en:()=>d(()=>import("./CloudEditorMessages_en-SmcRKW1O.js"),[],import.meta.url).then(n=>n.cloudEditorMessages_en),fr:()=>d(()=>import("./CloudEditorMessages_fr-SvL-CR04.js"),[],import.meta.url).then(n=>n.cloudEditorMessages_fr),es:()=>d(()=>import("./CloudEditorMessages_es-DFCuS9Qg.js"),[],import.meta.url).then(n=>n.cloudEditorMessages_es),it:()=>d(()=>import("./CloudEditorMessages_it-BvfiHWV9.js"),[],import.meta.url).then(n=>n.cloudEditorMessages_it)}),qr="rr0-ufoathome",Us='<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"><path d="M8 3v10M3 8h10"/></svg>',Bs='<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M2 4.5h4l1.5 1.5H14v6.5H2z"/></svg>',Cs=`
113
+ :is(${s(q.INFO,t)}, ${s(q.WARNING,e)}, ${s(q.ERROR,r)}) { font-size: var(--rr0-message-font-size, 0.78em); line-height: var(--rr0-message-line-height, 1.3); font-weight: normal; opacity: 1; }
114
+ :is(${s(q.INFO,t)}) { color: color-mix(in srgb, CanvasText 62%, transparent); }
115
+ :is(${s(q.WARNING,e)}) { color: color-mix(in srgb, #e48a00 72%, CanvasText); }
116
+ :is(${s(q.ERROR,r)}) { color: color-mix(in srgb, #e5322d 72%, CanvasText); }
117
+ `}static show(t,e,r="info"){t.textContent=e??"",t.hidden=!e,t.classList.toggle(q.INFO,r==="info"),t.classList.toggle(q.WARNING,r==="warning"),t.classList.toggle(q.ERROR,r==="error")}}class J{static given=new Map;static add(t,e){const r=decodeURIComponent(e.replace(/[?#].*$/,"").replace(/^.*\//,"")).replace(/\.json$/i,"")||"interview",s=t.name.replace(/[\\/:*?"<>|#%]+/g,"_").trim()||"file";let o=`${r}-files/${s}`;for(let i=2;J.given.has(new URL(encodeURI(o),e).href);i++)o=`${r}-files/${s.replace(/(\.[^.]*)?$/,`-${i}$1`)}`;return J.given.set(new URL(encodeURI(o),e).href,{blob:t}),{src:o,name:t.name,...t.type?{type:t.type}:{}}}static shown(t,e){const r=J.url(t,e),s=J.given.get(r);return s?(s.shown??=URL.createObjectURL(s.blob),s.shown):r}static fileName(t){return t.name??(decodeURIComponent(t.src.replace(/[?#].*$/,"").replace(/\/+$/,"").replace(/^.*\//,""))||t.src)}static isImage(t){return(t.type??"").startsWith("image/")||/\.(png|jpe?g|gif|webp|avif|svg)$/i.test(J.fileName(t))}static url(t,e){try{return new URL(/^[a-z][a-z0-9+.-]*:/i.test(t.src)?t.src:encodeURI(t.src),e??(typeof location>"u"?void 0:location.href)).href}catch{return t.src}}static blob(t){return J.given.get(t)?.blob}static clear(){for(const{shown:t}of J.given.values())t&&URL.revokeObjectURL(t);J.given.clear()}}class O{static withImages(t,e){const r=s=>s?.forEach(o=>{o.src=e(o.src)});for(const s of t.sections){r(s.images);for(const o of s.fields)r(o.images)}return t}static added=new Map;static ids(){return[...O.added.keys()]}static add(t){O.added.set(t.id,t)}static fetched=new Map;static async load(t){const e=O.added.get(t);if(e||!/[/:]|\.json$/i.test(t))return e;let r=O.fetched.get(t);return r||(r=fetch(t).then(s=>s.ok?s.json():void 0).then(s=>{if(!(!s||typeof s.id!="string"||!Array.isArray(s.sections)))return O.add(O.withImages(s,o=>new URL(o,t).href)),s}).catch(()=>{}),O.fetched.set(t,r)),r}static fields(t){return t.sections.flatMap(e=>e.fields)}static field(t,e){return O.fields(t).find(r=>r.id===e)}static text(t,e){if(t===void 0)return"";if(typeof t=="string")return t;const r=t;return(e&&r[e])??Object.values(r)[0]??""}static interview(t,e={},r){const s=e.witnesses?.length===1?e.witnesses[0]:void 0;return{version:1,...t.language?{language:t.language}:{},title:t.title,medium:"questionnaire",questionnaire:{id:t.id,...t.version?{version:t.version}:{},...r?{recipient:r}:{}},...s?{interviewOf:s.id}:{},speakers:{interviewer:{role:"interviewer",...e.by?.[0]!==void 0?{by:{people:e.by[0]}}:{}},witness:{role:"witness",...s?{title:s.label,of:s.id}:{}}},transcription:{method:"manual"},proofreading:{interviewer:{status:"pending"},witness:{status:"pending"}},segments:O.fields(t).map(o=>({speaker:"interviewer",field:o.id,text:O.text(o.question,t.language)}))}}static answerOf(t,e){return O.answerTurn(t,e)?.text}static filesOf(t,e){return O.answerTurn(t,e)?.files??[]}static answerTurn(t,e){return t.segments.find(r=>r.field===e&&t.speakers[r.speaker]?.role==="witness")}static fileName(t){return J.fileName(t)}static answerFiles(t,e,r,s){O.answer(t,e,r.map(o=>O.fileName(o)).join("; "),s,void 0,r)}static answer(t,e,r,s,o,i){const a=Object.entries(t.speakers).find(([,f])=>f.role==="witness")?.[0]??"witness";t.speakers[a]||(t.speakers[a]={role:"witness"});const l=t.segments.findIndex(f=>f.field===e&&t.speakers[f.speaker]?.role==="witness"),c=r.trim(),m=f=>{const{text:y,redacted:S,files:E,...G}=f;return o?{...G,redacted:o}:{...G,text:c,...i?.length?{files:i}:{}}};if(l>=0){c===""?t.segments.splice(l,1):t.segments[l]=m(t.segments[l]);return}if(c==="")return;let p=t.segments.findIndex(f=>f.field===e&&t.speakers[f.speaker]?.role!=="witness");if(p<0){const f=Object.entries(t.speakers).find(([,y])=>y.role==="interviewer")?.[0]??"interviewer";t.speakers[f]||(t.speakers[f]={role:"interviewer"}),t.segments.push({speaker:f,field:e,text:s??e}),p=t.segments.length-1}t.segments.splice(p+1,0,m({speaker:a,field:e}))}}const ro=Object.freeze(Object.defineProperty({__proto__:null,QuestionnaireTemplates:O},Symbol.toStringTag,{value:"Module"}));class L{static FORMAT=1;static read=new Map;static async install(t){for(const r of t.questionnaires??[])O.add(r);const e=t.starts.flatMap(r=>r.questionnaires??[]).filter(r=>L.isAddress(r));await Promise.all([...new Set(e)].map(r=>O.load(r)))}static load(t,e=fetch.bind(globalThis)){const r=new URL(t,typeof location>"u"?void 0:location.href).href;let s=L.read.get(r);return s||(s=(async()=>{const o=await e(r);if(!o.ok)throw new Error(`${r}: HTTP ${o.status}`);return L.check(await o.json(),r,"page")})(),s.catch(()=>L.read.delete(r)),L.read.set(r,s)),s}static check(t,e,r="page",s){const o=t;if(o===null||typeof o!="object"||!Array.isArray(o.starts))throw new Error(`${e}: not a UFO@home case template`);if(typeof o.format=="number"&&o.format>L.FORMAT)throw new Error(`${e}: format ${o.format} is newer than ${L.FORMAT}`);const i=m=>new URL(m,e).href,a=L.recipientOf(o.recipient,e),l=o.starts.filter(m=>typeof m?.id=="string").map(m=>({...m,...a?{recipient:a}:{},...m.questionnaires?{questionnaires:m.questionnaires.filter(p=>typeof p=="string").map(p=>L.isAddress(p)?i(p):p)}:{},...m.modules?{modules:m.modules.filter(p=>typeof p=="string").map(i)}:{}}));if(l.length===0)throw new Error(`${e}: a case template offers no start`);const c=Array.isArray(o.questionnaires)?o.questionnaires.filter(m=>typeof m?.id=="string"&&Array.isArray(m.sections)).map(m=>O.withImages(structuredClone(m),p=>/^[a-z][a-z0-9+.-]*:/i.test(p)?p:i(p))):void 0;return{format:1,id:typeof o.id=="string"?o.id:e,title:o.title??o.id??e,...o.modules?{modules:o.modules.filter(m=>typeof m=="string").map(i)}:{},...a?{recipient:a}:{},...c?.length?{questionnaires:c}:{},starts:l,url:e,origin:r,...s?{fileName:s}:{}}}static recipientOf(t,e){if(t===void 0)return;const r=t?.publicKey;if(typeof t.id!="string"||!r||r.kty!=="RSA"||typeof r.n!="string")throw new Error(`${e}: its recipient has no RSA public key`);if(r.d!==void 0)throw new Error(`${e}: its recipient gives a private key, which must never be published`);const{kty:s,n:o,e:i,alg:a}=r;return{id:t.id,name:t.name??t.id,publicKey:{kty:s,n:o,e:i,...a?{alg:a}:{}},...typeof t.email=="string"&&/^[^@\s]+@[^@\s]+$/.test(t.email)?{email:t.email}:{}}}static isAddress(t){return/[/:]|\.json$/i.test(t)}static step(t){return t.start??(t.questionnaires?.length?"questionnaire":"observation")}}class U{static KEY="rr0-case-template";static read(t=U.storage()){try{const e=U.record(t);return e?U.parse(e.text,e.name,e.url):void 0}catch{return}}static parse(t,e,r){const s=r??(typeof location>"u"?"https://localhost/":location.href);return L.check(JSON.parse(t),s,r?"address":"file",e)}static keep(t,e,r=U.storage(),s){const o=U.parse(t,e,s);if(!r)throw new Error("No storage in this browser");return r.setItem(U.KEY,JSON.stringify({name:e,text:t,...s?{url:s}:{}})),o}static forget(t=U.storage()){try{t?.removeItem(U.KEY)}catch{}}static record(t){const e=t?.getItem(U.KEY);return e?JSON.parse(e):void 0}static storage(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}}class H extends Error{}class we{constructor(t){this.name=t}validate(t){return!0}}class sn extends we{min;max;constructor(t,e,r){super(t),this.min=e,this.max=r}validate(t){if(typeof t!="number")throw new H(`${this.name} value must be a number, but was ${t}`);if(t<this.min||t>this.max)throw new H(`${this.name} value must be >= ${this.min} and <= ${this.max}, but was ${t}`);return super.validate(t)}}class v{name;min;max;duration;subUnit;validator;constructor(t,e,r,s,o=new sn(t,e,r)){this.name=t,this.min=e,this.max=r,this.subUnit=s,this.duration=s?(s.max-s.min+1)*s.duration:1,this.validator=o}validate(t){return this.validator.validate(t)}[Symbol.iterator](){let t=this.min;return{next:()=>{const e={done:t>this.max,value:t};return t++,e}}}}class Ue{millisecond;second;minute;hour;day;month;year}class Gn extends Ue{}class on extends Gn{millisecond=new v("millisecond",0,999,void 0);second=new v("second",0,59,this.millisecond);minute=new v("minute",0,59,this.second);hour=new v("hour",0,23,this.minute);day=new v("day",1,31,this.hour);month=new v("month",1,12,this.day);year=new v("year",0,9999,this.month)}const w=new on;class an extends sn{constructor(t=1,e=12){super("month",t,e)}}class _t extends v{static Month28=new _t(28);static Month29=new _t(29);static ThirtyDays=new _t(30);static ThirtyOneDays=new _t(31);constructor(t,e=new an(1,t)){super("month",1,t,w.day,e)}static create(t,e){switch(t){case 1:case 3:case 5:case 7:case 8:case 10:case 12:return this.ThirtyOneDays;case 2:return e%4===0?this.Month29:this.Month28;case 4:case 6:case 9:case 11:return this.ThirtyDays;default:throw new H("Unsupported month",t,e)}}}class tt{static instance=new tt;render(t){return t.value.toString()}}class B{unit;#t;constructor(t,e){this.unit=e,this.value=typeof t=="number"?t:t.value}get value(){return this.#t}set value(t){this.unit.validate(t),this.#t=t}get duration(){return this.value*this.unit.duration}#e(t){if(this.constructor.name!==t.constructor.name)throw new we(`${this.unit.name} "${this.toString()}" cannot be compared with ${t.unit?.name} "${t.toString()}"`)}compare(t){return this.#e(t),this.value-t.value}isEqual(t){return this.compare(t)===0}isBefore(t){return this.compare(t)<0}isAfter(t){return this.compare(t)>0}previous(t=this.unit){const e=this.value-1;return new this.constructor(e,t)}next(t=this.unit){const e=this.value+1;return new this.constructor(e,t)}toString(t=tt.instance){return t.render(this)}toSpec(){return{value:this.value}}toJSON(){return this.toSpec()}}class h{static#t=new Map;static register(t,e){h.#t.set(t,e)}static get(t){const e=h.#t.get(t);if(!e)throw new H(`No default parser registered for ${t.name}: import "@rr0/time/defaults" or pass a parser to fromString()`);return e()}}class Ot extends B{constructor(t=new Date().getFullYear(),e=w.year){super(t,e)}static fromString(t,e=h.get(Ot)){return new Ot(e.parse(t))}}class rt extends tt{static default=new rt("0",2);constructor(t,e){super(),this.char=t,this.size=e}render(t){return super.render(t).padStart(this.size,this.char)}}class Vt extends B{constructor(t=new Date().getMonth()+1,e=w.month){super(t,e)}static fromString(t,e=h.get(Vt)){return new Vt(e.parse(t))}toString(t=rt.default){return super.toString(t)}}class $t extends B{constructor(t=new Date().getDate(),e=w.day){super(t,e)}static fromString(t,e=h.get($t)){const r=e.parse(t);return new $t(r)}toString(t=rt.default){return super.toString(t)}}class Ft extends B{constructor(t=new Date().getHours(),e=w.hour){super(t,e)}static fromString(t,e=h.get(Ft)){return new Ft(e.parse(t))}toString(t=rt.default){return super.toString(t)}}class Dt extends B{constructor(t=new Date().getMinutes(),e=w.minute){super(t,e)}static fromString(t,e=h.get(Dt)){return new Dt(e.parse(t))}toString(t=rt.default){return super.toString(t)}}class Pt extends B{constructor(t=new Date().getSeconds(),e=w.second){super(t,e)}static fromString(t,e=h.get(Pt)){return new Pt(e.parse(t),w.second)}toString(t=rt.default){return super.toString(t)}}class xt extends B{static renderer=new rt("0",3);constructor(t,e=w.millisecond){super(t,e)}static parseFraction(t){return parseInt(t.padEnd(3,"0").substring(0,3),10)}toString(t=xt.renderer){return super.toString(t)}}class kn{render(t){return t.toString()}}class Rn extends kn{render(t){const e=t.value,r=Math.abs(e),s=Math.floor(r/60),o=r%60;if(s===0&&o===0)return"Z";{const i=e<0?"-":"+",a=s.toString().padStart(2,"0"),l=o>0?":"+o.toString().padEnd(2,"0"):"";return i+a+l}}}class St{value;name="timeshift";renderer;constructor(t=0){this.value=t}static fromString(t,e=h.get(St),r=void 0){const s=e.parse(t,r);return new St(s)}toString(t=new Rn){return t.render(this)}toSpec(){return{value:this.value}}toJSON(){return this.toSpec()}}class P{static timeshift(t,e){return t+(P.isDaylight(e)?60:0)}static isDaylight(t){const{year:e,month:r,day:s}=t,o=t.hour??12;if(![e,r,s].every(Number.isInteger))throw new RangeError("Daylight saving time depends on the year, month and day");const i=P.rule(e);if(!i)return!1;const a=P.rank(r,s,o);return a>=P.rank(i.start.month,i.start.day,2)&&a<P.rank(i.end.month,i.end.day,2)}static rule(t){if(t<1967)return;const e={month:10,day:P.sunday(t,10,-1)};return t>=2007?{start:{month:3,day:P.sunday(t,3,2)},end:{month:11,day:P.sunday(t,11,1)}}:t>=1987?{start:{month:4,day:P.sunday(t,4,1)},end:e}:t===1975?{start:{month:2,day:23},end:e}:t===1974?{start:{month:1,day:6},end:e}:{start:{month:4,day:P.sunday(t,4,-1)},end:e}}static sunday(t,e,r){const s=new Date(Date.UTC(2e3,e-1,1));s.setUTCFullYear(t);const o=1+(7-s.getUTCDay())%7;if(r>0)return o+7*(r-1);const i=[31,P.isLeap(t)?29:28,31,30,31,30,31,31,30,31,30,31][e-1];let a=o;for(;a+7<=i;)a+=7;return a}static isLeap(t){return t%4===0&&(t%100!==0||t%400===0)}static rank(t,e,r){return(t*100+e)*100+r}}const On={name:"PST",timeshift:"-08",title:"Pacific Standard Time (US)"},Vn={name:"PDT",timeshift:"-07",title:"Pacific Daylight Time (US)"},$n={name:"MDT",timeshift:"-06",title:"Mountain Standard Time (US)"},Fn={name:"MST",timeshift:"-07",title:"Mountain Daylight Time (US)"},Dn={name:"PT",timeshift:n=>P.timeshift(-480,n),title:"Pacific Time (US)"},Pn={name:"MT",timeshift:n=>P.timeshift(-420,n),title:"Mountain Time (US)"},Un={name:"CT",timeshift:n=>P.timeshift(-360,n),title:"Central Time (US)"},Bn={name:"ET",timeshift:n=>P.timeshift(-300,n),title:"Eastern Time (US)"},Ln={name:"CWT",timeshift:"-05",title:"Central War Time (US)"},jn={name:"CDT",timeshift:"-05",title:"Central Daylight Time"},Cn={name:"EST",timeshift:"-05",title:"Eastern Standard Time (US)"},Kn={name:"EDT",timeshift:"-04",title:"Eastern Time (US)"},Hn={name:"AST",timeshift:"-04",title:"Atlantic Standard Time (US)"},qn={name:"ADT",timeshift:"-03",title:"Atlantic Daylight Time (US)"},zn={name:"UTC",timeshift:"Z",title:"Coordinated Universal Time"},Wn={name:"Z",timeshift:"Z",title:"UTC"},Yn={name:"GMT",timeshift:"Z",title:"Greenwich Mean Time"},Xn={name:"BST",timeshift:"+01",title:"British Summer Time"},Jn={name:"CEST",timeshift:"+02",title:"Central European Summer Time"},Zn={name:"CET",timeshift:"+01",title:"Central European Time"},Qn={name:"MSK",timeshift:"+03",title:"Moscow Time (RU)"},ts={name:"IST",timeshift:"+05:30",title:"Indian Standard Time"},es={name:"BJT",timeshift:"+08",title:"Beijing Time"},rs={name:"CST",timeshift:"-06",title:"Central Standard Time"},ns={name:"JST",timeshift:"+09",title:"Japan Standard Time"},ss={name:"AEST",timeshift:"+10",title:"Australian Eastern Standard Time"},os={name:"NZST",timeshift:"+12",title:"New Zealand Standard Time"},is={name:"LST",timeshift:"?",title:"Local Sideral Time"},nr=[qn,ss,Hn,es,Xn,rs,jn,Zn,Jn,Un,Ln,Kn,Cn,Bn,Yn,ts,ns,is,$n,Qn,Fn,Pn,os,Vn,On,Dn,zn,Wn];class ye{static instance=new ye;renderComponent(t,e){return t[e].toString()}renderSecond(t){return this.renderComponent(t,"second")+(t.millisecond?"."+t.millisecond.toString():"")}render(t){const e=[];t.year&&e.push(this.renderComponent(t,"year")),t.month&&e.push(this.renderComponent(t,"month")),t.day&&e.push(this.renderComponent(t,"day"));const r=[];t.hour&&r.push(this.renderComponent(t,"hour")),t.minute&&r.push(this.renderComponent(t,"minute")),t.second&&r.push(this.renderSecond(t));const s=e.join("-"),o=t.timeshift?t.timeshift.toString():"",i=r.join(":")+o;return s+(i.length>0?"T"+i:"")}}class vt extends H{constructor(t="method is abstract"){super(t)}}class Be{units;constructor(t){this.units=t}newYear(t){throw new vt}newMonth(t){throw new vt}newDay(t){throw new vt}newHour(t){throw new vt}newMinute(t){throw new vt}newSecond(t){throw new vt}}class as extends Ue{millisecond=new v("milliseconds",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,void 0);second=new v("seconds",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.millisecond);minute=new v("minutes",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.second);hour=new v("hours",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.minutes);day=new v("days",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.hour);month=new v("months",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.day);year=new v("years",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const ue=new as;class be{static instance=new be;render(t){const e=Y.toSpec(t);let r="P";const s=e.years;s&&(r+=s.toString()+"Y");const o=e.months;o&&(r+=o.toString(tt.instance)+"MM");const i=e.days;i&&(r+=i.toString(tt.instance)+"D");const a=e.hours;a&&(r+=a.toString(tt.instance)+"H");const l=e.minutes;l&&(r+=l.toString(tt.instance)+"M");const c=e.seconds;return c&&(r+=c.toString(tt.instance)+"S"),r}}class Y extends B{constructor(t={years:new Date().getFullYear(),months:new Date().getMonth(),days:new Date().getDate(),hours:new Date().getHours(),minutes:new Date().getMinutes(),seconds:new Date().getSeconds(),milliseconds:new Date().getMilliseconds()}){super({value:typeof t=="number"?t:+(t.years?t.years*w.year.duration:0)+(t.months?t.months*w.month.duration:0)+(t.days?t.days*w.day.duration:0)+(t.hours?t.hours*w.hour.duration:0)+(t.minutes?t.minutes*w.minute.duration:0)+(t.seconds?t.seconds*w.second.duration:0)},new v("millisecond",0,Number.MAX_SAFE_INTEGER,void 0))}static toSpec(t,e=cs){let r=typeof t=="number"?t:t.value;const s=r>0?1:-1;r=Math.abs(r);const o={},i=r/w.year.duration,a=Math.floor(i);a>0&&(o.years=e.newYear(s*a),r-=a*w.year.duration);const l=r/w.month.duration,c=Math.floor(l);c>0&&(o.months=e.newMonth(s*c),r-=c*w.month.duration);const m=r/w.day.duration,p=Math.floor(m);p>0&&(o.days=e.newDay(s*p),r-=p*w.day.duration);const f=r/w.hour.duration,y=Math.floor(f);y>0&&(o.hours=e.newHour(s*y),r-=y*w.hour.duration);const S=r/w.minute.duration,E=Math.floor(S);E>0&&(o.minutes=e.newMinute(s*E),r-=E*w.minute.duration);const G=r/w.second.duration,mt=Math.floor(s*G);return mt>0&&(o.seconds=e.newSecond(mt)),o}static fromString(t,e=h.get(Y)){return new Y(e.parse(t))}static between(t,e){const r=e.getTime(),s=t.getTime();return new Y(r-s)}toSpec(){return Y.toSpec(this)}toString(t=be.instance){return t.render(this)}}class un extends Be{constructor(t){super(t)}newYear(t){return new Ot(t,this.units.year)}newMonth(t){return new Vt(t,this.units.month)}newDay(t){return new $t(t,this.units.day)}newHour(t){return new Ft(t,this.units.hour)}newMinute(t){return new Dt(t,this.units.minute)}newSecond(t){return new Pt(t,this.units.second)}newMillisecond(t){return new xt(t,this.units.millisecond)}newTimeshift(t){return new St(typeof t=="number"?t:t.value)}}const us=new un(w),cs=new un(ue);class D{#t;#e;#r;#n;#s;#o;#i;#a;constructor(t={year:new Date().getFullYear(),month:new Date().getMonth()+1,day:new Date().getDate(),hour:new Date().getHours(),minute:new Date().getMinutes(),second:new Date().getSeconds(),timeshift:D.timeshiftOf(new Date)}){this.year=t.year,this.month=t.month,this.day=t.day,this.hour=t.hour,this.minute=t.minute,this.second=t.second,this.millisecond=t.millisecond,this.timeshift=t.timeshift}get year(){return this.#t}set year(t){const e=typeof t=="number";this.#t&&e?this.#t.value=t:this.#t=e?this.factory.newYear(t):!t||t.start||t instanceof B?t:this.factory.newYear(t)}get month(){return this.#e}set month(t){const e=typeof t=="number";this.#e&&e?this.#e.value=t:this.#e=e?this.factory.newMonth(t):!t||t.start||t instanceof B?t:this.factory.newMonth(t)}get day(){return this.#r}set day(t){const e=typeof t=="number";this.#r&&e?this.#r.value=t:this.#r=e?this.factory.newDay(t):!t||t.start||t instanceof B?t:this.factory.newDay(t)}get hour(){return this.#n}set hour(t){const e=typeof t=="number";this.#n&&e?this.#n.value=t:this.#n=e?this.factory.newHour(t):!t||t.start||t instanceof B?t:this.factory.newHour(t)}get minute(){return this.#s}set minute(t){const e=typeof t=="number";this.#s&&e?this.#s.value=t:this.#s=e?this.factory.newMinute(t):!t||t.start||t instanceof B?t:this.factory.newMinute(t)}get second(){return this.#o}set second(t){const e=typeof t=="number";this.#o&&e?this.#o.value=t:this.#o=e?this.factory.newSecond(t):!t||t.start||t instanceof B?t:this.factory.newSecond(t)}get millisecond(){return this.#i}set millisecond(t){const e=typeof t=="number";this.#i&&e?this.#i.value=t:this.#i=e||t&&!(t instanceof B)?this.factory.newMillisecond(t):t}get timeshift(){return this.#a}set timeshift(t){const e=typeof t=="number";this.#a&&e?this.#a.value=t:this.#a=e||t&&!(t instanceof St)?this.factory.newTimeshift(t):t}get factory(){return us}static fromString(t,e=h.get(D)){const{year:r,month:s,day:o,hour:i,minute:a,second:l,millisecond:c,timeshift:m}=e.parse(t);return new D({year:r,month:s,day:o,hour:i,minute:a,second:l,millisecond:c,timeshift:m})}static timeshiftOf(t){return-t.getTimezoneOffset()||0}static fromDate(t){return new D({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:D.timeshiftOf(t)})}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),r=t.substring(0,e)+t.substring(e+4);return D.fromString(r)}#u(t){if(this.constructor.name!==t.constructor.name)throw new we(`Date "${this.toString()}" cannot be compared with "${t.toString()}"`)}compare(t){return this.#u(t),this.getTime()-t.getTime()}delta(t){const e=this.compare(t);return new Y(e)}getTime(){return(this.year?.duration||0)+(this.month?.duration||0)+(this.day?.duration||0)+(this.hour?.duration||0)+(this.minute?.duration||0)+(this.second?.duration||0)+(this.millisecond?.duration||0)}isEqual(t){return this.compare(t)===0}isBefore(t){return this.compare(t)<0}isAfter(t){return this.compare(t)>0}clone(){return new D(this.toSpec())}previous(){let t=this.clone();try{t.second=this.second.previous()}catch{try{t.minute=this.minute.previous()}catch{try{t.hour=this.hour.previous()}catch{try{t.day=this.day.previous()}catch{try{t.month=this.month.previous()}catch{t.year=this.year.previous()}}}}}return t}next(){let t=this.clone();try{t.second=this.second.next()}catch{try{t.minute=this.minute.next()}catch{try{t.hour=this.hour.next()}catch{try{t.day=this.day.next()}catch{try{t.month=this.month.next()}catch{t.year=this.year.next()}}}}}return t}toString(t=ye.instance){return t.render(this)}toSpec(){const t={},e=this.year?.toSpec();e&&(t.year=e);const r=this.month?.toSpec();r&&(t.month=r);const s=this.day?.toSpec();s&&(t.day=s);const o=this.hour?.toSpec();o&&(t.hour=o);const i=this.minute?.toSpec();i&&(t.minute=i);const a=this.second?.toSpec();a&&(t.second=a);const l=this.millisecond?.toSpec();l&&(t.millisecond=l);const c=this.timeshift?.toSpec();return c&&(t.timeshift=c),t}toJSON(){return this.toSpec()}}class Le{static instance=new Le;render(t){return(t.start?t.start.toString():"")+"/"+(t.end?t.end.toString():"")}}class jt{constructor(t,e){this.start=t,this.end=e}_start;get start(){return this._start}set start(t){if(typeof t=="string"&&(t=D.fromString(t)),t&&!(t instanceof D)&&!(t instanceof Y))throw new H("Interval start is not a level 0 date or duration: "+t);this._start=t}_end;get end(){return this._end}set end(t){if(typeof t=="string"&&(t=D.fromString(t)),t&&!(t instanceof D)&&!(t instanceof Y))throw new H("Interval end is not a level 0 date or duration: "+t);this._end=t}static fromString(t,e=h.get(jt)){const{start:r,end:s}=e.parse(t);return new jt(r,s)}toString(t=Le.instance){return t.render(this)}[Symbol.iterator](){let t=this.start;return{next:()=>{const e={done:t>this.end,value:t};return t++,e}}}}class ce extends tt{static instance=new ce(rt.default);constructor(t){super(),this.valueRenderer=t}render(t){return(this.valueRenderer?this.valueRenderer.render(t):super.render(t))+this.qualifier(t)}qualifier(t){return t.uncertain?t.approximate?"%":"?":t.approximate?"~":""}}class et extends B{#t;#e;constructor(t,e){super(t,e),this.#t=t.uncertain||!1,this.#e=t.approximate||!1}get uncertain(){return this.#t}set uncertain(t){return this.#t=t}get approximate(){return this.#e}set approximate(t){return this.#e=t}isCertainAndPrecise(){return!this.approximate&&!this.uncertain}isEqual(t){return this.isCertainAndPrecise()&&super.isEqual(t)}isBefore(t){return this.isCertainAndPrecise()&&super.isBefore(t)}isAfter(t){return this.isCertainAndPrecise()&&super.isAfter(t)}toString(t=ce.instance){return super.toString(t)}toSpec(){return{...super.toSpec(),uncertain:this.uncertain,approximate:this.approximate}}toJSON(){return this.toSpec()}}class cn extends on{year=new v("year",-9999,9999,this.month);yearExtended=new v("year",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const me=new cn;class ft extends et{constructor(t,e=me.year){super(t,e)}static fromString(t,e=me.year,r=h.get(ft)){const s=r.parse(t),o=s.value.start;if(t.startsWith("Y")&&(e=me.yearExtended),o!==void 0){const i=new ft(Object.assign({...s},{value:Math.max(o,e.min)})),a=new ft(Object.assign({...s},{value:Math.min(s.value.end,e.max)}));return{start:i,end:a}}else return new ft(s,e)}}class dn extends we{monthValidator=new an;validate(t){switch(t){case 21:case 22:case 23:case 24:return!0;default:return this.monthValidator.validate(t)}}}class gt extends et{constructor(t,e=new v(w.month.name,1,24,w.day,new dn)){super(t,e)}static fromString(t,e=h.get(gt)){const r=e.parse(t),s=r.value.start;if(s!==void 0){let o=w.month;const i=new gt(Object.assign({...r},{value:Math.max(s,o.min)})),a=new gt(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new gt(r)}toString(t){return super.toString(t).padStart(2,"0")}}class wt extends et{constructor(t,e=w.day){super(t,e)}static fromString(t,e=h.get(wt)){const r=e.parse(t),s=r.value.start;if(s!==void 0){let o=w.day;const i=new wt(Object.assign({...r},{value:Math.max(s,o.min)})),a=new wt(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new wt(r)}toString(t){return super.toString(t).padStart(2,"0")}}class yt extends et{constructor(t,e=w.hour){super(t,e)}static fromString(t,e=h.get(yt)){const r=e.parse(t),s=r.value.start;if(s!==void 0){let o=w.hour;const i=new yt(Object.assign({...r},{value:Math.max(s,o.min)})),a=new yt(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new yt(r)}}class bt extends et{constructor(t,e=w.minute){super(t,e)}static fromString(t,e=h.get(bt)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=w.minute,i=new bt(Object.assign({...r},{value:Math.max(s,o.min)})),a=new bt(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new bt(r)}toString(t=ce.instance){return super.toString(t)}}class Et extends et{constructor(t,e=w.second){super(t,e)}static fromString(t,e=h.get(Et)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=w.second,i=new Et(Object.assign({...r},{value:Math.max(s,o.min)})),a=new Et(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new Et(r)}}class Tt extends St{static fromString(t,e=h.get(Tt),r=void 0){return new Tt(e.parse(t,r))}}class ln extends Be{constructor(t){super(t)}newYear(t){return new ft(t,this.units.year)}newMonth(t){return new gt(t,this.units.month)}newDay(t){return new wt(t,this.units.day)}newHour(t){return new yt(t,this.units.hour)}newMinute(t){return new bt(t,this.units.minute)}newSecond(t){return new Et(t,this.units.second)}newMillisecond(t){return new xt(t,this.units.millisecond)}newTimeshift(t){return new Tt(typeof t=="number"?t:t.value)}}const ds=new ln(me),ls=new ln(ue);class C extends D{constructor(t){super(t)}get factory(){return ds}get uncertain(){return this.year?.uncertain===!0||this.month?.uncertain===!0||this.day?.uncertain===!0||this.hour?.uncertain===!0||this.minute?.uncertain===!0||this.second?.uncertain===!0}get approximate(){return this.year?.approximate===!0||this.month?.approximate===!0||this.day?.approximate===!0||this.hour?.approximate===!0||this.minute?.approximate===!0||this.second?.approximate===!0}static fromDate(t){return new C({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:D.timeshiftOf(t)})}static fromString(t,e=h.get(C)){const r=e.parse(t);return new C(r)}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),r=t.substring(0,e)+t.substring(e+4);return C.fromString(r)}clone(){return new C(this.toSpec())}}const $=Object.freeze({year:"year",month:"month",day:"day",hour:"hour",minute:"minute",second:"second",timeshift:"timeshift",uncertain:"uncertain",approximate:"approx"});class Ee extends be{static instance=new Ee;render(t){return super.render(t)}}class R extends et{constructor(t){super(typeof t=="number"||t.hasOwnProperty("value")?t:{value:R.getValue(t,$.year)+R.getValue(t,$.month)+R.getValue(t,$.day)+R.getValue(t,$.hour)+R.getValue(t,$.minute)+R.getValue(t,$.second),uncertain:R.getBoolean(t,$.uncertain),approximate:R.getBoolean(t,"approximate")},ue.millisecond)}static getBoolean(t,e){return t[e]||t[$.year+"s"]?.[e]||t[$.month+"s"]?.[e]||t[$.day+"s"]?.[e]||t[$.hour+"s"]?.[e]||t[$.minute+"s"]?.[e]||t[$.second+"s"]?.[e]||!1}static getValue(t,e){let r=0,s=t[e+"s"];if(s instanceof et?s=s.value:typeof t=="number"&&(s=t),s){const o=w[e];r=s*o.duration}return r}static toSpec(t,e=ls){return{...Y.toSpec(t,e),uncertain:t.uncertain||!1,approximate:t.approximate||!1}}static fromString(t,e=h.get(R)){const r=e.parse(t);return new R(r)}static between(t,e){const r=e.getTime(),s=t.getTime();return new R(r-s)}toString(t=Ee.instance){return super.toString(t)}toSpec(){return R.toSpec(this)}}class Ct extends jt{constructor(t,e){super(t,e)}get start(){return this._start}set start(t){if(typeof t=="string"&&(super.start=C.fromString(t)),t&&!(t instanceof C)&&!(t instanceof R))throw new H("Interval start is not a level 1 date or duration: "+t);this._start=t}get end(){return this._end}set end(t){if(typeof t=="string"&&(t=C.fromString(t)),t&&!(t instanceof C)&&!(t instanceof R))throw new H("Interval end is not a level 1 date or duration: "+t);this._end=t}static fromString(t,e=h.get(Ct)){const{start:r,end:s}=e.parse(t);return new Ct(r,s)}}class Bt extends et{uncertainComponent;approximateComponent;constructor(t,e){super(t,e),this.uncertainComponent=t.uncertainComponent||!1,this.approximateComponent=t.approximateComponent||!1}get uncertain(){return super.uncertain||this.uncertainComponent}set uncertain(t){return super.uncertain=t}get approximate(){return super.approximate||this.approximateComponent}set approximate(t){return super.approximate=t}get uncertainGroup(){return super.uncertain}get approximateGroup(){return super.approximate}toSpec(){return{...super.toSpec(),uncertain:this.uncertainGroup,approximate:this.approximateGroup,uncertainComponent:this.uncertainComponent,approximateComponent:this.approximateComponent}}toJSON(){return this.toSpec()}}class ms extends cn{year=new v("year",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const De=new ms;class st extends Bt{constructor(t,e=De.year){super(t,e)}static fromString(t,e=De.year,r=h.get(st)){const s=r.parse(t),o=s.value.start;if(o!==void 0){const i=new st(Object.assign({...s},{value:Math.max(o,e.min)})),a=new st(Object.assign({...s},{value:Math.min(s.value.end,e.max)})),l={start:i,end:a},c=s.value.estimate;return c&&(l.estimate=c),l}else return new st(s)}}class ps extends dn{validate(t){switch(t){case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:return!0;default:return super.validate(t)}}}class ot extends Bt{constructor(t,e=new v(w.month.name,1,41,w.day,new ps)){super(t,e)}static fromString(t,e=h.get(ot)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=w.month,i=new ot(Object.assign({...r},{value:Math.max(s,o.min)})),a=new ot(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new ot(r)}toString(t){return super.toString(t).padStart(2,"0")}}class it extends Bt{constructor(t,e=w.day){super(t,e)}static fromString(t,e=h.get(it)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=w.day,i=new it(Object.assign({...r},{value:Math.max(s,o.min)})),a=new it(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new it(r)}toString(t){return super.toString(t).padStart(2,"0")}}class at extends Bt{constructor(t,e=w.hour){super(t,e)}static fromString(t,e=h.get(at)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=w.hour,i=new at(Object.assign({...r},{value:Math.max(s,o.min)})),a=new at(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new at(r)}}class ut extends Bt{constructor(t,e=w.minute){super(t,e)}static fromString(t,e=h.get(ut)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=w.minute,i=new ut(Object.assign({...r},{value:Math.max(s,o.min)})),a=new ut(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new ut(r)}}class ct extends Bt{constructor(t,e=w.second){super(t,e)}static fromString(t,e=w.second,r=h.get(ct)){const s=r.parse(t),o=s.value.start;if(o!==void 0){const i=new ct(Object.assign({...s},{value:Math.max(o,e.min)})),a=new ct(Object.assign({...s},{value:Math.min(s.value.end,e.max)}));return{start:i,end:a}}else return new ct(s,e)}}class mn extends Tt{}class hs extends ce{qualifier(){return""}}class pt extends ye{static instance=new pt;static valueRenderer=new hs(rt.default);static names=["year","month","day","hour","minute","second"];static qualifier(t,e){return t?e?"%":"?":e?"~":""}renderComponent(t,e){const r=t[e],s=pt.names.slice(pt.names.indexOf(e)+1).map(a=>t[a]).filter(Boolean),o=pt.qualifier(r.uncertainComponent,r.approximateComponent),i=pt.qualifier(r.uncertainGroup&&!r.uncertainComponent&&!s.some(a=>a.uncertain),r.approximateGroup&&!r.approximateComponent&&!s.some(a=>a.approximate));return o+r.toString(pt.valueRenderer)+i}}class pn extends Be{constructor(t){super(t)}newYear(t){return new st(t,this.units.year)}newMonth(t){return new ot(t,this.units.month)}newDay(t){return new it(t,this.units.day)}newHour(t){return new at(t,this.units.hour)}newMinute(t){return new ut(t,this.units.minute)}newSecond(t){return new ct(t,this.units.second)}newMillisecond(t){return new xt(t,this.units.millisecond)}newTimeshift(t){return new mn(typeof t=="number"?t:t.value)}}const fs=new pn(De),gs=new pn(ue);class K extends C{constructor(t){super(t)}toString(t=pt.instance){return super.toString(t)}get year(){return super.year}set year(t){super.year=t}get month(){return super.month}set month(t){super.month=t}get factory(){return fs}static fromDate(t){return new K({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:D.timeshiftOf(t)})}static fromString(t,e=h.get(K)){const r=e.parse(t);return new K(r)}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),r=t.substring(0,e)+t.substring(e+4);return K.fromString(r)}clone(){return new K(this.toSpec())}}class dt{regExp;constructor(t,e){this.name=t,this.regExp=new RegExp(`^(?:${e})$`)}regexGroups(t){const e=this.regExp.exec(t);if(!e)throw new H(`Invalid ${this.name} "${t}"`);return e.groups}parseGroups(t){throw new vt(`${this.constructor.name} is abstract`)}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}class Gt extends Ee{static instance=new Gt;static designators=[["years","Y"],["months","MM"],["days","D"],["hours","H"],["minutes","M"],["seconds","S"]];static qualifier(t,e){return t?e?"%":"?":e?"~":""}render(t){const e=Gt.qualifier(t.uncertainDuration,t.approximateDuration);if(!t.hasQualifiedComponent)return e+super.render(t);let r=e+"P";for(const[s,o]of Gt.designators){const i=t.components[s];i&&(r+=Gt.qualifier(i.uncertainComponent,i.approximateComponent)+i.value+o)}return r}}class k extends R{#t;constructor(t){if(super(typeof t=="number"?t:{value:k.valueFromSpec(t),uncertain:t.uncertain===!0,approximate:t.approximate===!0},ue.millisecond),typeof t!="number"){const e={};for(const r of k.componentNames)t[r]instanceof et&&(e[r]=t[r]);Object.keys(e).length>0&&(this.#t=e)}}static componentNames=["years","months","days","hours","minutes","seconds"];get components(){return this.#t}#e(t){return this.#t?Object.values(this.#t).some(e=>e[t]):!1}get uncertainDuration(){return super.uncertain}get approximateDuration(){return super.approximate}get uncertain(){return super.uncertain||this.#e("uncertain")}set uncertain(t){super.uncertain=t}get approximate(){return super.approximate||this.#e("approximate")}set approximate(t){super.approximate=t}get hasQualifiedComponent(){return this.#t?Object.values(this.#t).some(t=>t.uncertainComponent||t.approximateComponent):!1}static valueFromSpec(t){return k.getValue(t,$.year)+k.getValue(t,$.month)+k.getValue(t,$.day)+k.getValue(t,$.hour)+k.getValue(t,$.minute)+k.getValue(t,$.second)}static toSpec(t,e=gs){const r=R.toSpec(t,e);if(t instanceof k&&t.hasQualifiedComponent)for(const s of k.componentNames)delete r[s],t.components[s]&&(r[s]=t.components[s]);return r}static fromString(t,e=h.get(k)){const r=e.parse(t);return new k(r)}static between(t,e){const r=e.getTime(),s=t.getTime();return new k(r-s)}toSpec(){return k.toSpec(this)}toString(t=Gt.instance){return super.toString(t)}}class Kt extends Ct{get start(){return this._start}set start(t){if(typeof t=="string"&&(super.start=K.fromString(t)),t&&!(t instanceof K)&&!(t instanceof k))throw new H("Interval start is not a level 2 date or duration: "+t);this._start=t}get end(){return this._end}set end(t){if(typeof t=="string"&&(t=K.fromString(t)),t&&!(t instanceof K)&&!(t instanceof k))throw new H("Interval end is not a level 2 date or duration: "+t);this._end=t}static fromString(t,e=h.get(Kt)){const{start:r,end:s}=e.parse(t);return new Kt(r,s)}}class ge extends Set{constructor(t,e){super(t),this.exclusive=e}has(t){const e=t.toString().replace("..","/");for(const r of this)if(r.toString()===e)return!0;return!1}static fromString(t,e=h.get(ge)){const{exclusive:r,values:s}=e.parse(t);return new ge(s,r)}}class lt extends dt{constructor(t,e){super(t,e)}static read(t){return{value:t?parseInt(t,10):void 0}}parseGroups(t){return lt.read(t[this.name])}parse(t){if(t.startsWith("-"))throw new H(`${this.name} cannot be negative`);return super.parse(t)}}class u{static groupName(...t){return t.reduce((e,r)=>e?e+r.charAt(0).toUpperCase()+r.substring(1):r,"")}static group(t,...e){return`(?<${t}>${e.join("")})`}static optional(t){return t+"?"}static nonCapturingGroup(...t){return`(?:${t.join("")})`}static optionalGroup(t,...e){return u.optional(u.group(t,...e))}static optionalNonCapturingGroup(...t){return u.optional(u.nonCapturingGroup(...t))}static numberGroup(t,e,r,s="\\d"){return u.group(t,`${r||""}[${s}]${e}`)}}const sr="yearValue";class Ht extends lt{static format(t=""){return u.numberGroup(u.groupName(t,sr),"{4}",void 0)}constructor(){super(sr,Ht.format())}}const or="monthValue";class qt extends lt{static format(t=""){return u.numberGroup(u.groupName(t,or),"{1,2}",void 0)}constructor(){super(or,qt.format())}}const ir="dayValue";class kt extends lt{static format(t=""){return u.numberGroup(u.groupName(t,ir),"{1,2}",void 0)}constructor(){super(ir,kt.format())}}const ar="hourValue";class Rt extends lt{static format(t=""){return u.numberGroup(u.groupName(t,ar),"{1,2}",void 0)}constructor(){super(ar,Rt.format())}}const ur="minuteValue";class zt extends lt{static format(t=""){return u.numberGroup(u.groupName(t,ur),"{1,2}",void 0)}constructor(){super(ur,zt.format())}}const cr="secondValue";class Wt extends lt{static format(t=""){return u.numberGroup(u.groupName(t,cr),"{1,2}",void 0)}constructor(){super(cr,Wt.format())}}const dr="timeshiftValue",lr="shiftHour",mr="shiftMinute";class Ut extends dt{static format(t=""){return nr.map(e=>e.name).join("|")+"|"+u.nonCapturingGroup(u.group(t+lr,u.numberGroup(u.groupName(t,dr),"{2}","[+-]")),u.optionalNonCapturingGroup(":?",u.numberGroup(u.groupName(t,mr),"{2}",void 0)))}constructor(){super(dr,Ut.format())}parse(t,e){let r=0;const s=nr.find(o=>o.name===t);if(s){if(typeof s.timeshift=="function")try{return s.timeshift(e??{})}catch(o){throw new H(`The time zone ${t} depends on the date: ${o.message}`)}t=s.timeshift}if(t!=="Z"){const o=this.regexGroups(t),i=o[lr];i&&(r+=parseInt(i,10)*60);const a=o[mr];a&&(r+=parseInt(a,10))}return r}}const pr="year",hr="month",fr="day",gr="hour",wr="minute",yr="second",br="millisecond",Er="timeshift";class Mt extends dt{static format(t=""){return u.group(u.groupName(t,pr),Ht.format(t))+u.optionalNonCapturingGroup("-",u.group(u.groupName(t,hr),qt.format(t)),u.optionalNonCapturingGroup("-",u.group(u.groupName(t,fr),kt.format(t)),u.optionalNonCapturingGroup("[T ]",u.group(u.groupName(t,gr),Rt.format(t)),":?",u.group(u.groupName(t,wr),zt.format(t)),u.optionalNonCapturingGroup(":",u.group(u.groupName(t,yr),Wt.format(t)),u.optionalNonCapturingGroup("[.,]",u.group(u.groupName(t,br),"\\d+"))),"\\s*",u.optionalGroup(u.groupName(t,Er),Ut.format(t)))))}constructor(){super("date",Mt.format())}parse(t){const e=this.regexGroups(t),r=e[pr],s=e[hr],o=e[fr],i=e[gr],a=e[wr],l=e[yr],c=e[br],m=e[Er],p=r?new Ot(Ht.read(r)):void 0,f=s?qt.read(s):void 0;return{year:p,month:f?new Vt(f,_t.create(f.value,p?.value)):void 0,day:o?new $t(kt.read(o)):void 0,hour:i?new Ft(Rt.read(i)):void 0,minute:a?new Dt(zt.read(a)):void 0,second:l?new Pt(Wt.read(l)):void 0,millisecond:c?xt.parseFraction(c):void 0,timeshift:m?St.fromString(m,new Ut,{year:p?.value,month:f?.value,day:o?kt.read(o).value:void 0,hour:i?Rt.read(i).value:void 0}):void 0}}}const Sr="years",Me="months",ws="days",xr="hours",vr="minutes",Mr="seconds";class je extends dt{static format(t=""){return"P"+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Sr),"+",void 0,"\\d"),"Y")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Me),"+",void 0,"\\d"),"MM")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,ws),"+",void 0,"\\d"),"D")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,xr),"+",void 0,"\\d"),"H")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,vr),"+",void 0,"\\d"),"M")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Mr),"+",void 0,"\\d"),"S")}constructor(){super("duration",je.format())}parseGroups(t){return{years:t[Sr],months:t[Me],days:t[Me],hours:t[xr],minutes:t[vr],seconds:t[Mr]}}}const Ae="start",Te="end";class Ce extends dt{static format=u.group(Ae,Mt.format(Ae))+"/"+u.group(Te,Mt.format(Te));constructor(){super("interval",Ce.format)}parse(t){const e=this.regexGroups(t),r=e[Ae],s=e[Te];return{start:r?D.fromString(r,new Mt):void 0,end:s?D.fromString(s,new Mt):void 0}}}h.register(D,()=>new Mt);h.register($t,()=>new kt);h.register(Y,()=>new je);h.register(Ft,()=>new Rt);h.register(jt,()=>new Ce);h.register(Dt,()=>new zt);h.register(Vt,()=>new qt);h.register(Pt,()=>new Wt);h.register(St,()=>new Ut);h.register(Ot,()=>new Ht);class M extends lt{static uncertainGroup="uncertain";static approximateGroup="approx";static uncertainAndApproximateGroup=M.uncertainGroup+M.approximateGroup;constructor(t,e){super(t,e)}static qualifierFormat(t,e){return u.optionalGroup(t,`\\${e}`)}static formatSuffix(t){return this.qualifierFormat(u.groupName(M.uncertainGroup,t),"?")+this.qualifierFormat(u.groupName(M.approximateGroup,t),"~")+this.qualifierFormat(u.groupName(M.uncertainAndApproximateGroup,t),"%")}static numberFormat(t,e,r){return u.numberGroup(t,e,r,"\\dX")+this.formatSuffix(t)}getValueAndSign(t){let e=t[this.name],r;return e.charAt(0)==="-"?(r=-1,e=e.substring(1)):r=1,{valueStr:e,sign:r}}parseGroups(t){const{valueStr:e,sign:r}=this.getValueAndSign(t);let s=0,o;for(o=0;o<e.length;o++){const c=e[o];if(c==="X")break;s=s*10+parseInt(c,10)}if(o<e.length){let c=1;for(let f=0;f<e.length-o;f++)c*=10;const m=r*s*c,p=m+c-1;s={start:m,end:p}}else s*=r;const i=t[u.groupName(M.uncertainAndApproximateGroup,this.name)],a=t[u.groupName(M.approximateGroup,this.name)]||i,l=t[u.groupName(M.uncertainGroup,this.name)]||i;return{value:s,approximate:a?!!a:!1,uncertain:l?!!l:!1}}}const Ar="yearValue";class Yt extends M{constructor(){super(Ar,Yt.format())}static format(t=""){return"Y?"+M.numberFormat(u.groupName(t,Ar),"+","[-]?")}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}const Tr="monthValue";class Xt extends M{static format(t=""){return M.numberFormat(u.groupName(t,Tr),"{1,2}",void 0)}constructor(){super(Tr,Xt.format())}}const Ir="dayValue";class Jt extends M{static format(t=""){return M.numberFormat(u.groupName(t,Ir),"{1,2}",void 0)}constructor(){super(Ir,Jt.format())}}const Nr="hourValue";class Zt extends M{static format(t=""){return M.numberFormat(u.groupName(t,Nr),"{1,2}",void 0)}constructor(){super(Nr,Zt.format())}}const _r="minuteValue";class Qt extends M{static format(t=""){return M.numberFormat(u.groupName(t,_r),"{1,2}",void 0)}constructor(){super(_r,Qt.format())}}const Gr="secondValue";class te extends M{static format(t=""){return M.numberFormat(u.groupName(t,Gr),"{1,2}",void 0)}constructor(){super(Gr,te.format())}}class ee extends Ut{}class T extends dt{static yearGroup="year";static monthGroup="month";static dayGroup="day";static hourGroup="hour";static minuteGroup="minute";static secondGroup="second";static millisecondGroup="millisecond";static timeshiftGroup="timeshift";constructor(t=T.format()){super("date",t)}static format(t=""){return u.group(u.groupName(t,T.yearGroup),Yt.format(t))+u.optionalNonCapturingGroup("-",u.group(u.groupName(t,T.monthGroup),Xt.format(t)),u.optionalNonCapturingGroup("-",u.group(u.groupName(t,T.dayGroup),Jt.format(t)),u.optionalNonCapturingGroup("[T ]",u.group(u.groupName(t,T.hourGroup),Zt.format(t)),":",u.group(u.groupName(t,T.minuteGroup),Qt.format(t)),u.optionalNonCapturingGroup(":",u.group(u.groupName(t,T.secondGroup),te.format(t)),u.optionalNonCapturingGroup("[.,]",u.group(u.groupName(t,T.millisecondGroup),"\\d+"))),u.optionalGroup(u.groupName(t,T.timeshiftGroup),ee.format(t)))))}parseGroups(t){const e=t[T.millisecondGroup],r=e?xt.parseFraction(e):void 0,s=t[T.secondGroup],o=s?Et.fromString(s,new te):void 0,i=t[T.minuteGroup];let a;i&&(a=bt.fromString(i,new Qt),a.uncertain=a.uncertain||o?.uncertain||!1,a.approximate=a.approximate||o?.approximate||!1);const l=t[T.hourGroup];let c;l&&(c=yt.fromString(l,new Zt),c.uncertain=c.uncertain||a?.uncertain||!1,c.approximate=c.approximate||a?.approximate||!1);const m=t[T.dayGroup];let p;m&&(p=wt.fromString(m,new Jt),p.uncertain=p.uncertain||c?.uncertain||!1,p.approximate=p.approximate||c?.approximate||!1);const f=t[T.monthGroup];let y;f&&(y=gt.fromString(f,new Xt),y.uncertain=y.uncertain||p?.uncertain||!1,y.approximate=y.approximate||p?.approximate||!1);const S=t[T.yearGroup];let E;S&&(E=ft.fromString(S,void 0,new Yt),E.uncertain=E.uncertain||y?.uncertain||!1,E.approximate=E.approximate||y?.approximate||!1);const G=t[T.timeshiftGroup],mt=G?Tt.fromString(G,new ee,{year:E?.value,month:y?.value,day:p?.value,hour:c?.value}):void 0;return{year:E,month:y,day:p,hour:c,minute:a,second:o,millisecond:r,timeshift:mt}}}const kr="years",Rr="months",Or="days",Vr="hours",$r="minutes",Fr="seconds";class At extends M{static format(t=""){return"P"+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,kr),"+",void 0,"\\d"),"Y")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Rr),"+",void 0,"\\d"),"MM")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Or),"+",void 0,"\\d"),"D")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Vr),"+",void 0,"\\d"),"H")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,$r),"+",void 0,"\\d"),"M")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Fr),"+",void 0,"\\d"),"S")+this.formatSuffix(t)}constructor(){super("duration",At.format())}parseGroups(t){return{years:t[kr],months:t[Rr],days:t[Or],hours:t[Vr],minutes:t[$r],seconds:t[Fr],uncertain:!!t[M.uncertainGroup],approximate:!!t[M.approximateGroup]}}}const ys="dates",Ie="start",Ne="end",Dr="durations",_e="durationMin",Ge="durationMax";class Ke extends dt{static format=u.group(ys,u.optionalGroup(Ie,u.group("openStart","\\.\\.")+"|"+T.format(Ie))+"/"+u.optionalGroup(Ne,u.group("openEnd","\\.\\.")+"|"+T.format(Ne)))+"|"+u.group(Dr,u.group(_e,At.format(_e))+"/"+u.group(Ge,At.format(Ge)));constructor(t="interval",e=Ke.format){super(t,e)}parseGroups(t){let e,r;if(t[Dr]){const o=t[_e];e=R.fromString(o,new At);const i=t[Ge];r=R.fromString(i,new At)}else{const o=t[Ie];switch(o){case void 0:e=null;break;case"..":e=void 0;break;default:e=C.fromString(o,new T)}const i=t[Ne];switch(i){case void 0:r=null;break;case"..":r=void 0;break;default:r=C.fromString(i,new T)}}return{start:e,end:r}}}h.register(C,()=>new T);h.register(wt,()=>new Jt);h.register(R,()=>new At);h.register(yt,()=>new Zt);h.register(Ct,()=>new Ke);h.register(bt,()=>new Qt);h.register(gt,()=>new Xt);h.register(Et,()=>new te);h.register(Tt,()=>new ee);h.register(ft,()=>new Yt);class b extends M{static uncertainGroup="uncertain1";static approximateGroup="approx1";static uncertainAndApproximateGroup=b.uncertainGroup+b.approximateGroup;constructor(t,e){super(t,e)}static numberFormat(t,e,r){return this.qualifierFormat(u.groupName(b.uncertainGroup,t),"?")+this.qualifierFormat(u.groupName(b.approximateGroup,t),"~")+this.qualifierFormat(u.groupName(b.uncertainAndApproximateGroup,t),"%")+M.numberFormat(t,e,r)}parseGroups(t){const e=super.parseGroups(t),r=t[u.groupName(b.uncertainAndApproximateGroup,this.name)];return(t[u.groupName(b.uncertainGroup,this.name)]||r)&&(e.uncertainComponent=!0),(t[u.groupName(b.approximateGroup,this.name)]||r)&&(e.approximateComponent=!0),e}}const Lt="yearValue",Pr="exp",Ur="signif";class re extends b{constructor(){super(Lt,re.format())}static format(t=""){return"Y?"+u.nonCapturingGroup(u.group(u.groupName(t,Pr),"[-]?\\d+E\\d+")+"|"+b.numberFormat(u.groupName(t,Lt),"+","[-]?")+u.optionalGroup(u.groupName(t,Ur),"S\\d+"))}parseGroups(t){const e=t[Pr];if(e){const i=e.indexOf("E"),a=parseInt(e.substring(i+1),10),c=parseInt(e.substring(0,i),10)*Math.pow(10,a);t[Lt]=c.toString()}const r=t[Ur],s=t[Lt];if(r){const i=parseInt(r.substring(1),10),{valueStr:a,sign:l}=this.getValueAndSign(t);let c="";for(let m=0;m<a.length;m++)c+=m<i?a.charAt(m):"X";t[Lt]=(l<0?"-":"")+c}const o=super.parseGroups(t);return r&&(o.value.estimate=parseInt(s,10)),o}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}const Br="monthValue";class ne extends b{static format(t=""){return b.numberFormat(u.groupName(t,Br),"{1,2}",void 0)}constructor(){super(Br,ne.format())}}const Lr="dayValue";class se extends b{static format(t=""){return b.numberFormat(u.groupName(t,Lr),"{1,2}",void 0)}constructor(){super(Lr,se.format())}}const jr="hourValue";class oe extends b{static format(t=""){return b.numberFormat(u.groupName(t,jr),"{1,2}",void 0)}constructor(){super(jr,oe.format())}}const Cr="secondValue";class ie extends b{static format(t=""){return b.numberFormat(u.groupName(t,Cr),"{1,2}",void 0)}constructor(){super(Cr,ie.format())}}const Kr="minuteValue";class ae extends b{static format(t=""){return b.numberFormat(u.groupName(t,Kr),"{1,2}",void 0)}constructor(){super(Kr,ae.format())}}class bs extends ee{}class x extends dt{static yearGroup=T.yearGroup;static monthGroup="month";static dayGroup="day";static hourGroup="hour";static minuteGroup="minute";static secondGroup="second";static millisecondGroup="millisecond";static timeshiftGroup="timeshift";constructor(){super("date",x.format())}static format(t=""){return u.group(u.groupName(t,x.yearGroup),re.format(t))+u.optionalNonCapturingGroup("-",u.group(u.groupName(t,x.monthGroup),ne.format(t)),u.optionalNonCapturingGroup("-",u.group(u.groupName(t,x.dayGroup),se.format(t)),u.optionalNonCapturingGroup("[T ]",u.group(u.groupName(t,x.hourGroup),oe.format(t)),":",u.group(u.groupName(t,x.minuteGroup),ae.format(t)),u.optionalNonCapturingGroup(":",u.group(u.groupName(t,x.secondGroup),ie.format(t)),u.optionalNonCapturingGroup("[.,]",u.group(u.groupName(t,x.millisecondGroup),"\\d+"))),u.optionalGroup(u.groupName(t,x.timeshiftGroup),bs.format(t)))))}parseGroups(t){const e=t[x.millisecondGroup],r=e?xt.parseFraction(e):void 0,s=t[x.secondGroup];let o;s&&(o=ct.fromString(s,void 0,new ie),o.uncertain=o?.uncertain||!1,o.approximate=o?.approximate||!1);const i=t[x.minuteGroup];let a;i&&(a=ut.fromString(i,new ae),a.uncertain=a.uncertain||o?.uncertain||!1,a.approximate=a.approximate||o?.approximate||!1);const l=t[x.hourGroup];let c;l&&(c=at.fromString(l,new oe),c.uncertain=c.uncertain||a?.uncertain||!1,c.approximate=c.approximate||a?.approximate||!1);const m=t[x.dayGroup];let p;m&&(p=it.fromString(m,new se),p.uncertain=p.uncertain||c?.uncertain||!1,p.approximate=p.approximate||c?.approximate||!1);const f=t[x.monthGroup];let y;f&&(y=ot.fromString(f,new ne),y.uncertain=y.uncertain||p?.uncertain||!1,y.approximate=y.approximate||p?.approximate||!1);const S=t[x.yearGroup];let E;S&&(E=st.fromString(S,void 0,new re),E.uncertain=E.uncertain||y?.uncertain||!1,E.approximate=E.approximate||y?.approximate||!1);const G=t[x.timeshiftGroup],mt=G?mn.fromString(G,new ee,{year:E?.value,month:y?.value,day:p?.value,hour:c?.value}):void 0;return{year:E,month:y,day:p,hour:c,minute:a,second:o,millisecond:r,timeshift:mt}}}const Hr="durationValue";class He extends b{static format(t=""){return"^"+b.numberFormat(u.groupName(t,Hr),"+",void 0)}constructor(){super(Hr,He.format())}}class Es extends Ue{millisecond=new v("millisecond",0,Number.MAX_SAFE_INTEGER,void 0);second=new v("second",0,Number.MAX_SAFE_INTEGER,this.millisecond);minute=new v("minute",0,Number.MAX_SAFE_INTEGER,this.second);hour=new v("hour",0,Number.MAX_SAFE_INTEGER,this.minute);day=new v("day",1,Number.MAX_SAFE_INTEGER,this.hour);month=new v("month",1,Number.MAX_SAFE_INTEGER,this.day);year=new v("year",0,Number.MAX_SAFE_INTEGER,this.month)}const Nt=new Es;class g extends b{static yearsGroup="years";static monthsGroup="months";static isoMonthsGroup="isoMonths";static daysGroup="days";static hoursGroup="hours";static minutesGroup="minutes";static secondsGroup="seconds";static durationGroup="duration";static suffixGroup="durationSuffix";static componentParser=new He;static componentFormat(t,e,r,s,o=""){const i=u.group(u.groupName(t,g.quantityGroup(e)),b.numberFormat(u.groupName(t,r),"+",void 0,"\\d"));return u.group(u.groupName(t,e),i,s,o)}static quantityGroup(t){return t+"Quantity"}static isoMonthsLookahead="(?=[?~%]?\\d+D|T)";constructor(){super("duration",g.format())}static format(t=""){const e=u.groupName(t,g.durationGroup);return this.qualifierFormat(u.groupName(b.uncertainGroup,e),"?")+this.qualifierFormat(u.groupName(b.approximateGroup,e),"~")+this.qualifierFormat(u.groupName(b.uncertainAndApproximateGroup,e),"%")+"P"+u.optional(g.componentFormat(t,g.yearsGroup,x.yearGroup,"Y"))+u.optionalNonCapturingGroup(g.componentFormat(t,g.monthsGroup,x.monthGroup,"MM")+"|"+g.componentFormat(t,g.isoMonthsGroup,"isoMonth","M",g.isoMonthsLookahead))+u.optional(g.componentFormat(t,g.daysGroup,x.dayGroup,"D"))+"T?"+u.optional(g.componentFormat(t,g.hoursGroup,x.hourGroup,"H"))+u.optional(g.componentFormat(t,g.minutesGroup,x.minuteGroup,"M"))+u.optional(g.componentFormat(t,g.secondsGroup,x.secondGroup,"S"))+u.optionalGroup(u.groupName(t,g.suffixGroup),"[?~%]")}static parseComponent(t,e,r){const s=g.componentParser.parse(t);return new e(s,r)}parseGroups(t){const e=t[g.quantityGroup(g.secondsGroup)];let r;e&&(r=g.parseComponent(e,ct,Nt.second),r.uncertain=!!t[u.groupName(b.uncertainGroup,g.secondsGroup)]||!1,r.approximate=!!t[u.groupName(b.approximateGroup,g.secondsGroup)]||!1);const s=t[g.quantityGroup(g.minutesGroup)];let o;s&&(o=g.parseComponent(s,ut,Nt.minute),o.uncertain=o.uncertain||r?.uncertain||!1,o.approximate=o.approximate||r?.approximate||!1);const i=t[g.quantityGroup(g.hoursGroup)];let a;i&&(a=g.parseComponent(i,at,Nt.hour),a.uncertain=a.uncertain||o?.uncertain||!1,a.approximate=a.approximate||o?.approximate||!1);const l=t[g.quantityGroup(g.daysGroup)];let c;l&&(c=g.parseComponent(l,it,Nt.day),c.uncertain=c.uncertain||a?.uncertain||!1,c.approximate=c.approximate||a?.approximate||!1);const m=t[g.quantityGroup(g.monthsGroup)]||t[g.quantityGroup(g.isoMonthsGroup)];let p;m&&(p=g.parseComponent(m,ot,Nt.month),p.uncertain=p.uncertain||c?.uncertain||!1,p.approximate=p.approximate||c?.approximate||!1);const f=t[g.quantityGroup(g.yearsGroup)];let y;f&&(y=g.parseComponent(f,st,Nt.year),y.uncertain=y.uncertain||p?.uncertain||!1,y.approximate=y.approximate||p?.approximate||!1);const S=t[g.suffixGroup],E=!!t[u.groupName(b.uncertainAndApproximateGroup,g.durationGroup)]||S==="%",G=E||!!t[u.groupName(b.uncertainGroup,g.durationGroup)]||S==="?",mt=E||!!t[u.groupName(b.approximateGroup,g.durationGroup)]||S==="~";return{years:y,months:p,days:c,hours:a,minutes:o,seconds:r,uncertain:G,approximate:mt}}}const Ss="dates",ke="start",Re="end",qr="durations",Oe="durationMin",Ve="durationMax";class Se extends dt{static format=u.group(Ss,u.optionalGroup(ke,u.group("openStart","\\.\\.")+"|"+x.format(ke))+"/"+u.optionalGroup(Re,u.group("openEnd","\\.\\.")+"|"+x.format(Re)))+"|"+u.group(qr,u.group(Oe,g.format(Oe))+"/"+u.group(Ve,g.format(Ve)));constructor(t="interval",e=Se.format){super(t,e)}parseGroups(t){let e,r;if(t[qr]){const o=t[Oe];e=k.fromString(o,new g);const i=t[Ve];r=k.fromString(i,new g)}else{const o=t[ke];switch(o){case void 0:e=null;break;case"..":e=void 0;break;default:e=K.fromString(o,new x)}const i=t[Re];switch(i){case void 0:r=null;break;case"..":r=void 0;break;default:r=K.fromString(i,new x)}}return{start:e,end:r}}}class xs{parse(t){t=t.trim();const e=t.startsWith("["),s=t.substring(1,t.length-1).split(","),o=[];for(const i of s){let a;i.includes("..")?a=Kt.fromString(i.replace("..","/"),new Se):a=K.fromString(i,new x),o.push(a)}return{values:o,exclusive:e}}}h.register(K,()=>new x);h.register(it,()=>new se);h.register(k,()=>new g);h.register(at,()=>new oe);h.register(Kt,()=>new Se);h.register(ut,()=>new ae);h.register(ot,()=>new ne);h.register(ct,()=>new ie);h.register(ge,()=>new xs);h.register(st,()=>new re);class W{constructor(t){this.preferences=t}read(t){var e,r;if(t===void 0)return;if(typeof t=="string")return t===""?void 0:t;for(const o of this.preferences){const i=(e=t[o])!==null&&e!==void 0?e:t[W.base(o)];if(i)return i}const s=new Set(this.preferences.map(o=>W.base(o)));for(const[o,i]of Object.entries(t))if(i&&s.has(W.base(o)))return i;return(r=Object.values(t).find(o=>o))!==null&&r!==void 0?r:void 0}write(t,e,r){var s,o;const i=e?.trim()?e.trim():void 0;if(t===void 0||typeof t=="string")return i;const a={...t},l=(o=(s=Object.keys(a).find(c=>c===r))!==null&&s!==void 0?s:Object.keys(a).find(c=>W.base(c)===W.base(r)))!==null&&o!==void 0?o:r;return i===void 0?delete a[l]:a[l]=i,Object.keys(a).length===0?void 0:a}static base(t){return t.toLowerCase().split("-")[0]}}W.any=new W([]);var zr;(function(n){n.abductee="abductee",n.actor="actor",n.artist="artist",n.anthropologist="anthropologist",n.archeologist="archeologist",n.astronaut="astronaut",n.astronomer="astronomer",n.astrologist="astrologist",n.astrophysicist="astrophysicist",n.banker="banker",n.barman="barman",n.biologist="biologist",n.biochemist="biochemist",n.biophysicist="biophysicist",n.bishop="bishop",n.businessman="businessman",n.botanist="botanist",n.cameraman="cameraman",n.chemist="chemist",n.contactee="contactee",n.cryptozoologist="cryptozoologist",n.dentist="dentist",n.director="director",n.diplomat="diplomat",n.diver="diver",n.electronics="electronics",n.engineer="engineer",n.ethnologist="ethnologist",n.exobiologist="exobiologist",n.farmer="farmer",n.firefighter="firefighter",n.flightAttendant="flightAttendant",n.geologist="geologist",n.geophysicist="geophysicist",n.geographer="geographer",n.historian="historian",n.houseWife="houseWife",n.hypnotherapist="hypnotherapist",n.illusionist="illusionist",n.journalist="journalist",n.judge="judge",n.lawyer="lawyer",n.leader="leader",n.librarian="librarian",n.logger="logger",n.mathematician="mathematician",n.mechanic="mechanic",n.meteorologist="meteorologist",n.military="military",n.musician="musician",n.neurologist="neurologist",n.neuroscientist="neuroscientist",n.neuropsychiatrist="neuropsychiatrist",n.nurse="nurse",n.oceanographer="oceanographer",n.painter="painter",n.parapsychologist="parapsychologist",n.philosopher="philosopher",n.photographer="photographer",n.physician="physician",n.physicist="physicist",n.pilot="pilot",n.politician="politician",n.policeman="policeman",n.priest="priest",n.producer="producer",n.prospector="prospector",n.psychologist="psychologist",n.psychiatrist="psychiatrist",n.radioastronomer="radioastronomer",n.radioamateur="radioamateur",n.salesman="salesman",n.sailor="sailor",n.sociologist="sociologist",n.softwareEngineer="softwareEngineer",n.stuntman="stuntman",n.taxiDriver="taxiDriver",n.teacher="teacher",n.telegrapher="telegrapher",n.truckDriver="truckDriver",n.ufologist="ufologist",n.ufoWitness="ufoWitness",n.ufoWitness2="ufoWitness2",n.worker="worker",n.writer="writer"})(zr||(zr={}));var Wr;(function(n){n.neutral="neutral",n.male="male",n.female="female"})(Wr||(Wr={}));class vs extends Error{constructor(t,e){super(t),this.cause=e}}class qe extends vs{constructor(t=qe.defaultMessage,e){super(t,e)}}qe.defaultMessage="Assertion failed";var Yr;(function(n){n.country="country",n.region="region",n.department="department",n.city="city",n.company="company"})(Yr||(Yr={}));var Xr;(function(n){n.at="at",n.au="au",n.ar="ar",n.be="be",n.br="br",n.ca="ca",n.ch="ch",n.cn="cn",n.cl="cl",n.co="co",n.cy="cy",n.de="de",n.dk="dk",n.do="do",n.dz="dz",n.gr="gr",n.ec="ec",n.eg="eg",n.es="es",n.fi="fi",n.fr="fr",n.ga="ga",n.ge="ge",n.hu="hu",n.in="in",n.ie="ie",n.ir="ir",n.il="il",n.it="it",n.jp="jp",n.kr="kr",n.ma="ma",n.mx="mx",n.my="my",n.mz="mz",n.nl="nl",n.no="no",n.nz="nz",n.pa="pa",n.pe="pe",n.ph="ph",n.pl="pl",n.pt="pt",n.ro="ro",n.ru="ru",n.sc="sc",n.tr="tr",n.ua="ua",n.uk="uk",n.us="us",n.sa="sa",n.se="se",n.su="su",n.tn="tn",n.tw="tw",n.ve="ve",n.za="za"})(Xr||(Xr={}));class I{static KEY="rr0-module-consent";static originOf(t){try{return new URL(t,typeof location>"u"?void 0:location.href).origin}catch{return t}}static granted(t,e=I.storage()){const r=I.originOf(t);return typeof location<"u"&&r===location.origin?!0:I.list(e).includes(r)}static list(t=I.storage()){try{const e=JSON.parse(t?.getItem(I.KEY)??"[]");return Array.isArray(e)?e.filter(r=>typeof r=="string"):[]}catch{return[]}}static grant(t,e=I.storage()){const r=[...new Set([...I.list(e),...t.map(s=>I.originOf(s))])];try{e?.setItem(I.KEY,JSON.stringify(r))}catch{}}static revoke(t,e=I.storage()){const r=I.originOf(t);try{e?.setItem(I.KEY,JSON.stringify(I.list(e).filter(s=>s!==r)))}catch{}}static revokeUnused(t,e,r=I.storage()){const s=new Set(e.map(o=>I.originOf(o)));for(const o of t)s.has(I.originOf(o))||I.revoke(o,r)}static storage(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}}const Ms=`
118
+ .consent-dialog { width: min(32em, calc(100vw - 2em)); padding: 14px 16px; border: 1px solid var(--line-strong, #888); border-radius: 12px;
119
+ background: var(--ground-raised, Canvas); color: var(--ink, CanvasText); box-shadow: 0 8px 28px rgba(0, 0, 0, .25); font: 400 14px/1.4 var(--sans, sans-serif); }
120
+ .consent-dialog:popover-open { position: fixed; inset: 0; margin: auto; height: fit-content; }
121
+ .consent-dialog h2 { margin: 0 0 8px; font: 600 12px/1.3 var(--sans, sans-serif); letter-spacing: .12em; text-transform: uppercase; color: var(--glow-dim, inherit); }
122
+ .consent-dialog p { margin: 0; }
123
+ .consent-dialog ul { margin: 6px 0 10px; padding-left: 1.2em; font-family: var(--mono, monospace); font-size: .85em; overflow-wrap: anywhere; }
124
+ .consent-dialog .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
125
+ `;class As{static async ask(t,e,r){const s=[...new Set(r.filter(S=>!I.granted(S)).map(S=>I.originOf(S)))];if(s.length===0)return!0;const o=(t instanceof ShadowRoot?t.host:t).ownerDocument,i=o.createElement("div");i.className="consent-dialog",i.id="consent",i.setAttribute("popover","manual"),i.setAttribute("role","dialog");const a=o.createElement("style");a.textContent=Ms;const l=o.createElement("h2");l.id="consent-heading",l.textContent=e?.consentHeading??"",i.setAttribute("aria-labelledby",l.id);const c=o.createElement("p");c.id="consent-text",c.textContent=e?.consentText??"";const m=o.createElement("ul");m.id="consent-origins",m.append(...s.map(S=>Object.assign(o.createElement("li"),{textContent:S})));const p=o.createElement("div");p.className="actions";const f=Object.assign(o.createElement("button"),{type:"button",id:"consent-without",className:"pill-btn",textContent:e?.consentWithout??""}),y=Object.assign(o.createElement("button"),{type:"button",id:"consent-run",className:"pill-btn primary",textContent:e?.consentRun??""});return p.append(f,y),i.append(a,l,c,m,p),t.getElementById?.("consent")?.remove(),t.append(i),new Promise(S=>{const E=G=>{try{i.hidePopover?.()}catch{}i.remove(),G&&I.grant(r),S(G)};y.addEventListener("click",()=>E(!0)),f.addEventListener("click",()=>E(!1));try{i.showPopover?.()}catch{}f.focus()})}}function Ts(n,t){for(const e of n){const r=e.toLowerCase().split("-")[0];if(t.includes(r))return r}return"en"}class le{static preferencesFor(t){const e=navigator.languages??[],r=this.declaredFor(t);return r?[r,...e]:e}static declaredFor(t){for(let e=t;e;){const r=e.closest("[lang]")?.getAttribute("lang")?.trim();if(r)return r;const s=e.getRootNode();e=s instanceof ShadowRoot?s.host:void 0}}}const Is=["en","fr","es","it"],Ns={en:()=>d(()=>import("./UfoMessages_en-D5OYWJ3K.js"),__vite__mapDeps([32,24]),import.meta.url).then(n=>n.ufoMessages_en),fr:()=>d(()=>import("./UfoMessages_fr-CGkQBn5r.js"),[],import.meta.url).then(n=>n.ufoMessages_fr),es:()=>d(()=>import("./UfoMessages_es-CO-v8Jl6.js"),[],import.meta.url).then(n=>n.ufoMessages_es),it:()=>d(()=>import("./UfoMessages_it-BScqxIaH.js"),[],import.meta.url).then(n=>n.ufoMessages_it)},no=N.catalog(Ns),_s={en:()=>d(()=>import("./SightingEditorMessages_en-BmqJK2u_.js"),__vite__mapDeps([33,34]),import.meta.url).then(n=>n.sightingEditorMessages_en),fr:()=>d(()=>import("./SightingEditorMessages_fr-ClEadK1E.js"),__vite__mapDeps([35,36]),import.meta.url).then(n=>n.sightingEditorMessages_fr),es:()=>d(()=>import("./SightingEditorMessages_es-avQMqPMq.js"),__vite__mapDeps([37,38]),import.meta.url).then(n=>n.sightingEditorMessages_es),it:()=>d(()=>import("./SightingEditorMessages_it-Co5behaA.js"),__vite__mapDeps([39,40]),import.meta.url).then(n=>n.sightingEditorMessages_it)},Gs=N.catalog(_s);function so(n){return Gs.load(n)}const ks={en:()=>d(()=>import("./SightingMessages_en-CzICxNU3.js"),__vite__mapDeps([41,34]),import.meta.url).then(n=>n.sightingMessages_en),fr:()=>d(()=>import("./SightingMessages_fr-nopOVDa1.js"),__vite__mapDeps([42,36]),import.meta.url).then(n=>n.sightingMessages_fr),es:()=>d(()=>import("./SightingMessages_es-CiVFZlgA.js"),__vite__mapDeps([43,38]),import.meta.url).then(n=>n.sightingMessages_es),it:()=>d(()=>import("./SightingMessages_it-Cu0nnPts.js"),__vite__mapDeps([44,40]),import.meta.url).then(n=>n.sightingMessages_it)},oo=N.catalog(ks),Rs={en:()=>d(()=>import("./CaseMessages_en-BC0lku35.js"),[],import.meta.url).then(n=>n.caseMessages_en),fr:()=>d(()=>import("./CaseMessages_fr-D_6J6ONO.js"),[],import.meta.url).then(n=>n.caseMessages_fr),es:()=>d(()=>import("./CaseMessages_es-Cbktn5vj.js"),[],import.meta.url).then(n=>n.caseMessages_es),it:()=>d(()=>import("./CaseMessages_it-CYyww4oG.js"),[],import.meta.url).then(n=>n.caseMessages_it)},Os=N.catalog(Rs);function io(n){return Os.load(n)}const Vs={en:()=>d(()=>import("./UfoAtHomeMessages_en-ByVu39KF.js"),__vite__mapDeps([45,46]),import.meta.url).then(n=>n.ufoAtHomeMessages_en),fr:()=>d(()=>import("./UfoAtHomeMessages_fr-nTqRf0ZK.js"),__vite__mapDeps([47,48]),import.meta.url).then(n=>n.ufoAtHomeMessages_fr),es:()=>d(()=>import("./UfoAtHomeMessages_es-D9bLboxq.js"),__vite__mapDeps([49,50]),import.meta.url).then(n=>n.ufoAtHomeMessages_es),it:()=>d(()=>import("./UfoAtHomeMessages_it-4cZC5-y5.js"),__vite__mapDeps([51,52]),import.meta.url).then(n=>n.ufoAtHomeMessages_it)},$s=N.catalog(Vs);function Fs(n){return $s.load(n)}const Ds={en:()=>d(()=>import("./ShareMessages_en-B43x8LgJ.js"),[],import.meta.url).then(n=>n.shareMessages_en),fr:()=>d(()=>import("./ShareMessages_fr-CzZyVbbX.js"),[],import.meta.url).then(n=>n.shareMessages_fr),es:()=>d(()=>import("./ShareMessages_es-DZCJojSc.js"),[],import.meta.url).then(n=>n.shareMessages_es),it:()=>d(()=>import("./ShareMessages_it-C_Z6eDQK.js"),[],import.meta.url).then(n=>n.shareMessages_it)},ao=N.catalog(Ds);function uo(n){switch(n){case"fr":return d(()=>import("./TagNames_fr-Dnqq6HQ5.js"),[],import.meta.url).then(t=>t.tagNames_fr);case"es":return d(()=>import("./TagNames_es-BfnMpc3D.js"),[],import.meta.url).then(t=>t.tagNames_es);case"it":return d(()=>import("./TagNames_it-n6E4EGYO.js"),[],import.meta.url).then(t=>t.tagNames_it);default:return Promise.resolve({})}}const Ps={en:()=>d(()=>import("./BodyEditorMessages_en-CckxSS1L.js"),[],import.meta.url).then(n=>n.bodyEditorMessages_en),fr:()=>d(()=>import("./BodyEditorMessages_fr-638ypdqf.js"),[],import.meta.url).then(n=>n.bodyEditorMessages_fr),es:()=>d(()=>import("./BodyEditorMessages_es-B8GlFFBo.js"),[],import.meta.url).then(n=>n.bodyEditorMessages_es),it:()=>d(()=>import("./BodyEditorMessages_it-SKpMkHFI.js"),[],import.meta.url).then(n=>n.bodyEditorMessages_it)},Us={en:()=>d(()=>import("./CaseEditorMessages_en-pog3M_U6.js"),[],import.meta.url).then(n=>n.caseEditorMessages_en),fr:()=>d(()=>import("./CaseEditorMessages_fr-BOKVeIXM.js"),[],import.meta.url).then(n=>n.caseEditorMessages_fr),es:()=>d(()=>import("./CaseEditorMessages_es-Dz1N0VpM.js"),[],import.meta.url).then(n=>n.caseEditorMessages_es),it:()=>d(()=>import("./CaseEditorMessages_it-BKAkbKq-.js"),[],import.meta.url).then(n=>n.caseEditorMessages_it)},Bs={en:()=>d(()=>import("./ReadingSensitivityMessages_en-ChQHFyxb.js"),[],import.meta.url).then(n=>n.readingSensitivityMessages_en),fr:()=>d(()=>import("./ReadingSensitivityMessages_fr-Dl4a8udu.js"),[],import.meta.url).then(n=>n.readingSensitivityMessages_fr),es:()=>d(()=>import("./ReadingSensitivityMessages_es-BbFqHsvR.js"),[],import.meta.url).then(n=>n.readingSensitivityMessages_es),it:()=>d(()=>import("./ReadingSensitivityMessages_it-CwiJfUo_.js"),[],import.meta.url).then(n=>n.readingSensitivityMessages_it)},co=N.catalog(Bs),Ls={en:()=>d(()=>import("./HvsMessages_en-BiLhEAxJ.js"),[],import.meta.url).then(n=>n.hvsMessages_en),fr:()=>d(()=>import("./HvsMessages_fr-DkvE2qm1.js"),[],import.meta.url).then(n=>n.hvsMessages_fr),es:()=>d(()=>import("./HvsMessages_es-Cbj_6eFs.js"),[],import.meta.url).then(n=>n.hvsMessages_es),it:()=>d(()=>import("./HvsMessages_it-BIJ87Uyb.js"),[],import.meta.url).then(n=>n.hvsMessages_it)},lo=N.catalog(Ls),js={en:()=>d(()=>import("./ScenarioSweepMessages_en-Bf4BscDU.js"),[],import.meta.url).then(n=>n.scenarioSweepMessages_en),fr:()=>d(()=>import("./ScenarioSweepMessages_fr-DlPsO6oI.js"),[],import.meta.url).then(n=>n.scenarioSweepMessages_fr),es:()=>d(()=>import("./ScenarioSweepMessages_es-CBHQfuRB.js"),[],import.meta.url).then(n=>n.scenarioSweepMessages_es),it:()=>d(()=>import("./ScenarioSweepMessages_it-DANW3_la.js"),[],import.meta.url).then(n=>n.scenarioSweepMessages_it)},mo=N.catalog(js),Cs={en:()=>d(()=>import("./CaseExportMessages_en-jHlu58Y7.js"),[],import.meta.url).then(n=>n.caseExportMessages_en),fr:()=>d(()=>import("./CaseExportMessages_fr-sDfEgjWg.js"),[],import.meta.url).then(n=>n.caseExportMessages_fr),es:()=>d(()=>import("./CaseExportMessages_es-dCQQFgjq.js"),[],import.meta.url).then(n=>n.caseExportMessages_es),it:()=>d(()=>import("./CaseExportMessages_it-BJaglZtP.js"),[],import.meta.url).then(n=>n.caseExportMessages_it)},po=N.catalog(Cs),Ks={en:()=>d(()=>import("./InterviewMessages_en-Ikx6GjEd.js"),[],import.meta.url).then(n=>n.interviewMessages_en),fr:()=>d(()=>import("./InterviewMessages_fr-DT0gXAKD.js"),[],import.meta.url).then(n=>n.interviewMessages_fr),es:()=>d(()=>import("./InterviewMessages_es-DKWWyrnb.js"),[],import.meta.url).then(n=>n.interviewMessages_es),it:()=>d(()=>import("./InterviewMessages_it-CF_9MYPt.js"),[],import.meta.url).then(n=>n.interviewMessages_it)},ho=N.catalog(Ks),fo=N.catalog(Us),go=N.catalog(Ps),Hs=N.catalog({en:()=>d(()=>import("./SceneNames_en-7OZ7peGc.js"),__vite__mapDeps([53,7]),import.meta.url).then(n=>n.sceneNames_en),fr:()=>d(()=>import("./SceneNames_fr-qzw0QzD0.js"),__vite__mapDeps([54,7]),import.meta.url).then(n=>n.sceneNames_fr),es:()=>d(()=>import("./SceneNames_es-P5-Mavdi.js"),__vite__mapDeps([55,7]),import.meta.url).then(n=>n.sceneNames_es),it:()=>d(()=>import("./SceneNames_it-Sqf8JFOd.js"),__vite__mapDeps([56,7]),import.meta.url).then(n=>n.sceneNames_it)});function wo(n){return Hs.load(n)}const yo=N.catalog({en:()=>d(()=>import("./CloudEditorMessages_en-SmcRKW1O.js"),[],import.meta.url).then(n=>n.cloudEditorMessages_en),fr:()=>d(()=>import("./CloudEditorMessages_fr-SvL-CR04.js"),[],import.meta.url).then(n=>n.cloudEditorMessages_fr),es:()=>d(()=>import("./CloudEditorMessages_es-DFCuS9Qg.js"),[],import.meta.url).then(n=>n.cloudEditorMessages_es),it:()=>d(()=>import("./CloudEditorMessages_it-BvfiHWV9.js"),[],import.meta.url).then(n=>n.cloudEditorMessages_it)}),Jr="rr0-ufoathome",qs='<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"><path d="M8 3v10M3 8h10"/></svg>',zs='<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M2 4.5h4l1.5 1.5H14v6.5H2z"/></svg>',Ws=`
118
126
  <style>
119
- :host { display: block; ${we.TOKENS} }
127
+ :host { display: block; ${ve.TOKENS} }
120
128
  :host([hidden]) { display: none; }
121
- ${we.HEAD}
122
- ${we.fields(".open-menu")}
123
- ${C.CSS}
129
+ ${ve.HEAD}
130
+ ${ve.fields(".open-menu")}
131
+ ${q.CSS}
124
132
  .bar { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
125
133
  .bar .status { margin-right: auto; }
126
134
  .status[hidden] { display: none; }
@@ -149,15 +157,18 @@ ${C.CSS}
149
157
  .starts button:is(:hover, :focus-visible) { background: var(--neutral-bg); border-color: var(--line-strong); }
150
158
  .starts .name { font-weight: 600; }
151
159
  .starts .what { color: var(--ink-dim); font-size: .78em; }
160
+ .template-now { margin: 0 0 6px; }
161
+ .template-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
162
+ .template-row[hidden], .template-forget[hidden] { display: none; }
152
163
  </style>
153
164
  <div class="bar">
154
165
  <p id="status" class="status" role="status" hidden></p>
155
- <button id="new" type="button" class="pill-btn">${Us}<span id="label-new"></span></button>
166
+ <button id="new" type="button" class="pill-btn">${qs}<span id="label-new"></span></button>
156
167
  <div id="new-menu" class="open-menu" popover>
157
168
  <h2 id="starts-heading"></h2>
158
169
  <ul id="starts" class="starts"></ul>
159
170
  </div>
160
- <button id="open" type="button" class="pill-btn" popovertarget="open-menu">${Bs}<span id="label-open"></span></button>
171
+ <button id="open" type="button" class="pill-btn" popovertarget="open-menu">${zs}<span id="label-open"></span></button>
161
172
  </div>
162
173
  <div id="open-menu" class="open-menu" popover>
163
174
  <rr0-input-file id="open-file" name="open" accept=".json" multiple handles></rr0-input-file>
@@ -165,6 +176,13 @@ ${C.CSS}
165
176
  <h2 id="recent-heading"></h2>
166
177
  <ul id="recent" class="recent"></ul>
167
178
  <p id="recent-none" class="recent-none" hidden></p>
179
+ <h2 id="template-heading"></h2>
180
+ <p id="template-now" class="template-now"></p>
181
+ <div class="template-row">
182
+ <rr0-input-file id="template-file" name="template" accept=".json,application/json"></rr0-input-file>
183
+ <button id="template-forget" type="button" class="pill-btn template-forget" hidden></button>
184
+ </div>
185
+ <p id="template-hint" class="hint"></p>
168
186
  </div>
169
187
  <slot></slot>
170
- `;class Ce extends HTMLElement{switcher=new Ve(t=>this.append(t),void 0,t=>this.dispatchEvent(new CustomEvent(pn,{detail:t,bubbles:!0,composed:!0})));shadow;messages;started=!1;constructor(){super(),Qr(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.innerHTML=Cs,this.byId("new").addEventListener("click",()=>void this.startNew()),this.byId("open").addEventListener("click",()=>{this.placeMenu(),this.showRecent()}),this.byId("open-file").addEventListener("filepick",t=>{this.closeMenu(),this.openPick(t.detail)})}connectedCallback(){if(window.addEventListener("resize",this.fitHeight),this.fitHeight(),this.started)return;this.started=!0,this.loadLocale();const t=this.getAttribute("src")??void 0,e=this.getAttribute("track")??void 0,r=t&&this.getAttribute("mode")!=="edit"?this.switcher.read({src:t,...e?{track:e}:{}}):this.switcher.edit({...t?{src:t}:{},...e?{track:e}:{}});this.ready=r.catch(()=>this.say(this.messages?.openFailed,"error")),this.ready.then(this.fitHeight)}disconnectedCallback(){window.removeEventListener("resize",this.fitHeight)}fitHeight=()=>{const t=this.byId("open").closest(".bar").getBoundingClientRect().bottom+window.scrollY;this.style.setProperty("--rr0-editor-height",`calc(100dvh - ${Math.round(t+12)}px)`)};ready=Promise.resolve();async openFiles(t,e){const r=(await Promise.all(t.map(async i=>{const a=await Ce.textOf(i);try{return{name:i.name,text:a,json:JSON.parse(a)}}catch{return}}))).filter(i=>i!==void 0);if(r.length===0){this.say(this.messages?.noJson,"warning");return}const s=k.localBase();k.hold(new Map(r.map(i=>[new URL(i.name,s).href,{json:i.json,changed:!1,local:!0}])));const o=r.find(i=>H.isCase(i.json))??r[0];this.say(void 0),await this.switcher.open(new URL(o.name,s).href),await R.add(e&&e.length?{kind:"handles",name:o.name,openedAt:Date.now(),handles:e}:{kind:"copy",name:o.name,openedAt:Date.now(),copies:r.map(({name:i,text:a})=>({name:i,text:a}))})}static textOf(t){return new Promise((e,r)=>{const s=new FileReader;s.onload=()=>e(s.result),s.onerror=()=>r(s.error),s.readAsText(t)})}async openAddress(t){const e=new URL(t,location.href).href;this.say(void 0),await this.switcher.open(e),await R.add({kind:"address",name:decodeURIComponent(new URL(e).pathname.split("/").pop()||e),openedAt:Date.now(),url:e})}async openPick(t){try{t.url!==void 0?await this.openAddress(t.url):await this.openFiles(t.files??[t.file],t.handles)}catch{this.say(this.messages?.openFailed,"error")}}async reopen(t){this.closeMenu();try{t.kind==="address"?await this.openAddress(t.url):await this.openFiles(await R.files(t),t.kind==="handles"?t.handles:void 0)}catch{this.say(this.messages?.openFailed,"error")}}async startNew(){const t=this.getAttribute("case-template");if(!t)return this.switcher.startNew();let e;try{e=await z.load(t)}catch{this.say(this.messages?.caseTemplateFailed,"error");return}this.say(void 0);const{ModuleSession:r}=await d(async()=>{const{ModuleSession:s}=await import("./ModuleSession-BKDWGSEo.js");return{ModuleSession:s}},__vite__mapDeps([50,25,4]),import.meta.url);if(r.shared.require(e.modules,e.url,!0),e.starts.length===1)return this.start(e.starts[0]);this.showStarts(e)}async start(t){if(this.closeStarts(),t.modules?.length){const{ModuleSession:e}=await d(async()=>{const{ModuleSession:r}=await import("./ModuleSession-BKDWGSEo.js");return{ModuleSession:r}},__vite__mapDeps([50,25,4]),import.meta.url);await e.shared.require(t.modules,void 0,!0)}await this.switcher.startNew(t)}showStarts(t){const e=new Z(zr.preferencesFor(this));this.byId("starts-heading").textContent=e.read(t.title)??"",this.byId("starts").replaceChildren(...t.starts.map(o=>{const i=document.createElement("li"),a=document.createElement("button");a.type="button",a.dataset.start=o.id;const l=document.createElement("span");if(l.className="name",l.textContent=e.read(o.title)??"",a.append(l),o.description){const c=document.createElement("span");c.className="what",c.textContent=e.read(o.description)??"",a.append(c)}return a.addEventListener("click",()=>void this.start(o)),i.append(a),i}));const r=this.byId("new-menu"),s=this.byId("new").getBoundingClientRect();r.style.top=`${Math.round(s.bottom+6)}px`,r.style.right=`${Math.max(8,Math.round(window.innerWidth-s.right))}px`;try{r.showPopover?.()}catch{}}closeStarts(){const t=this.byId("new-menu");try{t.hidePopover?.()}catch{}}async showRecent(){const t=this.messages,e=await R.list();this.byId("recent").replaceChildren(...e.map(o=>{const i=document.createElement("li"),a=document.createElement("button");a.type="button",a.className="reopen";const l=document.createElement("span");l.className="name",l.textContent=o.name;const c=document.createElement("span");c.className="how";const m=new Date(o.openedAt).toLocaleString(this.language,{dateStyle:"medium",timeStyle:"short"}),p=o.kind==="address"?t?.recentAddress:o.kind==="handles"?t?.recentHandles:t?.recentCopy;c.textContent=`${m} · ${p??""}`,a.title=o.kind==="address"?o.url:o.name,a.append(l,c),a.addEventListener("click",()=>void this.reopen(o));const w=document.createElement("button");return w.type="button",w.className="remove",w.textContent="×",w.title=t?.recentRemove??"",w.setAttribute("aria-label",t?.recentRemove??""),w.addEventListener("click",()=>void R.remove(o).then(()=>this.showRecent())),i.append(a,w),i}));const s=this.byId("recent-none");s.hidden=e.length>0}placeMenu(){const t=this.byId("open").getBoundingClientRect(),e=this.byId("open-menu");e.style.top=`${Math.round(t.bottom+6)}px`,e.style.right=`${Math.max(8,Math.round(window.innerWidth-t.right))}px`}closeMenu(){const t=this.byId("open-menu");try{t.hidePopover?.()}catch{}}say(t,e="info"){const r=this.byId("status");C.show(r,t,e)}language="en";async loadLocale(){this.language=ys(zr.preferencesFor(this),Ss);const t=this.messages=await Is(this.language);this.byId("label-new").textContent=t.newFile,this.byId("new").title=t.newFileHint,this.byId("label-open").textContent=t.open,this.byId("open").title=t.openHint,this.byId("open-together").textContent=t.openTogether,this.byId("recent-heading").textContent=t.recentHeading,this.byId("recent-none").textContent=t.recentNone,this.byId("open-file").messages=t}byId(t){return this.shadow.getElementById(t)}}function js(){customElements.get(qr)||customElements.define(qr,Ce)}js();export{qs as $,eo as A,no as B,H as C,Ys as D,hn as E,ct as F,Qs as G,zr as H,Ie as I,y as J,ae as K,U as L,T as M,zs as N,k as O,j as P,ue as Q,Hs as R,Z as S,so as T,Ss as U,Xs as V,K as W,io as X,Ls as Y,Ks as Z,d as _,ce as a,Ws as a0,Js as b,to as c,ao as d,ro as e,uo as f,v as g,we as h,C as i,Xr as j,q as k,Zs as l,fn as m,xt as n,Zr as o,N as p,Ge as q,Qr as r,ys as s,vs as t,ge as u,Ve as v,pn as w,z as x,oo as y,mn as z};
188
+ `;class Z extends HTMLElement{switcher=new Pe(t=>this.append(t),void 0,t=>this.dispatchEvent(new CustomEvent(yn,{detail:t,bubbles:!0,composed:!0})));shadow;messages;started=!1;constructor(){super(),nn(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.innerHTML=Ws,this.byId("new").addEventListener("click",()=>void this.startNew()),this.byId("open").addEventListener("click",()=>{this.placeMenu(),this.showRecent(),this.showTemplate()}),this.byId("open-file").addEventListener("filepick",t=>{this.closeMenu(),this.openPick(t.detail)}),this.byId("template-file").addEventListener("filepick",t=>void this.keepTemplate(t.detail)),this.byId("template-forget").addEventListener("click",()=>void this.forgetTemplate())}connectedCallback(){if(window.addEventListener("resize",this.fitHeight),this.fitHeight(),this.started)return;this.started=!0,this.localeLoaded=this.loadLocale();const t=this.getAttribute("src")??void 0,e=this.getAttribute("track")??void 0,r=t&&this.getAttribute("mode")!=="edit"?this.switcher.read({src:t,...e?{track:e}:{}}):this.switcher.edit({...t?{src:t}:{},...e?{track:e}:{}});this.ready=r.catch(()=>this.say(this.messages?.openFailed,"error")),this.loadKeptTemplate(),t||this.ready.then(()=>this.startUnderTemplate()),this.ready.then(this.fitHeight)}disconnectedCallback(){window.removeEventListener("resize",this.fitHeight)}fitHeight=()=>{const t=this.byId("open").closest(".bar").getBoundingClientRect().bottom+window.scrollY;this.style.setProperty("--rr0-editor-height",`calc(100dvh - ${Math.round(t+12)}px)`)};ready=Promise.resolve();async openFiles(t,e){const r=(await Promise.all(t.map(async i=>{const a=await Z.textOf(i);try{return{name:i.name,text:a,json:JSON.parse(a)}}catch{return}}))).filter(i=>i!==void 0);if(r.length===0){this.say(this.messages?.noJson,"warning");return}const s=F.localBase();F.hold(new Map(r.map(i=>[new URL(i.name,s).href,{json:i.json,changed:!1,local:!0}])));const o=r.find(i=>z.isCase(i.json))??r[0];this.say(void 0),await this.switcher.open(new URL(o.name,s).href),await V.add(e&&e.length?{kind:"handles",name:o.name,openedAt:Date.now(),handles:e}:{kind:"copy",name:o.name,openedAt:Date.now(),copies:r.map(({name:i,text:a})=>({name:i,text:a}))})}static textOf(t){return new Promise((e,r)=>{const s=new FileReader;s.onload=()=>e(s.result),s.onerror=()=>r(s.error),s.readAsText(t)})}async openAddress(t){const e=new URL(t,location.href).href;this.say(void 0),await this.switcher.open(e),await V.add({kind:"address",name:decodeURIComponent(new URL(e).pathname.split("/").pop()||e),openedAt:Date.now(),url:e})}async openPick(t){try{t.url!==void 0?await this.openAddress(t.url):await this.openFiles(t.files??[t.file],t.handles)}catch{this.say(this.messages?.openFailed,"error")}}async reopen(t){this.closeMenu();try{t.kind==="address"?await this.openAddress(t.url):await this.openFiles(await V.files(t),t.kind==="handles"?t.handles:void 0)}catch{this.say(this.messages?.openFailed,"error")}}async startNew(){let t;try{t=await this.template()}catch{this.say(this.messages?.caseTemplateFailed,"error");return}if(!t)return this.switcher.startNew();this.say(void 0),await this.offer(t)}async template(){const t=U.read();if(t)return t;const e=this.getAttribute("case-template");return e?L.load(e):void 0}async offer(t){await L.install(t);const{ModuleSession:e}=await d(async()=>{const{ModuleSession:r}=await import("./ModuleSession-Dac4fD0X.js");return{ModuleSession:r}},__vite__mapDeps([57,25,4]),import.meta.url);if(e.shared.require(t.modules,t.url,Z.runsScripts(t)),t.starts.length===1)return this.start(t.starts[0],t);this.showStarts(t)}async startUnderTemplate(){let t;try{t=await this.template()}catch{this.say(this.messages?.caseTemplateFailed,"error");return}t&&await this.offer(t)}async start(t,e){if(this.closeStarts(),t.modules?.length){const{ModuleSession:r}=await d(async()=>{const{ModuleSession:s}=await import("./ModuleSession-Dac4fD0X.js");return{ModuleSession:s}},__vite__mapDeps([57,25,4]),import.meta.url);await r.shared.require(t.modules,void 0,e?Z.runsScripts(e):!0)}await this.switcher.startNew(t)}static runsScripts(t){return t.origin==="page"||Z.moduleUrls(t).every(e=>I.granted(e))}static moduleUrls(t){return[...new Set([...t.modules??[],...t.starts.flatMap(e=>e.modules??[])])]}async loadKeptTemplate(){const t=U.read();if(!t||(await L.install(t).catch(()=>{}),!t.modules?.length))return;const{ModuleSession:e}=await d(async()=>{const{ModuleSession:r}=await import("./ModuleSession-Dac4fD0X.js");return{ModuleSession:r}},__vite__mapDeps([57,25,4]),import.meta.url);e.shared.require(t.modules,t.url,Z.runsScripts(t))}async forgetTemplate(){const t=U.read();if(U.forget(),t){const{ModuleSession:e}=await d(async()=>{const{ModuleSession:r}=await import("./ModuleSession-Dac4fD0X.js");return{ModuleSession:r}},__vite__mapDeps([57,25,4]),import.meta.url);I.revokeUnused(Z.moduleUrls(t),e.shared.list().filter(r=>r.addedByPerson).map(r=>r.url))}await this.showTemplate()}async keepTemplate(t){await this.localeLoaded;const e=this.messages;let r;try{if(t.url!==void 0){const l=new URL(t.url,location.href).href,c=await fetch(l);if(!c.ok)throw new Error(`${l}: HTTP ${c.status}`);r=U.keep(await c.text(),decodeURIComponent(l.replace(/[?#].*$/,"").replace(/^.*\//,"")),void 0,l)}else r=U.keep(await Z.textOf(t.file),t.file.name)}catch{this.say(e?.caseTemplateFailed,"error"),await this.showTemplate();return}const s=Z.moduleUrls(r),o=s.length>0&&await As.ask(this.shadow,e,s),a=new W(le.preferencesFor(this)).read(r.title)??r.id;if(this.say([e?.templateKept.replace("{title}",a),s.length===0?void 0:o?e?.templateModulesRun:e?.templateModulesWithoutScripts].filter(Boolean).join(" ")),await L.install(r).catch(()=>{}),s.length>0){const{ModuleSession:l}=await d(async()=>{const{ModuleSession:c}=await import("./ModuleSession-Dac4fD0X.js");return{ModuleSession:c}},__vite__mapDeps([57,25,4]),import.meta.url);l.shared.require(r.modules,r.url,o)}await this.showTemplate()}async showTemplate(){await this.localeLoaded;const t=this.messages;if(!t)return;const e=new W(le.preferencesFor(this));let r;try{r=await this.template()}catch{r=void 0}const s=r?e.read(r.title)??r.id:"";this.byId("template-now").textContent=r?r.origin==="file"?t.templateFromFile.replace("{title}",s).replace("{file}",r.fileName??""):r.origin==="address"?t.templateFromAddress.replace("{title}",s).replace("{url}",r.url):t.templateFromPage.replace("{title}",s):t.templateNone,this.byId("template-forget").hidden=r===void 0||r.origin==="page"}showStarts(t){const e=new W(le.preferencesFor(this));this.byId("starts-heading").textContent=e.read(t.title)??"",this.byId("starts").replaceChildren(...t.starts.map(o=>{const i=document.createElement("li"),a=document.createElement("button");a.type="button",a.dataset.start=o.id;const l=document.createElement("span");if(l.className="name",l.textContent=e.read(o.title)??"",a.append(l),o.description){const c=document.createElement("span");c.className="what",c.textContent=e.read(o.description)??"",a.append(c)}return a.addEventListener("click",()=>void this.start(o,t)),i.append(a),i}));const r=this.byId("new-menu"),s=this.byId("new").getBoundingClientRect();r.style.top=`${Math.round(s.bottom+6)}px`,r.style.right=`${Math.max(8,Math.round(window.innerWidth-s.right))}px`;try{r.showPopover?.()}catch{}}closeStarts(){const t=this.byId("new-menu");try{t.hidePopover?.()}catch{}}async showRecent(){const t=this.messages,e=await V.list();this.byId("recent").replaceChildren(...e.map(o=>{const i=document.createElement("li"),a=document.createElement("button");a.type="button",a.className="reopen";const l=document.createElement("span");l.className="name",l.textContent=o.name;const c=document.createElement("span");c.className="how";const m=new Date(o.openedAt).toLocaleString(this.language,{dateStyle:"medium",timeStyle:"short"}),p=o.kind==="address"?t?.recentAddress:o.kind==="handles"?t?.recentHandles:t?.recentCopy;c.textContent=`${m} · ${p??""}`,a.title=o.kind==="address"?o.url:o.name,a.append(l,c),a.addEventListener("click",()=>void this.reopen(o));const f=document.createElement("button");return f.type="button",f.className="remove",f.textContent="×",f.title=t?.recentRemove??"",f.setAttribute("aria-label",t?.recentRemove??""),f.addEventListener("click",()=>void V.remove(o).then(()=>this.showRecent())),i.append(a,f),i}));const s=this.byId("recent-none");s.hidden=e.length>0}placeMenu(){const t=this.byId("open").getBoundingClientRect(),e=this.byId("open-menu");e.style.top=`${Math.round(t.bottom+6)}px`,e.style.right=`${Math.max(8,Math.round(window.innerWidth-t.right))}px`}closeMenu(){const t=this.byId("open-menu");try{t.hidePopover?.()}catch{}}say(t,e="info"){const r=this.byId("status");q.show(r,t,e)}language="en";localeLoaded=Promise.resolve();async loadLocale(){this.language=Ts(le.preferencesFor(this),Is);const t=this.messages=await Fs(this.language);this.byId("label-new").textContent=t.newFile,this.byId("new").title=t.newFileHint,this.byId("label-open").textContent=t.open,this.byId("open").title=t.openHint,this.byId("open-together").textContent=t.openTogether,this.byId("recent-heading").textContent=t.recentHeading,this.byId("recent-none").textContent=t.recentNone,this.byId("open-file").messages=t,this.byId("template-file").messages=t,this.byId("template-heading").textContent=t.templateHeading,this.byId("template-hint").textContent=t.templateLoadHint,this.byId("template-forget").textContent=t.templateForget}byId(t){return this.shadow.getElementById(t)}}function Ys(){customElements.get(Jr)||customElements.define(Jr,Z)}Ys();export{X as $,gn as A,co as B,z as C,lo as D,wn as E,ht as F,po as G,le as H,J as I,no as J,ao as K,I as L,N as M,K as N,F as O,j as P,O as Q,Xs as R,W as S,x as T,Is as U,pe as V,Qs as W,he as X,ho as Y,so as Z,d as _,fe as a,As as a0,go as a1,Js as a2,Zs as a3,to as a4,eo as a5,ro as a6,oo as b,uo as c,wo as d,mo as e,yo as f,A as g,ve as h,q as i,tn as j,Q as k,io as l,Fe as m,bn as n,It as o,rn as p,_ as q,nn as r,Ts as s,$e as t,Gs as u,xe as v,Pe as w,yn as x,L as y,fo as z};