js实现三维3a逼真射击游戏代码

代码语言:html

所属分类:其他

代码描述:js实现三维3a逼真射击游戏代码,全部资源在一个文件中,无引入资源,由fable 5.2生成单个html文件,媲美3A游戏大作。

代码标签: js 三维 3a 逼真 射击 游戏 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
<title>Play Saltline Online | Free 3D Browser FPS</title>

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@500;700;900&family=IBM+Plex+Mono:wght@400;500&family=Barlow+Condensed:wght@400;500;600&display=swap">

<style>
:root {
  color-scheme: dark;
  --ink: #0b0d0f; --ink-2: #14181b; --bone: #e8e4da; --bone-dim: rgba(232, 228, 218, .64); --bone-faint: rgba(232, 228, 218, .24);
  --signal: #ffb347; --signal-hot: #ffc977; --rust: #d2622a; --steel: #8d9aa3; --alarm: #ff5a40;
  --line: rgba(232, 228, 218, .2); --plate: rgba(11, 13, 15, .6); --plate-solid: rgba(11, 13, 15, .9);
  --f-display: 'Big Shoulders Display', 'Impact', 'Haettenschweiler', 'Arial Narrow', sans-serif;
  --f-label: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --gl: max(16px, env(safe-area-inset-left, 0px)); --gr: max(16px, env(safe-area-inset-right, 0px));
  --shadow: 0 0 2px rgba(0, 0, 0, .75), 0 1px 5px rgba(0, 0, 0, .55);
}
html, body { height: 100%; margin: 0; }
body { background: var(--ink); color: var(--bone); overflow: hidden; font-family: var(--f-label); -webkit-text-size-adjust: 100%; }
#app { position: fixed; inset: 0; overflow: hidden; background: var(--ink); -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#app *, #app *::before, #app *::after { box-sizing: border-box; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
#ui { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

/* ---- boot ---- */
#boot { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--ink); transition: opacity .6s ease; z-index: 50;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
#boot.done { opacity: 0; pointer-events: none; }
.boot-mark { font-family: var(--f-display); font-weight: 900; font-size: clamp(40px, 9vw, 96px); letter-spacing: .16em; margin-right: -.16em; color: var(--bone); line-height: 1; }
.boot-sub { font-family: var(--f-mono); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--steel); text-align: center; }
.boot-bar { width: min(320px, 70vw); height: 2px; background: #23282c; }
.boot-bar i { display: block; height: 100%; width: 0%; background: var(--signal); transition: width .25s ease; }
#fatal { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + var(--sab)) max(16px, env(safe-area-inset-left, 0px)); font: 12px/1.4 var(--f-mono); color: #ffb4a8; background: rgba(40, 8, 4, .85); white-space: pre-wrap; z-index: 99; max-height: 40%; overflow: auto; pointer-events: auto; -webkit-user-select: text; user-select: text; }

/* =====================================================================  HUD  */
.hud { position: absolute; inset: 0; opacity: 0; transition: opacity .35s ease; pointer-events: none; color: var(--bone); text-shadow: var(--shadow); }
.hud.on { opacity: 1; }
.h-k { font: 600 11px/1 var(--f-label); letter-spacing: .26em; text-transform: uppercase; color: rgba(232, 228, 218, .72); }

/* compass */
.h-compass { position: absolute; top: calc(12px + var(--sat)); left: 50%; width: min(420px, calc(100vw - var(--gl) - var(--gr) - 8px)); height: 60px; transform: translateX(-50%); }
.h-tape-wrap { position: absolute; left: 0; right: 0; top: 0; height: 28px; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent); mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent); }
.h-tape { position: absolute; left: 0; top: 0; height: 100%; width: 2168px; will-change: transform; }
.h-tape i { position: absolute; bottom: 0; width: 1px; margin-left: -.5px; background: var(--bone); box-shadow: 0 0 2px rgba(0, 0, 0, .6); }
.h-tape i.mn { height: 4px; opacity: .45; } .h-tape i.md { height: 7px; opacity: .8; } .h-tape i.mj { height: 10px; width: 2px; margin-left: -1px; }
.h-tape b { position: absolute; top: 0; transform: translateX(-50%); font-weight: 400; white-space: nowrap; }
.h-tape b.card { font: 700 16px/1 var(--f-display); letter-spacing: .04em; }
.h-tape b.ic { font: 600 11px/1.4 var(--f-label); color: var(--bone-dim); letter-spacing: .08em; }
.h-tape b.num { font: 400 9px/1.7 var(--f-mono); color: var(--bone-dim); }
.h-needle { position: absolute; left: 50%; top: 14px; width: 2px; height: 16px; margin-left: -1px; background: var(--signal); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }
.h-heading { position: absolute; left: 100%; top: 9px; margin-left: 6px; font: 500 11px/1 var(--f-mono); color: var(--bone-dim); letter-spacing: .06em; }
.h-cmarks { position: absolute; left: 50%; top: 33px; width: 0; height: 0; }
.h-cm { position: absolute; left: -24px; top: 0; width: 48px; text-align: center; will-change: transform; color: var(--signal); }
.h-cm i { display: block; width: 8px; height: 8px; margin: 0 auto 3px; border: 1.5px solid currentColor; transform: rotate(45deg); background: rgba(11, 13, 15, .5); }
.h-cm b { font: 700 13px/1 var(--f-display); letter-spacing: .06em; margin-right: 4px; }
.h-cm span { font: 400 10px/1 var(--f-mono); color: var(--bone); }
.h-cm.edge { opacity: .55; }
.h-cm.extract { color: var(--bone); } .h-cm.extract i { background: var(--bone); }

/* objective tracker */
.h-obj { position: absolute; top: calc(16px + var(--sat)); left: var(--gl); max-width: min(300px, 42vw); padding-left: 12px; border-left: 2px solid var(--signal); opacity: 0; transition: opacity .3s; }
.h-obj.has { opacity: 1; }
.h-obj-t { font: 600 20px/1.1 var(--f-label); letter-spacing: .05em; text-transform: uppercase; margin: 6px 0 9px; min-height: 22px; }
.h-relays { display: flex; align-items: center; gap: 5px; font: 600 11px/1 var(--f-label); letter-spacing: .22em; text-transform: uppercase; color: rgba(232, 228, 218, .72); }
.h-relays span { margin-right: 4px; }
.h-relays i { width: 9px; height: 9px; border: 1.5px solid var(--bone); box-shadow: 0 0 2px rgba(0, 0, 0, .6); }
.h-relays i.cut { background: var(--signal); border-color: var(--signal); }
.h-relays b { font: 500 11px/1 var(--f-mono); letter-spacing: .04em; color: var(--bone); margin-left: 5px; }
@keyframes objflash { 0% { border-left-color: var(--bone); } 100% { border-left-color: var(--signal); } }
.h-obj.flash { animation: objflash .9s ease-out; }

/* wave warning */
.h-warn { position: absolute; left: 50%; top: 21%; transform: translateX(-50%); white-space: nowrap; opacity: 0; color: var(--signal);
  font: 700 clamp(20px, 3.6vw, 38px)/1 var(--f-display); letter-spacing: .24em; margin-right: -.24em; text-transform: uppercase; padding: 9px 0 8px; border-top: 1px solid currentColor; border-bottom: 1px solid currentColor; }
@keyframes warn { 0% { opacity: 0; letter-spacing: .5em; } 8% { opacity: 1; letter-spacing: .24em; } 14% { opacity: .35; } 20%, 82% { opacity: 1; } 100% { opacity: 0; } }
.h-warn.on { animation: warn 3.4s linear both; }

/* crosshair + hit marker */
.h-cross { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transition: opacity .1s; }
.h-cross.off { opacity: 0; }
.h-cross i { position: absolute; left: 0; top: 0; background: var(--bone); box-shadow: 0 0 0 1px rgba(0, 0, 0, .4); transition: transform .06s linear; }
.h-cross .c-t, .h-cross .c-b { width: 2px; height: 9px; transform: translate3d(-50%, 0, 0); }
.h-cross .c-l, .h-cross .c-r { width: 9px; height: 2px; transform: translate3d(0, -50%, 0); }
.h-cross .c-dot { width: 2px; height: 2px; margin: -1px 0 0 -1px; opacity: .85; }
.h-hit { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; transform: translate(-50%, -50%); opacity: 0; }
.h-hit i { position: absolute; width: 2px; height: 11px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }
.h-hit i:nth-child(1) { left: 3px; top: 0; transform: rotate(-45deg); } .h-hit i:nth-child(2) { right: 3px; top: 0; transform: rotate(45deg); }
.h-hit i:nth-child(3) { left: 3px; bottom: 0; transform: rotate(45deg); } .h-hit i:nth-child(4) { right: 3px; bottom: 0; transform: rotate(-45deg); }
.h-hit.weak i { background: var(--signal); } .h-hit.kill i { background: var(--alarm); width: 3px; }

/* damage direction */
.h-arcs { position: absolute; inset: 0; }
.h-arc { position: absolute; left: 50%; top: 50%; width: min(72vh, 94vw); aspect-ratio: 1; transform: translate(-50%, -50%); opacity: 0; will-change: transform, opacity; }
.h-arc svg { width: 100%; height: 100%; display: block; overflow: visible; }
.h-arc path { fill: none; stroke: var(--alarm); stroke-width: 4; opacity: .9; }
.h-arc path.tip { stroke-width: 2.5; }

/* interaction prompt */
.h-prompt { position: absolute; left: 50%; top: 61%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; opacity: 0; transition: opacity .15s; white-space: nowrap; }
.h-prompt.on { opacity: 1; }
.h-prompt svg { width: 48px; height: 48px; flex: none; }
.h-prompt circle { fill: none; stroke-width: 3; }
.h-prompt .bg { stroke: var(--bone-faint); fill: rgba(11, 13, 15, .5); } .h-prompt .fg { stroke: var(--signal); }
.h-key { position: absolute; left: 0; top: 0; width: 48px; line-height: 48px; text-align: center; font: 700 19px/48px var(--f-display); letter-spacing: .04em; }
.h-key.wide { font-size: 12px; letter-spacing: .1em; }
.h-plabel { font: 600 16px/1 var(--f-label); letter-spacing: .14em; text-transform: uppercase; padding: 7px 10px 6px; background: var(--plate); border-left: 2px solid var(--signal); }
.h-prompt.busy .h-plabel { color: var(--signal); }

/* kill feed + transient message */
.h-feed { position: absolute; right: var(--gr); top: 31%; text-align: right; }
.h-fl { font: 500 13px/1.5 var(--f-label); letter-spacing: .18em; text-transform: uppercase; color: var(--bone-dim); transition: opacity .5s; }
.h-fl b { font-weight: 600; color: var(--bone); } .h-fl em { font-style: normal; color: var(--signal); margin-left: 10px; }
.h-fl.out { opacity: 0; }
.h-msg { position: absolute; left: 50%; bottom: calc(23% + var(--sab)); transform: translateX(-50%); max-width: calc(100vw - var(--gl) - var(--gr)); text-align: center; padding: 6px 10px; background: var(--plate);
  font: 400 11px/1.4 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; opacity: 0; transition: opacity .3s; }
.h-msg.on { opacity: 1; }

/* health (only while hurt) */
.h-health { position: absolute; left: var(--gl); bottom: calc(22px + var(--sab)); opacity: 0; transition: opacity .6s; }
.h-health.on { opacity: 1; transition-duration: .12s; }
.h-hp-row { display: flex; align-items: flex-end; gap: 10px; margin-top: 6px; }
.h-hp-n { font: 700 34px/.82 var(--f-display); letter-spacing: .02em; min-width: 1.6em; }
.h-hp-bar { display: flex; gap: 3px; padding-bottom: 2px; }
.h-hp-bar i { width: 15px; height: 5px; background: var(--bone); box-shadow: 0 0 2px rgba(0, 0, 0, .6); }
.h-hp-bar i.off { background: transparent; box-shadow: inset 0 0 0 1px var(--bone-faint); }
.h-health.crit .h-hp-n { color: var(--alarm); } .h-health.crit .h-hp-bar i:not(.off) { background: var(--alarm); }

