@rr0/ufoathome 0.198.1 → 0.199.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.
- package/dist-embed-scene/rr0-scene.mjs +4 -4
- package/dist-embed-sighting/CaseMessages_en-BC0lku35.js +1 -0
- package/dist-embed-sighting/CaseMessages_es-Cbktn5vj.js +1 -0
- package/dist-embed-sighting/CaseMessages_fr-D_6J6ONO.js +1 -0
- package/dist-embed-sighting/CaseMessages_it-CYyww4oG.js +1 -0
- package/dist-embed-sighting/{CaseReportExport-BetcYOov.js → CaseReportExport-CAuwP-Ec.js} +1 -1
- package/dist-embed-sighting/rr0-sighting.mjs +70 -59
- package/dist-embed-sighting-editor/{CaseEditorMessages_en-CpJLWbJD.js → CaseEditorMessages_en-pog3M_U6.js} +1 -1
- package/{dist-embed-ufoathome/CaseEditorMessages_es-C5YOqVpF.js → dist-embed-sighting-editor/CaseEditorMessages_es-Dz1N0VpM.js} +1 -1
- package/{dist-embed-ufoathome/CaseEditorMessages_fr-rMlMgrqV.js → dist-embed-sighting-editor/CaseEditorMessages_fr-BOKVeIXM.js} +1 -1
- package/{dist-embed-ufoathome/CaseEditorMessages_it-Bkiv2Hun.js → dist-embed-sighting-editor/CaseEditorMessages_it-BKAkbKq-.js} +1 -1
- package/dist-embed-sighting-editor/CaseElement--JmpOsUW.js +131 -0
- package/dist-embed-sighting-editor/CaseMessages_en-BC0lku35.js +1 -0
- package/dist-embed-sighting-editor/CaseMessages_es-Cbktn5vj.js +1 -0
- package/dist-embed-sighting-editor/CaseMessages_fr-D_6J6ONO.js +1 -0
- package/dist-embed-sighting-editor/CaseMessages_it-CYyww4oG.js +1 -0
- package/dist-embed-sighting-editor/{CaseReportExport-U-dk4A7z.js → CaseReportExport-nFM_7lq4.js} +1 -1
- package/dist-embed-sighting-editor/{SightingElement-BhyoU_gg.js → SightingElement-DsR4mBCh.js} +1 -1
- package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +123 -111
- package/dist-embed-ufoathome/{AdsbLolArchiveProvider-CUkfGJbL.js → AdsbLolArchiveProvider-B9MGq-iQ.js} +1 -1
- package/dist-embed-ufoathome/{BallesterGuaspAssessor-CB2F8A6P.js → BallesterGuaspAssessor-BehuINgj.js} +1 -1
- package/dist-embed-ufoathome/{BeamEditor-Q_m3KK0S.js → BeamEditor-CFYAfywp.js} +1 -1
- package/dist-embed-ufoathome/{BeamSystem-CVMU5DeE.js → BeamSystem-Bt5Dnpzy.js} +1 -1
- package/dist-embed-ufoathome/{BodyEditor-BwsMj37A.js → BodyEditor-B96fap0d.js} +1 -1
- package/dist-embed-ufoathome/{CaseEditorElement-BrcX9sp0.js → CaseEditorElement-D-RKShTH.js} +88 -77
- package/dist-embed-ufoathome/{CaseEditorMessages_en-CpJLWbJD.js → CaseEditorMessages_en-pog3M_U6.js} +1 -1
- package/{dist-embed-sighting-editor/CaseEditorMessages_es-C5YOqVpF.js → dist-embed-ufoathome/CaseEditorMessages_es-Dz1N0VpM.js} +1 -1
- package/{dist-embed-sighting-editor/CaseEditorMessages_fr-rMlMgrqV.js → dist-embed-ufoathome/CaseEditorMessages_fr-BOKVeIXM.js} +1 -1
- package/{dist-embed-sighting-editor/CaseEditorMessages_it-Bkiv2Hun.js → dist-embed-ufoathome/CaseEditorMessages_it-BKAkbKq-.js} +1 -1
- package/dist-embed-ufoathome/CaseElement-BFDRYL5v.js +131 -0
- package/dist-embed-ufoathome/CaseMessages_en-BC0lku35.js +1 -0
- package/dist-embed-ufoathome/CaseMessages_es-Cbktn5vj.js +1 -0
- package/dist-embed-ufoathome/CaseMessages_fr-D_6J6ONO.js +1 -0
- package/dist-embed-ufoathome/CaseMessages_it-CYyww4oG.js +1 -0
- package/dist-embed-ufoathome/{CaseReportExport--IhmS67e.js → CaseReportExport-VrulN0VG.js} +3 -3
- package/dist-embed-ufoathome/{ColumnResize-CMfGWQHi.js → ColumnResize-DD0wwlp2.js} +7 -6
- package/dist-embed-ufoathome/{ContrailSystem-CuFduINP.js → ContrailSystem-BKeTHlcZ.js} +1 -1
- package/dist-embed-ufoathome/{ControlPasses-BS7yyZOR.js → ControlPasses-D3vc-NmG.js} +1 -1
- package/dist-embed-ufoathome/{CoverageAssessor-BwXJv4OD.js → CoverageAssessor-Be38W7Im.js} +1 -1
- package/dist-embed-ufoathome/{Flightradar24Provider-Cd4o260r.js → Flightradar24Provider-DdPjGVJg.js} +1 -1
- package/dist-embed-ufoathome/{GLTFLoader-BegH9SUA.js → GLTFLoader-D1_vI_Fe.js} +1 -1
- package/dist-embed-ufoathome/{GeoJsonExport-Czm1iAIW.js → GeoJsonExport-B2qogWLj.js} +1 -1
- package/dist-embed-ufoathome/{GeographicFigures-CKg7JYgf.js → GeographicFigures-Ds8kfyn7.js} +1 -1
- package/dist-embed-ufoathome/{HeadlightSystem-DIk-C7_5.js → HeadlightSystem-BdhHphIq.js} +1 -1
- package/dist-embed-ufoathome/{HynekAssessor-BybLMdda.js → HynekAssessor-MqnQfg3F.js} +1 -1
- package/dist-embed-ufoathome/{InterviewEditorElement-CbTakhyi.js → InterviewEditorElement-DjQuGytO.js} +1 -1
- package/dist-embed-ufoathome/{InterviewElement-fI19BieO.js → InterviewElement-BrlawcDm.js} +1 -1
- package/dist-embed-ufoathome/{KmlExport-De-2dnYz.js → KmlExport-AzofE76s.js} +1 -1
- package/dist-embed-ufoathome/{LaserBeam-CouNB7Pe.js → LaserBeam-Ced8VujI.js} +1 -1
- package/dist-embed-ufoathome/{LaunchEditor-BNInX90c.js → LaunchEditor-D-5OJi90.js} +1 -1
- package/dist-embed-ufoathome/{LaunchPlume-DVxzb0wy.js → LaunchPlume-DdeLDyDg.js} +1 -1
- package/dist-embed-ufoathome/{LaunchSimulation-CCvSd6qD.js → LaunchSimulation-BeCHjgE5.js} +1 -1
- package/dist-embed-ufoathome/{ModelSource-BZ1U1VU1.js → ModelSource-LY5T91ay.js} +1 -1
- package/dist-embed-ufoathome/{ModelThumbnails-Ckdb3qoW.js → ModelThumbnails-C25E4WMl.js} +1 -1
- package/dist-embed-ufoathome/{ModelViewer-B9PZN5c7.js → ModelViewer-D6JaOQS7.js} +1 -1
- package/dist-embed-ufoathome/{ModuleConformance-8JN5JVgE.js → ModuleConformance-DGjaEwAM.js} +2 -2
- package/dist-embed-ufoathome/{ModuleSession-ClSpEZMn.js → ModuleSession-pXE1aOJF.js} +3 -3
- package/dist-embed-ufoathome/{ModuleThree-CRG8PTLA.js → ModuleThree-xQDeVLs0.js} +1 -1
- package/dist-embed-ufoathome/{ModulesPanelElement-D4Hos-mF.js → ModulesPanelElement-Bio6lzC6.js} +3 -3
- package/dist-embed-ufoathome/{NearestApproach-DrJN7h_1.js → NearestApproach-DAiByBN2.js} +1 -1
- package/dist-embed-ufoathome/{PictureRegistration-LxhNTA4v.js → PictureRegistration-Dbr0O7NF.js} +1 -1
- package/dist-embed-ufoathome/{PoherAssessor-RyKMyps7.js → PoherAssessor-C7NN73NP.js} +1 -1
- package/dist-embed-ufoathome/{RailwaySystem-BOQvJ2r4.js → RailwaySystem-D3u3j_tw.js} +1 -1
- package/dist-embed-ufoathome/{ReentryEditor-B1H_TUMf.js → ReentryEditor-s-AkSgbU.js} +1 -1
- package/dist-embed-ufoathome/{ReentrySimulation-C7XZlAED.js → ReentrySimulation-2UWwXU7K.js} +1 -1
- package/dist-embed-ufoathome/{ReferenceSystem-BcsjHgaw.js → ReferenceSystem-BhEFpIis.js} +1 -1
- package/dist-embed-ufoathome/{ShareDialogElement-DHlxoHWP.js → ShareDialogElement-C9Uiwt0F.js} +11 -11
- package/dist-embed-ufoathome/{SightingElement-COJwKNNg.js → SightingElement-DTADTDwh.js} +2 -2
- package/dist-embed-ufoathome/{TraceSystem-BBCpq8-v.js → TraceSystem-BcWYbjQM.js} +1 -1
- package/dist-embed-ufoathome/{VideoButton-CGQI7iUA.js → VideoButton-CgfBskVu.js} +1 -1
- package/dist-embed-ufoathome/{WaterSystem-BrIS0Wzy.js → WaterSystem-BsGtTimO.js} +1 -1
- package/dist-embed-ufoathome/rr0-ufoathome.mjs +3 -3
- package/dist-embed-ufoathome/{surroundingsSources-Dg6vMWL7.js → surroundingsSources-B--F7TR5.js} +1 -1
- package/dist-embed-ufoathome/{trafficRuntime-BT5Ol_v5.js → trafficRuntime-B97u9ZY_.js} +1 -1
- package/package.json +1 -1
- package/dist-embed-sighting/CaseMessages_en-G5J5w1_d.js +0 -1
- package/dist-embed-sighting/CaseMessages_es-D7Rp1_1K.js +0 -1
- package/dist-embed-sighting/CaseMessages_fr-B8eZ1NIJ.js +0 -1
- package/dist-embed-sighting/CaseMessages_it-Cu02nVVo.js +0 -1
- package/dist-embed-sighting-editor/CaseElement-IzaexO7n.js +0 -121
- package/dist-embed-sighting-editor/CaseMessages_en-G5J5w1_d.js +0 -1
- package/dist-embed-sighting-editor/CaseMessages_es-D7Rp1_1K.js +0 -1
- package/dist-embed-sighting-editor/CaseMessages_fr-B8eZ1NIJ.js +0 -1
- package/dist-embed-sighting-editor/CaseMessages_it-Cu02nVVo.js +0 -1
- package/dist-embed-ufoathome/CaseElement-Ca8ctACA.js +0 -121
- package/dist-embed-ufoathome/CaseMessages_en-G5J5w1_d.js +0 -1
- package/dist-embed-ufoathome/CaseMessages_es-D7Rp1_1K.js +0 -1
- package/dist-embed-ufoathome/CaseMessages_fr-B8eZ1NIJ.js +0 -1
- package/dist-embed-ufoathome/CaseMessages_it-Cu02nVVo.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as M}from"./LaunchPlume-
|
|
1
|
+
import{L as M}from"./LaunchPlume-DdeLDyDg.js";import{b2 as T,bg as z,bj as f,bb as C,cD as w,cE as A}from"./ShareDialogElement-C9Uiwt0F.js";import"./rr0-ufoathome.mjs";import"./SaidPosition-CXZLm-ck.js";import"./Sighting-Ch4eiBNK.js";import"./VisualAids-DI-hEL46.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./Obstacles-v9SkfBD7.js";class n{static RADIUS=840;static MAX_PUFFS=1e3;static RINGS=[0,.25,.5,.75,1,1.25];static COLUMN=n.RINGS.map(t=>{const i=o=>Math.exp(-((o/M.SIGMA_OF_RADIUS)**2)/2),s=i(n.RINGS[n.RINGS.length-1]);return Math.max(0,(i(t)-s)/(1-s))});static SECTORS=12;static VERTICES_PER_PUFF=n.SECTORS*(3+6*(n.RINGS.length-2));static BRIGHTEST_RELATIVE=6e4;object=new T;mesh;positions=new Float32Array(n.MAX_PUFFS*n.VERTICES_PER_PUFF*3);colors=new Float32Array(n.MAX_PUFFS*n.VERTICES_PER_PUFF*3);shown=0;drawn=[];static VISIBLE_CONTRAST=.1;constructor(){this.object.name="plumes";const t=new z;t.setAttribute("position",new f(this.positions,3)),t.setAttribute("color",new f(this.colors,3)),t.setDrawRange(0,0),this.mesh=new C(t,w.material()),this.mesh.frustumCulled=!1,w.track(this.mesh),this.object.add(this.mesh)}get count(){return this.shown}set(t,i,s,o){let h=0,e=0;this.drawn=[];for(const u of t){if(e>=n.MAX_PUFFS)break;const d=o(u.centre);if(d<=0)continue;const a=s(u.centre),r=[0,1,2].map(g=>Math.min(n.BRIGHTEST_RELATIVE,u.luminanceCdM2*(u.colour?.[g]??1)*i*u.sunTransmittance[g]*a[g]*d));Math.max(...r)<=0||(h=this.pushPuff(h,u,r),this.drawn.push({view:u,direction:this.normalise(A(u.centre.altitudeDeg,u.centre.azimuthDeg,1)),radiusRad:u.radiusDeg*Math.PI/180,luminance:.2126*r[0]+.7152*r[1]+.0722*r[2]}),e++)}this.shown=e;const p=this.mesh.geometry;p.setDrawRange(0,h),p.getAttribute("position").needsUpdate=!0,p.getAttribute("color").needsUpdate=!0}pushPuff(t,i,s){const o=A(i.centre.altitudeDeg,i.centre.azimuthDeg,n.RADIUS),h=this.normalise(o),e=this.normalise(this.cross({x:0,y:1,z:0},h)),p=this.cross(h,e),u=n.RADIUS*Math.tan(i.radiusDeg*Math.PI/180),d=(r,g)=>{const c=g/n.SECTORS*2*Math.PI,I=n.RINGS[r]*u,R=Math.cos(c)*I,l=Math.sin(c)*I;return{x:o.x+e.x*R+p.x*l,y:o.y+e.y*R+p.y*l,z:o.z+e.z*R+p.z*l}},a=r=>n.COLUMN[r];for(let r=0;r<n.SECTORS;r++){const g=(r+1)%n.SECTORS;t=this.push(t,o,s,a(0)),t=this.push(t,d(1,r),s,a(1)),t=this.push(t,d(1,g),s,a(1));for(let c=1;c<n.RINGS.length-1;c++){const I=d(c,r),R=d(c,g),l=d(c+1,r),E=d(c+1,g);t=this.push(t,I,s,a(c)),t=this.push(t,R,s,a(c)),t=this.push(t,l,s,a(c+1)),t=this.push(t,R,s,a(c)),t=this.push(t,E,s,a(c+1)),t=this.push(t,l,s,a(c+1))}}return t}pickAt(t,i,s=0){const o=this.normalise(t);let h=0,e;for(const p of this.drawn){const u=Math.max(-1,Math.min(1,o.x*p.direction.x+o.y*p.direction.y+o.z*p.direction.z)),d=Math.max(0,Math.acos(u)-i)/Math.max(p.radiusRad,1e-9),a=p.luminance*n.profile(d);a<=0||(h+=a,(!e||a>e.light)&&(e={view:p.view,light:a}))}return e&&h>=n.VISIBLE_CONTRAST*s?e.view:void 0}static profile(t){const i=n.RINGS;if(t>=i[i.length-1])return 0;let s=0;for(;t>i[s+1];)s++;const o=(t-i[s])/(i[s+1]-i[s]);return n.COLUMN[s]+(n.COLUMN[s+1]-n.COLUMN[s])*o}push(t,i,s,o){const h=t*3;return this.positions[h]=i.x,this.positions[h+1]=i.y,this.positions[h+2]=i.z,this.colors[h]=s[0]*o,this.colors[h+1]=s[1]*o,this.colors[h+2]=s[2]*o,t+1}cross(t,i){return this.normalise({x:t.y*i.z-t.z*i.y,y:t.z*i.x-t.x*i.z,z:t.x*i.y-t.y*i.x})}normalise(t){const i=Math.hypot(t.x,t.y,t.z)||1;return{x:t.x/i,y:t.y/i,z:t.z/i}}dispose(){this.mesh.geometry.dispose(),this.mesh.material.dispose(),this.object.removeFromParent()}}class k{inSky=!0;plumes=new n;get object(){return this.plumes.object}get drawnCount(){return this.plumes.count}update(t,i,s){const o=t.length===0||!s.date?[]:M.viewsAt(t,i,s.observer,M.sunDirectionAt(s.date));o.length===0&&this.plumes.count===0||this.plumes.set(o,s.relativeScale,h=>s.transmittanceFromSpace(h),h=>s.cloudTransmission(h))}pick(t,i,s){const o=this.plumes.pickAt(i,s.toleranceRad,s.skyLightTowards(i));return o&&{id:o.launchId,detail:o}}dispose(){this.plumes.dispose()}}export{k as LaunchSimulation};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b2 as d,cY as p,az as l,bb as f,cZ as m,bi as u,bp as w,bq as b,c_ as g,c$ as y,c3 as M,b6 as S,b7 as v}from"./ShareDialogElement-
|
|
1
|
+
import{b2 as d,cY as p,az as l,bb as f,cZ as m,bi as u,bp as w,bq as b,c_ as g,c$ as y,c3 as M,b6 as S,b7 as v}from"./ShareDialogElement-C9Uiwt0F.js";class c{static key(e){return"url"in e?`url:${e.url}|${e.headingOffsetDeg??0}`:"shape"in e?`shape:${e.shape}`:`decor:${e.decorKind}`}static async build(e){const s=new d;if("url"in e){const a=await p(e.url);a.rotation.y=-(e.headingOffsetDeg??0)*Math.PI/180,s.add(a)}else"shape"in e?s.add(c.shapeOf(e.shape)):s.add(l.build({id:"preview",kind:e.decorKind,eastM:0,northM:0},!1));return s}static shapeOf(e){if(e==="figure")return l.build({id:"preview",kind:"entity",eastM:0,northM:0},!1);const s=new f(m.unitGeometry(e),new u({color:13158608,roughness:.5,metalness:0}));return e==="ellipsoid"&&s.scale.set(1,.55,1),s}static dispose(e){e.traverse(s=>{const a=s;if(a.isMesh){a.geometry?.dispose();for(const t of[a.material].flat())t.dispose()}})}static stage(e,s){const a=new w().setFromObject(e);if(a.isEmpty())return;const t=a.getBoundingSphere(new b),r=new d;e.position.sub(t.center),r.add(e);const n=new g;n.add(r),n.add(new y(16777215,6715272,1.6));const o=new M(16777215,2.5);o.position.set(1,2,1.5),n.add(o);const i=new S(30,s,t.radius*.05,t.radius*20),h=t.radius/Math.sin(i.fov*Math.PI/360)*1.05;return i.position.copy(new v(.55,.3,-.78).normalize().multiplyScalar(h)),i.lookAt(0,0,0),{scene:n,camera:i,pivot:r}}}export{c as M};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cX as o}from"./ShareDialogElement-
|
|
1
|
+
import{cX as o}from"./ShareDialogElement-C9Uiwt0F.js";import{M as s}from"./ModelSource-LY5T91ay.js";import"./rr0-ufoathome.mjs";import"./SaidPosition-CXZLm-ck.js";import"./Sighting-Ch4eiBNK.js";import"./VisualAids-DI-hEL46.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./Obstacles-v9SkfBD7.js";class y{static SIZE_PX={width:192,height:144};static cache=new Map;static queue=Promise.resolve();static pending=0;static renderer;static of(r){const t=s.key(r);let e=this.cache.get(t);return e||(this.pending++,e=this.queue.then(()=>this.draw(r)).catch(()=>{}).finally(()=>{--this.pending===0&&this.release()}),this.queue=e,this.cache.set(t,e)),e}static async draw(r){const t=await s.build(r);try{const{width:e,height:n}=this.SIZE_PX,a=s.stage(t,e/n);if(!a)return;const i=this.renderer??=new o({antialias:!0,alpha:!0,preserveDrawingBuffer:!0});return i.setSize(e,n,!1),i.setClearColor(0,0),i.render(a.scene,a.camera),i.domElement.toDataURL("image/png")}finally{s.dispose(t)}}static release(){this.renderer?.dispose(),this.renderer?.forceContextLoss(),this.renderer=void 0}}export{y as ModelThumbnails};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cX as h}from"./ShareDialogElement-
|
|
1
|
+
import{cX as h}from"./ShareDialogElement-C9Uiwt0F.js";import{M as c}from"./ModelSource-LY5T91ay.js";import"./rr0-ufoathome.mjs";import"./SaidPosition-CXZLm-ck.js";import"./Sighting-Ch4eiBNK.js";import"./VisualAids-DI-hEL46.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./Obstacles-v9SkfBD7.js";class a{constructor(t,i){this.container=t,this.source=i,this.canvas=document.createElement("canvas"),this.canvas.className="model-live",this.canvas.style.cssText="position:absolute;inset:0;width:100%;height:100%;touch-action:none;cursor:grab;display:none",this.canvas.addEventListener("pointerdown",s=>this.press(s)),this.canvas.addEventListener("pointermove",s=>this.move(s)),this.canvas.addEventListener("pointerup",()=>this.release()),this.canvas.addEventListener("pointercancel",()=>this.release())}static renderer;static SPIN_RAD_PER_S=.7;static DRAG_RAD_PER_PX=.012;static CLICK_TOLERANCE_PX=4;static current;object;stage;frame=0;stopped=!1;last=0;dragging;draggedPastClick=!1;canvas;static show(t,i){a.current?.stop();const s=new a(t,i);return a.current=s,s.start(),s}static end(){a.current?.stop(),a.current=void 0,a.renderer?.dispose(),a.renderer?.forceContextLoss(),a.renderer=void 0}consumeDrag(){const t=this.draggedPastClick;return this.draggedPastClick=!1,t}get active(){return!this.stopped}stop(){this.stopped=!0,cancelAnimationFrame(this.frame),this.canvas.remove(),this.object&&c.dispose(this.object),this.object=void 0,a.current===this&&(a.current=void 0)}async start(){try{const t=await c.build(this.source);if(this.stopped){c.dispose(t);return}this.object=t;const{width:i,height:s}=this.container.getBoundingClientRect(),e=i>0&&s>0?i/s:4/3;if(this.stage=c.stage(t,e),!this.stage)return;(a.renderer??=new h({antialias:!0,alpha:!0})).setClearColor(0,0),this.container.append(this.canvas),this.canvas.style.display="block",this.last=performance.now(),this.tick()}catch{}}tick=()=>{if(this.stopped||!this.stage)return;const t=performance.now(),i=Math.min(.1,(t-this.last)/1e3);this.last=t,this.dragging||(this.stage.pivot.rotation.y+=a.SPIN_RAD_PER_S*i);const s=a.renderer,{width:e,height:n}=this.canvas.getBoundingClientRect(),r=Math.min(2,window.devicePixelRatio||1);(this.canvas.width!==Math.round(e*r)||this.canvas.height!==Math.round(n*r))&&(s.setPixelRatio(r),s.setSize(e,n,!1),this.canvas.width=Math.round(e*r),this.canvas.height=Math.round(n*r),this.stage.camera.aspect=e/Math.max(1,n),this.stage.camera.updateProjectionMatrix()),s.render(this.stage.scene,this.stage.camera);const o=this.canvas.getContext("2d");o?.clearRect(0,0,this.canvas.width,this.canvas.height),o?.drawImage(s.domElement,0,0,this.canvas.width,this.canvas.height),this.frame=requestAnimationFrame(this.tick)};press(t){this.dragging={x:t.clientX,y:t.clientY,moved:!1},this.canvas.setPointerCapture(t.pointerId),this.canvas.style.cursor="grabbing"}move(t){const i=this.dragging;if(!i||!this.stage)return;const s=t.clientX-i.x,e=t.clientY-i.y;!i.moved&&Math.hypot(s,e)<a.CLICK_TOLERANCE_PX||(i.moved=!0,this.draggedPastClick=!0,this.stage.pivot.rotation.y+=s*a.DRAG_RAD_PER_PX,this.stage.pivot.rotation.x=Math.max(-1.4,Math.min(1.4,this.stage.pivot.rotation.x-e*a.DRAG_RAD_PER_PX)),i.x=t.clientX,i.y=t.clientY)}release(){this.dragging=void 0,this.canvas.style.cursor="grab"}}export{a as ModelViewer};
|
package/dist-embed-ufoathome/{ModuleConformance-8JN5JVgE.js → ModuleConformance-DGjaEwAM.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ModuleThree-
|
|
2
|
-
import{_ as w}from"./rr0-ufoathome.mjs";class n{static MEMBERS={weather:["getWeather"],place:["attribution","search","reverse"],timeZone:["zoneAt"],narrative:["settings","draft"],assessment:["assess"],lightPollution:["year","citation","lookUp"],aircraft:["citation","between"],upperAir:["between"],elevation:["getElevationGrid"],imagery:["attribution","getImageryTexture"],surroundings:["id","name","attribution","creditUrl","contemporary","covers","getSurroundings"],decorModels:["attribution","entries","entry"],skyEvents:["key","messages","simulation"],interpretations:["key","messages","compute"],perception:["id","messages","sources","settings","perceive"],transcription:["sendsAudio","engine","transcribe"],reentryTypes:["key","nature","messages","template"]};static WEATHER_SHARES=["cloudCover","cloudDarkness","precipitationIntensity","highCloudCover","lowerCloudCover","iceCrystalAlignment","rareIceCrystals","relativeHumidity"];static WEATHER_REQUIRED=["cloudCover","cloudDarkness","precipitationIntensity"];static PRECIPITATIONS=["none","rain","snow","hail"];static HIGH_WIND_MS=60;static TIMEOUT_MS=3e4;static async check(i,a={}){const r=[];i.hasScript&&!i.scriptRun&&r.push({level:"note",code:"scriptNotRun"});for(const[t,s]of Object.entries(i.module.contributes))Object.hasOwn(n.MEMBERS,t)?Array.isArray(s)?await n.checkPoint(t,s,a,r):r.push({level:"failed",code:"notAList",point:t}):r.push({level:"failed",code:"unknownPoint",point:t});return r}static async checkPoint(i,a,r,t){const s=new Set;for(const e of a){const c=(l,d,g="failed")=>{t.push({level:g,code:l,point:i,source:typeof e?.id=="string"?e.id:void 0,detail:d})};if(s.has(e?.id)&&c("duplicateId"),s.add(e?.id),n.checkEntry(e,c),typeof e?.create!="function"){c("createMissing");continue}const o=n.build(e,c);if(o===void 0)continue;const h=n.MEMBERS[i].filter(l=>o[l]===void 0);for(const l of h)c("missingMember",l);h.length>0||(i==="weather"&&await n.checkWeather(e.id,o,r,c),i==="skyEvents"&&await n.checkSkyEventKind(e.id,o,r,c),i==="interpretations"&&await n.checkInterpretationKind(e.id,o,r,c))}}static checkEntry(i,a){for(const r of["id","name","credit","creditUrl"]){const t=i?.[r];(typeof t!="string"||t.trim()==="")&&a("entryField",r)}typeof i?.creditUrl=="string"&&i.creditUrl!==""&&!URL.canParse(i.creditUrl)&&a("entryField","creditUrl")}static build(i,a){let r=!1;const t=(async()=>(r=!0,new Response("",{status:503}))),s=globalThis.fetch;globalThis.fetch=t;try{const e=i.create(t);if(r&&a("createAsked"),e==null){a("createEmpty");return}return e}catch(e){a("createThrew",n.told(e));return}finally{globalThis.fetch=s}}static async checkWeather(i,a,r,t){const s=r.weatherQuery;if(!s){t("weatherNotAsked",void 0,"note");return}let e;try{e=await n.within(a.getWeather(s),r)}catch(l){t("weatherThrew",n.told(l));return}if(e===void 0){t("weatherNoRecord",void 0,"note");return}const c=e?.samples;if(!Array.isArray(c)||c.length!==s.points.length){t("weatherSamples",`${Array.isArray(c)?c.length:0}/${s.points.length}`);return}c.some((l,d)=>l?.time?.getTime?.()!==s.points[d].time.getTime())&&t("weatherOrder");const o=new Set;let h=!1;for(const l of c){const d=l?.weather??{};for(const g of n.WEATHER_SHARES){const u=d[g],p=n.WEATHER_REQUIRED.includes(g);(u!==void 0||p)&&!n.between(u,0,1)&&o.add(`${g} = ${String(u)}`)}n.between(d.windDirectionDeg,0,360)||o.add(`windDirectionDeg = ${String(d.windDirectionDeg)}`),n.between(d.windSpeed,0,1/0)?d.windSpeed>n.HIGH_WIND_MS&&(h=!0):o.add(`windSpeed = ${String(d.windSpeed)}`),n.PRECIPITATIONS.includes(d.precipitationType)||o.add(`precipitationType = ${String(d.precipitationType)}`),typeof d.storm!="boolean"&&o.add(`storm = ${String(d.storm)}`)}for(const l of o)t("weatherValue",l);h&&t("weatherWindHigh",void 0,"note"),e.source?.id!==i&&t("weatherSource","id"),(typeof e.source?.name!="string"||e.source.name==="")&&t("weatherSource","name"),(typeof e.source?.url!="string"||e.source.url==="")&&t("weatherSource","url")}static async checkSkyEventKind(i,a,r,t){a.key!==i&&t("kindKey",String(a.key)),await n.checkTexts(a.messages,["title","name"],r,t);let s;try{s=(await n.within(a.simulation(),r))()}catch(o){t("simulationFailed",n.told(o));return}const{MODULE_THREE:e}=await w(async()=>{const{MODULE_THREE:o}=await import("./ModuleThree-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ModuleThree-xQDeVLs0.js","./ShareDialogElement-C9Uiwt0F.js","./rr0-ufoathome.mjs","./SaidPosition-CXZLm-ck.js","./Sighting-Ch4eiBNK.js","./VisualAids-DI-hEL46.js","./Decor-Dn-cvniW.js","./RecordingIssue-BlWT8Xsu.js","./Obstacles-v9SkfBD7.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as w}from"./rr0-ufoathome.mjs";class n{static MEMBERS={weather:["getWeather"],place:["attribution","search","reverse"],timeZone:["zoneAt"],narrative:["settings","draft"],assessment:["assess"],lightPollution:["year","citation","lookUp"],aircraft:["citation","between"],upperAir:["between"],elevation:["getElevationGrid"],imagery:["attribution","getImageryTexture"],surroundings:["id","name","attribution","creditUrl","contemporary","covers","getSurroundings"],decorModels:["attribution","entries","entry"],skyEvents:["key","messages","simulation"],interpretations:["key","messages","compute"],perception:["id","messages","sources","settings","perceive"],transcription:["sendsAudio","engine","transcribe"],reentryTypes:["key","nature","messages","template"]};static WEATHER_SHARES=["cloudCover","cloudDarkness","precipitationIntensity","highCloudCover","lowerCloudCover","iceCrystalAlignment","rareIceCrystals","relativeHumidity"];static WEATHER_REQUIRED=["cloudCover","cloudDarkness","precipitationIntensity"];static PRECIPITATIONS=["none","rain","snow","hail"];static HIGH_WIND_MS=60;static TIMEOUT_MS=3e4;static async check(i,a={}){const r=[];i.hasScript&&!i.scriptRun&&r.push({level:"note",code:"scriptNotRun"});for(const[t,s]of Object.entries(i.module.contributes))Object.hasOwn(n.MEMBERS,t)?Array.isArray(s)?await n.checkPoint(t,s,a,r):r.push({level:"failed",code:"notAList",point:t}):r.push({level:"failed",code:"unknownPoint",point:t});return r}static async checkPoint(i,a,r,t){const s=new Set;for(const e of a){const c=(l,d,g="failed")=>{t.push({level:g,code:l,point:i,source:typeof e?.id=="string"?e.id:void 0,detail:d})};if(s.has(e?.id)&&c("duplicateId"),s.add(e?.id),n.checkEntry(e,c),typeof e?.create!="function"){c("createMissing");continue}const o=n.build(e,c);if(o===void 0)continue;const h=n.MEMBERS[i].filter(l=>o[l]===void 0);for(const l of h)c("missingMember",l);h.length>0||(i==="weather"&&await n.checkWeather(e.id,o,r,c),i==="skyEvents"&&await n.checkSkyEventKind(e.id,o,r,c),i==="interpretations"&&await n.checkInterpretationKind(e.id,o,r,c))}}static checkEntry(i,a){for(const r of["id","name","credit","creditUrl"]){const t=i?.[r];(typeof t!="string"||t.trim()==="")&&a("entryField",r)}typeof i?.creditUrl=="string"&&i.creditUrl!==""&&!URL.canParse(i.creditUrl)&&a("entryField","creditUrl")}static build(i,a){let r=!1;const t=(async()=>(r=!0,new Response("",{status:503}))),s=globalThis.fetch;globalThis.fetch=t;try{const e=i.create(t);if(r&&a("createAsked"),e==null){a("createEmpty");return}return e}catch(e){a("createThrew",n.told(e));return}finally{globalThis.fetch=s}}static async checkWeather(i,a,r,t){const s=r.weatherQuery;if(!s){t("weatherNotAsked",void 0,"note");return}let e;try{e=await n.within(a.getWeather(s),r)}catch(l){t("weatherThrew",n.told(l));return}if(e===void 0){t("weatherNoRecord",void 0,"note");return}const c=e?.samples;if(!Array.isArray(c)||c.length!==s.points.length){t("weatherSamples",`${Array.isArray(c)?c.length:0}/${s.points.length}`);return}c.some((l,d)=>l?.time?.getTime?.()!==s.points[d].time.getTime())&&t("weatherOrder");const o=new Set;let h=!1;for(const l of c){const d=l?.weather??{};for(const g of n.WEATHER_SHARES){const u=d[g],p=n.WEATHER_REQUIRED.includes(g);(u!==void 0||p)&&!n.between(u,0,1)&&o.add(`${g} = ${String(u)}`)}n.between(d.windDirectionDeg,0,360)||o.add(`windDirectionDeg = ${String(d.windDirectionDeg)}`),n.between(d.windSpeed,0,1/0)?d.windSpeed>n.HIGH_WIND_MS&&(h=!0):o.add(`windSpeed = ${String(d.windSpeed)}`),n.PRECIPITATIONS.includes(d.precipitationType)||o.add(`precipitationType = ${String(d.precipitationType)}`),typeof d.storm!="boolean"&&o.add(`storm = ${String(d.storm)}`)}for(const l of o)t("weatherValue",l);h&&t("weatherWindHigh",void 0,"note"),e.source?.id!==i&&t("weatherSource","id"),(typeof e.source?.name!="string"||e.source.name==="")&&t("weatherSource","name"),(typeof e.source?.url!="string"||e.source.url==="")&&t("weatherSource","url")}static async checkSkyEventKind(i,a,r,t){a.key!==i&&t("kindKey",String(a.key)),await n.checkTexts(a.messages,["title","name"],r,t);let s;try{s=(await n.within(a.simulation(),r))()}catch(o){t("simulationFailed",n.told(o));return}const{MODULE_THREE:e}=await w(async()=>{const{MODULE_THREE:o}=await import("./ModuleThree-xQDeVLs0.js");return{MODULE_THREE:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url);if(!(s?.object instanceof e.Object3D)){t("secondThree");return}try{s.update([],0,n.frame(new e.Vector3)),s.drawnCount!==0&&t("drawnWithoutEvents",String(s.drawnCount))}catch(o){t("updateThrew",n.told(o))}const c=new e.Group;c.add(s.object);try{s.dispose(),s.object.parent===c&&t("disposeLeft")}catch(o){t("disposeThrew",n.told(o))}}static async checkInterpretationKind(i,a,r,t){a.key!==i&&t("kindKey",String(a.key)),await n.checkTexts(a.messages,["title"],r,t);const s=r.interpretation?.[a.key];if(!Array.isArray(s)||s.length===0){t("readingNotTried",void 0,"note");return}let e;try{if(e=await n.within(a.compute(),r),typeof e!="function"){t("readingThrew","compute");return}}catch(c){t("readingThrew",n.told(c));return}for(const c of s)try{const o=e(c);Array.isArray(o)||t("readingNotAList")}catch(o){t("readingThrew",n.told(o))}}static async checkTexts(i,a,r,t){for(const s of["en","fr"])try{const e=await n.within(i.load(s),r);for(const c of a)(typeof e?.[c]!="string"||e[c]==="")&&t("kindMessages",`${s}: ${c}`)}catch(e){t("kindMessages",`${s}: ${n.told(e)}`)}}static frame(i){return{reference:{lat:0,lng:0},origin:{x:0,z:0},eastScale:1,siteElevationM:0,eye:i,pixelRad:.001,relativeScale:1,air:{},transmittanceTo:()=>[1,1,1],groundYAt:()=>0,wind:{eastMS:0,northMS:0},observer:{lat:0,lng:0,heightM:0},date:new Date(0),magnitudeLimit:6,cloudTransmission:()=>1,arrivingIlluminance:()=>[0,0,0],transmittanceFromSpace:()=>[1,1,1],lightFrom:()=>{},glareFrom:()=>{}}}static between(i,a,r){return typeof i=="number"&&!Number.isNaN(i)&&i>=a&&i<=r}static told(i){return i instanceof Error?i.message:String(i)}static within(i,a){const r=a.timeoutMs??n.TIMEOUT_MS;let t;const s=new Promise((e,c)=>{t=setTimeout(()=>c(new Error(`> ${r/1e3} s`)),r)});return Promise.race([i,s]).finally(()=>clearTimeout(t))}}export{n as ModuleConformance};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ModuleThree-
|
|
2
|
-
import{_ as g,e as p}from"./rr0-ufoathome.mjs";import{a$ as w,b0 as b}from"./ShareDialogElement-
|
|
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 w(t,e,i=>f.tileUrl(this.tileUrlTemplate,i),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 i=o=>{throw new v(e,o)};(t===null||typeof t!="object"||Array.isArray(t))&&i("not a JSON object");const r=t;typeof r.format!="number"&&i('no "format"'),r.format>d.FORMAT&&i(`format ${r.format} is newer than ${d.FORMAT}, which this version reads`),(typeof r.id!="string"||!/^[a-z0-9][a-z0-9._-]*$/.test(r.id))&&i(`"id" must be lowercase letters, digits, '.', '_' or '-'`),(typeof r.name!="string"||r.name.trim()==="")&&i('no "name"'),r.script!==void 0&&typeof r.script!="string"&&i('"script" must be an address');const s=r.contributes??{};for(const o of["imagery","elevation"]){const c=s[o];c!==void 0&&(Array.isArray(c)||i(`"contributes.${o}" must be a list`),c.forEach((l,h)=>{for(const m of["id","name","credit","creditUrl","tiles"])(typeof l?.[m]!="string"||l[m]==="")&&i(`"contributes.${o}[${h}].${m}" is missing`);["{z}","{x}","{y}"].every(m=>l.tiles.includes(m))||i(`"contributes.${o}[${h}].tiles" must hold {z}, {x} and {y}`)}))}const a=s.models;return a!==void 0&&(Array.isArray(a)||i('"contributes.models" must be a list'),a.forEach((o,c)=>{for(const l of["id","name","file"])(typeof o?.[l]!="string"||o[l]==="")&&i(`"contributes.models[${c}].${l}" is missing`);o.kind===void 0&&i(`"contributes.models[${c}].kind" is missing`),(!o.credit||typeof o.credit!="object")&&i(`"contributes.models[${c}].credit" is missing: a model is shown with its author and licence`)})),r}static contributions(t,e){const i=t.contributes??{},r={};if(i.imagery?.length&&(r.imagery=i.imagery.map(s=>({id:s.id,name:s.name,credit:s.credit,creditUrl:s.creditUrl,create:a=>new f({tileUrlTemplate:d.absoluteTemplate(s.tiles,e),attribution:s.credit,fetchImpl:a})}))),i.elevation?.length&&(r.elevation=i.elevation.map(s=>({id:s.id,name:s.name,credit:s.credit,creditUrl:s.creditUrl,create:a=>new b({tileUrlTemplate:d.absoluteTemplate(s.tiles,e),fetchImpl:a})}))),i.models?.length){const s=i.models.map(({file:o,...c})=>({...c,url:new URL(o,e).href})),a=t.credit??t.name;r.decorModels=[{id:`${t.id}-models`,name:t.name,credit:a,creditUrl:t.creditUrl??e,create:()=>new E(a,s)}]}return r}static module(t,e,i={}){const r=d.contributions(t,e);for(const[s,a]of Object.entries(i))Array.isArray(a)&&(r[s]=[...r[s]??[],...a]);return{id:t.id,name:t.name,credit:t.credit,creditUrl:t.creditUrl,url:e,contributes:r}}static absoluteTemplate(t,e){const i=t.replaceAll("{z}","__Z__").replaceAll("{x}","__X__").replaceAll("{y}","__Y__");return new URL(i,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 i=await this.fetchImpl(t);if(!i.ok)throw new Error(`${t}: HTTP ${i.status}`);const r=d.check(await i.json(),t),s=r.script!==void 0;let a={};if(s&&e.runScript){const o=new URL(r.script,t).href,c=await this.importImpl(o);if(typeof c.default!="function")throw new Error(`${o}: its default export is not a function`);const{MODULE_THREE:l}=await g(async()=>{const{MODULE_THREE:h}=await import("./ModuleThree-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ModuleThree-xQDeVLs0.js","./ShareDialogElement-C9Uiwt0F.js","./rr0-ufoathome.mjs","./SaidPosition-CXZLm-ck.js","./Sighting-Ch4eiBNK.js","./VisualAids-DI-hEL46.js","./Decor-Dn-cvniW.js","./RecordingIssue-BlWT8Xsu.js","./Obstacles-v9SkfBD7.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as g,e as p}from"./rr0-ufoathome.mjs";import{a$ as w,b0 as b}from"./ShareDialogElement-C9Uiwt0F.js";import"./SaidPosition-CXZLm-ck.js";import"./Sighting-Ch4eiBNK.js";import"./VisualAids-DI-hEL46.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./Obstacles-v9SkfBD7.js";class n{static STORAGE_KEY="ufoathome.modules";static FORMAT=1;static empty(){return{format:1,modules:[]}}static read(t=n.storage()){try{const e=t?.getItem(n.STORAGE_KEY);return e?n.parse(e):n.empty()}catch{return n.empty()}}static write(t,e=n.storage()){try{return e?(t.modules.length===0?e.removeItem(n.STORAGE_KEY):e.setItem(n.STORAGE_KEY,n.text(t)),!0):!1}catch{return!1}}static parse(t){const e=JSON.parse(t);if(e===null||typeof e!="object"||!Array.isArray(e.modules))throw new Error("not a UFO@home module list");if(typeof e.format=="number"&&e.format>n.FORMAT)throw new Error(`format ${e.format} is newer than ${n.FORMAT}`);const i=new Set,r=[];for(const s of e.modules)typeof s?.url!="string"||i.has(s.url)||(i.add(s.url),r.push({url:s.url,enabled:s.enabled!==!1}));return{format:1,modules:r}}static text(t){return JSON.stringify({format:n.FORMAT,modules:t.modules},null,2)+`
|
|
3
|
+
`}static storage(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}}class E{constructor(t,e){this.attribution=t,this.models=e}async entries(t){return t?this.models.filter(e=>[e.kind].flat().includes(t)):[...this.models]}async entry(t){return this.models.find(e=>e.id===t)}}class f{attribution;fetchImpl;tileUrlTemplate;constructor(t){this.attribution=t.attribution,this.tileUrlTemplate=t.tileUrlTemplate,this.fetchImpl=t.fetchImpl??fetch.bind(globalThis)}getImageryTexture(t,e){return w(t,e,i=>f.tileUrl(this.tileUrlTemplate,i),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 i=o=>{throw new v(e,o)};(t===null||typeof t!="object"||Array.isArray(t))&&i("not a JSON object");const r=t;typeof r.format!="number"&&i('no "format"'),r.format>d.FORMAT&&i(`format ${r.format} is newer than ${d.FORMAT}, which this version reads`),(typeof r.id!="string"||!/^[a-z0-9][a-z0-9._-]*$/.test(r.id))&&i(`"id" must be lowercase letters, digits, '.', '_' or '-'`),(typeof r.name!="string"||r.name.trim()==="")&&i('no "name"'),r.script!==void 0&&typeof r.script!="string"&&i('"script" must be an address');const s=r.contributes??{};for(const o of["imagery","elevation"]){const c=s[o];c!==void 0&&(Array.isArray(c)||i(`"contributes.${o}" must be a list`),c.forEach((l,h)=>{for(const m of["id","name","credit","creditUrl","tiles"])(typeof l?.[m]!="string"||l[m]==="")&&i(`"contributes.${o}[${h}].${m}" is missing`);["{z}","{x}","{y}"].every(m=>l.tiles.includes(m))||i(`"contributes.${o}[${h}].tiles" must hold {z}, {x} and {y}`)}))}const a=s.models;return a!==void 0&&(Array.isArray(a)||i('"contributes.models" must be a list'),a.forEach((o,c)=>{for(const l of["id","name","file"])(typeof o?.[l]!="string"||o[l]==="")&&i(`"contributes.models[${c}].${l}" is missing`);o.kind===void 0&&i(`"contributes.models[${c}].kind" is missing`),(!o.credit||typeof o.credit!="object")&&i(`"contributes.models[${c}].credit" is missing: a model is shown with its author and licence`)})),r}static contributions(t,e){const i=t.contributes??{},r={};if(i.imagery?.length&&(r.imagery=i.imagery.map(s=>({id:s.id,name:s.name,credit:s.credit,creditUrl:s.creditUrl,create:a=>new f({tileUrlTemplate:d.absoluteTemplate(s.tiles,e),attribution:s.credit,fetchImpl:a})}))),i.elevation?.length&&(r.elevation=i.elevation.map(s=>({id:s.id,name:s.name,credit:s.credit,creditUrl:s.creditUrl,create:a=>new b({tileUrlTemplate:d.absoluteTemplate(s.tiles,e),fetchImpl:a})}))),i.models?.length){const s=i.models.map(({file:o,...c})=>({...c,url:new URL(o,e).href})),a=t.credit??t.name;r.decorModels=[{id:`${t.id}-models`,name:t.name,credit:a,creditUrl:t.creditUrl??e,create:()=>new E(a,s)}]}return r}static module(t,e,i={}){const r=d.contributions(t,e);for(const[s,a]of Object.entries(i))Array.isArray(a)&&(r[s]=[...r[s]??[],...a]);return{id:t.id,name:t.name,credit:t.credit,creditUrl:t.creditUrl,url:e,contributes:r}}static absoluteTemplate(t,e){const i=t.replaceAll("{z}","__Z__").replaceAll("{x}","__X__").replaceAll("{y}","__Y__");return new URL(i,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 i=await this.fetchImpl(t);if(!i.ok)throw new Error(`${t}: HTTP ${i.status}`);const r=d.check(await i.json(),t),s=r.script!==void 0;let a={};if(s&&e.runScript){const o=new URL(r.script,t).href,c=await this.importImpl(o);if(typeof c.default!="function")throw new Error(`${o}: its default export is not a function`);const{MODULE_THREE:l}=await g(async()=>{const{MODULE_THREE:h}=await import("./ModuleThree-xQDeVLs0.js");return{MODULE_THREE:h}},__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url);a=await c.default({manifestUrl:t,three:l})??{}}return{url:t,manifest:r,module:d.module(r,t,a),hasScript:s,scriptRun:s&&e.runScript}}}class y{constructor(t=new T,e){this.loader=t,this.storage=e}static shared=new y;changes=new EventTarget;states=new Map;config=n.empty();started;list(){const t=[...this.states.values()];return[...t.filter(e=>e.addedByPerson),...t.filter(e=>!e.addedByPerson)]}state(t){return this.states.get(t)}start(){return this.started??=this.applyConfig(n.read(this.storage)),this.started}async add(t){await this.start();const e=new URL(t,typeof location>"u"?void 0:location.href).href;return this.config.modules.some(i=>i.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(i=>i.url===t?{...i,enabled:e}:i)},this.save(),await this.reload(t)}exportText(){return n.text(this.config)}async importText(t){const e=n.parse(t);await this.start();const i=this.config.modules.map(r=>r.url);this.config=e,this.save(),await Promise.all([...new Set([...i,...e.modules.map(r=>r.url)])].map(r=>this.reload(r)))}async require(t,e){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 s=this.states.get(r);if(s&&s.status!=="off")return s.status==="loading"?this.pending.get(r):void 0;this.named.add(r),await this.reload(r)})))}named=new Set;pending=new Map;async applyConfig(t){this.config=t,await Promise.all(t.modules.map(e=>this.reload(e.url)))}reload(t){const e=this.reloadNow(t);return this.pending.set(t,e),e}async reloadNow(t){const e=this.config.modules.find(a=>a.url===t),i=this.states.get(t);i?.loaded&&p.uninstall(i.loaded.module.id);const r=e!==void 0,s=e?.enabled??!0;if(!r&&!this.named.has(t))return this.states.delete(t),this.announce(),{url:t,addedByPerson:r,enabled:s,status:"off"};if(r&&!s&&!this.named.has(t))return this.set({url:t,addedByPerson:r,enabled:s,status:"off"});this.set({url:t,addedByPerson:r,enabled:s,status:"loading"});try{const a=await this.loader.load(t,{runScript:r&&s});return p.install(a.module),this.set({url:t,addedByPerson:r,enabled:s,status:"installed",loaded:a})}catch(a){return this.set({url:t,addedByPerson:r,enabled:s,status:"failed",error:a instanceof Error?a.message:String(a)})}}set(t){return this.states.set(t.url,t),this.announce(),t}save(){n.write(this.config,this.storage)}announce(){this.changes.dispatchEvent(new Event("change"))}}export{y as ModuleSession};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b7 as a,ba as e,d0 as t,bA as r,bC as s,bR as i,br as o,bM as b,by as n,bz as m,c2 as d,bS as l,bT as c,d1 as p,bi as u,bD as M,bb as y,b5 as B,ck as S,ch as G,cl as h,b2 as f,cy as g,bh as x,cU as C,bE as D,d2 as E,d3 as L,d4 as T,b4 as A,bB as P,bg as j,bj as k,d5 as v,bQ as F,bG as O}from"./ShareDialogElement-
|
|
1
|
+
import{b7 as a,ba as e,d0 as t,bA as r,bC as s,bR as i,br as o,bM as b,by as n,bz as m,c2 as d,bS as l,bT as c,d1 as p,bi as u,bD as M,bb as y,b5 as B,ck as S,ch as G,cl as h,b2 as f,cy as g,bh as x,cU as C,bE as D,d2 as E,d3 as L,d4 as T,b4 as A,bB as P,bg as j,bj as k,d5 as v,bQ as F,bG as O}from"./ShareDialogElement-C9Uiwt0F.js";import"./rr0-ufoathome.mjs";import"./SaidPosition-CXZLm-ck.js";import"./Sighting-Ch4eiBNK.js";import"./VisualAids-DI-hEL46.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./Obstacles-v9SkfBD7.js";const q={AdditiveBlending:O,BackSide:F,BoxGeometry:v,BufferAttribute:k,BufferGeometry:j,CanvasTexture:P,Color:A,ConeGeometry:T,CylinderGeometry:L,DataTexture:E,DoubleSide:D,Euler:C,Float32BufferAttribute:x,FrontSide:g,Group:f,Line:h,LineBasicMaterial:G,LineSegments:S,Matrix4:B,Mesh:y,MeshBasicMaterial:M,MeshStandardMaterial:u,NormalBlending:p,Object3D:c,PlaneGeometry:l,PointLight:d,Points:m,PointsMaterial:n,Quaternion:b,ShaderMaterial:o,SphereGeometry:i,Sprite:s,SpriteMaterial:r,TorusGeometry:t,Vector2:e,Vector3:a};export{q as MODULE_THREE};
|
package/dist-embed-ufoathome/{ModulesPanelElement-D4Hos-mF.js → ModulesPanelElement-Bio6lzC6.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ModuleConformance-
|
|
2
|
-
import{M as _,_ as x,H as y,g as m}from"./rr0-ufoathome.mjs";import{ModuleSession as L}from"./ModuleSession-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ModuleConformance-DGjaEwAM.js","./rr0-ufoathome.mjs"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{M as _,_ as x,H as y,g as m}from"./rr0-ufoathome.mjs";import{ModuleSession as L}from"./ModuleSession-pXE1aOJF.js";import{M as C}from"./CaseEditorElement-D-RKShTH.js";import"./ShareDialogElement-C9Uiwt0F.js";import"./SaidPosition-CXZLm-ck.js";import"./Sighting-Ch4eiBNK.js";import"./VisualAids-DI-hEL46.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./Obstacles-v9SkfBD7.js";import"./ParameterForm-DcVFxrcO.js";import"./ColumnResize-DD0wwlp2.js";import"./TimelineTracks-BgZmkKhn.js";import"./ReentryArchive-CeXHrU7L.js";import"./ReferenceTimeline-2kBldQeG.js";import"./upperAirSources-BGuLpdwu.js";import"./Account-C4jhsVtN.js";const M=_.catalog({en:()=>x(()=>import("./ModulesPanelMessages_en-DuwrY3Pm.js"),[],import.meta.url).then(b=>b.modulesPanelMessages_en),fr:()=>x(()=>import("./ModulesPanelMessages_fr-B8cSDc6o.js"),[],import.meta.url).then(b=>b.modulesPanelMessages_fr),es:()=>x(()=>import("./ModulesPanelMessages_es-Bq5X-XuT.js"),[],import.meta.url).then(b=>b.modulesPanelMessages_es),it:()=>x(()=>import("./ModulesPanelMessages_it-BdC626aJ.js"),[],import.meta.url).then(b=>b.modulesPanelMessages_it)}),N="rr0-modules-panel",P=`
|
|
3
3
|
rr0-modules-panel { display: block; }
|
|
4
4
|
rr0-modules-panel .mp-add { display: flex; gap: .4em; align-items: center; margin: .4em 0; }
|
|
5
5
|
rr0-modules-panel .mp-add input { flex: 1 1 16em; min-width: 0; }
|
|
@@ -12,4 +12,4 @@ rr0-modules-panel .mp-head .mp-remove { margin-left: auto; }
|
|
|
12
12
|
rr0-modules-panel .mp-module p { margin: .2em 0; }
|
|
13
13
|
rr0-modules-panel .mp-findings { margin: .3em 0; padding-left: 1.2em; }
|
|
14
14
|
rr0-modules-panel .mp-files { display: flex; gap: .6em; flex-wrap: wrap; align-items: center; margin-top: .6em; }
|
|
15
|
-
`;class A extends HTMLElement{session=L.shared;messages;languageAsked=!1;named=[];recordingBase;note;languageToken=0;draft="";onChange=()=>this.render();checkContext;checks=new Map;set moduleSession(e){this.session.changes.removeEventListener("change",this.onChange),this.session=e,this.isConnected&&this.session.changes.addEventListener("change",this.onChange),this.render()}get recordingModules(){return[...this.named]}set recordingModules(e){this.named=[...e??[]],this.render()}set base(e){this.recordingBase=e,this.render()}async setLanguage(e){this.languageAsked=!0;const t=++this.languageToken,n=await M.load(e);t===this.languageToken&&(this.messages=n,this.render())}connectedCallback(){this.languageAsked||this.setLanguage(y.preferencesFor(this)[0]??"en"),this.session.changes.addEventListener("change",this.onChange),this.session.start(),this.render()}disconnectedCallback(){this.session.changes.removeEventListener("change",this.onChange)}absolute(e){try{return new URL(e,this.recordingBase??location.href).href}catch{return}}isNamed(e){return this.named.some(t=>this.absolute(t)===e)}setNamed(e,t){t!==this.isNamed(e)&&(this.named=t?[...this.named,C.of(e,this.recordingBase)]:this.named.filter(n=>this.absolute(n)!==e),t&&this.session.require([e]),this.dispatchEvent(new Event("recordingmoduleschange",{bubbles:!0})),this.render())}render(){const e=this.messages;if(!this.isConnected||!this.messages)return;const t=this.ownerDocument,n=t.createElement("style");n.textContent=P;const s=t.createElement("p");s.className=m.INFO,s.textContent=e.intro;const a=t.createElement("form");a.className="mp-add";const i=t.createElement("input");i.type="url",i.id="module-url",i.required=!0,i.placeholder=e.urlPlaceholder,i.value=this.draft,i.addEventListener("input",()=>{this.draft=i.value}),i.setAttribute("aria-label",e.urlPlaceholder);const u=t.createElement("button");u.type="submit",u.textContent=e.add,a.append(i,u),a.addEventListener("submit",r=>{r.preventDefault();const w=i.value.trim();w&&(this.draft="",this.session.add(w))});const l=t.createElement("p");l.className=m.WARNING,l.textContent=e.codeWarning;const c=this.session.list(),p=new Set(c.map(r=>r.url)),v=this.named.map(r=>this.absolute(r)).filter(r=>r!==void 0&&!p.has(r)),g=t.createElement("ul");g.className="mp-list",g.append(...c.map(r=>this.item(r)),...v.map(r=>this.item({url:r,addedByPerson:!1,enabled:!0,status:"loading"})));const k=t.createElement("p");k.className=m.INFO,k.textContent=e.none,k.hidden=g.childElementCount>0;const f=t.createElement("div");f.className="mp-files";const E=t.createElement("button");E.type="button",E.id="modules-export",E.textContent=e.exportConfig,E.disabled=!c.some(r=>r.addedByPerson),E.addEventListener("click",()=>this.download());const h=t.createElement("input");h.type="file",h.id="modules-import",h.accept="application/json,.json",h.hidden=!0;const o=t.createElement("button");o.type="button",o.textContent=e.importConfig,o.addEventListener("click",()=>h.click()),h.addEventListener("change",()=>{const r=h.files?.[0];r&&this.importFile(r),h.value=""}),f.append(E,o,h);const d=t.createElement("p");d.id="modules-note",d.setAttribute("role","status"),m.show(d,this.note?.text,this.note?.kind),this.replaceChildren(n,s,a,l,g,k,f,d)}item(e){const t=this.messages,n=this.ownerDocument,s=e.loaded,a=n.createElement("li");a.className="mp-module",a.dataset.url=e.url;const i=n.createElement("div");if(i.className="mp-head",e.addedByPerson){const o=n.createElement("label"),d=n.createElement("input");d.type="checkbox",d.className="mp-enabled",d.checked=e.enabled,d.addEventListener("change",()=>void this.session.setEnabled(e.url,d.checked)),o.append(d,n.createTextNode(` ${t.enabled}`)),i.append(o)}const u=n.createElement("span");u.className="mp-name",u.textContent=e.loaded?.module.name??e.url,i.append(u);const l=e.loaded?.module.credit;if(l){const o=n.createElement(e.loaded?.module.creditUrl?"a":"span");o.className=m.INFO,o.textContent=l,o instanceof HTMLAnchorElement&&(o.href=e.loaded.module.creditUrl,o.target="_blank",o.rel="noopener noreferrer"),i.append(o)}const c=n.createElement("button");if(c.type="button",c.className="mp-remove",e.addedByPerson?(c.textContent=t.remove,c.addEventListener("click",()=>void this.session.remove(e.url))):(c.textContent=t.addToMine,c.addEventListener("click",()=>void this.session.add(e.url))),e.status==="installed"&&s){const o=n.createElement("button");o.type="button",o.className="mp-check";const d=this.checks.get(e.url),r=d?.of===s&&d.findings===void 0&&d.crash===void 0;o.textContent=r?t.checking:t.check,o.disabled=r,o.addEventListener("click",()=>void this.check(e.url,s)),i.append(o)}i.append(c);const p=n.createElement("p");p.className=`${m.INFO} mp-url`,p.textContent=e.url;const v=n.createElement("p");v.className="mp-status",e.status==="loading"?m.show(v,t.loading):e.status==="failed"?m.show(v,t.failed.replace("{error}",e.error??""),"error"):e.status==="off"?m.show(v,t.off):m.show(v,this.brings(e));const g=n.createElement("p");g.className="mp-code",s?.scriptRun?m.show(g,t.runsCode,"warning"):s?.hasScript?m.show(g,t.codeNotRun,"info"):g.hidden=!0;const k=n.createElement("label");k.title=t.namedByRecordingHint;const f=n.createElement("input");f.type="checkbox",f.className="mp-named",f.checked=this.isNamed(e.url),f.addEventListener("change",()=>this.setNamed(e.url,f.checked)),k.append(f,n.createTextNode(` ${t.namedByRecording}`));const E=n.createElement("p");E.append(k),a.append(i,p,v,g,E);const h=this.checks.get(e.url);return h&&h.of===s&&a.append(...this.checkResult(h)),a}async check(e,t){const n={of:t};this.checks.set(e,n),this.render();try{const{ModuleConformance:s}=await x(async()=>{const{ModuleConformance:a}=await import("./ModuleConformance-
|
|
15
|
+
`;class A extends HTMLElement{session=L.shared;messages;languageAsked=!1;named=[];recordingBase;note;languageToken=0;draft="";onChange=()=>this.render();checkContext;checks=new Map;set moduleSession(e){this.session.changes.removeEventListener("change",this.onChange),this.session=e,this.isConnected&&this.session.changes.addEventListener("change",this.onChange),this.render()}get recordingModules(){return[...this.named]}set recordingModules(e){this.named=[...e??[]],this.render()}set base(e){this.recordingBase=e,this.render()}async setLanguage(e){this.languageAsked=!0;const t=++this.languageToken,n=await M.load(e);t===this.languageToken&&(this.messages=n,this.render())}connectedCallback(){this.languageAsked||this.setLanguage(y.preferencesFor(this)[0]??"en"),this.session.changes.addEventListener("change",this.onChange),this.session.start(),this.render()}disconnectedCallback(){this.session.changes.removeEventListener("change",this.onChange)}absolute(e){try{return new URL(e,this.recordingBase??location.href).href}catch{return}}isNamed(e){return this.named.some(t=>this.absolute(t)===e)}setNamed(e,t){t!==this.isNamed(e)&&(this.named=t?[...this.named,C.of(e,this.recordingBase)]:this.named.filter(n=>this.absolute(n)!==e),t&&this.session.require([e]),this.dispatchEvent(new Event("recordingmoduleschange",{bubbles:!0})),this.render())}render(){const e=this.messages;if(!this.isConnected||!this.messages)return;const t=this.ownerDocument,n=t.createElement("style");n.textContent=P;const s=t.createElement("p");s.className=m.INFO,s.textContent=e.intro;const a=t.createElement("form");a.className="mp-add";const i=t.createElement("input");i.type="url",i.id="module-url",i.required=!0,i.placeholder=e.urlPlaceholder,i.value=this.draft,i.addEventListener("input",()=>{this.draft=i.value}),i.setAttribute("aria-label",e.urlPlaceholder);const u=t.createElement("button");u.type="submit",u.textContent=e.add,a.append(i,u),a.addEventListener("submit",r=>{r.preventDefault();const w=i.value.trim();w&&(this.draft="",this.session.add(w))});const l=t.createElement("p");l.className=m.WARNING,l.textContent=e.codeWarning;const c=this.session.list(),p=new Set(c.map(r=>r.url)),v=this.named.map(r=>this.absolute(r)).filter(r=>r!==void 0&&!p.has(r)),g=t.createElement("ul");g.className="mp-list",g.append(...c.map(r=>this.item(r)),...v.map(r=>this.item({url:r,addedByPerson:!1,enabled:!0,status:"loading"})));const k=t.createElement("p");k.className=m.INFO,k.textContent=e.none,k.hidden=g.childElementCount>0;const f=t.createElement("div");f.className="mp-files";const E=t.createElement("button");E.type="button",E.id="modules-export",E.textContent=e.exportConfig,E.disabled=!c.some(r=>r.addedByPerson),E.addEventListener("click",()=>this.download());const h=t.createElement("input");h.type="file",h.id="modules-import",h.accept="application/json,.json",h.hidden=!0;const o=t.createElement("button");o.type="button",o.textContent=e.importConfig,o.addEventListener("click",()=>h.click()),h.addEventListener("change",()=>{const r=h.files?.[0];r&&this.importFile(r),h.value=""}),f.append(E,o,h);const d=t.createElement("p");d.id="modules-note",d.setAttribute("role","status"),m.show(d,this.note?.text,this.note?.kind),this.replaceChildren(n,s,a,l,g,k,f,d)}item(e){const t=this.messages,n=this.ownerDocument,s=e.loaded,a=n.createElement("li");a.className="mp-module",a.dataset.url=e.url;const i=n.createElement("div");if(i.className="mp-head",e.addedByPerson){const o=n.createElement("label"),d=n.createElement("input");d.type="checkbox",d.className="mp-enabled",d.checked=e.enabled,d.addEventListener("change",()=>void this.session.setEnabled(e.url,d.checked)),o.append(d,n.createTextNode(` ${t.enabled}`)),i.append(o)}const u=n.createElement("span");u.className="mp-name",u.textContent=e.loaded?.module.name??e.url,i.append(u);const l=e.loaded?.module.credit;if(l){const o=n.createElement(e.loaded?.module.creditUrl?"a":"span");o.className=m.INFO,o.textContent=l,o instanceof HTMLAnchorElement&&(o.href=e.loaded.module.creditUrl,o.target="_blank",o.rel="noopener noreferrer"),i.append(o)}const c=n.createElement("button");if(c.type="button",c.className="mp-remove",e.addedByPerson?(c.textContent=t.remove,c.addEventListener("click",()=>void this.session.remove(e.url))):(c.textContent=t.addToMine,c.addEventListener("click",()=>void this.session.add(e.url))),e.status==="installed"&&s){const o=n.createElement("button");o.type="button",o.className="mp-check";const d=this.checks.get(e.url),r=d?.of===s&&d.findings===void 0&&d.crash===void 0;o.textContent=r?t.checking:t.check,o.disabled=r,o.addEventListener("click",()=>void this.check(e.url,s)),i.append(o)}i.append(c);const p=n.createElement("p");p.className=`${m.INFO} mp-url`,p.textContent=e.url;const v=n.createElement("p");v.className="mp-status",e.status==="loading"?m.show(v,t.loading):e.status==="failed"?m.show(v,t.failed.replace("{error}",e.error??""),"error"):e.status==="off"?m.show(v,t.off):m.show(v,this.brings(e));const g=n.createElement("p");g.className="mp-code",s?.scriptRun?m.show(g,t.runsCode,"warning"):s?.hasScript?m.show(g,t.codeNotRun,"info"):g.hidden=!0;const k=n.createElement("label");k.title=t.namedByRecordingHint;const f=n.createElement("input");f.type="checkbox",f.className="mp-named",f.checked=this.isNamed(e.url),f.addEventListener("change",()=>this.setNamed(e.url,f.checked)),k.append(f,n.createTextNode(` ${t.namedByRecording}`));const E=n.createElement("p");E.append(k),a.append(i,p,v,g,E);const h=this.checks.get(e.url);return h&&h.of===s&&a.append(...this.checkResult(h)),a}async check(e,t){const n={of:t};this.checks.set(e,n),this.render();try{const{ModuleConformance:s}=await x(async()=>{const{ModuleConformance:a}=await import("./ModuleConformance-DGjaEwAM.js");return{ModuleConformance:a}},__vite__mapDeps([0,1]),import.meta.url);n.findings=await s.check(t,this.checkContext?.())}catch(s){n.crash=s instanceof Error?s.message:String(s)}this.render()}checkResult(e){const t=this.messages,n=this.ownerDocument,s=(l,c)=>{const p=n.createElement("p");return p.className="mp-check-result",p.setAttribute("role","status"),m.show(p,l,c),p};if(e.crash!==void 0)return[s(t.checkCrashed.replace("{error}",()=>e.crash),"error")];if(!e.findings)return[];const a=e.findings.filter(l=>l.level==="failed"),i=e.findings.filter(l=>l.level==="note"),u=[];if(a.length===0&&u.push(s(t.checkPassed,"info")),a.length+i.length>0){const l=n.createElement("ul");l.className="mp-findings";for(const c of[...a,...i]){const p=n.createElement("li");m.show(p,this.finding(c),c.level==="failed"?"error":"info"),l.append(p)}u.push(l)}return u}finding(e){const t=this.messages,n=e.point===void 0?"":t.points[e.point]??e.point,s=t.checks[e.code].replace("{point}",()=>e.point??"").replace("{detail}",()=>e.detail??""),a=e.source??(e.code==="unknownPoint"||e.code==="notAList"?void 0:n);return a?t.checkAbout.replace("{about}",()=>a).replace("{text}",()=>s):s}brings(e){const t=Object.entries(e.loaded?.module.contributes??{}).filter(([,n])=>Array.isArray(n)&&n.length>0).map(([n,s])=>`${this.messages.points[n]??n} (${s.length})`);return t.length>0?this.messages.brings.replace("{points}",t.join(", ")):this.messages.bringsNothing}download(){const e=new Blob([this.session.exportText()],{type:"application/json"}),t=URL.createObjectURL(e),n=this.ownerDocument.createElement("a");n.href=t,n.download="ufoathome-modules.json",n.click(),URL.revokeObjectURL(t)}async importFile(e){try{await this.session.importText(await e.text());const t=this.session.list().filter(n=>n.addedByPerson).length;this.note={text:this.messages.imported.replace("{count}",String(t)),kind:"info"}}catch(t){this.note={text:this.messages.importFailed.replace("{error}",t instanceof Error?t.message:String(t)),kind:"error"}}this.render()}}function z(){customElements.get(N)||customElements.define(N,A)}export{N as MODULES_PANEL_ELEMENT_NAME,A as ModulesPanelElement,z as register};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b1 as b,aS as h}from"./ShareDialogElement-
|
|
1
|
+
import{b1 as b,aS as h}from"./ShareDialogElement-C9Uiwt0F.js";class c{static FLAT={heightAt:()=>0};static of(e){const s=e.timeline.sourceIds.map(n=>b.of(e,n)?.nearestM).filter(n=>n!==void 0);return s.length>0?{m:Math.min(...s),basis:"derived",paths:["timeline","observerTrack"]}:c.interpreted(e)}static interpreted(e){const s=(e.interpretation?.bodies??[]).map((t,i)=>({body:t,index:i})).filter(({body:t})=>Array.isArray(t.track)),n=s.filter(({body:t})=>(t.explains?.length??0)>0),u=n.length>0?n:s,d=c.FLAT,l=t=>h.eyeOf(e,t,d);let o;const p=[];for(const{body:t,index:i}of u){const M=new h(t,d,l);for(const{t:f}of t.track){const a=M.at(f),r=l(f);if(!a||!r)continue;const m=Math.hypot(a.eastM-r.eastM,a.northM-r.northM,a.upM-r.upM);(o===void 0||m<o)&&(o=m)}p.push(`interpretation.bodies.${i}`)}return o===void 0?void 0:{m:o,basis:"assumed",paths:p}}}export{c as N};
|
package/dist-embed-ufoathome/{PictureRegistration-LxhNTA4v.js → PictureRegistration-Dbr0O7NF.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b7 as m,bT as b,cU as A,bM as x,b5 as O,cV as w}from"./ShareDialogElement-
|
|
1
|
+
import{b7 as m,bT as b,cU as A,bM as x,b5 as O,cV as w}from"./ShareDialogElement-C9Uiwt0F.js";import"./rr0-ufoathome.mjs";import"./SaidPosition-CXZLm-ck.js";import"./Sighting-Ch4eiBNK.js";import"./VisualAids-DI-hEL46.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./Obstacles-v9SkfBD7.js";const D=Math.PI/180,z=180/Math.PI;class C{static localDirection(t,e,i,o=new m){const n=Math.tan(e/2*D);return o.set((t.u*2-1)*n*i,(1-t.v*2)*n,-1).normalize()}static picturePoint(t,e,i){if(t.z>=0)return;const o=Math.tan(e/2*D),n=t.x/-t.z/(o*i),r=t.y/-t.z/o;return{u:(n+1)/2,v:(1-r)/2}}static worldDirection(t,e=new m){const i=t.azimuthDeg*D,o=t.altitudeDeg*D;return e.set(Math.sin(i)*Math.cos(o),Math.sin(o),-Math.cos(i)*Math.cos(o))}static aimOf(t){const e=Math.hypot(t.x,t.z);return{azimuthDeg:(Math.atan2(t.x,-t.z)*z+360)%360,altitudeDeg:Math.atan2(t.y,e)*z}}static rotationOf(t){const e=new b;return e.rotation.set(t.pitchDeg*D,-t.headingDeg*D,-(t.rollDeg??0)*D,"YXZ"),e.quaternion.clone()}static anglesOf(t){const e=new A().setFromQuaternion(t,"YXZ"),i=(-e.y*z%360+360)%360,o=-e.z*z;return{headingDeg:i,pitchDeg:e.x*z,rollDeg:Math.abs(o)<1e-9?0:o}}static worldDirectionOf(t,e,i,o=new m){return this.localDirection(t,e.fovDeg,i,o).applyQuaternion(this.rotationOf(e))}static picturePointOf(t,e,i){const o=t.clone().applyQuaternion(this.rotationOf(e).invert()),n=this.picturePoint(o,e.fovDeg,i);if(!(!n||n.u<0||n.u>1||n.v<0||n.v>1))return n}static solve(t,e,i,o=t.length>=3){if(t.length<2)return;if(!o)return this.solveAtField(t,e,i);let n=1,r=179;const h=(Math.sqrt(5)-1)/2;let f=r-h*(r-n),c=n+h*(r-n),s=this.solveAtField(t,e,f),a=this.solveAtField(t,e,c);for(let l=0;l<60&&r-n>1e-4;l++){if(!s||!a)return;s.residualDeg<a.residualDeg?(r=c,c=f,a=s,f=r-h*(r-n),s=this.solveAtField(t,e,f)):(n=f,f=c,s=a,c=n+h*(r-n),a=this.solveAtField(t,e,c))}return s&&a?s.residualDeg<a.residualDeg?s:a:s??a}static solveAtField(t,e,i){const o=t.map(c=>this.localDirection(c.picture,i,e)),n=t.map(c=>this.worldDirection(c.scene)),r=this.triad(o,n);if(!r)return;const h=this.refine(r,o,n);return{registration:{...this.anglesOf(h),fovDeg:i},residualDeg:this.residualDeg(h,o,n)}}static triad(t,e){let i=0,o=1,n=-1;for(let s=0;s<t.length;s++)for(let a=s+1;a<t.length;a++){const g=t[s].clone().cross(t[a]).lengthSq();g>n&&(n=g,i=s,o=a)}if(n<1e-12)return;const r=(s,a)=>{const g=s.clone().normalize(),l=s.clone().cross(a).normalize(),u=l.clone().cross(g);return new w().set(g.x,u.x,l.x,g.y,u.y,l.y,g.z,u.z,l.z)},h=r(t[i],t[o]),c=r(e[i],e[o]).multiply(h.transpose());return new x().setFromRotationMatrix(new O().setFromMatrix3(c))}static refine(t,e,i){const o=t.clone(),n=new m;for(let r=0;r<20;r++){const h=new w().set(0,0,0,0,0,0,0,0,0),f=h.elements,c=new m;for(let l=0;l<e.length;l++){n.copy(e[l]).applyQuaternion(o);const u=n,y=[[0,u.z,-u.y],[-u.z,0,u.x],[u.y,-u.x,0]],v=[i[l].x-u.x,i[l].y-u.y,i[l].z-u.z];for(let p=0;p<3;p++){for(let d=0;d<3;d++)for(let M=0;M<3;M++)f[d*3+p]+=y[M][p]*y[M][d];c.setComponent(p,c.getComponent(p)+y[0][p]*v[0]+y[1][p]*v[1]+y[2][p]*v[2])}}for(let l=0;l<3;l++)f[l*3+l]+=1e-9;const s=c.applyMatrix3(h.invert()),a=s.length();if(a<1e-12)break;const g=new x().setFromAxisAngle(s.normalize(),a);if(o.premultiply(g).normalize(),a<1e-10)break}return o}static residualDeg(t,e,i){let o=0;const n=new m;for(let r=0;r<e.length;r++){n.copy(e[r]).applyQuaternion(t);const h=n.angleTo(i[r])*z;o+=h*h}return Math.sqrt(o/e.length)}}export{C as PictureRegistration};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{w as u}from"./ShareDialogElement-
|
|
1
|
+
import{w as u}from"./ShareDialogElement-C9Uiwt0F.js";import"./rr0-ufoathome.mjs";import"./SaidPosition-CXZLm-ck.js";import"./Sighting-Ch4eiBNK.js";import"./VisualAids-DI-hEL46.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./Obstacles-v9SkfBD7.js";class o{about="shape";static STEP_DEG=2;static TURN_DEG=60;static ERRATIC_TURNS=3;static OSCILLATIONS=["vibrate","spiral","roll"];async assess(n){const t=this.trajectory(n),s=this.vanish(n),e=this.oscillation(n),i=this.landing(n),c=this.judged(n,"traces"),r=this.occupants(n),h=i.shown&&r.shown?5:i.shown&&c.shown?4:i.shown||t.value==="erratic"||s.shown||e.shown?3:t.value==="abnormal"?2:t.value==="straight"?1:0,a=[{id:"poher-trajectory",basis:t.basis,paths:t.paths,value:o.TRAJECTORIES.indexOf(t.value)},this.criterion("poher-vanish",s),this.criterion("poher-oscillation",e),{...this.criterion("poher-landing",i),unsupported:i.basis===void 0},this.criterion("poher-traces",c),this.criterion("poher-occupants",r)];return{verdict:String(h),criteria:a}}static TRAJECTORIES=["unknown","still","straight","abnormal","erratic"];criterion(n,t){return{id:n,value:t.shown?1:0,basis:t.basis,paths:t.basis===void 0?[]:t.paths}}trajectory(n){let t="unknown";for(const s of n.timeline.sourceIds){const e=this.seen(n,s).filter(a=>a.aim!==void 0).map(a=>a.aim);if(e.length<2)continue;const i=[o.unit(e[0])];for(const a of e.slice(1)){const l=o.unit(a);o.angleDeg(i[i.length-1],l)>=o.STEP_DEG&&i.push(l)}const c=i.length-1;let r=0;for(let a=1;a<i.length-1;a++){const l=o.cross(i[a-1],i[a]),d=o.cross(i[a],i[a+1]);o.angleDeg(l,d)>=o.TURN_DEG&&r++}const h=c===0?"still":r>=o.ERRATIC_TURNS?"erratic":r>0?"abnormal":"straight";o.TRAJECTORIES.indexOf(h)>o.TRAJECTORIES.indexOf(t)&&(t=h)}return t==="unknown"?{value:t,paths:[]}:{value:t,basis:"derived",paths:["timeline"]}}vanish(n){const t=(n.events??[]).findIndex(s=>s.eventType==="vanish"&&u.isPhenomenon(n,s));return t>=0?{shown:!0,basis:"stated",paths:[`events.${t}`]}:{shown:!1,paths:[]}}oscillation(n){const t=new Set((n.interpretation?.bodies??[]).map(e=>e.id)),s=(n.events??[]).findIndex(e=>o.OSCILLATIONS.includes(e.eventType)&&(u.isPhenomenon(n,e)||t.has(e.who?.split("/")[0]??"")));return s>=0?{shown:!0,basis:"stated",paths:[`events.${s}`]}:{shown:!1,paths:[]}}landing(n){const t=e=>!e.onGround&&((e.altitudeAboveGroundM??0)>0||(e.altitudeM??0)>0),s=(n.interpretation?.bodies??[]).findIndex(e=>Array.isArray(e.track)&&e.track.some(i=>i.onGround)&&e.track.some(t));return s>=0?{shown:!0,basis:"assumed",paths:[`interpretation.bodies.${s}`]}:{shown:!1,paths:[]}}occupants(n){const t=n.decor.findIndex(s=>s.kind==="entity");return t>=0?{shown:!0,basis:"stated",paths:[`decor.${t}`]}:this.judged(n,"beings")}judged(n,t){const s=n.account?.strangeness?.[t];return s===void 0?{shown:!1,paths:[]}:{shown:s,basis:"stated",paths:[`account.strangeness.${t}`]}}instants(n,t){return n.timeline.allKeyframes.map(s=>({t:s.t,shape:s.shapes.find(e=>e.sourceId===t)?.shape})).filter(({shape:s})=>s!==void 0).map(({t:s,shape:e})=>({t:s,aim:e.aim,visible:e.transparency<1})).sort((s,e)=>s.t-e.t)}seen(n,t){return this.instants(n,t).filter(s=>s.visible)}static unit(n){const[t,s]=[n.azimuthDeg*Math.PI/180,n.altitudeDeg*Math.PI/180];return[Math.cos(s)*Math.sin(t),Math.cos(s)*Math.cos(t),Math.sin(s)]}static cross(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}static angleDeg(n,t){const s=Math.hypot(...n)*Math.hypot(...t);if(s===0)return 0;const e=(n[0]*t[0]+n[1]*t[1]+n[2]*t[2])/s;return Math.acos(Math.max(-1,Math.min(1,e)))*180/Math.PI}}export{o as PoherAssessor};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b2 as F,bi as P,b4 as H,bg as K,bj as N,bb as w,bk as k}from"./ShareDialogElement-DHlxoHWP.js";import{g as U}from"./SaidPosition-CXZLm-ck.js";import"./rr0-ufoathome.mjs";import"./Sighting-Ch4eiBNK.js";import"./VisualAids-DI-hEL46.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./Obstacles-v9SkfBD7.js";class D{static HOLLOW_M=1;static COVERED_M=3;static WINDOW_M=30;static SAMPLE_M=4;static MAX_GRADE={rail:.025,highSpeed:.035,subway:.04,light_rail:.06,tram:.08,funicular:1/0};static heights(t,s,e){const n=t.map(a=>a.level===0),o=t.map((a,i)=>n[i]?D.targets(a,s,e):[]),c=t.map((a,i)=>n[i]?D.samples(a,o[i]):[]),r=new Map;t.forEach((a,i)=>{if(n[i])for(const h of D.ends(a)){const p=D.key(h),M=r.get(p);M?M.push(i):r.set(p,[i])}});const u=a=>{const i=r.get(D.key(a));if(i)return D.median(i.flatMap(h=>c[h]),a)};return t.map((a,i)=>{if(n[i]){const h=[...new Set([i,...D.ends(a).flatMap(d=>r.get(D.key(d))??[])])].flatMap(d=>c[d]),p=a.centre.map((d,O)=>D.median(h,d)??o[i][O]),[M,A]=D.ends(a);return p[0]=u(M)??p[0],p[p.length-1]=u(A)??p[p.length-1],D.graded(p,a.along,a.highSpeed?D.MAX_GRADE.highSpeed:D.MAX_GRADE[a.kind])}return D.carried(a,s,e,u)})}static targets(t,s,e){return t.centre.map(n=>{const o=s(n.x,n.z);if(e===void 0||n.altitudeM===void 0)return o;const c=n.altitudeM+e;return c-o>D.HOLLOW_M||o-c>D.COVERED_M?c:o})}static samples(t,s){const e=[];let n=0;return t.centre.forEach((o,c)=>{t.along[c]+1e-6<n&&c<t.centre.length-1||(e.push({x:o.x,z:o.z,y:s[c]}),n=t.along[c]+D.SAMPLE_M)}),e}static median(t,s){const e=[];for(const o of t)Math.hypot(o.x-s.x,o.z-s.z)<=D.WINDOW_M&&e.push(o.y);if(e.length===0)return;e.sort((o,c)=>o-c);const n=e.length>>1;return e.length%2===1?e[n]:(e[n-1]+e[n])/2}static graded(t,s,e){if(!Number.isFinite(e)||t.length<3)return t;const n=[...t],o=n.length-1,c=s[o];if(Math.abs(n[o]-n[0])>e*c)return s.map(r=>n[0]+(n[o]-n[0])*r/c);for(let r=1;r<o;r++){const u=e*(s[r]-s[r-1]);n[r]=Math.min(n[r-1]+u,Math.max(n[r-1]-u,n[r]))}for(let r=o-1;r>0;r--){const u=e*(s[r+1]-s[r]);n[r]=Math.min(n[r+1]+u,Math.max(n[r+1]-u,n[r]))}return n}static carried(t,s,e,n){const[o,c]=D.ends(t),r=t.along[t.along.length-1],u=n(o),a=n(c);if(e!==void 0&&t.centre.every(p=>p.altitudeM!==void 0)){const p=t.centre.map(d=>d.altitudeM+e),M=u!==void 0?u-p[0]:0,A=a!==void 0?a-p[p.length-1]:0;return p.map((d,O)=>d+M+(A-M)*t.along[O]/r)}const i=u??s(o.x,o.z),h=a??s(c.x,c.z);return t.along.map(p=>i+(h-i)*p/r)}static ends(t){return[t.centre[0],t.centre[t.centre.length-1]]}static key(t){return`${Math.round(t.x*2)},${Math.round(t.z*2)}`}}class B{positions=[];indices=[];along=[];get vertexCount(){return this.positions.length/3}strip(t,s,e){const n=this.vertexCount;for(let o=0;o<t.length;o++)this.positions.push(t[o].x,t[o].y,t[o].z,s[o].x,s[o].y,s[o].z),e&&this.along.push(e[o],e[o]);for(let o=0;o<t.length-1;o++){const c=n+o*2;this.indices.push(c,c+2,c+1,c+1,c+2,c+3)}}beam(t,s,e,n=!0){const o=s.x-t.x,c=s.y-t.y,r=s.z-t.z,u=Math.hypot(o,c,r);if(u<1e-6)return;const a={x:o/u,y:c/u,z:r/u},i=Math.abs(a.y)>.9?{x:1,y:0,z:0}:{x:0,y:1,z:0},h=a.y*i.z-a.z*i.y,p=a.z*i.x-a.x*i.z,M=a.x*i.y-a.y*i.x,A=Math.hypot(h,p,M),d={x:h/A*e/2,y:p/A*e/2,z:M/A*e/2},O={x:a.y*d.z-a.z*d.y,y:a.z*d.x-a.x*d.z,z:a.x*d.y-a.y*d.x},g=(f,x,E)=>({x:f.x+d.x*x+O.x*E,y:f.y+d.y*x+O.y*E,z:f.z+d.z*x+O.z*E}),_=[[1,1],[-1,1],[-1,-1],[1,-1]];for(let f=0;f<4;f++){const[x,E]=_[f],[z,v]=_[(f+1)%4];this.quad(g(t,x,E),g(t,z,v),g(s,z,v),g(s,x,E))}n&&(this.quad(...[..._].reverse().map(([f,x])=>g(t,f,x))),this.quad(..._.map(([f,x])=>g(s,f,x))))}quad(t,s,e,n){const o=this.vertexCount;this.positions.push(t.x,t.y,t.z,s.x,s.y,s.z,e.x,e.y,e.z,n.x,n.y,n.z),this.indices.push(o,o+1,o+2,o,o+2,o+3)}}class l{static STEP_M=6;static BALLAST_HEIGHT_M=.5;static BALLAST_SLOPE=1.5;static BALLAST_SHOULDER_M=.45;static DECK_DEPTH_M=.8;static BANK_SLOPE=1.5;static SLEEPER_LENGTH_M=2.4;static SLEEPER_WIDTH_M=.29;static SLEEPER_SPACING_M=.6;static RAIL_HEAD_M=.072;static RAIL_HEIGHT_M=.18;static TRAM_RAIL_HEIGHT_M=.03;static LIFT_M=.06;static CATENARY={rail:{contactM:5.5,systemM:1.4,spanM:54,staggerM:.2},highSpeed:{contactM:5.08,systemM:1.4,spanM:63,staggerM:.2},service:{contactM:5.5,systemM:1.2,spanM:45,staggerM:.2},tram:{contactM:6,systemM:0,spanM:30,staggerM:.2}};static MESSENGER_SAG_M=.55;static MAST_SIDE_M=.26;static MAST_OFFSET_M=3.1;static MAST_ABOVE_M=.6;static CONTACT_DIAMETER_M=.012;static MESSENGER_DIAMETER_M=.011;static ARM_SIDE_M=.06;static TRACK_SPACING_M={rail:3.7,highSpeed:4.5,tram:3.1,subway:3.4,light_rail:3.4,funicular:3.2};static BALLAST_ALBEDO=[.17,.16,.15];static BANK_ALBEDO=[.085,.09,.05];static DECK_ALBEDO=[.26,.255,.24];static CONCRETE_ALBEDO=[.36,.35,.33];static WOOD_ALBEDO=[.07,.055,.045];static RUST_ALBEDO=[.085,.068,.058];static STEEL_ALBEDO=[.3,.31,.32];static COPPER_ALBEDO=[.09,.085,.07];static LINE_REACH_M=20;group=new F;stepM=l.STEP_M;drawn=0;laid=[];ballastMaterial=l.pebbled(l.lambert(l.BALLAST_ALBEDO,!0));earthMaterial=l.lambert(l.BANK_ALBEDO,!0);deckMaterial=l.lambert(l.DECK_ALBEDO,!1);concreteSleepers=l.sleeperMaterial(l.CONCRETE_ALBEDO);woodSleepers=l.sleeperMaterial(l.WOOD_ALBEDO);rustMaterial=l.lambert(l.RUST_ALBEDO,!0);headMaterial=new P({color:new H(.62,.62,.62),metalness:1,roughness:.28,polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2});steelMaterial=l.lambert(l.STEEL_ALBEDO,!1);wireMaterial=l.lambert(l.COPPER_ALBEDO,!1);constructor(){this.group.name="railways"}get count(){return this.drawn}setGroundSpacing(t){this.stepM=Number.isFinite(t)&&t>0?Math.min(l.STEP_M,Math.max(1.5,t/2)):l.STEP_M}set(t,s,e,n,o=1/0){this.clear();const r=t.map(M=>({line:M,path:M.points.map(A=>({...U(A.lat,A.lng,s,e),altitudeM:A.altitudeM}))})).filter(({line:M,path:A})=>M.level>=0&&l.within(A,o)),u=l.altitudeOffset(r,n),a=r.flatMap(({line:M,path:A})=>{const d=this.layoutOf(M,A);return d?[{line:M,layout:d}]:[]}),i=D.heights(a.map(({layout:M})=>M),n,u),h={ballast:new B,earth:new B,deck:new B,concrete:new B,wood:new B,rust:new B,head:new B,steel:new B,wire:new B};a.forEach(({line:M,layout:A},d)=>{this.lay(M,{...A,y:i[d]},n,h),this.laid.push({line:M,centre:A.centre}),this.drawn++});const p=[[h.ballast,this.ballastMaterial,"ballast",!1],[h.earth,this.earthMaterial,"embankments",!1],[h.deck,this.deckMaterial,"decks",!0],[h.concrete,this.concreteSleepers,"sleepers",!1],[h.wood,this.woodSleepers,"sleepers wood",!1],[h.rust,this.rustMaterial,"rails",!1],[h.head,this.headMaterial,"rail heads",!1],[h.steel,this.steelMaterial,"catenary masts",!0],[h.wire,this.wireMaterial,"catenary wires",!1]];for(const[M,A,d,O]of p){const g=l.meshOf(M,A);g&&(g.name=`railways ${d}`,g.castShadow=O,g.receiveShadow=!0,this.group.add(g))}}clear(){for(const t of[...this.group.children])this.group.remove(t),t.geometry?.dispose();this.drawn=0,this.laid=[]}lineAt(t,s){let e;for(const{line:n,centre:o}of this.laid)for(let c=0;c<o.length-1;c++){const r=o[c],u=o[c+1],a=u.x-r.x,i=u.z-r.z,h=a*a+i*i,p=h===0?0:Math.max(0,Math.min(1,((t-r.x)*a+(s-r.z)*i)/h)),M=Math.hypot(t-(r.x+a*p),s-(r.z+i*p));M<=l.LINE_REACH_M&&(!e||M<e.distance)&&(e={line:n,distance:M})}return e?.line}mayMeet(t,s,e,n){const o=Math.hypot(s.x,s.z);if(o<1e-6)return this.lineAt(t.x,t.z)!==void 0;const c=s.x/o,r=s.z/o,u=l.LINE_REACH_M;for(const{centre:a}of this.laid)for(let i=0;i<a.length-1;i++){const h=a[i],p=a[i+1];for(const M of[0,.5,1]){const A=h.x+(p.x-h.x)*M,d=h.z+(p.z-h.z)*M,O=(A-t.x)*c+(d-t.z)*r;if(O<0)continue;const g=Math.abs((A-t.x)*r-(d-t.z)*c),_=Math.hypot(p.x-h.x,p.z-h.z)/2;if(g>u+_)continue;if(t.y+s.y*(O/o)<=e(A,d)+n)return!0}}return!1}contactHeightM(t){if(!(t.electrification!=="overhead"||t.kind==="subway"||t.kind==="funicular"))return l.catenaryOf(t).contactM}static catenaryOf(t){return t.kind==="tram"?l.CATENARY.tram:t.highSpeed?l.CATENARY.highSpeed:t.service?l.CATENARY.service:l.CATENARY.rail}dispose(){this.clear();for(const t of[this.ballastMaterial,this.earthMaterial,this.deckMaterial,this.concreteSleepers,this.woodSleepers,this.rustMaterial,this.headMaterial,this.steelMaterial,this.wireMaterial])t.dispose()}static within(t,s){if(!Number.isFinite(s))return!0;const e=s*1.1+100;return t.some((n,o)=>Math.hypot(n.x,n.z)<=e||o>0&&Math.hypot((n.x+t[o-1].x)/2,(n.z+t[o-1].z)/2)<=e)}static altitudeOffset(t,s){const e=[];for(const{line:n,path:o}of t)if(n.level===0)for(const c of o)c.altitudeM!==void 0&&e.push(s(c.x,c.z)-c.altitudeM);if(!(e.length<5))return e.sort((n,o)=>n-o),e[Math.floor(e.length/2)]}layoutOf(t,s){const e=[];for(let c=0;c<s.length-1;c++){const r=s[c],u=s[c+1],a=Math.max(1,Math.ceil(Math.hypot(u.x-r.x,u.z-r.z)/this.stepM));for(let i=0;i<a;i++){const h=i/a,p=r.altitudeM!==void 0&&u.altitudeM!==void 0?r.altitudeM+(u.altitudeM-r.altitudeM)*h:void 0;e.push({x:r.x+(u.x-r.x)*h,z:r.z+(u.z-r.z)*h,altitudeM:p})}}if(e.push(s[s.length-1]),e.length<2)return;const n=[0];for(let c=1;c<e.length;c++)n.push(n[c-1]+Math.hypot(e[c].x-e[c-1].x,e[c].z-e[c-1].z));if(n[n.length-1]<.5)return;const o=e.map((c,r)=>{const u=e[Math.max(0,r-1)],a=e[Math.min(e.length-1,r+1)],i=a.x-u.x,h=a.z-u.z,p=Math.hypot(i,h);return p<1e-6?{x:1,z:0}:{x:i/p,z:h/p}});return{kind:t.kind,...t.highSpeed?{highSpeed:!0}:{},level:t.level,centre:e,along:n,dir:o}}lay(t,s,e,n){const o=t.highSpeed?l.TRACK_SPACING_M.highSpeed:l.TRACK_SPACING_M[t.kind],c=Math.min(8,Math.max(1,t.tracks)),r=Array.from({length:c},(g,_)=>(_-(c-1)/2)*o),u=t.kind==="tram",a=u?0:l.BALLAST_HEIGHT_M,i=l.LIFT_M,h=(g,_,f)=>({x:s.centre[g].x-s.dir[g].z*_,y:s.y[g]+f,z:s.centre[g].z+s.dir[g].x*_}),p=s.centre.map((g,_)=>_);if(!u){const g=l.SLEEPER_LENGTH_M/2+l.BALLAST_SHOULDER_M+(r[r.length-1]??0),_=p.map(x=>h(x,g,a+i)),f=p.map(x=>h(x,-g,a+i));if(n.ballast.strip(_,f),t.level===0){const x=g+a*l.BALLAST_SLOPE;for(const E of[1,-1]){const z=[],v=[];let m=!1;for(const L of p){const C=h(L,E*x,i),S=e(C.x,C.z)+i,T=C.y-S;T<0&&(C.y=Math.min(S,s.y[L]+a-.05+i)),z.push(C);const I=h(L,E*(x+Math.max(0,T)*l.BANK_SLOPE),i);I.y=Math.min(e(I.x,I.z)+i,C.y),C.y-I.y>.02&&(m=!0),v.push(I)}const b=E>0?_:f;E>0?n.ballast.strip(z,b):n.ballast.strip(b,z),m&&(E>0?n.earth.strip(v,z):n.earth.strip(z,v))}}else{const x=-l.DECK_DEPTH_M,E=g+.15,z=p.map(L=>h(L,E,a+i+.1)),v=p.map(L=>h(L,-E,a+i+.1)),m=p.map(L=>h(L,E,x)),b=p.map(L=>h(L,-E,x));n.deck.strip(m,z),n.deck.strip(v,b),n.deck.strip(b,m),n.deck.strip(z,p.map(L=>h(L,g,a+i+.1))),n.deck.strip(p.map(L=>h(L,-g,a+i+.1)),v)}}const M=t.service?n.wood:n.concrete,A=t.gaugeMm/2e3+l.RAIL_HEAD_M/2,d=u?l.TRAM_RAIL_HEIGHT_M:l.RAIL_HEIGHT_M,O=a+i;for(const g of r){if(!u){const _=l.SLEEPER_LENGTH_M/2;M.strip(p.map(f=>h(f,g+_,O+.004)),p.map(f=>h(f,g-_,O+.004)),s.along)}for(const _ of[1,-1]){const f=g+_*A,x=l.RAIL_HEAD_M/2,E=p.map(v=>h(v,f+x,O+d)),z=p.map(v=>h(v,f-x,O+d));n.head.strip(E,z),n.rust.strip(p.map(v=>h(v,f+x,O)),E),n.rust.strip(z,p.map(v=>h(v,f-x,O)))}}t.electrification==="overhead"&&t.kind!=="subway"&&t.kind!=="funicular"&&this.catenary(t,s,r,O+d,h,e,n)}catenary(t,s,e,n,o,c,r){const u=l.catenaryOf(t),a=s.along[s.along.length-1],i=Math.max(1,Math.round(a/u.spanM)),h=a/i,p=Array.from({length:i},(E,z)=>(z+.5)*h),M=n+u.contactM,A=M+u.systemM,d=(u.systemM>0?A:M)+l.MAST_ABOVE_M,O=e[e.length-1],g=e.length>2,_=e.length===1?[1]:[1,-1],f=(E,z,v)=>{let m=0,b=s.along.length-2;for(;m<b;){const T=m+b+1>>1;s.along[T]<=E?m=T:b=T-1}const L=Math.min(1,Math.max(0,(E-s.along[m])/Math.max(1e-6,s.along[m+1]-s.along[m]))),C=o(m,z,v),S=o(m+1,z,v);return{x:C.x+(S.x-C.x)*L,y:C.y+(S.y-C.y)*L,z:C.z+(S.z-C.z)*L}};for(const E of p){const z=f(E,0,M);if(!(t.level===0&&c(z.x,z.z)>z.y)){for(const v of _){const m=v*(O+l.MAST_OFFSET_M),b=f(E,m,0);t.level===0&&(b.y=Math.min(b.y,c(b.x,b.z)));const L=f(E,m,d);if(r.steel.beam(b,L,l.MAST_SIDE_M),g)continue;const S=(_.length===1?e[0]:v*O)-v*.6,T=u.systemM>0?A:M+.3;r.steel.beam(f(E,m,T),f(E,S,T),l.ARM_SIDE_M),r.steel.beam(f(E,m,M-.4),f(E,S,T),l.ARM_SIDE_M)}if(g){const v=O+l.MAST_OFFSET_M;r.steel.beam(f(E,v,d-.2),f(E,-v,d-.2),l.MAST_SIDE_M*.8)}}}const x=[0,...p,a];for(const[E,z]of e.entries()){const v=m=>m===0||m===x.length-1?0:((m+E)%2===0?1:-1)*u.staggerM;for(let m=0;m<x.length-1;m++){const b=x[m],L=x[m+1];if(L-b<.1||(r.wire.beam(f(b,z+v(m),M),f(L,z+v(m+1),M),l.CONTACT_DIAMETER_M,!1),u.systemM<=0))continue;const C=4,S=T=>{const I=m===0?.5+T/2:m===x.length-2?T/2:T;return A-l.MESSENGER_SAG_M*4*I*(1-I)};for(let T=0;T<C;T++){const I=T/C,G=(T+1)/C;r.wire.beam(f(b+(L-b)*I,z,S(I)),f(b+(L-b)*G,z,S(G)),l.MESSENGER_DIAMETER_M,!1)}}}}static meshOf(t,s){if(t.indices.length===0)return;const e=new K;return e.setAttribute("position",new N(new Float32Array(t.positions),3)),t.along.length>0&&e.setAttribute("aAlong",new N(new Float32Array(t.along),1)),e.setIndex(new N(new Uint32Array(t.indices),1)),e.computeVertexNormals(),new w(e,s)}static lambert(t,s){return new k({color:new H(...t),...s?{polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2}:{}})}static pebbled(t){return t.onBeforeCompile=s=>{s.vertexShader=s.vertexShader.replace("#include <common>",`#include <common>
|
|
1
|
+
import{b2 as F,bi as P,b4 as H,bg as K,bj as N,bb as w,bk as k}from"./ShareDialogElement-C9Uiwt0F.js";import{g as U}from"./SaidPosition-CXZLm-ck.js";import"./rr0-ufoathome.mjs";import"./Sighting-Ch4eiBNK.js";import"./VisualAids-DI-hEL46.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./Obstacles-v9SkfBD7.js";class D{static HOLLOW_M=1;static COVERED_M=3;static WINDOW_M=30;static SAMPLE_M=4;static MAX_GRADE={rail:.025,highSpeed:.035,subway:.04,light_rail:.06,tram:.08,funicular:1/0};static heights(t,s,e){const n=t.map(a=>a.level===0),o=t.map((a,i)=>n[i]?D.targets(a,s,e):[]),c=t.map((a,i)=>n[i]?D.samples(a,o[i]):[]),r=new Map;t.forEach((a,i)=>{if(n[i])for(const h of D.ends(a)){const p=D.key(h),M=r.get(p);M?M.push(i):r.set(p,[i])}});const u=a=>{const i=r.get(D.key(a));if(i)return D.median(i.flatMap(h=>c[h]),a)};return t.map((a,i)=>{if(n[i]){const h=[...new Set([i,...D.ends(a).flatMap(d=>r.get(D.key(d))??[])])].flatMap(d=>c[d]),p=a.centre.map((d,O)=>D.median(h,d)??o[i][O]),[M,A]=D.ends(a);return p[0]=u(M)??p[0],p[p.length-1]=u(A)??p[p.length-1],D.graded(p,a.along,a.highSpeed?D.MAX_GRADE.highSpeed:D.MAX_GRADE[a.kind])}return D.carried(a,s,e,u)})}static targets(t,s,e){return t.centre.map(n=>{const o=s(n.x,n.z);if(e===void 0||n.altitudeM===void 0)return o;const c=n.altitudeM+e;return c-o>D.HOLLOW_M||o-c>D.COVERED_M?c:o})}static samples(t,s){const e=[];let n=0;return t.centre.forEach((o,c)=>{t.along[c]+1e-6<n&&c<t.centre.length-1||(e.push({x:o.x,z:o.z,y:s[c]}),n=t.along[c]+D.SAMPLE_M)}),e}static median(t,s){const e=[];for(const o of t)Math.hypot(o.x-s.x,o.z-s.z)<=D.WINDOW_M&&e.push(o.y);if(e.length===0)return;e.sort((o,c)=>o-c);const n=e.length>>1;return e.length%2===1?e[n]:(e[n-1]+e[n])/2}static graded(t,s,e){if(!Number.isFinite(e)||t.length<3)return t;const n=[...t],o=n.length-1,c=s[o];if(Math.abs(n[o]-n[0])>e*c)return s.map(r=>n[0]+(n[o]-n[0])*r/c);for(let r=1;r<o;r++){const u=e*(s[r]-s[r-1]);n[r]=Math.min(n[r-1]+u,Math.max(n[r-1]-u,n[r]))}for(let r=o-1;r>0;r--){const u=e*(s[r+1]-s[r]);n[r]=Math.min(n[r+1]+u,Math.max(n[r+1]-u,n[r]))}return n}static carried(t,s,e,n){const[o,c]=D.ends(t),r=t.along[t.along.length-1],u=n(o),a=n(c);if(e!==void 0&&t.centre.every(p=>p.altitudeM!==void 0)){const p=t.centre.map(d=>d.altitudeM+e),M=u!==void 0?u-p[0]:0,A=a!==void 0?a-p[p.length-1]:0;return p.map((d,O)=>d+M+(A-M)*t.along[O]/r)}const i=u??s(o.x,o.z),h=a??s(c.x,c.z);return t.along.map(p=>i+(h-i)*p/r)}static ends(t){return[t.centre[0],t.centre[t.centre.length-1]]}static key(t){return`${Math.round(t.x*2)},${Math.round(t.z*2)}`}}class B{positions=[];indices=[];along=[];get vertexCount(){return this.positions.length/3}strip(t,s,e){const n=this.vertexCount;for(let o=0;o<t.length;o++)this.positions.push(t[o].x,t[o].y,t[o].z,s[o].x,s[o].y,s[o].z),e&&this.along.push(e[o],e[o]);for(let o=0;o<t.length-1;o++){const c=n+o*2;this.indices.push(c,c+2,c+1,c+1,c+2,c+3)}}beam(t,s,e,n=!0){const o=s.x-t.x,c=s.y-t.y,r=s.z-t.z,u=Math.hypot(o,c,r);if(u<1e-6)return;const a={x:o/u,y:c/u,z:r/u},i=Math.abs(a.y)>.9?{x:1,y:0,z:0}:{x:0,y:1,z:0},h=a.y*i.z-a.z*i.y,p=a.z*i.x-a.x*i.z,M=a.x*i.y-a.y*i.x,A=Math.hypot(h,p,M),d={x:h/A*e/2,y:p/A*e/2,z:M/A*e/2},O={x:a.y*d.z-a.z*d.y,y:a.z*d.x-a.x*d.z,z:a.x*d.y-a.y*d.x},g=(f,x,E)=>({x:f.x+d.x*x+O.x*E,y:f.y+d.y*x+O.y*E,z:f.z+d.z*x+O.z*E}),_=[[1,1],[-1,1],[-1,-1],[1,-1]];for(let f=0;f<4;f++){const[x,E]=_[f],[z,v]=_[(f+1)%4];this.quad(g(t,x,E),g(t,z,v),g(s,z,v),g(s,x,E))}n&&(this.quad(...[..._].reverse().map(([f,x])=>g(t,f,x))),this.quad(..._.map(([f,x])=>g(s,f,x))))}quad(t,s,e,n){const o=this.vertexCount;this.positions.push(t.x,t.y,t.z,s.x,s.y,s.z,e.x,e.y,e.z,n.x,n.y,n.z),this.indices.push(o,o+1,o+2,o,o+2,o+3)}}class l{static STEP_M=6;static BALLAST_HEIGHT_M=.5;static BALLAST_SLOPE=1.5;static BALLAST_SHOULDER_M=.45;static DECK_DEPTH_M=.8;static BANK_SLOPE=1.5;static SLEEPER_LENGTH_M=2.4;static SLEEPER_WIDTH_M=.29;static SLEEPER_SPACING_M=.6;static RAIL_HEAD_M=.072;static RAIL_HEIGHT_M=.18;static TRAM_RAIL_HEIGHT_M=.03;static LIFT_M=.06;static CATENARY={rail:{contactM:5.5,systemM:1.4,spanM:54,staggerM:.2},highSpeed:{contactM:5.08,systemM:1.4,spanM:63,staggerM:.2},service:{contactM:5.5,systemM:1.2,spanM:45,staggerM:.2},tram:{contactM:6,systemM:0,spanM:30,staggerM:.2}};static MESSENGER_SAG_M=.55;static MAST_SIDE_M=.26;static MAST_OFFSET_M=3.1;static MAST_ABOVE_M=.6;static CONTACT_DIAMETER_M=.012;static MESSENGER_DIAMETER_M=.011;static ARM_SIDE_M=.06;static TRACK_SPACING_M={rail:3.7,highSpeed:4.5,tram:3.1,subway:3.4,light_rail:3.4,funicular:3.2};static BALLAST_ALBEDO=[.17,.16,.15];static BANK_ALBEDO=[.085,.09,.05];static DECK_ALBEDO=[.26,.255,.24];static CONCRETE_ALBEDO=[.36,.35,.33];static WOOD_ALBEDO=[.07,.055,.045];static RUST_ALBEDO=[.085,.068,.058];static STEEL_ALBEDO=[.3,.31,.32];static COPPER_ALBEDO=[.09,.085,.07];static LINE_REACH_M=20;group=new F;stepM=l.STEP_M;drawn=0;laid=[];ballastMaterial=l.pebbled(l.lambert(l.BALLAST_ALBEDO,!0));earthMaterial=l.lambert(l.BANK_ALBEDO,!0);deckMaterial=l.lambert(l.DECK_ALBEDO,!1);concreteSleepers=l.sleeperMaterial(l.CONCRETE_ALBEDO);woodSleepers=l.sleeperMaterial(l.WOOD_ALBEDO);rustMaterial=l.lambert(l.RUST_ALBEDO,!0);headMaterial=new P({color:new H(.62,.62,.62),metalness:1,roughness:.28,polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2});steelMaterial=l.lambert(l.STEEL_ALBEDO,!1);wireMaterial=l.lambert(l.COPPER_ALBEDO,!1);constructor(){this.group.name="railways"}get count(){return this.drawn}setGroundSpacing(t){this.stepM=Number.isFinite(t)&&t>0?Math.min(l.STEP_M,Math.max(1.5,t/2)):l.STEP_M}set(t,s,e,n,o=1/0){this.clear();const r=t.map(M=>({line:M,path:M.points.map(A=>({...U(A.lat,A.lng,s,e),altitudeM:A.altitudeM}))})).filter(({line:M,path:A})=>M.level>=0&&l.within(A,o)),u=l.altitudeOffset(r,n),a=r.flatMap(({line:M,path:A})=>{const d=this.layoutOf(M,A);return d?[{line:M,layout:d}]:[]}),i=D.heights(a.map(({layout:M})=>M),n,u),h={ballast:new B,earth:new B,deck:new B,concrete:new B,wood:new B,rust:new B,head:new B,steel:new B,wire:new B};a.forEach(({line:M,layout:A},d)=>{this.lay(M,{...A,y:i[d]},n,h),this.laid.push({line:M,centre:A.centre}),this.drawn++});const p=[[h.ballast,this.ballastMaterial,"ballast",!1],[h.earth,this.earthMaterial,"embankments",!1],[h.deck,this.deckMaterial,"decks",!0],[h.concrete,this.concreteSleepers,"sleepers",!1],[h.wood,this.woodSleepers,"sleepers wood",!1],[h.rust,this.rustMaterial,"rails",!1],[h.head,this.headMaterial,"rail heads",!1],[h.steel,this.steelMaterial,"catenary masts",!0],[h.wire,this.wireMaterial,"catenary wires",!1]];for(const[M,A,d,O]of p){const g=l.meshOf(M,A);g&&(g.name=`railways ${d}`,g.castShadow=O,g.receiveShadow=!0,this.group.add(g))}}clear(){for(const t of[...this.group.children])this.group.remove(t),t.geometry?.dispose();this.drawn=0,this.laid=[]}lineAt(t,s){let e;for(const{line:n,centre:o}of this.laid)for(let c=0;c<o.length-1;c++){const r=o[c],u=o[c+1],a=u.x-r.x,i=u.z-r.z,h=a*a+i*i,p=h===0?0:Math.max(0,Math.min(1,((t-r.x)*a+(s-r.z)*i)/h)),M=Math.hypot(t-(r.x+a*p),s-(r.z+i*p));M<=l.LINE_REACH_M&&(!e||M<e.distance)&&(e={line:n,distance:M})}return e?.line}mayMeet(t,s,e,n){const o=Math.hypot(s.x,s.z);if(o<1e-6)return this.lineAt(t.x,t.z)!==void 0;const c=s.x/o,r=s.z/o,u=l.LINE_REACH_M;for(const{centre:a}of this.laid)for(let i=0;i<a.length-1;i++){const h=a[i],p=a[i+1];for(const M of[0,.5,1]){const A=h.x+(p.x-h.x)*M,d=h.z+(p.z-h.z)*M,O=(A-t.x)*c+(d-t.z)*r;if(O<0)continue;const g=Math.abs((A-t.x)*r-(d-t.z)*c),_=Math.hypot(p.x-h.x,p.z-h.z)/2;if(g>u+_)continue;if(t.y+s.y*(O/o)<=e(A,d)+n)return!0}}return!1}contactHeightM(t){if(!(t.electrification!=="overhead"||t.kind==="subway"||t.kind==="funicular"))return l.catenaryOf(t).contactM}static catenaryOf(t){return t.kind==="tram"?l.CATENARY.tram:t.highSpeed?l.CATENARY.highSpeed:t.service?l.CATENARY.service:l.CATENARY.rail}dispose(){this.clear();for(const t of[this.ballastMaterial,this.earthMaterial,this.deckMaterial,this.concreteSleepers,this.woodSleepers,this.rustMaterial,this.headMaterial,this.steelMaterial,this.wireMaterial])t.dispose()}static within(t,s){if(!Number.isFinite(s))return!0;const e=s*1.1+100;return t.some((n,o)=>Math.hypot(n.x,n.z)<=e||o>0&&Math.hypot((n.x+t[o-1].x)/2,(n.z+t[o-1].z)/2)<=e)}static altitudeOffset(t,s){const e=[];for(const{line:n,path:o}of t)if(n.level===0)for(const c of o)c.altitudeM!==void 0&&e.push(s(c.x,c.z)-c.altitudeM);if(!(e.length<5))return e.sort((n,o)=>n-o),e[Math.floor(e.length/2)]}layoutOf(t,s){const e=[];for(let c=0;c<s.length-1;c++){const r=s[c],u=s[c+1],a=Math.max(1,Math.ceil(Math.hypot(u.x-r.x,u.z-r.z)/this.stepM));for(let i=0;i<a;i++){const h=i/a,p=r.altitudeM!==void 0&&u.altitudeM!==void 0?r.altitudeM+(u.altitudeM-r.altitudeM)*h:void 0;e.push({x:r.x+(u.x-r.x)*h,z:r.z+(u.z-r.z)*h,altitudeM:p})}}if(e.push(s[s.length-1]),e.length<2)return;const n=[0];for(let c=1;c<e.length;c++)n.push(n[c-1]+Math.hypot(e[c].x-e[c-1].x,e[c].z-e[c-1].z));if(n[n.length-1]<.5)return;const o=e.map((c,r)=>{const u=e[Math.max(0,r-1)],a=e[Math.min(e.length-1,r+1)],i=a.x-u.x,h=a.z-u.z,p=Math.hypot(i,h);return p<1e-6?{x:1,z:0}:{x:i/p,z:h/p}});return{kind:t.kind,...t.highSpeed?{highSpeed:!0}:{},level:t.level,centre:e,along:n,dir:o}}lay(t,s,e,n){const o=t.highSpeed?l.TRACK_SPACING_M.highSpeed:l.TRACK_SPACING_M[t.kind],c=Math.min(8,Math.max(1,t.tracks)),r=Array.from({length:c},(g,_)=>(_-(c-1)/2)*o),u=t.kind==="tram",a=u?0:l.BALLAST_HEIGHT_M,i=l.LIFT_M,h=(g,_,f)=>({x:s.centre[g].x-s.dir[g].z*_,y:s.y[g]+f,z:s.centre[g].z+s.dir[g].x*_}),p=s.centre.map((g,_)=>_);if(!u){const g=l.SLEEPER_LENGTH_M/2+l.BALLAST_SHOULDER_M+(r[r.length-1]??0),_=p.map(x=>h(x,g,a+i)),f=p.map(x=>h(x,-g,a+i));if(n.ballast.strip(_,f),t.level===0){const x=g+a*l.BALLAST_SLOPE;for(const E of[1,-1]){const z=[],v=[];let m=!1;for(const L of p){const C=h(L,E*x,i),S=e(C.x,C.z)+i,T=C.y-S;T<0&&(C.y=Math.min(S,s.y[L]+a-.05+i)),z.push(C);const I=h(L,E*(x+Math.max(0,T)*l.BANK_SLOPE),i);I.y=Math.min(e(I.x,I.z)+i,C.y),C.y-I.y>.02&&(m=!0),v.push(I)}const b=E>0?_:f;E>0?n.ballast.strip(z,b):n.ballast.strip(b,z),m&&(E>0?n.earth.strip(v,z):n.earth.strip(z,v))}}else{const x=-l.DECK_DEPTH_M,E=g+.15,z=p.map(L=>h(L,E,a+i+.1)),v=p.map(L=>h(L,-E,a+i+.1)),m=p.map(L=>h(L,E,x)),b=p.map(L=>h(L,-E,x));n.deck.strip(m,z),n.deck.strip(v,b),n.deck.strip(b,m),n.deck.strip(z,p.map(L=>h(L,g,a+i+.1))),n.deck.strip(p.map(L=>h(L,-g,a+i+.1)),v)}}const M=t.service?n.wood:n.concrete,A=t.gaugeMm/2e3+l.RAIL_HEAD_M/2,d=u?l.TRAM_RAIL_HEIGHT_M:l.RAIL_HEIGHT_M,O=a+i;for(const g of r){if(!u){const _=l.SLEEPER_LENGTH_M/2;M.strip(p.map(f=>h(f,g+_,O+.004)),p.map(f=>h(f,g-_,O+.004)),s.along)}for(const _ of[1,-1]){const f=g+_*A,x=l.RAIL_HEAD_M/2,E=p.map(v=>h(v,f+x,O+d)),z=p.map(v=>h(v,f-x,O+d));n.head.strip(E,z),n.rust.strip(p.map(v=>h(v,f+x,O)),E),n.rust.strip(z,p.map(v=>h(v,f-x,O)))}}t.electrification==="overhead"&&t.kind!=="subway"&&t.kind!=="funicular"&&this.catenary(t,s,r,O+d,h,e,n)}catenary(t,s,e,n,o,c,r){const u=l.catenaryOf(t),a=s.along[s.along.length-1],i=Math.max(1,Math.round(a/u.spanM)),h=a/i,p=Array.from({length:i},(E,z)=>(z+.5)*h),M=n+u.contactM,A=M+u.systemM,d=(u.systemM>0?A:M)+l.MAST_ABOVE_M,O=e[e.length-1],g=e.length>2,_=e.length===1?[1]:[1,-1],f=(E,z,v)=>{let m=0,b=s.along.length-2;for(;m<b;){const T=m+b+1>>1;s.along[T]<=E?m=T:b=T-1}const L=Math.min(1,Math.max(0,(E-s.along[m])/Math.max(1e-6,s.along[m+1]-s.along[m]))),C=o(m,z,v),S=o(m+1,z,v);return{x:C.x+(S.x-C.x)*L,y:C.y+(S.y-C.y)*L,z:C.z+(S.z-C.z)*L}};for(const E of p){const z=f(E,0,M);if(!(t.level===0&&c(z.x,z.z)>z.y)){for(const v of _){const m=v*(O+l.MAST_OFFSET_M),b=f(E,m,0);t.level===0&&(b.y=Math.min(b.y,c(b.x,b.z)));const L=f(E,m,d);if(r.steel.beam(b,L,l.MAST_SIDE_M),g)continue;const S=(_.length===1?e[0]:v*O)-v*.6,T=u.systemM>0?A:M+.3;r.steel.beam(f(E,m,T),f(E,S,T),l.ARM_SIDE_M),r.steel.beam(f(E,m,M-.4),f(E,S,T),l.ARM_SIDE_M)}if(g){const v=O+l.MAST_OFFSET_M;r.steel.beam(f(E,v,d-.2),f(E,-v,d-.2),l.MAST_SIDE_M*.8)}}}const x=[0,...p,a];for(const[E,z]of e.entries()){const v=m=>m===0||m===x.length-1?0:((m+E)%2===0?1:-1)*u.staggerM;for(let m=0;m<x.length-1;m++){const b=x[m],L=x[m+1];if(L-b<.1||(r.wire.beam(f(b,z+v(m),M),f(L,z+v(m+1),M),l.CONTACT_DIAMETER_M,!1),u.systemM<=0))continue;const C=4,S=T=>{const I=m===0?.5+T/2:m===x.length-2?T/2:T;return A-l.MESSENGER_SAG_M*4*I*(1-I)};for(let T=0;T<C;T++){const I=T/C,G=(T+1)/C;r.wire.beam(f(b+(L-b)*I,z,S(I)),f(b+(L-b)*G,z,S(G)),l.MESSENGER_DIAMETER_M,!1)}}}}static meshOf(t,s){if(t.indices.length===0)return;const e=new K;return e.setAttribute("position",new N(new Float32Array(t.positions),3)),t.along.length>0&&e.setAttribute("aAlong",new N(new Float32Array(t.along),1)),e.setIndex(new N(new Uint32Array(t.indices),1)),e.computeVertexNormals(),new w(e,s)}static lambert(t,s){return new k({color:new H(...t),...s?{polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2}:{}})}static pebbled(t){return t.onBeforeCompile=s=>{s.vertexShader=s.vertexShader.replace("#include <common>",`#include <common>
|
|
2
2
|
varying vec3 vBallast;`).replace("#include <begin_vertex>",`#include <begin_vertex>
|
|
3
3
|
vBallast = position;`),s.fragmentShader=s.fragmentShader.replace("#include <common>",`#include <common>
|
|
4
4
|
varying vec3 vBallast;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{M as w,_ as I,c as F}from"./rr0-ufoathome.mjs";import{P as S,I as x}from"./SaidPosition-CXZLm-ck.js";import{S as N}from"./SkyEventEditorStyle-CvY_AhbI.js";import{p as b,cO as M,aK as E,aE as C,m as _,s as P,cC as L}from"./ShareDialogElement-DHlxoHWP.js";import{c as G}from"./Sighting-Ch4eiBNK.js";import{P as D,a as k,E as H}from"./ParameterForm-DcVFxrcO.js";import{T as K}from"./TimelineTracks-BgZmkKhn.js";import{R as O}from"./ReentryArchive-CeXHrU7L.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./Obstacles-v9SkfBD7.js";import"./VisualAids-DI-hEL46.js";const z=w.catalog({en:()=>I(()=>import("./ReentryParameterTexts_en-5BOfwCsS.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_en),fr:()=>I(()=>import("./ReentryParameterTexts_fr-BgUJROXF.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_fr),es:()=>I(()=>import("./ReentryParameterTexts_es-ze1-U4jB.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_es),it:()=>I(()=>import("./ReentryParameterTexts_it-MTb9Vuq0.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_it)});class g{static NAME="name";static OBJECT="object";static LIGHT="light";static WHEN="when";static SEEN="seenByTheWitness";static EARTH_KM=6371;static placeSeen(t,e,n,i){const r=Math.PI/180,o=g.EARTH_KM,a=n*r,s=-o*Math.sin(a)+Math.sqrt((o*Math.sin(a))**2+(o+i)**2-o**2),d=Math.atan2(s*Math.cos(a),o+s*Math.sin(a)),c=t.lat*r,l=e*r,h=Math.asin(Math.sin(c)*Math.cos(d)+Math.cos(c)*Math.sin(d)*Math.cos(l)),m=t.lng*r+Math.atan2(Math.sin(l)*Math.sin(d)*Math.cos(c),Math.cos(d)-Math.sin(c)*Math.sin(h));return{lat:h/r,lng:(m/r+540)%360-180}}static trackFromSeen(t,e){const n=t.seen,{fromAzimuthDeg:i,fromAltitudeDeg:r,toAzimuthDeg:o,toAltitudeDeg:a,durationS:s}=n??{};if(i===void 0||r===void 0||o===void 0||a===void 0||!s)return;const d=t.track[0],c=t.track[t.track.length-1],l=d?.t??0,h=d?.altitudeKm??100,m=c?.altitudeKm??h;return[{t:l,...g.placeSeen(e,i,r,h),altitudeKm:h},{t:l+Math.round(s*1e3),...g.placeSeen(e,o,a,m),altitudeKm:m}]}static placeAt(t,e){const n=b.leadAt(t,e);if(n)return{t:e,lat:n.lat,lng:n.lng,altitudeKm:n.heightM/1e3};const i=t.track,[r,o]=e<(i[0]?.t??0)?[i[0],i[1]]:[i[i.length-2],i[i.length-1]];if(!r||!o||o.t===r.t){const s=r??o??{lat:0,lng:0,altitudeKm:80};return{t:e,lat:s.lat,lng:s.lng,altitudeKm:s.altitudeKm}}const a=(e-r.t)/(o.t-r.t);return{t:e,lat:r.lat+(o.lat-r.lat)*a,lng:r.lng+(o.lng-r.lng)*a,altitudeKm:Math.max(0,r.altitudeKm+(o.altitudeKm-r.altitudeKm)*a)}}static curvePointAt(t,e){return{t:e,absoluteMagnitude:Math.round(b.absoluteMagnitudeAt(t,e)*10)/10}}static instantsOf(t){return[...t.track.map(e=>e.t),...t.fragments.flatMap(e=>[...e.fromT===void 0?[]:[e.fromT],...e.untilT===void 0?[]:[e.untilT],...(e.lightCurve??[]).map(n=>n.t)])]}static instant(t,e,n,i={}){return{type:"number",key:t,min:-3600,max:36e3,step:.1,unit:"s",scale:.001,label:e,hint:n,...i}}static mayBeCatalogued(t){return M.of(t.type)?.nature!=="natural"}static SET={kind:"reentry",title:"fireballOrReEntry",parameters:[{type:"said",key:"title",label:g.NAME},{type:"choice",key:"type",label:"type",hint:"whatCameInNaturalOrPut",empty:"notKnown",choices:[],optionsOf:t=>{const e=t.type,n=M.all().map(i=>({value:i.key,label:M.nameOf(i.key)}));return e===void 0||n.some(i=>i.value===e)?n:[...n,{value:e,label:e}]}},{type:"text",key:"object.name",group:g.OBJECT,visibleWhen:g.mayBeCatalogued,label:"catalogueName",hint:"forAReEntryThePiece"},{type:"text",key:"object.cosparId",group:g.OBJECT,visibleWhen:g.mayBeCatalogued,label:"cosparId",placeholder:"t1968013c"},{type:"number",key:"object.norad",min:1,max:999999,step:1,group:g.OBJECT,visibleWhen:g.mayBeCatalogued,label:"noradNumber"},{type:"number",key:"seen.fromAzimuthDeg",min:0,max:360,step:1,unit:"°",group:g.SEEN,label:"appearedAzimuth",hint:"fromTheNorthTowardsTheEast"},{type:"number",key:"seen.fromAltitudeDeg",min:-5,max:90,step:1,unit:"°",group:g.SEEN,label:"appearedHeight",hint:"aboveTheHorizon"},{type:"number",key:"seen.toAzimuthDeg",min:0,max:360,step:1,unit:"°",group:g.SEEN,label:"wentOutAzimuth",hint:"fromTheNorthTowardsTheEast"},{type:"number",key:"seen.toAltitudeDeg",min:-5,max:90,step:1,unit:"°",group:g.SEEN,label:"wentOutHeight",hint:"aboveTheHorizon"},{type:"number",key:"seen.durationS",min:.1,max:3600,step:.1,unit:"s",group:g.SEEN,label:"seenFor",hint:"allSaidThePathIsWorkedOut"}]};static PLACE={kind:"reentry-place",title:"pointOfThePath",parameters:[g.instant("t","time","secondsOfTheRecordingNegativeBefore",{required:!0}),{type:"position",key:"lat",secondKey:"lng",saidKey:"saidPosition",native:"geo",step:1,rangeM:2e6,label:"position"},{type:"number",key:"altitudeKm",min:0,max:300,step:.1,unit:"km",required:!0,label:"altitude",hint:"aboveTheEllipsoidAMeteorBegins"}]};static trackEnd(t,e){const n=t?.track;if(n?.length)return e==="first"?n[0].t:n[n.length-1].t}static FRAGMENT={kind:"reentry-fragment",title:"piece",parameters:[{type:"text",key:"id",label:"id",validate:(t,e,n)=>!n?.fragments.some(i=>i!==e&&i.id===t)},{type:"number",key:"absoluteMagnitude",min:-40,max:10,step:.1,required:!0,group:g.LIGHT,label:"absoluteMagnitude",hint:"itsBrightnessSeenFrom100Km"},{type:"colour",key:"color",group:g.LIGHT,fallback:b.DEFAULT_COLOR,label:"colour"},{type:"number",key:"trainS",min:0,max:600,step:.1,unit:"s",group:g.LIGHT,effective:()=>b.DEFAULT_TRAIN_S,label:"train",hint:"howLongAStretchOfIts"},{type:"number",key:"lagS",min:0,max:600,step:.1,unit:"s",group:g.WHEN,effective:()=>0,label:"behindTheLead",hint:"secondsBehindTheLeadingPointAlong"},g.instant("fromT","seenFrom","whenItBreaksOffOrBegins",{group:g.WHEN,effective:(t,e)=>g.trackEnd(e,"first")}),g.instant("untilT","outAt","whenItHasBurnedUpOr",{group:g.WHEN,effective:(t,e)=>g.trackEnd(e,"last")})]};static CURVE_POINT={kind:"reentry-curve-point",title:"pointOfTheLightCurve",parameters:[g.instant("t","time","secondsOfTheRecording",{required:!0}),{type:"number",key:"absoluteMagnitude",min:-40,max:10,step:.1,required:!0,label:"absoluteMagnitude"}]}}const $=w.catalog({en:()=>I(()=>import("./ReentryEditorMessages_en-BmTZMr-m.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_en),fr:()=>I(()=>import("./ReentryEditorMessages_fr-DHbcY0tN.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_fr),es:()=>I(()=>import("./ReentryEditorMessages_es-edid__Jo.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_es),it:()=>I(()=>import("./ReentryEditorMessages_it-CIzkIU4G.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_it)});class u{static TIME_MARGIN_MIN=6;static HEADING_MARGIN_DEG=45;static ELEVATION_LOW_FACTOR=.3;static ELEVATION_SLACK_DEG=5;static DURATION_FACTOR=3;static ARCHIVED_MAGNITUDE=-3;static WATCHED_KM=600;static WATCHED_COUNT=5;static NIGHT_SUN_DEG=-12;static SHOWER_MARGIN_DEG=20;static RADIANT_BELOW_DEG=-10;static FIRST_ORBIT_MS=Date.UTC(1957,9,4);static shared={fireballs:new E,reentries:new O};static viewOf(t,e,n){const i=t.track;if(i.length<2)return;const r=i[0],o=i[i.length-1],a=t.seen,s=m=>b.seenFrom(n,{lat:m.lat,lng:m.lng,heightM:m.altitudeKm*1e3}),d=a?.fromAzimuthDeg!==void 0&&a.fromAltitudeDeg!==void 0?{azimuthDeg:a.fromAzimuthDeg,altitudeDeg:a.fromAltitudeDeg}:s(r),c=a?.toAzimuthDeg!==void 0&&a.toAltitudeDeg!==void 0?{azimuthDeg:a.toAzimuthDeg,altitudeDeg:a.toAltitudeDeg}:s(o),l=a?.durationS??(o.t-r.t)/1e3,h=Math.min(...t.fragments.flatMap(m=>[m.absoluteMagnitude,...(m.lightCurve??[]).map(f=>f.absoluteMagnitude)]));return{startMs:e.getTime()+r.t,durationS:l,from:{azimuthDeg:d.azimuthDeg,altitudeDeg:d.altitudeDeg},to:{azimuthDeg:c.azimuthDeg,altitudeDeg:c.altitudeDeg},peakAbsoluteMagnitude:h}}static azimuthOff(t,e){const n=Math.abs(((t-e)%360+360)%360);return Math.min(n,360-n)}static elevationOff(t,e){const n=Math.max(0,t*u.ELEVATION_LOW_FACTOR)-u.ELEVATION_SLACK_DEG,i=t+u.ELEVATION_SLACK_DEG;return e<n?n-e:e>i?e-i:0}static matchFireball(t,e,n){const i=e.t<t.startMs?t.startMs-e.t:0,r=e.t>t.startMs?e.t-t.startMs:0;if(Math.max(i,r)>u.TIME_MARGIN_MIN*6e4)return;const o=b.seenFrom(n,{lat:e.from[0],lng:e.from[1],heightM:e.from[2]*1e3}),a=b.seenFrom(n,{lat:e.to[0],lng:e.to[1],heightM:e.to[2]*1e3});if(o.altitudeDeg<0&&a.altitudeDeg<0)return;const s=Math.max(u.azimuthOff(t.from.azimuthDeg,o.azimuthDeg),u.azimuthOff(t.to.azimuthDeg,a.azimuthDeg));if(s>u.HEADING_MARGIN_DEG||Math.max(u.elevationOff(t.from.altitudeDeg,o.altitudeDeg),u.elevationOff(t.to.altitudeDeg,a.altitudeDeg))>0)return;const c=u.DURATION_FACTOR;if(!(e.durationS>0&&(t.durationS<e.durationS/c||t.durationS>e.durationS*c)))return{record:e,offsetMinutes:Math.round((i+r)/6e4),headingOffDeg:Math.round(s),altitudeOffDeg:Math.round(Math.abs(a.altitudeDeg-t.to.altitudeDeg))}}static async check(t,e,n,i=u.shared){if(!e||!n)return[{verdict:"unchecked",source:"none",reason:"noDateOrPlace"}];const r=u.viewOf(t,e,n);if(!r)return[{verdict:"unchecked",source:"none",reason:"noDateOrPlace"}];const o=M.of(t.type)?.nature,a=[];if(o!=="artificial"&&a.push(...await u.checkFireballs(r,n,o==="natural",i)),o!=="artificial"){const s=u.showerOf(r,n);s&&(s.verdict==="compatible"||o==="natural")&&a.push(s)}return o!=="natural"&&a.push(...await u.checkCatalogue(t,r,n,o==="artificial",i)),o===void 0&&!a.some(s=>s.verdict==="known"||s.verdict==="possible"||s.verdict==="compatible")?[...a.filter(s=>s.verdict==="unchecked"),{verdict:"uninformative",source:"none",reason:"typeUnknown"}]:a}static vectorOf(t,e){const n=Math.PI/180,i=e*n,r=t*n;return[Math.cos(i)*Math.sin(r),Math.cos(i)*Math.cos(r),Math.sin(i)]}static angleDeg(t,e){return Math.acos(Math.max(-1,Math.min(1,t[0]*e[0]+t[1]*e[1]+t[2]*e[2])))*180/Math.PI}static showerOf(t,e){const n=u.vectorOf(t.from.azimuthDeg,t.from.altitudeDeg),i=u.vectorOf(t.to.azimuthDeg,t.to.altitudeDeg),r=u.angleDeg(n,i);if(r<1)return;const o=[n[1]*i[2]-n[2]*i[1],n[2]*i[0]-n[0]*i[2],n[0]*i[1]-n[1]*i[0]],a=Math.hypot(o[0],o[1],o[2]),s=new Date(t.startMs),d=C.activeAt(s);let c;for(const{shower:l,zhr:h}of d){const m=C.radiantPosition(l,s,{lat:e.lat,lng:e.lng,elevationM:e.heightM});if(m.altitudeDeg<u.RADIANT_BELOW_DEG)continue;const f=u.vectorOf(m.azimuthDeg,m.altitudeDeg),p=Math.asin(Math.min(1,Math.abs((f[0]*o[0]+f[1]*o[1]+f[2]*o[2])/a)))*180/Math.PI,y=u.angleDeg(f,n),A=u.angleDeg(f,i);y>=A||A<=r||p<=u.SHOWER_MARGIN_DEG&&(!c||p<c.offDeg)&&(c={showerId:l.id,offDeg:Math.round(p),zhr:Math.round(h)})}return c?{verdict:"compatible",source:"showers",...c}:{verdict:"sporadic",source:"showers",active:d.length}}static async checkFireballs(t,e,n,i){const r=u.TIME_MARGIN_MIN*6e4;if(!E.mayCover(t.startMs))return n?[{verdict:"uninformative",source:"gmn",reason:"beforeArchive"}]:[];const o=await i.fireballs.between(t.startMs-r,t.startMs+r+t.durationS*1e3);if(o===void 0)return n?[{verdict:"unchecked",source:"gmn",reason:"unreachable"}]:[];const a=o.map(m=>u.matchFireball(t,m,e)).filter(m=>m!==void 0).sort((m,f)=>m.offsetMinutes-f.offsetMinutes||m.headingOffDeg-f.headingOffDeg);if(a.length>0)return[{verdict:"known",source:"gmn",match:a[0]}];if(!n)return[];if(t.peakAbsoluteMagnitude>u.ARCHIVED_MAGNITUDE)return[{verdict:"uninformative",source:"gmn",reason:"faint"}];if(_("Sun",new Date(t.startMs),{lat:e.lat,lng:e.lng,elevationM:0}).altitudeDeg>u.NIGHT_SUN_DEG)return[{verdict:"uninformative",source:"gmn",reason:"daylight"}];const s=new Date(t.startMs),d=Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),1),c=Date.UTC(s.getUTCFullYear(),s.getUTCMonth()+1,1)-1,h=(await i.fireballs.between(d,c)??[]).filter(m=>O.distanceKm(e.lat,e.lng,m.from[0],m.from[1])<=u.WATCHED_KM).length;return h<u.WATCHED_COUNT?[{verdict:"uninformative",source:"gmn",reason:"unwatched"}]:[{verdict:"expectedAbsent",source:"gmn",absoluteMagnitude:t.peakAbsoluteMagnitude,watchedCount:h}]}static async checkCatalogue(t,e,n,i,r){if(e.startMs<u.FIRST_ORBIT_MS)return i?[{verdict:"impossible",source:"catalogue"}]:[];const o=u.TIME_MARGIN_MIN*6e4,a=await r.reentries.candidates(e.startMs-o,e.startMs+o+e.durationS*1e3,n);if(a===void 0)return i?[{verdict:"unchecked",source:"catalogue",reason:"unreachable"}]:[];const s=t.object,d=s&&a.find(l=>s.cosparId&&l.record.cosparId===s.cosparId||s.norad!==void 0&&l.record.norad===s.norad);if(d)return[{verdict:"known",source:"catalogue",candidate:d,by:"object"}];const c=a.find(l=>l.record.precision==="minute"&&l.seenKm!==void 0&&(l.offsetMinutes??0)<=u.TIME_MARGIN_MIN);return c?[{verdict:"known",source:"catalogue",candidate:c,by:"seen"}]:a.length>0?a.slice(0,3).map(l=>({verdict:"possible",source:"catalogue",candidate:l})):i?[{verdict:"expectedAbsent",source:"catalogue"}]:[]}}class T{constructor(t,e,n){this.container=t,this.host=e,N.attach(t,"reentry-editor-part",T.STYLE),this.language=n,this.ready=this.setLanguage(n)}messages;ready;parameterTexts;languageToken=0;currentId;form;list;timeline;placeForm;placeIndex=0;row="path";fragmentForm;fragmentIndex=0;curveForm;curveIndex=0;language;shown=[];static STYLE='.reentry-editor-part { flex-basis: 100%; min-width: 0; } .reentry-editor-part #reentry-timeline { flex-basis: 100%; min-width: 0; padding: 4px 0; } .reentry-editor-part #reentry-path > .icon-btn, .reentry-editor-part #reentry-curve > .icon-btn { align-self: flex-end; } .reentry-editor-part #reentry-list, .reentry-editor-part #reentry-places, .reentry-editor-part #reentry-fragment-list, .reentry-editor-part #reentry-curve-list { flex-basis: 100%; min-width: 0; } .reentry-editor-part .launch-editor, .reentry-editor-part .launch-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; } .reentry-editor-part .launch-fields { flex-basis: 100%; min-width: 0; } .reentry-editor-part [hidden] { display: none !important; } .reentry-editor-part .reentry-evidence { flex-basis: 100%; } .reentry-editor-part .evidence-known, .reentry-editor-part .evidence-impossible, .reentry-editor-part .evidence-expectedAbsent { font-weight: 600; } .reentry-editor-part select { min-width: 0; width: 100%; } .reentry-editor-part .launch-intro { flex-basis: 100%; margin: 0; } .reentry-editor-part .launch-track { flex-basis: 100%; margin: 0; } .reentry-editor-part .launch-parameters { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .reentry-editor-part .parameter-group { flex: 1 1 14em; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; align-content: flex-start; } .reentry-editor-part input, .reentry-editor-part select { max-width: 100%; box-sizing: border-box; } .reentry-editor-part input[type="text"] { width: 12em; } .reentry-editor-part input[data-key="title"] { width: 18em; } .reentry-editor-part label { min-width: 0; max-width: 100%; } .reentry-editor-part input.parameter-derived::placeholder { opacity: .65; } .reentry-editor-part .launch-path { flex: 1 1 100%; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; }';async setLanguage(t){const e=++this.languageToken;this.language=t;const[n,i,,r]=await Promise.all([$.load(t),z.load(t),M.load(t),F(t).catch(()=>{})]);e===this.languageToken&&(this.sceneNames=r,this.messages=n,this.parameterTexts=i,this.render(),this.sync())}sync(){if(!this.messages)return;const t=this.reentries;this.shown=[...t],t.some(n=>n.id===this.currentId)||(this.currentId=t[0]?.id),this.list?.setItems(t.map(n=>({id:n.id,label:this.labelOf(n)})),this.currentId),this.list?.setKinds(M.all().map(n=>({value:n.key,label:M.nameOf(n.key)}))),this.syncAddState();const e=this.current;this.element("reentry-fields").hidden=e===void 0,e&&(this.syncPlace(!0),this.syncFragments(e,!0),this.syncEvidence(),this.form??=new D(this.element("reentry-parameters"),this.language,"reentry.",{said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()}),this.form.show(this.resolved(g.SET),new k(()=>this.current,n=>this.editReentry(i=>{i.object&&(i.object={...i.object}),i.seen&&(i.seen={...i.seen}),n(i),i.object&&Object.values(i.object).every(a=>a===void 0||a==="")&&delete i.object;const r=this.origin(),o=r&&g.trackFromSeen(i,r);o&&(i.track=o)})),()=>this.written()))}refresh(){if(!this.messages)return;this.syncAddState();const t=this.reentries;if(t.length===this.shown.length&&t.every((e,n)=>e.id===this.shown[n].id)){this.syncTimeline();return}this.sync()}setTime(t){this.messages&&this.timeline?.setTime(t)}syncAddState(){const t=this.origin()!==void 0;this.list?.setAddState(t,t?void 0:this.messages.addNowhere)}get current(){return this.reentries.find(t=>t.id===this.currentId)}show(t){this.messages&&(this.currentId=t,this.row="path",this.placeIndex=0,this.fragmentIndex=0,this.curveIndex=0,this.sync())}resolved(t){return S.resolve(t,this.parameterTexts)}render(){if(!this.messages)return;const t=this.messages;this.form=void 0,this.evidenceFor=void 0,this.container.innerHTML=`<div class="launch-editor">
|
|
1
|
+
import{M as w,_ as I,c as F}from"./rr0-ufoathome.mjs";import{P as S,I as x}from"./SaidPosition-CXZLm-ck.js";import{S as N}from"./SkyEventEditorStyle-CvY_AhbI.js";import{p as b,cO as M,aK as E,aE as C,m as _,s as P,cC as L}from"./ShareDialogElement-C9Uiwt0F.js";import{c as G}from"./Sighting-Ch4eiBNK.js";import{P as D,a as k,E as H}from"./ParameterForm-DcVFxrcO.js";import{T as K}from"./TimelineTracks-BgZmkKhn.js";import{R as O}from"./ReentryArchive-CeXHrU7L.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./Obstacles-v9SkfBD7.js";import"./VisualAids-DI-hEL46.js";const z=w.catalog({en:()=>I(()=>import("./ReentryParameterTexts_en-5BOfwCsS.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_en),fr:()=>I(()=>import("./ReentryParameterTexts_fr-BgUJROXF.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_fr),es:()=>I(()=>import("./ReentryParameterTexts_es-ze1-U4jB.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_es),it:()=>I(()=>import("./ReentryParameterTexts_it-MTb9Vuq0.js"),[],import.meta.url).then(v=>v.reentryParameterTexts_it)});class g{static NAME="name";static OBJECT="object";static LIGHT="light";static WHEN="when";static SEEN="seenByTheWitness";static EARTH_KM=6371;static placeSeen(t,e,n,i){const r=Math.PI/180,o=g.EARTH_KM,a=n*r,s=-o*Math.sin(a)+Math.sqrt((o*Math.sin(a))**2+(o+i)**2-o**2),d=Math.atan2(s*Math.cos(a),o+s*Math.sin(a)),c=t.lat*r,l=e*r,h=Math.asin(Math.sin(c)*Math.cos(d)+Math.cos(c)*Math.sin(d)*Math.cos(l)),m=t.lng*r+Math.atan2(Math.sin(l)*Math.sin(d)*Math.cos(c),Math.cos(d)-Math.sin(c)*Math.sin(h));return{lat:h/r,lng:(m/r+540)%360-180}}static trackFromSeen(t,e){const n=t.seen,{fromAzimuthDeg:i,fromAltitudeDeg:r,toAzimuthDeg:o,toAltitudeDeg:a,durationS:s}=n??{};if(i===void 0||r===void 0||o===void 0||a===void 0||!s)return;const d=t.track[0],c=t.track[t.track.length-1],l=d?.t??0,h=d?.altitudeKm??100,m=c?.altitudeKm??h;return[{t:l,...g.placeSeen(e,i,r,h),altitudeKm:h},{t:l+Math.round(s*1e3),...g.placeSeen(e,o,a,m),altitudeKm:m}]}static placeAt(t,e){const n=b.leadAt(t,e);if(n)return{t:e,lat:n.lat,lng:n.lng,altitudeKm:n.heightM/1e3};const i=t.track,[r,o]=e<(i[0]?.t??0)?[i[0],i[1]]:[i[i.length-2],i[i.length-1]];if(!r||!o||o.t===r.t){const s=r??o??{lat:0,lng:0,altitudeKm:80};return{t:e,lat:s.lat,lng:s.lng,altitudeKm:s.altitudeKm}}const a=(e-r.t)/(o.t-r.t);return{t:e,lat:r.lat+(o.lat-r.lat)*a,lng:r.lng+(o.lng-r.lng)*a,altitudeKm:Math.max(0,r.altitudeKm+(o.altitudeKm-r.altitudeKm)*a)}}static curvePointAt(t,e){return{t:e,absoluteMagnitude:Math.round(b.absoluteMagnitudeAt(t,e)*10)/10}}static instantsOf(t){return[...t.track.map(e=>e.t),...t.fragments.flatMap(e=>[...e.fromT===void 0?[]:[e.fromT],...e.untilT===void 0?[]:[e.untilT],...(e.lightCurve??[]).map(n=>n.t)])]}static instant(t,e,n,i={}){return{type:"number",key:t,min:-3600,max:36e3,step:.1,unit:"s",scale:.001,label:e,hint:n,...i}}static mayBeCatalogued(t){return M.of(t.type)?.nature!=="natural"}static SET={kind:"reentry",title:"fireballOrReEntry",parameters:[{type:"said",key:"title",label:g.NAME},{type:"choice",key:"type",label:"type",hint:"whatCameInNaturalOrPut",empty:"notKnown",choices:[],optionsOf:t=>{const e=t.type,n=M.all().map(i=>({value:i.key,label:M.nameOf(i.key)}));return e===void 0||n.some(i=>i.value===e)?n:[...n,{value:e,label:e}]}},{type:"text",key:"object.name",group:g.OBJECT,visibleWhen:g.mayBeCatalogued,label:"catalogueName",hint:"forAReEntryThePiece"},{type:"text",key:"object.cosparId",group:g.OBJECT,visibleWhen:g.mayBeCatalogued,label:"cosparId",placeholder:"t1968013c"},{type:"number",key:"object.norad",min:1,max:999999,step:1,group:g.OBJECT,visibleWhen:g.mayBeCatalogued,label:"noradNumber"},{type:"number",key:"seen.fromAzimuthDeg",min:0,max:360,step:1,unit:"°",group:g.SEEN,label:"appearedAzimuth",hint:"fromTheNorthTowardsTheEast"},{type:"number",key:"seen.fromAltitudeDeg",min:-5,max:90,step:1,unit:"°",group:g.SEEN,label:"appearedHeight",hint:"aboveTheHorizon"},{type:"number",key:"seen.toAzimuthDeg",min:0,max:360,step:1,unit:"°",group:g.SEEN,label:"wentOutAzimuth",hint:"fromTheNorthTowardsTheEast"},{type:"number",key:"seen.toAltitudeDeg",min:-5,max:90,step:1,unit:"°",group:g.SEEN,label:"wentOutHeight",hint:"aboveTheHorizon"},{type:"number",key:"seen.durationS",min:.1,max:3600,step:.1,unit:"s",group:g.SEEN,label:"seenFor",hint:"allSaidThePathIsWorkedOut"}]};static PLACE={kind:"reentry-place",title:"pointOfThePath",parameters:[g.instant("t","time","secondsOfTheRecordingNegativeBefore",{required:!0}),{type:"position",key:"lat",secondKey:"lng",saidKey:"saidPosition",native:"geo",step:1,rangeM:2e6,label:"position"},{type:"number",key:"altitudeKm",min:0,max:300,step:.1,unit:"km",required:!0,label:"altitude",hint:"aboveTheEllipsoidAMeteorBegins"}]};static trackEnd(t,e){const n=t?.track;if(n?.length)return e==="first"?n[0].t:n[n.length-1].t}static FRAGMENT={kind:"reentry-fragment",title:"piece",parameters:[{type:"text",key:"id",label:"id",validate:(t,e,n)=>!n?.fragments.some(i=>i!==e&&i.id===t)},{type:"number",key:"absoluteMagnitude",min:-40,max:10,step:.1,required:!0,group:g.LIGHT,label:"absoluteMagnitude",hint:"itsBrightnessSeenFrom100Km"},{type:"colour",key:"color",group:g.LIGHT,fallback:b.DEFAULT_COLOR,label:"colour"},{type:"number",key:"trainS",min:0,max:600,step:.1,unit:"s",group:g.LIGHT,effective:()=>b.DEFAULT_TRAIN_S,label:"train",hint:"howLongAStretchOfIts"},{type:"number",key:"lagS",min:0,max:600,step:.1,unit:"s",group:g.WHEN,effective:()=>0,label:"behindTheLead",hint:"secondsBehindTheLeadingPointAlong"},g.instant("fromT","seenFrom","whenItBreaksOffOrBegins",{group:g.WHEN,effective:(t,e)=>g.trackEnd(e,"first")}),g.instant("untilT","outAt","whenItHasBurnedUpOr",{group:g.WHEN,effective:(t,e)=>g.trackEnd(e,"last")})]};static CURVE_POINT={kind:"reentry-curve-point",title:"pointOfTheLightCurve",parameters:[g.instant("t","time","secondsOfTheRecording",{required:!0}),{type:"number",key:"absoluteMagnitude",min:-40,max:10,step:.1,required:!0,label:"absoluteMagnitude"}]}}const $=w.catalog({en:()=>I(()=>import("./ReentryEditorMessages_en-BmTZMr-m.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_en),fr:()=>I(()=>import("./ReentryEditorMessages_fr-DHbcY0tN.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_fr),es:()=>I(()=>import("./ReentryEditorMessages_es-edid__Jo.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_es),it:()=>I(()=>import("./ReentryEditorMessages_it-CIzkIU4G.js"),[],import.meta.url).then(v=>v.reentryEditorMessages_it)});class u{static TIME_MARGIN_MIN=6;static HEADING_MARGIN_DEG=45;static ELEVATION_LOW_FACTOR=.3;static ELEVATION_SLACK_DEG=5;static DURATION_FACTOR=3;static ARCHIVED_MAGNITUDE=-3;static WATCHED_KM=600;static WATCHED_COUNT=5;static NIGHT_SUN_DEG=-12;static SHOWER_MARGIN_DEG=20;static RADIANT_BELOW_DEG=-10;static FIRST_ORBIT_MS=Date.UTC(1957,9,4);static shared={fireballs:new E,reentries:new O};static viewOf(t,e,n){const i=t.track;if(i.length<2)return;const r=i[0],o=i[i.length-1],a=t.seen,s=m=>b.seenFrom(n,{lat:m.lat,lng:m.lng,heightM:m.altitudeKm*1e3}),d=a?.fromAzimuthDeg!==void 0&&a.fromAltitudeDeg!==void 0?{azimuthDeg:a.fromAzimuthDeg,altitudeDeg:a.fromAltitudeDeg}:s(r),c=a?.toAzimuthDeg!==void 0&&a.toAltitudeDeg!==void 0?{azimuthDeg:a.toAzimuthDeg,altitudeDeg:a.toAltitudeDeg}:s(o),l=a?.durationS??(o.t-r.t)/1e3,h=Math.min(...t.fragments.flatMap(m=>[m.absoluteMagnitude,...(m.lightCurve??[]).map(f=>f.absoluteMagnitude)]));return{startMs:e.getTime()+r.t,durationS:l,from:{azimuthDeg:d.azimuthDeg,altitudeDeg:d.altitudeDeg},to:{azimuthDeg:c.azimuthDeg,altitudeDeg:c.altitudeDeg},peakAbsoluteMagnitude:h}}static azimuthOff(t,e){const n=Math.abs(((t-e)%360+360)%360);return Math.min(n,360-n)}static elevationOff(t,e){const n=Math.max(0,t*u.ELEVATION_LOW_FACTOR)-u.ELEVATION_SLACK_DEG,i=t+u.ELEVATION_SLACK_DEG;return e<n?n-e:e>i?e-i:0}static matchFireball(t,e,n){const i=e.t<t.startMs?t.startMs-e.t:0,r=e.t>t.startMs?e.t-t.startMs:0;if(Math.max(i,r)>u.TIME_MARGIN_MIN*6e4)return;const o=b.seenFrom(n,{lat:e.from[0],lng:e.from[1],heightM:e.from[2]*1e3}),a=b.seenFrom(n,{lat:e.to[0],lng:e.to[1],heightM:e.to[2]*1e3});if(o.altitudeDeg<0&&a.altitudeDeg<0)return;const s=Math.max(u.azimuthOff(t.from.azimuthDeg,o.azimuthDeg),u.azimuthOff(t.to.azimuthDeg,a.azimuthDeg));if(s>u.HEADING_MARGIN_DEG||Math.max(u.elevationOff(t.from.altitudeDeg,o.altitudeDeg),u.elevationOff(t.to.altitudeDeg,a.altitudeDeg))>0)return;const c=u.DURATION_FACTOR;if(!(e.durationS>0&&(t.durationS<e.durationS/c||t.durationS>e.durationS*c)))return{record:e,offsetMinutes:Math.round((i+r)/6e4),headingOffDeg:Math.round(s),altitudeOffDeg:Math.round(Math.abs(a.altitudeDeg-t.to.altitudeDeg))}}static async check(t,e,n,i=u.shared){if(!e||!n)return[{verdict:"unchecked",source:"none",reason:"noDateOrPlace"}];const r=u.viewOf(t,e,n);if(!r)return[{verdict:"unchecked",source:"none",reason:"noDateOrPlace"}];const o=M.of(t.type)?.nature,a=[];if(o!=="artificial"&&a.push(...await u.checkFireballs(r,n,o==="natural",i)),o!=="artificial"){const s=u.showerOf(r,n);s&&(s.verdict==="compatible"||o==="natural")&&a.push(s)}return o!=="natural"&&a.push(...await u.checkCatalogue(t,r,n,o==="artificial",i)),o===void 0&&!a.some(s=>s.verdict==="known"||s.verdict==="possible"||s.verdict==="compatible")?[...a.filter(s=>s.verdict==="unchecked"),{verdict:"uninformative",source:"none",reason:"typeUnknown"}]:a}static vectorOf(t,e){const n=Math.PI/180,i=e*n,r=t*n;return[Math.cos(i)*Math.sin(r),Math.cos(i)*Math.cos(r),Math.sin(i)]}static angleDeg(t,e){return Math.acos(Math.max(-1,Math.min(1,t[0]*e[0]+t[1]*e[1]+t[2]*e[2])))*180/Math.PI}static showerOf(t,e){const n=u.vectorOf(t.from.azimuthDeg,t.from.altitudeDeg),i=u.vectorOf(t.to.azimuthDeg,t.to.altitudeDeg),r=u.angleDeg(n,i);if(r<1)return;const o=[n[1]*i[2]-n[2]*i[1],n[2]*i[0]-n[0]*i[2],n[0]*i[1]-n[1]*i[0]],a=Math.hypot(o[0],o[1],o[2]),s=new Date(t.startMs),d=C.activeAt(s);let c;for(const{shower:l,zhr:h}of d){const m=C.radiantPosition(l,s,{lat:e.lat,lng:e.lng,elevationM:e.heightM});if(m.altitudeDeg<u.RADIANT_BELOW_DEG)continue;const f=u.vectorOf(m.azimuthDeg,m.altitudeDeg),p=Math.asin(Math.min(1,Math.abs((f[0]*o[0]+f[1]*o[1]+f[2]*o[2])/a)))*180/Math.PI,y=u.angleDeg(f,n),A=u.angleDeg(f,i);y>=A||A<=r||p<=u.SHOWER_MARGIN_DEG&&(!c||p<c.offDeg)&&(c={showerId:l.id,offDeg:Math.round(p),zhr:Math.round(h)})}return c?{verdict:"compatible",source:"showers",...c}:{verdict:"sporadic",source:"showers",active:d.length}}static async checkFireballs(t,e,n,i){const r=u.TIME_MARGIN_MIN*6e4;if(!E.mayCover(t.startMs))return n?[{verdict:"uninformative",source:"gmn",reason:"beforeArchive"}]:[];const o=await i.fireballs.between(t.startMs-r,t.startMs+r+t.durationS*1e3);if(o===void 0)return n?[{verdict:"unchecked",source:"gmn",reason:"unreachable"}]:[];const a=o.map(m=>u.matchFireball(t,m,e)).filter(m=>m!==void 0).sort((m,f)=>m.offsetMinutes-f.offsetMinutes||m.headingOffDeg-f.headingOffDeg);if(a.length>0)return[{verdict:"known",source:"gmn",match:a[0]}];if(!n)return[];if(t.peakAbsoluteMagnitude>u.ARCHIVED_MAGNITUDE)return[{verdict:"uninformative",source:"gmn",reason:"faint"}];if(_("Sun",new Date(t.startMs),{lat:e.lat,lng:e.lng,elevationM:0}).altitudeDeg>u.NIGHT_SUN_DEG)return[{verdict:"uninformative",source:"gmn",reason:"daylight"}];const s=new Date(t.startMs),d=Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),1),c=Date.UTC(s.getUTCFullYear(),s.getUTCMonth()+1,1)-1,h=(await i.fireballs.between(d,c)??[]).filter(m=>O.distanceKm(e.lat,e.lng,m.from[0],m.from[1])<=u.WATCHED_KM).length;return h<u.WATCHED_COUNT?[{verdict:"uninformative",source:"gmn",reason:"unwatched"}]:[{verdict:"expectedAbsent",source:"gmn",absoluteMagnitude:t.peakAbsoluteMagnitude,watchedCount:h}]}static async checkCatalogue(t,e,n,i,r){if(e.startMs<u.FIRST_ORBIT_MS)return i?[{verdict:"impossible",source:"catalogue"}]:[];const o=u.TIME_MARGIN_MIN*6e4,a=await r.reentries.candidates(e.startMs-o,e.startMs+o+e.durationS*1e3,n);if(a===void 0)return i?[{verdict:"unchecked",source:"catalogue",reason:"unreachable"}]:[];const s=t.object,d=s&&a.find(l=>s.cosparId&&l.record.cosparId===s.cosparId||s.norad!==void 0&&l.record.norad===s.norad);if(d)return[{verdict:"known",source:"catalogue",candidate:d,by:"object"}];const c=a.find(l=>l.record.precision==="minute"&&l.seenKm!==void 0&&(l.offsetMinutes??0)<=u.TIME_MARGIN_MIN);return c?[{verdict:"known",source:"catalogue",candidate:c,by:"seen"}]:a.length>0?a.slice(0,3).map(l=>({verdict:"possible",source:"catalogue",candidate:l})):i?[{verdict:"expectedAbsent",source:"catalogue"}]:[]}}class T{constructor(t,e,n){this.container=t,this.host=e,N.attach(t,"reentry-editor-part",T.STYLE),this.language=n,this.ready=this.setLanguage(n)}messages;ready;parameterTexts;languageToken=0;currentId;form;list;timeline;placeForm;placeIndex=0;row="path";fragmentForm;fragmentIndex=0;curveForm;curveIndex=0;language;shown=[];static STYLE='.reentry-editor-part { flex-basis: 100%; min-width: 0; } .reentry-editor-part #reentry-timeline { flex-basis: 100%; min-width: 0; padding: 4px 0; } .reentry-editor-part #reentry-path > .icon-btn, .reentry-editor-part #reentry-curve > .icon-btn { align-self: flex-end; } .reentry-editor-part #reentry-list, .reentry-editor-part #reentry-places, .reentry-editor-part #reentry-fragment-list, .reentry-editor-part #reentry-curve-list { flex-basis: 100%; min-width: 0; } .reentry-editor-part .launch-editor, .reentry-editor-part .launch-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; } .reentry-editor-part .launch-fields { flex-basis: 100%; min-width: 0; } .reentry-editor-part [hidden] { display: none !important; } .reentry-editor-part .reentry-evidence { flex-basis: 100%; } .reentry-editor-part .evidence-known, .reentry-editor-part .evidence-impossible, .reentry-editor-part .evidence-expectedAbsent { font-weight: 600; } .reentry-editor-part select { min-width: 0; width: 100%; } .reentry-editor-part .launch-intro { flex-basis: 100%; margin: 0; } .reentry-editor-part .launch-track { flex-basis: 100%; margin: 0; } .reentry-editor-part .launch-parameters { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .reentry-editor-part .parameter-group { flex: 1 1 14em; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; align-content: flex-start; } .reentry-editor-part input, .reentry-editor-part select { max-width: 100%; box-sizing: border-box; } .reentry-editor-part input[type="text"] { width: 12em; } .reentry-editor-part input[data-key="title"] { width: 18em; } .reentry-editor-part label { min-width: 0; max-width: 100%; } .reentry-editor-part input.parameter-derived::placeholder { opacity: .65; } .reentry-editor-part .launch-path { flex: 1 1 100%; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; }';async setLanguage(t){const e=++this.languageToken;this.language=t;const[n,i,,r]=await Promise.all([$.load(t),z.load(t),M.load(t),F(t).catch(()=>{})]);e===this.languageToken&&(this.sceneNames=r,this.messages=n,this.parameterTexts=i,this.render(),this.sync())}sync(){if(!this.messages)return;const t=this.reentries;this.shown=[...t],t.some(n=>n.id===this.currentId)||(this.currentId=t[0]?.id),this.list?.setItems(t.map(n=>({id:n.id,label:this.labelOf(n)})),this.currentId),this.list?.setKinds(M.all().map(n=>({value:n.key,label:M.nameOf(n.key)}))),this.syncAddState();const e=this.current;this.element("reentry-fields").hidden=e===void 0,e&&(this.syncPlace(!0),this.syncFragments(e,!0),this.syncEvidence(),this.form??=new D(this.element("reentry-parameters"),this.language,"reentry.",{said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()}),this.form.show(this.resolved(g.SET),new k(()=>this.current,n=>this.editReentry(i=>{i.object&&(i.object={...i.object}),i.seen&&(i.seen={...i.seen}),n(i),i.object&&Object.values(i.object).every(a=>a===void 0||a==="")&&delete i.object;const r=this.origin(),o=r&&g.trackFromSeen(i,r);o&&(i.track=o)})),()=>this.written()))}refresh(){if(!this.messages)return;this.syncAddState();const t=this.reentries;if(t.length===this.shown.length&&t.every((e,n)=>e.id===this.shown[n].id)){this.syncTimeline();return}this.sync()}setTime(t){this.messages&&this.timeline?.setTime(t)}syncAddState(){const t=this.origin()!==void 0;this.list?.setAddState(t,t?void 0:this.messages.addNowhere)}get current(){return this.reentries.find(t=>t.id===this.currentId)}show(t){this.messages&&(this.currentId=t,this.row="path",this.placeIndex=0,this.fragmentIndex=0,this.curveIndex=0,this.sync())}resolved(t){return S.resolve(t,this.parameterTexts)}render(){if(!this.messages)return;const t=this.messages;this.form=void 0,this.evidenceFor=void 0,this.container.innerHTML=`<div class="launch-editor">
|
|
2
2
|
<p class="launch-intro">${t.intro}</p>
|
|
3
3
|
<div id="reentry-list"></div>
|
|
4
4
|
<div id="reentry-fields" class="launch-fields">
|
package/dist-embed-ufoathome/{ReentrySimulation-C7XZlAED.js → ReentrySimulation-2UWwXU7K.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b2 as S,cJ as G,bz as _,bg as M,cK as f,bj as b,bb as F,cD as R,cE as w,b7 as N,b4 as y,cL as H,cM as C,cN as L,p as j}from"./ShareDialogElement-
|
|
1
|
+
import{b2 as S,cJ as G,bz as _,bg as M,cK as f,bj as b,bb as F,cD as R,cE as w,b7 as N,b4 as y,cL as H,cM as C,cN as L,p as j}from"./ShareDialogElement-C9Uiwt0F.js";import"./rr0-ufoathome.mjs";import"./SaidPosition-CXZLm-ck.js";import"./Sighting-Ch4eiBNK.js";import"./VisualAids-DI-hEL46.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./Obstacles-v9SkfBD7.js";class h{static RADIUS=840;static MAX_SEGMENTS=1024;static VERTICES_PER_SEGMENT=12;static MIN_HALF_WIDTH_DEG=.1;static BRIGHT_HALF_WIDTH_DEG=.22;static TRAIN_SHARE=.9;static TRAIN_FALLOFF=1.2;object=new S;tiers;trains;positions;colors;shown=0;drawn=[];constructor(){this.object.name="reentries",this.tiers=G.map(i=>{const o=new _(new M,f.material(i.size,!1));return f.track(o),o.frustumCulled=!1,this.object.add(o),o});const s=h.MAX_SEGMENTS*h.VERTICES_PER_SEGMENT;this.positions=new Float32Array(s*3),this.colors=new Float32Array(s*3);const t=new M;t.setAttribute("position",new b(this.positions,3)),t.setAttribute("color",new b(this.colors,3)),t.setDrawRange(0,0),this.trains=new F(t,R.material()),this.trains.frustumCulled=!1,R.track(this.trains),this.object.add(this.trains)}nearest(s,t){let i,o=t;for(const e of this.drawn){const n=e.direction.dot(s);(n>o||i&&n===o&&e.magnitude<i.magnitude)&&(o=n,i=e)}return i}static directionOf(s){const{x:t,y:i,z:o}=w(s.altitudeDeg,s.azimuthDeg,1);return new N(t,i,o)}get count(){return this.shown}set(s,t,i,o){const e=this.tiers.map(()=>[]);let n=0,E=0;const r=new y;this.drawn=[];for(const a of s){const u=i(a.head);if(u<=0)continue;const c=a.magnitude-2.5*Math.log10(u);if(c>t)continue;E++,this.drawn.push({direction:h.directionOf(a.head),view:a,magnitude:c}),r.set(a.color);const d=H(c,t)*a.fade,{x:A,y:m,z:g}=w(a.head.altitudeDeg,a.head.azimuthDeg,h.RADIUS),[p,I,T]=o(a.head,c),z=a.fade,D=Math.max(r.r,r.g,r.b)||1;e[C(d)].push({x:A,y:m,z:g,r:p*r.r*z/D,g:I*r.g*z/D,b:T*r.b*z/D}),n=this.pushTrain(n,a.train,d,r)}this.shown=E,this.tiers.forEach((a,u)=>{const c=e[u],d=new Float32Array(c.length*3),A=new Float32Array(c.length*3);c.forEach((g,p)=>{d.set([g.x,g.y,g.z],p*3),A.set([g.r,g.g,g.b],p*3)}),a.geometry.dispose();const m=new M;m.setAttribute("position",new b(d,3)),m.setAttribute("color",new b(A,3)),a.geometry=m});const l=this.trains.geometry;l.setDrawRange(0,n),l.getAttribute("position").needsUpdate=!0,l.getAttribute("color").needsUpdate=!0}pushTrain(s,t,i,o){const e=t.length-1;for(let n=0;n<e;n++){if(s+h.VERTICES_PER_SEGMENT>h.MAX_SEGMENTS*h.VERTICES_PER_SEGMENT)return s;const E=1-n/e,r=1-(n+1)/e,l=w(t[n].altitudeDeg,t[n].azimuthDeg,h.RADIUS),a=w(t[n+1].altitudeDeg,t[n+1].azimuthDeg,h.RADIUS),u=d=>h.RADIUS*((h.MIN_HALF_WIDTH_DEG+h.BRIGHT_HALF_WIDTH_DEG*i*d)*Math.PI/180),c=d=>h.TRAIN_SHARE*i*d**h.TRAIN_FALLOFF;s=this.pushRibbon(s,l,a,u(E),u(r),c(E),c(r),o)}return s}pushRibbon(s,t,i,o,e,n,E,r){const l={x:i.x-t.x,y:i.y-t.y,z:i.z-t.z};if(Math.hypot(l.x,l.y,l.z)<1e-9)return s;const a=this.normalise(this.cross(this.normalise(t),this.normalise(l)));for(const[u,c]of[[-1,0],[0,1]]){const d=this.across(t,a,o,u),A=this.across(i,a,e,u),m=this.across(t,a,o,c),g=this.across(i,a,e,c),p=(I,T)=>I===0?T:0;s=this.push(s,d,p(u,n),r),s=this.push(s,A,p(u,E),r),s=this.push(s,m,p(c,n),r),s=this.push(s,A,p(u,E),r),s=this.push(s,g,p(c,E),r),s=this.push(s,m,p(c,n),r)}return s}across(s,t,i,o){return{x:s.x+t.x*i*o,y:s.y+t.y*i*o,z:s.z+t.z*i*o}}push(s,t,i,o){const e=s*3;this.positions[e]=t.x,this.positions[e+1]=t.y,this.positions[e+2]=t.z;const n=L.relativeOfResponse(Math.max(0,Math.min(1,i)));return this.colors[e]=n*o.r,this.colors[e+1]=n*o.g,this.colors[e+2]=n*o.b,s+1}cross(s,t){return{x:s.y*t.z-s.z*t.y,y:s.z*t.x-s.x*t.z,z:s.x*t.y-s.y*t.x}}normalise(s){const t=Math.hypot(s.x,s.y,s.z)||1;return{x:s.x/t,y:s.y/t,z:s.z/t}}dispose(){for(const s of this.tiers)s.geometry.dispose(),s.material.dispose();this.trains.geometry.dispose(),this.trains.material.dispose(),this.object.removeFromParent()}}class ${inSky=!0;hiddenFromEye=!0;pieces=new h;get object(){return this.pieces.object}get drawnCount(){return this.pieces.count}update(s,t,i){const o=s.length===0?[]:j.viewsAt(s,t,i.observer);o.length===0&&this.pieces.count===0||(this.pieces.set(o,i.magnitudeLimit,e=>i.cloudTransmission(e),(e,n)=>i.arrivingIlluminance(e,n,1)),i.lightFrom(o.map(e=>({position:e.head,magnitude:e.magnitude}))),i.glareFrom(o.map(e=>({key:`${e.reentryId}:${e.fragmentId}`,position:e.head,magnitude:e.magnitude,fade:e.fade}))))}pick(s,t,i){const o=this.pieces.nearest(t,i.nearestCos);return o&&{id:o.view.reentryId,detail:o}}dispose(){this.pieces.dispose()}}export{$ as ReentrySimulation};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bM as w,bN as M,bO as g,be as c,bP as b,bb as y,bD as k,bQ as O,bR as T,bS as E,bT as D}from"./ShareDialogElement-
|
|
1
|
+
import{bM as w,bN as M,bO as g,be as c,bP as b,bb as y,bD as k,bQ as O,bR as T,bS as E,bT as D}from"./ShareDialogElement-C9Uiwt0F.js";import{R as d}from"./ReferenceTimeline-2kBldQeG.js";import{g as I}from"./SaidPosition-CXZLm-ck.js";import{P as m,a as f}from"./PictureFetch-C3wgf1ZV.js";import"./rr0-ufoathome.mjs";import"./Sighting-Ch4eiBNK.js";import"./VisualAids-DI-hEL46.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./Obstacles-v9SkfBD7.js";const v=3,u=800,l=Math.PI/180;class r{constructor(t,i,s=r.fetchImage,e=r.openVideo){this.scene=t,this.onImageLoaded=i,this.loadImage=s,this.loadVideo=e}meshes=new Map;signatures=new Map;images=new Map;loading=new Map;failed=new Map;references=[];views=new Map;shown=!0;observerAt;clock={t:0,playing:!1,timeScale:1};static PRESENT_WITHIN_M=2;static GONE_BEYOND_M=20;static presenceAt(t,i){if(!t.from||!i)return 1;const s=I(i.lat,i.lng,t.from.lat,t.from.lng),a=(Math.hypot(s.x,s.z)-r.PRESENT_WITHIN_M)/(r.GONE_BEYOND_M-r.PRESENT_WITHIN_M),o=Math.min(Math.max(a,0),1);return 1-o*o*(3-2*o)}set(t,i=this.views,s){this.references=t,this.observerAt=s,this.views=i;const e=new Set(t.map(a=>a.id));for(const[a,o]of this.meshes)e.has(a)||(this.dispose(o),this.meshes.delete(a),this.signatures.delete(a));for(const[a,o]of this.images){const n=t.find(p=>p.id===a);if(n&&n.src===o.texture.userData.src&&n.kind==="video"==(o.video!==void 0))continue;r.release(o),this.images.delete(a);const h=this.meshes.get(a);h&&(this.dispose(h),this.meshes.delete(a),this.signatures.delete(a))}for(const a of t){const o=this.images.get(a.id);if(!o){this.load(a);continue}this.build(a,o)}this.follow()}setTime(t){this.clock=t,this.follow()}setShown(t){this.shown=t;for(const i of this.meshes.values())i.visible=t&&this.opacityOf(i.userData.id)>0}setView(t,i){this.views.set(t,i);const s=this.meshes.get(t);s&&this.applyOpacity(s,t)}layer=v;get any(){for(const t of this.meshes.values())if(t.visible)return!0;return!1}place(t){const i=this.held;i&&t.getWorldQuaternion(this.cameraTurn);for(const s of this.meshes.values()){if(!s.visible)continue;s.position.copy(t.position);const e=i?.get(s);e&&s.quaternion.copy(this.cameraTurn).multiply(e),s.updateMatrixWorld()}}hold(t){t.getWorldQuaternion(this.cameraTurn);const i=this.cameraTurn.clone().invert();this.held=new Map([...this.meshes.values()].map(s=>[s,i.clone().multiply(s.quaternion)])),this.registered=new Map([...this.meshes.values()].map(s=>[s,s.quaternion.clone()]))}release(){if(this.held){for(const[t,i]of this.registered??[])t.quaternion.copy(i);this.held=void 0,this.registered=void 0}}registered;held;cameraTurn=new w;get furthestM(){return this.meshes.size>0?u:0}directionOfPixel(t,i,s,e){const a=this.images.get(t.id),o=a?a.width/a.height:1,n=d.registrationAt(t,this.clock.t),h=Math.tan(n.fovDeg/2*l),p=h*o;return e.set((i*2-1)*p,(1-s*2)*h,-1).normalize(),e.applyQuaternion(r.orientation(n))}aspectOf(t){const i=this.images.get(t);return i?i.width/i.height:void 0}failureOf(t){return this.failed.get(t)}follow(){for(const t of this.references){const i=this.meshes.get(t.id),s=this.images.get(t.id)?.video;s&&this.sync(t,s),i&&(t.registrationTrack?.length&&r.point(i,t,d.registrationAt(t,this.clock.t)),t.kind==="video"&&this.applyOpacity(i,t.id))}}sync(t,i){const s=d.mediaSecondsAt(t,this.clock.t,this.clock.timeScale,Number.isFinite(i.duration)?i.duration:void 0);if(s===void 0){i.paused||i.pause();return}const e=d.command(i.currentTime,s,this.clock.playing,d.rateOf(t));i.playbackRate=e.rate,e.seekS!==void 0&&!i.seeking&&(i.currentTime=e.seekS),e.play&&i.paused&&i.play().catch(()=>{}),!e.play&&!i.paused&&i.pause()}load(t){const i=t.src;if(this.loading.has(t.id)||this.failed.has(i))return;const s=t.kind==="video",a=(s?this.loadVideo(i,()=>this.onVideoFrame()):this.loadImage(i)).then(o=>{this.loading.delete(t.id);const n=this.references.find(h=>h.id===t.id);if(!n||n.src!==i||n.kind==="video"!==s){r.release(o);return}o.texture.userData.src=i,this.images.set(t.id,o),this.build(n,o),this.follow(),this.onImageLoaded()},o=>{this.loading.delete(t.id),this.failed.set(i,m.failureOf(o)),this.onImageLoaded()});this.loading.set(t.id,a)}onVideoFrame(){this.follow(),this.onFrame?.()}onFrame;static openVideo(t,i){return new Promise((s,e)=>{const a=document.createElement("video");a.crossOrigin="anonymous",a.muted=!0,a.playsInline=!0,a.preload="auto",a.addEventListener("loadeddata",()=>{const o=new M(a);o.colorSpace=g,o.minFilter=c,o.magFilter=c,o.generateMipmaps=!1,a.addEventListener("seeked",i);const n=()=>{a.paused&&i(),a.src&&a.requestVideoFrameCallback(n)};"requestVideoFrameCallback"in a&&a.requestVideoFrameCallback(n),s({texture:o,width:a.videoWidth,height:a.videoHeight,video:a})},{once:!0}),a.addEventListener("error",()=>{m.whyVideoUnread(t).then(o=>e(new f(t,o)))},{once:!0}),a.src=t})}static release(t){t.texture.dispose();const i=t.video;i&&(i.pause(),i.removeAttribute?.("src"),i.load?.())}static async fetchImage(t){const i=await m.blob(t),s=await createImageBitmap(i,{imageOrientation:"flipY"}).catch(()=>{throw new f(t,{kind:"notPicture"})}),e=new b(s);return e.flipY=!1,e.colorSpace=g,e.minFilter=c,e.magFilter=c,e.generateMipmaps=!1,e.needsUpdate=!0,{texture:e,width:s.width,height:s.height}}build(t,i){const s=r.signatureOf(t,i);let e=this.meshes.get(t.id);if(e&&this.signatures.get(t.id)===s){this.applyOpacity(e,t.id);return}e&&(this.dispose(e),this.meshes.delete(t.id)),e=new y(r.geometryOf(t,i),new k({map:i.texture,transparent:!0,depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1})),t.kind==="panorama"&&(e.material.side=O),e.frustumCulled=!1,e.layers.set(v),e.userData.id=t.id,r.point(e,t,d.registrationAt(t,this.clock.t)),this.scene.add(e),this.meshes.set(t.id,e),this.signatures.set(t.id,s),this.applyOpacity(e,t.id)}static geometryOf(t,i){if(t.kind==="panorama"){const o=new T(u,64,32,Math.PI/2,Math.PI*2),n=o.attributes.uv;for(let h=0;h<n.count;h++)n.setX(h,1-n.getX(h));return n.needsUpdate=!0,o}const s=2*u*Math.tan(t.registration.fovDeg/2*l),e=s*(i.width/Math.max(i.height,1)),a=new E(e,s);return a.translate(0,0,-u),a}static orientation({headingDeg:t,pitchDeg:i,rollDeg:s}){const e=new D;return e.rotation.set(i*l,-t*l,-(s??0)*l,"YXZ"),e.quaternion}static point(t,i,s){if(t.quaternion.copy(r.orientation(s)),i.kind==="panorama")return;const e=Math.tan(s.fovDeg/2*l)/Math.tan(i.registration.fovDeg/2*l);t.scale.set(e,e,1)}inTime(t){if(t.kind!=="video")return!0;const i=this.images.get(t.id)?.video?.duration;return d.mediaSecondsAt(t,this.clock.t,this.clock.timeScale,i!==void 0&&Number.isFinite(i)?i:void 0)!==void 0}opacityOf(t){const i=this.references.find(a=>a.id===t);if(i&&!this.inTime(i))return 0;const s=this.views.get(t),e=i?r.presenceAt(i,this.observerAt):1;return(s?.opacity??i?.opacity??0)*e}applyOpacity(t,i){const s=this.opacityOf(i);t.material.opacity=s,t.visible=this.shown&&s>0}static signatureOf(t,i){const{headingDeg:s,pitchDeg:e,rollDeg:a,fovDeg:o}=t.registration;return[t.kind,t.src,i.width,i.height,s,e,a??0,o].join("|")}dispose(t){this.scene.remove(t),t.geometry.dispose(),t.material.dispose()}disposeAll(){for(const t of this.meshes.values())this.dispose(t);this.meshes.clear(),this.signatures.clear();for(const t of this.images.values())r.release(t);this.images.clear()}}export{v as REFERENCE_LAYER,r as ReferenceSystem};
|