@rr0/ufoathome 0.195.0 → 0.196.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist-embed-scene/rr0-scene.mjs +4 -4
  2. package/dist-embed-sighting/CaseMessages_en-G5J5w1_d.js +1 -0
  3. package/dist-embed-sighting/CaseMessages_es-D7Rp1_1K.js +1 -0
  4. package/dist-embed-sighting/CaseMessages_fr-B8eZ1NIJ.js +1 -0
  5. package/dist-embed-sighting/CaseMessages_it-Cu02nVVo.js +1 -0
  6. package/dist-embed-sighting/{CaseReportExport-BeKawC8S.js → CaseReportExport-CdRgJb5M.js} +1 -1
  7. package/dist-embed-sighting/rr0-sighting.mjs +343 -324
  8. package/dist-embed-sighting-editor/{AdsbLolArchiveProvider--KjPxNqw.js → AdsbLolArchiveProvider-BqEnqRP0.js} +1 -1
  9. package/dist-embed-sighting-editor/{BallesterGuaspAssessor-BTmq0r-G.js → BallesterGuaspAssessor-BL_yzudf.js} +1 -1
  10. package/dist-embed-sighting-editor/{BeamEditor-CI8-9VOc.js → BeamEditor-DA29mfqm.js} +1 -1
  11. package/dist-embed-sighting-editor/{BeamSystem-odg570aR.js → BeamSystem-DYohqXlF.js} +1 -1
  12. package/dist-embed-sighting-editor/{BirdEditor-DV3ndYff.js → BirdEditor-CAoRqqRV.js} +1 -1
  13. package/dist-embed-sighting-editor/{BirdFlock-O7K_g8y7.js → BirdFlock-TI63ZAKZ.js} +1 -1
  14. package/dist-embed-sighting-editor/{CaseEditorMessages_en-CoFukfwf.js → CaseEditorMessages_en-BPdxQsTX.js} +1 -1
  15. package/dist-embed-sighting-editor/{CaseEditorMessages_es-DZptbzB7.js → CaseEditorMessages_es-B48BAICC.js} +1 -1
  16. package/dist-embed-sighting-editor/{CaseEditorMessages_fr-DXl2GNmR.js → CaseEditorMessages_fr-DTWi9mIY.js} +1 -1
  17. package/dist-embed-sighting-editor/{CaseEditorMessages_it-ss10VmRM.js → CaseEditorMessages_it-CMLxgu8y.js} +1 -1
  18. package/dist-embed-sighting-editor/CaseElement-AXaERD8m.js +112 -0
  19. package/dist-embed-sighting-editor/CaseMessages_en-G5J5w1_d.js +1 -0
  20. package/dist-embed-sighting-editor/CaseMessages_es-D7Rp1_1K.js +1 -0
  21. package/dist-embed-sighting-editor/CaseMessages_fr-B8eZ1NIJ.js +1 -0
  22. package/dist-embed-sighting-editor/CaseMessages_it-Cu02nVVo.js +1 -0
  23. package/dist-embed-sighting-editor/{CaseReportExport-DisXbZ3b.js → CaseReportExport-CDZp6xGk.js} +2 -2
  24. package/dist-embed-sighting-editor/{ContrailSystem-BddkU7fj.js → ContrailSystem-B0cQbaHc.js} +1 -1
  25. package/dist-embed-sighting-editor/{ControlPasses-CNlCUT1L.js → ControlPasses-BvS8haeS.js} +1 -1
  26. package/dist-embed-sighting-editor/{CoverageAssessor-DjY8iKp5.js → CoverageAssessor-DD1kSvun.js} +1 -1
  27. package/dist-embed-sighting-editor/{DroneEditor-DRsM2ash.js → DroneEditor-BRB2-dAw.js} +1 -1
  28. package/dist-embed-sighting-editor/{DroneFlight-Fr4Vgso3.js → DroneFlight-BpnBgJ9K.js} +1 -1
  29. package/dist-embed-sighting-editor/{Flightradar24Provider-BxeduRam.js → Flightradar24Provider-D5OdIL0L.js} +1 -1
  30. package/dist-embed-sighting-editor/{GLTFLoader-C6nlGTTi.js → GLTFLoader-DuqJVU4y.js} +1 -1
  31. package/dist-embed-sighting-editor/{HeadlightSystem-DI5wHYZu.js → HeadlightSystem-BejdfHqe.js} +1 -1
  32. package/dist-embed-sighting-editor/{HynekAssessor-DlXalbph.js → HynekAssessor-CwzpS7YP.js} +1 -1
  33. package/dist-embed-sighting-editor/{LanternEditor-M887ltwe.js → LanternEditor-BnXAwLuQ.js} +1 -1
  34. package/dist-embed-sighting-editor/{LaserBeam-Drpkr84G.js → LaserBeam-tqM2fwHf.js} +1 -1
  35. package/dist-embed-sighting-editor/{LaunchEditor-BjAk4XZR.js → LaunchEditor-vwecAGwH.js} +1 -1
  36. package/dist-embed-sighting-editor/{LaunchPlume-CrzPcqw7.js → LaunchPlume-DWyU0YyJ.js} +1 -1
  37. package/dist-embed-sighting-editor/{LaunchSimulation-C1ZWpKZT.js → LaunchSimulation-C_OJQoKC.js} +1 -1
  38. package/dist-embed-sighting-editor/{ModelSource-Bko_3OJt.js → ModelSource-D1Wt6VYS.js} +1 -1
  39. package/dist-embed-sighting-editor/{ModelThumbnails-DSshyLu2.js → ModelThumbnails-C_8KCF7H.js} +1 -1
  40. package/dist-embed-sighting-editor/{ModelViewer-_yhAYvNy.js → ModelViewer-Cy-6IZBY.js} +1 -1
  41. package/dist-embed-sighting-editor/{ModuleConformance-B6iFVb8X.js → ModuleConformance-DYi4XZdB.js} +2 -2
  42. package/dist-embed-sighting-editor/{ModuleSession-jKFl1FMo.js → ModuleSession-BDbaoiCf.js} +2 -2
  43. package/dist-embed-sighting-editor/ModuleThree-DRf9SEr_.js +1 -0
  44. package/dist-embed-sighting-editor/{ModulesPanelElement-VPRCdjmv.js → ModulesPanelElement-hDjGLhRa.js} +3 -3
  45. package/dist-embed-sighting-editor/{NearestApproach-O8k2n_qL.js → NearestApproach-D6tQo7dk.js} +1 -1
  46. package/dist-embed-sighting-editor/{PoherAssessor-sTJEnlmb.js → PoherAssessor-BTYpHucH.js} +1 -1
  47. package/dist-embed-sighting-editor/{RailwaySystem-BZqNSSFA.js → RailwaySystem-D_8D64Bu.js} +1 -1
  48. package/dist-embed-sighting-editor/{ReentryEditor-DfDGpL5C.js → ReentryEditor-D7HxkvKP.js} +2 -2
  49. package/dist-embed-sighting-editor/{ReentrySimulation-BuUK0niI.js → ReentrySimulation-Bom073AV.js} +1 -1
  50. package/dist-embed-sighting-editor/{ReferenceSystem-DvcQp167.js → ReferenceSystem-D_eueNAb.js} +1 -1
  51. package/dist-embed-sighting-editor/{SightingElement-Bdkf99VT.js → SightingElement-DukKlaH1.js} +4 -4
  52. package/dist-embed-sighting-editor/{SkyLantern-B7UlFgmB.js → SkyLantern-BDpxvmY3.js} +1 -1
  53. package/dist-embed-sighting-editor/{TraceSystem-vZF4B5EC.js → TraceSystem-B1mmypS3.js} +2 -2
  54. package/dist-embed-sighting-editor/{WaterSystem-DSWmZbiL.js → WaterSystem-mZ-f2CcD.js} +2 -2
  55. package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +370 -359
  56. package/dist-embed-sighting-editor/{trafficRuntime-C5BXL-G6.js → trafficRuntime-CvK_m6bC.js} +1 -1
  57. package/dist-embed-ufoathome/{AdsbLolArchiveProvider-veDw9Mxo.js → AdsbLolArchiveProvider-BAZqWk1I.js} +1 -1
  58. package/dist-embed-ufoathome/{BallesterGuaspAssessor-BVygSN0R.js → BallesterGuaspAssessor-D5DnaJGn.js} +1 -1
  59. package/dist-embed-ufoathome/{BeamEditor-eDeeNBE9.js → BeamEditor-DmuKTRqU.js} +1 -1
  60. package/dist-embed-ufoathome/{BeamSystem-B5u4ithz.js → BeamSystem-KHzcEosy.js} +1 -1
  61. package/dist-embed-ufoathome/{BodyEditor-23Dua2K5.js → BodyEditor-Blkm_Xmd.js} +1 -1
  62. package/dist-embed-ufoathome/{CaseEditorElement-DYMt7oB4.js → CaseEditorElement-BTZu9wey.js} +33 -29
  63. package/dist-embed-ufoathome/{CaseEditorMessages_en-CoFukfwf.js → CaseEditorMessages_en-BPdxQsTX.js} +1 -1
  64. package/dist-embed-ufoathome/{CaseEditorMessages_es-DZptbzB7.js → CaseEditorMessages_es-B48BAICC.js} +1 -1
  65. package/dist-embed-ufoathome/{CaseEditorMessages_fr-DXl2GNmR.js → CaseEditorMessages_fr-DTWi9mIY.js} +1 -1
  66. package/dist-embed-ufoathome/{CaseEditorMessages_it-ss10VmRM.js → CaseEditorMessages_it-CMLxgu8y.js} +1 -1
  67. package/dist-embed-ufoathome/CaseElement-Cr3vTWdf.js +112 -0
  68. package/dist-embed-ufoathome/CaseMessages_en-G5J5w1_d.js +1 -0
  69. package/dist-embed-ufoathome/CaseMessages_es-D7Rp1_1K.js +1 -0
  70. package/dist-embed-ufoathome/CaseMessages_fr-B8eZ1NIJ.js +1 -0
  71. package/dist-embed-ufoathome/CaseMessages_it-Cu02nVVo.js +1 -0
  72. package/dist-embed-ufoathome/{CaseReportExport-Cgs2Y0v3.js → CaseReportExport-CyuSf3U_.js} +3 -3
  73. package/dist-embed-ufoathome/{CaseTimeline-BwCuVg5N.js → ColumnResize-DifCqMt1.js} +14 -7
  74. package/dist-embed-ufoathome/{ContrailSystem-CtQPQFyc.js → ContrailSystem-DqZ8PoEd.js} +1 -1
  75. package/dist-embed-ufoathome/{ControlPasses-B_uf1Wmh.js → ControlPasses-BtU_MVQU.js} +1 -1
  76. package/dist-embed-ufoathome/{CoverageAssessor-JQCFe16i.js → CoverageAssessor-DkVligEj.js} +1 -1
  77. package/dist-embed-ufoathome/{Flightradar24Provider-BR8_7wmx.js → Flightradar24Provider-GYjtvwah.js} +1 -1
  78. package/dist-embed-ufoathome/{GLTFLoader-DrBMau2Y.js → GLTFLoader-DzEwUqtj.js} +1 -1
  79. package/dist-embed-ufoathome/{GeoJsonExport-wUgEVyel.js → GeoJsonExport-B1i0YjqN.js} +1 -1
  80. package/dist-embed-ufoathome/{GeographicFigures-CpbFopao.js → GeographicFigures-D5ZCRN0K.js} +1 -1
  81. package/dist-embed-ufoathome/{HeadlightSystem-YXD1Zdpn.js → HeadlightSystem-x2xYh-cs.js} +1 -1
  82. package/dist-embed-ufoathome/{HynekAssessor-BV2nWUx8.js → HynekAssessor-DOUPfuRV.js} +1 -1
  83. package/dist-embed-ufoathome/{InterviewEditorElement-DiT6FZnj.js → InterviewEditorElement-Dt-KQiv0.js} +1 -1
  84. package/dist-embed-ufoathome/{InterviewElement-DFcCnZtF.js → InterviewElement-BPsBLXlf.js} +1 -1
  85. package/dist-embed-ufoathome/{KmlExport-wWr2S8H-.js → KmlExport-JEXMAssj.js} +1 -1
  86. package/dist-embed-ufoathome/{LaserBeam-CejB0H9v.js → LaserBeam-Cy9lfcCE.js} +1 -1
  87. package/dist-embed-ufoathome/{LaunchEditor-ConcMLIe.js → LaunchEditor-zWZhMyLf.js} +1 -1
  88. package/dist-embed-ufoathome/{LaunchPlume-BQEYjeSf.js → LaunchPlume-CcUQvACB.js} +1 -1
  89. package/dist-embed-ufoathome/{LaunchSimulation-BIiU6D8P.js → LaunchSimulation-DRH0rTE7.js} +1 -1
  90. package/dist-embed-ufoathome/{ModelSource-B93j0IA6.js → ModelSource-Dljnl-RW.js} +1 -1
  91. package/dist-embed-ufoathome/{ModelThumbnails-3U8M50_n.js → ModelThumbnails-DeaPuKSb.js} +1 -1
  92. package/dist-embed-ufoathome/{ModelViewer-Cnxj0Oi9.js → ModelViewer-B-ZLBTmq.js} +1 -1
  93. package/dist-embed-ufoathome/{ModuleConformance-BlrRirPF.js → ModuleConformance-Bd8yK7Ic.js} +2 -2
  94. package/dist-embed-ufoathome/{ModuleSession-Cdilmebx.js → ModuleSession-DXdpVejH.js} +3 -3
  95. package/dist-embed-ufoathome/{ModuleThree-Dpv5uvYp.js → ModuleThree-BL59t48W.js} +1 -1
  96. package/dist-embed-ufoathome/{ModulesPanelElement-CwgqBVUI.js → ModulesPanelElement-6KUAMJcl.js} +3 -3
  97. package/dist-embed-ufoathome/{NearestApproach-CQ2w9ctm.js → NearestApproach-wbFbwOAh.js} +1 -1
  98. package/dist-embed-ufoathome/{PictureRegistration-DOSDjiOf.js → PictureRegistration-CfSYGbeh.js} +1 -1
  99. package/dist-embed-ufoathome/{PoherAssessor-C8g5YvJi.js → PoherAssessor-CVIeQpd7.js} +1 -1
  100. package/dist-embed-ufoathome/{RailwaySystem-D8B965iv.js → RailwaySystem-DTXetaSg.js} +1 -1
  101. package/dist-embed-ufoathome/{ReentryEditor-CEbb0oLd.js → ReentryEditor-7Fxkxq-Q.js} +1 -1
  102. package/dist-embed-ufoathome/{ReentrySimulation-D_JX7wWS.js → ReentrySimulation-T3H0mJI3.js} +1 -1
  103. package/dist-embed-ufoathome/{ReferenceSystem-xm8mzWiT.js → ReferenceSystem-CJaq2UzO.js} +1 -1
  104. package/dist-embed-ufoathome/{ShareDialogElement-BBMLOqSW.js → ShareDialogElement-ClhewPap.js} +11 -11
  105. package/dist-embed-ufoathome/{SightingElement-e9ZcWa58.js → SightingElement-BtHQ5LDE.js} +4 -4
  106. package/dist-embed-ufoathome/{TraceSystem-BL6qfrHF.js → TraceSystem-B42kzZXG.js} +1 -1
  107. package/dist-embed-ufoathome/{VideoButton-DA48Qz2E.js → VideoButton-DhanY6AD.js} +1 -1
  108. package/dist-embed-ufoathome/{WaterSystem-BLy0L9qC.js → WaterSystem-DyJivqCq.js} +1 -1
  109. package/dist-embed-ufoathome/rr0-ufoathome.mjs +3 -3
  110. package/dist-embed-ufoathome/{surroundingsSources-Dlyt6moH.js → surroundingsSources-DEMGw8rm.js} +1 -1
  111. package/dist-embed-ufoathome/{trafficRuntime-B_bwWY8d.js → trafficRuntime-BJFdLEcT.js} +1 -1
  112. package/package.json +1 -1
  113. package/dist-embed-sighting/CaseMessages_en-BbbbikHH.js +0 -1
  114. package/dist-embed-sighting/CaseMessages_es-AHBxl8Ka.js +0 -1
  115. package/dist-embed-sighting/CaseMessages_fr-CD33PQCH.js +0 -1
  116. package/dist-embed-sighting/CaseMessages_it-DyMACGSU.js +0 -1
  117. package/dist-embed-sighting-editor/CaseElement-CVi_yfyW.js +0 -100
  118. package/dist-embed-sighting-editor/CaseMessages_en-BbbbikHH.js +0 -1
  119. package/dist-embed-sighting-editor/CaseMessages_es-AHBxl8Ka.js +0 -1
  120. package/dist-embed-sighting-editor/CaseMessages_fr-CD33PQCH.js +0 -1
  121. package/dist-embed-sighting-editor/CaseMessages_it-DyMACGSU.js +0 -1
  122. package/dist-embed-sighting-editor/ModuleThree-Fvr5G-Yh.js +0 -1
  123. package/dist-embed-ufoathome/CaseElement-C6KVIESP.js +0 -100
  124. package/dist-embed-ufoathome/CaseMessages_en-BbbbikHH.js +0 -1
  125. package/dist-embed-ufoathome/CaseMessages_es-AHBxl8Ka.js +0 -1
  126. package/dist-embed-ufoathome/CaseMessages_fr-CD33PQCH.js +0 -1
  127. package/dist-embed-ufoathome/CaseMessages_it-DyMACGSU.js +0 -1