/* ammo */
.h-ammo { position: absolute; right: var(--gr); bottom: calc(20px + var(--sab)); text-align: right; }
.h-cue { height: 16px; font: 600 12px/16px var(--f-label); letter-spacing: .26em; margin-right: -.26em; text-transform: uppercase; color: var(--signal); opacity: 0; }
.h-cue.on { opacity: 1; } .h-cue.urgent { color: var(--alarm); animation: blink .7s steps(2, jump-none) infinite; }
@keyframes blink { 0% { opacity: 1; } 100% { opacity: .35; } }
.h-ammo-row { display: flex; align-items: flex-end; justify-content: flex-end; gap: 8px; }
.h-ammo-n { font: 700 76px/.8 var(--f-display); letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.h-ammo-r { font: 500 15px/1 var(--f-mono); color: var(--bone); padding-bottom: 3px; }
.h-ammo-r::before { content: '/ '; color: var(--bone-dim); }
.h-ammo.low .h-ammo-n { color: var(--signal); }
.h-pips { display: flex; justify-content: flex-end; gap: 2px; margin: 9px 0 7px; }
.h-pips i { width: 3px; height: 11px; background: var(--bone); box-shadow: 0 0 2px rgba(0, 0, 0, .5); }
.h-pips i.off { background: var(--bone-faint); box-shadow: none; }
.h-ammo.low .h-pips i:not(.off) { background: var(--signal); }
.h-wname { font: 600 11px/1 var(--f-label); letter-spacing: .28em; margin-right: -.28em; text-transform: uppercase; color: rgba(232, 228, 218, .82); }

/* world-space objective diamonds */
.h-marks { position: absolute; inset: 0; transition: opacity .15s; } .h-marks.off { opacity: 0; }
.h-wm { position: absolute; left: 0; top: 0; width: 0; height: 0; color: var(--signal); will-change: transform; opacity: .78; transition: opacity .25s; }
.h-wm.dim { opacity: .22; }
.h-wm i { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border: 1.5px solid currentColor; transform: rotate(45deg); background: rgba(11, 13, 15, .45); box-shadow: 0 0 3px rgba(0, 0, 0, .5); }
.h-wm b { position: absolute; left: -30px; width: 60px; top: -24px; text-align: center; font: 700 12px/1 var(--f-display); letter-spacing: .08em; }
.h-wm span { position: absolute; left: -30px; width: 60px; top: 11px; text-align: center; font: 400 10px/1 var(--f-mono); color: var(--bone); }
.h-wm.offscreen { opacity: .7; } .h-wm.offscreen i { left: -5px; top: -5px; width: 10px; height: 10px; } .h-wm.offscreen b { top: -24px; font-size: 12px; }
.h-wm.near { opacity: 0; }
.h-wm.extract { color: var(--bone); } .h-wm.extract i { background: var(--bone); }

/* =====================================================================  radio subtitles  */
.comms { position: absolute; left: 50%; bottom: calc(15% + var(--sab)); transform: translateX(-50%); width: min(620px, calc(100vw - var(--gl) - var(--gr))); text-align: center; opacity: 0; transition: opacity .3s; text-shadow: var(--shadow); }
.comms.on { opacity: 1; }
.comms-who { display: block; font: 600 11px/1 var(--f-label); letter-spacing: .34em; margin-right: -.34em; text-transform: uppercase; color: var(--signal); margin-bottom: 6px; }
.comms-t { display: inline; font: 500 19px/1.3 var(--f-label); letter-spacing: .02em; color: var(--bone); background: var(--plate); box-decoration-break: clone; -webkit-box-decoration-break: clone; padding: 2px 8px; }

/* =====================================================================  touch controls  */
.touch { position: absolute; inset: 0; display: none; pointer-events: none; }
.touch.on { display: block; }
.t-stick { position: absolute; left: 0; top: 0; width: 0; height: 0; opacity: 0; transition: opacity .12s; }
.t-stick.on { opacity: 1; }
.t-ring { position: absolute; left: -58px; top: -58px; width: 116px; height: 116px; border-radius: 50%; border: 1.5px solid rgba(232, 228, 218, .5); background: rgba(11, 13, 15, .18); }
.t-nub { position: absolute; left: -24px; top: -24px; width: 48px; height: 48px; border-radius: 50%; background: rgba(232, 228, 218, .3); border: 1.5px solid rgba(232, 228, 218, .7); }
.t-btn { position: absolute; pointer-events: auto; touch-action: none; border-radius: 50%; border: 1.5px solid rgba(232, 228, 218, .55); background: rgba(11, 13, 15, .38); color: var(--bone);
  font: 600 12px/1 var(--f-label); letter-spacing: .14em; padding: 0; margin: 0; -webkit-appearance: none; appearance: none; }
.t-btn span { pointer-events: none; margin-right: -.14em; }
.t-btn.active { background: rgba(255, 179, 71, .32); border-color: var(--signal); color: var(--signal); }
.t-fire { width: 86px; height: 86px; right: calc(20px + var(--sar)); bottom: calc(62px + var(--sab)); font-size: 14px; }
.t-ads { width: 60px; height: 60px; right: calc(120px + var(--sar)); bottom: calc(34px + var(--sab)); }
.t-jump { width: 60px; height: 60px; right: calc(20px + var(--sar)); bottom: calc(164px + var(--sab)); }
.t-reload { width: 54px; height: 54px; right: calc(108px + var(--sar)); bottom: calc(126px + var(--sab)); }
.t-interact { width: 68px; height: 68px; right: calc(186px + var(--sar)); bottom: calc(96px + var(--sab)); border-color: var(--signal); color: var(--signal); display: none; }
.t-interact.on { display: block; }
.t-pause { width: 42px; height: 42px; border-radius: 0; right: calc(12px + var(--sar)); top: calc(12px + var(--sat)); letter-spacing: .2em; }
/* touch layout: keep the thumbs' corners clear */
.is-touch .h-ammo { bottom: auto; top: calc(64px + var(--sat)); }
.is-touch .h-ammo-n { font-size: 44px; } .is-touch .h-pips { margin: 6px 0 5px; } .is-touch .h-pips i { height: 7px; width: 2px; }
.is-touch .h-health { bottom: auto; top: calc(128px + var(--sat)); }
.is-touch .h-feed { top: calc(150px + var(--sat)); }
.is-touch .comms { bottom: auto; top: calc(27% + var(--sat)); }
.is-touch .h-compass { width: min(300px, calc(100vw - var(--gl) - var(--gr) - 120px)); }

/* =====================================================================  menus  */
.menu { position: absolute; inset: 0; pointer-events: none; color: var(--bone); }
.menu.open { pointer-events: auto; }
.menu h1, .menu h2, .menu h3, .menu p, .menu dl, .menu dd, .menu dt { margin: 0; padding: 0; }
.m-veil { position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease; background: rgba(6, 8, 10, .62); }
.menu.open .m-veil { opacity: 1; }
/* title: a reading scrim on the text side only — the scene stays the picture */
.menu[data-screen="title"] .m-veil { background: linear-gradient(90deg, rgba(6, 8, 10, .82) 0%, rgba(6, 8, 10, .5) 38%, rgba(6, 8, 10, 0) 72%), linear-gradient(0deg, rgba(6, 8, 10, .7) 0%, rgba(6, 8, 10, 0) 46%); }
.menu[data-screen="dead"] .m-veil { background: rgba(6, 8, 10, .35); }
.m-bars i { position: absolute; left: 0; right: 0; height: calc(clamp(14px, 5.5vh, 52px) + var(--sat)); background: #000; top: 0; transform: translateY(-101%); transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.m-bars i + i { top: auto; bottom: 0; height: calc(clamp(14px, 5.5vh, 52px) + var(--sab)); transform: translateY(101%); }
.menu[data-screen="title"] .m-bars i { transform: none; }

.m-screen { position: absolute; display: none; }
.menu[data-screen="title"] .m-title { display: flex; }
.menu[data-screen="paused"] [data-s="paused"], .menu[data-screen="dead"] [data-s="dead"], .menu[data-screen="complete"] [data-s="complete"] { display: block; }

/* ---- title ---- */
.m-title { inset: 0; align-items: flex-end; justify-content: space-between; gap: 32px;
  padding: calc(clamp(14px, 5.5vh, 52px) + var(--sat) + 20px) max(var(--gr), 4.5vw) calc(clamp(14px, 5.5vh, 52px) + var(--sab) + clamp(18px, 5vh, 56px)) max(var(--gl), 5.5vw); }
.m-title-main { min-width: 0; flex: 1 1 auto; }
.m-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font: 600 13px/1.2 var(--f-label); letter-spacing: .24em; text-transform: uppercase; }
.m-tag { font: 900 15px/1 var(--f-display); letter-spacing: .06em; color: var(--ink); background: var(--signal); padding: 4px 7px 3px; }
.m-dim { color: var(--bone-dim); }
.m-word { font: 900 clamp(52px, 15.5vw, 208px)/.8 var(--f-display) !important; letter-spacing: .15em !important; margin: clamp(10px, 2vh, 22px) -.15em clamp(12px, 2.2vh, 24px) -.035em !important; color: var(--bone); white-space: nowrap; text-shadow: 0 2px 30px rgba(0, 0, 0, .35); }
.m-premise { position: relative; padding-top: 16px !important; border-top: 1px solid var(--line); font: 500 clamp(17px, 1.55vw, 22px)/1.3 var(--f-label); letter-spacing: .03em; color: rgba(232, 228, 218, .9); max-width: 40em; }
.m-premise::before { content: ''; position: absolute; left: 0; top: -2px; width: 72px; height: 3px; background: var(--signal); }
.m-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(16px, 3vh, 28px); }
.m-actions.col { flex-direction: column; align-items: stretch; margin-top: 22px; }
.m-note { margin-top: clamp(14px, 2.6vh, 26px) !important; font: 400 11px/1.5 var(--f-mono); letter-spacing: .04em; color: var(--steel); max-width: 52ch; }

.btn { font: 600 15px/1 var(--f-label); letter-spacing: .22em; text-transform: uppercase; color: var(--bone); background: rgba(11, 13, 15, .55); border: 1px solid rgba(232, 228, 218, .42);
  border-radius: 0; min-height: 46px; padding: 2px 22px 0; cursor: pointer; text-align: center; -webkit-appearance: none; appearance: none; transition: background .12s, border-color .12s, color .12s; }
.btn:hover { border-color: var(--bone); background: rgba(232, 228, 218, .12); }
.btn:active { background: rgba(232, 228, 218, .22); }
.btn.primary { background: var(--signal); border-color: var(--signal); color: var(--ink); font-size: 18px; font-weight: 600; letter-spacing: .3em; min-height: 52px; padding: 2px 40px 0 44px; }
.btn.primary:hover { background: var(--signal-hot); border-color: var(--signal-hot); }
.btn.small { min-height: 34px; font-size: 12px; padding: 1px 14px 0; }
.m-actions.col .btn { text-align: left; padding-left: 18px; }
.menu button:focus-visible, .menu input:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
.btn.primary:focus-visible { outline-color: var(--bone); }

/* controls at a glance on the title (wide screens; the Controls button covers the rest) */
.m-legend { display: none; flex: none; text-align: right; text-shadow: var(--shadow); padding-bottom: 2px; }
.m-legend > div { display: flex; justify-content: flex-end; align-items: center; gap: 18px; margin-top: 9px; font: 500 12px/1 var(--f-label); letter-spacing: .16em; text-transform: uppercase; color: rgba(232, 228, 218, .78); white-space: nowrap; }
.m-legend kbd { margin-right: 3px; background: rgba(11, 13, 15, .45); }
.m-legend .lg-touch { margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); color: var(--bone-dim); }
.m-legend em { font-style: normal; color: var(--signal); letter-spacing: .26em; }
@media (min-width: 1180px) and (min-height: 600px) { .m-legend { display: block; } }
.keys > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 3px 0; }
.keys dt { font: 500 12px/1.3 var(--f-label); letter-spacing: .16em; text-transform: uppercase; color: var(--steel); white-space: nowrap; }
.keys dd { font: 500 13px/1.3 var(--f-label); letter-spacing: .04em; color: var(--bone); text-align: right; }
kbd { display: inline-block; font: 500 10px/1 var(--f-mono); color: var(--bone); border: 1px solid rgba(232, 228, 218, .45); padding: 3px 4px 2px; margin: 0 1px; min-width: 18px; text-align: center; text-transform: uppercase; }

/* ---- cards: paused / dead / debrief ---- */
.m-card { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(430px, calc(100vw - var(--gl) - var(--gr))); max-height: calc(100vh - 24px - var(--sat) - var(--sab)); overflow: auto;
  padding: 26px 26px 24px; background: var(--plate-solid); border: 1px solid var(--line); border-top: 3px solid var(--signal); }
.m-card.m-dead { border-top-color: var(--alarm); }
.m-k { font: 600 12px/1 var(--f-label); letter-spacing: .28em; text-transform: uppercase; color: var(--steel); }
.m-h { font: 900 clamp(40px, 11vw, 62px)/.86 var(--f-display) !important; letter-spacing: .08em; text-transform: uppercase; margin: 10px 0 12px !important; }
.m-dead .m-h { color: var(--alarm); }
.m-debrief .m-h { font-size: clamp(30px, 8.6vw, 44px) !important; white-space: nowrap; }
.m-line { font: 400 11px/1.5 var(--f-mono); letter-spacing: .04em; color: var(--steel); min-height: 1px; }
.m-stats > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0 8px; border-top: 1px solid var(--line); }
.m-stats > div:last-child { border-bottom: 1px solid var(--line); }
.m-stats dt { font: 500 13px/1 var(--f-label); letter-spacing: .18em; text-transform: uppercase; color: var(--steel); }
.m-stats dd { font: 500 16px/1 var(--f-mono); color: var(--bone); }
.m-rating { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin: 4px 0 12px; }
.m-rating span { font: 500 13px/1 var(--f-label); letter-spacing: .18em; text-transform: uppercase; color: var(--steel); }
.m-rating b { font: 900 46px/.9 var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: var(--signal); }

/* ---- settings / controls panel ---- */
.panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); display: flex; flex-direction: column; background: rgba(11, 13, 15, .95); border-left: 1px solid var(--line);
  padding: calc(10px + var(--sat)) 0 var(--sab); z-index: 5; }
