@rr0/ufoathome 0.172.0 → 0.174.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 (164) hide show
  1. package/dist-embed-scene/{AdsbLolArchiveProvider-CmrPztlQ.js → AdsbLolArchiveProvider-liG2xlWV.js} +1 -1
  2. package/dist-embed-scene/{BeamEditor-moWuVLT-.js → BeamEditor-DRrVChwI.js} +1 -1
  3. package/dist-embed-scene/{BeamSystem-DXTXXbc7.js → BeamSystem-CEzXZFNu.js} +1 -1
  4. package/dist-embed-scene/{ContrailSystem-CcDlnjiD.js → ContrailSystem-BSbI2jUe.js} +1 -1
  5. package/dist-embed-scene/{Flightradar24Provider-6Yk43zPK.js → Flightradar24Provider-BkhQ2iqB.js} +1 -1
  6. package/dist-embed-scene/GLTFLoader-UnRP5t__.js +1 -0
  7. package/dist-embed-scene/{HeadlightSystem-B0Ubhwxs.js → HeadlightSystem-Dvc4Rbz-.js} +1 -1
  8. package/dist-embed-scene/{LanternEditor-4v_UpY6t.js → LanternEditor-DCP-Wz-Q.js} +1 -1
  9. package/dist-embed-scene/{LaserBeam-DJnJ5Okd.js → LaserBeam-DfUrxrC_.js} +1 -1
  10. package/dist-embed-scene/{LaunchEditor-DKZ1U9ZU.js → LaunchEditor-DzToEZHF.js} +1 -1
  11. package/dist-embed-scene/{LaunchPlume-DwOSrKP_.js → LaunchPlume-D7l6FeNX.js} +1 -1
  12. package/dist-embed-scene/{LaunchSimulation-ClGdZJHr.js → LaunchSimulation-DKpm2Xqs.js} +1 -1
  13. package/dist-embed-scene/{ModuleSession-BGQH5SEC.js → ModuleSession-VVjH7nnr.js} +2 -2
  14. package/dist-embed-scene/ModuleThree-5mmzRPs2.js +1 -0
  15. package/dist-embed-scene/ParameterForm-BDYo2bPV.js +94 -0
  16. package/dist-embed-scene/{ReentryEditor-Rr_H4UZf.js → ReentryEditor-Dk_CUVvM.js} +1 -1
  17. package/dist-embed-scene/{ReentrySimulation-CrhMgBEf.js → ReentrySimulation-D-FR761p.js} +1 -1
  18. package/dist-embed-scene/ReferenceSystem-BUj-6A76.js +1 -0
  19. package/dist-embed-scene/{SceneNames_en-BL9uncGh.js → SceneNames_en-DGqvOiKr.js} +1 -1
  20. package/dist-embed-scene/{SceneNames_es-CH-eXo8N.js → SceneNames_es-CjXqPgH3.js} +1 -1
  21. package/dist-embed-scene/{SceneNames_fr-DcyxwufJ.js → SceneNames_fr-BJqNnvOr.js} +1 -1
  22. package/dist-embed-scene/{SceneNames_it-DT3v8j9C.js → SceneNames_it-BYKERxdw.js} +1 -1
  23. package/{dist-embed-sighting/TimelineTracks-Cuz5LKXi.js → dist-embed-scene/TimelineTracks-BPVmDKpc.js} +1 -1
  24. package/dist-embed-scene/{TraceSystem-D7pxye9d.js → TraceSystem-gVZk_ffU.js} +1 -1
  25. package/dist-embed-scene/{UfoMessages_en-DiW_p05E.js → UfoMessages_en-wpJoNj_d.js} +1 -1
  26. package/dist-embed-scene/rr0-scene.mjs +299 -279
  27. package/dist-embed-scene/sightingSchema-DZXw4x_Q.js +1 -0
  28. package/dist-embed-scene/trafficRuntime-BgM4IVmy.js +2 -0
  29. package/dist-embed-sighting/{AdsbLolArchiveProvider-B7vb8UEW.js → AdsbLolArchiveProvider-CkHzWGQi.js} +1 -1
  30. package/dist-embed-sighting/BallesterGuaspAssessor-C3AZoSYJ.js +1 -0
  31. package/dist-embed-sighting/{BeamEditor-EW6OYCVG.js → BeamEditor-BJNdmRuT.js} +1 -1
  32. package/dist-embed-sighting/{BeamSystem-Bm8JAQ9L.js → BeamSystem-K3DiM1GA.js} +1 -1
  33. package/dist-embed-sighting/{ContrailSystem-Bgre4cLs.js → ContrailSystem-CRHKaUK-.js} +1 -1
  34. package/dist-embed-sighting/CoverageAssessor-BSoRnjHD.js +1 -0
  35. package/dist-embed-sighting/{Flightradar24Provider-DD9gPyCn.js → Flightradar24Provider--mgNvbo7.js} +1 -1
  36. package/dist-embed-sighting/{GLTFLoader-BWnr870a.js → GLTFLoader-NORF7Wya.js} +1 -1
  37. package/dist-embed-sighting/{HeadlightSystem-CmppP6Mm.js → HeadlightSystem-BrccF2M7.js} +1 -1
  38. package/dist-embed-sighting/{HynekAssessor-tNpli5GC.js → HynekAssessor-BNn-J5RL.js} +1 -1
  39. package/dist-embed-sighting/{LanternEditor-BDrPaoos.js → LanternEditor-v7J6meRk.js} +1 -1
  40. package/dist-embed-sighting/{LaserBeam-Dfjpv2LA.js → LaserBeam-CrsVNYnr.js} +1 -1
  41. package/dist-embed-sighting/{LaunchEditor-Dm5CIbfP.js → LaunchEditor-BQKUng5i.js} +2 -2
  42. package/dist-embed-sighting/{LaunchPlume-DH8ZMXrj.js → LaunchPlume-zs7QuS9V.js} +1 -1
  43. package/dist-embed-sighting/{LaunchSimulation-3m1LUs2t.js → LaunchSimulation-Vj5v57hz.js} +1 -1
  44. package/dist-embed-sighting/{ModuleSession-Bg99aje_.js → ModuleSession-BgHWPEDv.js} +2 -2
  45. package/dist-embed-sighting/ModuleThree-cSwqALyP.js +1 -0
  46. package/dist-embed-sighting/{NearestApproach-hO2JFAfU.js → NearestApproach-Dm99M0L8.js} +1 -1
  47. package/dist-embed-sighting/ParameterForm-BEtRCdpW.js +94 -0
  48. package/dist-embed-sighting/{PoherAssessor-CxcKyCRu.js → PoherAssessor-BUqWHdc2.js} +1 -1
  49. package/dist-embed-sighting/{RailwaySystem-C920HhY6.js → RailwaySystem-Bb0sdKJq.js} +1 -1
  50. package/dist-embed-sighting/ReadingCheckTexts_en-eq6teExJ.js +1 -0
  51. package/dist-embed-sighting/ReadingCheckTexts_es-CR_JJZMV.js +1 -0
  52. package/dist-embed-sighting/ReadingCheckTexts_fr-pcDleIvY.js +1 -0
  53. package/dist-embed-sighting/ReadingCheckTexts_it-MFKeoXnq.js +1 -0
  54. package/dist-embed-sighting/{ReentryEditor-iXEKSCu_.js → ReentryEditor-CMnCxTU4.js} +2 -2
  55. package/dist-embed-sighting/ReentrySimulation-B7bV2GTy.js +1 -0
  56. package/dist-embed-sighting/{ReferenceSystem-DJUjnjNZ.js → ReferenceSystem-s-ggwBEd.js} +1 -1
  57. package/dist-embed-sighting/{RoadMarkings-DDNrriGo.js → RoadMarkings-DiBAmqci.js} +1 -1
  58. package/dist-embed-sighting/{SceneNames_en-BCismFgW.js → SceneNames_en-Cy3_acfm.js} +1 -1
  59. package/dist-embed-sighting/{SceneNames_es-u83jdbyr.js → SceneNames_es-VxS6QttN.js} +1 -1
  60. package/dist-embed-sighting/{SceneNames_fr-hA9CGBs-.js → SceneNames_fr-Dg8Zgkb7.js} +1 -1
  61. package/dist-embed-sighting/{SceneNames_it-Bp7twqSK.js → SceneNames_it-Cf-I4HxZ.js} +1 -1
  62. package/dist-embed-sighting/{SightingMessages_en-BcD8zikg.js → SightingMessages_en-BjIUyT4W.js} +1 -1
  63. package/dist-embed-sighting/{SightingMessages_es-MrTWzprC.js → SightingMessages_es-TueslN1u.js} +1 -1
  64. package/dist-embed-sighting/{SightingMessages_fr-CPZ7UIEm.js → SightingMessages_fr-Dfp6mAcU.js} +1 -1
  65. package/dist-embed-sighting/{SightingMessages_it-0JPA_6O9.js → SightingMessages_it-C0VvJY01.js} +1 -1
  66. package/{dist-embed-scene/TimelineTracks-DcYnMVi8.js → dist-embed-sighting/TimelineTracks-D_Oedo7x.js} +1 -1
  67. package/dist-embed-sighting/{TraceSystem-BrpqiAAJ.js → TraceSystem-DW2kF0O_.js} +1 -1
  68. package/dist-embed-sighting/{WaterSystem-D3andNtL.js → WaterSystem-B1eVrX5D.js} +1 -1
  69. package/dist-embed-sighting/rr0-sighting.mjs +3744 -3724
  70. package/dist-embed-sighting/sightingSchema-DZXw4x_Q.js +1 -0
  71. package/dist-embed-sighting/trafficRuntime-D2QZwJQQ.js +2 -0
  72. package/dist-embed-sighting-editor/{AdsbLolArchiveProvider-DS9ev-HU.js → AdsbLolArchiveProvider-CpaPx7Px.js} +1 -1
  73. package/dist-embed-sighting-editor/BallesterGuaspAssessor-BIHqYTXC.js +1 -0
  74. package/dist-embed-sighting-editor/{BeamEditor-DQp2vKdn.js → BeamEditor-8NrnezeZ.js} +1 -1
  75. package/dist-embed-sighting-editor/{BeamSystem-Dd5G0PNW.js → BeamSystem-CaxJaT_y.js} +1 -1
  76. package/dist-embed-sighting-editor/{BodyEditor-CamqX5Xg.js → BodyEditor-Cj7TgjV-.js} +2 -2
  77. package/dist-embed-sighting-editor/{ContrailSystem-DYAYamnm.js → ContrailSystem-CTAB7sqQ.js} +1 -1
  78. package/dist-embed-sighting-editor/CoverageAssessor-CHa6U2A7.js +1 -0
  79. package/dist-embed-sighting-editor/Flightradar24Provider-DAS99x3c.js +1 -0
  80. package/dist-embed-sighting-editor/{GLTFLoader-DQ9JYWIM.js → GLTFLoader-BLpME7vC.js} +1 -1
  81. package/dist-embed-sighting-editor/GeoExportTexts-DAllttgw.js +1 -0
  82. package/dist-embed-sighting-editor/GeoExportTexts_en-Dq0fSJQp.js +1 -0
  83. package/dist-embed-sighting-editor/GeoExportTexts_es-CoVHdOo0.js +1 -0
  84. package/dist-embed-sighting-editor/GeoExportTexts_fr-DVAMpZIR.js +1 -0
  85. package/dist-embed-sighting-editor/GeoExportTexts_it-Bh1uJBQp.js +1 -0
  86. package/dist-embed-sighting-editor/GeoJsonExport-3snOe-2J.js +2 -0
  87. package/dist-embed-sighting-editor/GeoJsonImport-CIftC0ws.js +1 -0
  88. package/dist-embed-sighting-editor/GeographicFigures-CLBS2HJ-.js +1 -0
  89. package/dist-embed-sighting-editor/{HeadlightSystem-FfcayJJX.js → HeadlightSystem-Crmc9zbw.js} +1 -1
  90. package/dist-embed-sighting-editor/{HynekAssessor-CI7wuMYw.js → HynekAssessor-D_UJjt62.js} +1 -1
  91. package/dist-embed-sighting-editor/{InterviewEditorElement-Bwn4BIQi.js → InterviewEditorElement-DtBxBtVw.js} +2 -2
  92. package/dist-embed-sighting-editor/KmlExport-B0SKgn4U.js +19 -0
  93. package/dist-embed-sighting-editor/{LanternEditor-DT2LvlBk.js → LanternEditor-DWIefcSu.js} +1 -1
  94. package/dist-embed-sighting-editor/{LaserBeam-DCfAd_IK.js → LaserBeam-C_5uHg0U.js} +1 -1
  95. package/dist-embed-sighting-editor/{LaunchEditor-hAMtWhby.js → LaunchEditor-ByC2Emjf.js} +1 -1
  96. package/dist-embed-sighting-editor/{LaunchPlume-B1QcGtTl.js → LaunchPlume-CpAzgYlA.js} +1 -1
  97. package/dist-embed-sighting-editor/{LaunchSimulation-Bl72jnqq.js → LaunchSimulation-D4CHeSnk.js} +1 -1
  98. package/dist-embed-sighting-editor/{ModelSource-CE5kDeLL.js → ModelSource-UJizu116.js} +1 -1
  99. package/dist-embed-sighting-editor/{ModelThumbnails-cuvgO3ks.js → ModelThumbnails-C6MY31ux.js} +1 -1
  100. package/dist-embed-sighting-editor/{ModelViewer-DjGC6fMB.js → ModelViewer-vYoh4mVh.js} +1 -1
  101. package/dist-embed-sighting-editor/{ModuleConformance-H7LbISvs.js → ModuleConformance-D6VFY6JB.js} +2 -2
  102. package/dist-embed-sighting-editor/{ModuleSession-BXk5ijvF.js → ModuleSession-Dsi0JKlc.js} +2 -2
  103. package/dist-embed-sighting-editor/ModuleThree-HknjibVQ.js +1 -0
  104. package/dist-embed-sighting-editor/{ModulesPanelElement-B1KHXTpq.js → ModulesPanelElement-CeEA058j.js} +3 -3
  105. package/dist-embed-sighting-editor/NearestApproach-B8jOOhQy.js +1 -0
  106. package/dist-embed-sighting-editor/{PoherAssessor-YeV1i0Lw.js → PoherAssessor-COIGIPYG.js} +1 -1
  107. package/dist-embed-sighting-editor/{RailwaySystem-CuqGInI5.js → RailwaySystem-DPEyve9f.js} +1 -1
  108. package/dist-embed-sighting-editor/ReadingCheckTexts_en-eq6teExJ.js +1 -0
  109. package/dist-embed-sighting-editor/ReadingCheckTexts_es-CR_JJZMV.js +1 -0
  110. package/dist-embed-sighting-editor/ReadingCheckTexts_fr-pcDleIvY.js +1 -0
  111. package/dist-embed-sighting-editor/ReadingCheckTexts_it-MFKeoXnq.js +1 -0
  112. package/dist-embed-sighting-editor/{ReentryEditor-Bt90y2I7.js → ReentryEditor-pBwTz0Zh.js} +2 -2
  113. package/dist-embed-sighting-editor/{ReentrySimulation-DS7Q5nso.js → ReentrySimulation-Dfg-6_Da.js} +1 -1
  114. package/dist-embed-sighting-editor/{ReferenceSystem-D-bNZI8e.js → ReferenceSystem-CGC3BqZJ.js} +1 -1
  115. package/dist-embed-sighting-editor/{RoadMarkings-GIdi730L.js → RoadMarkings-Cr-sSvIY.js} +1 -1
  116. package/dist-embed-sighting-editor/{SceneNames_en-DNhr4wdu.js → SceneNames_en-DggkchR4.js} +1 -1
  117. package/dist-embed-sighting-editor/{SceneNames_es-DP1RW7Iw.js → SceneNames_es-BtXXqtTk.js} +1 -1
  118. package/dist-embed-sighting-editor/{SceneNames_fr-mGHb5j1M.js → SceneNames_fr-I6FOP0oQ.js} +1 -1
  119. package/dist-embed-sighting-editor/{SceneNames_it-fxUdb_jZ.js → SceneNames_it-DrW4eXBX.js} +1 -1
  120. package/dist-embed-sighting-editor/SightingEditorMessages_en-G8-sD56V.js +12 -0
  121. package/dist-embed-sighting-editor/SightingEditorMessages_es-DEmsmIRU.js +12 -0
  122. package/dist-embed-sighting-editor/SightingEditorMessages_fr-D2HXab_N.js +12 -0
  123. package/dist-embed-sighting-editor/SightingEditorMessages_it-LpFdlGY5.js +12 -0
  124. package/dist-embed-sighting-editor/{SightingFileEditor-CXaZ0zyV.js → SightingFileEditor-BymOujPF.js} +1 -1
  125. package/dist-embed-sighting-editor/TraceImport-CL8lefw6.js +2 -0
  126. package/dist-embed-sighting-editor/{TraceSystem-CUMKKQY4.js → TraceSystem-BAZq4Mcs.js} +2 -2
  127. package/dist-embed-sighting-editor/{UfoMessages_en-DVlS5Elx.js → UfoMessages_en-BxhQNf5z.js} +1 -1
  128. package/dist-embed-sighting-editor/{WaterSystem-BBrkl1Y3.js → WaterSystem-1Sp5frNp.js} +1 -1
  129. package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +5267 -5235
  130. package/dist-embed-sighting-editor/sightingSchema-CUVU5eOl.js +1 -0
  131. package/dist-embed-sighting-editor/trafficRuntime-C9bT5cO9.js +2 -0
  132. package/package.json +1 -1
  133. package/dist-embed-scene/GLTFLoader-BYBOfwYv.js +0 -1
  134. package/dist-embed-scene/ModuleThree-4waMG8o7.js +0 -1
  135. package/dist-embed-scene/ParameterForm-DTX-QXNh.js +0 -85
  136. package/dist-embed-scene/ReferenceSystem-B8i0qbr6.js +0 -1
  137. package/dist-embed-scene/sightingSchema-9ZtPvUrR.js +0 -1
  138. package/dist-embed-scene/trafficRuntime-cS8H9PlA.js +0 -2
  139. package/dist-embed-sighting/BallesterGuaspAssessor-VMcyGlQb.js +0 -1
  140. package/dist-embed-sighting/CoverageAssessor-C7k3p3iN.js +0 -1
  141. package/dist-embed-sighting/ModuleThree-DTr6m1tj.js +0 -1
  142. package/dist-embed-sighting/ParameterForm-CbQHBPju.js +0 -85
  143. package/dist-embed-sighting/ReadingCheckTexts_en-DMSQIyl-.js +0 -1
  144. package/dist-embed-sighting/ReadingCheckTexts_es-U0mwsu1B.js +0 -1
  145. package/dist-embed-sighting/ReadingCheckTexts_fr-BGsdUnRK.js +0 -1
  146. package/dist-embed-sighting/ReadingCheckTexts_it-BGVlr3JP.js +0 -1
  147. package/dist-embed-sighting/ReentrySimulation-BfkUcIGM.js +0 -1
  148. package/dist-embed-sighting/sightingSchema-9ZtPvUrR.js +0 -1
  149. package/dist-embed-sighting/trafficRuntime-BKg4PEmv.js +0 -2
  150. package/dist-embed-sighting-editor/BallesterGuaspAssessor-Baptv_sO.js +0 -1
  151. package/dist-embed-sighting-editor/CoverageAssessor-C9c1Isxw.js +0 -1
  152. package/dist-embed-sighting-editor/Flightradar24Provider-VG9pYq17.js +0 -1
  153. package/dist-embed-sighting-editor/ModuleThree-DsbRgMxg.js +0 -1
  154. package/dist-embed-sighting-editor/NearestApproach-Bw4UBKQD.js +0 -1
  155. package/dist-embed-sighting-editor/ReadingCheckTexts_en-DMSQIyl-.js +0 -1
  156. package/dist-embed-sighting-editor/ReadingCheckTexts_es-U0mwsu1B.js +0 -1
  157. package/dist-embed-sighting-editor/ReadingCheckTexts_fr-BGsdUnRK.js +0 -1
  158. package/dist-embed-sighting-editor/ReadingCheckTexts_it-BGVlr3JP.js +0 -1
  159. package/dist-embed-sighting-editor/SightingEditorMessages_en-B1i2vZCG.js +0 -12
  160. package/dist-embed-sighting-editor/SightingEditorMessages_es-DLhzlNDm.js +0 -12
  161. package/dist-embed-sighting-editor/SightingEditorMessages_fr-B5jPMP9L.js +0 -12
  162. package/dist-embed-sighting-editor/SightingEditorMessages_it-BJwvaU7I.js +0 -12
  163. package/dist-embed-sighting-editor/sightingSchema-9ZtPvUrR.js +0 -1
  164. package/dist-embed-sighting-editor/trafficRuntime-CBsyESZY.js +0 -2