@@ -1,4 +1,4 @@
1
- import{c1 as A,aX as g,V as P,c2 as m,ba as C,bb as E,bS as L,br as x,bd as R,be as S}from"./rr0-sighting-editor.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 A(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),b=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),w=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,w?(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,b)})}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:S,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{c2 as A,aY as g,V as P,c3 as m,bb as C,bc as E,bT as L,bs as x,be as R,bf as I}from"./rr0-sighting-editor.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 A(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),b=Math.max(u,i.CLEAR_AIR_SCATTER_PER_M);if(!c)return;const l=m.BEAMS[t],f=new P(-n.z,0,n.x),w=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 v=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,w?(s.shadow.autoUpdate||(s.shadow.needsUpdate=!0),s.shadow.autoUpdate=!0):s.shadow.autoUpdate=!1,s.position.copy(r).addScaledVector(f,v*a);const M=n.clone().addScaledVector(f,-v*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,b)})}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;
@@ -1 +1 @@
1
- import{aB as n,bz as c}from"./rr0-sighting-editor.mjs";import{N as p}from"./NearestApproach-O8k2n_qL.js";const l=-6,u=150;class o{about="temporal";async assess(e){const t=o.daylight(e),i=e.decor.map((s,r)=>({object:s,index:r})).filter(({object:s})=>s.kind==="entity"),a=p.of(e),d=a!==void 0&&a.m<=u;return{verdict:i.length>0?"ce3":d?"ce1":t===void 0?void 0:t?"dd":"nl",criteria:[{id:"entities",basis:i.length>0?"stated":void 0,paths:i.map(({index:s})=>`decor.${s}`)},{id:"traces",paths:[],unsupported:!0},{id:"proximity",basis:a?.basis,paths:a?.paths??[]},{id:"radar",paths:[],unsupported:!0},{id:"daylight",basis:t===void 0?void 0:"derived",paths:t===void 0?[]:["time","place"]}]}}static daylight(e){const t=e.event.place?.[0],i=e.event.time;if(!t||!i)return;const a=n(i,t.lng,e.event.utcOffsetHours);if(a)return c("Sun",a,{lat:t.lat,lng:t.lng,elevationM:0}).altitudeDeg>l}}export{o as HynekAssessor};
1
+ import{aC as n,bA as c}from"./rr0-sighting-editor.mjs";import{N as p}from"./NearestApproach-D6tQo7dk.js";const l=-6,u=150;class o{about="temporal";async assess(e){const t=o.daylight(e),i=e.decor.map((s,r)=>({object:s,index:r})).filter(({object:s})=>s.kind==="entity"),a=p.of(e),d=a!==void 0&&a.m<=u;return{verdict:i.length>0?"ce3":d?"ce1":t===void 0?void 0:t?"dd":"nl",criteria:[{id:"entities",basis:i.length>0?"stated":void 0,paths:i.map(({index:s})=>`decor.${s}`)},{id:"traces",paths:[],unsupported:!0},{id:"proximity",basis:a?.basis,paths:a?.paths??[]},{id:"radar",paths:[],unsupported:!0},{id:"daylight",basis:t===void 0?void 0:"derived",paths:t===void 0?[]:["time","place"]}]}}static daylight(e){const t=e.event.place?.[0],i=e.event.time;if(!t||!i)return;const a=n(i,t.lng,e.event.utcOffsetHours);if(a)return c("Sun",a,{lat:t.lat,lng:t.lng,elevationM:0}).altitudeDeg>l}}export{o as HynekAssessor};
@@ -1,4 +1,4 @@
1
- import{n as u,_ as h,b5 as p,$ as g,a1 as f,a0 as y,Y as b,b6 as T,b7 as w,a2 as A,a3 as E}from"./rr0-sighting-editor.mjs";import{S as v}from"./SkyEventEditorStyle-CvY_AhbI.js";import{SkyLantern as o}from"./SkyLantern-B7UlFgmB.js";const x=u.catalog({en:()=>h(()=>import("./LanternParameterTexts_en-CcnGd8UH.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_en),fr:()=>h(()=>import("./LanternParameterTexts_fr-P2JwYOUy.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_fr),es:()=>h(()=>import("./LanternParameterTexts_es-CUTgNutZ.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_es),it:()=>h(()=>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(l=>l.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(){p.publish(i.SET)}}const S=u.catalog({en:()=>h(()=>import("./LanternEditorMessages_en-DaT3UNfD.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_en),fr:()=>h(()=>import("./LanternEditorMessages_fr-9mByTFMG.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_fr),es:()=>h(()=>import("./LanternEditorMessages_es-TDV5lKeJ.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_es),it:()=>h(()=>import("./LanternEditorMessages_it-MRkJnDQp.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_it)});class c{constructor(e,t,n){this.container=e,this.host=t,v.attach(e,"lantern-editor-part",c.STYLE),this.language=n,p.of("lantern")||i.publish(),this.ready=this.setLanguage(n)}messages;ready;parameterTexts;languageToken=0;currentId;form;list;language;shown=[];static STYLE=`
1
+ import{n as u,_ as h,b6 as p,$ as g,a1 as f,a0 as y,Y as b,b7 as T,b8 as w,a2 as A,a3 as E}from"./rr0-sighting-editor.mjs";import{S as v}from"./SkyEventEditorStyle-CvY_AhbI.js";import{SkyLantern as o}from"./SkyLantern-BDpxvmY3.js";const x=u.catalog({en:()=>h(()=>import("./LanternParameterTexts_en-CcnGd8UH.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_en),fr:()=>h(()=>import("./LanternParameterTexts_fr-P2JwYOUy.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_fr),es:()=>h(()=>import("./LanternParameterTexts_es-CUTgNutZ.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_es),it:()=>h(()=>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(l=>l.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(){p.publish(i.SET)}}const S=u.catalog({en:()=>h(()=>import("./LanternEditorMessages_en-DaT3UNfD.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_en),fr:()=>h(()=>import("./LanternEditorMessages_fr-9mByTFMG.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_fr),es:()=>h(()=>import("./LanternEditorMessages_es-TDV5lKeJ.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_es),it:()=>h(()=>import("./LanternEditorMessages_it-MRkJnDQp.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_it)});class c{constructor(e,t,n){this.container=e,this.host=t,v.attach(e,"lantern-editor-part",c.STYLE),this.language=n,p.of("lantern")||i.publish(),this.ready=this.setLanguage(n)}messages;ready;parameterTexts;languageToken=0;currentId;form;list;language;shown=[];static STYLE=`
2
2
  .lantern-editor-part, .lantern-editor-part #lantern-list, .lantern-editor-part .launch-fields { flex-basis: 100%; min-width: 0; }
3
3
  .lantern-editor-part .launch-editor, .lantern-editor-part .launch-fields { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
4
4
  .lantern-editor-part [hidden] { display: none !important; }
@@ -1 +1 @@
1
- import{aI as O,bf as D,bg as I}from"./rr0-sighting-editor.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,R)=>{const v=Math.sin(i*127.1+R*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,R=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,g]=r(f),[N,T]=r(w);return[(N-E)/(d||1),(T-g)/(d||1)]})(),y=Math.max(1,Math.min(l.MAX_SAMPLES,Math.ceil(d/l.STEP_M)));for(let E=u===0?0:1;E<=y;E++){const g=E/y,N=[0,1,2].map(P=>f[P]+(w[P]-f[P])*g),T=g*d,x=p.altitudeM+(A.altitudeM-p.altitudeM)*g+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,R=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:R})}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,I.colourMatching(n)[1])}static colourOf(n){const[o,t,s]=I.colourMatching(n);if(t<=0)return[0,0,0];const c=I.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{aJ as O,bg as D,bh as y}from"./rr0-sighting-editor.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,R)=>{const v=Math.sin(i*127.1+R*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,R=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,g]=r(f),[N,T]=r(w);return[(N-E)/(d||1),(T-g)/(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 g=E/I,N=[0,1,2].map(P=>f[P]+(w[P]-f[P])*g),T=g*d,x=p.altitudeM+(A.altitudeM-p.altitudeM)*g+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,R=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:R})}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,4 +1,4 @@
1
- import{n as y,_ as d,b5 as b,$ as x,a0 as E,I as g,Y as w,Z as j,a1 as v,bh as k}from"./rr0-sighting-editor.mjs";import{S as I}from"./SkyEventEditorStyle-CvY_AhbI.js";import{L as T}from"./LaunchPlume-CrzPcqw7.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,I.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 E.resolve(e,this.parameterTexts)}render(){if(!this.messages)return;const e=this.messages;this.form=void 0,this.container.innerHTML=`<div class="launch-editor">
1
+ import{n as y,_ as d,b6 as b,$ as x,a0 as E,I as g,Y as w,Z as j,a1 as v,bi as k}from"./rr0-sighting-editor.mjs";import{S as I}from"./SkyEventEditorStyle-CvY_AhbI.js";import{L as T}from"./LaunchPlume-DWyU0YyJ.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,I.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 E.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
2
  <p class="launch-intro">${e.intro}</p>
3
3
  <div id="launch-list"></div>
4
4
  <div id="launch-fields" class="launch-fields">
@@ -1 +1 @@
1
- import{bk as w,bl as F,bm as v,bn as Y,aI as H}from"./rr0-sighting-editor.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,S=Math.hypot(o,n,p),T=K.OMEGA,M=-398600.4418/(S*S*S),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(S-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),S=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*S/(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),S=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(m=>(M[m]-T[m])/y),I=r.EARTH_ROTATION,E=[U[0]-I*S[1],U[1]+I*S[0],U[2]],D=m=>{const b=Math.hypot(m[0],m[1],m[2])||1;return m.map(k=>k/b)},c=D(E),f=D(S),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(m=>-c[m]*Math.cos(G)+Math.sin(G)*(Math.cos(x)*l[m]+Math.sin(x)*O[m])),P=[0,1,2].map(m=>U[m]+t.speedKmPerS*C[m]);return new _(S,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)),S=[0,1,2].map(T=>Math.exp(-r.RAYLEIGH_PER_M[T]*d*R-r.OZONE_GRAZING_DEPTH[T]*h));return{lit:n,transmittance:S}}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{bl as w,bm as F,bn as v,bo as Y,aJ as H}from"./rr0-sighting-editor.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,S=Math.hypot(o,n,p),T=K.OMEGA,M=-398600.4418/(S*S*S),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(S-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),S=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*S/(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),S=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(m=>(M[m]-T[m])/y),I=r.EARTH_ROTATION,E=[U[0]-I*S[1],U[1]+I*S[0],U[2]],D=m=>{const b=Math.hypot(m[0],m[1],m[2])||1;return m.map(k=>k/b)},c=D(E),f=D(S),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(m=>-c[m]*Math.cos(G)+Math.sin(G)*(Math.cos(x)*l[m]+Math.sin(x)*O[m])),P=[0,1,2].map(m=>U[m]+t.speedKmPerS*C[m]);return new _(S,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)),S=[0,1,2].map(T=>Math.exp(-r.RAYLEIGH_PER_M[T]*d*R-r.OZONE_GRAZING_DEPTH[T]*h));return{lit:n,transmittance:S}}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-CrzPcqw7.js";import{aU as T,ba as z,bb as f,aX as C,bi as w,bj as A}from"./rr0-sighting-editor.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 a=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 h=s(p.centre),r=[0,1,2].map(g=>Math.min(n.BRIGHTEST_RELATIVE,p.luminanceCdM2*(p.colour?.[g]??1)*i*p.sunTransmittance[g]*h[g]*d));Math.max(...r)<=0||(a=this.pushPuff(a,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,a),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),a=this.normalise(o),c=this.normalise(this.cross({x:0,y:1,z:0},a)),u=this.cross(a,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}},h=r=>n.COLUMN[r];for(let r=0;r<n.SECTORS;r++){const g=(r+1)%n.SECTORS;t=this.push(t,o,s,h(0)),t=this.push(t,d(1,r),s,h(1)),t=this.push(t,d(1,g),s,h(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,h(e)),t=this.push(t,R,s,h(e)),t=this.push(t,l,s,h(e+1)),t=this.push(t,R,s,h(e)),t=this.push(t,E,s,h(e+1)),t=this.push(t,l,s,h(e+1))}}return t}pickAt(t,i,s=0){const o=this.normalise(t);let a=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),h=u.luminance*n.profile(d);h<=0||(a+=h,(!c||h>c.light)&&(c={view:u.view,light:h}))}return c&&a>=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 a=t*3;return this.positions[a]=i.x,this.positions[a+1]=i.y,this.positions[a+2]=i.z,this.colors[a]=s[0]*o,this.colors[a+1]=s[1]*o,this.colors[a+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 S{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,a=>s.transmittanceFromSpace(a),a=>s.cloudTransmission(a))}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{S as LaunchSimulation};
1
+ import{L as M}from"./LaunchPlume-DWyU0YyJ.js";import{aV as T,bb as z,bc as f,aY as C,bj as w,bk as A}from"./rr0-sighting-editor.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 a=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 h=s(p.centre),r=[0,1,2].map(g=>Math.min(n.BRIGHTEST_RELATIVE,p.luminanceCdM2*(p.colour?.[g]??1)*i*p.sunTransmittance[g]*h[g]*d));Math.max(...r)<=0||(a=this.pushPuff(a,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,a),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),a=this.normalise(o),c=this.normalise(this.cross({x:0,y:1,z:0},a)),u=this.cross(a,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}},h=r=>n.COLUMN[r];for(let r=0;r<n.SECTORS;r++){const g=(r+1)%n.SECTORS;t=this.push(t,o,s,h(0)),t=this.push(t,d(1,r),s,h(1)),t=this.push(t,d(1,g),s,h(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,h(e)),t=this.push(t,R,s,h(e)),t=this.push(t,l,s,h(e+1)),t=this.push(t,R,s,h(e)),t=this.push(t,E,s,h(e+1)),t=this.push(t,l,s,h(e+1))}}return t}pickAt(t,i,s=0){const o=this.normalise(t);let a=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),h=u.luminance*n.profile(d);h<=0||(a+=h,(!c||h>c.light)&&(c={view:u.view,light:h}))}return c&&a>=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 a=t*3;return this.positions[a]=i.x,this.positions[a+1]=i.y,this.positions[a+2]=i.z,this.colors[a]=s[0]*o,this.colors[a+1]=s[1]*o,this.colors[a+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 U{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,a=>s.transmittanceFromSpace(a),a=>s.cloudTransmission(a))}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{U as LaunchSimulation};
@@ -1 +1 @@
1
- import{aU as d,aV as c,aW as l,aX as f,aY as m,aZ as u,a_ as w,a$ as g,b0 as y,b1 as M,b2 as b,b3 as S,V as v}from"./rr0-sighting-editor.mjs";class h{static key(e){return"url"in e?`url:${e.url}|${e.headingOffsetDeg??0}`:"shape"in e?`shape:${e.shape}`:`decor:${e.decorKind}`}static async build(e){const a=new d;if("url"in e){const s=await c(e.url);s.rotation.y=-(e.headingOffsetDeg??0)*Math.PI/180,a.add(s)}else"shape"in e?a.add(h.shapeOf(e.shape)):a.add(l.build({id:"preview",kind:e.decorKind,eastM:0,northM:0},!1));return a}static shapeOf(e){if(e==="figure")return l.build({id:"preview",kind:"entity",eastM:0,northM:0},!1);const a=new f(m.unitGeometry(e),new u({color:13158608,roughness:.5,metalness:0}));return e==="ellipsoid"&&a.scale.set(1,.55,1),a}static dispose(e){e.traverse(a=>{const s=a;if(s.isMesh){s.geometry?.dispose();for(const t of[s.material].flat())t.dispose()}})}static stage(e,a){const s=new w().setFromObject(e);if(s.isEmpty())return;const t=s.getBoundingSphere(new g),r=new d;e.position.sub(t.center),r.add(e);const n=new y;n.add(r),n.add(new M(16777215,6715272,1.6));const o=new b(16777215,2.5);o.position.set(1,2,1.5),n.add(o);const i=new S(30,a,t.radius*.05,t.radius*20),p=t.radius/Math.sin(i.fov*Math.PI/360)*1.05;return i.position.copy(new v(.55,.3,-.78).normalize().multiplyScalar(p)),i.lookAt(0,0,0),{scene:n,camera:i,pivot:r}}}export{h as M};
1
+ import{aV as d,aW as c,aX as l,aY as f,aZ as m,a_ as u,a$ as w,b0 as g,b1 as y,b2 as M,b3 as b,b4 as S,V as v}from"./rr0-sighting-editor.mjs";class h{static key(e){return"url"in e?`url:${e.url}|${e.headingOffsetDeg??0}`:"shape"in e?`shape:${e.shape}`:`decor:${e.decorKind}`}static async build(e){const a=new d;if("url"in e){const s=await c(e.url);s.rotation.y=-(e.headingOffsetDeg??0)*Math.PI/180,a.add(s)}else"shape"in e?a.add(h.shapeOf(e.shape)):a.add(l.build({id:"preview",kind:e.decorKind,eastM:0,northM:0},!1));return a}static shapeOf(e){if(e==="figure")return l.build({id:"preview",kind:"entity",eastM:0,northM:0},!1);const a=new f(m.unitGeometry(e),new u({color:13158608,roughness:.5,metalness:0}));return e==="ellipsoid"&&a.scale.set(1,.55,1),a}static dispose(e){e.traverse(a=>{const s=a;if(s.isMesh){s.geometry?.dispose();for(const t of[s.material].flat())t.dispose()}})}static stage(e,a){const s=new w().setFromObject(e);if(s.isEmpty())return;const t=s.getBoundingSphere(new g),r=new d;e.position.sub(t.center),r.add(e);const n=new y;n.add(r),n.add(new M(16777215,6715272,1.6));const o=new b(16777215,2.5);o.position.set(1,2,1.5),n.add(o);const i=new S(30,a,t.radius*.05,t.radius*20),p=t.radius/Math.sin(i.fov*Math.PI/360)*1.05;return i.position.copy(new v(.55,.3,-.78).normalize().multiplyScalar(p)),i.lookAt(0,0,0),{scene:n,camera:i,pivot:r}}}export{h as M};
@@ -1 +1 @@
1
- import{aT as c}from"./rr0-sighting-editor.mjs";import{M as i}from"./ModelSource-Bko_3OJt.js";class l{static SIZE_PX={width:192,height:144};static cache=new Map;static queue=Promise.resolve();static pending=0;static renderer;static of(r){const t=i.key(r);let e=this.cache.get(t);return e||(this.pending++,e=this.queue.then(()=>this.draw(r)).catch(()=>{}).finally(()=>{--this.pending===0&&this.release()}),this.queue=e,this.cache.set(t,e)),e}static async draw(r){const t=await i.build(r);try{const{width:e,height:n}=this.SIZE_PX,a=i.stage(t,e/n);if(!a)return;const s=this.renderer??=new c({antialias:!0,alpha:!0,preserveDrawingBuffer:!0});return s.setSize(e,n,!1),s.setClearColor(0,0),s.render(a.scene,a.camera),s.domElement.toDataURL("image/png")}finally{i.dispose(t)}}static release(){this.renderer?.dispose(),this.renderer?.forceContextLoss(),this.renderer=void 0}}export{l as ModelThumbnails};
1
+ import{aU as c}from"./rr0-sighting-editor.mjs";import{M as i}from"./ModelSource-D1Wt6VYS.js";class l{static SIZE_PX={width:192,height:144};static cache=new Map;static queue=Promise.resolve();static pending=0;static renderer;static of(r){const t=i.key(r);let e=this.cache.get(t);return e||(this.pending++,e=this.queue.then(()=>this.draw(r)).catch(()=>{}).finally(()=>{--this.pending===0&&this.release()}),this.queue=e,this.cache.set(t,e)),e}static async draw(r){const t=await i.build(r);try{const{width:e,height:n}=this.SIZE_PX,a=i.stage(t,e/n);if(!a)return;const s=this.renderer??=new c({antialias:!0,alpha:!0,preserveDrawingBuffer:!0});return s.setSize(e,n,!1),s.setClearColor(0,0),s.render(a.scene,a.camera),s.domElement.toDataURL("image/png")}finally{i.dispose(t)}}static release(){this.renderer?.dispose(),this.renderer?.forceContextLoss(),this.renderer=void 0}}export{l as ModelThumbnails};
@@ -1 +1 @@
1
- import{aT as h}from"./rr0-sighting-editor.mjs";import{M as c}from"./ModelSource-Bko_3OJt.js";class a{constructor(t,e){this.container=t,this.source=e,this.canvas=document.createElement("canvas"),this.canvas.className="model-live",this.canvas.style.cssText="position:absolute;inset:0;width:100%;height:100%;touch-action:none;cursor:grab;display:none",this.canvas.addEventListener("pointerdown",s=>this.press(s)),this.canvas.addEventListener("pointermove",s=>this.move(s)),this.canvas.addEventListener("pointerup",()=>this.release()),this.canvas.addEventListener("pointercancel",()=>this.release())}static renderer;static SPIN_RAD_PER_S=.7;static DRAG_RAD_PER_PX=.012;static CLICK_TOLERANCE_PX=4;static current;object;stage;frame=0;stopped=!1;last=0;dragging;draggedPastClick=!1;canvas;static show(t,e){a.current?.stop();const s=new a(t,e);return a.current=s,s.start(),s}static end(){a.current?.stop(),a.current=void 0,a.renderer?.dispose(),a.renderer?.forceContextLoss(),a.renderer=void 0}consumeDrag(){const t=this.draggedPastClick;return this.draggedPastClick=!1,t}get active(){return!this.stopped}stop(){this.stopped=!0,cancelAnimationFrame(this.frame),this.canvas.remove(),this.object&&c.dispose(this.object),this.object=void 0,a.current===this&&(a.current=void 0)}async start(){try{const t=await c.build(this.source);if(this.stopped){c.dispose(t);return}this.object=t;const{width:e,height:s}=this.container.getBoundingClientRect(),i=e>0&&s>0?e/s:4/3;if(this.stage=c.stage(t,i),!this.stage)return;(a.renderer??=new h({antialias:!0,alpha:!0})).setClearColor(0,0),this.container.append(this.canvas),this.canvas.style.display="block",this.last=performance.now(),this.tick()}catch{}}tick=()=>{if(this.stopped||!this.stage)return;const t=performance.now(),e=Math.min(.1,(t-this.last)/1e3);this.last=t,this.dragging||(this.stage.pivot.rotation.y+=a.SPIN_RAD_PER_S*e);const s=a.renderer,{width:i,height:n}=this.canvas.getBoundingClientRect(),r=Math.min(2,window.devicePixelRatio||1);(this.canvas.width!==Math.round(i*r)||this.canvas.height!==Math.round(n*r))&&(s.setPixelRatio(r),s.setSize(i,n,!1),this.canvas.width=Math.round(i*r),this.canvas.height=Math.round(n*r),this.stage.camera.aspect=i/Math.max(1,n),this.stage.camera.updateProjectionMatrix()),s.render(this.stage.scene,this.stage.camera);const o=this.canvas.getContext("2d");o?.clearRect(0,0,this.canvas.width,this.canvas.height),o?.drawImage(s.domElement,0,0,this.canvas.width,this.canvas.height),this.frame=requestAnimationFrame(this.tick)};press(t){this.dragging={x:t.clientX,y:t.clientY,moved:!1},this.canvas.setPointerCapture(t.pointerId),this.canvas.style.cursor="grabbing"}move(t){const e=this.dragging;if(!e||!this.stage)return;const s=t.clientX-e.x,i=t.clientY-e.y;!e.moved&&Math.hypot(s,i)<a.CLICK_TOLERANCE_PX||(e.moved=!0,this.draggedPastClick=!0,this.stage.pivot.rotation.y+=s*a.DRAG_RAD_PER_PX,this.stage.pivot.rotation.x=Math.max(-1.4,Math.min(1.4,this.stage.pivot.rotation.x-i*a.DRAG_RAD_PER_PX)),e.x=t.clientX,e.y=t.clientY)}release(){this.dragging=void 0,this.canvas.style.cursor="grab"}}export{a as ModelViewer};
1
+ import{aU as h}from"./rr0-sighting-editor.mjs";import{M as c}from"./ModelSource-D1Wt6VYS.js";class a{constructor(t,e){this.container=t,this.source=e,this.canvas=document.createElement("canvas"),this.canvas.className="model-live",this.canvas.style.cssText="position:absolute;inset:0;width:100%;height:100%;touch-action:none;cursor:grab;display:none",this.canvas.addEventListener("pointerdown",s=>this.press(s)),this.canvas.addEventListener("pointermove",s=>this.move(s)),this.canvas.addEventListener("pointerup",()=>this.release()),this.canvas.addEventListener("pointercancel",()=>this.release())}static renderer;static SPIN_RAD_PER_S=.7;static DRAG_RAD_PER_PX=.012;static CLICK_TOLERANCE_PX=4;static current;object;stage;frame=0;stopped=!1;last=0;dragging;draggedPastClick=!1;canvas;static show(t,e){a.current?.stop();const s=new a(t,e);return a.current=s,s.start(),s}static end(){a.current?.stop(),a.current=void 0,a.renderer?.dispose(),a.renderer?.forceContextLoss(),a.renderer=void 0}consumeDrag(){const t=this.draggedPastClick;return this.draggedPastClick=!1,t}get active(){return!this.stopped}stop(){this.stopped=!0,cancelAnimationFrame(this.frame),this.canvas.remove(),this.object&&c.dispose(this.object),this.object=void 0,a.current===this&&(a.current=void 0)}async start(){try{const t=await c.build(this.source);if(this.stopped){c.dispose(t);return}this.object=t;const{width:e,height:s}=this.container.getBoundingClientRect(),i=e>0&&s>0?e/s:4/3;if(this.stage=c.stage(t,i),!this.stage)return;(a.renderer??=new h({antialias:!0,alpha:!0})).setClearColor(0,0),this.container.append(this.canvas),this.canvas.style.display="block",this.last=performance.now(),this.tick()}catch{}}tick=()=>{if(this.stopped||!this.stage)return;const t=performance.now(),e=Math.min(.1,(t-this.last)/1e3);this.last=t,this.dragging||(this.stage.pivot.rotation.y+=a.SPIN_RAD_PER_S*e);const s=a.renderer,{width:i,height:n}=this.canvas.getBoundingClientRect(),r=Math.min(2,window.devicePixelRatio||1);(this.canvas.width!==Math.round(i*r)||this.canvas.height!==Math.round(n*r))&&(s.setPixelRatio(r),s.setSize(i,n,!1),this.canvas.width=Math.round(i*r),this.canvas.height=Math.round(n*r),this.stage.camera.aspect=i/Math.max(1,n),this.stage.camera.updateProjectionMatrix()),s.render(this.stage.scene,this.stage.camera);const o=this.canvas.getContext("2d");o?.clearRect(0,0,this.canvas.width,this.canvas.height),o?.drawImage(s.domElement,0,0,this.canvas.width,this.canvas.height),this.frame=requestAnimationFrame(this.tick)};press(t){this.dragging={x:t.clientX,y:t.clientY,moved:!1},this.canvas.setPointerCapture(t.pointerId),this.canvas.style.cursor="grabbing"}move(t){const e=this.dragging;if(!e||!this.stage)return;const s=t.clientX-e.x,i=t.clientY-e.y;!e.moved&&Math.hypot(s,i)<a.CLICK_TOLERANCE_PX||(e.moved=!0,this.draggedPastClick=!0,this.stage.pivot.rotation.y+=s*a.DRAG_RAD_PER_PX,this.stage.pivot.rotation.x=Math.max(-1.4,Math.min(1.4,this.stage.pivot.rotation.x-i*a.DRAG_RAD_PER_PX)),e.x=t.clientX,e.y=t.clientY)}release(){this.dragging=void 0,this.canvas.style.cursor="grab"}}export{a as ModelViewer};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ModuleThree-Fvr5G-Yh.js","./rr0-sighting-editor.mjs"])))=>i.map(i=>d[i]);
2
- import{_ as w}from"./rr0-sighting-editor.mjs";class n{static MEMBERS={weather:["getWeather"],place:["attribution","search","reverse"],timeZone:["zoneAt"],narrative:["settings","draft"],assessment:["assess"],lightPollution:["year","citation","lookUp"],aircraft:["citation","between"],upperAir:["between"],elevation:["getElevationGrid"],imagery:["attribution","getImageryTexture"],surroundings:["id","name","attribution","creditUrl","contemporary","covers","getSurroundings"],decorModels:["attribution","entries","entry"],skyEvents:["key","messages","simulation"],interpretations:["key","messages","compute"],perception:["id","messages","sources","settings","perceive"],transcription:["sendsAudio","engine","transcribe"],reentryTypes:["key","nature","messages","template"]};static WEATHER_SHARES=["cloudCover","cloudDarkness","precipitationIntensity","highCloudCover","lowerCloudCover","iceCrystalAlignment","rareIceCrystals","relativeHumidity"];static WEATHER_REQUIRED=["cloudCover","cloudDarkness","precipitationIntensity"];static PRECIPITATIONS=["none","rain","snow","hail"];static HIGH_WIND_MS=60;static TIMEOUT_MS=3e4;static async check(i,a={}){const r=[];i.hasScript&&!i.scriptRun&&r.push({level:"note",code:"scriptNotRun"});for(const[t,s]of Object.entries(i.module.contributes))Object.hasOwn(n.MEMBERS,t)?Array.isArray(s)?await n.checkPoint(t,s,a,r):r.push({level:"failed",code:"notAList",point:t}):r.push({level:"failed",code:"unknownPoint",point:t});return r}static async checkPoint(i,a,r,t){const s=new Set;for(const e of a){const c=(l,d,g="failed")=>{t.push({level:g,code:l,point:i,source:typeof e?.id=="string"?e.id:void 0,detail:d})};if(s.has(e?.id)&&c("duplicateId"),s.add(e?.id),n.checkEntry(e,c),typeof e?.create!="function"){c("createMissing");continue}const o=n.build(e,c);if(o===void 0)continue;const h=n.MEMBERS[i].filter(l=>o[l]===void 0);for(const l of h)c("missingMember",l);h.length>0||(i==="weather"&&await n.checkWeather(e.id,o,r,c),i==="skyEvents"&&await n.checkSkyEventKind(e.id,o,r,c),i==="interpretations"&&await n.checkInterpretationKind(e.id,o,r,c))}}static checkEntry(i,a){for(const r of["id","name","credit","creditUrl"]){const t=i?.[r];(typeof t!="string"||t.trim()==="")&&a("entryField",r)}typeof i?.creditUrl=="string"&&i.creditUrl!==""&&!URL.canParse(i.creditUrl)&&a("entryField","creditUrl")}static build(i,a){let r=!1;const t=(async()=>(r=!0,new Response("",{status:503}))),s=globalThis.fetch;globalThis.fetch=t;try{const e=i.create(t);if(r&&a("createAsked"),e==null){a("createEmpty");return}return e}catch(e){a("createThrew",n.told(e));return}finally{globalThis.fetch=s}}static async checkWeather(i,a,r,t){const s=r.weatherQuery;if(!s){t("weatherNotAsked",void 0,"note");return}let e;try{e=await n.within(a.getWeather(s),r)}catch(l){t("weatherThrew",n.told(l));return}if(e===void 0){t("weatherNoRecord",void 0,"note");return}const c=e?.samples;if(!Array.isArray(c)||c.length!==s.points.length){t("weatherSamples",`${Array.isArray(c)?c.length:0}/${s.points.length}`);return}c.some((l,d)=>l?.time?.getTime?.()!==s.points[d].time.getTime())&&t("weatherOrder");const o=new Set;let h=!1;for(const l of c){const d=l?.weather??{};for(const g of n.WEATHER_SHARES){const u=d[g],p=n.WEATHER_REQUIRED.includes(g);(u!==void 0||p)&&!n.between(u,0,1)&&o.add(`${g} = ${String(u)}`)}n.between(d.windDirectionDeg,0,360)||o.add(`windDirectionDeg = ${String(d.windDirectionDeg)}`),n.between(d.windSpeed,0,1/0)?d.windSpeed>n.HIGH_WIND_MS&&(h=!0):o.add(`windSpeed = ${String(d.windSpeed)}`),n.PRECIPITATIONS.includes(d.precipitationType)||o.add(`precipitationType = ${String(d.precipitationType)}`),typeof d.storm!="boolean"&&o.add(`storm = ${String(d.storm)}`)}for(const l of o)t("weatherValue",l);h&&t("weatherWindHigh",void 0,"note"),e.source?.id!==i&&t("weatherSource","id"),(typeof e.source?.name!="string"||e.source.name==="")&&t("weatherSource","name"),(typeof e.source?.url!="string"||e.source.url==="")&&t("weatherSource","url")}static async checkSkyEventKind(i,a,r,t){a.key!==i&&t("kindKey",String(a.key)),await n.checkTexts(a.messages,["title","name"],r,t);let s;try{s=(await n.within(a.simulation(),r))()}catch(o){t("simulationFailed",n.told(o));return}const{MODULE_THREE:e}=await w(async()=>{const{MODULE_THREE:o}=await import("./ModuleThree-Fvr5G-Yh.js");return{MODULE_THREE:o}},__vite__mapDeps([0,1]),import.meta.url);if(!(s?.object instanceof e.Object3D)){t("secondThree");return}try{s.update([],0,n.frame(new e.Vector3)),s.drawnCount!==0&&t("drawnWithoutEvents",String(s.drawnCount))}catch(o){t("updateThrew",n.told(o))}const c=new e.Group;c.add(s.object);try{s.dispose(),s.object.parent===c&&t("disposeLeft")}catch(o){t("disposeThrew",n.told(o))}}static async checkInterpretationKind(i,a,r,t){a.key!==i&&t("kindKey",String(a.key)),await n.checkTexts(a.messages,["title"],r,t);const s=r.interpretation?.[a.key];if(!Array.isArray(s)||s.length===0){t("readingNotTried",void 0,"note");return}let e;try{if(e=await n.within(a.compute(),r),typeof e!="function"){t("readingThrew","compute");return}}catch(c){t("readingThrew",n.told(c));return}for(const c of s)try{const o=e(c);Array.isArray(o)||t("readingNotAList")}catch(o){t("readingThrew",n.told(o))}}static async checkTexts(i,a,r,t){for(const s of["en","fr"])try{const e=await n.within(i.load(s),r);for(const c of a)(typeof e?.[c]!="string"||e[c]==="")&&t("kindMessages",`${s}: ${c}`)}catch(e){t("kindMessages",`${s}: ${n.told(e)}`)}}static frame(i){return{reference:{lat:0,lng:0},origin:{x:0,z:0},eastScale:1,siteElevationM:0,eye:i,pixelRad:.001,relativeScale:1,air:{},transmittanceTo:()=>[1,1,1],groundYAt:()=>0,wind:{eastMS:0,northMS:0},observer:{lat:0,lng:0,heightM:0},date:new Date(0),magnitudeLimit:6,cloudTransmission:()=>1,arrivingIlluminance:()=>[0,0,0],transmittanceFromSpace:()=>[1,1,1],lightFrom:()=>{},glareFrom:()=>{}}}static between(i,a,r){return typeof i=="number"&&!Number.isNaN(i)&&i>=a&&i<=r}static told(i){return i instanceof Error?i.message:String(i)}static within(i,a){const r=a.timeoutMs??n.TIMEOUT_MS;let t;const s=new Promise((e,c)=>{t=setTimeout(()=>c(new Error(`> ${r/1e3} s`)),r)});return Promise.race([i,s]).finally(()=>clearTimeout(t))}}export{n as ModuleConformance};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ModuleThree-DRf9SEr_.js","./rr0-sighting-editor.mjs"])))=>i.map(i=>d[i]);
2
+ import{_ as w}from"./rr0-sighting-editor.mjs";class n{static MEMBERS={weather:["getWeather"],place:["attribution","search","reverse"],timeZone:["zoneAt"],narrative:["settings","draft"],assessment:["assess"],lightPollution:["year","citation","lookUp"],aircraft:["citation","between"],upperAir:["between"],elevation:["getElevationGrid"],imagery:["attribution","getImageryTexture"],surroundings:["id","name","attribution","creditUrl","contemporary","covers","getSurroundings"],decorModels:["attribution","entries","entry"],skyEvents:["key","messages","simulation"],interpretations:["key","messages","compute"],perception:["id","messages","sources","settings","perceive"],transcription:["sendsAudio","engine","transcribe"],reentryTypes:["key","nature","messages","template"]};static WEATHER_SHARES=["cloudCover","cloudDarkness","precipitationIntensity","highCloudCover","lowerCloudCover","iceCrystalAlignment","rareIceCrystals","relativeHumidity"];static WEATHER_REQUIRED=["cloudCover","cloudDarkness","precipitationIntensity"];static PRECIPITATIONS=["none","rain","snow","hail"];static HIGH_WIND_MS=60;static TIMEOUT_MS=3e4;static async check(i,a={}){const r=[];i.hasScript&&!i.scriptRun&&r.push({level:"note",code:"scriptNotRun"});for(const[t,s]of Object.entries(i.module.contributes))Object.hasOwn(n.MEMBERS,t)?Array.isArray(s)?await n.checkPoint(t,s,a,r):r.push({level:"failed",code:"notAList",point:t}):r.push({level:"failed",code:"unknownPoint",point:t});return r}static async checkPoint(i,a,r,t){const s=new Set;for(const e of a){const c=(l,d,g="failed")=>{t.push({level:g,code:l,point:i,source:typeof e?.id=="string"?e.id:void 0,detail:d})};if(s.has(e?.id)&&c("duplicateId"),s.add(e?.id),n.checkEntry(e,c),typeof e?.create!="function"){c("createMissing");continue}const o=n.build(e,c);if(o===void 0)continue;const h=n.MEMBERS[i].filter(l=>o[l]===void 0);for(const l of h)c("missingMember",l);h.length>0||(i==="weather"&&await n.checkWeather(e.id,o,r,c),i==="skyEvents"&&await n.checkSkyEventKind(e.id,o,r,c),i==="interpretations"&&await n.checkInterpretationKind(e.id,o,r,c))}}static checkEntry(i,a){for(const r of["id","name","credit","creditUrl"]){const t=i?.[r];(typeof t!="string"||t.trim()==="")&&a("entryField",r)}typeof i?.creditUrl=="string"&&i.creditUrl!==""&&!URL.canParse(i.creditUrl)&&a("entryField","creditUrl")}static build(i,a){let r=!1;const t=(async()=>(r=!0,new Response("",{status:503}))),s=globalThis.fetch;globalThis.fetch=t;try{const e=i.create(t);if(r&&a("createAsked"),e==null){a("createEmpty");return}return e}catch(e){a("createThrew",n.told(e));return}finally{globalThis.fetch=s}}static async checkWeather(i,a,r,t){const s=r.weatherQuery;if(!s){t("weatherNotAsked",void 0,"note");return}let e;try{e=await n.within(a.getWeather(s),r)}catch(l){t("weatherThrew",n.told(l));return}if(e===void 0){t("weatherNoRecord",void 0,"note");return}const c=e?.samples;if(!Array.isArray(c)||c.length!==s.points.length){t("weatherSamples",`${Array.isArray(c)?c.length:0}/${s.points.length}`);return}c.some((l,d)=>l?.time?.getTime?.()!==s.points[d].time.getTime())&&t("weatherOrder");const o=new Set;let h=!1;for(const l of c){const d=l?.weather??{};for(const g of n.WEATHER_SHARES){const u=d[g],p=n.WEATHER_REQUIRED.includes(g);(u!==void 0||p)&&!n.between(u,0,1)&&o.add(`${g} = ${String(u)}`)}n.between(d.windDirectionDeg,0,360)||o.add(`windDirectionDeg = ${String(d.windDirectionDeg)}`),n.between(d.windSpeed,0,1/0)?d.windSpeed>n.HIGH_WIND_MS&&(h=!0):o.add(`windSpeed = ${String(d.windSpeed)}`),n.PRECIPITATIONS.includes(d.precipitationType)||o.add(`precipitationType = ${String(d.precipitationType)}`),typeof d.storm!="boolean"&&o.add(`storm = ${String(d.storm)}`)}for(const l of o)t("weatherValue",l);h&&t("weatherWindHigh",void 0,"note"),e.source?.id!==i&&t("weatherSource","id"),(typeof e.source?.name!="string"||e.source.name==="")&&t("weatherSource","name"),(typeof e.source?.url!="string"||e.source.url==="")&&t("weatherSource","url")}static async checkSkyEventKind(i,a,r,t){a.key!==i&&t("kindKey",String(a.key)),await n.checkTexts(a.messages,["title","name"],r,t);let s;try{s=(await n.within(a.simulation(),r))()}catch(o){t("simulationFailed",n.told(o));return}const{MODULE_THREE:e}=await w(async()=>{const{MODULE_THREE:o}=await import("./ModuleThree-DRf9SEr_.js");return{MODULE_THREE:o}},__vite__mapDeps([0,1]),import.meta.url);if(!(s?.object instanceof e.Object3D)){t("secondThree");return}try{s.update([],0,n.frame(new e.Vector3)),s.drawnCount!==0&&t("drawnWithoutEvents",String(s.drawnCount))}catch(o){t("updateThrew",n.told(o))}const c=new e.Group;c.add(s.object);try{s.dispose(),s.object.parent===c&&t("disposeLeft")}catch(o){t("disposeThrew",n.told(o))}}static async checkInterpretationKind(i,a,r,t){a.key!==i&&t("kindKey",String(a.key)),await n.checkTexts(a.messages,["title"],r,t);const s=r.interpretation?.[a.key];if(!Array.isArray(s)||s.length===0){t("readingNotTried",void 0,"note");return}let e;try{if(e=await n.within(a.compute(),r),typeof e!="function"){t("readingThrew","compute");return}}catch(c){t("readingThrew",n.told(c));return}for(const c of s)try{const o=e(c);Array.isArray(o)||t("readingNotAList")}catch(o){t("readingThrew",n.told(o))}}static async checkTexts(i,a,r,t){for(const s of["en","fr"])try{const e=await n.within(i.load(s),r);for(const c of a)(typeof e?.[c]!="string"||e[c]==="")&&t("kindMessages",`${s}: ${c}`)}catch(e){t("kindMessages",`${s}: ${n.told(e)}`)}}static frame(i){return{reference:{lat:0,lng:0},origin:{x:0,z:0},eastScale:1,siteElevationM:0,eye:i,pixelRad:.001,relativeScale:1,air:{},transmittanceTo:()=>[1,1,1],groundYAt:()=>0,wind:{eastMS:0,northMS:0},observer:{lat:0,lng:0,heightM:0},date:new Date(0),magnitudeLimit:6,cloudTransmission:()=>1,arrivingIlluminance:()=>[0,0,0],transmittanceFromSpace:()=>[1,1,1],lightFrom:()=>{},glareFrom:()=>{}}}static between(i,a,r){return typeof i=="number"&&!Number.isNaN(i)&&i>=a&&i<=r}static told(i){return i instanceof Error?i.message:String(i)}static within(i,a){const r=a.timeoutMs??n.TIMEOUT_MS;let t;const s=new Promise((e,c)=>{t=setTimeout(()=>c(new Error(`> ${r/1e3} s`)),r)});return Promise.race([i,s]).finally(()=>clearTimeout(t))}}export{n as ModuleConformance};
@@ -1,3 +1,3 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ModuleThree-Fvr5G-Yh.js","./rr0-sighting-editor.mjs"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ModuleThree-DRf9SEr_.js","./rr0-sighting-editor.mjs"])))=>i.map(i=>d[i]);
2
2
  import{z as g,C as w,_ as b,M as p}from"./rr0-sighting-editor.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-Fvr5G-Yh.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-DRf9SEr_.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{V as a,bI as e,cU as s,b$ as t,c1 as r,ce as i,bT as o,Q as c,b_ as n,bq as b,cn as l,cf as d,D as u,cV as m,a_ as M,bd as B,aY as S,G as f,cE as G,cB as y,cF as h,aV as p,cS as x,bN as D,F as E,be as L,cW as T,cX as V,cY as g,bs as C,c0 as F,bb as P,bc as A,cZ as _,cd as v,bf as N}from"./rr0-sighting-editor.mjs";const Q={AdditiveBlending:N,BackSide:v,BoxGeometry:_,BufferAttribute:A,BufferGeometry:P,CanvasTexture:F,Color:C,ConeGeometry:g,CylinderGeometry:V,DataTexture:T,DoubleSide:L,Euler:E,Float32BufferAttribute:D,FrontSide:x,Group:p,Line:h,LineBasicMaterial:y,LineSegments:G,Matrix4:f,Mesh:S,MeshBasicMaterial:B,MeshStandardMaterial:M,NormalBlending:m,Object3D:u,PlaneGeometry:d,PointLight:l,Points:b,PointsMaterial:n,Quaternion:c,ShaderMaterial:o,SphereGeometry:i,Sprite:r,SpriteMaterial:t,TorusGeometry:s,Vector2:e,Vector3:a};export{Q as MODULE_THREE};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ModuleConformance-B6iFVb8X.js","./rr0-sighting-editor.mjs"])))=>i.map(i=>d[i]);
2
- import{n as N,_ as x,c as _,y as L,h as m}from"./rr0-sighting-editor.mjs";import{ModuleSession as C}from"./ModuleSession-jKFl1FMo.js";const P=N.catalog({en:()=>x(()=>import("./ModulesPanelMessages_en-DuwrY3Pm.js"),[],import.meta.url).then(b=>b.modulesPanelMessages_en),fr:()=>x(()=>import("./ModulesPanelMessages_fr-B8cSDc6o.js"),[],import.meta.url).then(b=>b.modulesPanelMessages_fr),es:()=>x(()=>import("./ModulesPanelMessages_es-Bq5X-XuT.js"),[],import.meta.url).then(b=>b.modulesPanelMessages_es),it:()=>x(()=>import("./ModulesPanelMessages_it-BdC626aJ.js"),[],import.meta.url).then(b=>b.modulesPanelMessages_it)}),y="rr0-modules-panel",A=`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ModuleConformance-DYi4XZdB.js","./rr0-sighting-editor.mjs"])))=>i.map(i=>d[i]);
2
+ import{n as N,_ as x,c as _,y as L,h as m}from"./rr0-sighting-editor.mjs";import{ModuleSession as C}from"./ModuleSession-BDbaoiCf.js";const P=N.catalog({en:()=>x(()=>import("./ModulesPanelMessages_en-DuwrY3Pm.js"),[],import.meta.url).then(b=>b.modulesPanelMessages_en),fr:()=>x(()=>import("./ModulesPanelMessages_fr-B8cSDc6o.js"),[],import.meta.url).then(b=>b.modulesPanelMessages_fr),es:()=>x(()=>import("./ModulesPanelMessages_es-Bq5X-XuT.js"),[],import.meta.url).then(b=>b.modulesPanelMessages_es),it:()=>x(()=>import("./ModulesPanelMessages_it-BdC626aJ.js"),[],import.meta.url).then(b=>b.modulesPanelMessages_it)}),y="rr0-modules-panel",A=`
3
3
  rr0-modules-panel { display: block; }
4
4
  rr0-modules-panel .mp-add { display: flex; gap: .4em; align-items: center; margin: .4em 0; }
5
5
  rr0-modules-panel .mp-add input { flex: 1 1 16em; min-width: 0; }
@@ -12,4 +12,4 @@ rr0-modules-panel .mp-head .mp-remove { margin-left: auto; }
12
12
  rr0-modules-panel .mp-module p { margin: .2em 0; }
13
13
  rr0-modules-panel .mp-findings { margin: .3em 0; padding-left: 1.2em; }
14
14
  rr0-modules-panel .mp-files { display: flex; gap: .6em; flex-wrap: wrap; align-items: center; margin-top: .6em; }
15
- `;class M extends HTMLElement{session=C.shared;messages;languageAsked=!1;named=[];recordingBase;note;languageToken=0;draft="";onChange=()=>this.render();checkContext;checks=new Map;set moduleSession(e){this.session.changes.removeEventListener("change",this.onChange),this.session=e,this.isConnected&&this.session.changes.addEventListener("change",this.onChange),this.render()}get recordingModules(){return[...this.named]}set recordingModules(e){this.named=[...e??[]],this.render()}set base(e){this.recordingBase=e,this.render()}async setLanguage(e){this.languageAsked=!0;const t=++this.languageToken,n=await P.load(e);t===this.languageToken&&(this.messages=n,this.render())}connectedCallback(){this.languageAsked||this.setLanguage(_.preferencesFor(this)[0]??"en"),this.session.changes.addEventListener("change",this.onChange),this.session.start(),this.render()}disconnectedCallback(){this.session.changes.removeEventListener("change",this.onChange)}absolute(e){try{return new URL(e,this.recordingBase??location.href).href}catch{return}}isNamed(e){return this.named.some(t=>this.absolute(t)===e)}setNamed(e,t){t!==this.isNamed(e)&&(this.named=t?[...this.named,L.of(e,this.recordingBase)]:this.named.filter(n=>this.absolute(n)!==e),t&&this.session.require([e]),this.dispatchEvent(new Event("recordingmoduleschange",{bubbles:!0})),this.render())}render(){const e=this.messages;if(!this.isConnected||!this.messages)return;const t=this.ownerDocument,n=t.createElement("style");n.textContent=A;const s=t.createElement("p");s.className=m.INFO,s.textContent=e.intro;const a=t.createElement("form");a.className="mp-add";const i=t.createElement("input");i.type="url",i.id="module-url",i.required=!0,i.placeholder=e.urlPlaceholder,i.value=this.draft,i.addEventListener("input",()=>{this.draft=i.value}),i.setAttribute("aria-label",e.urlPlaceholder);const u=t.createElement("button");u.type="submit",u.textContent=e.add,a.append(i,u),a.addEventListener("submit",r=>{r.preventDefault();const w=i.value.trim();w&&(this.draft="",this.session.add(w))});const l=t.createElement("p");l.className=m.WARNING,l.textContent=e.codeWarning;const c=this.session.list(),h=new Set(c.map(r=>r.url)),v=this.named.map(r=>this.absolute(r)).filter(r=>r!==void 0&&!h.has(r)),g=t.createElement("ul");g.className="mp-list",g.append(...c.map(r=>this.item(r)),...v.map(r=>this.item({url:r,addedByPerson:!1,enabled:!0,status:"loading"})));const k=t.createElement("p");k.className=m.INFO,k.textContent=e.none,k.hidden=g.childElementCount>0;const f=t.createElement("div");f.className="mp-files";const E=t.createElement("button");E.type="button",E.id="modules-export",E.textContent=e.exportConfig,E.disabled=!c.some(r=>r.addedByPerson),E.addEventListener("click",()=>this.download());const p=t.createElement("input");p.type="file",p.id="modules-import",p.accept="application/json,.json",p.hidden=!0;const o=t.createElement("button");o.type="button",o.textContent=e.importConfig,o.addEventListener("click",()=>p.click()),p.addEventListener("change",()=>{const r=p.files?.[0];r&&this.importFile(r),p.value=""}),f.append(E,o,p);const d=t.createElement("p");d.id="modules-note",d.setAttribute("role","status"),m.show(d,this.note?.text,this.note?.kind),this.replaceChildren(n,s,a,l,g,k,f,d)}item(e){const t=this.messages,n=this.ownerDocument,s=e.loaded,a=n.createElement("li");a.className="mp-module",a.dataset.url=e.url;const i=n.createElement("div");if(i.className="mp-head",e.addedByPerson){const o=n.createElement("label"),d=n.createElement("input");d.type="checkbox",d.className="mp-enabled",d.checked=e.enabled,d.addEventListener("change",()=>void this.session.setEnabled(e.url,d.checked)),o.append(d,n.createTextNode(` ${t.enabled}`)),i.append(o)}const u=n.createElement("span");u.className="mp-name",u.textContent=e.loaded?.module.name??e.url,i.append(u);const l=e.loaded?.module.credit;if(l){const o=n.createElement(e.loaded?.module.creditUrl?"a":"span");o.className=m.INFO,o.textContent=l,o instanceof HTMLAnchorElement&&(o.href=e.loaded.module.creditUrl,o.target="_blank",o.rel="noopener noreferrer"),i.append(o)}const c=n.createElement("button");if(c.type="button",c.className="mp-remove",e.addedByPerson?(c.textContent=t.remove,c.addEventListener("click",()=>void this.session.remove(e.url))):(c.textContent=t.addToMine,c.addEventListener("click",()=>void this.session.add(e.url))),e.status==="installed"&&s){const o=n.createElement("button");o.type="button",o.className="mp-check";const d=this.checks.get(e.url),r=d?.of===s&&d.findings===void 0&&d.crash===void 0;o.textContent=r?t.checking:t.check,o.disabled=r,o.addEventListener("click",()=>void this.check(e.url,s)),i.append(o)}i.append(c);const h=n.createElement("p");h.className=`${m.INFO} mp-url`,h.textContent=e.url;const v=n.createElement("p");v.className="mp-status",e.status==="loading"?m.show(v,t.loading):e.status==="failed"?m.show(v,t.failed.replace("{error}",e.error??""),"error"):e.status==="off"?m.show(v,t.off):m.show(v,this.brings(e));const g=n.createElement("p");g.className="mp-code",s?.scriptRun?m.show(g,t.runsCode,"warning"):s?.hasScript?m.show(g,t.codeNotRun,"info"):g.hidden=!0;const k=n.createElement("label");k.title=t.namedByRecordingHint;const f=n.createElement("input");f.type="checkbox",f.className="mp-named",f.checked=this.isNamed(e.url),f.addEventListener("change",()=>this.setNamed(e.url,f.checked)),k.append(f,n.createTextNode(` ${t.namedByRecording}`));const E=n.createElement("p");E.append(k),a.append(i,h,v,g,E);const p=this.checks.get(e.url);return p&&p.of===s&&a.append(...this.checkResult(p)),a}async check(e,t){const n={of:t};this.checks.set(e,n),this.render();try{const{ModuleConformance:s}=await x(async()=>{const{ModuleConformance:a}=await import("./ModuleConformance-B6iFVb8X.js");return{ModuleConformance:a}},__vite__mapDeps([0,1]),import.meta.url);n.findings=await s.check(t,this.checkContext?.())}catch(s){n.crash=s instanceof Error?s.message:String(s)}this.render()}checkResult(e){const t=this.messages,n=this.ownerDocument,s=(l,c)=>{const h=n.createElement("p");return h.className="mp-check-result",h.setAttribute("role","status"),m.show(h,l,c),h};if(e.crash!==void 0)return[s(t.checkCrashed.replace("{error}",()=>e.crash),"error")];if(!e.findings)return[];const a=e.findings.filter(l=>l.level==="failed"),i=e.findings.filter(l=>l.level==="note"),u=[];if(a.length===0&&u.push(s(t.checkPassed,"info")),a.length+i.length>0){const l=n.createElement("ul");l.className="mp-findings";for(const c of[...a,...i]){const h=n.createElement("li");m.show(h,this.finding(c),c.level==="failed"?"error":"info"),l.append(h)}u.push(l)}return u}finding(e){const t=this.messages,n=e.point===void 0?"":t.points[e.point]??e.point,s=t.checks[e.code].replace("{point}",()=>e.point??"").replace("{detail}",()=>e.detail??""),a=e.source??(e.code==="unknownPoint"||e.code==="notAList"?void 0:n);return a?t.checkAbout.replace("{about}",()=>a).replace("{text}",()=>s):s}brings(e){const t=Object.entries(e.loaded?.module.contributes??{}).filter(([,n])=>Array.isArray(n)&&n.length>0).map(([n,s])=>`${this.messages.points[n]??n} (${s.length})`);return t.length>0?this.messages.brings.replace("{points}",t.join(", ")):this.messages.bringsNothing}download(){const e=new Blob([this.session.exportText()],{type:"application/json"}),t=URL.createObjectURL(e),n=this.ownerDocument.createElement("a");n.href=t,n.download="ufoathome-modules.json",n.click(),URL.revokeObjectURL(t)}async importFile(e){try{await this.session.importText(await e.text());const t=this.session.list().filter(n=>n.addedByPerson).length;this.note={text:this.messages.imported.replace("{count}",String(t)),kind:"info"}}catch(t){this.note={text:this.messages.importFailed.replace("{error}",t instanceof Error?t.message:String(t)),kind:"error"}}this.render()}}function B(){customElements.get(y)||customElements.define(y,M)}export{y as MODULES_PANEL_ELEMENT_NAME,M as ModulesPanelElement,B as register};
15
+ `;class M extends HTMLElement{session=C.shared;messages;languageAsked=!1;named=[];recordingBase;note;languageToken=0;draft="";onChange=()=>this.render();checkContext;checks=new Map;set moduleSession(e){this.session.changes.removeEventListener("change",this.onChange),this.session=e,this.isConnected&&this.session.changes.addEventListener("change",this.onChange),this.render()}get recordingModules(){return[...this.named]}set recordingModules(e){this.named=[...e??[]],this.render()}set base(e){this.recordingBase=e,this.render()}async setLanguage(e){this.languageAsked=!0;const t=++this.languageToken,n=await P.load(e);t===this.languageToken&&(this.messages=n,this.render())}connectedCallback(){this.languageAsked||this.setLanguage(_.preferencesFor(this)[0]??"en"),this.session.changes.addEventListener("change",this.onChange),this.session.start(),this.render()}disconnectedCallback(){this.session.changes.removeEventListener("change",this.onChange)}absolute(e){try{return new URL(e,this.recordingBase??location.href).href}catch{return}}isNamed(e){return this.named.some(t=>this.absolute(t)===e)}setNamed(e,t){t!==this.isNamed(e)&&(this.named=t?[...this.named,L.of(e,this.recordingBase)]:this.named.filter(n=>this.absolute(n)!==e),t&&this.session.require([e]),this.dispatchEvent(new Event("recordingmoduleschange",{bubbles:!0})),this.render())}render(){const e=this.messages;if(!this.isConnected||!this.messages)return;const t=this.ownerDocument,n=t.createElement("style");n.textContent=A;const s=t.createElement("p");s.className=m.INFO,s.textContent=e.intro;const a=t.createElement("form");a.className="mp-add";const i=t.createElement("input");i.type="url",i.id="module-url",i.required=!0,i.placeholder=e.urlPlaceholder,i.value=this.draft,i.addEventListener("input",()=>{this.draft=i.value}),i.setAttribute("aria-label",e.urlPlaceholder);const u=t.createElement("button");u.type="submit",u.textContent=e.add,a.append(i,u),a.addEventListener("submit",r=>{r.preventDefault();const w=i.value.trim();w&&(this.draft="",this.session.add(w))});const l=t.createElement("p");l.className=m.WARNING,l.textContent=e.codeWarning;const c=this.session.list(),h=new Set(c.map(r=>r.url)),v=this.named.map(r=>this.absolute(r)).filter(r=>r!==void 0&&!h.has(r)),g=t.createElement("ul");g.className="mp-list",g.append(...c.map(r=>this.item(r)),...v.map(r=>this.item({url:r,addedByPerson:!1,enabled:!0,status:"loading"})));const k=t.createElement("p");k.className=m.INFO,k.textContent=e.none,k.hidden=g.childElementCount>0;const f=t.createElement("div");f.className="mp-files";const E=t.createElement("button");E.type="button",E.id="modules-export",E.textContent=e.exportConfig,E.disabled=!c.some(r=>r.addedByPerson),E.addEventListener("click",()=>this.download());const p=t.createElement("input");p.type="file",p.id="modules-import",p.accept="application/json,.json",p.hidden=!0;const o=t.createElement("button");o.type="button",o.textContent=e.importConfig,o.addEventListener("click",()=>p.click()),p.addEventListener("change",()=>{const r=p.files?.[0];r&&this.importFile(r),p.value=""}),f.append(E,o,p);const d=t.createElement("p");d.id="modules-note",d.setAttribute("role","status"),m.show(d,this.note?.text,this.note?.kind),this.replaceChildren(n,s,a,l,g,k,f,d)}item(e){const t=this.messages,n=this.ownerDocument,s=e.loaded,a=n.createElement("li");a.className="mp-module",a.dataset.url=e.url;const i=n.createElement("div");if(i.className="mp-head",e.addedByPerson){const o=n.createElement("label"),d=n.createElement("input");d.type="checkbox",d.className="mp-enabled",d.checked=e.enabled,d.addEventListener("change",()=>void this.session.setEnabled(e.url,d.checked)),o.append(d,n.createTextNode(` ${t.enabled}`)),i.append(o)}const u=n.createElement("span");u.className="mp-name",u.textContent=e.loaded?.module.name??e.url,i.append(u);const l=e.loaded?.module.credit;if(l){const o=n.createElement(e.loaded?.module.creditUrl?"a":"span");o.className=m.INFO,o.textContent=l,o instanceof HTMLAnchorElement&&(o.href=e.loaded.module.creditUrl,o.target="_blank",o.rel="noopener noreferrer"),i.append(o)}const c=n.createElement("button");if(c.type="button",c.className="mp-remove",e.addedByPerson?(c.textContent=t.remove,c.addEventListener("click",()=>void this.session.remove(e.url))):(c.textContent=t.addToMine,c.addEventListener("click",()=>void this.session.add(e.url))),e.status==="installed"&&s){const o=n.createElement("button");o.type="button",o.className="mp-check";const d=this.checks.get(e.url),r=d?.of===s&&d.findings===void 0&&d.crash===void 0;o.textContent=r?t.checking:t.check,o.disabled=r,o.addEventListener("click",()=>void this.check(e.url,s)),i.append(o)}i.append(c);const h=n.createElement("p");h.className=`${m.INFO} mp-url`,h.textContent=e.url;const v=n.createElement("p");v.className="mp-status",e.status==="loading"?m.show(v,t.loading):e.status==="failed"?m.show(v,t.failed.replace("{error}",e.error??""),"error"):e.status==="off"?m.show(v,t.off):m.show(v,this.brings(e));const g=n.createElement("p");g.className="mp-code",s?.scriptRun?m.show(g,t.runsCode,"warning"):s?.hasScript?m.show(g,t.codeNotRun,"info"):g.hidden=!0;const k=n.createElement("label");k.title=t.namedByRecordingHint;const f=n.createElement("input");f.type="checkbox",f.className="mp-named",f.checked=this.isNamed(e.url),f.addEventListener("change",()=>this.setNamed(e.url,f.checked)),k.append(f,n.createTextNode(` ${t.namedByRecording}`));const E=n.createElement("p");E.append(k),a.append(i,h,v,g,E);const p=this.checks.get(e.url);return p&&p.of===s&&a.append(...this.checkResult(p)),a}async check(e,t){const n={of:t};this.checks.set(e,n),this.render();try{const{ModuleConformance:s}=await x(async()=>{const{ModuleConformance:a}=await import("./ModuleConformance-DYi4XZdB.js");return{ModuleConformance:a}},__vite__mapDeps([0,1]),import.meta.url);n.findings=await s.check(t,this.checkContext?.())}catch(s){n.crash=s instanceof Error?s.message:String(s)}this.render()}checkResult(e){const t=this.messages,n=this.ownerDocument,s=(l,c)=>{const h=n.createElement("p");return h.className="mp-check-result",h.setAttribute("role","status"),m.show(h,l,c),h};if(e.crash!==void 0)return[s(t.checkCrashed.replace("{error}",()=>e.crash),"error")];if(!e.findings)return[];const a=e.findings.filter(l=>l.level==="failed"),i=e.findings.filter(l=>l.level==="note"),u=[];if(a.length===0&&u.push(s(t.checkPassed,"info")),a.length+i.length>0){const l=n.createElement("ul");l.className="mp-findings";for(const c of[...a,...i]){const h=n.createElement("li");m.show(h,this.finding(c),c.level==="failed"?"error":"info"),l.append(h)}u.push(l)}return u}finding(e){const t=this.messages,n=e.point===void 0?"":t.points[e.point]??e.point,s=t.checks[e.code].replace("{point}",()=>e.point??"").replace("{detail}",()=>e.detail??""),a=e.source??(e.code==="unknownPoint"||e.code==="notAList"?void 0:n);return a?t.checkAbout.replace("{about}",()=>a).replace("{text}",()=>s):s}brings(e){const t=Object.entries(e.loaded?.module.contributes??{}).filter(([,n])=>Array.isArray(n)&&n.length>0).map(([n,s])=>`${this.messages.points[n]??n} (${s.length})`);return t.length>0?this.messages.brings.replace("{points}",t.join(", ")):this.messages.bringsNothing}download(){const e=new Blob([this.session.exportText()],{type:"application/json"}),t=URL.createObjectURL(e),n=this.ownerDocument.createElement("a");n.href=t,n.download="ufoathome-modules.json",n.click(),URL.revokeObjectURL(t)}async importFile(e){try{await this.session.importText(await e.text());const t=this.session.list().filter(n=>n.addedByPerson).length;this.note={text:this.messages.imported.replace("{count}",String(t)),kind:"info"}}catch(t){this.note={text:this.messages.importFailed.replace("{error}",t instanceof Error?t.message:String(t)),kind:"error"}}this.render()}}function B(){customElements.get(y)||customElements.define(y,M)}export{y as MODULES_PANEL_ELEMENT_NAME,M as ModulesPanelElement,B as register};
@@ -1 +1 @@
1
- import{bB as b,B as h}from"./rr0-sighting-editor.mjs";class c{static FLAT={heightAt:()=>0};static of(e){const s=e.timeline.sourceIds.map(n=>b.of(e,n)?.nearestM).filter(n=>n!==void 0);return s.length>0?{m:Math.min(...s),basis:"derived",paths:["timeline","observerTrack"]}:c.interpreted(e)}static interpreted(e){const s=(e.interpretation?.bodies??[]).map((t,i)=>({body:t,index:i})).filter(({body:t})=>Array.isArray(t.track)),n=s.filter(({body:t})=>(t.explains?.length??0)>0),u=n.length>0?n:s,d=c.FLAT,l=t=>h.eyeOf(e,t,d);let o;const p=[];for(const{body:t,index:i}of u){const M=new h(t,d,l);for(const{t:f}of t.track){const r=M.at(f),a=l(f);if(!r||!a)continue;const m=Math.hypot(r.eastM-a.eastM,r.northM-a.northM,r.upM-a.upM);(o===void 0||m<o)&&(o=m)}p.push(`interpretation.bodies.${i}`)}return o===void 0?void 0:{m:o,basis:"assumed",paths:p}}}export{c as N};
1
+ import{bC as b,B as h}from"./rr0-sighting-editor.mjs";class c{static FLAT={heightAt:()=>0};static of(e){const s=e.timeline.sourceIds.map(n=>b.of(e,n)?.nearestM).filter(n=>n!==void 0);return s.length>0?{m:Math.min(...s),basis:"derived",paths:["timeline","observerTrack"]}:c.interpreted(e)}static interpreted(e){const s=(e.interpretation?.bodies??[]).map((t,i)=>({body:t,index:i})).filter(({body:t})=>Array.isArray(t.track)),n=s.filter(({body:t})=>(t.explains?.length??0)>0),u=n.length>0?n:s,d=c.FLAT,l=t=>h.eyeOf(e,t,d);let o;const p=[];for(const{body:t,index:i}of u){const M=new h(t,d,l);for(const{t:f}of t.track){const r=M.at(f),a=l(f);if(!r||!a)continue;const m=Math.hypot(r.eastM-a.eastM,r.northM-a.northM,r.upM-a.upM);(o===void 0||m<o)&&(o=m)}p.push(`interpretation.bodies.${i}`)}return o===void 0?void 0:{m:o,basis:"assumed",paths:p}}}export{c as N};
@@ -1 +1 @@
1
- import{bD as u}from"./rr0-sighting-editor.mjs";class o{about="shape";static STEP_DEG=2;static TURN_DEG=60;static ERRATIC_TURNS=3;static OSCILLATIONS=["vibrate","spiral","roll"];async assess(n){const t=this.trajectory(n),s=this.vanish(n),e=this.oscillation(n),a=this.landing(n),c=this.judged(n,"traces"),r=this.occupants(n),h=a.shown&&r.shown?5:a.shown&&c.shown?4:a.shown||t.value==="erratic"||s.shown||e.shown?3:t.value==="abnormal"?2:t.value==="straight"?1:0,i=[{id:"poher-trajectory",basis:t.basis,paths:t.paths,value:o.TRAJECTORIES.indexOf(t.value)},this.criterion("poher-vanish",s),this.criterion("poher-oscillation",e),{...this.criterion("poher-landing",a),unsupported:a.basis===void 0},this.criterion("poher-traces",c),this.criterion("poher-occupants",r)];return{verdict:String(h),criteria:i}}static TRAJECTORIES=["unknown","still","straight","abnormal","erratic"];criterion(n,t){return{id:n,value:t.shown?1:0,basis:t.basis,paths:t.basis===void 0?[]:t.paths}}trajectory(n){let t="unknown";for(const s of n.timeline.sourceIds){const e=this.seen(n,s).filter(i=>i.aim!==void 0).map(i=>i.aim);if(e.length<2)continue;const a=[o.unit(e[0])];for(const i of e.slice(1)){const l=o.unit(i);o.angleDeg(a[a.length-1],l)>=o.STEP_DEG&&a.push(l)}const c=a.length-1;let r=0;for(let i=1;i<a.length-1;i++){const l=o.cross(a[i-1],a[i]),d=o.cross(a[i],a[i+1]);o.angleDeg(l,d)>=o.TURN_DEG&&r++}const h=c===0?"still":r>=o.ERRATIC_TURNS?"erratic":r>0?"abnormal":"straight";o.TRAJECTORIES.indexOf(h)>o.TRAJECTORIES.indexOf(t)&&(t=h)}return t==="unknown"?{value:t,paths:[]}:{value:t,basis:"derived",paths:["timeline"]}}vanish(n){const t=(n.events??[]).findIndex(s=>s.eventType==="vanish"&&u.isPhenomenon(n,s));return t>=0?{shown:!0,basis:"stated",paths:[`events.${t}`]}:{shown:!1,paths:[]}}oscillation(n){const t=new Set((n.interpretation?.bodies??[]).map(e=>e.id)),s=(n.events??[]).findIndex(e=>o.OSCILLATIONS.includes(e.eventType)&&(u.isPhenomenon(n,e)||t.has(e.who?.split("/")[0]??"")));return s>=0?{shown:!0,basis:"stated",paths:[`events.${s}`]}:{shown:!1,paths:[]}}landing(n){const t=e=>!e.onGround&&((e.altitudeAboveGroundM??0)>0||(e.altitudeM??0)>0),s=(n.interpretation?.bodies??[]).findIndex(e=>Array.isArray(e.track)&&e.track.some(a=>a.onGround)&&e.track.some(t));return s>=0?{shown:!0,basis:"assumed",paths:[`interpretation.bodies.${s}`]}:{shown:!1,paths:[]}}occupants(n){const t=n.decor.findIndex(s=>s.kind==="entity");return t>=0?{shown:!0,basis:"stated",paths:[`decor.${t}`]}:this.judged(n,"beings")}judged(n,t){const s=n.account?.strangeness?.[t];return s===void 0?{shown:!1,paths:[]}:{shown:s,basis:"stated",paths:[`account.strangeness.${t}`]}}instants(n,t){return n.timeline.allKeyframes.map(s=>({t:s.t,shape:s.shapes.find(e=>e.sourceId===t)?.shape})).filter(({shape:s})=>s!==void 0).map(({t:s,shape:e})=>({t:s,aim:e.aim,visible:e.transparency<1})).sort((s,e)=>s.t-e.t)}seen(n,t){return this.instants(n,t).filter(s=>s.visible)}static unit(n){const[t,s]=[n.azimuthDeg*Math.PI/180,n.altitudeDeg*Math.PI/180];return[Math.cos(s)*Math.sin(t),Math.cos(s)*Math.cos(t),Math.sin(s)]}static cross(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}static angleDeg(n,t){const s=Math.hypot(...n)*Math.hypot(...t);if(s===0)return 0;const e=(n[0]*t[0]+n[1]*t[1]+n[2]*t[2])/s;return Math.acos(Math.max(-1,Math.min(1,e)))*180/Math.PI}}export{o as PoherAssessor};
1
+ import{bE as u}from"./rr0-sighting-editor.mjs";class o{about="shape";static STEP_DEG=2;static TURN_DEG=60;static ERRATIC_TURNS=3;static OSCILLATIONS=["vibrate","spiral","roll"];async assess(n){const t=this.trajectory(n),s=this.vanish(n),e=this.oscillation(n),a=this.landing(n),c=this.judged(n,"traces"),r=this.occupants(n),h=a.shown&&r.shown?5:a.shown&&c.shown?4:a.shown||t.value==="erratic"||s.shown||e.shown?3:t.value==="abnormal"?2:t.value==="straight"?1:0,i=[{id:"poher-trajectory",basis:t.basis,paths:t.paths,value:o.TRAJECTORIES.indexOf(t.value)},this.criterion("poher-vanish",s),this.criterion("poher-oscillation",e),{...this.criterion("poher-landing",a),unsupported:a.basis===void 0},this.criterion("poher-traces",c),this.criterion("poher-occupants",r)];return{verdict:String(h),criteria:i}}static TRAJECTORIES=["unknown","still","straight","abnormal","erratic"];criterion(n,t){return{id:n,value:t.shown?1:0,basis:t.basis,paths:t.basis===void 0?[]:t.paths}}trajectory(n){let t="unknown";for(const s of n.timeline.sourceIds){const e=this.seen(n,s).filter(i=>i.aim!==void 0).map(i=>i.aim);if(e.length<2)continue;const a=[o.unit(e[0])];for(const i of e.slice(1)){const l=o.unit(i);o.angleDeg(a[a.length-1],l)>=o.STEP_DEG&&a.push(l)}const c=a.length-1;let r=0;for(let i=1;i<a.length-1;i++){const l=o.cross(a[i-1],a[i]),d=o.cross(a[i],a[i+1]);o.angleDeg(l,d)>=o.TURN_DEG&&r++}const h=c===0?"still":r>=o.ERRATIC_TURNS?"erratic":r>0?"abnormal":"straight";o.TRAJECTORIES.indexOf(h)>o.TRAJECTORIES.indexOf(t)&&(t=h)}return t==="unknown"?{value:t,paths:[]}:{value:t,basis:"derived",paths:["timeline"]}}vanish(n){const t=(n.events??[]).findIndex(s=>s.eventType==="vanish"&&u.isPhenomenon(n,s));return t>=0?{shown:!0,basis:"stated",paths:[`events.${t}`]}:{shown:!1,paths:[]}}oscillation(n){const t=new Set((n.interpretation?.bodies??[]).map(e=>e.id)),s=(n.events??[]).findIndex(e=>o.OSCILLATIONS.includes(e.eventType)&&(u.isPhenomenon(n,e)||t.has(e.who?.split("/")[0]??"")));return s>=0?{shown:!0,basis:"stated",paths:[`events.${s}`]}:{shown:!1,paths:[]}}landing(n){const t=e=>!e.onGround&&((e.altitudeAboveGroundM??0)>0||(e.altitudeM??0)>0),s=(n.interpretation?.bodies??[]).findIndex(e=>Array.isArray(e.track)&&e.track.some(a=>a.onGround)&&e.track.some(t));return s>=0?{shown:!0,basis:"assumed",paths:[`interpretation.bodies.${s}`]}:{shown:!1,paths:[]}}occupants(n){const t=n.decor.findIndex(s=>s.kind==="entity");return t>=0?{shown:!0,basis:"stated",paths:[`decor.${t}`]}:this.judged(n,"beings")}judged(n,t){const s=n.account?.strangeness?.[t];return s===void 0?{shown:!1,paths:[]}:{shown:s,basis:"stated",paths:[`account.strangeness.${t}`]}}instants(n,t){return n.timeline.allKeyframes.map(s=>({t:s.t,shape:s.shapes.find(e=>e.sourceId===t)?.shape})).filter(({shape:s})=>s!==void 0).map(({t:s,shape:e})=>({t:s,aim:e.aim,visible:e.transparency<1})).sort((s,e)=>s.t-e.t)}seen(n,t){return this.instants(n,t).filter(s=>s.visible)}static unit(n){const[t,s]=[n.azimuthDeg*Math.PI/180,n.altitudeDeg*Math.PI/180];return[Math.cos(s)*Math.sin(t),Math.cos(s)*Math.cos(t),Math.sin(s)]}static cross(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}static angleDeg(n,t){const s=Math.hypot(...n)*Math.hypot(...t);if(s===0)return 0;const e=(n[0]*t[0]+n[1]*t[1]+n[2]*t[2])/s;return Math.acos(Math.max(-1,Math.min(1,e)))*180/Math.PI}}export{o as PoherAssessor};
@@ -1,4 +1,4 @@
1
- import{aU as F,aZ as P,br as H,m as K,ba as w,bb as N,aX as U,bN as k}from"./rr0-sighting-editor.mjs";class D{static HOLLOW_M=1;static COVERED_M=3;static WINDOW_M=30;static SAMPLE_M=4;static MAX_GRADE={rail:.025,highSpeed:.035,subway:.04,light_rail:.06,tram:.08,funicular:1/0};static heights(t,s,e){const n=t.map(a=>a.level===0),o=t.map((a,i)=>n[i]?D.targets(a,s,e):[]),c=t.map((a,i)=>n[i]?D.samples(a,o[i]):[]),r=new Map;t.forEach((a,i)=>{if(n[i])for(const h of D.ends(a)){const u=D.key(h),p=r.get(u);p?p.push(i):r.set(u,[i])}});const M=a=>{const i=r.get(D.key(a));if(i)return D.median(i.flatMap(h=>c[h]),a)};return t.map((a,i)=>{if(n[i]){const h=[...new Set([i,...D.ends(a).flatMap(d=>r.get(D.key(d))??[])])].flatMap(d=>c[d]),u=a.centre.map((d,O)=>D.median(h,d)??o[i][O]),[p,A]=D.ends(a);return u[0]=M(p)??u[0],u[u.length-1]=M(A)??u[u.length-1],D.graded(u,a.along,a.highSpeed?D.MAX_GRADE.highSpeed:D.MAX_GRADE[a.kind])}return D.carried(a,s,e,M)})}static targets(t,s,e){return t.centre.map(n=>{const o=s(n.x,n.z);if(e===void 0||n.altitudeM===void 0)return o;const c=n.altitudeM+e;return c-o>D.HOLLOW_M||o-c>D.COVERED_M?c:o})}static samples(t,s){const e=[];let n=0;return t.centre.forEach((o,c)=>{t.along[c]+1e-6<n&&c<t.centre.length-1||(e.push({x:o.x,z:o.z,y:s[c]}),n=t.along[c]+D.SAMPLE_M)}),e}static median(t,s){const e=[];for(const o of t)Math.hypot(o.x-s.x,o.z-s.z)<=D.WINDOW_M&&e.push(o.y);if(e.length===0)return;e.sort((o,c)=>o-c);const n=e.length>>1;return e.length%2===1?e[n]:(e[n-1]+e[n])/2}static graded(t,s,e){if(!Number.isFinite(e)||t.length<3)return t;const n=[...t],o=n.length-1,c=s[o];if(Math.abs(n[o]-n[0])>e*c)return s.map(r=>n[0]+(n[o]-n[0])*r/c);for(let r=1;r<o;r++){const M=e*(s[r]-s[r-1]);n[r]=Math.min(n[r-1]+M,Math.max(n[r-1]-M,n[r]))}for(let r=o-1;r>0;r--){const M=e*(s[r+1]-s[r]);n[r]=Math.min(n[r+1]+M,Math.max(n[r+1]-M,n[r]))}return n}static carried(t,s,e,n){const[o,c]=D.ends(t),r=t.along[t.along.length-1],M=n(o),a=n(c);if(e!==void 0&&t.centre.every(u=>u.altitudeM!==void 0)){const u=t.centre.map(d=>d.altitudeM+e),p=M!==void 0?M-u[0]:0,A=a!==void 0?a-u[u.length-1]:0;return u.map((d,O)=>d+p+(A-p)*t.along[O]/r)}const i=M??s(o.x,o.z),h=a??s(c.x,c.z);return t.along.map(u=>i+(h-i)*u/r)}static ends(t){return[t.centre[0],t.centre[t.centre.length-1]]}static key(t){return`${Math.round(t.x*2)},${Math.round(t.z*2)}`}}class B{positions=[];indices=[];along=[];get vertexCount(){return this.positions.length/3}strip(t,s,e){const n=this.vertexCount;for(let o=0;o<t.length;o++)this.positions.push(t[o].x,t[o].y,t[o].z,s[o].x,s[o].y,s[o].z),e&&this.along.push(e[o],e[o]);for(let o=0;o<t.length-1;o++){const c=n+o*2;this.indices.push(c,c+2,c+1,c+1,c+2,c+3)}}beam(t,s,e,n=!0){const o=s.x-t.x,c=s.y-t.y,r=s.z-t.z,M=Math.hypot(o,c,r);if(M<1e-6)return;const a={x:o/M,y:c/M,z:r/M},i=Math.abs(a.y)>.9?{x:1,y:0,z:0}:{x:0,y:1,z:0},h=a.y*i.z-a.z*i.y,u=a.z*i.x-a.x*i.z,p=a.x*i.y-a.y*i.x,A=Math.hypot(h,u,p),d={x:h/A*e/2,y:u/A*e/2,z:p/A*e/2},O={x:a.y*d.z-a.z*d.y,y:a.z*d.x-a.x*d.z,z:a.x*d.y-a.y*d.x},g=(f,x,E)=>({x:f.x+d.x*x+O.x*E,y:f.y+d.y*x+O.y*E,z:f.z+d.z*x+O.z*E}),_=[[1,1],[-1,1],[-1,-1],[1,-1]];for(let f=0;f<4;f++){const[x,E]=_[f],[z,v]=_[(f+1)%4];this.quad(g(t,x,E),g(t,z,v),g(s,z,v),g(s,x,E))}n&&(this.quad(...[..._].reverse().map(([f,x])=>g(t,f,x))),this.quad(..._.map(([f,x])=>g(s,f,x))))}quad(t,s,e,n){const o=this.vertexCount;this.positions.push(t.x,t.y,t.z,s.x,s.y,s.z,e.x,e.y,e.z,n.x,n.y,n.z),this.indices.push(o,o+1,o+2,o,o+2,o+3)}}class l{static STEP_M=6;static BALLAST_HEIGHT_M=.5;static BALLAST_SLOPE=1.5;static BALLAST_SHOULDER_M=.45;static DECK_DEPTH_M=.8;static BANK_SLOPE=1.5;static SLEEPER_LENGTH_M=2.4;static SLEEPER_WIDTH_M=.29;static SLEEPER_SPACING_M=.6;static RAIL_HEAD_M=.072;static RAIL_HEIGHT_M=.18;static TRAM_RAIL_HEIGHT_M=.03;static LIFT_M=.06;static CATENARY={rail:{contactM:5.5,systemM:1.4,spanM:54,staggerM:.2},highSpeed:{contactM:5.08,systemM:1.4,spanM:63,staggerM:.2},service:{contactM:5.5,systemM:1.2,spanM:45,staggerM:.2},tram:{contactM:6,systemM:0,spanM:30,staggerM:.2}};static MESSENGER_SAG_M=.55;static MAST_SIDE_M=.26;static MAST_OFFSET_M=3.1;static MAST_ABOVE_M=.6;static CONTACT_DIAMETER_M=.012;static MESSENGER_DIAMETER_M=.011;static ARM_SIDE_M=.06;static TRACK_SPACING_M={rail:3.7,highSpeed:4.5,tram:3.1,subway:3.4,light_rail:3.4,funicular:3.2};static BALLAST_ALBEDO=[.17,.16,.15];static BANK_ALBEDO=[.085,.09,.05];static DECK_ALBEDO=[.26,.255,.24];static CONCRETE_ALBEDO=[.36,.35,.33];static WOOD_ALBEDO=[.07,.055,.045];static RUST_ALBEDO=[.085,.068,.058];static STEEL_ALBEDO=[.3,.31,.32];static COPPER_ALBEDO=[.09,.085,.07];static LINE_REACH_M=20;group=new F;stepM=l.STEP_M;drawn=0;laid=[];ballastMaterial=l.pebbled(l.lambert(l.BALLAST_ALBEDO,!0));earthMaterial=l.lambert(l.BANK_ALBEDO,!0);deckMaterial=l.lambert(l.DECK_ALBEDO,!1);concreteSleepers=l.sleeperMaterial(l.CONCRETE_ALBEDO);woodSleepers=l.sleeperMaterial(l.WOOD_ALBEDO);rustMaterial=l.lambert(l.RUST_ALBEDO,!0);headMaterial=new P({color:new H(.62,.62,.62),metalness:1,roughness:.28,polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2});steelMaterial=l.lambert(l.STEEL_ALBEDO,!1);wireMaterial=l.lambert(l.COPPER_ALBEDO,!1);constructor(){this.group.name="railways"}get count(){return this.drawn}setGroundSpacing(t){this.stepM=Number.isFinite(t)&&t>0?Math.min(l.STEP_M,Math.max(1.5,t/2)):l.STEP_M}set(t,s,e,n,o=1/0){this.clear();const r=t.map(p=>({line:p,path:p.points.map(A=>({...K(A.lat,A.lng,s,e),altitudeM:A.altitudeM}))})).filter(({line:p,path:A})=>p.level>=0&&l.within(A,o)),M=l.altitudeOffset(r,n),a=r.flatMap(({line:p,path:A})=>{const d=this.layoutOf(p,A);return d?[{line:p,layout:d}]:[]}),i=D.heights(a.map(({layout:p})=>p),n,M),h={ballast:new B,earth:new B,deck:new B,concrete:new B,wood:new B,rust:new B,head:new B,steel:new B,wire:new B};a.forEach(({line:p,layout:A},d)=>{this.lay(p,{...A,y:i[d]},n,h),this.laid.push({line:p,centre:A.centre}),this.drawn++});const u=[[h.ballast,this.ballastMaterial,"ballast",!1],[h.earth,this.earthMaterial,"embankments",!1],[h.deck,this.deckMaterial,"decks",!0],[h.concrete,this.concreteSleepers,"sleepers",!1],[h.wood,this.woodSleepers,"sleepers wood",!1],[h.rust,this.rustMaterial,"rails",!1],[h.head,this.headMaterial,"rail heads",!1],[h.steel,this.steelMaterial,"catenary masts",!0],[h.wire,this.wireMaterial,"catenary wires",!1]];for(const[p,A,d,O]of u){const g=l.meshOf(p,A);g&&(g.name=`railways ${d}`,g.castShadow=O,g.receiveShadow=!0,this.group.add(g))}}clear(){for(const t of[...this.group.children])this.group.remove(t),t.geometry?.dispose();this.drawn=0,this.laid=[]}lineAt(t,s){let e;for(const{line:n,centre:o}of this.laid)for(let c=0;c<o.length-1;c++){const r=o[c],M=o[c+1],a=M.x-r.x,i=M.z-r.z,h=a*a+i*i,u=h===0?0:Math.max(0,Math.min(1,((t-r.x)*a+(s-r.z)*i)/h)),p=Math.hypot(t-(r.x+a*u),s-(r.z+i*u));p<=l.LINE_REACH_M&&(!e||p<e.distance)&&(e={line:n,distance:p})}return e?.line}mayMeet(t,s,e,n){const o=Math.hypot(s.x,s.z);if(o<1e-6)return this.lineAt(t.x,t.z)!==void 0;const c=s.x/o,r=s.z/o,M=l.LINE_REACH_M;for(const{centre:a}of this.laid)for(let i=0;i<a.length-1;i++){const h=a[i],u=a[i+1];for(const p of[0,.5,1]){const A=h.x+(u.x-h.x)*p,d=h.z+(u.z-h.z)*p,O=(A-t.x)*c+(d-t.z)*r;if(O<0)continue;const g=Math.abs((A-t.x)*r-(d-t.z)*c),_=Math.hypot(u.x-h.x,u.z-h.z)/2;if(g>M+_)continue;if(t.y+s.y*(O/o)<=e(A,d)+n)return!0}}return!1}contactHeightM(t){if(!(t.electrification!=="overhead"||t.kind==="subway"||t.kind==="funicular"))return l.catenaryOf(t).contactM}static catenaryOf(t){return t.kind==="tram"?l.CATENARY.tram:t.highSpeed?l.CATENARY.highSpeed:t.service?l.CATENARY.service:l.CATENARY.rail}dispose(){this.clear();for(const t of[this.ballastMaterial,this.earthMaterial,this.deckMaterial,this.concreteSleepers,this.woodSleepers,this.rustMaterial,this.headMaterial,this.steelMaterial,this.wireMaterial])t.dispose()}static within(t,s){if(!Number.isFinite(s))return!0;const e=s*1.1+100;return t.some((n,o)=>Math.hypot(n.x,n.z)<=e||o>0&&Math.hypot((n.x+t[o-1].x)/2,(n.z+t[o-1].z)/2)<=e)}static altitudeOffset(t,s){const e=[];for(const{line:n,path:o}of t)if(n.level===0)for(const c of o)c.altitudeM!==void 0&&e.push(s(c.x,c.z)-c.altitudeM);if(!(e.length<5))return e.sort((n,o)=>n-o),e[Math.floor(e.length/2)]}layoutOf(t,s){const e=[];for(let c=0;c<s.length-1;c++){const r=s[c],M=s[c+1],a=Math.max(1,Math.ceil(Math.hypot(M.x-r.x,M.z-r.z)/this.stepM));for(let i=0;i<a;i++){const h=i/a,u=r.altitudeM!==void 0&&M.altitudeM!==void 0?r.altitudeM+(M.altitudeM-r.altitudeM)*h:void 0;e.push({x:r.x+(M.x-r.x)*h,z:r.z+(M.z-r.z)*h,altitudeM:u})}}if(e.push(s[s.length-1]),e.length<2)return;const n=[0];for(let c=1;c<e.length;c++)n.push(n[c-1]+Math.hypot(e[c].x-e[c-1].x,e[c].z-e[c-1].z));if(n[n.length-1]<.5)return;const o=e.map((c,r)=>{const M=e[Math.max(0,r-1)],a=e[Math.min(e.length-1,r+1)],i=a.x-M.x,h=a.z-M.z,u=Math.hypot(i,h);return u<1e-6?{x:1,z:0}:{x:i/u,z:h/u}});return{kind:t.kind,...t.highSpeed?{highSpeed:!0}:{},level:t.level,centre:e,along:n,dir:o}}lay(t,s,e,n){const o=t.highSpeed?l.TRACK_SPACING_M.highSpeed:l.TRACK_SPACING_M[t.kind],c=Math.min(8,Math.max(1,t.tracks)),r=Array.from({length:c},(g,_)=>(_-(c-1)/2)*o),M=t.kind==="tram",a=M?0:l.BALLAST_HEIGHT_M,i=l.LIFT_M,h=(g,_,f)=>({x:s.centre[g].x-s.dir[g].z*_,y:s.y[g]+f,z:s.centre[g].z+s.dir[g].x*_}),u=s.centre.map((g,_)=>_);if(!M){const g=l.SLEEPER_LENGTH_M/2+l.BALLAST_SHOULDER_M+(r[r.length-1]??0),_=u.map(x=>h(x,g,a+i)),f=u.map(x=>h(x,-g,a+i));if(n.ballast.strip(_,f),t.level===0){const x=g+a*l.BALLAST_SLOPE;for(const E of[1,-1]){const z=[],v=[];let m=!1;for(const L of u){const C=h(L,E*x,i),S=e(C.x,C.z)+i,T=C.y-S;T<0&&(C.y=Math.min(S,s.y[L]+a-.05+i)),z.push(C);const I=h(L,E*(x+Math.max(0,T)*l.BANK_SLOPE),i);I.y=Math.min(e(I.x,I.z)+i,C.y),C.y-I.y>.02&&(m=!0),v.push(I)}const b=E>0?_:f;E>0?n.ballast.strip(z,b):n.ballast.strip(b,z),m&&(E>0?n.earth.strip(v,z):n.earth.strip(z,v))}}else{const x=-l.DECK_DEPTH_M,E=g+.15,z=u.map(L=>h(L,E,a+i+.1)),v=u.map(L=>h(L,-E,a+i+.1)),m=u.map(L=>h(L,E,x)),b=u.map(L=>h(L,-E,x));n.deck.strip(m,z),n.deck.strip(v,b),n.deck.strip(b,m),n.deck.strip(z,u.map(L=>h(L,g,a+i+.1))),n.deck.strip(u.map(L=>h(L,-g,a+i+.1)),v)}}const p=t.service?n.wood:n.concrete,A=t.gaugeMm/2e3+l.RAIL_HEAD_M/2,d=M?l.TRAM_RAIL_HEIGHT_M:l.RAIL_HEIGHT_M,O=a+i;for(const g of r){if(!M){const _=l.SLEEPER_LENGTH_M/2;p.strip(u.map(f=>h(f,g+_,O+.004)),u.map(f=>h(f,g-_,O+.004)),s.along)}for(const _ of[1,-1]){const f=g+_*A,x=l.RAIL_HEAD_M/2,E=u.map(v=>h(v,f+x,O+d)),z=u.map(v=>h(v,f-x,O+d));n.head.strip(E,z),n.rust.strip(u.map(v=>h(v,f+x,O)),E),n.rust.strip(z,u.map(v=>h(v,f-x,O)))}}t.electrification==="overhead"&&t.kind!=="subway"&&t.kind!=="funicular"&&this.catenary(t,s,r,O+d,h,e,n)}catenary(t,s,e,n,o,c,r){const M=l.catenaryOf(t),a=s.along[s.along.length-1],i=Math.max(1,Math.round(a/M.spanM)),h=a/i,u=Array.from({length:i},(E,z)=>(z+.5)*h),p=n+M.contactM,A=p+M.systemM,d=(M.systemM>0?A:p)+l.MAST_ABOVE_M,O=e[e.length-1],g=e.length>2,_=e.length===1?[1]:[1,-1],f=(E,z,v)=>{let m=0,b=s.along.length-2;for(;m<b;){const T=m+b+1>>1;s.along[T]<=E?m=T:b=T-1}const L=Math.min(1,Math.max(0,(E-s.along[m])/Math.max(1e-6,s.along[m+1]-s.along[m]))),C=o(m,z,v),S=o(m+1,z,v);return{x:C.x+(S.x-C.x)*L,y:C.y+(S.y-C.y)*L,z:C.z+(S.z-C.z)*L}};for(const E of u){const z=f(E,0,p);if(!(t.level===0&&c(z.x,z.z)>z.y)){for(const v of _){const m=v*(O+l.MAST_OFFSET_M),b=f(E,m,0);t.level===0&&(b.y=Math.min(b.y,c(b.x,b.z)));const L=f(E,m,d);if(r.steel.beam(b,L,l.MAST_SIDE_M),g)continue;const S=(_.length===1?e[0]:v*O)-v*.6,T=M.systemM>0?A:p+.3;r.steel.beam(f(E,m,T),f(E,S,T),l.ARM_SIDE_M),r.steel.beam(f(E,m,p-.4),f(E,S,T),l.ARM_SIDE_M)}if(g){const v=O+l.MAST_OFFSET_M;r.steel.beam(f(E,v,d-.2),f(E,-v,d-.2),l.MAST_SIDE_M*.8)}}}const x=[0,...u,a];for(const[E,z]of e.entries()){const v=m=>m===0||m===x.length-1?0:((m+E)%2===0?1:-1)*M.staggerM;for(let m=0;m<x.length-1;m++){const b=x[m],L=x[m+1];if(L-b<.1||(r.wire.beam(f(b,z+v(m),p),f(L,z+v(m+1),p),l.CONTACT_DIAMETER_M,!1),M.systemM<=0))continue;const C=4,S=T=>{const I=m===0?.5+T/2:m===x.length-2?T/2:T;return A-l.MESSENGER_SAG_M*4*I*(1-I)};for(let T=0;T<C;T++){const I=T/C,G=(T+1)/C;r.wire.beam(f(b+(L-b)*I,z,S(I)),f(b+(L-b)*G,z,S(G)),l.MESSENGER_DIAMETER_M,!1)}}}}static meshOf(t,s){if(t.indices.length===0)return;const e=new w;return e.setAttribute("position",new N(new Float32Array(t.positions),3)),t.along.length>0&&e.setAttribute("aAlong",new N(new Float32Array(t.along),1)),e.setIndex(new N(new Uint32Array(t.indices),1)),e.computeVertexNormals(),new U(e,s)}static lambert(t,s){return new k({color:new H(...t),...s?{polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2}:{}})}static pebbled(t){return t.onBeforeCompile=s=>{s.vertexShader=s.vertexShader.replace("#include <common>",`#include <common>
1
+ import{aV as F,a_ as P,bs as H,m as K,bb as w,bc as N,aY as U,bO as k}from"./rr0-sighting-editor.mjs";class D{static HOLLOW_M=1;static COVERED_M=3;static WINDOW_M=30;static SAMPLE_M=4;static MAX_GRADE={rail:.025,highSpeed:.035,subway:.04,light_rail:.06,tram:.08,funicular:1/0};static heights(t,s,e){const n=t.map(a=>a.level===0),o=t.map((a,i)=>n[i]?D.targets(a,s,e):[]),c=t.map((a,i)=>n[i]?D.samples(a,o[i]):[]),r=new Map;t.forEach((a,i)=>{if(n[i])for(const h of D.ends(a)){const u=D.key(h),p=r.get(u);p?p.push(i):r.set(u,[i])}});const M=a=>{const i=r.get(D.key(a));if(i)return D.median(i.flatMap(h=>c[h]),a)};return t.map((a,i)=>{if(n[i]){const h=[...new Set([i,...D.ends(a).flatMap(d=>r.get(D.key(d))??[])])].flatMap(d=>c[d]),u=a.centre.map((d,O)=>D.median(h,d)??o[i][O]),[p,A]=D.ends(a);return u[0]=M(p)??u[0],u[u.length-1]=M(A)??u[u.length-1],D.graded(u,a.along,a.highSpeed?D.MAX_GRADE.highSpeed:D.MAX_GRADE[a.kind])}return D.carried(a,s,e,M)})}static targets(t,s,e){return t.centre.map(n=>{const o=s(n.x,n.z);if(e===void 0||n.altitudeM===void 0)return o;const c=n.altitudeM+e;return c-o>D.HOLLOW_M||o-c>D.COVERED_M?c:o})}static samples(t,s){const e=[];let n=0;return t.centre.forEach((o,c)=>{t.along[c]+1e-6<n&&c<t.centre.length-1||(e.push({x:o.x,z:o.z,y:s[c]}),n=t.along[c]+D.SAMPLE_M)}),e}static median(t,s){const e=[];for(const o of t)Math.hypot(o.x-s.x,o.z-s.z)<=D.WINDOW_M&&e.push(o.y);if(e.length===0)return;e.sort((o,c)=>o-c);const n=e.length>>1;return e.length%2===1?e[n]:(e[n-1]+e[n])/2}static graded(t,s,e){if(!Number.isFinite(e)||t.length<3)return t;const n=[...t],o=n.length-1,c=s[o];if(Math.abs(n[o]-n[0])>e*c)return s.map(r=>n[0]+(n[o]-n[0])*r/c);for(let r=1;r<o;r++){const M=e*(s[r]-s[r-1]);n[r]=Math.min(n[r-1]+M,Math.max(n[r-1]-M,n[r]))}for(let r=o-1;r>0;r--){const M=e*(s[r+1]-s[r]);n[r]=Math.min(n[r+1]+M,Math.max(n[r+1]-M,n[r]))}return n}static carried(t,s,e,n){const[o,c]=D.ends(t),r=t.along[t.along.length-1],M=n(o),a=n(c);if(e!==void 0&&t.centre.every(u=>u.altitudeM!==void 0)){const u=t.centre.map(d=>d.altitudeM+e),p=M!==void 0?M-u[0]:0,A=a!==void 0?a-u[u.length-1]:0;return u.map((d,O)=>d+p+(A-p)*t.along[O]/r)}const i=M??s(o.x,o.z),h=a??s(c.x,c.z);return t.along.map(u=>i+(h-i)*u/r)}static ends(t){return[t.centre[0],t.centre[t.centre.length-1]]}static key(t){return`${Math.round(t.x*2)},${Math.round(t.z*2)}`}}class B{positions=[];indices=[];along=[];get vertexCount(){return this.positions.length/3}strip(t,s,e){const n=this.vertexCount;for(let o=0;o<t.length;o++)this.positions.push(t[o].x,t[o].y,t[o].z,s[o].x,s[o].y,s[o].z),e&&this.along.push(e[o],e[o]);for(let o=0;o<t.length-1;o++){const c=n+o*2;this.indices.push(c,c+2,c+1,c+1,c+2,c+3)}}beam(t,s,e,n=!0){const o=s.x-t.x,c=s.y-t.y,r=s.z-t.z,M=Math.hypot(o,c,r);if(M<1e-6)return;const a={x:o/M,y:c/M,z:r/M},i=Math.abs(a.y)>.9?{x:1,y:0,z:0}:{x:0,y:1,z:0},h=a.y*i.z-a.z*i.y,u=a.z*i.x-a.x*i.z,p=a.x*i.y-a.y*i.x,A=Math.hypot(h,u,p),d={x:h/A*e/2,y:u/A*e/2,z:p/A*e/2},O={x:a.y*d.z-a.z*d.y,y:a.z*d.x-a.x*d.z,z:a.x*d.y-a.y*d.x},g=(f,x,E)=>({x:f.x+d.x*x+O.x*E,y:f.y+d.y*x+O.y*E,z:f.z+d.z*x+O.z*E}),_=[[1,1],[-1,1],[-1,-1],[1,-1]];for(let f=0;f<4;f++){const[x,E]=_[f],[z,v]=_[(f+1)%4];this.quad(g(t,x,E),g(t,z,v),g(s,z,v),g(s,x,E))}n&&(this.quad(...[..._].reverse().map(([f,x])=>g(t,f,x))),this.quad(..._.map(([f,x])=>g(s,f,x))))}quad(t,s,e,n){const o=this.vertexCount;this.positions.push(t.x,t.y,t.z,s.x,s.y,s.z,e.x,e.y,e.z,n.x,n.y,n.z),this.indices.push(o,o+1,o+2,o,o+2,o+3)}}class l{static STEP_M=6;static BALLAST_HEIGHT_M=.5;static BALLAST_SLOPE=1.5;static BALLAST_SHOULDER_M=.45;static DECK_DEPTH_M=.8;static BANK_SLOPE=1.5;static SLEEPER_LENGTH_M=2.4;static SLEEPER_WIDTH_M=.29;static SLEEPER_SPACING_M=.6;static RAIL_HEAD_M=.072;static RAIL_HEIGHT_M=.18;static TRAM_RAIL_HEIGHT_M=.03;static LIFT_M=.06;static CATENARY={rail:{contactM:5.5,systemM:1.4,spanM:54,staggerM:.2},highSpeed:{contactM:5.08,systemM:1.4,spanM:63,staggerM:.2},service:{contactM:5.5,systemM:1.2,spanM:45,staggerM:.2},tram:{contactM:6,systemM:0,spanM:30,staggerM:.2}};static MESSENGER_SAG_M=.55;static MAST_SIDE_M=.26;static MAST_OFFSET_M=3.1;static MAST_ABOVE_M=.6;static CONTACT_DIAMETER_M=.012;static MESSENGER_DIAMETER_M=.011;static ARM_SIDE_M=.06;static TRACK_SPACING_M={rail:3.7,highSpeed:4.5,tram:3.1,subway:3.4,light_rail:3.4,funicular:3.2};static BALLAST_ALBEDO=[.17,.16,.15];static BANK_ALBEDO=[.085,.09,.05];static DECK_ALBEDO=[.26,.255,.24];static CONCRETE_ALBEDO=[.36,.35,.33];static WOOD_ALBEDO=[.07,.055,.045];static RUST_ALBEDO=[.085,.068,.058];static STEEL_ALBEDO=[.3,.31,.32];static COPPER_ALBEDO=[.09,.085,.07];static LINE_REACH_M=20;group=new F;stepM=l.STEP_M;drawn=0;laid=[];ballastMaterial=l.pebbled(l.lambert(l.BALLAST_ALBEDO,!0));earthMaterial=l.lambert(l.BANK_ALBEDO,!0);deckMaterial=l.lambert(l.DECK_ALBEDO,!1);concreteSleepers=l.sleeperMaterial(l.CONCRETE_ALBEDO);woodSleepers=l.sleeperMaterial(l.WOOD_ALBEDO);rustMaterial=l.lambert(l.RUST_ALBEDO,!0);headMaterial=new P({color:new H(.62,.62,.62),metalness:1,roughness:.28,polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2});steelMaterial=l.lambert(l.STEEL_ALBEDO,!1);wireMaterial=l.lambert(l.COPPER_ALBEDO,!1);constructor(){this.group.name="railways"}get count(){return this.drawn}setGroundSpacing(t){this.stepM=Number.isFinite(t)&&t>0?Math.min(l.STEP_M,Math.max(1.5,t/2)):l.STEP_M}set(t,s,e,n,o=1/0){this.clear();const r=t.map(p=>({line:p,path:p.points.map(A=>({...K(A.lat,A.lng,s,e),altitudeM:A.altitudeM}))})).filter(({line:p,path:A})=>p.level>=0&&l.within(A,o)),M=l.altitudeOffset(r,n),a=r.flatMap(({line:p,path:A})=>{const d=this.layoutOf(p,A);return d?[{line:p,layout:d}]:[]}),i=D.heights(a.map(({layout:p})=>p),n,M),h={ballast:new B,earth:new B,deck:new B,concrete:new B,wood:new B,rust:new B,head:new B,steel:new B,wire:new B};a.forEach(({line:p,layout:A},d)=>{this.lay(p,{...A,y:i[d]},n,h),this.laid.push({line:p,centre:A.centre}),this.drawn++});const u=[[h.ballast,this.ballastMaterial,"ballast",!1],[h.earth,this.earthMaterial,"embankments",!1],[h.deck,this.deckMaterial,"decks",!0],[h.concrete,this.concreteSleepers,"sleepers",!1],[h.wood,this.woodSleepers,"sleepers wood",!1],[h.rust,this.rustMaterial,"rails",!1],[h.head,this.headMaterial,"rail heads",!1],[h.steel,this.steelMaterial,"catenary masts",!0],[h.wire,this.wireMaterial,"catenary wires",!1]];for(const[p,A,d,O]of u){const g=l.meshOf(p,A);g&&(g.name=`railways ${d}`,g.castShadow=O,g.receiveShadow=!0,this.group.add(g))}}clear(){for(const t of[...this.group.children])this.group.remove(t),t.geometry?.dispose();this.drawn=0,this.laid=[]}lineAt(t,s){let e;for(const{line:n,centre:o}of this.laid)for(let c=0;c<o.length-1;c++){const r=o[c],M=o[c+1],a=M.x-r.x,i=M.z-r.z,h=a*a+i*i,u=h===0?0:Math.max(0,Math.min(1,((t-r.x)*a+(s-r.z)*i)/h)),p=Math.hypot(t-(r.x+a*u),s-(r.z+i*u));p<=l.LINE_REACH_M&&(!e||p<e.distance)&&(e={line:n,distance:p})}return e?.line}mayMeet(t,s,e,n){const o=Math.hypot(s.x,s.z);if(o<1e-6)return this.lineAt(t.x,t.z)!==void 0;const c=s.x/o,r=s.z/o,M=l.LINE_REACH_M;for(const{centre:a}of this.laid)for(let i=0;i<a.length-1;i++){const h=a[i],u=a[i+1];for(const p of[0,.5,1]){const A=h.x+(u.x-h.x)*p,d=h.z+(u.z-h.z)*p,O=(A-t.x)*c+(d-t.z)*r;if(O<0)continue;const g=Math.abs((A-t.x)*r-(d-t.z)*c),_=Math.hypot(u.x-h.x,u.z-h.z)/2;if(g>M+_)continue;if(t.y+s.y*(O/o)<=e(A,d)+n)return!0}}return!1}contactHeightM(t){if(!(t.electrification!=="overhead"||t.kind==="subway"||t.kind==="funicular"))return l.catenaryOf(t).contactM}static catenaryOf(t){return t.kind==="tram"?l.CATENARY.tram:t.highSpeed?l.CATENARY.highSpeed:t.service?l.CATENARY.service:l.CATENARY.rail}dispose(){this.clear();for(const t of[this.ballastMaterial,this.earthMaterial,this.deckMaterial,this.concreteSleepers,this.woodSleepers,this.rustMaterial,this.headMaterial,this.steelMaterial,this.wireMaterial])t.dispose()}static within(t,s){if(!Number.isFinite(s))return!0;const e=s*1.1+100;return t.some((n,o)=>Math.hypot(n.x,n.z)<=e||o>0&&Math.hypot((n.x+t[o-1].x)/2,(n.z+t[o-1].z)/2)<=e)}static altitudeOffset(t,s){const e=[];for(const{line:n,path:o}of t)if(n.level===0)for(const c of o)c.altitudeM!==void 0&&e.push(s(c.x,c.z)-c.altitudeM);if(!(e.length<5))return e.sort((n,o)=>n-o),e[Math.floor(e.length/2)]}layoutOf(t,s){const e=[];for(let c=0;c<s.length-1;c++){const r=s[c],M=s[c+1],a=Math.max(1,Math.ceil(Math.hypot(M.x-r.x,M.z-r.z)/this.stepM));for(let i=0;i<a;i++){const h=i/a,u=r.altitudeM!==void 0&&M.altitudeM!==void 0?r.altitudeM+(M.altitudeM-r.altitudeM)*h:void 0;e.push({x:r.x+(M.x-r.x)*h,z:r.z+(M.z-r.z)*h,altitudeM:u})}}if(e.push(s[s.length-1]),e.length<2)return;const n=[0];for(let c=1;c<e.length;c++)n.push(n[c-1]+Math.hypot(e[c].x-e[c-1].x,e[c].z-e[c-1].z));if(n[n.length-1]<.5)return;const o=e.map((c,r)=>{const M=e[Math.max(0,r-1)],a=e[Math.min(e.length-1,r+1)],i=a.x-M.x,h=a.z-M.z,u=Math.hypot(i,h);return u<1e-6?{x:1,z:0}:{x:i/u,z:h/u}});return{kind:t.kind,...t.highSpeed?{highSpeed:!0}:{},level:t.level,centre:e,along:n,dir:o}}lay(t,s,e,n){const o=t.highSpeed?l.TRACK_SPACING_M.highSpeed:l.TRACK_SPACING_M[t.kind],c=Math.min(8,Math.max(1,t.tracks)),r=Array.from({length:c},(g,_)=>(_-(c-1)/2)*o),M=t.kind==="tram",a=M?0:l.BALLAST_HEIGHT_M,i=l.LIFT_M,h=(g,_,f)=>({x:s.centre[g].x-s.dir[g].z*_,y:s.y[g]+f,z:s.centre[g].z+s.dir[g].x*_}),u=s.centre.map((g,_)=>_);if(!M){const g=l.SLEEPER_LENGTH_M/2+l.BALLAST_SHOULDER_M+(r[r.length-1]??0),_=u.map(x=>h(x,g,a+i)),f=u.map(x=>h(x,-g,a+i));if(n.ballast.strip(_,f),t.level===0){const x=g+a*l.BALLAST_SLOPE;for(const E of[1,-1]){const z=[],v=[];let m=!1;for(const L of u){const C=h(L,E*x,i),S=e(C.x,C.z)+i,T=C.y-S;T<0&&(C.y=Math.min(S,s.y[L]+a-.05+i)),z.push(C);const I=h(L,E*(x+Math.max(0,T)*l.BANK_SLOPE),i);I.y=Math.min(e(I.x,I.z)+i,C.y),C.y-I.y>.02&&(m=!0),v.push(I)}const b=E>0?_:f;E>0?n.ballast.strip(z,b):n.ballast.strip(b,z),m&&(E>0?n.earth.strip(v,z):n.earth.strip(z,v))}}else{const x=-l.DECK_DEPTH_M,E=g+.15,z=u.map(L=>h(L,E,a+i+.1)),v=u.map(L=>h(L,-E,a+i+.1)),m=u.map(L=>h(L,E,x)),b=u.map(L=>h(L,-E,x));n.deck.strip(m,z),n.deck.strip(v,b),n.deck.strip(b,m),n.deck.strip(z,u.map(L=>h(L,g,a+i+.1))),n.deck.strip(u.map(L=>h(L,-g,a+i+.1)),v)}}const p=t.service?n.wood:n.concrete,A=t.gaugeMm/2e3+l.RAIL_HEAD_M/2,d=M?l.TRAM_RAIL_HEIGHT_M:l.RAIL_HEIGHT_M,O=a+i;for(const g of r){if(!M){const _=l.SLEEPER_LENGTH_M/2;p.strip(u.map(f=>h(f,g+_,O+.004)),u.map(f=>h(f,g-_,O+.004)),s.along)}for(const _ of[1,-1]){const f=g+_*A,x=l.RAIL_HEAD_M/2,E=u.map(v=>h(v,f+x,O+d)),z=u.map(v=>h(v,f-x,O+d));n.head.strip(E,z),n.rust.strip(u.map(v=>h(v,f+x,O)),E),n.rust.strip(z,u.map(v=>h(v,f-x,O)))}}t.electrification==="overhead"&&t.kind!=="subway"&&t.kind!=="funicular"&&this.catenary(t,s,r,O+d,h,e,n)}catenary(t,s,e,n,o,c,r){const M=l.catenaryOf(t),a=s.along[s.along.length-1],i=Math.max(1,Math.round(a/M.spanM)),h=a/i,u=Array.from({length:i},(E,z)=>(z+.5)*h),p=n+M.contactM,A=p+M.systemM,d=(M.systemM>0?A:p)+l.MAST_ABOVE_M,O=e[e.length-1],g=e.length>2,_=e.length===1?[1]:[1,-1],f=(E,z,v)=>{let m=0,b=s.along.length-2;for(;m<b;){const T=m+b+1>>1;s.along[T]<=E?m=T:b=T-1}const L=Math.min(1,Math.max(0,(E-s.along[m])/Math.max(1e-6,s.along[m+1]-s.along[m]))),C=o(m,z,v),S=o(m+1,z,v);return{x:C.x+(S.x-C.x)*L,y:C.y+(S.y-C.y)*L,z:C.z+(S.z-C.z)*L}};for(const E of u){const z=f(E,0,p);if(!(t.level===0&&c(z.x,z.z)>z.y)){for(const v of _){const m=v*(O+l.MAST_OFFSET_M),b=f(E,m,0);t.level===0&&(b.y=Math.min(b.y,c(b.x,b.z)));const L=f(E,m,d);if(r.steel.beam(b,L,l.MAST_SIDE_M),g)continue;const S=(_.length===1?e[0]:v*O)-v*.6,T=M.systemM>0?A:p+.3;r.steel.beam(f(E,m,T),f(E,S,T),l.ARM_SIDE_M),r.steel.beam(f(E,m,p-.4),f(E,S,T),l.ARM_SIDE_M)}if(g){const v=O+l.MAST_OFFSET_M;r.steel.beam(f(E,v,d-.2),f(E,-v,d-.2),l.MAST_SIDE_M*.8)}}}const x=[0,...u,a];for(const[E,z]of e.entries()){const v=m=>m===0||m===x.length-1?0:((m+E)%2===0?1:-1)*M.staggerM;for(let m=0;m<x.length-1;m++){const b=x[m],L=x[m+1];if(L-b<.1||(r.wire.beam(f(b,z+v(m),p),f(L,z+v(m+1),p),l.CONTACT_DIAMETER_M,!1),M.systemM<=0))continue;const C=4,S=T=>{const I=m===0?.5+T/2:m===x.length-2?T/2:T;return A-l.MESSENGER_SAG_M*4*I*(1-I)};for(let T=0;T<C;T++){const I=T/C,G=(T+1)/C;r.wire.beam(f(b+(L-b)*I,z,S(I)),f(b+(L-b)*G,z,S(G)),l.MESSENGER_DIAMETER_M,!1)}}}}static meshOf(t,s){if(t.indices.length===0)return;const e=new w;return e.setAttribute("position",new N(new Float32Array(t.positions),3)),t.along.length>0&&e.setAttribute("aAlong",new N(new Float32Array(t.along),1)),e.setIndex(new N(new Uint32Array(t.indices),1)),e.computeVertexNormals(),new U(e,s)}static lambert(t,s){return new k({color:new H(...t),...s?{polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2}:{}})}static pebbled(t){return t.onBeforeCompile=s=>{s.vertexShader=s.vertexShader.replace("#include <common>",`#include <common>
2
2
  varying vec3 vBallast;`).replace("#include <begin_vertex>",`#include <begin_vertex>
3
3
  vBallast = position;`),s.fragmentShader=s.fragmentShader.replace("#include <common>",`#include <common>
4
4
  varying vec3 vBallast;