.panel[hidden] { display: none; }
.panel:focus { outline: none; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px max(20px, var(--sar)) 0 22px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 22px; }
.tab { font: 600 15px/1 var(--f-label); letter-spacing: .22em; text-transform: uppercase; color: var(--steel); background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 14px 0 12px; cursor: pointer; margin-bottom: -1px; }
.tab[aria-selected="true"] { color: var(--bone); border-bottom-color: var(--signal); }
.tab:hover { color: var(--bone); }
.panel-b { flex: 1 1 auto; overflow-y: auto; padding: 6px max(20px, var(--sar)) 24px 22px; -webkit-overflow-scrolling: touch; }
.panel-b[hidden] { display: none; }
.panel-b h3 { font: 600 11px/1 var(--f-label); letter-spacing: .26em; text-transform: uppercase; color: var(--steel); margin: 20px 0 8px !important; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.panel-note { font: 400 11px/1.6 var(--f-mono); letter-spacing: .02em; color: var(--steel); margin-top: 14px !important; }
.row { padding: 15px 0 16px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.row[hidden] { display: none; }
.row .btn.small { justify-self: start; min-height: 38px; }
.row label { font: 600 13px/1 var(--f-label); letter-spacing: .2em; text-transform: uppercase; color: var(--bone); }
.seg { display: flex; }
.seg button { flex: 1 1 0; min-width: 0; min-height: 40px; font: 600 13px/1 var(--f-label); letter-spacing: .16em; text-transform: uppercase; color: var(--bone-dim); background: transparent; border: 1px solid rgba(232, 228, 218, .35); border-radius: 0; margin-left: -1px; padding: 1px 0 0; cursor: pointer; }
.seg button:first-child { margin-left: 0; }
.seg button:hover { color: var(--bone); }
.seg button[aria-pressed="true"] { background: var(--bone); border-color: var(--bone); color: var(--ink); position: relative; }
.slider { display: flex; align-items: center; gap: 14px; }
.slider output { font: 500 13px/1 var(--f-mono); color: var(--bone); min-width: 5ch; text-align: right; }
.slider input { flex: 1 1 auto; min-width: 0; height: 28px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.slider input::-webkit-slider-runnable-track { height: 2px; background: rgba(232, 228, 218, .35); }
.slider input::-moz-range-track { height: 2px; background: rgba(232, 228, 218, .35); }
.slider input::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 22px; margin-top: -10px; background: var(--signal); border: 0; border-radius: 0; }
.slider input::-moz-range-thumb { width: 10px; height: 22px; background: var(--signal); border: 0; border-radius: 0; }
.toggle { display: inline-flex; align-items: center; gap: 12px; justify-self: start; background: none; border: 0; padding: 4px 0; color: var(--bone); cursor: pointer; font: 500 13px/1 var(--f-mono); }
.toggle i { position: relative; width: 44px; height: 22px; border: 1px solid rgba(232, 228, 218, .45); }
.toggle i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 14px; background: var(--bone-dim); transition: transform .12s, background .12s; }
.toggle[aria-pressed="true"] i { border-color: var(--signal); } .toggle[aria-pressed="true"] i::after { transform: translateX(20px); background: var(--signal); }

/* ---- intro location card ---- */
.loc-card { position: absolute; left: max(var(--gl), 5.5vw); bottom: calc(28vh + var(--sab)); padding-left: 16px; opacity: 0; transition: opacity .5s; text-shadow: var(--shadow); max-width: calc(100vw - var(--gl) - var(--gr) - 16px); }
.loc-card i { position: absolute; left: 0; top: 2px; bottom: 2px; width: 3px; background: var(--signal); }
.loc-card b { display: block; font: 700 clamp(19px, 3vw, 34px)/1.05 var(--f-display); letter-spacing: .16em; text-transform: uppercase; }
.loc-card span { display: block; margin-top: 7px; font: 400 11px/1.4 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--bone-dim); }
@keyframes locin { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 -2% 0 0); } }
.loc-card.on { opacity: 1; } .loc-card.on b { animation: locin 1.1s steps(28, end) both; }

/* ---- narrow screens (phones, portrait) ---- */
@media (max-width: 760px) {
  .h-obj { top: calc(78px + var(--sat)); max-width: 62vw; } .h-obj-t { font-size: 17px; }
  .h-heading { display: none; }
  .h-ammo-n { font-size: 56px; }
  .is-touch .h-ammo { top: calc(78px + var(--sat)); }
  .is-touch .h-health { top: calc(150px + var(--sat)); }
  .m-title { padding-left: var(--gl); padding-right: var(--gr); }
  .m-word { font-size: clamp(52px, 20vw, 150px) !important; }
  .m-eyebrow { font-size: 11px; letter-spacing: .2em; }
  .m-actions .btn.primary { flex: 1 1 100%; }
  .m-actions:not(.col) .btn:not(.primary) { flex: 1 1 0; padding-left: 8px; padding-right: 8px; }
  .m-card { padding: 22px 20px 20px; }
  .comms-t { font-size: 17px; }
}
@media (max-height: 520px) {
  .m-word { font-size: clamp(40px, 20vh, 120px) !important; margin-top: 8px !important; margin-bottom: 10px !important; }
  .m-premise { padding-top: 10px !important; } .m-actions { margin-top: 12px; } .m-note { margin-top: 10px !important; }
  .btn.primary { min-height: 44px; } .btn { min-height: 40px; }
  .m-card { padding: 16px 20px 16px; } .m-h { font-size: clamp(30px, 11vh, 62px) !important; margin: 6px 0 8px !important; }
  .m-actions.col { margin-top: 12px; gap: 6px; } .m-stats > div { padding: 6px 0 5px; } .m-rating b { font-size: 34px; }
  .h-prompt { top: 64%; }
}

/* ---- motion preferences ---- */
@media (prefers-reduced-motion: reduce) {
  .menu *, .hud *, .comms, .loc-card, .loc-card *, #boot, .m-bars i { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .h-warn.on { animation: none; opacity: 1; }
  .h-cue.urgent { animation: none; }
}

</style>
<div id="app">
  <canvas id="view" tabindex="0"></canvas>
  <div id="ui"></div>
  <div id="boot">
    <div class="boot-mark">SALTLINE</div>
    <div class="boot-sub" id="boot-msg">Raising the terminal</div>
    <div class="boot-bar"><i id="boot-fill"></i></div>
  </div>
