@rr0/ufoathome 0.201.0 → 0.202.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 (186) hide show
  1. package/dist-embed-interview/InterviewMessages_en-BrnxG2rl.js +3 -0
  2. package/dist-embed-interview/InterviewMessages_es-Dxfjqrte.js +3 -0
  3. package/dist-embed-interview/InterviewMessages_fr-DIA-1qu8.js +3 -0
  4. package/dist-embed-interview/InterviewMessages_it-CYBEIKX-.js +3 -0
  5. package/dist-embed-interview/rr0-interview.mjs +10 -6
  6. package/{dist-embed-sighting/AuroraSimulation-C9hvCV0W.js → dist-embed-scene/AuroraSimulation-Dh4kZW1x.js} +7 -2
  7. package/dist-embed-scene/rr0-scene.mjs +49 -45
  8. package/{dist-embed-scene/AuroraSimulation-BZpjImM0.js → dist-embed-sighting/AuroraSimulation-C7LAHgWM.js} +7 -2
  9. package/dist-embed-sighting/{CaseReportExport-DVVsc8gA.js → CaseReportExport-CkWf0HNx.js} +1 -1
  10. package/dist-embed-sighting/{InterviewElement-BduwyUn5.js → InterviewElement-B_ULRy5z.js} +9 -5
  11. package/dist-embed-sighting/InterviewMessages_en-BrnxG2rl.js +3 -0
  12. package/dist-embed-sighting/InterviewMessages_es-Dxfjqrte.js +3 -0
  13. package/dist-embed-sighting/InterviewMessages_fr-DIA-1qu8.js +3 -0
  14. package/dist-embed-sighting/InterviewMessages_it-CYBEIKX-.js +3 -0
  15. package/dist-embed-sighting/rr0-sighting.mjs +52 -48
  16. package/dist-embed-sighting-editor/{AdsbLolArchiveProvider-CWpyBqG3.js → AdsbLolArchiveProvider-Bz1OjSjY.js} +1 -1
  17. package/dist-embed-sighting-editor/{AirshipEditor-BvnVNcF4.js → AirshipEditor-BlJXyxlr.js} +1 -1
  18. package/dist-embed-sighting-editor/{AirshipFlight-CB1Quf68.js → AirshipFlight-Cx40Y8JT.js} +1 -1
  19. package/dist-embed-sighting-editor/{Aurora-BRXvgyRM.js → Aurora-Ldk66p1A.js} +1 -1
  20. package/dist-embed-sighting-editor/{AuroraEditor-JQ3kRqrq.js → AuroraEditor-CGSomAFk.js} +1 -1
  21. package/dist-embed-sighting-editor/{AuroraSimulation-i64MFW2z.js → AuroraSimulation-vKcv2Hue.js} +7 -2
  22. package/dist-embed-sighting-editor/{BallesterGuaspAssessor-BaKKAdY3.js → BallesterGuaspAssessor-Bylahnc2.js} +1 -1
  23. package/dist-embed-sighting-editor/{BalloonEditor-C2oHClW7.js → BalloonEditor-CgO4LaWn.js} +1 -1
  24. package/dist-embed-sighting-editor/{BalloonFlight-B9A6MoCj.js → BalloonFlight-hLr_4TFU.js} +1 -1
  25. package/dist-embed-sighting-editor/{BeamEditor-CW7mTQjS.js → BeamEditor-B8qreA3j.js} +1 -1
  26. package/dist-embed-sighting-editor/{BeamSystem-CSfJjLCb.js → BeamSystem-D0hrju5J.js} +1 -1
  27. package/dist-embed-sighting-editor/{BirdEditor-BdxhCoW9.js → BirdEditor-BNzrfSqX.js} +1 -1
  28. package/dist-embed-sighting-editor/{BirdFlock-DCbrukNp.js → BirdFlock-iSovVEZd.js} +1 -1
  29. package/dist-embed-sighting-editor/{BodyEditor-DE8ZQrqe.js → BodyEditor-Bd_pKafG.js} +2 -2
  30. package/dist-embed-sighting-editor/{CaseElement-C46wM-nU.js → CaseElement-DPlro-7S.js} +3 -3
  31. package/dist-embed-sighting-editor/{CaseReportExport-UVrInf6H.js → CaseReportExport-C1g5C8hi.js} +2 -2
  32. package/dist-embed-sighting-editor/{ContrailSystem-CDSSxouG.js → ContrailSystem-D3tXAg2r.js} +1 -1
  33. package/dist-embed-sighting-editor/{ControlPasses-CsOVa-jq.js → ControlPasses-BMEmppip.js} +1 -1
  34. package/dist-embed-sighting-editor/{CoverageAssessor-DWY_gJJX.js → CoverageAssessor-uzQnTEH8.js} +1 -1
  35. package/dist-embed-sighting-editor/{DroneEditor-DgeuaHdb.js → DroneEditor-BFsArPKi.js} +1 -1
  36. package/dist-embed-sighting-editor/{DroneFlight-CFztr-9j.js → DroneFlight-B96pVrY1.js} +1 -1
  37. package/dist-embed-sighting-editor/{DroneParameters-CHmDmRoC.js → DroneParameters-DW-enQUo.js} +1 -1
  38. package/dist-embed-sighting-editor/{Flightradar24Provider-e6_3o9Jf.js → Flightradar24Provider-CBGkjw03.js} +1 -1
  39. package/dist-embed-sighting-editor/GLTFLoader-2Zbfb3kh.js +1 -0
  40. package/dist-embed-sighting-editor/{GenerativeKitMessages-CmqG-T2c.js → GenerativeKitMessages-DmeZ_YZO.js} +1 -1
  41. package/dist-embed-sighting-editor/{GeoExportTexts-Wjc5YKlM.js → GeoExportTexts-Cp95Dg-h.js} +1 -1
  42. package/dist-embed-sighting-editor/{GeoJsonExport-BSPGzTbG.js → GeoJsonExport-CdadOwd2.js} +1 -1
  43. package/dist-embed-sighting-editor/{GeographicFigures-D_TfLkj9.js → GeographicFigures-Bo9rsT_L.js} +1 -1
  44. package/dist-embed-sighting-editor/{HeadlightSystem-DljWmzj5.js → HeadlightSystem-CBmEcC9f.js} +1 -1
  45. package/dist-embed-sighting-editor/{HynekAssessor-BCDwoOI9.js → HynekAssessor-uub2VxTi.js} +1 -1
  46. package/dist-embed-sighting-editor/InterviewEditorElement-_1fa2bG7.js +294 -0
  47. package/dist-embed-sighting-editor/{InterviewElement-DDa53uMq.js → InterviewElement-Ala811KB.js} +6 -2
  48. package/dist-embed-sighting-editor/InterviewMessages_en-BrnxG2rl.js +3 -0
  49. package/dist-embed-sighting-editor/InterviewMessages_es-Dxfjqrte.js +3 -0
  50. package/dist-embed-sighting-editor/InterviewMessages_fr-DIA-1qu8.js +3 -0
  51. package/dist-embed-sighting-editor/InterviewMessages_it-CYBEIKX-.js +3 -0
  52. package/dist-embed-sighting-editor/{KmlExport-B46AfaoJ.js → KmlExport-DIxM5Hpx.js} +1 -1
  53. package/dist-embed-sighting-editor/{LanternEditor-CkbeitJh.js → LanternEditor-CjQVFowY.js} +1 -1
  54. package/dist-embed-sighting-editor/{LaserBeam-Ber-PT8j.js → LaserBeam-BVc8Mvhr.js} +1 -1
  55. package/dist-embed-sighting-editor/{LaunchEditor-BsvHahqK.js → LaunchEditor-Cz8Mzo4a.js} +1 -1
  56. package/dist-embed-sighting-editor/{LaunchPlume-BmPMeGMN.js → LaunchPlume-CvBhTPgN.js} +1 -1
  57. package/dist-embed-sighting-editor/{LaunchSimulation-g-ETWhEH.js → LaunchSimulation-CkZIG-3P.js} +1 -1
  58. package/dist-embed-sighting-editor/{ModelSource-DOUnBBhu.js → ModelSource-B153oeTu.js} +1 -1
  59. package/dist-embed-sighting-editor/{ModelThumbnails-TwG1snwZ.js → ModelThumbnails-BUL_OLFv.js} +1 -1
  60. package/dist-embed-sighting-editor/{ModelViewer-Y_B6eM4z.js → ModelViewer-BzBLcY9s.js} +1 -1
  61. package/dist-embed-sighting-editor/{ModuleConformance-CO1S9pa3.js → ModuleConformance-Cr6fM28A.js} +2 -2
  62. package/dist-embed-sighting-editor/{ModuleSession-VLS0tjAb.js → ModuleSession-WA6lqfV6.js} +3 -3
  63. package/dist-embed-sighting-editor/ModuleThree-CB_EjTOI.js +1 -0
  64. package/dist-embed-sighting-editor/{ModulesPanelElement--YQ0QtcW.js → ModulesPanelElement-BsRg3mzl.js} +3 -3
  65. package/dist-embed-sighting-editor/{NearestApproach-C_8Uvp6i.js → NearestApproach-Bnx9Ld5_.js} +1 -1
  66. package/dist-embed-sighting-editor/PictureRegistration-D8fDZm4v.js +1 -0
  67. package/dist-embed-sighting-editor/{PoherAssessor-DtDcuhWK.js → PoherAssessor-CNj_Nyci.js} +1 -1
  68. package/dist-embed-sighting-editor/{QuestionnaireFeed-CvLtuLIH.js → QuestionnaireFeed-B0j8W4JM.js} +1 -1
  69. package/dist-embed-sighting-editor/QuestionnaireForm-lzn9MPr2.js +1 -0
  70. package/dist-embed-sighting-editor/{QuestionnaireImport-BYj5QoJS.js → QuestionnaireImport-BmcxlQBq.js} +1 -1
  71. package/dist-embed-sighting-editor/RailwaySystem-6bwbv8UB.js +41 -0
  72. package/dist-embed-sighting-editor/{ReentryEditor-CW8H7KaA.js → ReentryEditor-BWCK2g_s.js} +1 -1
  73. package/dist-embed-sighting-editor/{ReentrySimulation-DVl__RjO.js → ReentrySimulation-B09JXMu5.js} +1 -1
  74. package/dist-embed-sighting-editor/ReferenceSystem-8QgwbbAG.js +1 -0
  75. package/dist-embed-sighting-editor/{RoadMarkings-DJraHdS6.js → RoadMarkings-Dl6zVQIx.js} +1 -1
  76. package/dist-embed-sighting-editor/ScenarioReadings-DyMshXS4.js +1 -0
  77. package/dist-embed-sighting-editor/{ScenarioSweep-Ddtuo_Af.js → ScenarioSweep-ByqOTfs2.js} +1 -1
  78. package/dist-embed-sighting-editor/{SceneNames_en-p5YNYZhA.js → SceneNames_en-c5zNw0Hi.js} +1 -1
  79. package/dist-embed-sighting-editor/{SceneNames_es-DlMqYLL9.js → SceneNames_es-CDjoBwy_.js} +1 -1
  80. package/dist-embed-sighting-editor/{SceneNames_fr-lFA7hY3x.js → SceneNames_fr-CoZNmFu3.js} +1 -1
  81. package/dist-embed-sighting-editor/{SceneNames_it-CDwvX1Nw.js → SceneNames_it-CVEahBpq.js} +1 -1
  82. package/dist-embed-sighting-editor/{SearchlightEditor-BSI8hB1V.js → SearchlightEditor-BpwPOhJ6.js} +1 -1
  83. package/dist-embed-sighting-editor/{SearchlightSystem-DHfVi2np.js → SearchlightSystem-CEG52QDx.js} +1 -1
  84. package/dist-embed-sighting-editor/{SightingElement-T0x4j9Zt.js → SightingElement-BQdiez39.js} +3 -3
  85. package/dist-embed-sighting-editor/{SkyLantern-Dl4yl-lc.js → SkyLantern-D6bru_e_.js} +1 -1
  86. package/dist-embed-sighting-editor/{TraceSystem-Dbu_bgfE.js → TraceSystem-DZMUxSn-.js} +2 -2
  87. package/dist-embed-sighting-editor/{UfoMessages_en-BAuHAGgq.js → UfoMessages_en-DdCKc-Ez.js} +1 -1
  88. package/dist-embed-sighting-editor/{VideoButton-C8eRmv7A.js → VideoButton-CzJg9lBG.js} +1 -1
  89. package/dist-embed-sighting-editor/{WaterSystem-DpJCe_2Q.js → WaterSystem-CB5jE7qB.js} +2 -2
  90. package/dist-embed-sighting-editor/geipan-qt-2025-B_RUiH8B.js +7 -0
  91. package/dist-embed-sighting-editor/{interviewImport-zzDGCbXd.js → interviewImport-D4P6e28u.js} +1 -1
  92. package/dist-embed-sighting-editor/{interviewJson-DngUPqK8.js → interviewJson-BJF9C-Rb.js} +1 -1
  93. package/dist-embed-sighting-editor/interviewSchema-r5bW7skq.js +1 -0
  94. package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +421 -415
  95. package/dist-embed-sighting-editor/{surroundingsSources-lvh4Rw5C.js → surroundingsSources-CqL7lcmF.js} +1 -1
  96. package/dist-embed-sighting-editor/{trafficRuntime-Drx7CE9H.js → trafficRuntime-Bu3my6S4.js} +2 -2
  97. package/dist-embed-ufoathome/{AdsbLolArchiveProvider-CqedGYi5.js → AdsbLolArchiveProvider-KbJPyJ97.js} +1 -1
  98. package/dist-embed-ufoathome/{Aurora-CpZx9hQ3.js → Aurora-C_mCH4JM.js} +1 -1
  99. package/dist-embed-ufoathome/{AuroraEditor-D2v8sWVE.js → AuroraEditor-Dzvgh6e0.js} +1 -1
  100. package/dist-embed-ufoathome/{AuroraSimulation-DdSP66LD.js → AuroraSimulation-BRUnHmlp.js} +7 -2
  101. package/dist-embed-ufoathome/{BallesterGuaspAssessor-C4IktJ1l.js → BallesterGuaspAssessor-DurdUgbG.js} +1 -1
  102. package/dist-embed-ufoathome/{BeamEditor-CuW3LVO-.js → BeamEditor-Ccvx7l7x.js} +1 -1
  103. package/dist-embed-ufoathome/{BeamSystem-BPEYuCF4.js → BeamSystem-CPM8m17q.js} +1 -1
  104. package/dist-embed-ufoathome/{BodyEditor-COMX-T65.js → BodyEditor-BG--NjnZ.js} +1 -1
  105. package/dist-embed-ufoathome/{CaseEditorElement-C5BHP8jT.js → CaseEditorElement-0J_TCeiq.js} +64 -62
  106. package/dist-embed-ufoathome/{CaseElement-CIZvyRVi.js → CaseElement-CRXPyMMR.js} +3 -3
  107. package/dist-embed-ufoathome/{CaseReportExport-BFbswUIB.js → CaseReportExport-DKrBXPgZ.js} +3 -3
  108. package/dist-embed-ufoathome/{ColumnResize-Dh6Xyspd.js → ColumnResize-DV-byvDt.js} +6 -6
  109. package/dist-embed-ufoathome/{ControlPasses-CnL1GmT-.js → ControlPasses-CKvTCqTI.js} +1 -1
  110. package/dist-embed-ufoathome/{CoverageAssessor-CiqUEJkN.js → CoverageAssessor-MeOMUjkZ.js} +1 -1
  111. package/dist-embed-ufoathome/{Flightradar24Provider-_tNmWf11.js → Flightradar24Provider-DxTfswSh.js} +1 -1
  112. package/dist-embed-ufoathome/{GLTFLoader-BLk8prLt.js → GLTFLoader-pi-JKaNa.js} +1 -1
  113. package/dist-embed-ufoathome/{GeoJsonExport-DkPKk-7q.js → GeoJsonExport-iyhoKOUU.js} +1 -1
  114. package/dist-embed-ufoathome/{GeographicFigures-l-PfHdSR.js → GeographicFigures-DBmuFlvH.js} +1 -1
  115. package/dist-embed-ufoathome/{HynekAssessor-BhnvqsYz.js → HynekAssessor-Bda6csgM.js} +1 -1
  116. package/dist-embed-ufoathome/InterviewAttachments-BP6Prvdu.js +1 -0
  117. package/dist-embed-ufoathome/InterviewEditorElement-BA060rqJ.js +294 -0
  118. package/dist-embed-ufoathome/{InterviewElement-CuRmQ0d3.js → InterviewElement-DvqsCA3I.js} +6 -2
  119. package/dist-embed-ufoathome/InterviewMessages_en-BrnxG2rl.js +3 -0
  120. package/dist-embed-ufoathome/InterviewMessages_es-Dxfjqrte.js +3 -0
  121. package/dist-embed-ufoathome/InterviewMessages_fr-DIA-1qu8.js +3 -0
  122. package/dist-embed-ufoathome/InterviewMessages_it-CYBEIKX-.js +3 -0
  123. package/dist-embed-ufoathome/{KmlExport-BUl3gOrw.js → KmlExport-DEPgRRWe.js} +1 -1
  124. package/dist-embed-ufoathome/{LaserBeam-C7glTvQN.js → LaserBeam--dquPX_h.js} +1 -1
  125. package/dist-embed-ufoathome/{LaunchEditor-DvudtAzp.js → LaunchEditor-D3P0GkLr.js} +1 -1
  126. package/dist-embed-ufoathome/{LaunchPlume-CrDBzsQe.js → LaunchPlume-w4l4TR4A.js} +1 -1
  127. package/dist-embed-ufoathome/{LaunchSimulation-DyOA4lPb.js → LaunchSimulation-BpZd-Nov.js} +1 -1
  128. package/dist-embed-ufoathome/{ModelSource-CoT4mxTx.js → ModelSource-Csnm3RH_.js} +1 -1
  129. package/dist-embed-ufoathome/{ModelThumbnails-t59SZ3Vn.js → ModelThumbnails-Cnt2GxTb.js} +1 -1
  130. package/dist-embed-ufoathome/{ModelViewer-DEdruEtl.js → ModelViewer-DOfAkPgK.js} +1 -1
  131. package/dist-embed-ufoathome/{ModulesPanelElement-N-ccpGxl.js → ModulesPanelElement-DH1oroWm.js} +2 -2
  132. package/dist-embed-ufoathome/{NearestApproach-Do15yfeg.js → NearestApproach-DJ98M81-.js} +1 -1
  133. package/dist-embed-ufoathome/{PoherAssessor-Cs8-ZBge.js → PoherAssessor-4zSdFnFp.js} +1 -1
  134. package/dist-embed-ufoathome/QuestionnaireFeed-W69udpmT.js +1 -0
  135. package/dist-embed-ufoathome/QuestionnaireForm-U78nFPn5.js +1 -0
  136. package/dist-embed-ufoathome/{QuestionnaireImport-Cx1dQiha.js → QuestionnaireImport-Q5uHxQwU.js} +1 -1
  137. package/dist-embed-ufoathome/{ReentryEditor-CJUFkVFO.js → ReentryEditor-DEi9nT0z.js} +1 -1
  138. package/dist-embed-ufoathome/{ReentrySimulation-B5QcdOTq.js → ReentrySimulation-CSO1vgro.js} +1 -1
  139. package/dist-embed-ufoathome/{ReferenceSystem-DyzOUClN.js → ReferenceSystem--tiMGm4e.js} +1 -1
  140. package/dist-embed-ufoathome/ScenarioReadings-Dzdgopl3.js +1 -0
  141. package/dist-embed-ufoathome/ScenarioSweep-CMcleprC.js +1 -0
  142. package/dist-embed-ufoathome/{SearchlightEditor-CPDNpfNC.js → SearchlightEditor--1uL8bTa.js} +1 -1
  143. package/dist-embed-ufoathome/{SearchlightSystem-Ca0rZcXv.js → SearchlightSystem-7bntVtp_.js} +1 -1
  144. package/dist-embed-ufoathome/{ShareDialogElement-CBeU9ChH.js → ShareDialogElement-Dlfy9NCE.js} +52 -48
  145. package/dist-embed-ufoathome/{SightingElement-BveOM4nF.js → SightingElement-BJSNmFM6.js} +2 -2
  146. package/dist-embed-ufoathome/{TraceSystem-CoHX04R3.js → TraceSystem-Cq2TgP-u.js} +1 -1
  147. package/dist-embed-ufoathome/{VideoButton-DNQmWtfv.js → VideoButton-MRJlVNm_.js} +1 -1
  148. package/dist-embed-ufoathome/geipan-qt-2025-B_RUiH8B.js +7 -0
  149. package/dist-embed-ufoathome/interviewSchema-r5bW7skq.js +1 -0
  150. package/dist-embed-ufoathome/rr0-ufoathome.mjs +4 -4
  151. package/dist-embed-ufoathome/{surroundingsSources-C823p3dG.js → surroundingsSources--qffL_nJ.js} +1 -1
  152. package/dist-embed-ufoathome/{trafficRuntime-DtXb9B2f.js → trafficRuntime-CTCGr90P.js} +1 -1
  153. package/package.json +1 -1
  154. package/dist-embed-interview/InterviewMessages_en-BRmuWrAg.js +0 -1
  155. package/dist-embed-interview/InterviewMessages_es-BTotimwY.js +0 -1
  156. package/dist-embed-interview/InterviewMessages_fr-DBCdGB0r.js +0 -1
  157. package/dist-embed-interview/InterviewMessages_it-B5EyMD-k.js +0 -1
  158. package/dist-embed-sighting/InterviewMessages_en-BRmuWrAg.js +0 -1
  159. package/dist-embed-sighting/InterviewMessages_es-BTotimwY.js +0 -1
  160. package/dist-embed-sighting/InterviewMessages_fr-DBCdGB0r.js +0 -1
  161. package/dist-embed-sighting/InterviewMessages_it-B5EyMD-k.js +0 -1
  162. package/dist-embed-sighting-editor/GLTFLoader-Df-r7_lf.js +0 -1
  163. package/dist-embed-sighting-editor/InterviewEditorElement-KHpgfy3k.js +0 -277
  164. package/dist-embed-sighting-editor/InterviewMessages_en-BRmuWrAg.js +0 -1
  165. package/dist-embed-sighting-editor/InterviewMessages_es-BTotimwY.js +0 -1
  166. package/dist-embed-sighting-editor/InterviewMessages_fr-DBCdGB0r.js +0 -1
  167. package/dist-embed-sighting-editor/InterviewMessages_it-B5EyMD-k.js +0 -1
  168. package/dist-embed-sighting-editor/ModuleThree-DQ2dT7XW.js +0 -1
  169. package/dist-embed-sighting-editor/PictureRegistration-Br0xjLE2.js +0 -1
  170. package/dist-embed-sighting-editor/QuestionnaireForm-DA6LPvBt.js +0 -1
  171. package/dist-embed-sighting-editor/RailwaySystem-eT-ZKfZl.js +0 -41
  172. package/dist-embed-sighting-editor/ReferenceSystem-DxVYO7g9.js +0 -1
  173. package/dist-embed-sighting-editor/ScenarioReadings-BYqlpLo8.js +0 -1
  174. package/dist-embed-sighting-editor/geipan-qt-2025-j-yGY7EN.js +0 -7
  175. package/dist-embed-sighting-editor/interviewSchema-DRWvRSL2.js +0 -1
  176. package/dist-embed-ufoathome/InterviewEditorElement-iw2lnwx8.js +0 -277
  177. package/dist-embed-ufoathome/InterviewMessages_en-BRmuWrAg.js +0 -1
  178. package/dist-embed-ufoathome/InterviewMessages_es-BTotimwY.js +0 -1
  179. package/dist-embed-ufoathome/InterviewMessages_fr-DBCdGB0r.js +0 -1
  180. package/dist-embed-ufoathome/InterviewMessages_it-B5EyMD-k.js +0 -1
  181. package/dist-embed-ufoathome/QuestionnaireFeed-BfvRSPoo.js +0 -1
  182. package/dist-embed-ufoathome/QuestionnaireForm-ByFmq67M.js +0 -1
  183. package/dist-embed-ufoathome/ScenarioReadings-CfZehU_P.js +0 -1
  184. package/dist-embed-ufoathome/ScenarioSweep-CDumnmq2.js +0 -1
  185. package/dist-embed-ufoathome/geipan-qt-2025-j-yGY7EN.js +0 -7
  186. package/dist-embed-ufoathome/interviewSchema-DRWvRSL2.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./InterviewElement-CuRmQ0d3.js","./rr0-ufoathome.mjs","./ColumnResize-Dh6Xyspd.js","./ShareDialogElement-CBeU9ChH.js","./Sighting-B7bsiTIQ.js","./VisualAids-DI-hEL46.js","./three.module-CbaHqYFq.js","./SaidPosition-OJEYhVKN.js","./GeoProjection-DvqDbRIx.js","./Decor-Dn-cvniW.js","./RecordingIssue-BlWT8Xsu.js","./xyzImageryRaster-Dhxs0B26.js","./Obstacles-v9SkfBD7.js","./interviewJson-D-i14LTf.js"])))=>i.map(i=>d[i]);
