@rr0/ufoathome 0.202.0 → 0.202.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/dist-embed-scene/{AirshipEditor-BnRmKeVs.js → AirshipEditor-guE_ib3z.js} +1 -1
  2. package/dist-embed-scene/{AirshipFlight-C9DSPGwk.js → AirshipFlight-DzW0313e.js} +1 -1
  3. package/dist-embed-scene/{BalloonEditor-BehJs6H-.js → BalloonEditor-BIsCy_y4.js} +2 -2
  4. package/dist-embed-scene/{BalloonFlight-BYn4diw1.js → BalloonFlight-gunghgAq.js} +1 -1
  5. package/dist-embed-scene/{BirdEditor-dOp1sGsz.js → BirdEditor-CuLv4Ij5.js} +1 -1
  6. package/dist-embed-scene/{BirdFlock-CfJeXvWu.js → BirdFlock-L3dYU2K_.js} +1 -1
  7. package/dist-embed-scene/{DroneEditor-CBoR4fJ_.js → DroneEditor-BQWPhTyf.js} +1 -1
  8. package/dist-embed-scene/{DroneFlight-DSE1OXqh.js → DroneFlight-ERYah68l.js} +1 -1
  9. package/dist-embed-scene/{DroneParameters-D3EOg4oe.js → DroneParameters-CoWQympS.js} +1 -1
  10. package/dist-embed-scene/{LanternEditor-CbcA7K8y.js → LanternEditor-BpCyb79i.js} +1 -1
  11. package/dist-embed-scene/{ModuleSession-XnOI5Mcr.js → ModuleSession-bj7QHWjO.js} +2 -2
  12. package/dist-embed-scene/ModuleThree-DRsA8rtL.js +1 -0
  13. package/dist-embed-scene/SearchlightSystem-Ddws2hQY.js +1 -0
  14. package/dist-embed-scene/{SkyLantern-Dp_B40X0.js → SkyLantern-C3BSxHtq.js} +1 -1
  15. package/dist-embed-scene/rr0-scene.mjs +85 -64
  16. package/dist-embed-sighting/{CaseReportExport-CkWf0HNx.js → CaseReportExport-BtGCWD7H.js} +1 -1
  17. package/dist-embed-sighting/{ModuleSession-ChJsGuTn.js → ModuleSession-DztK084a.js} +2 -2
  18. package/dist-embed-sighting/{ModuleThree-whEZoXYF.js → ModuleThree-BLNSm2eY.js} +1 -1
  19. package/dist-embed-sighting/SearchlightSystem-PEMBDW1s.js +1 -0
  20. package/dist-embed-sighting/rr0-sighting.mjs +90 -69
  21. package/dist-embed-sighting-editor/{BallesterGuaspAssessor-Bylahnc2.js → BallesterGuaspAssessor-CJyRqwvh.js} +1 -1
  22. package/dist-embed-sighting-editor/{CaseElement-DPlro-7S.js → CaseElement-D80gHg4r.js} +1 -1
  23. package/dist-embed-sighting-editor/{CaseReportExport-C1g5C8hi.js → CaseReportExport-Bv6FWPs2.js} +1 -1
  24. package/dist-embed-sighting-editor/{ControlPasses-BMEmppip.js → ControlPasses-CaVHMhEY.js} +1 -1
  25. package/dist-embed-sighting-editor/{CoverageAssessor-uzQnTEH8.js → CoverageAssessor-CTfHqAd_.js} +1 -1
  26. package/dist-embed-sighting-editor/{GLTFLoader-2Zbfb3kh.js → GLTFLoader-CrRPu-Pt.js} +1 -1
  27. package/dist-embed-sighting-editor/{HeadlightSystem-CBmEcC9f.js → HeadlightSystem-BmPfcHt1.js} +1 -1
  28. package/dist-embed-sighting-editor/{HynekAssessor-uub2VxTi.js → HynekAssessor-nBidt6QV.js} +1 -1
  29. package/dist-embed-sighting-editor/{InterviewEditorElement-_1fa2bG7.js → InterviewEditorElement-CQWfYlGL.js} +2 -2
  30. package/dist-embed-sighting-editor/{ModuleConformance-Cr6fM28A.js → ModuleConformance-CpMYkYgb.js} +2 -2
  31. package/dist-embed-sighting-editor/{ModuleSession-WA6lqfV6.js → ModuleSession-b_pmjUfP.js} +2 -2
  32. package/dist-embed-sighting-editor/ModuleThree-B_FZVqsf.js +1 -0
  33. package/dist-embed-sighting-editor/{ModulesPanelElement-BsRg3mzl.js → ModulesPanelElement-D0gn9Z-y.js} +3 -3
  34. package/dist-embed-sighting-editor/{NearestApproach-Bnx9Ld5_.js → NearestApproach-Bxo_N7a9.js} +1 -1
  35. package/dist-embed-sighting-editor/{PoherAssessor-CNj_Nyci.js → PoherAssessor-CEVA26zd.js} +1 -1
  36. package/dist-embed-sighting-editor/{RailwaySystem-6bwbv8UB.js → RailwaySystem-Ceb0_MVz.js} +1 -1
  37. package/dist-embed-sighting-editor/{ReferenceSystem-8QgwbbAG.js → ReferenceSystem-B15kw0uH.js} +1 -1
  38. package/dist-embed-sighting-editor/SearchlightSystem-D7sdsRYn.js +1 -0
  39. package/dist-embed-sighting-editor/{SightingElement-BQdiez39.js → SightingElement-Bp-t_EAF.js} +1 -1
  40. package/dist-embed-sighting-editor/{TraceSystem-DZMUxSn-.js → TraceSystem-Bv4kLpie.js} +2 -2
  41. package/dist-embed-sighting-editor/{WaterSystem-CB5jE7qB.js → WaterSystem-Bbk_RJKg.js} +1 -1
  42. package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +193 -172
  43. package/dist-embed-ufoathome/{AdsbLolArchiveProvider-KbJPyJ97.js → AdsbLolArchiveProvider-v1sSwhN1.js} +1 -1
  44. package/dist-embed-ufoathome/{Aurora-C_mCH4JM.js → Aurora-Dc4u2vEw.js} +1 -1
  45. package/dist-embed-ufoathome/{AuroraEditor-Dzvgh6e0.js → AuroraEditor-CeLzRDPj.js} +1 -1
  46. package/dist-embed-ufoathome/{AuroraSimulation-BRUnHmlp.js → AuroraSimulation-BT1CdWX5.js} +1 -1
  47. package/dist-embed-ufoathome/{BallesterGuaspAssessor-DurdUgbG.js → BallesterGuaspAssessor-CPW-Omah.js} +1 -1
  48. package/dist-embed-ufoathome/{BeamEditor-Ccvx7l7x.js → BeamEditor-BS73mBZU.js} +1 -1
  49. package/dist-embed-ufoathome/{BeamSystem-CPM8m17q.js → BeamSystem-C5EpRhij.js} +1 -1
  50. package/dist-embed-ufoathome/{BodyEditor-BG--NjnZ.js → BodyEditor-BV8WwzAj.js} +1 -1
  51. package/dist-embed-ufoathome/{CaseEditorElement-0J_TCeiq.js → CaseEditorElement-HR8RFluQ.js} +6 -6
  52. package/dist-embed-ufoathome/{CaseElement-CRXPyMMR.js → CaseElement-vCbCfGOv.js} +3 -3
  53. package/dist-embed-ufoathome/{CaseReportExport-DKrBXPgZ.js → CaseReportExport-XLbFCkPg.js} +3 -3
  54. package/dist-embed-ufoathome/{ColumnResize-DV-byvDt.js → ColumnResize-CEXrq3KB.js} +3 -3
  55. package/dist-embed-ufoathome/{ControlPasses-CKvTCqTI.js → ControlPasses-CKOU_3lG.js} +1 -1
  56. package/dist-embed-ufoathome/{CoverageAssessor-MeOMUjkZ.js → CoverageAssessor-BYMf3Qhv.js} +1 -1
  57. package/dist-embed-ufoathome/{Flightradar24Provider-DxTfswSh.js → Flightradar24Provider-_QPbhh5s.js} +1 -1
  58. package/dist-embed-ufoathome/{GLTFLoader-pi-JKaNa.js → GLTFLoader-DQeHB-Bk.js} +1 -1
  59. package/dist-embed-ufoathome/{GeoJsonExport-iyhoKOUU.js → GeoJsonExport-Pq_pPvjK.js} +1 -1
  60. package/dist-embed-ufoathome/{GeographicFigures-DBmuFlvH.js → GeographicFigures-KII55iXE.js} +1 -1
  61. package/dist-embed-ufoathome/{HynekAssessor-Bda6csgM.js → HynekAssessor-wCDhgIB8.js} +1 -1
  62. package/dist-embed-ufoathome/{InterviewEditorElement-BA060rqJ.js → InterviewEditorElement-BSwkegEp.js} +4 -4
  63. package/dist-embed-ufoathome/{InterviewElement-DvqsCA3I.js → InterviewElement-CfkDtybc.js} +1 -1
  64. package/dist-embed-ufoathome/{KmlExport-DEPgRRWe.js → KmlExport-BMNwwys8.js} +1 -1
  65. package/dist-embed-ufoathome/{LaserBeam--dquPX_h.js → LaserBeam-B-tlAzNB.js} +1 -1
  66. package/dist-embed-ufoathome/{LaunchEditor-D3P0GkLr.js → LaunchEditor-Cy5D-gwU.js} +1 -1
  67. package/dist-embed-ufoathome/{LaunchPlume-w4l4TR4A.js → LaunchPlume-D-vSb8tJ.js} +1 -1
  68. package/dist-embed-ufoathome/{LaunchSimulation-BpZd-Nov.js → LaunchSimulation-CZ8Oba00.js} +1 -1
  69. package/dist-embed-ufoathome/{ModelSource-Csnm3RH_.js → ModelSource-HSiigkeO.js} +1 -1
  70. package/dist-embed-ufoathome/{ModelThumbnails-Cnt2GxTb.js → ModelThumbnails-DWvRMmj_.js} +1 -1
  71. package/dist-embed-ufoathome/{ModelViewer-DOfAkPgK.js → ModelViewer-CM7qTW8F.js} +1 -1
  72. package/dist-embed-ufoathome/{ModulesPanelElement-DH1oroWm.js → ModulesPanelElement-DsOa2zH0.js} +1 -1
  73. package/dist-embed-ufoathome/{NearestApproach-DJ98M81-.js → NearestApproach-PAsV5RlG.js} +1 -1
  74. package/dist-embed-ufoathome/{PoherAssessor-4zSdFnFp.js → PoherAssessor-CniYlhUl.js} +1 -1
  75. package/dist-embed-ufoathome/{QuestionnaireFeed-W69udpmT.js → QuestionnaireFeed-CpZqkxlt.js} +1 -1
  76. package/dist-embed-ufoathome/{QuestionnaireForm-U78nFPn5.js → QuestionnaireForm-LkllpNx-.js} +1 -1
  77. package/dist-embed-ufoathome/{QuestionnaireImport-Q5uHxQwU.js → QuestionnaireImport-CNROmkT2.js} +1 -1
  78. package/dist-embed-ufoathome/{ReentryEditor-DEi9nT0z.js → ReentryEditor-Qax1sT82.js} +1 -1
  79. package/dist-embed-ufoathome/{ReentrySimulation-CSO1vgro.js → ReentrySimulation-CTeCaxZl.js} +1 -1
  80. package/dist-embed-ufoathome/{ReferenceSystem--tiMGm4e.js → ReferenceSystem-CM27OCUo.js} +1 -1
  81. package/dist-embed-ufoathome/{ScenarioReadings-Dzdgopl3.js → ScenarioReadings-Is3HX0n0.js} +1 -1
  82. package/dist-embed-ufoathome/{ScenarioSweep-CMcleprC.js → ScenarioSweep-BbtX26Fi.js} +1 -1
  83. package/dist-embed-ufoathome/{SearchlightEditor--1uL8bTa.js → SearchlightEditor-PuLz84pp.js} +1 -1
  84. package/dist-embed-ufoathome/SearchlightSystem-B-tHvY1M.js +1 -0
  85. package/dist-embed-ufoathome/{ShareDialogElement-Dlfy9NCE.js → ShareDialogElement-EzLob2Tz.js} +92 -71
  86. package/dist-embed-ufoathome/{SightingElement-BJSNmFM6.js → SightingElement--qpGoyxL.js} +2 -2
  87. package/dist-embed-ufoathome/{TraceSystem-Cq2TgP-u.js → TraceSystem-8XQX03MS.js} +1 -1
  88. package/dist-embed-ufoathome/{VideoButton-MRJlVNm_.js → VideoButton-WNtEngz-.js} +1 -1
  89. package/dist-embed-ufoathome/rr0-ufoathome.mjs +2 -2
  90. package/dist-embed-ufoathome/{surroundingsSources--qffL_nJ.js → surroundingsSources-UHKGesPa.js} +1 -1
  91. package/dist-embed-ufoathome/{trafficRuntime-CTCGr90P.js → trafficRuntime-CgY_7-NH.js} +1 -1
  92. package/package.json +1 -1
  93. package/dist-embed-scene/ModuleThree-BTQgimAj.js +0 -1
  94. package/dist-embed-scene/SearchlightSystem-CX1_nBkz.js +0 -1
  95. package/dist-embed-sighting/SearchlightSystem-B2-MzG4x.js +0 -1
  96. package/dist-embed-sighting-editor/ModuleThree-CB_EjTOI.js +0 -1
  97. package/dist-embed-sighting-editor/SearchlightSystem-CEG52QDx.js +0 -1
  98. package/dist-embed-ufoathome/SearchlightSystem-7bntVtp_.js +0 -1