</div>
<script>
(()=>{var _M=Object.defineProperty;var br=(i,e)=>{for(var t in e)_M(i,t,{get:e[t],enumerable:!0})};var lt={};br(lt,{ACESFilmicToneMapping:()=>xc,AddEquation:()=>nr,AddOperation:()=>H2,AdditiveAnimationBlendMode:()=>Zp,AdditiveBlending:()=>hr,AgXToneMapping:()=>X2,AlphaFormat:()=>Xp,AlwaysCompare:()=>ug,AlwaysDepth:()=>q0,AlwaysStencilFunc:()=>Dd,AmbientLight:()=>dh,AnimationAction:()=>wh,AnimationClip:()=>Wa,AnimationLoader:()=>jd,AnimationMixer:()=>cp,AnimationObjectGroup:()=>lp,AnimationUtils:()=>Zd,ArcCurve:()=>Vu,ArrayCamera:()=>yh,ArrowHelper:()=>Dp,AttachedBindMode:()=>zd,Audio:()=>_h,AudioAnalyser:()=>ap,AudioContext:()=>mc,AudioListener:()=>op,AudioLoader:()=>ip,AxesHelper:()=>Lp,BackSide:()=>Ki,BasicDepthPacking:()=>tg,BasicShadowMap:()=>p5,BatchedMesh:()=>ku,Bone:()=>Fa,BooleanKeyframeTrack:()=>Ar,Box2:()=>bp,Box3:()=>$n,Box3Helper:()=>Ip,BoxGeometry:()=>un,BoxHelper:()=>Pp,BufferAttribute:()=>et,BufferGeometry:()=>nt,BufferGeometryLoader:()=>xh,ByteType:()=>Vp,Cache:()=>tr,Camera:()=>I0,CameraHelper:()=>Cp,CanvasTexture:()=>xs,CapsuleGeometry:()=>U0,CatmullRomCurve3:()=>Jr,CineonToneMapping:()=>G2,CircleGeometry:()=>Bu,ClampToEdgeWrapping:()=>Bi,Clock:()=>bh,Color:()=>Ve,ColorKeyframeTrack:()=>fc,ColorManagement:()=>Kt,CompressedArrayTexture:()=>Xd,CompressedCubeTexture:()=>Yd,CompressedTexture:()=>F0,CompressedTextureLoader:()=>Jd,ConeGeometry:()=>Ua,ConstantAlphaFactor:()=>N2,ConstantColorFactor:()=>F2,Controls:()=>Fp,CubeCamera:()=>z0,CubeReflectionMapping:()=>Cr,CubeRefractionMapping:()=>ta,CubeTexture:()=>Da,CubeTextureLoader:()=>Kd,CubeUVReflectionMapping:()=>X0,CubicBezierCurve:()=>ic,CubicBezierCurve3:()=>Wu,CubicInterpolant:()=>ah,CullFaceBack:()=>Np,CullFaceFront:()=>E2,CullFaceFrontBack:()=>d5,CullFaceNone:()=>w2,Curve:()=>$s,CurvePath:()=>qu,CustomBlending:()=>Sh,CustomToneMapping:()=>q2,CylinderGeometry:()=>Ys,Cylindrical:()=>xp,Data3DTexture:()=>R0,DataArrayTexture:()=>A0,DataTexture:()=>ui,DataTextureLoader:()=>Qd,DataUtils:()=>P0,DecrementStencilOp:()=>S5,DecrementWrapStencilOp:()=>A5,DefaultLoadingManager:()=>xg,DepthFormat:()=>E0,DepthStencilFormat:()=>j0,DepthTexture:()=>Tr,DetachedBindMode:()=>$2,DirectionalLight:()=>W0,DirectionalLightHelper:()=>Rp,DiscreteInterpolant:()=>lh,DodecahedronGeometry:()=>Ou,DoubleSide:()=>Sn,DstAlphaFactor:()=>I2,DstColorFactor:()=>D2,DynamicCopyUsage:()=>H5,DynamicDrawUsage:()=>bo,DynamicReadUsage:()=>N5,EdgesGeometry:()=>Hu,EllipseCurve:()=>N0,EqualCompare:()=>rg,EqualDepth:()=>Ch,EqualStencilFunc:()=>I5,EquirectangularReflectionMapping:()=>yc,EquirectangularRefractionMapping:()=>bc,Euler:()=>In,EventDispatcher:()=>xo,ExternalTexture:()=>nc,ExtrudeGeometry:()=>rr,FileLoader:()=>Lo,Float16BufferAttribute:()=>Hd,Float32BufferAttribute:()=>He,FloatType:()=>as,Fog:()=>Iu,FogExp2:()=>Pu,FramebufferTexture:()=>qd,FrontSide:()=>wr,Frustum:()=>Zr,FrustumArray:()=>Lu,GLBufferAttribute:()=>pp,GLSL1:()=>W5,GLSL3:()=>Ac,GreaterCompare:()=>ag,GreaterDepth:()=>Ih,GreaterEqualCompare:()=>cg,GreaterEqualDepth:()=>Ph,GreaterEqualStencilFunc:()=>k5,GreaterStencilFunc:()=>D5,GridHelper:()=>Tp,Group:()=>wt,HalfFloatType:()=>js,HemisphereLight:()=>uh,HemisphereLightHelper:()=>Sp,IcosahedronGeometry:()=>Zu,ImageBitmapLoader:()=>np,ImageLoader:()=>Ga,ImageUtils:()=>Cu,IncrementStencilOp:()=>E5,IncrementWrapStencilOp:()=>T5,InstancedBufferAttribute:()=>zs,InstancedBufferGeometry:()=>ea,InstancedInterleavedBuffer:()=>dp,InstancedMesh:()=>Sr,Int16BufferAttribute:()=>Bd,Int32BufferAttribute:()=>Od,Int8BufferAttribute:()=>Fd,IntType:()=>Lh,InterleavedBuffer:()=>La,InterleavedBufferAttribute:()=>$r,Interpolant:()=>Ba,InterpolateDiscrete:()=>ql,InterpolateLinear:()=>Ru,InterpolateSmooth:()=>wu,InterpolationSamplingMode:()=>X5,InterpolationSamplingType:()=>q5,InvertStencilOp:()=>R5,KeepStencilOp:()=>Ra,KeyframeTrack:()=>Ds,LOD:()=>Du,LatheGeometry:()=>ar,Layers:()=>C0,LessCompare:()=>og,LessDepth:()=>Rh,LessEqualCompare:()=>jp,LessEqualDepth:()=>za,LessEqualStencilFunc:()=>z5,LessStencilFunc:()=>P5,Light:()=>lr,LightProbe:()=>gh,Line:()=>sr,Line3:()=>_p,LineBasicMaterial:()=>Ji,LineCurve:()=>sc,LineCurve3:()=>Gu,LineDashedMaterial:()=>rh,LineLoop:()=>Fu,LineSegments:()=>yo,LinearFilter:()=>Zt,LinearInterpolant:()=>hc,LinearMipMapLinearFilter:()=>x5,LinearMipMapNearestFilter:()=>v5,LinearMipmapLinearFilter:()=>Ln,LinearMipmapNearestFilter:()=>_c,LinearSRGBColorSpace:()=>Er,LinearToneMapping:()=>V2,LinearTransfer:()=>Yl,Loader:()=>cs,LoaderUtils:()=>pc,LoadingManager:()=>dc,LoopOnce:()=>Z2,LoopPingPong:()=>J2,LoopRepeat:()=>j2,MOUSE:()=>h5,Material:()=>Oi,MaterialLoader:()=>vh,MathUtils:()=>bs,Matrix2:()=>yp,Matrix3:()=>kt,Matrix4:()=>Ye,MaxEquation:()=>R2,Mesh:()=>Qe,MeshBasicMaterial:()=>Nn,MeshDepthMaterial:()=>cc,MeshDistanceMaterial:()=>uc,MeshLambertMaterial:()=>sh,MeshMatcapMaterial:()=>oh,MeshNormalMaterial:()=>ih,MeshPhongMaterial:()=>th,MeshPhysicalMaterial:()=>eh,MeshStandardMaterial:()=>Qt,MeshToonMaterial:()=>nh,MinEquation:()=>A2,MirroredRepeatWrapping:()=>Gl,MixOperation:()=>O2,MultiplyBlending:()=>Op,MultiplyOperation:()=>vc,NearestFilter:()=>Gn,NearestMipMapLinearFilter:()=>g5,NearestMipMapNearestFilter:()=>m5,NearestMipmapLinearFilter:()=>Y0,NearestMipmapNearestFilter:()=>Hp,NeutralToneMapping:()=>Y2,NeverCompare:()=>sg,NeverDepth:()=>Ah,NeverStencilFunc:()=>C5,NoBlending:()=>ko,NoColorSpace:()=>hi,NoToneMapping:()=>ys,NormalAnimationBlendMode:()=>pf,NormalBlending:()=>Ia,NotEqualCompare:()=>lg,NotEqualDepth:()=>zh,NotEqualStencilFunc:()=>L5,NumberKeyframeTrack:()=>Oa,Object3D:()=>on,ObjectLoader:()=>tp,ObjectSpaceNormalMap:()=>ig,OctahedronGeometry:()=>Na,OneFactor:()=>G0,OneMinusConstantAlphaFactor:()=>B2,OneMinusConstantColorFactor:()=>U2,OneMinusDstAlphaFactor:()=>z2,OneMinusDstColorFactor:()=>L2,OneMinusSrcAlphaFactor:()=>w0,OneMinusSrcColorFactor:()=>P2,OrthographicCamera:()=>cr,PCFShadowMap:()=>gc,PCFSoftShadowMap:()=>Eh,PMREMGenerator:()=>ia,Path:()=>or,PerspectiveCamera:()=>Wn,Plane:()=>go,PlaneGeometry:()=>rn,PlaneHelper:()=>zp,PointLight:()=>Qr,PointLightHelper:()=>Ep,Points:()=>Uu,PointsMaterial:()=>tc,PolarGridHelper:()=>Ap,PolyhedronGeometry:()=>jr,PositionalAudio:()=>rp,PropertyBinding:()=>yn,PropertyMixer:()=>Mh,QuadraticBezierCurve:()=>oc,QuadraticBezierCurve3:()=>rc,Quaternion:()=>Lt,QuaternionKeyframeTrack:()=>Ha,QuaternionLinearInterpolant:()=>ch,RED_GREEN_RGTC2_Format:()=>ff,RED_RGTC1_Format:()=>uf,REVISION:()=>M2,RGBADepthPacking:()=>ng,RGBAFormat:()=>_n,RGBAIntegerFormat:()=>Nh,RGBA_ASTC_10x10_Format:()=>sf,RGBA_ASTC_10x5_Format:()=>ef,RGBA_ASTC_10x6_Format:()=>tf,RGBA_ASTC_10x8_Format:()=>nf,RGBA_ASTC_12x10_Format:()=>of,RGBA_ASTC_12x12_Format:()=>rf,RGBA_ASTC_4x4_Format:()=>Xh,RGBA_ASTC_5x4_Format:()=>Yh,RGBA_ASTC_5x5_Format:()=>$h,RGBA_ASTC_6x5_Format:()=>Zh,RGBA_ASTC_6x6_Format:()=>jh,RGBA_ASTC_8x5_Format:()=>Jh,RGBA_ASTC_8x6_Format:()=>Kh,RGBA_ASTC_8x8_Format:()=>Qh,RGBA_BPTC_Format:()=>af,RGBA_ETC2_EAC_Format:()=>qh,RGBA_PVRTC_2BPPV1_Format:()=>Vh,RGBA_PVRTC_4BPPV1_Format:()=>Hh,RGBA_S3TC_DXT1_Format:()=>Ec,RGBA_S3TC_DXT3_Format:()=>Sc,RGBA_S3TC_DXT5_Format:()=>Tc,RGBDepthPacking:()=>b5,RGBFormat:()=>Yp,RGBIntegerFormat:()=>y5,RGB_BPTC_SIGNED_Format:()=>lf,RGB_BPTC_UNSIGNED_Format:()=>cf,RGB_ETC1_Format:()=>Wh,RGB_ETC2_Format:()=>Gh,RGB_PVRTC_2BPPV1_Format:()=>Oh,RGB_PVRTC_4BPPV1_Format:()=>Bh,RGB_S3TC_DXT1_Format:()=>wc,RGDepthPacking:()=>_5,RGFormat:()=>$p,RGIntegerFormat:()=>Uh,RawShaderMaterial:()=>V0,Ray:()=>Yr,Raycaster:()=>mp,RectAreaLight:()=>ph,RedFormat:()=>J0,RedIntegerFormat:()=>Mc,ReinhardToneMapping:()=>W2,RenderTarget:()=>Jl,RenderTarget3D:()=>up,RepeatWrapping:()=>Is,ReplaceStencilOp:()=>w5,ReverseSubtractEquation:()=>T2,RingGeometry:()=>O0,SIGNED_RED_GREEN_RGTC2_Format:()=>df,SIGNED_RED_RGTC1_Format:()=>hf,SRGBColorSpace:()=>Vn,SRGBTransfer:()=>bn,Scene:()=>ir,ShaderChunk:()=>It,ShaderLib:()=>fr,ShaderMaterial:()=>zn,ShadowMaterial:()=>Qu,Shape:()=>ji,ShapeGeometry:()=>H0,ShapePath:()=>kp,ShapeUtils:()=>Xs,ShortType:()=>Wp,Skeleton:()=>k0,SkeletonHelper:()=>wp,SkinnedMesh:()=>ka,Source:()=>er,Sphere:()=>Dn,SphereGeometry:()=>ls,Spherical:()=>vp,SphericalHarmonics3:()=>mh,SplineCurve:()=>ac,SpotLight:()=>fh,SpotLightHelper:()=>Mp,Sprite:()=>zu,SpriteMaterial:()=>ec,SrcAlphaFactor:()=>Au,SrcAlphaSaturateFactor:()=>k2,SrcColorFactor:()=>C2,StaticCopyUsage:()=>O5,StaticDrawUsage:()=>$l,StaticReadUsage:()=>U5,StereoCamera:()=>sp,StreamCopyUsage:()=>V5,StreamDrawUsage:()=>F5,StreamReadUsage:()=>B5,StringKeyframeTrack:()=>Rr,SubtractEquation:()=>S2,SubtractiveBlending:()=>Bp,TOUCH:()=>f5,TangentSpaceNormalMap:()=>na,TetrahedronGeometry:()=>ju,Texture:()=>xi,TextureLoader:()=>ep,TextureUtils:()=>Up,Timer:()=>gp,TimestampQuery:()=>G5,TorusGeometry:()=>Ci,TorusKnotGeometry:()=>Ju,Triangle:()=>Qo,TriangleFanDrawMode:()=>eg,TriangleStripDrawMode:()=>Q2,TrianglesDrawMode:()=>K2,TubeGeometry:()=>Kr,UVMapping:()=>Dh,Uint16BufferAttribute:()=>Kl,Uint32BufferAttribute:()=>Ql,Uint8BufferAttribute:()=>Ud,Uint8ClampedBufferAttribute:()=>Nd,Uniform:()=>hp,UniformsGroup:()=>fp,UniformsLib:()=>st,UniformsUtils:()=>mg,UnsignedByteType:()=>yi,UnsignedInt101111Type:()=>qp,UnsignedInt248Type:()=>Z0,UnsignedInt5999Type:()=>Gp,UnsignedIntType:()=>Zs,UnsignedShort4444Type:()=>kh,UnsignedShort5551Type:()=>Fh,UnsignedShortType:()=>$0,VSMShadowMap:()=>ur,Vector2:()=>Ae,Vector3:()=>W,Vector4:()=>Dt,VectorKeyframeTrack:()=>Va,VideoFrameTexture:()=>Gd,VideoTexture:()=>Nu,WebGL3DRenderTarget:()=>kd,WebGLArrayRenderTarget:()=>Ld,WebGLCoordinateSystem:()=>qs,WebGLCubeRenderTarget:()=>D0,WebGLRenderTarget:()=>si,WebGLRenderer:()=>gf,WebGLUtils:()=>Iy,WebGPUCoordinateSystem:()=>S0,WebXRController:()=>L0,WireframeGeometry:()=>Ku,WrapAroundEnding:()=>Xl,ZeroCurvatureEnding:()=>Ca,ZeroFactor:()=>Th,ZeroSlopeEnding:()=>Pa,ZeroStencilOp:()=>M5,createCanvasElement:()=>dg});var M2="180",h5={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},f5={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},w2=0,Np=1,E2=2,d5=3,p5=0,gc=1,Eh=2,ur=3,wr=0,Ki=1,Sn=2,ko=0,Ia=1,hr=2,Bp=3,Op=4,Sh=5,nr=100,S2=101,T2=102,A2=103,R2=104,Th=200,G0=201,C2=202,P2=203,Au=204,w0=205,I2=206,z2=207,D2=208,L2=209,k2=210,F2=211,U2=212,N2=213,B2=214,Ah=0,q0=1,Rh=2,za=3,Ch=4,Ph=5,Ih=6,zh=7,vc=0,O2=1,H2=2,ys=0,V2=1,W2=2,G2=3,xc=4,q2=5,X2=6,Y2=7,zd="attached",$2="detached",Dh=300,Cr=301,ta=302,yc=303,bc=304,X0=306,Is=1e3,Bi=1001,Gl=1002,Gn=1003,Hp=1004,m5=1004,Y0=1005,g5=1005,Zt=1006,_c=1007,v5=1007,Ln=1008,x5=1008,yi=1009,Vp=1010,Wp=1011,$0=1012,Lh=1013,Zs=1014,as=1015,js=1016,kh=1017,Fh=1018,Z0=1020,Gp=35902,qp=35899,Xp=1021,Yp=1022,_n=1023,E0=1026,j0=1027,J0=1028,Mc=1029,$p=1030,Uh=1031,y5=1032,Nh=1033,wc=33776,Ec=33777,Sc=33778,Tc=33779,Bh=35840,Oh=35841,Hh=35842,Vh=35843,Wh=36196,Gh=37492,qh=37496,Xh=37808,Yh=37809,$h=37810,Zh=37811,jh=37812,Jh=37813,Kh=37814,Qh=37815,ef=37816,tf=37817,nf=37818,sf=37819,of=37820,rf=37821,af=36492,lf=36494,cf=36495,uf=36283,hf=36284,ff=36285,df=36286,Z2=2200,j2=2201,J2=2202,ql=2300,Ru=2301,wu=2302,Ca=2400,Pa=2401,Xl=2402,pf=2500,Zp=2501,K2=0,Q2=1,eg=2,tg=3200,ng=3201,b5=3202,_5=3203,na=0,ig=1,hi="",Vn="srgb",Er="srgb-linear",Yl="linear",bn="srgb",M5=0,Ra=7680,w5=7681,E5=7682,S5=7683,T5=34055,A5=34056,R5=5386,C5=512,P5=513,I5=514,z5=515,D5=516,L5=517,k5=518,Dd=519,sg=512,og=513,rg=514,jp=515,ag=516,lg=517,cg=518,ug=519,$l=35044,bo=35048,F5=35040,U5=35045,N5=35049,B5=35041,O5=35046,H5=35050,V5=35042,W5="100",Ac="300 es",qs=2e3,S0=2001,G5={COMPUTE:"compute",RENDER:"render"},q5={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},X5={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"},xo=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners;if(n===void 0)return;let s=n[e];if(s!==void 0){let o=s.indexOf(t);o!==-1&&s.splice(o,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let n=t[e.type];if(n!==void 0){e.target=this;let s=n.slice(0);for(let o=0,r=s.length;o<r;o++)s[o].call(this,e);e.target=null}}},ms=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],sx=1234567,M0=Math.PI/180,T0=180/Math.PI;function vo(){let i=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(ms[i&255]+ms[i>>8&255]+ms[i>>16&255]+ms[i>>24&255]+"-"+ms[e&255]+ms[e>>8&255]+"-"+ms[e>>16&15|64]+ms[e>>24&255]+"-"+ms[t&63|128]+ms[t>>8&255]+"-"+ms[t>>16&255]+ms[t>>24&255]+ms[n&255]+ms[n>>8&255]+ms[n>>16&255]+ms[n>>24&255]).toLowerCase()}function Ct(i,e,t){return Math.max(e,Math.min(t,i))}function hg(i,e){return(i%e+e)%e}function MM(i,e,t,n,s){return n+(i-e)*(s-n)/(t-e)}function wM(i,e,t){return i!==e?(t-i)/(e-i):0}function Eu(i,e,t){return(1-t)*i+t*e}function EM(i,e,t,n){return Eu(i,e,1-Math.exp(-t*n))}function SM(i,e=1){return e-Math.abs(hg(i,e*2)-e)}function TM(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*(3-2*i))}function AM(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*i*(i*(i*6-15)+10))}function RM(i,e){return i+Math.floor(Math.random()*(e-i+1))}function CM(i,e){return i+Math.random()*(e-i)}function PM(i){return i*(.5-Math.random())}function IM(i){i!==void 0&&(sx=i);let e=sx+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function zM(i){return i*M0}function DM(i){return i*T0}function LM(i){return(i&i-1)===0&&i!==0}function kM(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function FM(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function UM(i,e,t,n,s){let o=Math.cos,r=Math.sin,a=o(t/2),l=r(t/2),c=o((e+n)/2),u=r((e+n)/2),h=o((e-n)/2),f=r((e-n)/2),p=o((n-e)/2),d=r((n-e)/2);switch(s){case"XYX":i.set(a*u,l*h,l*f,a*c);break;case"YZY":i.set(l*f,a*u,l*h,a*c);break;case"ZXZ":i.set(l*h,l*f,a*u,a*c);break;case"XZX":i.set(a*u,l*d,l*p,a*c);break;case"YXY":i.set(l*p,a*u,l*d,a*c);break;case"ZYZ":i.set(l*d,l*p,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function Ps(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function Ft(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}var bs={DEG2RAD:M0,RAD2DEG:T0,generateUUID:vo,clamp:Ct,euclideanModulo:hg,mapLinear:MM,inverseLerp:wM,lerp:Eu,damp:EM,pingpong:SM,smoothstep:TM,smootherstep:AM,randInt:RM,randFloat:CM,randFloatSpread:PM,seededRandom:IM,degToRad:zM,radToDeg:DM,isPowerOfTwo:LM,ceilPowerOfTwo:kM,floorPowerOfTwo:FM,setQuaternionFromProperEuler:UM,normalize:Ft,denormalize:Ps},Ae=class i{constructor(e=0,t=0){i.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6],this.y=s[1]*t+s[4]*n+s[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Ct(this.x,e.x,t.x),this.y=Ct(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=Ct(this.x,e,t),this.y=Ct(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Ct(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Ct(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),s=Math.sin(t),o=this.x-e.x,r=this.y-e.y;return this.x=o*n-r*s+e.x,this.y=o*s+r*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Lt=class{constructor(e=0,t=0,n=0,s=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=s}static slerpFlat(e,t,n,s,o,r,a){let l=n[s+0],c=n[s+1],u=n[s+2],h=n[s+3],f=o[r+0],p=o[r+1],d=o[r+2],v=o[r+3];if(a===0){e[t+0]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h;return}if(a===1){e[t+0]=f,e[t+1]=p,e[t+2]=d,e[t+3]=v;return}if(h!==v||l!==f||c!==p||u!==d){let g=1-a,x=l*f+c*p+u*d+h*v,y=x>=0?1:-1,b=1-x*x;if(b>Number.EPSILON){let A=Math.sqrt(b),_=Math.atan2(A,x*y);g=Math.sin(g*_)/A,a=Math.sin(a*_)/A}let m=a*y;if(l=l*g+f*m,c=c*g+p*m,u=u*g+d*m,h=h*g+v*m,g===1-a){let A=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=A,c*=A,u*=A,h*=A}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,s,o,r){let a=n[s],l=n[s+1],c=n[s+2],u=n[s+3],h=o[r],f=o[r+1],p=o[r+2],d=o[r+3];return e[t]=a*d+u*h+l*p-c*f,e[t+1]=l*d+u*f+c*h-a*p,e[t+2]=c*d+u*p+a*f-l*h,e[t+3]=u*d-a*h-l*f-c*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,s){return this._x=e,this._y=t,this._z=n,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,s=e._y,o=e._z,r=e._order,a=Math.cos,l=Math.sin,c=a(n/2),u=a(s/2),h=a(o/2),f=l(n/2),p=l(s/2),d=l(o/2);switch(r){case"XYZ":this._x=f*u*h+c*p*d,this._y=c*p*h-f*u*d,this._z=c*u*d+f*p*h,this._w=c*u*h-f*p*d;break;case"YXZ":this._x=f*u*h+c*p*d,this._y=c*p*h-f*u*d,this._z=c*u*d-f*p*h,this._w=c*u*h+f*p*d;break;case"ZXY":this._x=f*u*h-c*p*d,this._y=c*p*h+f*u*d,this._z=c*u*d+f*p*h,this._w=c*u*h-f*p*d;break;case"ZYX":this._x=f*u*h-c*p*d,this._y=c*p*h+f*u*d,this._z=c*u*d-f*p*h,this._w=c*u*h+f*p*d;break;case"YZX":this._x=f*u*h+c*p*d,this._y=c*p*h+f*u*d,this._z=c*u*d-f*p*h,this._w=c*u*h-f*p*d;break;case"XZY":this._x=f*u*h-c*p*d,this._y=c*p*h-f*u*d,this._z=c*u*d+f*p*h,this._w=c*u*h+f*p*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+r)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,s=Math.sin(n);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],s=t[4],o=t[8],r=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],f=n+a+h;if(f>0){let p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(u-l)*p,this._y=(o-c)*p,this._z=(r-s)*p}else if(n>a&&n>h){let p=2*Math.sqrt(1+n-a-h);this._w=(u-l)/p,this._x=.25*p,this._y=(s+r)/p,this._z=(o+c)/p}else if(a>h){let p=2*Math.sqrt(1+a-n-h);this._w=(o-c)/p,this._x=(s+r)/p,this._y=.25*p,this._z=(l+u)/p}else{let p=2*Math.sqrt(1+h-n-a);this._w=(r-s)/p,this._x=(o+c)/p,this._y=(l+u)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ct(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let s=Math.min(1,t/n);return this.slerp(e,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,s=e._y,o=e._z,r=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+r*a+s*c-o*l,this._y=s*u+r*l+o*a-n*c,this._z=o*u+r*c+n*l-s*a,this._w=r*u-n*a-s*l-o*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let n=this._x,s=this._y,o=this._z,r=this._w,a=r*e._w+n*e._x+s*e._y+o*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=r,this._x=n,this._y=s,this._z=o,this;let l=1-a*a;if(l<=Number.EPSILON){let p=1-t;return this._w=p*r+t*this._w,this._x=p*n+t*this._x,this._y=p*s+t*this._y,this._z=p*o+t*this._z,this.normalize(),this}let c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,f=Math.sin(t*u)/c;return this._w=r*h+this._w*f,this._x=n*h+this._x*f,this._y=s*h+this._y*f,this._z=o*h+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),s=Math.sqrt(1-n),o=Math.sqrt(n);return this.set(s*Math.sin(e),s*Math.cos(e),o*Math.sin(t),o*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},W=class i{constructor(e=0,t=0,n=0){i.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(ox.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ox.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,s=this.z,o=e.elements;return this.x=o[0]*t+o[3]*n+o[6]*s,this.y=o[1]*t+o[4]*n+o[7]*s,this.z=o[2]*t+o[5]*n+o[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,s=this.z,o=e.elements,r=1/(o[3]*t+o[7]*n+o[11]*s+o[15]);return this.x=(o[0]*t+o[4]*n+o[8]*s+o[12])*r,this.y=(o[1]*t+o[5]*n+o[9]*s+o[13])*r,this.z=(o[2]*t+o[6]*n+o[10]*s+o[14])*r,this}applyQuaternion(e){let t=this.x,n=this.y,s=this.z,o=e.x,r=e.y,a=e.z,l=e.w,c=2*(r*s-a*n),u=2*(a*t-o*s),h=2*(o*n-r*t);return this.x=t+l*c+r*h-a*u,this.y=n+l*u+a*c-o*h,this.z=s+l*h+o*u-r*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,s=this.z,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*s,this.y=o[1]*t+o[5]*n+o[9]*s,this.z=o[2]*t+o[6]*n+o[10]*s,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Ct(this.x,e.x,t.x),this.y=Ct(this.y,e.y,t.y),this.z=Ct(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=Ct(this.x,e,t),this.y=Ct(this.y,e,t),this.z=Ct(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Ct(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,s=e.y,o=e.z,r=t.x,a=t.y,l=t.z;return this.x=s*l-o*a,this.y=o*r-n*l,this.z=n*a-s*r,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Tm.copy(this).projectOnVector(e),this.sub(Tm)}reflect(e){return this.sub(Tm.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(Ct(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,s=this.z-e.z;return t*t+n*n+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let s=Math.sin(t)*e;return this.x=s*Math.sin(n),this.y=Math.cos(t)*e,this.z=s*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=s,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},Tm=new W,ox=new Lt,kt=class i{constructor(e,t,n,s,o,r,a,l,c){i.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,s,o,r,a,l,c)}set(e,t,n,s,o,r,a,l,c){let u=this.elements;return u[0]=e,u[1]=s,u[2]=a,u[3]=t,u[4]=o,u[5]=l,u[6]=n,u[7]=r,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,s=t.elements,o=this.elements,r=n[0],a=n[3],l=n[6],c=n[1],u=n[4],h=n[7],f=n[2],p=n[5],d=n[8],v=s[0],g=s[3],x=s[6],y=s[1],b=s[4],m=s[7],A=s[2],_=s[5],M=s[8];return o[0]=r*v+a*y+l*A,o[3]=r*g+a*b+l*_,o[6]=r*x+a*m+l*M,o[1]=c*v+u*y+h*A,o[4]=c*g+u*b+h*_,o[7]=c*x+u*m+h*M,o[2]=f*v+p*y+d*A,o[5]=f*g+p*b+d*_,o[8]=f*x+p*m+d*M,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],s=e[2],o=e[3],r=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*r*u-t*a*c-n*o*u+n*a*l+s*o*c-s*r*l}invert(){let e=this.elements,t=e[0],n=e[1],s=e[2],o=e[3],r=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*r-a*c,f=a*l-u*o,p=c*o-r*l,d=t*h+n*f+s*p;if(d===0)return this.set(0,0,0,0,0,0,0,0,0);let v=1/d;return e[0]=h*v,e[1]=(s*c-u*n)*v,e[2]=(a*n-s*r)*v,e[3]=f*v,e[4]=(u*t-s*l)*v,e[5]=(s*o-a*t)*v,e[6]=p*v,e[7]=(n*l-c*t)*v,e[8]=(r*t-n*o)*v,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,s,o,r,a){let l=Math.cos(o),c=Math.sin(o);return this.set(n*l,n*c,-n*(l*r+c*a)+r+e,-s*c,s*l,-s*(-c*r+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Am.makeScale(e,t)),this}rotate(e){return this.premultiply(Am.makeRotation(-e)),this}translate(e,t){return this.premultiply(Am.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let s=0;s<9;s++)if(t[s]!==n[s])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}},Am=new kt;function fg(i){for(let e=i.length-1;e>=0;--e)if(i[e]>=65535)return!0;return!1}var NM={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Vl(i,e){return new NM[i](e)}function Zl(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function dg(){let i=Zl("canvas");return i.style.display="block",i}var rx={};function jl(i){i in rx||(rx[i]=!0,console.warn(i))}function Y5(i,e,t){return new Promise(function(n,s){function o(){switch(i.clientWaitSync(e,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:s();break;case i.TIMEOUT_EXPIRED:setTimeout(o,t);break;default:n()}}setTimeout(o,t)})}var ax=new kt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),lx=new kt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function BM(){let i={enabled:!0,workingColorSpace:Er,spaces:{},convert:function(s,o,r){return this.enabled===!1||o===r||!o||!r||(this.spaces[o].transfer===bn&&(s.r=Xr(s.r),s.g=Xr(s.g),s.b=Xr(s.b)),this.spaces[o].primaries!==this.spaces[r].primaries&&(s.applyMatrix3(this.spaces[o].toXYZ),s.applyMatrix3(this.spaces[r].fromXYZ)),this.spaces[r].transfer===bn&&(s.r=Wl(s.r),s.g=Wl(s.g),s.b=Wl(s.b))),s},workingToColorSpace:function(s,o){return this.convert(s,this.workingColorSpace,o)},colorSpaceToWorking:function(s,o){return this.convert(s,o,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===hi?Yl:this.spaces[s].transfer},getToneMappingMode:function(s){return this.spaces[s].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(s,o=this.workingColorSpace){return s.fromArray(this.spaces[o].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,o,r){return s.copy(this.spaces[o].toXYZ).multiply(this.spaces[r].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(s,o){return jl("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),i.workingToColorSpace(s,o)},toWorkingColorSpace:function(s,o){return jl("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),i.colorSpaceToWorking(s,o)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return i.define({[Er]:{primaries:e,whitePoint:n,transfer:Yl,toXYZ:ax,fromXYZ:lx,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Vn},outputColorSpaceConfig:{drawingBufferColorSpace:Vn}},[Vn]:{primaries:e,whitePoint:n,transfer:bn,toXYZ:ax,fromXYZ:lx,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Vn}}}),i}var Kt=BM();function Xr(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function Wl(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}var Ml,Cu=class{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Ml===void 0&&(Ml=Zl("canvas")),Ml.width=e.width,Ml.height=e.height;let s=Ml.getContext("2d");e instanceof ImageData?s.putImageData(e,0,0):s.drawImage(e,0,0,e.width,e.height),n=Ml}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=Zl("canvas");t.width=e.width,t.height=e.height;let n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);let s=n.getImageData(0,0,e.width,e.height),o=s.data;for(let r=0;r<o.length;r++)o[r]=Xr(o[r]/255)*255;return n.putImageData(s,0,0),t}else if(e.data){let t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(Xr(t[n]/255)*255):t[n]=Xr(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}},OM=0,er=class{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:OM++}),this.uuid=vo(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){let t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):t instanceof VideoFrame?e.set(t.displayHeight,t.displayWidth,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let n={uuid:this.uuid,url:""},s=this.data;if(s!==null){let o;if(Array.isArray(s)){o=[];for(let r=0,a=s.length;r<a;r++)s[r].isDataTexture?o.push(Rm(s[r].image)):o.push(Rm(s[r]))}else o=Rm(s);n.url=o}return t||(e.images[this.uuid]=n),n}};function Rm(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?Cu.getDataURL(i):i.data?{data:Array.from(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var HM=0,Cm=new W,xi=class i extends xo{constructor(e=i.DEFAULT_IMAGE,t=i.DEFAULT_MAPPING,n=Bi,s=Bi,o=Zt,r=Ln,a=_n,l=yi,c=i.DEFAULT_ANISOTROPY,u=hi){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:HM++}),this.uuid=vo(),this.name="",this.source=new er(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=s,this.magFilter=o,this.minFilter=r,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new Ae(0,0),this.repeat=new Ae(1,1),this.center=new Ae(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new kt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(Cm).x}get height(){return this.source.getSize(Cm).y}get depth(){return this.source.getSize(Cm).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let n=e[t];if(n===void 0){console.warn(`THREE.Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let s=this[t];if(s===void 0){console.warn(`THREE.Texture.setValues(): property '${t}' does not exist.`);continue}s&&n&&s.isVector2&&n.isVector2||s&&n&&s.isVector3&&n.isVector3||s&&n&&s.isMatrix3&&n.isMatrix3?s.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Dh)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Is:e.x=e.x-Math.floor(e.x);break;case Bi:e.x=e.x<0?0:1;break;case Gl:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Is:e.y=e.y-Math.floor(e.y);break;case Bi:e.y=e.y<0?0:1;break;case Gl:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}};xi.DEFAULT_IMAGE=null;xi.DEFAULT_MAPPING=Dh;xi.DEFAULT_ANISOTROPY=1;var Dt=class i{constructor(e=0,t=0,n=0,s=1){i.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=s}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,s){return this.x=e,this.y=t,this.z=n,this.w=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,s=this.z,o=this.w,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*s+r[12]*o,this.y=r[1]*t+r[5]*n+r[9]*s+r[13]*o,this.z=r[2]*t+r[6]*n+r[10]*s+r[14]*o,this.w=r[3]*t+r[7]*n+r[11]*s+r[15]*o,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,s,o,l=e.elements,c=l[0],u=l[4],h=l[8],f=l[1],p=l[5],d=l[9],v=l[2],g=l[6],x=l[10];if(Math.abs(u-f)<.01&&Math.abs(h-v)<.01&&Math.abs(d-g)<.01){if(Math.abs(u+f)<.1&&Math.abs(h+v)<.1&&Math.abs(d+g)<.1&&Math.abs(c+p+x-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;let b=(c+1)/2,m=(p+1)/2,A=(x+1)/2,_=(u+f)/4,M=(h+v)/4,E=(d+g)/4;return b>m&&b>A?b<.01?(n=0,s=.707106781,o=.707106781):(n=Math.sqrt(b),s=_/n,o=M/n):m>A?m<.01?(n=.707106781,s=0,o=.707106781):(s=Math.sqrt(m),n=_/s,o=E/s):A<.01?(n=.707106781,s=.707106781,o=0):(o=Math.sqrt(A),n=M/o,s=E/o),this.set(n,s,o,t),this}let y=Math.sqrt((g-d)*(g-d)+(h-v)*(h-v)+(f-u)*(f-u));return Math.abs(y)<.001&&(y=1),this.x=(g-d)/y,this.y=(h-v)/y,this.z=(f-u)/y,this.w=Math.acos((c+p+x-1)/2),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Ct(this.x,e.x,t.x),this.y=Ct(this.y,e.y,t.y),this.z=Ct(this.z,e.z,t.z),this.w=Ct(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=Ct(this.x,e,t),this.y=Ct(this.y,e,t),this.z=Ct(this.z,e,t),this.w=Ct(this.w,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Ct(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},Jl=class extends xo{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Zt,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new Dt(0,0,e,t),this.scissorTest=!1,this.viewport=new Dt(0,0,e,t);let s={width:e,height:t,depth:n.depth},o=new xi(s);this.textures=[];let r=n.count;for(let a=0;a<r;a++)this.textures[a]=o.clone(),this.textures[a].isRenderTargetTexture=!0,this.textures[a].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}_setTextureOptions(e={}){let t={minFilter:Zt,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let n=0;n<this.textures.length;n++)this.textures[n].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let s=0,o=this.textures.length;s<o;s++)this.textures[s].image.width=e,this.textures[s].image.height=t,this.textures[s].image.depth=n,this.textures[s].isArrayTexture=this.textures[s].image.depth>1;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;let s=Object.assign({},e.textures[t].image);this.textures[t].source=new er(s)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},si=class extends Jl{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}},A0=class extends xi{constructor(e=null,t=1,n=1,s=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:s},this.magFilter=Gn,this.minFilter=Gn,this.wrapR=Bi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}},Ld=class extends si{constructor(e=1,t=1,n=1,s={}){super(e,t,s),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new A0(null,e,t,n),this._setTextureOptions(s),this.texture.isRenderTargetTexture=!0}},R0=class extends xi{constructor(e=null,t=1,n=1,s=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:s},this.magFilter=Gn,this.minFilter=Gn,this.wrapR=Bi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},kd=class extends si{constructor(e=1,t=1,n=1,s={}){super(e,t,s),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new R0(null,e,t,n),this._setTextureOptions(s),this.texture.isRenderTargetTexture=!0}},$n=class{constructor(e=new W(1/0,1/0,1/0),t=new W(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(jo.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(jo.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let n=jo.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);let n=e.geometry;if(n!==void 0){let o=n.getAttribute("position");if(t===!0&&o!==void 0&&e.isInstancedMesh!==!0)for(let r=0,a=o.count;r<a;r++)e.isMesh===!0?e.getVertexPosition(r,jo):jo.fromBufferAttribute(o,r),jo.applyMatrix4(e.matrixWorld),this.expandByPoint(jo);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Gf.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),Gf.copy(n.boundingBox)),Gf.applyMatrix4(e.matrixWorld),this.union(Gf)}let s=e.children;for(let o=0,r=s.length;o<r;o++)this.expandByObject(s[o],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,jo),jo.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(cu),qf.subVectors(this.max,cu),wl.subVectors(e.a,cu),El.subVectors(e.b,cu),Sl.subVectors(e.c,cu),_a.subVectors(El,wl),Ma.subVectors(Sl,El),c0.subVectors(wl,Sl);let t=[0,-_a.z,_a.y,0,-Ma.z,Ma.y,0,-c0.z,c0.y,_a.z,0,-_a.x,Ma.z,0,-Ma.x,c0.z,0,-c0.x,-_a.y,_a.x,0,-Ma.y,Ma.x,0,-c0.y,c0.x,0];return!Pm(t,wl,El,Sl,qf)||(t=[1,0,0,0,1,0,0,0,1],!Pm(t,wl,El,Sl,qf))?!1:(Xf.crossVectors(_a,Ma),t=[Xf.x,Xf.y,Xf.z],Pm(t,wl,El,Sl,qf))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,jo).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(jo).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Br[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Br[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Br[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Br[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Br[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Br[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Br[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Br[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Br),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}},Br=[new W,new W,new W,new W,new W,new W,new W,new W],jo=new W,Gf=new $n,wl=new W,El=new W,Sl=new W,_a=new W,Ma=new W,c0=new W,cu=new W,qf=new W,Xf=new W,u0=new W;function Pm(i,e,t,n,s){for(let o=0,r=i.length-3;o<=r;o+=3){u0.fromArray(i,o);let a=s.x*Math.abs(u0.x)+s.y*Math.abs(u0.y)+s.z*Math.abs(u0.z),l=e.dot(u0),c=t.dot(u0),u=n.dot(u0);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}var VM=new $n,uu=new W,Im=new W,Dn=class{constructor(e=new W,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t!==void 0?n.copy(t):VM.setFromPoints(e).getCenter(n);let s=0;for(let o=0,r=e.length;o<r;o++)s=Math.max(s,n.distanceToSquared(e[o]));return this.radius=Math.sqrt(s),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){let t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){let n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;uu.subVectors(e,this.center);let t=uu.lengthSq();if(t>this.radius*this.radius){let n=Math.sqrt(t),s=(n-this.radius)*.5;this.center.addScaledVector(uu,s/n),this.radius+=s}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Im.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(uu.copy(e.center).add(Im)),this.expandByPoint(uu.copy(e.center).sub(Im))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}},Or=new W,zm=new W,Yf=new W,wa=new W,Dm=new W,$f=new W,Lm=new W,Yr=class{constructor(e=new W,t=new W(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Or)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Or.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Or.copy(this.origin).addScaledVector(this.direction,t),Or.distanceToSquared(e))}distanceSqToSegment(e,t,n,s){zm.copy(e).add(t).multiplyScalar(.5),Yf.copy(t).sub(e).normalize(),wa.copy(this.origin).sub(zm);let o=e.distanceTo(t)*.5,r=-this.direction.dot(Yf),a=wa.dot(this.direction),l=-wa.dot(Yf),c=wa.lengthSq(),u=Math.abs(1-r*r),h,f,p,d;if(u>0)if(h=r*l-a,f=r*a-l,d=o*u,h>=0)if(f>=-d)if(f<=d){let v=1/u;h*=v,f*=v,p=h*(h+r*f+2*a)+f*(r*h+f+2*l)+c}else f=o,h=Math.max(0,-(r*f+a)),p=-h*h+f*(f+2*l)+c;else f=-o,h=Math.max(0,-(r*f+a)),p=-h*h+f*(f+2*l)+c;else f<=-d?(h=Math.max(0,-(-r*o+a)),f=h>0?-o:Math.min(Math.max(-o,-l),o),p=-h*h+f*(f+2*l)+c):f<=d?(h=0,f=Math.min(Math.max(-o,-l),o),p=f*(f+2*l)+c):(h=Math.max(0,-(r*o+a)),f=h>0?o:Math.min(Math.max(-o,-l),o),p=-h*h+f*(f+2*l)+c);else f=r>0?-o:o,h=Math.max(0,-(r*f+a)),p=-h*h+f*(f+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,h),s&&s.copy(zm).addScaledVector(Yf,f),p}intersectSphere(e,t){Or.subVectors(e.center,this.origin);let n=Or.dot(this.direction),s=Or.dot(Or)-n*n,o=e.radius*e.radius;if(s>o)return null;let r=Math.sqrt(o-s),a=n-r,l=n+r;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,s,o,r,a,l,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,f=this.origin;return c>=0?(n=(e.min.x-f.x)*c,s=(e.max.x-f.x)*c):(n=(e.max.x-f.x)*c,s=(e.min.x-f.x)*c),u>=0?(o=(e.min.y-f.y)*u,r=(e.max.y-f.y)*u):(o=(e.max.y-f.y)*u,r=(e.min.y-f.y)*u),n>r||o>s||((o>n||isNaN(n))&&(n=o),(r<s||isNaN(s))&&(s=r),h>=0?(a=(e.min.z-f.z)*h,l=(e.max.z-f.z)*h):(a=(e.max.z-f.z)*h,l=(e.min.z-f.z)*h),n>l||a>s)||((a>n||n!==n)&&(n=a),(l<s||s!==s)&&(s=l),s<0)?null:this.at(n>=0?n:s,t)}intersectsBox(e){return this.intersectBox(e,Or)!==null}intersectTriangle(e,t,n,s,o){Dm.subVectors(t,e),$f.subVectors(n,e),Lm.crossVectors(Dm,$f);let r=this.direction.dot(Lm),a;if(r>0){if(s)return null;a=1}else if(r<0)a=-1,r=-r;else return null;wa.subVectors(this.origin,e);let l=a*this.direction.dot($f.crossVectors(wa,$f));if(l<0)return null;let c=a*this.direction.dot(Dm.cross(wa));if(c<0||l+c>r)return null;let u=-a*wa.dot(Lm);return u<0?null:this.at(u/r,o)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},Ye=class i{constructor(e,t,n,s,o,r,a,l,c,u,h,f,p,d,v,g){i.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,s,o,r,a,l,c,u,h,f,p,d,v,g)}set(e,t,n,s,o,r,a,l,c,u,h,f,p,d,v,g){let x=this.elements;return x[0]=e,x[4]=t,x[8]=n,x[12]=s,x[1]=o,x[5]=r,x[9]=a,x[13]=l,x[2]=c,x[6]=u,x[10]=h,x[14]=f,x[3]=p,x[7]=d,x[11]=v,x[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new i().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,s=1/Tl.setFromMatrixColumn(e,0).length(),o=1/Tl.setFromMatrixColumn(e,1).length(),r=1/Tl.setFromMatrixColumn(e,2).length();return t[0]=n[0]*s,t[1]=n[1]*s,t[2]=n[2]*s,t[3]=0,t[4]=n[4]*o,t[5]=n[5]*o,t[6]=n[6]*o,t[7]=0,t[8]=n[8]*r,t[9]=n[9]*r,t[10]=n[10]*r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,s=e.y,o=e.z,r=Math.cos(n),a=Math.sin(n),l=Math.cos(s),c=Math.sin(s),u=Math.cos(o),h=Math.sin(o);if(e.order==="XYZ"){let f=r*u,p=r*h,d=a*u,v=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=p+d*c,t[5]=f-v*c,t[9]=-a*l,t[2]=v-f*c,t[6]=d+p*c,t[10]=r*l}else if(e.order==="YXZ"){let f=l*u,p=l*h,d=c*u,v=c*h;t[0]=f+v*a,t[4]=d*a-p,t[8]=r*c,t[1]=r*h,t[5]=r*u,t[9]=-a,t[2]=p*a-d,t[6]=v+f*a,t[10]=r*l}else if(e.order==="ZXY"){let f=l*u,p=l*h,d=c*u,v=c*h;t[0]=f-v*a,t[4]=-r*h,t[8]=d+p*a,t[1]=p+d*a,t[5]=r*u,t[9]=v-f*a,t[2]=-r*c,t[6]=a,t[10]=r*l}else if(e.order==="ZYX"){let f=r*u,p=r*h,d=a*u,v=a*h;t[0]=l*u,t[4]=d*c-p,t[8]=f*c+v,t[1]=l*h,t[5]=v*c+f,t[9]=p*c-d,t[2]=-c,t[6]=a*l,t[10]=r*l}else if(e.order==="YZX"){let f=r*l,p=r*c,d=a*l,v=a*c;t[0]=l*u,t[4]=v-f*h,t[8]=d*h+p,t[1]=h,t[5]=r*u,t[9]=-a*u,t[2]=-c*u,t[6]=p*h+d,t[10]=f-v*h}else if(e.order==="XZY"){let f=r*l,p=r*c,d=a*l,v=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=f*h+v,t[5]=r*u,t[9]=p*h-d,t[2]=d*h-p,t[6]=a*u,t[10]=v*h+f}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(WM,e,GM)}lookAt(e,t,n){let s=this.elements;return po.subVectors(e,t),po.lengthSq()===0&&(po.z=1),po.normalize(),Ea.crossVectors(n,po),Ea.lengthSq()===0&&(Math.abs(n.z)===1?po.x+=1e-4:po.z+=1e-4,po.normalize(),Ea.crossVectors(n,po)),Ea.normalize(),Zf.crossVectors(po,Ea),s[0]=Ea.x,s[4]=Zf.x,s[8]=po.x,s[1]=Ea.y,s[5]=Zf.y,s[9]=po.y,s[2]=Ea.z,s[6]=Zf.z,s[10]=po.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,s=t.elements,o=this.elements,r=n[0],a=n[4],l=n[8],c=n[12],u=n[1],h=n[5],f=n[9],p=n[13],d=n[2],v=n[6],g=n[10],x=n[14],y=n[3],b=n[7],m=n[11],A=n[15],_=s[0],M=s[4],E=s[8],w=s[12],S=s[1],z=s[5],H=s[9],O=s[13],q=s[2],U=s[6],T=s[10],D=s[14],C=s[3],G=s[7],j=s[11],N=s[15];return o[0]=r*_+a*S+l*q+c*C,o[4]=r*M+a*z+l*U+c*G,o[8]=r*E+a*H+l*T+c*j,o[12]=r*w+a*O+l*D+c*N,o[1]=u*_+h*S+f*q+p*C,o[5]=u*M+h*z+f*U+p*G,o[9]=u*E+h*H+f*T+p*j,o[13]=u*w+h*O+f*D+p*N,o[2]=d*_+v*S+g*q+x*C,o[6]=d*M+v*z+g*U+x*G,o[10]=d*E+v*H+g*T+x*j,o[14]=d*w+v*O+g*D+x*N,o[3]=y*_+b*S+m*q+A*C,o[7]=y*M+b*z+m*U+A*G,o[11]=y*E+b*H+m*T+A*j,o[15]=y*w+b*O+m*D+A*N,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],s=e[8],o=e[12],r=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],f=e[10],p=e[14],d=e[3],v=e[7],g=e[11],x=e[15];return d*(+o*l*h-s*c*h-o*a*f+n*c*f+s*a*p-n*l*p)+v*(+t*l*p-t*c*f+o*r*f-s*r*p+s*c*u-o*l*u)+g*(+t*c*h-t*a*p-o*r*h+n*r*p+o*a*u-n*c*u)+x*(-s*a*u-t*l*h+t*a*f+s*r*h-n*r*f+n*l*u)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],s=e[2],o=e[3],r=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],f=e[10],p=e[11],d=e[12],v=e[13],g=e[14],x=e[15],y=h*g*c-v*f*c+v*l*p-a*g*p-h*l*x+a*f*x,b=d*f*c-u*g*c-d*l*p+r*g*p+u*l*x-r*f*x,m=u*v*c-d*h*c+d*a*p-r*v*p-u*a*x+r*h*x,A=d*h*l-u*v*l-d*a*f+r*v*f+u*a*g-r*h*g,_=t*y+n*b+s*m+o*A;if(_===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let M=1/_;return e[0]=y*M,e[1]=(v*f*o-h*g*o-v*s*p+n*g*p+h*s*x-n*f*x)*M,e[2]=(a*g*o-v*l*o+v*s*c-n*g*c-a*s*x+n*l*x)*M,e[3]=(h*l*o-a*f*o-h*s*c+n*f*c+a*s*p-n*l*p)*M,e[4]=b*M,e[5]=(u*g*o-d*f*o+d*s*p-t*g*p-u*s*x+t*f*x)*M,e[6]=(d*l*o-r*g*o-d*s*c+t*g*c+r*s*x-t*l*x)*M,e[7]=(r*f*o-u*l*o+u*s*c-t*f*c-r*s*p+t*l*p)*M,e[8]=m*M,e[9]=(d*h*o-u*v*o-d*n*p+t*v*p+u*n*x-t*h*x)*M,e[10]=(r*v*o-d*a*o+d*n*c-t*v*c-r*n*x+t*a*x)*M,e[11]=(u*a*o-r*h*o-u*n*c+t*h*c+r*n*p-t*a*p)*M,e[12]=A*M,e[13]=(u*v*s-d*h*s+d*n*f-t*v*f-u*n*g+t*h*g)*M,e[14]=(d*a*s-r*v*s-d*n*l+t*v*l+r*n*g-t*a*g)*M,e[15]=(r*h*s-u*a*s+u*n*l-t*h*l-r*n*f+t*a*f)*M,this}scale(e){let t=this.elements,n=e.x,s=e.y,o=e.z;return t[0]*=n,t[4]*=s,t[8]*=o,t[1]*=n,t[5]*=s,t[9]*=o,t[2]*=n,t[6]*=s,t[10]*=o,t[3]*=n,t[7]*=s,t[11]*=o,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,s))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),s=Math.sin(t),o=1-n,r=e.x,a=e.y,l=e.z,c=o*r,u=o*a;return this.set(c*r+n,c*a-s*l,c*l+s*a,0,c*a+s*l,u*a+n,u*l-s*r,0,c*l-s*a,u*l+s*r,o*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,s,o,r){return this.set(1,n,o,0,e,1,r,0,t,s,1,0,0,0,0,1),this}compose(e,t,n){let s=this.elements,o=t._x,r=t._y,a=t._z,l=t._w,c=o+o,u=r+r,h=a+a,f=o*c,p=o*u,d=o*h,v=r*u,g=r*h,x=a*h,y=l*c,b=l*u,m=l*h,A=n.x,_=n.y,M=n.z;return s[0]=(1-(v+x))*A,s[1]=(p+m)*A,s[2]=(d-b)*A,s[3]=0,s[4]=(p-m)*_,s[5]=(1-(f+x))*_,s[6]=(g+y)*_,s[7]=0,s[8]=(d+b)*M,s[9]=(g-y)*M,s[10]=(1-(f+v))*M,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,n){let s=this.elements,o=Tl.set(s[0],s[1],s[2]).length(),r=Tl.set(s[4],s[5],s[6]).length(),a=Tl.set(s[8],s[9],s[10]).length();this.determinant()<0&&(o=-o),e.x=s[12],e.y=s[13],e.z=s[14],Jo.copy(this);let c=1/o,u=1/r,h=1/a;return Jo.elements[0]*=c,Jo.elements[1]*=c,Jo.elements[2]*=c,Jo.elements[4]*=u,Jo.elements[5]*=u,Jo.elements[6]*=u,Jo.elements[8]*=h,Jo.elements[9]*=h,Jo.elements[10]*=h,t.setFromRotationMatrix(Jo),n.x=o,n.y=r,n.z=a,this}makePerspective(e,t,n,s,o,r,a=qs,l=!1){let c=this.elements,u=2*o/(t-e),h=2*o/(n-s),f=(t+e)/(t-e),p=(n+s)/(n-s),d,v;if(l)d=o/(r-o),v=r*o/(r-o);else if(a===qs)d=-(r+o)/(r-o),v=-2*r*o/(r-o);else if(a===S0)d=-r/(r-o),v=-r*o/(r-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return c[0]=u,c[4]=0,c[8]=f,c[12]=0,c[1]=0,c[5]=h,c[9]=p,c[13]=0,c[2]=0,c[6]=0,c[10]=d,c[14]=v,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,s,o,r,a=qs,l=!1){let c=this.elements,u=2/(t-e),h=2/(n-s),f=-(t+e)/(t-e),p=-(n+s)/(n-s),d,v;if(l)d=1/(r-o),v=r/(r-o);else if(a===qs)d=-2/(r-o),v=-(r+o)/(r-o);else if(a===S0)d=-1/(r-o),v=-o/(r-o);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return c[0]=u,c[4]=0,c[8]=0,c[12]=f,c[1]=0,c[5]=h,c[9]=0,c[13]=p,c[2]=0,c[6]=0,c[10]=d,c[14]=v,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let s=0;s<16;s++)if(t[s]!==n[s])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}},Tl=new W,Jo=new Ye,WM=new W(0,0,0),GM=new W(1,1,1),Ea=new W,Zf=new W,po=new W,cx=new Ye,ux=new Lt,In=class i{constructor(e=0,t=0,n=0,s=i.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=s}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,s=this._order){return this._x=e,this._y=t,this._z=n,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let s=e.elements,o=s[0],r=s[4],a=s[8],l=s[1],c=s[5],u=s[9],h=s[2],f=s[6],p=s[10];switch(t){case"XYZ":this._y=Math.asin(Ct(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-r,o)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ct(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,o),this._z=0);break;case"ZXY":this._x=Math.asin(Ct(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-r,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-Ct(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-r,c));break;case"YZX":this._z=Math.asin(Ct(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-Ct(r,-1,1)),Math.abs(r)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-u,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return cx.makeRotationFromQuaternion(e),this.setFromRotationMatrix(cx,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return ux.setFromEuler(this),this.setFromQuaternion(ux,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};In.DEFAULT_ORDER="XYZ";var C0=class{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}},qM=0,hx=new W,Al=new Lt,Hr=new Ye,jf=new W,hu=new W,XM=new W,YM=new Lt,fx=new W(1,0,0),dx=new W(0,1,0),px=new W(0,0,1),mx={type:"added"},$M={type:"removed"},Rl={type:"childadded",child:null},km={type:"childremoved",child:null},on=class i extends xo{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:qM++}),this.uuid=vo(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=i.DEFAULT_UP.clone();let e=new W,t=new In,n=new Lt,s=new W(1,1,1);function o(){n.setFromEuler(t,!1)}function r(){t.setFromQuaternion(n,void 0,!1)}t._onChange(o),n._onChange(r),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:s},modelViewMatrix:{value:new Ye},normalMatrix:{value:new kt}}),this.matrix=new Ye,this.matrixWorld=new Ye,this.matrixAutoUpdate=i.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=i.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new C0,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Al.setFromAxisAngle(e,t),this.quaternion.multiply(Al),this}rotateOnWorldAxis(e,t){return Al.setFromAxisAngle(e,t),this.quaternion.premultiply(Al),this}rotateX(e){return this.rotateOnAxis(fx,e)}rotateY(e){return this.rotateOnAxis(dx,e)}rotateZ(e){return this.rotateOnAxis(px,e)}translateOnAxis(e,t){return hx.copy(e).applyQuaternion(this.quaternion),this.position.add(hx.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(fx,e)}translateY(e){return this.translateOnAxis(dx,e)}translateZ(e){return this.translateOnAxis(px,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Hr.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?jf.copy(e):jf.set(e,t,n);let s=this.parent;this.updateWorldMatrix(!0,!1),hu.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Hr.lookAt(hu,jf,this.up):Hr.lookAt(jf,hu,this.up),this.quaternion.setFromRotationMatrix(Hr),s&&(Hr.extractRotation(s.matrixWorld),Al.setFromRotationMatrix(Hr),this.quaternion.premultiply(Al.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(mx),Rl.child=e,this.dispatchEvent(Rl),Rl.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}let t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent($M),km.child=e,this.dispatchEvent(km),km.child=null),this}removeFromParent(){let e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Hr.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Hr.multiply(e.parent.matrixWorld)),e.applyMatrix4(Hr),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(mx),Rl.child=e,this.dispatchEvent(Rl),Rl.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,s=this.children.length;n<s;n++){let r=this.children[n].getObjectByProperty(e,t);if(r!==void 0)return r}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);let s=this.children;for(let o=0,r=s.length;o<r;o++)s[o].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(hu,e,XM),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(hu,YM,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let n=0,s=t.length;n<s;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let t=this.children;for(let n=0,s=t.length;n<s;n++)t[n].traverseVisible(e)}traverseAncestors(e){let t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);let t=this.children;for(let n=0,s=t.length;n<s;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){let n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){let s=this.children;for(let o=0,r=s.length;o<r;o++)s[o].updateWorldMatrix(!1,!0)}}toJSON(e){let t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});let s={};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.castShadow===!0&&(s.castShadow=!0),this.receiveShadow===!0&&(s.receiveShadow=!0),this.visible===!1&&(s.visible=!1),this.frustumCulled===!1&&(s.frustumCulled=!1),this.renderOrder!==0&&(s.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.geometryInfo=this._geometryInfo.map(a=>({...a,boundingBox:a.boundingBox?a.boundingBox.toJSON():void 0,boundingSphere:a.boundingSphere?a.boundingSphere.toJSON():void 0})),s.instanceInfo=this._instanceInfo.map(a=>({...a})),s.availableInstanceIds=this._availableInstanceIds.slice(),s.availableGeometryIds=this._availableGeometryIds.slice(),s.nextIndexStart=this._nextIndexStart,s.nextVertexStart=this._nextVertexStart,s.geometryCount=this._geometryCount,s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.matricesTexture=this._matricesTexture.toJSON(e),s.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(s.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(s.boundingBox=this.boundingBox.toJSON()));function o(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=o(e.geometries,this.geometry);let a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){let l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c<u;c++){let h=l[c];o(e.shapes,h)}else o(e.shapes,l)}}if(this.isSkinnedMesh&&(s.bindMode=this.bindMode,s.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(o(e.skeletons,this.skeleton),s.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let a=[];for(let l=0,c=this.material.length;l<c;l++)a.push(o(e.materials,this.material[l]));s.material=a}else s.material=o(e.materials,this.material);if(this.children.length>0){s.children=[];for(let a=0;a<this.children.length;a++)s.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){s.animations=[];for(let a=0;a<this.animations.length;a++){let l=this.animations[a];s.animations.push(o(e.animations,l))}}if(t){let a=r(e.geometries),l=r(e.materials),c=r(e.textures),u=r(e.images),h=r(e.shapes),f=r(e.skeletons),p=r(e.animations),d=r(e.nodes);a.length>0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),f.length>0&&(n.skeletons=f),p.length>0&&(n.animations=p),d.length>0&&(n.nodes=d)}return n.object=s,n;function r(a){let l=[];for(let c in a){let u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){let s=e.children[n];this.add(s.clone())}return this}};on.DEFAULT_UP=new W(0,1,0);on.DEFAULT_MATRIX_AUTO_UPDATE=!0;on.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var Ko=new W,Vr=new W,Fm=new W,Wr=new W,Cl=new W,Pl=new W,gx=new W,Um=new W,Nm=new W,Bm=new W,Om=new Dt,Hm=new Dt,Vm=new Dt,Qo=class i{constructor(e=new W,t=new W,n=new W){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,s){s.subVectors(n,t),Ko.subVectors(e,t),s.cross(Ko);let o=s.lengthSq();return o>0?s.multiplyScalar(1/Math.sqrt(o)):s.set(0,0,0)}static getBarycoord(e,t,n,s,o){Ko.subVectors(s,t),Vr.subVectors(n,t),Fm.subVectors(e,t);let r=Ko.dot(Ko),a=Ko.dot(Vr),l=Ko.dot(Fm),c=Vr.dot(Vr),u=Vr.dot(Fm),h=r*c-a*a;if(h===0)return o.set(0,0,0),null;let f=1/h,p=(c*l-a*u)*f,d=(r*u-a*l)*f;return o.set(1-p-d,d,p)}static containsPoint(e,t,n,s){return this.getBarycoord(e,t,n,s,Wr)===null?!1:Wr.x>=0&&Wr.y>=0&&Wr.x+Wr.y<=1}static getInterpolation(e,t,n,s,o,r,a,l){return this.getBarycoord(e,t,n,s,Wr)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(o,Wr.x),l.addScaledVector(r,Wr.y),l.addScaledVector(a,Wr.z),l)}static getInterpolatedAttribute(e,t,n,s,o,r){return Om.setScalar(0),Hm.setScalar(0),Vm.setScalar(0),Om.fromBufferAttribute(e,t),Hm.fromBufferAttribute(e,n),Vm.fromBufferAttribute(e,s),r.setScalar(0),r.addScaledVector(Om,o.x),r.addScaledVector(Hm,o.y),r.addScaledVector(Vm,o.z),r}static isFrontFacing(e,t,n,s){return Ko.subVectors(n,t),Vr.subVectors(e,t),Ko.cross(Vr).dot(s)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,s){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,n,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,s),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ko.subVectors(this.c,this.b),Vr.subVectors(this.a,this.b),Ko.cross(Vr).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return i.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return i.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,s,o){return i.getInterpolation(e,this.a,this.b,this.c,t,n,s,o)}containsPoint(e){return i.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return i.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,s=this.b,o=this.c,r,a;Cl.subVectors(s,n),Pl.subVectors(o,n),Um.subVectors(e,n);let l=Cl.dot(Um),c=Pl.dot(Um);if(l<=0&&c<=0)return t.copy(n);Nm.subVectors(e,s);let u=Cl.dot(Nm),h=Pl.dot(Nm);if(u>=0&&h<=u)return t.copy(s);let f=l*h-u*c;if(f<=0&&l>=0&&u<=0)return r=l/(l-u),t.copy(n).addScaledVector(Cl,r);Bm.subVectors(e,o);let p=Cl.dot(Bm),d=Pl.dot(Bm);if(d>=0&&p<=d)return t.copy(o);let v=p*c-l*d;if(v<=0&&c>=0&&d<=0)return a=c/(c-d),t.copy(n).addScaledVector(Pl,a);let g=u*d-p*h;if(g<=0&&h-u>=0&&p-d>=0)return gx.subVectors(o,s),a=(h-u)/(h-u+(p-d)),t.copy(s).addScaledVector(gx,a);let x=1/(g+v+f);return r=v*x,a=f*x,t.copy(n).addScaledVector(Cl,r).addScaledVector(Pl,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},$5={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Sa={h:0,s:0,l:0},Jf={h:0,s:0,l:0};function Wm(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*6*(2/3-t):i}var Ve=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){let s=e;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Vn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Kt.colorSpaceToWorking(this,t),this}setRGB(e,t,n,s=Kt.workingColorSpace){return this.r=e,this.g=t,this.b=n,Kt.colorSpaceToWorking(this,s),this}setHSL(e,t,n,s=Kt.workingColorSpace){if(e=hg(e,1),t=Ct(t,0,1),n=Ct(n,0,1),t===0)this.r=this.g=this.b=n;else{let o=n<=.5?n*(1+t):n+t-n*t,r=2*n-o;this.r=Wm(r,o,e+1/3),this.g=Wm(r,o,e),this.b=Wm(r,o,e-1/3)}return Kt.colorSpaceToWorking(this,s),this}setStyle(e,t=Vn){function n(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let o,r=s[1],a=s[2];switch(r){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,t);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,t);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){let o=s[1],r=o.length;if(r===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,t);if(r===6)return this.setHex(parseInt(o,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Vn){let n=$5[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Xr(e.r),this.g=Xr(e.g),this.b=Xr(e.b),this}copyLinearToSRGB(e){return this.r=Wl(e.r),this.g=Wl(e.g),this.b=Wl(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Vn){return Kt.workingToColorSpace(gs.copy(this),e),Math.round(Ct(gs.r*255,0,255))*65536+Math.round(Ct(gs.g*255,0,255))*256+Math.round(Ct(gs.b*255,0,255))}getHexString(e=Vn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Kt.workingColorSpace){Kt.workingToColorSpace(gs.copy(this),t);let n=gs.r,s=gs.g,o=gs.b,r=Math.max(n,s,o),a=Math.min(n,s,o),l,c,u=(a+r)/2;if(a===r)l=0,c=0;else{let h=r-a;switch(c=u<=.5?h/(r+a):h/(2-r-a),r){case n:l=(s-o)/h+(s<o?6:0);break;case s:l=(o-n)/h+2;break;case o:l=(n-s)/h+4;break}l/=6}return e.h=l,e.s=c,e.l=u,e}getRGB(e,t=Kt.workingColorSpace){return Kt.workingToColorSpace(gs.copy(this),t),e.r=gs.r,e.g=gs.g,e.b=gs.b,e}getStyle(e=Vn){Kt.workingToColorSpace(gs.copy(this),e);let t=gs.r,n=gs.g,s=gs.b;return e!==Vn?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${s.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(s*255)})`}offsetHSL(e,t,n){return this.getHSL(Sa),this.setHSL(Sa.h+e,Sa.s+t,Sa.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Sa),e.getHSL(Jf);let n=Eu(Sa.h,Jf.h,t),s=Eu(Sa.s,Jf.s,t),o=Eu(Sa.l,Jf.l,t);return this.setHSL(n,s,o),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,n=this.g,s=this.b,o=e.elements;return this.r=o[0]*t+o[3]*n+o[6]*s,this.g=o[1]*t+o[4]*n+o[7]*s,this.b=o[2]*t+o[5]*n+o[8]*s,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},gs=new Ve;Ve.NAMES=$5;var ZM=0,Oi=class extends xo{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:ZM++}),this.uuid=vo(),this.name="",this.type="Material",this.blending=Ia,this.side=wr,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Au,this.blendDst=w0,this.blendEquation=nr,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ve(0,0,0),this.blendAlpha=0,this.depthFunc=za,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Dd,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Ra,this.stencilZFail=Ra,this.stencilZPass=Ra,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}let s=this[t];if(s===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(n):s&&s.isVector3&&n&&n.isVector3?s.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Ia&&(n.blending=this.blending),this.side!==wr&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Au&&(n.blendSrc=this.blendSrc),this.blendDst!==w0&&(n.blendDst=this.blendDst),this.blendEquation!==nr&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==za&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Dd&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ra&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Ra&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Ra&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function s(o){let r=[];for(let a in o){let l=o[a];delete l.metadata,r.push(l)}return r}if(t){let o=s(e.textures),r=s(e.images);o.length>0&&(n.textures=o),r.length>0&&(n.images=r)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let s=t.length;n=new Array(s);for(let o=0;o!==s;++o)n[o]=t[o].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}},Nn=class extends Oi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ve(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new In,this.combine=vc,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}},qr=jM();function jM(){let i=new ArrayBuffer(4),e=new Float32Array(i),t=new Uint32Array(i),n=new Uint32Array(512),s=new Uint32Array(512);for(let l=0;l<256;++l){let c=l-127;c<-27?(n[l]=0,n[l|256]=32768,s[l]=24,s[l|256]=24):c<-14?(n[l]=1024>>-c-14,n[l|256]=1024>>-c-14|32768,s[l]=-c-1,s[l|256]=-c-1):c<=15?(n[l]=c+15<<10,n[l|256]=c+15<<10|32768,s[l]=13,s[l|256]=13):c<128?(n[l]=31744,n[l|256]=64512,s[l]=24,s[l|256]=24):(n[l]=31744,n[l|256]=64512,s[l]=13,s[l|256]=13)}let o=new Uint32Array(2048),r=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;(c&8388608)===0;)c<<=1,u-=8388608;c&=-8388609,u+=947912704,o[l]=c|u}for(let l=1024;l<2048;++l)o[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)r[l]=l<<23;r[31]=1199570944,r[32]=2147483648;for(let l=33;l<63;++l)r[l]=2147483648+(l-32<<23);r[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:s,mantissaTable:o,exponentTable:r,offsetTable:a}}function Gs(i){Math.abs(i)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),i=Ct(i,-65504,65504),qr.floatView[0]=i;let e=qr.uint32View[0],t=e>>23&511;return qr.baseTable[t]+((e&8388607)>>qr.shiftTable[t])}function _u(i){let e=i>>10;return qr.uint32View[0]=qr.mantissaTable[qr.offsetTable[e]+(i&1023)]+qr.exponentTable[e],qr.floatView[0]}var P0=cl.........完整代码请登录后点击上方下载按钮下载查看

网友评论0