2
- import{S as A,a as k,O as C,R as $,E as H,s as U,U as j,H as q,l as P,C as x,_ as V}from"./rr0-ufoathome.mjs";import{C as v,a as p,R as z,b as B,I as G}from"./ColumnResize-Dh6Xyspd.js";import{I as D}from"./SaidPosition-OJEYhVKN.js";import{T as F,S as K,P as W,A as Y}from"./ShareDialogElement-CBeU9ChH.js";import{SHOW_INFO_ATTRIBUTE as O,OBSERVER_ATTRIBUTE as m,registerSighting as Z,HIDE_PICKERS_ATTRIBUTE as R,SIGHTING_ELEMENT_NAME as c,INTERPRETATION_ATTRIBUTE as f,CASE_NAMED_ATTRIBUTE as J,OBSERVER_CHANGE_EVENT as N,INTERPRETATION_CHANGE_EVENT as Q}from"./SightingElement-BveOM4nF.js";import"./GeoProjection-DvqDbRIx.js";import"./Sighting-B7bsiTIQ.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";const X=`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./InterviewElement-DvqsCA3I.js","./rr0-ufoathome.mjs","./ColumnResize-DV-byvDt.js","./ShareDialogElement-Dlfy9NCE.js","./Sighting-B7bsiTIQ.js","./VisualAids-DI-hEL46.js","./three.module-CbaHqYFq.js","./SaidPosition-OJEYhVKN.js","./GeoProjection-DvqDbRIx.js","./Decor-Dn-cvniW.js","./RecordingIssue-BlWT8Xsu.js","./xyzImageryRaster-Dhxs0B26.js","./Obstacles-v9SkfBD7.js","./interviewJson-D-i14LTf.js","./InterviewAttachments-BP6Prvdu.js"])))=>i.map(i=>d[i]);
2
+ import{S as A,a as k,O as C,R as $,E as H,s as U,U as j,H as q,l as P,C as x,_ as V}from"./rr0-ufoathome.mjs";import{C as v,a as p,R as z,b as B,I as G}from"./ColumnResize-DV-byvDt.js";import{I as D}from"./SaidPosition-OJEYhVKN.js";import{T as F,S as K,P as W,A as Y}from"./ShareDialogElement-Dlfy9NCE.js";import{SHOW_INFO_ATTRIBUTE as O,OBSERVER_ATTRIBUTE as m,registerSighting as Z,HIDE_PICKERS_ATTRIBUTE as R,SIGHTING_ELEMENT_NAME as c,INTERPRETATION_ATTRIBUTE as f,CASE_NAMED_ATTRIBUTE as J,OBSERVER_CHANGE_EVENT as N,INTERPRETATION_CHANGE_EVENT as Q}from"./SightingElement-BJSNmFM6.js";import"./GeoProjection-DvqDbRIx.js";import"./Sighting-B7bsiTIQ.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";const X=`
3
3
  <header class="case-head">
4
4
  <div class="case-bar">
5
5
  <p id="case-kind" class="case-kind"></p>
@@ -128,4 +128,4 @@ ${v.CSS}
128
128
  .case-timeline > :not(.event-list) { display: none !important; }
129
129
  .case-timeline > .event-list { padding-left: 30px; }
130
130
  }
