@rr0/ufoathome 0.177.2 → 0.178.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) hide show
  1. package/dist-embed-interview/rr0-interview.mjs +3 -3
  2. package/dist-embed-scene/{AdsbLolArchiveProvider-BHGe8FVN.js → AdsbLolArchiveProvider-B0Yi081_.js} +1 -1
  3. package/dist-embed-scene/{BeamEditor-zq64GorX.js → BeamEditor-DFGRzRny.js} +1 -1
  4. package/dist-embed-scene/{BeamSystem-BXee1GYk.js → BeamSystem-ebEMoYD3.js} +1 -1
  5. package/dist-embed-scene/{ContrailSystem-BSbI2jUe.js → ContrailSystem-Bn--uCNU.js} +1 -1
  6. package/dist-embed-scene/ControlPasses-BMma2JRm.js +29 -0
  7. package/dist-embed-scene/FilmChrome-DYiyzoB_.js +1 -0
  8. package/dist-embed-scene/{Flightradar24Provider-Dx2Fb8yO.js → Flightradar24Provider-CpwhYfIE.js} +1 -1
  9. package/dist-embed-scene/GLTFLoader-BxToReDu.js +1 -0
  10. package/dist-embed-scene/GenerativeKit-BmhvjjzB.js +9 -0
  11. package/dist-embed-scene/GenerativeKitMessages-7-3kT9Ef.js +1 -0
  12. package/dist-embed-scene/GenerativeKitMessages_en-BY4B6yas.js +34 -0
  13. package/dist-embed-scene/GenerativeKitMessages_es-_iYkoRhK.js +34 -0
  14. package/dist-embed-scene/GenerativeKitMessages_fr-BY5yUJwK.js +34 -0
  15. package/dist-embed-scene/GenerativeKitMessages_it-DAgB31P1.js +34 -0
  16. package/dist-embed-scene/{HeadlightSystem-_BIIKhQ2.js → HeadlightSystem-l2XbBvXf.js} +1 -1
  17. package/dist-embed-scene/LanternEditor-H8VYYbRn.js +9 -0
  18. package/dist-embed-scene/{LaserBeam-DmH2JeMa.js → LaserBeam-B48FKTrt.js} +1 -1
  19. package/dist-embed-scene/LaunchEditor-CIYcS0Y-.js +22 -0
  20. package/dist-embed-scene/{LaunchPlume-BRnjFVcY.js → LaunchPlume-eEIp7_hM.js} +1 -1
  21. package/dist-embed-scene/{LaunchSimulation-DL7QBfEl.js → LaunchSimulation-DNNEzmzs.js} +1 -1
  22. package/dist-embed-scene/{ModuleSession-BvQABNEZ.js → ModuleSession-DLoAutYP.js} +2 -2
  23. package/dist-embed-scene/ModuleThree-R2LhnY95.js +1 -0
  24. package/dist-embed-scene/{ParameterForm-BMIW4Gkh.js → ParameterForm-ez-n_0Dw.js} +9 -9
  25. package/dist-embed-scene/{RailwaySystem-DZQr_rS_.js → RailwaySystem-C3Y0a9aT.js} +1 -1
  26. package/dist-embed-scene/{ReentryEditor-DJO_M-8-.js → ReentryEditor-CwY4oANp.js} +1 -1
  27. package/dist-embed-scene/{ReentrySimulation-pWRgNLjt.js → ReentrySimulation-BDgEPekW.js} +1 -1
  28. package/dist-embed-scene/ReferenceSystem-D9IdSvFM.js +1 -0
  29. package/dist-embed-scene/{SceneNames_en-CqzjDgS4.js → SceneNames_en-BCTAMSLj.js} +1 -1
  30. package/dist-embed-scene/{SceneNames_es-DMfxIS0T.js → SceneNames_es-BOWBdXXS.js} +1 -1
  31. package/dist-embed-scene/{SceneNames_fr-DydzEE4a.js → SceneNames_fr-De6iQ9ff.js} +1 -1
  32. package/dist-embed-scene/{SceneNames_it-DJAACEvb.js → SceneNames_it-DfBWbCPR.js} +1 -1
  33. package/dist-embed-scene/{TimelineTracks-B-bXAaF7.js → TimelineTracks-BQXJMJaJ.js} +1 -1
  34. package/dist-embed-scene/{TraceSystem-gVZk_ffU.js → TraceSystem-BD6YpW6g.js} +2 -2
  35. package/dist-embed-scene/UfoMessages_en-CXQNZd8v.js +1 -0
  36. package/dist-embed-scene/UfoMessages_es-CO-v8Jl6.js +1 -0
  37. package/dist-embed-scene/UfoMessages_fr-CGkQBn5r.js +1 -0
  38. package/dist-embed-scene/UfoMessages_it-BScqxIaH.js +1 -0
  39. package/dist-embed-scene/VideoButton-Cy_r767Z.js +1 -0
  40. package/dist-embed-scene/VideoExport-B8ZhHNnd.js +169 -0
  41. package/dist-embed-scene/{WaterSystem-DI_NBDfH.js → WaterSystem-DbyWlKho.js} +1 -1
  42. package/dist-embed-scene/browser-CltifEM0.js +1 -0
  43. package/dist-embed-scene/logo-h2-w4Mwu.png +0 -0
  44. package/dist-embed-scene/rr0-scene.mjs +438 -308
  45. package/dist-embed-scene/{sightingSchema-BfOYR_OD.js → sightingSchema-pBDQNwMz.js} +1 -1
  46. package/dist-embed-scene/trafficRuntime-CJIPy2oO.js +2 -0
  47. package/dist-embed-sighting/{AdsbLolArchiveProvider-DK4qEYPv.js → AdsbLolArchiveProvider-BqLvFUVC.js} +1 -1
  48. package/dist-embed-sighting/{BallesterGuaspAssessor-FGskpWWG.js → BallesterGuaspAssessor-CLQvJKlm.js} +1 -1
  49. package/dist-embed-sighting/{BeamEditor-BglkfKa6.js → BeamEditor-CcOf6lNz.js} +1 -1
  50. package/dist-embed-sighting/{BeamSystem-DDtPjozC.js → BeamSystem-B5d0Ymn5.js} +1 -1
  51. package/dist-embed-sighting/CaseExportMessages_en-jHlu58Y7.js +1 -0
  52. package/dist-embed-sighting/CaseExportMessages_es-dCQQFgjq.js +1 -0
  53. package/dist-embed-sighting/CaseExportMessages_fr-sDfEgjWg.js +1 -0
  54. package/dist-embed-sighting/CaseExportMessages_it-BJaglZtP.js +1 -0
  55. package/dist-embed-sighting/CaseMessages_en-CBS5QChl.js +1 -0
  56. package/dist-embed-sighting/CaseMessages_es-DAMl4aTC.js +1 -0
  57. package/dist-embed-sighting/CaseMessages_fr-C3wQxAk_.js +1 -0
  58. package/dist-embed-sighting/CaseMessages_it-CyrREg6v.js +1 -0
  59. package/dist-embed-sighting/CaseReportExport-N7KM0IT0.js +65 -0
  60. package/dist-embed-sighting/CaseReportTexts_en-DlN7p1pC.js +1 -0
  61. package/dist-embed-sighting/CaseReportTexts_es-CncAEaey.js +1 -0
  62. package/dist-embed-sighting/CaseReportTexts_fr-B5nP6RlP.js +1 -0
  63. package/dist-embed-sighting/CaseReportTexts_it-Dc-oPmXB.js +1 -0
  64. package/dist-embed-sighting/{ContrailSystem-DXV0DnrQ.js → ContrailSystem-CqpZgLkb.js} +1 -1
  65. package/dist-embed-sighting/ControlPasses-BxgSO3B9.js +29 -0
  66. package/dist-embed-sighting/FilmChrome-DYiyzoB_.js +1 -0
  67. package/dist-embed-sighting/{Flightradar24Provider-Ch4GdVJG.js → Flightradar24Provider-DQtEJ3tX.js} +1 -1
  68. package/dist-embed-sighting/GLTFLoader-VIIHsteW.js +1 -0
  69. package/dist-embed-sighting/GenerativeKit-BmhvjjzB.js +9 -0
  70. package/dist-embed-sighting/GenerativeKitMessages-CRj85mnY.js +1 -0
  71. package/dist-embed-sighting/GenerativeKitMessages_en-BY4B6yas.js +34 -0
  72. package/dist-embed-sighting/GenerativeKitMessages_es-_iYkoRhK.js +34 -0
  73. package/dist-embed-sighting/GenerativeKitMessages_fr-BY5yUJwK.js +34 -0
  74. package/dist-embed-sighting/GenerativeKitMessages_it-DAgB31P1.js +34 -0
  75. package/dist-embed-sighting/HeadlightSystem-B4RR270O.js +34 -0
  76. package/dist-embed-sighting/{HynekAssessor-Cb8mZ9Ib.js → HynekAssessor-CJ9APziM.js} +1 -1
  77. package/dist-embed-sighting/LanternEditor-D1BA5pRP.js +9 -0
  78. package/dist-embed-sighting/{LaserBeam-DkKFSSp_.js → LaserBeam-BjjC_CzP.js} +1 -1
  79. package/dist-embed-sighting/LaunchEditor-TTSgWqbE.js +22 -0
  80. package/dist-embed-sighting/LaunchPlume-B2Fjd2_C.js +1 -0
  81. package/dist-embed-sighting/{LaunchSimulation-DUvH6_BB.js → LaunchSimulation-BcmPicEe.js} +1 -1
  82. package/dist-embed-sighting/{ModuleSession-GzfQ8_LE.js → ModuleSession-CY9_UusZ.js} +2 -2
  83. package/dist-embed-sighting/ModuleThree-BhryLUjX.js +1 -0
  84. package/dist-embed-sighting/{NearestApproach-BeKwz4vK.js → NearestApproach-iBLl7o1g.js} +1 -1
  85. package/dist-embed-sighting/ParameterForm-BaUeWd7v.js +91 -0
  86. package/dist-embed-sighting/{PoherAssessor-JLqDISRf.js → PoherAssessor-DDRUgnRW.js} +1 -1
  87. package/dist-embed-sighting/RailwaySystem-C1nfRJfj.js +41 -0
  88. package/dist-embed-sighting/ReadingSensitivityMessages_en-CF6XauSj.js +1 -0
  89. package/dist-embed-sighting/ReadingSensitivityMessages_es-Ca-13TTT.js +1 -0
  90. package/dist-embed-sighting/ReadingSensitivityMessages_fr-Djdd6Hdq.js +1 -0
  91. package/dist-embed-sighting/ReadingSensitivityMessages_it-CPUXxMqD.js +1 -0
  92. package/dist-embed-sighting/{ReentryEditor-BHgPXlx3.js → ReentryEditor-CGN3ewTE.js} +1 -1
  93. package/dist-embed-sighting/ReentrySimulation-C2kIulZ6.js +1 -0
  94. package/dist-embed-sighting/{ReferenceSystem-B5diz1Lt.js → ReferenceSystem-BRTCOQHk.js} +1 -1
  95. package/dist-embed-sighting/{RoadMarkings-Dv3xdtFG.js → RoadMarkings-CNLt-BEg.js} +1 -1
  96. package/dist-embed-sighting/{SceneNames_en-BbQ55UYu.js → SceneNames_en-ChY7v63o.js} +1 -1
  97. package/dist-embed-sighting/{SceneNames_es-DsJpGSDK.js → SceneNames_es-DH4YgJV5.js} +1 -1
  98. package/dist-embed-sighting/{SceneNames_fr-CKr5m8QL.js → SceneNames_fr-Ca52lykk.js} +1 -1
  99. package/dist-embed-sighting/{SceneNames_it-qSw1j95v.js → SceneNames_it-BQe9GLaj.js} +1 -1
  100. package/dist-embed-sighting/{SightingMessages_en-DuokT218.js → SightingMessages_en-Xm6PILcs.js} +1 -1
  101. package/dist-embed-sighting/{SightingMessages_es-JO8WQ1_V.js → SightingMessages_es-DMp0MUjJ.js} +1 -1
  102. package/dist-embed-sighting/{SightingMessages_fr-3C2RZVNA.js → SightingMessages_fr-NvQKGPaf.js} +1 -1
  103. package/dist-embed-sighting/{SightingMessages_it-BEMBUACg.js → SightingMessages_it-CKIf49Zt.js} +1 -1
  104. package/dist-embed-sighting/{TimelineTracks-XzShW15O.js → TimelineTracks-Ddv5sZHp.js} +1 -1
  105. package/{dist-embed-sighting-editor/TraceSystem-CDHG18il.js → dist-embed-sighting/TraceSystem-BkUPo1Xf.js} +2 -2
  106. package/dist-embed-sighting/UfoMessages_en-cLvtpfIC.js +1 -0
  107. package/dist-embed-sighting/UfoMessages_es-CO-v8Jl6.js +1 -0
  108. package/dist-embed-sighting/UfoMessages_fr-CGkQBn5r.js +1 -0
  109. package/dist-embed-sighting/UfoMessages_it-BScqxIaH.js +1 -0
  110. package/dist-embed-sighting/VideoButton-C62NkJrH.js +1 -0
  111. package/dist-embed-sighting/VideoExport-B8ZhHNnd.js +169 -0
  112. package/dist-embed-sighting/{WaterSystem-CcLIPQfy.js → WaterSystem-DrSAhM5g.js} +1 -1
  113. package/dist-embed-sighting/browser-CltifEM0.js +1 -0
  114. package/dist-embed-sighting/logo-h2-w4Mwu.png +0 -0
  115. package/dist-embed-sighting/rr0-sighting.mjs +543 -349
  116. package/dist-embed-sighting/{sightingSchema-BfOYR_OD.js → sightingSchema-pBDQNwMz.js} +1 -1
  117. package/dist-embed-sighting/trafficRuntime-CFgDqQz4.js +2 -0
  118. package/dist-embed-sighting-editor/{AdsbLolArchiveProvider-CXB-CDQ2.js → AdsbLolArchiveProvider-fZkxLAHp.js} +1 -1
  119. package/dist-embed-sighting-editor/{BallesterGuaspAssessor-Bb8Kl2FU.js → BallesterGuaspAssessor-DASadJjI.js} +1 -1
  120. package/dist-embed-sighting-editor/{BeamEditor-DJtZYFp0.js → BeamEditor-B2diaX_e.js} +1 -1
  121. package/dist-embed-sighting-editor/{BeamSystem-C6Wk_vNQ.js → BeamSystem-BfNJfayv.js} +1 -1
  122. package/dist-embed-sighting-editor/{BodyEditor-Cj7TgjV-.js → BodyEditor-CCBXFuuL.js} +1 -1
  123. package/dist-embed-sighting-editor/BodyEditorMessages_en-CckxSS1L.js +1 -0
  124. package/dist-embed-sighting-editor/BodyEditorMessages_es-B8GlFFBo.js +1 -0
  125. package/dist-embed-sighting-editor/BodyEditorMessages_fr-638ypdqf.js +1 -0
  126. package/dist-embed-sighting-editor/BodyEditorMessages_it-SKpMkHFI.js +1 -0
  127. package/dist-embed-sighting-editor/CaseEditorMessages_en-DrJY0M8h.js +1 -0
  128. package/dist-embed-sighting-editor/CaseEditorMessages_es-j8EeOBq6.js +1 -0
  129. package/dist-embed-sighting-editor/CaseEditorMessages_fr-BkwEF9mu.js +1 -0
  130. package/dist-embed-sighting-editor/CaseEditorMessages_it-d3Z0PBEw.js +1 -0
  131. package/dist-embed-sighting-editor/CaseExportMessages_en-jHlu58Y7.js +1 -0
  132. package/dist-embed-sighting-editor/CaseExportMessages_es-dCQQFgjq.js +1 -0
  133. package/dist-embed-sighting-editor/CaseExportMessages_fr-sDfEgjWg.js +1 -0
  134. package/dist-embed-sighting-editor/CaseExportMessages_it-BJaglZtP.js +1 -0
  135. package/dist-embed-sighting-editor/CaseReportExport-C1trLSiC.js +65 -0
  136. package/dist-embed-sighting-editor/CaseReportTexts_en-DlN7p1pC.js +1 -0
  137. package/dist-embed-sighting-editor/CaseReportTexts_es-CncAEaey.js +1 -0
  138. package/dist-embed-sighting-editor/CaseReportTexts_fr-B5nP6RlP.js +1 -0
  139. package/dist-embed-sighting-editor/CaseReportTexts_it-Dc-oPmXB.js +1 -0
  140. package/dist-embed-sighting-editor/{ContrailSystem-e-OLIzTk.js → ContrailSystem-BWvO9taK.js} +1 -1
  141. package/dist-embed-sighting-editor/ControlPasses-BQ_DUxa_.js +29 -0
  142. package/dist-embed-sighting-editor/{CoverageAssessor-DUDmS-aG.js → CoverageAssessor-CSktyUlP.js} +1 -1
  143. package/dist-embed-sighting-editor/FilmChrome-DYiyzoB_.js +1 -0
  144. package/dist-embed-sighting-editor/{Flightradar24Provider-DtcvpdT3.js → Flightradar24Provider-OvRZWZWj.js} +1 -1
  145. package/dist-embed-sighting-editor/{GLTFLoader-AHdd-c6G.js → GLTFLoader-CM7Uk25s.js} +1 -1
  146. package/dist-embed-sighting-editor/GenerativeKit-BmhvjjzB.js +9 -0
  147. package/dist-embed-sighting-editor/GenerativeKitMessages-BtNG1usJ.js +1 -0
  148. package/dist-embed-sighting-editor/GenerativeKitMessages_en-BY4B6yas.js +34 -0
  149. package/dist-embed-sighting-editor/GenerativeKitMessages_es-_iYkoRhK.js +34 -0
  150. package/dist-embed-sighting-editor/GenerativeKitMessages_fr-BY5yUJwK.js +34 -0
  151. package/dist-embed-sighting-editor/GenerativeKitMessages_it-DAgB31P1.js +34 -0
  152. package/dist-embed-sighting-editor/{GeoExportTexts-DAllttgw.js → GeoExportTexts-DBGGdRnP.js} +1 -1
  153. package/dist-embed-sighting-editor/{GeoJsonExport-3snOe-2J.js → GeoJsonExport-BZ-0v8fM.js} +1 -1
  154. package/dist-embed-sighting-editor/GeographicFigures-DqhWddS9.js +1 -0
  155. package/dist-embed-sighting-editor/{HeadlightSystem-CLhqQjbe.js → HeadlightSystem-C-8Gl3vu.js} +1 -1
  156. package/dist-embed-sighting-editor/{HynekAssessor-DvVp-CLS.js → HynekAssessor-CH2E88xV.js} +1 -1
  157. package/dist-embed-sighting-editor/{InterviewEditorElement-44XFadV4.js → InterviewEditorElement-Bz3hyZ-m.js} +2 -2
  158. package/dist-embed-sighting-editor/{KmlExport-B0SKgn4U.js → KmlExport-Bh4eTycx.js} +1 -1
  159. package/dist-embed-sighting-editor/{KmlImport-B9mAzJwr.js → KmlImport-CKxaATTA.js} +1 -1
  160. package/dist-embed-sighting-editor/LanternEditor-tTk1vUZm.js +9 -0
  161. package/dist-embed-sighting-editor/{LaserBeam-QJPhnVO_.js → LaserBeam-CtogDP38.js} +1 -1
  162. package/dist-embed-sighting-editor/LaunchEditor-CteAalch.js +22 -0
  163. package/dist-embed-sighting-editor/{LaunchPlume-C_r62XTj.js → LaunchPlume-BtRrJTP9.js} +1 -1
  164. package/dist-embed-sighting-editor/{LaunchSimulation-BSDTfZTv.js → LaunchSimulation-xKwguVJt.js} +1 -1
  165. package/dist-embed-sighting-editor/{ModelSource-B85niY1n.js → ModelSource-CnKzaNDn.js} +1 -1
  166. package/dist-embed-sighting-editor/{ModelThumbnails-uYh2sUIb.js → ModelThumbnails-UE_Er5EW.js} +1 -1
  167. package/dist-embed-sighting-editor/{ModelViewer-DLZhhuq5.js → ModelViewer-DoCshJc6.js} +1 -1
  168. package/dist-embed-sighting-editor/{ModuleConformance-CBMdTSVo.js → ModuleConformance-BKvZnuw9.js} +2 -2
  169. package/dist-embed-sighting-editor/{ModuleSession-rFLStWcj.js → ModuleSession-CJstaNEN.js} +3 -3
  170. package/dist-embed-sighting-editor/ModuleThree-1hxqvWFa.js +1 -0
  171. package/dist-embed-sighting-editor/{ModulesPanelElement-CGp6DrpQ.js → ModulesPanelElement-DdGqqdn4.js} +3 -3
  172. package/dist-embed-sighting-editor/{NearestApproach-Ctw1-XBO.js → NearestApproach-BH3Yw8Qz.js} +1 -1
  173. package/dist-embed-sighting-editor/{PictureRegistration-ZyvGfReK.js → PictureRegistration-B9C6iY17.js} +1 -1
  174. package/dist-embed-sighting-editor/{PoherAssessor-CLKwvgUL.js → PoherAssessor-DWcCWUfa.js} +1 -1
  175. package/dist-embed-sighting-editor/RailwaySystem-D3VBmx1X.js +41 -0
  176. package/dist-embed-sighting-editor/ReadingSensitivityMessages_en-CF6XauSj.js +1 -0
  177. package/dist-embed-sighting-editor/ReadingSensitivityMessages_es-Ca-13TTT.js +1 -0
  178. package/dist-embed-sighting-editor/ReadingSensitivityMessages_fr-Djdd6Hdq.js +1 -0
  179. package/dist-embed-sighting-editor/ReadingSensitivityMessages_it-CPUXxMqD.js +1 -0
  180. package/dist-embed-sighting-editor/{ReentryEditor-DXe8wen6.js → ReentryEditor-BDyG-48K.js} +2 -2
  181. package/dist-embed-sighting-editor/{ReentrySimulation-BxVE5Dsn.js → ReentrySimulation-BQj0wWXW.js} +1 -1
  182. package/dist-embed-sighting-editor/ReferenceSystem-C9NRL7UY.js +1 -0
  183. package/dist-embed-sighting-editor/RoadMarkings-ByQL2MTo.js +1 -0
  184. package/dist-embed-sighting-editor/SceneNames_en-BdRB6cjg.js +1 -0
  185. package/dist-embed-sighting-editor/SceneNames_es-Dk0UmXHp.js +1 -0
  186. package/dist-embed-sighting-editor/SceneNames_fr-_z2iZ8Bm.js +1 -0
  187. package/dist-embed-sighting-editor/SceneNames_it-CE7fanb3.js +1 -0
  188. package/dist-embed-sighting-editor/{SightingEditorMessages_en-G8-sD56V.js → SightingEditorMessages_en-jinQLW0J.js} +1 -1
  189. package/dist-embed-sighting-editor/{SightingEditorMessages_es-DEmsmIRU.js → SightingEditorMessages_es-CsrGiJYn.js} +1 -1
  190. package/dist-embed-sighting-editor/{SightingEditorMessages_fr-D2HXab_N.js → SightingEditorMessages_fr-cQ6KnPU1.js} +1 -1
  191. package/dist-embed-sighting-editor/{SightingEditorMessages_it-LpFdlGY5.js → SightingEditorMessages_it-D3Rqso5s.js} +1 -1
  192. package/dist-embed-sighting-editor/{SightingFileEditor-CnKF2ndt.js → SightingFileEditor-BCjntT4l.js} +1 -1
  193. package/dist-embed-sighting-editor/{TraceImport-CL8lefw6.js → TraceImport-uGVIjCrc.js} +2 -2
  194. package/{dist-embed-sighting/TraceSystem-XybhI4uJ.js → dist-embed-sighting-editor/TraceSystem-g262KZ3G.js} +2 -2
  195. package/dist-embed-sighting-editor/UfoMessages_en-JeMK-39o.js +1 -0
  196. package/dist-embed-sighting-editor/UfoMessages_es-CO-v8Jl6.js +1 -0
  197. package/dist-embed-sighting-editor/UfoMessages_fr-CGkQBn5r.js +1 -0
  198. package/dist-embed-sighting-editor/UfoMessages_it-BScqxIaH.js +1 -0
  199. package/dist-embed-sighting-editor/VideoButton-CqCZ65oK.js +1 -0
  200. package/dist-embed-sighting-editor/VideoExport-B8ZhHNnd.js +169 -0
  201. package/dist-embed-sighting-editor/WaterSystem-CIbQPMqE.js +1 -0
  202. package/dist-embed-sighting-editor/browser-CltifEM0.js +1 -0
  203. package/dist-embed-sighting-editor/logo-h2-w4Mwu.png +0 -0
  204. package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +622 -410
  205. package/dist-embed-sighting-editor/{sightingSchema-9xw8srxN.js → sightingSchema-RamhmoRU.js} +1 -1
  206. package/dist-embed-sighting-editor/{surroundingsSources-DXpzMDPy.js → surroundingsSources-BExFsNzP.js} +1 -1
  207. package/dist-embed-sighting-editor/trafficRuntime-CPRQW0Ho.js +2 -0
  208. package/package.json +2 -1
  209. package/dist-embed-scene/GLTFLoader-DDba3PaV.js +0 -1
  210. package/dist-embed-scene/LanternEditor-2q5seAWj.js +0 -9
  211. package/dist-embed-scene/LaunchEditor-Cupksu8A.js +0 -22
  212. package/dist-embed-scene/ModuleThree-12Uq6OyD.js +0 -1
  213. package/dist-embed-scene/ReferenceSystem-D9agTeWl.js +0 -1
  214. package/dist-embed-scene/UfoMessages_en-CRIdIMYy.js +0 -1
  215. package/dist-embed-scene/UfoMessages_es-BoulVpJw.js +0 -1
  216. package/dist-embed-scene/UfoMessages_fr-8f6FJbk6.js +0 -1
  217. package/dist-embed-scene/UfoMessages_it-cngzFg3N.js +0 -1
  218. package/dist-embed-scene/browser-_Ncw3Jhn.js +0 -1
  219. package/dist-embed-scene/trafficRuntime-BDtw1Kqi.js +0 -2
  220. package/dist-embed-sighting/CaseMessages_en-DEyvxYxv.js +0 -1
  221. package/dist-embed-sighting/CaseMessages_es-DDsQ93tK.js +0 -1
  222. package/dist-embed-sighting/CaseMessages_fr-DoHbDEkG.js +0 -1
  223. package/dist-embed-sighting/CaseMessages_it-CF8sKknV.js +0 -1
  224. package/dist-embed-sighting/GLTFLoader-BDyucwJ-.js +0 -1
  225. package/dist-embed-sighting/HeadlightSystem-DGUfgm2c.js +0 -34
  226. package/dist-embed-sighting/LanternEditor-CaZ1JhZS.js +0 -9
  227. package/dist-embed-sighting/LaunchEditor-QRG2uHH8.js +0 -22
  228. package/dist-embed-sighting/LaunchPlume-DBINBQgQ.js +0 -1
  229. package/dist-embed-sighting/ModuleThree-tnKi-oul.js +0 -1
  230. package/dist-embed-sighting/ParameterForm-DW6cQmYI.js +0 -91
  231. package/dist-embed-sighting/RailwaySystem-BfTJvmf3.js +0 -41
  232. package/dist-embed-sighting/ReentrySimulation-C3BR2hs3.js +0 -1
  233. package/dist-embed-sighting/UfoMessages_en-CoSqGYwb.js +0 -1
  234. package/dist-embed-sighting/UfoMessages_es-BoulVpJw.js +0 -1
  235. package/dist-embed-sighting/UfoMessages_fr-8f6FJbk6.js +0 -1
  236. package/dist-embed-sighting/UfoMessages_it-cngzFg3N.js +0 -1
  237. package/dist-embed-sighting/browser-_Ncw3Jhn.js +0 -1
  238. package/dist-embed-sighting/trafficRuntime-BAuwwA-Z.js +0 -2
  239. package/dist-embed-sighting-editor/BodyEditorMessages_en-zfy3BJb5.js +0 -1
  240. package/dist-embed-sighting-editor/BodyEditorMessages_es-w95anMnI.js +0 -1
  241. package/dist-embed-sighting-editor/BodyEditorMessages_fr-ixsDgTbt.js +0 -1
  242. package/dist-embed-sighting-editor/BodyEditorMessages_it-B3oQzqHE.js +0 -1
  243. package/dist-embed-sighting-editor/CaseEditorMessages_en-D47ntA6R.js +0 -1
  244. package/dist-embed-sighting-editor/CaseEditorMessages_es-CyIdBeD_.js +0 -1
  245. package/dist-embed-sighting-editor/CaseEditorMessages_fr-DXaZI1jZ.js +0 -1
  246. package/dist-embed-sighting-editor/CaseEditorMessages_it-Cp1-Jm34.js +0 -1
  247. package/dist-embed-sighting-editor/GeographicFigures-CLBS2HJ-.js +0 -1
  248. package/dist-embed-sighting-editor/LanternEditor-ngKN2Zt3.js +0 -9
  249. package/dist-embed-sighting-editor/LaunchEditor-B8KlP5eo.js +0 -22
  250. package/dist-embed-sighting-editor/ModuleThree-DrKN6B-3.js +0 -1
  251. package/dist-embed-sighting-editor/RailwaySystem-C67LdkZv.js +0 -41
  252. package/dist-embed-sighting-editor/ReferenceSystem-B201fXMC.js +0 -1
  253. package/dist-embed-sighting-editor/RoadMarkings-DJ2HL-6g.js +0 -1
  254. package/dist-embed-sighting-editor/SceneNames_en-DggkchR4.js +0 -1
  255. package/dist-embed-sighting-editor/SceneNames_es-BtXXqtTk.js +0 -1
  256. package/dist-embed-sighting-editor/SceneNames_fr-I6FOP0oQ.js +0 -1
  257. package/dist-embed-sighting-editor/SceneNames_it-DrW4eXBX.js +0 -1
  258. package/dist-embed-sighting-editor/UfoMessages_en-BxhQNf5z.js +0 -1
  259. package/dist-embed-sighting-editor/UfoMessages_es-BoulVpJw.js +0 -1
  260. package/dist-embed-sighting-editor/UfoMessages_fr-8f6FJbk6.js +0 -1
  261. package/dist-embed-sighting-editor/UfoMessages_it-cngzFg3N.js +0 -1
  262. package/dist-embed-sighting-editor/WaterSystem-B2xlCmn2.js +0 -1
  263. package/dist-embed-sighting-editor/browser-_Ncw3Jhn.js +0 -1
  264. package/dist-embed-sighting-editor/trafficRuntime-_7Uw8kC_.js +0 -2
