@rr0/ufoathome 0.174.0 → 0.176.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 (139) hide show
  1. package/dist-embed-interview/rr0-interview.mjs +9 -6
  2. package/dist-embed-scene/{AdsbLolArchiveProvider-liG2xlWV.js → AdsbLolArchiveProvider-BHGe8FVN.js} +1 -1
  3. package/dist-embed-scene/{BeamEditor-DRrVChwI.js → BeamEditor-zq64GorX.js} +1 -1
  4. package/dist-embed-scene/{BeamSystem-CEzXZFNu.js → BeamSystem-BXee1GYk.js} +1 -1
  5. package/dist-embed-scene/{Flightradar24Provider-BkhQ2iqB.js → Flightradar24Provider-Dx2Fb8yO.js} +1 -1
  6. package/dist-embed-scene/GLTFLoader-DDba3PaV.js +1 -0
  7. package/dist-embed-scene/{HeadlightSystem-Dvc4Rbz-.js → HeadlightSystem-_BIIKhQ2.js} +1 -1
  8. package/dist-embed-scene/{LanternEditor-DCP-Wz-Q.js → LanternEditor-2q5seAWj.js} +1 -1
  9. package/dist-embed-scene/{LaserBeam-DfUrxrC_.js → LaserBeam-DmH2JeMa.js} +1 -1
  10. package/dist-embed-scene/{LaunchEditor-DzToEZHF.js → LaunchEditor-Cupksu8A.js} +1 -1
  11. package/dist-embed-scene/{LaunchPlume-D7l6FeNX.js → LaunchPlume-BRnjFVcY.js} +1 -1
  12. package/dist-embed-scene/{LaunchSimulation-DKpm2Xqs.js → LaunchSimulation-DL7QBfEl.js} +1 -1
  13. package/dist-embed-scene/{ModuleSession-VVjH7nnr.js → ModuleSession-BvQABNEZ.js} +2 -2
  14. package/dist-embed-scene/ModuleThree-12Uq6OyD.js +1 -0
  15. package/dist-embed-scene/{ParameterForm-BDYo2bPV.js → ParameterForm-BMIW4Gkh.js} +9 -9
  16. package/dist-embed-scene/{ReentryEditor-Dk_CUVvM.js → ReentryEditor-DJO_M-8-.js} +1 -1
  17. package/dist-embed-scene/{ReentrySimulation-D-FR761p.js → ReentrySimulation-pWRgNLjt.js} +1 -1
  18. package/dist-embed-scene/ReferenceSystem-D9agTeWl.js +1 -0
  19. package/dist-embed-scene/{SceneNames_en-DGqvOiKr.js → SceneNames_en-CqzjDgS4.js} +1 -1
  20. package/dist-embed-scene/{SceneNames_es-CjXqPgH3.js → SceneNames_es-DMfxIS0T.js} +1 -1
  21. package/dist-embed-scene/{SceneNames_fr-BJqNnvOr.js → SceneNames_fr-DydzEE4a.js} +1 -1
  22. package/dist-embed-scene/{SceneNames_it-BYKERxdw.js → SceneNames_it-DJAACEvb.js} +1 -1
  23. package/dist-embed-scene/{TimelineTracks-BPVmDKpc.js → TimelineTracks-B-bXAaF7.js} +1 -1
  24. package/dist-embed-scene/{UfoMessages_en-wpJoNj_d.js → UfoMessages_en-CRIdIMYy.js} +1 -1
  25. package/dist-embed-scene/rr0-scene.mjs +330 -304
  26. package/dist-embed-scene/sightingSchema-BqAGojjT.js +1 -0
  27. package/dist-embed-scene/trafficRuntime-BDtw1Kqi.js +2 -0
  28. package/dist-embed-sighting/{AdsbLolArchiveProvider-CkHzWGQi.js → AdsbLolArchiveProvider-DK4qEYPv.js} +1 -1
  29. package/dist-embed-sighting/{BallesterGuaspAssessor-C3AZoSYJ.js → BallesterGuaspAssessor-FGskpWWG.js} +1 -1
  30. package/dist-embed-sighting/{BeamEditor-BJNdmRuT.js → BeamEditor-BglkfKa6.js} +1 -1
  31. package/dist-embed-sighting/{BeamSystem-K3DiM1GA.js → BeamSystem-DDtPjozC.js} +1 -1
  32. package/dist-embed-sighting/CaseMessages_en-DEyvxYxv.js +1 -0
  33. package/dist-embed-sighting/CaseMessages_es-DDsQ93tK.js +1 -0
  34. package/dist-embed-sighting/CaseMessages_fr-DoHbDEkG.js +1 -0
  35. package/dist-embed-sighting/CaseMessages_it-CF8sKknV.js +1 -0
  36. package/dist-embed-sighting/{ContrailSystem-CRHKaUK-.js → ContrailSystem-DXV0DnrQ.js} +1 -1
  37. package/dist-embed-sighting/{Flightradar24Provider--mgNvbo7.js → Flightradar24Provider-Ch4GdVJG.js} +1 -1
  38. package/dist-embed-sighting/GLTFLoader-BDyucwJ-.js +1 -0
  39. package/dist-embed-sighting/HeadlightSystem-DGUfgm2c.js +34 -0
  40. package/dist-embed-sighting/HynekAssessor-Cb8mZ9Ib.js +1 -0
  41. package/dist-embed-sighting/InterviewElement-Byb_sxbO.js +38 -0
  42. package/dist-embed-sighting/InterviewMessages_en-BNau2xU8.js +1 -0
  43. package/dist-embed-sighting/InterviewMessages_es-ypa0EDh9.js +1 -0
  44. package/dist-embed-sighting/InterviewMessages_fr-OCQdwn9j.js +1 -0
  45. package/dist-embed-sighting/InterviewMessages_it-awuOqf5v.js +1 -0
  46. package/dist-embed-sighting/{LanternEditor-v7J6meRk.js → LanternEditor-CaZ1JhZS.js} +1 -1
  47. package/dist-embed-sighting/{LaserBeam-CrsVNYnr.js → LaserBeam-DkKFSSp_.js} +1 -1
  48. package/dist-embed-sighting/LaunchEditor-QRG2uHH8.js +22 -0
  49. package/dist-embed-sighting/LaunchPlume-DBINBQgQ.js +1 -0
  50. package/dist-embed-sighting/{LaunchSimulation-Vj5v57hz.js → LaunchSimulation-DUvH6_BB.js} +1 -1
  51. package/dist-embed-sighting/{ModuleSession-BgHWPEDv.js → ModuleSession-GzfQ8_LE.js} +3 -3
  52. package/dist-embed-sighting/ModuleThree-tnKi-oul.js +1 -0
  53. package/dist-embed-sighting/{NearestApproach-Dm99M0L8.js → NearestApproach-BeKwz4vK.js} +1 -1
  54. package/dist-embed-sighting/{ParameterForm-BEtRCdpW.js → ParameterForm-DW6cQmYI.js} +9 -12
  55. package/dist-embed-sighting/{PoherAssessor-BUqWHdc2.js → PoherAssessor-JLqDISRf.js} +1 -1
  56. package/dist-embed-sighting/{RailwaySystem-Bb0sdKJq.js → RailwaySystem-BfTJvmf3.js} +1 -1
  57. package/dist-embed-sighting/{ReentryEditor-CMnCxTU4.js → ReentryEditor-BHgPXlx3.js} +6 -6
  58. package/dist-embed-sighting/ReentrySimulation-C3BR2hs3.js +1 -0
  59. package/dist-embed-sighting/{ReferenceSystem-s-ggwBEd.js → ReferenceSystem-B5diz1Lt.js} +1 -1
  60. package/dist-embed-sighting/{RoadMarkings-DiBAmqci.js → RoadMarkings-Dv3xdtFG.js} +1 -1
  61. package/dist-embed-sighting/{SceneNames_en-Cy3_acfm.js → SceneNames_en-BbQ55UYu.js} +1 -1
  62. package/dist-embed-sighting/{SceneNames_es-VxS6QttN.js → SceneNames_es-DsJpGSDK.js} +1 -1
  63. package/dist-embed-sighting/{SceneNames_fr-Dg8Zgkb7.js → SceneNames_fr-CKr5m8QL.js} +1 -1
  64. package/dist-embed-sighting/{SceneNames_it-Cf-I4HxZ.js → SceneNames_it-qSw1j95v.js} +1 -1
  65. package/dist-embed-sighting/{SightingMessages_en-BjIUyT4W.js → SightingMessages_en-DuokT218.js} +1 -1
  66. package/dist-embed-sighting/{SightingMessages_es-TueslN1u.js → SightingMessages_es-JO8WQ1_V.js} +1 -1
  67. package/dist-embed-sighting/{SightingMessages_fr-Dfp6mAcU.js → SightingMessages_fr-3C2RZVNA.js} +1 -1
  68. package/dist-embed-sighting/{SightingMessages_it-C0VvJY01.js → SightingMessages_it-BEMBUACg.js} +1 -1
  69. package/dist-embed-sighting/{TimelineTracks-D_Oedo7x.js → TimelineTracks-XzShW15O.js} +2 -2
  70. package/dist-embed-sighting/{TraceSystem-DW2kF0O_.js → TraceSystem-XybhI4uJ.js} +2 -2
  71. package/dist-embed-sighting/UfoMessages_en-CoSqGYwb.js +1 -0
  72. package/dist-embed-sighting/{WaterSystem-B1eVrX5D.js → WaterSystem-CcLIPQfy.js} +1 -1
  73. package/dist-embed-sighting/rr0-sighting.mjs +459 -337
  74. package/dist-embed-sighting/sightingSchema-BqAGojjT.js +1 -0
  75. package/dist-embed-sighting/trafficRuntime-BAuwwA-Z.js +2 -0
  76. package/dist-embed-sighting-editor/{AdsbLolArchiveProvider-CpaPx7Px.js → AdsbLolArchiveProvider-CXB-CDQ2.js} +1 -1
  77. package/dist-embed-sighting-editor/{BallesterGuaspAssessor-BIHqYTXC.js → BallesterGuaspAssessor-Bb8Kl2FU.js} +1 -1
  78. package/dist-embed-sighting-editor/{BeamEditor-8NrnezeZ.js → BeamEditor-DJtZYFp0.js} +1 -1
  79. package/dist-embed-sighting-editor/{BeamSystem-CaxJaT_y.js → BeamSystem-C6Wk_vNQ.js} +1 -1
  80. package/dist-embed-sighting-editor/CaseEditorMessages_en-D47ntA6R.js +1 -0
  81. package/dist-embed-sighting-editor/CaseEditorMessages_es-CyIdBeD_.js +1 -0
  82. package/dist-embed-sighting-editor/CaseEditorMessages_fr-DXaZI1jZ.js +1 -0
  83. package/dist-embed-sighting-editor/CaseEditorMessages_it-Cp1-Jm34.js +1 -0
  84. package/dist-embed-sighting-editor/{ContrailSystem-CTAB7sqQ.js → ContrailSystem-e-OLIzTk.js} +1 -1
  85. package/dist-embed-sighting-editor/{CoverageAssessor-CHa6U2A7.js → CoverageAssessor-DUDmS-aG.js} +1 -1
  86. package/dist-embed-sighting-editor/{Flightradar24Provider-DAS99x3c.js → Flightradar24Provider-DtcvpdT3.js} +1 -1
  87. package/dist-embed-sighting-editor/{GLTFLoader-BLpME7vC.js → GLTFLoader-AHdd-c6G.js} +1 -1
  88. package/dist-embed-sighting-editor/{HeadlightSystem-Crmc9zbw.js → HeadlightSystem-CLhqQjbe.js} +1 -1
  89. package/dist-embed-sighting-editor/{HynekAssessor-D_UJjt62.js → HynekAssessor-DvVp-CLS.js} +1 -1
  90. package/dist-embed-sighting-editor/{InterviewEditorElement-DtBxBtVw.js → InterviewEditorElement-BesUoWBH.js} +16 -13
  91. package/dist-embed-sighting-editor/{LanternEditor-DWIefcSu.js → LanternEditor-ngKN2Zt3.js} +1 -1
  92. package/dist-embed-sighting-editor/{LaserBeam-C_5uHg0U.js → LaserBeam-QJPhnVO_.js} +1 -1
  93. package/dist-embed-sighting-editor/{LaunchEditor-ByC2Emjf.js → LaunchEditor-B8KlP5eo.js} +1 -1
  94. package/dist-embed-sighting-editor/{LaunchPlume-CpAzgYlA.js → LaunchPlume-C_r62XTj.js} +1 -1
  95. package/dist-embed-sighting-editor/{LaunchSimulation-D4CHeSnk.js → LaunchSimulation-BSDTfZTv.js} +1 -1
  96. package/dist-embed-sighting-editor/{ModelSource-UJizu116.js → ModelSource-B85niY1n.js} +1 -1
  97. package/dist-embed-sighting-editor/{ModelThumbnails-C6MY31ux.js → ModelThumbnails-uYh2sUIb.js} +1 -1
  98. package/dist-embed-sighting-editor/{ModelViewer-vYoh4mVh.js → ModelViewer-DLZhhuq5.js} +1 -1
  99. package/dist-embed-sighting-editor/{ModuleConformance-D6VFY6JB.js → ModuleConformance-CBMdTSVo.js} +2 -2
  100. package/dist-embed-sighting-editor/{ModuleSession-Dsi0JKlc.js → ModuleSession-rFLStWcj.js} +2 -2
  101. package/dist-embed-sighting-editor/ModuleThree-DrKN6B-3.js +1 -0
  102. package/dist-embed-sighting-editor/{ModulesPanelElement-CeEA058j.js → ModulesPanelElement-CGp6DrpQ.js} +3 -3
  103. package/dist-embed-sighting-editor/{NearestApproach-B8jOOhQy.js → NearestApproach-Ctw1-XBO.js} +1 -1
  104. package/dist-embed-sighting-editor/{PoherAssessor-COIGIPYG.js → PoherAssessor-CLKwvgUL.js} +1 -1
  105. package/dist-embed-sighting-editor/{RailwaySystem-DPEyve9f.js → RailwaySystem-C67LdkZv.js} +1 -1
  106. package/dist-embed-sighting-editor/{ReentryEditor-pBwTz0Zh.js → ReentryEditor-DXe8wen6.js} +1 -1
  107. package/dist-embed-sighting-editor/{ReentrySimulation-Dfg-6_Da.js → ReentrySimulation-BxVE5Dsn.js} +1 -1
  108. package/dist-embed-sighting-editor/{ReferenceSystem-CGC3BqZJ.js → ReferenceSystem-B201fXMC.js} +1 -1
  109. package/dist-embed-sighting-editor/{RoadMarkings-Cr-sSvIY.js → RoadMarkings-DJ2HL-6g.js} +1 -1
  110. package/dist-embed-sighting-editor/{SightingFileEditor-BymOujPF.js → SightingFileEditor-CASP3L_i.js} +1 -1
  111. package/dist-embed-sighting-editor/{TraceSystem-BAZq4Mcs.js → TraceSystem-CDHG18il.js} +2 -2
  112. package/dist-embed-sighting-editor/{WaterSystem-1Sp5frNp.js → WaterSystem-B2xlCmn2.js} +1 -1
  113. package/dist-embed-sighting-editor/{caseSchema-SAzcVIGZ.js → caseSchema-ChUB1-9j.js} +1 -1
  114. package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +484 -416
  115. package/dist-embed-sighting-editor/sightingSchema-DbcXsOHL.js +1 -0
  116. package/dist-embed-sighting-editor/trafficRuntime-_7Uw8kC_.js +2 -0
  117. package/package.json +1 -1
  118. package/dist-embed-scene/GLTFLoader-UnRP5t__.js +0 -1
  119. package/dist-embed-scene/ModuleThree-5mmzRPs2.js +0 -1
  120. package/dist-embed-scene/ReferenceSystem-BUj-6A76.js +0 -1
  121. package/dist-embed-scene/sightingSchema-DZXw4x_Q.js +0 -1
  122. package/dist-embed-scene/trafficRuntime-BgM4IVmy.js +0 -2
  123. package/dist-embed-sighting/GLTFLoader-NORF7Wya.js +0 -1
  124. package/dist-embed-sighting/HeadlightSystem-BrccF2M7.js +0 -34
  125. package/dist-embed-sighting/HynekAssessor-BNn-J5RL.js +0 -1
  126. package/dist-embed-sighting/LaunchEditor-BQKUng5i.js +0 -22
  127. package/dist-embed-sighting/LaunchPlume-zs7QuS9V.js +0 -1
  128. package/dist-embed-sighting/ModuleThree-cSwqALyP.js +0 -1
  129. package/dist-embed-sighting/ReentrySimulation-B7bV2GTy.js +0 -1
  130. package/dist-embed-sighting/UfoMessages_en-Bau9u8Mz.js +0 -1
  131. package/dist-embed-sighting/sightingSchema-DZXw4x_Q.js +0 -1
  132. package/dist-embed-sighting/trafficRuntime-D2QZwJQQ.js +0 -2
  133. package/dist-embed-sighting-editor/CaseEditorMessages_en-BRK8_A_C.js +0 -1
  134. package/dist-embed-sighting-editor/CaseEditorMessages_es-B47ks0dC.js +0 -1
  135. package/dist-embed-sighting-editor/CaseEditorMessages_fr-DGFZDYgn.js +0 -1
  136. package/dist-embed-sighting-editor/CaseEditorMessages_it-BcpT08hY.js +0 -1
  137. package/dist-embed-sighting-editor/ModuleThree-HknjibVQ.js +0 -1
  138. package/dist-embed-sighting-editor/sightingSchema-CUVU5eOl.js +0 -1
  139. package/dist-embed-sighting-editor/trafficRuntime-C9bT5cO9.js +0 -2
