@rr0/ufoathome 0.124.0 → 0.125.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-interview/rr0-interview.mjs +8 -7
- package/dist-embed-scene/{AdsbLolArchiveProvider-Ju7E64iO.js → AdsbLolArchiveProvider-CL1XUape.js} +1 -1
- package/dist-embed-scene/{ContrailSystem-BlsY0hsn.js → ContrailSystem-CG5BhBF7.js} +1 -1
- package/dist-embed-scene/GLTFLoader-CowOlg4J.js +1 -0
- package/dist-embed-scene/{HeadlightSystem-k2VkX7hN.js → HeadlightSystem-OwCRe0Vs.js} +1 -1
- package/dist-embed-scene/RailwaySystem-usuVIAY1.js +41 -0
- package/dist-embed-scene/{RoadMarkings-Bd5i68iF.js → RoadMarkings-DbE4nCJ2.js} +1 -1
- package/dist-embed-scene/SceneNames_es-B9tudMDH.js +1 -0
- package/dist-embed-scene/SceneNames_fr-DAd-g0yB.js +1 -0
- package/dist-embed-scene/SceneNames_it-BLLX--oG.js +1 -0
- package/dist-embed-scene/{TraceSystem-D2DpL5Qj.js → TraceSystem-B9WBM9ut.js} +1 -1
- package/dist-embed-scene/WaterSystem-yC8sKIc5.js +1 -0
- package/dist-embed-scene/rr0-scene.mjs +374 -334
- package/dist-embed-scene/sightingSchema-v2l1p6Ld.js +1 -0
- package/dist-embed-sighting/{AdsbLolArchiveProvider-BUE3bdCg.js → AdsbLolArchiveProvider-DvCD0VGc.js} +1 -1
- package/dist-embed-sighting/ContrailSystem-XVzDvxFV.js +1 -0
- package/dist-embed-sighting/GLTFLoader-DjN5_ISf.js +1 -0
- package/dist-embed-sighting/{HeadlightSystem-DmXqrF-e.js → HeadlightSystem-BAkFE-MU.js} +1 -1
- package/dist-embed-sighting/RailwaySystem-BMOTAo7T.js +41 -0
- package/dist-embed-sighting/{RoadMarkings-C_046g21.js → RoadMarkings-DtoEUDmh.js} +1 -1
- package/dist-embed-sighting/SceneNames_es-VHJ-mGWu.js +1 -0
- package/dist-embed-sighting/SceneNames_fr-BtjbcaRx.js +1 -0
- package/dist-embed-sighting/SceneNames_it-Ck8f90Z6.js +1 -0
- package/dist-embed-sighting/{SightingMessages_es-C88y-33t.js → SightingMessages_es-OXYzPf-m.js} +1 -1
- package/dist-embed-sighting/{SightingMessages_fr-DC2iwVp3.js → SightingMessages_fr-ylqIoox7.js} +1 -1
- package/dist-embed-sighting/{SightingMessages_it-B5t71z1M.js → SightingMessages_it-B9f92W5s.js} +1 -1
- package/dist-embed-sighting/{TraceSystem-DxQWm8ZH.js → TraceSystem-DpokUmzt.js} +2 -2
- package/dist-embed-sighting/WaterSystem-BLt9Dsxc.js +1 -0
- package/dist-embed-sighting/rr0-sighting.mjs +379 -339
- package/dist-embed-sighting/sightingSchema-v2l1p6Ld.js +1 -0
- package/dist-embed-sighting-editor/{AdsbLolArchiveProvider-CFgVABcu.js → AdsbLolArchiveProvider-BtbGVTLo.js} +1 -1
- package/dist-embed-sighting-editor/{BodyEditor-Dg97ZrRa.js → BodyEditor-DinH26FA.js} +1 -1
- package/dist-embed-sighting-editor/ContrailSystem-Bh3PmOP9.js +1 -0
- package/dist-embed-sighting-editor/{CoverageAssessor-8zrC-ZY0.js → CoverageAssessor-DCGCl8ic.js} +1 -1
- package/dist-embed-sighting-editor/{GLTFLoader-RPFGUAaO.js → GLTFLoader-Bpggnw6G.js} +1 -1
- package/dist-embed-sighting-editor/{HeadlightSystem-DbRok2GO.js → HeadlightSystem-DOjC-oxf.js} +1 -1
- package/dist-embed-sighting-editor/HynekAssessor-DTuaJ9gE.js +1 -0
- package/dist-embed-sighting-editor/{InterviewEditorElement-DRjEJwEk.js → InterviewEditorElement-BRL8pvdi.js} +8 -7
- package/dist-embed-sighting-editor/{LaunchEditor-byu9U1W7.js → LaunchEditor-CFmH6y0N.js} +1 -1
- package/dist-embed-sighting-editor/ModelSource-SZRN-dar.js +1 -0
- package/dist-embed-sighting-editor/{ModelThumbnails-hmPAkRbd.js → ModelThumbnails-6N7NAP44.js} +1 -1
- package/dist-embed-sighting-editor/{ModelViewer-Mvug9CHB.js → ModelViewer-C_mVYZ1c.js} +1 -1
- package/dist-embed-sighting-editor/RailwaySystem-BTm6OfuJ.js +41 -0
- package/dist-embed-sighting-editor/{RoadMarkings-BKfyWjdC.js → RoadMarkings-AaLPDthv.js} +1 -1
- package/dist-embed-sighting-editor/SceneNames_es-4pppn42v.js +1 -0
- package/dist-embed-sighting-editor/SceneNames_fr-odZ6uYWU.js +1 -0
- package/dist-embed-sighting-editor/SceneNames_it-lXfB7y6i.js +1 -0
- package/dist-embed-sighting-editor/{SightingEditorMessages_es-DvIK6dPp.js → SightingEditorMessages_es-1QZ2n8km.js} +2 -2
- package/dist-embed-sighting-editor/{SightingEditorMessages_fr-Ds1GsY_1.js → SightingEditorMessages_fr-DAg8lRfr.js} +2 -2
- package/dist-embed-sighting-editor/{SightingEditorMessages_it-Y2D8aYCY.js → SightingEditorMessages_it-C2TQ7muu.js} +2 -2
- package/dist-embed-sighting-editor/{SightingFileEditor-C0NC8jbz.js → SightingFileEditor-7inIgp24.js} +1 -1
- package/dist-embed-sighting-editor/{TraceSystem-BMYhHoF0.js → TraceSystem-D8oL7SlQ.js} +2 -2
- package/dist-embed-sighting-editor/WaterSystem-1r0jEJ6E.js +1 -0
- package/dist-embed-sighting-editor/{caseSchema-BDFgjA8v.js → caseSchema-ByeWR3Rx.js} +1 -1
- package/dist-embed-sighting-editor/{interviewSchema-CMRZUnRy.js → interviewSchema-m_h5f8H0.js} +1 -1
- package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +403 -425
- package/dist-embed-sighting-editor/sightingSchema-v2l1p6Ld.js +1 -0
- package/dist-embed-sighting-editor/surroundingsSources-98rSCu2Y.js +1 -0
- package/dist-embed-sighting-editor/{trafficRuntime-BtljEizX.js → trafficRuntime-Dk4XdgcY.js} +1 -1
- package/package.json +3 -1
- package/dist-embed-scene/GLTFLoader-BHGcTcu1.js +0 -1
- package/dist-embed-scene/SceneNames_es-b8rqu51e.js +0 -1
- package/dist-embed-scene/SceneNames_fr-sF9gfZV2.js +0 -1
- package/dist-embed-scene/SceneNames_it-CoR2S3bM.js +0 -1
- package/dist-embed-scene/sightingSchema-kkSSrggd.js +0 -1
- package/dist-embed-sighting/ContrailSystem-DjBzEFUl.js +0 -1
- package/dist-embed-sighting/GLTFLoader-DvLBfH-C.js +0 -1
- package/dist-embed-sighting/SceneNames_es-rKjN2baM.js +0 -1
- package/dist-embed-sighting/SceneNames_fr-CSUSeZT0.js +0 -1
- package/dist-embed-sighting/SceneNames_it-C-mVddAw.js +0 -1
- package/dist-embed-sighting/sightingSchema-kkSSrggd.js +0 -1
- package/dist-embed-sighting-editor/ContrailSystem-DSdLswxr.js +0 -1
- package/dist-embed-sighting-editor/HynekAssessor-9gYrshkH.js +0 -1
- package/dist-embed-sighting-editor/ModelSource-f1GhdDou.js +0 -1
- package/dist-embed-sighting-editor/SceneNames_es-cN-l95fv.js +0 -1
- package/dist-embed-sighting-editor/SceneNames_fr-ZUtpsigH.js +0 -1
- package/dist-embed-sighting-editor/SceneNames_it-DLqJc0Rc.js +0 -1
- package/dist-embed-sighting-editor/sightingSchema-kkSSrggd.js +0 -1
- package/dist-embed-sighting-editor/surroundingsSources-BtDVuj-U.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
class
|
|
2
|
-
`).replace(/<\/?[a-z][^>]*>/gi,"").replace(/&#x([0-9a-f]+);/gi,(r,t)=>String.fromCodePoint(parseInt(t,16))).replace(/&#(\d+);/g,(r,t)=>String.fromCodePoint(Number(t))).replace(/&(\w+);/g,(r,t)=>
|
|
1
|
+
class b{constructor(e){this.preferences=e}read(e){if(e===void 0||typeof e=="string")return e===""?void 0:e;for(const t of this.preferences){const s=e[t]??e[b.base(t)];if(s)return s}const r=new Set(this.preferences.map(t=>b.base(t)));for(const[t,s]of Object.entries(e))if(s&&r.has(b.base(t)))return s;return Object.values(e).find(t=>t)??void 0}write(e,r,t){const s=r?.trim()?r.trim():void 0;if(e===void 0||typeof e=="string")return s;const i={...e},c=Object.keys(i).find(a=>a===t)??Object.keys(i).find(a=>b.base(a)===b.base(t))??t;return s===void 0?delete i[c]:i[c]=s,Object.keys(i).length===0?void 0:i}static base(e){return e.toLowerCase().split("-")[0]}}class k extends Error{constructor(e,r,t){super(`${e}: ${r}${t===void 0?"":` (HTTP ${t})`}`),this.kind=e,this.url=r,this.status=t,this.name="SightingFetchError"}}class y{static async json(e){const r=new URL(e,location.href);if(location.protocol==="https:"&&r.protocol==="http:")throw new k("mixed-content",e);let t;try{t=await fetch(e)}catch{throw await this.diagnose(e,r)}if(!t.ok)throw new k("status",e,t.status);try{return await t.json()}catch{throw new k("malformed",e)}}static async diagnose(e,r){if(r.origin===location.origin)return new k("unreachable",e);try{return await fetch(e,{mode:"no-cors"}),new k("cors",e)}catch{return new k("unreachable",e)}}}function C(d,e){for(const r of d){const t=r.toLowerCase().split("-")[0];if(e.includes(t))return t}return"en"}class ${static preferencesFor(e){const r=navigator.languages??[],t=this.declaredFor(e);return t?[t,...r]:r}static declaredFor(e){for(let r=e;r;){const t=r.closest("[lang]")?.getAttribute("lang")?.trim();if(t)return t;const s=r.getRootNode();r=s instanceof ShadowRoot?s.host:void 0}}}const z="modulepreload",x=function(d,e){return new URL(d,e).href},S={},L=function(e,r,t){let s=Promise.resolve();if(r&&r.length>0){let c=function(h){return Promise.all(h.map(o=>Promise.resolve(o).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const a=document.getElementsByTagName("link"),p=document.querySelector("meta[property=csp-nonce]"),w=p?.nonce||p?.getAttribute("nonce");s=c(r.map(h=>{if(h=x(h,t),h in S)return;S[h]=!0;const o=h.endsWith(".css"),f=o?'[rel="stylesheet"]':"";if(!!t)for(let g=a.length-1;g>=0;g--){const E=a[g];if(E.href===h&&(!o||E.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${f}`))return;const l=document.createElement("link");if(l.rel=o?"stylesheet":z,o||(l.as="script"),l.crossOrigin="",l.href=h,w&&l.setAttribute("nonce",w),document.head.appendChild(l),o)return new Promise((g,E)=>{l.addEventListener("load",g),l.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${h}`)))})}))}function i(c){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=c,window.dispatchEvent(a),!a.defaultPrevented)throw c}return s.then(c=>{for(const a of c||[])a.status==="rejected"&&i(a.reason);return e().catch(i)})},j=["en","fr","es","it"],U={en:()=>L(()=>Promise.resolve().then(()=>V),void 0,import.meta.url).then(d=>d.interviewMessages_en),fr:()=>L(()=>import("./InterviewMessages_fr-CmScqfza.js"),[],import.meta.url).then(d=>d.interviewMessages_fr),es:()=>L(()=>import("./InterviewMessages_es-D5d2JVA3.js"),[],import.meta.url).then(d=>d.interviewMessages_es),it:()=>L(()=>import("./InterviewMessages_it-2SNw5xMp.js"),[],import.meta.url).then(d=>d.interviewMessages_it)};function H(d){return U[d]()}const M={title:"Title",time:"When",by:"Interviewer",medium:"Medium",witness:"Witness",witnessNone:"—",summary:"Description",transcript:"Transcript",transcriptHint:"Address of the anonymised transcript file (optional)",summaryTab:"Summary",fileTab:"File",importFile:"Load a file (JSON, text, WebVTT, SRT)",importUrl:"Or load from URL",importButton:"Load",saveButton:"Save",loading:"Loading the transcript…",invalid:"This text is not valid JSON yet: the interview keeps the last transcript it understood.",notATranscript:"That file is not an interview transcript (it has no segments).",loadFailed:"That transcript could not be read.",editorLabel:"Interview transcript as JSON",byHint:"RR0 people ids, separated by commas",exchangesTab:"Exchanges",exchangesEmpty:"Nothing was said yet.",redacted:"Passage removed",proofreadAll:"Proofread by everyone.",proofreadPending:"Not proofread yet by: {names}",roles:{interviewer:"Interviewer",interviewee:"Interviewee",witness:"Witness"}},V=Object.freeze(Object.defineProperty({__proto__:null,interviewMessages_en:M},Symbol.toStringTag,{value:"Module"})),B="interviewseek";class u{static isProofread(e){const r=Object.keys(e.speakers);return r.length>0&&r.every(t=>{const s=e.proofreading?.[t]?.status;return s==="approved"||s==="covered"})}static said(e){return e.parts?e.parts.map(r=>"redacted"in r?"…":u.plain(r.text)).join(" "):e.redacted?void 0:u.plain(e.text??"")}static ENTITIES={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};static plain(e){return/[<&]/.test(e)?e.replace(/<br\s*\/?>/gi,`
|
|
2
|
+
`).replace(/<\/?[a-z][^>]*>/gi,"").replace(/&#x([0-9a-f]+);/gi,(r,t)=>String.fromCodePoint(parseInt(t,16))).replace(/&#(\d+);/g,(r,t)=>String.fromCodePoint(Number(t))).replace(/&(\w+);/g,(r,t)=>u.ENTITIES[t.toLowerCase()]??r):e}static sightingsOf(e){return[e.interviewOf].flat().filter(r=>typeof r=="string")}static passagesAbout(e,r){const t=u.sightingsOf(e),s=[];return e.segments.forEach((i,c)=>{for(const a of i.refs??[]){if(a.sighting===void 0?!t.includes(r):a.sighting!==r)continue;const p=u.said(i);s.push({index:c,speaker:i.speaker,at:a.at,...p!==void 0?{text:p}:{},...a.range?{range:a.range}:{}})}}),s.sort((i,c)=>i.at-c.at||i.index-c.index)}static clock(e,r=!1){const t=Math.round(e*10),s=Math.floor(t/10),i=p=>String(p).padStart(2,"0"),c=Math.floor(s/3600),a=`${c>0||r?i(Math.floor(s/60)%60):Math.floor(s/60)}:${i(s%60)}`;return`${c>0?`${c}:`:""}${a}${r||t%10!==0?`.${t%10}`:""}`}static speakerName(e,r){const t=e.speakers[r];if(!t)return r;const s=typeof t.title=="string"?t.title:t.title?Object.values(t.title)[0]:void 0;return s||t.by&&u.agentName(t.by)||t.role}static agentName(e){if("people"in e){const[r,...t]=e.people.replace(/([a-z])([A-Z])/g,"$1 $2").split(" ");return[...t,r].join(" ")}return"org"in e?e.org:e.title??""}static stamp(e){const r=Math.round(e*1e3),t=(s,i=2)=>String(s).padStart(i,"0");return`${t(Math.floor(r/36e5))}:${t(Math.floor(r/6e4)%60)}:${t(Math.floor(r/1e3)%60)}.${t(r%1e3,3)}`}static toVtt(e){const r=i=>i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),t=e.segments.filter(i=>i.start!==void 0);return`WEBVTT
|
|
3
3
|
|
|
4
|
-
${t.map((
|
|
5
|
-
<v ${r(
|
|
4
|
+
${t.map((i,c)=>{const a=t[c+1],p=i.end??a?.start??i.start+5,w=a&&a.start<p?Math.max(i.start,a.start):p;return`${u.stamp(i.start)} --> ${u.stamp(w)}
|
|
5
|
+
<v ${r(u.speakerName(e,i.speaker))}>${r(u.said(i)??"[…]")}`}).join(`
|
|
6
6
|
|
|
7
7
|
`)}
|
|
8
|
-
`}}const
|
|
8
|
+
`}}class n{static svg(e){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${e}" fill="currentColor"/></svg>`}static outline(e){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${e}" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round" stroke-linecap="round"/></svg>`}static solid(e){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${e}" fill="currentColor" fill-rule="evenodd"/></svg>`}static BOOKMARK="M6 3.5h12a.5.5 0 0 1 .5.5v16.5L12 16.8l-6.5 3.7V4a.5.5 0 0 1 .5-.5z";static PICTURE="M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z";static PICTURE_HILLS="M4.5 17.5l4.5-6 3 4 2.5-3 5 5z";static PIN="M12 21.5s-6.5-5.7-6.5-10.8a6.5 6.5 0 0 1 13 0c0 5.1-6.5 10.8-6.5 10.8z";static PIN_HOLE="M12 8.4a2.4 2.4 0 1 0 0 4.8 2.4 2.4 0 0 0 0-4.8z";static MILESTONES_OFF=n.outline(n.BOOKMARK);static MILESTONES_ON=n.solid(n.BOOKMARK);static PICTURES_OFF=n.outline(`${n.PICTURE}${n.PICTURE_HILLS}`);static PICTURES_ON=n.solid(`${n.PICTURE}${n.PICTURE_HILLS}`);static TRACE_LINE="M3 19.5l2.2-2.2 1.4 1.4L4.4 20.9zM8 14.5l2.2-2.2 1.4 1.4-2.2 2.2zM13 9.5l2.2-2.2 1.4 1.4-2.2 2.2z";static TRACE_MARK="M18.5 2.5l3.5 3.5-3.5 3.5-3.5-3.5z";static TRACES_OFF=n.outline(`${n.TRACE_LINE}${n.TRACE_MARK}`);static TRACES_ON=n.solid(`${n.TRACE_LINE}${n.TRACE_MARK}`);static MAP_OFF=n.outline(`${n.PIN}${n.PIN_HOLE}`);static MAP_ON=n.solid(`${n.PIN}${n.PIN_HOLE}`);static SHARE=n.outline("M14 4l7 7-7 7v-4.2C8.6 13.8 5.4 15.6 3.5 19c.6-5.6 3.4-9.6 10.5-10.8V4z");static FOLDED=n.svg("M15.4 7.4 14 6l-6 6 6 6 1.4-1.4L10.8 12z");static UNFOLDED=n.svg("M8.6 16.6 10 18l6-6-6-6-1.4 1.4 4.6 4.6z");static PLAY=n.svg("M7.4 5v14l11-7z");static PAUSE=n.svg("M6 5h4v14H6zM14 5h4v14h-4z");static VOLUME=n.svg("M2 9.5v5h3.5l4.5 4.5V5L5.5 9.5H2zm12.5 2.5A4 4 0 0 0 12.5 8.5v7A4 4 0 0 0 14.5 12zM12.5 4.2v2.1a6.5 6.5 0 0 1 0 11.4v2.1a8.6 8.6 0 0 0 0-15.6z");static MUTED=n.svg("M2 9.5v5h3.5l4.5 4.5V5L5.5 9.5H2zM15 9.8l1.4-1.4 2.6 2.6 2.6-2.6 1.4 1.4-2.6 2.6 2.6 2.6-1.4 1.4-2.6-2.6-2.6 2.6-1.4-1.4 2.6-2.6z");static ENTER_FULLSCREEN=n.svg("M5 5h5v2H7v3H5V5zm9 0h5v5h-2V7h-3V5zM5 14h2v3h3v2H5v-5zm12 0h2v5h-5v-2h3v-3z");static EXIT_FULLSCREEN=n.svg("M8 5h2v5H5V8h3V5zm6 0h2v3h3v2h-5V5zM5 14h5v5H8v-3H5v-2zm9 0h5v2h-3v3h-2v-5z")}const O="rr0-interview",F=`
|
|
9
9
|
rr0-interview { display: block; --rr0-interview-line: color-mix(in srgb, currentColor 35%, transparent); }
|
|
10
10
|
rr0-interview [hidden] { display: none !important; }
|
|
11
11
|
rr0-interview .rr0-interview-status { font-size: .85em; opacity: .85; margin: 0 0 .5em; }
|
|
@@ -30,5 +30,6 @@ rr0-interview .bar::after { content: attr(data-tip); display: none; position: ab
|
|
|
30
30
|
rr0-interview .bar:hover::after, rr0-interview .bar:focus::after { display: block; }
|
|
31
31
|
rr0-interview .turn .refs { display: flex; flex-wrap: wrap; gap: .25em; }
|
|
32
32
|
rr0-interview .turn .ref { font: inherit; font-size: .8em; cursor: pointer; border: 1px solid var(--rr0-interview-line); border-radius: 999px; background: transparent; color: inherit;
|
|
33
|
-
padding: 0 .35em; font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
34
|
-
|
|
33
|
+
padding: 0 .35em; font-variant-numeric: tabular-nums; white-space: nowrap; display: inline-flex; align-items: center; gap: .15em; }
|
|
34
|
+
rr0-interview .turn .ref svg { width: 1.1em; height: 1.1em; }
|
|
35
|
+
`;class R extends HTMLElement{messages=M;said=new b(["en"]);localeToken=0;loadToken=0;json;loading;base;status=document.createElement("p");turns=document.createElement("div");blocks=new Map;constructor(){super(),this.status.className="rr0-interview-status",this.status.setAttribute("role","status"),this.turns.className="rr0-interview-turns"}static get observedAttributes(){return["src"]}attributeChangedCallback(e,r,t){e==="src"&&t!==r&&this.isConnected&&this.load()}connectedCallback(){R.styleRoot(this.getRootNode()),this.contains(this.turns)||this.replaceChildren(this.status,this.turns),this.loadLocale(),this.hasAttribute("src")&&this.json===void 0&&this.loading!==this.getAttribute("src")&&this.load()}get interview(){return this.json}set interview(e){this.loadToken++,this.json=e,this.draw()}set documentUrl(e){this.base=e}static styleRoot(e){const r=e instanceof ShadowRoot?e:document.head;if(r.querySelector("style[data-rr0-interview]"))return;const t=document.createElement("style");t.dataset.rr0Interview="",t.textContent=F,r.append(t)}async load(){const e=this.getAttribute("src"),r=++this.loadToken;if(this.loading=e??void 0,!e)return;const t=new URL(e,location.href).href;let s;try{s=await y.json(t)}catch{s=void 0}r===this.loadToken&&(this.base=t,this.json=s,this.draw())}async loadLocale(){const e=++this.localeToken,r=$.preferencesFor(this),t=C(r,j),s=t==="en"?M:await H(t);e===this.localeToken&&(this.said=new b(r),this.messages=s,this.draw())}speakerName(e,r){const t=u.speakerName(e,r),s=e.speakers?.[r]?.role;return t===s&&s in this.messages.roles?this.messages.roles[s]:t}seek(e){const r=this.json,t={sighting:e.sighting??u.sightingsOf(r)[0],at:e.at};this.dispatchEvent(new CustomEvent(B,{bubbles:!0,composed:!0,detail:t}));const s=this.getAttribute("player");if(!s)return;const c=this.getRootNode().getElementById?.(s);typeof c?.seekTo=="function"&&(c.scrollIntoView?.({block:"center",behavior:"smooth"}),c.seekTo(t.at,t.sighting))}gap(e,r){const t=document.createElement(r),s=document.createElement("span");s.className="bar";const i=`${this.messages.redacted} : ${this.said.read(e)??""}`;return s.dataset.tip=i,s.tabIndex=0,s.setAttribute("role","img"),s.setAttribute("aria-label",i),t.append(s),t}saidNodes(e){if(!/[<&]/.test(e))return[document.createTextNode(e)];const r=document.createElement("template");r.innerHTML=e;for(const t of r.content.querySelectorAll("*")){if(["SCRIPT","STYLE","IFRAME","OBJECT","EMBED"].includes(t.tagName)){t.remove();continue}for(const s of[...t.attributes])if(/^on/i.test(s.name)||/^\s*javascript:/i.test(s.value))t.removeAttribute(s.name);else if(["href","src"].includes(s.name))try{s.value=new URL(s.value,this.base??location.href).href}catch{}}return[...r.content.childNodes]}draw(){const e=this.messages,r=this.json;this.blocks.clear();const t=Array.isArray(r?.segments)?r.segments:[];if(!r||t.length===0){this.status.hidden=!0;const o=document.createElement("p");o.textContent=e.exchangesEmpty,this.turns.replaceChildren(o);return}const s=r.speakers??{},i=Object.keys(s);if(r.proofreading){const o=i.filter(f=>!["approved","covered"].includes(r.proofreading?.[f]?.status??""));this.status.textContent=o.length===0?e.proofreadAll:e.proofreadPending.replace("{names}",o.map(f=>this.speakerName(r,f)).join(", ")),this.status.hidden=!1}else this.status.hidden=!0;const c=[];let a,p=!1,w,h;t.forEach((o,f)=>{const T=o.redacted?JSON.stringify(o.redacted.reason):void 0;if(T!==void 0&&w?.reason===T){this.blocks.set(f,w.block),o.speaker!==h&&(h=void 0);return}const l=document.createElement("div");l.className="turn",l.dataset.segment=String(f);const g=document.createElement("div");g.className="who";const E=document.createElement("span");if(E.textContent=o.redacted?"":this.speakerName(r,o.speaker),o.start!==void 0&&(l.dataset.time=u.clock(o.start,!0)),h!==o.speaker&&(a=document.createElement("div"),a.className="intervention",a.style.setProperty("--speaker-hue",String((Math.max(0,i.indexOf(o.speaker))*67+210)%360)),c.push(a),p=!1),o.redacted||(p&&l.classList.add("goes-on"),p=!0),a.append(l),h=o.speaker,g.append(E),o.redacted){l.classList.add("is-redacted");const v=this.gap(o.redacted.reason,"p");v.className="redacted",w={block:l,reason:T},l.append(g,v)}else{const v=document.createElement("p");if(v.className="said",o.parts){let N="";for(const m of o.parts){const A="redacted"in m?"▮":u.plain(m.text);/[\p{L}\p{N}.,;:!?)»”…▮]$/u.test(N)&&/^[\p{L}\p{N}(«“▮]/u.test(A)&&v.append(" "),"redacted"in m?v.append(this.gap(m.redacted.reason,"span")):v.append(...this.saidNodes(m.text)),N=A}}else v.append(...this.saidNodes(o.text??""));w=void 0,l.append(g,v)}if(o.refs?.length){const v=document.createElement("div");v.className="refs";for(const N of o.refs){const m=document.createElement("button");m.type="button",m.className="ref",m.innerHTML=n.PLAY,m.append(u.clock(N.at,!0)),m.addEventListener("click",()=>this.seek(N)),v.append(m)}l.append(v)}this.blocks.set(f,l)}),this.turns.replaceChildren(...c)}revealSegment(e){const r=this.blocks.get(e);r&&(r.scrollIntoView?.({block:"center"}),r.classList.add("flash"),window.setTimeout(()=>r.classList.remove("flash"),1600))}}function _(){customElements.get(O)||customElements.define(O,R)}_();
|
package/dist-embed-scene/{AdsbLolArchiveProvider-Ju7E64iO.js → AdsbLolArchiveProvider-CL1XUape.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{O as M,Q as y,a as I}from"./rr0-scene.mjs";class d{static RECORD_BYTES=20;static NON_ICAO_FLAG=1<<24;static UNKNOWN=65535;static MAX_DT=35999;static decode(t){if(t.length%d.RECORD_BYTES!==0)throw new Error(`An aircraft tile is a multiple of ${d.RECORD_BYTES} bytes, not ${t.length}`);const e=new DataView(t.buffer,t.byteOffset,t.byteLength),c=[];for(let n=0;n<t.length;n+=d.RECORD_BYTES){const s=e.getUint32(n,!0),a=e.getUint16(n+16,!0),r=e.getUint16(n+18,!0);c.push({icao:s&16777215,nonIcao:(s&d.NON_ICAO_FLAG)!==0,secondsInHour:e.getUint16(n+4,!0)/10,lat:e.getInt32(n+6,!0)/1e5,lng:e.getInt32(n+10,!0)/1e5,altitudeFt:e.getInt16(n+14,!0)*25,groundSpeedKt:a===d.UNKNOWN?void 0:a/10,trackDeg:r===d.UNKNOWN?void 0:r/10})}return c}}const w="https://ufoathome.org/aircraft/index.json";class f{citation=M;static DEFAULT_RADIUS_KM=150;static FLAG_MILITARY=1;static FLAG_PIA=4;static FLAG_LADD=8;static KM_PER_DEG=111.32;static HOUR_MS=36e5;fetchImpl;indexUrls;index;hours=new Map;tiles=new Map;shards=new Map;constructor(t={}){this.fetchImpl=t.fetchImpl??fetch.bind(globalThis),this.indexUrls=t.indexUrls??f.defaultIndexUrls()}static defaultIndexUrls(){const t=[];return typeof location<"u"&&/^https?:$/.test(location.protocol)&&t.push(new URL("/aircraft/index.json",location.href).href),t.includes(w)||t.push(w),t}mayCover(t){return y.mayCover(t)}async between(t,e,c,n=f.DEFAULT_RADIUS_KM){const s=await this.loadIndex();if(!s)return{status:"failed"};const a=[];for(let o=Math.floor(e/f.HOUR_MS);o<=Math.floor(c/f.HOUR_MS);o++)a.push(o);if(!a.every(o=>s.index.days.includes(f.dayOf(o))))return{status:"outside"};const r=f.tilesAround(t,n);try{const o=(await Promise.all(a.flatMap(u=>r.map(i=>this.tileOf(s.base,u,i))))).flat();return{status:"found",tracks:f.merge(o,t,e,c,n)}}catch{return{status:"failed"}}}async describe(t,e){const c=await this.loadIndex();if(!c)return;const n=t.icao.toString(16).padStart(6,"0"),s=t.nonIcao?"non-icao":n.slice(0,2),a=`${e}/${s}`;let r=this.shards.get(a);r||(r=this.fetchImpl(new URL(`${e}/aircraft/${s}.json`,c.base).href).then(g=>g.ok?g.json():{}).catch(()=>({})),this.shards.set(a,r));const o=(await r)[t.nonIcao?`~${n}`:n];if(!o)return;const[u,i,l,h=0]=o,p={registration:u||void 0,type:i||void 0,category:l||void 0,military:(h&f.FLAG_MILITARY)!==0||void 0,restricted:(h&(f.FLAG_PIA|f.FLAG_LADD))!==0||void 0};return Object.values(p).some(g=>g!==void 0)?p:void 0}static tilesAround(t,e){const c=e/f.KM_PER_DEG,n=Math.max(-90,t.lat-c),s=Math.min(90,t.lat+c),a=Math.cos(Math.max(Math.abs(n),Math.abs(s))*Math.PI/180),r=a<1e-6?180:e/(f.KM_PER_DEG*a),o=new Set;if(r>=180)for(let i=-180;i<180;i++)o.add(i);else for(let i=Math.floor(t.lng-r);i<=Math.floor(t.lng+r);i++)o.add(I.wrapLongitude(i));const u=[];for(let i=Math.floor(n);i<=Math.min(89,Math.floor(s));i++)for(const l of o)u.push(`${i}_${l}`);return u}static dayOf(t){return new Date(t*f.HOUR_MS).toISOString().slice(0,10)}static merge(t,e,c,n,s){const a=new Map;for(const o of t){const u=o.points.filter(h=>h.t>=c&&h.t<=n&&I.groundDistanceKm(e,h)<=s);if(u.length===0)continue;const i=`${o.nonIcao?"~":""}${o.icao}`,l=a.get(i);l?l.points.push(...u):a.set(i,{icao:o.icao,nonIcao:o.nonIcao,points:u})}const r=[...a.values()];for(const o of r)o.points.sort((u,i)=>u.t-i.t);return r.sort((o,u)=>o.icao-u.icao)}loadIndex(){return this.index??=(async()=>{for(const t of this.indexUrls)try{const e=await this.fetchImpl(t);if(e.ok)return{index:await e.json(),base:t}}catch{}})(),this.index}tileOf(t,e,c){const n=f.dayOf(e),s=String(e%24).padStart(2,"0"),a=`${n}/${s}/${c}`;let r=this.tiles.get(a);return r||(r=this.hourIndex(t,n,s).then(async o=>{const u=o[c];if(!u)return[];const[i,l]=u,h=await this.fetchImpl(new URL(`${n}/${s}.pack`,t).href,{headers:{Range:`bytes=${i}-${i+l-1}`}});if(!h.ok)throw new Error(`The pack of ${n} ${s} h answered ${h.status}`);const p=new Uint8Array(await h.arrayBuffer()),g=h.status===206?p:p.subarray(i,i+l);return f.tracksOf(await f.gunzip(g),e)}),r.catch(()=>this.tiles.delete(a)),this.tiles.set(a,r)),r}hourIndex(t,e,c){const n=`${e}/${c}`;let s=this.hours.get(n);return s||(s=this.fetchImpl(new URL(`${e}/${c}.json`,t).href).then(a=>{if(a.status===404)return{};if(!a.ok)throw new Error(`The index of ${e} ${c} h answered ${a.status}`);return a.json()}),s.catch(()=>this.hours.delete(n)),this.hours.set(n,s)),s}static async gunzip(t){const e=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip"));return new Uint8Array(await new Response(e).arrayBuffer())}static tracksOf(t,e){const c=new Map;for(const n of d.decode(t)){const s=`${n.nonIcao?"~":""}${n.icao}`;let a=c.get(s);a||c.set(s,a={icao:n.icao,nonIcao:n.nonIcao,points:[]}),a.points.push({t:e*f.HOUR_MS+n.secondsInHour*1e3,lat:n.lat,lng:n.lng,altitudeFt:n.altitudeFt,groundSpeedKt:n.groundSpeedKt,trackDeg:n.trackDeg})}return[...c.values()]}}export{f as AdsbLolArchiveProvider,w as UFOATHOME_AIRCRAFT_INDEX_URL};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as T,
|
|
1
|
+
import{G as T,B as A,d as N,b as w,y as G,z as O}from"./rr0-scene.mjs";import{C as z}from"./ContrailGrowth-CuAzwIoc.js";class f{static MAX_SEGMENTS=4e3;static MIN_PIXELS=2;static UNRESOLVED_CONTRAST=.5;static VERTICES_PER_SEGMENT=12;object;group=new T;trails=[];positions=new Float32Array(f.MAX_SEGMENTS*f.VERTICES_PER_SEGMENT*3);colors=new Float32Array(f.MAX_SEGMENTS*f.VERTICES_PER_SEGMENT*4);segments=0;constructor(){const t=new A;t.setAttribute("position",new N(this.positions,3)),t.setAttribute("color",new N(this.colors,4)),t.setDrawRange(0,0),this.object=new w(t,new G({vertexColors:!0,transparent:!0,depthWrite:!1,side:O})),this.object.frustumCulled=!1,this.object.name="contrails",this.group.name="contrails",this.group.add(this.object)}get segmentCount(){return this.segments}set(t){this.trails=t}update(t,s,r){let h=0;this.segments=0;for(const n of this.trails){const a=this.samplesOf(n,t,s),e=r(n.id);for(let c=0;c+1<a.length;c++){const o=a[c],p=a[c+1];if(!o.forms||!p.forms)continue;if(this.segments>=f.MAX_SEGMENTS)break;const l=this.pushSegment(h,o,p,n.spanM,e,s);l>h&&this.segments++,h=l}}const u=this.object.geometry;u.setDrawRange(0,h);for(const[n,a]of[["position",3],["color",4]]){const e=u.getAttribute(n);e.clearUpdateRanges(),h>0&&e.addUpdateRange(0,h*a),e.needsUpdate=!0}}samplesOf(t,s,r){const h=s-z.FORMATION_S*1e3,u=[],n=(o,p,l,d,m,y)=>({x:p+o.driftEastMs*m+r.origin.x,y:d,z:-(l+o.driftNorthMs*m)+r.origin.z,age:m,forms:y,point:o});let a=-1;t.points.forEach((o,p)=>{o.tMs>h||(a=p,u.push(n(o,o.eastM,o.northM,o.upM,(s-o.tMs)/1e3,o.forms)))});const e=t.points[a],c=t.points[a+1];if(e&&c){const o=(h-e.tMs)/(c.tMs-e.tMs),p=(l,d)=>l+(d-l)*o;u.push(n(e,p(e.eastM,c.eastM),p(e.northM,c.northM),p(e.upM,c.upM),z.FORMATION_S,e.forms&&c.forms))}return u}pushSegment(t,s,r,h,u,n){const a={persistent:s.point.persistent,lifetimeS:s.point.lifetimeS,spanM:h,shearPerS:s.point.shearPerS},e=z.opacity(s.age,a),c=z.opacity(r.age,a);if(e<=0&&c<=0)return t;const o={x:r.x-s.x,y:r.y-s.y,z:r.z-s.z};if(Math.hypot(o.x,o.y,o.z)<1e-6)return t;const p={x:(s.x+r.x)/2-n.eye.x,y:(s.y+r.y)/2-n.eye.y,z:(s.z+r.z)/2-n.eye.z},l=this.normalise(this.cross(o,p)),d=(i,M)=>{const g=Math.hypot(i.x-n.eye.x,i.y-n.eye.y,i.z-n.eye.z),E=z.widthM(h,i.age,i.point.shearPerS),R=Math.max(E,f.MIN_PIXELS*n.pixelRad*g);return{half:R/2,alpha:M*(E/R)**f.UNRESOLVED_CONTRAST}},m=[{sample:s,...d(s,e)},{sample:r,...d(r,c)}],y=(i,M)=>{const g=t*3;this.positions[g]=i.sample.x+l.x*i.half*M,this.positions[g+1]=i.sample.y+l.y*i.half*M,this.positions[g+2]=i.sample.z+l.z*i.half*M;const E=t*4;this.colors[E]=u[0],this.colors[E+1]=u[1],this.colors[E+2]=u[2],this.colors[E+3]=M===0?i.alpha:0,t++},[S,x]=m;for(const[i,M]of[[-1,0],[1,0]])y(S,i),y(S,M),y(x,i),y(S,M),y(x,M),y(x,i);return t}cross(t,s){return{x:t.y*s.z-t.z*s.y,y:t.z*s.x-t.x*s.z,z:t.x*s.y-t.y*s.x}}normalise(t){const s=Math.hypot(t.x,t.y,t.z)||1;return{x:t.x/s,y:t.y/s,z:t.z/s}}dispose(){this.object.geometry.dispose(),this.object.material.dispose(),this.group.removeFromParent()}}export{f as ContrailSystem};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{X as Le,Y as Q,Z as he,_ as Me,$ as v,a0 as de,M as w,V as pe,C as F,a1 as b,a2 as U,E as Se,a3 as ye,a4 as we,s as B,a5 as be,k as C,a6 as me,a7 as Ne,a8 as ge,a9 as Ie,aa as Oe,d as V,ab as Ce,ac as Te,ad as Fe,ae as Pe,af as He,ag as J,ah as Re,ai as Z,aj as ke,ak as De,P as Ge,al as X,am as ve,c as Ee,z as Ue,y as G,an as Be,B as Ke,ao as je,b as Ve,ap as Xe,aq as ze,ar as qe,u as We,G as z,as as Ye,t as Qe,at as Je,au as Ze,av as $e,aw as en,ax as nn,ay as tn,az as xe,h as sn,aA as ne,aB as te,aC as se,aD as ie,aE as re,aF as rn,aG as on,i as an,j as cn}from"./rr0-scene.mjs";function oe(f,n){if(n===Le)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),f;if(n===Q||n===he){let e=f.getIndex();if(e===null){const r=[],a=f.getAttribute("position");if(a!==void 0){for(let o=0;o<a.count;o++)r.push(o);f.setIndex(r),e=f.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),f}const s=e.count-2,t=[];if(n===Q)for(let r=1;r<=s;r++)t.push(e.getX(0)),t.push(e.getX(r)),t.push(e.getX(r+1));else for(let r=0;r<s;r++)r%2===0?(t.push(e.getX(r)),t.push(e.getX(r+1)),t.push(e.getX(r+2))):(t.push(e.getX(r+2)),t.push(e.getX(r+1)),t.push(e.getX(r)));t.length/3!==s&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const i=f.clone();return i.setIndex(t),i.clearGroups(),i}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",n),f}class jn extends Me{constructor(n){super(n),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new dn(e)}),this.register(function(e){return new pn(e)}),this.register(function(e){return new Ln(e)}),this.register(function(e){return new Mn(e)}),this.register(function(e){return new Sn(e)}),this.register(function(e){return new gn(e)}),this.register(function(e){return new Tn(e)}),this.register(function(e){return new Rn(e)}),this.register(function(e){return new En(e)}),this.register(function(e){return new hn(e)}),this.register(function(e){return new xn(e)}),this.register(function(e){return new mn(e)}),this.register(function(e){return new _n(e)}),this.register(function(e){return new An(e)}),this.register(function(e){return new ln(e)}),this.register(function(e){return new ae(e,g.EXT_MESHOPT_COMPRESSION)}),this.register(function(e){return new ae(e,g.KHR_MESHOPT_COMPRESSION)}),this.register(function(e){return new yn(e)})}load(n,e,s,t){const i=this;let r;if(this.resourcePath!=="")r=this.resourcePath;else if(this.path!==""){const c=v.extractUrlBase(n);r=v.resolveURL(c,this.path)}else r=v.extractUrlBase(n);this.manager.itemStart(n);const a=function(c){t?t(c):console.error(c),i.manager.itemError(n),i.manager.itemEnd(n)},o=new de(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(n,function(c){try{i.parse(c,r,function(u){e(u),i.manager.itemEnd(n)},a)}catch(u){a(u)}},s,a)}setDRACOLoader(n){return this.dracoLoader=n,this}setKTX2Loader(n){return this.ktx2Loader=n,this}setMeshoptDecoder(n){return this.meshoptDecoder=n,this}register(n){return this.pluginCallbacks.indexOf(n)===-1&&this.pluginCallbacks.push(n),this}unregister(n){return this.pluginCallbacks.indexOf(n)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(n),1),this}parse(n,e,s,t){let i;const r={},a={},o=new TextDecoder;if(typeof n=="string")i=JSON.parse(n);else if(n instanceof ArrayBuffer)if(o.decode(new Uint8Array(n,0,4))===Ae){try{r[g.KHR_BINARY_GLTF]=new wn(n)}catch(l){t&&t(l);return}i=JSON.parse(r[g.KHR_BINARY_GLTF].content)}else i=JSON.parse(o.decode(n));else i=n;if(i.asset===void 0||i.asset.version[0]<2){t&&t(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const c=new Un(i,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u<this.pluginCallbacks.length;u++){const l=this.pluginCallbacks[u](c);l.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[l.name]=l,r[l.name]=!0}if(i.extensionsUsed)for(let u=0;u<i.extensionsUsed.length;++u){const l=i.extensionsUsed[u],h=i.extensionsRequired||[];switch(l){case g.KHR_MATERIALS_UNLIT:r[l]=new fn;break;case g.KHR_DRACO_MESH_COMPRESSION:r[l]=new bn(i,this.dracoLoader);break;case g.KHR_TEXTURE_TRANSFORM:r[l]=new Nn;break;case g.KHR_MESH_QUANTIZATION:r[l]=new In;break;default:h.indexOf(l)>=0&&a[l]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+l+'".')}}c.setExtensions(r),c.setPlugins(a),c.parse(s,t)}parseAsync(n,e){const s=this;return new Promise(function(t,i){s.parse(n,e,t,i)})}}function un(){let f={};return{get:function(n){return f[n]},add:function(n,e){f[n]=e},remove:function(n){delete f[n]},removeAll:function(){f={}}}}function _(f,n,e){const s=f.json.materials[n];return s.extensions&&s.extensions[e]?s.extensions[e]:null}const g={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",KHR_MESHOPT_COMPRESSION:"KHR_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class ln{constructor(n){this.parser=n,this.name=g.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const n=this.parser,e=this.parser.json.nodes||[];for(let s=0,t=e.length;s<t;s++){const i=e[s];i.extensions&&i.extensions[this.name]&&i.extensions[this.name].light!==void 0&&n._addNodeRef(this.cache,i.extensions[this.name].light)}}_loadLight(n){const e=this.parser,s="light:"+n;let t=e.cache.get(s);if(t)return t;const i=e.json,o=((i.extensions&&i.extensions[this.name]||{}).lights||[])[n];let c;const u=new F(16777215);o.color!==void 0&&u.setRGB(o.color[0],o.color[1],o.color[2],b);const l=o.range!==void 0?o.range:0;switch(o.type){case"directional":c=new we(u),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new ye(u),c.distance=l;break;case"spot":c=new Se(u),c.distance=l,o.spot=o.spot||{},o.spot.innerConeAngle=o.spot.innerConeAngle!==void 0?o.spot.innerConeAngle:0,o.spot.outerConeAngle=o.spot.outerConeAngle!==void 0?o.spot.outerConeAngle:Math.PI/4,c.angle=o.spot.outerConeAngle,c.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return c.position.set(0,0,0),y(c,o),o.intensity!==void 0&&(c.intensity=o.intensity),c.name=e.createUniqueName(o.name||"light_"+n),t=Promise.resolve(c),e.cache.add(s,t),t}getDependency(n,e){if(n==="light")return this._loadLight(e)}createNodeAttachment(n){const e=this,s=this.parser,i=s.json.nodes[n],a=(i.extensions&&i.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(o){return s._getNodeRef(e.cache,a,o)})}}class fn{constructor(){this.name=g.KHR_MATERIALS_UNLIT}getMaterialType(){return G}extendParams(n,e,s){const t=[];n.color=new F(1,1,1),n.opacity=1;const i=e.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){const r=i.baseColorFactor;n.color.setRGB(r[0],r[1],r[2],b),n.opacity=r[3]}i.baseColorTexture!==void 0&&t.push(s.assignTexture(n,"map",i.baseColorTexture,U))}return Promise.all(t)}}class hn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);return s===null||s.emissiveStrength!==void 0&&(e.emissiveIntensity=s.emissiveStrength),Promise.resolve()}}class dn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_CLEARCOAT}getMaterialType(n){return _(this.parser,n,this.name)!==null?w:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];if(s.clearcoatFactor!==void 0&&(e.clearcoat=s.clearcoatFactor),s.clearcoatTexture!==void 0&&t.push(this.parser.assignTexture(e,"clearcoatMap",s.clearcoatTexture)),s.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=s.clearcoatRoughnessFactor),s.clearcoatRoughnessTexture!==void 0&&t.push(this.parser.assignTexture(e,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),s.clearcoatNormalTexture!==void 0&&(t.push(this.parser.assignTexture(e,"clearcoatNormalMap",s.clearcoatNormalTexture)),s.clearcoatNormalTexture.scale!==void 0)){const i=s.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new pe(i,i)}return Promise.all(t)}}class pn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_DISPERSION}getMaterialType(n){return _(this.parser,n,this.name)!==null?w:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);return s===null||(e.dispersion=s.dispersion!==void 0?s.dispersion:0),Promise.resolve()}}class mn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_IRIDESCENCE}getMaterialType(n){return _(this.parser,n,this.name)!==null?w:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];return s.iridescenceFactor!==void 0&&(e.iridescence=s.iridescenceFactor),s.iridescenceTexture!==void 0&&t.push(this.parser.assignTexture(e,"iridescenceMap",s.iridescenceTexture)),s.iridescenceIor!==void 0&&(e.iridescenceIOR=s.iridescenceIor),e.iridescenceThicknessRange===void 0&&(e.iridescenceThicknessRange=[100,400]),s.iridescenceThicknessMinimum!==void 0&&(e.iridescenceThicknessRange[0]=s.iridescenceThicknessMinimum),s.iridescenceThicknessMaximum!==void 0&&(e.iridescenceThicknessRange[1]=s.iridescenceThicknessMaximum),s.iridescenceThicknessTexture!==void 0&&t.push(this.parser.assignTexture(e,"iridescenceThicknessMap",s.iridescenceThicknessTexture)),Promise.all(t)}}class gn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_SHEEN}getMaterialType(n){return _(this.parser,n,this.name)!==null?w:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];if(e.sheenColor=new F(0,0,0),e.sheenRoughness=0,e.sheen=1,s.sheenColorFactor!==void 0){const i=s.sheenColorFactor;e.sheenColor.setRGB(i[0],i[1],i[2],b)}return s.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=s.sheenRoughnessFactor),s.sheenColorTexture!==void 0&&t.push(this.parser.assignTexture(e,"sheenColorMap",s.sheenColorTexture,U)),s.sheenRoughnessTexture!==void 0&&t.push(this.parser.assignTexture(e,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(t)}}class Tn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_TRANSMISSION}getMaterialType(n){return _(this.parser,n,this.name)!==null?w:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];return s.transmissionFactor!==void 0&&(e.transmission=s.transmissionFactor),s.transmissionTexture!==void 0&&t.push(this.parser.assignTexture(e,"transmissionMap",s.transmissionTexture)),Promise.all(t)}}class Rn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_VOLUME}getMaterialType(n){return _(this.parser,n,this.name)!==null?w:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];e.thickness=s.thicknessFactor!==void 0?s.thicknessFactor:0,s.thicknessTexture!==void 0&&t.push(this.parser.assignTexture(e,"thicknessMap",s.thicknessTexture)),e.attenuationDistance=s.attenuationDistance||1/0;const i=s.attenuationColor||[1,1,1];return e.attenuationColor=new F().setRGB(i[0],i[1],i[2],b),Promise.all(t)}}class En{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_IOR}getMaterialType(n){return _(this.parser,n,this.name)!==null?w:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);return s===null||(e.ior=s.ior!==void 0?s.ior:1.5,e.ior===0&&(e.ior=1e3)),Promise.resolve()}}class xn{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_SPECULAR}getMaterialType(n){return _(this.parser,n,this.name)!==null?w:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];e.specularIntensity=s.specularFactor!==void 0?s.specularFactor:1,s.specularTexture!==void 0&&t.push(this.parser.assignTexture(e,"specularIntensityMap",s.specularTexture));const i=s.specularColorFactor||[1,1,1];return e.specularColor=new F().setRGB(i[0],i[1],i[2],b),s.specularColorTexture!==void 0&&t.push(this.parser.assignTexture(e,"specularColorMap",s.specularColorTexture,U)),Promise.all(t)}}class An{constructor(n){this.parser=n,this.name=g.EXT_MATERIALS_BUMP}getMaterialType(n){return _(this.parser,n,this.name)!==null?w:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];return e.bumpScale=s.bumpFactor!==void 0?s.bumpFactor:1,s.bumpTexture!==void 0&&t.push(this.parser.assignTexture(e,"bumpMap",s.bumpTexture)),Promise.all(t)}}class _n{constructor(n){this.parser=n,this.name=g.KHR_MATERIALS_ANISOTROPY}getMaterialType(n){return _(this.parser,n,this.name)!==null?w:null}extendMaterialParams(n,e){const s=_(this.parser,n,this.name);if(s===null)return Promise.resolve();const t=[];return s.anisotropyStrength!==void 0&&(e.anisotropy=s.anisotropyStrength),s.anisotropyRotation!==void 0&&(e.anisotropyRotation=s.anisotropyRotation),s.anisotropyTexture!==void 0&&t.push(this.parser.assignTexture(e,"anisotropyMap",s.anisotropyTexture)),Promise.all(t)}}class Ln{constructor(n){this.parser=n,this.name=g.KHR_TEXTURE_BASISU}loadTexture(n){const e=this.parser,s=e.json,t=s.textures[n];if(!t.extensions||!t.extensions[this.name])return null;const i=t.extensions[this.name],r=e.options.ktx2Loader;if(!r){if(s.extensionsRequired&&s.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(n,i.source,r)}}class Mn{constructor(n){this.parser=n,this.name=g.EXT_TEXTURE_WEBP}loadTexture(n){const e=this.name,s=this.parser,t=s.json,i=t.textures[n];if(!i.extensions||!i.extensions[e])return null;const r=i.extensions[e],a=t.images[r.source];let o=s.textureLoader;if(a.uri){const c=s.options.manager.getHandler(a.uri);c!==null&&(o=c)}return s.loadTextureImage(n,r.source,o)}}class Sn{constructor(n){this.parser=n,this.name=g.EXT_TEXTURE_AVIF}loadTexture(n){const e=this.name,s=this.parser,t=s.json,i=t.textures[n];if(!i.extensions||!i.extensions[e])return null;const r=i.extensions[e],a=t.images[r.source];let o=s.textureLoader;if(a.uri){const c=s.options.manager.getHandler(a.uri);c!==null&&(o=c)}return s.loadTextureImage(n,r.source,o)}}class ae{constructor(n,e){this.name=e,this.parser=n}loadBufferView(n){const e=this.parser.json,s=e.bufferViews[n];if(s.extensions&&s.extensions[this.name]){const t=s.extensions[this.name],i=this.parser.getDependency("buffer",t.buffer),r=this.parser.options.meshoptDecoder;if(!r||!r.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return i.then(function(a){const o=t.byteOffset||0,c=t.byteLength||0,u=t.count,l=t.byteStride,h=new Uint8Array(a,o,c);return r.decodeGltfBufferAsync?r.decodeGltfBufferAsync(u,l,h,t.mode,t.filter).then(function(d){return d.buffer}):r.ready.then(function(){const d=new ArrayBuffer(u*l);return r.decodeGltfBuffer(new Uint8Array(d),u,l,h,t.mode,t.filter),d})})}else return null}}class yn{constructor(n){this.name=g.EXT_MESH_GPU_INSTANCING,this.parser=n}createNodeMesh(n){const e=this.parser.json,s=e.nodes[n];if(!s.extensions||!s.extensions[this.name]||s.mesh===void 0)return null;const t=e.meshes[s.mesh];for(const c of t.primitives)if(c.mode!==M.TRIANGLES&&c.mode!==M.TRIANGLE_STRIP&&c.mode!==M.TRIANGLE_FAN&&c.mode!==void 0)return null;const r=s.extensions[this.name].attributes,a=[],o={};for(const c in r)a.push(this.parser.getDependency("accessor",r[c]).then(u=>(o[c]=u,o[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(n)),Promise.all(a).then(c=>{const u=c.pop(),l=u.isGroup?u.children:[u],h=c[0].count,d=[];for(const p of l){const R=new B,m=new C,T=new me,A=new C(1,1,1),x=new be(p.geometry,p.material,h);for(let E=0;E<h;E++)o.TRANSLATION&&m.fromBufferAttribute(o.TRANSLATION,E),o.ROTATION&&T.fromBufferAttribute(o.ROTATION,E),o.SCALE&&A.fromBufferAttribute(o.SCALE,E),x.setMatrixAt(E,R.compose(m,T,A));for(const E in o)if(E==="_COLOR_0"){const L=o[E];x.instanceColor=new Ne(L.array,L.itemSize,L.normalized)}else E!=="TRANSLATION"&&E!=="ROTATION"&&E!=="SCALE"&&p.geometry.setAttribute(E,o[E]);ge.prototype.copy.call(x,p),this.parser.assignFinalMaterial(x),d.push(x)}return u.isGroup?(u.clear(),u.add(...d),u):d[0]}))}}const Ae="glTF",D=12,ce={JSON:1313821514,BIN:5130562};class wn{constructor(n){this.name=g.KHR_BINARY_GLTF,this.content=null,this.body=null;const e=new DataView(n,0,D),s=new TextDecoder;if(this.header={magic:s.decode(new Uint8Array(n.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==Ae)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const t=this.header.length-D,i=new DataView(n,D);let r=0;for(;r<t;){const a=i.getUint32(r,!0);r+=4;const o=i.getUint32(r,!0);if(r+=4,o===ce.JSON){const c=new Uint8Array(n,D+r,a);this.content=s.decode(c)}else if(o===ce.BIN){const c=D+r;this.body=n.slice(c,c+a)}r+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class bn{constructor(n,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=g.KHR_DRACO_MESH_COMPRESSION,this.json=n,this.dracoLoader=e,this.dracoLoader.preload()}decodePrimitive(n,e){const s=this.json,t=this.dracoLoader,i=n.extensions[this.name].bufferView,r=n.extensions[this.name].attributes,a={},o={},c={};for(const u in r){const l=$[u]||u.toLowerCase();a[l]=r[u]}for(const u in n.attributes){const l=$[u]||u.toLowerCase();if(r[u]!==void 0){const h=s.accessors[n.attributes[u]],d=H[h.componentType];c[l]=d.name,o[l]=h.normalized===!0}}return e.getDependency("bufferView",i).then(function(u){return new Promise(function(l,h){t.decodeDracoFile(u,function(d){for(const p in d.attributes){const R=d.attributes[p],m=o[p];m!==void 0&&(R.normalized=m)}l(d)},a,c,b,h)})})}}class Nn{constructor(){this.name=g.KHR_TEXTURE_TRANSFORM}extendTexture(n,e){return(e.texCoord===void 0||e.texCoord===n.channel)&&e.offset===void 0&&e.rotation===void 0&&e.scale===void 0||(n=n.clone(),e.texCoord!==void 0&&(n.channel=e.texCoord),e.offset!==void 0&&n.offset.fromArray(e.offset),e.rotation!==void 0&&(n.rotation=e.rotation),e.scale!==void 0&&n.repeat.fromArray(e.scale),n.needsUpdate=!0),n}}class In{constructor(){this.name=g.KHR_MESH_QUANTIZATION}}class _e extends on{constructor(n,e,s,t){super(n,e,s,t)}copySampleValue_(n){const e=this.resultBuffer,s=this.sampleValues,t=this.valueSize,i=n*t*3+t;for(let r=0;r!==t;r++)e[r]=s[i+r];return e}interpolate_(n,e,s,t){const i=this.resultBuffer,r=this.sampleValues,a=this.valueSize,o=a*2,c=a*3,u=t-e,l=(s-e)/u,h=l*l,d=h*l,p=n*c,R=p-c,m=-2*d+3*h,T=d-h,A=1-m,x=T-h+l;for(let E=0;E!==a;E++){const L=r[R+E+a],N=r[R+E+o]*u,S=r[p+E+a],k=r[p+E]*u;i[E]=A*L+x*N+m*S+T*k}return i}}const On=new me;class Cn extends _e{interpolate_(n,e,s,t){const i=super.interpolate_(n,e,s,t);return On.fromArray(i).normalize().toArray(i),i}}const M={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},H={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},ue={9728:Re,9729:J,9984:He,9985:Pe,9986:Fe,9987:Te},le={33071:De,33648:ke,10497:Z},q={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},$={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},I={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Fn={CUBICSPLINE:void 0,LINEAR:xe,STEP:tn},W={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Pn(f){return f.DefaultMaterial===void 0&&(f.DefaultMaterial=new Ee({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:rn})),f.DefaultMaterial}function O(f,n,e){for(const s in e.extensions)f[s]===void 0&&(n.userData.gltfExtensions=n.userData.gltfExtensions||{},n.userData.gltfExtensions[s]=e.extensions[s])}function y(f,n){n.extras!==void 0&&(typeof n.extras=="object"?Object.assign(f.userData,n.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+n.extras))}function Hn(f,n,e){let s=!1,t=!1,i=!1;for(let c=0,u=n.length;c<u;c++){const l=n[c];if(l.POSITION!==void 0&&(s=!0),l.NORMAL!==void 0&&(t=!0),l.COLOR_0!==void 0&&(i=!0),s&&t&&i)break}if(!s&&!t&&!i)return Promise.resolve(f);const r=[],a=[],o=[];for(let c=0,u=n.length;c<u;c++){const l=n[c];if(s){const h=l.POSITION!==void 0?e.getDependency("accessor",l.POSITION):f.attributes.position;r.push(h)}if(t){const h=l.NORMAL!==void 0?e.getDependency("accessor",l.NORMAL):f.attributes.normal;a.push(h)}if(i){const h=l.COLOR_0!==void 0?e.getDependency("accessor",l.COLOR_0):f.attributes.color;o.push(h)}}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(o)]).then(function(c){const u=c[0],l=c[1],h=c[2];return s&&(f.morphAttributes.position=u),t&&(f.morphAttributes.normal=l),i&&(f.morphAttributes.color=h),f.morphTargetsRelative=!0,f})}function kn(f,n){if(f.updateMorphTargets(),n.weights!==void 0)for(let e=0,s=n.weights.length;e<s;e++)f.morphTargetInfluences[e]=n.weights[e];if(n.extras&&Array.isArray(n.extras.targetNames)){const e=n.extras.targetNames;if(f.morphTargetInfluences.length===e.length){f.morphTargetDictionary={};for(let s=0,t=e.length;s<t;s++)f.morphTargetDictionary[e[s]]=s}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Dn(f){let n;const e=f.extensions&&f.extensions[g.KHR_DRACO_MESH_COMPRESSION];if(e?n="draco:"+e.bufferView+":"+e.indices+":"+Y(e.attributes):n=f.indices+":"+Y(f.attributes)+":"+f.mode,f.targets!==void 0)for(let s=0,t=f.targets.length;s<t;s++)n+=":"+Y(f.targets[s]);return n}function Y(f){let n="";const e=Object.keys(f).sort();for(let s=0,t=e.length;s<t;s++)n+=e[s]+":"+f[e[s]]+";";return n}function ee(f){switch(f){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function Gn(f){return f.search(/\.jpe?g($|\?)/i)>0||f.search(/^data\:image\/jpeg/)===0?"image/jpeg":f.search(/\.webp($|\?)/i)>0||f.search(/^data\:image\/webp/)===0?"image/webp":f.search(/\.ktx2($|\?)/i)>0||f.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const vn=new B;class Un{constructor(n={},e={}){this.json=n,this.extensions={},this.plugins={},this.options=e,this.cache=new un,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let s=!1,t=-1,i=!1,r=-1;if(typeof navigator<"u"&&typeof navigator.userAgent<"u"){const a=navigator.userAgent;s=/^((?!chrome|android).)*safari/i.test(a)===!0;const o=a.match(/Version\/(\d+)/);t=s&&o?parseInt(o[1],10):-1,i=a.indexOf("Firefox")>-1,r=i?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||s&&t<17||i&&r<98?this.textureLoader=new Ie(this.options.manager):this.textureLoader=new Oe(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new de(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(n){this.extensions=n}setPlugins(n){this.plugins=n}parse(n,e){const s=this,t=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(r){return r._markDefs&&r._markDefs()}),Promise.all(this._invokeAll(function(r){return r.beforeRoot&&r.beforeRoot()})).then(function(){return Promise.all([s.getDependencies("scene"),s.getDependencies("animation"),s.getDependencies("camera")])}).then(function(r){const a={scene:r[0][t.scene||0],scenes:r[0],animations:r[1],cameras:r[2],asset:t.asset,parser:s,userData:{}};return O(i,a,t),y(a,t),Promise.all(s._invokeAll(function(o){return o.afterRoot&&o.afterRoot(a)})).then(function(){for(const o of a.scenes)o.updateMatrixWorld();n(a)})}).catch(e)}_markDefs(){const n=this.json.nodes||[],e=this.json.skins||[],s=this.json.meshes||[];for(let t=0,i=e.length;t<i;t++){const r=e[t].joints;for(let a=0,o=r.length;a<o;a++)n[r[a]].isBone=!0}for(let t=0,i=n.length;t<i;t++){const r=n[t];r.mesh!==void 0&&(this._addNodeRef(this.meshCache,r.mesh),r.skin!==void 0&&(s[r.mesh].isSkinnedMesh=!0)),r.camera!==void 0&&this._addNodeRef(this.cameraCache,r.camera)}}_addNodeRef(n,e){e!==void 0&&(n.refs[e]===void 0&&(n.refs[e]=n.uses[e]=0),n.refs[e]++)}_getNodeRef(n,e,s){if(n.refs[e]<=1)return s;const t=s.clone(),i=(r,a)=>{const o=this.associations.get(r);o!=null&&this.associations.set(a,o);for(const[c,u]of r.children.entries())i(u,a.children[c])};return i(s,t),t.name+="_instance_"+n.uses[e]++,t}_invokeOne(n){const e=Object.values(this.plugins);e.push(this);for(let s=0;s<e.length;s++){const t=n(e[s]);if(t)return t}return null}_invokeAll(n){const e=Object.values(this.plugins);e.unshift(this);const s=[];for(let t=0;t<e.length;t++){const i=n(e[t]);i&&s.push(i)}return s}getDependency(n,e){const s=n+":"+e;let t=this.cache.get(s);if(!t){switch(n){case"scene":t=this.loadScene(e);break;case"node":t=this._invokeOne(function(i){return i.loadNode&&i.loadNode(e)});break;case"mesh":t=this._invokeOne(function(i){return i.loadMesh&&i.loadMesh(e)});break;case"accessor":t=this.loadAccessor(e);break;case"bufferView":t=this._invokeOne(function(i){return i.loadBufferView&&i.loadBufferView(e)});break;case"buffer":t=this.loadBuffer(e);break;case"material":t=this._invokeOne(function(i){return i.loadMaterial&&i.loadMaterial(e)});break;case"texture":t=this._invokeOne(function(i){return i.loadTexture&&i.loadTexture(e)});break;case"skin":t=this.loadSkin(e);break;case"animation":t=this._invokeOne(function(i){return i.loadAnimation&&i.loadAnimation(e)});break;case"camera":t=this.loadCamera(e);break;default:if(t=this._invokeOne(function(i){return i!=this&&i.getDependency&&i.getDependency(n,e)}),!t)throw new Error("Unknown type: "+n);break}this.cache.add(s,t)}return t}getDependencies(n){let e=this.cache.get(n);if(!e){const s=this,t=this.json[n+(n==="mesh"?"es":"s")]||[];e=Promise.all(t.map(function(i,r){return s.getDependency(n,r)})),this.cache.add(n,e)}return e}loadBuffer(n){const e=this.json.buffers[n],s=this.fileLoader;if(e.type&&e.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+e.type+" buffer type is not supported.");if(e.uri===void 0&&n===0)return Promise.resolve(this.extensions[g.KHR_BINARY_GLTF].body);const t=this.options;return new Promise(function(i,r){s.load(v.resolveURL(e.uri,t.path),i,void 0,function(){r(new Error('THREE.GLTFLoader: Failed to load buffer "'+e.uri+'".'))})})}loadBufferView(n){const e=this.json.bufferViews[n];return this.getDependency("buffer",e.buffer).then(function(s){const t=e.byteLength||0,i=e.byteOffset||0;return s.slice(i,i+t)})}loadAccessor(n){const e=this,s=this.json,t=this.json.accessors[n];if(t.bufferView===void 0&&t.sparse===void 0){const r=q[t.type],a=H[t.componentType],o=t.normalized===!0,c=new a(t.count*r);return Promise.resolve(new V(c,r,o))}const i=[];return t.bufferView!==void 0?i.push(this.getDependency("bufferView",t.bufferView)):i.push(null),t.sparse!==void 0&&(i.push(this.getDependency("bufferView",t.sparse.indices.bufferView)),i.push(this.getDependency("bufferView",t.sparse.values.bufferView))),Promise.all(i).then(function(r){const a=r[0],o=q[t.type],c=H[t.componentType],u=c.BYTES_PER_ELEMENT,l=u*o,h=t.byteOffset||0,d=t.bufferView!==void 0?s.bufferViews[t.bufferView].byteStride:void 0,p=t.normalized===!0;let R,m;if(d&&d!==l){const T=Math.floor(h/d),A="InterleavedBuffer:"+t.bufferView+":"+t.componentType+":"+T+":"+t.count;let x=e.cache.get(A);x||(R=new c(a,T*d,t.count*d/u),x=new Ce(R,d/u),e.cache.add(A,x)),m=new sn(x,o,h%d/u,p)}else a===null?R=new c(t.count*o):R=new c(a,h,t.count*o),m=new V(R,o,p);if(t.sparse!==void 0){const T=q.SCALAR,A=H[t.sparse.indices.componentType],x=t.sparse.indices.byteOffset||0,E=t.sparse.values.byteOffset||0,L=new A(r[1],x,t.sparse.count*T),N=new c(r[2],E,t.sparse.count*o);a!==null&&(m=new V(m.array.slice(),m.itemSize,m.normalized)),m.normalized=!1;for(let S=0,k=L.length;S<k;S++){const P=L[S];if(m.setX(P,N[S*o]),o>=2&&m.setY(P,N[S*o+1]),o>=3&&m.setZ(P,N[S*o+2]),o>=4&&m.setW(P,N[S*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}m.normalized=p}return m})}loadTexture(n){const e=this.json,s=this.options,i=e.textures[n].source,r=e.images[i];let a=this.textureLoader;if(r.uri){const o=s.manager.getHandler(r.uri);o!==null&&(a=o)}return this.loadTextureImage(n,i,a)}loadTextureImage(n,e,s){const t=this,i=this.json,r=i.textures[n],a=i.images[e],o=(a.uri||a.bufferView)+":"+r.sampler;if(this.textureCache[o])return this.textureCache[o];const c=this.loadImageSource(e,s).then(function(u){u.flipY=!1,u.name=r.name||a.name||"",u.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(u.name=a.uri);const h=(i.samplers||{})[r.sampler]||{};return u.magFilter=ue[h.magFilter]||J,u.minFilter=ue[h.minFilter]||Te,u.wrapS=le[h.wrapS]||Z,u.wrapT=le[h.wrapT]||Z,u.generateMipmaps=!u.isCompressedTexture&&u.minFilter!==Re&&u.minFilter!==J,t.associations.set(u,{textures:n}),u}).catch(function(){return null});return this.textureCache[o]=c,c}loadImageSource(n,e){const s=this,t=this.json,i=this.options;if(this.sourceCache[n]!==void 0)return this.sourceCache[n].then(l=>l.clone());const r=t.images[n],a=self.URL||self.webkitURL;let o=r.uri||"",c=!1;if(r.bufferView!==void 0)o=s.getDependency("bufferView",r.bufferView).then(function(l){c=!0;const h=new Blob([l],{type:r.mimeType});return o=a.createObjectURL(h),o});else if(r.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+n+" is missing URI and bufferView");const u=Promise.resolve(o).then(function(l){return new Promise(function(h,d){let p=h;e.isImageBitmapLoader===!0&&(p=function(R){const m=new ne(R);m.needsUpdate=!0,h(m)}),e.load(v.resolveURL(l,i.path),p,void 0,d)})}).then(function(l){return c===!0&&a.revokeObjectURL(o),y(l,r),l.userData.mimeType=r.mimeType||Gn(r.uri),l}).catch(function(l){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),l});return this.sourceCache[n]=u,u}assignTexture(n,e,s,t){const i=this;return this.getDependency("texture",s.index).then(function(r){if(!r)return null;if(s.texCoord!==void 0&&s.texCoord>0&&(r=r.clone(),r.channel=s.texCoord),i.extensions[g.KHR_TEXTURE_TRANSFORM]){const a=s.extensions!==void 0?s.extensions[g.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const o=i.associations.get(r);r=i.extensions[g.KHR_TEXTURE_TRANSFORM].extendTexture(r,a),i.associations.set(r,o)}}return t!==void 0&&(r.colorSpace=t),n[e]=r,r})}assignFinalMaterial(n){const e=n.geometry;let s=n.material;const t=e.attributes.tangent===void 0,i=e.attributes.color!==void 0,r=e.attributes.normal===void 0;if(n.isPoints){const a="PointsMaterial:"+s.uuid;let o=this.cache.get(a);o||(o=new Ge,X.prototype.copy.call(o,s),o.color.copy(s.color),o.map=s.map,o.sizeAttenuation=!1,this.cache.add(a,o)),s=o}else if(n.isLine){const a="LineBasicMaterial:"+s.uuid;let o=this.cache.get(a);o||(o=new ve,X.prototype.copy.call(o,s),o.color.copy(s.color),o.map=s.map,this.cache.add(a,o)),s=o}if(t||i||r){let a="ClonedMaterial:"+s.uuid+":";t&&(a+="derivative-tangents:"),i&&(a+="vertex-colors:"),r&&(a+="flat-shading:");let o=this.cache.get(a);o||(o=s.clone(),i&&(o.vertexColors=!0),r&&(o.flatShading=!0),t&&(o.normalScale&&(o.normalScale.y*=-1),o.clearcoatNormalScale&&(o.clearcoatNormalScale.y*=-1)),this.cache.add(a,o),this.associations.set(o,this.associations.get(s))),s=o}n.material=s}getMaterialType(){return Ee}loadMaterial(n){const e=this,s=this.json,t=this.extensions,i=s.materials[n];let r;const a={},o=i.extensions||{},c=[];if(o[g.KHR_MATERIALS_UNLIT]){const l=t[g.KHR_MATERIALS_UNLIT];r=l.getMaterialType(),c.push(l.extendParams(a,i,e))}else{const l=i.pbrMetallicRoughness||{};if(a.color=new F(1,1,1),a.opacity=1,Array.isArray(l.baseColorFactor)){const h=l.baseColorFactor;a.color.setRGB(h[0],h[1],h[2],b),a.opacity=h[3]}l.baseColorTexture!==void 0&&c.push(e.assignTexture(a,"map",l.baseColorTexture,U)),a.metalness=l.metallicFactor!==void 0?l.metallicFactor:1,a.roughness=l.roughnessFactor!==void 0?l.roughnessFactor:1,l.metallicRoughnessTexture!==void 0&&(c.push(e.assignTexture(a,"metalnessMap",l.metallicRoughnessTexture)),c.push(e.assignTexture(a,"roughnessMap",l.metallicRoughnessTexture))),r=this._invokeOne(function(h){return h.getMaterialType&&h.getMaterialType(n)}),c.push(Promise.all(this._invokeAll(function(h){return h.extendMaterialParams&&h.extendMaterialParams(n,a)})))}i.doubleSided===!0&&(a.side=Ue);const u=i.alphaMode||W.OPAQUE;if(u===W.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===W.MASK&&(a.alphaTest=i.alphaCutoff!==void 0?i.alphaCutoff:.5)),i.normalTexture!==void 0&&r!==G&&(c.push(e.assignTexture(a,"normalMap",i.normalTexture)),a.normalScale=new pe(1,1),i.normalTexture.scale!==void 0)){const l=i.normalTexture.scale;a.normalScale.set(l,l)}if(i.occlusionTexture!==void 0&&r!==G&&(c.push(e.assignTexture(a,"aoMap",i.occlusionTexture)),i.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=i.occlusionTexture.strength)),i.emissiveFactor!==void 0&&r!==G){const l=i.emissiveFactor;a.emissive=new F().setRGB(l[0],l[1],l[2],b)}return i.emissiveTexture!==void 0&&r!==G&&c.push(e.assignTexture(a,"emissiveMap",i.emissiveTexture,U)),Promise.all(c).then(function(){const l=new r(a);return i.name&&(l.name=i.name),y(l,i),e.associations.set(l,{materials:n}),i.extensions&&O(t,l,i),l})}createUniqueName(n){const e=Be.sanitizeNodeName(n||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(n){const e=this,s=this.extensions,t=this.primitiveCache;function i(a){return s[g.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,e).then(function(o){return fe(o,a,e)})}const r=[];for(let a=0,o=n.length;a<o;a++){const c=n[a],u=Dn(c),l=t[u];if(l)r.push(l.promise);else{let h;c.extensions&&c.extensions[g.KHR_DRACO_MESH_COMPRESSION]?h=i(c):h=fe(new Ke,c,e),t[u]={primitive:c,promise:h},r.push(h)}}return Promise.all(r)}loadMesh(n){const e=this,s=this.json,t=this.extensions,i=s.meshes[n],r=i.primitives,a=[];for(let o=0,c=r.length;o<c;o++){const u=r[o].material===void 0?Pn(this.cache):this.getDependency("material",r[o].material);a.push(u)}return a.push(e.loadGeometries(r)),Promise.all(a).then(function(o){const c=o.slice(0,o.length-1),u=o[o.length-1],l=[];for(let d=0,p=u.length;d<p;d++){const R=u[d],m=r[d];let T;const A=c[d];if(m.mode===M.TRIANGLES||m.mode===M.TRIANGLE_STRIP||m.mode===M.TRIANGLE_FAN||m.mode===void 0)T=i.isSkinnedMesh===!0?new je(R,A):new Ve(R,A),T.isSkinnedMesh===!0&&T.normalizeSkinWeights(),m.mode===M.TRIANGLE_STRIP?T.geometry=oe(T.geometry,he):m.mode===M.TRIANGLE_FAN&&(T.geometry=oe(T.geometry,Q));else if(m.mode===M.LINES)T=new Xe(R,A);else if(m.mode===M.LINE_STRIP)T=new ze(R,A);else if(m.mode===M.LINE_LOOP)T=new qe(R,A);else if(m.mode===M.POINTS)T=new We(R,A);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);Object.keys(T.geometry.morphAttributes).length>0&&kn(T,i),T.name=e.createUniqueName(i.name||"mesh_"+n),y(T,i),m.extensions&&O(t,T,m),e.assignFinalMaterial(T),l.push(T)}for(let d=0,p=l.length;d<p;d++)e.associations.set(l[d],{meshes:n,primitives:d});if(l.length===1)return i.extensions&&O(t,l[0],i),l[0];const h=new z;i.extensions&&O(t,h,i),e.associations.set(h,{meshes:n});for(let d=0,p=l.length;d<p;d++)h.add(l[d]);return h})}loadCamera(n){let e;const s=this.json.cameras[n],t=s[s.type];if(!t){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return s.type==="perspective"?e=new Ye(Qe.radToDeg(t.yfov),t.aspectRatio||1,t.znear||1,t.zfar||2e6):s.type==="orthographic"&&(e=new Je(-t.xmag,t.xmag,t.ymag,-t.ymag,t.znear,t.zfar)),s.name&&(e.name=this.createUniqueName(s.name)),y(e,s),Promise.resolve(e)}loadSkin(n){const e=this.json.skins[n],s=[];for(let t=0,i=e.joints.length;t<i;t++)s.push(this._loadNodeShallow(e.joints[t]));return e.inverseBindMatrices!==void 0?s.push(this.getDependency("accessor",e.inverseBindMatrices)):s.push(null),Promise.all(s).then(function(t){const i=t.pop(),r=t,a=[],o=[];for(let c=0,u=r.length;c<u;c++){const l=r[c];if(l){a.push(l);const h=new B;i!==null&&h.fromArray(i.array,c*16),o.push(h)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',e.joints[c])}return new Ze(a,o)})}loadAnimation(n){const e=this.json,s=this,t=e.animations[n],i=t.name?t.name:"animation_"+n,r=[],a=[],o=[],c=[],u=[];for(let l=0,h=t.channels.length;l<h;l++){const d=t.channels[l],p=t.samplers[d.sampler],R=d.target,m=R.node,T=t.parameters!==void 0?t.parameters[p.input]:p.input,A=t.parameters!==void 0?t.parameters[p.output]:p.output;R.node!==void 0&&(r.push(this.getDependency("node",m)),a.push(this.getDependency("accessor",T)),o.push(this.getDependency("accessor",A)),c.push(p),u.push(R))}return Promise.all([Promise.all(r),Promise.all(a),Promise.all(o),Promise.all(c),Promise.all(u)]).then(function(l){const h=l[0],d=l[1],p=l[2],R=l[3],m=l[4],T=[];for(let x=0,E=h.length;x<E;x++){const L=h[x],N=d[x],S=p[x],k=R[x],P=m[x];if(L===void 0)continue;L.updateMatrix&&L.updateMatrix();const K=s._createAnimationTracks(L,N,S,k,P);if(K)for(let j=0;j<K.length;j++)T.push(K[j])}const A=new $e(i,void 0,T);return y(A,t),A})}createNodeMesh(n){const e=this.json,s=this,t=e.nodes[n];return t.mesh===void 0?null:s.getDependency("mesh",t.mesh).then(function(i){const r=s._getNodeRef(s.meshCache,t.mesh,i);return t.weights!==void 0&&r.traverse(function(a){if(a.isMesh)for(let o=0,c=t.weights.length;o<c;o++)a.morphTargetInfluences[o]=t.weights[o]}),r})}loadNode(n){const e=this.json,s=this,t=e.nodes[n],i=s._loadNodeShallow(n),r=[],a=t.children||[];for(let c=0,u=a.length;c<u;c++)r.push(s.getDependency("node",a[c]));const o=t.skin===void 0?Promise.resolve(null):s.getDependency("skin",t.skin);return Promise.all([i,Promise.all(r),o]).then(function(c){const u=c[0],l=c[1],h=c[2];h!==null&&u.traverse(function(d){d.isSkinnedMesh&&d.bind(h,vn)});for(let d=0,p=l.length;d<p;d++)u.add(l[d]);if(u.userData.pivot!==void 0&&l.length>0){const d=u.userData.pivot,p=l[0];u.pivot=new C().fromArray(d),u.position.x-=d[0],u.position.y-=d[1],u.position.z-=d[2],p.position.set(0,0,0),delete u.userData.pivot}return u})}_loadNodeShallow(n){const e=this.json,s=this.extensions,t=this;if(this.nodeCache[n]!==void 0)return this.nodeCache[n];const i=e.nodes[n],r=i.name?t.createUniqueName(i.name):"",a=[],o=t._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(n)});return o&&a.push(o),i.camera!==void 0&&a.push(t.getDependency("camera",i.camera).then(function(c){return t._getNodeRef(t.cameraCache,i.camera,c)})),t._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(n)}).forEach(function(c){a.push(c)}),this.nodeCache[n]=Promise.all(a).then(function(c){let u;if(i.isBone===!0?u=new en:c.length>1?u=new z:c.length===1?u=c[0]:u=new ge,u!==c[0])for(let l=0,h=c.length;l<h;l++)u.add(c[l]);if(i.name&&(u.userData.name=i.name,u.name=r),y(u,i),i.extensions&&O(s,u,i),i.matrix!==void 0){const l=new B;l.fromArray(i.matrix),u.applyMatrix4(l)}else i.translation!==void 0&&u.position.fromArray(i.translation),i.rotation!==void 0&&u.quaternion.fromArray(i.rotation),i.scale!==void 0&&u.scale.fromArray(i.scale);if(!t.associations.has(u))t.associations.set(u,{});else if(i.mesh!==void 0&&t.meshCache.refs[i.mesh]>1){const l=t.associations.get(u);t.associations.set(u,{...l})}return t.associations.get(u).nodes=n,u}),this.nodeCache[n]}loadScene(n){const e=this.extensions,s=this.json.scenes[n],t=this,i=new z;s.name&&(i.name=t.createUniqueName(s.name)),y(i,s),s.extensions&&O(e,i,s);const r=s.nodes||[],a=[];for(let o=0,c=r.length;o<c;o++)a.push(t.getDependency("node",r[o]));return Promise.all(a).then(function(o){for(let u=0,l=o.length;u<l;u++){const h=o[u];h.parent!==null?i.add(nn(h)):i.add(h)}const c=u=>{const l=new Map;for(const[h,d]of t.associations)(h instanceof X||h instanceof ne)&&l.set(h,d);return u.traverse(h=>{const d=t.associations.get(h);d!=null&&l.set(h,d)}),l};return t.associations=c(i),i})}_createAnimationTracks(n,e,s,t,i){const r=[],a=n.name?n.name:n.uuid,o=[];function c(d){d.morphTargetInfluences&&o.push(d.name?d.name:d.uuid)}I[i.path]===I.weights?(c(n),n.isGroup&&n.children.forEach(c)):o.push(a);let u;switch(I[i.path]){case I.weights:u=se;break;case I.rotation:u=ie;break;case I.translation:case I.scale:u=te;break;default:switch(s.itemSize){case 1:u=se;break;case 2:case 3:default:u=te;break}break}const l=t.interpolation!==void 0?Fn[t.interpolation]:xe,h=this._getArrayFromAccessor(s);for(let d=0,p=o.length;d<p;d++){const R=new u(o[d]+"."+I[i.path],e.array,h,l);t.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(R),r.push(R)}return r}_getArrayFromAccessor(n){let e=n.array;if(n.normalized){const s=ee(e.constructor),t=new Float32Array(e.length);for(let i=0,r=e.length;i<r;i++)t[i]=e[i]*s;e=t}return e}_createCubicSplineTrackInterpolant(n){n.createInterpolant=function(s){const t=this instanceof ie?Cn:_e;return new t(this.times,this.values,this.getValueSize()/3,s)},n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function Bn(f,n,e){const s=n.attributes,t=new an;if(s.POSITION!==void 0){const a=e.json.accessors[s.POSITION],o=a.min,c=a.max;if(o!==void 0&&c!==void 0){if(t.set(new C(o[0],o[1],o[2]),new C(c[0],c[1],c[2])),a.normalized){const u=ee(H[a.componentType]);t.min.multiplyScalar(u),t.max.multiplyScalar(u)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const i=n.targets;if(i!==void 0){const a=new C,o=new C;for(let c=0,u=i.length;c<u;c++){const l=i[c];if(l.POSITION!==void 0){const h=e.json.accessors[l.POSITION],d=h.min,p=h.max;if(d!==void 0&&p!==void 0){if(o.setX(Math.max(Math.abs(d[0]),Math.abs(p[0]))),o.setY(Math.max(Math.abs(d[1]),Math.abs(p[1]))),o.setZ(Math.max(Math.abs(d[2]),Math.abs(p[2]))),h.normalized){const R=ee(H[h.componentType]);o.multiplyScalar(R)}a.max(o)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}t.expandByVector(a)}f.boundingBox=t;const r=new cn;t.getCenter(r.center),r.radius=t.min.distanceTo(t.max)/2,f.boundingSphere=r}function fe(f,n,e){const s=n.attributes,t=[];function i(r,a){return e.getDependency("accessor",r).then(function(o){f.setAttribute(a,o)})}for(const r in s){const a=$[r]||r.toLowerCase();a in f.attributes||t.push(i(s[r],a))}if(n.indices!==void 0&&!f.index){const r=e.getDependency("accessor",n.indices).then(function(a){f.setIndex(a)});t.push(r)}return re.workingColorSpace!==b&&"COLOR_0"in s&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${re.workingColorSpace}" not supported.`),y(f,n),Bn(f,n,e),Promise.all(t).then(function(){return n.targets!==void 0?Hn(f,n.targets,e):f})}export{jn as GLTFLoader};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{E as A,b as g,k as P,H as h,B as C,d as E,m as L,C as x,z as R,J as I}from"./rr0-scene.mjs";class i{constructor(e){this.scene=e}static REAL_BEAMS=4;static LAMPS=2;static DISTANCE_M=500;static AIR_LENGTH_M=90;static CLEAR_AIR_SCATTER_PER_M=2e-4;static SHADOW_MAP_PX=1024;beams=new Map;static airGeometry;has(e){return this.beams.has(e)}get size(){return this.beams.size}lamps(e){return this.beams.get(e)?.lamps??[]}airMeshes(e){return this.beams.get(e)?.air??[]}add(e){if(this.beams.has(e))return!0;if(this.beams.size>=i.REAL_BEAMS)return!1;const t=[],r=[];for(let n=0;n<i.LAMPS;n++){const a=new A(16777215,0,i.DISTANCE_M,Math.PI/8,.5,2);a.castShadow=e==="observer",a.shadow.mapSize.set(i.SHADOW_MAP_PX,i.SHADOW_MAP_PX),a.shadow.camera.near=.4,a.shadow.camera.far=110,a.shadow.bias=-4e-4,a.shadow.normalBias=.04,a.shadow.radius=2,this.scene.add(a),this.scene.add(a.target),t.push(a);const o=new g(i.airCone(),i.airMaterial());o.visible=!1,o.frustumCulled=!1,o.renderOrder=8,o.castShadow=!1,o.receiveShadow=!1,o.name="headlight air",this.scene.add(o),r.push(o)}return this.beams.set(e,{lamps:t,air:r}),!0}remove(e){const t=this.beams.get(e);if(t){for(const r of t.lamps)r.removeFromParent(),r.target.removeFromParent(),r.dispose();for(const r of t.air)r.removeFromParent(),r.material.dispose();this.beams.delete(e)}}clear(e){for(const t of[...this.beams.keys()])e&&t==="observer"||this.remove(t)}dispose(){this.clear(!1),i.airGeometry?.dispose(),i.airGeometry=void 0}aim(e,t,r,n,a,o,u){const c=this.beams.get(e),w=Math.max(u,i.CLEAR_AIR_SCATTER_PER_M);if(!c)return;const l=h.BEAMS[t],v=new P(-n.z,0,n.x),b=e==="observer"&&l!==void 0;c.lamps.forEach((s,d)=>{if(!l){s.intensity=0,c.air[d].visible=!1,s.shadow.autoUpdate=!1;return}const f=d===0?-1:1,m=l.pitchDeg*Math.PI/180,p=l.candela*h.DISPLAY_GAIN*o/c.lamps.length;s.color.set(l.color),s.intensity=p,s.angle=l.halfAngleDeg*Math.PI/180,s.penumbra=l.penumbra,b?(s.shadow.autoUpdate||(s.shadow.needsUpdate=!0),s.shadow.autoUpdate=!0):s.shadow.autoUpdate=!1,s.position.copy(r).addScaledVector(v,f*a);const M=n.clone().addScaledVector(v,-f*Math.tan(h.TOE_IN_DEG*Math.PI/180)).normalize();s.target.position.set(s.position.x+M.x*Math.cos(m)*50,s.position.y-Math.sin(m)*50,s.position.z+M.z*Math.cos(m)*50),s.target.updateMatrixWorld(),this.aimAir(c.air[d],s,l.color,p,w)})}aimAir(e,t,r,n,a){if(e.visible=a*n>1e-4,!e.visible)return;const o=i.AIR_LENGTH_M,u=o*Math.tan(t.angle);e.position.copy(t.position),e.scale.set(u,u,o),e.lookAt(t.target.position),e.updateMatrixWorld();const c=e.material.uniforms;c.uColor.value.set(r),c.uCandela.value=n,c.uScatter.value=a,c.uLength.value=o,c.uRadius.value=u}static airCone(){if(i.airGeometry)return i.airGeometry;const e=24,t=new Float32Array((e+1)*3);for(let a=0;a<e;a++){const o=a/e*Math.PI*2;t.set([Math.cos(o),Math.sin(o),1],(a+1)*3)}const r=[];for(let a=0;a<e;a++)r.push(0,1+a,1+(a+1)%e);const n=new C;return n.setAttribute("position",new E(t,3)),n.setIndex(r),i.airGeometry=n,n}static airMaterial(){return new L({transparent:!0,depthWrite:!1,depthTest:!0,blending:I,side:R,uniforms:{uColor:{value:new x(1,1,1)},uCandela:{value:0},uScatter:{value:0},uLength:{value:90},uRadius:{value:20}},vertexShader:`
|
|
2
2
|
varying vec3 vLocal;
|
|
3
3
|
varying vec3 vNormalView;
|
|
4
4
|
varying vec3 vViewDir;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import{G as F,c as P,C as H,g as w,B as K,d as N,b as U,e as k}from"./rr0-scene.mjs";class S{static HOLLOW_M=1;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,n,s){const e=t.map(r=>r.level===0),o=t.map((r,l)=>e[l]?S.targets(r,n,s):[]),i=t.map((r,l)=>e[l]?S.samples(r,o[l]):[]),a=new Map;t.forEach((r,l)=>{if(e[l])for(const p of S.ends(r)){const h=S.key(p),E=a.get(h);E?E.push(l):a.set(h,[l])}});const u=r=>{const l=a.get(S.key(r));if(l)return S.median(l.flatMap(p=>i[p]),r)};return t.map((r,l)=>{if(e[l]){const p=[...new Set([l,...S.ends(r).flatMap(f=>a.get(S.key(f))??[])])].flatMap(f=>i[f]),h=r.centre.map((f,O)=>S.median(p,f)??o[l][O]),[E,L]=S.ends(r);return h[0]=u(E)??h[0],h[h.length-1]=u(L)??h[h.length-1],S.graded(h,r.along,r.highSpeed?S.MAX_GRADE.highSpeed:S.MAX_GRADE[r.kind])}return S.carried(r,n,s,u)})}static targets(t,n,s){return t.centre.map(e=>{const o=n(e.x,e.z);if(s===void 0||e.altitudeM===void 0)return o;const i=e.altitudeM+s;return i-o>S.HOLLOW_M?i:o})}static samples(t,n){const s=[];let e=0;return t.centre.forEach((o,i)=>{t.along[i]+1e-6<e&&i<t.centre.length-1||(s.push({x:o.x,z:o.z,y:n[i]}),e=t.along[i]+S.SAMPLE_M)}),s}static median(t,n){const s=[];for(const o of t)Math.hypot(o.x-n.x,o.z-n.z)<=S.WINDOW_M&&s.push(o.y);if(s.length===0)return;s.sort((o,i)=>o-i);const e=s.length>>1;return s.length%2===1?s[e]:(s[e-1]+s[e])/2}static graded(t,n,s){if(!Number.isFinite(s)||t.length<3)return t;const e=[...t],o=e.length-1,i=n[o];if(Math.abs(e[o]-e[0])>s*i)return n.map(a=>e[0]+(e[o]-e[0])*a/i);for(let a=1;a<o;a++){const u=s*(n[a]-n[a-1]);e[a]=Math.min(e[a-1]+u,Math.max(e[a-1]-u,e[a]))}for(let a=o-1;a>0;a--){const u=s*(n[a+1]-n[a]);e[a]=Math.min(e[a+1]+u,Math.max(e[a+1]-u,e[a]))}return e}static carried(t,n,s,e){const[o,i]=S.ends(t),a=t.along[t.along.length-1],u=e(o),r=e(i);if(s!==void 0&&t.centre.every(h=>h.altitudeM!==void 0)){const h=t.centre.map(f=>f.altitudeM+s),E=u!==void 0?u-h[0]:0,L=r!==void 0?r-h[h.length-1]:0;return h.map((f,O)=>f+E+(L-E)*t.along[O]/a)}const l=u??n(o.x,o.z),p=r??n(i.x,i.z);return t.along.map(h=>l+(p-l)*h/a)}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 I{positions=[];indices=[];along=[];get vertexCount(){return this.positions.length/3}strip(t,n,s){const e=this.vertexCount;for(let o=0;o<t.length;o++)this.positions.push(t[o].x,t[o].y,t[o].z,n[o].x,n[o].y,n[o].z),s&&this.along.push(s[o],s[o]);for(let o=0;o<t.length-1;o++){const i=e+o*2;this.indices.push(i,i+2,i+1,i+1,i+2,i+3)}}beam(t,n,s,e=!0){const o=n.x-t.x,i=n.y-t.y,a=n.z-t.z,u=Math.hypot(o,i,a);if(u<1e-6)return;const r={x:o/u,y:i/u,z:a/u},l=Math.abs(r.y)>.9?{x:1,y:0,z:0}:{x:0,y:1,z:0},p=r.y*l.z-r.z*l.y,h=r.z*l.x-r.x*l.z,E=r.x*l.y-r.y*l.x,L=Math.hypot(p,h,E),f={x:p/L*s/2,y:h/L*s/2,z:E/L*s/2},O={x:r.y*f.z-r.z*f.y,y:r.z*f.x-r.x*f.z,z:r.x*f.y-r.y*f.x},g=(M,A,d)=>({x:M.x+f.x*A+O.x*d,y:M.y+f.y*A+O.y*d,z:M.z+f.z*A+O.z*d}),_=[[1,1],[-1,1],[-1,-1],[1,-1]];for(let M=0;M<4;M++){const[A,d]=_[M],[x,v]=_[(M+1)%4];this.quad(g(t,A,d),g(t,x,v),g(n,x,v),g(n,A,d))}e&&(this.quad(...[..._].reverse().map(([M,A])=>g(t,M,A))),this.quad(..._.map(([M,A])=>g(n,M,A))))}quad(t,n,s,e){const o=this.vertexCount;this.positions.push(t.x,t.y,t.z,n.x,n.y,n.z,s.x,s.y,s.z,e.x,e.y,e.z),this.indices.push(o,o+1,o+2,o,o+2,o+3)}}class c{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];group=new F;stepM=c.STEP_M;drawn=0;ballastMaterial=c.pebbled(c.lambert(c.BALLAST_ALBEDO,!0));earthMaterial=c.lambert(c.BANK_ALBEDO,!0);deckMaterial=c.lambert(c.DECK_ALBEDO,!1);concreteSleepers=c.sleeperMaterial(c.CONCRETE_ALBEDO);woodSleepers=c.sleeperMaterial(c.WOOD_ALBEDO);rustMaterial=c.lambert(c.RUST_ALBEDO,!0);headMaterial=new P({color:new H(.62,.62,.62),metalness:1,roughness:.28,polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2});steelMaterial=c.lambert(c.STEEL_ALBEDO,!1);wireMaterial=c.lambert(c.COPPER_ALBEDO,!1);constructor(){this.group.name="railways"}get count(){return this.drawn}setGroundSpacing(t){this.stepM=Number.isFinite(t)&&t>0?Math.min(c.STEP_M,Math.max(1.5,t/2)):c.STEP_M}set(t,n,s,e,o=1/0){this.clear();const a=t.map(E=>({line:E,path:E.points.map(L=>({...w(L.lat,L.lng,n,s),altitudeM:L.altitudeM}))})).filter(({line:E,path:L})=>E.level>=0&&c.within(L,o)),u=c.altitudeOffset(a,e),r=a.flatMap(({line:E,path:L})=>{const f=this.layoutOf(E,L);return f?[{line:E,layout:f}]:[]}),l=S.heights(r.map(({layout:E})=>E),e,u),p={ballast:new I,earth:new I,deck:new I,concrete:new I,wood:new I,rust:new I,head:new I,steel:new I,wire:new I};r.forEach(({line:E,layout:L},f)=>{this.lay(E,{...L,y:l[f]},e,p),this.drawn++});const h=[[p.ballast,this.ballastMaterial,"ballast",!1],[p.earth,this.earthMaterial,"embankments",!1],[p.deck,this.deckMaterial,"decks",!0],[p.concrete,this.concreteSleepers,"sleepers",!1],[p.wood,this.woodSleepers,"sleepers wood",!1],[p.rust,this.rustMaterial,"rails",!1],[p.head,this.headMaterial,"rail heads",!1],[p.steel,this.steelMaterial,"catenary masts",!0],[p.wire,this.wireMaterial,"catenary wires",!1]];for(const[E,L,f,O]of h){const g=c.meshOf(E,L);g&&(g.name=`railways ${f}`,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}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,n){if(!Number.isFinite(n))return!0;const s=n*1.1+100;return t.some((e,o)=>Math.hypot(e.x,e.z)<=s||o>0&&Math.hypot((e.x+t[o-1].x)/2,(e.z+t[o-1].z)/2)<=s)}static altitudeOffset(t,n){const s=[];for(const{line:e,path:o}of t)if(e.level===0)for(const i of o)i.altitudeM!==void 0&&s.push(n(i.x,i.z)-i.altitudeM);if(!(s.length<5))return s.sort((e,o)=>e-o),s[Math.floor(s.length/2)]}layoutOf(t,n){const s=[];for(let i=0;i<n.length-1;i++){const a=n[i],u=n[i+1],r=Math.max(1,Math.ceil(Math.hypot(u.x-a.x,u.z-a.z)/this.stepM));for(let l=0;l<r;l++){const p=l/r,h=a.altitudeM!==void 0&&u.altitudeM!==void 0?a.altitudeM+(u.altitudeM-a.altitudeM)*p:void 0;s.push({x:a.x+(u.x-a.x)*p,z:a.z+(u.z-a.z)*p,altitudeM:h})}}if(s.push(n[n.length-1]),s.length<2)return;const e=[0];for(let i=1;i<s.length;i++)e.push(e[i-1]+Math.hypot(s[i].x-s[i-1].x,s[i].z-s[i-1].z));if(e[e.length-1]<.5)return;const o=s.map((i,a)=>{const u=s[Math.max(0,a-1)],r=s[Math.min(s.length-1,a+1)],l=r.x-u.x,p=r.z-u.z,h=Math.hypot(l,p);return h<1e-6?{x:1,z:0}:{x:l/h,z:p/h}});return{kind:t.kind,...t.highSpeed?{highSpeed:!0}:{},level:t.level,centre:s,along:e,dir:o}}lay(t,n,s,e){const o=t.highSpeed?c.TRACK_SPACING_M.highSpeed:c.TRACK_SPACING_M[t.kind],i=Math.min(8,Math.max(1,t.tracks)),a=Array.from({length:i},(g,_)=>(_-(i-1)/2)*o),u=t.kind==="tram",r=u?0:c.BALLAST_HEIGHT_M,l=c.LIFT_M,p=(g,_,M)=>({x:n.centre[g].x-n.dir[g].z*_,y:n.y[g]+M,z:n.centre[g].z+n.dir[g].x*_}),h=n.centre.map((g,_)=>_);if(!u){const g=c.SLEEPER_LENGTH_M/2+c.BALLAST_SHOULDER_M+(a[a.length-1]??0),_=h.map(A=>p(A,g,r+l)),M=h.map(A=>p(A,-g,r+l));if(e.ballast.strip(_,M),t.level===0){const A=g+r*c.BALLAST_SLOPE;for(const d of[1,-1]){const x=[],v=[];let m=!1;for(const z of h){const D=p(z,d*A,l),B=s(D.x,D.z)+l,T=D.y-B;T<0&&(D.y=Math.min(B,n.y[z]+r-.05+l)),x.push(D);const C=p(z,d*(A+Math.max(0,T)*c.BANK_SLOPE),l);C.y=Math.min(s(C.x,C.z)+l,D.y),D.y-C.y>.02&&(m=!0),v.push(C)}const b=d>0?_:M;d>0?e.ballast.strip(x,b):e.ballast.strip(b,x),m&&(d>0?e.earth.strip(v,x):e.earth.strip(x,v))}}else{const A=-c.DECK_DEPTH_M,d=g+.15,x=h.map(z=>p(z,d,r+l+.1)),v=h.map(z=>p(z,-d,r+l+.1)),m=h.map(z=>p(z,d,A)),b=h.map(z=>p(z,-d,A));e.deck.strip(m,x),e.deck.strip(v,b),e.deck.strip(b,m),e.deck.strip(x,h.map(z=>p(z,g,r+l+.1))),e.deck.strip(h.map(z=>p(z,-g,r+l+.1)),v)}}const E=t.service?e.wood:e.concrete,L=t.gaugeMm/2e3+c.RAIL_HEAD_M/2,f=u?c.TRAM_RAIL_HEIGHT_M:c.RAIL_HEIGHT_M,O=r+l;for(const g of a){if(!u){const _=c.SLEEPER_LENGTH_M/2;E.strip(h.map(M=>p(M,g+_,O+.004)),h.map(M=>p(M,g-_,O+.004)),n.along)}for(const _ of[1,-1]){const M=g+_*L,A=c.RAIL_HEAD_M/2,d=h.map(v=>p(v,M+A,O+f)),x=h.map(v=>p(v,M-A,O+f));e.head.strip(d,x),e.rust.strip(h.map(v=>p(v,M+A,O)),d),e.rust.strip(x,h.map(v=>p(v,M-A,O)))}}t.electrification==="overhead"&&t.kind!=="subway"&&t.kind!=="funicular"&&this.catenary(t,n,a,O+f,p,s,e)}catenary(t,n,s,e,o,i,a){const u=t.kind==="tram"?c.CATENARY.tram:t.highSpeed?c.CATENARY.highSpeed:t.service?c.CATENARY.service:c.CATENARY.rail,r=n.along[n.along.length-1],l=Math.max(1,Math.round(r/u.spanM)),p=r/l,h=Array.from({length:l},(d,x)=>(x+.5)*p),E=e+u.contactM,L=E+u.systemM,f=(u.systemM>0?L:E)+c.MAST_ABOVE_M,O=s[s.length-1],g=s.length>2,_=s.length===1?[1]:[1,-1],M=(d,x,v)=>{let m=0,b=n.along.length-2;for(;m<b;){const T=m+b+1>>1;n.along[T]<=d?m=T:b=T-1}const z=Math.min(1,Math.max(0,(d-n.along[m])/Math.max(1e-6,n.along[m+1]-n.along[m]))),D=o(m,x,v),B=o(m+1,x,v);return{x:D.x+(B.x-D.x)*z,y:D.y+(B.y-D.y)*z,z:D.z+(B.z-D.z)*z}};for(const d of h){for(const x of _){const v=x*(O+c.MAST_OFFSET_M),m=M(d,v,0);t.level===0&&(m.y=i(m.x,m.z));const b=M(d,v,f);if(a.steel.beam(m,b,c.MAST_SIDE_M),g)continue;const D=(_.length===1?s[0]:x*O)-x*.6,B=u.systemM>0?L:E+.3;a.steel.beam(M(d,v,B),M(d,D,B),c.ARM_SIDE_M),a.steel.beam(M(d,v,E-.4),M(d,D,B),c.ARM_SIDE_M)}if(g){const x=O+c.MAST_OFFSET_M;a.steel.beam(M(d,x,f-.2),M(d,-x,f-.2),c.MAST_SIDE_M*.8)}}const A=[0,...h,r];for(const[d,x]of s.entries()){const v=m=>m===0||m===A.length-1?0:((m+d)%2===0?1:-1)*u.staggerM;for(let m=0;m<A.length-1;m++){const b=A[m],z=A[m+1];if(z-b<.1||(a.wire.beam(M(b,x+v(m),E),M(z,x+v(m+1),E),c.CONTACT_DIAMETER_M,!1),u.systemM<=0))continue;const D=4,B=T=>{const C=m===0?.5+T/2:m===A.length-2?T/2:T;return L-c.MESSENGER_SAG_M*4*C*(1-C)};for(let T=0;T<D;T++){const C=T/D,G=(T+1)/D;a.wire.beam(M(b+(z-b)*C,x,B(C)),M(b+(z-b)*G,x,B(G)),c.MESSENGER_DIAMETER_M,!1)}}}}static meshOf(t,n){if(t.indices.length===0)return;const s=new K;return s.setAttribute("position",new N(new Float32Array(t.positions),3)),t.along.length>0&&s.setAttribute("aAlong",new N(new Float32Array(t.along),1)),s.setIndex(new N(new Uint32Array(t.indices),1)),s.computeVertexNormals(),new U(s,n)}static lambert(t,n){return new k({color:new H(...t),...n?{polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2}:{}})}static pebbled(t){return t.onBeforeCompile=n=>{n.vertexShader=n.vertexShader.replace("#include <common>",`#include <common>
|
|
2
|
+
varying vec3 vBallast;`).replace("#include <begin_vertex>",`#include <begin_vertex>
|
|
3
|
+
vBallast = position;`),n.fragmentShader=n.fragmentShader.replace("#include <common>",`#include <common>
|
|
4
|
+
varying vec3 vBallast;
|
|
5
|
+
float ballastHash(vec2 p) {
|
|
6
|
+
p = fract(p * vec2(127.1, 311.7));
|
|
7
|
+
p += dot(p, p + 34.5);
|
|
8
|
+
return fract(p.x * p.y);
|
|
9
|
+
}
|
|
10
|
+
float ballastNoise(vec2 p) {
|
|
11
|
+
vec2 i = floor(p);
|
|
12
|
+
vec2 f = fract(p);
|
|
13
|
+
f = f * f * (3.0 - 2.0 * f);
|
|
14
|
+
return mix(mix(ballastHash(i), ballastHash(i + vec2(1.0, 0.0)), f.x), mix(ballastHash(i + vec2(0.0, 1.0)), ballastHash(i + vec2(1.0, 1.0)), f.x), f.y);
|
|
15
|
+
}`).replace("#include <map_fragment>",`#include <map_fragment>
|
|
16
|
+
{
|
|
17
|
+
float eye = length(vViewPosition);
|
|
18
|
+
vec2 at = vBallast.xz + vec2(0.0, vBallast.y);
|
|
19
|
+
float stones = (ballastHash(floor(at * 22.0)) - 0.5) * 0.9 * (1.0 - smoothstep(4.0, 18.0, eye))
|
|
20
|
+
+ (ballastNoise(at * 6.0) - 0.5) * 0.5 * (1.0 - smoothstep(15.0, 60.0, eye))
|
|
21
|
+
+ (ballastNoise(at * 0.7) - 0.5) * 0.35 * (1.0 - smoothstep(80.0, 300.0, eye));
|
|
22
|
+
diffuseColor.rgb *= 1.0 + stones;
|
|
23
|
+
}`)},t.customProgramCacheKey=()=>"rr0-railway-ballast",t}static sleeperMaterial(t){const n=new k({color:new H(1,1,1),polygonOffset:!0,polygonOffsetFactor:-3,polygonOffsetUnits:-3}),s=new H(...t),e=new H(...c.BALLAST_ALBEDO);return n.onBeforeCompile=o=>{o.uniforms.uSleeper={value:s},o.uniforms.uCrib={value:e},o.uniforms.uSpacing={value:c.SLEEPER_SPACING_M},o.uniforms.uDuty={value:c.SLEEPER_WIDTH_M/c.SLEEPER_SPACING_M},o.vertexShader=o.vertexShader.replace("#include <common>",`#include <common>
|
|
24
|
+
attribute float aAlong;
|
|
25
|
+
varying float vAlong;`).replace("#include <begin_vertex>",`#include <begin_vertex>
|
|
26
|
+
vAlong = aAlong;`),o.fragmentShader=o.fragmentShader.replace("#include <common>",`#include <common>
|
|
27
|
+
varying float vAlong;
|
|
28
|
+
uniform vec3 uSleeper;
|
|
29
|
+
uniform vec3 uCrib;
|
|
30
|
+
uniform float uSpacing;
|
|
31
|
+
uniform float uDuty;
|
|
32
|
+
// How much of [0, x] periods is sleeper: the integral of a pulse of width uDuty at the start of each period.
|
|
33
|
+
float sleeperIntegral(float x) {
|
|
34
|
+
return floor(x) * uDuty + min(fract(x), uDuty);
|
|
35
|
+
}`).replace("#include <map_fragment>",`#include <map_fragment>
|
|
36
|
+
{
|
|
37
|
+
float u = vAlong / uSpacing;
|
|
38
|
+
float w = max(fwidth(u), 1e-4);
|
|
39
|
+
float cover = (sleeperIntegral(u + 0.5 * w) - sleeperIntegral(u - 0.5 * w)) / w;
|
|
40
|
+
diffuseColor.rgb *= mix(uCrib, uSleeper, clamp(cover, 0.0, 1.0));
|
|
41
|
+
}`)},n.customProgramCacheKey=()=>"rr0-railway-sleepers",n}}export{c as RailwaySystem};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{g as D}from"./rr0-scene.mjs";class l{static MIN_ROAD_M=5.5;static WIDE_ROAD_M=9;static LINE_WIDTH_M=.12;static DASH_M=3;static GAP_M=10;static RIVE_DASH_M=2.5;static RIVE_GAP_M=3.5;static MIN_DASH_M=.5;static LANE_M=3.5;static SHOULDER_MIN_M=1.5;static SOLID_EDGE_FROM_M=7;static SOLID_EDGE_FROM_KMH=80;static BEND_RADIUS_M=300;static EDGE_SETBACK_M=.4;static PAINT_RADIUS_M=450;static LIFT_M=.015;static BARRIER_MAX_AXES_M=40;static BARRIER_MIN_AXES_M=5;static BARRIER_HEIGHT_M=.8;static BARRIER_HALF_WIDTH_M=.2;static BARRIER_STEP_M=4;static painted(t){return t.surface==="paved"&&t.widthM>=l.MIN_ROAD_M&&t.kind!=="roundabout"}static plan(t){if(!l.painted(t))return[];const M=t.widthM,r=M/2,c=l.EDGE_SETBACK_M;if(!(t.direction!==void 0&&t.lanes!==void 0)){const I=[{offsetM:r-c,pattern:"solid"},{offsetM:-(r-c),pattern:"solid"}],A=M>=l.WIDE_ROAD_M?[-M/4,M/4]:[0];for(const x of A)I.push({offsetM:x,pattern:"dashed"});return I}const s=t.lanes,n=M>=l.SOLID_EDGE_FROM_M||(t.speedKmh??0)>=l.SOLID_EDGE_FROM_KMH?"solid":"rive";if(t.direction==="both"){if(s<2)return[];const I=[{offsetM:r-c,pattern:n},{offsetM:-(r-c),pattern:n}];if(s>=4){I.push({offsetM:.1,pattern:"solid"},{offsetM:-.1,pattern:"solid"});const A=Math.floor(s/2),x=M/s;for(let z=1;z<A;z++)I.push({offsetM:z*x,pattern:"dashed"},{offsetM:-z*x,pattern:"dashed"})}else I.push({offsetM:0,pattern:"dashed",solidInBends:!0});return I}const u=t.direction==="backward"?-1:1,o=I=>u*(r-I),i=Math.min(l.LANE_M,M/Math.max(s,1)),h=s*i,_=M-h,d=(t.kind==="motorway"||t.kind==="dual")&&_>=l.SHOULDER_MIN_M,E=[{offsetM:o(c),pattern:t.kind==="motorway"||t.kind==="dual"?"solid":n}];E.push({offsetM:o(d?h:M-c),pattern:t.kind==="motorway"||t.kind==="dual"?"solid":n});for(let I=1;I<s;I++)E.push({offsetM:o(I*i),pattern:"dashed"});return E}static lay(t,M,r,c){let e=0;const s=(f,n)=>{c(f,l.LINE_WIDTH_M,{offsetM:n,liftM:l.LIFT_M,minHalfM:l.LINE_WIDTH_M/2}),e++};for(const f of t){const n=l.plan(f);if(n.length===0)continue;const u=f.points.map(o=>D(o.lat,o.lng,M,r));for(const o of l.near(u,l.PAINT_RADIUS_M))for(const i of n){if(i.pattern==="solid"){s(o,i.offsetM);continue}const[h,_]=i.pattern==="dashed"?[l.DASH_M,l.GAP_M]:[l.RIVE_DASH_M,l.RIVE_GAP_M];for(const d of i.solidInBends?l.byBends(o):[{path:o,bend:!1}])if(d.bend)s(d.path,i.offsetM);else for(const E of l.dashes(d.path,h,_))s(E,i.offsetM)}}return e}static byBends(t){if(t.length<3)return[{path:t,bend:!1}];const M=(e,s)=>Math.atan2(s.x-e.x,-(s.z-e.z)),r=new Array(t.length-1).fill(!1);for(let e=1;e<t.length-1;e++){const s=Math.hypot(t[e].x-t[e-1].x,t[e].z-t[e-1].z),f=Math.hypot(t[e+1].x-t[e].x,t[e+1].z-t[e].z);if(s<1e-6||f<1e-6)continue;let n=Math.abs(M(t[e],t[e+1])-M(t[e-1],t[e]));n>Math.PI&&(n=2*Math.PI-n),(s+f)/2/Math.max(n,1e-6)<l.BEND_RADIUS_M&&(r[e-1]=!0,r[e]=!0)}const c=[];for(let e=0;e<r.length;e++){const s=c.at(-1);s&&s.bend===r[e]?s.path.push(t[e+1]):c.push({path:[t[e],t[e+1]],bend:r[e]})}return c}static barriers(t,M,r){const c=t.filter(n=>(n.kind==="motorway"||n.kind==="dual")&&(n.direction==="forward"||n.direction==="backward")),e=c.map(n=>{const u=n.points.map(o=>D(o.lat,o.lng,M,r));return n.direction==="backward"?[...u].reverse():u}),s=[],f=l.BARRIER_STEP_M;return c.forEach((n,u)=>{for(const o of l.near(e[u],l.PAINT_RADIUS_M)){let i=[];for(const h of l.resample(o,f)){const _=l.midwayToOpposite(h,u,c,e);_?i.push(_):i.length>0&&(i.length>=2&&s.push(i),i=[])}i.length>=2&&s.push(i)}}),s}static midwayToOpposite(t,M,r,c){let e;for(let s=0;s<c.length;s++){if(s===M||r[s].id<r[M].id)continue;const f=c[s];for(let n=0;n<f.length-1;n++){const u=f[n+1].x-f[n].x,o=f[n+1].z-f[n].z,i=u*u+o*o;if(i<1e-9||(u*t.dx+o*t.dz)/Math.sqrt(i)>-.9)continue;const h=Math.max(0,Math.min(1,((t.x-f[n].x)*u+(t.z-f[n].z)*o)/i)),_={x:f[n].x+u*h,z:f[n].z+o*h},d=Math.hypot(t.x-_.x,t.z-_.z);d<l.BARRIER_MIN_AXES_M||d>l.BARRIER_MAX_AXES_M||(!e||d<e.distance)&&(e={distance:d,point:_})}}return e?{x:(t.x+e.point.x)/2,z:(t.z+e.point.z)/2}:void 0}static resample(t,M){const r=[];for(let c=0;c<t.length-1;c++){const e=Math.hypot(t[c+1].x-t[c].x,t[c+1].z-t[c].z);if(e<1e-6)continue;const s=(t[c+1].x-t[c].x)/e,f=(t[c+1].z-t[c].z)/e;for(let n=0;n<e;n+=M)r.push({x:t[c].x+s*n,z:t[c].z+f*n,dx:s,dz:f})}return r}static barrierGeometry(t,M){const r=[],c=[],e=l.BARRIER_HALF_WIDTH_M;for(const s of t){if(s.length<2)continue;const f=r.length/3;for(let n=0;n<s.length;n++){const u=s[Math.max(0,n-1)],o=s[Math.min(s.length-1,n+1)],i=Math.hypot(o.x-u.x,o.z-u.z)||1,h=-(o.z-u.z)/i*e,_=(o.x-u.x)/i*e,d=M(s[n].x,s[n].z);r.push(s[n].x+h,d,s[n].z+_,s[n].x+h,d+l.BARRIER_HEIGHT_M,s[n].z+_,s[n].x-h,d+l.BARRIER_HEIGHT_M,s[n].z-_,s[n].x-h,d,s[n].z-_)}for(let n=0;n<s.length-1;n++){const u=f+n*4,o=u+4;for(let i=0;i<3;i++)c.push(u+i,o+i,u+i+1,u+i+1,o+i,o+i+1)}}return{positions:r,indices:c}}static near(t,M){const r=[];let c;for(let e=0;e<t.length-1;e++)Math.min(Math.hypot(t[e].x,t[e].z),Math.hypot(t[e+1].x,t[e+1].z))<=M||Math.hypot((t[e].x+t[e+1].x)/2,(t[e].z+t[e+1].z)/2)<=M?(c||(c=[t[e]]),c.push(t[e+1])):c&&(r.push(c),c=void 0);return c&&r.push(c),r}static dashes(t,M,r){const c=[],e=M+r;let s=0,f;const n=(o,i)=>({x:t[o].x+(t[o+1].x-t[o].x)*i,z:t[o].z+(t[o+1].z-t[o].z)*i});for(let o=0;o<t.length-1;o++){const i=Math.hypot(t[o+1].x-t[o].x,t[o+1].z-t[o].z);if(i<1e-6)continue;let h=0;for(;h<i;){const _=(s+h)%e,d=_<M,E=d?M-_:e-_,I=Math.min(i,h+E);d&&(f||(f=[n(o,h/i)]),f.push(n(o,I/i)),I-h>=E-1e-9&&(c.push(f),f=void 0)),h=I}s+=i}f&&f.length>=2&&c.push(f);const u=o=>o.slice(1).reduce((i,h,_)=>i+Math.hypot(h.x-o[_].x,h.z-o[_].z),0);return c.filter(o=>o.length>=2&&u(o)>=l.MIN_DASH_M)}}export{l as RoadMarkings};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{K as a,N as o}from"./rr0-scene.mjs";const l={bodies:{sun:"Sol",moon:"Luna",Venus:"Venus",Mars:"Marte",Jupiter:"Júpiter",Saturn:"Saturno"},stars:{Sirius:"Sirio",Canopus:"Canopo",Arcturus:"Arturo",Capella:"Capela",Procyon:"Proción",Aldebaran:"Aldebarán",Spica:"Espiga",Pollux:"Pólux",Castor:"Cástor",Regulus:"Régulo"},comets:{"halley-1910":"cometa Halley","brooks-1911":"cometa Brooks","skjellerup-maristany-1927":"cometa Skjellerup-Maristany","de-kock-paraskevopoulos-1941":"cometa de Kock-Paraskevopoulos","southern-1947":"cometa austral","eclipse-1948":"cometa del eclipse","arend-roland-1957":"cometa Arend-Roland","mrkos-1957":"cometa Mrkos","seki-lines-1962":"cometa Seki-Lines","ikeya-seki-1965":"cometa Ikeya-Seki","bennett-1970":"cometa Bennett","white-ortiz-bolelli-1970":"cometa White-Ortiz-Bolelli","kohoutek-1973":"cometa Kohoutek","west-1976":"cometa West","iras-araki-alcock-1983":"cometa IRAS-Araki-Alcock","halley-1986":"cometa Halley","hyakutake-1996":"cometa Hyakutake","hale-bopp-1997":"cometa Hale-Bopp","mcnaught-2007":"cometa McNaught","lovejoy-2011":"cometa Lovejoy","panstarrs-2013":"cometa PANSTARRS","neowise-2020":"cometa NEOWISE","tsuchinshan-atlas-2024":"cometa Tsuchinshan-ATLAS"},novae:{"sn-1006":"supernova de 1006","sn-1054":"supernova de 1054","sn-1181":"supernova de 1181","sn-1572":"supernova de Tycho","sn-1604":"supernova de Kepler","t-crb-1866":"nova de la Corona Boreal 1866","t-aur-1891":"nova de Auriga 1891","gk-per-1901":"nova de Perseo 1901","dn-gem-1912":"nova de Géminis 1912","v603-aql-1918":"nova del Águila 1918","v476-cyg-1920":"nova del Cisne 1920","rr-pic-1925":"nova del Pintor 1925","dq-her-1934":"nova de Hércules 1934","cp-lac-1936":"nova del Lagarto 1936","cp-pup-1942":"nova de la Popa 1942","t-crb-1946":"nova de la Corona Boreal 1946","v446-her-1960":"nova de Hércules 1960","v533-her-1963":"nova de Hércules 1963","hr-del-1967":"nova del Delfín 1967","lv-vul-1968":"nova de la Zorra 1968","fh-ser-1970":"nova de la Serpiente 1970","v1500-cyg-1975":"nova del Cisne 1975","v842-cen-1986":"nova del Centauro 1986","sn-1987a":"supernova 1987A","v1974-cyg-1992":"nova del Cisne 1992","v382-vel-1999":"nova de las Velas 1999","v1494-aql-1999":"nova del Águila 1999","v4743-sgr-2002":"nova de Sagitario 2002","rs-oph-2006":"nova de Ofiuco 2006","v1280-sco-2007":"nova de Escorpio 2007","v339-del-2013":"nova del Delfín 2013","v1369-cen-2013":"nova del Centauro 2013","rs-oph-2021":"nova de Ofiuco 2021"},satelliteClasses:{echo:"los globos Echo","iridium-flares":"los destellos de los Iridium",iss:"la Estación Espacial Internacional","starlink-trains":"los trenes de Starlink"},showers:{quadrantids:"Cuadrántidas",lyrids:"Líridas de abril","eta-aquariids":"Eta Acuáridas","alpha-capricornids":"Alfa Capricórnidas","southern-delta-aquariids":"Delta Acuáridas del Sur",perseids:"Perseidas","southern-taurids":"Táuridas del Sur",draconids:"Dracónidas de octubre",orionids:"Oriónidas","northern-taurids":"Táuridas del Norte",leonids:"Leónidas",geminids:"Gemínidas",ursids:"Úrsidas"},lightRigs:{airliner:"Avión de pasajeros",helicopter:"Helicóptero","car-headlights":"Coche, faros encendidos","car-hazards":"Coche, luces de emergencia","emergency-beacons":"Rotativos de vehículo de emergencia","traffic-signal":"Semáforo","pedestrian-signal":"Semáforo peatonal",streetlamp:"Farola"},instruments:{eye:"A simple vista","rectilinear-lens":"Cámara, modelo desconocido","roamer-1-120":"Roamer 1, película 120","instamatic-126":"Instamatic, película 126","slr-35mm-50":"Réflex 35 mm, objetivo 50 mm","slr-35mm-zoom":"Réflex 35 mm, zoom 70-210 mm","phone-landscape":"Teléfono, en horizontal","phone-portrait":"Teléfono, en vertical",...o.names(),...a.names()},decorKinds:{building:"Edificio",tree:"Árbol",shrub:"Arbusto",bridge:"Puente",wire:"Línea aérea",crop:"Hilera de cultivo",terrace:"Bancal (terraza)",mound:"Montón de piedras",wall:"Muro de piedra seca",streetlight:"Farola",trafficlight:"Semáforo",crossing:"Paso de peatones",roadsign:"Señal de tráfico",vehicle:"Vehículo",observer:"Observador",aircraft:"Aeronave",entity:"Ser"},compassPoints:["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSO","SO","OSO","O","ONO","NO","NNO"],towards:e=>`al ${e}`,starTooltip:"{name} — mag {mag}, {alt}° sobre el horizonte",starTooltipBelow:"{name} — mag {mag}, {alt}° bajo la horizontal",decorTooltip:"{name} — {size}, a {distance}",satelliteTooltip:"{name} — satélite, mag {mag}, a {height} km de altitud",opticsTooltips:{halo22:"Halo de 22° — un anillo alrededor del Sol, por luz desviada en cristales de hielo hexagonales de los cirros; su borde interior es rojo, a 21,7°",halo46:"Halo de 46° — un anillo más raro y débil: la luz entra por una cara lateral del cristal y sale por una cara del extremo",oddRadius:"Halo de {angle}° — un anillo de radio impar, raro y débil, hecho por cristales de hielo con extremos piramidales",parhelion:"Parhelio — una mancha brillante de colores junto al Sol, a su altura, por placas de hielo que caen planas; rojo hacia el Sol",parhelion120:"Parhelio de 120° — una mancha blanca débil a 120° del Sol, por luz reflejada dentro de placas planas",upperTangentArc:"Arco tangente superior — un arco brillante apoyado sobre el halo de 22°, por columnas tumbadas en horizontal",lowerTangentArc:"Arco tangente inferior — un arco que toca la base del halo de 22°, por columnas tumbadas en horizontal",circumzenithal:"Arco circuncenital — una banda de colores vivos cerca del cenit, por luz que entra por la cara superior de placas planas (solo con el Sol bajo 32°)",circumhorizontal:"Arco circunhorizontal — una banda de colores baja en el cielo, por luz que entra por la cara lateral de placas planas (solo con el Sol sobre 58°)",parhelicCircle:"Círculo parhélico — un círculo blanco alrededor de todo el cielo a la altura del Sol, por reflejos en las caras verticales de placas planas",pillar:"Pilar de luz — una columna de luz sobre el Sol, por reflejos en placas planas ligeramente inclinadas",subsun:"Subsol — una imagen del Sol bajo el horizonte, por reflejos en las caras planas de las placas"},trafficTooltip:{unnamed:"Aeronave {hex}",altitude:"{value} ft",speed:"{value} kt",heading:"rumbo {value}°",position:"a {distance} km, {elevation}° sobre el horizonte, {bearing}",heard:"Se oye a {level} dB(A), salió del avión hace {delay} s, {lag}° detrás de él: {character}{pitch}",rumble:"un rumor grave, nada por encima de {cutoff} Hz",muffled:"un ruido sordo, nada por encima de {cutoff} Hz",broad:"un rugido ancho",pitchHigher:", sonido {percent} % más agudo",pitchLower:", sonido {percent} % más grave",inaudible:"Inaudible aquí: {level} dB(A) frente a {ambient} dB(A) de ruido ambiente",soundUnknown:"Sonido no calculable: el avión aún no estaba registrado cuando salió",contrailPersistent:"Deja una estela que dura: el aire está sobresaturado respecto al hielo ({rhi} % respecto al hielo)",contrailShort:"Deja una estela breve: el aire está seco respecto al hielo ({rhi} % respecto al hielo)",military:"militar",restricted:"identidad oculta por su propietario",candidate:"Un candidato compatible, no una identificación"},credits:"Créditos",notAVideo:"Esto no es un vídeo",isASimulation:"Es una simulación en tiempo real."};export{l as sceneNames_es};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{K as a,N as r}from"./rr0-scene.mjs";const n={bodies:{sun:"Soleil",moon:"Lune",Venus:"Vénus",Saturn:"Saturne"},stars:{Betelgeuse:"Bételgeuse",Vega:"Véga",Altair:"Altaïr",Aldebaran:"Aldébaran",Regulus:"Régulus",Antares:"Antarès"},comets:{"halley-1910":"comète de Halley","brooks-1911":"comète Brooks","skjellerup-maristany-1927":"comète Skjellerup-Maristany","de-kock-paraskevopoulos-1941":"comète de Kock-Paraskevopoulos","southern-1947":"comète australe","eclipse-1948":"comète de l'éclipse","arend-roland-1957":"comète Arend-Roland","mrkos-1957":"comète Mrkos","seki-lines-1962":"comète Seki-Lines","ikeya-seki-1965":"comète Ikeya-Seki","bennett-1970":"comète Bennett","white-ortiz-bolelli-1970":"comète White-Ortiz-Bolelli","kohoutek-1973":"comète Kohoutek","west-1976":"comète West","iras-araki-alcock-1983":"comète IRAS-Araki-Alcock","halley-1986":"comète de Halley","hyakutake-1996":"comète Hyakutake","hale-bopp-1997":"comète Hale-Bopp","mcnaught-2007":"comète McNaught","lovejoy-2011":"comète Lovejoy","panstarrs-2013":"comète PANSTARRS","neowise-2020":"comète NEOWISE","tsuchinshan-atlas-2024":"comète Tsuchinshan-ATLAS"},novae:{"sn-1006":"supernova de 1006","sn-1054":"supernova de 1054","sn-1181":"supernova de 1181","sn-1572":"supernova de Tycho","sn-1604":"supernova de Kepler","t-crb-1866":"nova de la Couronne boréale 1866","t-aur-1891":"nova du Cocher 1891","gk-per-1901":"nova de Persée 1901","dn-gem-1912":"nova des Gémeaux 1912","v603-aql-1918":"nova de l'Aigle 1918","v476-cyg-1920":"nova du Cygne 1920","rr-pic-1925":"nova du Peintre 1925","dq-her-1934":"nova d'Hercule 1934","cp-lac-1936":"nova du Lézard 1936","cp-pup-1942":"nova de la Poupe 1942","t-crb-1946":"nova de la Couronne boréale 1946","v446-her-1960":"nova d'Hercule 1960","v533-her-1963":"nova d'Hercule 1963","hr-del-1967":"nova du Dauphin 1967","lv-vul-1968":"nova du Petit Renard 1968","fh-ser-1970":"nova du Serpent 1970","v1500-cyg-1975":"nova du Cygne 1975","v842-cen-1986":"nova du Centaure 1986","sn-1987a":"supernova 1987A","v1974-cyg-1992":"nova du Cygne 1992","v382-vel-1999":"nova des Voiles 1999","v1494-aql-1999":"nova de l'Aigle 1999","v4743-sgr-2002":"nova du Sagittaire 2002","rs-oph-2006":"nova d'Ophiuchus 2006","v1280-sco-2007":"nova du Scorpion 2007","v339-del-2013":"nova du Dauphin 2013","v1369-cen-2013":"nova du Centaure 2013","rs-oph-2021":"nova d'Ophiuchus 2021"},satelliteClasses:{echo:"les ballons Echo","iridium-flares":"les flashes d'Iridium",iss:"la Station spatiale internationale","starlink-trains":"les trains de Starlink"},showers:{quadrantids:"Quadrantides",lyrids:"Lyrides d'avril","eta-aquariids":"Êta Aquarides","alpha-capricornids":"Alpha Capricornides","southern-delta-aquariids":"Delta Aquarides du Sud",perseids:"Perséides","southern-taurids":"Taurides du Sud",draconids:"Draconides d'octobre",orionids:"Orionides","northern-taurids":"Taurides du Nord",leonids:"Léonides",geminids:"Géminides",ursids:"Ursides"},lightRigs:{airliner:"Avion de ligne",helicopter:"Hélicoptère","car-headlights":"Voiture, phares allumés","car-hazards":"Voiture, feux de détresse","emergency-beacons":"Gyrophares de véhicule d'urgence","traffic-signal":"Feu de circulation","pedestrian-signal":"Feu piéton",streetlamp:"Lampadaire"},instruments:{eye:"Œil nu","rectilinear-lens":"Appareil, modèle inconnu","roamer-1-120":"Roamer 1, film 120","instamatic-126":"Instamatic, film 126","slr-35mm-50":"Reflex 35 mm, objectif 50 mm","slr-35mm-zoom":"Reflex 35 mm, zoom 70-210 mm","phone-landscape":"Téléphone, tenu couché","phone-portrait":"Téléphone, tenu debout",...r.names(),...a.names()},decorKinds:{building:"Bâtiment",tree:"Arbre",shrub:"Buisson",bridge:"Pont",wire:"Ligne aérienne",crop:"Rang de culture",terrace:"Restanque (terrasse)",mound:"Tas de pierres",wall:"Muret de pierres sèches",streetlight:"Lampadaire",trafficlight:"Feu de circulation",crossing:"Passage piéton",roadsign:"Panneau de signalisation",vehicle:"Véhicule",observer:"Observateur",aircraft:"Aéronef",entity:"Être"},compassPoints:["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSO","SO","OSO","O","ONO","NO","NNO"],towards:e=>/^[EO]/.test(e)?`à l'${e}`:`au ${e}`,starTooltip:"{name} — mag {mag}, {alt}° au-dessus de l'horizon",starTooltipBelow:"{name} — mag {mag}, {alt}° sous l'horizontale",decorTooltip:"{name} — {size}, à {distance}",satelliteTooltip:"{name} — satellite, mag {mag}, à {height} km d'altitude",opticsTooltips:{halo22:"Halo de 22° — un anneau autour du Soleil, dû à la lumière déviée par des cristaux de glace hexagonaux dans les cirrus ; son bord interne est rouge, à 21,7°",halo46:"Halo de 46° — un anneau plus rare et plus faible : la lumière entre par une face latérale d'un cristal et sort par une face de bout",oddRadius:"Halo de {angle}° — un anneau à rayon impair, rare et faible, dû à des cristaux de glace à bouts pyramidaux",parhelion:"Parhélie — une tache brillante colorée à côté du Soleil, à sa hauteur, due à des plaquettes de glace tombant à plat ; rouge côté Soleil",parhelion120:"Parhélie à 120° — une faible tache blanche à 120° du Soleil, due à la lumière réfléchie à l'intérieur de plaquettes à plat",upperTangentArc:"Arc tangent supérieur — un arc brillant posé sur le haut du halo de 22°, dû à des colonnes couchées à l'horizontale",lowerTangentArc:"Arc tangent inférieur — un arc touchant le bas du halo de 22°, dû à des colonnes couchées à l'horizontale",circumzenithal:"Arc circumzénithal — une bande vivement colorée près du zénith, due à la lumière entrant par la face du dessus de plaquettes à plat (seulement Soleil sous 32°)",circumhorizontal:"Arc circumhorizontal — une bande colorée basse dans le ciel, due à la lumière entrant par la face latérale de plaquettes à plat (seulement Soleil au-dessus de 58°)",parhelicCircle:"Cercle parhélique — un cercle blanc faisant tout le tour du ciel à la hauteur du Soleil, dû aux reflets sur les faces verticales de plaquettes à plat",pillar:"Pilier de lumière — une colonne de lumière dressée au-dessus du Soleil, due aux reflets sur des plaquettes à plat légèrement inclinées",subsun:"Sous-soleil — une image du Soleil sous l'horizon, due aux reflets sur les faces plates de plaquettes"},trafficTooltip:{unnamed:"Aéronef {hex}",altitude:"{value} ft",speed:"{value} kt",heading:"cap {value}°",position:"à {distance} km, {elevation}° au-dessus de l'horizon, {bearing}",heard:"Entendu à {level} dB(A), parti de l'avion il y a {delay} s, {lag}° derrière lui : {character}{pitch}",rumble:"un grondement grave, rien au-delà de {cutoff} Hz",muffled:"un bruit sourd, rien au-delà de {cutoff} Hz",broad:"un souffle large",pitchHigher:", son plus aigu de {percent} %",pitchLower:", son plus grave de {percent} %",inaudible:"Inaudible ici : {level} dB(A) contre {ambient} dB(A) de bruit ambiant",soundUnknown:"Son non calculable : l'avion n'était pas encore enregistré quand il est parti",contrailPersistent:"Laisse une traînée qui dure : l'air est sursaturé en glace ({rhi} % par rapport à la glace)",contrailShort:"Laisse une traînée brève : l'air est sec par rapport à la glace ({rhi} % par rapport à la glace)",military:"militaire",restricted:"identité masquée par son propriétaire",candidate:"Un candidat compatible, pas une identification"},credits:"Crédits",notAVideo:"Ceci n'est pas une vidéo",isASimulation:"C'est une simulation en temps réel."};export{n as sceneNames_fr};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{K as a,N as o}from"./rr0-scene.mjs";const l={bodies:{sun:"Sole",moon:"Luna",Venus:"Venere",Mars:"Marte",Jupiter:"Giove",Saturn:"Saturno"},stars:{Sirius:"Sirio",Canopus:"Canopo",Arcturus:"Arturo",Procyon:"Procione",Pollux:"Polluce",Castor:"Castore",Regulus:"Regolo"},comets:{"halley-1910":"cometa di Halley","brooks-1911":"cometa Brooks","skjellerup-maristany-1927":"cometa Skjellerup-Maristany","de-kock-paraskevopoulos-1941":"cometa de Kock-Paraskevopoulos","southern-1947":"cometa australe","eclipse-1948":"cometa dell'eclisse","arend-roland-1957":"cometa Arend-Roland","mrkos-1957":"cometa Mrkos","seki-lines-1962":"cometa Seki-Lines","ikeya-seki-1965":"cometa Ikeya-Seki","bennett-1970":"cometa Bennett","white-ortiz-bolelli-1970":"cometa White-Ortiz-Bolelli","kohoutek-1973":"cometa Kohoutek","west-1976":"cometa West","iras-araki-alcock-1983":"cometa IRAS-Araki-Alcock","halley-1986":"cometa di Halley","hyakutake-1996":"cometa Hyakutake","hale-bopp-1997":"cometa Hale-Bopp","mcnaught-2007":"cometa McNaught","lovejoy-2011":"cometa Lovejoy","panstarrs-2013":"cometa PANSTARRS","neowise-2020":"cometa NEOWISE","tsuchinshan-atlas-2024":"cometa Tsuchinshan-ATLAS"},novae:{"sn-1006":"supernova del 1006","sn-1054":"supernova del 1054","sn-1181":"supernova del 1181","sn-1572":"supernova di Tycho","sn-1604":"supernova di Keplero","t-crb-1866":"nova della Corona Boreale 1866","t-aur-1891":"nova dell'Auriga 1891","gk-per-1901":"nova di Perseo 1901","dn-gem-1912":"nova dei Gemelli 1912","v603-aql-1918":"nova dell'Aquila 1918","v476-cyg-1920":"nova del Cigno 1920","rr-pic-1925":"nova del Pittore 1925","dq-her-1934":"nova di Ercole 1934","cp-lac-1936":"nova della Lucertola 1936","cp-pup-1942":"nova della Poppa 1942","t-crb-1946":"nova della Corona Boreale 1946","v446-her-1960":"nova di Ercole 1960","v533-her-1963":"nova di Ercole 1963","hr-del-1967":"nova del Delfino 1967","lv-vul-1968":"nova della Volpetta 1968","fh-ser-1970":"nova del Serpente 1970","v1500-cyg-1975":"nova del Cigno 1975","v842-cen-1986":"nova del Centauro 1986","sn-1987a":"supernova 1987A","v1974-cyg-1992":"nova del Cigno 1992","v382-vel-1999":"nova delle Vele 1999","v1494-aql-1999":"nova dell'Aquila 1999","v4743-sgr-2002":"nova del Sagittario 2002","rs-oph-2006":"nova di Ofiuco 2006","v1280-sco-2007":"nova dello Scorpione 2007","v339-del-2013":"nova del Delfino 2013","v1369-cen-2013":"nova del Centauro 2013","rs-oph-2021":"nova di Ofiuco 2021"},satelliteClasses:{echo:"i palloni Echo","iridium-flares":"i lampi degli Iridium",iss:"la Stazione Spaziale Internazionale","starlink-trains":"i treni di Starlink"},showers:{quadrantids:"Quadrantidi",lyrids:"Liridi di aprile","eta-aquariids":"Eta Aquaridi","alpha-capricornids":"Alfa Capricornidi","southern-delta-aquariids":"Delta Aquaridi australi",perseids:"Perseidi","southern-taurids":"Tauridi australi",draconids:"Draconidi di ottobre",orionids:"Orionidi","northern-taurids":"Tauridi boreali",leonids:"Leonidi",geminids:"Geminidi",ursids:"Ursidi"},lightRigs:{airliner:"Aereo di linea",helicopter:"Elicottero","car-headlights":"Auto, fari accesi","car-hazards":"Auto, luci di emergenza","emergency-beacons":"Lampeggianti di veicolo di soccorso","traffic-signal":"Semaforo","pedestrian-signal":"Semaforo pedonale",streetlamp:"Lampione"},instruments:{eye:"Occhio nudo","rectilinear-lens":"Fotocamera, modello sconosciuto","roamer-1-120":"Roamer 1, pellicola 120","instamatic-126":"Instamatic, pellicola 126","slr-35mm-50":"Reflex 35 mm, obiettivo 50 mm","slr-35mm-zoom":"Reflex 35 mm, zoom 70-210 mm","phone-landscape":"Telefono, in orizzontale","phone-portrait":"Telefono, in verticale",...o.names(),...a.names()},decorKinds:{building:"Edificio",tree:"Albero",shrub:"Arbusto",bridge:"Ponte",wire:"Linea aerea",crop:"Filare di coltura",terrace:"Terrazzamento",mound:"Mucchio di pietre",wall:"Muretto a secco",streetlight:"Lampione",trafficlight:"Semaforo",crossing:"Attraversamento pedonale",roadsign:"Segnale stradale",vehicle:"Veicolo",observer:"Osservatore",aircraft:"Aeromobile",entity:"Essere"},compassPoints:["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSO","SO","OSO","O","ONO","NO","NNO"],towards:e=>`verso ${e}`,starTooltip:"{name} — mag {mag}, {alt}° sopra l'orizzonte",starTooltipBelow:"{name} — mag {mag}, {alt}° sotto l'orizzontale",decorTooltip:"{name} — {size}, a {distance}",satelliteTooltip:"{name} — satellite, mag {mag}, a {height} km di quota",opticsTooltips:{halo22:"Alone di 22° — un anello attorno al Sole, dovuto alla luce deviata da cristalli di ghiaccio esagonali nei cirri; il bordo interno è rosso, a 21,7°",halo46:"Alone di 46° — un anello più raro e debole: la luce entra da una faccia laterale del cristallo ed esce da una faccia di estremità",oddRadius:"Alone di {angle}° — un anello a raggio dispari, raro e debole, prodotto da cristalli di ghiaccio con estremità piramidali",parhelion:"Parelio — una macchia luminosa colorata accanto al Sole, alla sua altezza, da lastrine di ghiaccio che cadono piatte; rosso verso il Sole",parhelion120:"Parelio di 120° — una debole macchia bianca a 120° dal Sole, da luce riflessa dentro lastrine piatte",upperTangentArc:"Arco tangente superiore — un arco luminoso appoggiato sull'alone di 22°, da colonne coricate in orizzontale",lowerTangentArc:"Arco tangente inferiore — un arco che tocca la base dell'alone di 22°, da colonne coricate in orizzontale",circumzenithal:"Arco circumzenitale — una banda di colori vivi vicino allo zenit, da luce che entra dalla faccia superiore di lastrine piatte (solo con il Sole sotto i 32°)",circumhorizontal:"Arco circumorizzontale — una banda colorata bassa nel cielo, da luce che entra dalla faccia laterale di lastrine piatte (solo con il Sole sopra i 58°)",parhelicCircle:"Cerchio parelico — un cerchio bianco attorno a tutto il cielo all'altezza del Sole, da riflessi sulle facce verticali di lastrine piatte",pillar:"Colonna di luce — un fascio di luce sopra il Sole, da riflessi su lastrine piatte leggermente inclinate",subsun:"Sotto-sole — un'immagine del Sole sotto l'orizzonte, da riflessi sulle facce piatte delle lastrine"},trafficTooltip:{unnamed:"Aeromobile {hex}",altitude:"{value} ft",speed:"{value} kt",heading:"prua {value}°",position:"a {distance} km, {elevation}° sopra l'orizzonte, {bearing}",heard:"Si sente a {level} dB(A), partito dall'aereo {delay} s fa, {lag}° dietro di esso: {character}{pitch}",rumble:"un rombo grave, nulla oltre {cutoff} Hz",muffled:"un rumore sordo, nulla oltre {cutoff} Hz",broad:"un fragore ampio",pitchHigher:", suono più acuto del {percent} %",pitchLower:", suono più grave del {percent} %",inaudible:"Non si sente qui: {level} dB(A) contro {ambient} dB(A) di rumore ambientale",soundUnknown:"Suono non calcolabile: l'aereo non era ancora registrato quando è partito",contrailPersistent:"Lascia una scia che dura: l'aria è sovrasatura rispetto al ghiaccio ({rhi} % rispetto al ghiaccio)",contrailShort:"Lascia una scia breve: l'aria è secca rispetto al ghiaccio ({rhi} % rispetto al ghiaccio)",military:"militare",restricted:"identità nascosta dal proprietario",candidate:"Un candidato compatibile, non un'identificazione"},credits:"Crediti",notAVideo:"Questo non è un video",isASimulation:"È una simulazione in tempo reale."};export{l as sceneNames_it};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{I as ee,F,
|
|
1
|
+
import{I as ee,F,f as G,h as M,W as te,i as j,j as $,k as E,m as ie,n as I,U as J,V as ne,o as O,b as se,p as B,q as oe,s as ae,t as re,G as le,C as ce,D as de,B as fe,P as ue,u as pe,v as he,w as me,x as V,g as ge}from"./rr0-scene.mjs";const k=new j,P=new E;class Q extends ee{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],n=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],i=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(i),this.setAttribute("position",new F(e,3)),this.setAttribute("uv",new F(n,2))}applyMatrix4(e){const n=this.attributes.instanceStart,i=this.attributes.instanceEnd;return n!==void 0&&(n.applyMatrix4(e),i.applyMatrix4(e),n.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));const i=new G(n,6,1);return this.setAttribute("instanceStart",new M(i,3,0)),this.setAttribute("instanceEnd",new M(i,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));const i=new G(n,6,1);return this.setAttribute("instanceColorStart",new M(i,3,0)),this.setAttribute("instanceColorEnd",new M(i,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new te(e.geometry)),this}fromLineSegments(e){const n=e.geometry;return this.setPositions(n.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new j);const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;e!==void 0&&n!==void 0&&(this.boundingBox.setFromBufferAttribute(e),k.setFromBufferAttribute(n),this.boundingBox.union(k))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new $),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;if(e!==void 0&&n!==void 0){const i=this.boundingSphere.center;this.boundingBox.getCenter(i);let t=0;for(let o=0,l=e.count;o<l;o++)P.fromBufferAttribute(e,o),t=Math.max(t,i.distanceToSquared(P)),P.fromBufferAttribute(n,o),t=Math.max(t,i.distanceToSquared(P));this.boundingSphere.radius=Math.sqrt(t),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}}O.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new ne},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};I.line={uniforms:J.merge([O.common,O.fog,O.line]),vertexShader:`
|
|
2
2
|
#include <common>
|
|
3
3
|
#include <color_pars_vertex>
|
|
4
4
|
#include <fog_pars_vertex>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{G as O,M as w,C as A,g as M,b as R,V as v,S as b,B,F as L}from"./rr0-scene.mjs";class r{static LIFT_M=.05;static RENDER_ORDER=1.04;static LEVEL_QUANTILE=.2;static BODY_ALBEDO=[.035,.045,.04];static IOR=1.33;static ROUGHNESS=.08;static MAX_SAMPLES=48;group=new O;material=new w({color:new A(...r.BODY_ALBEDO),roughness:r.ROUGHNESS,metalness:0,ior:r.IOR,polygonOffset:!0,polygonOffsetFactor:-2,polygonOffsetUnits:-2});constructor(){this.group.name="water"}set(s,e,n,p,t,o){this.clear();for(const l of s){const f=l.rings.map(i=>r.clip(i.map(h=>M(h.lat,h.lng,e,n)),t)),a=f[0];if(!a||a.length<3)continue;const g=f.slice(1).filter(i=>i.length>=3),u=r.level(a,g,p,o);if(u===void 0)continue;const c=r.geometry(a,g,u+r.LIFT_M);if(!c)continue;const x=new R(c,this.material);x.name=`water ${l.id}`,x.renderOrder=r.RENDER_ORDER,x.receiveShadow=!0,this.group.add(x)}}get count(){return this.group.children.length}clear(){for(const s of[...this.group.children])s.geometry.dispose(),this.group.remove(s)}dispose(){this.clear(),this.material.dispose()}static level(s,e,n,p){const t=s.map(i=>i.x),o=s.map(i=>i.z),[l,f,a,g]=[Math.min(...t),Math.max(...t),Math.min(...o),Math.max(...o)],u=Math.max(p,(f-l)/r.MAX_SAMPLES,(g-a)/r.MAX_SAMPLES,.5),c=[];for(let i=a+u/2;i<g;i+=u)for(let h=l+u/2;h<f;h+=u){const z={x:h,z:i};if(!r.contains(s,z)||e.some(E=>r.contains(E,z)))continue;const d=n(h,i);Number.isFinite(d)&&c.push(d)}if(c.length===0)for(const i of s)c.push(n(i.x,i.z));const x=c.filter(Number.isFinite).sort((i,h)=>i-h);if(x.length!==0)return x[Math.floor((x.length-1)*r.LEVEL_QUANTILE)]}static clip(s,e){let n=s;const p=[{inside:t=>t.x>=-e,cross:(t,o)=>r.atX(t,o,-e)},{inside:t=>t.x<=e,cross:(t,o)=>r.atX(t,o,e)},{inside:t=>t.z>=-e,cross:(t,o)=>r.atZ(t,o,-e)},{inside:t=>t.z<=e,cross:(t,o)=>r.atZ(t,o,e)}];for(const t of p){const o=[];for(let l=0;l<n.length;l++){const f=n[l],a=n[(l+n.length-1)%n.length];t.inside(f)?(t.inside(a)||o.push(t.cross(a,f)),o.push(f)):t.inside(a)&&o.push(t.cross(a,f))}if(n=o,n.length===0)break}return n}static atX(s,e,n){return{x:n,z:s.z+(e.z-s.z)*(n-s.x)/(e.x-s.x)}}static atZ(s,e,n){return{x:s.x+(e.x-s.x)*(n-s.z)/(e.z-s.z),z:n}}static contains(s,e){let n=!1;for(let p=0,t=s.length-1;p<s.length;t=p++){const o=s[p],l=s[t];o.z>e.z!=l.z>e.z&&e.x<(l.x-o.x)*(e.z-o.z)/(l.z-o.z)+o.x&&(n=!n)}return n}static geometry(s,e,n){const p=c=>new v(c.x,c.z),t=s.map(p),o=e.map(c=>c.map(p)),l=b.triangulateShape(t,o);if(l.length===0)return;const f=[...t,...o.flat()],a=[];for(const[c,x,i]of l){const[h,z,d]=[f[c],f[x],f[i]],E=(z.y-h.y)*(d.x-h.x)-(z.x-h.x)*(d.y-h.y)>0;for(const m of E?[h,z,d]:[h,d,z])a.push(m.x,n,m.y)}const g=new B;g.setAttribute("position",new L(a,3));const u=new Float32Array(a.length);for(let c=1;c<u.length;c+=3)u[c]=1;return g.setAttribute("normal",new L(u,3)),g.computeBoundingSphere(),g}}export{r as WaterSystem};
|