@@ -0,0 +1 @@
1
+ import{ak as Le,al as Q,am as he,an as Me,ao as v,ap as de,d as w,V as pe,C as F,aq as N,a7 as U,X as Se,ar as ye,as as we,w as B,at as Ne,p as C,a5 as me,au as be,ad as ge,av as Ie,aw as Oe,i as V,ax as Ce,ay as Te,az as Fe,aA as Pe,aB as He,a8 as J,a2 as Re,aC as Z,aD as ke,aE as De,z as Ge,aF as X,aG as ve,h as Ee,Q as Ue,N as G,aH as Be,B as Ke,aI as je,e as Ve,aJ as Xe,aK as ze,aL as qe,E as We,G as z,$ as Ye,x as Qe,aM as Je,aN as Ze,aO as $e,aP as en,aQ as nn,aR as tn,aS as xe,m as sn,a9 as ne,aT as te,aU as se,aV as ie,aW as re,aX as rn,aY as on,n as an,o as cn}from"./rr0-scene.mjs";function oe(f,n){if(n===Le)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),f;if(n===Q||n===he){let e=f.getIndex();if(e===null){const r=[],a=f.getAttribute("position");if(a!==void 0){for(let o=0;o<a.count;o++)r.push(o);f.setIndex(r),e=f.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),f}const s=e.count-2,t=[];if(n===Q)for(let r=1;r<=s;r++)t.push(e.getX(0)),t.push(e.getX(r)),t.push(e.getX(r+1));else for(let r=0;r<s;r++)r%2===0?(t.push(e.getX(r)),t.push(e.getX(r+1)),t.push(e.getX(r+2))):(t.push(e.getX(r+2)),t.push(e.getX(r+1)),t.push(e.getX(r)));t.length/3!==s&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const i=f.clone();return i.setIndex(t),i.clearGroups(),i}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",n),f}class jn extends Me{constructor(n){super(n),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new dn(e)}),this.register(function(e){return new pn(e)}),this.register(function(e){return new Ln(e)}),this.register(function(e){return new Mn(e)}),this.register(function(e){return new Sn(e)}),this.register(function(e){return new gn(e)}),this.register(function(e){return new Tn(e)}),this.register(function(e){return new Rn(e)}),this.register(function(e){return new En(e)}),this.register(function(e){return new hn(e)}),this.register(function(e){return new xn(e)}),this.register(function(e){return new mn(e)}),this.register(function(e){return new _n(e)}),this.register(function(e){return new An(e)}),this.register(function(e){return new ln(e)}),this.register(function(e){return new ae(e,g.EXT_MESHOPT_COMPRESSION)}),this.register(function(e){return new ae(e,g.KHR_MESHOPT_COMPRESSION)}),this.register(function(e){return new yn(e)})}load(n,e,s,t){const i=this;let r;if(this.resourcePath!=="")r=this.resourcePath;else if(this.path!==""){const c=v.extractUrlBase(n);r=v.resolveURL(c,this.path)}else r=v.extractUrlBase(n);this.manager.itemStart(n);const a=function(c){t?t(c):console.error(c),i.manager.itemError(n),i.manager.itemEnd(n)},o=new de(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(n,function(c){try{i.parse(c,r,function(u){e(u),i.manager.itemEnd(n)},a)}catch(u){a(u)}},s,a)}setDRACOLoader(n){return this.dracoLoader=n,this}setKTX2Loader(n){return this.ktx2Loader=n,this}setMeshoptDecoder(n){return this.meshoptDecoder=n,this}register(n){return this.pluginCallbacks.indexOf(n)===-1&&this.pluginCallbacks.push(n),this}unregister(n){return this.pluginCallbacks.indexOf(n)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(n),1),this}parse(n,e,s,t){let i;const r={},a={},o=new TextDecoder;if(typeof n=="string")i=JSON.parse(n);else if(n instanceof ArrayBuffer)if(o.decode(new Uint8Array(n,0,4))===Ae){try{r[g.KHR_BINARY_GLTF]=new wn(n)}catch(l){t&&t(l);return}i=JSON.parse(r[g.KHR_BINARY_GLTF].content)}else i=JSON.parse(o.decode(n));else i=n;if(i.asset===void 0||i.asset.version[0]<2){t&&t(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const c=new Un(i,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u<this.pluginCallbacks.length;u++){const l=this.pluginCallbacks[u](c);l.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[l.name]=l,r[l.name]=!0}if(i.extensionsUsed)for(let u=0;u<i.extensionsUsed.length;++u){const l=i.extensionsUsed[u],h=i.extensionsRequired||[];switch(l){case g.KHR_MATERIALS_UNLIT:r[l]=new fn;break;case g.KHR_DRACO_MESH_COMPRESSION:r[l]=new Nn(i,this.dracoLoader);break;case g.KHR_TEXTURE_TRANSFORM:r[l]=new bn;break;case g.KHR_MESH_QUANTIZATION:r[l]=new In;break;default:h.indexOf(l)>=0&&a[l]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+l+'".')}}c.setExtensions(r),c.setPlugins(a),c.parse(s,t)}parseAsync(n,e){const s=this;return new Promise(function(t,i){s.parse(n,e,t,i)})}}function un(){let f={};return{get:function(n){return f[n]},add:function(n,e){f[n]=e},remove:function(n){delete f[n]},removeAll:function(){f={}}}}function _(f,n,e){const s=f.json.materials[n];return s.extensions&&s.extensions[e]?s.extensions[e]:null}const g={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",KHR_MESHOPT_COMPRESSION:"KHR_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class ln{constructor(n){this.parser=n,this.name=g.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const n=this.parser,e=this.parser.json.nodes||[];for(let s=0,t=e.length;s<t;s++){const i=e[s];i.extensions&&i.extensions[this.name]&&i.extensions[this.name].light!==void 0&&n._addNodeRef(this.cache,i.extensions[this.name].light)}}_loadLight(n){const e=this.parser,s="light:"+n;let t=e.cache.get(s);if(t)return t;const i=e.json,o=((i.extensions&&i.extensions[this.name]||{}).lights||[])[n];let c;const u=new F(16777215);o.color!==void 0&&u.setRGB(o.color[0],o.color[1],o.color[2],N);const l=o.range!==void 0?o.range:0;switch(o.type){case"directional":c=new we(u),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new ye(u),c.distance=l;break;case"spot":c=new Se(u),c.distance=l,o.spot=o.spot||{},o.spot.innerConeAngle=o.spot.innerConeAngle!==void 0?o.spot.innerConeAngle:0,o.spot.outerConeAngle=o.spot.outerConeAngle!==void 0?o.spot.outerConeAngle:Math.PI/4,c.angle=o.spot.outerConeAngle,c.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return c.position.set(0,0,0),y(c,o),o.intensity!==void 0&&(c.intensity=o.intensity),c.name=e.createUniqueName(o.name||"light_"+n),t=Promise.resolve(c),e.cache.add(s,t),t}getDependency(n,e){if(n==="light")return this._loadLight(e)}createNodeAttachment(n){const e=this,s=this.parser,i=s.json.nodes[n],a=(i.extensions&&i.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(o){return s._getNodeRef(e.cache,a,o)})}}class fn{constructor(){this.name=g.KHR_MATERIALS_UNLIT}getMaterialType(){return G}extendParams(n,e,s){const t=[];n.color=new F(1,1,1),n.opacity=1;const i=e.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){const r=i.baseColorFactor;n.color.setRGB(r[0],r[1],r[2],N),n.opacity=r[3]}i.baseColorTexture!==void 0&&t.push(s.assignTexture(n,"map",i.baseColorTexture,U))}return Promise.all(t)}}class hn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);return s===null||s.emissiveStrength!==void 0&&(e.emissiveIntensity=s.emissiveStrength),Promise.resolve()}}class dn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_CLEARCOAT}getMaterialType(n){return _(this.parser,n,this.name)!==null?w:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];if(s.clearcoatFactor!==void 0&&(e.clearcoat=s.clearcoatFactor),s.clearcoatTexture!==void 0&&t.push(this.parser.assignTexture(e,"clearcoatMap",s.clearcoatTexture)),s.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=s.clearcoatRoughnessFactor),s.clearcoatRoughnessTexture!==void 0&&t.push(this.parser.assignTexture(e,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),s.clearcoatNormalTexture!==void 0&&(t.push(this.parser.assignTexture(e,"clearcoatNormalMap",s.clearcoatNormalTexture)),s.clearcoatNormalTexture.scale!==void 0)){const i=s.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new pe(i,i)}return Promise.all(t)}}class pn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_DISPERSION}getMaterialType(n){return _(this.parser,n,this.name)!==null?w:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);return s===null||(e.dispersion=s.dispersion!==void 0?s.dispersion:0),Promise.resolve()}}class mn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_IRIDESCENCE}getMaterialType(n){return _(this.parser,n,this.name)!==null?w:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];return s.iridescenceFactor!==void 0&&(e.iridescence=s.iridescenceFactor),s.iridescenceTexture!==void 0&&t.push(this.parser.assignTexture(e,"iridescenceMap",s.iridescenceTexture)),s.iridescenceIor!==void 0&&(e.iridescenceIOR=s.iridescenceIor),e.iridescenceThicknessRange===void 0&&(e.iridescenceThicknessRange=[100,400]),s.iridescenceThicknessMinimum!==void 0&&(e.iridescenceThicknessRange[0]=s.iridescenceThicknessMinimum),s.iridescenceThicknessMaximum!==void 0&&(e.iridescenceThicknessRange[1]=s.iridescenceThicknessMaximum),s.iridescenceThicknessTexture!==void 0&&t.push(this.parser.assignTexture(e,"iridescenceThicknessMap",s.iridescenceThicknessTexture)),Promise.all(t)}}class gn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_SHEEN}getMaterialType(n){return _(this.parser,n,this.name)!==null?w:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];if(e.sheenColor=new F(0,0,0),e.sheenRoughness=0,e.sheen=1,s.sheenColorFactor!==void 0){const i=s.sheenColorFactor;e.sheenColor.setRGB(i[0],i[1],i[2],N)}return s.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=s.sheenRoughnessFactor),s.sheenColorTexture!==void 0&&t.push(this.parser.assignTexture(e,"sheenColorMap",s.sheenColorTexture,U)),s.sheenRoughnessTexture!==void 0&&t.push(this.parser.assignTexture(e,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(t)}}class Tn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_TRANSMISSION}getMaterialType(n){return _(this.parser,n,this.name)!==null?w:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];return s.transmissionFactor!==void 0&&(e.transmission=s.transmissionFactor),s.transmissionTexture!==void 0&&t.push(this.parser.assignTexture(e,"transmissionMap",s.transmissionTexture)),Promise.all(t)}}class Rn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_VOLUME}getMaterialType(n){return _(this.parser,n,this.name)!==null?w:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];e.thickness=s.thicknessFactor!==void 0?s.thicknessFactor:0,s.thicknessTexture!==void 0&&t.push(this.parser.assignTexture(e,"thicknessMap",s.thicknessTexture)),e.attenuationDistance=s.attenuationDistance||1/0;const i=s.attenuationColor||[1,1,1];return e.attenuationColor=new F().setRGB(i[0],i[1],i[2],N),Promise.all(t)}}class En{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_IOR}getMaterialType(n){return _(this.parser,n,this.name)!==null?w:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);return s===null||(e.ior=s.ior!==void 0?s.ior:1.5,e.ior===0&&(e.ior=1e3)),Promise.resolve()}}class xn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_SPECULAR}getMaterialType(n){return _(this.parser,n,this.name)!==null?w:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];e.specularIntensity=s.specularFactor!==void 0?s.specularFactor:1,s.specularTexture!==void 0&&t.push(this.parser.assignTexture(e,"specularIntensityMap",s.specularTexture));const i=s.specularColorFactor||[1,1,1];return e.specularColor=new F().setRGB(i[0],i[1],i[2],N),s.specularColorTexture!==void 0&&t.push(this.parser.assignTexture(e,"specularColorMap",s.specularColorTexture,U)),Promise.all(t)}}class An{constructor(n){this.parser=n,this.name=g.EXT_MATERIALS_BUMP}getMaterialType(n){return _(this.parser,n,this.name)!==null?w:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];return e.bumpScale=s.bumpFactor!==void 0?s.bumpFactor:1,s.bumpTexture!==void 0&&t.push(this.parser.assignTexture(e,"bumpMap",s.bumpTexture)),Promise.all(t)}}class _n{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_ANISOTROPY}getMaterialType(n){return _(this.parser,n,this.name)!==null?w:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];return s.anisotropyStrength!==void 0&&(e.anisotropy=s.anisotropyStrength),s.anisotropyRotation!==void 0&&(e.anisotropyRotation=s.anisotropyRotation),s.anisotropyTexture!==void 0&&t.push(this.parser.assignTexture(e,"anisotropyMap",s.anisotropyTexture)),Promise.all(t)}}class Ln{constructor(n){this.parser=n,this.name=g.KHR_TEXTURE_BASISU}loadTexture(n){const e=this.parser,s=e.json,t=s.textures[n];if(!t.extensions||!t.extensions[this.name])return null;const i=t.extensions[this.name],r=e.options.ktx2Loader;if(!r){if(s.extensionsRequired&&s.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(n,i.source,r)}}class Mn{constructor(n){this.parser=n,this.name=g.EXT_TEXTURE_WEBP}loadTexture(n){const e=this.name,s=this.parser,t=s.json,i=t.textures[n];if(!i.extensions||!i.extensions[e])return null;const r=i.extensions[e],a=t.images[r.source];let o=s.textureLoader;if(a.uri){const c=s.options.manager.getHandler(a.uri);c!==null&&(o=c)}return s.loadTextureImage(n,r.source,o)}}class Sn{constructor(n){this.parser=n,this.name=g.EXT_TEXTURE_AVIF}loadTexture(n){const e=this.name,s=this.parser,t=s.json,i=t.textures[n];if(!i.extensions||!i.extensions[e])return null;const r=i.extensions[e],a=t.images[r.source];let o=s.textureLoader;if(a.uri){const c=s.options.manager.getHandler(a.uri);c!==null&&(o=c)}return s.loadTextureImage(n,r.source,o)}}class ae{constructor(n,e){this.name=e,this.parser=n}loadBufferView(n){const e=this.parser.json,s=e.bufferViews[n];if(s.extensions&&s.extensions[this.name]){const t=s.extensions[this.name],i=this.parser.getDependency("buffer",t.buffer),r=this.parser.options.meshoptDecoder;if(!r||!r.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return i.then(function(a){const o=t.byteOffset||0,c=t.byteLength||0,u=t.count,l=t.byteStride,h=new Uint8Array(a,o,c);return r.decodeGltfBufferAsync?r.decodeGltfBufferAsync(u,l,h,t.mode,t.filter).then(function(d){return d.buffer}):r.ready.then(function(){const d=new ArrayBuffer(u*l);return r.decodeGltfBuffer(new Uint8Array(d),u,l,h,t.mode,t.filter),d})})}else return null}}class yn{constructor(n){this.name=g.EXT_MESH_GPU_INSTANCING,this.parser=n}createNodeMesh(n){const e=this.parser.json,s=e.nodes[n];if(!s.extensions||!s.extensions[this.name]||s.mesh===void 0)return null;const t=e.meshes[s.mesh];for(const c of t.primitives)if(c.mode!==M.TRIANGLES&&c.mode!==M.TRIANGLE_STRIP&&c.mode!==M.TRIANGLE_FAN&&c.mode!==void 0)return null;const r=s.extensions[this.name].attributes,a=[],o={};for(const c in r)a.push(this.parser.getDependency("accessor",r[c]).then(u=>(o[c]=u,o[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(n)),Promise.all(a).then(c=>{const u=c.pop(),l=u.isGroup?u.children:[u],h=c[0].count,d=[];for(const p of l){const R=new B,m=new C,T=new me,A=new C(1,1,1),x=new Ne(p.geometry,p.material,h);for(let E=0;E<h;E++)o.TRANSLATION&&m.fromBufferAttribute(o.TRANSLATION,E),o.ROTATION&&T.fromBufferAttribute(o.ROTATION,E),o.SCALE&&A.fromBufferAttribute(o.SCALE,E),x.setMatrixAt(E,R.compose(m,T,A));for(const E in o)if(E==="_COLOR_0"){const L=o[E];x.instanceColor=new be(L.array,L.itemSize,L.normalized)}else E!=="TRANSLATION"&&E!=="ROTATION"&&E!=="SCALE"&&p.geometry.setAttribute(E,o[E]);ge.prototype.copy.call(x,p),this.parser.assignFinalMaterial(x),d.push(x)}return u.isGroup?(u.clear(),u.add(...d),u):d[0]}))}}const Ae="glTF",D=12,ce={JSON:1313821514,BIN:5130562};class wn{constructor(n){this.name=g.KHR_BINARY_GLTF,this.content=null,this.body=null;const e=new DataView(n,0,D),s=new TextDecoder;if(this.header={magic:s.decode(new Uint8Array(n.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==Ae)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const t=this.header.length-D,i=new DataView(n,D);let r=0;for(;r<t;){const a=i.getUint32(r,!0);r+=4;const o=i.getUint32(r,!0);if(r+=4,o===ce.JSON){const c=new Uint8Array(n,D+r,a);this.content=s.decode(c)}else if(o===ce.BIN){const c=D+r;this.body=n.slice(c,c+a)}r+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Nn{constructor(n,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=g.KHR_DRACO_MESH_COMPRESSION,this.json=n,this.dracoLoader=e,this.dracoLoader.preload()}decodePrimitive(n,e){const s=this.json,t=this.dracoLoader,i=n.extensions[this.name].bufferView,r=n.extensions[this.name].attributes,a={},o={},c={};for(const u in r){const l=$[u]||u.toLowerCase();a[l]=r[u]}for(const u in n.attributes){const l=$[u]||u.toLowerCase();if(r[u]!==void 0){const h=s.accessors[n.attributes[u]],d=H[h.componentType];c[l]=d.name,o[l]=h.normalized===!0}}return e.getDependency("bufferView",i).then(function(u){return new Promise(function(l,h){t.decodeDracoFile(u,function(d){for(const p in d.attributes){const R=d.attributes[p],m=o[p];m!==void 0&&(R.normalized=m)}l(d)},a,c,N,h)})})}}class bn{constructor(){this.name=g.KHR_TEXTURE_TRANSFORM}extendTexture(n,e){return(e.texCoord===void 0||e.texCoord===n.channel)&&e.offset===void 0&&e.rotation===void 0&&e.scale===void 0||(n=n.clone(),e.texCoord!==void 0&&(n.channel=e.texCoord),e.offset!==void 0&&n.offset.fromArray(e.offset),e.rotation!==void 0&&(n.rotation=e.rotation),e.scale!==void 0&&n.repeat.fromArray(e.scale),n.needsUpdate=!0),n}}class In{constructor(){this.name=g.KHR_MESH_QUANTIZATION}}class _e extends on{constructor(n,e,s,t){super(n,e,s,t)}copySampleValue_(n){const e=this.resultBuffer,s=this.sampleValues,t=this.valueSize,i=n*t*3+t;for(let r=0;r!==t;r++)e[r]=s[i+r];return e}interpolate_(n,e,s,t){const i=this.resultBuffer,r=this.sampleValues,a=this.valueSize,o=a*2,c=a*3,u=t-e,l=(s-e)/u,h=l*l,d=h*l,p=n*c,R=p-c,m=-2*d+3*h,T=d-h,A=1-m,x=T-h+l;for(let E=0;E!==a;E++){const L=r[R+E+a],b=r[R+E+o]*u,S=r[p+E+a],k=r[p+E]*u;i[E]=A*L+x*b+m*S+T*k}return i}}const On=new me;class Cn extends _e{interpolate_(n,e,s,t){const i=super.interpolate_(n,e,s,t);return On.fromArray(i).normalize().toArray(i),i}}const M={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},H={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},ue={9728:Re,9729:J,9984:He,9985:Pe,9986:Fe,9987:Te},le={33071:De,33648:ke,10497:Z},q={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},I={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Fn={CUBICSPLINE:void 0,LINEAR:xe,STEP:tn},W={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Pn(f){return f.DefaultMaterial===void 0&&(f.DefaultMaterial=new Ee({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:rn})),f.DefaultMaterial}function O(f,n,e){for(const s in e.extensions)f[s]===void 0&&(n.userData.gltfExtensions=n.userData.gltfExtensions||{},n.userData.gltfExtensions[s]=e.extensions[s])}function y(f,n){n.extras!==void 0&&(typeof n.extras=="object"?Object.assign(f.userData,n.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+n.extras))}function Hn(f,n,e){let s=!1,t=!1,i=!1;for(let c=0,u=n.length;c<u;c++){const l=n[c];if(l.POSITION!==void 0&&(s=!0),l.NORMAL!==void 0&&(t=!0),l.COLOR_0!==void 0&&(i=!0),s&&t&&i)break}if(!s&&!t&&!i)return Promise.resolve(f);const r=[],a=[],o=[];for(let c=0,u=n.length;c<u;c++){const l=n[c];if(s){const h=l.POSITION!==void 0?e.getDependency("accessor",l.POSITION):f.attributes.position;r.push(h)}if(t){const h=l.NORMAL!==void 0?e.getDependency("accessor",l.NORMAL):f.attributes.normal;a.push(h)}if(i){const h=l.COLOR_0!==void 0?e.getDependency("accessor",l.COLOR_0):f.attributes.color;o.push(h)}}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(o)]).then(function(c){const u=c[0],l=c[1],h=c[2];return s&&(f.morphAttributes.position=u),t&&(f.morphAttributes.normal=l),i&&(f.morphAttributes.color=h),f.morphTargetsRelative=!0,f})}function kn(f,n){if(f.updateMorphTargets(),n.weights!==void 0)for(let e=0,s=n.weights.length;e<s;e++)f.morphTargetInfluences[e]=n.weights[e];if(n.extras&&Array.isArray(n.extras.targetNames)){const e=n.extras.targetNames;if(f.morphTargetInfluences.length===e.length){f.morphTargetDictionary={};for(let s=0,t=e.length;s<t;s++)f.morphTargetDictionary[e[s]]=s}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Dn(f){let n;const e=f.extensions&&f.extensions[g.KHR_DRACO_MESH_COMPRESSION];if(e?n="draco:"+e.bufferView+":"+e.indices+":"+Y(e.attributes):n=f.indices+":"+Y(f.attributes)+":"+f.mode,f.targets!==void 0)for(let s=0,t=f.targets.length;s<t;s++)n+=":"+Y(f.targets[s]);return n}function Y(f){let n="";const e=Object.keys(f).sort();for(let s=0,t=e.length;s<t;s++)n+=e[s]+":"+f[e[s]]+";";return n}function ee(f){switch(f){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function Gn(f){return f.search(/\.jpe?g($|\?)/i)>0||f.search(/^data\:image\/jpeg/)===0?"image/jpeg":f.search(/\.webp($|\?)/i)>0||f.search(/^data\:image\/webp/)===0?"image/webp":f.search(/\.ktx2($|\?)/i)>0||f.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const vn=new B;class Un{constructor(n={},e={}){this.json=n,this.extensions={},this.plugins={},this.options=e,this.cache=new un,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let s=!1,t=-1,i=!1,r=-1;if(typeof navigator<"u"&&typeof navigator.userAgent<"u"){const a=navigator.userAgent;s=/^((?!chrome|android).)*safari/i.test(a)===!0;const o=a.match(/Version\/(\d+)/);t=s&&o?parseInt(o[1],10):-1,i=a.indexOf("Firefox")>-1,r=i?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||s&&t<17||i&&r<98?this.textureLoader=new Ie(this.options.manager):this.textureLoader=new Oe(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new de(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(n){this.extensions=n}setPlugins(n){this.plugins=n}parse(n,e){const s=this,t=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(r){return r._markDefs&&r._markDefs()}),Promise.all(this._invokeAll(function(r){return r.beforeRoot&&r.beforeRoot()})).then(function(){return Promise.all([s.getDependencies("scene"),s.getDependencies("animation"),s.getDependencies("camera")])}).then(function(r){const a={scene:r[0][t.scene||0],scenes:r[0],animations:r[1],cameras:r[2],asset:t.asset,parser:s,userData:{}};return O(i,a,t),y(a,t),Promise.all(s._invokeAll(function(o){return o.afterRoot&&o.afterRoot(a)})).then(function(){for(const o of a.scenes)o.updateMatrixWorld();n(a)})}).catch(e)}_markDefs(){const n=this.json.nodes||[],e=this.json.skins||[],s=this.json.meshes||[];for(let t=0,i=e.length;t<i;t++){const r=e[t].joints;for(let a=0,o=r.length;a<o;a++)n[r[a]].isBone=!0}for(let t=0,i=n.length;t<i;t++){const r=n[t];r.mesh!==void 0&&(this._addNodeRef(this.meshCache,r.mesh),r.skin!==void 0&&(s[r.mesh].isSkinnedMesh=!0)),r.camera!==void 0&&this._addNodeRef(this.cameraCache,r.camera)}}_addNodeRef(n,e){e!==void 0&&(n.refs[e]===void 0&&(n.refs[e]=n.uses[e]=0),n.refs[e]++)}_getNodeRef(n,e,s){if(n.refs[e]<=1)return s;const t=s.clone(),i=(r,a)=>{const o=this.associations.get(r);o!=null&&this.associations.set(a,o);for(const[c,u]of r.children.entries())i(u,a.children[c])};return i(s,t),t.name+="_instance_"+n.uses[e]++,t}_invokeOne(n){const e=Object.values(this.plugins);e.push(this);for(let s=0;s<e.length;s++){const t=n(e[s]);if(t)return t}return null}_invokeAll(n){const e=Object.values(this.plugins);e.unshift(this);const s=[];for(let t=0;t<e.length;t++){const i=n(e[t]);i&&s.push(i)}return s}getDependency(n,e){const s=n+":"+e;let t=this.cache.get(s);if(!t){switch(n){case"scene":t=this.loadScene(e);break;case"node":t=this._invokeOne(function(i){return i.loadNode&&i.loadNode(e)});break;case"mesh":t=this._invokeOne(function(i){return i.loadMesh&&i.loadMesh(e)});break;case"accessor":t=this.loadAccessor(e);break;case"bufferView":t=this._invokeOne(function(i){return i.loadBufferView&&i.loadBufferView(e)});break;case"buffer":t=this.loadBuffer(e);break;case"material":t=this._invokeOne(function(i){return i.loadMaterial&&i.loadMaterial(e)});break;case"texture":t=this._invokeOne(function(i){return i.loadTexture&&i.loadTexture(e)});break;case"skin":t=this.loadSkin(e);break;case"animation":t=this._invokeOne(function(i){return i.loadAnimation&&i.loadAnimation(e)});break;case"camera":t=this.loadCamera(e);break;default:if(t=this._invokeOne(function(i){return i!=this&&i.getDependency&&i.getDependency(n,e)}),!t)throw new Error("Unknown type: "+n);break}this.cache.add(s,t)}return t}getDependencies(n){let e=this.cache.get(n);if(!e){const s=this,t=this.json[n+(n==="mesh"?"es":"s")]||[];e=Promise.all(t.map(function(i,r){return s.getDependency(n,r)})),this.cache.add(n,e)}return e}loadBuffer(n){const e=this.json.buffers[n],s=this.fileLoader;if(e.type&&e.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+e.type+" buffer type is not supported.");if(e.uri===void 0&&n===0)return Promise.resolve(this.extensions[g.KHR_BINARY_GLTF].body);const t=this.options;return new Promise(function(i,r){s.load(v.resolveURL(e.uri,t.path),i,void 0,function(){r(new Error('THREE.GLTFLoader: Failed to load buffer "'+e.uri+'".'))})})}loadBufferView(n){const e=this.json.bufferViews[n];return this.getDependency("buffer",e.buffer).then(function(s){const t=e.byteLength||0,i=e.byteOffset||0;return s.slice(i,i+t)})}loadAccessor(n){const e=this,s=this.json,t=this.json.accessors[n];if(t.bufferView===void 0&&t.sparse===void 0){const r=q[t.type],a=H[t.componentType],o=t.normalized===!0,c=new a(t.count*r);return Promise.resolve(new V(c,r,o))}const i=[];return t.bufferView!==void 0?i.push(this.getDependency("bufferView",t.bufferView)):i.push(null),t.sparse!==void 0&&(i.push(this.getDependency("bufferView",t.sparse.indices.bufferView)),i.push(this.getDependency("bufferView",t.sparse.values.bufferView))),Promise.all(i).then(function(r){const a=r[0],o=q[t.type],c=H[t.componentType],u=c.BYTES_PER_ELEMENT,l=u*o,h=t.byteOffset||0,d=t.bufferView!==void 0?s.bufferViews[t.bufferView].byteStride:void 0,p=t.normalized===!0;let R,m;if(d&&d!==l){const T=Math.floor(h/d),A="InterleavedBuffer:"+t.bufferView+":"+t.componentType+":"+T+":"+t.count;let x=e.cache.get(A);x||(R=new c(a,T*d,t.count*d/u),x=new Ce(R,d/u),e.cache.add(A,x)),m=new sn(x,o,h%d/u,p)}else a===null?R=new c(t.count*o):R=new c(a,h,t.count*o),m=new V(R,o,p);if(t.sparse!==void 0){const T=q.SCALAR,A=H[t.sparse.indices.componentType],x=t.sparse.indices.byteOffset||0,E=t.sparse.values.byteOffset||0,L=new A(r[1],x,t.sparse.count*T),b=new c(r[2],E,t.sparse.count*o);a!==null&&(m=new V(m.array.slice(),m.itemSize,m.normalized)),m.normalized=!1;for(let S=0,k=L.length;S<k;S++){const P=L[S];if(m.setX(P,b[S*o]),o>=2&&m.setY(P,b[S*o+1]),o>=3&&m.setZ(P,b[S*o+2]),o>=4&&m.setW(P,b[S*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}m.normalized=p}return m})}loadTexture(n){const e=this.json,s=this.options,i=e.textures[n].source,r=e.images[i];let a=this.textureLoader;if(r.uri){const o=s.manager.getHandler(r.uri);o!==null&&(a=o)}return this.loadTextureImage(n,i,a)}loadTextureImage(n,e,s){const t=this,i=this.json,r=i.textures[n],a=i.images[e],o=(a.uri||a.bufferView)+":"+r.sampler;if(this.textureCache[o])return this.textureCache[o];const c=this.loadImageSource(e,s).then(function(u){u.flipY=!1,u.name=r.name||a.name||"",u.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(u.name=a.uri);const h=(i.samplers||{})[r.sampler]||{};return u.magFilter=ue[h.magFilter]||J,u.minFilter=ue[h.minFilter]||Te,u.wrapS=le[h.wrapS]||Z,u.wrapT=le[h.wrapT]||Z,u.generateMipmaps=!u.isCompressedTexture&&u.minFilter!==Re&&u.minFilter!==J,t.associations.set(u,{textures:n}),u}).catch(function(){return null});return this.textureCache[o]=c,c}loadImageSource(n,e){const s=this,t=this.json,i=this.options;if(this.sourceCache[n]!==void 0)return this.sourceCache[n].then(l=>l.clone());const r=t.images[n],a=self.URL||self.webkitURL;let o=r.uri||"",c=!1;if(r.bufferView!==void 0)o=s.getDependency("bufferView",r.bufferView).then(function(l){c=!0;const h=new Blob([l],{type:r.mimeType});return o=a.createObjectURL(h),o});else if(r.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+n+" is missing URI and bufferView");const u=Promise.resolve(o).then(function(l){return new Promise(function(h,d){let p=h;e.isImageBitmapLoader===!0&&(p=function(R){const m=new ne(R);m.needsUpdate=!0,h(m)}),e.load(v.resolveURL(l,i.path),p,void 0,d)})}).then(function(l){return c===!0&&a.revokeObjectURL(o),y(l,r),l.userData.mimeType=r.mimeType||Gn(r.uri),l}).catch(function(l){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),l});return this.sourceCache[n]=u,u}assignTexture(n,e,s,t){const i=this;return this.getDependency("texture",s.index).then(function(r){if(!r)return null;if(s.texCoord!==void 0&&s.texCoord>0&&(r=r.clone(),r.channel=s.texCoord),i.extensions[g.KHR_TEXTURE_TRANSFORM]){const a=s.extensions!==void 0?s.extensions[g.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const o=i.associations.get(r);r=i.extensions[g.KHR_TEXTURE_TRANSFORM].extendTexture(r,a),i.associations.set(r,o)}}return t!==void 0&&(r.colorSpace=t),n[e]=r,r})}assignFinalMaterial(n){const e=n.geometry;let s=n.material;const t=e.attributes.tangent===void 0,i=e.attributes.color!==void 0,r=e.attributes.normal===void 0;if(n.isPoints){const a="PointsMaterial:"+s.uuid;let o=this.cache.get(a);o||(o=new Ge,X.prototype.copy.call(o,s),o.color.copy(s.color),o.map=s.map,o.sizeAttenuation=!1,this.cache.add(a,o)),s=o}else if(n.isLine){const a="LineBasicMaterial:"+s.uuid;let o=this.cache.get(a);o||(o=new ve,X.prototype.copy.call(o,s),o.color.copy(s.color),o.map=s.map,this.cache.add(a,o)),s=o}if(t||i||r){let a="ClonedMaterial:"+s.uuid+":";t&&(a+="derivative-tangents:"),i&&(a+="vertex-colors:"),r&&(a+="flat-shading:");let o=this.cache.get(a);o||(o=s.clone(),i&&(o.vertexColors=!0),r&&(o.flatShading=!0),t&&(o.normalScale&&(o.normalScale.y*=-1),o.clearcoatNormalScale&&(o.clearcoatNormalScale.y*=-1)),this.cache.add(a,o),this.associations.set(o,this.associations.get(s))),s=o}n.material=s}getMaterialType(){return Ee}loadMaterial(n){const e=this,s=this.json,t=this.extensions,i=s.materials[n];let r;const a={},o=i.extensions||{},c=[];if(o[g.KHR_MATERIALS_UNLIT]){const l=t[g.KHR_MATERIALS_UNLIT];r=l.getMaterialType(),c.push(l.extendParams(a,i,e))}else{const l=i.pbrMetallicRoughness||{};if(a.color=new F(1,1,1),a.opacity=1,Array.isArray(l.baseColorFactor)){const h=l.baseColorFactor;a.color.setRGB(h[0],h[1],h[2],N),a.opacity=h[3]}l.baseColorTexture!==void 0&&c.push(e.assignTexture(a,"map",l.baseColorTexture,U)),a.metalness=l.metallicFactor!==void 0?l.metallicFactor:1,a.roughness=l.roughnessFactor!==void 0?l.roughnessFactor:1,l.metallicRoughnessTexture!==void 0&&(c.push(e.assignTexture(a,"metalnessMap",l.metallicRoughnessTexture)),c.push(e.assignTexture(a,"roughnessMap",l.metallicRoughnessTexture))),r=this._invokeOne(function(h){return h.getMaterialType&&h.getMaterialType(n)}),c.push(Promise.all(this._invokeAll(function(h){return h.extendMaterialParams&&h.extendMaterialParams(n,a)})))}i.doubleSided===!0&&(a.side=Ue);const u=i.alphaMode||W.OPAQUE;if(u===W.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===W.MASK&&(a.alphaTest=i.alphaCutoff!==void 0?i.alphaCutoff:.5)),i.normalTexture!==void 0&&r!==G&&(c.push(e.assignTexture(a,"normalMap",i.normalTexture)),a.normalScale=new pe(1,1),i.normalTexture.scale!==void 0)){const l=i.normalTexture.scale;a.normalScale.set(l,l)}if(i.occlusionTexture!==void 0&&r!==G&&(c.push(e.assignTexture(a,"aoMap",i.occlusionTexture)),i.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=i.occlusionTexture.strength)),i.emissiveFactor!==void 0&&r!==G){const l=i.emissiveFactor;a.emissive=new F().setRGB(l[0],l[1],l[2],N)}return i.emissiveTexture!==void 0&&r!==G&&c.push(e.assignTexture(a,"emissiveMap",i.emissiveTexture,U)),Promise.all(c).then(function(){const l=new r(a);return i.name&&(l.name=i.name),y(l,i),e.associations.set(l,{materials:n}),i.extensions&&O(t,l,i),l})}createUniqueName(n){const e=Be.sanitizeNodeName(n||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(n){const e=this,s=this.extensions,t=this.primitiveCache;function i(a){return s[g.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,e).then(function(o){return fe(o,a,e)})}const r=[];for(let a=0,o=n.length;a<o;a++){const c=n[a],u=Dn(c),l=t[u];if(l)r.push(l.promise);else{let h;c.extensions&&c.extensions[g.KHR_DRACO_MESH_COMPRESSION]?h=i(c):h=fe(new Ke,c,e),t[u]={primitive:c,promise:h},r.push(h)}}return Promise.all(r)}loadMesh(n){const e=this,s=this.json,t=this.extensions,i=s.meshes[n],r=i.primitives,a=[];for(let o=0,c=r.length;o<c;o++){const u=r[o].material===void 0?Pn(this.cache):this.getDependency("material",r[o].material);a.push(u)}return a.push(e.loadGeometries(r)),Promise.all(a).then(function(o){const c=o.slice(0,o.length-1),u=o[o.length-1],l=[];for(let d=0,p=u.length;d<p;d++){const R=u[d],m=r[d];let T;const A=c[d];if(m.mode===M.TRIANGLES||m.mode===M.TRIANGLE_STRIP||m.mode===M.TRIANGLE_FAN||m.mode===void 0)T=i.isSkinnedMesh===!0?new je(R,A):new Ve(R,A),T.isSkinnedMesh===!0&&T.normalizeSkinWeights(),m.mode===M.TRIANGLE_STRIP?T.geometry=oe(T.geometry,he):m.mode===M.TRIANGLE_FAN&&(T.geometry=oe(T.geometry,Q));else if(m.mode===M.LINES)T=new Xe(R,A);else if(m.mode===M.LINE_STRIP)T=new ze(R,A);else if(m.mode===M.LINE_LOOP)T=new qe(R,A);else if(m.mode===M.POINTS)T=new We(R,A);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);Object.keys(T.geometry.morphAttributes).length>0&&kn(T,i),T.name=e.createUniqueName(i.name||"mesh_"+n),y(T,i),m.extensions&&O(t,T,m),e.assignFinalMaterial(T),l.push(T)}for(let d=0,p=l.length;d<p;d++)e.associations.set(l[d],{meshes:n,primitives:d});if(l.length===1)return i.extensions&&O(t,l[0],i),l[0];const h=new z;i.extensions&&O(t,h,i),e.associations.set(h,{meshes:n});for(let d=0,p=l.length;d<p;d++)h.add(l[d]);return h})}loadCamera(n){let e;const s=this.json.cameras[n],t=s[s.type];if(!t){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return s.type==="perspective"?e=new Ye(Qe.radToDeg(t.yfov),t.aspectRatio||1,t.znear||1,t.zfar||2e6):s.type==="orthographic"&&(e=new Je(-t.xmag,t.xmag,t.ymag,-t.ymag,t.znear,t.zfar)),s.name&&(e.name=this.createUniqueName(s.name)),y(e,s),Promise.resolve(e)}loadSkin(n){const e=this.json.skins[n],s=[];for(let t=0,i=e.joints.length;t<i;t++)s.push(this._loadNodeShallow(e.joints[t]));return e.inverseBindMatrices!==void 0?s.push(this.getDependency("accessor",e.inverseBindMatrices)):s.push(null),Promise.all(s).then(function(t){const i=t.pop(),r=t,a=[],o=[];for(let c=0,u=r.length;c<u;c++){const l=r[c];if(l){a.push(l);const h=new B;i!==null&&h.fromArray(i.array,c*16),o.push(h)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',e.joints[c])}return new Ze(a,o)})}loadAnimation(n){const e=this.json,s=this,t=e.animations[n],i=t.name?t.name:"animation_"+n,r=[],a=[],o=[],c=[],u=[];for(let l=0,h=t.channels.length;l<h;l++){const d=t.channels[l],p=t.samplers[d.sampler],R=d.target,m=R.node,T=t.parameters!==void 0?t.parameters[p.input]:p.input,A=t.parameters!==void 0?t.parameters[p.output]:p.output;R.node!==void 0&&(r.push(this.getDependency("node",m)),a.push(this.getDependency("accessor",T)),o.push(this.getDependency("accessor",A)),c.push(p),u.push(R))}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(o),Promise.all(c),Promise.all(u)]).then(function(l){const h=l[0],d=l[1],p=l[2],R=l[3],m=l[4],T=[];for(let x=0,E=h.length;x<E;x++){const L=h[x],b=d[x],S=p[x],k=R[x],P=m[x];if(L===void 0)continue;L.updateMatrix&&L.updateMatrix();const K=s._createAnimationTracks(L,b,S,k,P);if(K)for(let j=0;j<K.length;j++)T.push(K[j])}const A=new $e(i,void 0,T);return y(A,t),A})}createNodeMesh(n){const e=this.json,s=this,t=e.nodes[n];return t.mesh===void 0?null:s.getDependency("mesh",t.mesh).then(function(i){const r=s._getNodeRef(s.meshCache,t.mesh,i);return t.weights!==void 0&&r.traverse(function(a){if(a.isMesh)for(let o=0,c=t.weights.length;o<c;o++)a.morphTargetInfluences[o]=t.weights[o]}),r})}loadNode(n){const e=this.json,s=this,t=e.nodes[n],i=s._loadNodeShallow(n),r=[],a=t.children||[];for(let c=0,u=a.length;c<u;c++)r.push(s.getDependency("node",a[c]));const o=t.skin===void 0?Promise.resolve(null):s.getDependency("skin",t.skin);return Promise.all([i,Promise.all(r),o]).then(function(c){const u=c[0],l=c[1],h=c[2];h!==null&&u.traverse(function(d){d.isSkinnedMesh&&d.bind(h,vn)});for(let d=0,p=l.length;d<p;d++)u.add(l[d]);if(u.userData.pivot!==void 0&&l.length>0){const d=u.userData.pivot,p=l[0];u.pivot=new C().fromArray(d),u.position.x-=d[0],u.position.y-=d[1],u.position.z-=d[2],p.position.set(0,0,0),delete u.userData.pivot}return u})}_loadNodeShallow(n){const e=this.json,s=this.extensions,t=this;if(this.nodeCache[n]!==void 0)return this.nodeCache[n];const i=e.nodes[n],r=i.name?t.createUniqueName(i.name):"",a=[],o=t._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(n)});return o&&a.push(o),i.camera!==void 0&&a.push(t.getDependency("camera",i.camera).then(function(c){return t._getNodeRef(t.cameraCache,i.camera,c)})),t._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(n)}).forEach(function(c){a.push(c)}),this.nodeCache[n]=Promise.all(a).then(function(c){let u;if(i.isBone===!0?u=new en:c.length>1?u=new z:c.length===1?u=c[0]:u=new ge,u!==c[0])for(let l=0,h=c.length;l<h;l++)u.add(c[l]);if(i.name&&(u.userData.name=i.name,u.name=r),y(u,i),i.extensions&&O(s,u,i),i.matrix!==void 0){const l=new B;l.fromArray(i.matrix),u.applyMatrix4(l)}else i.translation!==void 0&&u.position.fromArray(i.translation),i.rotation!==void 0&&u.quaternion.fromArray(i.rotation),i.scale!==void 0&&u.scale.fromArray(i.scale);if(!t.associations.has(u))t.associations.set(u,{});else if(i.mesh!==void 0&&t.meshCache.refs[i.mesh]>1){const l=t.associations.get(u);t.associations.set(u,{...l})}return t.associations.get(u).nodes=n,u}),this.nodeCache[n]}loadScene(n){const e=this.extensions,s=this.json.scenes[n],t=this,i=new z;s.name&&(i.name=t.createUniqueName(s.name)),y(i,s),s.extensions&&O(e,i,s);const r=s.nodes||[],a=[];for(let o=0,c=r.length;o<c;o++)a.push(t.getDependency("node",r[o]));return Promise.all(a).then(function(o){for(let u=0,l=o.length;u<l;u++){const h=o[u];h.parent!==null?i.add(nn(h)):i.add(h)}const c=u=>{const l=new Map;for(const[h,d]of t.associations)(h instanceof X||h instanceof ne)&&l.set(h,d);return u.traverse(h=>{const d=t.associations.get(h);d!=null&&l.set(h,d)}),l};return t.associations=c(i),i})}_createAnimationTracks(n,e,s,t,i){const r=[],a=n.name?n.name:n.uuid,o=[];function c(d){d.morphTargetInfluences&&o.push(d.name?d.name:d.uuid)}I[i.path]===I.weights?(c(n),n.isGroup&&n.children.forEach(c)):o.push(a);let u;switch(I[i.path]){case I.weights:u=se;break;case I.rotation:u=ie;break;case I.translation:case I.scale:u=te;break;default:switch(s.itemSize){case 1:u=se;break;case 2:case 3:default:u=te;break}break}const l=t.interpolation!==void 0?Fn[t.interpolation]:xe,h=this._getArrayFromAccessor(s);for(let d=0,p=o.length;d<p;d++){const R=new u(o[d]+"."+I[i.path],e.array,h,l);t.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(R),r.push(R)}return r}_getArrayFromAccessor(n){let e=n.array;if(n.normalized){const s=ee(e.constructor),t=new Float32Array(e.length);for(let i=0,r=e.length;i<r;i++)t[i]=e[i]*s;e=t}return e}_createCubicSplineTrackInterpolant(n){n.createInterpolant=function(s){const t=this instanceof ie?Cn:_e;return new t(this.times,this.values,this.getValueSize()/3,s)},n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function Bn(f,n,e){const s=n.attributes,t=new an;if(s.POSITION!==void 0){const a=e.json.accessors[s.POSITION],o=a.min,c=a.max;if(o!==void 0&&c!==void 0){if(t.set(new C(o[0],o[1],o[2]),new C(c[0],c[1],c[2])),a.normalized){const u=ee(H[a.componentType]);t.min.multiplyScalar(u),t.max.multiplyScalar(u)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const i=n.targets;if(i!==void 0){const a=new C,o=new C;for(let c=0,u=i.length;c<u;c++){const l=i[c];if(l.POSITION!==void 0){const h=e.json.accessors[l.POSITION],d=h.min,p=h.max;if(d!==void 0&&p!==void 0){if(o.setX(Math.max(Math.abs(d[0]),Math.abs(p[0]))),o.setY(Math.max(Math.abs(d[1]),Math.abs(p[1]))),o.setZ(Math.max(Math.abs(d[2]),Math.abs(p[2]))),h.normalized){const R=ee(H[h.componentType]);o.multiplyScalar(R)}a.max(o)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}t.expandByVector(a)}f.boundingBox=t;const r=new cn;t.getCenter(r.center),r.radius=t.min.distanceTo(t.max)/2,f.boundingSphere=r}function fe(f,n,e){const s=n.attributes,t=[];function i(r,a){return e.getDependency("accessor",r).then(function(o){f.setAttribute(a,o)})}for(const r in s){const a=$[r]||r.toLowerCase();a in f.attributes||t.push(i(s[r],a))}if(n.indices!==void 0&&!f.index){const r=e.getDependency("accessor",n.indices).then(function(a){f.setIndex(a)});t.push(r)}return re.workingColorSpace!==N&&"COLOR_0"in s&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${re.workingColorSpace}" not supported.`),y(f,n),Bn(f,n,e),Promise.all(t).then(function(){return n.targets!==void 0?Hn(f,n.targets,e):f})}export{jn as GLTFLoader};
@@ -0,0 +1,9 @@
1
+ import{zip as T}from"./browser-CltifEM0.js";import{g as x,V as A,O as $,B as _,M as D,C as H,Q as I}from"./VideoExport-B8ZhHNnd.js";class p{static DEPTH_NEAR_M=1;static DEPTH_FAR_M=2e4;static MASK_MARGIN_PX=4;static depthLevel(e){if(!(e>0))return 0;const t=1-Math.log(e/p.DEPTH_NEAR_M)/Math.log(p.DEPTH_FAR_M/p.DEPTH_NEAR_M);return Math.min(1,Math.max(0,t))}static dilate(e,t,a,c,n=p.MASK_MARGIN_PX){const i=new Uint8Array(e.length);for(let o=0;o<c;o++)for(let r=0;r<a;r++){let s=0;for(let d=-n;d<=n&&!s;d++){const u=r+d;u>=0&&u<a&&e[o*a+u]&&(s=255)}i[o*a+r]=s}for(let o=0;o<c;o++)for(let r=0;r<a;r++){let s=0;for(let d=-n;d<=n&&!s;d++){const u=o+d;u>=0&&u<c&&i[u*a+r]&&(s=255)}t[o*a+r]=s}}}class l{static MAX_CHARS=2500;static NEGATIVE=`added objects, windows, portholes, lights or beams not in the reference, smoke, people, animals, camera shake beyond the reference, lens flares not in the reference, any change of the phenomenon's shape, size, colour, brightness, position or motion, text, logos.
2
+ `;static of(e,t){const a=e,c=t.rate&&t.rate>0?t.rate:1,n=s=>Math.max(0,(s-t.fromSeconds)/c),i=[s=>s,s=>l.firstSentence(s),s=>l.firstWords(l.firstSentence(s),l.SHORT_NOTE_CHARS)];let o="";for(const s of i)if(o=[`Realistic, steady first-person view, as seen by a pedestrian's own eyes, ${a.place?.name??"place not stated"}, local time ${a.time??"not stated"}. Keep exactly the geometry, horizon, framing, lighting and motion of the reference video: only make the textures (vegetation, ground, buildings, clouds, rain) photographic. Render the phenomenon as realistically as the rest (same grain, blur, haze and light), but keep its shape, size, colour, brightness, position and motion exactly those of the reference video.`,"","Phenomenon, as drawn by the reconstruction from the testimony:",...l.shapes(a,t.fromSeconds),...l.section("What happens:",l.milestones(a,t,n,s)),...l.section("Weather and light (follow this, not the reference's own colours):",l.weather(a,t,n))].join(`
3
+ `)+`
4
+ `,o.length<=l.MAX_CHARS)return o;const r=[];for(const s of o.split(`
5
+ `)){if([...r,s].join(`
6
+ `).length+1>l.MAX_CHARS)break;r.push(s)}return r.join(`
7
+ `)+`
8
+ `}static SHORT_NOTE_CHARS=80;static firstSentence(e){const t=e.search(/[.;!?](\s|$)/);return t>=0?e.slice(0,t+1):e}static firstWords(e,t){if(e.length<=t)return e;const a=e.lastIndexOf(" ",t-1);return e.slice(0,a>0?a:t-1)+"…"}static section(e,t){return t.length>0?["",e,...t]:[]}static text(e,t="en"){if(e!==void 0)return typeof e=="string"?e:e[t]??e.en??Object.values(e)[0]}static shapes(e,t){const a=new Map;for(const c of e.timeline?.keyframes??[])for(const n of c.shapes??[])(c.t<=t*1e3||!a.has(n.sourceId))&&a.set(n.sourceId,n.shape);return a.size===0?["- none drawn."]:[...a.entries()].map(([c,n])=>{const i=n.angular?`${n.angular.widthDeg}° wide and ${n.angular.heightDeg}° tall as seen`:"size not stated",o=n.aim?`, at azimuth ${Math.round(n.aim.azimuthDeg)}°, ${n.aim.altitudeDeg.toFixed(1)}° above the horizon`:"";return`- ${l.text(n.title)??c}: colour ${n.color??"not stated"}, ${i}${o}.`})}static milestones(e,t,a,c){return(e.milestones??[]).filter(n=>n.t/1e3>=t.fromSeconds&&n.t/1e3<=t.toSeconds).map(n=>`- ${a(n.t/1e3).toFixed(1)} s into the video: ${c(l.text(n.note)??"")}`)}static weather(e,t,a){const c=(e.tags??[]).length>0?[`- ${(e.tags??[]).join(", ")}.`]:[];let n="";for(const i of e.weatherTrack?.keyframes??[]){const o=i.t/1e3;if(o>t.toSeconds)break;const r=l.describe(i.weather);r!==n&&(n=r,c.push(`- ${o<=t.fromSeconds?"from the start":`from ${a(o).toFixed(1)} s into the video`}: ${r}.`))}return c}static describe(e){const t=[];return typeof e.cloudCover=="number"&&t.push(e.cloudCover>=.95?"overcast":`cloud cover ${Math.round(e.cloudCover*100)} %`),typeof e.cloudBaseM=="number"&&t.push(`cloud base ${Math.round(e.cloudBaseM)} m`),t.push(e.precipitationType&&e.precipitationType!=="none"?`${e.precipitationType}, intensity ${e.precipitationIntensity??"not stated"}`:"no precipitation"),t.join(", ")}}class S{static async make(e,t,a,c){const n=Math.max(2,Math.floor(e.film.width/2)*2),i=Math.max(2,Math.floor(e.film.height/2)*2),o=await x(["avc","vp9","av1"],{width:n,height:i});if(!o)throw new Error(`No video codec for ${n}×${i}`);const r=await Promise.all(["depth","phenomenon-mask","sky-mask"].map(y=>S.passFilm(y,n,i,o))),[s,d,u]=r;let m,M,E=0;try{const y=await A.film({...e.film,frameAt:(f,h,w)=>e.film.frameAt(f,h,w)?(m=e.drawControlPasses(),!0):!1,hearInto:f=>e.film.hearInto(f),afterFrame:async(f,h)=>{if(f===0&&(M=await h.canvas.convertToBlob({type:"image/png"})),!m)throw new Error(`No control passes for frame ${f}`);S.paint(m,s.context,d.context,u.context),m=void 0;for(const w of r)await w.source.add(f/A.FRAME_RATE,1/A.FRAME_RATE);E=f+1}},a,c),g=await Promise.all(r.map(async f=>{await f.output.finalize();const h=f.output.target.buffer;if(!h)throw new Error(`Empty ${f.name} film`);return[f.name,new Uint8Array(h)]}));return await S.zipped(e,t,new Uint8Array(await y.arrayBuffer()),g,M,E)}catch(y){throw await Promise.all(r.map(g=>g.output.cancel().catch(()=>{}))),y}}static async passFilm(e,t,a,c){const n=new OffscreenCanvas(t,a),i=n.getContext("2d");if(!i)throw new Error("No 2D context");i.imageSmoothingEnabled=!1;const o=new $({format:new D({fastStart:"in-memory"}),target:new _}),r=new H(n,{codec:c,quality:I});return o.addVideoTrack(r,{frameRate:A.FRAME_RATE}),await o.start(),{name:e,output:o,source:r,context:i}}static paint(e,t,a,c){const{width:n,height:i}=e,o=n*i,r=new Uint8Array(o);p.dilate(e.phenomenon,r,n,i);const s={depth:new ImageData(n,i),phenomenon:new ImageData(n,i),sky:new ImageData(n,i)};for(let m=0;m<o;m++){const M=e.distanceM[m],E=Math.round(p.depthLevel(M)*255),y=M>0?0:255,g=m*4;for(const[f,h]of[[s.depth.data,E],[s.phenomenon.data,r[m]],[s.sky.data,y]])f[g]=h,f[g+1]=h,f[g+2]=h,f[g+3]=255}const d=new OffscreenCanvas(n,i),u=d.getContext("2d");for(const[m,M]of[[t,s.depth],[a,s.phenomenon],[c,s.sky]])u.putImageData(M,0,0),m.drawImage(d,0,0,m.canvas.width,m.canvas.height)}static zipped(e,t,a,c,n,i){const o=new TextEncoder,r=e.film.fromMs/1e3,s=e.film.toMs/1e3,d=e.film.rate>0?e.film.rate:1,u=Math.round(i/A.FRAME_RATE*10)/10,m=new Date().toISOString().slice(0,10),M={title:e.title,source:e.source??"",date:m,fps:String(A.FRAME_RATE),duration:String(u),near:String(p.DEPTH_NEAR_M),far:String(p.DEPTH_FAR_M),margin:String(p.MASK_MARGIN_PX),maxChars:l.MAX_CHARS.toLocaleString(e.language),label:t.label},E=t.readme.replace(/\{(\w+)\}/g,(h,w)=>M[w]??h),y={title:e.title,source:e.source,madeBy:A.MADE_BY,date:m,clip:{fromSeconds:r/d,toSeconds:s/d,fps:A.FRAME_RATE,frames:i,width:e.film.width,height:e.film.height},depth:{encoding:"1 - ln(d / near) / ln(far / near), clamped to 0..1; 0 for the sky",nearM:p.DEPTH_NEAR_M,farM:p.DEPTH_FAR_M},phenomenonMaskMarginPx:p.MASK_MARGIN_PX,promptMaxChars:l.MAX_CHARS,label:t.label},g={level:0},f={"reference.mp4":[a,g],...Object.fromEntries(c.map(([h,w])=>[`${h}.mp4`,[w,g]])),"prompt.txt":o.encode(l.of(e.recording,{fromSeconds:r,toSeconds:s,rate:d})),"negative-prompt.txt":o.encode(l.NEGATIVE),[t.readmeFile]:o.encode(E),"manifest.json":o.encode(JSON.stringify(y,null,2)+`
9
+ `)};return(async()=>(n&&(f["first-frame.png"]=[new Uint8Array(await n.arrayBuffer()),g]),new Promise((h,w)=>T(f,(R,b)=>R?w(R):h(new Blob([b],{type:"application/zip"}))))))()}}export{S as GenerativeKit};
@@ -0,0 +1 @@
1
+ import{c as r,_ as t}from"./rr0-scene.mjs";const i=r.catalog({en:()=>t(()=>import("./GenerativeKitMessages_en-BY4B6yas.js"),[],import.meta.url).then(e=>e.generativeKitMessages_en),fr:()=>t(()=>import("./GenerativeKitMessages_fr-BY5yUJwK.js"),[],import.meta.url).then(e=>e.generativeKitMessages_fr),es:()=>t(()=>import("./GenerativeKitMessages_es-_iYkoRhK.js"),[],import.meta.url).then(e=>e.generativeKitMessages_es),it:()=>t(()=>import("./GenerativeKitMessages_it-DAgB31P1.js"),[],import.meta.url).then(e=>e.generativeKitMessages_it)});export{i as generativeKitMessages};
@@ -0,0 +1,34 @@
1
+ const e={readmeFile:"README.md",label:"Generated reconstruction, not real footage",readme:`# Generative AI kit: {title}
2
+
3
+ This kit is for making, with a video generator (Runway, Kling, Luma, Veo…), a realistic version of the UFO@home reconstruction of this observation, without letting the generator invent the testimony.
4
+
5
+ Source: {source}
6
+ Made with UFO@home (https://ufoathome.org) on {date}.
7
+
8
+ ## Contents
9
+
10
+ - **reference.mp4**: the reconstruction as the player shows it, with its sound, without caption or logo ({fps} frames/s, {duration} s).
11
+ - **first-frame.png**: its first frame, for generators that start from an image.
12
+ - **depth.mp4**: how far each pixel is, white near, black far and for the sky, on a logarithmic scale from {near} m to {far} m, the same for the whole video.
13
+ - **phenomenon-mask.mp4**: in white, where the phenomenon the witness described stands, grown by {margin} pixels: what the generated phenomenon must not leave.
14
+ - **sky-mask.mp4**: in white, the sky.
15
+ - **prompt.txt**: the prompt, written from the recording's own statements only, {maxChars} characters at most.
16
+ - **negative-prompt.txt**: the negative prompt, what the generator must not do.
17
+ - **manifest.json**: the provenance and the same information, for a program.
18
+
19
+ ## How to use it
20
+
21
+ 1. In the generator, choose a mode that starts from a video ("video to video", "restyle", "modify video"…) and give it reference.mp4. If the video is too long for it, cut it around the moment you want.
22
+ 2. Paste prompt.txt into the prompt field, and negative-prompt.txt into the negative prompt's, if there is one. Set the transformation to the lowest that makes the picture realistic: the geometry, the horizon, the framing and the motion must stay those of the reference.
23
+ 3. If the generator takes a depth control video, give it depth.mp4.
24
+ 4. The generator renders the phenomenon too, so that it has the same grain, blur and light as the rest. Then check the result by laying phenomenon-mask.mp4 over the generated video: if the phenomenon leaves it, changes shape, size, colour or motion, or gains details (portholes, lights, reflections), reject the video and start again with a weaker transformation.
25
+ 5. Burn into the whole picture, not into a corner: "{label}".
26
+ 6. Cite the source above wherever the video is published.
27
+
28
+ ## Do not
29
+
30
+ - Show the generated video to a witness before interviewing them: a realistic picture can change what they remember.
31
+ - Give the generator the witness's account as its prompt: it would draw every word of it, what the witness did not say included.
32
+ - Paste the phenomenon of reference.mp4 back over the generated video: less realistic than the rest, it would look stuck on and draw the eye more than anything else.
33
+ - Present the result as evidence: it shows a reconstruction, not what was seen.
34
+ `};export{e as generativeKitMessages_en};
@@ -0,0 +1,34 @@
1
+ const e={readmeFile:"LEEME.md",label:"Reconstrucción generada, no una imagen real",readme:`# Kit para IA generativa: {title}
2
+
3
+ Este kit sirve para producir, con un generador de vídeo (Runway, Kling, Luma, Veo…), una versión realista de la reconstrucción UFO@home de esta observación, sin dejar que el generador invente el testimonio.
4
+
5
+ Fuente: {source}
6
+ Hecho con UFO@home (https://ufoathome.org) el {date}.
7
+
8
+ ## Contenido
9
+
10
+ - **reference.mp4**: la reconstrucción tal como la muestra el reproductor, con su sonido, sin leyenda ni logotipo ({fps} imágenes/s, {duration} s).
11
+ - **first-frame.png**: su primera imagen, para los generadores que parten de una imagen.
12
+ - **depth.mp4**: la distancia de cada píxel, blanco cerca, negro lejos y para el cielo, en una escala logarítmica de {near} m a {far} m, la misma para todo el vídeo.
13
+ - **phenomenon-mask.mp4**: en blanco, el lugar del fenómeno descrito por el testigo, ampliado {margin} píxeles: de donde el fenómeno generado no debe salir.
14
+ - **sky-mask.mp4**: en blanco, el cielo.
15
+ - **prompt.txt**: el prompt, en inglés, escrito solo a partir de lo que afirma el registro, de {maxChars} caracteres como máximo.
16
+ - **negative-prompt.txt**: el prompt negativo, lo que el generador no debe hacer.
17
+ - **manifest.json**: la procedencia y la misma información, para un programa.
18
+
19
+ ## Modo de empleo
20
+
21
+ 1. En el generador, elegir un modo que parta de un vídeo («video to video», «restyle», «modify video»…) y darle reference.mp4. Si el vídeo es demasiado largo para él, cortarlo en torno al momento deseado.
22
+ 2. Pegar prompt.txt en el campo del prompt, y negative-prompt.txt en el del prompt negativo si lo hay. Ajustar la transformación al mínimo que haga la imagen realista: la geometría, el horizonte, el encuadre y el movimiento deben seguir siendo los de la referencia.
23
+ 3. Si el generador acepta un vídeo de control de profundidad («depth»), darle depth.mp4.
24
+ 4. El generador también reproduce el fenómeno, para que tenga el mismo grano, el mismo desenfoque y la misma luz que el resto. Después, controlar el resultado superponiendo phenomenon-mask.mp4 al vídeo generado: si el fenómeno se sale, cambia de forma, tamaño, color o movimiento, o gana detalles (ojos de buey, luces, reflejos), descartar el vídeo y volver a empezar con una transformación más débil.
25
+ 5. Incrustar en toda la imagen, y no en una esquina: «{label}».
26
+ 6. Citar la fuente anterior allí donde se publique el vídeo.
27
+
28
+ ## No hacer
29
+
30
+ - Mostrar el vídeo generado a un testigo antes de haberlo entrevistado: una imagen realista puede modificar su recuerdo.
31
+ - Dar al generador el texto del testimonio como prompt: dibujaría cada palabra, incluido lo que el testigo no dijo.
32
+ - Volver a pegar el fenómeno de reference.mp4 sobre el vídeo generado: menos realista que el resto, parecería añadido y atraería la mirada más que todo lo demás.
33
+ - Presentar el resultado como una prueba: muestra una reconstrucción, no lo que se vio.
34
+ `};export{e as generativeKitMessages_es};
@@ -0,0 +1,34 @@
1
+ const e={readmeFile:"LISEZ-MOI.md",label:"Reconstitution générée, pas une image réelle",readme:`# Kit pour IA générative : {title}
2
+
3
+ Ce kit sert à produire, avec un générateur vidéo (Runway, Kling, Luma, Veo…), une version réaliste de la reconstitution UFO@home de cette observation, sans laisser le générateur inventer le témoignage.
4
+
5
+ Source : {source}
6
+ Fait avec UFO@home (https://ufoathome.org) le {date}.
7
+
8
+ ## Contenu
9
+
10
+ - **reference.mp4** : la reconstitution telle que le lecteur la montre, avec son son, sans légende ni logo ({fps} images/s, {duration} s).
11
+ - **first-frame.png** : sa première image, pour les générateurs qui partent d'une image.
12
+ - **depth.mp4** : la distance de chaque pixel, blanc près, noir loin et pour le ciel, sur une échelle logarithmique de {near} m à {far} m, la même pour toute la vidéo.
13
+ - **phenomenon-mask.mp4** : en blanc, la place du phénomène décrit par le témoin, élargie de {margin} pixels : ce dont le phénomène généré ne doit pas sortir.
14
+ - **sky-mask.mp4** : en blanc, le ciel.
15
+ - **prompt.txt** : le prompt, en anglais, écrit à partir des seuls énoncés de l'enregistrement, en {maxChars} caractères au plus.
16
+ - **negative-prompt.txt** : le prompt négatif, ce que le générateur ne doit pas faire.
17
+ - **manifest.json** : la provenance et ces mêmes informations, pour un programme.
18
+
19
+ ## Mode d'emploi
20
+
21
+ 1. Dans le générateur, choisir un mode qui part d'une vidéo (« video to video », « restyle », « modify video »…) et y déposer reference.mp4. Si la vidéo est trop longue pour lui, la couper autour du moment voulu.
22
+ 2. Coller prompt.txt dans le champ du prompt, et negative-prompt.txt dans celui du prompt négatif s'il y en a un. Régler la transformation au plus bas qui rende l'image réaliste : la géométrie, l'horizon, le cadrage et le mouvement doivent rester ceux de la référence.
23
+ 3. Si le générateur accepte une vidéo de contrôle de profondeur (« depth »), lui donner depth.mp4.
24
+ 4. Le générateur rend aussi le phénomène, pour qu'il ait le même grain, le même flou et la même lumière que le reste. Contrôler ensuite le résultat en superposant phenomenon-mask.mp4 à la vidéo générée : si le phénomène en sort, change de forme, de taille, de couleur ou de mouvement, ou gagne des détails (hublots, lumières, reflets), rejeter la vidéo et recommencer avec une transformation plus faible.
25
+ 5. Incruster sur toute l'image, et pas dans un coin : « {label} ».
26
+ 6. Citer la source ci-dessus partout où la vidéo est publiée.
27
+
28
+ ## À ne pas faire
29
+
30
+ - Montrer la vidéo générée à un témoin avant de l'avoir interrogé : une image réaliste peut modifier son souvenir.
31
+ - Donner au générateur le texte du témoignage comme prompt : il en dessinerait chaque mot, y compris ce que le témoin n'a pas dit.
32
+ - Recoller le phénomène de reference.mp4 sur la vidéo générée : moins réaliste que le reste, il aurait l'air rapporté et attirerait l'œil plus que tout le reste.
33
+ - Présenter le résultat comme une preuve : il montre une reconstitution, pas ce qui a été vu.
34
+ `};export{e as generativeKitMessages_fr};
@@ -0,0 +1,34 @@
1
+ const e={readmeFile:"LEGGIMI.md",label:"Ricostruzione generata, non un'immagine reale",readme:`# Kit per IA generativa: {title}
2
+
3
+ Questo kit serve a produrre, con un generatore video (Runway, Kling, Luma, Veo…), una versione realistica della ricostruzione UFO@home di questa osservazione, senza lasciare che il generatore inventi la testimonianza.
4
+
5
+ Fonte: {source}
6
+ Fatto con UFO@home (https://ufoathome.org) il {date}.
7
+
8
+ ## Contenuto
9
+
10
+ - **reference.mp4**: la ricostruzione come la mostra il lettore, con il suo sonoro, senza didascalia né logo ({fps} immagini/s, {duration} s).
11
+ - **first-frame.png**: la sua prima immagine, per i generatori che partono da un'immagine.
12
+ - **depth.mp4**: la distanza di ogni pixel, bianco vicino, nero lontano e per il cielo, su una scala logaritmica da {near} m a {far} m, la stessa per tutto il video.
13
+ - **phenomenon-mask.mp4**: in bianco, il posto del fenomeno descritto dal testimone, allargato di {margin} pixel: ciò da cui il fenomeno generato non deve uscire.
14
+ - **sky-mask.mp4**: in bianco, il cielo.
15
+ - **prompt.txt**: il prompt, in inglese, scritto solo a partire da ciò che afferma la registrazione, di {maxChars} caratteri al massimo.
16
+ - **negative-prompt.txt**: il prompt negativo, ciò che il generatore non deve fare.
17
+ - **manifest.json**: la provenienza e le stesse informazioni, per un programma.
18
+
19
+ ## Istruzioni
20
+
21
+ 1. Nel generatore, scegliere una modalità che parta da un video («video to video», «restyle», «modify video»…) e dargli reference.mp4. Se il video è troppo lungo per esso, tagliarlo attorno al momento voluto.
22
+ 2. Incollare prompt.txt nel campo del prompt, e negative-prompt.txt in quello del prompt negativo se c'è. Regolare la trasformazione al minimo che renda l'immagine realistica: la geometria, l'orizzonte, l'inquadratura e il movimento devono restare quelli del riferimento.
23
+ 3. Se il generatore accetta un video di controllo della profondità («depth»), dargli depth.mp4.
24
+ 4. Il generatore rende anche il fenomeno, perché abbia la stessa grana, la stessa sfocatura e la stessa luce del resto. Poi controllare il risultato sovrapponendo phenomenon-mask.mp4 al video generato: se il fenomeno ne esce, cambia forma, dimensione, colore o movimento, o acquista dettagli (oblò, luci, riflessi), scartare il video e ricominciare con una trasformazione più debole.
25
+ 5. Sovrimprimere su tutta l'immagine, e non in un angolo: «{label}».
26
+ 6. Citare la fonte qui sopra ovunque il video sia pubblicato.
27
+
28
+ ## Da non fare
29
+
30
+ - Mostrare il video generato a un testimone prima di averlo intervistato: un'immagine realistica può modificarne il ricordo.
31
+ - Dare al generatore il testo della testimonianza come prompt: ne disegnerebbe ogni parola, compreso ciò che il testimone non ha detto.
32
+ - Reincollare il fenomeno di reference.mp4 sul video generato: meno realistico del resto, sembrerebbe aggiunto e attirerebbe lo sguardo più di tutto il resto.
33
+ - Presentare il risultato come una prova: mostra una ricostruzione, non ciò che è stato visto.
34
+ `};export{e as generativeKitMessages_it};
@@ -1,4 +1,4 @@
1
- import{N as b,d as g,o as P,Q as m,B as C,h as E,p as L,C as x,K as R,X as I}from"./rr0-scene.mjs";class i{constructor(e){this.scene=e}static REAL_BEAMS=4;static LAMPS=2;static DISTANCE_M=500;static AIR_LENGTH_M=90;static CLEAR_AIR_SCATTER_PER_M=2e-4;static SHADOW_MAP_PX=1024;beams=new Map;static airGeometry;has(e){return this.beams.has(e)}get size(){return this.beams.size}lamps(e){return this.beams.get(e)?.lamps??[]}airMeshes(e){return this.beams.get(e)?.air??[]}add(e){if(this.beams.has(e))return!0;if(this.beams.size>=i.REAL_BEAMS)return!1;const t=[],r=[];for(let n=0;n<i.LAMPS;n++){const a=new b(16777215,0,i.DISTANCE_M,Math.PI/8,.5,2);a.castShadow=e==="observer",a.shadow.mapSize.set(i.SHADOW_MAP_PX,i.SHADOW_MAP_PX),a.shadow.camera.near=.4,a.shadow.camera.far=110,a.shadow.bias=-4e-4,a.shadow.normalBias=.04,a.shadow.radius=2,this.scene.add(a),this.scene.add(a.target),t.push(a);const o=new g(i.airCone(),i.airMaterial());o.visible=!1,o.frustumCulled=!1,o.renderOrder=8,o.castShadow=!1,o.receiveShadow=!1,o.name="headlight air",this.scene.add(o),r.push(o)}return this.beams.set(e,{lamps:t,air:r}),!0}remove(e){const t=this.beams.get(e);if(t){for(const r of t.lamps)r.removeFromParent(),r.target.removeFromParent(),r.dispose();for(const r of t.air)r.removeFromParent(),r.material.dispose();this.beams.delete(e)}}clear(e){for(const t of[...this.beams.keys()])e&&t==="observer"||this.remove(t)}dispose(){this.clear(!1),i.airGeometry?.dispose(),i.airGeometry=void 0}aim(e,t,r,n,a,o,u){const c=this.beams.get(e),w=Math.max(u,i.CLEAR_AIR_SCATTER_PER_M);if(!c)return;const l=m.BEAMS[t],v=new P(-n.z,0,n.x),A=e==="observer"&&l!==void 0;c.lamps.forEach((s,d)=>{if(!l){s.intensity=0,c.air[d].visible=!1,s.shadow.autoUpdate=!1;return}const f=d===0?-1:1,h=l.pitchDeg*Math.PI/180,p=l.candela*m.DISPLAY_GAIN*o/c.lamps.length;s.color.set(l.color),s.intensity=p,s.angle=l.halfAngleDeg*Math.PI/180,s.penumbra=l.penumbra,A?(s.shadow.autoUpdate||(s.shadow.needsUpdate=!0),s.shadow.autoUpdate=!0):s.shadow.autoUpdate=!1,s.position.copy(r).addScaledVector(v,f*a);const M=n.clone().addScaledVector(v,-f*Math.tan(m.TOE_IN_DEG*Math.PI/180)).normalize();s.target.position.set(s.position.x+M.x*Math.cos(h)*50,s.position.y-Math.sin(h)*50,s.position.z+M.z*Math.cos(h)*50),s.target.updateMatrixWorld(),this.aimAir(c.air[d],s,l.color,p,w)})}aimAir(e,t,r,n,a){if(e.visible=a*n>1e-4,!e.visible)return;const o=i.AIR_LENGTH_M,u=o*Math.tan(t.angle);e.position.copy(t.position),e.scale.set(u,u,o),e.lookAt(t.target.position),e.updateMatrixWorld();const c=e.material.uniforms;c.uColor.value.set(r),c.uCandela.value=n,c.uScatter.value=a,c.uLength.value=o,c.uRadius.value=u}static airCone(){if(i.airGeometry)return i.airGeometry;const e=24,t=new Float32Array((e+1)*3);for(let a=0;a<e;a++){const o=a/e*Math.PI*2;t.set([Math.cos(o),Math.sin(o),1],(a+1)*3)}const r=[];for(let a=0;a<e;a++)r.push(0,1+a,1+(a+1)%e);const n=new C;return n.setAttribute("position",new E(t,3)),n.setIndex(r),i.airGeometry=n,n}static airMaterial(){return new L({transparent:!0,depthWrite:!1,depthTest:!0,blending:I,side:R,uniforms:{uColor:{value:new x(1,1,1)},uCandela:{value:0},uScatter:{value:0},uLength:{value:90},uRadius:{value:20}},vertexShader:`
1
+ import{X as b,e as g,p as P,Y as m,B as C,i as E,q as L,C as x,Q as R,Z as I}from"./rr0-scene.mjs";class i{constructor(e){this.scene=e}static REAL_BEAMS=4;static LAMPS=2;static DISTANCE_M=500;static AIR_LENGTH_M=90;static CLEAR_AIR_SCATTER_PER_M=2e-4;static SHADOW_MAP_PX=1024;beams=new Map;static airGeometry;has(e){return this.beams.has(e)}get size(){return this.beams.size}lamps(e){return this.beams.get(e)?.lamps??[]}airMeshes(e){return this.beams.get(e)?.air??[]}add(e){if(this.beams.has(e))return!0;if(this.beams.size>=i.REAL_BEAMS)return!1;const t=[],r=[];for(let n=0;n<i.LAMPS;n++){const a=new b(16777215,0,i.DISTANCE_M,Math.PI/8,.5,2);a.castShadow=e==="observer",a.shadow.mapSize.set(i.SHADOW_MAP_PX,i.SHADOW_MAP_PX),a.shadow.camera.near=.4,a.shadow.camera.far=110,a.shadow.bias=-4e-4,a.shadow.normalBias=.04,a.shadow.radius=2,this.scene.add(a),this.scene.add(a.target),t.push(a);const o=new g(i.airCone(),i.airMaterial());o.visible=!1,o.frustumCulled=!1,o.renderOrder=8,o.castShadow=!1,o.receiveShadow=!1,o.name="headlight air",this.scene.add(o),r.push(o)}return this.beams.set(e,{lamps:t,air:r}),!0}remove(e){const t=this.beams.get(e);if(t){for(const r of t.lamps)r.removeFromParent(),r.target.removeFromParent(),r.dispose();for(const r of t.air)r.removeFromParent(),r.material.dispose();this.beams.delete(e)}}clear(e){for(const t of[...this.beams.keys()])e&&t==="observer"||this.remove(t)}dispose(){this.clear(!1),i.airGeometry?.dispose(),i.airGeometry=void 0}aim(e,t,r,n,a,o,u){const c=this.beams.get(e),w=Math.max(u,i.CLEAR_AIR_SCATTER_PER_M);if(!c)return;const l=m.BEAMS[t],v=new P(-n.z,0,n.x),A=e==="observer"&&l!==void 0;c.lamps.forEach((s,d)=>{if(!l){s.intensity=0,c.air[d].visible=!1,s.shadow.autoUpdate=!1;return}const f=d===0?-1:1,h=l.pitchDeg*Math.PI/180,p=l.candela*m.DISPLAY_GAIN*o/c.lamps.length;s.color.set(l.color),s.intensity=p,s.angle=l.halfAngleDeg*Math.PI/180,s.penumbra=l.penumbra,A?(s.shadow.autoUpdate||(s.shadow.needsUpdate=!0),s.shadow.autoUpdate=!0):s.shadow.autoUpdate=!1,s.position.copy(r).addScaledVector(v,f*a);const M=n.clone().addScaledVector(v,-f*Math.tan(m.TOE_IN_DEG*Math.PI/180)).normalize();s.target.position.set(s.position.x+M.x*Math.cos(h)*50,s.position.y-Math.sin(h)*50,s.position.z+M.z*Math.cos(h)*50),s.target.updateMatrixWorld(),this.aimAir(c.air[d],s,l.color,p,w)})}aimAir(e,t,r,n,a){if(e.visible=a*n>1e-4,!e.visible)return;const o=i.AIR_LENGTH_M,u=o*Math.tan(t.angle);e.position.copy(t.position),e.scale.set(u,u,o),e.lookAt(t.target.position),e.updateMatrixWorld();const c=e.material.uniforms;c.uColor.value.set(r),c.uCandela.value=n,c.uScatter.value=a,c.uLength.value=o,c.uRadius.value=u}static airCone(){if(i.airGeometry)return i.airGeometry;const e=24,t=new Float32Array((e+1)*3);for(let a=0;a<e;a++){const o=a/e*Math.PI*2;t.set([Math.cos(o),Math.sin(o),1],(a+1)*3)}const r=[];for(let a=0;a<e;a++)r.push(0,1+a,1+(a+1)%e);const n=new C;return n.setAttribute("position",new E(t,3)),n.setIndex(r),i.airGeometry=n,n}static airMaterial(){return new L({transparent:!0,depthWrite:!1,depthTest:!0,blending:I,side:R,uniforms:{uColor:{value:new x(1,1,1)},uCandela:{value:0},uScatter:{value:0},uLength:{value:90},uRadius:{value:20}},vertexShader:`
2
2
  varying vec3 vLocal;
3
3
  varying vec3 vNormalView;
4
4
  varying vec3 vViewDir;
@@ -0,0 +1,9 @@
1
+ import{c as d,_ as l,bh as o,bi as m,bj as g,bk as f}from"./rr0-scene.mjs";import{P as u,S as b,a as y,c as T,b as A,E}from"./ParameterForm-ez-n_0Dw.js";const w=d.catalog({en:()=>l(()=>import("./LanternParameterTexts_en-CcnGd8UH.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_en),fr:()=>l(()=>import("./LanternParameterTexts_fr-P2JwYOUy.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_fr),es:()=>l(()=>import("./LanternParameterTexts_es-CUTgNutZ.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_es),it:()=>l(()=>import("./LanternParameterTexts_it-CzNnIUrX.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_it)});class i{static RELEASE="letGo";static LANTERNS="lanterns";static AIR="air";static LANTERN="eachLantern";static instant(e,t,n){return{type:"number",key:e,min:-36e3,max:36e3,step:1,unit:"s",scale:.001,required:!0,label:t,hint:n,group:i.LANTERNS}}static wind(e,t,n,s){return[{type:"number",key:`${e}.towardDeg`,min:0,max:360,step:1,unit:"°",group:i.AIR,hint:s,label:t},{type:"number",key:`${e}.speedMS`,min:0,max:60,step:.1,unit:"m/s",group:i.AIR,label:n}]}static SET={kind:"lantern",title:"skyLanterns",parameters:[{type:"said",key:"title",label:"name",group:i.RELEASE},{type:"position",key:"site.eastM",secondKey:"site.northM",saidKey:"site.saidPosition",native:"local",step:1,rangeM:1e5,group:i.RELEASE,label:"whereTheyAreLetGo",hint:"whereTheyAreLetGoFrom"},{type:"number",key:"site.altitudeM",min:-1e3,max:5e3,step:.1,unit:"m",group:i.RELEASE,effective:()=>0,label:"heightAboveThePlaceSGround",hint:"aGardenOnAHillAbove"},{type:"number",key:"site.originElevationM",min:-500,max:6e3,step:1,unit:"m",group:i.RELEASE,effective:()=>0,label:"thePlaceSGroundAboveThe",hint:"whatSetsHowThinTheAir"},{type:"number",key:"group.count",min:1,max:200,step:1,required:!0,group:i.LANTERNS,label:"howMany"},i.instant("group.fromT","firstLetGoAt","secondsOfTheRecordingBeforeIts"),i.instant("group.untilT","lastLetGoAt","secondsOfTheRecordingTheOthers"),{type:"number",key:"group.radiusM",min:0,max:5e3,step:1,unit:"m",group:i.LANTERNS,effective:()=>20,label:"letGoWithin",hint:"aCrowdLetsThemGoA"},{type:"number",key:"group.burnS.min",min:10,max:3600,step:1,unit:"s",group:i.LANTERNS,effective:()=>480,label:"burnsAtLeast",hint:"howLongEachBurnsFromWhen"},{type:"number",key:"group.burnS.max",min:10,max:3600,step:1,unit:"s",group:i.LANTERNS,effective:()=>900,label:"burnsAtMost"},{type:"number",key:"group.insideExcessK.min",min:10,max:400,step:1,unit:"K",group:i.LANTERNS,effective:()=>125,label:"hotterThanTheAirAtLeast",hint:"howMuchHotterThanTheAir"},{type:"number",key:"group.insideExcessK.max",min:10,max:400,step:1,unit:"K",group:i.LANTERNS,effective:()=>175,label:"hotterThanTheAirAtMost"},{type:"number",key:"group.burnedS",min:0,max:3600,step:1,unit:"s",group:i.LANTERNS,effective:()=>0,label:"alreadyBurntWhenLetGo",hint:"forLanternsTheAccountOnlyHas"},{type:"number",key:"group.seed",min:0,max:4294967295,step:1,group:i.LANTERNS,effective:()=>1,label:"draw",hint:"whatTheDrawsStartFromAnother"},{type:"set",key:"group.explains",group:i.LANTERNS,label:"standForTheShapes",options:(e,t)=>{const n=t?.shapes??[],s=(e.group?.explains??[]).filter(r=>!n.some(h=>h.value===r));return[...n,...s.map(r=>({value:r,label:r}))]},empty:"noShape"},...i.wind("wind","windAtTheGroundTowards","windAtTheGroundSpeed","whereItBlowsTowardsWhichIs"),...i.wind("windAloft","windAloftTowards","windAloftSpeed","theWindHigherUpBlendedWith"),{type:"number",key:"windAloft.atM",min:10,max:1e4,step:10,unit:"m",group:i.AIR,label:"windAloftAt",hint:"metresAboveWhereTheyAreLet"},{type:"number",key:"airTemperatureC",min:-60,max:50,step:.5,unit:"°C",group:i.AIR,effective:()=>10,label:"airTemperature",hint:"atTheGroundFallingBy6"},{type:"number",key:"turbulence.horizontalMS",min:0,max:10,step:.1,unit:"m/s",group:i.AIR,effective:()=>o.TURBULENCE.horizontalMS,label:"gustsAcross",hint:"howFarTheAirSSpeed"},{type:"number",key:"turbulence.verticalMS",min:0,max:10,step:.1,unit:"m/s",group:i.AIR,effective:()=>o.TURBULENCE.verticalMS,label:"gustsUpAndDown"},{type:"number",key:"turbulence.timescaleS",min:1,max:600,step:1,unit:"s",group:i.AIR,effective:()=>o.TURBULENCE.timescaleS,label:"aGustLasts"},{type:"number",key:"lantern.luminousIntensityCd",min:.1,max:1e3,step:.1,unit:"cd",group:i.LANTERN,effective:()=>o.COMMON.luminousIntensityCd,label:"light",hint:"itsFlameSLightThroughThe"},{type:"choice",key:"lantern.shape",group:i.LANTERN,effective:()=>o.COMMON.shape,label:"shape",choices:[{value:"classic",label:"roundAtTheMouthSquareAt"},{value:"balloon",label:"balloonLobedTop"}]},{type:"colour",key:"lantern.paperColor",group:i.LANTERN,fallback:o.COMMON.paperColor,label:"paperColour",hint:"whatItLooksLikeByDay"},{type:"colour",key:"lantern.color",group:i.LANTERN,fallback:o.COMMON.color,label:"flameLight",hint:"itsFlameSLightThroughWhite"},{type:"number",key:"lantern.envelopeVolumeM3",min:.01,max:10,step:.01,unit:"m³",group:i.LANTERN,effective:()=>o.COMMON.envelopeVolumeM3,label:"airItHolds"},{type:"number",key:"lantern.massKg",min:.005,max:5,step:.001,unit:"kg",group:i.LANTERN,effective:()=>o.COMMON.massKg,label:"weightWhenLetGo"}]};static publish(){u.publish(i.SET)}}const v=d.catalog({en:()=>l(()=>import("./LanternEditorMessages_en-DaT3UNfD.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_en),fr:()=>l(()=>import("./LanternEditorMessages_fr-9mByTFMG.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_fr),es:()=>l(()=>import("./LanternEditorMessages_es-TDV5lKeJ.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_es),it:()=>l(()=>import("./LanternEditorMessages_it-MRkJnDQp.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_it)});class p{constructor(e,t,n){this.container=e,this.host=t,b.attach(e,"lantern-editor-part",p.STYLE),this.language=n,u.of("lantern")||i.publish(),this.ready=this.setLanguage(n)}messages;ready;parameterTexts;languageToken=0;currentId;form;list;language;shown=[];static STYLE='.lantern-editor-part { flex-basis: 100%; min-width: 0; } .lantern-editor-part #lantern-list { flex-basis: 100%; min-width: 0; } .lantern-editor-part .launch-editor, .lantern-editor-part .launch-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; } .lantern-editor-part .launch-fields { flex-basis: 100%; min-width: 0; } .lantern-editor-part [hidden] { display: none !important; } .lantern-editor-part select { min-width: 0; width: 100%; } .lantern-editor-part .launch-intro { flex-basis: 100%; margin: 0; } .lantern-editor-part .launch-parameters { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .lantern-editor-part .parameter-group { flex: 1 1 14em; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; align-content: flex-start; } .lantern-editor-part input, .lantern-editor-part select { max-width: 100%; box-sizing: border-box; } .lantern-editor-part input[type="text"] { width: 12em; } .lantern-editor-part label { min-width: 0; max-width: 100%; } .lantern-editor-part input.parameter-derived::placeholder { opacity: .65; }';async setLanguage(e){const t=++this.languageToken;this.language=e;const[n,s]=await Promise.all([v.load(e),w.load(e)]);t===this.languageToken&&(this.messages=n,this.parameterTexts=s,this.render(),this.sync())}sync(){if(!this.messages)return;const e=this.launches;this.shown=[...e],e.some(r=>r.id===this.currentId)||(this.currentId=e[0]?.id),this.list?.setItems(e.map(r=>({id:r.id,label:this.labelOf(r)})),this.currentId),this.syncAddState();const t=this.current;if(this.element("lantern-fields").hidden=t===void 0,!t)return;const n=t.releases?.length??0,s=this.element("lantern-releases");s.hidden=n===0,s.textContent=this.messages.releasesNote.replace("{n}",String(n)),this.form??=new y(this.element("lantern-parameters"),this.language,"lantern.",{said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()}),this.form.show(this.resolved(i.SET),new T(()=>this.current,r=>this.editLaunch(h=>r(h)),()=>({shapes:this.host.shapes().map(r=>({value:r.id,label:r.label}))}),this.host.positionPlace?.()),()=>this.written())}refresh(){if(!this.messages)return;this.syncAddState();const e=this.launches;e.length===this.shown.length&&e.every((t,n)=>t.id===this.shown[n].id)||this.sync()}syncAddState(){const e=this.siteOfNew()!==void 0;this.list?.setAddState(e,e?void 0:this.messages.addLaunchNowhere)}get current(){return this.launches.find(e=>e.id===this.currentId)}resolved(e){return A.resolve(e,this.parameterTexts)}render(){if(!this.messages)return;const e=this.messages;this.form=void 0,this.container.innerHTML=`<div class="launch-editor">
2
+ <p class="launch-intro">${e.intro}</p>
3
+ <div id="lantern-list"></div>
4
+ <div id="lantern-fields" class="launch-fields">
5
+ <div id="lantern-parameters" class="launch-parameters"></div>
6
+ <p id="lantern-releases" class="launch-intro" hidden></p>
7
+ <p class="launch-intro">${e.derivedNote}</p>
8
+ </div>
9
+ </div>`,this.list=new E({header:this.element("lantern-list"),body:this.element("lantern-fields"),ids:{list:"lantern-select",remove:"lantern-delete",add:"lantern-add"},onSelect:t=>{this.currentId=t,this.sync()},onAdd:()=>this.addLaunch(),onRemove:()=>this.deleteCurrent()}),this.list.setLabels({list:e.launch,remove:e.deleteLaunch,add:e.addLaunch,empty:e.none})}written(){const e=this.current;e&&this.list?.rename(e.id,this.labelOf(e))}editLaunch(e){const t=this.current;if(!t)return;const n=structuredClone(t);e(n),this.writeLaunches(this.launches.map(s=>s===t?n:s)),this.host.changed()}siteOfNew(){const e=this.host.sighting(),t=e.event?.place?.[0];if(t?.lat===void 0||t.lng===void 0)return;const n=e.observerTrack?.getInterpolatedPoseAt(0),s=(n?.headingDeg??0)*Math.PI/180,r=111320,h=n?.lng!==void 0?(n.lng-t.lng)*r*Math.cos(t.lat*Math.PI/180):0,c=n?.lat!==void 0?(n.lat-t.lat)*r:0;return{eastM:Math.round(h+1500*Math.sin(s)),northM:Math.round(c+1500*Math.cos(s))}}addLaunch(){const e=this.siteOfNew();if(!e)return;let t=this.launches.length+1;for(;this.launches.some(r=>r.id===`lanterns-${t}`);)t++;const n=m(this.host.sighting(),0),s={id:`lanterns-${t}`,site:e,group:{count:12,fromT:0,untilT:12e4,seed:t},wind:{towardDeg:Math.round((n.windDirectionDeg+180)%360),speedMS:Math.round(n.windSpeed*10)/10}};this.writeLaunches([...this.launches,s]),this.currentId=s.id,this.host.changed(),this.sync()}deleteCurrent(){const e=this.current;e&&(this.currentId=void 0,this.writeLaunches(this.launches.filter(t=>t!==e)),this.host.changed(),this.sync())}writeLaunches(e){const t=this.host.sighting(),n={...t.interpretation??{bodies:[]},lanterns:e.length>0?e:void 0};n.lanterns===void 0&&delete n.lanterns;const s=g.saysNothing(n,f.kinds());t.interpretation=s?void 0:n}labelOf(e){const t=this.host.said().read(e.title);return t?`${t} (${e.id})`:e.id}get launches(){return this.host.sighting().interpretation?.lanterns??[]}element(e){return this.container.querySelector(`#${e}`)}}export{p as LanternEditor};
@@ -1 +1 @@
1
- import{R as O,aV as D,aW as y}from"./rr0-scene.mjs";class l{static DEFAULT_DIVERGENCE_MRAD=.1;static DEFAULT_APERTURE_M=.01;static AEROSOL_SINGLE_SCATTERING_ALBEDO=.9;static AEROSOL_ASYMMETRY=.7;static DEFAULT_PATCHINESS=.35;static PATCH_M=120;static STEP_M=25;static MAX_SAMPLES=2e3;static viewsAt(n,o,t,s){return l.onAt(n,o).map(c=>l.viewOf(c,t,s))}static viewOf(n,o,t){return{id:n.id,wavelengthNm:n.wavelengthNm,patchiness:n.patchiness??l.DEFAULT_PATCHINESS,samples:l.samplesOf(n,o,t)}}static onAt(n,o){return n.filter(t=>(t.fromT===void 0||o>=t.fromT)&&(t.untilT===void 0||o<=t.untilT)).map(t=>l.stateAt(t,o)).filter(t=>t.path.length>=2)}static stateAt(n,o){if(!n.light?.length&&!n.moves?.length)return n;const t={...n};if(n.light?.length){const s=l.joined(n.light.filter(e=>e.wavelengthNm!==void 0),o,e=>e.wavelengthNm),c=l.joined(n.light.filter(e=>e.powerW!==void 0),o,e=>e.powerW);s!==void 0&&(t.wavelengthNm=s),c!==void 0&&(t.powerW=c)}return n.moves?.length&&(t.path=l.pathAt(n.moves,o)),t}static joined(n,o,t){if(n.length===0)return;const s=[...n].sort((a,i)=>a.t-i.t);if(o<=s[0].t)return t(s[0]);const c=s[s.length-1];if(o>=c.t)return t(c);const e=s.findIndex(a=>a.t>o),r=s[e-1],h=s[e],M=(o-r.t)/(h.t-r.t);return t(r)+(t(h)-t(r))*M}static pathAt(n,o){const t=[...n].sort((a,i)=>a.t-i.t);if(o<=t[0].t)return t[0].path;const s=t[t.length-1];if(o>=s.t)return s.path;const c=t.findIndex(a=>a.t>o),e=t[c-1],r=t[c];if(e.path.length!==r.path.length)return e.path;const h=(o-e.t)/(r.t-e.t),M=(a,i)=>a+(i-a)*h;return e.path.map((a,i)=>({lat:M(a.lat,r.path[i].lat),lng:M(a.lng,r.path[i].lng),altitudeM:M(a.altitudeM,r.path[i].altitudeM)}))}static patchAt(n,o,t){if(t.patchiness<=0)return 1;const s=o/1e3,c=(r,h)=>{const M=(n-t.windAlongMS*s)/r,a=(Math.abs(t.windAcrossMS)+.3)*s/r+h;return l.valueNoise(M,a)},e=(2*c(l.PATCH_M,0)+c(l.PATCH_M/3,17.3))/3;return 1+t.patchiness*(2*e-1)}static valueNoise(n,o){const t=Math.floor(n),s=Math.floor(o),c=n-t,e=o-s,r=i=>i*i*(3-2*i),h=(i,g)=>{const v=Math.sin(i*127.1+g*311.7)*43758.5453;return v-Math.floor(v)},M=h(t,s)+(h(t+1,s)-h(t,s))*r(c),a=h(t,s+1)+(h(t+1,s+1)-h(t,s+1))*r(c);return M+(a-M)*r(e)}static samplesOf(n,o,t){const s=O.ecef({lat:o.lat,lng:o.lng,heightM:0}),c=o.lat*Math.PI/180,e=o.lng*Math.PI/180,r=u=>{const p=u[0]-s[0],A=u[1]-s[1],f=u[2]-s[2];return[-Math.sin(e)*p+Math.cos(e)*A,-Math.sin(c)*Math.cos(e)*p-Math.sin(c)*Math.sin(e)*A+Math.cos(c)*f,Math.cos(c)*Math.cos(e)*p+Math.cos(c)*Math.sin(e)*A+Math.sin(c)*f]},h=(n.divergenceMrad??l.DEFAULT_DIVERGENCE_MRAD)/1e3,M=n.apertureM??l.DEFAULT_APERTURE_M,a=[];let i=0,g=n.powerW,v=0;for(let u=0;u+1<n.path.length;u++){const p=n.path[u],A=n.path[u+1],f=O.ecef({lat:p.lat,lng:p.lng,heightM:p.altitudeM}),w=O.ecef({lat:A.lat,lng:A.lng,heightM:A.altitudeM}),d=Math.hypot(w[0]-f[0],w[1]-f[1],w[2]-f[2]),[C,S]=(()=>{const[E,R]=r(f),[N,T]=r(w);return[(N-E)/(d||1),(T-R)/(d||1)]})(),I=Math.max(1,Math.min(l.MAX_SAMPLES,Math.ceil(d/l.STEP_M)));for(let E=u===0?0:1;E<=I;E++){const R=E/I,N=[0,1,2].map(P=>f[P]+(w[P]-f[P])*R),T=R*d,x=p.altitudeM+(A.altitudeM-p.altitudeM)*R+l.bulgeM(T,d);if(E>0){const P=a[a.length-1],G=T+i-P.fromSourceM,H=l.extinctionAt(t,n.wavelengthNm,(P.altitudeM+x)/2);v+=H*G,g=n.powerW*Math.exp(-v)}const[U,W,F]=r(N);a.push({eastM:U,northM:W,upM:F,altitudeM:x,fromSourceM:i+T,dirEast:C,dirNorth:S,widthM:M+h*(i+T),powerW:g})}i+=d}return a}static bulgeM(n,o){return n*(o-n)/(2*6371e3)}static extinctionAt(n,o,t){const{rayleighPerM:s,aerosolPerM:c}=l.coefficientsAt(n,o,t);return s+c}static coefficientsAt(n,o,t){const s=D.rayleighAt(o)*D.rayleighDensity(t),c=n.aerosol[1]*(o/550)**-1.3*D.aerosolDensity(t);return{rayleighPerM:s,aerosolPerM:c}}static phasedScattering(n,o){const t=3/(16*Math.PI)*(1+o*o),s=l.AEROSOL_ASYMMETRY,c=(1-s*s)/(4*Math.PI*(1+s*s-2*s*o)**1.5);return n.rayleighPerM*t+n.aerosolPerM*l.AEROSOL_SINGLE_SCATTERING_ALBEDO*c}static efficacy(n){return 683*Math.max(0,y.colourMatching(n)[1])}static colourOf(n){const[o,t,s]=y.colourMatching(n);if(t<=0)return[0,0,0];const c=y.linearSrgbOf([o/t,1,s/t]).map(r=>Math.max(0,r)),e=.2126*c[0]+.7152*c[1]+.0722*c[2];return c.map(r=>r/e)}static luminanceCdM2(n,o,t,s,c){return l.efficacy(o)*n*t/(s*Math.max(c,.001))}}export{l as L};
1
+ import{R as O,aZ as D,a_ as y}from"./rr0-scene.mjs";class l{static DEFAULT_DIVERGENCE_MRAD=.1;static DEFAULT_APERTURE_M=.01;static AEROSOL_SINGLE_SCATTERING_ALBEDO=.9;static AEROSOL_ASYMMETRY=.7;static DEFAULT_PATCHINESS=.35;static PATCH_M=120;static STEP_M=25;static MAX_SAMPLES=2e3;static viewsAt(n,o,t,s){return l.onAt(n,o).map(c=>l.viewOf(c,t,s))}static viewOf(n,o,t){return{id:n.id,wavelengthNm:n.wavelengthNm,patchiness:n.patchiness??l.DEFAULT_PATCHINESS,samples:l.samplesOf(n,o,t)}}static onAt(n,o){return n.filter(t=>(t.fromT===void 0||o>=t.fromT)&&(t.untilT===void 0||o<=t.untilT)).map(t=>l.stateAt(t,o)).filter(t=>t.path.length>=2)}static stateAt(n,o){if(!n.light?.length&&!n.moves?.length)return n;const t={...n};if(n.light?.length){const s=l.joined(n.light.filter(e=>e.wavelengthNm!==void 0),o,e=>e.wavelengthNm),c=l.joined(n.light.filter(e=>e.powerW!==void 0),o,e=>e.powerW);s!==void 0&&(t.wavelengthNm=s),c!==void 0&&(t.powerW=c)}return n.moves?.length&&(t.path=l.pathAt(n.moves,o)),t}static joined(n,o,t){if(n.length===0)return;const s=[...n].sort((a,i)=>a.t-i.t);if(o<=s[0].t)return t(s[0]);const c=s[s.length-1];if(o>=c.t)return t(c);const e=s.findIndex(a=>a.t>o),r=s[e-1],h=s[e],M=(o-r.t)/(h.t-r.t);return t(r)+(t(h)-t(r))*M}static pathAt(n,o){const t=[...n].sort((a,i)=>a.t-i.t);if(o<=t[0].t)return t[0].path;const s=t[t.length-1];if(o>=s.t)return s.path;const c=t.findIndex(a=>a.t>o),e=t[c-1],r=t[c];if(e.path.length!==r.path.length)return e.path;const h=(o-e.t)/(r.t-e.t),M=(a,i)=>a+(i-a)*h;return e.path.map((a,i)=>({lat:M(a.lat,r.path[i].lat),lng:M(a.lng,r.path[i].lng),altitudeM:M(a.altitudeM,r.path[i].altitudeM)}))}static patchAt(n,o,t){if(t.patchiness<=0)return 1;const s=o/1e3,c=(r,h)=>{const M=(n-t.windAlongMS*s)/r,a=(Math.abs(t.windAcrossMS)+.3)*s/r+h;return l.valueNoise(M,a)},e=(2*c(l.PATCH_M,0)+c(l.PATCH_M/3,17.3))/3;return 1+t.patchiness*(2*e-1)}static valueNoise(n,o){const t=Math.floor(n),s=Math.floor(o),c=n-t,e=o-s,r=i=>i*i*(3-2*i),h=(i,g)=>{const v=Math.sin(i*127.1+g*311.7)*43758.5453;return v-Math.floor(v)},M=h(t,s)+(h(t+1,s)-h(t,s))*r(c),a=h(t,s+1)+(h(t+1,s+1)-h(t,s+1))*r(c);return M+(a-M)*r(e)}static samplesOf(n,o,t){const s=O.ecef({lat:o.lat,lng:o.lng,heightM:0}),c=o.lat*Math.PI/180,e=o.lng*Math.PI/180,r=u=>{const p=u[0]-s[0],A=u[1]-s[1],f=u[2]-s[2];return[-Math.sin(e)*p+Math.cos(e)*A,-Math.sin(c)*Math.cos(e)*p-Math.sin(c)*Math.sin(e)*A+Math.cos(c)*f,Math.cos(c)*Math.cos(e)*p+Math.cos(c)*Math.sin(e)*A+Math.sin(c)*f]},h=(n.divergenceMrad??l.DEFAULT_DIVERGENCE_MRAD)/1e3,M=n.apertureM??l.DEFAULT_APERTURE_M,a=[];let i=0,g=n.powerW,v=0;for(let u=0;u+1<n.path.length;u++){const p=n.path[u],A=n.path[u+1],f=O.ecef({lat:p.lat,lng:p.lng,heightM:p.altitudeM}),w=O.ecef({lat:A.lat,lng:A.lng,heightM:A.altitudeM}),d=Math.hypot(w[0]-f[0],w[1]-f[1],w[2]-f[2]),[C,S]=(()=>{const[E,R]=r(f),[N,T]=r(w);return[(N-E)/(d||1),(T-R)/(d||1)]})(),I=Math.max(1,Math.min(l.MAX_SAMPLES,Math.ceil(d/l.STEP_M)));for(let E=u===0?0:1;E<=I;E++){const R=E/I,N=[0,1,2].map(P=>f[P]+(w[P]-f[P])*R),T=R*d,x=p.altitudeM+(A.altitudeM-p.altitudeM)*R+l.bulgeM(T,d);if(E>0){const P=a[a.length-1],W=T+i-P.fromSourceM,H=l.extinctionAt(t,n.wavelengthNm,(P.altitudeM+x)/2);v+=H*W,g=n.powerW*Math.exp(-v)}const[U,F,G]=r(N);a.push({eastM:U,northM:F,upM:G,altitudeM:x,fromSourceM:i+T,dirEast:C,dirNorth:S,widthM:M+h*(i+T),powerW:g})}i+=d}return a}static bulgeM(n,o){return n*(o-n)/(2*6371e3)}static extinctionAt(n,o,t){const{rayleighPerM:s,aerosolPerM:c}=l.coefficientsAt(n,o,t);return s+c}static coefficientsAt(n,o,t){const s=D.rayleighAt(o)*D.rayleighDensity(t),c=n.aerosol[1]*(o/550)**-1.3*D.aerosolDensity(t);return{rayleighPerM:s,aerosolPerM:c}}static phasedScattering(n,o){const t=3/(16*Math.PI)*(1+o*o),s=l.AEROSOL_ASYMMETRY,c=(1-s*s)/(4*Math.PI*(1+s*s-2*s*o)**1.5);return n.rayleighPerM*t+n.aerosolPerM*l.AEROSOL_SINGLE_SCATTERING_ALBEDO*c}static efficacy(n){return 683*Math.max(0,y.colourMatching(n)[1])}static colourOf(n){const[o,t,s]=y.colourMatching(n);if(t<=0)return[0,0,0];const c=y.linearSrgbOf([o/t,1,s/t]).map(r=>Math.max(0,r)),e=.2126*c[0]+.7152*c[1]+.0722*c[2];return c.map(r=>r/e)}static luminanceCdM2(n,o,t,s,c){return l.efficacy(o)*n*t/(s*Math.max(c,.001))}}export{l as L};
@@ -0,0 +1,22 @@
1
+ import{c as y,_ as d,a$ as E}from"./rr0-scene.mjs";import{P as b,S as w,a as x,b as j,I as g,E as k,c as v}from"./ParameterForm-ez-n_0Dw.js";import{L as T}from"./LaunchPlume-eEIp7_hM.js";import{T as I}from"./TimelineTracks-BQXJMJaJ.js";const S=y.catalog({en:()=>d(()=>import("./LaunchParameterTexts_en-DvrCwbDM.js"),[],import.meta.url).then(r=>r.launchParameterTexts_en),fr:()=>d(()=>import("./LaunchParameterTexts_fr-Bh_1zVzy.js"),[],import.meta.url).then(r=>r.launchParameterTexts_fr),es:()=>d(()=>import("./LaunchParameterTexts_es--RUAegVp.js"),[],import.meta.url).then(r=>r.launchParameterTexts_es),it:()=>d(()=>import("./LaunchParameterTexts_it-CWDx9nJy.js"),[],import.meta.url).then(r=>r.launchParameterTexts_it)});class n{static plumeValue(e){return t=>T.plumeOf(t)[e]}static plume(e,t){return{type:"number",key:`plume.${e}`,effective:n.plumeValue(e),...t}}static burn(e,t){return{type:"number",key:e,min:-3600,max:36e3,step:.1,unit:"s",scale:.001,label:t.label,hint:t.hint,group:"engine",effective:i=>t.ends(i.track??[])?.t}}static placeAt(e,t){if(e.length===0)return{t,lat:0,lng:0,altitudeKm:0};if(e.length===1)return{t,lat:e[0].lat,lng:e[0].lng,altitudeKm:e[0].altitudeKm};let i=0;for(;i<e.length-2&&e[i+1].t<t;)i++;const s=e[i],a=e[i+1],l=a.t===s.t?0:(t-s.t)/(a.t-s.t),o=(m,h)=>m+(h-m)*l;return{t,lat:o(s.lat,a.lat),lng:o(s.lng,a.lng),altitudeKm:Math.max(0,o(s.altitudeKm,a.altitudeKm))}}static instantsOf(e){return[...e.track.map(t=>t.t),...[e.burnFromT,e.burnUntilT].filter(t=>t!==void 0),...(e.jets??[]).flatMap(t=>[t.fromT,t.untilT])]}static SET={kind:"launch",title:"launch",parameters:[{type:"said",key:"title",label:"name",group:"vehicle"},{type:"text",key:"vehicle.mission",label:"mission",placeholder:"Starlink Group 10-49",group:"vehicle"},{type:"number",key:"vehicle.engine.thrustKN",min:1,max:1e5,step:1,unit:"kN",label:"thrustVacuum",hint:"merlinVacuum934Rl10110A",group:"engine"},{type:"number",key:"vehicle.engine.specificImpulseS",min:100,max:500,step:1,unit:"s",label:"specificImpulseVacuum",hint:"times981MSIt",group:"engine"},{type:"choice",key:"vehicle.engine.propellant",label:"propellant",hint:"whatTheExhaustIsMadeOf",choices:[{value:"rp1-lox",label:"keroseneAndOxygen"},{value:"methane-lox",label:"methaneAndOxygen"},{value:"hydrogen-lox",label:"hydrogenAndOxygen"},{value:"hypergolic",label:"hypergolic"},{value:"solid",label:"solid"}],group:"engine"},n.burn("burnFromT",{label:"engineStart",hint:"whenTheEngineStartedInSeconds",ends:e=>e[0]}),n.burn("burnUntilT",{label:"engineCutOff",hint:"whenTheEngineStoppedInSeconds",ends:e=>e[e.length-1]}),n.plume("exhaustKgPerS",{min:.1,max:1e5,step:.1,unit:"kg/s",label:"exhaustFlow",hint:"howMuchExhaustLeavesTheEngine",group:"plume"}),n.plume("condensedShare",{min:0,max:1,step:.01,label:"shareThatScatters",hint:"theShareOfTheExhaustThat",group:"plume"}),n.plume("particleRadiusUm",{min:.05,max:5,step:.05,unit:"µm",label:"particleRadius",group:"plume"}),n.plume("lifetimeS",{min:10,max:3600,step:10,unit:"s",label:"trailLifetime",hint:"howLongTheNarrowTrailLasts",group:"plume"}),n.plume("expansionKmPerS",{min:0,max:5,step:.01,unit:"km/s",label:"trailSpreading",group:"plume"}),n.plume("initialRadiusKm",{min:0,max:50,step:.1,unit:"km",label:"radiusAtRelease",group:"plume"}),n.plume("collarShare",{min:0,max:1,step:.01,label:"shareInTheCollar",hint:"theCollarIsTheExhaustJust",group:"collar"}),n.plume("collarExpansionKmPerS",{min:0,max:10,step:.05,unit:"km/s",label:"collarSpreading",hint:"howFastTheCollarWidensThree",group:"collar"}),n.plume("collarLifetimeS",{min:1,max:300,step:1,unit:"s",label:"collarLifetime",group:"collar"})]};static PLACE={kind:"launch-place",title:"placeOfThePath",parameters:[{type:"number",key:"t",min:-3600,max:36e3,step:.1,unit:"s",scale:.001,required:!0,label:"time",hint:"secondsOfTheRecordingNegativeBefore"},{type:"position",key:"lat",secondKey:"lng",saidKey:"saidPosition",native:"geo",step:1,label:"position"},{type:"number",key:"altitudeKm",min:0,max:2e3,step:.1,unit:"km",required:!0,label:"altitude"}]};static jetContext(e,t){return{launch:e,index:t}}static jetValue(e){return(t,i)=>{const{launch:s,index:a}=i??{};return s?e(T.releaseOf(s,t,a)):void 0}}static JET_GROUP="jet";static JET={kind:"launch-jet",title:"jet",parameters:[{type:"choice",key:"kind",required:!0,label:"what",choices:[{value:"burn",label:"engineBurn"},{value:"vent",label:"propellantVented"}],group:n.JET_GROUP},{type:"number",key:"fromT",min:-36e3,max:36e3,step:.1,unit:"s",scale:.001,required:!0,label:"from",hint:"secondsOfTheRecordingNegativeBefore2",group:n.JET_GROUP},{type:"number",key:"untilT",min:-36e3,max:36e3,step:.1,unit:"s",scale:.001,required:!0,label:"until",group:n.JET_GROUP},{type:"number",key:"angleDeg",min:0,max:180,step:1,unit:"°",effective:()=>0,label:"directionFromAft",hint:"t0StraightBackAlongTheStage",group:n.JET_GROUP},{type:"number",key:"azimuthDeg",min:-360,max:360,step:1,unit:"°",effective:()=>0,label:"side",hint:"roundTheLineOfMotionWhich",group:n.JET_GROUP},{type:"number",key:"spinPeriodS",min:-3600,max:3600,step:.1,unit:"s",label:"spinPeriod",hint:"howLongTheStageTakesTo",group:n.JET_GROUP},{type:"number",key:"speedKmPerS",min:0,max:10,step:.01,unit:"km/s",effective:n.jetValue(e=>e.speedKmPerS),label:"speed",hint:"howFastItLeavesTheStage",group:n.JET_GROUP},{type:"number",key:"massKgPerS",min:0,max:1e5,step:.1,unit:"kg/s",effective:n.jetValue(e=>e.massKgPerS),label:"flow",group:n.JET_GROUP},{type:"number",key:"condensedShare",min:0,max:1,step:.01,effective:n.jetValue(e=>e.condensedShare),label:"shareThatScatters",group:n.JET_GROUP},{type:"number",key:"particleRadiusUm",min:.05,max:5,step:.05,unit:"µm",effective:n.jetValue(e=>e.particleRadiusUm),label:"particleRadius",group:n.JET_GROUP},{type:"number",key:"expansionKmPerS",min:0,max:5,step:.01,unit:"km/s",effective:n.jetValue(e=>e.populations[0].expansionKmPerS),label:"spreading",hint:"howFastEachPuffOfIt",group:n.JET_GROUP},{type:"number",key:"initialRadiusKm",min:0,max:50,step:.1,unit:"km",effective:n.jetValue(e=>e.initialRadiusKm),label:"radiusAtRelease",group:n.JET_GROUP},{type:"number",key:"lifetimeS",min:1,max:7200,step:1,unit:"s",effective:n.jetValue(e=>e.populations[0].lifetimeS),label:"lifetime",group:n.JET_GROUP}]};static publish(){b.publish(n.SET)}}const O=y.catalog({en:()=>d(()=>import("./LaunchEditorMessages_en-BnzNAYW9.js"),[],import.meta.url).then(r=>r.launchEditorMessages_en),fr:()=>d(()=>import("./LaunchEditorMessages_fr-Ds_VOB8c.js"),[],import.meta.url).then(r=>r.launchEditorMessages_fr),es:()=>d(()=>import("./LaunchEditorMessages_es-BE0dEl7I.js"),[],import.meta.url).then(r=>r.launchEditorMessages_es),it:()=>d(()=>import("./LaunchEditorMessages_it-DPQaR8HY.js"),[],import.meta.url).then(r=>r.launchEditorMessages_it)});class u{constructor(e,t,i){this.container=e,this.host=t,w.attach(e,"launch-editor-part",u.STYLE),this.language=i,b.of("launch")||n.publish(),this.ready=this.setLanguage(i)}messages;ready;parameterTexts;languageToken=0;currentId;form;list;timeline;row="path";placeForm;placeIndex=0;jetForm;jetIndex=0;language;shown=[];static STYLE='.launch-editor-part { flex-basis: 100%; min-width: 0; } .launch-editor-part #launch-timeline { flex-basis: 100%; min-width: 0; padding: 4px 0; } .launch-editor-part .launch-path > .icon-btn { align-self: flex-end; } .launch-editor-part #launch-list, .launch-editor-part #launch-places { flex-basis: 100%; min-width: 0; } .launch-editor-part .launch-editor, .launch-editor-part .launch-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; } .launch-editor-part .launch-fields { flex-basis: 100%; min-width: 0; } .launch-editor-part [hidden] { display: none !important; } .launch-editor-part select { min-width: 0; width: 100%; } .launch-editor-part .launch-intro { flex-basis: 100%; margin: 0; } .launch-editor-part .launch-track { flex-basis: 100%; margin: 0; } .launch-editor-part .launch-parameters { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .launch-editor-part .parameter-group { flex: 1 1 14em; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; align-content: flex-start; } .launch-editor-part input, .launch-editor-part select { max-width: 100%; box-sizing: border-box; } .launch-editor-part input[type="text"] { width: 12em; } .launch-editor-part #launch-title { width: 18em; } .launch-editor-part label { min-width: 0; max-width: 100%; } .launch-editor-part input.parameter-derived::placeholder { opacity: .65; } .launch-editor-part .launch-path { flex: 1 1 100%; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; }';async setLanguage(e){const t=++this.languageToken;this.language=e;const[i,s]=await Promise.all([O.load(e),S.load(e)]);t===this.languageToken&&(this.messages=i,this.parameterTexts=s,this.render(),this.sync())}sync(){if(!this.messages)return;const e=this.launches;this.shown=[...e],e.some(s=>s.id===this.currentId)||(this.currentId=e[0]?.id),this.list?.setItems(e.map(s=>({id:s.id,label:this.labelOf(s)})),this.currentId),this.syncAddState();const t=this.current;if(this.element("launch-fields").hidden=t===void 0,!t)return;this.syncPlace(!0),this.syncJet(!0);const i=this.resolved(b.of("launch"));this.form??=new x(this.element("launch-parameters"),this.language,"",{said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()}),this.form.show(i,t,()=>this.written())}refresh(){if(!this.messages)return;this.syncAddState();const e=this.launches;if(e.length===this.shown.length&&e.every((t,i)=>t===this.shown[i])){this.syncTimeline();return}this.sync()}setTime(e){this.messages&&this.timeline?.setTime(e)}syncAddState(){const e=this.startOfNew()!==void 0;this.list?.setAddState(e,e?void 0:this.messages.addLaunchNowhere)}get current(){return this.launches.find(e=>e.id===this.currentId)}show(e){this.messages&&(this.currentId=e,this.row="path",this.placeIndex=0,this.jetIndex=0,this.sync())}resolved(e){return j.resolve(e,this.parameterTexts)}render(){if(!this.messages)return;const e=this.messages;this.form=void 0,this.container.innerHTML=`<div class="launch-editor">
2
+ <p class="launch-intro">${e.intro}</p>
3
+ <div id="launch-list"></div>
4
+ <div id="launch-fields" class="launch-fields">
5
+ <div id="launch-parameters" class="launch-parameters"></div>
6
+ <div id="launch-timeline" class="launch-timeline"></div>
7
+ <button id="launch-jet-add-burn" type="button" title="${e.addJet}">${g.PLUS} ${e.jetBurn}</button>
8
+ <button id="launch-jet-add-vent" type="button" title="${e.addJet}">${g.PLUS} ${e.jetVent}</button>
9
+ <p class="launch-intro">${e.timelineNote}</p>
10
+ <fieldset id="launch-path" class="launch-path">
11
+ <legend>${e.path}</legend>
12
+ <div id="launch-place-parameters" class="launch-parameters"></div>
13
+ <button id="launch-place-delete" class="icon-btn" type="button" title="${e.deletePlace}" aria-label="${e.deletePlace}">${g.TRASH}</button>
14
+ </fieldset>
15
+ <fieldset id="launch-jets" class="launch-path">
16
+ <legend id="launch-jet-legend">${e.jet}</legend>
17
+ <div id="launch-jet-parameters" class="launch-parameters"></div>
18
+ <button id="launch-jet-delete" class="icon-btn" type="button" title="${e.deleteJet}" aria-label="${e.deleteJet}">${g.TRASH}</button>
19
+ </fieldset>
20
+ <p class="launch-intro">${e.derivedNote}</p>
21
+ </div>
22
+ </div>`;const t=this.element("launch-list");this.list=new k({header:t,body:this.element("launch-fields"),ids:{list:"launch-select",remove:"launch-delete",add:"launch-add",kinds:"launch-add-kind",kind:i=>`launch-add-${i}`},onSelect:i=>this.show(i),onAdd:i=>this.addLaunch(i??u.VEHICLES[0].id),onRemove:()=>this.deleteCurrent()}),this.list.setLabels({list:e.launch,remove:e.deleteLaunch,add:e.addLaunch,empty:e.none}),this.list.setKinds(u.VEHICLES.map(i=>({value:i.id,label:i.vehicle.name??i.id}))),this.timeline=new I(this.element("launch-timeline"),i=>this.host.seekTo(i),{addKeyframeHere:e.addHere,keyframeHere:e.here,zoomHint:e.zoomHint}),this.element("launch-jet-add-burn").addEventListener("click",()=>this.addJet("burn",this.host.currentTime())),this.element("launch-jet-add-vent").addEventListener("click",()=>this.addJet("vent",this.host.currentTime())),this.element("launch-place-delete").addEventListener("click",()=>this.removePlace()),this.element("launch-jet-delete").addEventListener("click",()=>this.removeJet()),this.placeForm=void 0,this.jetForm=void 0}written(){this.host.changed();const e=this.current;e&&(this.list?.rename(e.id,this.labelOf(e)),this.syncTimeline())}static PATH_COLOR="#e08a1e";static JET_COLOR="#4f8fd6";jetLabel(e,t){return`${e.kind==="vent"?this.messages.jetVent:this.messages.jetBurn} ${t+1}`}syncTimeline(){const e=this.current;if(!this.timeline||!e)return;const i={id:"path",label:this.messages.path,color:u.PATH_COLOR,times:e.track.map(h=>h.t),active:this.row==="path",selectedTime:this.row==="path"?e.track[this.placeIndex]?.t:void 0,open:()=>this.selectPlace(this.placeIndex),pressed:(h,c)=>{const p=c===void 0?-1:(this.current?.track??[]).findIndex(f=>f.t===c);this.selectPlace(p>=0?p:this.placeIndex)},move:(h,c)=>this.movePlace(h,c),add:()=>this.addPlaceAt(this.host.currentTime())},s=(e.jets??[]).map((h,c)=>({id:`jet-${c}`,label:this.jetLabel(h,c),color:u.JET_COLOR,times:[h.fromT,h.untilT],spans:[{t:h.fromT,until:h.untilT,label:""}],active:this.row==="jet"&&c===this.jetIndex,open:()=>this.selectJet(c),pressed:()=>this.selectJet(c),move:(p,f)=>this.moveJetEnd(c,p,f),add:()=>this.addJet(h.kind??"burn",this.host.currentTime())})),a=n.instantsOf(e),l=Math.min(...a),o=Math.max(...a),m=Math.max(500,(o-l)/10);this.timeline.show([i,...s],this.host.duration(),this.host.currentTime(),{from:l-m,to:o+m})}syncDetail(){const t=this.current?.jets?.[this.jetIndex];this.row==="jet"&&!t&&(this.row="path"),this.element("launch-path").hidden=this.row!=="path",this.element("launch-jets").hidden=this.row!=="jet",this.element("launch-jet-legend").textContent=t?this.jetLabel(t,this.jetIndex):this.messages.jet}static MIN_PLACES=2;syncPlace(e=!1){const t=this.current?.track??[];this.placeIndex=Math.max(0,Math.min(this.placeIndex,t.length-1)),this.element("launch-place-delete").disabled=t.length<=u.MIN_PLACES,this.placeForm?this.placeForm.sync(e):(this.placeForm=new x(this.element("launch-place-parameters"),this.language,"launchPlace."),this.placeForm.show(this.resolved(n.PLACE),new v(()=>this.current?.track[this.placeIndex],i=>this.editPlace(this.placeIndex,i),void 0,this.host.positionPlace?.()),()=>{})),this.syncDetail(),this.syncTimeline()}selectPlace(e){this.row="path",this.placeIndex=e,this.syncPlace(!0)}editPlace(e,t){const i=this.current;if(!i)return;const s={...i.track[e]};t(s),i.track=i.track.map((a,l)=>l===e?s:a).sort((a,l)=>a.t-l.t),this.placeIndex=i.track.indexOf(s),this.syncPlace(),this.written()}movePlace(e,t){const i=this.current?.track.findIndex(s=>s.t===e)??-1;i<0||(this.editPlace(i,s=>{s.t=t}),this.syncPlace(!0))}addPlaceAt(e){const t=this.current;if(!t)return;const i=t.track.findIndex(s=>Math.abs(s.t-e)<1);if(i<0){const s=n.placeAt(t.track,Math.round(e));t.track=[...t.track,s].sort((a,l)=>a.t-l.t),this.host.changed(),this.selectPlace(t.track.indexOf(s));return}this.selectPlace(i)}removePlace(){const e=this.current;!e||e.track.length<=u.MIN_PLACES||(e.track=e.track.filter((t,i)=>i!==this.placeIndex),this.syncPlace(!0),this.host.changed())}syncJet(e=!1){const t=this.current?.jets??[];this.jetIndex=Math.max(0,Math.min(this.jetIndex,t.length-1)),this.jetForm?this.jetForm.sync(e):(this.jetForm=new x(this.element("launch-jet-parameters"),this.language,"launchJet."),this.jetForm.show(this.resolved(n.JET),new v(()=>this.current?.jets?.[this.jetIndex],i=>this.editJet(this.jetIndex,i),()=>this.current?n.jetContext(this.current,this.jetIndex):void 0),()=>{})),this.syncDetail(),this.syncTimeline()}selectJet(e){this.row="jet",this.jetIndex=e,this.syncJet(!0)}editJet(e,t){const i=this.current;if(!i?.jets)return;const s={...i.jets[e]};t(s),i.jets=i.jets.map((a,l)=>l===e?s:a),this.written()}moveJetEnd(e,t,i){const s=this.current?.jets?.[e];s&&(this.editJet(e,a=>{const l=t===s.fromT?[i,s.untilT]:[s.fromT,i];a.fromT=Math.min(l[0],l[1]),a.untilT=Math.max(l[0],l[1])}),this.selectJet(e))}addJet(e,t){const i=this.current;if(!i)return;const s=i.track,a=Math.round(t),l=e==="vent"?{kind:e,fromT:a,untilT:a+3e4,angleDeg:90}:{kind:e,fromT:a,untilT:a+3e4};!i.jets?.length&&i.burnFromT===void 0&&i.burnUntilT===void 0&&(i.burnFromT=s[0].t,i.burnUntilT=s[s.length-1].t),i.jets=[...i.jets??[],l],this.form?.sync(!0),this.host.changed(),this.selectJet(i.jets.length-1)}removeJet(){const e=this.current;if(!e?.jets?.length)return;const t=e.jets.filter((i,s)=>s!==this.jetIndex);t.length?e.jets=t:delete e.jets,this.host.changed(),t.length?this.selectJet(Math.min(this.jetIndex,t.length-1)):this.selectPlace(this.placeIndex)}startOfNew(){const e=this.host.sighting(),t=e.event?.place?.[0];if(t?.lat===void 0||t.lng===void 0)return;const i=(e.observerTrack?.getInterpolatedPoseAt(0)?.headingDeg??0)*Math.PI/180,s=a=>({lat:t.lat+a*Math.cos(i)/111.32,lng:t.lng+a*Math.sin(i)/(111.32*Math.max(.05,Math.cos(t.lat*Math.PI/180)))});return[{t:0,...s(300),altitudeKm:80},{t:6e4,...s(450),altitudeKm:160}]}static VEHICLES=[{id:"falcon-9",vehicle:{name:"Falcon 9"}}];addLaunch(e){const t=this.startOfNew();if(!t)return;const i=u.VEHICLES.find(o=>o.id===e)??u.VEHICLES[0];let s=this.launches.length+1;for(;this.launches.some(o=>o.id===`launch-${s}`);)s++;const a={id:`launch-${s}`,vehicle:{...i.vehicle},track:t},l=this.host.sighting();l.skyEvents={...l.skyEvents,launches:[...this.launches,a]},this.currentId=a.id,this.row="path",this.placeIndex=0,this.host.changed(),this.sync()}deleteCurrent(){const e=this.current;if(!e)return;this.currentId=void 0;const t=this.host.sighting();t.skyEvents=E.written({...t.skyEvents,launches:this.launches.filter(i=>i!==e)}),this.host.changed(),this.sync()}labelOf(e){const t=this.host.said().read(e.title)??e.vehicle?.mission??e.vehicle?.name;return t?`${t} (${e.id})`:e.id}get launches(){return this.host.sighting().skyEvents?.launches??[]}element(e){return this.container.querySelector(`#${e}`)}}export{u as LaunchEditor};
@@ -1 +1 @@
1
- import{aZ as F,a_ as b,a$ as v,b0 as _,R as H}from"./rr0-scene.mjs";class K{static MU=398600.4418;static OMEGA=72921159e-12;static EARTH_RADIUS_KM=6371;static STEP_S=1;static DENSITY=[[0,1.225],[20,.0889],[40,.004],[60,31e-5],[80,185e-7],[100,56e-8],[120,222e-10],[150,208e-11],[200,254e-12],[250,607e-13],[300,192e-13],[400,28e-13],[500,522e-15],[600,114e-15],[700,307e-16],[800,114e-16],[900,576e-17],[1e3,356e-17]];static FREE_PATH_TIMES_DENSITY=68e-9;static ICE_DENSITY=917;static airDensity(s){const t=K.DENSITY;if(s<=t[0][0])return t[0][1];let e=0;for(;e<t.length-2&&t[e+1][0]<s;)e++;const[a,i]=t[e],[o,n]=t[e+1];return i*Math.exp(Math.log(n/i)*(s-a)/(o-a))}static dragPerKm(s,t,e,a=.5){const i=K.airDensity(s),o=K.FREE_PATH_TIMES_DENSITY/i/1e3,n=Math.exp(-o/t),p=i*1e9*Math.PI*t*t/Math.max(e,1e-9),d=3*i/(4*a*1e-6*K.ICE_DENSITY)*1e3;return n*p+(1-n)*d}static step(s,t,e,a,i){const[o,n,p,d,R,h]=s,m=Math.hypot(o,n,p),T=K.OMEGA,M=-398600.4418/(m*m*m),y=M*o+2*T*R+T*T*o,U=M*n-2*T*d+T*T*n,I=M*p,E=Math.hypot(d,R,h),c=1/(1+K.dragPerKm(m-K.EARTH_RADIUS_KM,e,a,i)*E*t);s[3]=(d+y*t)*c,s[4]=(R+U*t)*c,s[5]=(h+I*t)*c,s[0]=o+s[3]*t,s[1]=n+s[4]*t,s[2]=p+s[5]*t;const f=Math.hypot(s[0],s[1],s[2]);if(f<K.EARTH_RADIUS_KM){const A=K.EARTH_RADIUS_KM/f;s[0]*=A,s[1]*=A,s[2]*=A,s[3]=s[4]=s[5]=0}}}class Y{constructor(s,t,e,a,i=.5){this.massKg=e,this.radiusAt=a,this.particleRadiusUm=i,this.state=Float64Array.of(...s,...t),this.positions=new Float64Array(192),this.positions.set(s,0)}positions;steps=0;state;at(s){const t=K.STEP_S,e=Math.max(0,s/t),a=Math.ceil(e);for(;this.steps<a;){if(K.step(this.state,t,this.radiusAt(this.steps*t),this.massKg,this.particleRadiusUm),this.steps++,3*(this.steps+1)>this.positions.length){const p=new Float64Array(this.positions.length*2);p.set(this.positions),this.positions=p}this.positions.set(this.state.subarray(0,3),3*this.steps)}const i=Math.floor(e),o=e-i,n=this.positions;return o===0||i>=this.steps?[n[3*i],n[3*i+1],n[3*i+2]]:[0,1,2].map(p=>n[3*i+p]+(n[3*i+3+p]-n[3*i+p])*o)}}class r{static EARTH_RADIUS_KM=6371;static SHADOW_RADIUS_KM=r.EARTH_RADIUS_KM+15;static PENUMBRA_KM=10;static SUN_ILLUMINANCE_LUX=127e3;static RAYLEIGH_PER_M=[58e-7,135e-7,331e-7];static SCALE_HEIGHT_M=8e3;static OZONE_GRAZING_DEPTH=[2.4,1.8,.24];static ANISOTROPY=.7;static ALBEDO=.99;static WAVELENGTHS_UM=[.61,.55,.465];static ICE_INDEX=1.31;static DEFAULTS={exhaustKgPerS:273,condensedShare:.065,particleRadiusUm:.5,expansionKmPerS:.15,initialRadiusKm:.5,lifetimeS:420,collarShare:.85,collarExpansionKmPerS:2.5,collarLifetimeS:20};static PROPELLANTS={"rp1-lox":{condensedShare:.065,particleRadiusUm:.5},"methane-lox":{condensedShare:.09,particleRadiusUm:.5},"hydrogen-lox":{condensedShare:.13,particleRadiusUm:.5},hypergolic:{condensedShare:.079,particleRadiusUm:.4},solid:{condensedShare:.27,particleRadiusUm:.8}};static G0=9.80665;static COLLAR_SPREAD_OF_EXHAUST_VELOCITY=.735;static plumeOf(s){const t={},e=s.vehicle?.engine;if(e){const a=e.specificImpulseS===void 0?void 0:e.specificImpulseS*r.G0;e.thrustKN!==void 0&&a&&(t.exhaustKgPerS=e.thrustKN*1e3/a),a&&(t.collarExpansionKmPerS=a/1e3*r.COLLAR_SPREAD_OF_EXHAUST_VELOCITY),e.propellant&&Object.assign(t,r.PROPELLANTS[e.propellant])}return{...r.DEFAULTS,...t,...s.plume}}static PUFF_EVERY_S=.5;static SIGMA_OF_RADIUS=.5;static MAX_PUFFS=320;static DEG=Math.PI/180;static EARTH_ROTATION=72921159e-12;static VENT_DEFAULTS={speedKmPerS:.7,massKgPerS:20,condensedShare:.5,particleRadiusUm:.5,expansionKmPerS:.1,initialRadiusKm:.2,lifetimeS:600};static paths=new WeakMap;static exhaustVelocityKmPerS(s){return(s.vehicle?.engine?.specificImpulseS??348)*r.G0/1e3}static releasesOf(s){const t=[],e=s.jets??[];if(e.length===0||s.burnFromT!==void 0||s.burnUntilT!==void 0){const a=s.track[0]?.t??0,i=s.track[s.track.length-1]?.t??0;t.push(r.engineRelease(s,"burn",{fromT:s.burnFromT??a,untilT:s.burnUntilT??i}))}return e.forEach((a,i)=>t.push(r.releaseOf(s,a,i))),t}static releaseOf(s,t,e){const a=`jet:${t.id??e}`;if((t.kind??"burn")==="burn")return r.engineRelease(s,a,t);const i=r.VENT_DEFAULTS;return{key:a,fromT:t.fromT,untilT:t.untilT,angleDeg:t.angleDeg??0,azimuthDeg:t.azimuthDeg??0,spinPeriodS:t.spinPeriodS,speedKmPerS:t.speedKmPerS??i.speedKmPerS,massKgPerS:t.massKgPerS??i.massKgPerS,condensedShare:t.condensedShare??i.condensedShare,particleRadiusUm:t.particleRadiusUm??i.particleRadiusUm,initialRadiusKm:t.initialRadiusKm??i.initialRadiusKm,populations:[{share:1,expansionKmPerS:t.expansionKmPerS??i.expansionKmPerS,lifetimeS:t.lifetimeS??i.lifetimeS}]}}static engineRelease(s,t,e){const a=r.plumeOf(s);return{key:t,fromT:e.fromT,untilT:e.untilT,angleDeg:e.angleDeg??0,azimuthDeg:e.azimuthDeg??0,spinPeriodS:e.spinPeriodS,speedKmPerS:e.speedKmPerS??r.exhaustVelocityKmPerS(s),massKgPerS:e.massKgPerS??a.exhaustKgPerS,condensedShare:e.condensedShare??a.condensedShare,particleRadiusUm:e.particleRadiusUm??a.particleRadiusUm,initialRadiusKm:e.initialRadiusKm??a.initialRadiusKm,populations:[{share:1-a.collarShare,expansionKmPerS:e.expansionKmPerS??a.expansionKmPerS,lifetimeS:e.lifetimeS??a.lifetimeS},{share:a.collarShare,expansionKmPerS:a.collarExpansionKmPerS,lifetimeS:a.collarLifetimeS}]}}static extinctionEfficiency(s,t){const e=2*Math.PI*s/t,a=r.ICE_INDEX**2,i=8/3*e**4*((a-1)/(a+2))**2,o=2*e*(r.ICE_INDEX-1),n=o<.001?o*o/2:2-4/o*Math.sin(o)+4/(o*o)*(1-Math.cos(o));return Math.min(i,n)}static scatteringColour(s){const t=r.extinctionEfficiency(s,r.WAVELENGTHS_UM[1]);return r.WAVELENGTHS_UM.map(e=>r.extinctionEfficiency(s,e)/t)}static sunDirectionAt(s){const t=new F(0,0,-6378137),e=b(v.Sun,s,t,!0,!0),a=(e.ra-_(s))*15*r.DEG,i=e.dec*r.DEG;return[Math.cos(i)*Math.cos(a),Math.cos(i)*Math.sin(a),Math.sin(i)]}static puffsAt(s,t){const e=[];for(const a of s){let i=r.paths.get(a);i||r.paths.set(a,i=new Map);for(const o of r.releasesOf(a)){const n=Math.min(o.untilT,t);if(n<=o.fromT)continue;const p=Math.max(r.PUFF_EVERY_S*1e3,(o.untilT-o.fromT)/r.MAX_PUFFS),d=[];for(let M=o.fromT;M<n;M+=p)d.push(M);d.push(n);const R=o.massKgPerS*(p/1e3),m=3*r.extinctionEfficiency(o.particleRadiusUm,r.WAVELENGTHS_UM[1])/(4*917*o.particleRadiusUm*1e-6),T=r.scatteringColour(o.particleRadiusUm);o.populations.forEach((M,y)=>{if(M.share<=0)return;const U=E=>o.initialRadiusKm+M.expansionKmPerS*E,I=[];for(const E of d){const D=(t-E)/1e3;if(D>M.lifetimeS)continue;const c=E!==n||n===o.untilT,f=`${o.key}|${y}|${E}`;let A=c?i.get(f):void 0;if(!A){if(A=r.launchPuff(a,o,E,R*M.share,U),!A)continue;c&&i.set(f,A)}I.push({ageS:D,position:A.at(D)})}for(let E=I.length-1;E>=0;E--){const{ageS:D,position:c}=I[E],f=I[E-1]??I[E+1],A=f?Math.hypot(c[0]-f.position[0],c[1]-f.position[1],c[2]-f.position[2]):0,l=U(D)+A/2,O=r.SIGMA_OF_RADIUS*l*1e3,N=R*o.condensedShare*M.share*m/(2*Math.PI*O*O),x=Math.max(0,1-(D/M.lifetimeS)**2);N*x<=0||e.push({launchId:a.id,release:o.key,at:r.geoPoint(c),radiusKm:l,opticalDepth:N*x,colour:T,ageS:D})}})}}return e}static viewsAt(s,t,e,a){const i=[];for(const o of r.puffsAt(s,t)){const n=H.seenFrom(e,o.at);if(n.altitudeDeg<0)continue;const p=r.sunlightAt(o.at,a);if(p.lit<=0)continue;const d=r.scatteringPhase(e,o.at,a),R=r.SUN_ILLUMINANCE_LUX*r.ALBEDO*d*o.opticalDepth*p.lit;R<=0||i.push({launchId:o.launchId,release:o.release,heightKm:o.at.heightM/1e3,centre:n,radiusDeg:Math.atan2(o.radiusKm,n.distanceKm)/r.DEG,luminanceCdM2:R,sunTransmittance:p.transmittance,colour:o.colour,lit:p.lit,ageS:o.ageS})}return i}static launchPuff(s,t,e,a,i){const o={id:s.id,track:s.track,fragments:[]},n=H.leadAt(o,e);if(!n)return;const p=s.track[0].t,d=s.track[s.track.length-1].t,R=Math.max(p,e-500),h=Math.min(d,e+500),m=r.earthCentred(n),T=r.earthCentred(H.leadAt(o,R)),M=r.earthCentred(H.leadAt(o,h)),y=Math.max(.001,(h-R)/1e3),U=[0,1,2].map(S=>(M[S]-T[S])/y),I=r.EARTH_ROTATION,E=[U[0]-I*m[1],U[1]+I*m[0],U[2]],D=S=>{const k=Math.hypot(S[0],S[1],S[2])||1;return S.map(w=>w/k)},c=D(E),f=D(m),A=f[0]*c[0]+f[1]*c[1]+f[2]*c[2];let l=[f[0]-A*c[0],f[1]-A*c[1],f[2]-A*c[2]];Math.hypot(l[0],l[1],l[2])<1e-6&&(l=[-c[2]*c[0],-c[2]*c[1],1-c[2]*c[2]]),l=D(l);const O=[c[1]*l[2]-c[2]*l[1],c[2]*l[0]-c[0]*l[2],c[0]*l[1]-c[1]*l[0]],N=t.spinPeriodS?360*((e-t.fromT)/1e3)/t.spinPeriodS:0,x=(t.azimuthDeg+N)*r.DEG,G=t.angleDeg*r.DEG,C=[0,1,2].map(S=>-c[S]*Math.cos(G)+Math.sin(G)*(Math.cos(x)*l[S]+Math.sin(x)*O[S])),P=[0,1,2].map(S=>U[S]+t.speedKmPerS*C[S]);return new Y(m,P,a,i,t.particleRadiusUm)}static geoPoint(s){const t=Math.hypot(s[0],s[1],s[2]);return{lat:Math.asin(s[2]/t)/r.DEG,lng:Math.atan2(s[1],s[0])/r.DEG,heightM:(t-K.EARTH_RADIUS_KM)*1e3}}static sunlightAt(s,t){const e=r.earthCentred(s),a=e[0]*t[0]+e[1]*t[1]+e[2]*t[2];if(a>=0)return{lit:1,transmittance:[1,1,1]};const i=Math.hypot(e[0]-a*t[0],e[1]-a*t[1],e[2]-a*t[2]),o=r.PENUMBRA_KM,n=Math.min(1,Math.max(0,(i-(r.SHADOW_RADIUS_KM-o/2))/o));if(n<=0)return{lit:0,transmittance:[0,0,0]};const p=Math.max(0,(i-r.EARTH_RADIUS_KM)*1e3),d=Math.exp(-p/r.SCALE_HEIGHT_M),R=Math.sqrt(2*Math.PI*r.EARTH_RADIUS_KM*1e3*r.SCALE_HEIGHT_M),h=Math.exp(-(((p/1e3-25)/15)**2)),m=[0,1,2].map(T=>Math.exp(-r.RAYLEIGH_PER_M[T]*d*R-r.OZONE_GRAZING_DEPTH[T]*h));return{lit:n,transmittance:m}}static scatteringPhase(s,t,e){const a=r.earthCentred(s),i=r.earthCentred(t),o=[a[0]-i[0],a[1]-i[1],a[2]-i[2]],n=Math.hypot(o[0],o[1],o[2])||1,p=-(o[0]*e[0]+o[1]*e[1]+o[2]*e[2])/n,d=r.ANISOTROPY;return(1-d*d)/(4*Math.PI*(1+d*d-2*d*p)**1.5)}static earthCentred(s){const t=s.lat*r.DEG,e=s.lng*r.DEG,a=r.EARTH_RADIUS_KM+s.heightM/1e3;return[a*Math.cos(t)*Math.cos(e),a*Math.cos(t)*Math.sin(e),a*Math.sin(t)]}}export{r as L};
1
+ import{b8 as w,b9 as F,ba as v,bb as Y,R as H}from"./rr0-scene.mjs";class K{static MU=398600.4418;static OMEGA=72921159e-12;static EARTH_RADIUS_KM=6371;static STEP_S=1;static DENSITY=[[0,1.225],[20,.0889],[40,.004],[60,31e-5],[80,185e-7],[100,56e-8],[120,222e-10],[150,208e-11],[200,254e-12],[250,607e-13],[300,192e-13],[400,28e-13],[500,522e-15],[600,114e-15],[700,307e-16],[800,114e-16],[900,576e-17],[1e3,356e-17]];static FREE_PATH_TIMES_DENSITY=68e-9;static ICE_DENSITY=917;static airDensity(s){const t=K.DENSITY;if(s<=t[0][0])return t[0][1];let e=0;for(;e<t.length-2&&t[e+1][0]<s;)e++;const[a,i]=t[e],[o,n]=t[e+1];return i*Math.exp(Math.log(n/i)*(s-a)/(o-a))}static dragPerKm(s,t,e,a=.5){const i=K.airDensity(s),o=K.FREE_PATH_TIMES_DENSITY/i/1e3,n=Math.exp(-o/t),p=i*1e9*Math.PI*t*t/Math.max(e,1e-9),d=3*i/(4*a*1e-6*K.ICE_DENSITY)*1e3;return n*p+(1-n)*d}static step(s,t,e,a,i){const[o,n,p,d,R,h]=s,m=Math.hypot(o,n,p),T=K.OMEGA,M=-398600.4418/(m*m*m),y=M*o+2*T*R+T*T*o,U=M*n-2*T*d+T*T*n,I=M*p,E=Math.hypot(d,R,h),c=1/(1+K.dragPerKm(m-K.EARTH_RADIUS_KM,e,a,i)*E*t);s[3]=(d+y*t)*c,s[4]=(R+U*t)*c,s[5]=(h+I*t)*c,s[0]=o+s[3]*t,s[1]=n+s[4]*t,s[2]=p+s[5]*t;const f=Math.hypot(s[0],s[1],s[2]);if(f<K.EARTH_RADIUS_KM){const A=K.EARTH_RADIUS_KM/f;s[0]*=A,s[1]*=A,s[2]*=A,s[3]=s[4]=s[5]=0}}}class _{constructor(s,t,e,a,i=.5){this.massKg=e,this.radiusAt=a,this.particleRadiusUm=i,this.state=Float64Array.of(...s,...t),this.positions=new Float64Array(192),this.positions.set(s,0)}positions;steps=0;state;at(s){const t=K.STEP_S,e=Math.max(0,s/t),a=Math.ceil(e);for(;this.steps<a;){if(K.step(this.state,t,this.radiusAt(this.steps*t),this.massKg,this.particleRadiusUm),this.steps++,3*(this.steps+1)>this.positions.length){const p=new Float64Array(this.positions.length*2);p.set(this.positions),this.positions=p}this.positions.set(this.state.subarray(0,3),3*this.steps)}const i=Math.floor(e),o=e-i,n=this.positions;return o===0||i>=this.steps?[n[3*i],n[3*i+1],n[3*i+2]]:[0,1,2].map(p=>n[3*i+p]+(n[3*i+3+p]-n[3*i+p])*o)}}class r{static EARTH_RADIUS_KM=6371;static SHADOW_RADIUS_KM=r.EARTH_RADIUS_KM+15;static PENUMBRA_KM=10;static SUN_ILLUMINANCE_LUX=127e3;static RAYLEIGH_PER_M=[58e-7,135e-7,331e-7];static SCALE_HEIGHT_M=8e3;static OZONE_GRAZING_DEPTH=[2.4,1.8,.24];static ANISOTROPY=.7;static ALBEDO=.99;static WAVELENGTHS_UM=[.61,.55,.465];static ICE_INDEX=1.31;static DEFAULTS={exhaustKgPerS:273,condensedShare:.065,particleRadiusUm:.5,expansionKmPerS:.15,initialRadiusKm:.5,lifetimeS:420,collarShare:.85,collarExpansionKmPerS:2.5,collarLifetimeS:20};static PROPELLANTS={"rp1-lox":{condensedShare:.065,particleRadiusUm:.5},"methane-lox":{condensedShare:.09,particleRadiusUm:.5},"hydrogen-lox":{condensedShare:.13,particleRadiusUm:.5},hypergolic:{condensedShare:.079,particleRadiusUm:.4},solid:{condensedShare:.27,particleRadiusUm:.8}};static G0=9.80665;static COLLAR_SPREAD_OF_EXHAUST_VELOCITY=.735;static plumeOf(s){const t={},e=s.vehicle?.engine;if(e){const a=e.specificImpulseS===void 0?void 0:e.specificImpulseS*r.G0;e.thrustKN!==void 0&&a&&(t.exhaustKgPerS=e.thrustKN*1e3/a),a&&(t.collarExpansionKmPerS=a/1e3*r.COLLAR_SPREAD_OF_EXHAUST_VELOCITY),e.propellant&&Object.assign(t,r.PROPELLANTS[e.propellant])}return{...r.DEFAULTS,...t,...s.plume}}static PUFF_EVERY_S=.5;static SIGMA_OF_RADIUS=.5;static MAX_PUFFS=320;static DEG=Math.PI/180;static EARTH_ROTATION=72921159e-12;static VENT_DEFAULTS={speedKmPerS:.7,massKgPerS:20,condensedShare:.5,particleRadiusUm:.5,expansionKmPerS:.1,initialRadiusKm:.2,lifetimeS:600};static paths=new WeakMap;static exhaustVelocityKmPerS(s){return(s.vehicle?.engine?.specificImpulseS??348)*r.G0/1e3}static releasesOf(s){const t=[],e=s.jets??[];if(e.length===0||s.burnFromT!==void 0||s.burnUntilT!==void 0){const a=s.track[0]?.t??0,i=s.track[s.track.length-1]?.t??0;t.push(r.engineRelease(s,"burn",{fromT:s.burnFromT??a,untilT:s.burnUntilT??i}))}return e.forEach((a,i)=>t.push(r.releaseOf(s,a,i))),t}static releaseOf(s,t,e){const a=`jet:${t.id??e}`;if((t.kind??"burn")==="burn")return r.engineRelease(s,a,t);const i=r.VENT_DEFAULTS;return{key:a,fromT:t.fromT,untilT:t.untilT,angleDeg:t.angleDeg??0,azimuthDeg:t.azimuthDeg??0,spinPeriodS:t.spinPeriodS,speedKmPerS:t.speedKmPerS??i.speedKmPerS,massKgPerS:t.massKgPerS??i.massKgPerS,condensedShare:t.condensedShare??i.condensedShare,particleRadiusUm:t.particleRadiusUm??i.particleRadiusUm,initialRadiusKm:t.initialRadiusKm??i.initialRadiusKm,populations:[{share:1,expansionKmPerS:t.expansionKmPerS??i.expansionKmPerS,lifetimeS:t.lifetimeS??i.lifetimeS}]}}static engineRelease(s,t,e){const a=r.plumeOf(s);return{key:t,fromT:e.fromT,untilT:e.untilT,angleDeg:e.angleDeg??0,azimuthDeg:e.azimuthDeg??0,spinPeriodS:e.spinPeriodS,speedKmPerS:e.speedKmPerS??r.exhaustVelocityKmPerS(s),massKgPerS:e.massKgPerS??a.exhaustKgPerS,condensedShare:e.condensedShare??a.condensedShare,particleRadiusUm:e.particleRadiusUm??a.particleRadiusUm,initialRadiusKm:e.initialRadiusKm??a.initialRadiusKm,populations:[{share:1-a.collarShare,expansionKmPerS:e.expansionKmPerS??a.expansionKmPerS,lifetimeS:e.lifetimeS??a.lifetimeS},{share:a.collarShare,expansionKmPerS:a.collarExpansionKmPerS,lifetimeS:a.collarLifetimeS}]}}static extinctionEfficiency(s,t){const e=2*Math.PI*s/t,a=r.ICE_INDEX**2,i=8/3*e**4*((a-1)/(a+2))**2,o=2*e*(r.ICE_INDEX-1),n=o<.001?o*o/2:2-4/o*Math.sin(o)+4/(o*o)*(1-Math.cos(o));return Math.min(i,n)}static scatteringColour(s){const t=r.extinctionEfficiency(s,r.WAVELENGTHS_UM[1]);return r.WAVELENGTHS_UM.map(e=>r.extinctionEfficiency(s,e)/t)}static sunDirectionAt(s){const t=new w(0,0,-6378137),e=F(v.Sun,s,t,!0,!0),a=(e.ra-Y(s))*15*r.DEG,i=e.dec*r.DEG;return[Math.cos(i)*Math.cos(a),Math.cos(i)*Math.sin(a),Math.sin(i)]}static puffsAt(s,t){const e=[];for(const a of s){let i=r.paths.get(a);i||r.paths.set(a,i=new Map);for(const o of r.releasesOf(a)){const n=Math.min(o.untilT,t);if(n<=o.fromT)continue;const p=Math.max(r.PUFF_EVERY_S*1e3,(o.untilT-o.fromT)/r.MAX_PUFFS),d=[];for(let M=o.fromT;M<n;M+=p)d.push(M);d.push(n);const R=o.massKgPerS*(p/1e3),m=3*r.extinctionEfficiency(o.particleRadiusUm,r.WAVELENGTHS_UM[1])/(4*917*o.particleRadiusUm*1e-6),T=r.scatteringColour(o.particleRadiusUm);o.populations.forEach((M,y)=>{if(M.share<=0)return;const U=E=>o.initialRadiusKm+M.expansionKmPerS*E,I=[];for(const E of d){const D=(t-E)/1e3;if(D>M.lifetimeS)continue;const c=E!==n||n===o.untilT,f=`${o.key}|${y}|${E}`;let A=c?i.get(f):void 0;if(!A){if(A=r.launchPuff(a,o,E,R*M.share,U),!A)continue;c&&i.set(f,A)}I.push({ageS:D,position:A.at(D)})}for(let E=I.length-1;E>=0;E--){const{ageS:D,position:c}=I[E],f=I[E-1]??I[E+1],A=f?Math.hypot(c[0]-f.position[0],c[1]-f.position[1],c[2]-f.position[2]):0,l=U(D)+A/2,O=r.SIGMA_OF_RADIUS*l*1e3,N=R*o.condensedShare*M.share*m/(2*Math.PI*O*O),x=Math.max(0,1-(D/M.lifetimeS)**2);N*x<=0||e.push({launchId:a.id,release:o.key,at:r.geoPoint(c),radiusKm:l,opticalDepth:N*x,colour:T,ageS:D})}})}}return e}static viewsAt(s,t,e,a){const i=[];for(const o of r.puffsAt(s,t)){const n=H.seenFrom(e,o.at);if(n.altitudeDeg<0)continue;const p=r.sunlightAt(o.at,a);if(p.lit<=0)continue;const d=r.scatteringPhase(e,o.at,a),R=r.SUN_ILLUMINANCE_LUX*r.ALBEDO*d*o.opticalDepth*p.lit;R<=0||i.push({launchId:o.launchId,release:o.release,heightKm:o.at.heightM/1e3,centre:n,radiusDeg:Math.atan2(o.radiusKm,n.distanceKm)/r.DEG,luminanceCdM2:R,sunTransmittance:p.transmittance,colour:o.colour,lit:p.lit,ageS:o.ageS})}return i}static launchPuff(s,t,e,a,i){const o={id:s.id,track:s.track,fragments:[]},n=H.leadAt(o,e);if(!n)return;const p=s.track[0].t,d=s.track[s.track.length-1].t,R=Math.max(p,e-500),h=Math.min(d,e+500),m=r.earthCentred(n),T=r.earthCentred(H.leadAt(o,R)),M=r.earthCentred(H.leadAt(o,h)),y=Math.max(.001,(h-R)/1e3),U=[0,1,2].map(S=>(M[S]-T[S])/y),I=r.EARTH_ROTATION,E=[U[0]-I*m[1],U[1]+I*m[0],U[2]],D=S=>{const b=Math.hypot(S[0],S[1],S[2])||1;return S.map(k=>k/b)},c=D(E),f=D(m),A=f[0]*c[0]+f[1]*c[1]+f[2]*c[2];let l=[f[0]-A*c[0],f[1]-A*c[1],f[2]-A*c[2]];Math.hypot(l[0],l[1],l[2])<1e-6&&(l=[-c[2]*c[0],-c[2]*c[1],1-c[2]*c[2]]),l=D(l);const O=[c[1]*l[2]-c[2]*l[1],c[2]*l[0]-c[0]*l[2],c[0]*l[1]-c[1]*l[0]],N=t.spinPeriodS?360*((e-t.fromT)/1e3)/t.spinPeriodS:0,x=(t.azimuthDeg+N)*r.DEG,G=t.angleDeg*r.DEG,C=[0,1,2].map(S=>-c[S]*Math.cos(G)+Math.sin(G)*(Math.cos(x)*l[S]+Math.sin(x)*O[S])),P=[0,1,2].map(S=>U[S]+t.speedKmPerS*C[S]);return new _(m,P,a,i,t.particleRadiusUm)}static geoPoint(s){const t=Math.hypot(s[0],s[1],s[2]);return{lat:Math.asin(s[2]/t)/r.DEG,lng:Math.atan2(s[1],s[0])/r.DEG,heightM:(t-K.EARTH_RADIUS_KM)*1e3}}static sunlightAt(s,t){const e=r.earthCentred(s),a=e[0]*t[0]+e[1]*t[1]+e[2]*t[2];if(a>=0)return{lit:1,transmittance:[1,1,1]};const i=Math.hypot(e[0]-a*t[0],e[1]-a*t[1],e[2]-a*t[2]),o=r.PENUMBRA_KM,n=Math.min(1,Math.max(0,(i-(r.SHADOW_RADIUS_KM-o/2))/o));if(n<=0)return{lit:0,transmittance:[0,0,0]};const p=Math.max(0,(i-r.EARTH_RADIUS_KM)*1e3),d=Math.exp(-p/r.SCALE_HEIGHT_M),R=Math.sqrt(2*Math.PI*r.EARTH_RADIUS_KM*1e3*r.SCALE_HEIGHT_M),h=Math.exp(-(((p/1e3-25)/15)**2)),m=[0,1,2].map(T=>Math.exp(-r.RAYLEIGH_PER_M[T]*d*R-r.OZONE_GRAZING_DEPTH[T]*h));return{lit:n,transmittance:m}}static scatteringPhase(s,t,e){const a=r.earthCentred(s),i=r.earthCentred(t),o=[a[0]-i[0],a[1]-i[1],a[2]-i[2]],n=Math.hypot(o[0],o[1],o[2])||1,p=-(o[0]*e[0]+o[1]*e[1]+o[2]*e[2])/n,d=r.ANISOTROPY;return(1-d*d)/(4*Math.PI*(1+d*d-2*d*p)**1.5)}static earthCentred(s){const t=s.lat*r.DEG,e=s.lng*r.DEG,a=r.EARTH_RADIUS_KM+s.heightM/1e3;return[a*Math.cos(t)*Math.cos(e),a*Math.cos(t)*Math.sin(e),a*Math.sin(t)]}}export{r as L};
@@ -1 +1 @@
1
- import{L as M}from"./LaunchPlume-BRnjFVcY.js";import{G as T,B as z,h as f,d as C,aX as w,aY as A}from"./rr0-scene.mjs";class n{static RADIUS=840;static MAX_PUFFS=1e3;static RINGS=[0,.25,.5,.75,1,1.25];static COLUMN=n.RINGS.map(t=>{const i=o=>Math.exp(-((o/M.SIGMA_OF_RADIUS)**2)/2),s=i(n.RINGS[n.RINGS.length-1]);return Math.max(0,(i(t)-s)/(1-s))});static SECTORS=12;static VERTICES_PER_PUFF=n.SECTORS*(3+6*(n.RINGS.length-2));static BRIGHTEST_RELATIVE=6e4;object=new T;mesh;positions=new Float32Array(n.MAX_PUFFS*n.VERTICES_PER_PUFF*3);colors=new Float32Array(n.MAX_PUFFS*n.VERTICES_PER_PUFF*3);shown=0;drawn=[];static VISIBLE_CONTRAST=.1;constructor(){this.object.name="plumes";const t=new z;t.setAttribute("position",new f(this.positions,3)),t.setAttribute("color",new f(this.colors,3)),t.setDrawRange(0,0),this.mesh=new C(t,w.material()),this.mesh.frustumCulled=!1,w.track(this.mesh),this.object.add(this.mesh)}get count(){return this.shown}set(t,i,s,o){let h=0,c=0;this.drawn=[];for(const p of t){if(c>=n.MAX_PUFFS)break;const d=o(p.centre);if(d<=0)continue;const a=s(p.centre),r=[0,1,2].map(g=>Math.min(n.BRIGHTEST_RELATIVE,p.luminanceCdM2*(p.colour?.[g]??1)*i*p.sunTransmittance[g]*a[g]*d));Math.max(...r)<=0||(h=this.pushPuff(h,p,r),this.drawn.push({view:p,direction:this.normalise(A(p.centre.altitudeDeg,p.centre.azimuthDeg,1)),radiusRad:p.radiusDeg*Math.PI/180,luminance:.2126*r[0]+.7152*r[1]+.0722*r[2]}),c++)}this.shown=c;const u=this.mesh.geometry;u.setDrawRange(0,h),u.getAttribute("position").needsUpdate=!0,u.getAttribute("color").needsUpdate=!0}pushPuff(t,i,s){const o=A(i.centre.altitudeDeg,i.centre.azimuthDeg,n.RADIUS),h=this.normalise(o),c=this.normalise(this.cross({x:0,y:1,z:0},h)),u=this.cross(h,c),p=n.RADIUS*Math.tan(i.radiusDeg*Math.PI/180),d=(r,g)=>{const e=g/n.SECTORS*2*Math.PI,I=n.RINGS[r]*p,R=Math.cos(e)*I,l=Math.sin(e)*I;return{x:o.x+c.x*R+u.x*l,y:o.y+c.y*R+u.y*l,z:o.z+c.z*R+u.z*l}},a=r=>n.COLUMN[r];for(let r=0;r<n.SECTORS;r++){const g=(r+1)%n.SECTORS;t=this.push(t,o,s,a(0)),t=this.push(t,d(1,r),s,a(1)),t=this.push(t,d(1,g),s,a(1));for(let e=1;e<n.RINGS.length-1;e++){const I=d(e,r),R=d(e,g),l=d(e+1,r),E=d(e+1,g);t=this.push(t,I,s,a(e)),t=this.push(t,R,s,a(e)),t=this.push(t,l,s,a(e+1)),t=this.push(t,R,s,a(e)),t=this.push(t,E,s,a(e+1)),t=this.push(t,l,s,a(e+1))}}return t}pickAt(t,i,s=0){const o=this.normalise(t);let h=0,c;for(const u of this.drawn){const p=Math.max(-1,Math.min(1,o.x*u.direction.x+o.y*u.direction.y+o.z*u.direction.z)),d=Math.max(0,Math.acos(p)-i)/Math.max(u.radiusRad,1e-9),a=u.luminance*n.profile(d);a<=0||(h+=a,(!c||a>c.light)&&(c={view:u.view,light:a}))}return c&&h>=n.VISIBLE_CONTRAST*s?c.view:void 0}static profile(t){const i=n.RINGS;if(t>=i[i.length-1])return 0;let s=0;for(;t>i[s+1];)s++;const o=(t-i[s])/(i[s+1]-i[s]);return n.COLUMN[s]+(n.COLUMN[s+1]-n.COLUMN[s])*o}push(t,i,s,o){const h=t*3;return this.positions[h]=i.x,this.positions[h+1]=i.y,this.positions[h+2]=i.z,this.colors[h]=s[0]*o,this.colors[h+1]=s[1]*o,this.colors[h+2]=s[2]*o,t+1}cross(t,i){return this.normalise({x:t.y*i.z-t.z*i.y,y:t.z*i.x-t.x*i.z,z:t.x*i.y-t.y*i.x})}normalise(t){const i=Math.hypot(t.x,t.y,t.z)||1;return{x:t.x/i,y:t.y/i,z:t.z/i}}dispose(){this.mesh.geometry.dispose(),this.mesh.material.dispose(),this.object.removeFromParent()}}class N{inSky=!0;plumes=new n;get object(){return this.plumes.object}get drawnCount(){return this.plumes.count}update(t,i,s){const o=t.length===0||!s.date?[]:M.viewsAt(t,i,s.observer,M.sunDirectionAt(s.date));o.length===0&&this.plumes.count===0||this.plumes.set(o,s.relativeScale,h=>s.transmittanceFromSpace(h),h=>s.cloudTransmission(h))}pick(t,i,s){const o=this.plumes.pickAt(i,s.toleranceRad,s.skyLightTowards(i));return o&&{id:o.launchId,detail:o}}dispose(){this.plumes.dispose()}}export{N as LaunchSimulation};
1
+ import{L as M}from"./LaunchPlume-eEIp7_hM.js";import{G as T,B as z,i as f,e as C,b6 as w,b7 as A}from"./rr0-scene.mjs";class n{static RADIUS=840;static MAX_PUFFS=1e3;static RINGS=[0,.25,.5,.75,1,1.25];static COLUMN=n.RINGS.map(t=>{const i=o=>Math.exp(-((o/M.SIGMA_OF_RADIUS)**2)/2),s=i(n.RINGS[n.RINGS.length-1]);return Math.max(0,(i(t)-s)/(1-s))});static SECTORS=12;static VERTICES_PER_PUFF=n.SECTORS*(3+6*(n.RINGS.length-2));static BRIGHTEST_RELATIVE=6e4;object=new T;mesh;positions=new Float32Array(n.MAX_PUFFS*n.VERTICES_PER_PUFF*3);colors=new Float32Array(n.MAX_PUFFS*n.VERTICES_PER_PUFF*3);shown=0;drawn=[];static VISIBLE_CONTRAST=.1;constructor(){this.object.name="plumes";const t=new z;t.setAttribute("position",new f(this.positions,3)),t.setAttribute("color",new f(this.colors,3)),t.setDrawRange(0,0),this.mesh=new C(t,w.material()),this.mesh.frustumCulled=!1,w.track(this.mesh),this.object.add(this.mesh)}get count(){return this.shown}set(t,i,s,o){let h=0,c=0;this.drawn=[];for(const p of t){if(c>=n.MAX_PUFFS)break;const d=o(p.centre);if(d<=0)continue;const a=s(p.centre),r=[0,1,2].map(g=>Math.min(n.BRIGHTEST_RELATIVE,p.luminanceCdM2*(p.colour?.[g]??1)*i*p.sunTransmittance[g]*a[g]*d));Math.max(...r)<=0||(h=this.pushPuff(h,p,r),this.drawn.push({view:p,direction:this.normalise(A(p.centre.altitudeDeg,p.centre.azimuthDeg,1)),radiusRad:p.radiusDeg*Math.PI/180,luminance:.2126*r[0]+.7152*r[1]+.0722*r[2]}),c++)}this.shown=c;const u=this.mesh.geometry;u.setDrawRange(0,h),u.getAttribute("position").needsUpdate=!0,u.getAttribute("color").needsUpdate=!0}pushPuff(t,i,s){const o=A(i.centre.altitudeDeg,i.centre.azimuthDeg,n.RADIUS),h=this.normalise(o),c=this.normalise(this.cross({x:0,y:1,z:0},h)),u=this.cross(h,c),p=n.RADIUS*Math.tan(i.radiusDeg*Math.PI/180),d=(r,g)=>{const e=g/n.SECTORS*2*Math.PI,I=n.RINGS[r]*p,R=Math.cos(e)*I,l=Math.sin(e)*I;return{x:o.x+c.x*R+u.x*l,y:o.y+c.y*R+u.y*l,z:o.z+c.z*R+u.z*l}},a=r=>n.COLUMN[r];for(let r=0;r<n.SECTORS;r++){const g=(r+1)%n.SECTORS;t=this.push(t,o,s,a(0)),t=this.push(t,d(1,r),s,a(1)),t=this.push(t,d(1,g),s,a(1));for(let e=1;e<n.RINGS.length-1;e++){const I=d(e,r),R=d(e,g),l=d(e+1,r),E=d(e+1,g);t=this.push(t,I,s,a(e)),t=this.push(t,R,s,a(e)),t=this.push(t,l,s,a(e+1)),t=this.push(t,R,s,a(e)),t=this.push(t,E,s,a(e+1)),t=this.push(t,l,s,a(e+1))}}return t}pickAt(t,i,s=0){const o=this.normalise(t);let h=0,c;for(const u of this.drawn){const p=Math.max(-1,Math.min(1,o.x*u.direction.x+o.y*u.direction.y+o.z*u.direction.z)),d=Math.max(0,Math.acos(p)-i)/Math.max(u.radiusRad,1e-9),a=u.luminance*n.profile(d);a<=0||(h+=a,(!c||a>c.light)&&(c={view:u.view,light:a}))}return c&&h>=n.VISIBLE_CONTRAST*s?c.view:void 0}static profile(t){const i=n.RINGS;if(t>=i[i.length-1])return 0;let s=0;for(;t>i[s+1];)s++;const o=(t-i[s])/(i[s+1]-i[s]);return n.COLUMN[s]+(n.COLUMN[s+1]-n.COLUMN[s])*o}push(t,i,s,o){const h=t*3;return this.positions[h]=i.x,this.positions[h+1]=i.y,this.positions[h+2]=i.z,this.colors[h]=s[0]*o,this.colors[h+1]=s[1]*o,this.colors[h+2]=s[2]*o,t+1}cross(t,i){return this.normalise({x:t.y*i.z-t.z*i.y,y:t.z*i.x-t.x*i.z,z:t.x*i.y-t.y*i.x})}normalise(t){const i=Math.hypot(t.x,t.y,t.z)||1;return{x:t.x/i,y:t.y/i,z:t.z/i}}dispose(){this.mesh.geometry.dispose(),this.mesh.material.dispose(),this.object.removeFromParent()}}class b{inSky=!0;plumes=new n;get object(){return this.plumes.object}get drawnCount(){return this.plumes.count}update(t,i,s){const o=t.length===0||!s.date?[]:M.viewsAt(t,i,s.observer,M.sunDirectionAt(s.date));o.length===0&&this.plumes.count===0||this.plumes.set(o,s.relativeScale,h=>s.transmittanceFromSpace(h),h=>s.cloudTransmission(h))}pick(t,i,s){const o=this.plumes.pickAt(i,s.toleranceRad,s.skyLightTowards(i));return o&&{id:o.launchId,detail:o}}dispose(){this.plumes.dispose()}}export{b as LaunchSimulation};
@@ -1,3 +1,3 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ModuleThree-12Uq6OyD.js","./rr0-scene.mjs"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ModuleThree-R2LhnY95.js","./rr0-scene.mjs"])))=>i.map(i=>d[i]);
2
2
  import{f as g,b as w,_ as b,M as p}from"./rr0-scene.mjs";class n{static STORAGE_KEY="ufoathome.modules";static FORMAT=1;static empty(){return{format:1,modules:[]}}static read(t=n.storage()){try{const e=t?.getItem(n.STORAGE_KEY);return e?n.parse(e):n.empty()}catch{return n.empty()}}static write(t,e=n.storage()){try{return e?(t.modules.length===0?e.removeItem(n.STORAGE_KEY):e.setItem(n.STORAGE_KEY,n.text(t)),!0):!1}catch{return!1}}static parse(t){const e=JSON.parse(t);if(e===null||typeof e!="object"||!Array.isArray(e.modules))throw new Error("not a UFO@home module list");if(typeof e.format=="number"&&e.format>n.FORMAT)throw new Error(`format ${e.format} is newer than ${n.FORMAT}`);const r=new Set,s=[];for(const i of e.modules)typeof i?.url!="string"||r.has(i.url)||(r.add(i.url),s.push({url:i.url,enabled:i.enabled!==!1}));return{format:1,modules:s}}static text(t){return JSON.stringify({format:n.FORMAT,modules:t.modules},null,2)+`
3
- `}static storage(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}}class E{constructor(t,e){this.attribution=t,this.models=e}async entries(t){return t?this.models.filter(e=>[e.kind].flat().includes(t)):[...this.models]}async entry(t){return this.models.find(e=>e.id===t)}}class f{attribution;fetchImpl;tileUrlTemplate;constructor(t){this.attribution=t.attribution,this.tileUrlTemplate=t.tileUrlTemplate,this.fetchImpl=t.fetchImpl??fetch.bind(globalThis)}getImageryTexture(t,e){return g(t,e,r=>f.tileUrl(this.tileUrlTemplate,r),this.fetchImpl)}static tileUrl(t,e){return t.replaceAll("{z}",String(e.z)).replaceAll("{x}",String(e.x)).replaceAll("{y}",String(e.y))}}class v extends Error{constructor(t,e){super(`${t}: ${e}`),this.url=t,this.reason=e,this.name="ModuleManifestError"}}class d{static FORMAT=1;static check(t,e){const r=o=>{throw new v(e,o)};(t===null||typeof t!="object"||Array.isArray(t))&&r("not a JSON object");const s=t;typeof s.format!="number"&&r('no "format"'),s.format>d.FORMAT&&r(`format ${s.format} is newer than ${d.FORMAT}, which this version reads`),(typeof s.id!="string"||!/^[a-z0-9][a-z0-9._-]*$/.test(s.id))&&r(`"id" must be lowercase letters, digits, '.', '_' or '-'`),(typeof s.name!="string"||s.name.trim()==="")&&r('no "name"'),s.script!==void 0&&typeof s.script!="string"&&r('"script" must be an address');const i=s.contributes??{};for(const o of["imagery","elevation"]){const c=i[o];c!==void 0&&(Array.isArray(c)||r(`"contributes.${o}" must be a list`),c.forEach((l,h)=>{for(const m of["id","name","credit","creditUrl","tiles"])(typeof l?.[m]!="string"||l[m]==="")&&r(`"contributes.${o}[${h}].${m}" is missing`);["{z}","{x}","{y}"].every(m=>l.tiles.includes(m))||r(`"contributes.${o}[${h}].tiles" must hold {z}, {x} and {y}`)}))}const a=i.models;return a!==void 0&&(Array.isArray(a)||r('"contributes.models" must be a list'),a.forEach((o,c)=>{for(const l of["id","name","file"])(typeof o?.[l]!="string"||o[l]==="")&&r(`"contributes.models[${c}].${l}" is missing`);o.kind===void 0&&r(`"contributes.models[${c}].kind" is missing`),(!o.credit||typeof o.credit!="object")&&r(`"contributes.models[${c}].credit" is missing: a model is shown with its author and licence`)})),s}static contributions(t,e){const r=t.contributes??{},s={};if(r.imagery?.length&&(s.imagery=r.imagery.map(i=>({id:i.id,name:i.name,credit:i.credit,creditUrl:i.creditUrl,create:a=>new f({tileUrlTemplate:d.absoluteTemplate(i.tiles,e),attribution:i.credit,fetchImpl:a})}))),r.elevation?.length&&(s.elevation=r.elevation.map(i=>({id:i.id,name:i.name,credit:i.credit,creditUrl:i.creditUrl,create:a=>new w({tileUrlTemplate:d.absoluteTemplate(i.tiles,e),fetchImpl:a})}))),r.models?.length){const i=r.models.map(({file:o,...c})=>({...c,url:new URL(o,e).href})),a=t.credit??t.name;s.decorModels=[{id:`${t.id}-models`,name:t.name,credit:a,creditUrl:t.creditUrl??e,create:()=>new E(a,i)}]}return s}static module(t,e,r={}){const s=d.contributions(t,e);for(const[i,a]of Object.entries(r))Array.isArray(a)&&(s[i]=[...s[i]??[],...a]);return{id:t.id,name:t.name,credit:t.credit,creditUrl:t.creditUrl,url:e,contributes:s}}static absoluteTemplate(t,e){const r=t.replaceAll("{z}","__Z__").replaceAll("{x}","__X__").replaceAll("{y}","__Y__");return new URL(r,e).href.replaceAll("__Z__","{z}").replaceAll("__X__","{x}").replaceAll("__Y__","{y}")}}class T{fetchImpl;importImpl;constructor(t={}){this.fetchImpl=t.fetchImpl??fetch.bind(globalThis),this.importImpl=t.importImpl??(e=>import(e))}async load(t,e){const r=await this.fetchImpl(t);if(!r.ok)throw new Error(`${t}: HTTP ${r.status}`);const s=d.check(await r.json(),t),i=s.script!==void 0;let a={};if(i&&e.runScript){const o=new URL(s.script,t).href,c=await this.importImpl(o);if(typeof c.default!="function")throw new Error(`${o}: its default export is not a function`);const{MODULE_THREE:l}=await b(async()=>{const{MODULE_THREE:h}=await import("./ModuleThree-12Uq6OyD.js");return{MODULE_THREE:h}},__vite__mapDeps([0,1]),import.meta.url);a=await c.default({manifestUrl:t,three:l})??{}}return{url:t,manifest:s,module:d.module(s,t,a),hasScript:i,scriptRun:i&&e.runScript}}}class y{constructor(t=new T,e){this.loader=t,this.storage=e}static shared=new y;changes=new EventTarget;states=new Map;config=n.empty();started;list(){const t=[...this.states.values()];return[...t.filter(e=>e.addedByPerson),...t.filter(e=>!e.addedByPerson)]}state(t){return this.states.get(t)}start(){return this.started??=this.applyConfig(n.read(this.storage)),this.started}async add(t){await this.start();const e=new URL(t,typeof location>"u"?void 0:location.href).href;return this.config.modules.some(r=>r.url===e)||(this.config={...this.config,modules:[...this.config.modules,{url:e,enabled:!0}]},this.save()),this.reload(e)}async remove(t){this.config={...this.config,modules:this.config.modules.filter(e=>e.url!==t)},this.save(),await this.reload(t)}async setEnabled(t,e){this.config={...this.config,modules:this.config.modules.map(r=>r.url===t?{...r,enabled:e}:r)},this.save(),await this.reload(t)}exportText(){return n.text(this.config)}async importText(t){const e=n.parse(t);await this.start();const r=this.config.modules.map(s=>s.url);this.config=e,this.save(),await Promise.all([...new Set([...r,...e.modules.map(s=>s.url)])].map(s=>this.reload(s)))}async require(t,e){t?.length&&(await this.start(),await Promise.all(t.map(async r=>{let s;try{s=new URL(r,e??(typeof location>"u"?void 0:location.href)).href}catch{return}const i=this.states.get(s);if(i&&i.status!=="off")return i.status==="loading"?this.pending.get(s):void 0;this.named.add(s),await this.reload(s)})))}named=new Set;pending=new Map;async applyConfig(t){this.config=t,await Promise.all(t.modules.map(e=>this.reload(e.url)))}reload(t){const e=this.reloadNow(t);return this.pending.set(t,e),e}async reloadNow(t){const e=this.config.modules.find(a=>a.url===t),r=this.states.get(t);r?.loaded&&p.uninstall(r.loaded.module.id);const s=e!==void 0,i=e?.enabled??!0;if(!s&&!this.named.has(t))return this.states.delete(t),this.announce(),{url:t,addedByPerson:s,enabled:i,status:"off"};if(s&&!i&&!this.named.has(t))return this.set({url:t,addedByPerson:s,enabled:i,status:"off"});this.set({url:t,addedByPerson:s,enabled:i,status:"loading"});try{const a=await this.loader.load(t,{runScript:s&&i});return p.install(a.module),this.set({url:t,addedByPerson:s,enabled:i,status:"installed",loaded:a})}catch(a){return this.set({url:t,addedByPerson:s,enabled:i,status:"failed",error:a instanceof Error?a.message:String(a)})}}set(t){return this.states.set(t.url,t),this.announce(),t}save(){n.write(this.config,this.storage)}announce(){this.changes.dispatchEvent(new Event("change"))}}export{y as ModuleSession};
3
+ `}static storage(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}}class E{constructor(t,e){this.attribution=t,this.models=e}async entries(t){return t?this.models.filter(e=>[e.kind].flat().includes(t)):[...this.models]}async entry(t){return this.models.find(e=>e.id===t)}}class f{attribution;fetchImpl;tileUrlTemplate;constructor(t){this.attribution=t.attribution,this.tileUrlTemplate=t.tileUrlTemplate,this.fetchImpl=t.fetchImpl??fetch.bind(globalThis)}getImageryTexture(t,e){return g(t,e,r=>f.tileUrl(this.tileUrlTemplate,r),this.fetchImpl)}static tileUrl(t,e){return t.replaceAll("{z}",String(e.z)).replaceAll("{x}",String(e.x)).replaceAll("{y}",String(e.y))}}class v extends Error{constructor(t,e){super(`${t}: ${e}`),this.url=t,this.reason=e,this.name="ModuleManifestError"}}class d{static FORMAT=1;static check(t,e){const r=o=>{throw new v(e,o)};(t===null||typeof t!="object"||Array.isArray(t))&&r("not a JSON object");const s=t;typeof s.format!="number"&&r('no "format"'),s.format>d.FORMAT&&r(`format ${s.format} is newer than ${d.FORMAT}, which this version reads`),(typeof s.id!="string"||!/^[a-z0-9][a-z0-9._-]*$/.test(s.id))&&r(`"id" must be lowercase letters, digits, '.', '_' or '-'`),(typeof s.name!="string"||s.name.trim()==="")&&r('no "name"'),s.script!==void 0&&typeof s.script!="string"&&r('"script" must be an address');const i=s.contributes??{};for(const o of["imagery","elevation"]){const c=i[o];c!==void 0&&(Array.isArray(c)||r(`"contributes.${o}" must be a list`),c.forEach((l,h)=>{for(const m of["id","name","credit","creditUrl","tiles"])(typeof l?.[m]!="string"||l[m]==="")&&r(`"contributes.${o}[${h}].${m}" is missing`);["{z}","{x}","{y}"].every(m=>l.tiles.includes(m))||r(`"contributes.${o}[${h}].tiles" must hold {z}, {x} and {y}`)}))}const a=i.models;return a!==void 0&&(Array.isArray(a)||r('"contributes.models" must be a list'),a.forEach((o,c)=>{for(const l of["id","name","file"])(typeof o?.[l]!="string"||o[l]==="")&&r(`"contributes.models[${c}].${l}" is missing`);o.kind===void 0&&r(`"contributes.models[${c}].kind" is missing`),(!o.credit||typeof o.credit!="object")&&r(`"contributes.models[${c}].credit" is missing: a model is shown with its author and licence`)})),s}static contributions(t,e){const r=t.contributes??{},s={};if(r.imagery?.length&&(s.imagery=r.imagery.map(i=>({id:i.id,name:i.name,credit:i.credit,creditUrl:i.creditUrl,create:a=>new f({tileUrlTemplate:d.absoluteTemplate(i.tiles,e),attribution:i.credit,fetchImpl:a})}))),r.elevation?.length&&(s.elevation=r.elevation.map(i=>({id:i.id,name:i.name,credit:i.credit,creditUrl:i.creditUrl,create:a=>new w({tileUrlTemplate:d.absoluteTemplate(i.tiles,e),fetchImpl:a})}))),r.models?.length){const i=r.models.map(({file:o,...c})=>({...c,url:new URL(o,e).href})),a=t.credit??t.name;s.decorModels=[{id:`${t.id}-models`,name:t.name,credit:a,creditUrl:t.creditUrl??e,create:()=>new E(a,i)}]}return s}static module(t,e,r={}){const s=d.contributions(t,e);for(const[i,a]of Object.entries(r))Array.isArray(a)&&(s[i]=[...s[i]??[],...a]);return{id:t.id,name:t.name,credit:t.credit,creditUrl:t.creditUrl,url:e,contributes:s}}static absoluteTemplate(t,e){const r=t.replaceAll("{z}","__Z__").replaceAll("{x}","__X__").replaceAll("{y}","__Y__");return new URL(r,e).href.replaceAll("__Z__","{z}").replaceAll("__X__","{x}").replaceAll("__Y__","{y}")}}class T{fetchImpl;importImpl;constructor(t={}){this.fetchImpl=t.fetchImpl??fetch.bind(globalThis),this.importImpl=t.importImpl??(e=>import(e))}async load(t,e){const r=await this.fetchImpl(t);if(!r.ok)throw new Error(`${t}: HTTP ${r.status}`);const s=d.check(await r.json(),t),i=s.script!==void 0;let a={};if(i&&e.runScript){const o=new URL(s.script,t).href,c=await this.importImpl(o);if(typeof c.default!="function")throw new Error(`${o}: its default export is not a function`);const{MODULE_THREE:l}=await b(async()=>{const{MODULE_THREE:h}=await import("./ModuleThree-R2LhnY95.js");return{MODULE_THREE:h}},__vite__mapDeps([0,1]),import.meta.url);a=await c.default({manifestUrl:t,three:l})??{}}return{url:t,manifest:s,module:d.module(s,t,a),hasScript:i,scriptRun:i&&e.runScript}}}class y{constructor(t=new T,e){this.loader=t,this.storage=e}static shared=new y;changes=new EventTarget;states=new Map;config=n.empty();started;list(){const t=[...this.states.values()];return[...t.filter(e=>e.addedByPerson),...t.filter(e=>!e.addedByPerson)]}state(t){return this.states.get(t)}start(){return this.started??=this.applyConfig(n.read(this.storage)),this.started}async add(t){await this.start();const e=new URL(t,typeof location>"u"?void 0:location.href).href;return this.config.modules.some(r=>r.url===e)||(this.config={...this.config,modules:[...this.config.modules,{url:e,enabled:!0}]},this.save()),this.reload(e)}async remove(t){this.config={...this.config,modules:this.config.modules.filter(e=>e.url!==t)},this.save(),await this.reload(t)}async setEnabled(t,e){this.config={...this.config,modules:this.config.modules.map(r=>r.url===t?{...r,enabled:e}:r)},this.save(),await this.reload(t)}exportText(){return n.text(this.config)}async importText(t){const e=n.parse(t);await this.start();const r=this.config.modules.map(s=>s.url);this.config=e,this.save(),await Promise.all([...new Set([...r,...e.modules.map(s=>s.url)])].map(s=>this.reload(s)))}async require(t,e){t?.length&&(await this.start(),await Promise.all(t.map(async r=>{let s;try{s=new URL(r,e??(typeof location>"u"?void 0:location.href)).href}catch{return}const i=this.states.get(s);if(i&&i.status!=="off")return i.status==="loading"?this.pending.get(s):void 0;this.named.add(s),await this.reload(s)})))}named=new Set;pending=new Map;async applyConfig(t){this.config=t,await Promise.all(t.modules.map(e=>this.reload(e.url)))}reload(t){const e=this.reloadNow(t);return this.pending.set(t,e),e}async reloadNow(t){const e=this.config.modules.find(a=>a.url===t),r=this.states.get(t);r?.loaded&&p.uninstall(r.loaded.module.id);const s=e!==void 0,i=e?.enabled??!0;if(!s&&!this.named.has(t))return this.states.delete(t),this.announce(),{url:t,addedByPerson:s,enabled:i,status:"off"};if(s&&!i&&!this.named.has(t))return this.set({url:t,addedByPerson:s,enabled:i,status:"off"});this.set({url:t,addedByPerson:s,enabled:i,status:"loading"});try{const a=await this.loader.load(t,{runScript:s&&i});return p.install(a.module),this.set({url:t,addedByPerson:s,enabled:i,status:"installed",loaded:a})}catch(a){return this.set({url:t,addedByPerson:s,enabled:i,status:"failed",error:a instanceof Error?a.message:String(a)})}}set(t){return this.states.set(t.url,t),this.announce(),t}save(){n.write(this.config,this.storage)}announce(){this.changes.dispatchEvent(new Event("change"))}}export{y as ModuleSession};
@@ -0,0 +1 @@
1
+ import{p as a,V as e,bl as s,H as r,K as t,ab as i,q as o,a5 as n,z as l,E as b,ar as d,ac as m,ad as u,bm as M,h as B,N as G,e as S,w as c,aJ as p,aG as y,aK as f,G as h,aX as x,F as C,bn as E,Q as L,bo as g,bp as D,bq as P,C as T,J as A,B as F,i as V,br as q,aa as v,Z as H}from"./rr0-scene.mjs";const K={AdditiveBlending:H,BackSide:v,BoxGeometry:q,BufferAttribute:V,BufferGeometry:F,CanvasTexture:A,Color:T,ConeGeometry:P,CylinderGeometry:D,DataTexture:g,DoubleSide:L,Euler:E,Float32BufferAttribute:C,FrontSide:x,Group:h,Line:f,LineBasicMaterial:y,LineSegments:p,Matrix4:c,Mesh:S,MeshBasicMaterial:G,MeshStandardMaterial:B,NormalBlending:M,Object3D:u,PlaneGeometry:m,PointLight:d,Points:b,PointsMaterial:l,Quaternion:n,ShaderMaterial:o,SphereGeometry:i,Sprite:t,SpriteMaterial:r,TorusGeometry:s,Vector2:e,Vector3:a};export{K as MODULE_THREE};