@@ -1,2 +0,0 @@
1
- import{Y as lt,Z as ut,$ as z,a0 as L,a1 as F,a2 as ht,k as q}from"./rr0-sighting-editor.mjs";import{a3 as Ht}from"./rr0-sighting-editor.mjs";import{C as Z}from"./ContrailGrowth-DwHS8If9.js";class A{static OCTAVES=[63,125,250,500,1e3,2e3,4e3,8e3];static STANDARD={temperatureC:15,relativeHumidity:.7,pressureKPa:101.325};static REFERENCE_PRESSURE_KPA=101.325;static REFERENCE_TEMPERATURE_K=293.15;static TRIPLE_POINT_K=273.16;static speedOfSound(t){return 20.0468*Math.sqrt(t+273.15)}static absorptionDbPerKm(t,e=A.STANDARD){const a=e.temperatureC+273.15,n=A.REFERENCE_TEMPERATURE_K,i=e.pressureKPa/A.REFERENCE_PRESSURE_KPA,o=10**(-6.8346*(A.TRIPLE_POINT_K/a)**1.261+4.6151),r=e.relativeHumidity*100*o/i,c=i*(24+40400*r*(.02+r)/(.391+r)),h=i*(a/n)**-.5*(9+280*r*Math.exp(-4.17*((a/n)**(-1/3)-1))),s=t*t;return 8.686*s*(184e-13*(1/i)*Math.sqrt(a/n)+(a/n)**-2.5*(.01275*Math.exp(-2239.1/a)/(c+s/c)+.1068*Math.exp(-3352/a)/(h+s/h)))*1e3}static aWeightingDb(t){const e=t*t,a=12194**2*e*e/((e+20.6**2)*Math.sqrt((e+107.7**2)*(e+737.9**2))*(e+12194**2));return 20*Math.log10(a)+2}static sumDb(t){return 10*Math.log10(t.reduce((e,a)=>e+10**(a/10),0))}}const dt=.25,x=.4,Q=6,U=12,pt=3,tt=.2,gt=.2,Et=24,At=3,mt=12,et=1,Mt=.7,bt=1.5,ft=.8,St=1.3,at=.9,nt=5,Dt=25,Rt=.5,It=.12,it=[.13,.31],Ot=.16,Tt=1.6,Bt=3.6,st=1.1,Nt=.3,vt=1e3,rt=.7;class Y{context;noiseBuffer;roughBuffers=new Map;voices=new Map;bus;reverb;reverbOut;level=1;master;paused=!0;requested=[];headingDeg=0;resume(){if(!this.context){if(typeof AudioContext>"u")return;try{this.context=new AudioContext}catch(t){console.warn("AircraftAudio: Web Audio unavailable, aircraft stay silent:",t);return}}lt.unlock(this.context),this.apply()}setLevel(t){this.level=t,this.master&&(this.master.gain.value=t)}setPaused(t){t!==this.paused&&(this.paused=t,this.apply())}setVoices(t,e=0){this.requested=t,this.headingDeg=e,this.apply()}dispose(){for(const t of[...this.voices.keys()])this.release(t);this.context?.close(),this.context=void 0,this.master=void 0,this.bus=void 0}apply(){const t=this.context;if(!t)return;const e=this.paused?[]:this.requested,a=new Set(e.map(n=>n.id));for(const n of[...this.voices.keys()])a.has(n)||this.release(n);for(const n of e){const i=this.voices.get(n.id)??this.build(t,n);this.retarget(t,i,n)}}build(t,e){const a=t.createGain();a.gain.value=0;let n;const i=this.busOf(t);typeof t.createStereoPanner=="function"?(n=t.createStereoPanner(),a.connect(n).connect(i)):a.connect(i);const o=t.createGain(),r=e.character?.modulationDepth??0;o.gain.value=1-r/2;const c=t.createOscillator();c.type="sine";const h=t.createGain();h.gain.value=r/2,c.connect(h).connect(o.gain),o.connect(a);const s=t.createBufferSource();s.buffer=this.noise(t),s.loop=!0,s.loopStart=Math.random()*Q*.5;const d=[],l=[],u=[];for(const T of A.OCTAVES){const N=t.createBiquadFilter();N.type="bandpass",N.frequency.value=T,N.Q.value=et;const C=t.createBiquadFilter();C.type="bandpass",C.frequency.value=T,C.Q.value=et;const P=t.createGain();P.gain.value=0,s.connect(N).connect(C).connect(P).connect(o),d.push(N),l.push(C),u.push(P)}const p=[];for(const[T,N]of[[e.character?.toneHz,e.character?.toneShare],[e.character?.humHz,e.character?.humShare]])if(T!==void 0)for(let C=1;C<=At;C++){const P=t.createOscillator();P.type="sine",P.frequency.value=T*C;const X=t.createGain();X.gain.value=0,P.connect(X).connect(a),p.push({oscillator:P,gain:X,harmonic:C,baseHz:T,share:N??0})}const g=t.createGain();g.gain.value=0,g.connect(a.gain);const M=it.map(T=>{const N=t.createOscillator();return N.type="sine",N.frequency.value=T,N.connect(g),N}),f=t.createGain();f.gain.value=e.character?.roughness??tt;const R=t.createBufferSource();R.buffer=this.roughTable(t,pt),R.loop=!0,R.loopStart=Math.random()*U*.5,R.connect(f).connect(o.gain);const S=t.createGain();S.gain.value=(e.character?.roughness??tt)*gt;const b=t.createBufferSource();b.buffer=this.roughTable(t,Et),b.loop=!0,b.loopStart=Math.random()*U*.5,b.connect(S).connect(o.gain);let v;const K=this.busOf(t)&&this.reverb;K&&(v=t.createGain(),v.gain.value=0,a.connect(v).connect(K));const V=[s,R,b,c,...p.map(T=>T.oscillator),...M];for(const T of V)T.start();const J={nodes:[a,o,h,f,S,g,...p.map(T=>T.gain),...d,...l,...u,...v?[v]:[],...n?[n]:[],...V],sources:V,filters:d,seconds:l,gains:u,tones:p,lfo:c,lfoDepth:h,wander:M,wanderDepth:g,roughDepth:f,crackleDepth:S,beat:o,output:a,panner:n,send:v};return this.voices.set(e.id,J),J}retarget(t,e,a){const n=t.currentTime,i=(p,g)=>p.setTargetAtTime(g,n,dt),o=Math.min(bt,Math.max(Mt,a.dopplerRatio)),r=Math.min(St,Math.max(ft,Math.sqrt(a.dopplerRatio))),c=t.sampleRate*.45,h=a.bandAmplitudes.map((p,g)=>p*Y.unweighting(A.OCTAVES[g])),s=Math.sqrt(h.reduce((p,g)=>p+g*g,0)),d=Math.min(1,Math.max(0,(a.distanceKm-nt)/(Dt-nt)));A.OCTAVES.forEach((p,g)=>{i(e.filters[g].frequency,Math.min(c,p*r)),i(e.seconds[g].frequency,Math.min(c,p*r)),i(e.gains[g].gain,h[g]*Math.sqrt(vt/p))});const l=a.character;for(const{oscillator:p,gain:g,harmonic:M,baseHz:f,share:R}of e.tones){const S=f*M;i(p.frequency,S*o);const b=S*o;i(g.gain,b<c?R*Ot*h[Y.bandOf(b)]/M:0)}l?.modulationHz!==void 0&&i(e.lfo.frequency,l.modulationHz*o);const u=s>0?rt*(1-Math.exp(-s/rt))/s:1;if(i(e.output.gain,u*(1-Nt*d)),i(e.wanderDepth.gain,u*It*d/it.length),e.send&&i(e.send.gain,Tt*d),e.panner){const p=(a.azimuthDeg-this.headingDeg)*Math.PI/180;i(e.panner.pan,Math.max(-at,Math.min(at,Math.sin(p)))*(1-Rt*d))}}static unweighting(t){return 10**(Math.min(mt,Math.max(0,-A.aWeightingDb(t)))/20)}static bandOf(t){let e=0;return A.OCTAVES.forEach((a,n)=>{Math.abs(Math.log(t/a))<Math.abs(Math.log(t/A.OCTAVES[e]))&&(e=n)}),e}roughTable(t,e){const a=this.roughBuffers.get(e);if(a)return a;const n=Math.floor(t.sampleRate*U),i=t.createBuffer(1,n,t.sampleRate),o=i.getChannelData(0),r=Array.from({length:U*e},()=>(Math.random()*2-1)**3),c=t.sampleRate/e;for(let h=0;h<o.length;h++){const s=h/c,d=Math.floor(s),l=s-d,u=l*l*(3-2*l);o[h]=r[d%r.length]*(1-u)+r[(d+1)%r.length]*u}return this.roughBuffers.set(e,i),i}roomImpulse(t){const e=Math.floor(t.sampleRate*Bt),a=t.createBuffer(2,e,t.sampleRate);for(let n=0;n<2;n++){const i=a.getChannelData(n);let o=0;for(let r=0;r<e;r++){const c=r/t.sampleRate,h=.6*Math.exp(-c/(st*2))+.04;o+=h*(Math.random()*2-1-o),i[r]=o*Math.exp(-c/st)}}return a}busOf(t){if(this.bus)return this.bus;const e=t.createGain();if(e.gain.value=this.level,e.connect(t.destination),this.master=e,typeof t.createConvolver=="function"){const a=t.createConvolver();a.buffer=this.roomImpulse(t);const n=t.createGain();n.gain.value=.9,a.connect(n),this.reverb=a,this.reverbOut=n}if(typeof t.createDynamicsCompressor=="function"){const a=t.createDynamicsCompressor();a.threshold.value=-6,a.knee.value=3,a.ratio.value=4,a.attack.value=.005,a.release.value=.25,a.connect(e),this.bus=a}else this.bus=e;return this.reverbOut?.connect(this.bus),this.bus}release(t){const e=this.voices.get(t);if(!e)return;this.voices.delete(t);const a=this.context;a&&(e.output.gain.setTargetAtTime(0,a.currentTime,x/3),setTimeout(()=>{for(const n of e.sources)try{n.stop()}catch{}for(const n of e.nodes)n.disconnect()},x*1e3*3))}noise(t){if(this.noiseBuffer)return this.noiseBuffer;const e=t.createBuffer(1,t.sampleRate*Q,t.sampleRate),a=e.getChannelData(0);for(let n=0;n<a.length;n++)a[n]=Math.random()*2-1;return this.noiseBuffer=e,e}}class _{static BASE_DB_A=30;static WIND_DB_A=[[0,10],[1,28],[2,36],[3,40],[5,46],[8,52],[12,58],[20,66]];static RAIN_DB_A=[[0,0],[.1,42],[.3,50],[.6,58],[1,65]];static BED_RMS=.2;static MINIMUM_REFERENCE=.008;static WIND_BED_MIN_MS=1;static WIND_BED_FULL_MS=20;static dbA(t){const e=[_.BASE_DB_A,_.along(_.WIND_DB_A,t.windSpeed)];return(t.precipitationType==="rain"||t.precipitationType==="hail")&&e.push(_.along(_.RAIN_DB_A,t.precipitationIntensity)),10*Math.log10(e.filter(a=>a>0).reduce((a,n)=>a+10**(n/10),0))}static bedVolume(t){const e=t.windSpeed>_.WIND_BED_MIN_MS?Math.min(t.windSpeed/_.WIND_BED_FULL_MS,1):0,a=t.precipitationType==="hail"?Math.min(1,t.precipitationIntensity*1.3+.2):t.precipitationType==="rain"?t.precipitationIntensity:0;return Math.hypot(e,a)}static referenceAmplitude(t){return Math.max(_.BED_RMS*_.bedVolume(t),_.MINIMUM_REFERENCE)}static along(t,e){if(e<=t[0][0])return t[0][1];for(let a=1;a<t.length;a++)if(e<=t[a][0]){const[n,i]=t[a-1],[o,r]=t[a];return i+(r-i)*(e-n)/(o-n)}return t[t.length-1][1]}}class y{static TYPES={A318:["Airbus A318","airliner-narrow",34.1,31.4],A319:["Airbus A319","airliner-narrow",34.1,33.8],A320:["Airbus A320","airliner-narrow",34.1,37.6],A321:["Airbus A321","airliner-narrow",34.1,44.5],A19N:["Airbus A319neo","airliner-narrow",35.8,33.8],A20N:["Airbus A320neo","airliner-narrow",35.8,37.6],A21N:["Airbus A321neo","airliner-narrow",35.8,44.5],B737:["Boeing 737-700","airliner-narrow",34.3,33.6],B738:["Boeing 737-800","airliner-narrow",35.8,39.5],B739:["Boeing 737-900","airliner-narrow",35.8,42.1],B38M:["Boeing 737 MAX 8","airliner-narrow",35.9,39.5],B39M:["Boeing 737 MAX 9","airliner-narrow",35.9,42.2],B752:["Boeing 757-200","airliner-narrow",38,47.3],B753:["Boeing 757-300","airliner-narrow",38,54.4],B762:["Boeing 767-200","airliner-wide",47.6,48.5],B763:["Boeing 767-300","airliner-wide",47.6,54.9],B764:["Boeing 767-400","airliner-wide",51.9,61.4],B772:["Boeing 777-200","airliner-wide",60.9,63.7],B77L:["Boeing 777-200LR","airliner-wide",64.8,63.7],B77W:["Boeing 777-300ER","airliner-wide",64.8,73.9],B788:["Boeing 787-8","airliner-wide",60.1,56.7],B789:["Boeing 787-9","airliner-wide",60.1,62.8],B78X:["Boeing 787-10","airliner-wide",60.1,68.3],B744:["Boeing 747-400","airliner-wide",64.4,70.7],B748:["Boeing 747-8","airliner-wide",68.4,76.3],A306:["Airbus A300-600","airliner-wide",44.8,54.1],A310:["Airbus A310","airliner-wide",43.9,46.7],A332:["Airbus A330-200","airliner-wide",60.3,58.8],A333:["Airbus A330-300","airliner-wide",60.3,63.7],A338:["Airbus A330-800","airliner-wide",64,58.8],A339:["Airbus A330-900","airliner-wide",64,63.7],A343:["Airbus A340-300","airliner-wide",60.3,63.7],A346:["Airbus A340-600","airliner-wide",63.5,75.4],A359:["Airbus A350-900","airliner-wide",64.8,66.8],A35K:["Airbus A350-1000","airliner-wide",64.8,73.8],A388:["Airbus A380-800","airliner-wide",79.8,72.7],E170:["Embraer 170","regional-jet",26,29.9],E75L:["Embraer 175","regional-jet",26,31.7],E75S:["Embraer 175","regional-jet",26,31.7],E190:["Embraer 190","regional-jet",28.7,36.2],E195:["Embraer 195","regional-jet",28.7,38.7],E290:["Embraer 190-E2","regional-jet",33.7,36.2],E295:["Embraer 195-E2","regional-jet",33.7,41.5],CRJ2:["Bombardier CRJ200","regional-jet",21.2,26.8],CRJ7:["Bombardier CRJ700","regional-jet",23.2,32.3],CRJ9:["Bombardier CRJ900","regional-jet",24.9,36.2],CRJX:["Bombardier CRJ1000","regional-jet",26.2,39.1],AT72:["ATR 72","regional-turboprop",27.1,27.2],AT76:["ATR 72-600","regional-turboprop",27.1,27.2],AT45:["ATR 42","regional-turboprop",24.6,22.7],DH8D:["Dash 8 Q400","regional-turboprop",28.4,32.8],DH8C:["Dash 8-300","regional-turboprop",27.4,25.7],SF34:["Saab 340","regional-turboprop",21.4,19.7],B190:["Beechcraft 1900","regional-turboprop",17.7,17.6],C25A:["Cessna CitationJet CJ2","business-jet",14.3,14.4],C56X:["Cessna Citation Excel","business-jet",17.2,16],C68A:["Cessna Citation Latitude","business-jet",22,18.9],C550:["Cessna Citation II","business-jet",15.8,14.4],E55P:["Embraer Phenom 300","business-jet",15.9,15.6],E50P:["Embraer Phenom 100","business-jet",12.3,12.8],GLF5:["Gulfstream G550","business-jet",28.5,29.4],FA7X:["Dassault Falcon 7X","business-jet",26.2,23.4],CL60:["Bombardier Challenger 600","business-jet",19.6,20.9],LJ45:["Learjet 45","business-jet",14.6,17.7],H25B:["Hawker 800","business-jet",15.7,15.6],C172:["Cessna 172","light-piston",11,8.3],C152:["Cessna 152","light-piston",10.2,7.3],C182:["Cessna 182","light-piston",10.9,8.8],P28A:["Piper Cherokee","light-piston",10.7,7.2],PA34:["Piper Seneca","light-piston",11.8,8.7],SR20:["Cirrus SR20","light-piston",10.9,7.9],SR22:["Cirrus SR22","light-piston",11.7,7.9],S22T:["Cirrus SR22T","light-piston",11.7,7.9],DA40:["Diamond DA40","light-piston",11.6,8.1],DA42:["Diamond DA42","light-piston",13.4,8.6],BE20:["Beechcraft King Air 200","turboprop-light",16.6,13.3],BE58:["Beechcraft Baron","light-piston",11.5,9.1],C208:["Cessna Caravan","turboprop-light",15.9,11.5],PC12:["Pilatus PC-12","turboprop-light",16.3,14.4],TBM9:["Daher TBM 900","turboprop-light",12.8,10.7],EC35:["Airbus H135","helicopter-light",10.2,12.1],EC45:["Airbus H145","helicopter-medium",11,13.6],AS50:["Airbus H125","helicopter-light",10.7,12.9],EC30:["Airbus H130","helicopter-light",10.7,12.6],B407:["Bell 407","helicopter-light",10.7,12.7],B06:["Bell 206","helicopter-light",10.2,12],B429:["Bell 429","helicopter-medium",10.9,13],B505:["Bell 505","helicopter-light",10.4,11.9],R44:["Robinson R44","helicopter-light",10.1,11.7],R22:["Robinson R22","helicopter-light",7.7,8.8],A109:["Agusta A109","helicopter-medium",11,13],A139:["Leonardo AW139","helicopter-medium",13.8,16.7],S92:["Sikorsky S-92","helicopter-heavy",17.2,20.9],H60:["Sikorsky UH-60 Black Hawk","helicopter-heavy",16.4,19.8],T38:["Northrop T-38 Talon","military-jet",7.7,14.1],HAWK:["BAE Hawk","military-jet",9.4,11.9],GLID:["Glider","glider",17,7],BALL:["Balloon","balloon",15,20],ULAC:["Ultralight","ultralight",9.5,6],C42:["Ikarus C42","ultralight",9.4,6.3],DRON:["Drone","unmanned",1,.6]};static CATEGORIES={A1:["Light aircraft","light-piston",11,8.3],A2:["Small aircraft","business-jet",15,15],A3:["Large aircraft","airliner-narrow",34.1,37.6],A4:["High-vortex large aircraft","airliner-narrow",38,47.3],A5:["Heavy aircraft","airliner-wide",60.3,63.7],A6:["High-performance aircraft","military-jet",8,14],A7:["Rotorcraft","helicopter-medium",10.7,12.7],B1:["Glider","glider",17,7],B2:["Lighter-than-air","balloon",15,20],B4:["Ultralight","ultralight",9.5,6],B6:["Unmanned aircraft","unmanned",1.5,1]};static GENERIC={name:"Airliner",kind:"airliner-narrow",spanM:34.1,lengthM:37.6,basis:"nothing"};static of(t){const e=t?.type?.toUpperCase(),a=e?y.TYPES[e]:void 0;if(a)return{code:e,name:a[0],kind:a[1],spanM:a[2],lengthM:a[3],basis:"type"};const n=t?.category?y.CATEGORIES[t.category]:void 0;return n?{name:n[0],kind:n[1],spanM:n[2],lengthM:n[3],basis:"category"}:{...y.GENERIC}}static isHelicopter(t){return t.kind.startsWith("helicopter")}}class O{static DUSK_SUN_ELEVATION_DEG=-.83;static ALWAYS=new Set(["airliner-narrow","airliner-wide","regional-turboprop","regional-jet","business-jet"]);static NONE=new Set(["glider","balloon"]);static BRIGHTNESS={"light-piston":[.5,.2,.5],"turboprop-light":[.7,.4,.8],ultralight:[.4,.2,.4],unmanned:[0,.05,0],"helicopter-light":[1,1,1],"helicopter-medium":[1,1,1],"helicopter-heavy":[1,1,1],"military-jet":[1,1,1]};static LANDING_LIGHTS_BELOW_FT=1e4;static LANDING_INTENSITY=600;static LANDING_BEAM_DEG=10;static LANDING_COLOR="#fff1dc";static LANDING_BRIGHTNESS={"airliner-narrow":1,"airliner-wide":1,"regional-jet":.6,"regional-turboprop":.6,"business-jet":.4,"turboprop-light":.2,"light-piston":.1,ultralight:.05,"helicopter-light":.1,"helicopter-medium":.2,"helicopter-heavy":.2};static lampsOn(t,e){if(O.NONE.has(t))return{navigation:!1,beacon:!1,strobes:!1};if(O.ALWAYS.has(t))return{navigation:!0,beacon:!0,strobes:!0};const a=e<O.DUSK_SUN_ELEVATION_DEG;return t==="unmanned"?{navigation:!1,beacon:!1,strobes:a}:{navigation:a,beacon:a,strobes:a}}static lights(t,e){const a=O.lampsOn(t.kind,e),n=t.kind.startsWith("helicopter"),i=ut.find(u=>u.id===(n?"helicopter":"airliner")).create(),[o,r]=n?[5,7]:[17,18],c=t.spanM/2/o,h=t.lengthM/2/r,[s,d,l]=O.BRIGHTNESS[t.kind]??[1,1,1];return i.filter(u=>u.id.startsWith("nav")?a.navigation:u.id.startsWith("strobe")?a.strobes:u.id.startsWith("beacon")?a.beacon:!0).filter(u=>!(u.id.startsWith("beacon")&&!a.beacon)).map(u=>{const p=u.id.startsWith("nav")?s:u.id.startsWith("strobe")?d:l;return{...u,offsetM:{x:u.offsetM.x*c,y:u.offsetM.y,z:u.offsetM.z*h},intensity:(u.intensity??1)*p}}).filter(u=>(u.intensity??1)>0)}static landingLights(t,e,a){const n=O.LANDING_BRIGHTNESS[t.kind]??0;if(n===0||!O.lampsOn(t.kind,e).navigation)return[];const i=s=>s<O.LANDING_LIGHTS_BELOW_FT;if(!a.some(s=>i(s.altitudeFt)))return[];const o=O.LANDING_INTENSITY*n,r=a.flatMap((s,d)=>d>0&&i(s.altitudeFt)!==i(a[d-1].altitudeFt)?[{t:s.t,intensity:i(s.altitudeFt)?o:0}]:[]),c=t.spanM/34,h=t.lengthM/36;return[-1,1].map(s=>({id:s<0?"landing-left":"landing-right",offsetM:{x:s*5*c,y:-1,z:3*h},color:O.LANDING_COLOR,intensity:i(a[0].altitudeFt)?o:0,pattern:{kind:"steady"},beamDeg:O.LANDING_BEAM_DEG,keyframes:r}))}static bodyColor(t){return t.kind==="military-jet"?"#8a8e94":t.kind.startsWith("helicopter")?"#c8ccd1":t.kind==="unmanned"?"#2c2e33":"#dde0e4"}}class j{static FAMILIES={"amvlab-a320":["A318","A319","A320","A321","A19N","A20N","A21N"],"amvlab-b737":["B732","B733","B734","B735","B736","B737","B738","B739","B37M","B38M","B39M","B3XM"],"amvlab-a350":["A359","A35K"],"amvlab-a380":["A388"],"amvlab-b787":["B788","B789","B78X"]};static BY_TYPE=new Map(Object.entries(j.FAMILIES).flatMap(([t,e])=>e.map(a=>[a,t])));static idOf(t){return t?j.BY_TYPE.get(t.toUpperCase()):void 0}}class D{static ID_PREFIX=z.ID_PREFIX;static MAX_OBJECTS=40;static FT_TO_M=.3048;static DEG=Math.PI/180;static from(t,e,a,n=D.MAX_OBJECTS,i={}){return new _t(t,e,a,n,i).build()}static idOf(t,e){return z.idOf(t,e)}static keyOf(t){return z.keyOf(t)}static HEIGHT_OVER_LENGTH=.29;static sizeOf(t){return{widthM:t.spanM,lengthM:t.lengthM,heightM:t.lengthM*D.HEIGHT_OVER_LENGTH}}static offsetOf(t,e){const a=L.seenFrom(t,{lat:e.lat,lng:e.lng,heightM:e.altitudeFt*D.FT_TO_M}),n=a.distanceKm*1e3,i=n*Math.cos(a.altitudeDeg*D.DEG);return{eastM:i*Math.sin(a.azimuthDeg*D.DEG),northM:i*Math.cos(a.azimuthDeg*D.DEG),upM:n*Math.sin(a.altitudeDeg*D.DEG),altitudeDeg:a.altitudeDeg,distanceKm:a.distanceKm}}static segments(t){const e=[];let a=[];for(const n of t.points){const i=a[a.length-1];i&&n.t-i.t>F.MAX_GAP_S*1e3&&(e.push(a),a=[]),a.push(n)}return e.push(a),e.filter(n=>n.length>=2)}static bearingDeg(t,e){return(Math.atan2(e.eastM-t.eastM,e.northM-t.northM)/D.DEG+360)%360}}class _t{constructor(t,e,a,n,i){this.tracks=t,this.observer=e,this.startMs=a,this.maxObjects=n,this.options=i}build(){const t=[];for(const a of this.tracks){const n=D.keyOf(a),i=this.options.models?.get(n)??y.of(void 0);D.segments(a).forEach((o,r)=>{const c=o.map(u=>({point:u,at:D.offsetOf(this.observer,u)}));if(!c.some(u=>u.at.altitudeDeg>=0))return;const h=c.map((u,p)=>({t:u.point.t-this.startMs,eastM:u.at.eastM,northM:u.at.northM,altitudeM:u.at.upM,headingDeg:u.point.trackDeg??(p+1<c.length?D.bearingDeg(u.at,c[p+1].at):D.bearingDeg(c[p-1].at,u.at))})),s=D.idOf(a,r),d=c[Math.floor(c.length/2)].point,l=this.options.sunElevationAt?.(d)??90;t.push({object:{id:s,kind:"aircraft",eastM:h[0].eastM,northM:h[0].northM,headingDeg:h[0].headingDeg,sizeM:D.sizeOf(i),model:j.idOf(i.code)?{id:j.idOf(i.code)}:void 0,color:O.bodyColor(i),lights:[...O.lights(i,l),...O.landingLights(i,l,o.map(u=>({t:u.t-this.startMs,altitudeFt:u.altitudeFt})))],track:h},presence:{fromMs:h[0].t,untilMs:h[h.length-1].t},flight:{icao:a.icao,nonIcao:a.nonIcao,points:o},closestKm:Math.min(...c.map(u=>u.at.distanceKm))})})}t.sort((a,n)=>a.closestKm-n.closestKm);const e=t.slice(0,this.maxObjects);return{objects:e.map(a=>a.object),presence:new Map(e.map(a=>[a.object.id,a.presence])),flights:new Map(e.map(a=>[a.object.id,a.flight])),total:t.length,shown:e.length}}}const ct=[{id:"turbofan-narrow-body",name:"Turbofan airliner, narrow-body",kinds:["airliner-narrow"],totalDbA:148,shapeDb:[-32,-17,-9,-6,-5,-7,-12,-22],character:{toneHz:1800,toneShare:.3,humHz:90,humShare:.7}},{id:"turbofan-wide-body",name:"Turbofan airliner, wide-body",kinds:["airliner-wide"],totalDbA:151,shapeDb:[-28,-14,-7,-4,-3,-6,-12,-22],character:{toneHz:1200,toneShare:.3,humHz:70,humShare:.7}},{id:"regional-jet",name:"Regional jet",kinds:["regional-jet"],totalDbA:144,shapeDb:[-32,-17,-9,-5,-4,-6,-11,-21],character:{toneHz:1900,toneShare:.3,humHz:95,humShare:.7}},{id:"business-jet",name:"Business jet",kinds:["business-jet"],totalDbA:141,shapeDb:[-30,-15,-8,-4,-3,-4,-9,-19],character:{toneHz:2500,toneShare:.25,humHz:110,humShare:.7}},{id:"turboprop",name:"Turboprop",kinds:["regional-turboprop","turboprop-light"],totalDbA:138,shapeDb:[-14,-9,-8,-6,-8,-13,-20,-28],character:{toneHz:80,toneShare:.5}},{id:"light-piston",name:"Light piston aircraft",kinds:["light-piston"],totalDbA:130,shapeDb:[-18,-9,-5,-4,-8,-14,-22,-30],character:{toneHz:80,toneShare:.4}},{id:"ultralight",name:"Ultralight",kinds:["ultralight"],totalDbA:124,shapeDb:[-16,-8,-5,-4,-9,-15,-23,-31],character:{toneHz:140,toneShare:.4}},{id:"helicopter-light",name:"Light helicopter",kinds:["helicopter-light"],totalDbA:134,shapeDb:[-15,-8,-4,-3,-6,-10,-16,-24],character:{modulationHz:20,modulationDepth:.5}},{id:"helicopter-medium",name:"Medium helicopter",kinds:["helicopter-medium"],totalDbA:138,shapeDb:[-14,-7,-4,-3,-6,-10,-16,-24],character:{modulationHz:22,modulationDepth:.5}},{id:"helicopter-heavy",name:"Heavy helicopter",kinds:["helicopter-heavy"],totalDbA:144,shapeDb:[-12,-6,-4,-4,-7,-11,-17,-25],character:{modulationHz:17,modulationDepth:.5}},{id:"military-jet",name:"Military jet",kinds:["military-jet"],totalDbA:152,shapeDb:[-26,-12,-6,-3,-2,-3,-7,-15]},{id:"glider",name:"Glider",kinds:["glider"],totalDbA:85,shapeDb:[-30,-22,-15,-10,-8,-8,-14,-22]},{id:"balloon",name:"Hot-air balloon",kinds:["balloon"],totalDbA:100,shapeDb:[-25,-15,-9,-5,-3,-6,-12,-20]},{id:"unmanned",name:"Unmanned aircraft",kinds:["unmanned"],totalDbA:88,shapeDb:[-40,-30,-20,-12,-6,-3,-3,-8],character:{toneHz:450,toneShare:1}}],ot=ct.map(w=>({id:w.id,name:w.name,soundPowerA:w.shapeDb.map(t=>t+w.totalDbA-A.sumDb(w.shapeDb)),character:w.character}));class E{static DEFAULT_AMBIENT_DB_A=35;static DETECTION_MARGIN_DB=3;static AMBIENT_SHAPE_DB=[-12,-7,-5,-5,-7,-11,-17,-25];static HEARING_FLOOR_DB_A=0;static ITERATIONS=30;static CONVERGED_MS=.5;static VELOCITY_STEP_MS=500;static noiseOfKind(t){const e=ct.find(a=>a.kinds.includes(t));return ot.find(a=>a.id===(e?.id??"turbofan-narrow-body"))}static bandsAt(t,e,a=A.STANDARD){const n=20*Math.log10(Math.max(e*1e3,1))+11;return A.OCTAVES.map((i,o)=>t.soundPowerA[o]-n-A.absorptionDbPerKm(i,a)*e)}static couldBeHeard(t,e,a=E.DEFAULT_AMBIENT_DB_A,n=A.STANDARD){const i=E.ambientBands(a);return E.bandsAt(t,e,n).some((o,r)=>o>=Math.max(i[r]+E.DETECTION_MARGIN_DB,E.HEARING_FLOOR_DB_A))}static ambientBands(t){const e=E.AMBIENT_SHAPE_DB,a=A.sumDb(e);return e.map(n=>t+n-a)}static heardAt(t,e,a,n={}){const i=n.air??A.STANDARD,o=A.speedOfSound(i.temperatureC),r=t.points[t.points.length-1]?.t;if(r===void 0)return;let c=Math.min(a,r),h=F.positionAt(t,c);if(!h)return;let s=L.seenFrom(e,h.geo);for(let b=0;b<E.ITERATIONS;b++){const v=a-s.distanceKm*1e3*1e3/o,K=Math.abs(v-c);if(c=v,h=F.positionAt(t,c),!h)return;if(s=L.seenFrom(e,h.geo),K<E.CONVERGED_MS)break}const d=F.positionAt(t,a),l=d?L.seenFrom(e,d.geo):s,u=n.noise??ot[0],p=n.ambientDbA??E.DEFAULT_AMBIENT_DB_A,g=E.ambientBands(p),M=E.bandsAt(u,s.distanceKm,i),f=M.map((b,v)=>b>=Math.max(g[v]+E.DETECTION_MARGIN_DB,E.HEARING_FLOOR_DB_A)),R=M.indexOf(Math.max(...M)),S=f.lastIndexOf(!0);return{track:t,audible:f.some(Boolean),levelDbA:A.sumDb(M),bandsDbA:M,ambientDbA:p,delayS:(a-c)/1e3,emittedAtMs:c,sound:s,seen:l,lagDeg:E.angleBetween(s,l),dopplerRatio:E.doppler(t,e,c,o),dominantHz:A.OCTAVES[R],cutoffHz:S<0?void 0:A.OCTAVES[S]}}static profile(t,e,a,n,i=2e3,o={}){const r=[];let c,h,s=a;for(let d=a;d<=n;d+=i){const l=E.heardAt(t,e,d,o);l&&(!h||l.levelDbA>h.levelDbA)&&(h=l,s=d),l?.audible?c?c.untilMs=d:r.push(c={fromMs:d,untilMs:d}):c=void 0}return{track:t,audible:r,peakDbA:h?.levelDbA??-1/0,peakAtMs:s,peakDelayS:h?.delayS??0}}static angleBetween(t,e){const a=s=>{const d=s.altitudeDeg*Math.PI/180,l=s.azimuthDeg*Math.PI/180;return[Math.cos(d)*Math.sin(l),Math.cos(d)*Math.cos(l),Math.sin(d)]},[n,i,o]=a(t),[r,c,h]=a(e);return Math.acos(Math.min(1,Math.max(-1,n*r+i*c+o*h)))*180/Math.PI}static doppler(t,e,a,n){const i=E.VELOCITY_STEP_MS,o=F.positionAt(t,a-i),r=F.positionAt(t,a+i);if(!o||!r)return 1;const c=L.seenFrom(e,o.geo).distanceKm*1e3,h=L.seenFrom(e,r.geo).distanceKm*1e3;return 1/(1-(c-h)/(2*i/1e3)/n)}}class yt{static at(t,e,a,n,i={}){const o=F.seenFrom(t,a,n);if(!o)return;const r=y.of(e),c=E.heardAt(t,a,n,{noise:E.noiseOfKind(r.kind),...i});return{hex:`${t.nonIcao?"~":""}${t.icao.toString(16).padStart(6,"0")}`,registration:e?.registration,typeCode:r.code??e?.type,name:r.basis==="nothing"?void 0:r.name,kind:r.kind,basis:r.basis,military:e?.military===!0,restricted:e?.restricted===!0,altitudeFt:o.altitudeFt,groundSpeedKt:o.groundSpeedKt,trackDeg:o.trackDeg,sky:o.sky,angularRateDegPerS:o.angularRateDegPerS,hearing:c&&{audible:c.audible,levelDbA:c.levelDbA,ambientDbA:c.ambientDbA,delayS:c.delayS,lagDeg:c.lagDeg,dopplerRatio:c.dopplerRatio,cutoffHz:c.cutoffHz,dominantHz:c.dominantHz}}}}class I{static REFERENCE_AMPLITUDE=.02;static MASKING_RANGE_DB=6;static KNEE_DB=20;static COMPRESSION_RATIO=1.5;static EXPANSION_RATIO=1.8;static DEFAULT_MAX_VOICES=4;static candidates(t,e,a,n,i={}){const o=new Set;for(const[r,c]of t){const h=E.noiseOfKind(y.of(e.get(a(c))).kind);let s=1/0;for(const d of c.points)s=Math.min(s,L.seenFrom(n,{lat:d.lat,lng:d.lng,heightM:d.altitudeFt*.3048}).distanceKm);E.couldBeHeard(h,s,i.ambientDbA,i.air)&&o.add(r)}return o}static voices(t,e,a,n,i,o,r={}){const c=[];for(const h of t){const s=e.get(h);if(!s||r.only?.(h)===!1)continue;const d=r.kindOf?.(h)??y.of(a.get(n(s))).kind,l=r.noiseOf?.(h)??E.noiseOfKind(d),u=E.heardAt(s,i,o,{...r,noise:l});u?.audible&&c.push({id:h,kind:d,bandAmplitudes:I.bandAmplitudes(u.bandsDbA,u.ambientDbA,r.referenceAmplitude),levelDbA:u.levelDbA,distanceKm:u.sound.distanceKm,dopplerRatio:u.dopplerRatio,azimuthDeg:u.sound.azimuthDeg,elevationDeg:u.sound.altitudeDeg,character:l.character})}return c.sort((h,s)=>s.levelDbA-h.levelDbA).slice(0,r.maxVoices??I.DEFAULT_MAX_VOICES)}static bandAmplitudes(t,e,a=I.REFERENCE_AMPLITUDE){const n=E.ambientBands(e),i=E.DETECTION_MARGIN_DB,o=A.sumDb(t),r=o-e,c=r>=I.KNEE_DB?I.KNEE_DB+(r-I.KNEE_DB)/I.COMPRESSION_RATIO:I.KNEE_DB-(I.KNEE_DB-r)*I.EXPANSION_RATIO,h=a*10**(c/20);return t.map((s,d)=>{const l=Math.min(1,Math.max(0,(s-n[d]-i+I.MASKING_RANGE_DB)/(2*I.MASKING_RANGE_DB)));return l*l*(3-2*l)*h*10**((s-o)/20)})}static BANDS_HZ=A.OCTAVES}class W{static RUMBLE_BELOW_HZ=500;static DULL_BELOW_HZ=2e3;static PITCH_NOTICED=.03;static text(t,e,a,n){const i=(l,u=0)=>l.toLocaleString(n,{maximumFractionDigits:u}),o=(l,u)=>l.replace(/\{(\w+)\}/g,(p,g)=>u[g]??`{${g}}`),r=[],c=[t.registration,t.name].filter(Boolean).join(" · ");r.push(c||o(e.unnamed,{hex:t.hex}));const h=[o(e.altitude,{value:i(Math.round(t.altitudeFt/100)*100)}),t.groundSpeedKt===void 0?void 0:o(e.speed,{value:i(Math.round(t.groundSpeedKt))}),t.trackDeg===void 0?void 0:o(e.heading,{value:i(Math.round(t.trackDeg))})].filter(Boolean);r.push(h.join(" · ")),r.push(o(e.position,{distance:i(t.sky.distanceKm,t.sky.distanceKm<10?1:0),elevation:i(Math.round(t.sky.altitudeDeg)),bearing:a(t.sky.azimuthDeg)}));const s=t.hearing;if(!s)r.push(e.soundUnknown);else if(!s.audible)r.push(o(e.inaudible,{level:i(Math.round(s.levelDbA)),ambient:i(Math.round(s.ambientDbA))}));else{const l=s.cutoffHz??0,u=l<=W.RUMBLE_BELOW_HZ?e.rumble:l<=W.DULL_BELOW_HZ?e.muffled:e.broad,p=s.dopplerRatio-1,g=Math.abs(p)<W.PITCH_NOTICED?"":o(p>0?e.pitchHigher:e.pitchLower,{percent:i(Math.round(Math.abs(p)*100))});r.push(o(e.heard,{level:i(Math.round(s.levelDbA)),delay:i(Math.round(s.delayS)),lag:i(Math.round(s.lagDeg)),character:o(u,{cutoff:i(l)}),pitch:g}))}t.contrail&&r.push(o(t.contrail.persistent?e.contrailPersistent:e.contrailShort,{rhi:i(Math.round(t.contrail.iceRelativeHumidity*100))}));const d=[t.military?e.military:void 0,t.restricted?e.restricted:void 0].filter(Boolean);return d.length>0&&r.push(d.join(" · ")),r.push(e.candidate),r.join(`
2
- `)}}class ${static EFFICIENCY={"airliner-narrow":.34,"airliner-wide":.38,"regional-jet":.32,"business-jet":.3,"military-jet":.22,unknown:.34};static efficiencyOf(t){return $.EFFICIENCY[t]}}class m{static EMISSION_INDEX_WATER=1.25;static COMBUSTION_HEAT=432e5;static AIR_HEAT_CAPACITY=1004;static MOLAR_MASS_RATIO=.622;static FT_TO_M=.3048;static TROPOPAUSE_M=11e3;static TROPOPAUSE_HPA=226.32;static ISOTHERMAL_SCALE_HEIGHT_M=6341.62;static pressureAtAltitudeFt(t){const e=t*m.FT_TO_M;return e<=m.TROPOPAUSE_M?1013.25*(1-225577e-10*e)**5.25588:m.TROPOPAUSE_HPA*Math.exp(-(e-m.TROPOPAUSE_M)/m.ISOTHERMAL_SCALE_HEIGHT_M)}static saturationOverWaterPa(t){const e=t+273.15;return Math.exp(54.842763-6763.22/e-4.21*Math.log(e)+367e-6*e+Math.tanh(.0415*(e-218.8))*(53.878-1331.22/e-9.44523*Math.log(e)+.014025*e))}static saturationOverIcePa(t){const e=t+273.15;return Math.exp(9.550426-5723.265/e+3.53068*Math.log(e)-.00728332*e)}static iceRelativeHumidity(t,e){return e*m.saturationOverWaterPa(t)/m.saturationOverIcePa(t)}static mixingSlope(t,e){return m.EMISSION_INDEX_WATER*m.AIR_HEAT_CAPACITY*t*100/(m.MOLAR_MASS_RATIO*m.COMBUSTION_HEAT*(1-e))}static criticalTemperatureC(t,e){const a=Math.log(m.mixingSlope(t,e)-.053);return-46.46+9.43*a+.72*a*a}static requiredHumidity(t,e,a){const n=m.criticalTemperatureC(t,e);return(m.mixingSlope(t,e)*(a-n)+m.saturationOverWaterPa(n))/m.saturationOverWaterPa(a)}static evaluate(t,e){const a=m.criticalTemperatureC(t.pressureHpa,e),n=m.requiredHumidity(t.pressureHpa,e,t.temperatureC),i=m.iceRelativeHumidity(t.temperatureC,t.relativeHumidity),o=t.temperatureC<a&&t.relativeHumidity>=n;return{forms:o,persistent:o&&i>=1,criticalTemperatureC:a,requiredHumidity:n,iceRelativeHumidity:i}}}class k{static HOLD_MS=36e5;static DEG=Math.PI/180;static GAS_CONSTANT_OVER_GRAVITY=287.05/9.80665;static at(t,e,a){if(t.length===0)return;const n=t[0],i=t[t.length-1];if(e<n.t-k.HOLD_MS||e>i.t+k.HOLD_MS)return;const o=t.findIndex(u=>u.t>e),r=o===0?t[0]:t[(o===-1?t.length:o)-1],c=o===-1||o===0?r:t[o],h=k.atLevel(r,a),s=k.atLevel(c,a);if(!h||!s)return;const d=c.t>r.t?Math.min(1,Math.max(0,(e-r.t)/(c.t-r.t))):0,l=(u,p)=>u+(p-u)*d;return{pressureHpa:a,temperatureC:l(h.temperatureC,s.temperatureC),relativeHumidity:l(h.relativeHumidity,s.relativeHumidity),driftEastMs:l(h.driftEastMs,s.driftEastMs),driftNorthMs:l(h.driftNorthMs,s.driftNorthMs),shearPerS:l(h.shearPerS,s.shearPerS)}}static atLevel(t,e){const a=t.levels;for(let n=0;n+1<a.length;n++){const i=a[n],o=a[n+1];if(e>i.pressureHpa||e<o.pressureHpa)continue;const r=(Math.log(i.pressureHpa)-Math.log(e))/(Math.log(i.pressureHpa)-Math.log(o.pressureHpa)),c=(u,p)=>u+(p-u)*r,h=u=>{const p=u.windFromDeg*k.DEG;return{east:-u.windSpeedMs*Math.sin(p),north:-u.windSpeedMs*Math.cos(p)}},s=h(i),d=h(o),l=k.GAS_CONSTANT_OVER_GRAVITY*((i.temperatureC+o.temperatureC)/2+273.15)*Math.log(i.pressureHpa/o.pressureHpa);return{pressureHpa:e,temperatureC:c(i.temperatureC,o.temperatureC),relativeHumidity:c(i.relativeHumidity,o.relativeHumidity),driftEastMs:c(s.east,d.east),driftNorthMs:c(s.north,d.north),shearPerS:Math.hypot(d.east-s.east,d.north-s.north)/l}}}}class H{static MIN_ALTITUDE_FT=2e4;static DENSE_MS=3e5;static SPARSE_STEP_MS=6e4;static SATURATION_HORIZON_MS=3*36e5;static SATURATION_STEP_MS=6e5;static PRESSURE_STEP_HPA=5;static plan(t,e,a,n){if(a.length===0)return[];const i=[],o=new Map,r=(c,h,s)=>{const d=Math.round(h/H.PRESSURE_STEP_HPA)*H.PRESSURE_STEP_HPA,l=H.SATURATION_STEP_MS,u=Math.floor(c/l)*l,p=`${d}|${u}`,g=o.get(p);if(g!==void 0)return g+(u-c)/1e3;let M=1/0;for(let f=l;f<=H.SATURATION_HORIZON_MS;f+=l){const R=k.at(a,u+f,d);if(!R)break;if(m.evaluate(R,s).iceRelativeHumidity<1){M=f/1e3;break}}return o.set(p,M),M+(u-c)/1e3};for(const c of t.objects){const h=t.flights.get(c.id),s=c.track;if(!h||!s||s.length!==h.points.length)continue;const d=e?.get(z.keyOf(h))??y.of(void 0),l=$.efficiencyOf(d.kind);if(l===void 0)continue;const u=[];let p=-1/0;s.forEach((g,M)=>{if(g.t<-H.DENSE_MS&&M+1<s.length&&g.t-p<H.SPARSE_STEP_MS)return;p=g.t;const f=h.points[M],R=m.pressureAtAltitudeFt(f.altitudeFt),S=k.at(a,n+g.t,R),b=S&&m.evaluate(S,l);u.push({tMs:g.t,eastM:g.eastM,northM:g.northM,upM:g.altitudeM??0,forms:b?.forms??!1,persistent:b?.persistent??!1,lifetimeS:b?Z.lifetimeS(b.iceRelativeHumidity):0,driftEastMs:S?.driftEastMs??0,driftNorthMs:S?.driftNorthMs??0,shearPerS:S?.shearPerS??Z.TYPICAL_SHEAR_PER_S,iceRelativeHumidity:b?.iceRelativeHumidity??0,saturatedForS:b?.persistent?r(n+g.t,R,l):0})}),u.some((g,M)=>g.forms&&u[M+1]?.forms)&&i.push({id:c.id,spanM:d.spanM,points:u})}return i}}class B{static DEFAULT_KIND="airliner-narrow";static STEP_MS=1e3;static LEAD_MS=12e4;static FT_PER_M=1/.3048;static ID_PREFIX="decor:";tracks=new Map;static kindOf(t,e){if(t.kind!=="aircraft"||!B.flies(t))return;const a=t.aircraftSound??e??B.DEFAULT_KIND;return a==="silent"?void 0:a}static flies(t){return(t.track??[]).some(e=>(e.altitudeM??0)>0)}voices(t,e,a,n={},i=()=>{}){const o=t.event.place?.[0];if(!o)return[];const r=new Map,c=new Map,h=Math.max(t.observerTrack.duration,(t.event.durationSeconds??0)*1e3);for(const s of t.decor){const d=B.kindOf(s,i(s));if(!d)continue;const l=`${B.ID_PREFIX}${s.id}`;r.set(l,this.trackOf(s,l,o,h)),c.set(l,d)}for(const s of this.tracks.keys())r.has(s)||this.tracks.delete(s);return r.size===0?[]:I.voices(new Set(r.keys()),r,new Map,s=>String(s.icao),a,e,{...n,kindOf:s=>c.get(s)})}trackOf(t,e,a,n){const i=JSON.stringify([t.track,t.eastM,t.northM,t.headingDeg,a.lat,a.lng,n]),o=this.tracks.get(e);if(o?.key===i)return o.track;const r=[];for(let l=0;l<=n;l+=B.STEP_MS)r.push(B.pointAt(t,l,a));(r.length===0||r[r.length-1].t<n)&&r.push(B.pointAt(t,n,a));const c=r[0],h=r[1]??c,s=l=>(h[l]-c[l])/(h.t-c.t||1);for(let l=B.STEP_MS*10;l<=B.LEAD_MS;l+=B.STEP_MS*10)r.unshift({t:-l,lat:c.lat-s("lat")*l,lng:c.lng-s("lng")*l,altitudeFt:Math.max(0,c.altitudeFt-s("altitudeFt")*l)});const d={icao:B.hash(e),nonIcao:!0,points:r};return this.tracks.set(e,{key:i,track:d}),d}static pointAt(t,e,a){const n=ht(t,e),i=q(n.eastM,-n.northM,a.lat,a.lng);return{t:e,lat:i.lat,lng:i.lng,altitudeFt:n.altitudeM*B.FT_PER_M}}static hash(t){let e=0;for(let a=0;a<t.length;a++)e=e*31+t.charCodeAt(a)>>>0;return e}}class G{static STEP_MS=250;static FT_PER_M=1/.3048;static ID_PREFIX="body:";tracks=new Map;static noiseOf(t){const e=E.noiseOfKind(t.kind),a=t.quieterDb??0;return a===0?e:{...e,id:`${e.id}-${a}dB`,soundPowerA:e.soundPowerA.map(n=>n-a)}}voices(t,e,a,n,i,o,r={}){const c=new Map,h=new Map,s=new Map;for(const l of t){if(!l.sound)continue;const u=`${G.ID_PREFIX}${l.id}`,p=this.trackOf(l,u,e,n,o);p&&(c.set(u,p),h.set(u,l.sound.kind),s.set(u,G.noiseOf(l.sound)))}for(const l of this.tracks.keys())c.has(l)||this.tracks.delete(l);if(c.size===0)return[];const d=q(a.eastM,-a.northM,n.lat,n.lng);return I.voices(new Set(c.keys()),c,new Map,l=>String(l.icao),{lat:d.lat,lng:d.lng,heightM:a.upM},i,{...r,kindOf:l=>h.get(l),noiseOf:l=>s.get(l)})}trackOf(t,e,a,n,i){const o=`${n.lat},${n.lng},${i}`,r=this.tracks.get(e);if(r&&r.body===t&&r.origin===o)return r.track;const c=[];for(let s=-12e4;s<=i;s+=G.STEP_MS){const d=a(t,s);if(!d)continue;const l=q(d.eastM,-d.northM,n.lat,n.lng);c.push({t:s,lat:l.lat,lng:l.lng,altitudeFt:d.upM*G.FT_PER_M})}if(c.length<2)return;const h={icao:G.hash(e),nonIcao:!0,points:c};return this.tracks.set(e,{body:t,origin:o,track:h}),h}static hash(t){let e=0;for(let a=0;a<t.length;a++)e=e*31+t.charCodeAt(a)>>>0;return e}}export{Y as AircraftAudio,H as AircraftContrails,y as AircraftModels,_ as AmbientNoise,G as BodyHearing,B as DecorAircraftHearing,D as TrafficDecor,yt as TrafficInfos,I as TrafficSound,W as TrafficTooltip,Ht as UPPER_AIR_SOURCES};