131
- `,g="rr0-case",w="show-timeline",y="open-events",te="openchange";class u extends HTMLElement{static get observedAttributes(){return["src","show-labels",O,w,y,m]}static PASSED_ON=["show-labels"];shadow;openEvents;timeline;shown=new Map;messages;said=new A(["en"]);json;url;shareMessages;entries=[];grouping=!1;query="";folded=new Set;columns;constructor(){super(),this.shadow=this.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=ee;const i=document.createElement("div");i.innerHTML=X,this.shadow.append(e,i),Z(),this.timeline=new p(this.byId("case-events"),n=>void this.only(n),n=>void this.only(n),n=>void this.toggle(n),n=>{this.folded.delete(n)||this.folded.add(n),this.draw()}),this.grouping=p.groupingRemembered(),this.columns=new v(this.byId("column-resize"),this.shadow.querySelector(".case-layout"),()=>this.shadow.querySelector(".case-timeline"),v.CASE_HISTORY_KEY,v.PROPERTY,44),this.byId("events-search").addEventListener("input",n=>{this.query=n.target.value,this.draw()}),this.byId("group-readings").addEventListener("click",()=>{this.grouping=!this.grouping,p.rememberGrouping(this.grouping),this.order(),this.draw()}),z.register(),B.register(),this.byId("export").source=async()=>{const n=this.json,o=new Map;return await Promise.all(this.entries.filter(a=>a.kind!=="interview"&&a.url).map(async a=>{try{o.set(a.url,await k.recording(a.url))}catch{}})),{caseJson:n,caseUrl:this.url,recordings:o}},this.openEvents=this.byId("open-events"),this.openEvents.addEventListener(G,n=>{const{at:o,sighting:a}=n.detail;this.seekObservation(o,a)}),this.openEvents.addEventListener(F,n=>{const o=n.target?.closest?.(".open-event");this.followReplay(o??void 0)}),K.register();const t=this.byId("share");t.innerHTML=W.SHARE;const s=this.byId("share-dialog");s.subject=this.shareSubject,t.addEventListener("click",()=>{this.url&&(s.note=C.changed(this.url,...this.entries.map(n=>n.url))?this.shareMessages?.unsaved:void 0,s.open())}),this.byId("edit").addEventListener("click",()=>{if(this.url&&$.ask(this,H,{src:this.url}))return;const n=this.editorUrl();n&&window.open(n,"_blank","noopener")}),this.byId("info").addEventListener("click",()=>this.showSummary(this.byId("case-summary").hidden)),this.byId("timeline-button").addEventListener("click",()=>{this.showTimeline(this.byId("case-events").parentElement.hidden)})}shareSubject={module:"rr0-sighting",link:()=>{const e=this.openKeys();return`${Y.home()}/play/?file=${encodeURIComponent(this.url??"")}${e?`&events=${encodeURIComponent(e)}`:""}`+(this.timelineShown()?"":"&timeline=0")},element:()=>{const e=this.openKeys();return`<${g} src="${this.url??""}"${e?` ${y}="${e}"`:""}${this.timelineShown()?"":` ${w}="false"`}></${g}>`}};timelineShown(){return!this.byId("case-events").parentElement.hidden}openKeys(){const e=[...this.shown.keys()].sort((i,t)=>i-t);return e.length===1&&e[0]===this.firstObservation()?"":e.map(i=>u.keyOf(this.entries[i])).join(",")}static keyOf(e){return e.event.id??u.fileNameOf(e)}static fileNameOf(e){return(e.url??"").split("/").pop().replace(/[.]json$/i,"")}asked(e){if(e===null)return[];if(e.trim()==="all")return this.entries.map((t,s)=>s);const i=e.split(",").map(t=>t.trim().replace(/[.]json$/i,"")).filter(t=>t!=="");return this.entries.map((t,s)=>({entry:t,at:s})).filter(({entry:t})=>i.some(s=>s===t.event.id||s===u.fileNameOf(t))).map(({at:t})=>t)}firstObservation(){return this.entries.findIndex(e=>e.kind!=="interview")}byId(e){return this.shadow.getElementById(e)}showSummary(e){this.byId("case-summary").hidden=!e,this.byId("info").setAttribute("aria-expanded",String(e))}showTimeline(e){this.byId("case-events").parentElement.hidden=!e,this.byId("timeline-button").setAttribute("aria-pressed",String(e));for(const i of this.players())i.toggleAttribute(R,e)}connectedCallback(){this.loadMessages(),this.showTimeline(this.getAttribute(w)!=="false"),this.showSummary(this.hasAttribute(O));const e=this.getAttribute("src");e&&this.load(e).catch(i=>console.warn(`<${g}> could not read ${e}:`,i))}attributeChangedCallback(e,i,t){if(!(!this.isConnected||t===i))if(e==="src"&&t)this.load(t);else if(e===w)this.showTimeline(t!=="false");else if(e===y)for(const s of this.asked(t))this.open(s);else for(const s of this.players())t===null?s.removeAttribute(e):s.setAttribute(e,t)}async loadMessages(){const e=U(q.preferencesFor(this),j);this.said=new A([e,"en"]),this.messages=await P(e),this.shareMessages=await this.byId("share-dialog").useLanguage(e),this.draw()}async load(e){this.url=new URL(e,location.href).href;const i=await k.recording(this.url);if(!x.isCase(i))throw new Error(`${e} is not a case: <${g}> reads a case.json`);this.json=i,this.byId("share").hidden=C.local(this.url),this.entries=u.inTime((i.events??[]).map(r=>this.entryOf(r)).filter(r=>r!==void 0)),this.shown.clear(),this.folded.clear(),this.openEvents.replaceChildren(),this.draw(),this.compareReadings();const t=this.asked(this.getAttribute(y));if(t.length>0){for(const r of t)await this.open(r);return}const s=this.firstObservation();s>=0&&this.open(s)}static inTime(e){const i=new Map(e.filter(t=>t.event.id!==void 0).map(t=>[t.event.id,t]));return p.inTime(e,{when:t=>t.when,kind:t=>t.kind,read:t=>[t.event.interpretationOf].flat().map(s=>s===void 0?void 0:i.get(s)).filter(s=>s!==void 0)}).map(({item:t})=>t)}entryOf(e){if(typeof e.url!="string"||e.url==="")return;const i=e.eventType===x.INTERVIEW_EVENT?"interview":e.eventType===x.SIGHTING_EVENT?e.interpretationOf===void 0?"observation":"reading":void 0;if(i)return{event:e,kind:i,url:new URL(e.url,this.url??location.href).href,title:this.said.read(e.title)??e.id??"",when:String(e.time??"")}}compareReadings(){const e=this.byId("readings-comparison"),i=new Map,t=r=>{let n=i.get(r);return n||(n=k.recording(r).then(o=>o,()=>{}),i.set(r,n)),n},s=async r=>Promise.all(this.entries.flatMap((n,o)=>{if(n.kind!=="reading")return[];const a=this.accountOf(n);return[(async()=>({title:n.title,witness:a?.title??"",...r&&a?.url&&n.url?{account:await t(a.url),reading:await t(n.url)}:{},open:()=>void this.only(o).then(()=>this.shown.get(o)?.scrollIntoView({block:"start",behavior:"smooth"}))}))()]}));s(!1).then(r=>e.show(r,()=>s(!0)))}accountOf(e){return this.accountsOf(e)[0]}accountsOf(e){const i=[e.event.interpretationOf].flat().filter(t=>t!==void 0);return this.entries.filter(t=>t.kind==="observation"&&i.includes(t.event.id??""))}editorUrl(){if(!this.url)return;const e=new URL("/edit/",location.href);return e.searchParams.set("file",this.url),e.href}async only(e){const i=this.turn(e);for(const t of[...this.shown.keys()])t!==e&&this.shut(t);i||await this.open(e)}turn(e){const i=this.entries[e];if(!i?.url||this.shown.has(e)||i.kind!=="observation"&&i.kind!=="reading")return!1;const[t,s]=[...this.shown.entries()].find(([n,o])=>{const a=this.entries[n]?.kind;return(a==="observation"||a==="reading")&&o.querySelector(c)})??[],r=s?.querySelector(c);return t===void 0||!s||!r?!1:(this.shown.delete(t),this.shown.set(e,s),s.dataset.at=String(e),i.kind==="reading"?(r.setAttribute(f,i.url),r.setAttribute(m,this.accountOf(i)?.url??i.url)):(r.setAttribute(m,i.url),r.removeAttribute(f)),this.order(),this.draw(),window.setTimeout(()=>this.markCitedMoments(),300),this.announceOpen(),!0)}async toggle(e){this.shown.has(e)?this.shut(e):await this.open(e)}async open(e){const i=this.entries[e];if(!i||!i.url||this.shown.has(e))return;const t=document.createElement("section");if(t.className="open-event",t.dataset.at=String(e),i.kind==="interview"){const s=document.createElement("p");s.className="open-title",s.textContent=i.title,t.append(s)}if(i.kind==="interview"){const{register:s}=await V(async()=>{const{register:n}=await import("./InterviewElement-CuRmQ0d3.js");return{register:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url);s();const r=document.createElement("rr0-interview");r.setAttribute("src",i.url),t.append(r),window.setTimeout(()=>{this.followReplay(),this.markCitedMoments()},300)}else{const s=document.createElement(c);s.setAttribute(J,""),s.toggleAttribute(R,!this.byId("case-events").parentElement.hidden),s.setAttribute("src",this.url??"");const r=i.kind==="reading"?this.accountOf(i):void 0;s.setAttribute(m,(r??i).url??""),i.kind==="reading"&&s.setAttribute(f,i.url),queueMicrotask(()=>{for(const n of u.PASSED_ON){const o=this.getAttribute(n);o!==null&&s.setAttribute(n,o)}}),s.addEventListener(N,n=>{this.dispatchEvent(new CustomEvent(N,{detail:n.detail})),this.follow(t,s)}),s.addEventListener(Q,()=>this.follow(t,s)),t.append(s)}this.shown.set(e,t),this.order(),this.draw(),i.kind!=="interview"&&window.setTimeout(()=>this.markCitedMoments(),300),this.announceOpen()}follow(e,i){const t=Number(e.dataset.at),s=i.shownReadingUrl,r=i.shownRecordingUrl,n=(h,b)=>h!==void 0&&b!==void 0&&new URL(h,this.url??location.href).href===new URL(b,this.url??location.href).href,o=s?this.entries.findIndex(h=>h.kind==="reading"&&n(h.url,s)):this.entries.findIndex(h=>h.kind==="observation"&&n(h.url,r));if(o<0||o===t||this.shown.get(t)!==e||this.shown.has(o))return;this.shown.delete(t),this.shown.set(o,e),e.dataset.at=String(o);const a=this.entries[o];a.kind==="reading"?i.setAttribute(f,a.url):(i.removeAttribute(f),a.url&&i.setAttribute(m,a.url)),this.order(),this.draw(),this.announceOpen()}announceOpen(){this.dispatchEvent(new CustomEvent(te,{detail:{events:this.openKeys()}}))}followReplay(e){const i=e??[...this.shown.values()].find(n=>n.querySelector(c)),t=i?Number(i.dataset.at):NaN,s=Number.isNaN(t)?void 0:this.entries[t],r=i?.querySelector(c);if(!(!s||!r)){for(const[n,o]of this.shown){if(this.entries[n]?.kind!=="interview")continue;o.querySelector("rr0-interview")?.revealAt?.(r.playedSeconds,s.event.id)}return i}}markCitedMoments(){for(const[e,i]of this.shown){const t=this.entries[e],s=i.querySelector(c);if(!t||!s)continue;const r=[];for(const[n,o]of this.shown){if(this.entries[n]?.kind!=="interview")continue;const a=o.querySelector("rr0-interview");r.push(...a?.momentsCited?.(t.event.id)??[])}s.citedMoments=r.sort((n,o)=>n.at-o.at)}}shut(e){this.shown.get(e)?.remove(),this.shown.delete(e),this.markCitedMoments(),this.draw(),this.announceOpen()}order(){const e=new Map(this.listed().map(({index:t},s)=>[t,s])),i=[...this.shown.entries()].sort(([t],[s])=>(e.get(t)??t)-(e.get(s)??s)).map(([,t])=>t);i.length===this.openEvents.children.length&&i.every((t,s)=>this.openEvents.children[s]===t)||this.openEvents.replaceChildren(...i)}listed(){const e=this.entries.map((i,t)=>({item:i,index:t}));return this.grouping?p.grouped(e,{kind:i=>i.kind,read:i=>this.accountsOf(i)}):e}async seekObservation(e,i){const t=this.entries.findIndex(n=>n.kind!=="interview"&&(n.event.id===i||i!==void 0&&n.url?.endsWith(`/${i}.json`))),s=t>=0?t:this.entries.findIndex(n=>n.kind!=="interview");if(s<0)return;this.shown.has(s)||await this.open(s),this.shown.get(s)?.querySelector(c)?.seekTo(e,i),this.shown.get(s)?.scrollIntoView({block:"nearest",behavior:"smooth"})}authors(e){const i=this.messages,t=(e??[]).map(s=>"people"in s?s.people:"org"in s?s.org:this.said.read(s.title)??"").filter(s=>s!=="");return t.length<2||!i?t.join(", "):`${t.slice(0,-1).join(", ")} ${i.linkAnd} ${t[t.length-1]}`}linkedTo(e){const i=this.messages;if(i){if(e.kind==="reading"){const t=[e.event.interpretationOf].flat().filter(r=>r!==void 0),s=this.entries.map((r,n)=>t.includes(r.event.id??"")?n:-1).filter(r=>r>=0);return s.length>0?{heading:i.interpretationOf,to:s}:void 0}if(e.kind==="observation"){const t=this.entries.map((s,r)=>s.kind==="interview"&&[s.event.interviewOf].flat().includes(e.event.id)?r:-1).filter(s=>s>=0);return t.length>0?{heading:i.passagesHeading,to:t}:void 0}}}draw(){const e=this.messages,i=this.json;if(!e||!i)return;this.byId("case-kind").textContent=e.caseHeading,this.byId("case-title").textContent=this.said.read(i.title)??i.id??"";const t=this.said.read(i.summary)??"",s=this.byId("case-summary");s.textContent=t;const r=this.byId("info");r.hidden=t==="",r.title=e.caseSummary,r.setAttribute("aria-label",e.caseSummary),t===""&&this.showSummary(!1),this.byId("events-heading").textContent=e.eventsHeading,this.byId("events-icon").innerHTML=D.CLOCK;const n=this.byId("share");n.title=e.shareCase,n.setAttribute("aria-label",e.shareCase);const o=this.byId("edit");o.title=e.editCase,o.setAttribute("aria-label",e.editCase);const a=this.byId("group-readings");a.title=e.groupReadings,a.setAttribute("aria-label",e.groupReadings),this.columns.label(e.resizeColumns),a.setAttribute("aria-pressed",String(this.grouping)),a.hidden=!this.entries.some(d=>d.kind==="reading");const h=this.listed(),b=d=>h.filter(({under:l})=>l===d).length,M=new Map(this.entries.map((d,l)=>[d,l]));this.timeline.render(h.filter(({index:d,under:l})=>l===void 0||this.query.trim()!==""||!this.folded.has(M.get(l))||this.shown.has(d)).map(({item:d,index:l,under:L})=>{const I=this.card(d,l,L),S=this.grouping&&d.kind==="observation"?b(d):0;return S>0?{...I,readings:{count:S,folded:this.folded.has(l)}}:I}),e);const E=this.byId("events-search");E.placeholder=e.searchEvents,E.setAttribute("aria-label",e.searchEvents),E.hidden=this.entries.length<5;const _=this.timeline.search(this.query),T=this.byId("events-none");T.textContent=e.noEventFound,T.hidden=this.query.trim()===""||_>0}card(e,i,t){const s=this.linkedTo(e),r=(s?.to??[]).filter(o=>this.entries[o]!==t),n=t?this.messages.alsoAbout:s?.heading??"";return{at:i,kind:e.kind,title:e.title,meta:e.when.replace("T"," "),open:this.shown.has(i),...r.length>0?{links:{heading:n,to:r.map(o=>({at:o,title:this.entries[o].title}))}}:{},by:e.kind==="observation"?"":this.authors(e.event.by),...t?{nested:!0}:{}}}async loadFromSrc(e){await this.load(e),await this.player?.loaded}get scene(){return this.players()[0]?.scene}players(){return[...this.shown.entries()].sort(([e],[i])=>e-i).map(([,e])=>e.querySelector(c)).filter(e=>e!==null)}get sightingData(){return this.players()[0]?.sightingData}get player(){return this.players()[0]}}function me(){customElements.get(g)||customElements.define(g,u)}export{g as CASE_ELEMENT_NAME,u as CaseElement,te as OPEN_CHANGE_EVENT,y as OPEN_EVENTS_ATTRIBUTE,w as SHOW_TIMELINE_ATTRIBUTE,me as register};
131
+ `,g="rr0-case",w="show-timeline",y="open-events",te="openchange";class u extends HTMLElement{static get observedAttributes(){return["src","show-labels",O,w,y,m]}static PASSED_ON=["show-labels"];shadow;openEvents;timeline;shown=new Map;messages;said=new A(["en"]);json;url;shareMessages;entries=[];grouping=!1;query="";folded=new Set;columns;constructor(){super(),this.shadow=this.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=ee;const i=document.createElement("div");i.innerHTML=X,this.shadow.append(e,i),Z(),this.timeline=new p(this.byId("case-events"),n=>void this.only(n),n=>void this.only(n),n=>void this.toggle(n),n=>{this.folded.delete(n)||this.folded.add(n),this.draw()}),this.grouping=p.groupingRemembered(),this.columns=new v(this.byId("column-resize"),this.shadow.querySelector(".case-layout"),()=>this.shadow.querySelector(".case-timeline"),v.CASE_HISTORY_KEY,v.PROPERTY,44),this.byId("events-search").addEventListener("input",n=>{this.query=n.target.value,this.draw()}),this.byId("group-readings").addEventListener("click",()=>{this.grouping=!this.grouping,p.rememberGrouping(this.grouping),this.order(),this.draw()}),z.register(),B.register(),this.byId("export").source=async()=>{const n=this.json,o=new Map;return await Promise.all(this.entries.filter(a=>a.kind!=="interview"&&a.url).map(async a=>{try{o.set(a.url,await k.recording(a.url))}catch{}})),{caseJson:n,caseUrl:this.url,recordings:o}},this.openEvents=this.byId("open-events"),this.openEvents.addEventListener(G,n=>{const{at:o,sighting:a}=n.detail;this.seekObservation(o,a)}),this.openEvents.addEventListener(F,n=>{const o=n.target?.closest?.(".open-event");this.followReplay(o??void 0)}),K.register();const t=this.byId("share");t.innerHTML=W.SHARE;const s=this.byId("share-dialog");s.subject=this.shareSubject,t.addEventListener("click",()=>{this.url&&(s.note=C.changed(this.url,...this.entries.map(n=>n.url))?this.shareMessages?.unsaved:void 0,s.open())}),this.byId("edit").addEventListener("click",()=>{if(this.url&&$.ask(this,H,{src:this.url}))return;const n=this.editorUrl();n&&window.open(n,"_blank","noopener")}),this.byId("info").addEventListener("click",()=>this.showSummary(this.byId("case-summary").hidden)),this.byId("timeline-button").addEventListener("click",()=>{this.showTimeline(this.byId("case-events").parentElement.hidden)})}shareSubject={module:"rr0-sighting",link:()=>{const e=this.openKeys();return`${Y.home()}/play/?file=${encodeURIComponent(this.url??"")}${e?`&events=${encodeURIComponent(e)}`:""}`+(this.timelineShown()?"":"&timeline=0")},element:()=>{const e=this.openKeys();return`<${g} src="${this.url??""}"${e?` ${y}="${e}"`:""}${this.timelineShown()?"":` ${w}="false"`}></${g}>`}};timelineShown(){return!this.byId("case-events").parentElement.hidden}openKeys(){const e=[...this.shown.keys()].sort((i,t)=>i-t);return e.length===1&&e[0]===this.firstObservation()?"":e.map(i=>u.keyOf(this.entries[i])).join(",")}static keyOf(e){return e.event.id??u.fileNameOf(e)}static fileNameOf(e){return(e.url??"").split("/").pop().replace(/[.]json$/i,"")}asked(e){if(e===null)return[];if(e.trim()==="all")return this.entries.map((t,s)=>s);const i=e.split(",").map(t=>t.trim().replace(/[.]json$/i,"")).filter(t=>t!=="");return this.entries.map((t,s)=>({entry:t,at:s})).filter(({entry:t})=>i.some(s=>s===t.event.id||s===u.fileNameOf(t))).map(({at:t})=>t)}firstObservation(){return this.entries.findIndex(e=>e.kind!=="interview")}byId(e){return this.shadow.getElementById(e)}showSummary(e){this.byId("case-summary").hidden=!e,this.byId("info").setAttribute("aria-expanded",String(e))}showTimeline(e){this.byId("case-events").parentElement.hidden=!e,this.byId("timeline-button").setAttribute("aria-pressed",String(e));for(const i of this.players())i.toggleAttribute(R,e)}connectedCallback(){this.loadMessages(),this.showTimeline(this.getAttribute(w)!=="false"),this.showSummary(this.hasAttribute(O));const e=this.getAttribute("src");e&&this.load(e).catch(i=>console.warn(`<${g}> could not read ${e}:`,i))}attributeChangedCallback(e,i,t){if(!(!this.isConnected||t===i))if(e==="src"&&t)this.load(t);else if(e===w)this.showTimeline(t!=="false");else if(e===y)for(const s of this.asked(t))this.open(s);else for(const s of this.players())t===null?s.removeAttribute(e):s.setAttribute(e,t)}async loadMessages(){const e=U(q.preferencesFor(this),j);this.said=new A([e,"en"]),this.messages=await P(e),this.shareMessages=await this.byId("share-dialog").useLanguage(e),this.draw()}async load(e){this.url=new URL(e,location.href).href;const i=await k.recording(this.url);if(!x.isCase(i))throw new Error(`${e} is not a case: <${g}> reads a case.json`);this.json=i,this.byId("share").hidden=C.local(this.url),this.entries=u.inTime((i.events??[]).map(r=>this.entryOf(r)).filter(r=>r!==void 0)),this.shown.clear(),this.folded.clear(),this.openEvents.replaceChildren(),this.draw(),this.compareReadings();const t=this.asked(this.getAttribute(y));if(t.length>0){for(const r of t)await this.open(r);return}const s=this.firstObservation();s>=0&&this.open(s)}static inTime(e){const i=new Map(e.filter(t=>t.event.id!==void 0).map(t=>[t.event.id,t]));return p.inTime(e,{when:t=>t.when,kind:t=>t.kind,read:t=>[t.event.interpretationOf].flat().map(s=>s===void 0?void 0:i.get(s)).filter(s=>s!==void 0)}).map(({item:t})=>t)}entryOf(e){if(typeof e.url!="string"||e.url==="")return;const i=e.eventType===x.INTERVIEW_EVENT?"interview":e.eventType===x.SIGHTING_EVENT?e.interpretationOf===void 0?"observation":"reading":void 0;if(i)return{event:e,kind:i,url:new URL(e.url,this.url??location.href).href,title:this.said.read(e.title)??e.id??"",when:String(e.time??"")}}compareReadings(){const e=this.byId("readings-comparison"),i=new Map,t=r=>{let n=i.get(r);return n||(n=k.recording(r).then(o=>o,()=>{}),i.set(r,n)),n},s=async r=>Promise.all(this.entries.flatMap((n,o)=>{if(n.kind!=="reading")return[];const a=this.accountOf(n);return[(async()=>({title:n.title,witness:a?.title??"",...r&&a?.url&&n.url?{account:await t(a.url),reading:await t(n.url)}:{},open:()=>void this.only(o).then(()=>this.shown.get(o)?.scrollIntoView({block:"start",behavior:"smooth"}))}))()]}));s(!1).then(r=>e.show(r,()=>s(!0)))}accountOf(e){return this.accountsOf(e)[0]}accountsOf(e){const i=[e.event.interpretationOf].flat().filter(t=>t!==void 0);return this.entries.filter(t=>t.kind==="observation"&&i.includes(t.event.id??""))}editorUrl(){if(!this.url)return;const e=new URL("/edit/",location.href);return e.searchParams.set("file",this.url),e.href}async only(e){const i=this.turn(e);for(const t of[...this.shown.keys()])t!==e&&this.shut(t);i||await this.open(e)}turn(e){const i=this.entries[e];if(!i?.url||this.shown.has(e)||i.kind!=="observation"&&i.kind!=="reading")return!1;const[t,s]=[...this.shown.entries()].find(([n,o])=>{const a=this.entries[n]?.kind;return(a==="observation"||a==="reading")&&o.querySelector(c)})??[],r=s?.querySelector(c);return t===void 0||!s||!r?!1:(this.shown.delete(t),this.shown.set(e,s),s.dataset.at=String(e),i.kind==="reading"?(r.setAttribute(f,i.url),r.setAttribute(m,this.accountOf(i)?.url??i.url)):(r.setAttribute(m,i.url),r.removeAttribute(f)),this.order(),this.draw(),window.setTimeout(()=>this.markCitedMoments(),300),this.announceOpen(),!0)}async toggle(e){this.shown.has(e)?this.shut(e):await this.open(e)}async open(e){const i=this.entries[e];if(!i||!i.url||this.shown.has(e))return;const t=document.createElement("section");if(t.className="open-event",t.dataset.at=String(e),i.kind==="interview"){const s=document.createElement("p");s.className="open-title",s.textContent=i.title,t.append(s)}if(i.kind==="interview"){const{register:s}=await V(async()=>{const{register:n}=await import("./InterviewElement-DvqsCA3I.js");return{register:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url);s();const r=document.createElement("rr0-interview");r.setAttribute("src",i.url),t.append(r),window.setTimeout(()=>{this.followReplay(),this.markCitedMoments()},300)}else{const s=document.createElement(c);s.setAttribute(J,""),s.toggleAttribute(R,!this.byId("case-events").parentElement.hidden),s.setAttribute("src",this.url??"");const r=i.kind==="reading"?this.accountOf(i):void 0;s.setAttribute(m,(r??i).url??""),i.kind==="reading"&&s.setAttribute(f,i.url),queueMicrotask(()=>{for(const n of u.PASSED_ON){const o=this.getAttribute(n);o!==null&&s.setAttribute(n,o)}}),s.addEventListener(N,n=>{this.dispatchEvent(new CustomEvent(N,{detail:n.detail})),this.follow(t,s)}),s.addEventListener(Q,()=>this.follow(t,s)),t.append(s)}this.shown.set(e,t),this.order(),this.draw(),i.kind!=="interview"&&window.setTimeout(()=>this.markCitedMoments(),300),this.announceOpen()}follow(e,i){const t=Number(e.dataset.at),s=i.shownReadingUrl,r=i.shownRecordingUrl,n=(h,b)=>h!==void 0&&b!==void 0&&new URL(h,this.url??location.href).href===new URL(b,this.url??location.href).href,o=s?this.entries.findIndex(h=>h.kind==="reading"&&n(h.url,s)):this.entries.findIndex(h=>h.kind==="observation"&&n(h.url,r));if(o<0||o===t||this.shown.get(t)!==e||this.shown.has(o))return;this.shown.delete(t),this.shown.set(o,e),e.dataset.at=String(o);const a=this.entries[o];a.kind==="reading"?i.setAttribute(f,a.url):(i.removeAttribute(f),a.url&&i.setAttribute(m,a.url)),this.order(),this.draw(),this.announceOpen()}announceOpen(){this.dispatchEvent(new CustomEvent(te,{detail:{events:this.openKeys()}}))}followReplay(e){const i=e??[...this.shown.values()].find(n=>n.querySelector(c)),t=i?Number(i.dataset.at):NaN,s=Number.isNaN(t)?void 0:this.entries[t],r=i?.querySelector(c);if(!(!s||!r)){for(const[n,o]of this.shown){if(this.entries[n]?.kind!=="interview")continue;o.querySelector("rr0-interview")?.revealAt?.(r.playedSeconds,s.event.id)}return i}}markCitedMoments(){for(const[e,i]of this.shown){const t=this.entries[e],s=i.querySelector(c);if(!t||!s)continue;const r=[];for(const[n,o]of this.shown){if(this.entries[n]?.kind!=="interview")continue;const a=o.querySelector("rr0-interview");r.push(...a?.momentsCited?.(t.event.id)??[])}s.citedMoments=r.sort((n,o)=>n.at-o.at)}}shut(e){this.shown.get(e)?.remove(),this.shown.delete(e),this.markCitedMoments(),this.draw(),this.announceOpen()}order(){const e=new Map(this.listed().map(({index:t},s)=>[t,s])),i=[...this.shown.entries()].sort(([t],[s])=>(e.get(t)??t)-(e.get(s)??s)).map(([,t])=>t);i.length===this.openEvents.children.length&&i.every((t,s)=>this.openEvents.children[s]===t)||this.openEvents.replaceChildren(...i)}listed(){const e=this.entries.map((i,t)=>({item:i,index:t}));return this.grouping?p.grouped(e,{kind:i=>i.kind,read:i=>this.accountsOf(i)}):e}async seekObservation(e,i){const t=this.entries.findIndex(n=>n.kind!=="interview"&&(n.event.id===i||i!==void 0&&n.url?.endsWith(`/${i}.json`))),s=t>=0?t:this.entries.findIndex(n=>n.kind!=="interview");if(s<0)return;this.shown.has(s)||await this.open(s),this.shown.get(s)?.querySelector(c)?.seekTo(e,i),this.shown.get(s)?.scrollIntoView({block:"nearest",behavior:"smooth"})}authors(e){const i=this.messages,t=(e??[]).map(s=>"people"in s?s.people:"org"in s?s.org:this.said.read(s.title)??"").filter(s=>s!=="");return t.length<2||!i?t.join(", "):`${t.slice(0,-1).join(", ")} ${i.linkAnd} ${t[t.length-1]}`}linkedTo(e){const i=this.messages;if(i){if(e.kind==="reading"){const t=[e.event.interpretationOf].flat().filter(r=>r!==void 0),s=this.entries.map((r,n)=>t.includes(r.event.id??"")?n:-1).filter(r=>r>=0);return s.length>0?{heading:i.interpretationOf,to:s}:void 0}if(e.kind==="observation"){const t=this.entries.map((s,r)=>s.kind==="interview"&&[s.event.interviewOf].flat().includes(e.event.id)?r:-1).filter(s=>s>=0);return t.length>0?{heading:i.passagesHeading,to:t}:void 0}}}draw(){const e=this.messages,i=this.json;if(!e||!i)return;this.byId("case-kind").textContent=e.caseHeading,this.byId("case-title").textContent=this.said.read(i.title)??i.id??"";const t=this.said.read(i.summary)??"",s=this.byId("case-summary");s.textContent=t;const r=this.byId("info");r.hidden=t==="",r.title=e.caseSummary,r.setAttribute("aria-label",e.caseSummary),t===""&&this.showSummary(!1),this.byId("events-heading").textContent=e.eventsHeading,this.byId("events-icon").innerHTML=D.CLOCK;const n=this.byId("share");n.title=e.shareCase,n.setAttribute("aria-label",e.shareCase);const o=this.byId("edit");o.title=e.editCase,o.setAttribute("aria-label",e.editCase);const a=this.byId("group-readings");a.title=e.groupReadings,a.setAttribute("aria-label",e.groupReadings),this.columns.label(e.resizeColumns),a.setAttribute("aria-pressed",String(this.grouping)),a.hidden=!this.entries.some(d=>d.kind==="reading");const h=this.listed(),b=d=>h.filter(({under:l})=>l===d).length,M=new Map(this.entries.map((d,l)=>[d,l]));this.timeline.render(h.filter(({index:d,under:l})=>l===void 0||this.query.trim()!==""||!this.folded.has(M.get(l))||this.shown.has(d)).map(({item:d,index:l,under:L})=>{const I=this.card(d,l,L),S=this.grouping&&d.kind==="observation"?b(d):0;return S>0?{...I,readings:{count:S,folded:this.folded.has(l)}}:I}),e);const E=this.byId("events-search");E.placeholder=e.searchEvents,E.setAttribute("aria-label",e.searchEvents),E.hidden=this.entries.length<5;const _=this.timeline.search(this.query),T=this.byId("events-none");T.textContent=e.noEventFound,T.hidden=this.query.trim()===""||_>0}card(e,i,t){const s=this.linkedTo(e),r=(s?.to??[]).filter(o=>this.entries[o]!==t),n=t?this.messages.alsoAbout:s?.heading??"";return{at:i,kind:e.kind,title:e.title,meta:e.when.replace("T"," "),open:this.shown.has(i),...r.length>0?{links:{heading:n,to:r.map(o=>({at:o,title:this.entries[o].title}))}}:{},by:e.kind==="observation"?"":this.authors(e.event.by),...t?{nested:!0}:{}}}async loadFromSrc(e){await this.load(e),await this.player?.loaded}get scene(){return this.players()[0]?.scene}players(){return[...this.shown.entries()].sort(([e],[i])=>e-i).map(([,e])=>e.querySelector(c)).filter(e=>e!==null)}get sightingData(){return this.players()[0]?.sightingData}get player(){return this.players()[0]}}function me(){customElements.get(g)||customElements.define(g,u)}export{g as CASE_ELEMENT_NAME,u as CaseElement,te as OPEN_CHANGE_EVENT,y as OPEN_EVENTS_ATTRIBUTE,w as SHOW_TIMELINE_ATTRIBUTE,me as register};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ShareDialogElement-CBeU9ChH.js","./rr0-ufoathome.mjs","./Sighting-B7bsiTIQ.js","./VisualAids-DI-hEL46.js","./three.module-CbaHqYFq.js","./SaidPosition-OJEYhVKN.js","./GeoProjection-DvqDbRIx.js","./Decor-Dn-cvniW.js","./RecordingIssue-BlWT8Xsu.js","./xyzImageryRaster-Dhxs0B26.js","./Obstacles-v9SkfBD7.js"])))=>i.map(i=>d[i]);
2
- import{P as W,M as Y,_ as Z,S as K}from"./rr0-ufoathome.mjs";import{aR as B,a7 as Q,aS as H,W as P,c as J,d as C}from"./ShareDialogElement-CBeU9ChH.js";import{g as F}from"./GeoProjection-DvqDbRIx.js";import"./Sighting-B7bsiTIQ.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./SaidPosition-OJEYhVKN.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";class A{static of(t,n,a,s,i,e=new Date){const r=t.events??[],c=f=>f.url?new URL(f.url,n).href:void 0,o=r.filter(f=>f.eventType==="sighting"&&c(f)),u=o.filter(f=>f.interpretationOf===void 0),p=u.map(f=>A.witnessOf(f,c(f),a.get(c(f)),s)),l=f=>{const w=[f.interpretationOf].flat().filter(b=>typeof b=="string");return u.find(b=>b.id!==void 0&&w.includes(b.id))??u.find(b=>w.includes(a.get(c(b))?.id??""))},m=o.filter(f=>f.interpretationOf!==void 0).map(f=>{const w=l(f),b=w?p[u.indexOf(w)]:void 0;return A.readingOf(f,c(f),a.get(c(f)),b,w?a.get(c(w)):void 0,s,i)}),d=r.filter(f=>f.eventType==="interview").map(f=>{const w=u.find(b=>b.id!==void 0&&[f.interviewOf].flat().includes(b.id));return{title:s.read(f.title)??f.id??"",...w?{witness:p[u.indexOf(w)].title}:{},...f.time?{time:f.time}:{},by:A.names(f.by,s),...f.medium?{medium:f.medium}:{}}});A.placeOnMap(p,m);const g=s.read(t.summary);return{generatedAt:e.toISOString(),case:{...t.id?{id:t.id}:{},...t.title?{title:t.title}:{},...t.time?{time:t.time}:{},url:n,...g?{summary:g}:{}},witnesses:p,readings:m,interviews:d}}static witnessOf(t,n,a,s){const i=s.read(t.title)??s.read(a?.observer?.title)??t.id??n,e={...t.id?{id:t.id}:{},title:i,url:n,...t.time?{time:t.time}:{},indications:[],values:[],sources:[],moments:[]};if(!a)return e;const{recording:r,provenance:c}=W.strip(a),o=s.read(r.description);o&&(e.description=o);const u=r.place?.name;u&&(e.place=u),!e.time&&r.time&&(e.time=r.time),typeof r.durationSeconds=="number"&&(e.durationSeconds=r.durationSeconds),r.instrument&&(e.instrument=r.instrument),e.sources=(r.sources??[]).map(b=>{const v=b,y=s.read(v.title);return{...y?{title:y}:{},...v.authors?.length?{authors:v.authors}:{},...v.publication?.publisher?{publisher:v.publication.publisher}:{},...v.publication?.time?{time:v.publication.time}:{},...v.url?{url:v.url}:{},...v.index?{index:v.index}:{}}}),e.moments=[...r.milestones??[]].sort((b,v)=>b.t-v.t).map(b=>{const v=s.read(b.note);return{t:b.t,label:s.read(b.label)??"",...v?{note:v}:{}}});const p=r.observerTrack?.keyframes?.[0]?.pose,l=r.place?.locations?.[0],m=p?.lat??l?.lat,d=p?.lng??l?.lng;typeof m=="number"&&typeof d=="number"&&Object.assign(e,{lat:m,lng:d}),e.values=A.valuesOf(c,r,()=>!0,s);const g=P.MODELS[0],f=r.account?.conditions,w=new Map;for(const b of r.timeline?.keyframes??[])for(const v of b.shapes){const y=s.read(v.shape.title);y&&!w.has(v.sourceId)&&w.set(v.sourceId,y)}return e.phenomena=Object.fromEntries(w),(r.timeline?.keyframes??[]).forEach((b,v)=>b.shapes.forEach((y,h)=>{const M=`timeline.keyframes.${v}.shapes.${h}.shape`,E=B.traced(c,`${M}.aim`),O=B.traced(c,`${M}.angular`);if(!E&&!O)return;const $=y.shape,x=c.at(`${M}.aim`)??c.at(`${M}.angular`),I={t:b.t,sourceId:y.sourceId,directionSaid:E,sizeSaid:O,...w.has(y.sourceId)?{phenomenon:w.get(y.sourceId)}:{},...$.aim?{aim:{azimuthDeg:$.aim.azimuthDeg,altitudeDeg:$.aim.altitudeDeg}}:{},...$.angular?{angular:$.angular}:{},...x?{basis:x.basis}:{},...x?.rationale?{rationale:s.read(x.rationale)??""}:{},...x?.source?{source:x.source}:{}};if(E&&$.aim){const L=(G,j,R)=>{const V=c.at(`${M}.aim.${R}`)??c.at(`${M}.aim`),q=g.law({kind:G,value:j,basis:V?.basis,how:V?.how},f);return[q.low??j,q.high??j]};I.uncertainty={azimuthDeg:L("heading",$.aim.azimuthDeg,"azimuthDeg"),altitudeDeg:L("elevation",$.aim.altitudeDeg,"altitudeDeg")}}e.indications.push(I)})),e}static readingOf(t,n,a,s,i,e,r){const c={...t.id?{id:t.id}:{},title:e.read(t.title)??e.read(a?.interpretation?.title)??n,url:n,reads:s?.title??"",by:A.names(t.by,e),...t.time?{time:t.time}:{},supposed:[],findings:[],comparisons:[],paths:[]};if(!a)return c;const{recording:o,provenance:u}=W.strip(a),p=e.read(o.description)??e.read(o.summary);p&&(c.description=p),c.supposed=A.valuesOf(u,o,(d,g)=>d.startsWith("interpretation")&&(g==="assumed"||g==="fitted"),e);const l=d=>typeof d=="string"?d:e.read(d)??"";if(c.findings=(o.interpretation?.findings??[]).map(d=>({text:l(d.text),outcome:d.outcome,...d.against?{against:d.against}:{},written:!0})),!i)return c;r&&c.findings.push(...r.findingsOf(i,a).map(d=>({text:l(d.text),outcome:d.outcome,...d.against?{against:d.against}:{},written:!1})));const m=o.interpretation?.bodies??[];if(m.length>0)try{const d=B.forAccount(i);c.sensitivity=d.of(m,u),c.comparisons=d.comparisons(m),c.paths=A.pathsOf(m,i,c.comparisons.map(g=>g.t))}catch{}return c}static pathsOf(t,n,a){const s=Q(n),i={heightAt:()=>0},e=r=>H.eyeOf(s,r,i);return t.filter(r=>(r.explains?.length??0)>0).map(r=>{const c=new H(r,i,e),u=[...new Set([...r.track.map(p=>p.t),...a])].sort((p,l)=>p-l).map(p=>({t:p,state:c.at(p)})).filter(p=>p.state!==void 0).map(({t:p,state:l})=>({t:p,eastM:l.eastM,northM:l.northM}));return{bodyId:r.id,points:u}}).filter(r=>r.points.length>0)}static placeOnMap(t,n){const a=t.find(s=>s.lat!==void 0&&s.lng!==void 0);if(a){for(const s of t){if(s.lat===void 0||s.lng===void 0)continue;const i=F(s.lat,s.lng,a.lat,a.lng);s.at={eastM:i.x,northM:-i.z}}for(const s of n){const i=t.find(e=>e.title===s.reads)?.at;if(!i){s.paths=[];continue}for(const e of s.paths)for(const r of e.points)r.eastM+=i.eastM,r.northM+=i.northM}}}static valuesOf(t,n,a,s){return t.paths().flatMap(i=>{const e=t.at(i);return a(i,e.basis)?[{path:i,value:i.split(".").reduce((r,c)=>r?.[c],n),basis:e.basis,...e.rationale?{rationale:s.read(e.rationale)??""}:{},...e.source?{source:e.source}:{}}]:[]})}static names(t,n){const a=s=>s.replace(/([a-z])([A-Z])/g,"$1 $2");return(t??[]).map(s=>{if("people"in s){const[e,...r]=a(s.people).split(" ");return[...r,e].join(" ")}if("org"in s)return a(s.org);const i=s;return n.read(i.title)??i.id??""}).filter(s=>s!=="")}}class X{constructor(t,n){this.texts=t,this.language=n,this.decimal=new Intl.NumberFormat(n,{maximumFractionDigits:1}),this.signed=new Intl.NumberFormat(n,{maximumFractionDigits:2,signDisplay:"exceptZero"})}decimal;signed;number(t){return t===void 0||!Number.isFinite(t)?"":this.decimal.format(t)}degrees(t){return t===void 0?"":`${this.number(t)}°`}azimuth(t){return t===void 0?"":this.degrees((t%360+360)%360)}instant(t){return`${this.number(t/1e3)} s`}amount(t,n){switch(t){case"azimuth":case"altitude":return`${this.signed.format(n)}°`;case"time":return`${this.signed.format(n/1e3)} s`;default:return`×${new Intl.NumberFormat(this.language,{maximumFractionDigits:2}).format(n)}`}}rests(t){const n=t.source;return[n?[n.said?`interview ${n.said.interview??""} #${n.said.segment}`.replace(" "," "):void 0,typeof n.document=="string"?n.document:void 0,n.at,n.picture,n.tool,n.url].filter(Boolean).join(", "):"",t.rationale].filter(s=>s&&s!=="").join(" : ")}value(t){const n=t.value;return typeof n=="number"?this.number(n):typeof n=="string"?n:Array.isArray(n)?`[${n.length}]`:n===void 0?"":JSON.stringify(n)}robustness(t){const n=this.texts.robustness;return!t||t.compared===0?{kind:"nothing",text:n.nothing}:B.measurable(t)?t.sufficient===!0?{kind:"sufficient",text:n.sufficient}:t.sufficient===!1?{kind:"fine-tuned",text:n.fineTuned.replace("{knob}",this.texts.knobs[t.margins[0].knob])}:{kind:"unjudged",text:n.unjudged}:{kind:"too-few",text:n.tooFew}}reproduced(t){return t&&t.compared>0?`${Math.round(t.agreement*t.compared)} / ${t.compared}`:""}ends(t){const n=(a,s)=>`${s?"≥ ":""}${this.amount(t.knob,a)}`;return{from:n(t.lower,t.lowerReached),to:n(t.upper,t.upperReached)}}fill(t,n){return t.replace(/\{(\w+)\}/g,(a,s)=>s in n?n[s]:a)}}class T{static FORMAT="ufoathome-case-report";static VERSION=1;static json(t,n){return JSON.stringify({format:T.FORMAT,version:T.VERSION,generator:`UFO@home ${n}`,...t},null,2)}static csv(t,n,a){const s=new X(n,a),i=n.columns,e=c=>c===void 0||!Number.isFinite(c)?"":String(Math.round(c*1e3)/1e3),r={};return r["indications.csv"]=T.table([i.witness,`${i.instant} (s)`,i.phenomenon,`${i.azimuth} (°)`,`${i.altitude} (°)`,`${i.azimuth} min`,`${i.azimuth} max`,`${i.altitude} min`,`${i.altitude} max`,`${i.size} (°)`,i.basis,i.rests],t.witnesses.flatMap(c=>c.indications.map(o=>[c.title,e(o.t/1e3),o.phenomenon??o.sourceId,e(o.aim?.azimuthDeg),e(o.aim?.altitudeDeg),e(o.uncertainty?.azimuthDeg[0]),e(o.uncertainty?.azimuthDeg[1]),e(o.uncertainty?.altitudeDeg[0]),e(o.uncertainty?.altitudeDeg[1]),o.sizeSaid?e(o.angular?.widthDeg):"",o.basis?n.bases[o.basis]:"",s.rests(o)]))),r["values.csv"]=T.table([i.witness,i.reading,i.path,i.value,i.basis,i.rests],[...t.witnesses.flatMap(c=>c.values.map(o=>[c.title,"",o.path,s.value(o),n.bases[o.basis],s.rests(o)])),...t.readings.flatMap(c=>c.supposed.map(o=>[c.reads,c.title,o.path,s.value(o),n.bases[o.basis],s.rests(o)]))]),r["readings.csv"]=T.table([i.reading,i.reads,i.by,i.time,i.reproduced,i.compared,`${i.gap} (°)`,i.robustness,i.supposedCount],t.readings.map(c=>[c.title,c.reads,c.by.join(", "),c.time??"",c.sensitivity&&c.sensitivity.compared>0?String(Math.round(c.sensitivity.agreement*c.sensitivity.compared)):"",c.sensitivity&&c.sensitivity.compared>0?String(c.sensitivity.compared):"",e(c.sensitivity?.medianSeparationDeg),s.robustness(c.sensitivity).text,String(c.supposed.length)])),r["margins.csv"]=T.table([i.reading,i.reads,i.knob,i.from,i.to,`${i.reference} min`,`${i.reference} max`,i.covered],t.readings.flatMap(c=>(c.sensitivity?.margins??[]).map(o=>[c.title,c.reads,n.knobs[o.knob],e(o.lower),e(o.upper),e(o.reference?.lower),e(o.reference?.upper),o.coverage===void 0?"":e(o.coverage)]))),r["comparisons.csv"]=T.table([i.reading,i.reads,`${i.instant} (s)`,i.phenomenon,`${i.said} ${i.azimuth}`,`${i.said} ${i.altitude}`,`${i.read} ${i.azimuth}`,`${i.read} ${i.altitude}`,`${i.separation} (°)`,i.agrees],t.readings.flatMap(c=>c.comparisons.map(o=>[c.title,c.reads,e(o.t/1e3),t.witnesses.find(u=>u.title===c.reads)?.phenomena?.[o.sourceId]??o.sourceId,e(o.said?.azimuthDeg),e(o.said?.altitudeDeg),e(o.predicted.azimuthDeg),e(o.predicted.altitudeDeg),e(o.separationDeg),o.agrees?n.yes:n.no]))),r["findings.csv"]=T.table([i.reading,i.reads,i.finding,i.outcome,i.against,i.origin],t.readings.flatMap(c=>c.findings.map(o=>[c.title,c.reads,o.text,n.outcomes[o.outcome],o.outcome==="fails"?n.grounds[o.against??"established"]:"",n.origins[o.written?"written":"computed"]]))),r}static table(t,n){const a=s=>/[",\r\n]/.test(s)?`"${s.replace(/"/g,'""')}"`:s;return[t,...n].map(s=>s.map(a).join(",")).join(`\r
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ShareDialogElement-Dlfy9NCE.js","./rr0-ufoathome.mjs","./Sighting-B7bsiTIQ.js","./VisualAids-DI-hEL46.js","./three.module-CbaHqYFq.js","./SaidPosition-OJEYhVKN.js","./GeoProjection-DvqDbRIx.js","./Decor-Dn-cvniW.js","./RecordingIssue-BlWT8Xsu.js","./xyzImageryRaster-Dhxs0B26.js","./Obstacles-v9SkfBD7.js"])))=>i.map(i=>d[i]);
2
+ import{P as W,M as Y,_ as Z,S as K}from"./rr0-ufoathome.mjs";import{aR as B,a7 as Q,aS as H,W as P,c as J,d as C}from"./ShareDialogElement-Dlfy9NCE.js";import{g as F}from"./GeoProjection-DvqDbRIx.js";import"./Sighting-B7bsiTIQ.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./SaidPosition-OJEYhVKN.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";class A{static of(t,n,a,s,i,e=new Date){const r=t.events??[],c=f=>f.url?new URL(f.url,n).href:void 0,o=r.filter(f=>f.eventType==="sighting"&&c(f)),u=o.filter(f=>f.interpretationOf===void 0),p=u.map(f=>A.witnessOf(f,c(f),a.get(c(f)),s)),l=f=>{const w=[f.interpretationOf].flat().filter(b=>typeof b=="string");return u.find(b=>b.id!==void 0&&w.includes(b.id))??u.find(b=>w.includes(a.get(c(b))?.id??""))},m=o.filter(f=>f.interpretationOf!==void 0).map(f=>{const w=l(f),b=w?p[u.indexOf(w)]:void 0;return A.readingOf(f,c(f),a.get(c(f)),b,w?a.get(c(w)):void 0,s,i)}),d=r.filter(f=>f.eventType==="interview").map(f=>{const w=u.find(b=>b.id!==void 0&&[f.interviewOf].flat().includes(b.id));return{title:s.read(f.title)??f.id??"",...w?{witness:p[u.indexOf(w)].title}:{},...f.time?{time:f.time}:{},by:A.names(f.by,s),...f.medium?{medium:f.medium}:{}}});A.placeOnMap(p,m);const g=s.read(t.summary);return{generatedAt:e.toISOString(),case:{...t.id?{id:t.id}:{},...t.title?{title:t.title}:{},...t.time?{time:t.time}:{},url:n,...g?{summary:g}:{}},witnesses:p,readings:m,interviews:d}}static witnessOf(t,n,a,s){const i=s.read(t.title)??s.read(a?.observer?.title)??t.id??n,e={...t.id?{id:t.id}:{},title:i,url:n,...t.time?{time:t.time}:{},indications:[],values:[],sources:[],moments:[]};if(!a)return e;const{recording:r,provenance:c}=W.strip(a),o=s.read(r.description);o&&(e.description=o);const u=r.place?.name;u&&(e.place=u),!e.time&&r.time&&(e.time=r.time),typeof r.durationSeconds=="number"&&(e.durationSeconds=r.durationSeconds),r.instrument&&(e.instrument=r.instrument),e.sources=(r.sources??[]).map(b=>{const v=b,y=s.read(v.title);return{...y?{title:y}:{},...v.authors?.length?{authors:v.authors}:{},...v.publication?.publisher?{publisher:v.publication.publisher}:{},...v.publication?.time?{time:v.publication.time}:{},...v.url?{url:v.url}:{},...v.index?{index:v.index}:{}}}),e.moments=[...r.milestones??[]].sort((b,v)=>b.t-v.t).map(b=>{const v=s.read(b.note);return{t:b.t,label:s.read(b.label)??"",...v?{note:v}:{}}});const p=r.observerTrack?.keyframes?.[0]?.pose,l=r.place?.locations?.[0],m=p?.lat??l?.lat,d=p?.lng??l?.lng;typeof m=="number"&&typeof d=="number"&&Object.assign(e,{lat:m,lng:d}),e.values=A.valuesOf(c,r,()=>!0,s);const g=P.MODELS[0],f=r.account?.conditions,w=new Map;for(const b of r.timeline?.keyframes??[])for(const v of b.shapes){const y=s.read(v.shape.title);y&&!w.has(v.sourceId)&&w.set(v.sourceId,y)}return e.phenomena=Object.fromEntries(w),(r.timeline?.keyframes??[]).forEach((b,v)=>b.shapes.forEach((y,h)=>{const M=`timeline.keyframes.${v}.shapes.${h}.shape`,E=B.traced(c,`${M}.aim`),O=B.traced(c,`${M}.angular`);if(!E&&!O)return;const $=y.shape,x=c.at(`${M}.aim`)??c.at(`${M}.angular`),I={t:b.t,sourceId:y.sourceId,directionSaid:E,sizeSaid:O,...w.has(y.sourceId)?{phenomenon:w.get(y.sourceId)}:{},...$.aim?{aim:{azimuthDeg:$.aim.azimuthDeg,altitudeDeg:$.aim.altitudeDeg}}:{},...$.angular?{angular:$.angular}:{},...x?{basis:x.basis}:{},...x?.rationale?{rationale:s.read(x.rationale)??""}:{},...x?.source?{source:x.source}:{}};if(E&&$.aim){const L=(G,j,R)=>{const V=c.at(`${M}.aim.${R}`)??c.at(`${M}.aim`),q=g.law({kind:G,value:j,basis:V?.basis,how:V?.how},f);return[q.low??j,q.high??j]};I.uncertainty={azimuthDeg:L("heading",$.aim.azimuthDeg,"azimuthDeg"),altitudeDeg:L("elevation",$.aim.altitudeDeg,"altitudeDeg")}}e.indications.push(I)})),e}static readingOf(t,n,a,s,i,e,r){const c={...t.id?{id:t.id}:{},title:e.read(t.title)??e.read(a?.interpretation?.title)??n,url:n,reads:s?.title??"",by:A.names(t.by,e),...t.time?{time:t.time}:{},supposed:[],findings:[],comparisons:[],paths:[]};if(!a)return c;const{recording:o,provenance:u}=W.strip(a),p=e.read(o.description)??e.read(o.summary);p&&(c.description=p),c.supposed=A.valuesOf(u,o,(d,g)=>d.startsWith("interpretation")&&(g==="assumed"||g==="fitted"),e);const l=d=>typeof d=="string"?d:e.read(d)??"";if(c.findings=(o.interpretation?.findings??[]).map(d=>({text:l(d.text),outcome:d.outcome,...d.against?{against:d.against}:{},written:!0})),!i)return c;r&&c.findings.push(...r.findingsOf(i,a).map(d=>({text:l(d.text),outcome:d.outcome,...d.against?{against:d.against}:{},written:!1})));const m=o.interpretation?.bodies??[];if(m.length>0)try{const d=B.forAccount(i);c.sensitivity=d.of(m,u),c.comparisons=d.comparisons(m),c.paths=A.pathsOf(m,i,c.comparisons.map(g=>g.t))}catch{}return c}static pathsOf(t,n,a){const s=Q(n),i={heightAt:()=>0},e=r=>H.eyeOf(s,r,i);return t.filter(r=>(r.explains?.length??0)>0).map(r=>{const c=new H(r,i,e),u=[...new Set([...r.track.map(p=>p.t),...a])].sort((p,l)=>p-l).map(p=>({t:p,state:c.at(p)})).filter(p=>p.state!==void 0).map(({t:p,state:l})=>({t:p,eastM:l.eastM,northM:l.northM}));return{bodyId:r.id,points:u}}).filter(r=>r.points.length>0)}static placeOnMap(t,n){const a=t.find(s=>s.lat!==void 0&&s.lng!==void 0);if(a){for(const s of t){if(s.lat===void 0||s.lng===void 0)continue;const i=F(s.lat,s.lng,a.lat,a.lng);s.at={eastM:i.x,northM:-i.z}}for(const s of n){const i=t.find(e=>e.title===s.reads)?.at;if(!i){s.paths=[];continue}for(const e of s.paths)for(const r of e.points)r.eastM+=i.eastM,r.northM+=i.northM}}}static valuesOf(t,n,a,s){return t.paths().flatMap(i=>{const e=t.at(i);return a(i,e.basis)?[{path:i,value:i.split(".").reduce((r,c)=>r?.[c],n),basis:e.basis,...e.rationale?{rationale:s.read(e.rationale)??""}:{},...e.source?{source:e.source}:{}}]:[]})}static names(t,n){const a=s=>s.replace(/([a-z])([A-Z])/g,"$1 $2");return(t??[]).map(s=>{if("people"in s){const[e,...r]=a(s.people).split(" ");return[...r,e].join(" ")}if("org"in s)return a(s.org);const i=s;return n.read(i.title)??i.id??""}).filter(s=>s!=="")}}class X{constructor(t,n){this.texts=t,this.language=n,this.decimal=new Intl.NumberFormat(n,{maximumFractionDigits:1}),this.signed=new Intl.NumberFormat(n,{maximumFractionDigits:2,signDisplay:"exceptZero"})}decimal;signed;number(t){return t===void 0||!Number.isFinite(t)?"":this.decimal.format(t)}degrees(t){return t===void 0?"":`${this.number(t)}°`}azimuth(t){return t===void 0?"":this.degrees((t%360+360)%360)}instant(t){return`${this.number(t/1e3)} s`}amount(t,n){switch(t){case"azimuth":case"altitude":return`${this.signed.format(n)}°`;case"time":return`${this.signed.format(n/1e3)} s`;default:return`×${new Intl.NumberFormat(this.language,{maximumFractionDigits:2}).format(n)}`}}rests(t){const n=t.source;return[n?[n.said?`interview ${n.said.interview??""} #${n.said.segment}`.replace(" "," "):void 0,typeof n.document=="string"?n.document:void 0,n.at,n.picture,n.tool,n.url].filter(Boolean).join(", "):"",t.rationale].filter(s=>s&&s!=="").join(" : ")}value(t){const n=t.value;return typeof n=="number"?this.number(n):typeof n=="string"?n:Array.isArray(n)?`[${n.length}]`:n===void 0?"":JSON.stringify(n)}robustness(t){const n=this.texts.robustness;return!t||t.compared===0?{kind:"nothing",text:n.nothing}:B.measurable(t)?t.sufficient===!0?{kind:"sufficient",text:n.sufficient}:t.sufficient===!1?{kind:"fine-tuned",text:n.fineTuned.replace("{knob}",this.texts.knobs[t.margins[0].knob])}:{kind:"unjudged",text:n.unjudged}:{kind:"too-few",text:n.tooFew}}reproduced(t){return t&&t.compared>0?`${Math.round(t.agreement*t.compared)} / ${t.compared}`:""}ends(t){const n=(a,s)=>`${s?"≥ ":""}${this.amount(t.knob,a)}`;return{from:n(t.lower,t.lowerReached),to:n(t.upper,t.upperReached)}}fill(t,n){return t.replace(/\{(\w+)\}/g,(a,s)=>s in n?n[s]:a)}}class T{static FORMAT="ufoathome-case-report";static VERSION=1;static json(t,n){return JSON.stringify({format:T.FORMAT,version:T.VERSION,generator:`UFO@home ${n}`,...t},null,2)}static csv(t,n,a){const s=new X(n,a),i=n.columns,e=c=>c===void 0||!Number.isFinite(c)?"":String(Math.round(c*1e3)/1e3),r={};return r["indications.csv"]=T.table([i.witness,`${i.instant} (s)`,i.phenomenon,`${i.azimuth} (°)`,`${i.altitude} (°)`,`${i.azimuth} min`,`${i.azimuth} max`,`${i.altitude} min`,`${i.altitude} max`,`${i.size} (°)`,i.basis,i.rests],t.witnesses.flatMap(c=>c.indications.map(o=>[c.title,e(o.t/1e3),o.phenomenon??o.sourceId,e(o.aim?.azimuthDeg),e(o.aim?.altitudeDeg),e(o.uncertainty?.azimuthDeg[0]),e(o.uncertainty?.azimuthDeg[1]),e(o.uncertainty?.altitudeDeg[0]),e(o.uncertainty?.altitudeDeg[1]),o.sizeSaid?e(o.angular?.widthDeg):"",o.basis?n.bases[o.basis]:"",s.rests(o)]))),r["values.csv"]=T.table([i.witness,i.reading,i.path,i.value,i.basis,i.rests],[...t.witnesses.flatMap(c=>c.values.map(o=>[c.title,"",o.path,s.value(o),n.bases[o.basis],s.rests(o)])),...t.readings.flatMap(c=>c.supposed.map(o=>[c.reads,c.title,o.path,s.value(o),n.bases[o.basis],s.rests(o)]))]),r["readings.csv"]=T.table([i.reading,i.reads,i.by,i.time,i.reproduced,i.compared,`${i.gap} (°)`,i.robustness,i.supposedCount],t.readings.map(c=>[c.title,c.reads,c.by.join(", "),c.time??"",c.sensitivity&&c.sensitivity.compared>0?String(Math.round(c.sensitivity.agreement*c.sensitivity.compared)):"",c.sensitivity&&c.sensitivity.compared>0?String(c.sensitivity.compared):"",e(c.sensitivity?.medianSeparationDeg),s.robustness(c.sensitivity).text,String(c.supposed.length)])),r["margins.csv"]=T.table([i.reading,i.reads,i.knob,i.from,i.to,`${i.reference} min`,`${i.reference} max`,i.covered],t.readings.flatMap(c=>(c.sensitivity?.margins??[]).map(o=>[c.title,c.reads,n.knobs[o.knob],e(o.lower),e(o.upper),e(o.reference?.lower),e(o.reference?.upper),o.coverage===void 0?"":e(o.coverage)]))),r["comparisons.csv"]=T.table([i.reading,i.reads,`${i.instant} (s)`,i.phenomenon,`${i.said} ${i.azimuth}`,`${i.said} ${i.altitude}`,`${i.read} ${i.azimuth}`,`${i.read} ${i.altitude}`,`${i.separation} (°)`,i.agrees],t.readings.flatMap(c=>c.comparisons.map(o=>[c.title,c.reads,e(o.t/1e3),t.witnesses.find(u=>u.title===c.reads)?.phenomena?.[o.sourceId]??o.sourceId,e(o.said?.azimuthDeg),e(o.said?.altitudeDeg),e(o.predicted.azimuthDeg),e(o.predicted.altitudeDeg),e(o.separationDeg),o.agrees?n.yes:n.no]))),r["findings.csv"]=T.table([i.reading,i.reads,i.finding,i.outcome,i.against,i.origin],t.readings.flatMap(c=>c.findings.map(o=>[c.title,c.reads,o.text,n.outcomes[o.outcome],o.outcome==="fails"?n.grounds[o.against??"established"]:"",n.origins[o.written?"written":"computed"]]))),r}static table(t,n){const a=s=>/[",\r\n]/.test(s)?`"${s.replace(/"/g,'""')}"`:s;return[t,...n].map(s=>s.map(a).join(",")).join(`\r
3
3
  `)+`\r
4
4
  `}}class D{static COLOURS=["#c2410c","#1d4ed8","#15803d","#7e22ce","#b91c1c","#0f766e"];static WIDTH=640;static HEIGHT=320;static MARGIN={left:44,right:12,top:12,bottom:34};static svg(t,n,a){const s=t.indications.filter(h=>h.directionSaid&&h.aim);if(s.length===0)return;const i=D.circularMean(s.map(h=>h.aim.azimuthDeg)),e=h=>i+((h-i)%360+540)%360-180,r=[];for(const h of s){const{azimuthDeg:M,altitudeDeg:E}=h.uncertainty??{azimuthDeg:[h.aim.azimuthDeg,h.aim.azimuthDeg],altitudeDeg:[h.aim.altitudeDeg,h.aim.altitudeDeg]};r.push({x:e(h.aim.azimuthDeg),y:h.aim.altitudeDeg}),r.push({x:e(h.aim.azimuthDeg)+(M[0]-h.aim.azimuthDeg),y:E[0]}),r.push({x:e(h.aim.azimuthDeg)+(M[1]-h.aim.azimuthDeg),y:E[1]})}for(const h of n)for(const M of h.comparisons)r.push({x:e(M.predicted.azimuthDeg),y:M.predicted.altitudeDeg});const c=r.map(h=>h.x),o=r.map(h=>h.y),[u,p]=D.padded(Math.min(...c),Math.max(...c),10),[l,m]=D.padded(Math.max(-10,Math.min(...o)),Math.min(90,Math.max(...o)),5),d=D.MARGIN,g=D.WIDTH-d.left-d.right,f=D.HEIGHT-d.top-d.bottom,w=h=>d.left+(h-u)/(p-u)*g,b=h=>d.top+(1-(h-l)/(m-l))*f,v=h=>Math.round(h*10)/10,y=[];for(const h of D.ticks(u,p))y.push(`<line x1="${v(w(h))}" y1="${d.top}" x2="${v(w(h))}" y2="${d.top+f}" class="grid"/>`),y.push(`<text x="${v(w(h))}" y="${d.top+f+14}" text-anchor="middle" class="tick">${a.number((h%360+360)%360)}°</text>`);for(const h of D.ticks(l,m))y.push(`<line x1="${d.left}" y1="${v(b(h))}" x2="${d.left+g}" y2="${v(b(h))}" class="${h===0?"horizon":"grid"}"/>`),y.push(`<text x="${d.left-6}" y="${v(b(h))+4}" text-anchor="end" class="tick">${a.number(h)}°</text>`);y.push(`<text x="${d.left+g/2}" y="${D.HEIGHT-4}" text-anchor="middle" class="axis">${a.texts.azimuth}</text>`),y.push(`<text x="12" y="${d.top+f/2}" text-anchor="middle" class="axis" transform="rotate(-90 12 ${d.top+f/2})">${a.texts.altitude}</text>`);for(const h of s){const M=h.uncertainty;if(!M)continue;const E=e(h.aim.azimuthDeg),O=w(E+M.azimuthDeg[0]-h.aim.azimuthDeg),$=w(E+M.azimuthDeg[1]-h.aim.azimuthDeg);y.push(`<rect x="${v(Math.min(O,$))}" y="${v(b(M.altitudeDeg[1]))}" width="${v(Math.abs($-O))}" height="${v(Math.max(1,b(M.altitudeDeg[0])-b(M.altitudeDeg[1])))}" class="uncertainty"/>`)}n.forEach((h,M)=>{const E=D.COLOURS[M%D.COLOURS.length];for(const O of h.comparisons){const $=w(e(O.predicted.azimuthDeg)),x=b(O.predicted.altitudeDeg);O.said&&y.push(`<line x1="${v(w(e(O.said.azimuthDeg)))}" y1="${v(b(O.said.altitudeDeg))}" x2="${v($)}" y2="${v(x)}" stroke="${E}" class="gap"/>`),y.push(D.mark(M,$,x,E,O.agrees))}});for(const h of s)y.push(`<circle cx="${v(w(e(h.aim.azimuthDeg)))}" cy="${v(b(h.aim.altitudeDeg))}" r="4" class="said"><title>${a.instant(h.t)}</title></circle>`);return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${D.WIDTH} ${D.HEIGHT}" role="img" class="sky">${y.join("")}</svg>`}static mark(t,n,a,s,i){const r=o=>Math.round(o*10)/10,c=i?s:"none";switch(t%3){case 0:return`<path d="M${r(n-5)} ${r(a-5)}L${r(n+5)} ${r(a+5)}M${r(n-5)} ${r(a+5)}L${r(n+5)} ${r(a-5)}" stroke="${s}" stroke-width="${i?2.4:1.2}"/>`;case 1:return`<rect x="${r(n-5)}" y="${r(a-5)}" width="10" height="10" stroke="${s}" fill="${c}" stroke-width="1.4"/>`;default:return`<path d="M${r(n)} ${r(a-5-1)}L${r(n+5+1)} ${r(a+5)}L${r(n-5-1)} ${r(a+5)}Z" stroke="${s}" fill="${c}" stroke-width="1.4"/>`}}static legendMark(t){const n=D.COLOURS[t%D.COLOURS.length];return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14" aria-hidden="true">${D.mark(t,7,7,n,!0)}</svg>`}static circularMean(t){const n=Math.PI/180,a=t.reduce((i,e)=>i+Math.cos(e*n),0),s=t.reduce((i,e)=>i+Math.sin(e*n),0);return Math.atan2(s,a)/n}static padded(t,n,a){const s=Math.max(n-t,a),i=(t+n)/2;return[i-s/2-s*.08,i+s/2+s*.08]}static ticks(t,n){const a=n-t,s=[1,2,5,10,15,20,30,45,90].find(e=>a/e<=10)??90,i=[];for(let e=Math.ceil(t/s)*s;e<=n;e+=s)i.push(e);return i}}class k{static SIZE=520;static count=0;static MARGIN=28;static svg(t,n,a){const s=t.filter($=>$.at);if(s.length===0)return;const i=n.filter($=>$.paths.length>0),e=[...s.map($=>$.at),...i.flatMap($=>$.paths.flatMap(x=>x.points))],r=e.map($=>$.eastM),c=e.map($=>$.northM),o=Math.max(200,Math.max(...r)-Math.min(...r),Math.max(...c)-Math.min(...c))*1.25,u=(Math.max(...r)+Math.min(...r))/2,p=(Math.max(...c)+Math.min(...c))/2,l=k.SIZE-2*k.MARGIN,m=$=>k.MARGIN+($-u+o/2)/o*l,d=$=>k.MARGIN+(1-($-p+o/2)/o)*l,g=$=>Math.round($*10)/10,f=o*.75,w=Math.PI/180,b=($,x)=>({eastM:$.eastM+f*Math.sin(x*w),northM:$.northM+f*Math.cos(x*w)}),v=`plan-clip-${k.count++}`,y=[`<defs><clipPath id="${v}"><rect x="${k.MARGIN}" y="${k.MARGIN}" width="${l}" height="${l}"/></clipPath></defs>`,`<rect x="${k.MARGIN}" y="${k.MARGIN}" width="${l}" height="${l}" class="frame"/>`,`<g clip-path="url(#${v})">`];for(const $ of s)for(const x of $.indications){if(!x.directionSaid||!x.aim)continue;const I=$.at,L=x.uncertainty?.azimuthDeg;if(L&&L[1]-L[0]<180){const j=b(I,L[0]),R=b(I,L[1]);y.push(`<path d="M${g(m(I.eastM))} ${g(d(I.northM))}L${g(m(j.eastM))} ${g(d(j.northM))}L${g(m(R.eastM))} ${g(d(R.northM))}Z" class="fan"/>`)}const G=b(I,x.aim.azimuthDeg);y.push(`<line x1="${g(m(I.eastM))}" y1="${g(d(I.northM))}" x2="${g(m(G.eastM))}" y2="${g(d(G.northM))}" class="sight"><title>${a.instant(x.t)}</title></line>`)}i.forEach($=>{const x=D.COLOURS[n.indexOf($)%D.COLOURS.length];for(const I of $.paths){const L=I.points.map((j,R)=>`${R===0?"M":"L"}${g(m(j.eastM))} ${g(d(j.northM))}`).join("");y.push(`<path d="${L}" stroke="${x}" class="track"/>`);const G=I.points[I.points.length-1];y.push(`<circle cx="${g(m(G.eastM))}" cy="${g(d(G.northM))}" r="2.5" fill="${x}"/>`)}}),y.push("</g>");const h=[];for(const $ of s){const x=h.find(I=>Math.hypot(I.at.eastM-$.at.eastM,I.at.northM-$.at.northM)<o/100);x?x.names.push($.title):h.push({at:$.at,names:[$.title]})}for(const $ of h)y.push(`<circle cx="${g(m($.at.eastM))}" cy="${g(d($.at.northM))}" r="4.5" class="witness"/>`),y.push(`<text x="${g(m($.at.eastM)+7)}" y="${g(d($.at.northM)-7)}" class="name">${k.escape($.names.join(", "))}</text>`);const M=k.round(o/5),E=M/o*l,O=k.SIZE-10;return y.push(`<line x1="${k.MARGIN}" y1="${O}" x2="${g(k.MARGIN+E)}" y2="${O}" class="scale"/>`),y.push(`<text x="${g(k.MARGIN+E+6)}" y="${O+4}" class="tick">${k.escape(a.fill(a.texts.scale,{metres:a.number(M)}))}</text>`),y.push(`<path d="M${k.SIZE-18} 34L${k.SIZE-12} 18L${k.SIZE-6} 34Z" class="north"/><text x="${k.SIZE-12}" y="14" text-anchor="middle" class="tick">N</text>`),`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${k.SIZE} ${k.SIZE}" role="img" class="plan">${y.join("")}</svg>`}static round(t){const n=10**Math.floor(Math.log10(t));return[5,2,1].map(a=>a*n).find(a=>a<=t)??n}static escape(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}}class S{static WIDTH=640;static HEIGHT=74;static LEFT=16;static RIGHT=16;static svg(t,n){const a=t.indications.map(l=>l.t),s=t.moments;if(a.length===0&&s.length===0)return;const i=Math.max(1e3,(t.durationSeconds??0)*1e3,...a,...s.map(l=>l.t)),e=S.WIDTH-S.LEFT-S.RIGHT,r=l=>S.LEFT+l/i*e,c=l=>Math.round(l*10)/10,o=40,u=[`<line x1="${S.LEFT}" y1="${o}" x2="${S.LEFT+e}" y2="${o}" class="axis-line"/>`],p=[.5,1,2,5,10,15,30,60,120,300,600].find(l=>i/1e3/l<=10)??600;for(let l=0;l*1e3<=i;l+=p)u.push(`<line x1="${c(r(l*1e3))}" y1="${o-3}" x2="${c(r(l*1e3))}" y2="${o+3}" class="axis-line"/>`),u.push(`<text x="${c(r(l*1e3))}" y="${o+16}" text-anchor="middle" class="tick">${n.instant(l*1e3)}</text>`);for(const l of s)u.push(`<line x1="${c(r(l.t))}" y1="8" x2="${c(r(l.t))}" y2="${o}" class="moment"/>`),u.push(`<text x="${c(r(l.t)+3)}" y="16" class="moment-label">${S.escape(l.label)}${l.note?`<title>${S.escape(l.note)}</title>`:""}</text>`);for(const l of a)u.push(`<circle cx="${c(r(l))}" cy="${o}" r="3.5" class="said"><title>${n.instant(l)}</title></circle>`);return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${S.WIDTH} ${S.HEIGHT}" role="img" class="timeline">${u.join("")}</svg>`}static escape(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}}class z{static CSS=`
5
5
  :root { color-scheme: light; --ink: #1b1d22; --dim: #5b6070; --line: #d6d9e0; --ok: #15803d; --warn: #b45309; --error: #b91c1c; }
@@ -63,4 +63,4 @@ ${o.join(`
63
63
  `)}
64
64
  </body>
65
65
  </html>
66
- `}static comparedTable(t,n){const a=n.texts.columns,s=z.escape;return z.table([a.reading,a.reads,a.reproduced,a.gap,a.robustness,a.supposedCount],t.readings.map(i=>{const e=n.robustness(i.sensitivity);return[s(i.title),s(i.reads),`<span class="n">${n.reproduced(i.sensitivity)}</span>`,n.degrees(i.sensitivity?.medianSeparationDeg),`<span class="${e.kind}">${s(e.text)}</span>`,String(i.supposed.length)]}),[2,3,5])}static witness(t,n,a){const s=a.texts,i=s.columns,e=z.escape,r=[`<h3>${e(a.fill(s.witnessHeading,{witness:t.title}))}</h3>`],o=[[s.columns.time,t.time??""],[s.place,t.place??""],[s.duration,t.durationSeconds!==void 0?a.instant(t.durationSeconds*1e3):""],[s.instrument,t.instrument??""]].filter(([,m])=>m!=="");o.length&&r.push(`<dl class="facts">${o.map(([m,d])=>`<dt>${e(m)}</dt><dd>${e(d)}</dd>`).join("")}</dl>`),t.description&&r.push(`<h4>${e(s.account)}</h4>`,`<blockquote>${e(t.description)}</blockquote>`),t.sources.length&&r.push(`<h4>${e(s.sources)}</h4>`,`<ul class="sources">${t.sources.map(m=>`<li>${[m.authors?.join(", "),m.title?`<em>${e(m.title)}</em>`:"",m.publisher,m.time,m.index].filter(Boolean).map(g=>g.startsWith("<em>")?g:e(g)).join(", ")}${m.url?` <a href="${e(m.url)}">${e(m.url)}</a>`:""}</li>`).join("")}</ul>`);const u=S.svg(t,a);u&&r.push(`<figure>${u}<figcaption>${e(s.timelineCaption)}</figcaption></figure>`),n=n.filter(m=>m.comparisons.length>0);const p=D.svg(t,n,a);if(p){const m=[`<li><svg viewBox="0 0 14 14" width="14" height="14" aria-hidden="true"><circle cx="7" cy="7" r="4" fill="#111827"/></svg>${e(s.saidLegend)}</li>`,...n.map((d,g)=>`<li>${D.legendMark(g)}${e(d.title)}</li>`)];r.push(`<figure>${p}<ul class="legend">${m.join("")}</ul><figcaption>${e(s.figureCaption)}</figcaption></figure>`)}if(t.pictures?.length){const m=t.pictures[0].views.map(d=>d.label);r.push(`<h4>${e(s.pictures)}</h4>`,`<div class="scroll"><table class="pictures"><thead><tr><th scope="col">${e(s.columns.instant)}</th>${m.map(d=>`<th scope="col">${e(d)}</th>`).join("")}</tr></thead><tbody>${t.pictures.map(d=>`<tr><td class="n">${a.instant(d.t)}</td>${d.views.map(g=>`<td>${g.image?`<img src="${g.image}" alt="${e(g.label)}, ${a.instant(d.t)}">`:`<span class="nothing">${e(s.noPicture)}</span>`}</td>`).join("")}</tr>`).join("")}</tbody></table></div>`,`<p class="caption">${e(s.picturesCaption)}</p>`)}r.push(`<h4>${e(s.indications)}</h4>`),t.indications.length===0?r.push(`<p>${e(s.noIndication)}</p>`):r.push(z.table([i.instant,i.phenomenon,i.azimuth,i.altitude,i.uncertainty,i.size,i.basis,i.rests],t.indications.map(m=>{const d=m.uncertainty;return[a.instant(m.t),e(m.phenomenon??m.sourceId),m.directionSaid?a.azimuth(m.aim?.azimuthDeg):"",m.directionSaid?a.degrees(m.aim?.altitudeDeg):"",d?`${a.azimuth(d.azimuthDeg[0])} … ${a.azimuth(d.azimuthDeg[1])} ; ${a.degrees(d.altitudeDeg[0])} … ${a.degrees(d.altitudeDeg[1])}`:"",m.sizeSaid?a.degrees(m.angular?.widthDeg):"",m.basis?e(s.bases[m.basis]):"",e(a.rests(m))]}),[0,2,3,5]));const l=t.values.filter(m=>!/^timeline\.keyframes\.\d+\.shapes\.\d+\.shape\.(aim|angular)/.test(m.path));return l.length>0&&r.push(`<h4>${e(s.values)}</h4>`,z.valuesTable(l,a)),r}static reading(t,n,a){const s=a.texts,i=s.columns,e=z.escape,r=[`<h2>${e(a.fill(s.readingHeading,{title:t.title,witness:t.reads}))}</h2>`],c=[t.by.length?a.fill(s.by,{names:t.by.join(", ")}):"",t.time?a.fill(s.made,{time:t.time}):""].filter(Boolean).join(" ");c&&r.push(`<p class="meta">${e(c)}</p>`),t.description&&r.push(`<blockquote>${e(t.description)}</blockquote>`),r.push(`<h4>${e(s.supposed)}</h4>`,t.supposed.length?z.valuesTable(t.supposed,a):`<p>${e(s.noneSupposed)}</p>`),r.push(`<h4>${e(s.findings)}</h4>`),r.push(t.findings.length?z.table([i.finding,i.outcome,i.against,i.origin],t.findings.map(u=>[e(u.text),`<span class="${u.outcome}">${e(s.outcomes[u.outcome])}</span>`,u.outcome==="fails"?e(s.grounds[u.against??"established"]):"",e(s.origins[u.written?"written":"computed"])])):`<p>${e(s.noFinding)}</p>`);const o=t.sensitivity;if(o){const u=a.robustness(o);if(r.push(`<h4>${e(s.sensitivity)}</h4>`,`<p>${e(i.reproduced)} : ${a.reproduced(o)||"–"} · ${e(i.gap)} : ${a.degrees(o.medianSeparationDeg)||"–"} · <span class="${u.kind}">${e(u.text)}</span></p>`),u.kind!=="too-few"&&u.kind!=="nothing"&&o.margins.length>0&&r.push(z.table([i.knob,i.from,i.to,i.reference,i.covered],o.margins.map(p=>{const l=a.ends(p),m=p.reference?`${a.amount(p.knob,p.reference.lower)} … ${a.amount(p.knob,p.reference.upper)}`:s.noLaw;return[e(s.knobs[p.knob]),l.from,l.to,e(m),p.coverage===void 0?"":`${Math.round(p.coverage*100)} %`]}),[1,2,4])),o.better){const{knob:p,amount:l,agreement:m}=o.better;r.push(`<p class="fine-tuned">${e(a.fill(s.better,{knob:s.knobs[p],amount:a.amount(p,l),agreed:String(Math.round(m*o.compared)),compared:String(o.compared)}))}</p>`)}}return t.comparisons.length>0&&r.push(`<h4>${e(s.comparisons)}</h4>`,z.table([i.instant,i.phenomenon,`${i.said} (${i.azimuth}, ${i.altitude})`,`${i.read} (${i.azimuth}, ${i.altitude})`,i.separation,i.agrees],t.comparisons.map(u=>[a.instant(u.t),e(n?.phenomena?.[u.sourceId]??u.sourceId),u.said?`${a.azimuth(u.said.azimuthDeg)}, ${a.degrees(u.said.altitudeDeg)}`:"",`${a.azimuth(u.predicted.azimuthDeg)}, ${a.degrees(u.predicted.altitudeDeg)}`,a.degrees(u.separationDeg),`<span class="${u.agrees?"holds":"fails"}">${e(u.agrees?s.yes:s.no)}</span>`]),[0,4])),r}static valuesTable(t,n){const a=n.texts,s=a.columns,i=z.escape;return z.table([s.path,s.value,s.basis,s.rests],t.map(e=>[`<code>${i(e.path)}</code>`,i(n.value(e)),i(a.bases[e.basis]),i(n.rests(e))]))}static table(t,n,a=[]){const s=z.escape,i=`<tr>${t.map(r=>`<th scope="col">${s(r)}</th>`).join("")}</tr>`,e=n.map(r=>`<tr>${r.map((c,o)=>`<td${a.includes(o)?' class="n"':""}>${c}</td>`).join("")}</tr>`);return`<div class="scroll"><table><thead>${i}</thead><tbody>${e.join("")}</tbody></table></div>`}static escape(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}}const _=Y.catalog({en:()=>Z(()=>import("./CaseReportTexts_en-DlN7p1pC.js"),[],import.meta.url).then(N=>N.caseReportTexts_en),fr:()=>Z(()=>import("./CaseReportTexts_fr-B5nP6RlP.js"),[],import.meta.url).then(N=>N.caseReportTexts_fr),es:()=>Z(()=>import("./CaseReportTexts_es-CncAEaey.js"),[],import.meta.url).then(N=>N.caseReportTexts_es),it:()=>Z(()=>import("./CaseReportTexts_it-Dc-oPmXB.js"),[],import.meta.url).then(N=>N.caseReportTexts_it)});class U{static async make(t,n,a,s,i=!1,e){const[r,c]=await Promise.all([_.load(a),J.load(a)]),o=A.of(n.caseJson,n.caseUrl,n.recordings,new K([...s]),new C(c));i&&t!=="csv"&&await U.pictures(o,n,r,e);const u=`${n.caseJson.id??"case"}-report`;switch(t){case"html":U.download(new Blob([z.of(o,r,a,"0.201.0")],{type:"text/html"}),`${u}.html`);return;case"print":U.print(z.of(o,r,a,"0.201.0"));return;case"json":U.download(new Blob([T.json(o,"0.201.0")],{type:"application/json"}),`${u}.json`);return;case"csv":{const{zipSync:p,strToU8:l}=await Z(async()=>{const{zipSync:d,strToU8:g}=await import("./browser-CltifEM0.js");return{zipSync:d,strToU8:g}},[],import.meta.url),m=Object.fromEntries(Object.entries(T.csv(o,r,a)).map(([d,g])=>[d,l(`\uFEFF${g}`)]));U.download(new Blob([p(m)],{type:"application/zip"}),`${u}-tables.zip`)}}}static PICTURED_INSTANTS=3;static async pictures(t,n,a,s){const{registerScene:i,SCENE_ELEMENT_NAME:e}=await Z(async()=>{const{registerScene:p,SCENE_ELEMENT_NAME:l}=await import("./ShareDialogElement-CBeU9ChH.js").then(m=>m.bC);return{registerScene:p,SCENE_ELEMENT_NAME:l}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url);i();const r=t.witnesses.map(p=>{const l=p.indications.filter(f=>f.directionSaid).map(f=>f.t),m=l.length<=U.PICTURED_INSTANTS?l:[l[0],l[Math.floor(l.length/2)],l[l.length-1]],d=t.readings.filter(f=>f.reads===p.title&&f.comparisons.length>0),g=[{label:a.accountView,url:p.url,reading:void 0},...d.map(f=>({label:f.title,url:p.url,reading:f.url}))];return{witness:p,instants:[...new Set(m)],recordings:g}}).filter(p=>p.instants.length>0),c=r.reduce((p,l)=>p+l.instants.length*l.recordings.length,0);if(c===0)return;const o=document.createElement(e);o.setAttribute("max-pixel-ratio","1"),o.setAttribute("always-live",""),Object.assign(o.style,{position:"fixed",left:"-10000px",top:"0",width:"640px",height:"360px",visibility:"hidden",pointerEvents:"none"}),document.body.appendChild(o);let u=0;s?.(u,c);try{for(const p of r){const l=p.instants.map(d=>({t:d,views:[]})),m=n.recordings.get(p.witness.url);m&&(o.documentUrl=p.witness.url,o.sightingData=m);for(const d of p.recordings){const g=m,f=d.reading?n.recordings.get(d.reading):void 0;for(const w of l){let b;g&&(!d.reading||f)&&(w===l[0]&&(o.interpretation=U.bodiesOf(f??g,d.reading??p.witness.url)),b=await o.pictureAt(w.t,480).catch(()=>{})),w.views.push({label:d.label,...b?{image:b}:{}}),s?.(++u,c)}}p.witness.pictures=l}}finally{o.remove()}}static bodiesOf(t,n){const a=W.strip(t).recording.interpretation;if(a)return{...a,bodies:a.bodies.map(s=>s.model?.url?{...s,model:{...s.model,url:new URL(s.model.url,n).href}}:s)}}static print(t){const n=document.createElement("iframe");n.setAttribute("aria-hidden","true"),n.style.cssText="position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0",n.addEventListener("load",()=>{const a=n.contentWindow;a&&(a.addEventListener("afterprint",()=>n.remove()),a.focus(),a.print(),window.setTimeout(()=>n.remove(),6e4))},{once:!0}),n.srcdoc=t,document.body.append(n)}static download(t,n){const a=URL.createObjectURL(t),s=document.createElement("a");s.href=a,s.download=n,s.click(),window.setTimeout(()=>URL.revokeObjectURL(a),1e3)}}export{U as CaseReportExport};
66
+ `}static comparedTable(t,n){const a=n.texts.columns,s=z.escape;return z.table([a.reading,a.reads,a.reproduced,a.gap,a.robustness,a.supposedCount],t.readings.map(i=>{const e=n.robustness(i.sensitivity);return[s(i.title),s(i.reads),`<span class="n">${n.reproduced(i.sensitivity)}</span>`,n.degrees(i.sensitivity?.medianSeparationDeg),`<span class="${e.kind}">${s(e.text)}</span>`,String(i.supposed.length)]}),[2,3,5])}static witness(t,n,a){const s=a.texts,i=s.columns,e=z.escape,r=[`<h3>${e(a.fill(s.witnessHeading,{witness:t.title}))}</h3>`],o=[[s.columns.time,t.time??""],[s.place,t.place??""],[s.duration,t.durationSeconds!==void 0?a.instant(t.durationSeconds*1e3):""],[s.instrument,t.instrument??""]].filter(([,m])=>m!=="");o.length&&r.push(`<dl class="facts">${o.map(([m,d])=>`<dt>${e(m)}</dt><dd>${e(d)}</dd>`).join("")}</dl>`),t.description&&r.push(`<h4>${e(s.account)}</h4>`,`<blockquote>${e(t.description)}</blockquote>`),t.sources.length&&r.push(`<h4>${e(s.sources)}</h4>`,`<ul class="sources">${t.sources.map(m=>`<li>${[m.authors?.join(", "),m.title?`<em>${e(m.title)}</em>`:"",m.publisher,m.time,m.index].filter(Boolean).map(g=>g.startsWith("<em>")?g:e(g)).join(", ")}${m.url?` <a href="${e(m.url)}">${e(m.url)}</a>`:""}</li>`).join("")}</ul>`);const u=S.svg(t,a);u&&r.push(`<figure>${u}<figcaption>${e(s.timelineCaption)}</figcaption></figure>`),n=n.filter(m=>m.comparisons.length>0);const p=D.svg(t,n,a);if(p){const m=[`<li><svg viewBox="0 0 14 14" width="14" height="14" aria-hidden="true"><circle cx="7" cy="7" r="4" fill="#111827"/></svg>${e(s.saidLegend)}</li>`,...n.map((d,g)=>`<li>${D.legendMark(g)}${e(d.title)}</li>`)];r.push(`<figure>${p}<ul class="legend">${m.join("")}</ul><figcaption>${e(s.figureCaption)}</figcaption></figure>`)}if(t.pictures?.length){const m=t.pictures[0].views.map(d=>d.label);r.push(`<h4>${e(s.pictures)}</h4>`,`<div class="scroll"><table class="pictures"><thead><tr><th scope="col">${e(s.columns.instant)}</th>${m.map(d=>`<th scope="col">${e(d)}</th>`).join("")}</tr></thead><tbody>${t.pictures.map(d=>`<tr><td class="n">${a.instant(d.t)}</td>${d.views.map(g=>`<td>${g.image?`<img src="${g.image}" alt="${e(g.label)}, ${a.instant(d.t)}">`:`<span class="nothing">${e(s.noPicture)}</span>`}</td>`).join("")}</tr>`).join("")}</tbody></table></div>`,`<p class="caption">${e(s.picturesCaption)}</p>`)}r.push(`<h4>${e(s.indications)}</h4>`),t.indications.length===0?r.push(`<p>${e(s.noIndication)}</p>`):r.push(z.table([i.instant,i.phenomenon,i.azimuth,i.altitude,i.uncertainty,i.size,i.basis,i.rests],t.indications.map(m=>{const d=m.uncertainty;return[a.instant(m.t),e(m.phenomenon??m.sourceId),m.directionSaid?a.azimuth(m.aim?.azimuthDeg):"",m.directionSaid?a.degrees(m.aim?.altitudeDeg):"",d?`${a.azimuth(d.azimuthDeg[0])} … ${a.azimuth(d.azimuthDeg[1])} ; ${a.degrees(d.altitudeDeg[0])} … ${a.degrees(d.altitudeDeg[1])}`:"",m.sizeSaid?a.degrees(m.angular?.widthDeg):"",m.basis?e(s.bases[m.basis]):"",e(a.rests(m))]}),[0,2,3,5]));const l=t.values.filter(m=>!/^timeline\.keyframes\.\d+\.shapes\.\d+\.shape\.(aim|angular)/.test(m.path));return l.length>0&&r.push(`<h4>${e(s.values)}</h4>`,z.valuesTable(l,a)),r}static reading(t,n,a){const s=a.texts,i=s.columns,e=z.escape,r=[`<h2>${e(a.fill(s.readingHeading,{title:t.title,witness:t.reads}))}</h2>`],c=[t.by.length?a.fill(s.by,{names:t.by.join(", ")}):"",t.time?a.fill(s.made,{time:t.time}):""].filter(Boolean).join(" ");c&&r.push(`<p class="meta">${e(c)}</p>`),t.description&&r.push(`<blockquote>${e(t.description)}</blockquote>`),r.push(`<h4>${e(s.supposed)}</h4>`,t.supposed.length?z.valuesTable(t.supposed,a):`<p>${e(s.noneSupposed)}</p>`),r.push(`<h4>${e(s.findings)}</h4>`),r.push(t.findings.length?z.table([i.finding,i.outcome,i.against,i.origin],t.findings.map(u=>[e(u.text),`<span class="${u.outcome}">${e(s.outcomes[u.outcome])}</span>`,u.outcome==="fails"?e(s.grounds[u.against??"established"]):"",e(s.origins[u.written?"written":"computed"])])):`<p>${e(s.noFinding)}</p>`);const o=t.sensitivity;if(o){const u=a.robustness(o);if(r.push(`<h4>${e(s.sensitivity)}</h4>`,`<p>${e(i.reproduced)} : ${a.reproduced(o)||"–"} · ${e(i.gap)} : ${a.degrees(o.medianSeparationDeg)||"–"} · <span class="${u.kind}">${e(u.text)}</span></p>`),u.kind!=="too-few"&&u.kind!=="nothing"&&o.margins.length>0&&r.push(z.table([i.knob,i.from,i.to,i.reference,i.covered],o.margins.map(p=>{const l=a.ends(p),m=p.reference?`${a.amount(p.knob,p.reference.lower)} … ${a.amount(p.knob,p.reference.upper)}`:s.noLaw;return[e(s.knobs[p.knob]),l.from,l.to,e(m),p.coverage===void 0?"":`${Math.round(p.coverage*100)} %`]}),[1,2,4])),o.better){const{knob:p,amount:l,agreement:m}=o.better;r.push(`<p class="fine-tuned">${e(a.fill(s.better,{knob:s.knobs[p],amount:a.amount(p,l),agreed:String(Math.round(m*o.compared)),compared:String(o.compared)}))}</p>`)}}return t.comparisons.length>0&&r.push(`<h4>${e(s.comparisons)}</h4>`,z.table([i.instant,i.phenomenon,`${i.said} (${i.azimuth}, ${i.altitude})`,`${i.read} (${i.azimuth}, ${i.altitude})`,i.separation,i.agrees],t.comparisons.map(u=>[a.instant(u.t),e(n?.phenomena?.[u.sourceId]??u.sourceId),u.said?`${a.azimuth(u.said.azimuthDeg)}, ${a.degrees(u.said.altitudeDeg)}`:"",`${a.azimuth(u.predicted.azimuthDeg)}, ${a.degrees(u.predicted.altitudeDeg)}`,a.degrees(u.separationDeg),`<span class="${u.agrees?"holds":"fails"}">${e(u.agrees?s.yes:s.no)}</span>`]),[0,4])),r}static valuesTable(t,n){const a=n.texts,s=a.columns,i=z.escape;return z.table([s.path,s.value,s.basis,s.rests],t.map(e=>[`<code>${i(e.path)}</code>`,i(n.value(e)),i(a.bases[e.basis]),i(n.rests(e))]))}static table(t,n,a=[]){const s=z.escape,i=`<tr>${t.map(r=>`<th scope="col">${s(r)}</th>`).join("")}</tr>`,e=n.map(r=>`<tr>${r.map((c,o)=>`<td${a.includes(o)?' class="n"':""}>${c}</td>`).join("")}</tr>`);return`<div class="scroll"><table><thead>${i}</thead><tbody>${e.join("")}</tbody></table></div>`}static escape(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}}const _=Y.catalog({en:()=>Z(()=>import("./CaseReportTexts_en-DlN7p1pC.js"),[],import.meta.url).then(N=>N.caseReportTexts_en),fr:()=>Z(()=>import("./CaseReportTexts_fr-B5nP6RlP.js"),[],import.meta.url).then(N=>N.caseReportTexts_fr),es:()=>Z(()=>import("./CaseReportTexts_es-CncAEaey.js"),[],import.meta.url).then(N=>N.caseReportTexts_es),it:()=>Z(()=>import("./CaseReportTexts_it-Dc-oPmXB.js"),[],import.meta.url).then(N=>N.caseReportTexts_it)});class U{static async make(t,n,a,s,i=!1,e){const[r,c]=await Promise.all([_.load(a),J.load(a)]),o=A.of(n.caseJson,n.caseUrl,n.recordings,new K([...s]),new C(c));i&&t!=="csv"&&await U.pictures(o,n,r,e);const u=`${n.caseJson.id??"case"}-report`;switch(t){case"html":U.download(new Blob([z.of(o,r,a,"0.202.0")],{type:"text/html"}),`${u}.html`);return;case"print":U.print(z.of(o,r,a,"0.202.0"));return;case"json":U.download(new Blob([T.json(o,"0.202.0")],{type:"application/json"}),`${u}.json`);return;case"csv":{const{zipSync:p,strToU8:l}=await Z(async()=>{const{zipSync:d,strToU8:g}=await import("./browser-CltifEM0.js");return{zipSync:d,strToU8:g}},[],import.meta.url),m=Object.fromEntries(Object.entries(T.csv(o,r,a)).map(([d,g])=>[d,l(`\uFEFF${g}`)]));U.download(new Blob([p(m)],{type:"application/zip"}),`${u}-tables.zip`)}}}static PICTURED_INSTANTS=3;static async pictures(t,n,a,s){const{registerScene:i,SCENE_ELEMENT_NAME:e}=await Z(async()=>{const{registerScene:p,SCENE_ELEMENT_NAME:l}=await import("./ShareDialogElement-Dlfy9NCE.js").then(m=>m.bC);return{registerScene:p,SCENE_ELEMENT_NAME:l}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url);i();const r=t.witnesses.map(p=>{const l=p.indications.filter(f=>f.directionSaid).map(f=>f.t),m=l.length<=U.PICTURED_INSTANTS?l:[l[0],l[Math.floor(l.length/2)],l[l.length-1]],d=t.readings.filter(f=>f.reads===p.title&&f.comparisons.length>0),g=[{label:a.accountView,url:p.url,reading:void 0},...d.map(f=>({label:f.title,url:p.url,reading:f.url}))];return{witness:p,instants:[...new Set(m)],recordings:g}}).filter(p=>p.instants.length>0),c=r.reduce((p,l)=>p+l.instants.length*l.recordings.length,0);if(c===0)return;const o=document.createElement(e);o.setAttribute("max-pixel-ratio","1"),o.setAttribute("always-live",""),Object.assign(o.style,{position:"fixed",left:"-10000px",top:"0",width:"640px",height:"360px",visibility:"hidden",pointerEvents:"none"}),document.body.appendChild(o);let u=0;s?.(u,c);try{for(const p of r){const l=p.instants.map(d=>({t:d,views:[]})),m=n.recordings.get(p.witness.url);m&&(o.documentUrl=p.witness.url,o.sightingData=m);for(const d of p.recordings){const g=m,f=d.reading?n.recordings.get(d.reading):void 0;for(const w of l){let b;g&&(!d.reading||f)&&(w===l[0]&&(o.interpretation=U.bodiesOf(f??g,d.reading??p.witness.url)),b=await o.pictureAt(w.t,480).catch(()=>{})),w.views.push({label:d.label,...b?{image:b}:{}}),s?.(++u,c)}}p.witness.pictures=l}}finally{o.remove()}}static bodiesOf(t,n){const a=W.strip(t).recording.interpretation;if(a)return{...a,bodies:a.bodies.map(s=>s.model?.url?{...s,model:{...s.model,url:new URL(s.model.url,n).href}}:s)}}static print(t){const n=document.createElement("iframe");n.setAttribute("aria-hidden","true"),n.style.cssText="position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0",n.addEventListener("load",()=>{const a=n.contentWindow;a&&(a.addEventListener("afterprint",()=>n.remove()),a.focus(),a.print(),window.setTimeout(()=>n.remove(),6e4))},{once:!0}),n.srcdoc=t,document.body.append(n)}static download(t,n){const a=URL.createObjectURL(t),s=document.createElement("a");s.href=a,s.download=n,s.click(),window.setTimeout(()=>URL.revokeObjectURL(a),1e3)}}export{U as CaseReportExport};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CaseReportExport-BFbswUIB.js","./rr0-ufoathome.mjs","./ShareDialogElement-CBeU9ChH.js","./Sighting-B7bsiTIQ.js","./VisualAids-DI-hEL46.js","./three.module-CbaHqYFq.js","./SaidPosition-OJEYhVKN.js","./GeoProjection-DvqDbRIx.js","./Decor-Dn-cvniW.js","./RecordingIssue-BlWT8Xsu.js","./xyzImageryRaster-Dhxs0B26.js","./Obstacles-v9SkfBD7.js"])))=>i.map(i=>d[i]);
2
- import{H as C,R as N,aR as T,k as y}from"./ShareDialogElement-CBeU9ChH.js";import{s as L,U as I,H as R,A as O,P as E,B as M,_ as P}from"./rr0-ufoathome.mjs";import{I as A}from"./SaidPosition-OJEYhVKN.js";class g extends HTMLElement{static TAG="rr0-readings-comparison";static CSS=`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CaseReportExport-DKrBXPgZ.js","./rr0-ufoathome.mjs","./ShareDialogElement-Dlfy9NCE.js","./Sighting-B7bsiTIQ.js","./VisualAids-DI-hEL46.js","./three.module-CbaHqYFq.js","./SaidPosition-OJEYhVKN.js","./GeoProjection-DvqDbRIx.js","./Decor-Dn-cvniW.js","./RecordingIssue-BlWT8Xsu.js","./xyzImageryRaster-Dhxs0B26.js","./Obstacles-v9SkfBD7.js"])))=>i.map(i=>d[i]);
2
+ import{H as N,R as C,aR as T,k as y}from"./ShareDialogElement-Dlfy9NCE.js";import{s as I,U as L,H as R,A as O,P as E,B as M,_ as P}from"./rr0-ufoathome.mjs";import{I as A}from"./SaidPosition-OJEYhVKN.js";class g extends HTMLElement{static TAG="rr0-readings-comparison";static CSS=`
3
3
  :host { display: block; font-size: 13px; line-height: 1.4; }
4
4
  :host([hidden]) { display: none; }
5
5
  summary { cursor: pointer; list-style-position: inside; font: 600 12px/1.4 var(--rr0-sans, system-ui, sans-serif); letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
@@ -14,8 +14,8 @@ td[data-robustness="none"] { opacity: .6; }
14
14
  th button.sort { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; white-space: nowrap; }
15
15
  th button.sort:hover, th[aria-sort] button.sort { text-decoration: underline; text-underline-offset: 2px; }
16
16
  button.link { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
17
- ${C.CSS}
18
- `;messages;language="en";rows=[];load;loaded=!1;opened=!1;sort={key:"reproduced",descending:!0};static register(){customElements.get(g.TAG)||customElements.define(g.TAG,g)}static create(){return g.register(),document.createElement(g.TAG)}constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.messages||this.loadLocale()}show(e,n){this.rows=e,this.load=n,this.loaded=e.every(a=>a.account&&a.reading),this.draw(),this.opened&&this.loadRows()}async loadLocale(){const e=L(R.preferencesFor(this),I);this.messages=await O.load(e),this.language=e,this.draw()}async loadRows(){this.loaded||!this.load||(this.loaded=!0,this.rows=await this.load(),this.draw())}draw(){const e=this.messages;if(this.hidden=this.rows.length===0,!e||this.rows.length===0){this.shadowRoot.replaceChildren();return}const n=e.comparison,a=document.createElement("style");a.textContent=g.CSS;const i=document.createElement("details");i.open=this.opened,i.addEventListener("toggle",()=>{this.opened=i.open,i.open&&this.loadRows()});const o=document.createElement("summary");o.append(n.heading.replace("{n}",String(this.rows.length)),C.of(n.hint));const t=document.createElement("table"),s=t.createTHead().insertRow(),l=[[n.reading,"case"],[n.witness,void 0],[n.reproduced,"reproduced"],[n.gap,"gap"],[n.robustness,"robustness"],[n.supposed,"supposed"]];for(const[p,u]of l){const v=document.createElement("th");if(v.scope="col",!u)v.textContent=p;else{const x=this.sort.key===u;x&&u!=="case"&&v.setAttribute("aria-sort",this.sort.descending?"descending":"ascending"),x&&u==="case"&&v.setAttribute("aria-sort","other");const m=document.createElement("button");m.type="button",m.className="sort",m.title=n.sortBy.replace("{column}",p),m.textContent=x&&u!=="case"?`${p} ${this.sort.descending?"▾":"▴"}`:p,m.addEventListener("click",()=>{this.sort=x?{key:u,descending:!this.sort.descending}:{key:u,descending:u!=="gap"&&u!=="supposed"},this.draw()}),v.append(m)}s.append(v)}const c=t.createTBody(),d=this.ordered(),r=this.sort.key==="case"||this.sort.key==="reproduced",b=[...new Set(d.map(p=>p.title))],h=r?b.flatMap(p=>d.filter(u=>u.title===p)):d;h.forEach((p,u)=>{const x=!r||u===0||h[u-1].title!==p.title?r?h.filter(m=>m.title===p.title).length:1:0;this.drawRow(c.insertRow(),p,e,x)});const w=document.createElement("div");w.className="scroll",w.append(t),i.append(o,w),this.shadowRoot.replaceChildren(a,i)}ordered(){const{key:e,descending:n}=this.sort;if(e==="case")return[...this.rows];const a=new Map(this.rows.map(t=>[t,this.standingOf(t)])),i=n?-1:1,o={reproduced:(t,s)=>i*(t.agreement-s.agreement)||(s.robustness-t.robustness)*i||((t.gapDeg??1/0)-(s.gapDeg??1/0))*-i||(t.supposed-s.supposed)*-i,gap:(t,s)=>(t.gapDeg===void 0?1:0)-(s.gapDeg===void 0?1:0)||i*((t.gapDeg??0)-(s.gapDeg??0)),robustness:(t,s)=>-i*(t.robustness-s.robustness),supposed:(t,s)=>i*(t.supposed-s.supposed)}[e];return this.rows.map((t,s)=>({row:t,index:s})).sort((t,s)=>{const l=a.get(t.row),c=a.get(s.row);return!l||!c?(l?0:1)-(c?0:1)||t.index-s.index:o(l,c)||t.index-s.index}).map(t=>t.row)}standingOf(e){if(!e.account||!e.reading)return;const n=N.resultOf(e.account,e.reading);if(!n||n.compared===0)return;const{provenance:a}=E.strip(e.reading),i=a.paths().filter(t=>t.startsWith("interpretation")&&E.free(a.at(t))).length,o=T.measurable(n)?n.sufficient===!0?0:n.sufficient===!1?2:1:3;return{agreement:n.agreement,robustness:o,...n.medianSeparationDeg===void 0?{}:{gapDeg:n.medianSeparationDeg},supposed:i}}drawTitle(e,n,a){const i=e.insertCell();i.rowSpan=a,i.textContent=n.title}drawWitness(e,n){const a=e.insertCell();if(!n.open){a.textContent=n.witness;return}const i=document.createElement("button");i.type="button",i.className="link",i.textContent=n.witness,i.addEventListener("click",n.open),a.append(i)}drawRow(e,n,a,i){const o=a.comparison,t=(h,w=!1)=>{const p=e.insertCell();return p.textContent=h,w&&(p.className="number"),p};if(i>0&&this.drawTitle(e,n,i),this.drawWitness(e,n),!n.account||!n.reading){for(let h=0;h<4;h++)t(o.loading);return}const s=N.resultOf(n.account,n.reading),{provenance:l}=E.strip(n.reading),c=l.paths().filter(h=>h.startsWith("interpretation")&&E.free(l.at(h)));if(!s||s.compared===0){const h=t(o.nothing);h.colSpan=3,h.dataset.robustness="none",t(String(c.length),!0);return}const d=Math.round(s.agreement*s.compared);t(`${d} / ${s.compared}`,!0);const r=new Intl.NumberFormat(this.language,{maximumFractionDigits:1});t(s.medianSeparationDeg===void 0?"–":`${r.format(s.medianSeparationDeg)}°`,!0);const b=T.measurable(s)?s.sufficient===!0?{kind:"sufficient",text:o.sufficient}:s.sufficient===!1?{kind:"fine-tuned",text:o.fineTuned.replace("{knob}",a.knobs[s.margins[0].knob])}:{kind:"none",text:o.unjudged}:{kind:"too-few",text:o.tooFew};t(b.text).dataset.robustness=b.kind,t(String(c.length),!0)}}class k extends HTMLElement{static TAG="rr0-case-export";static ICON='<svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M4 1.8h5.2L12.5 5v9.2H4z"/><path d="M9 1.8V5h3.5M6 8.2h4.5M6 10.6h4.5M6 12.9h2.5"/></svg>';static CSS=`
17
+ ${N.CSS}
18
+ `;messages;language="en";rows=[];load;loaded=!1;opened=!1;sort={key:"reproduced",descending:!0};static register(){customElements.get(g.TAG)||customElements.define(g.TAG,g)}static create(){return g.register(),document.createElement(g.TAG)}constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.messages||this.loadLocale()}show(e,n){this.rows=e,this.load=n,this.loaded=e.every(a=>a.account&&a.reading),this.draw(),this.opened&&this.loadRows()}async loadLocale(){const e=I(R.preferencesFor(this),L);this.messages=await O.load(e),this.language=e,this.draw()}async loadRows(){this.loaded||!this.load||(this.loaded=!0,this.rows=await this.load(),this.draw())}draw(){const e=this.messages;if(this.hidden=this.rows.length===0,!e||this.rows.length===0){this.shadowRoot.replaceChildren();return}const n=e.comparison,a=document.createElement("style");a.textContent=g.CSS;const i=document.createElement("details");i.open=this.opened,i.addEventListener("toggle",()=>{this.opened=i.open,i.open&&this.loadRows()});const o=document.createElement("summary");o.append(n.heading.replace("{n}",String(this.rows.length)),N.of(n.hint));const t=document.createElement("table"),s=t.createTHead().insertRow(),l=[[n.reading,"case"],[n.witness,void 0],[n.reproduced,"reproduced"],[n.gap,"gap"],[n.robustness,"robustness"],[n.supposed,"supposed"]];for(const[p,u]of l){const v=document.createElement("th");if(v.scope="col",!u)v.textContent=p;else{const x=this.sort.key===u;x&&u!=="case"&&v.setAttribute("aria-sort",this.sort.descending?"descending":"ascending"),x&&u==="case"&&v.setAttribute("aria-sort","other");const m=document.createElement("button");m.type="button",m.className="sort",m.title=n.sortBy.replace("{column}",p),m.textContent=x&&u!=="case"?`${p} ${this.sort.descending?"▾":"▴"}`:p,m.addEventListener("click",()=>{this.sort=x?{key:u,descending:!this.sort.descending}:{key:u,descending:u!=="gap"&&u!=="supposed"},this.draw()}),v.append(m)}s.append(v)}const c=t.createTBody(),d=this.ordered(),r=this.sort.key==="case"||this.sort.key==="reproduced",b=[...new Set(d.map(p=>p.title))],h=r?b.flatMap(p=>d.filter(u=>u.title===p)):d;h.forEach((p,u)=>{const x=!r||u===0||h[u-1].title!==p.title?r?h.filter(m=>m.title===p.title).length:1:0;this.drawRow(c.insertRow(),p,e,x)});const w=document.createElement("div");w.className="scroll",w.append(t),i.append(o,w),this.shadowRoot.replaceChildren(a,i)}ordered(){const{key:e,descending:n}=this.sort;if(e==="case")return[...this.rows];const a=new Map(this.rows.map(t=>[t,this.standingOf(t)])),i=n?-1:1,o={reproduced:(t,s)=>i*(t.agreement-s.agreement)||(s.robustness-t.robustness)*i||((t.gapDeg??1/0)-(s.gapDeg??1/0))*-i||(t.supposed-s.supposed)*-i,gap:(t,s)=>(t.gapDeg===void 0?1:0)-(s.gapDeg===void 0?1:0)||i*((t.gapDeg??0)-(s.gapDeg??0)),robustness:(t,s)=>-i*(t.robustness-s.robustness),supposed:(t,s)=>i*(t.supposed-s.supposed)}[e];return this.rows.map((t,s)=>({row:t,index:s})).sort((t,s)=>{const l=a.get(t.row),c=a.get(s.row);return!l||!c?(l?0:1)-(c?0:1)||t.index-s.index:o(l,c)||t.index-s.index}).map(t=>t.row)}standingOf(e){if(!e.account||!e.reading)return;const n=C.resultOf(e.account,e.reading);if(!n||n.compared===0)return;const{provenance:a}=E.strip(e.reading),i=a.paths().filter(t=>t.startsWith("interpretation")&&E.free(a.at(t))).length,o=T.measurable(n)?n.sufficient===!0?0:n.sufficient===!1?2:1:3;return{agreement:n.agreement,robustness:o,...n.medianSeparationDeg===void 0?{}:{gapDeg:n.medianSeparationDeg},supposed:i}}drawTitle(e,n,a){const i=e.insertCell();i.rowSpan=a,i.textContent=n.title}drawWitness(e,n){const a=e.insertCell();if(!n.open){a.textContent=n.witness;return}const i=document.createElement("button");i.type="button",i.className="link",i.textContent=n.witness,i.addEventListener("click",n.open),a.append(i)}drawRow(e,n,a,i){const o=a.comparison,t=(h,w=!1)=>{const p=e.insertCell();return p.textContent=h,w&&(p.className="number"),p};if(i>0&&this.drawTitle(e,n,i),this.drawWitness(e,n),!n.account||!n.reading){for(let h=0;h<4;h++)t(o.loading);return}const s=C.resultOf(n.account,n.reading),{provenance:l}=E.strip(n.reading),c=l.paths().filter(h=>h.startsWith("interpretation")&&E.free(l.at(h)));if(!s||s.compared===0){const h=t(o.nothing);h.colSpan=3,h.dataset.robustness="none",t(String(c.length),!0);return}const d=Math.round(s.agreement*s.compared);t(`${d} / ${s.compared}`,!0);const r=new Intl.NumberFormat(this.language,{maximumFractionDigits:1});t(s.medianSeparationDeg===void 0?"–":`${r.format(s.medianSeparationDeg)}°`,!0);const b=T.measurable(s)?s.sufficient===!0?{kind:"sufficient",text:o.sufficient}:s.sufficient===!1?{kind:"fine-tuned",text:o.fineTuned.replace("{knob}",a.knobs[s.margins[0].knob])}:{kind:"none",text:o.unjudged}:{kind:"too-few",text:o.tooFew};t(b.text).dataset.robustness=b.kind,t(String(c.length),!0)}}class k extends HTMLElement{static TAG="rr0-case-export";static ICON='<svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M4 1.8h5.2L12.5 5v9.2H4z"/><path d="M9 1.8V5h3.5M6 8.2h4.5M6 10.6h4.5M6 12.9h2.5"/></svg>';static CSS=`
19
19
  :host { display: inline-block; position: relative; }
20
20
  :host([hidden]) { display: none; }
21
21
  /* A button's own type, as its neighbours keep theirs: a size in em taken from the bar's text made it taller than they are. */
@@ -31,7 +31,7 @@ button.open { display: inline-flex; align-items: center; gap: 6px; cursor: point
31
31
  .option input { margin: 2px 0 0; }
32
32
  ${y.css(".menu")}
33
33
  .menu:popover-open { position-area: bottom span-left; margin: .35em 0 0; }
34
- `;source;messages;language="en";preferences=["en"];status;withPictures;static register(){customElements.get(k.TAG)||customElements.define(k.TAG,k)}constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.messages||this.loadLocale()}async loadLocale(){this.preferences=R.preferencesFor(this),this.language=L([...this.preferences],I),this.messages=await M.load(this.language),this.draw()}draw(){const e=this.messages,n=document.createElement("style");n.textContent=k.CSS;const a=document.createElement("button");a.type="button",a.className="open",a.setAttribute("part","button"),a.title=e.hint,a.setAttribute("aria-label",e.hint),a.setAttribute("aria-haspopup","menu"),a.innerHTML=k.ICON,this.getAttribute("variant")==="pill"&&a.append(Object.assign(document.createElement("span"),{textContent:e.button}));const i=document.createElement("div");i.className="menu",i.setAttribute("role","menu"),y.attach(a,i);const o=[["html",e.html,e.htmlHint],["print",e.print,e.printHint],["json",e.json,e.jsonHint],["csv",e.csv,e.csvHint]];i.append(...o.map(([l,c,d])=>{const r=document.createElement("button");return r.type="button",r.setAttribute("role","menuitem"),r.append(Object.assign(document.createElement("strong"),{textContent:c}),Object.assign(document.createElement("small"),{textContent:d})),r.addEventListener("click",()=>void this.export(l,i)),r}));const t=document.createElement("label");t.className="option",this.withPictures=Object.assign(document.createElement("input"),{type:"checkbox"});const s=document.createElement("span");s.append(Object.assign(document.createElement("strong"),{textContent:e.pictures}),Object.assign(document.createElement("small"),{textContent:e.picturesHint})),t.append(this.withPictures,s),i.append(t),this.status=Object.assign(document.createElement("p"),{className:"status",hidden:!0}),this.status.setAttribute("role","status"),i.append(this.status),a.addEventListener("click",()=>y.show(i,i.hidden)),this.shadowRoot.replaceChildren(n,a,i)}async export(e,n){const a=this.messages;if(this.source){this.status.textContent=a.working,this.status.hidden=!1;try{const[{CaseReportExport:i},o]=await Promise.all([P(()=>import("./CaseReportExport-BFbswUIB.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),this.source()]);await i.make(e,o,this.language,this.preferences,this.withPictures?.checked??!1,(t,s)=>{this.status.textContent=a.drawing.replace("{done}",String(t)).replace("{total}",String(s))}),this.status.hidden=!0,y.show(n,!1)}catch{this.status.textContent=a.failed}}}}const $="interviewchange",j="interviewseek",z="questionnairefeed";class f{constructor(e,n,a=n,i,o){this.list=e,this.choose=n,this.follow=a,this.toggle=i,this.fold=o}static CSS=`
34
+ `;source;messages;language="en";preferences=["en"];status;withPictures;static register(){customElements.get(k.TAG)||customElements.define(k.TAG,k)}constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.messages||this.loadLocale()}async loadLocale(){this.preferences=R.preferencesFor(this),this.language=I([...this.preferences],L),this.messages=await M.load(this.language),this.draw()}draw(){const e=this.messages,n=document.createElement("style");n.textContent=k.CSS;const a=document.createElement("button");a.type="button",a.className="open",a.setAttribute("part","button"),a.title=e.hint,a.setAttribute("aria-label",e.hint),a.setAttribute("aria-haspopup","menu"),a.innerHTML=k.ICON,this.getAttribute("variant")==="pill"&&a.append(Object.assign(document.createElement("span"),{textContent:e.button}));const i=document.createElement("div");i.className="menu",i.setAttribute("role","menu"),y.attach(a,i);const o=[["html",e.html,e.htmlHint],["print",e.print,e.printHint],["json",e.json,e.jsonHint],["csv",e.csv,e.csvHint]];i.append(...o.map(([l,c,d])=>{const r=document.createElement("button");return r.type="button",r.setAttribute("role","menuitem"),r.append(Object.assign(document.createElement("strong"),{textContent:c}),Object.assign(document.createElement("small"),{textContent:d})),r.addEventListener("click",()=>void this.export(l,i)),r}));const t=document.createElement("label");t.className="option",this.withPictures=Object.assign(document.createElement("input"),{type:"checkbox"});const s=document.createElement("span");s.append(Object.assign(document.createElement("strong"),{textContent:e.pictures}),Object.assign(document.createElement("small"),{textContent:e.picturesHint})),t.append(this.withPictures,s),i.append(t),this.status=Object.assign(document.createElement("p"),{className:"status",hidden:!0}),this.status.setAttribute("role","status"),i.append(this.status),a.addEventListener("click",()=>y.show(i,i.hidden)),this.shadowRoot.replaceChildren(n,a,i)}async export(e,n){const a=this.messages;if(this.source){this.status.textContent=a.working,this.status.hidden=!1;try{const[{CaseReportExport:i},o]=await Promise.all([P(()=>import("./CaseReportExport-DKrBXPgZ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),this.source()]);await i.make(e,o,this.language,this.preferences,this.withPictures?.checked??!1,(t,s)=>{this.status.textContent=a.drawing.replace("{done}",String(t)).replace("{total}",String(s))}),this.status.hidden=!0,y.show(n,!1)}catch{this.status.textContent=a.failed}}}}const $="interviewchange",j="interviewseek",z="questionnairefeed",_="questionnairesend";class f{constructor(e,n,a=n,i,o){this.list=e,this.choose=n,this.follow=a,this.toggle=i,this.fold=o}static CSS=`
35
35
  :host {
36
36
  --tl-ink: currentColor;
37
37
  --tl-ink-dim: color-mix(in srgb, currentColor 80%, transparent);
@@ -161,4 +161,4 @@ button.event-mark:focus-visible { outline: 2px solid var(--tl-sky); outline-offs
161
161
  background: var(--line-strong, rgba(127, 127, 127, .5)); opacity: 0; transition: opacity .15s ease; }
162
162
  .column-resize:is(:hover, :focus-visible, .dragging)::after { opacity: 1; }
163
163
  .column-resize:focus-visible { outline: none; }
164
- `;static MIN_PX=200;static OTHER_MIN_PX=320;label(e){this.grip.title=e,this.grip.setAttribute("aria-label",e)}set(e){const n=this.host;if(e===void 0)n.style.removeProperty(this.property);else{const a=Math.max(this.minPx,n.getBoundingClientRect().width-S.OTHER_MIN_PX);n.style.setProperty(this.property,`${Math.round(Math.min(a,Math.max(this.minPx,e)))}px`)}try{e===void 0?localStorage.removeItem(this.key):localStorage.setItem(this.key,n.style.getPropertyValue(this.property))}catch{}}}export{S as C,j as I,z as Q,g as R,f as a,k as b,$ as c};
164
+ `;static MIN_PX=200;static OTHER_MIN_PX=320;label(e){this.grip.title=e,this.grip.setAttribute("aria-label",e)}set(e){const n=this.host;if(e===void 0)n.style.removeProperty(this.property);else{const a=Math.max(this.minPx,n.getBoundingClientRect().width-S.OTHER_MIN_PX);n.style.setProperty(this.property,`${Math.round(Math.min(a,Math.max(this.minPx,e)))}px`)}try{e===void 0?localStorage.removeItem(this.key):localStorage.setItem(this.key,n.style.getPropertyValue(this.property))}catch{}}}export{S as C,j as I,_ as Q,g as R,f as a,k as b,$ as c,z as d};
@@ -1,4 +1,4 @@
1
- import{aa as A,j as F,W as D,r as M,d as R,F as b,M as E,C as P,S}from"./three.module-CbaHqYFq.js";import{b1 as U,b2 as k}from"./ShareDialogElement-CBeU9ChH.js";import"./rr0-ufoathome.mjs";import"./Sighting-B7bsiTIQ.js";import"./VisualAids-DI-hEL46.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";class w{target;wideCamera=new A;materials=new Map;draw(t){const{renderer:s,camera:a,equidistant:r}=t,i=s.getDrawingBufferSize(new F),o=i.x,n=i.y,e=o/n;if(r&&!U.supports(a.fov,e))throw new Error(`A field of ${a.fov}° is drawn through a cube, which the control passes do not follow yet: export through a narrower field.`);const c=this.sourceCamera(a,r?r.sourceFovDeg(a.fov,e):a.fov),d=this.usableTarget(o,n),l=this.drawDistance(t,c,d),u=this.drawPhenomenon(t,c,d),f=Math.tan(c.fov*Math.PI/360),p=new Float32Array(o*n),m=new Uint8Array(o*n);for(let v=0;v<n;v++)for(let g=0;g<o;g++){const h=this.sourcePixel(g,v,o,n,a.fov,e,f,r);if(h<0)continue;const x=v*o+g;p[x]=l[h*4];const y=u[h*4],C=u[h*4+1],T=u[h*4+2],_=u[h*4+3];m[x]=Math.max(y,C,T,_)>w.LIGHT_THRESHOLD?255:0}return{width:o,height:n,distanceM:p,phenomenon:m}}dispose(){this.target?.dispose();for(const t of this.materials.values())t.dispose();this.materials.clear()}static LIGHT_THRESHOLD=1e-6;sourcePixel(t,s,a,r,i,o,n,e){if(!e)return(r-1-s)*a+t;const c=(t+.5)/a*2-1,d=1-(s+.5)/r*2,l=e.directionFor(c,d,i);if(l.z>=0)return-1;const u=l.x/-l.z/(n*o),f=l.y/-l.z/n,p=Math.floor((u+1)/2*a),m=Math.floor((f+1)/2*r);return p<0||p>=a||m<0||m>=r?-1:m*a+p}sourceCamera(t,s){const a=this.wideCamera.copy(t);return a.fov=s,a.clearViewOffset(),a.updateProjectionMatrix(),a.updateMatrixWorld(),a}usableTarget(t,s){return this.target?(this.target.width!==t||this.target.height!==s)&&this.target.setSize(t,s):this.target=new D(t,s,{type:b,format:R,minFilter:M,magFilter:M,depthBuffer:!0}),this.target}drawDistance(t,s,a){const{renderer:r,scene:i}=t,o=[],n=[];for(const e of t.sky)e.visible&&(e.visible=!1,o.push(e));i.traverseVisible(e=>{if(e instanceof E){if(t.isSolid(e)){n.push({mesh:e,material:e.material}),e.material=Array.isArray(e.material)?e.material.map(c=>this.distanceMaterial(c)):this.distanceMaterial(e.material);return}}else if(!e.isPoints&&!e.isLine&&!e.isSprite)return;o.push(e)});for(const e of o)e.visible=!1;try{return this.drawInto(t,a,()=>r.render(i,s))}finally{for(const e of o)e.visible=!0;for(const{mesh:e,material:c}of n)e.material=c}}drawPhenomenon(t,s,a){return this.drawInto(t,a,()=>t.drawPhenomena(s))}drawInto(t,s,a){const{renderer:r,scene:i}=t,o=r.getRenderTarget(),n=r.autoClear,e=r.shadowMap.autoUpdate,c=i.fog,d=i.background,l=r.getClearAlpha(),u=r.getClearColor(new P);i.fog=null,i.background=null,r.shadowMap.autoUpdate=!1,r.setRenderTarget(s),r.setClearColor(0,0),r.clear(!0,!0,!0),r.autoClear=!1;try{a();const f=new Float32Array(s.width*s.height*4);return k.now(r,s,0,0,s.width,s.height,f),f}finally{r.autoClear=n,r.shadowMap.autoUpdate=e,r.setRenderTarget(o),r.setClearColor(u,l),i.fog=c,i.background=d}}distanceMaterial(t){const s=t.alphaTest??0,a=t.map??t.alphaMap??null,r=s>0&&a!==null,i=`${t.side}:${r?`${a.uuid}:${s}`:"-"}`;let o=this.materials.get(i);return o||(o=new S({defines:r?{CUTOUT:"",USE_UV:""}:{},uniforms:{cutoutMap:{value:a},cutoutAlpha:{value:s}},vertexShader:w.VERTEX,fragmentShader:w.FRAGMENT,side:t.side}),this.materials.set(i,o)),o}static VERTEX=`
1
+ import{aa as A,j as F,W as D,r as M,d as R,F as b,M as E,C as P,S}from"./three.module-CbaHqYFq.js";import{b1 as U,b2 as k}from"./ShareDialogElement-Dlfy9NCE.js";import"./rr0-ufoathome.mjs";import"./Sighting-B7bsiTIQ.js";import"./VisualAids-DI-hEL46.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";class w{target;wideCamera=new A;materials=new Map;draw(t){const{renderer:s,camera:a,equidistant:r}=t,i=s.getDrawingBufferSize(new F),o=i.x,n=i.y,e=o/n;if(r&&!U.supports(a.fov,e))throw new Error(`A field of ${a.fov}° is drawn through a cube, which the control passes do not follow yet: export through a narrower field.`);const c=this.sourceCamera(a,r?r.sourceFovDeg(a.fov,e):a.fov),d=this.usableTarget(o,n),l=this.drawDistance(t,c,d),u=this.drawPhenomenon(t,c,d),f=Math.tan(c.fov*Math.PI/360),p=new Float32Array(o*n),m=new Uint8Array(o*n);for(let v=0;v<n;v++)for(let g=0;g<o;g++){const h=this.sourcePixel(g,v,o,n,a.fov,e,f,r);if(h<0)continue;const x=v*o+g;p[x]=l[h*4];const y=u[h*4],C=u[h*4+1],T=u[h*4+2],_=u[h*4+3];m[x]=Math.max(y,C,T,_)>w.LIGHT_THRESHOLD?255:0}return{width:o,height:n,distanceM:p,phenomenon:m}}dispose(){this.target?.dispose();for(const t of this.materials.values())t.dispose();this.materials.clear()}static LIGHT_THRESHOLD=1e-6;sourcePixel(t,s,a,r,i,o,n,e){if(!e)return(r-1-s)*a+t;const c=(t+.5)/a*2-1,d=1-(s+.5)/r*2,l=e.directionFor(c,d,i);if(l.z>=0)return-1;const u=l.x/-l.z/(n*o),f=l.y/-l.z/n,p=Math.floor((u+1)/2*a),m=Math.floor((f+1)/2*r);return p<0||p>=a||m<0||m>=r?-1:m*a+p}sourceCamera(t,s){const a=this.wideCamera.copy(t);return a.fov=s,a.clearViewOffset(),a.updateProjectionMatrix(),a.updateMatrixWorld(),a}usableTarget(t,s){return this.target?(this.target.width!==t||this.target.height!==s)&&this.target.setSize(t,s):this.target=new D(t,s,{type:b,format:R,minFilter:M,magFilter:M,depthBuffer:!0}),this.target}drawDistance(t,s,a){const{renderer:r,scene:i}=t,o=[],n=[];for(const e of t.sky)e.visible&&(e.visible=!1,o.push(e));i.traverseVisible(e=>{if(e instanceof E){if(t.isSolid(e)){n.push({mesh:e,material:e.material}),e.material=Array.isArray(e.material)?e.material.map(c=>this.distanceMaterial(c)):this.distanceMaterial(e.material);return}}else if(!e.isPoints&&!e.isLine&&!e.isSprite)return;o.push(e)});for(const e of o)e.visible=!1;try{return this.drawInto(t,a,()=>r.render(i,s))}finally{for(const e of o)e.visible=!0;for(const{mesh:e,material:c}of n)e.material=c}}drawPhenomenon(t,s,a){return this.drawInto(t,a,()=>t.drawPhenomena(s))}drawInto(t,s,a){const{renderer:r,scene:i}=t,o=r.getRenderTarget(),n=r.autoClear,e=r.shadowMap.autoUpdate,c=i.fog,d=i.background,l=r.getClearAlpha(),u=r.getClearColor(new P);i.fog=null,i.background=null,r.shadowMap.autoUpdate=!1,r.setRenderTarget(s),r.setClearColor(0,0),r.clear(!0,!0,!0),r.autoClear=!1;try{a();const f=new Float32Array(s.width*s.height*4);return k.now(r,s,0,0,s.width,s.height,f),f}finally{r.autoClear=n,r.shadowMap.autoUpdate=e,r.setRenderTarget(o),r.setClearColor(u,l),i.fog=c,i.background=d}}distanceMaterial(t){const s=t.alphaTest??0,a=t.map??t.alphaMap??null,r=s>0&&a!==null,i=`${t.side}:${r?`${a.uuid}:${s}`:"-"}`;let o=this.materials.get(i);return o||(o=new S({defines:r?{CUTOUT:"",USE_UV:""}:{},uniforms:{cutoutMap:{value:a},cutoutAlpha:{value:s}},vertexShader:w.VERTEX,fragmentShader:w.FRAGMENT,side:t.side}),this.materials.set(i,o)),o}static VERTEX=`
2
2
  #include <common>
3
3
  #include <uv_pars_vertex>
4
4
  #include <batching_pars_vertex>
@@ -1 +1 @@
1
- import{am as h}from"./ShareDialogElement-CBeU9ChH.js";import"./rr0-ufoathome.mjs";import"./Sighting-B7bsiTIQ.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";const m=[{id:"when",paths:["time"]},{id:"where",paths:["place.locations.*.lat","place.locations.*.lng","observerTrack.keyframes.*.pose.lat","observerTrack.keyframes.*.pose.lng"]},{id:"facing",paths:["observerTrack.keyframes.*.pose.headingDeg"]},{id:"apparent-size",paths:["timeline.keyframes.*.shapes.*.shape.angular.widthDeg","timeline.keyframes.*.shapes.*.shape.angular.heightDeg"]},{id:"sky-position",paths:["timeline.keyframes.*.shapes.*.shape.aim.azimuthDeg","timeline.keyframes.*.shapes.*.shape.aim.altitudeDeg"]},{id:"how-long",paths:["durationSeconds","endTime"]},{id:"appearance",paths:["timeline.keyframes.*.shapes.*.shape.kind","timeline.keyframes.*.shapes.*.shape.title","timeline.keyframes.*.shapes.*.shape.color","timeline.keyframes.*.shapes.*.shape.brightness"]},{id:"movement",paths:["timeline.keyframes.1.t","observerTrack.keyframes.1.t"]},{id:"sound",paths:["soundTrack.keyframes.*.sound.kind"]},{id:"conditions",paths:["weatherTrack.keyframes.*.weather.*","weather.*"]}],l=["fitted","assumed","derived","stated","measured","established"];class p{about="observer";async assess(t){const i=h(t,!0),s=m.map(e=>p.answer(e,i,t));return{score:s.filter(e=>e.basis==="stated").length/s.length,criteria:s}}static answer(t,i,s){const e=t.paths.flatMap(a=>p.resolve(a,i));if(e.length===0)return{id:t.id,paths:[]};const r=e.map(a=>p.basisAt(a,s)??"stated");return{id:t.id,basis:l.find(a=>r.includes(a)),paths:e}}static basisAt(t,i){const s=t.split(".");for(let e=s.length;e>0;e--){const r=i.provenance.at(s.slice(0,e).join("."))?.basis;if(r)return r}}static resolve(t,i){let s=[{path:[],value:i}];for(const e of t.split("."))s=s.flatMap(({path:r,value:a})=>{if(typeof a!="object"||a===null)return[];if(e!=="*"){const n=a[e];return n===void 0?[]:[{path:[...r,e],value:n}]}return Object.entries(a).filter(([,n])=>n!==void 0).map(([n,o])=>({path:[...r,n],value:o}))});return s.filter(({value:e})=>e!==null&&e!==""&&!(Array.isArray(e)&&e.length===0)).map(({path:e})=>e.join("."))}}export{p as CoverageAssessor};
1
+ import{am as h}from"./ShareDialogElement-Dlfy9NCE.js";import"./rr0-ufoathome.mjs";import"./Sighting-B7bsiTIQ.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";const m=[{id:"when",paths:["time"]},{id:"where",paths:["place.locations.*.lat","place.locations.*.lng","observerTrack.keyframes.*.pose.lat","observerTrack.keyframes.*.pose.lng"]},{id:"facing",paths:["observerTrack.keyframes.*.pose.headingDeg"]},{id:"apparent-size",paths:["timeline.keyframes.*.shapes.*.shape.angular.widthDeg","timeline.keyframes.*.shapes.*.shape.angular.heightDeg"]},{id:"sky-position",paths:["timeline.keyframes.*.shapes.*.shape.aim.azimuthDeg","timeline.keyframes.*.shapes.*.shape.aim.altitudeDeg"]},{id:"how-long",paths:["durationSeconds","endTime"]},{id:"appearance",paths:["timeline.keyframes.*.shapes.*.shape.kind","timeline.keyframes.*.shapes.*.shape.title","timeline.keyframes.*.shapes.*.shape.color","timeline.keyframes.*.shapes.*.shape.brightness"]},{id:"movement",paths:["timeline.keyframes.1.t","observerTrack.keyframes.1.t"]},{id:"sound",paths:["soundTrack.keyframes.*.sound.kind"]},{id:"conditions",paths:["weatherTrack.keyframes.*.weather.*","weather.*"]}],l=["fitted","assumed","derived","stated","measured","established"];class p{about="observer";async assess(t){const i=h(t,!0),s=m.map(e=>p.answer(e,i,t));return{score:s.filter(e=>e.basis==="stated").length/s.length,criteria:s}}static answer(t,i,s){const e=t.paths.flatMap(a=>p.resolve(a,i));if(e.length===0)return{id:t.id,paths:[]};const r=e.map(a=>p.basisAt(a,s)??"stated");return{id:t.id,basis:l.find(a=>r.includes(a)),paths:e}}static basisAt(t,i){const s=t.split(".");for(let e=s.length;e>0;e--){const r=i.provenance.at(s.slice(0,e).join("."))?.basis;if(r)return r}}static resolve(t,i){let s=[{path:[],value:i}];for(const e of t.split("."))s=s.flatMap(({path:r,value:a})=>{if(typeof a!="object"||a===null)return[];if(e!=="*"){const n=a[e];return n===void 0?[]:[{path:[...r,e],value:n}]}return Object.entries(a).filter(([,n])=>n!==void 0).map(([n,o])=>({path:[...r,n],value:o}))});return s.filter(({value:e})=>e!==null&&e!==""&&!(Array.isArray(e)&&e.length===0)).map(({path:e})=>e.join("."))}}export{p as CoverageAssessor};
@@ -1 +1 @@
1
- import{b6 as I,aX as l,aW as m}from"./ShareDialogElement-CBeU9ChH.js";import"./rr0-ufoathome.mjs";import"./Sighting-B7bsiTIQ.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";class T extends Error{constructor(t){super(t),this.problem=t}}class e{citation=I;static FIRST_MS=Date.UTC(2016,4,11);static DEFAULT_RADIUS_KM=100;static RINGS_KM=[25,50];static SNAPSHOT_LIMIT=60;static SMALLEST_PLAN_RESULTS=20;static MAX_TRACED=8;static CREDITS_PER_SNAPSHOT_FLIGHT=8;static CREDITS_PER_TRACK=40;static CREDITS_FOR_NOTHING=1;static MAX_CREDITS_PER_PAGE=5e3;static WORST_CASE_CREDITS=(e.MAX_TRACED-1)*e.RINGS_KM.length*e.CREDITS_PER_SNAPSHOT_FLIGHT+e.SNAPSHOT_LIMIT*e.CREDITS_PER_SNAPSHOT_FLIGHT+e.MAX_TRACED*e.CREDITS_PER_TRACK;static API="https://fr24api.flightradar24.com/api";static IN_THE_AIR_FT="1-60000";static KM_PER_DEG=111.32;token;fetchImpl;settleMs;requestsPerMinute;snapshots=[];tracks=new Map;descriptions=new Map;requestTimes=[];tokenOfMemory;latestQuestion=0;creditsSpent=0;constructor(t){this.token=t.token,this.fetchImpl=t.fetchImpl??fetch.bind(globalThis),this.settleMs=t.settleMs??1500,this.requestsPerMinute=t.requestsPerMinute??10}mayCover(t){return t>=e.FIRST_MS&&t<=Date.now()}async between(t,n,i,o=e.DEFAULT_RADIUS_KM){const r=this.token();if(!r)return{status:"failed",problem:"credential"};r!==this.tokenOfMemory&&this.forgetAnswers(r);try{const a=await this.snapshotFor(r,t,n,i,o);if(!a)return{status:"failed"};const s=a.flights.slice(0,e.MAX_TRACED),h=await Promise.all(s.map(c=>this.trackOf(r,c))),p=[];return s.forEach((c,u)=>{const S=h[u].filter(f=>f.t>=n&&f.t<=i&&l.groundDistanceKm(t,f)<=o);S.length>0&&p.push({...e.addressOf(c),points:S})}),{status:"found",tracks:p,creditsSpent:this.creditsSpent,partial:{traced:s.length,seen:a.flights.length,moreSeen:a.flights.length>=e.SMALLEST_PLAN_RESULTS,withinKm:a.withinKm}}}catch(a){return{status:"failed",problem:a instanceof T?a.problem:"network",creditsSpent:this.creditsSpent}}}async describe(t){return this.descriptions.get(m.keyOf(t))}static addressOf(t){const n=t.hex?Number.parseInt(t.hex,16):Number.NaN;return Number.isFinite(n)?{icao:n,nonIcao:!1}:{icao:Number.parseInt(t.fr24_id,16),nonIcao:!0}}static boundsAround(t,n){const i=n/e.KM_PER_DEG,o=Math.min(90,t.lat+i),r=Math.max(-90,t.lat-i),a=Math.cos(Math.max(Math.abs(o),Math.abs(r))*Math.PI/180),s=a<1e-6?180:n/(e.KM_PER_DEG*a),h=Math.max(-180,t.lng-s),p=Math.min(180,t.lng+s);return[o,r,h,p].map(c=>c.toFixed(3)).join(",")}forgetAnswers(t){this.tokenOfMemory=t,this.snapshots.length=0,this.tracks.clear(),this.descriptions.clear()}async snapshotFor(t,n,i,o,r){const a=`${n.lat.toFixed(3)},${n.lng.toFixed(3)},${r}`;for(const p of this.snapshots){const c=await p.catch(()=>{});if(c&&c.place===a&&c.t>=i&&c.t<=o)return c}const s=++this.latestQuestion;if(this.settleMs>0&&await new Promise(p=>setTimeout(p,this.settleMs)),s!==this.latestQuestion)return;if(this.creditsSpent+e.WORST_CASE_CREDITS>e.MAX_CREDITS_PER_PAGE)throw new T("budget");const h=this.askSnapshot(t,n,Math.round((i+o)/2),r,a);return this.snapshots.push(h),h.catch(()=>this.snapshots.splice(this.snapshots.indexOf(h),1)),h}async askSnapshot(t,n,i,o,r){const a=[...e.RINGS_KM.filter(c=>c<o),o];let s=[],h=o;for(const c of a)if(h=c,s=await this.flightsWithin(t,n,i,c),s.length>=e.MAX_TRACED)break;const p=c=>l.groundDistanceKm(n,{lat:c.lat,lng:c.lon});return{t:i,place:r,withinKm:h,flights:[...s].sort((c,u)=>p(c)-p(u))}}async flightsWithin(t,n,i,o){const r=new URLSearchParams({timestamp:String(Math.floor(i/1e3)),bounds:e.boundsAround(n,o),altitude_ranges:e.IN_THE_AIR_FT,limit:String(e.SNAPSHOT_LIMIT)}),s=(await this.get(t,`/historic/flight-positions/full?${r}`)).data??[];this.creditsSpent+=s.length>0?s.length*e.CREDITS_PER_SNAPSHOT_FLIGHT:e.CREDITS_FOR_NOTHING;for(const h of s){const p={type:h.type||void 0,registration:h.reg||void 0};(p.type||p.registration)&&this.descriptions.set(m.keyOf(e.addressOf(h)),p)}return s}trackOf(t,n){let i=this.tracks.get(n.fr24_id);return i||(i=this.get(t,`/flight-tracks?flight_id=${encodeURIComponent(n.fr24_id)}`).then(o=>{const a=(Array.isArray(o)?o:o.data??[]).flatMap(s=>s.tracks??[]);return this.creditsSpent+=a.length>0?e.CREDITS_PER_TRACK:e.CREDITS_FOR_NOTHING,a.filter(s=>s.source?.toUpperCase()!=="ESTIMATED"&&s.alt>0).map(s=>({t:Date.parse(s.timestamp),lat:s.lat,lng:s.lon,altitudeFt:s.alt,groundSpeedKt:s.gspeed,trackDeg:s.track})).sort((s,h)=>s.t-h.t)}),i.catch(()=>this.tracks.delete(n.fr24_id)),this.tracks.set(n.fr24_id,i)),i}async get(t,n){await this.paced();const i=await this.fetchImpl(`${e.API}${n}`,{headers:{Accept:"application/json","Accept-Version":"v1",Authorization:`Bearer ${t}`}});if(!i.ok)throw new T(e.problemOf(i.status));return await i.json()}static problemOf(t){switch(t){case 401:return"credential";case 402:return"credits";case 429:return"rate";case 400:case 403:case 404:return"refused";default:return"network"}}async paced(){for(;;){const t=Date.now();for(;this.requestTimes.length>0&&t-this.requestTimes[0]>=6e4;)this.requestTimes.shift();if(this.requestTimes.length<this.requestsPerMinute){this.requestTimes.push(t);return}await new Promise(n=>setTimeout(n,6e4-(t-this.requestTimes[0])+50))}}}export{e as Flightradar24Provider};
1
+ import{b6 as I,aX as l,aW as m}from"./ShareDialogElement-Dlfy9NCE.js";import"./rr0-ufoathome.mjs";import"./Sighting-B7bsiTIQ.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";class T extends Error{constructor(t){super(t),this.problem=t}}class e{citation=I;static FIRST_MS=Date.UTC(2016,4,11);static DEFAULT_RADIUS_KM=100;static RINGS_KM=[25,50];static SNAPSHOT_LIMIT=60;static SMALLEST_PLAN_RESULTS=20;static MAX_TRACED=8;static CREDITS_PER_SNAPSHOT_FLIGHT=8;static CREDITS_PER_TRACK=40;static CREDITS_FOR_NOTHING=1;static MAX_CREDITS_PER_PAGE=5e3;static WORST_CASE_CREDITS=(e.MAX_TRACED-1)*e.RINGS_KM.length*e.CREDITS_PER_SNAPSHOT_FLIGHT+e.SNAPSHOT_LIMIT*e.CREDITS_PER_SNAPSHOT_FLIGHT+e.MAX_TRACED*e.CREDITS_PER_TRACK;static API="https://fr24api.flightradar24.com/api";static IN_THE_AIR_FT="1-60000";static KM_PER_DEG=111.32;token;fetchImpl;settleMs;requestsPerMinute;snapshots=[];tracks=new Map;descriptions=new Map;requestTimes=[];tokenOfMemory;latestQuestion=0;creditsSpent=0;constructor(t){this.token=t.token,this.fetchImpl=t.fetchImpl??fetch.bind(globalThis),this.settleMs=t.settleMs??1500,this.requestsPerMinute=t.requestsPerMinute??10}mayCover(t){return t>=e.FIRST_MS&&t<=Date.now()}async between(t,n,i,o=e.DEFAULT_RADIUS_KM){const r=this.token();if(!r)return{status:"failed",problem:"credential"};r!==this.tokenOfMemory&&this.forgetAnswers(r);try{const a=await this.snapshotFor(r,t,n,i,o);if(!a)return{status:"failed"};const s=a.flights.slice(0,e.MAX_TRACED),h=await Promise.all(s.map(c=>this.trackOf(r,c))),p=[];return s.forEach((c,u)=>{const S=h[u].filter(f=>f.t>=n&&f.t<=i&&l.groundDistanceKm(t,f)<=o);S.length>0&&p.push({...e.addressOf(c),points:S})}),{status:"found",tracks:p,creditsSpent:this.creditsSpent,partial:{traced:s.length,seen:a.flights.length,moreSeen:a.flights.length>=e.SMALLEST_PLAN_RESULTS,withinKm:a.withinKm}}}catch(a){return{status:"failed",problem:a instanceof T?a.problem:"network",creditsSpent:this.creditsSpent}}}async describe(t){return this.descriptions.get(m.keyOf(t))}static addressOf(t){const n=t.hex?Number.parseInt(t.hex,16):Number.NaN;return Number.isFinite(n)?{icao:n,nonIcao:!1}:{icao:Number.parseInt(t.fr24_id,16),nonIcao:!0}}static boundsAround(t,n){const i=n/e.KM_PER_DEG,o=Math.min(90,t.lat+i),r=Math.max(-90,t.lat-i),a=Math.cos(Math.max(Math.abs(o),Math.abs(r))*Math.PI/180),s=a<1e-6?180:n/(e.KM_PER_DEG*a),h=Math.max(-180,t.lng-s),p=Math.min(180,t.lng+s);return[o,r,h,p].map(c=>c.toFixed(3)).join(",")}forgetAnswers(t){this.tokenOfMemory=t,this.snapshots.length=0,this.tracks.clear(),this.descriptions.clear()}async snapshotFor(t,n,i,o,r){const a=`${n.lat.toFixed(3)},${n.lng.toFixed(3)},${r}`;for(const p of this.snapshots){const c=await p.catch(()=>{});if(c&&c.place===a&&c.t>=i&&c.t<=o)return c}const s=++this.latestQuestion;if(this.settleMs>0&&await new Promise(p=>setTimeout(p,this.settleMs)),s!==this.latestQuestion)return;if(this.creditsSpent+e.WORST_CASE_CREDITS>e.MAX_CREDITS_PER_PAGE)throw new T("budget");const h=this.askSnapshot(t,n,Math.round((i+o)/2),r,a);return this.snapshots.push(h),h.catch(()=>this.snapshots.splice(this.snapshots.indexOf(h),1)),h}async askSnapshot(t,n,i,o,r){const a=[...e.RINGS_KM.filter(c=>c<o),o];let s=[],h=o;for(const c of a)if(h=c,s=await this.flightsWithin(t,n,i,c),s.length>=e.MAX_TRACED)break;const p=c=>l.groundDistanceKm(n,{lat:c.lat,lng:c.lon});return{t:i,place:r,withinKm:h,flights:[...s].sort((c,u)=>p(c)-p(u))}}async flightsWithin(t,n,i,o){const r=new URLSearchParams({timestamp:String(Math.floor(i/1e3)),bounds:e.boundsAround(n,o),altitude_ranges:e.IN_THE_AIR_FT,limit:String(e.SNAPSHOT_LIMIT)}),s=(await this.get(t,`/historic/flight-positions/full?${r}`)).data??[];this.creditsSpent+=s.length>0?s.length*e.CREDITS_PER_SNAPSHOT_FLIGHT:e.CREDITS_FOR_NOTHING;for(const h of s){const p={type:h.type||void 0,registration:h.reg||void 0};(p.type||p.registration)&&this.descriptions.set(m.keyOf(e.addressOf(h)),p)}return s}trackOf(t,n){let i=this.tracks.get(n.fr24_id);return i||(i=this.get(t,`/flight-tracks?flight_id=${encodeURIComponent(n.fr24_id)}`).then(o=>{const a=(Array.isArray(o)?o:o.data??[]).flatMap(s=>s.tracks??[]);return this.creditsSpent+=a.length>0?e.CREDITS_PER_TRACK:e.CREDITS_FOR_NOTHING,a.filter(s=>s.source?.toUpperCase()!=="ESTIMATED"&&s.alt>0).map(s=>({t:Date.parse(s.timestamp),lat:s.lat,lng:s.lon,altitudeFt:s.alt,groundSpeedKt:s.gspeed,trackDeg:s.track})).sort((s,h)=>s.t-h.t)}),i.catch(()=>this.tracks.delete(n.fr24_id)),this.tracks.set(n.fr24_id,i)),i}async get(t,n){await this.paced();const i=await this.fetchImpl(`${e.API}${n}`,{headers:{Accept:"application/json","Accept-Version":"v1",Authorization:`Bearer ${t}`}});if(!i.ok)throw new T(e.problemOf(i.status));return await i.json()}static problemOf(t){switch(t){case 401:return"credential";case 402:return"credits";case 429:return"rate";case 400:case 403:case 404:return"refused";default:return"network"}}async paced(){for(;;){const t=Date.now();for(;this.requestTimes.length>0&&t-this.requestTimes[0]>=6e4;)this.requestTimes.shift();if(this.requestTimes.length<this.requestsPerMinute){this.requestTimes.push(t);return}await new Promise(n=>setTimeout(n,6e4-(t-this.requestTimes[0])+50))}}}export{e as Flightradar24Provider};