@@ -1,4 +1,4 @@
1
- import{I as u}from"./ParameterForm-BEtRCdpW.js";class p{constructor(t,a,e){this.host=t,this.seek=a,this.messages=e,t.classList.add("timeline-tracks"),this.scroll=document.createElement("div"),this.scroll.className="track-scroll",this.scroll.hidden=!0,this.thumb=document.createElement("div"),this.thumb.className="thumb",this.scroll.append(this.thumb),this.scroll.addEventListener("pointerdown",s=>this.dragWindow(s)),t.addEventListener("wheel",s=>this.wheel(s),{passive:!1})}static CSS=`
1
+ import{ay as u}from"./rr0-sighting.mjs";class p{constructor(t,i,e){this.host=t,this.seek=i,this.messages=e,t.classList.add("timeline-tracks"),this.scroll=document.createElement("div"),this.scroll.className="track-scroll",this.scroll.hidden=!0,this.thumb=document.createElement("div"),this.thumb.className="thumb",this.scroll.append(this.thumb),this.scroll.addEventListener("pointerdown",s=>this.dragWindow(s)),t.addEventListener("wheel",s=>this.wheel(s),{passive:!1})}static CSS=`
2
2
  .timeline-tracks { display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; padding: 10px 14px 12px; }
3
3
  .timeline-tracks[hidden] { display: none; }
4
4
  .track-name { display: inline-block; justify-self: start; min-height: 0; padding: 2px 0; border: 0; background: none; color: var(--ink-dim, inherit); font: 600 12px/1.3 var(--sans, inherit); cursor: pointer; }
@@ -32,4 +32,4 @@ import{I as u}from"./ParameterForm-BEtRCdpW.js";class p{constructor(t,a,e){this.
32
32
  .track-scroll[hidden] { display: none; }
33
33
  .track-scroll .thumb { position: absolute; top: 0; bottom: 0; min-width: 12px; border-radius: 4px; background: color-mix(in srgb, currentColor 35%, transparent); cursor: grab; }
34
34
  .track-scroll .thumb:active { cursor: grabbing; }
35
- `;static MIN_WINDOW_MS=200;tracks=[];duration=0;currentTime=0;extentStart=0;extentEnd=1;drawn="";windowStart=0;windowLength=0;lanes=new Map;adds=new Map;scroll;thumb;setMessages(t){this.messages=t,this.drawn=""}show(t,a,e,s){this.tracks=t;const i=s?s.from:0,n=s?Math.max(s.from+1,s.to):Math.max(1,a);(a!==this.duration||i!==this.extentStart||n!==this.extentEnd||this.windowLength===0)&&(this.windowStart=i,this.windowLength=n-i),this.duration=a,this.extentStart=i,this.extentEnd=n,this.currentTime=e;const r=JSON.stringify([a,i,n,t.map(l=>[l.id,l.label,l.times,l.spans])]);r!==this.drawn&&(this.drawn=r,this.draw()),this.place(e)}setTime(t){this.currentTime=t,this.place(t)}get zoomed(){return this.windowLength<this.extentEnd-this.extentStart}zoomTo(t,a=this.windowStart+this.windowLength/2){const e=this.extentEnd-this.extentStart,s=Math.min(e,Math.max(Math.min(e,p.MIN_WINDOW_MS),t)),i=(a-this.windowStart)/this.windowLength;this.windowLength=s,this.scrollTo(a-i*s)}scrollTo(t){this.windowStart=Math.min(this.extentEnd-this.windowLength,Math.max(this.extentStart,t)),this.layout(),this.place(this.currentTime)}wheel(t){const a=t.target.closest?.(".track-lane, .track-scroll");if(!a)return;const e=a.getBoundingClientRect();if(e.width===0)return;if(t.ctrlKey||t.metaKey){t.preventDefault();const i=this.windowStart+(t.clientX-e.left)/e.width*this.windowLength;this.zoomTo(this.windowLength*Math.exp(t.deltaY*.01),i);return}const s=t.shiftKey&&t.deltaX===0?t.deltaY:t.deltaX;!this.zoomed||Math.abs(s)<=Math.abs(t.shiftKey?0:t.deltaY)||(t.preventDefault(),this.scrollTo(this.windowStart+s/e.width*this.windowLength))}dragWindow(t){const a=this.scroll.getBoundingClientRect();if(a.width===0)return;const e=this.extentEnd-this.extentStart;t.target!==this.thumb&&this.scrollTo(this.extentStart+(t.clientX-a.left)/a.width*e-this.windowLength/2);const s=t.clientX,i=this.windowStart;this.scroll.setPointerCapture?.(t.pointerId);const n=l=>this.scrollTo(i+(l.clientX-s)/a.width*e),r=()=>{this.scroll.removeEventListener("pointermove",n),this.scroll.removeEventListener("pointerup",r),this.scroll.removeEventListener("pointercancel",r)};this.scroll.addEventListener("pointermove",n),this.scroll.addEventListener("pointerup",r),this.scroll.addEventListener("pointercancel",r)}x(t){return(t-this.windowStart)/this.windowLength*100}draw(){this.host.replaceChildren(),this.lanes.clear(),this.adds.clear();for(const t of this.tracks){const a=document.createElement("button");a.type="button",a.className="track-name",a.textContent=t.label,a.addEventListener("click",()=>t.open());const e=document.createElement("div");e.className="track-lane",e.style.setProperty("--track",t.color),e.setAttribute("role","group"),e.setAttribute("aria-label",t.label),e.tabIndex=0;const s=[],i=(t.spans??[]).map(d=>{let h=s.findIndex(o=>o<=d.t);return h<0&&(h=s.push(0)-1),s[h]=d.until,{event:d,row:h}});e.style.setProperty("--rows",String(Math.max(1,s.length)));for(const{event:d,row:h}of i){const o=document.createElement("span");if(o.className="span",o.textContent=d.label,o.title=d.label,o.dataset.t=String(d.t),o.dataset.until=String(d.until),d.id!==void 0&&t.select){const c=d.id;o.dataset.id=c,o.addEventListener("pointerdown",m=>{m.stopPropagation(),t.select(c)})}o.style.top=`${h/s.length*100}%`,o.style.height=`${100/s.length}%`,e.append(o)}for(const d of t.times){const h=document.createElement("span");h.className="kf",h.dataset.t=String(d),e.append(h)}t.move&&(e.dataset.movable="");for(const d of["before","after"]){const h=document.createElement("span");h.className="outside",h.dataset.side=d,e.prepend(h)}const n=document.createElement("span");n.className="playhead",e.append(n),e.addEventListener("pointerdown",d=>this.dragPlayhead(e,t,d));const r=document.createElement("button");r.type="button",r.className="icon-btn track-add",r.innerHTML=u.PLUS,r.addEventListener("click",()=>t.add());const l=document.createElement("div");l.className="track-row",l.append(a,e,r),this.host.append(l),this.lanes.set(t.id,e),this.adds.set(t.id,r)}this.host.append(this.scroll),this.layout()}layout(){const t=this.windowStart+this.windowLength,a=Math.max(1,this.duration);for(const s of this.lanes.values()){for(const i of s.querySelectorAll(".outside")){const[n,r]=i.dataset.side==="before"?[this.windowStart,Math.min(t,0)]:[Math.max(this.windowStart,a),t];i.hidden=r<=n,i.style.left=`${this.x(n)}%`,i.style.width=`${this.x(r)-this.x(n)}%`}for(const i of s.querySelectorAll(".span")){const n=Math.max(this.windowStart,Number(i.dataset.t)),r=Math.min(t,Number(i.dataset.until));i.hidden=r<=n,i.style.left=`${this.x(n)}%`,i.style.width=`${this.x(r)-this.x(n)}%`}for(const i of s.querySelectorAll(".kf")){const n=Number(i.dataset.t);i.hidden=n<this.windowStart||n>t,i.style.left=`${this.x(n)}%`}}const e=this.extentEnd-this.extentStart;this.scroll.hidden=!this.zoomed,this.scroll.title=this.messages.zoomHint,this.thumb.style.left=`${(this.windowStart-this.extentStart)/e*100}%`,this.thumb.style.width=`${this.windowLength/e*100}%`}dragPlayhead(t,a,e){const s=this.instantAt(t,e);if(s===void 0)return;const i=this.keyNear(t,a,s);t.setPointerCapture?.(e.pointerId);let n=d=>this.seekFrom(t,a,d),r=()=>{};if(i!==void 0&&a.move){const d=[...t.querySelectorAll(".kf")].find(o=>Number(o.dataset.t)===i);let h=i;this.seekTo(i),n=o=>{const c=this.instantAt(t,o);c===void 0||!d||(h=Math.round(Math.min(this.extentEnd,Math.max(this.extentStart,c))/100)*100,d.style.left=`${this.x(h)}%`,this.seekTo(h))},r=()=>{h!==i&&a.move(i,h)}}else this.seekTo(i??s);a.pressed?.(s,i);const l=()=>{r(),t.removeEventListener("pointermove",n),t.removeEventListener("pointerup",l),t.removeEventListener("pointercancel",l)};t.addEventListener("pointermove",n),t.addEventListener("pointerup",l),t.addEventListener("pointercancel",l)}seekFrom(t,a,e){const s=this.instantAt(t,e);s!==void 0&&this.seekTo(this.keyNear(t,a,s)??s)}instantAt(t,a){const e=t.getBoundingClientRect();if(e.width!==0)return this.windowStart+(a.clientX-e.left)/e.width*this.windowLength}keyNear(t,a,e){const s=6/t.getBoundingClientRect().width*this.windowLength;return a.times.reduce((i,n)=>Math.abs(n-e)<=s&&(i===void 0||Math.abs(n-e)<Math.abs(i-e))?n:i,void 0)}seekTo(t){this.seek(Math.round(Math.min(Math.max(1,this.duration),Math.max(0,t))))}place(t){const a=this.windowStart+this.windowLength;for(const e of this.tracks){const s=this.lanes.get(e.id),i=this.adds.get(e.id);if(!s||!i)continue;const n=s.parentElement,r=n.querySelector(".track-name");e.active===void 0?(delete n.dataset.active,r?.removeAttribute("aria-pressed")):(n.dataset.active=String(e.active),r?.setAttribute("aria-pressed",String(e.active)));const l=e.times.some(o=>Math.abs(o-t)<1);for(const o of s.querySelectorAll(".kf")){const c=Number(o.dataset.t);o.setAttribute("aria-current",String(Math.abs(c-t)<1)),o.dataset.selected=String(e.selectedTime!==void 0&&Math.abs(e.selectedTime-c)<1)}for(const o of s.querySelectorAll(".span[data-id]"))o.setAttribute("aria-selected",String(o.dataset.id===e.selected));const d=s.querySelector(".playhead");d.hidden=t<this.windowStart||t>a,d.style.left=`${this.x(Math.min(Math.max(1,this.duration),t))}%`;const h=`${e.label} · ${l?this.messages.keyframeHere:this.messages.addKeyframeHere}`;i.title=h,i.setAttribute("aria-label",h)}}}export{p as T};
35
+ `;static MIN_WINDOW_MS=200;tracks=[];duration=0;currentTime=0;extentStart=0;extentEnd=1;drawn="";windowStart=0;windowLength=0;lanes=new Map;adds=new Map;scroll;thumb;setMessages(t){this.messages=t,this.drawn=""}show(t,i,e,s){this.tracks=t;const a=s?s.from:0,n=s?Math.max(s.from+1,s.to):Math.max(1,i);(i!==this.duration||a!==this.extentStart||n!==this.extentEnd||this.windowLength===0)&&(this.windowStart=a,this.windowLength=n-a),this.duration=i,this.extentStart=a,this.extentEnd=n,this.currentTime=e;const r=JSON.stringify([i,a,n,t.map(l=>[l.id,l.label,l.times,l.spans])]);r!==this.drawn&&(this.drawn=r,this.draw()),this.place(e)}setTime(t){this.currentTime=t,this.place(t)}get zoomed(){return this.windowLength<this.extentEnd-this.extentStart}zoomTo(t,i=this.windowStart+this.windowLength/2){const e=this.extentEnd-this.extentStart,s=Math.min(e,Math.max(Math.min(e,p.MIN_WINDOW_MS),t)),a=(i-this.windowStart)/this.windowLength;this.windowLength=s,this.scrollTo(i-a*s)}scrollTo(t){this.windowStart=Math.min(this.extentEnd-this.windowLength,Math.max(this.extentStart,t)),this.layout(),this.place(this.currentTime)}wheel(t){const i=t.target.closest?.(".track-lane, .track-scroll");if(!i)return;const e=i.getBoundingClientRect();if(e.width===0)return;if(t.ctrlKey||t.metaKey){t.preventDefault();const a=this.windowStart+(t.clientX-e.left)/e.width*this.windowLength;this.zoomTo(this.windowLength*Math.exp(t.deltaY*.01),a);return}const s=t.shiftKey&&t.deltaX===0?t.deltaY:t.deltaX;!this.zoomed||Math.abs(s)<=Math.abs(t.shiftKey?0:t.deltaY)||(t.preventDefault(),this.scrollTo(this.windowStart+s/e.width*this.windowLength))}dragWindow(t){const i=this.scroll.getBoundingClientRect();if(i.width===0)return;const e=this.extentEnd-this.extentStart;t.target!==this.thumb&&this.scrollTo(this.extentStart+(t.clientX-i.left)/i.width*e-this.windowLength/2);const s=t.clientX,a=this.windowStart;this.scroll.setPointerCapture?.(t.pointerId);const n=l=>this.scrollTo(a+(l.clientX-s)/i.width*e),r=()=>{this.scroll.removeEventListener("pointermove",n),this.scroll.removeEventListener("pointerup",r),this.scroll.removeEventListener("pointercancel",r)};this.scroll.addEventListener("pointermove",n),this.scroll.addEventListener("pointerup",r),this.scroll.addEventListener("pointercancel",r)}x(t){return(t-this.windowStart)/this.windowLength*100}draw(){this.host.replaceChildren(),this.lanes.clear(),this.adds.clear();for(const t of this.tracks){const i=document.createElement("button");i.type="button",i.className="track-name",i.textContent=t.label,i.addEventListener("click",()=>t.open());const e=document.createElement("div");e.className="track-lane",e.style.setProperty("--track",t.color),e.setAttribute("role","group"),e.setAttribute("aria-label",t.label),e.tabIndex=0;const s=[],a=(t.spans??[]).map(d=>{let h=s.findIndex(o=>o<=d.t);return h<0&&(h=s.push(0)-1),s[h]=d.until,{event:d,row:h}});e.style.setProperty("--rows",String(Math.max(1,s.length)));for(const{event:d,row:h}of a){const o=document.createElement("span");if(o.className="span",o.textContent=d.label,o.title=d.label,o.dataset.t=String(d.t),o.dataset.until=String(d.until),d.id!==void 0&&t.select){const c=d.id;o.dataset.id=c,o.addEventListener("pointerdown",m=>{m.stopPropagation(),t.select(c)})}o.style.top=`${h/s.length*100}%`,o.style.height=`${100/s.length}%`,e.append(o)}for(const d of t.times){const h=document.createElement("span");h.className="kf",h.dataset.t=String(d),e.append(h)}t.move&&(e.dataset.movable="");for(const d of["before","after"]){const h=document.createElement("span");h.className="outside",h.dataset.side=d,e.prepend(h)}const n=document.createElement("span");n.className="playhead",e.append(n),e.addEventListener("pointerdown",d=>this.dragPlayhead(e,t,d));const r=document.createElement("button");r.type="button",r.className="icon-btn track-add",r.innerHTML=u.PLUS,r.addEventListener("click",()=>t.add());const l=document.createElement("div");l.className="track-row",l.append(i,e,r),this.host.append(l),this.lanes.set(t.id,e),this.adds.set(t.id,r)}this.host.append(this.scroll),this.layout()}layout(){const t=this.windowStart+this.windowLength,i=Math.max(1,this.duration);for(const s of this.lanes.values()){for(const a of s.querySelectorAll(".outside")){const[n,r]=a.dataset.side==="before"?[this.windowStart,Math.min(t,0)]:[Math.max(this.windowStart,i),t];a.hidden=r<=n,a.style.left=`${this.x(n)}%`,a.style.width=`${this.x(r)-this.x(n)}%`}for(const a of s.querySelectorAll(".span")){const n=Math.max(this.windowStart,Number(a.dataset.t)),r=Math.min(t,Number(a.dataset.until));a.hidden=r<=n,a.style.left=`${this.x(n)}%`,a.style.width=`${this.x(r)-this.x(n)}%`}for(const a of s.querySelectorAll(".kf")){const n=Number(a.dataset.t);a.hidden=n<this.windowStart||n>t,a.style.left=`${this.x(n)}%`}}const e=this.extentEnd-this.extentStart;this.scroll.hidden=!this.zoomed,this.scroll.title=this.messages.zoomHint,this.thumb.style.left=`${(this.windowStart-this.extentStart)/e*100}%`,this.thumb.style.width=`${this.windowLength/e*100}%`}dragPlayhead(t,i,e){const s=this.instantAt(t,e);if(s===void 0)return;const a=this.keyNear(t,i,s);t.setPointerCapture?.(e.pointerId);let n=d=>this.seekFrom(t,i,d),r=()=>{};if(a!==void 0&&i.move){const d=[...t.querySelectorAll(".kf")].find(o=>Number(o.dataset.t)===a);let h=a;this.seekTo(a),n=o=>{const c=this.instantAt(t,o);c===void 0||!d||(h=Math.round(Math.min(this.extentEnd,Math.max(this.extentStart,c))/100)*100,d.style.left=`${this.x(h)}%`,this.seekTo(h))},r=()=>{h!==a&&i.move(a,h)}}else this.seekTo(a??s);i.pressed?.(s,a);const l=()=>{r(),t.removeEventListener("pointermove",n),t.removeEventListener("pointerup",l),t.removeEventListener("pointercancel",l)};t.addEventListener("pointermove",n),t.addEventListener("pointerup",l),t.addEventListener("pointercancel",l)}seekFrom(t,i,e){const s=this.instantAt(t,e);s!==void 0&&this.seekTo(this.keyNear(t,i,s)??s)}instantAt(t,i){const e=t.getBoundingClientRect();if(e.width!==0)return this.windowStart+(i.clientX-e.left)/e.width*this.windowLength}keyNear(t,i,e){const s=6/t.getBoundingClientRect().width*this.windowLength;return i.times.reduce((a,n)=>Math.abs(n-e)<=s&&(a===void 0||Math.abs(n-e)<Math.abs(a-e))?n:a,void 0)}seekTo(t){this.seek(Math.round(Math.min(Math.max(1,this.duration),Math.max(0,t))))}place(t){const i=this.windowStart+this.windowLength;for(const e of this.tracks){const s=this.lanes.get(e.id),a=this.adds.get(e.id);if(!s||!a)continue;const n=s.parentElement,r=n.querySelector(".track-name");e.active===void 0?(delete n.dataset.active,r?.removeAttribute("aria-pressed")):(n.dataset.active=String(e.active),r?.setAttribute("aria-pressed",String(e.active)));const l=e.times.some(o=>Math.abs(o-t)<1);for(const o of s.querySelectorAll(".kf")){const c=Number(o.dataset.t);o.setAttribute("aria-current",String(Math.abs(c-t)<1)),o.dataset.selected=String(e.selectedTime!==void 0&&Math.abs(e.selectedTime-c)<1)}for(const o of s.querySelectorAll(".span[data-id]"))o.setAttribute("aria-selected",String(o.dataset.id===e.selected));const d=s.querySelector(".playhead");d.hidden=t<this.windowStart||t>i,d.style.left=`${this.x(Math.min(Math.max(1,this.duration),t))}%`;const h=`${e.label} · ${l?this.messages.keyframeHere:this.messages.addKeyframeHere}`;a.title=h,a.setAttribute("aria-label",h)}}}export{p as T};
@@ -1,4 +1,4 @@
1
- import{I as ee,F,v as G,w as M,W as te,x as j,y as $,z as E,E as ie,H as O,U as J,m as ne,J as I,k as se,K as B,N as oe,O as ae,P as re,G as le,C as ce,Q as de,o as fe,X as ue,Y as pe,Z as he,$ as me,a0 as V,j as ge}from"./rr0-sighting.mjs";const k=new j,P=new E;class Q extends ee{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],n=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],i=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(i),this.setAttribute("position",new F(e,3)),this.setAttribute("uv",new F(n,2))}applyMatrix4(e){const n=this.attributes.instanceStart,i=this.attributes.instanceEnd;return n!==void 0&&(n.applyMatrix4(e),i.applyMatrix4(e),n.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));const i=new G(n,6,1);return this.setAttribute("instanceStart",new M(i,3,0)),this.setAttribute("instanceEnd",new M(i,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));const i=new G(n,6,1);return this.setAttribute("instanceColorStart",new M(i,3,0)),this.setAttribute("instanceColorEnd",new M(i,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new te(e.geometry)),this}fromLineSegments(e){const n=e.geometry;return this.setPositions(n.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new j);const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;e!==void 0&&n!==void 0&&(this.boundingBox.setFromBufferAttribute(e),k.setFromBufferAttribute(n),this.boundingBox.union(k))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new $),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;if(e!==void 0&&n!==void 0){const i=this.boundingSphere.center;this.boundingBox.getCenter(i);let t=0;for(let o=0,l=e.count;o<l;o++)P.fromBufferAttribute(e,o),t=Math.max(t,i.distanceToSquared(P)),P.fromBufferAttribute(n,o),t=Math.max(t,i.distanceToSquared(P));this.boundingSphere.radius=Math.sqrt(t),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}}I.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new ne},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};O.line={uniforms:J.merge([I.common,I.fog,I.line]),vertexShader:`
1
+ import{z as ee,v as F,E as G,J as M,W as te,K as j,N as $,Q as E,X as ie,Y as O,Z as J,q as ne,$ as I,o as se,a0 as B,a1 as oe,a2 as ae,a3 as re,G as le,C as ce,a4 as de,u as fe,a5 as ue,a6 as pe,a7 as he,a8 as me,a9 as V,n as ge}from"./rr0-sighting.mjs";const k=new j,P=new E;class Q extends ee{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],n=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],i=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(i),this.setAttribute("position",new F(e,3)),this.setAttribute("uv",new F(n,2))}applyMatrix4(e){const n=this.attributes.instanceStart,i=this.attributes.instanceEnd;return n!==void 0&&(n.applyMatrix4(e),i.applyMatrix4(e),n.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));const i=new G(n,6,1);return this.setAttribute("instanceStart",new M(i,3,0)),this.setAttribute("instanceEnd",new M(i,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));const i=new G(n,6,1);return this.setAttribute("instanceColorStart",new M(i,3,0)),this.setAttribute("instanceColorEnd",new M(i,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new te(e.geometry)),this}fromLineSegments(e){const n=e.geometry;return this.setPositions(n.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new j);const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;e!==void 0&&n!==void 0&&(this.boundingBox.setFromBufferAttribute(e),k.setFromBufferAttribute(n),this.boundingBox.union(k))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new $),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;if(e!==void 0&&n!==void 0){const i=this.boundingSphere.center;this.boundingBox.getCenter(i);let t=0;for(let o=0,l=e.count;o<l;o++)P.fromBufferAttribute(e,o),t=Math.max(t,i.distanceToSquared(P)),P.fromBufferAttribute(n,o),t=Math.max(t,i.distanceToSquared(P));this.boundingSphere.radius=Math.sqrt(t),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}}I.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new ne},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};O.line={uniforms:J.merge([I.common,I.fog,I.line]),vertexShader:`
2
2
  #include <common>
3
3
  #include <color_pars_vertex>
4
4
  #include <fog_pars_vertex>
@@ -390,4 +390,4 @@ import{I as ee,F,v as G,w as M,W as te,x as j,y as $,z as E,E as ie,H as O,U as
390
390
  #include <premultiplied_alpha_fragment>
391
391
 
392
392
  }
393
- `};class N extends ie{constructor(e){super({type:"LineMaterial",uniforms:J.clone(O.line.uniforms),vertexShader:O.line.vertexShader,fragmentShader:O.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0!==this.worldUnits&&(this.needsUpdate=!0),e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const H=new B,X=new E,q=new E,f=new B,u=new B,x=new B,W=new E,R=new ae,p=new oe,K=new E,T=new j,C=new $,S=new B;let b,z;function Z(h,e,n){return S.set(0,0,-e,1).applyMatrix4(h.projectionMatrix),S.multiplyScalar(1/S.w),S.x=z/n.width,S.y=z/n.height,S.applyMatrix4(h.projectionMatrixInverse),S.multiplyScalar(1/S.w),Math.abs(Math.max(S.x,S.y))}function ve(h,e){const n=h.matrixWorld,i=h.geometry,t=i.attributes.instanceStart,o=i.attributes.instanceEnd,l=Math.min(i.instanceCount,t.count);for(let s=0,a=l;s<a;s++){p.start.fromBufferAttribute(t,s),p.end.fromBufferAttribute(o,s),p.applyMatrix4(n);const d=new E,m=new E;b.distanceSqToSegment(p.start,p.end,m,d),m.distanceTo(d)<z*.5&&e.push({point:m,pointOnLine:d,distance:b.origin.distanceTo(m),object:h,face:null,faceIndex:s,uv:null,uv1:null})}}function ye(h,e,n){const i=e.projectionMatrix,o=h.material.resolution,l=h.matrixWorld,s=h.geometry,a=s.attributes.instanceStart,d=s.attributes.instanceEnd,m=Math.min(s.instanceCount,a.count),c=-e.near;b.at(1,x),x.w=1,x.applyMatrix4(e.matrixWorldInverse),x.applyMatrix4(i),x.multiplyScalar(1/x.w),x.x*=o.x/2,x.y*=o.y/2,x.z=0,W.copy(x),R.multiplyMatrices(e.matrixWorldInverse,l);for(let g=0,r=m;g<r;g++){if(f.fromBufferAttribute(a,g),u.fromBufferAttribute(d,g),f.w=1,u.w=1,f.applyMatrix4(R),u.applyMatrix4(R),f.z>c&&u.z>c)continue;if(f.z>c){const _=f.z-u.z,w=(f.z-c)/_;f.lerp(u,w)}else if(u.z>c){const _=u.z-f.z,w=(u.z-c)/_;u.lerp(f,w)}f.applyMatrix4(i),u.applyMatrix4(i),f.multiplyScalar(1/f.w),u.multiplyScalar(1/u.w),f.x*=o.x/2,f.y*=o.y/2,u.x*=o.x/2,u.y*=o.y/2,p.start.copy(f),p.start.z=0,p.end.copy(u),p.end.z=0;const y=p.closestPointToPointParameter(W,!0);p.at(y,K);const U=re.lerp(f.z,u.z,y),L=U>=-1&&U<=1,D=W.distanceTo(K)<z*.5;if(L&&D){p.start.fromBufferAttribute(a,g),p.end.fromBufferAttribute(d,g),p.start.applyMatrix4(l),p.end.applyMatrix4(l);const _=new E,w=new E;b.distanceSqToSegment(p.start,p.end,w,_),n.push({point:w,pointOnLine:_,distance:b.origin.distanceTo(w),object:h,face:null,faceIndex:g,uv:null,uv1:null})}}}class we extends se{constructor(e=new Q,n=new N({color:Math.random()*16777215})){super(e,n),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,n=e.attributes.instanceStart,i=e.attributes.instanceEnd,t=new Float32Array(2*n.count);for(let l=0,s=0,a=n.count;l<a;l++,s+=2)X.fromBufferAttribute(n,l),q.fromBufferAttribute(i,l),t[s]=s===0?0:t[s-1],t[s+1]=t[s]+X.distanceTo(q);const o=new G(t,2,1);return e.setAttribute("instanceDistanceStart",new M(o,1,0)),e.setAttribute("instanceDistanceEnd",new M(o,1,1)),this}raycast(e,n){const i=this.material.worldUnits,t=e.camera;if(t===null&&!i&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.'),i===!1&&(this.material.resolution.x===0||this.material.resolution.y===0))return;const o=e.params.Line2!==void 0&&e.params.Line2.threshold||0;b=e.ray;const l=this.matrixWorld,s=this.geometry,a=this.material;z=a.linewidth+o,s.boundingSphere===null&&s.computeBoundingSphere(),C.copy(s.boundingSphere).applyMatrix4(l);let d;if(i)d=z*.5;else{const c=Math.max(t.near,C.distanceToPoint(b.origin));d=Z(t,c,a.resolution)}if(C.radius+=d,b.intersectsSphere(C)===!1)return;s.boundingBox===null&&s.computeBoundingBox(),T.copy(s.boundingBox).applyMatrix4(l);let m;if(i)m=z*.5;else{const c=Math.max(t.near,T.distanceToPoint(b.origin));m=Z(t,c,a.resolution)}T.expandByScalar(m),b.intersectsBox(T)!==!1&&(i?ve(this,n):ye(this,t,n))}onBeforeRender(e){const n=this.material.uniforms;n&&n.resolution&&(e.getViewport(H),this.material.uniforms.resolution.value.set(H.z,H.w))}}class Y extends Q{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const n=e.length-3,i=new Float32Array(2*n);for(let t=0;t<n;t+=3)i[2*t]=e[t],i[2*t+1]=e[t+1],i[2*t+2]=e[t+2],i[2*t+3]=e[t+3],i[2*t+4]=e[t+4],i[2*t+5]=e[t+5];return super.setPositions(i),this}setColors(e){const n=e.length-3,i=new Float32Array(2*n);for(let t=0;t<n;t+=3)i[2*t]=e[t],i[2*t+1]=e[t+1],i[2*t+2]=e[t+2],i[2*t+3]=e[t+3],i[2*t+4]=e[t+4],i[2*t+5]=e[t+5];return super.setColors(i),this}setFromPoints(e){const n=e.length-1,i=new Float32Array(6*n);for(let t=0;t<n;t++)i[6*t]=e[t].x,i[6*t+1]=e[t].y,i[6*t+2]=e[t].z||0,i[6*t+3]=e[t+1].x,i[6*t+4]=e[t+1].y,i[6*t+5]=e[t+1].z||0;return super.setPositions(i),this}fromLine(e){const n=e.geometry;return this.setPositions(n.attributes.position.array),this}}class xe extends we{constructor(e=new Y,n=new N({color:Math.random()*16777215})){super(e,n),this.isLine2=!0,this.type="Line2"}}class A{constructor(e){this.layer=e,this.group.name="traces"}static LINE_WIDTH_PX=2.5;static MARKER_SIZE_PX=9;static LABEL_HEIGHT_PX=15;static STEP_M=15;static LIFT_M=.3;group=new le;materials=[];pointsMaterials=[];labels=[];viewportHeightPx=720;fovDeg=60;set(e,n,i,t,o,l){this.empty();for(const s of e){const a=this.positions(s,i,t,o,l),d=new ce(s.color??de),m=n.get(s.id);if(m&&a.length>=3&&this.addLabel(m,this.labelAnchor(a,s.kind)),s.kind==="point"){const c=new fe;c.setAttribute("position",new F(a.slice(0,3),3));const g=new ue({color:d,size:A.MARKER_SIZE_PX,sizeAttenuation:!1,depthTest:!1,fog:!1});this.pointsMaterials.push(g);const r=new pe(c,g);r.name="trace point",r.frustumCulled=!1,r.layers.set(this.layer),this.group.add(r)}else if(a.length>=6){const c=new Y;c.setPositions(s.kind==="polygon"?[...a,a[0],a[1],a[2]]:a);const g=new N({color:d.getHex(),linewidth:A.LINE_WIDTH_PX,worldUnits:!1,transparent:!0,opacity:.92,depthTest:!1,fog:!1});this.materials.push(g);const r=new xe(c,g);r.name=`trace ${s.kind}`,r.frustumCulled=!1,r.layers.set(this.layer),this.group.add(r)}}}setView(e,n){for(const i of this.materials)i.resolution.copy(e);e.y===this.viewportHeightPx&&n===this.fovDeg||(this.viewportHeightPx=e.y,this.fovDeg=n,this.scaleLabels())}get any(){return this.group.children.length>0}dispose(){this.empty()}labelAnchor(e,n){let i=0;if(n==="line"){let t=-1;for(let o=0;o+2<e.length;o+=3){const l=Math.hypot(e[o],e[o+2]);l>t&&(t=l,i=o)}}return[e[i],e[i+1],e[i+2]]}addLabel(e,n){const i=document.createElement("canvas"),t=i.getContext("2d");if(!t)return;const o="bold 30px sans-serif";t.font=o;const l=10;i.width=Math.ceil(t.measureText(e).width)+l*2,i.height=44,t.font=o,t.fillStyle="rgba(0, 0, 0, 0.6)",t.beginPath(),t.roundRect(0,0,i.width,i.height,10),t.fill(),t.fillStyle="#ffffff",t.textBaseline="middle",t.fillText(e,l,i.height/2+2);const s=new he({map:new me(i),depthTest:!1,depthWrite:!1,fog:!1,sizeAttenuation:!1}),a=new V(s);a.name="trace name",a.center.set(0,0),a.position.set(n[0],n[1],n[2]),a.frustumCulled=!1,a.layers.set(this.layer),this.labels.push({sprite:a,aspect:i.width/i.height}),this.group.add(a),this.scaleLabels()}scaleLabels(){const e=A.LABEL_HEIGHT_PX/(this.viewportHeightPx/2)*Math.tan(this.fovDeg*Math.PI/360);for(const{sprite:n,aspect:i}of this.labels)n.scale.set(e*i,e,1)}empty(){for(const e of[...this.group.children])this.group.remove(e),e instanceof V?(e.material.map?.dispose(),e.material.dispose()):e.geometry.dispose();this.labels.length=0;for(const e of this.materials.splice(0))e.dispose();for(const e of this.pointsMaterials.splice(0))e.dispose()}positions(e,n,i,t,o){const l=e.altitude??"ground",s=e.points.map(r=>{const{x:v,z:y}=ge(r.lat,r.lng,n,i);return{x:v,z:y,altM:r.altM??0}}),a=l!=="absolute",d=[],m=(r,v,y)=>l==="absolute"?y-t:o(r,v)+(l==="relative"?y:0)+A.LIFT_M,c=e.kind==="polygon",g=c?s.length:s.length-1;for(let r=0;r<Math.max(g,1);r++){const v=s[r],y=s[(r+1)%s.length],U=a&&e.kind!=="point"?Math.max(1,Math.ceil(Math.hypot(y.x-v.x,y.z-v.z)/A.STEP_M)):1;for(let L=0;L<U;L++){const D=L/U,_=v.x+(y.x-v.x)*D,w=v.z+(y.z-v.z)*D;d.push(_,m(_,w,v.altM+(y.altM-v.altM)*D),w)}}if(!c&&e.kind!=="point"){const r=s[s.length-1];d.push(r.x,m(r.x,r.z,r.altM),r.z)}return d}}export{A as TraceSystem};
393
+ `};class N extends ie{constructor(e){super({type:"LineMaterial",uniforms:J.clone(O.line.uniforms),vertexShader:O.line.vertexShader,fragmentShader:O.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0!==this.worldUnits&&(this.needsUpdate=!0),e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const H=new B,X=new E,q=new E,f=new B,u=new B,x=new B,W=new E,R=new ae,p=new oe,K=new E,T=new j,C=new $,S=new B;let b,z;function Z(h,e,n){return S.set(0,0,-e,1).applyMatrix4(h.projectionMatrix),S.multiplyScalar(1/S.w),S.x=z/n.width,S.y=z/n.height,S.applyMatrix4(h.projectionMatrixInverse),S.multiplyScalar(1/S.w),Math.abs(Math.max(S.x,S.y))}function ve(h,e){const n=h.matrixWorld,i=h.geometry,t=i.attributes.instanceStart,o=i.attributes.instanceEnd,l=Math.min(i.instanceCount,t.count);for(let s=0,a=l;s<a;s++){p.start.fromBufferAttribute(t,s),p.end.fromBufferAttribute(o,s),p.applyMatrix4(n);const d=new E,m=new E;b.distanceSqToSegment(p.start,p.end,m,d),m.distanceTo(d)<z*.5&&e.push({point:m,pointOnLine:d,distance:b.origin.distanceTo(m),object:h,face:null,faceIndex:s,uv:null,uv1:null})}}function ye(h,e,n){const i=e.projectionMatrix,o=h.material.resolution,l=h.matrixWorld,s=h.geometry,a=s.attributes.instanceStart,d=s.attributes.instanceEnd,m=Math.min(s.instanceCount,a.count),c=-e.near;b.at(1,x),x.w=1,x.applyMatrix4(e.matrixWorldInverse),x.applyMatrix4(i),x.multiplyScalar(1/x.w),x.x*=o.x/2,x.y*=o.y/2,x.z=0,W.copy(x),R.multiplyMatrices(e.matrixWorldInverse,l);for(let g=0,r=m;g<r;g++){if(f.fromBufferAttribute(a,g),u.fromBufferAttribute(d,g),f.w=1,u.w=1,f.applyMatrix4(R),u.applyMatrix4(R),f.z>c&&u.z>c)continue;if(f.z>c){const _=f.z-u.z,w=(f.z-c)/_;f.lerp(u,w)}else if(u.z>c){const _=u.z-f.z,w=(u.z-c)/_;u.lerp(f,w)}f.applyMatrix4(i),u.applyMatrix4(i),f.multiplyScalar(1/f.w),u.multiplyScalar(1/u.w),f.x*=o.x/2,f.y*=o.y/2,u.x*=o.x/2,u.y*=o.y/2,p.start.copy(f),p.start.z=0,p.end.copy(u),p.end.z=0;const y=p.closestPointToPointParameter(W,!0);p.at(y,K);const L=re.lerp(f.z,u.z,y),U=L>=-1&&L<=1,D=W.distanceTo(K)<z*.5;if(U&&D){p.start.fromBufferAttribute(a,g),p.end.fromBufferAttribute(d,g),p.start.applyMatrix4(l),p.end.applyMatrix4(l);const _=new E,w=new E;b.distanceSqToSegment(p.start,p.end,w,_),n.push({point:w,pointOnLine:_,distance:b.origin.distanceTo(w),object:h,face:null,faceIndex:g,uv:null,uv1:null})}}}class we extends se{constructor(e=new Q,n=new N({color:Math.random()*16777215})){super(e,n),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,n=e.attributes.instanceStart,i=e.attributes.instanceEnd,t=new Float32Array(2*n.count);for(let l=0,s=0,a=n.count;l<a;l++,s+=2)X.fromBufferAttribute(n,l),q.fromBufferAttribute(i,l),t[s]=s===0?0:t[s-1],t[s+1]=t[s]+X.distanceTo(q);const o=new G(t,2,1);return e.setAttribute("instanceDistanceStart",new M(o,1,0)),e.setAttribute("instanceDistanceEnd",new M(o,1,1)),this}raycast(e,n){const i=this.material.worldUnits,t=e.camera;if(t===null&&!i&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.'),i===!1&&(this.material.resolution.x===0||this.material.resolution.y===0))return;const o=e.params.Line2!==void 0&&e.params.Line2.threshold||0;b=e.ray;const l=this.matrixWorld,s=this.geometry,a=this.material;z=a.linewidth+o,s.boundingSphere===null&&s.computeBoundingSphere(),C.copy(s.boundingSphere).applyMatrix4(l);let d;if(i)d=z*.5;else{const c=Math.max(t.near,C.distanceToPoint(b.origin));d=Z(t,c,a.resolution)}if(C.radius+=d,b.intersectsSphere(C)===!1)return;s.boundingBox===null&&s.computeBoundingBox(),T.copy(s.boundingBox).applyMatrix4(l);let m;if(i)m=z*.5;else{const c=Math.max(t.near,T.distanceToPoint(b.origin));m=Z(t,c,a.resolution)}T.expandByScalar(m),b.intersectsBox(T)!==!1&&(i?ve(this,n):ye(this,t,n))}onBeforeRender(e){const n=this.material.uniforms;n&&n.resolution&&(e.getViewport(H),this.material.uniforms.resolution.value.set(H.z,H.w))}}class Y extends Q{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const n=e.length-3,i=new Float32Array(2*n);for(let t=0;t<n;t+=3)i[2*t]=e[t],i[2*t+1]=e[t+1],i[2*t+2]=e[t+2],i[2*t+3]=e[t+3],i[2*t+4]=e[t+4],i[2*t+5]=e[t+5];return super.setPositions(i),this}setColors(e){const n=e.length-3,i=new Float32Array(2*n);for(let t=0;t<n;t+=3)i[2*t]=e[t],i[2*t+1]=e[t+1],i[2*t+2]=e[t+2],i[2*t+3]=e[t+3],i[2*t+4]=e[t+4],i[2*t+5]=e[t+5];return super.setColors(i),this}setFromPoints(e){const n=e.length-1,i=new Float32Array(6*n);for(let t=0;t<n;t++)i[6*t]=e[t].x,i[6*t+1]=e[t].y,i[6*t+2]=e[t].z||0,i[6*t+3]=e[t+1].x,i[6*t+4]=e[t+1].y,i[6*t+5]=e[t+1].z||0;return super.setPositions(i),this}fromLine(e){const n=e.geometry;return this.setPositions(n.attributes.position.array),this}}class xe extends we{constructor(e=new Y,n=new N({color:Math.random()*16777215})){super(e,n),this.isLine2=!0,this.type="Line2"}}class A{constructor(e){this.layer=e,this.group.name="traces"}static LINE_WIDTH_PX=2.5;static MARKER_SIZE_PX=9;static LABEL_HEIGHT_PX=15;static STEP_M=15;static LIFT_M=.3;group=new le;materials=[];pointsMaterials=[];labels=[];viewportHeightPx=720;fovDeg=60;set(e,n,i,t,o,l){this.empty();for(const s of e){const a=this.positions(s,i,t,o,l),d=new ce(s.color??de),m=n.get(s.id);if(m&&a.length>=3&&this.addLabel(m,this.labelAnchor(a,s.kind)),s.kind==="point"){const c=new fe;c.setAttribute("position",new F(a.slice(0,3),3));const g=new ue({color:d,size:A.MARKER_SIZE_PX,sizeAttenuation:!1,depthTest:!1,fog:!1});this.pointsMaterials.push(g);const r=new pe(c,g);r.name="trace point",r.frustumCulled=!1,r.layers.set(this.layer),this.group.add(r)}else if(a.length>=6){const c=new Y;c.setPositions(s.kind==="polygon"?[...a,a[0],a[1],a[2]]:a);const g=new N({color:d.getHex(),linewidth:A.LINE_WIDTH_PX,worldUnits:!1,transparent:!0,opacity:.92,depthTest:!1,fog:!1});this.materials.push(g);const r=new xe(c,g);r.name=`trace ${s.kind}`,r.frustumCulled=!1,r.layers.set(this.layer),this.group.add(r)}}}setView(e,n){for(const i of this.materials)i.resolution.copy(e);e.y===this.viewportHeightPx&&n===this.fovDeg||(this.viewportHeightPx=e.y,this.fovDeg=n,this.scaleLabels())}get any(){return this.group.children.length>0}dispose(){this.empty()}labelAnchor(e,n){let i=0;if(n==="line"){let t=-1;for(let o=0;o+2<e.length;o+=3){const l=Math.hypot(e[o],e[o+2]);l>t&&(t=l,i=o)}}return[e[i],e[i+1],e[i+2]]}addLabel(e,n){const i=document.createElement("canvas"),t=i.getContext("2d");if(!t)return;const o="bold 30px sans-serif";t.font=o;const l=10;i.width=Math.ceil(t.measureText(e).width)+l*2,i.height=44,t.font=o,t.fillStyle="rgba(0, 0, 0, 0.6)",t.beginPath(),t.roundRect(0,0,i.width,i.height,10),t.fill(),t.fillStyle="#ffffff",t.textBaseline="middle",t.fillText(e,l,i.height/2+2);const s=new he({map:new me(i),depthTest:!1,depthWrite:!1,fog:!1,sizeAttenuation:!1}),a=new V(s);a.name="trace name",a.center.set(0,0),a.position.set(n[0],n[1],n[2]),a.frustumCulled=!1,a.layers.set(this.layer),this.labels.push({sprite:a,aspect:i.width/i.height}),this.group.add(a),this.scaleLabels()}scaleLabels(){const e=A.LABEL_HEIGHT_PX/(this.viewportHeightPx/2)*Math.tan(this.fovDeg*Math.PI/360);for(const{sprite:n,aspect:i}of this.labels)n.scale.set(e*i,e,1)}empty(){for(const e of[...this.group.children])this.group.remove(e),e instanceof V?(e.material.map?.dispose(),e.material.dispose()):e.geometry.dispose();this.labels.length=0;for(const e of this.materials.splice(0))e.dispose();for(const e of this.pointsMaterials.splice(0))e.dispose()}positions(e,n,i,t,o){const l=e.altitude??"ground",s=e.points.map(r=>{const{x:v,z:y}=ge(r.lat,r.lng,n,i);return{x:v,z:y,altM:r.altM??0}}),a=l!=="absolute",d=[],m=(r,v,y)=>l==="absolute"?y-t:o(r,v)+(l==="relative"?y:0)+A.LIFT_M,c=e.kind==="polygon",g=c?s.length:s.length-1;for(let r=0;r<Math.max(g,1);r++){const v=s[r],y=s[(r+1)%s.length],L=a&&e.kind!=="point"?Math.max(1,Math.ceil(Math.hypot(y.x-v.x,y.z-v.z)/A.STEP_M)):1;for(let U=0;U<L;U++){const D=U/L,_=v.x+(y.x-v.x)*D,w=v.z+(y.z-v.z)*D;d.push(_,m(_,w,v.altM+(y.altM-v.altM)*D),w)}}if(!c&&e.kind!=="point"){const r=s[s.length-1];d.push(r.x,m(r.x,r.z,r.altM),r.z)}return d}}export{A as TraceSystem};
@@ -0,0 +1 @@
1
+ import{e}from"./rr0-sighting.mjs";const s={play:"Play",clickToPlay:"Click to play",pause:"Pause",noDuration:"No observation duration",currentPosition:"Current position",duration:"Duration",switchToElapsed:"click to show elapsed time",switchToClockTime:"click to show the time of day",fullscreen:"Fullscreen",exitFullscreen:"Exit fullscreen",mute:"Mute",volume:"Volume",unmute:"Unmute",noSound:"No sound recorded",moments:"Moments",moreControls:"More controls",fewerControls:"Fewer controls",showObserverMap:"Show where the witness was",hideObserverMap:"Hide where the witness was",mapImageryUnavailable:"Aerial imagery unavailable",zoomMapIn:"Zoom in",zoomMapOut:"Zoom out",fitMap:"Back to the whole path",placeObserverHere:"Put the witness here",showReferences:"Show the pictures of the place",hideReferences:"Hide the pictures of the place",showTraces:"Show the investigator's lines",hideTraces:"Hide the investigator's lines",referenceOpacity:"Picture opacity",referencesMenu:"Pictures of the place",showMilestones:"Show the account's moments",hideMilestones:"Hide the account's moments",observerHere:"The witness, here",decorHere:"Scenery",recordingIssues:"{count} problem(s) in this recording: it may not play as its author meant",issueTemplates:e.EN};export{s as ufoMessages_en};
@@ -1 +1 @@
1
- import{G as O,i as w,C as A,j as R,k as M,m as v,n as D,o as F,F as L}from"./rr0-sighting.mjs";class r{static LIFT_M=.05;static RENDER_ORDER=1.04;static LEVEL_QUANTILE=.2;static BODY_ALBEDO=[.035,.045,.04];static IOR=1.33;static ROUGHNESS=.08;static MAX_SAMPLES=48;group=new O;material=new w({color:new A(...r.BODY_ALBEDO),roughness:r.ROUGHNESS,metalness:0,ior:r.IOR,polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2});constructor(){this.group.name="water"}set(s,e,n,p,t,o){this.clear();for(const l of s){const f=l.rings.map(i=>r.clip(i.map(h=>R(h.lat,h.lng,e,n)),t)),a=f[0];if(!a||a.length<3)continue;const g=f.slice(1).filter(i=>i.length>=3),u=r.level(a,g,p,o);if(u===void 0)continue;const c=r.geometry(a,g,u+r.LIFT_M);if(!c)continue;const x=new M(c,this.material);x.name=`water ${l.id}`,x.renderOrder=r.RENDER_ORDER,x.receiveShadow=!0,this.group.add(x)}}get count(){return this.group.children.length}clear(){for(const s of[...this.group.children])s.geometry.dispose(),this.group.remove(s)}dispose(){this.clear(),this.material.dispose()}static level(s,e,n,p){const t=s.map(i=>i.x),o=s.map(i=>i.z),[l,f,a,g]=[Math.min(...t),Math.max(...t),Math.min(...o),Math.max(...o)],u=Math.max(p,(f-l)/r.MAX_SAMPLES,(g-a)/r.MAX_SAMPLES,.5),c=[];for(let i=a+u/2;i<g;i+=u)for(let h=l+u/2;h<f;h+=u){const z={x:h,z:i};if(!r.contains(s,z)||e.some(m=>r.contains(m,z)))continue;const d=n(h,i);Number.isFinite(d)&&c.push(d)}if(c.length===0)for(const i of s)c.push(n(i.x,i.z));const x=c.filter(Number.isFinite).sort((i,h)=>i-h);if(x.length!==0)return x[Math.floor((x.length-1)*r.LEVEL_QUANTILE)]}static clip(s,e){let n=s;const p=[{inside:t=>t.x>=-e,cross:(t,o)=>r.atX(t,o,-e)},{inside:t=>t.x<=e,cross:(t,o)=>r.atX(t,o,e)},{inside:t=>t.z>=-e,cross:(t,o)=>r.atZ(t,o,-e)},{inside:t=>t.z<=e,cross:(t,o)=>r.atZ(t,o,e)}];for(const t of p){const o=[];for(let l=0;l<n.length;l++){const f=n[l],a=n[(l+n.length-1)%n.length];t.inside(f)?(t.inside(a)||o.push(t.cross(a,f)),o.push(f)):t.inside(a)&&o.push(t.cross(a,f))}if(n=o,n.length===0)break}return n}static atX(s,e,n){return{x:n,z:s.z+(e.z-s.z)*(n-s.x)/(e.x-s.x)}}static atZ(s,e,n){return{x:s.x+(e.x-s.x)*(n-s.z)/(e.z-s.z),z:n}}static contains(s,e){let n=!1;for(let p=0,t=s.length-1;p<s.length;t=p++){const o=s[p],l=s[t];o.z>e.z!=l.z>e.z&&e.x<(l.x-o.x)*(e.z-o.z)/(l.z-o.z)+o.x&&(n=!n)}return n}static geometry(s,e,n){const p=c=>new v(c.x,c.z),t=s.map(p),o=e.map(c=>c.map(p)),l=D.triangulateShape(t,o);if(l.length===0)return;const f=[...t,...o.flat()],a=[];for(const[c,x,i]of l){const[h,z,d]=[f[c],f[x],f[i]],m=(z.y-h.y)*(d.x-h.x)-(z.x-h.x)*(d.y-h.y)>0;for(const E of m?[h,z,d]:[h,d,z])a.push(E.x,n,E.y)}const g=new F;g.setAttribute("position",new L(a,3));const u=new Float32Array(a.length);for(let c=1;c<u.length;c+=3)u[c]=1;return g.setAttribute("normal",new L(u,3)),g.computeBoundingSphere(),g}}export{r as WaterSystem};
1
+ import{G as O,m as w,C as A,n as R,o as M,q as v,t as D,u as N,v as L}from"./rr0-sighting.mjs";class r{static LIFT_M=.05;static RENDER_ORDER=1.04;static LEVEL_QUANTILE=.2;static BODY_ALBEDO=[.035,.045,.04];static IOR=1.33;static ROUGHNESS=.08;static MAX_SAMPLES=48;group=new O;material=new w({color:new A(...r.BODY_ALBEDO),roughness:r.ROUGHNESS,metalness:0,ior:r.IOR,polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2});constructor(){this.group.name="water"}set(s,e,n,p,t,o){this.clear();for(const l of s){const f=l.rings.map(i=>r.clip(i.map(h=>R(h.lat,h.lng,e,n)),t)),a=f[0];if(!a||a.length<3)continue;const g=f.slice(1).filter(i=>i.length>=3),u=r.level(a,g,p,o);if(u===void 0)continue;const c=r.geometry(a,g,u+r.LIFT_M);if(!c)continue;const x=new M(c,this.material);x.name=`water ${l.id}`,x.renderOrder=r.RENDER_ORDER,x.receiveShadow=!0,this.group.add(x)}}get count(){return this.group.children.length}clear(){for(const s of[...this.group.children])s.geometry.dispose(),this.group.remove(s)}dispose(){this.clear(),this.material.dispose()}static level(s,e,n,p){const t=s.map(i=>i.x),o=s.map(i=>i.z),[l,f,a,g]=[Math.min(...t),Math.max(...t),Math.min(...o),Math.max(...o)],u=Math.max(p,(f-l)/r.MAX_SAMPLES,(g-a)/r.MAX_SAMPLES,.5),c=[];for(let i=a+u/2;i<g;i+=u)for(let h=l+u/2;h<f;h+=u){const z={x:h,z:i};if(!r.contains(s,z)||e.some(m=>r.contains(m,z)))continue;const d=n(h,i);Number.isFinite(d)&&c.push(d)}if(c.length===0)for(const i of s)c.push(n(i.x,i.z));const x=c.filter(Number.isFinite).sort((i,h)=>i-h);if(x.length!==0)return x[Math.floor((x.length-1)*r.LEVEL_QUANTILE)]}static clip(s,e){let n=s;const p=[{inside:t=>t.x>=-e,cross:(t,o)=>r.atX(t,o,-e)},{inside:t=>t.x<=e,cross:(t,o)=>r.atX(t,o,e)},{inside:t=>t.z>=-e,cross:(t,o)=>r.atZ(t,o,-e)},{inside:t=>t.z<=e,cross:(t,o)=>r.atZ(t,o,e)}];for(const t of p){const o=[];for(let l=0;l<n.length;l++){const f=n[l],a=n[(l+n.length-1)%n.length];t.inside(f)?(t.inside(a)||o.push(t.cross(a,f)),o.push(f)):t.inside(a)&&o.push(t.cross(a,f))}if(n=o,n.length===0)break}return n}static atX(s,e,n){return{x:n,z:s.z+(e.z-s.z)*(n-s.x)/(e.x-s.x)}}static atZ(s,e,n){return{x:s.x+(e.x-s.x)*(n-s.z)/(e.z-s.z),z:n}}static contains(s,e){let n=!1;for(let p=0,t=s.length-1;p<s.length;t=p++){const o=s[p],l=s[t];o.z>e.z!=l.z>e.z&&e.x<(l.x-o.x)*(e.z-o.z)/(l.z-o.z)+o.x&&(n=!n)}return n}static geometry(s,e,n){const p=c=>new v(c.x,c.z),t=s.map(p),o=e.map(c=>c.map(p)),l=D.triangulateShape(t,o);if(l.length===0)return;const f=[...t,...o.flat()],a=[];for(const[c,x,i]of l){const[h,z,d]=[f[c],f[x],f[i]],m=(z.y-h.y)*(d.x-h.x)-(z.x-h.x)*(d.y-h.y)>0;for(const E of m?[h,z,d]:[h,d,z])a.push(E.x,n,E.y)}const g=new N;g.setAttribute("position",new L(a,3));const u=new Float32Array(a.length);for(let c=1;c<u.length;c+=3)u[c]=1;return g.setAttribute("normal",new L(u,3)),g.computeBoundingSphere(),g}}export{r as WaterSystem};