@rr0/ufoathome 0.204.0 → 0.204.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-embed-scene/rr0-scene.mjs +215 -215
- package/dist-embed-sighting/{CaseReportExport-CUy_3oyV.js → CaseReportExport-Dk3rKiVm.js} +1 -1
- package/dist-embed-sighting/rr0-sighting.mjs +239 -239
- package/dist-embed-sighting-editor/{CaseElement-CC4gimF1.js → CaseElement-4CRoH54h.js} +1 -1
- package/dist-embed-sighting-editor/{CaseReportExport-DmvvH_GH.js → CaseReportExport-W1lO4CR3.js} +1 -1
- package/dist-embed-sighting-editor/{SightingElement-BpYuBmJB.js → SightingElement-4YMo_us5.js} +1 -1
- package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +239 -239
- package/dist-embed-ufoathome/{AdsbLolArchiveProvider-Ck345V92.js → AdsbLolArchiveProvider-BJm3HMv9.js} +1 -1
- package/dist-embed-ufoathome/{Aurora-CMORgA2p.js → Aurora-DooZfol8.js} +1 -1
- package/dist-embed-ufoathome/{AuroraEditor-CDZgVOlI.js → AuroraEditor-COl6Uq7r.js} +1 -1
- package/dist-embed-ufoathome/{AuroraSimulation-DqfSBul6.js → AuroraSimulation-8865pkCY.js} +1 -1
- package/dist-embed-ufoathome/{BallesterGuaspAssessor-DUNQZ9e8.js → BallesterGuaspAssessor-CKK5Iybb.js} +1 -1
- package/dist-embed-ufoathome/{BalloonEditor-Cx3fRab8.js → BalloonEditor-BBAtMeVM.js} +1 -1
- package/dist-embed-ufoathome/{BeamEditor-gxTjO6Pr.js → BeamEditor-D6I1zG9Z.js} +1 -1
- package/dist-embed-ufoathome/{BeamSystem-C8jjTJtB.js → BeamSystem-BI4-w_0X.js} +1 -1
- package/dist-embed-ufoathome/{BodyEditor-DGaBo74A.js → BodyEditor-yBNJy9AC.js} +1 -1
- package/dist-embed-ufoathome/{CaseEditorElement-BOp207Tr.js → CaseEditorElement-CPt1laCe.js} +6 -6
- package/dist-embed-ufoathome/{CaseElement-BGO5UZLP.js → CaseElement-CTZ3YIL0.js} +3 -3
- package/dist-embed-ufoathome/{CaseReportExport-6DFaJzfO.js → CaseReportExport-UNmAQ_xa.js} +3 -3
- package/dist-embed-ufoathome/{ColumnResize-DnX89ynB.js → ColumnResize-D6vA9JBg.js} +3 -3
- package/dist-embed-ufoathome/{ControlPasses-CeExr5X1.js → ControlPasses-Bwafi16d.js} +1 -1
- package/dist-embed-ufoathome/{CoverageAssessor-BbqRqh0C.js → CoverageAssessor-DINhJJFz.js} +1 -1
- package/dist-embed-ufoathome/{Flightradar24Provider-MzQcuUHn.js → Flightradar24Provider-BEVn6h-k.js} +1 -1
- package/dist-embed-ufoathome/{GLTFLoader-CPUffC65.js → GLTFLoader-CqzCNjEl.js} +1 -1
- package/dist-embed-ufoathome/{GeoJsonExport-D7QhWNRC.js → GeoJsonExport-B4GBH7Ei.js} +1 -1
- package/dist-embed-ufoathome/{GeographicFigures-BvEeCtxr.js → GeographicFigures-wtF2TmIn.js} +1 -1
- package/dist-embed-ufoathome/{HynekAssessor-BwjRkQWT.js → HynekAssessor-De0RmEd0.js} +1 -1
- package/dist-embed-ufoathome/{InterviewEditorElement-CVCOicLD.js → InterviewEditorElement-BVfNqEBS.js} +1 -1
- package/dist-embed-ufoathome/{InterviewElement-ZI42DKRx.js → InterviewElement-BBEmBs1S.js} +1 -1
- package/dist-embed-ufoathome/{KmlExport-BX0nxAaA.js → KmlExport-C8yk8C7s.js} +1 -1
- package/dist-embed-ufoathome/{LanternEditor-BROUv-vx.js → LanternEditor-DEeA3Kf_.js} +1 -1
- package/dist-embed-ufoathome/{LaserBeam-ChD9aV-N.js → LaserBeam-BGs1pXaE.js} +1 -1
- package/dist-embed-ufoathome/{LaunchEditor-CM2Wcjv2.js → LaunchEditor-CBEW_ih2.js} +1 -1
- package/dist-embed-ufoathome/{LaunchPlume-DeVRe05u.js → LaunchPlume-BbsUUQE0.js} +1 -1
- package/dist-embed-ufoathome/{LaunchSimulation-RROdYccW.js → LaunchSimulation-DJJaKJGV.js} +1 -1
- package/dist-embed-ufoathome/{ModelSource-nXZ6eIH5.js → ModelSource-B2Ie3T9B.js} +1 -1
- package/dist-embed-ufoathome/{ModelThumbnails-CRSm49vm.js → ModelThumbnails-BOfC5SZt.js} +1 -1
- package/dist-embed-ufoathome/{ModelViewer-BQsl_Nfn.js → ModelViewer-CXP4K0sx.js} +1 -1
- package/dist-embed-ufoathome/{ModulesPanelElement-BvzY1GUF.js → ModulesPanelElement-DPkBhz-Y.js} +1 -1
- package/dist-embed-ufoathome/{NearestApproach-DbUpe1iw.js → NearestApproach-D2cz2_44.js} +1 -1
- package/dist-embed-ufoathome/{PoherAssessor-Dmro58tC.js → PoherAssessor-CNOuLGVz.js} +1 -1
- package/dist-embed-ufoathome/{PoherSelfCheck-pcYj_hQ1.js → PoherSelfCheck-DnXcStjH.js} +1 -1
- package/dist-embed-ufoathome/{ReentryEditor-Di0KzYeZ.js → ReentryEditor-BCQM22Ps.js} +1 -1
- package/dist-embed-ufoathome/{ReentrySimulation-HhdlSVkR.js → ReentrySimulation-BFhCb4sM.js} +1 -1
- package/dist-embed-ufoathome/{ReferenceSystem-B30-UBHY.js → ReferenceSystem-aZKW97nH.js} +1 -1
- package/dist-embed-ufoathome/{ScenarioReadings-EAUAsx9t.js → ScenarioReadings-_IkJEoIB.js} +1 -1
- package/dist-embed-ufoathome/{ScenarioSweep-jTxLjnaW.js → ScenarioSweep-DOvp2pYT.js} +1 -1
- package/dist-embed-ufoathome/{SearchlightEditor-B6_BW8FD.js → SearchlightEditor-C8Jwy1VZ.js} +1 -1
- package/dist-embed-ufoathome/{SearchlightSystem-D_DTpDNC.js → SearchlightSystem-D2TFaVqO.js} +1 -1
- package/dist-embed-ufoathome/{ShareDialogElement-C0oFh0X4.js → ShareDialogElement-Dsc4v4jd.js} +12 -12
- package/dist-embed-ufoathome/Sighting-C1yj2-s5.js +1 -0
- package/dist-embed-ufoathome/{SightingElement-DzxTvvLN.js → SightingElement-CFItfa0b.js} +2 -2
- package/dist-embed-ufoathome/{TraceSystem-CiBRo1aU.js → TraceSystem-_cZ6PZho.js} +1 -1
- package/dist-embed-ufoathome/{VideoButton-BseBKx2r.js → VideoButton-CeAdEi2m.js} +1 -1
- package/dist-embed-ufoathome/rr0-ufoathome.mjs +2 -2
- package/dist-embed-ufoathome/{surroundingsSources-BSh42KUu.js → surroundingsSources-B7gbT2Pb.js} +1 -1
- package/dist-embed-ufoathome/{trafficRuntime-BMTtwn7o.js → trafficRuntime-BKNJgPC4.js} +1 -1
- package/package.json +1 -1
- package/dist-embed-ufoathome/Sighting-BX_CmDY2.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Q as w,aO as M,z as g,L as c,aP as y,M as k,K as O,B as T,a as b,P as E,ac as I}from"./three.module-CbaHqYFq.js";import{R as d}from"./ReferenceTimeline-2kBldQeG.js";import{g as D}from"./GeoProjection-DvqDbRIx.js";import{P as m,a as f}from"./PictureFetch-C3wgf1ZV.js";import{b4 as x}from"./ShareDialogElement-
|
|
1
|
+
import{Q as w,aO as M,z as g,L as c,aP as y,M as k,K as O,B as T,a as b,P as E,ac as I}from"./three.module-CbaHqYFq.js";import{R as d}from"./ReferenceTimeline-2kBldQeG.js";import{g as D}from"./GeoProjection-DvqDbRIx.js";import{P as m,a as f}from"./PictureFetch-C3wgf1ZV.js";import{b4 as x}from"./ShareDialogElement-Dsc4v4jd.js";import"./rr0-ufoathome.mjs";import"./Sighting-C1yj2-s5.js";import"./VisualAids-DI-hEL46.js";import"./SaidPosition-OJEYhVKN.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";const v=x.reference,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=D(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 y(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 k(r.geometryOf(t,i),new O({map:i.texture,transparent:!0,depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1})),t.kind==="panorama"&&(e.material.side=T),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 b(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 I;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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as y,q as k,$ as h}from"./rr0-ufoathome.mjs";import{ScenarioSweep as j}from"./ScenarioSweep-
|
|
1
|
+
import{P as y,q as k,$ as h}from"./rr0-ufoathome.mjs";import{ScenarioSweep as j}from"./ScenarioSweep-DOvp2pYT.js";import"./ShareDialogElement-Dsc4v4jd.js";import"./Sighting-C1yj2-s5.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";import"./CaseEditorElement-CPt1laCe.js";import"./ParameterForm-XbqxCLRn.js";import"./ColumnResize-D6vA9JBg.js";import"./PoherSelfCheck-DnXcStjH.js";import"./PoherMatrix-C2fcLqDH.js";import"./TimelineTracks-Daaqw9ly.js";import"./ReentryArchive-CeXHrU7L.js";import"./ReferenceTimeline-2kBldQeG.js";import"./upperAirSources-BU0pD84c.js";import"./Account-C4jhsVtN.js";import"./SatellitePasses-Pfro2-0Z.js";class b{static fileName(c,n){const t=c.replace(/\.json$/,""),d=n.placeId.replace(/[^A-Za-z0-9-]+/g,"-"),p=n.local.replace(/[-:]/g,"").replace("T","-");return`${t}-scenario-${d}-${p}.json`}static recording(c,n,t,d,p,i={}){const a=structuredClone(c),r=y.strip(c).recording,l=a.interpretation;if(!l||!r.interpretation)throw new Error(`${n} states no interpretation`);a.id=`${r.id??n.replace(/\.json$/,"")}-scenario-${t.id}`,t.ownPlace||(a.place={value:{...t.placeName?{name:t.placeName}:{},locations:[{lat:t.lat,lng:t.lng}]},basis:"assumed",rationale:`one of the candidate places of the case, played as scenario ${t.id}${i.placeRationale?`: ${i.placeRationale}`:""}`},delete a.snapshots);const e=r.time?r.time.replace(/[~?%]$/,"").slice(0,16):void 0;return t.local!==e&&(a.time={value:`${t.local}:00`,basis:"assumed",rationale:`one of the candidate instants of the case, played as scenario ${t.id}${i.timeRationale?`: ${i.timeRationale}`:""}`}),delete a.image,d&&b.rewind(l,r.interpretation,d,t,p),l.scenario={id:t.id,of:n,...i.verdict?{verdict:i.verdict}:{}},i.title!==void 0&&(l.title=i.title),a}static rewind(c,n,t,d,p){const i={at:e=>h.at(t,e),levels:t.levels.map(e=>e.aboveGroundM)},a=e=>`${e} archived at ${t.hour} UTC at this place (${t.credit}, grid point ${t.lat.toFixed(3)}, ${t.lng.toFixed(3)}): established given scenario ${d.id} only`;for(const e of p){const f=k.itemsOf(n,e.key);if(!e.inWind||f.length===0)continue;const u=c[e.key];f.forEach((m,v)=>{const s=e.inWind(m,i);for(const o of Object.keys(s))JSON.stringify(s[o])!==JSON.stringify(m[o])&&(u[v][o]=o==="wind"?{value:s[o],basis:"established",rationale:a("the wind at the ground")}:s[o])})}const r=h.at(t,10),l=c.bodies;n.bodies.forEach((e,f)=>{if(!e.drifting)return;const u=j.drifted(e,r),m=l[f].track;!m||!u.track||u.track.forEach((v,s)=>{for(const o of["eastM","northM"]){const w=v[o];if(w===void 0)continue;const g=Math.round(w*100)/100,$=m[s][o];m[s][o]=typeof $=="object"&&$!==null&&"value"in $?{...$,value:g,...s===0?{rationale:a(`drifting with the wind at the ground, ${h.rounded(r).speedMS} m/s towards ${h.rounded(r).towardDeg}°,`)}:{}}:g}})})}}export{b as ScenarioReadings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as P,P as k,q as A,$ as N}from"./rr0-ufoathome.mjs";import{W as R,aS as O,a8 as $,ac as K}from"./ShareDialogElement-C0oFh0X4.js";import{S as y,C as S}from"./CaseEditorElement-BOp207Tr.js";import{SatellitePasses as T}from"./SatellitePasses-Pfro2-0Z.js";import"./Sighting-BX_CmDY2.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";import"./ParameterForm-XbqxCLRn.js";import"./ColumnResize-DnX89ynB.js";import"./PoherSelfCheck-pcYj_hQ1.js";import"./PoherMatrix-C2fcLqDH.js";import"./TimelineTracks-Daaqw9ly.js";import"./ReentryArchive-CeXHrU7L.js";import"./ReferenceTimeline-2kBldQeG.js";import"./upperAirSources-BU0pD84c.js";import"./Account-C4jhsVtN.js";class f{static MAX_SCENARIOS=200;static KM_PER_DEG=111.32;static merged(t,s){return t?s?{...t,...s}:t:s}static scenarios(t,s){const e=f.places(t,s?.places),a=f.instants(t,s?.time),n=[];for(const r of e)for(const i of a){const d=r.placeId==="own"&&i===f.minute(t.local);n.push({id:`${r.placeId}@${i}`,placeId:r.placeId,...r.placeName?{placeName:r.placeName}:{},lat:r.lat,lng:r.lng,local:i,date:f.utc(i,t.utcOffsetHours),own:d,ownPlace:r.placeId==="own"})}if(n.length>f.MAX_SCENARIOS)throw new Error(`${n.length} scenarios for one account: more than ${f.MAX_SCENARIOS}. Take a coarser step or fewer points.`);return n.sort((r,i)=>Number(i.own)-Number(r.own))}static places(t,s){const e={placeId:"own",...t.placeName?{placeName:t.placeName}:{},lat:t.lat,lng:t.lng},a=s?.own===!1?[]:[e],n=(s?.candidates??[]).filter(r=>!r.for||t.eventId===void 0||r.for.includes(t.eventId)).flatMap(r=>{const i=r.place.locations?.[0];return i?[{placeId:r.id,...r.place.name?{placeName:r.place.name}:{},lat:i.lat,lng:i.lng}]:[]});switch(s?.sweep??"bounds"){case"bounds":return[...a,...n];case"points":{const r=new Set(s?.points??[]);return[...a,...n.filter(i=>r.has(i.placeId))]}case"deltas":return[...a,...(s?.deltasKm??[]).filter(r=>r.eastKm!==0||r.northKm!==0).map(r=>({placeId:`own${r.eastKm>=0?"+":""}${r.eastKm},${r.northKm>=0?"+":""}${r.northKm}km`,...t.placeName?{placeName:t.placeName}:{},lat:t.lat+r.northKm/f.KM_PER_DEG,lng:t.lng+r.eastKm/(f.KM_PER_DEG*Math.cos(t.lat*Math.PI/180))}))];case"step":{const r=s?.stepKm;if(!r||r<=0)throw new Error("A sweep of places by step states its stepKm.");const i=[e,...n],d=Math.min(...i.map(u=>u.lat)),o=Math.max(...i.map(u=>u.lat)),l=Math.min(...i.map(u=>u.lng)),c=Math.max(...i.map(u=>u.lng)),h=f.KM_PER_DEG*Math.cos((d+o)/2*Math.PI/180),m=[];for(let u=0;d+u*r/f.KM_PER_DEG<=o+1e-9;u++)for(let p=0;l+p*r/h<=c+1e-9;p++){const g=d+u*r/f.KM_PER_DEG,v=l+p*r/h;m.push({placeId:`grid${g.toFixed(3)},${v.toFixed(3)}`,lat:g,lng:v})}return[...a,...m]}}}static instants(t,s){const e=f.minute(t.local);if(!s)return[e];const a=f.ms(e),n=f.ms(s.from),r=f.ms(s.to),i=s.each??"day",d=864e5,o=c=>{const h=[];if(i==="day"){const m=a+Math.ceil((n-a)/d)*d;for(let u=m;u<=r;u+=c)h.push(u)}else for(let m=n;m<=r;m+=c)h.push(m);return h};let l;switch(s.sweep??"bounds"){case"bounds":{const c=o(i==="day"?d:6e4);l=c.length>0?[c[0],c[c.length-1]]:[];break}case"points":l=(s.points??[]).map(c=>/T/.test(c)?f.ms(c):f.ms(`${c}T${e.slice(11)}`));break;case"step":l=o((s.stepMinutes??(i==="day"?1440:60))*6e4);break;case"deltas":l=[a,...(s.deltasMinutes??[]).map(c=>a+c*6e4)];break}return[...new Set(l)].sort((c,h)=>c-h).map(c=>new Date(c).toISOString().slice(0,16))}static ms(t){const s=t.replace(/[~?%]$/,"").replace(/(Z|[+-]\d\d:\d\d)$/,""),e=s.length===10?`${s}T00:00`:s,a=Date.parse(`${e}Z`);if(Number.isNaN(a))throw new Error(`Not an instant: ${t}`);return a}static minute(t){return new Date(f.ms(t)).toISOString().slice(0,16)}static utc(t,s){return new Date(f.ms(t)-s*36e5)}}class b{constructor(t){this.sources=t,this.model=t.model??R.MODELS[0]}static PLAUSIBLE=O.MEASURABLE;static DRAWN_STEP_MS=500;static STARS=6;static STAR_MAG=1.5;model;async sweep(t,s={}){const e=(t.events??[]).filter(o=>o.eventType===P.SIGHTING_EVENT&&!o.interpretationOf&&o.url).filter(o=>!s.accounts||o.id!==void 0&&s.accounts.includes(o.id)),a=[],n=await Promise.all(e.map(async o=>{const l=await this.sources.load(o.url),c=s.conditions??f.merged(t.conditions,k.strip(l).recording.conditions),h=f.scenarios(b.conditionsOf(l,o.id),c),m=[o.id,k.strip(l).recording.id].filter(p=>!!p),u=P.interpretationEvents(t,m).filter(p=>p.url&&(!s.readings||s.readings.includes(p.url)));return{event:o,accountJson:l,conditions:c,scenarios:h,readings:u}})),r=n.reduce((o,l)=>o+l.scenarios.length*(l.readings.length+(s.sky===!1?0:1)),0);let i=0;const d=()=>s.progress?.(++i,r);for(const{event:o,accountJson:l,conditions:c,scenarios:h,readings:m}of n){const u={...o.id?{eventId:o.id}:{},url:o.url,title:o.title,scenarios:h,readings:[],sky:[]},p=b.judges(l);for(const g of m){const v=await this.sources.load(g.url),w=k.strip(v).recording.interpretation;if(!w||w.scenario){h.forEach(d);continue}const M=await this.replay(g.url,g.title,w,h,p,d);M.kept=b.kept(M,s.keep??c?.keep??"telling"),u.readings.push(M)}if(s.sky!==!1){const g=await this.sky(l,h,d);u.sky=g.replays,g.note&&(u.skyNote=g.note)}a.push(u)}return{accounts:a,alerts:b.alerts(a)}}static conditionsOf(t,s){const e=k.strip(t).recording,a=e.place?.locations?.[0];if(!e.time||!a)throw new Error(`An account with no time or no place cannot be played elsewhere: ${e.id??s}`);return{...s?{eventId:s}:{},local:e.time,utcOffsetHours:e.utcOffsetHours??Math.round(a.lng/15),lat:a.lat,lng:a.lng,...e.place?.name?{placeName:e.place.name}:{}}}static judges(t){const s=O.forAccount(t),e=$(t),a=k.strip(t).recording.timeline?.keyframes??[],n=Math.max(0,...a.map(d=>d.t)),r=Array.from({length:Math.floor(n/b.DRAWN_STEP_MS)+1},(d,o)=>o*b.DRAWN_STEP_MS),i=K.lawsOf(R.MODELS[0],e.account?.conditions);return{said:s,drawn:new O(e,r,i)}}dependsOn(t){return this.sources.kinds.some(e=>e.inWind&&A.itemsOf(t,e.key).length>0)||t.bodies.some(e=>e.drifting)?["wind"]:[]}inWind(t,s){const e={at:n=>N.at(s,n),levels:s.levels.map(n=>n.aboveGroundM)},a={...t};for(const n of this.sources.kinds){const r=A.itemsOf(t,n.key);!n.inWind||r.length===0||(a[n.key]=r.map(i=>n.inWind(i,e)))}return a.bodies=t.bodies.map(n=>n.drifting?b.drifted(n,N.at(s,10)):n),a}static drifted(t,s){const e=t.track;if(!e||e.length<2)return t;const a=e[0],n=e[e.length-1],r=(n.t-a.t)/1e3;if(r<=0||a.eastM===void 0||n.eastM===void 0||a.northM===void 0||n.northM===void 0)return t;const[i,d]=N.vector(s),o=i-(n.eastM-a.eastM)/r,l=d-(n.northM-a.northM)/r;return{...t,track:e.map(c=>c.eastM===void 0||c.northM===void 0?c:{...c,eastM:c.eastM+o*(c.t-a.t)/1e3,northM:c.northM+l*(c.t-a.t)/1e3})}}async bodiesOf(t){return await A.load(t,this.sources.kinds),A.expand(t,this.sources.kinds).bodies}async replay(t,s,e,a,n,r){const i=this.dependsOn(e),d=m=>{const u=b.summary(n.said.comparisons(m)),p=b.summary(n.drawn.comparisons(m));return{said:u,drawn:p,plausible:b.plausible(u,p)}},o=d(await this.bodiesOf(e)),l=[];for(const m of a){if(r(),i.length===0){l.push({scenario:m,...o});continue}try{const u=await this.sources.wind.profile(m.lat,m.lng,m.date);l.push({scenario:m,...d(await this.bodiesOf(this.inWind(e,u))),groundWind:N.at(u,10)})}catch(u){l.push({scenario:m,...o,plausible:o.plausible,error:u.message})}}const c=l.filter(m=>!m.error),h=b.verdict(o.plausible?"plausible":"excluded",c.map(m=>({scenario:m.scenario,plausible:m.plausible})));return i.length===0&&(h.independent=!0),{url:t,title:s,depends:i,asWritten:o,outcomes:l,verdict:h,kept:[]}}static plausible(t,s){const e=t.compared>0?t:s;return e.compared>0&&e.agreedDirection/e.compared>=b.PLAUSIBLE}static summary(t){const s=t.filter(e=>e.separationDeg!==void 0).map(e=>e.separationDeg).sort((e,a)=>e-a);return{agreed:t.filter(e=>e.agrees).length,compared:t.length,agreedDirection:t.filter(e=>!e.contradicted?.includes("direction")).length,...s.length?{medianDeg:s[Math.floor(s.length/2)],worstDeg:s[s.length-1]}:{}}}static verdict(t,s){const e=s.filter(n=>n.plausible),a=s.length;return a===0?{robustness:t==="plausible"?"robust-plausible":"robust-exclusion",asWritten:t,holds:0,played:0,independent:!0}:e.length===a?{robustness:"robust-plausible",asWritten:t,holds:a,played:a}:e.length===0?{robustness:"robust-exclusion",asWritten:t,holds:0,played:a}:{robustness:"conditional",asWritten:t,onlyIf:b.onlyIf(s),holds:e.length,played:a}}static onlyIf(t){const s=n=>{const r=new Map;for(const d of t)r.set(n(d.scenario),[...r.get(n(d.scenario))??[],d.plausible]);const i=[...r.entries()];return i.every(([,d])=>d.every(o=>o)||d.every(o=>!o))?i.filter(([,d])=>d[0]).map(([d])=>d):void 0},e=s(n=>n.placeId);if(e&&new Set(t.map(n=>n.scenario.placeId)).size>1)return{places:e};const a=s(n=>n.local.slice(0,10));return a&&new Set(t.map(n=>n.scenario.local.slice(0,10))).size>1?{dates:a}:{scenarios:t.filter(n=>n.plausible).map(n=>n.scenario.id)}}static kept(t,s){if(s==="none"||t.verdict.independent)return[];const e=t.outcomes.filter(o=>!o.error);if(s==="all")return e.map(o=>o.scenario);const a=t.verdict.robustness!=="conditional";if(s==="robust"&&!a||s==="conditional"&&a)return[];const n=o=>{const l=o.said.compared>0?o.said:o.drawn;return(l.compared?l.agreedDirection/l.compared:0)-(l.medianDeg??180)/1e4},r=[...e].sort((o,l)=>n(l)-n(o));if(a){const o=t.verdict.robustness==="robust-plausible"?r[r.length-1]:r[0];return o?[o.scenario]:[]}const i=r.find(o=>o.plausible),d=[...r].reverse().find(o=>!o.plausible);return[i,d].filter(o=>!!o).map(o=>o.scenario)}async sky(t,s,e){const a=$(t),n=y.statement(a);if(!n)return s.forEach(e),{replays:[],note:"no-direction"};const{statement:r,t:i}=n,d=new S(this.model,a.account?.conditions,{dateShiftDays:[],mirror:!1}),o=p=>this.sources.names?.(p)??p,l=s.find(p=>p.own)??s[0],c={date:l.date,observer:{lat:l.lat,lng:l.lng,elevationM:0}},h=new Set(y.stars(c,i,r,this.sources.limitAt,b.STARS,b.STAR_MAG).map(({star:p})=>p.name)),m=new Map;for(const p of s){e();const g={date:p.date,observer:{lat:p.lat,lng:p.lng,elevationM:0}},v=[{track:y.body("Moon",o("Moon"),g,i,this.sources.limitAt),kind:"body"},...y.PLANETS.map(M=>({track:y.body(M,o(M),g,i,this.sources.limitAt),kind:"body"})),...y.stars(g,i,{...r,aim:void 0},this.sources.limitAt,1/0,b.STAR_MAG).filter(({star:M})=>h.has(M.name)).map(({star:M,track:D})=>({track:{...D,label:o(M.name)},kind:"star"}))],w=await this.issTrack(g,i);w&&v.push({track:w,kind:"satellite"});for(const{track:M,kind:D}of v){const I=d.fit(r,M);let E=m.get(M.id);E||(E={candidate:M.id,label:M.label,kind:D,outcomes:[],verdict:void 0},m.set(M.id,E)),E.outcomes.push({scenario:p,verdict:I.verdict,cost:I.cost,...I.reason?{reason:I.reason}:{}})}}const u=[...m.values()];for(const p of u){const g=p.outcomes.find(w=>w.scenario.own),v=g?g.verdict==="incompatible"?"excluded":"plausible":p.outcomes.every(w=>w.verdict==="incompatible")?"excluded":"plausible";p.verdict=b.verdict(v,p.outcomes.map(w=>({scenario:w.scenario,plausible:w.verdict!=="incompatible"})))}return{replays:u}}async issTrack(t,s){if(!this.sources.satellites)return;const a=(await this.sources.satellites(t.date).catch(()=>{}))?.find(r=>r.norad===y.ISS_NORAD);if(!a)return;const n=new T([a]);return y.satellite(`satellite-${a.norad}`,this.sources.names?.("ISS")??"ISS",r=>n.positionsAt(r,t.observer,-90).find(i=>i.object.norad===a.norad),t,s,this.sources.limitAt)}static alerts(t){return t.flatMap(s=>s.sky.filter(e=>e.kind!=="star"||e.verdict.robustness!=="robust-exclusion").map(e=>({...s.eventId?{eventId:s.eventId}:{},candidate:e.candidate,label:e.label,robustness:e.verdict.robustness,...e.verdict.onlyIf?{onlyIf:e.verdict.onlyIf}:{}})))}}export{b as ScenarioSweep};
|
|
1
|
+
import{C as P,P as k,q as A,$ as N}from"./rr0-ufoathome.mjs";import{W as R,aS as O,a8 as $,ac as K}from"./ShareDialogElement-Dsc4v4jd.js";import{S as y,C as S}from"./CaseEditorElement-CPt1laCe.js";import{SatellitePasses as T}from"./SatellitePasses-Pfro2-0Z.js";import"./Sighting-C1yj2-s5.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";import"./ParameterForm-XbqxCLRn.js";import"./ColumnResize-D6vA9JBg.js";import"./PoherSelfCheck-DnXcStjH.js";import"./PoherMatrix-C2fcLqDH.js";import"./TimelineTracks-Daaqw9ly.js";import"./ReentryArchive-CeXHrU7L.js";import"./ReferenceTimeline-2kBldQeG.js";import"./upperAirSources-BU0pD84c.js";import"./Account-C4jhsVtN.js";class f{static MAX_SCENARIOS=200;static KM_PER_DEG=111.32;static merged(t,s){return t?s?{...t,...s}:t:s}static scenarios(t,s){const e=f.places(t,s?.places),a=f.instants(t,s?.time),n=[];for(const r of e)for(const i of a){const d=r.placeId==="own"&&i===f.minute(t.local);n.push({id:`${r.placeId}@${i}`,placeId:r.placeId,...r.placeName?{placeName:r.placeName}:{},lat:r.lat,lng:r.lng,local:i,date:f.utc(i,t.utcOffsetHours),own:d,ownPlace:r.placeId==="own"})}if(n.length>f.MAX_SCENARIOS)throw new Error(`${n.length} scenarios for one account: more than ${f.MAX_SCENARIOS}. Take a coarser step or fewer points.`);return n.sort((r,i)=>Number(i.own)-Number(r.own))}static places(t,s){const e={placeId:"own",...t.placeName?{placeName:t.placeName}:{},lat:t.lat,lng:t.lng},a=s?.own===!1?[]:[e],n=(s?.candidates??[]).filter(r=>!r.for||t.eventId===void 0||r.for.includes(t.eventId)).flatMap(r=>{const i=r.place.locations?.[0];return i?[{placeId:r.id,...r.place.name?{placeName:r.place.name}:{},lat:i.lat,lng:i.lng}]:[]});switch(s?.sweep??"bounds"){case"bounds":return[...a,...n];case"points":{const r=new Set(s?.points??[]);return[...a,...n.filter(i=>r.has(i.placeId))]}case"deltas":return[...a,...(s?.deltasKm??[]).filter(r=>r.eastKm!==0||r.northKm!==0).map(r=>({placeId:`own${r.eastKm>=0?"+":""}${r.eastKm},${r.northKm>=0?"+":""}${r.northKm}km`,...t.placeName?{placeName:t.placeName}:{},lat:t.lat+r.northKm/f.KM_PER_DEG,lng:t.lng+r.eastKm/(f.KM_PER_DEG*Math.cos(t.lat*Math.PI/180))}))];case"step":{const r=s?.stepKm;if(!r||r<=0)throw new Error("A sweep of places by step states its stepKm.");const i=[e,...n],d=Math.min(...i.map(u=>u.lat)),o=Math.max(...i.map(u=>u.lat)),l=Math.min(...i.map(u=>u.lng)),c=Math.max(...i.map(u=>u.lng)),h=f.KM_PER_DEG*Math.cos((d+o)/2*Math.PI/180),m=[];for(let u=0;d+u*r/f.KM_PER_DEG<=o+1e-9;u++)for(let p=0;l+p*r/h<=c+1e-9;p++){const g=d+u*r/f.KM_PER_DEG,v=l+p*r/h;m.push({placeId:`grid${g.toFixed(3)},${v.toFixed(3)}`,lat:g,lng:v})}return[...a,...m]}}}static instants(t,s){const e=f.minute(t.local);if(!s)return[e];const a=f.ms(e),n=f.ms(s.from),r=f.ms(s.to),i=s.each??"day",d=864e5,o=c=>{const h=[];if(i==="day"){const m=a+Math.ceil((n-a)/d)*d;for(let u=m;u<=r;u+=c)h.push(u)}else for(let m=n;m<=r;m+=c)h.push(m);return h};let l;switch(s.sweep??"bounds"){case"bounds":{const c=o(i==="day"?d:6e4);l=c.length>0?[c[0],c[c.length-1]]:[];break}case"points":l=(s.points??[]).map(c=>/T/.test(c)?f.ms(c):f.ms(`${c}T${e.slice(11)}`));break;case"step":l=o((s.stepMinutes??(i==="day"?1440:60))*6e4);break;case"deltas":l=[a,...(s.deltasMinutes??[]).map(c=>a+c*6e4)];break}return[...new Set(l)].sort((c,h)=>c-h).map(c=>new Date(c).toISOString().slice(0,16))}static ms(t){const s=t.replace(/[~?%]$/,"").replace(/(Z|[+-]\d\d:\d\d)$/,""),e=s.length===10?`${s}T00:00`:s,a=Date.parse(`${e}Z`);if(Number.isNaN(a))throw new Error(`Not an instant: ${t}`);return a}static minute(t){return new Date(f.ms(t)).toISOString().slice(0,16)}static utc(t,s){return new Date(f.ms(t)-s*36e5)}}class b{constructor(t){this.sources=t,this.model=t.model??R.MODELS[0]}static PLAUSIBLE=O.MEASURABLE;static DRAWN_STEP_MS=500;static STARS=6;static STAR_MAG=1.5;model;async sweep(t,s={}){const e=(t.events??[]).filter(o=>o.eventType===P.SIGHTING_EVENT&&!o.interpretationOf&&o.url).filter(o=>!s.accounts||o.id!==void 0&&s.accounts.includes(o.id)),a=[],n=await Promise.all(e.map(async o=>{const l=await this.sources.load(o.url),c=s.conditions??f.merged(t.conditions,k.strip(l).recording.conditions),h=f.scenarios(b.conditionsOf(l,o.id),c),m=[o.id,k.strip(l).recording.id].filter(p=>!!p),u=P.interpretationEvents(t,m).filter(p=>p.url&&(!s.readings||s.readings.includes(p.url)));return{event:o,accountJson:l,conditions:c,scenarios:h,readings:u}})),r=n.reduce((o,l)=>o+l.scenarios.length*(l.readings.length+(s.sky===!1?0:1)),0);let i=0;const d=()=>s.progress?.(++i,r);for(const{event:o,accountJson:l,conditions:c,scenarios:h,readings:m}of n){const u={...o.id?{eventId:o.id}:{},url:o.url,title:o.title,scenarios:h,readings:[],sky:[]},p=b.judges(l);for(const g of m){const v=await this.sources.load(g.url),w=k.strip(v).recording.interpretation;if(!w||w.scenario){h.forEach(d);continue}const M=await this.replay(g.url,g.title,w,h,p,d);M.kept=b.kept(M,s.keep??c?.keep??"telling"),u.readings.push(M)}if(s.sky!==!1){const g=await this.sky(l,h,d);u.sky=g.replays,g.note&&(u.skyNote=g.note)}a.push(u)}return{accounts:a,alerts:b.alerts(a)}}static conditionsOf(t,s){const e=k.strip(t).recording,a=e.place?.locations?.[0];if(!e.time||!a)throw new Error(`An account with no time or no place cannot be played elsewhere: ${e.id??s}`);return{...s?{eventId:s}:{},local:e.time,utcOffsetHours:e.utcOffsetHours??Math.round(a.lng/15),lat:a.lat,lng:a.lng,...e.place?.name?{placeName:e.place.name}:{}}}static judges(t){const s=O.forAccount(t),e=$(t),a=k.strip(t).recording.timeline?.keyframes??[],n=Math.max(0,...a.map(d=>d.t)),r=Array.from({length:Math.floor(n/b.DRAWN_STEP_MS)+1},(d,o)=>o*b.DRAWN_STEP_MS),i=K.lawsOf(R.MODELS[0],e.account?.conditions);return{said:s,drawn:new O(e,r,i)}}dependsOn(t){return this.sources.kinds.some(e=>e.inWind&&A.itemsOf(t,e.key).length>0)||t.bodies.some(e=>e.drifting)?["wind"]:[]}inWind(t,s){const e={at:n=>N.at(s,n),levels:s.levels.map(n=>n.aboveGroundM)},a={...t};for(const n of this.sources.kinds){const r=A.itemsOf(t,n.key);!n.inWind||r.length===0||(a[n.key]=r.map(i=>n.inWind(i,e)))}return a.bodies=t.bodies.map(n=>n.drifting?b.drifted(n,N.at(s,10)):n),a}static drifted(t,s){const e=t.track;if(!e||e.length<2)return t;const a=e[0],n=e[e.length-1],r=(n.t-a.t)/1e3;if(r<=0||a.eastM===void 0||n.eastM===void 0||a.northM===void 0||n.northM===void 0)return t;const[i,d]=N.vector(s),o=i-(n.eastM-a.eastM)/r,l=d-(n.northM-a.northM)/r;return{...t,track:e.map(c=>c.eastM===void 0||c.northM===void 0?c:{...c,eastM:c.eastM+o*(c.t-a.t)/1e3,northM:c.northM+l*(c.t-a.t)/1e3})}}async bodiesOf(t){return await A.load(t,this.sources.kinds),A.expand(t,this.sources.kinds).bodies}async replay(t,s,e,a,n,r){const i=this.dependsOn(e),d=m=>{const u=b.summary(n.said.comparisons(m)),p=b.summary(n.drawn.comparisons(m));return{said:u,drawn:p,plausible:b.plausible(u,p)}},o=d(await this.bodiesOf(e)),l=[];for(const m of a){if(r(),i.length===0){l.push({scenario:m,...o});continue}try{const u=await this.sources.wind.profile(m.lat,m.lng,m.date);l.push({scenario:m,...d(await this.bodiesOf(this.inWind(e,u))),groundWind:N.at(u,10)})}catch(u){l.push({scenario:m,...o,plausible:o.plausible,error:u.message})}}const c=l.filter(m=>!m.error),h=b.verdict(o.plausible?"plausible":"excluded",c.map(m=>({scenario:m.scenario,plausible:m.plausible})));return i.length===0&&(h.independent=!0),{url:t,title:s,depends:i,asWritten:o,outcomes:l,verdict:h,kept:[]}}static plausible(t,s){const e=t.compared>0?t:s;return e.compared>0&&e.agreedDirection/e.compared>=b.PLAUSIBLE}static summary(t){const s=t.filter(e=>e.separationDeg!==void 0).map(e=>e.separationDeg).sort((e,a)=>e-a);return{agreed:t.filter(e=>e.agrees).length,compared:t.length,agreedDirection:t.filter(e=>!e.contradicted?.includes("direction")).length,...s.length?{medianDeg:s[Math.floor(s.length/2)],worstDeg:s[s.length-1]}:{}}}static verdict(t,s){const e=s.filter(n=>n.plausible),a=s.length;return a===0?{robustness:t==="plausible"?"robust-plausible":"robust-exclusion",asWritten:t,holds:0,played:0,independent:!0}:e.length===a?{robustness:"robust-plausible",asWritten:t,holds:a,played:a}:e.length===0?{robustness:"robust-exclusion",asWritten:t,holds:0,played:a}:{robustness:"conditional",asWritten:t,onlyIf:b.onlyIf(s),holds:e.length,played:a}}static onlyIf(t){const s=n=>{const r=new Map;for(const d of t)r.set(n(d.scenario),[...r.get(n(d.scenario))??[],d.plausible]);const i=[...r.entries()];return i.every(([,d])=>d.every(o=>o)||d.every(o=>!o))?i.filter(([,d])=>d[0]).map(([d])=>d):void 0},e=s(n=>n.placeId);if(e&&new Set(t.map(n=>n.scenario.placeId)).size>1)return{places:e};const a=s(n=>n.local.slice(0,10));return a&&new Set(t.map(n=>n.scenario.local.slice(0,10))).size>1?{dates:a}:{scenarios:t.filter(n=>n.plausible).map(n=>n.scenario.id)}}static kept(t,s){if(s==="none"||t.verdict.independent)return[];const e=t.outcomes.filter(o=>!o.error);if(s==="all")return e.map(o=>o.scenario);const a=t.verdict.robustness!=="conditional";if(s==="robust"&&!a||s==="conditional"&&a)return[];const n=o=>{const l=o.said.compared>0?o.said:o.drawn;return(l.compared?l.agreedDirection/l.compared:0)-(l.medianDeg??180)/1e4},r=[...e].sort((o,l)=>n(l)-n(o));if(a){const o=t.verdict.robustness==="robust-plausible"?r[r.length-1]:r[0];return o?[o.scenario]:[]}const i=r.find(o=>o.plausible),d=[...r].reverse().find(o=>!o.plausible);return[i,d].filter(o=>!!o).map(o=>o.scenario)}async sky(t,s,e){const a=$(t),n=y.statement(a);if(!n)return s.forEach(e),{replays:[],note:"no-direction"};const{statement:r,t:i}=n,d=new S(this.model,a.account?.conditions,{dateShiftDays:[],mirror:!1}),o=p=>this.sources.names?.(p)??p,l=s.find(p=>p.own)??s[0],c={date:l.date,observer:{lat:l.lat,lng:l.lng,elevationM:0}},h=new Set(y.stars(c,i,r,this.sources.limitAt,b.STARS,b.STAR_MAG).map(({star:p})=>p.name)),m=new Map;for(const p of s){e();const g={date:p.date,observer:{lat:p.lat,lng:p.lng,elevationM:0}},v=[{track:y.body("Moon",o("Moon"),g,i,this.sources.limitAt),kind:"body"},...y.PLANETS.map(M=>({track:y.body(M,o(M),g,i,this.sources.limitAt),kind:"body"})),...y.stars(g,i,{...r,aim:void 0},this.sources.limitAt,1/0,b.STAR_MAG).filter(({star:M})=>h.has(M.name)).map(({star:M,track:D})=>({track:{...D,label:o(M.name)},kind:"star"}))],w=await this.issTrack(g,i);w&&v.push({track:w,kind:"satellite"});for(const{track:M,kind:D}of v){const I=d.fit(r,M);let E=m.get(M.id);E||(E={candidate:M.id,label:M.label,kind:D,outcomes:[],verdict:void 0},m.set(M.id,E)),E.outcomes.push({scenario:p,verdict:I.verdict,cost:I.cost,...I.reason?{reason:I.reason}:{}})}}const u=[...m.values()];for(const p of u){const g=p.outcomes.find(w=>w.scenario.own),v=g?g.verdict==="incompatible"?"excluded":"plausible":p.outcomes.every(w=>w.verdict==="incompatible")?"excluded":"plausible";p.verdict=b.verdict(v,p.outcomes.map(w=>({scenario:w.scenario,plausible:w.verdict!=="incompatible"})))}return{replays:u}}async issTrack(t,s){if(!this.sources.satellites)return;const a=(await this.sources.satellites(t.date).catch(()=>{}))?.find(r=>r.norad===y.ISS_NORAD);if(!a)return;const n=new T([a]);return y.satellite(`satellite-${a.norad}`,this.sources.names?.("ISS")??"ISS",r=>n.positionsAt(r,t.observer,-90).find(i=>i.object.norad===a.norad),t,s,this.sources.limitAt)}static alerts(t){return t.flatMap(s=>s.sky.filter(e=>e.kind!=="star"||e.verdict.robustness!=="robust-exclusion").map(e=>({...s.eventId?{eventId:s.eventId}:{},candidate:e.candidate,label:e.label,robustness:e.verdict.robustness,...e.verdict.onlyIf?{onlyIf:e.verdict.onlyIf}:{}})))}}export{b as ScenarioSweep};
|
package/dist-embed-ufoathome/{SearchlightEditor-B6_BW8FD.js → SearchlightEditor-C8Jwy1VZ.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{M as c,_ as n}from"./rr0-ufoathome.mjs";import{b as g,P as d}from"./SaidPosition-OJEYhVKN.js";import{bq as r,bb as p}from"./ShareDialogElement-
|
|
1
|
+
import{M as c,_ as n}from"./rr0-ufoathome.mjs";import{b as g,P as d}from"./SaidPosition-OJEYhVKN.js";import{bq as r,bb as p}from"./ShareDialogElement-Dsc4v4jd.js";import{S as u}from"./SkyEventEditorStyle-CvY_AhbI.js";import{P as f,a as _,E}from"./ParameterForm-XbqxCLRn.js";import"./GeoProjection-DvqDbRIx.js";import"./Sighting-C1yj2-s5.js";import"./VisualAids-DI-hEL46.js";import"./three.module-CbaHqYFq.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";const v=c.catalog({en:()=>n(()=>import("./SearchlightParameterTexts_en-BwanYoMW.js"),[],import.meta.url).then(i=>i.searchlightParameterTexts_en),fr:()=>n(()=>import("./SearchlightParameterTexts_fr-B7eZQIdG.js"),[],import.meta.url).then(i=>i.searchlightParameterTexts_fr),es:()=>n(()=>import("./SearchlightParameterTexts_es-Cz_rg-Xe.js"),[],import.meta.url).then(i=>i.searchlightParameterTexts_es),it:()=>n(()=>import("./SearchlightParameterTexts_it-BjhuOJre.js"),[],import.meta.url).then(i=>i.searchlightParameterTexts_it)}),y=c.catalog({en:()=>n(()=>import("./SearchlightEditorMessages_en-BWTcGHYC.js"),[],import.meta.url).then(i=>i.searchlightEditorMessages_en),fr:()=>n(()=>import("./SearchlightEditorMessages_fr-CpaD2Il2.js"),[],import.meta.url).then(i=>i.searchlightEditorMessages_fr),es:()=>n(()=>import("./SearchlightEditorMessages_es-PS4IIWFS.js"),[],import.meta.url).then(i=>i.searchlightEditorMessages_es),it:()=>n(()=>import("./SearchlightEditorMessages_it-Br2IjowF.js"),[],import.meta.url).then(i=>i.searchlightEditorMessages_it)});class h{static time(t,e,s){return{type:"number",key:t,min:-36e3,max:36e3,step:1,unit:"s",scale:.001,label:e,hint:s,group:"when"}}static of(t){return t}static SET={kind:"searchlight",title:"searchlight",parameters:[{type:"said",key:"title",label:"name",group:"searchlight"},{type:"position",key:"lat",secondKey:"lng",saidKey:"saidPosition",native:"geo",step:1,label:"position",group:"searchlight"},{type:"number",key:"heightM",min:0,max:500,step:.5,unit:"m",label:"height",hint:"heightHint",group:"searchlight",effective:()=>r.DEFAULT_HEIGHT_M},{type:"number",key:"beams",min:1,max:r.MAX_BEAMS,step:1,label:"beams",hint:"beamsHint",group:"lamp",effective:()=>1},{type:"number",key:"intensityCd",min:1e4,max:1e10,step:1e6,unit:"cd",label:"intensity",hint:"intensityHint",group:"lamp",effective:()=>r.DEFAULT_INTENSITY_CD},{type:"number",key:"divergenceDeg",min:.1,max:20,step:.1,unit:"°",label:"divergence",hint:"divergenceHint",group:"lamp",effective:()=>r.DEFAULT_DIVERGENCE_DEG},{type:"number",key:"colourTemperatureK",min:2e3,max:1e4,step:100,unit:"K",label:"temperature",hint:"temperatureHint",group:"lamp",effective:()=>r.DEFAULT_TEMPERATURE_K},{type:"choice",key:"motion",label:"pattern",hint:"patternHint",group:"motion",effective:t=>r.motionOf(h.of(t)),choices:[{value:"fixed",label:"fixed"},{value:"sweep",label:"sweep"},{value:"rotate",label:"rotate"},{value:"cloverleaf",label:"cloverleaf"}]},{type:"number",key:"tiltDeg",min:0,max:85,step:1,unit:"°",label:"tilt",hint:"tiltHint",group:"motion",effective:()=>r.DEFAULT_TILT_DEG},{type:"number",key:"spreadDeg",min:0,max:360,step:1,unit:"°",label:"spread",hint:"spreadHint",group:"motion",effective:()=>r.DEFAULT_SPREAD_DEG,visibleWhen:t=>r.motionOf(h.of(t))==="sweep"},{type:"number",key:"azimuthDeg",min:0,max:360,step:1,unit:"°",label:"azimuth",hint:"azimuthHint",group:"motion",effective:()=>0},{type:"number",key:"periodS",min:.5,max:600,step:.5,unit:"s",label:"period",hint:"periodHint",group:"motion",effective:()=>r.DEFAULT_PERIOD_S,visibleWhen:t=>r.motionOf(h.of(t))!=="fixed"},h.time("fromT","from","fromHint"),h.time("untilT","until","untilHint")]};static publish(){g.publish(h.SET)}}class m{constructor(t,e,s){this.container=t,this.host=e,u.attach(t,"searchlight-editor-part",m.STYLE),this.language=s,g.of("searchlight")||h.publish(),this.ready=this.setLanguage(s)}messages;parameterTexts;ready;languageToken=0;currentId;form;list;language;shown=[];static STYLE=".searchlight-editor-part { flex-basis: 100%; min-width: 0; } .searchlight-editor-part .searchlight-editor, .searchlight-editor-part .searchlight-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; } .searchlight-editor-part #searchlight-list, .searchlight-editor-part .searchlight-fields { flex-basis: 100%; min-width: 0; } .searchlight-editor-part [hidden] { display: none !important; } .searchlight-editor-part .searchlight-intro { flex-basis: 100%; margin: 0; } .searchlight-editor-part .searchlight-parameters { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .searchlight-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; } .searchlight-editor-part input, .searchlight-editor-part select { max-width: 100%; box-sizing: border-box; } .searchlight-editor-part label { min-width: 0; max-width: 100%; } .searchlight-editor-part input.parameter-derived::placeholder { opacity: .65; }";async setLanguage(t){const e=++this.languageToken;this.language=t;const[s,l]=await Promise.all([y.load(t),v.load(t)]);e===this.languageToken&&(this.messages=s,this.parameterTexts=l,this.render(),this.sync())}sync(){if(!this.messages)return;const t=this.searchlights;this.shown=[...t],t.some(a=>a.id===this.currentId)||(this.currentId=t[0]?.id),this.list?.setItems(t.map(a=>({id:a.id,label:this.labelOf(a)})),this.currentId);const e=this.placeOfNew()!==void 0;this.list?.setAddState(e,e?void 0:this.messages.addNowhere);const s=this.current;if(this.element("searchlight-fields").hidden=s===void 0,!s)return;const l=d.resolve(g.of("searchlight"),this.parameterTexts);this.form??=new f(this.element("searchlight-parameters"),this.language,"",{said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()}),this.form.show(l,new _(()=>this.current,a=>{const o=this.current;o&&a(o)},void 0,this.host.positionPlace?.()),()=>this.host.changed())}refresh(){if(!this.messages)return;const t=this.searchlights;t.length===this.shown.length&&t.every((e,s)=>e===this.shown[s])||this.sync()}setTime(t){}get current(){return this.searchlights.find(t=>t.id===this.currentId)}render(){const t=this.messages;this.form=void 0,this.container.innerHTML=`<div class="searchlight-editor">
|
|
2
2
|
<p class="searchlight-intro">${t.intro}</p>
|
|
3
3
|
<div id="searchlight-list"></div>
|
|
4
4
|
<div id="searchlight-fields" class="searchlight-fields">
|
package/dist-embed-ufoathome/{SearchlightSystem-D_DTpDNC.js → SearchlightSystem-D2TFaVqO.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BeamSystem as L}from"./BeamSystem-
|
|
1
|
+
import{BeamSystem as L}from"./BeamSystem-BI4-w_0X.js";import{L as x}from"./LaserBeam-BGs1pXaE.js";import{bp as N,bq as r,br as U,t as D}from"./ShareDialogElement-Dsc4v4jd.js";import"./three.module-CbaHqYFq.js";import"./rr0-ufoathome.mjs";import"./Sighting-C1yj2-s5.js";import"./VisualAids-DI-hEL46.js";import"./SaidPosition-OJEYhVKN.js";import"./GeoProjection-DvqDbRIx.js";import"./Decor-Dn-cvniW.js";import"./RecordingIssue-BlWT8Xsu.js";import"./xyzImageryRaster-Dhxs0B26.js";import"./Obstacles-v9SkfBD7.js";class E{static APERTURE_M=.6;static NEAR_STEP_M=10;static FAR_STEP_M=250;static STEP_SHARE=.05;static CLOUD_STEP_M=25;static SPENT=.003;beams=new L;placed;lineOwners=[];constructor(){this.beams.group.name="searchlights"}get object(){return this.beams.group}get drawnCount(){return this.beams.drawnCount}update(a,s,t){const c=[],M=[];this.lineOwners=[];const i=t.clouds;i?i.dim(this.beams.material):N.apply(this.beams.material,[]);const l=t.wind??{eastMS:0,northMS:0};for(const o of r.onAt(a,s)){const A=this.whereOf(o,t.reference),g=t.origin.x+A.eastM*t.eastScale,d=t.origin.z-A.northM,u=t.groundYAt(g,d)+(o.heightM??r.DEFAULT_HEIGHT_M),e=o.intensityCd??r.DEFAULT_INTENSITY_CD,b=o.divergenceDeg??r.DEFAULT_DIVERGENCE_DEG,S=b*Math.PI/180,m=r.fluxLm(e,b),n=U.ofTemperature(o.colourTemperatureK??r.DEFAULT_TEMPERATURE_K),w=L.white(n);r.aimsAt(o,s).forEach((T,_)=>{const p=r.axisOf(T),h={x:p.east,y:p.up,z:-p.north},P={windAlongMS:l.eastMS*p.east+l.northMS*p.north,windAcrossMS:l.eastMS*p.north-l.northMS*p.east},{points:y,throughBelow:I}=this.walk({x:g,y:u,z:d},h,S,m,s,t,P);if(c.push({id:o.id,points:y,spectrum:w}),this.lineOwners.push({id:o.id,beam:_}),i&&h.y>.02&&i.bottomY>u){const v=(i.bottomY-u)/h.y,R=t.air.transmittance(t.siteElevationM+u,t.siteElevationM+i.bottomY,v),C=e*t.relativeScale;M.push({x:g,y:u,z:d,axis:h,fwhmRad:S,rgb:[C*n[0]*R[0],C*n[1]*R[1],C*n[2]*R[2]],throughCloudsBelow:I})}})}this.beams.drawLines(c,t),t.lightClouds?.(M)}walk(a,s,t,c,M,i,l){const o=i.clouds,A=[],g=[],d=[],u=i.siteElevationM+a.y;let e=0,b=0;for(;;){const m=a.x+s.x*e,n=a.y+s.y*e,w=a.z+s.z*e,T=o!==void 0&&n>=o.bottomY&&n<=o.topY,_=Math.exp(-b),p=e>0?i.air.transmittance(u,i.siteElevationM+n,e)[1]:1;if(A.push({x:m,y:n,z:w,altitudeM:i.siteElevationM+n,widthM:E.APERTURE_M+t*e,powerW:c*p*_,haze:x.patchAt(e,M,{...l,patchiness:x.DEFAULT_PATCHINESS})}),g.push(n),d.push(_),e>=r.RANGE_M||n>=r.CEILING_M||_<E.SPENT)break;const h=T?E.CLOUD_STEP_M:Math.min(E.FAR_STEP_M,Math.max(E.NEAR_STEP_M,e*E.STEP_SHARE));if(o&&(T||n<o.bottomY&&n+s.y*h>o.bottomY)){const P=T?h:Math.max(0,(o.bottomY-n)/Math.max(s.y,1e-6));if(!T){e+=Math.max(1,P);continue}b+=o.extinctionAt(m+s.x*h/2,n+s.y*h/2,w+s.z*h/2)*h}e+=h}return{points:A,throughBelow:m=>{const n=g.findIndex(w=>w>=m);return n<0?d[d.length-1]:d[n]}}}whereOf(a,s){(!this.placed||this.placed.lat!==s.lat||this.placed.lng!==s.lng)&&(this.placed={...s,at:new Map});let t=this.placed.at.get(a);if(!t){const c=D.ecef({lat:s.lat,lng:s.lng,heightM:0}),M=D.ecef({lat:a.lat,lng:a.lng,heightM:0}),i=s.lat*Math.PI/180,l=s.lng*Math.PI/180,o=[M[0]-c[0],M[1]-c[1],M[2]-c[2]];t={eastM:-Math.sin(l)*o[0]+Math.cos(l)*o[1],northM:-Math.sin(i)*Math.cos(l)*o[0]-Math.sin(i)*Math.sin(l)*o[1]+Math.cos(i)*o[2]},this.placed.at.set(a,t)}return t}pick(a,s,t){const c=this.beams.pickAt(a,s,t.toleranceRad);if(c)return{id:c.id,distanceM:c.distanceM,detail:{beam:(this.lineOwners[c.line]?.beam??0)+1}}}dispose(){this.beams.dispose()}}export{E as SearchlightSystem};
|