@@ -62,4 +62,4 @@ ${o.join(`
62
62
  `)}
63
63
  </body>
64
64
  </html>
65
- `}static comparedTable(t,n){const a=n.texts.columns,s=z.escape;return z.table([a.reading,a.reads,a.reproduced,a.gap,a.robustness,a.supposedCount],t.readings.map(i=>{const e=n.robustness(i.sensitivity);return[s(i.title),s(i.reads),`<span class="n">${n.reproduced(i.sensitivity)}</span>`,n.degrees(i.sensitivity?.medianSeparationDeg),`<span class="${e.kind}">${s(e.text)}</span>`,String(i.supposed.length)]}),[2,3,5])}static witness(t,n,a){const s=a.texts,i=s.columns,e=z.escape,r=[`<h3>${e(a.fill(s.witnessHeading,{witness:t.title}))}</h3>`],o=[[s.columns.time,t.time??""],[s.place,t.place??""],[s.duration,t.durationSeconds!==void 0?a.instant(t.durationSeconds*1e3):""],[s.instrument,t.instrument??""]].filter(([,m])=>m!=="");o.length&&r.push(`<dl class="facts">${o.map(([m,d])=>`<dt>${e(m)}</dt><dd>${e(d)}</dd>`).join("")}</dl>`),t.description&&r.push(`<h4>${e(s.account)}</h4>`,`<blockquote>${e(t.description)}</blockquote>`),t.sources.length&&r.push(`<h4>${e(s.sources)}</h4>`,`<ul class="sources">${t.sources.map(m=>`<li>${[m.authors?.join(", "),m.title?`<em>${e(m.title)}</em>`:"",m.publisher,m.time,m.index].filter(Boolean).map(g=>g.startsWith("<em>")?g:e(g)).join(", ")}${m.url?` <a href="${e(m.url)}">${e(m.url)}</a>`:""}</li>`).join("")}</ul>`);const u=S.svg(t,a);u&&r.push(`<figure>${u}<figcaption>${e(s.timelineCaption)}</figcaption></figure>`),n=n.filter(m=>m.comparisons.length>0);const p=D.svg(t,n,a);if(p){const m=[`<li><svg viewBox="0 0 14 14" width="14" height="14" aria-hidden="true"><circle cx="7" cy="7" r="4" fill="#111827"/></svg>${e(s.saidLegend)}</li>`,...n.map((d,g)=>`<li>${D.legendMark(g)}${e(d.title)}</li>`)];r.push(`<figure>${p}<ul class="legend">${m.join("")}</ul><figcaption>${e(s.figureCaption)}</figcaption></figure>`)}if(t.pictures?.length){const m=t.pictures[0].views.map(d=>d.label);r.push(`<h4>${e(s.pictures)}</h4>`,`<div class="scroll"><table class="pictures"><thead><tr><th scope="col">${e(s.columns.instant)}</th>${m.map(d=>`<th scope="col">${e(d)}</th>`).join("")}</tr></thead><tbody>${t.pictures.map(d=>`<tr><td class="n">${a.instant(d.t)}</td>${d.views.map(g=>`<td>${g.image?`<img src="${g.image}" alt="${e(g.label)}, ${a.instant(d.t)}">`:`<span class="nothing">${e(s.noPicture)}</span>`}</td>`).join("")}</tr>`).join("")}</tbody></table></div>`,`<p class="caption">${e(s.picturesCaption)}</p>`)}r.push(`<h4>${e(s.indications)}</h4>`),t.indications.length===0?r.push(`<p>${e(s.noIndication)}</p>`):r.push(z.table([i.instant,i.phenomenon,i.azimuth,i.altitude,i.uncertainty,i.size,i.basis,i.rests],t.indications.map(m=>{const d=m.uncertainty;return[a.instant(m.t),e(m.phenomenon??m.sourceId),m.directionSaid?a.azimuth(m.aim?.azimuthDeg):"",m.directionSaid?a.degrees(m.aim?.altitudeDeg):"",d?`${a.azimuth(d.azimuthDeg[0])} … ${a.azimuth(d.azimuthDeg[1])} ; ${a.degrees(d.altitudeDeg[0])} … ${a.degrees(d.altitudeDeg[1])}`:"",m.sizeSaid?a.degrees(m.angular?.widthDeg):"",m.basis?e(s.bases[m.basis]):"",e(a.rests(m))]}),[0,2,3,5]));const l=t.values.filter(m=>!/^timeline\.keyframes\.\d+\.shapes\.\d+\.shape\.(aim|angular)/.test(m.path));return l.length>0&&r.push(`<h4>${e(s.values)}</h4>`,z.valuesTable(l,a)),r}static reading(t,n,a){const s=a.texts,i=s.columns,e=z.escape,r=[`<h2>${e(a.fill(s.readingHeading,{title:t.title,witness:t.reads}))}</h2>`],c=[t.by.length?a.fill(s.by,{names:t.by.join(", ")}):"",t.time?a.fill(s.made,{time:t.time}):""].filter(Boolean).join(" ");c&&r.push(`<p class="meta">${e(c)}</p>`),t.description&&r.push(`<blockquote>${e(t.description)}</blockquote>`),r.push(`<h4>${e(s.supposed)}</h4>`,t.supposed.length?z.valuesTable(t.supposed,a):`<p>${e(s.noneSupposed)}</p>`),r.push(`<h4>${e(s.findings)}</h4>`),r.push(t.findings.length?z.table([i.finding,i.outcome,i.against,i.origin],t.findings.map(u=>[e(u.text),`<span class="${u.outcome}">${e(s.outcomes[u.outcome])}</span>`,u.outcome==="fails"?e(s.grounds[u.against??"established"]):"",e(s.origins[u.written?"written":"computed"])])):`<p>${e(s.noFinding)}</p>`);const o=t.sensitivity;if(o){const u=a.robustness(o);if(r.push(`<h4>${e(s.sensitivity)}</h4>`,`<p>${e(i.reproduced)} : ${a.reproduced(o)||"–"} · ${e(i.gap)} : ${a.degrees(o.medianSeparationDeg)||"–"} · <span class="${u.kind}">${e(u.text)}</span></p>`),u.kind!=="too-few"&&u.kind!=="nothing"&&o.margins.length>0&&r.push(z.table([i.knob,i.from,i.to,i.reference,i.covered],o.margins.map(p=>{const l=a.ends(p),m=p.reference?`${a.amount(p.knob,p.reference.lower)} … ${a.amount(p.knob,p.reference.upper)}`:s.noLaw;return[e(s.knobs[p.knob]),l.from,l.to,e(m),p.coverage===void 0?"":`${Math.round(p.coverage*100)} %`]}),[1,2,4])),o.better){const{knob:p,amount:l,agreement:m}=o.better;r.push(`<p class="fine-tuned">${e(a.fill(s.better,{knob:s.knobs[p],amount:a.amount(p,l),agreed:String(Math.round(m*o.compared)),compared:String(o.compared)}))}</p>`)}}return t.comparisons.length>0&&r.push(`<h4>${e(s.comparisons)}</h4>`,z.table([i.instant,i.phenomenon,`${i.said} (${i.azimuth}, ${i.altitude})`,`${i.read} (${i.azimuth}, ${i.altitude})`,i.separation,i.agrees],t.comparisons.map(u=>[a.instant(u.t),e(n?.phenomena?.[u.sourceId]??u.sourceId),u.said?`${a.azimuth(u.said.azimuthDeg)}, ${a.degrees(u.said.altitudeDeg)}`:"",`${a.azimuth(u.predicted.azimuthDeg)}, ${a.degrees(u.predicted.altitudeDeg)}`,a.degrees(u.separationDeg),`<span class="${u.agrees?"holds":"fails"}">${e(u.agrees?s.yes:s.no)}</span>`]),[0,4])),r}static valuesTable(t,n){const a=n.texts,s=a.columns,i=z.escape;return z.table([s.path,s.value,s.basis,s.rests],t.map(e=>[`<code>${i(e.path)}</code>`,i(n.value(e)),i(a.bases[e.basis]),i(n.rests(e))]))}static table(t,n,a=[]){const s=z.escape,i=`<tr>${t.map(r=>`<th scope="col">${s(r)}</th>`).join("")}</tr>`,e=n.map(r=>`<tr>${r.map((c,o)=>`<td${a.includes(o)?' class="n"':""}>${c}</td>`).join("")}</tr>`);return`<div class="scroll"><table><thead>${i}</thead><tbody>${e.join("")}</tbody></table></div>`}static escape(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}}const _=P.catalog({en:()=>B(()=>import("./CaseReportTexts_en-DlN7p1pC.js"),[],import.meta.url).then(N=>N.caseReportTexts_en),fr:()=>B(()=>import("./CaseReportTexts_fr-B5nP6RlP.js"),[],import.meta.url).then(N=>N.caseReportTexts_fr),es:()=>B(()=>import("./CaseReportTexts_es-CncAEaey.js"),[],import.meta.url).then(N=>N.caseReportTexts_es),it:()=>B(()=>import("./CaseReportTexts_it-Dc-oPmXB.js"),[],import.meta.url).then(N=>N.caseReportTexts_it)});class U{static async make(t,n,a,s,i=!1,e){const[r,c]=await Promise.all([_.load(a),J.load(a)]),o=A.of(n.caseJson,n.caseUrl,n.recordings,new C([...s]),new F(c));i&&t!=="csv"&&await U.pictures(o,n,r,e);const u=`${n.caseJson.id??"case"}-report`;switch(t){case"html":U.download(new Blob([z.of(o,r,a,"0.202.0")],{type:"text/html"}),`${u}.html`);return;case"print":U.print(z.of(o,r,a,"0.202.0"));return;case"json":U.download(new Blob([T.json(o,"0.202.0")],{type:"application/json"}),`${u}.json`);return;case"csv":{const{zipSync:p,strToU8:l}=await B(async()=>{const{zipSync:d,strToU8:g}=await import("./browser-CltifEM0.js");return{zipSync:d,strToU8:g}},[],import.meta.url),m=Object.fromEntries(Object.entries(T.csv(o,r,a)).map(([d,g])=>[d,l(`\uFEFF${g}`)]));U.download(new Blob([p(m)],{type:"application/zip"}),`${u}-tables.zip`)}}}static PICTURED_INSTANTS=3;static async pictures(t,n,a,s){const{registerScene:i,SCENE_ELEMENT_NAME:e}=await B(async()=>{const{registerScene:p,SCENE_ELEMENT_NAME:l}=await import("./rr0-sighting.mjs").then(m=>m.c5);return{registerScene:p,SCENE_ELEMENT_NAME:l}},[],import.meta.url);i();const r=t.witnesses.map(p=>{const l=p.indications.filter(f=>f.directionSaid).map(f=>f.t),m=l.length<=U.PICTURED_INSTANTS?l:[l[0],l[Math.floor(l.length/2)],l[l.length-1]],d=t.readings.filter(f=>f.reads===p.title&&f.comparisons.length>0),g=[{label:a.accountView,url:p.url,reading:void 0},...d.map(f=>({label:f.title,url:p.url,reading:f.url}))];return{witness:p,instants:[...new Set(m)],recordings:g}}).filter(p=>p.instants.length>0),c=r.reduce((p,l)=>p+l.instants.length*l.recordings.length,0);if(c===0)return;const o=document.createElement(e);o.setAttribute("max-pixel-ratio","1"),o.setAttribute("always-live",""),Object.assign(o.style,{position:"fixed",left:"-10000px",top:"0",width:"640px",height:"360px",visibility:"hidden",pointerEvents:"none"}),document.body.appendChild(o);let u=0;s?.(u,c);try{for(const p of r){const l=p.instants.map(d=>({t:d,views:[]})),m=n.recordings.get(p.witness.url);m&&(o.documentUrl=p.witness.url,o.sightingData=m);for(const d of p.recordings){const g=m,f=d.reading?n.recordings.get(d.reading):void 0;for(const w of l){let b;g&&(!d.reading||f)&&(w===l[0]&&(o.interpretation=U.bodiesOf(f??g,d.reading??p.witness.url)),b=await o.pictureAt(w.t,480).catch(()=>{})),w.views.push({label:d.label,...b?{image:b}:{}}),s?.(++u,c)}}p.witness.pictures=l}}finally{o.remove()}}static bodiesOf(t,n){const a=W.strip(t).recording.interpretation;if(a)return{...a,bodies:a.bodies.map(s=>s.model?.url?{...s,model:{...s.model,url:new URL(s.model.url,n).href}}:s)}}static print(t){const n=document.createElement("iframe");n.setAttribute("aria-hidden","true"),n.style.cssText="position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0",n.addEventListener("load",()=>{const a=n.contentWindow;a&&(a.addEventListener("afterprint",()=>n.remove()),a.focus(),a.print(),window.setTimeout(()=>n.remove(),6e4))},{once:!0}),n.srcdoc=t,document.body.append(n)}static download(t,n){const a=URL.createObjectURL(t),s=document.createElement("a");s.href=a,s.download=n,s.click(),window.setTimeout(()=>URL.revokeObjectURL(a),1e3)}}export{U as CaseReportExport};
65
+ `}static comparedTable(t,n){const a=n.texts.columns,s=z.escape;return z.table([a.reading,a.reads,a.reproduced,a.gap,a.robustness,a.supposedCount],t.readings.map(i=>{const e=n.robustness(i.sensitivity);return[s(i.title),s(i.reads),`<span class="n">${n.reproduced(i.sensitivity)}</span>`,n.degrees(i.sensitivity?.medianSeparationDeg),`<span class="${e.kind}">${s(e.text)}</span>`,String(i.supposed.length)]}),[2,3,5])}static witness(t,n,a){const s=a.texts,i=s.columns,e=z.escape,r=[`<h3>${e(a.fill(s.witnessHeading,{witness:t.title}))}</h3>`],o=[[s.columns.time,t.time??""],[s.place,t.place??""],[s.duration,t.durationSeconds!==void 0?a.instant(t.durationSeconds*1e3):""],[s.instrument,t.instrument??""]].filter(([,m])=>m!=="");o.length&&r.push(`<dl class="facts">${o.map(([m,d])=>`<dt>${e(m)}</dt><dd>${e(d)}</dd>`).join("")}</dl>`),t.description&&r.push(`<h4>${e(s.account)}</h4>`,`<blockquote>${e(t.description)}</blockquote>`),t.sources.length&&r.push(`<h4>${e(s.sources)}</h4>`,`<ul class="sources">${t.sources.map(m=>`<li>${[m.authors?.join(", "),m.title?`<em>${e(m.title)}</em>`:"",m.publisher,m.time,m.index].filter(Boolean).map(g=>g.startsWith("<em>")?g:e(g)).join(", ")}${m.url?` <a href="${e(m.url)}">${e(m.url)}</a>`:""}</li>`).join("")}</ul>`);const u=S.svg(t,a);u&&r.push(`<figure>${u}<figcaption>${e(s.timelineCaption)}</figcaption></figure>`),n=n.filter(m=>m.comparisons.length>0);const p=D.svg(t,n,a);if(p){const m=[`<li><svg viewBox="0 0 14 14" width="14" height="14" aria-hidden="true"><circle cx="7" cy="7" r="4" fill="#111827"/></svg>${e(s.saidLegend)}</li>`,...n.map((d,g)=>`<li>${D.legendMark(g)}${e(d.title)}</li>`)];r.push(`<figure>${p}<ul class="legend">${m.join("")}</ul><figcaption>${e(s.figureCaption)}</figcaption></figure>`)}if(t.pictures?.length){const m=t.pictures[0].views.map(d=>d.label);r.push(`<h4>${e(s.pictures)}</h4>`,`<div class="scroll"><table class="pictures"><thead><tr><th scope="col">${e(s.columns.instant)}</th>${m.map(d=>`<th scope="col">${e(d)}</th>`).join("")}</tr></thead><tbody>${t.pictures.map(d=>`<tr><td class="n">${a.instant(d.t)}</td>${d.views.map(g=>`<td>${g.image?`<img src="${g.image}" alt="${e(g.label)}, ${a.instant(d.t)}">`:`<span class="nothing">${e(s.noPicture)}</span>`}</td>`).join("")}</tr>`).join("")}</tbody></table></div>`,`<p class="caption">${e(s.picturesCaption)}</p>`)}r.push(`<h4>${e(s.indications)}</h4>`),t.indications.length===0?r.push(`<p>${e(s.noIndication)}</p>`):r.push(z.table([i.instant,i.phenomenon,i.azimuth,i.altitude,i.uncertainty,i.size,i.basis,i.rests],t.indications.map(m=>{const d=m.uncertainty;return[a.instant(m.t),e(m.phenomenon??m.sourceId),m.directionSaid?a.azimuth(m.aim?.azimuthDeg):"",m.directionSaid?a.degrees(m.aim?.altitudeDeg):"",d?`${a.azimuth(d.azimuthDeg[0])} … ${a.azimuth(d.azimuthDeg[1])} ; ${a.degrees(d.altitudeDeg[0])} … ${a.degrees(d.altitudeDeg[1])}`:"",m.sizeSaid?a.degrees(m.angular?.widthDeg):"",m.basis?e(s.bases[m.basis]):"",e(a.rests(m))]}),[0,2,3,5]));const l=t.values.filter(m=>!/^timeline\.keyframes\.\d+\.shapes\.\d+\.shape\.(aim|angular)/.test(m.path));return l.length>0&&r.push(`<h4>${e(s.values)}</h4>`,z.valuesTable(l,a)),r}static reading(t,n,a){const s=a.texts,i=s.columns,e=z.escape,r=[`<h2>${e(a.fill(s.readingHeading,{title:t.title,witness:t.reads}))}</h2>`],c=[t.by.length?a.fill(s.by,{names:t.by.join(", ")}):"",t.time?a.fill(s.made,{time:t.time}):""].filter(Boolean).join(" ");c&&r.push(`<p class="meta">${e(c)}</p>`),t.description&&r.push(`<blockquote>${e(t.description)}</blockquote>`),r.push(`<h4>${e(s.supposed)}</h4>`,t.supposed.length?z.valuesTable(t.supposed,a):`<p>${e(s.noneSupposed)}</p>`),r.push(`<h4>${e(s.findings)}</h4>`),r.push(t.findings.length?z.table([i.finding,i.outcome,i.against,i.origin],t.findings.map(u=>[e(u.text),`<span class="${u.outcome}">${e(s.outcomes[u.outcome])}</span>`,u.outcome==="fails"?e(s.grounds[u.against??"established"]):"",e(s.origins[u.written?"written":"computed"])])):`<p>${e(s.noFinding)}</p>`);const o=t.sensitivity;if(o){const u=a.robustness(o);if(r.push(`<h4>${e(s.sensitivity)}</h4>`,`<p>${e(i.reproduced)} : ${a.reproduced(o)||"–"} · ${e(i.gap)} : ${a.degrees(o.medianSeparationDeg)||"–"} · <span class="${u.kind}">${e(u.text)}</span></p>`),u.kind!=="too-few"&&u.kind!=="nothing"&&o.margins.length>0&&r.push(z.table([i.knob,i.from,i.to,i.reference,i.covered],o.margins.map(p=>{const l=a.ends(p),m=p.reference?`${a.amount(p.knob,p.reference.lower)} … ${a.amount(p.knob,p.reference.upper)}`:s.noLaw;return[e(s.knobs[p.knob]),l.from,l.to,e(m),p.coverage===void 0?"":`${Math.round(p.coverage*100)} %`]}),[1,2,4])),o.better){const{knob:p,amount:l,agreement:m}=o.better;r.push(`<p class="fine-tuned">${e(a.fill(s.better,{knob:s.knobs[p],amount:a.amount(p,l),agreed:String(Math.round(m*o.compared)),compared:String(o.compared)}))}</p>`)}}return t.comparisons.length>0&&r.push(`<h4>${e(s.comparisons)}</h4>`,z.table([i.instant,i.phenomenon,`${i.said} (${i.azimuth}, ${i.altitude})`,`${i.read} (${i.azimuth}, ${i.altitude})`,i.separation,i.agrees],t.comparisons.map(u=>[a.instant(u.t),e(n?.phenomena?.[u.sourceId]??u.sourceId),u.said?`${a.azimuth(u.said.azimuthDeg)}, ${a.degrees(u.said.altitudeDeg)}`:"",`${a.azimuth(u.predicted.azimuthDeg)}, ${a.degrees(u.predicted.altitudeDeg)}`,a.degrees(u.separationDeg),`<span class="${u.agrees?"holds":"fails"}">${e(u.agrees?s.yes:s.no)}</span>`]),[0,4])),r}static valuesTable(t,n){const a=n.texts,s=a.columns,i=z.escape;return z.table([s.path,s.value,s.basis,s.rests],t.map(e=>[`<code>${i(e.path)}</code>`,i(n.value(e)),i(a.bases[e.basis]),i(n.rests(e))]))}static table(t,n,a=[]){const s=z.escape,i=`<tr>${t.map(r=>`<th scope="col">${s(r)}</th>`).join("")}</tr>`,e=n.map(r=>`<tr>${r.map((c,o)=>`<td${a.includes(o)?' class="n"':""}>${c}</td>`).join("")}</tr>`);return`<div class="scroll"><table><thead>${i}</thead><tbody>${e.join("")}</tbody></table></div>`}static escape(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}}const _=P.catalog({en:()=>B(()=>import("./CaseReportTexts_en-DlN7p1pC.js"),[],import.meta.url).then(N=>N.caseReportTexts_en),fr:()=>B(()=>import("./CaseReportTexts_fr-B5nP6RlP.js"),[],import.meta.url).then(N=>N.caseReportTexts_fr),es:()=>B(()=>import("./CaseReportTexts_es-CncAEaey.js"),[],import.meta.url).then(N=>N.caseReportTexts_es),it:()=>B(()=>import("./CaseReportTexts_it-Dc-oPmXB.js"),[],import.meta.url).then(N=>N.caseReportTexts_it)});class U{static async make(t,n,a,s,i=!1,e){const[r,c]=await Promise.all([_.load(a),J.load(a)]),o=A.of(n.caseJson,n.caseUrl,n.recordings,new C([...s]),new F(c));i&&t!=="csv"&&await U.pictures(o,n,r,e);const u=`${n.caseJson.id??"case"}-report`;switch(t){case"html":U.download(new Blob([z.of(o,r,a,"0.202.1")],{type:"text/html"}),`${u}.html`);return;case"print":U.print(z.of(o,r,a,"0.202.1"));return;case"json":U.download(new Blob([T.json(o,"0.202.1")],{type:"application/json"}),`${u}.json`);return;case"csv":{const{zipSync:p,strToU8:l}=await B(async()=>{const{zipSync:d,strToU8:g}=await import("./browser-CltifEM0.js");return{zipSync:d,strToU8:g}},[],import.meta.url),m=Object.fromEntries(Object.entries(T.csv(o,r,a)).map(([d,g])=>[d,l(`\uFEFF${g}`)]));U.download(new Blob([p(m)],{type:"application/zip"}),`${u}-tables.zip`)}}}static PICTURED_INSTANTS=3;static async pictures(t,n,a,s){const{registerScene:i,SCENE_ELEMENT_NAME:e}=await B(async()=>{const{registerScene:p,SCENE_ELEMENT_NAME:l}=await import("./rr0-sighting.mjs").then(m=>m.c4);return{registerScene:p,SCENE_ELEMENT_NAME:l}},[],import.meta.url);i();const r=t.witnesses.map(p=>{const l=p.indications.filter(f=>f.directionSaid).map(f=>f.t),m=l.length<=U.PICTURED_INSTANTS?l:[l[0],l[Math.floor(l.length/2)],l[l.length-1]],d=t.readings.filter(f=>f.reads===p.title&&f.comparisons.length>0),g=[{label:a.accountView,url:p.url,reading:void 0},...d.map(f=>({label:f.title,url:p.url,reading:f.url}))];return{witness:p,instants:[...new Set(m)],recordings:g}}).filter(p=>p.instants.length>0),c=r.reduce((p,l)=>p+l.instants.length*l.recordings.length,0);if(c===0)return;const o=document.createElement(e);o.setAttribute("max-pixel-ratio","1"),o.setAttribute("always-live",""),Object.assign(o.style,{position:"fixed",left:"-10000px",top:"0",width:"640px",height:"360px",visibility:"hidden",pointerEvents:"none"}),document.body.appendChild(o);let u=0;s?.(u,c);try{for(const p of r){const l=p.instants.map(d=>({t:d,views:[]})),m=n.recordings.get(p.witness.url);m&&(o.documentUrl=p.witness.url,o.sightingData=m);for(const d of p.recordings){const g=m,f=d.reading?n.recordings.get(d.reading):void 0;for(const w of l){let b;g&&(!d.reading||f)&&(w===l[0]&&(o.interpretation=U.bodiesOf(f??g,d.reading??p.witness.url)),b=await o.pictureAt(w.t,480).catch(()=>{})),w.views.push({label:d.label,...b?{image:b}:{}}),s?.(++u,c)}}p.witness.pictures=l}}finally{o.remove()}}static bodiesOf(t,n){const a=W.strip(t).recording.interpretation;if(a)return{...a,bodies:a.bodies.map(s=>s.model?.url?{...s,model:{...s.model,url:new URL(s.model.url,n).href}}:s)}}static print(t){const n=document.createElement("iframe");n.setAttribute("aria-hidden","true"),n.style.cssText="position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0",n.addEventListener("load",()=>{const a=n.contentWindow;a&&(a.addEventListener("afterprint",()=>n.remove()),a.focus(),a.print(),window.setTimeout(()=>n.remove(),6e4))},{once:!0}),n.srcdoc=t,document.body.append(n)}static download(t,n){const a=URL.createObjectURL(t),s=document.createElement("a");s.href=a,s.download=n,s.click(),window.setTimeout(()=>URL.revokeObjectURL(a),1e3)}}export{U as CaseReportExport};
@@ -1,3 +1,3 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ModuleThree-whEZoXYF.js","./rr0-sighting.mjs"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ModuleThree-BLNSm2eY.js","./rr0-sighting.mjs"])))=>i.map(i=>d[i]);
2
2
  import{g,h as w,_ as b,M as p}from"./rr0-sighting.mjs";class o{static STORAGE_KEY="ufoathome.modules";static FORMAT=1;static empty(){return{format:1,modules:[]}}static read(t=o.storage()){try{const e=t?.getItem(o.STORAGE_KEY);return e?o.parse(e):o.empty()}catch{return o.empty()}}static write(t,e=o.storage()){try{return e?(t.modules.length===0?e.removeItem(o.STORAGE_KEY):e.setItem(o.STORAGE_KEY,o.text(t)),!0):!1}catch{return!1}}static parse(t){const e=JSON.parse(t);if(e===null||typeof e!="object"||!Array.isArray(e.modules))throw new Error("not a UFO@home module list");if(typeof e.format=="number"&&e.format>o.FORMAT)throw new Error(`format ${e.format} is newer than ${o.FORMAT}`);const s=new Set,i=[];for(const r of e.modules)typeof r?.url!="string"||s.has(r.url)||(s.add(r.url),i.push({url:r.url,enabled:r.enabled!==!1}));return{format:1,modules:i}}static text(t){return JSON.stringify({format:o.FORMAT,modules:t.modules},null,2)+`
3
- `}static storage(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}}class E{constructor(t,e){this.attribution=t,this.models=e}async entries(t){return t?this.models.filter(e=>[e.kind].flat().includes(t)):[...this.models]}async entry(t){return this.models.find(e=>e.id===t)}}class f{attribution;fetchImpl;tileUrlTemplate;constructor(t){this.attribution=t.attribution,this.tileUrlTemplate=t.tileUrlTemplate,this.fetchImpl=t.fetchImpl??fetch.bind(globalThis)}getImageryTexture(t,e){return g(t,e,s=>f.tileUrl(this.tileUrlTemplate,s),this.fetchImpl)}static tileUrl(t,e){return t.replaceAll("{z}",String(e.z)).replaceAll("{x}",String(e.x)).replaceAll("{y}",String(e.y))}}class v extends Error{constructor(t,e){super(`${t}: ${e}`),this.url=t,this.reason=e,this.name="ModuleManifestError"}}class d{static FORMAT=1;static check(t,e){const s=n=>{throw new v(e,n)};(t===null||typeof t!="object"||Array.isArray(t))&&s("not a JSON object");const i=t;typeof i.format!="number"&&s('no "format"'),i.format>d.FORMAT&&s(`format ${i.format} is newer than ${d.FORMAT}, which this version reads`),(typeof i.id!="string"||!/^[a-z0-9][a-z0-9._-]*$/.test(i.id))&&s(`"id" must be lowercase letters, digits, '.', '_' or '-'`),(typeof i.name!="string"||i.name.trim()==="")&&s('no "name"'),i.script!==void 0&&typeof i.script!="string"&&s('"script" must be an address');const r=i.contributes??{};for(const n of["imagery","elevation"]){const c=r[n];c!==void 0&&(Array.isArray(c)||s(`"contributes.${n}" must be a list`),c.forEach((l,m)=>{for(const h of["id","name","credit","creditUrl","tiles"])(typeof l?.[h]!="string"||l[h]==="")&&s(`"contributes.${n}[${m}].${h}" is missing`);["{z}","{x}","{y}"].every(h=>l.tiles.includes(h))||s(`"contributes.${n}[${m}].tiles" must hold {z}, {x} and {y}`)}))}const a=r.models;return a!==void 0&&(Array.isArray(a)||s('"contributes.models" must be a list'),a.forEach((n,c)=>{for(const l of["id","name","file"])(typeof n?.[l]!="string"||n[l]==="")&&s(`"contributes.models[${c}].${l}" is missing`);n.kind===void 0&&s(`"contributes.models[${c}].kind" is missing`),(!n.credit||typeof n.credit!="object")&&s(`"contributes.models[${c}].credit" is missing: a model is shown with its author and licence`)})),i}static contributions(t,e){const s=t.contributes??{},i={};if(s.imagery?.length&&(i.imagery=s.imagery.map(r=>({id:r.id,name:r.name,credit:r.credit,creditUrl:r.creditUrl,create:a=>new f({tileUrlTemplate:d.absoluteTemplate(r.tiles,e),attribution:r.credit,fetchImpl:a})}))),s.elevation?.length&&(i.elevation=s.elevation.map(r=>({id:r.id,name:r.name,credit:r.credit,creditUrl:r.creditUrl,create:a=>new w({tileUrlTemplate:d.absoluteTemplate(r.tiles,e),fetchImpl:a})}))),s.models?.length){const r=s.models.map(({file:n,...c})=>({...c,url:new URL(n,e).href})),a=t.credit??t.name;i.decorModels=[{id:`${t.id}-models`,name:t.name,credit:a,creditUrl:t.creditUrl??e,create:()=>new E(a,r)}]}return i}static module(t,e,s={}){const i=d.contributions(t,e);for(const[r,a]of Object.entries(s))Array.isArray(a)&&(i[r]=[...i[r]??[],...a]);return{id:t.id,name:t.name,credit:t.credit,creditUrl:t.creditUrl,url:e,contributes:i}}static absoluteTemplate(t,e){const s=t.replaceAll("{z}","__Z__").replaceAll("{x}","__X__").replaceAll("{y}","__Y__");return new URL(s,e).href.replaceAll("__Z__","{z}").replaceAll("__X__","{x}").replaceAll("__Y__","{y}")}}class T{fetchImpl;importImpl;constructor(t={}){this.fetchImpl=t.fetchImpl??fetch.bind(globalThis),this.importImpl=t.importImpl??(e=>import(e))}async load(t,e){const s=await this.fetchImpl(t);if(!s.ok)throw new Error(`${t}: HTTP ${s.status}`);const i=d.check(await s.json(),t),r=i.script!==void 0;let a={};if(r&&e.runScript){const n=new URL(i.script,t).href,c=await this.importImpl(n);if(typeof c.default!="function")throw new Error(`${n}: its default export is not a function`);const{MODULE_THREE:l}=await b(async()=>{const{MODULE_THREE:m}=await import("./ModuleThree-whEZoXYF.js");return{MODULE_THREE:m}},__vite__mapDeps([0,1]),import.meta.url);a=await c.default({manifestUrl:t,three:l})??{}}return{url:t,manifest:i,module:d.module(i,t,a),hasScript:r,scriptRun:r&&e.runScript}}}class y{constructor(t=new T,e){this.loader=t,this.storage=e}static shared=new y;changes=new EventTarget;states=new Map;config=o.empty();started;list(){const t=[...this.states.values()];return[...t.filter(e=>e.addedByPerson),...t.filter(e=>!e.addedByPerson)]}state(t){return this.states.get(t)}start(){return this.started??=this.applyConfig(o.read(this.storage)),this.started}async add(t){await this.start();const e=new URL(t,typeof location>"u"?void 0:location.href).href;return this.config.modules.some(s=>s.url===e)||(this.config={...this.config,modules:[...this.config.modules,{url:e,enabled:!0}]},this.save()),this.reload(e)}async remove(t){this.config={...this.config,modules:this.config.modules.filter(e=>e.url!==t)},this.save(),await this.reload(t)}async setEnabled(t,e){this.config={...this.config,modules:this.config.modules.map(s=>s.url===t?{...s,enabled:e}:s)},this.save(),await this.reload(t)}exportText(){return o.text(this.config)}async importText(t){const e=o.parse(t);await this.start();const s=this.config.modules.map(i=>i.url);this.config=e,this.save(),await Promise.all([...new Set([...s,...e.modules.map(i=>i.url)])].map(i=>this.reload(i)))}async require(t,e,s=!1){t?.length&&(await this.start(),await Promise.all(t.map(async i=>{let r;try{r=new URL(i,e??(typeof location>"u"?void 0:location.href)).href}catch{return}const a=this.states.get(r),n=s&&!this.trusted.has(r);if(s&&this.trusted.add(r),a&&a.status!=="off"&&!(n&&a.loaded&&!a.loaded.scriptRun))return a.status==="loading"?this.pending.get(r):void 0;this.named.add(r),await this.reload(r)})))}named=new Set;trusted=new Set;pending=new Map;async applyConfig(t){this.config=t,await Promise.all(t.modules.map(e=>this.reload(e.url)))}reload(t){const e=this.reloadNow(t);return this.pending.set(t,e),e}async reloadNow(t){const e=this.config.modules.find(a=>a.url===t),s=this.states.get(t);s?.loaded&&p.uninstall(s.loaded.module.id);const i=e!==void 0,r=e?.enabled??!0;if(!i&&!this.named.has(t))return this.states.delete(t),this.announce(),{url:t,addedByPerson:i,enabled:r,status:"off"};if(i&&!r&&!this.named.has(t))return this.set({url:t,addedByPerson:i,enabled:r,status:"off"});this.set({url:t,addedByPerson:i,enabled:r,status:"loading"});try{const a=await this.loader.load(t,{runScript:i&&r||!i&&this.trusted.has(t)});return p.install(a.module),this.set({url:t,addedByPerson:i,enabled:r,status:"installed",loaded:a})}catch(a){return this.set({url:t,addedByPerson:i,enabled:r,status:"failed",error:a instanceof Error?a.message:String(a)})}}set(t){return this.states.set(t.url,t),this.announce(),t}save(){o.write(this.config,this.storage)}announce(){this.changes.dispatchEvent(new Event("change"))}}export{y as ModuleSession};
3
+ `}static storage(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}}class E{constructor(t,e){this.attribution=t,this.models=e}async entries(t){return t?this.models.filter(e=>[e.kind].flat().includes(t)):[...this.models]}async entry(t){return this.models.find(e=>e.id===t)}}class f{attribution;fetchImpl;tileUrlTemplate;constructor(t){this.attribution=t.attribution,this.tileUrlTemplate=t.tileUrlTemplate,this.fetchImpl=t.fetchImpl??fetch.bind(globalThis)}getImageryTexture(t,e){return g(t,e,s=>f.tileUrl(this.tileUrlTemplate,s),this.fetchImpl)}static tileUrl(t,e){return t.replaceAll("{z}",String(e.z)).replaceAll("{x}",String(e.x)).replaceAll("{y}",String(e.y))}}class v extends Error{constructor(t,e){super(`${t}: ${e}`),this.url=t,this.reason=e,this.name="ModuleManifestError"}}class d{static FORMAT=1;static check(t,e){const s=n=>{throw new v(e,n)};(t===null||typeof t!="object"||Array.isArray(t))&&s("not a JSON object");const i=t;typeof i.format!="number"&&s('no "format"'),i.format>d.FORMAT&&s(`format ${i.format} is newer than ${d.FORMAT}, which this version reads`),(typeof i.id!="string"||!/^[a-z0-9][a-z0-9._-]*$/.test(i.id))&&s(`"id" must be lowercase letters, digits, '.', '_' or '-'`),(typeof i.name!="string"||i.name.trim()==="")&&s('no "name"'),i.script!==void 0&&typeof i.script!="string"&&s('"script" must be an address');const r=i.contributes??{};for(const n of["imagery","elevation"]){const c=r[n];c!==void 0&&(Array.isArray(c)||s(`"contributes.${n}" must be a list`),c.forEach((l,m)=>{for(const h of["id","name","credit","creditUrl","tiles"])(typeof l?.[h]!="string"||l[h]==="")&&s(`"contributes.${n}[${m}].${h}" is missing`);["{z}","{x}","{y}"].every(h=>l.tiles.includes(h))||s(`"contributes.${n}[${m}].tiles" must hold {z}, {x} and {y}`)}))}const a=r.models;return a!==void 0&&(Array.isArray(a)||s('"contributes.models" must be a list'),a.forEach((n,c)=>{for(const l of["id","name","file"])(typeof n?.[l]!="string"||n[l]==="")&&s(`"contributes.models[${c}].${l}" is missing`);n.kind===void 0&&s(`"contributes.models[${c}].kind" is missing`),(!n.credit||typeof n.credit!="object")&&s(`"contributes.models[${c}].credit" is missing: a model is shown with its author and licence`)})),i}static contributions(t,e){const s=t.contributes??{},i={};if(s.imagery?.length&&(i.imagery=s.imagery.map(r=>({id:r.id,name:r.name,credit:r.credit,creditUrl:r.creditUrl,create:a=>new f({tileUrlTemplate:d.absoluteTemplate(r.tiles,e),attribution:r.credit,fetchImpl:a})}))),s.elevation?.length&&(i.elevation=s.elevation.map(r=>({id:r.id,name:r.name,credit:r.credit,creditUrl:r.creditUrl,create:a=>new w({tileUrlTemplate:d.absoluteTemplate(r.tiles,e),fetchImpl:a})}))),s.models?.length){const r=s.models.map(({file:n,...c})=>({...c,url:new URL(n,e).href})),a=t.credit??t.name;i.decorModels=[{id:`${t.id}-models`,name:t.name,credit:a,creditUrl:t.creditUrl??e,create:()=>new E(a,r)}]}return i}static module(t,e,s={}){const i=d.contributions(t,e);for(const[r,a]of Object.entries(s))Array.isArray(a)&&(i[r]=[...i[r]??[],...a]);return{id:t.id,name:t.name,credit:t.credit,creditUrl:t.creditUrl,url:e,contributes:i}}static absoluteTemplate(t,e){const s=t.replaceAll("{z}","__Z__").replaceAll("{x}","__X__").replaceAll("{y}","__Y__");return new URL(s,e).href.replaceAll("__Z__","{z}").replaceAll("__X__","{x}").replaceAll("__Y__","{y}")}}class T{fetchImpl;importImpl;constructor(t={}){this.fetchImpl=t.fetchImpl??fetch.bind(globalThis),this.importImpl=t.importImpl??(e=>import(e))}async load(t,e){const s=await this.fetchImpl(t);if(!s.ok)throw new Error(`${t}: HTTP ${s.status}`);const i=d.check(await s.json(),t),r=i.script!==void 0;let a={};if(r&&e.runScript){const n=new URL(i.script,t).href,c=await this.importImpl(n);if(typeof c.default!="function")throw new Error(`${n}: its default export is not a function`);const{MODULE_THREE:l}=await b(async()=>{const{MODULE_THREE:m}=await import("./ModuleThree-BLNSm2eY.js");return{MODULE_THREE:m}},__vite__mapDeps([0,1]),import.meta.url);a=await c.default({manifestUrl:t,three:l})??{}}return{url:t,manifest:i,module:d.module(i,t,a),hasScript:r,scriptRun:r&&e.runScript}}}class y{constructor(t=new T,e){this.loader=t,this.storage=e}static shared=new y;changes=new EventTarget;states=new Map;config=o.empty();started;list(){const t=[...this.states.values()];return[...t.filter(e=>e.addedByPerson),...t.filter(e=>!e.addedByPerson)]}state(t){return this.states.get(t)}start(){return this.started??=this.applyConfig(o.read(this.storage)),this.started}async add(t){await this.start();const e=new URL(t,typeof location>"u"?void 0:location.href).href;return this.config.modules.some(s=>s.url===e)||(this.config={...this.config,modules:[...this.config.modules,{url:e,enabled:!0}]},this.save()),this.reload(e)}async remove(t){this.config={...this.config,modules:this.config.modules.filter(e=>e.url!==t)},this.save(),await this.reload(t)}async setEnabled(t,e){this.config={...this.config,modules:this.config.modules.map(s=>s.url===t?{...s,enabled:e}:s)},this.save(),await this.reload(t)}exportText(){return o.text(this.config)}async importText(t){const e=o.parse(t);await this.start();const s=this.config.modules.map(i=>i.url);this.config=e,this.save(),await Promise.all([...new Set([...s,...e.modules.map(i=>i.url)])].map(i=>this.reload(i)))}async require(t,e,s=!1){t?.length&&(await this.start(),await Promise.all(t.map(async i=>{let r;try{r=new URL(i,e??(typeof location>"u"?void 0:location.href)).href}catch{return}const a=this.states.get(r),n=s&&!this.trusted.has(r);if(s&&this.trusted.add(r),a&&a.status!=="off"&&!(n&&a.loaded&&!a.loaded.scriptRun))return a.status==="loading"?this.pending.get(r):void 0;this.named.add(r),await this.reload(r)})))}named=new Set;trusted=new Set;pending=new Map;async applyConfig(t){this.config=t,await Promise.all(t.modules.map(e=>this.reload(e.url)))}reload(t){const e=this.reloadNow(t);return this.pending.set(t,e),e}async reloadNow(t){const e=this.config.modules.find(a=>a.url===t),s=this.states.get(t);s?.loaded&&p.uninstall(s.loaded.module.id);const i=e!==void 0,r=e?.enabled??!0;if(!i&&!this.named.has(t))return this.states.delete(t),this.announce(),{url:t,addedByPerson:i,enabled:r,status:"off"};if(i&&!r&&!this.named.has(t))return this.set({url:t,addedByPerson:i,enabled:r,status:"off"});this.set({url:t,addedByPerson:i,enabled:r,status:"loading"});try{const a=await this.loader.load(t,{runScript:i&&r||!i&&this.trusted.has(t)});return p.install(a.module),this.set({url:t,addedByPerson:i,enabled:r,status:"installed",loaded:a})}catch(a){return this.set({url:t,addedByPerson:i,enabled:r,status:"failed",error:a instanceof Error?a.message:String(a)})}}set(t){return this.states.set(t.url,t),this.announce(),t}save(){o.write(this.config,this.storage)}announce(){this.changes.dispatchEvent(new Event("change"))}}export{y as ModuleSession};
@@ -1 +1 @@
1
- import{K as a,X as e,b_ as s,am as t,ao as r,aF as i,ad as o,aA as n,ak as l,al as m,b4 as c,aG as d,aH as u,b$ as b,a4 as M,ap as G,Y as B,E as S,bm as y,bj as f,bn as p,G as h,bA as E,a3 as x,c0 as A,aq as C,c1 as L,c2 as g,c3 as D,C as P,an as T,a2 as F,a5 as j,c4 as k,aE as v,at as H}from"./rr0-sighting.mjs";const V={AdditiveBlending:H,BackSide:v,BoxGeometry:k,BufferAttribute:j,BufferGeometry:F,CanvasTexture:T,Color:P,ConeGeometry:D,CylinderGeometry:g,DataTexture:L,DoubleSide:C,Euler:A,Float32BufferAttribute:x,FrontSide:E,Group:h,Line:p,LineBasicMaterial:f,LineSegments:y,Matrix4:S,Mesh:B,MeshBasicMaterial:G,MeshStandardMaterial:M,NormalBlending:b,Object3D:u,PlaneGeometry:d,PointLight:c,Points:m,PointsMaterial:l,Quaternion:n,ShaderMaterial:o,SphereGeometry:i,Sprite:r,SpriteMaterial:t,TorusGeometry:s,Vector2:e,Vector3:a};export{V as MODULE_THREE};
1
+ import{K as a,X as e,bZ as s,am as t,ao as r,aF as i,ad as o,aA as n,ak as l,al as m,b4 as b,aG as d,aH as u,b_ as c,a4 as M,ap as G,Y as B,E as S,bm as y,bj as f,bn as p,G as h,bA as E,a3 as x,b$ as A,aq as C,c0 as L,c1 as g,c2 as D,C as P,an as T,a2 as F,a5 as j,c3 as k,aE as v,at as H}from"./rr0-sighting.mjs";const V={AdditiveBlending:H,BackSide:v,BoxGeometry:k,BufferAttribute:j,BufferGeometry:F,CanvasTexture:T,Color:P,ConeGeometry:D,CylinderGeometry:g,DataTexture:L,DoubleSide:C,Euler:A,Float32BufferAttribute:x,FrontSide:E,Group:h,Line:p,LineBasicMaterial:f,LineSegments:y,Matrix4:S,Mesh:B,MeshBasicMaterial:G,MeshStandardMaterial:M,NormalBlending:c,Object3D:u,PlaneGeometry:d,PointLight:b,Points:m,PointsMaterial:l,Quaternion:n,ShaderMaterial:o,SphereGeometry:i,Sprite:r,SpriteMaterial:t,TorusGeometry:s,Vector2:e,Vector3:a};export{V as MODULE_THREE};
@@ -0,0 +1 @@
1
+ import{BeamSystem as L}from"./BeamSystem-CsNwl_vM.js";import{L as x}from"./LaserBeam-BRdhNOMZ.js";import{bW as v,bX as M,bY as N,R as D}from"./rr0-sighting.mjs";class E{static APERTURE_M=.6;static NEAR_STEP_M=10;static FAR_STEP_M=250;static STEP_SHARE=.05;static CLOUD_STEP_M=25;static SPENT=.003;beams=new L;placed;lineOwners=[];constructor(){this.beams.group.name="searchlights"}get object(){return this.beams.group}get drawnCount(){return this.beams.drawnCount}update(a,o,t){const c=[],r=[];this.lineOwners=[];const i=t.clouds;i?i.dim(this.beams.material):v.apply(this.beams.material,[]);const l=t.wind??{eastMS:0,northMS:0};for(const s of M.onAt(a,o)){const b=this.whereOf(s,t.reference),g=t.origin.x+b.eastM*t.eastScale,u=t.origin.z-b.northM,p=t.groundYAt(g,u)+(s.heightM??M.DEFAULT_HEIGHT_M),e=s.intensityCd??M.DEFAULT_INTENSITY_CD,m=s.divergenceDeg??M.DEFAULT_DIVERGENCE_DEG,S=m*Math.PI/180,w=M.fluxLm(e,m),n=N.ofTemperature(s.colourTemperatureK??M.DEFAULT_TEMPERATURE_K),T=L.white(n);M.aimsAt(s,o).forEach((A,_)=>{const d=M.axisOf(A),h={x:d.east,y:d.up,z:-d.north},R={windAlongMS:l.eastMS*d.east+l.northMS*d.north,windAcrossMS:l.eastMS*d.north-l.northMS*d.east},{points:y,throughBelow:I}=this.walk({x:g,y:p,z:u},h,S,w,o,t,R);if(c.push({id:s.id,points:y,spectrum:T}),this.lineOwners.push({id:s.id,beam:_}),i&&h.y>.02&&i.bottomY>p){const Y=(i.bottomY-p)/h.y,P=t.air.transmittance(t.siteElevationM+p,t.siteElevationM+i.bottomY,Y),C=e*t.relativeScale;r.push({x:g,y:p,z:u,axis:h,fwhmRad:S,rgb:[C*n[0]*P[0],C*n[1]*P[1],C*n[2]*P[2]],throughCloudsBelow:I})}})}this.beams.drawLines(c,t),t.lightClouds?.(r)}walk(a,o,t,c,r,i,l){const s=i.clouds,b=[],g=[],u=[],p=i.siteElevationM+a.y;let e=0,m=0;for(;;){const w=a.x+o.x*e,n=a.y+o.y*e,T=a.z+o.z*e,A=s!==void 0&&n>=s.bottomY&&n<=s.topY,_=Math.exp(-m),d=e>0?i.air.transmittance(p,i.siteElevationM+n,e)[1]:1;if(b.push({x:w,y:n,z:T,altitudeM:i.siteElevationM+n,widthM:E.APERTURE_M+t*e,powerW:c*d*_,haze:x.patchAt(e,r,{...l,patchiness:x.DEFAULT_PATCHINESS})}),g.push(n),u.push(_),e>=M.RANGE_M||n>=M.CEILING_M||_<E.SPENT)break;const h=A?E.CLOUD_STEP_M:Math.min(E.FAR_STEP_M,Math.max(E.NEAR_STEP_M,e*E.STEP_SHARE));if(s&&(A||n<s.bottomY&&n+o.y*h>s.bottomY)){const R=A?h:Math.max(0,(s.bottomY-n)/Math.max(o.y,1e-6));if(!A){e+=Math.max(1,R);continue}m+=s.extinctionAt(w+o.x*h/2,n+o.y*h/2,T+o.z*h/2)*h}e+=h}return{points:b,throughBelow:w=>{const n=g.findIndex(T=>T>=w);return n<0?u[u.length-1]:u[n]}}}whereOf(a,o){(!this.placed||this.placed.lat!==o.lat||this.placed.lng!==o.lng)&&(this.placed={...o,at:new Map});let t=this.placed.at.get(a);if(!t){const c=D.ecef({lat:o.lat,lng:o.lng,heightM:0}),r=D.ecef({lat:a.lat,lng:a.lng,heightM:0}),i=o.lat*Math.PI/180,l=o.lng*Math.PI/180,s=[r[0]-c[0],r[1]-c[1],r[2]-c[2]];t={eastM:-Math.sin(l)*s[0]+Math.cos(l)*s[1],northM:-Math.sin(i)*Math.cos(l)*s[0]-Math.sin(i)*Math.sin(l)*s[1]+Math.cos(i)*s[2]},this.placed.at.set(a,t)}return t}pick(a,o,t){const c=this.beams.pickAt(a,o,t.toleranceRad);if(c)return{id:c.id,distanceM:c.distanceM,detail:{beam:(this.lineOwners[c.line]?.beam??0)+1}}}dispose(){this.beams.dispose()}}export{E as SearchlightSystem};