@fleox/agent3d 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +39 -10
  2. package/changelog.json +9 -0
  3. package/dist/agent/agent3d.mjs +2 -2
  4. package/dist/agent/chunks/{package-DzXqX5Oe.mjs → package-Bn7PKfXn.mjs} +1 -1
  5. package/dist/runtime/agent3d-runtime.js +1 -1
  6. package/dist/runtime/agent3d-runtime.single.js +1 -1
  7. package/dist/studio/assets/{assets-DnOt59SU.js → assets-DICv7P37.js} +1 -1
  8. package/dist/studio/assets/{camera-DrubOxWu.js → camera-HsMeC1mn.js} +1 -1
  9. package/dist/studio/assets/{editor-V--luWVq.js → editor-BZLIZJC8.js} +1 -1
  10. package/dist/studio/assets/{game-43BhY_EE.js → game-DnnuBk26.js} +1 -1
  11. package/dist/studio/assets/{generators-lG93qWTO.js → generators-C4n9MsXd.js} +1 -1
  12. package/dist/studio/assets/{index-BPVRhKVV.js → index-cDbmaVDl.js} +4 -4
  13. package/dist/studio/assets/{model-D8-inS_D.js → model-CkPfLOl0.js} +1 -1
  14. package/dist/studio/assets/{photo-BuVK-UvQ.js → photo-CPGGCRa-.js} +1 -1
  15. package/dist/studio/assets/{postfx-Bcnem9ci.js → postfx-Dp7mgfGJ.js} +1 -1
  16. package/dist/studio/assets/{runtime-5Ti8UJJR.js → runtime-ByR4qfyV.js} +4 -4
  17. package/dist/studio/assets/{shaders-WM5brr9C.js → shaders-DoRMwJE_.js} +1 -1
  18. package/dist/studio/assets/{svg-CJ_RtiER.js → svg-n3rkKAm5.js} +1 -1
  19. package/dist/studio/assets/{text-NO7lyCoH.js → text-BkPPDghK.js} +1 -1
  20. package/dist/studio/index.html +1 -1
  21. package/package.json +1 -1
  22. package/plugin/.claude-plugin/plugin.json +1 -1
  23. package/plugin/skills/agent3d-assets/SKILL.md +28 -28
  24. package/plugin/skills/agent3d-create/SKILL.md +30 -30
  25. package/plugin/skills/agent3d-create/references/art-direction.md +3 -3
  26. package/plugin/skills/agent3d-create/references/recipes.md +6 -6
  27. package/plugin/skills/agent3d-edit/SKILL.md +22 -22
  28. package/plugin/skills/agent3d-edit/references/patch-ops.md +2 -2
  29. package/plugin/skills/agent3d-game/SKILL.md +7 -7
  30. package/plugin/skills/agent3d-publish/SKILL.md +23 -23
  31. package/plugin/skills/agent3d-publish/references/integrations.md +1 -1
package/README.md CHANGED
@@ -109,19 +109,19 @@ Once the scene exists, changing it is a conversation:
109
109
  ### Without an agent
110
110
 
111
111
  ```bash
112
- npx -y @fleox/agent3d@0.5.0 new bakery --target banner --title "Golden Crust"
113
- npx -y @fleox/agent3d@0.5.0 studio --project bakery
112
+ npx -y @fleox/agent3d@0.5.2 new bakery --target banner --title "Golden Crust"
113
+ npx -y @fleox/agent3d@0.5.2 studio --project bakery
114
114
  ```
115
115
 
116
- The first command creates a project folder with an attractive starter scene for its target (banner, hero, card, square, fullscreen, inline or game); add `--template <id>` to start from one of the [templates](#templates). The second opens the [Studio](#the-studio) on it. You need **Node.js 22+** and **Google Chrome** (or Chromium / Edge / Brave) for renders; `npx -y @fleox/agent3d@0.5.0 doctor` checks your setup with a test render.
116
+ The first command creates a project folder with an attractive starter scene for its target (banner, hero, card, square, fullscreen, inline or game); add `--template <id>` to start from one of the [templates](#templates). The second opens the [Studio](#the-studio) on it. You need **Node.js 22+** and **Google Chrome** (or Chromium / Edge / Brave) for renders; `npx -y @fleox/agent3d@0.5.2 doctor` checks your setup with a test render.
117
117
 
118
118
  The whole loop from a terminal:
119
119
 
120
120
  ```bash
121
- npx -y @fleox/agent3d@0.5.0 scene patch --project bakery '[{"op":"set","path":"objects#title.material","value":{"preset":"gold"}}]'
122
- npx -y @fleox/agent3d@0.5.0 render --project bakery --sheet # → renders/…-sheet.png
123
- npx -y @fleox/agent3d@0.5.0 check --project bakery
124
- npx -y @fleox/agent3d@0.5.0 export --project bakery # → dist/embed/ + the snippet
121
+ npx -y @fleox/agent3d@0.5.2 scene patch --project bakery '[{"op":"set","path":"objects#title.material","value":{"preset":"gold"}}]'
122
+ npx -y @fleox/agent3d@0.5.2 render --project bakery --sheet # → renders/…-sheet.png
123
+ npx -y @fleox/agent3d@0.5.2 check --project bakery
124
+ npx -y @fleox/agent3d@0.5.2 export --project bakery # → dist/embed/ + the snippet
125
125
  ```
126
126
 
127
127
  Step by step: [docs/getting-started.md](https://github.com/fleox/agent3d/blob/main/docs/getting-started.md).
@@ -157,6 +157,35 @@ Step by step: [docs/getting-started.md](https://github.com/fleox/agent3d/blob/ma
157
157
  <br><sub><b>3D photo</b>: one CC0 photo plus a depth map estimated locally in about a second (<code>agent3d assets depth</code>), moving in depth as the pointer sweeps across it. The <a href="https://github.com/fleox/agent3d/tree/main/templates/hero-photo-3d"><code>hero-photo-3d</code></a> template, rendered with <code>agent3d render --input</code>.</sub>
158
158
  </p>
159
159
 
160
+ **Beyond parallax: what else an agent can do with one photo.** Every clip is a headless render (`agent3d render --video`, then converted to WebP for this page) of a demo scene; the line in quotes is what to ask your agent to get the same result on your own photo. CC0 photos, depth maps estimated locally.
161
+
162
+ <table>
163
+ <tr>
164
+ <td width="50%" valign="top"><img src="https://raw.githubusercontent.com/fleox/agent3d/main/.github/assets/photo3d-inside.webp" width="100%" alt="A 3D OLD TOWN title placed inside a street photo: its letters pass behind the foreground houses as the view moves, with snow falling in front of and behind them"><br><b>3D inside the photo</b> (<code>occlude</code>)<br><i>"Put the OLD TOWN title inside the photo, behind the foreground buildings, with snow falling in front and behind."</i></td>
165
+ <td width="50%" valign="top"><img src="https://raw.githubusercontent.com/fleox/agent3d/main/.github/assets/photo3d-fog.webp" width="100%" alt="A bluish mist gathering at the far end of a street photo while the near facades stay clear"><br><b>Depth fog</b> (<code>effects.fog</code>)<br><i>"Add a bluish mist in the background of the photo."</i></td>
166
+ </tr>
167
+ <tr>
168
+ <td valign="top"><img src="https://raw.githubusercontent.com/fleox/agent3d/main/.github/assets/photo3d-light.webp" width="100%" alt="A warm light following the pointer over a photo of nesting dolls, shading their rounded shapes"><br><b>A light that follows the pointer</b> (<code>effects.light</code>, normals from the depth map)<br><i>"Light the photo with a warm lamp that follows the mouse."</i></td>
169
+ <td valign="top"><img src="https://raw.githubusercontent.com/fleox/agent3d/main/.github/assets/photo3d-reveal.webp" width="100%" alt="A street photo appearing plane by plane, from the far background to the nearest facades"><br><b>Depth-by-depth reveal</b> (<code>effects.reveal</code>)<br><i>"Make the photo appear from the background to the front in 3 seconds."</i></td>
170
+ </tr>
171
+ <tr>
172
+ <td valign="top"><img src="https://raw.githubusercontent.com/fleox/agent3d/main/.github/assets/photo3d-rack.webp" width="100%" alt="A grazing light sweeping down a street photo while a mist rises and falls, driven by the timeline"><br><b>Effects on the timeline</b><br><i>"Sweep a light across the street while the mist rises."</i></td>
173
+ <td valign="top"><img src="https://raw.githubusercontent.com/fleox/agent3d/main/.github/assets/photo3d-blur.webp" width="100%" alt="A lake photo whose focus moves from the foreground reeds to the far mountains and back"><br><b>Rack focus</b> (<code>effects.blur</code>, depth-aware lens blur)<br><i>"Add a focus pull from the foreground to the background."</i></td>
174
+ </tr>
175
+ <tr>
176
+ <td valign="top"><img src="https://raw.githubusercontent.com/fleox/agent3d/main/.github/assets/photo3d-frame.webp" width="100%" alt="A photo inside an inset frame whose nearest subject steps out over the frame edge with a drop shadow"><br><b>Out of frame</b> (<code>effects.frame</code>)<br><i>"Put the photo in a frame and make the subject step out of it."</i></td>
177
+ <td valign="top"><img src="https://raw.githubusercontent.com/fleox/agent3d/main/.github/assets/photo3d-plateab.webp" width="100%" alt="The same wide camera move on a street photo twice: on the left smears around people and roofs, on the right a clean rebuilt background"><br><b>Background plate</b> for bigger moves (<code>assets plate</code>): left without, right with<br><i>"Prepare the photo for bigger camera moves."</i></td>
178
+ </tr>
179
+ <tr>
180
+ <td valign="top"><img src="https://raw.githubusercontent.com/fleox/agent3d/main/.github/assets/photo3d-dolly.webp" width="100%" alt="A camera pushing into a street photo and pulling back, in a seamless loop"><br><b>Dolly</b> (<code>motion.auto</code>: dolly, pan, rise, vertigo)<br><i>"Do a dolly-in on the photo."</i></td>
181
+ <td valign="top"><img src="https://raw.githubusercontent.com/fleox/agent3d/main/.github/assets/photo3d-vertigo.webp" width="100%" alt="A dolly zoom on a street photo: the subject keeps its size while the background stretches"><br><b>Vertigo</b> (dolly zoom)<br><i>"Do a vertigo effect on the photo."</i></td>
182
+ </tr>
183
+ <tr>
184
+ <td valign="top"><img src="https://raw.githubusercontent.com/fleox/agent3d/main/.github/assets/photo3d-story.webp" width="100%" alt="A scroll story: the camera walks down a street photo, which dissolves into a lake photo with a THEN, THE LAKE title, then a vertigo on the lake"><br><b>Scroll story</b> (the <code>photo-scroll-story</code> template, filmed with simulated scrolling)<br><i>"Make a scroll story: we walk down the street, then arrive at the lake."</i></td>
185
+ <td valign="top" align="center"><img src="https://raw.githubusercontent.com/fleox/agent3d/main/.github/assets/photo3d-social.webp" width="200" alt="A vertical 9:16 video of a vertigo effect on a street photo"><br><b>Social video</b> (<code>render --video reel.mp4 --preset vertical</code>: 1080×1920, one seamless loop)<br><i>"Make me a vertical Instagram video with a vertigo effect on this photo."</i></td>
186
+ </tr>
187
+ </table>
188
+
160
189
  **Look**
161
190
  - **Lighting and lookdev**: 10 one-line light rigs (softbox, studio three-point, golden hour, neon, moonlight…), physical skies with a matching sun, 20 built-in HDRIs, height fog, contact shadows, rect panel lights and volumetric spots, mesh-gradient backgrounds
162
191
  - **Materials**: 38 presets from chrome, glass and car paint to velvet, diamond and soap bubble; physical parameters (clearcoat, sheen, iridescence, transmission, anisotropy, dispersion), 12 procedural textures (marble, wood, terrazzo, carbon…) at zero bytes, 17 shaders (aurora, liquid chrome, nebula, caustics…), cel shading that keeps brand colours true
@@ -194,7 +223,7 @@ Step by step: [docs/getting-started.md](https://github.com/fleox/agent3d/blob/ma
194
223
  A visual editor for when you want to see and touch the scene yourself, on the same files and the same validated tools as the agent. Changes your agent makes in a terminal appear live in the open Studio.
195
224
 
196
225
  ```bash
197
- npx -y @fleox/agent3d@0.5.0 studio --project bakery
226
+ npx -y @fleox/agent3d@0.5.2 studio --project bakery
198
227
  ```
199
228
 
200
229
  <p align="center">
@@ -325,7 +354,7 @@ Pick Spline when a designer wants a hosted visual tool, hand-written Three.js wh
325
354
 
326
355
  ## The `agent3d` CLI
327
356
 
328
- The same engine the agents use, by hand: `npx -y @fleox/agent3d@0.5.0 help`. Every command accepts `--json` and prints exactly one `{ ok, data }` or `{ ok: false, error }` object with an actionable hint, and commands that replace or overwrite something print a plan until you add `--yes`.
357
+ The same engine the agents use, by hand: `npx -y @fleox/agent3d@0.5.2 help`. Every command accepts `--json` and prints exactly one `{ ok, data }` or `{ ok: false, error }` object with an actionable hint, and commands that replace or overwrite something print a plan until you add `--yes`.
329
358
 
330
359
  <p align="center">
331
360
  <img src="https://raw.githubusercontent.com/fleox/agent3d/main/.github/assets/demo-cli.gif" width="820" alt="Terminal running the agent3d CLI: a project from the gradient-blob template, its scene summary, a gold torus added, a behaviour patch rejected with an actionable error then fixed, and the pre-export check">
@@ -363,7 +392,7 @@ Full reference: [docs/cli.md](https://github.com/fleox/agent3d/blob/main/docs/cl
363
392
  ## MCP server
364
393
 
365
394
  ```bash
366
- claude mcp add agent3d -- npx -y @fleox/agent3d@0.5.0 mcp --project ~/agent3d/my-banner
395
+ claude mcp add agent3d -- npx -y @fleox/agent3d@0.5.2 mcp --project ~/agent3d/my-banner
367
396
  ```
368
397
 
369
398
  <p align="center">
package/changelog.json CHANGED
@@ -1,5 +1,14 @@
1
1
  {
2
2
  "versions": [
3
+ {
4
+ "version": "0.5.2",
5
+ "date": "2026-11-26",
6
+ "breaking": false,
7
+ "changes": [
8
+ "README: 12 example clips of what one photo can do beyond parallax (3D inside the photo, fog, pointer light, reveal, timeline effects, rack focus, out of frame, background plate, dolly, vertigo, scroll story, vertical social video), each with the request to give your agent."
9
+ ],
10
+ "actions": []
11
+ },
3
12
  {
4
13
  "version": "0.5.0",
5
14
  "date": "2026-11-26",
@@ -6,7 +6,7 @@ __a3dRequire(import.meta.url);
6
6
  const __filename = __a3dPath(import.meta.url);
7
7
  __a3dDirname(__filename);
8
8
  import { t as __exportAll } from "./chunks/rolldown-runtime-ebOQtxsr.mjs";
9
- import { r as version, t as package_default } from "./chunks/package-DzXqX5Oe.mjs";
9
+ import { r as version, t as package_default } from "./chunks/package-Bn7PKfXn.mjs";
10
10
  import { n as didYouMean, r as listOptions, t as closest } from "./chunks/suggest-Cpcgv1RP.mjs";
11
11
  import { format, parseArgs } from "node:util";
12
12
  import { createReadStream, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, watch, writeFileSync } from "node:fs";
@@ -10352,7 +10352,7 @@ var exportCommand = {
10352
10352
  if (runtimeChoice !== "auto" && runtimeChoice !== "full") usage(`Unknown --runtime "${runtimeChoice}".`, "Use auto (default: the photo-only lite runtime for single-3D-photo scenes) or full.");
10353
10353
  const runtime = { files: readRuntimeFiles(format) };
10354
10354
  const { buildExport } = await import("./chunks/export-BSOqVfPT.mjs").then((n) => n.n);
10355
- const { version } = (await import("./chunks/package-DzXqX5Oe.mjs").then((n) => n.n)).default;
10355
+ const { version } = (await import("./chunks/package-Bn7PKfXn.mjs").then((n) => n.n)).default;
10356
10356
  let exportFs = fs;
10357
10357
  let exportLibrary = libraryProvider();
10358
10358
  let optimizeReport;
@@ -8,7 +8,7 @@ import { t as __exportAll } from "./rolldown-runtime-ebOQtxsr.mjs";
8
8
  // package.json
9
9
  var package_exports = /* @__PURE__ */ __exportAll({ default: () => package_default });
10
10
  var name = "@fleox/agent3d";
11
- var version = "0.5.0";
11
+ var version = "0.5.2";
12
12
  var package_default = {
13
13
  name,
14
14
  version,
@@ -1,4 +1,4 @@
1
- import{$t as e,A as t,Bt as n,Cn as r,Et as i,G as a,H as o,In as s,It as c,J as l,L as u,M as d,Mn as f,Mt as p,N as m,Nn as h,Nt as g,On as _,Pt as v,R as y,Rt as b,S as x,Sn as S,Tn as C,U as w,Ut as T,V as ee,W as E,Xt as D,Yt as te,_ as ne,an as re,b as O,bn as ie,bt as k,d as A,dn as ae,en as oe,et as se,f as ce,fn as j,g as le,h as ue,hn as M,i as de,in as fe,j as pe,lt as me,m as he,nn as ge,o as _e,p as ve,pn as ye,r as be,rn as N,t as xe,v as Se,vt as P,w as Ce,xt as we,yn as Te,yt as F,z as Ee,zt as De}from"./chunks/three.module-DnaBiDAJ.js";import{i as Oe,n as ke,o as Ae,r as je}from"./chunks/postfx-ylpcQcVK.js";import{i as Me,n as Ne,t as Pe}from"./chunks/catalog--OTp4gjy.js";import{t as I}from"./chunks/easing-CXSz2e6P.js";import{a as Fe,c as L,i as R,l as z,n as Ie,o as B,r as Le,s as Re,t as V,u as ze}from"./chunks/util-BEflQURG.js";import{n as Be,r as H,t as U}from"./chunks/num-CQNAlL82.js";import{a as Ve,i as He,t as Ue}from"./chunks/random-eeej60NW.js";import{i as We,n as Ge,o as Ke,r as qe,t as Je}from"./chunks/materials-jwhXlLYl.js";import{r as Ye}from"./chunks/assets-kC2Z1Xy_.js";import{n as Xe,t as Ze}from"./chunks/meshGradient.glsl-BMatplLA.js";import{n as Qe}from"./chunks/params-BCNrVCYZ.js";import{t as $e}from"./chunks/RoundedBoxGeometry-BViRogcJ.js";var et=`0.5.0`,tt=/\{data\.([a-zA-Z_$][\w$-]*(?:\.[a-zA-Z_$][\w$-]*)*)(?:\|([^}]*))?\}/g;function nt(e,t){let n=e;for(let e of t.split(`.`)){if(typeof n!=`object`||!n)return;n=n[e]}return n}function rt(e){return typeof e!=`string`||!e.includes(`{data.`)?!1:(tt.lastIndex=0,tt.test(e))}function it(e,t){return e.includes(`{data.`)?e.replace(tt,(e,n,r)=>{let i=nt(t,n);return i==null||i===``?r??``:typeof i==`object`?JSON.stringify(i):String(i)}):e}var at=/^\{data\.([a-zA-Z_$][\w$-]*(?:\.[a-zA-Z_$][\w$-]*)*)(?:\|([^}]*))?\}$/;function ot(e,t){if(typeof e!=`string`||!e.includes(`{data.`))return e;let n=at.exec(e.trim());if(!n)return it(e,t);let r=nt(t,n[1]);if(r!=null&&r!==``)return r;if(n[2]!==void 0)try{return JSON.parse(n[2])}catch{return n[2]}}function W(e,t=e.data){let n=!1,r=e=>rt(e)?(n=!0,it(e,t)):e,i=e=>{if(typeof e==`string`)return rt(e)?(n=!0,ot(e,t)):e;if(Array.isArray(e)){let t=e.map(i);return t.every((t,n)=>t===e[n])?e:t}if(e&&typeof e==`object`){let t=!1,n={};for(let[r,a]of Object.entries(e)){let e=i(a);e!==a&&(t=!0),e!==void 0&&(n[r]=e)}return t?n:e}return e},a=e=>{let t=e,n=t.kind===`text`?r(t.text):t.text,o=r(t.href),s=t.kind===`generator`&&t.params?i(t.params):t.params,c=e.children?.map(a);return n===t.text&&o===t.href&&s===t.params&&(!c||c.every((t,n)=>t===e.children[n]))?e:{...e,...t.kind===`text`?{text:n}:{},...t.href===void 0?{}:{href:o},...s===t.params?{}:{params:s},...c?{children:c}:{}}},o=e.interactions?.map(e=>{let t=e.do;if(!Array.isArray(t))return e;let n=t.map(e=>{let t=e;return!t||typeof t!=`object`||!rt(t.openUrl)?e:{...t,openUrl:r(t.openUrl)}});return n.every((e,n)=>e===t[n])?e:{...e,do:n}}),s=(e.objects??[]).map(a),c=r(e.title),l=r(e.ariaLabel),u=e.ui?.elements?.map(e=>{let t=e,n=r(t.text);return n===t.text?e:{...e,text:n}});return n?{...e,title:c,...e.ariaLabel===void 0?{}:{ariaLabel:l},objects:s,...e.ui&&u?{ui:{...e.ui,elements:u}}:{},...o?{interactions:o}:{}}:e}function st(e){let t={};for(let[n,r]of Object.entries(e))if(r!==void 0){if(n===`json`)try{let e=JSON.parse(r);e&&typeof e==`object`&&!Array.isArray(e)&&Object.assign(t,e)}catch{}else t[n]=r}return t}var ct=typeof HTMLElement<`u`?HTMLElement:class{},lt=`
1
+ import{$t as e,A as t,Bt as n,Cn as r,Et as i,G as a,H as o,In as s,It as c,J as l,L as u,M as d,Mn as f,Mt as p,N as m,Nn as h,Nt as g,On as _,Pt as v,R as y,Rt as b,S as x,Sn as S,Tn as C,U as w,Ut as T,V as ee,W as E,Xt as D,Yt as te,_ as ne,an as re,b as O,bn as ie,bt as k,d as A,dn as ae,en as oe,et as se,f as ce,fn as j,g as le,h as ue,hn as M,i as de,in as fe,j as pe,lt as me,m as he,nn as ge,o as _e,p as ve,pn as ye,r as be,rn as N,t as xe,v as Se,vt as P,w as Ce,xt as we,yn as Te,yt as F,z as Ee,zt as De}from"./chunks/three.module-DnaBiDAJ.js";import{i as Oe,n as ke,o as Ae,r as je}from"./chunks/postfx-ylpcQcVK.js";import{i as Me,n as Ne,t as Pe}from"./chunks/catalog--OTp4gjy.js";import{t as I}from"./chunks/easing-CXSz2e6P.js";import{a as Fe,c as L,i as R,l as z,n as Ie,o as B,r as Le,s as Re,t as V,u as ze}from"./chunks/util-BEflQURG.js";import{n as Be,r as H,t as U}from"./chunks/num-CQNAlL82.js";import{a as Ve,i as He,t as Ue}from"./chunks/random-eeej60NW.js";import{i as We,n as Ge,o as Ke,r as qe,t as Je}from"./chunks/materials-jwhXlLYl.js";import{r as Ye}from"./chunks/assets-kC2Z1Xy_.js";import{n as Xe,t as Ze}from"./chunks/meshGradient.glsl-BMatplLA.js";import{n as Qe}from"./chunks/params-BCNrVCYZ.js";import{t as $e}from"./chunks/RoundedBoxGeometry-BViRogcJ.js";var et=`0.5.2`,tt=/\{data\.([a-zA-Z_$][\w$-]*(?:\.[a-zA-Z_$][\w$-]*)*)(?:\|([^}]*))?\}/g;function nt(e,t){let n=e;for(let e of t.split(`.`)){if(typeof n!=`object`||!n)return;n=n[e]}return n}function rt(e){return typeof e!=`string`||!e.includes(`{data.`)?!1:(tt.lastIndex=0,tt.test(e))}function it(e,t){return e.includes(`{data.`)?e.replace(tt,(e,n,r)=>{let i=nt(t,n);return i==null||i===``?r??``:typeof i==`object`?JSON.stringify(i):String(i)}):e}var at=/^\{data\.([a-zA-Z_$][\w$-]*(?:\.[a-zA-Z_$][\w$-]*)*)(?:\|([^}]*))?\}$/;function ot(e,t){if(typeof e!=`string`||!e.includes(`{data.`))return e;let n=at.exec(e.trim());if(!n)return it(e,t);let r=nt(t,n[1]);if(r!=null&&r!==``)return r;if(n[2]!==void 0)try{return JSON.parse(n[2])}catch{return n[2]}}function W(e,t=e.data){let n=!1,r=e=>rt(e)?(n=!0,it(e,t)):e,i=e=>{if(typeof e==`string`)return rt(e)?(n=!0,ot(e,t)):e;if(Array.isArray(e)){let t=e.map(i);return t.every((t,n)=>t===e[n])?e:t}if(e&&typeof e==`object`){let t=!1,n={};for(let[r,a]of Object.entries(e)){let e=i(a);e!==a&&(t=!0),e!==void 0&&(n[r]=e)}return t?n:e}return e},a=e=>{let t=e,n=t.kind===`text`?r(t.text):t.text,o=r(t.href),s=t.kind===`generator`&&t.params?i(t.params):t.params,c=e.children?.map(a);return n===t.text&&o===t.href&&s===t.params&&(!c||c.every((t,n)=>t===e.children[n]))?e:{...e,...t.kind===`text`?{text:n}:{},...t.href===void 0?{}:{href:o},...s===t.params?{}:{params:s},...c?{children:c}:{}}},o=e.interactions?.map(e=>{let t=e.do;if(!Array.isArray(t))return e;let n=t.map(e=>{let t=e;return!t||typeof t!=`object`||!rt(t.openUrl)?e:{...t,openUrl:r(t.openUrl)}});return n.every((e,n)=>e===t[n])?e:{...e,do:n}}),s=(e.objects??[]).map(a),c=r(e.title),l=r(e.ariaLabel),u=e.ui?.elements?.map(e=>{let t=e,n=r(t.text);return n===t.text?e:{...e,text:n}});return n?{...e,title:c,...e.ariaLabel===void 0?{}:{ariaLabel:l},objects:s,...e.ui&&u?{ui:{...e.ui,elements:u}}:{},...o?{interactions:o}:{}}:e}function st(e){let t={};for(let[n,r]of Object.entries(e))if(r!==void 0){if(n===`json`)try{let e=JSON.parse(r);e&&typeof e==`object`&&!Array.isArray(e)&&Object.assign(t,e)}catch{}else t[n]=r}return t}var ct=typeof HTMLElement<`u`?HTMLElement:class{},lt=`
2
2
  :host{display:block;position:relative;width:100%;overflow:hidden;background:var(--agent3d-background,transparent);contain:layout paint;-webkit-tap-highlight-color:transparent}
3
3
  :host([hidden]){display:none}
4
4
  :host([interactive="false"]) ::slotted(*){pointer-events:none}
@@ -1,4 +1,4 @@
1
- var e=Object.defineProperty,t=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},n=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},r=`0.5.0`,i=/\{data\.([a-zA-Z_$][\w$-]*(?:\.[a-zA-Z_$][\w$-]*)*)(?:\|([^}]*))?\}/g;function a(e,t){let n=e;for(let e of t.split(`.`)){if(typeof n!=`object`||!n)return;n=n[e]}return n}function o(e){return typeof e!=`string`||!e.includes(`{data.`)?!1:(i.lastIndex=0,i.test(e))}function s(e,t){return e.includes(`{data.`)?e.replace(i,(e,n,r)=>{let i=a(t,n);return i==null||i===``?r??``:typeof i==`object`?JSON.stringify(i):String(i)}):e}var c=/^\{data\.([a-zA-Z_$][\w$-]*(?:\.[a-zA-Z_$][\w$-]*)*)(?:\|([^}]*))?\}$/;function l(e,t){if(typeof e!=`string`||!e.includes(`{data.`))return e;let n=c.exec(e.trim());if(!n)return s(e,t);let r=a(t,n[1]);if(r!=null&&r!==``)return r;if(n[2]!==void 0)try{return JSON.parse(n[2])}catch{return n[2]}}function u(e,t=e.data){let n=!1,r=e=>o(e)?(n=!0,s(e,t)):e,i=e=>{if(typeof e==`string`)return o(e)?(n=!0,l(e,t)):e;if(Array.isArray(e)){let t=e.map(i);return t.every((t,n)=>t===e[n])?e:t}if(e&&typeof e==`object`){let t=!1,n={};for(let[r,a]of Object.entries(e)){let e=i(a);e!==a&&(t=!0),e!==void 0&&(n[r]=e)}return t?n:e}return e},a=e=>{let t=e,n=t.kind===`text`?r(t.text):t.text,o=r(t.href),s=t.kind===`generator`&&t.params?i(t.params):t.params,c=e.children?.map(a);return n===t.text&&o===t.href&&s===t.params&&(!c||c.every((t,n)=>t===e.children[n]))?e:{...e,...t.kind===`text`?{text:n}:{},...t.href===void 0?{}:{href:o},...s===t.params?{}:{params:s},...c?{children:c}:{}}},c=e.interactions?.map(e=>{let t=e.do;if(!Array.isArray(t))return e;let n=t.map(e=>{let t=e;return!t||typeof t!=`object`||!o(t.openUrl)?e:{...t,openUrl:r(t.openUrl)}});return n.every((e,n)=>e===t[n])?e:{...e,do:n}}),u=(e.objects??[]).map(a),d=r(e.title),f=r(e.ariaLabel),p=e.ui?.elements?.map(e=>{let t=e,n=r(t.text);return n===t.text?e:{...e,text:n}});return n?{...e,title:d,...e.ariaLabel===void 0?{}:{ariaLabel:f},objects:u,...e.ui&&p?{ui:{...e.ui,elements:p}}:{},...c?{interactions:c}:{}}:e}function d(e){let t={};for(let[n,r]of Object.entries(e))if(r!==void 0){if(n===`json`)try{let e=JSON.parse(r);e&&typeof e==`object`&&!Array.isArray(e)&&Object.assign(t,e)}catch{}else t[n]=r}return t}var f=typeof HTMLElement<`u`?HTMLElement:class{},p=`
1
+ var e=Object.defineProperty,t=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},n=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},r=`0.5.2`,i=/\{data\.([a-zA-Z_$][\w$-]*(?:\.[a-zA-Z_$][\w$-]*)*)(?:\|([^}]*))?\}/g;function a(e,t){let n=e;for(let e of t.split(`.`)){if(typeof n!=`object`||!n)return;n=n[e]}return n}function o(e){return typeof e!=`string`||!e.includes(`{data.`)?!1:(i.lastIndex=0,i.test(e))}function s(e,t){return e.includes(`{data.`)?e.replace(i,(e,n,r)=>{let i=a(t,n);return i==null||i===``?r??``:typeof i==`object`?JSON.stringify(i):String(i)}):e}var c=/^\{data\.([a-zA-Z_$][\w$-]*(?:\.[a-zA-Z_$][\w$-]*)*)(?:\|([^}]*))?\}$/;function l(e,t){if(typeof e!=`string`||!e.includes(`{data.`))return e;let n=c.exec(e.trim());if(!n)return s(e,t);let r=a(t,n[1]);if(r!=null&&r!==``)return r;if(n[2]!==void 0)try{return JSON.parse(n[2])}catch{return n[2]}}function u(e,t=e.data){let n=!1,r=e=>o(e)?(n=!0,s(e,t)):e,i=e=>{if(typeof e==`string`)return o(e)?(n=!0,l(e,t)):e;if(Array.isArray(e)){let t=e.map(i);return t.every((t,n)=>t===e[n])?e:t}if(e&&typeof e==`object`){let t=!1,n={};for(let[r,a]of Object.entries(e)){let e=i(a);e!==a&&(t=!0),e!==void 0&&(n[r]=e)}return t?n:e}return e},a=e=>{let t=e,n=t.kind===`text`?r(t.text):t.text,o=r(t.href),s=t.kind===`generator`&&t.params?i(t.params):t.params,c=e.children?.map(a);return n===t.text&&o===t.href&&s===t.params&&(!c||c.every((t,n)=>t===e.children[n]))?e:{...e,...t.kind===`text`?{text:n}:{},...t.href===void 0?{}:{href:o},...s===t.params?{}:{params:s},...c?{children:c}:{}}},c=e.interactions?.map(e=>{let t=e.do;if(!Array.isArray(t))return e;let n=t.map(e=>{let t=e;return!t||typeof t!=`object`||!o(t.openUrl)?e:{...t,openUrl:r(t.openUrl)}});return n.every((e,n)=>e===t[n])?e:{...e,do:n}}),u=(e.objects??[]).map(a),d=r(e.title),f=r(e.ariaLabel),p=e.ui?.elements?.map(e=>{let t=e,n=r(t.text);return n===t.text?e:{...e,text:n}});return n?{...e,title:d,...e.ariaLabel===void 0?{}:{ariaLabel:f},objects:u,...e.ui&&p?{ui:{...e.ui,elements:p}}:{},...c?{interactions:c}:{}}:e}function d(e){let t={};for(let[n,r]of Object.entries(e))if(r!==void 0){if(n===`json`)try{let e=JSON.parse(r);e&&typeof e==`object`&&!Array.isArray(e)&&Object.assign(t,e)}catch{}else t[n]=r}return t}var f=typeof HTMLElement<`u`?HTMLElement:class{},p=`
2
2
  :host{display:block;position:relative;width:100%;overflow:hidden;background:var(--agent3d-background,transparent);contain:layout paint;-webkit-tap-highlight-color:transparent}
3
3
  :host([hidden]){display:none}
4
4
  :host([interactive="false"]) ::slotted(*){pointer-events:none}
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./three.module-B9FlcKtd.js","./rolldown-runtime-4tVxZq34.js"])))=>i.map(i=>d[i]);
2
- import{g as e}from"./index-BPVRhKVV.js";var t=new Map;function n(e){let n=t.get(e);return n||(n=fetch(e).then(t=>{if(!t.ok)throw Error(`HTTP ${t.status} for ${e}`);return t.text()}),n.catch(()=>t.delete(e)),t.set(e,n)),n}async function r(e){return JSON.parse(await n(e))}var i=new Map;function a(t){let n=i.get(t);return n||(n=e(()=>import(`./three.module-B9FlcKtd.js`).then(e=>e.a).then(e=>new Promise((n,r)=>{new e.TextureLoader().load(t,n,void 0,()=>r(Error(`Cannot load texture ${t}`)))})),__vite__mapDeps([0,1]),import.meta.url),n.catch(()=>i.delete(t)),i.set(t,n)),n.then(e=>{let t=e.clone();return t.needsUpdate=!0,t})}export{n,a as r,r as t};
2
+ import{g as e}from"./index-cDbmaVDl.js";var t=new Map;function n(e){let n=t.get(e);return n||(n=fetch(e).then(t=>{if(!t.ok)throw Error(`HTTP ${t.status} for ${e}`);return t.text()}),n.catch(()=>t.delete(e)),t.set(e,n)),n}async function r(e){return JSON.parse(await n(e))}var i=new Map;function a(t){let n=i.get(t);return n||(n=e(()=>import(`./three.module-B9FlcKtd.js`).then(e=>e.a).then(e=>new Promise((n,r)=>{new e.TextureLoader().load(t,n,void 0,()=>r(Error(`Cannot load texture ${t}`)))})),__vite__mapDeps([0,1]),import.meta.url),n.catch(()=>i.delete(t)),i.set(t,n)),n.then(e=>{let t=e.clone();return t.needsUpdate=!0,t})}export{n,a as r,r as t};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./OrbitControls-1xEm394I.js","./three.module-B9FlcKtd.js","./rolldown-runtime-4tVxZq34.js"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t,t as n}from"./num-CQNAlL82.js";import{In as r,It as i,Ln as a,Rt as o,wn as s,x as c}from"./three.module-B9FlcKtd.js";import{g as l}from"./index-BPVRhKVV.js";function u(e,t){return typeof e==`boolean`?e:t}function d(e,t){return typeof e==`string`?e:t}function f(e,t){return Array.isArray(e)&&e.length>=3&&e.every(e=>typeof e==`number`)?[e[0],e[1],e[2]]:t}function p(e,t){return typeof e==`string`?[e]:Array.isArray(e)&&e.length&&e.every(e=>typeof e==`string`)?e:t}var m=new Map;function h(e,t=`#ffffff`){let n=typeof e==`string`&&e?e:t,r=m.get(n);if(!r){r=new c;try{r.setStyle(n)}catch{r.setStyle(t)}m.size>512&&m.clear(),m.set(n,r)}return r.clone()}function g(e,t){let n={};if(e)for(let t of e.params)t.default!==void 0&&(n[t.name]=t.default);for(let[e,r]of Object.entries(t))r!==void 0&&(n[e]=r);return n}function _(t,n){let r=e(t,0,.999);return r<=0?1:1-r**(n*60)}function v(e){let t=Math.sin(e*127.1+311.7)*43758.5453123;return t-Math.floor(t)}function y(e){e.traverse(e=>{let t=e;t.geometry&&t.geometry.dispose();let n=t.material;if(n)for(let e of Array.isArray(n)?n:[n])b(e)})}function b(e){for(let t of Object.values(e))t instanceof s&&t.dispose();e.dispose()}function x(e){let t=new Set;return e.traverse(e=>{let n=e.material;if(n&&!e.userData.depthTwin)for(let e of Array.isArray(n)?n:[n])t.add(e)}),[...t]}function S(e){let t=(Math.floor(e)|0)^2654435769,n=()=>{t=t+2654435769|0;let e=t;return e=Math.imul(e^e>>>16,2246822507),e=Math.imul(e^e>>>13,3266489909),(e^e>>>16)>>>0},r=n(),i=n(),a=n(),o=n(),s=()=>{r>>>=0,i>>>=0,a>>>=0,o>>>=0;let e=(r+i|0)+o|0;return o=o+1|0,r=i^i>>>9,i=a+(a<<3)|0,a=a<<21|a>>>11,a=a+e|0,(e>>>0)/4294967296};for(let e=0;e<12;e++)s();return{next:s,range:(e,t)=>e+(t-e)*s(),int:(e,t)=>e+Math.floor(s()*(t-e+1)),pick:e=>e[Math.floor(s()*e.length)]}}function C(e,t){let n=(e|0)^2166136261;for(let e=0;e<t.length;e++)n^=t.charCodeAt(e),n=Math.imul(n,16777619);return n>>>0}var w=new Uint8Array(512),T=new Uint8Array(512);{let e=new Uint8Array(256);for(let t=0;t<256;t++)e[t]=t;let t=S(1337);for(let n=255;n>0;n--){let r=Math.floor(t.next()*(n+1)),i=e[n];e[n]=e[r],e[r]=i}for(let t=0;t<512;t++)w[t]=e[t&255],T[t]=w[t]%12}var E=new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),D=.5*(Math.sqrt(3)-1),O=(3-Math.sqrt(3))/6;function k(e,t){let n=(e+t)*D,r=Math.floor(e+n),i=Math.floor(t+n),a=(r+i)*O,o=e-(r-a),s=t-(i-a),c=+(o>s),l=o>s?0:1,u=o-c+O,d=s-l+O,f=o-1+2*O,p=s-1+2*O,m=r&255,h=i&255,g=0,_=.5-o*o-s*s;if(_>0){let e=T[m+w[h]]*3;_*=_,g+=_*_*(E[e]*o+E[e+1]*s)}let v=.5-u*u-d*d;if(v>0){let e=T[m+c+w[h+l]]*3;v*=v,g+=v*v*(E[e]*u+E[e+1]*d)}let y=.5-f*f-p*p;if(y>0){let e=T[m+1+w[h+1]]*3;y*=y,g+=y*y*(E[e]*f+E[e+1]*p)}return 70*g}var A=1/3,j=1/6;function M(e,t,n){let r=(e+t+n)*A,i=Math.floor(e+r),a=Math.floor(t+r),o=Math.floor(n+r),s=(i+a+o)*j,c=e-(i-s),l=t-(a-s),u=n-(o-s),d,f,p,m,h,g;c>=l?l>=u?[d,f,p,m,h,g]=[1,0,0,1,1,0]:c>=u?[d,f,p,m,h,g]=[1,0,0,1,0,1]:[d,f,p,m,h,g]=[0,0,1,1,0,1]:l<u?[d,f,p,m,h,g]=[0,0,1,0,1,1]:c<u?[d,f,p,m,h,g]=[0,1,0,0,1,1]:[d,f,p,m,h,g]=[0,1,0,1,1,0];let _=c-d+j,v=l-f+j,y=u-p+j,b=c-m+2*j,x=l-h+2*j,S=u-g+2*j,C=c-1+3*j,D=l-1+3*j,O=u-1+3*j,k=i&255,M=a&255,N=o&255,P=0,F=(e,t,n,r)=>{let i=.6-e*e-t*t-n*n;if(i>0){let a=r*3;i*=i,P+=i*i*(E[a]*e+E[a+1]*t+E[a+2]*n)}};return F(c,l,u,T[k+w[M+w[N]]]),F(_,v,y,T[k+d+w[M+f+w[N+p]]]),F(b,x,S,T[k+m+w[M+h+w[N+g]]]),F(C,D,O,T[k+1+w[M+1+w[N+1]]]),32*P}function N(e,t,n,r=2,i=.5){let a=0,o=1,s=1,c=0;for(let l=0;l<n;l++)a+=o*k(e*s+l*17.31,t*s-l*9.17),c+=o,o*=i,s*=r;return c>0?a/c:0}function P(e,t,n,r,i=2,a=.5){let o=0,s=1,c=1,l=0;for(let u=0;u<r;u++)o+=s*M(e*c+u*17.31,t*c-u*9.17,n*c+u*3.7),l+=s,s*=a,c*=i;return l>0?o/l:0}function F(e,t,n,r=2,i=.5){let a=0,o=1,s=1,c=0;for(let l=0;l<n;l++){let n=1-Math.abs(k(e*s+l*31.7,t*s+l*11.3));a+=o*n*n,c+=o,o*=i,s*=r}return c>0?a/c:0}function I(e,t){return!t||!(e>0)||e>=t?1:Math.min(t/e,3)}function L(e,t){return t<=1?e:Math.min(100,2*Math.atan(Math.tan(e*n/2)*t)/n)}function R(e){let t=/^\s*([\d.]+)\s*[:/x]\s*([\d.]+)\s*$/.exec(e??``),n=t?Number(t[1])/Number(t[2]):void 0;return n&&Number.isFinite(n)&&n>0?n:void 0}function z(e,t){let n=t.x-e.x,r=t.y-e.y,i=t.z-e.z,a=Math.hypot(n,r,i);if(a<1e-9)return;let o=-1e-4/a;e.set(e.x+n*o,e.y+r*o,e.z+i*o)}function B(e,n){let r=t(e.near,.1),s=t(e.far,1e3),c;if(e.type===`orthographic`){let a=t(e.zoom,10)/2;c=new i(-a*n,a*n,a,-a,r,s)}else c=new o(t(e.fov,45),n,r,s);c.position.set(...e.position);let l=e.target??[0,0,0];return z(c.position,new a(l[0],l[1],l[2])),c.lookAt(l[0],l[1],l[2]),c}function V(e,n,r,a){let s=I(r,a);if(e.userData.fitScale=s,e instanceof o)e.aspect=r,e.fov=L(t(e.userData.restFov,t(n.fov,45)),s),e.updateProjectionMatrix();else if(e instanceof i){let i=(e.userData.zoomHeight??t(n.zoom,10))/2*s;e.left=-i*r,e.right=i*r,e.top=i,e.bottom=-i,e.updateProjectionMatrix()}}async function H(s,c,u,d){let f=new a(...s.target??[0,0,0]),p={position:new a(...s.position),target:f.clone(),fov:t(s.fov,45),zoom:t(s.zoom,10)},m=s.controls??`none`,h=p.position.clone(),g=p.target.clone(),v=new r,y=new a,b=!0,x=null;if(m===`orbit`&&u&&!d){let{OrbitControls:e}=await l(async()=>{let{OrbitControls:e}=await import(`./OrbitControls-1xEm394I.js`);return{OrbitControls:e}},__vite__mapDeps([0,1,2]),import.meta.url),t=new e(c,u);t.target.copy(p.target),t.enableDamping=!0,t.dampingFactor=.08,t.enableZoom=s.orbitZoom!==!1,t.enablePan=!1;let r=s.orbitLimits??{};r.minDistance!==void 0&&(t.minDistance=r.minDistance),r.maxDistance!==void 0&&(t.maxDistance=r.maxDistance),r.minPolar!==void 0&&(t.minPolarAngle=r.minPolar*n),r.maxPolar!==void 0&&(t.maxPolarAngle=r.maxPolar*n),r.minAzimuth!==void 0&&(t.minAzimuthAngle=r.minAzimuth*n),r.maxAzimuth!==void 0&&(t.maxAzimuthAngle=r.maxAzimuth*n),s.autoRotate&&(t.autoRotate=!0,t.autoRotateSpeed=s.autoRotate/360*60),x=t}let S=new a,C=new a;return{rest:p,shake:y,orbit:x,update(r,l,u){if(c instanceof o){c.userData.restFov=p.fov;let e=L(p.fov,t(c.userData.fitScale,1));c.fov!==e&&(c.fov=e,c.updateProjectionMatrix())}else if(c instanceof i&&t(c.userData.zoomHeight,t(s.zoom,10))!==p.zoom){c.userData.zoomHeight=p.zoom;let e=(c.right-c.left)/Math.max(c.top-c.bottom,1e-6),n=p.zoom/2*t(c.userData.fitScale,1);c.left=-n*e,c.right=n*e,c.top=n,c.bottom=-n,c.updateProjectionMatrix()}if(x){x.update(),c.position.add(y);return}let d=S.copy(p.position),f=g;if(m===`scroll`&&s.scrollPath?.length){let t=s.scrollPath,n=e(u.scroll,0,1)*(t.length-1),r=Math.min(Math.floor(n),t.length-2),i=t.length===1?0:n-Math.max(r,0),o=i*i*(3-2*i),c=t[Math.max(r,0)],l=t[Math.min(Math.max(r,0)+1,t.length-1)];d.set(...c.position).lerp(new a(...l.position),o);let p=new a(...c.target??s.target??[0,0,0]),m=new a(...l.target??s.target??[0,0,0]);f.copy(p.lerp(m,o))}else if(m===`follow`&&u.followTarget){let e=s.follow??{target:``},n=u.followTarget.getWorldPosition(new a),r=new a(...e.offset??[0,4,8]),i=n.clone().add(r),o=n.clone().add(new a(0,0,-t(e.lookAhead,0))),c=b?1:_(t(e.smoothing,.85),l);h.lerp(i,c),f.lerp(o,c),d=S.copy(h)}else f.copy(p.target);if(u.lookAt&&f.copy(u.lookAt),s.autoRotate&&m!==`follow`){let e=s.autoRotate*n*r,t=d.clone().sub(f);t.applyAxisAngle(new a(0,1,0),e),d.copy(f).add(t)}if(m===`parallax`){let e=s.parallax??{},n=t(e.strength,.5),r=_(t(e.smoothing,.92),l);v.x+=(u.pointer.x*n-v.x)*r,v.y+=(u.pointer.y*n*.6-v.y)*r;let i=f.clone().sub(d).normalize(),o=new a().crossVectors(i,c.up).normalize(),p=new a().crossVectors(o,i).normalize();d.addScaledVector(o,v.x).addScaledVector(p,v.y)}if(s.shake){let e=s.shake,i=t(e.speed,.5),o=t(e.amount,.03),l=t(e.rotation,.4)*n,u=t(e.seed,1)*17.31,p=e=>k(r*i+u,e*7.13)*.75+k(r*i*2.7+u,e*7.13+3.1)*.25,m=f.clone().sub(d),h=m.length()||1;m.divideScalar(h);let g=new a().crossVectors(m,c.up).normalize(),_=new a().crossVectors(g,m).normalize();d.addScaledVector(g,p(0)*o).addScaledVector(_,p(1)*o),C.copy(f).addScaledVector(g,Math.tan(p(2)*l)*h).addScaledVector(_,Math.tan(p(3)*l)*h)}else C.copy(f);c.position.copy(d).add(y),z(c.position,C),c.lookAt(C),b=!1},dispose(){x?.dispose()}}}export{_,S as a,f as b,C as c,F as d,u as f,x as g,v as h,R as i,k as l,y as m,H as n,N as o,p,V as r,P as s,B as t,M as u,d as v,g as x,h as y};
2
+ import{n as e,r as t,t as n}from"./num-CQNAlL82.js";import{In as r,It as i,Ln as a,Rt as o,wn as s,x as c}from"./three.module-B9FlcKtd.js";import{g as l}from"./index-cDbmaVDl.js";function u(e,t){return typeof e==`boolean`?e:t}function d(e,t){return typeof e==`string`?e:t}function f(e,t){return Array.isArray(e)&&e.length>=3&&e.every(e=>typeof e==`number`)?[e[0],e[1],e[2]]:t}function p(e,t){return typeof e==`string`?[e]:Array.isArray(e)&&e.length&&e.every(e=>typeof e==`string`)?e:t}var m=new Map;function h(e,t=`#ffffff`){let n=typeof e==`string`&&e?e:t,r=m.get(n);if(!r){r=new c;try{r.setStyle(n)}catch{r.setStyle(t)}m.size>512&&m.clear(),m.set(n,r)}return r.clone()}function g(e,t){let n={};if(e)for(let t of e.params)t.default!==void 0&&(n[t.name]=t.default);for(let[e,r]of Object.entries(t))r!==void 0&&(n[e]=r);return n}function _(t,n){let r=e(t,0,.999);return r<=0?1:1-r**(n*60)}function v(e){let t=Math.sin(e*127.1+311.7)*43758.5453123;return t-Math.floor(t)}function y(e){e.traverse(e=>{let t=e;t.geometry&&t.geometry.dispose();let n=t.material;if(n)for(let e of Array.isArray(n)?n:[n])b(e)})}function b(e){for(let t of Object.values(e))t instanceof s&&t.dispose();e.dispose()}function x(e){let t=new Set;return e.traverse(e=>{let n=e.material;if(n&&!e.userData.depthTwin)for(let e of Array.isArray(n)?n:[n])t.add(e)}),[...t]}function S(e){let t=(Math.floor(e)|0)^2654435769,n=()=>{t=t+2654435769|0;let e=t;return e=Math.imul(e^e>>>16,2246822507),e=Math.imul(e^e>>>13,3266489909),(e^e>>>16)>>>0},r=n(),i=n(),a=n(),o=n(),s=()=>{r>>>=0,i>>>=0,a>>>=0,o>>>=0;let e=(r+i|0)+o|0;return o=o+1|0,r=i^i>>>9,i=a+(a<<3)|0,a=a<<21|a>>>11,a=a+e|0,(e>>>0)/4294967296};for(let e=0;e<12;e++)s();return{next:s,range:(e,t)=>e+(t-e)*s(),int:(e,t)=>e+Math.floor(s()*(t-e+1)),pick:e=>e[Math.floor(s()*e.length)]}}function C(e,t){let n=(e|0)^2166136261;for(let e=0;e<t.length;e++)n^=t.charCodeAt(e),n=Math.imul(n,16777619);return n>>>0}var w=new Uint8Array(512),T=new Uint8Array(512);{let e=new Uint8Array(256);for(let t=0;t<256;t++)e[t]=t;let t=S(1337);for(let n=255;n>0;n--){let r=Math.floor(t.next()*(n+1)),i=e[n];e[n]=e[r],e[r]=i}for(let t=0;t<512;t++)w[t]=e[t&255],T[t]=w[t]%12}var E=new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),D=.5*(Math.sqrt(3)-1),O=(3-Math.sqrt(3))/6;function k(e,t){let n=(e+t)*D,r=Math.floor(e+n),i=Math.floor(t+n),a=(r+i)*O,o=e-(r-a),s=t-(i-a),c=+(o>s),l=o>s?0:1,u=o-c+O,d=s-l+O,f=o-1+2*O,p=s-1+2*O,m=r&255,h=i&255,g=0,_=.5-o*o-s*s;if(_>0){let e=T[m+w[h]]*3;_*=_,g+=_*_*(E[e]*o+E[e+1]*s)}let v=.5-u*u-d*d;if(v>0){let e=T[m+c+w[h+l]]*3;v*=v,g+=v*v*(E[e]*u+E[e+1]*d)}let y=.5-f*f-p*p;if(y>0){let e=T[m+1+w[h+1]]*3;y*=y,g+=y*y*(E[e]*f+E[e+1]*p)}return 70*g}var A=1/3,j=1/6;function M(e,t,n){let r=(e+t+n)*A,i=Math.floor(e+r),a=Math.floor(t+r),o=Math.floor(n+r),s=(i+a+o)*j,c=e-(i-s),l=t-(a-s),u=n-(o-s),d,f,p,m,h,g;c>=l?l>=u?[d,f,p,m,h,g]=[1,0,0,1,1,0]:c>=u?[d,f,p,m,h,g]=[1,0,0,1,0,1]:[d,f,p,m,h,g]=[0,0,1,1,0,1]:l<u?[d,f,p,m,h,g]=[0,0,1,0,1,1]:c<u?[d,f,p,m,h,g]=[0,1,0,0,1,1]:[d,f,p,m,h,g]=[0,1,0,1,1,0];let _=c-d+j,v=l-f+j,y=u-p+j,b=c-m+2*j,x=l-h+2*j,S=u-g+2*j,C=c-1+3*j,D=l-1+3*j,O=u-1+3*j,k=i&255,M=a&255,N=o&255,P=0,F=(e,t,n,r)=>{let i=.6-e*e-t*t-n*n;if(i>0){let a=r*3;i*=i,P+=i*i*(E[a]*e+E[a+1]*t+E[a+2]*n)}};return F(c,l,u,T[k+w[M+w[N]]]),F(_,v,y,T[k+d+w[M+f+w[N+p]]]),F(b,x,S,T[k+m+w[M+h+w[N+g]]]),F(C,D,O,T[k+1+w[M+1+w[N+1]]]),32*P}function N(e,t,n,r=2,i=.5){let a=0,o=1,s=1,c=0;for(let l=0;l<n;l++)a+=o*k(e*s+l*17.31,t*s-l*9.17),c+=o,o*=i,s*=r;return c>0?a/c:0}function P(e,t,n,r,i=2,a=.5){let o=0,s=1,c=1,l=0;for(let u=0;u<r;u++)o+=s*M(e*c+u*17.31,t*c-u*9.17,n*c+u*3.7),l+=s,s*=a,c*=i;return l>0?o/l:0}function F(e,t,n,r=2,i=.5){let a=0,o=1,s=1,c=0;for(let l=0;l<n;l++){let n=1-Math.abs(k(e*s+l*31.7,t*s+l*11.3));a+=o*n*n,c+=o,o*=i,s*=r}return c>0?a/c:0}function I(e,t){return!t||!(e>0)||e>=t?1:Math.min(t/e,3)}function L(e,t){return t<=1?e:Math.min(100,2*Math.atan(Math.tan(e*n/2)*t)/n)}function R(e){let t=/^\s*([\d.]+)\s*[:/x]\s*([\d.]+)\s*$/.exec(e??``),n=t?Number(t[1])/Number(t[2]):void 0;return n&&Number.isFinite(n)&&n>0?n:void 0}function z(e,t){let n=t.x-e.x,r=t.y-e.y,i=t.z-e.z,a=Math.hypot(n,r,i);if(a<1e-9)return;let o=-1e-4/a;e.set(e.x+n*o,e.y+r*o,e.z+i*o)}function B(e,n){let r=t(e.near,.1),s=t(e.far,1e3),c;if(e.type===`orthographic`){let a=t(e.zoom,10)/2;c=new i(-a*n,a*n,a,-a,r,s)}else c=new o(t(e.fov,45),n,r,s);c.position.set(...e.position);let l=e.target??[0,0,0];return z(c.position,new a(l[0],l[1],l[2])),c.lookAt(l[0],l[1],l[2]),c}function V(e,n,r,a){let s=I(r,a);if(e.userData.fitScale=s,e instanceof o)e.aspect=r,e.fov=L(t(e.userData.restFov,t(n.fov,45)),s),e.updateProjectionMatrix();else if(e instanceof i){let i=(e.userData.zoomHeight??t(n.zoom,10))/2*s;e.left=-i*r,e.right=i*r,e.top=i,e.bottom=-i,e.updateProjectionMatrix()}}async function H(s,c,u,d){let f=new a(...s.target??[0,0,0]),p={position:new a(...s.position),target:f.clone(),fov:t(s.fov,45),zoom:t(s.zoom,10)},m=s.controls??`none`,h=p.position.clone(),g=p.target.clone(),v=new r,y=new a,b=!0,x=null;if(m===`orbit`&&u&&!d){let{OrbitControls:e}=await l(async()=>{let{OrbitControls:e}=await import(`./OrbitControls-1xEm394I.js`);return{OrbitControls:e}},__vite__mapDeps([0,1,2]),import.meta.url),t=new e(c,u);t.target.copy(p.target),t.enableDamping=!0,t.dampingFactor=.08,t.enableZoom=s.orbitZoom!==!1,t.enablePan=!1;let r=s.orbitLimits??{};r.minDistance!==void 0&&(t.minDistance=r.minDistance),r.maxDistance!==void 0&&(t.maxDistance=r.maxDistance),r.minPolar!==void 0&&(t.minPolarAngle=r.minPolar*n),r.maxPolar!==void 0&&(t.maxPolarAngle=r.maxPolar*n),r.minAzimuth!==void 0&&(t.minAzimuthAngle=r.minAzimuth*n),r.maxAzimuth!==void 0&&(t.maxAzimuthAngle=r.maxAzimuth*n),s.autoRotate&&(t.autoRotate=!0,t.autoRotateSpeed=s.autoRotate/360*60),x=t}let S=new a,C=new a;return{rest:p,shake:y,orbit:x,update(r,l,u){if(c instanceof o){c.userData.restFov=p.fov;let e=L(p.fov,t(c.userData.fitScale,1));c.fov!==e&&(c.fov=e,c.updateProjectionMatrix())}else if(c instanceof i&&t(c.userData.zoomHeight,t(s.zoom,10))!==p.zoom){c.userData.zoomHeight=p.zoom;let e=(c.right-c.left)/Math.max(c.top-c.bottom,1e-6),n=p.zoom/2*t(c.userData.fitScale,1);c.left=-n*e,c.right=n*e,c.top=n,c.bottom=-n,c.updateProjectionMatrix()}if(x){x.update(),c.position.add(y);return}let d=S.copy(p.position),f=g;if(m===`scroll`&&s.scrollPath?.length){let t=s.scrollPath,n=e(u.scroll,0,1)*(t.length-1),r=Math.min(Math.floor(n),t.length-2),i=t.length===1?0:n-Math.max(r,0),o=i*i*(3-2*i),c=t[Math.max(r,0)],l=t[Math.min(Math.max(r,0)+1,t.length-1)];d.set(...c.position).lerp(new a(...l.position),o);let p=new a(...c.target??s.target??[0,0,0]),m=new a(...l.target??s.target??[0,0,0]);f.copy(p.lerp(m,o))}else if(m===`follow`&&u.followTarget){let e=s.follow??{target:``},n=u.followTarget.getWorldPosition(new a),r=new a(...e.offset??[0,4,8]),i=n.clone().add(r),o=n.clone().add(new a(0,0,-t(e.lookAhead,0))),c=b?1:_(t(e.smoothing,.85),l);h.lerp(i,c),f.lerp(o,c),d=S.copy(h)}else f.copy(p.target);if(u.lookAt&&f.copy(u.lookAt),s.autoRotate&&m!==`follow`){let e=s.autoRotate*n*r,t=d.clone().sub(f);t.applyAxisAngle(new a(0,1,0),e),d.copy(f).add(t)}if(m===`parallax`){let e=s.parallax??{},n=t(e.strength,.5),r=_(t(e.smoothing,.92),l);v.x+=(u.pointer.x*n-v.x)*r,v.y+=(u.pointer.y*n*.6-v.y)*r;let i=f.clone().sub(d).normalize(),o=new a().crossVectors(i,c.up).normalize(),p=new a().crossVectors(o,i).normalize();d.addScaledVector(o,v.x).addScaledVector(p,v.y)}if(s.shake){let e=s.shake,i=t(e.speed,.5),o=t(e.amount,.03),l=t(e.rotation,.4)*n,u=t(e.seed,1)*17.31,p=e=>k(r*i+u,e*7.13)*.75+k(r*i*2.7+u,e*7.13+3.1)*.25,m=f.clone().sub(d),h=m.length()||1;m.divideScalar(h);let g=new a().crossVectors(m,c.up).normalize(),_=new a().crossVectors(g,m).normalize();d.addScaledVector(g,p(0)*o).addScaledVector(_,p(1)*o),C.copy(f).addScaledVector(g,Math.tan(p(2)*l)*h).addScaledVector(_,Math.tan(p(3)*l)*h)}else C.copy(f);c.position.copy(d).add(y),z(c.position,C),c.lookAt(C),b=!1},dispose(){x?.dispose()}}}export{_,S as a,f as b,C as c,F as d,u as f,x as g,v as h,R as i,k as l,y as m,H as n,N as o,p,V as r,P as s,B as t,M as u,d as v,g as x,h as y};
@@ -1,4 +1,4 @@
1
- import{OrbitControls as e}from"./OrbitControls-1xEm394I.js";import{Bt as t,En as n,Ft as r,Ht as i,I as a,In as o,It as s,Kt as c,Ln as l,N as u,Pt as d,Qt as f,Rt as p,St as m,T as h,an as g,at as _,bt as v,d as y,f as b,h as x,hn as ee,it as te,m as S,mn as C,nt as w,on as T,p as E,st as D,vt as O,w as ne,x as k,xt as A,yn as re,zt as ie}from"./three.module-B9FlcKtd.js";import{r as ae}from"./camera-DrubOxWu.js";import{a as j,i as M,n as N,o as oe}from"./index-BPVRhKVV.js";var P=new f,F=new l,I=new l,L=new c,se={X:new l(1,0,0),Y:new l(0,1,0),Z:new l(0,0,1)},R={type:`change`},z={type:`mouseDown`,mode:null},ce={type:`mouseUp`,mode:null},le={type:`objectChange`},ue=class extends ne{constructor(e,t=null){super(void 0,t);let n=new ve(this);this._root=n;let r=new ye;this._gizmo=r,n.add(r);let i=new be;this._plane=i,n.add(i);let a=this;function o(e,t){let n=t;Object.defineProperty(a,e,{get:function(){return n===void 0?t:n},set:function(t){n!==t&&(n=t,i[e]=t,r[e]=t,a.dispatchEvent({type:e+`-changed`,value:t}),a.dispatchEvent(R))}}),a[e]=t,i[e]=t,r[e]=t}o(`camera`,e),o(`object`,void 0),o(`enabled`,!0),o(`axis`,null),o(`mode`,`translate`),o(`translationSnap`,null),o(`rotationSnap`,null),o(`scaleSnap`,null),o(`space`,`world`),o(`size`,1),this.viewport=null,o(`dragging`,!1),o(`showX`,!0),o(`showY`,!0),o(`showZ`,!0),o(`showXY`,!0),o(`showYZ`,!0),o(`showXZ`,!0),o(`showXYZE`,!0),o(`showE`,!0),o(`minX`,-1/0),o(`maxX`,1/0),o(`minY`,-1/0),o(`maxY`,1/0),o(`minZ`,-1/0),o(`maxZ`,1/0);let s=new l,u=new l,d=new c,f=new c,p=new l,m=new c,h=new l,g=new l,_=new l,v=new l;o(`worldPosition`,s),o(`worldPositionStart`,u),o(`worldQuaternion`,d),o(`worldQuaternionStart`,f),o(`cameraPosition`,p),o(`cameraQuaternion`,m),o(`pointStart`,h),o(`pointEnd`,g),o(`rotationAxis`,_),o(`rotationAngle`,0),o(`eye`,v),this._offset=new l,this._startNorm=new l,this._endNorm=new l,this._cameraScale=new l,this._parentPosition=new l,this._parentQuaternion=new c,this._parentQuaternionInv=new c,this._parentScale=new l,this._worldScaleStart=new l,this._worldQuaternionInv=new c,this._worldScale=new l,this._positionStart=new l,this._quaternionStart=new c,this._scaleStart=new l,this._getPointer=de.bind(this),this._onPointerDown=pe.bind(this),this._onPointerHover=fe.bind(this),this._onPointerMove=me.bind(this),this._onPointerUp=he.bind(this),t!==null&&this.connect(t)}connect(e){super.connect(e),this.domElement.addEventListener(`pointerdown`,this._onPointerDown),this.domElement.addEventListener(`pointermove`,this._onPointerHover),this.domElement.addEventListener(`pointerup`,this._onPointerUp),this.domElement.style.touchAction=`none`}disconnect(){this.domElement.removeEventListener(`pointerdown`,this._onPointerDown),this.domElement.removeEventListener(`pointermove`,this._onPointerHover),this.domElement.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.removeEventListener(`pointerup`,this._onPointerUp),this.domElement.style.touchAction=``}getHelper(){return this._root}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;e!==null&&P.setFromCamera(e,this.camera);let t=B(this._gizmo.picker[this.mode],P);this.axis=t?t.object.name:null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e!=null&&e.button!==0)&&this.axis!==null){e!==null&&P.setFromCamera(e,this.camera);let t=B(this._plane,P,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,z.mode=this.mode,this.dispatchEvent(z)}}pointerMove(e){let t=this.axis,n=this.mode,r=this.object,i=this.space;if(n===`scale`?i=`local`:(t===`E`||t===`XYZE`||t===`XYZ`)&&(i=`world`),r===void 0||t===null||this.dragging===!1||e!==null&&e.button!==-1)return;e!==null&&P.setFromCamera(e,this.camera);let a=B(this._plane,P,!0);if(a){if(this.pointEnd.copy(a.point).sub(this.worldPositionStart),n===`translate`)this._offset.copy(this.pointEnd).sub(this.pointStart),i===`local`&&t!==`XYZ`&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf(`X`)===-1&&(this._offset.x=0),t.indexOf(`Y`)===-1&&(this._offset.y=0),t.indexOf(`Z`)===-1&&(this._offset.z=0),i===`local`&&t!==`XYZ`?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),r.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(i===`local`&&(r.position.applyQuaternion(L.copy(this._quaternionStart).invert()),t.search(`X`)!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),t.search(`Y`)!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),t.search(`Z`)!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.position.applyQuaternion(this._quaternionStart)),i===`world`&&(r.getWorldPosition(F),t.search(`X`)!==-1&&(F.x=Math.round(F.x/this.translationSnap)*this.translationSnap),t.search(`Y`)!==-1&&(F.y=Math.round(F.y/this.translationSnap)*this.translationSnap),t.search(`Z`)!==-1&&(F.z=Math.round(F.z/this.translationSnap)*this.translationSnap),r.position.copy(r.parent.worldToLocal(F)))),r.position.x=Math.max(this.minX,Math.min(this.maxX,r.position.x)),r.position.y=Math.max(this.minY,Math.min(this.maxY,r.position.y)),r.position.z=Math.max(this.minZ,Math.min(this.maxZ,r.position.z));else if(n===`scale`){if(t.search(`XYZ`)!==-1){let e=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(e*=-1),I.set(e,e,e)}else F.copy(this.pointStart),I.copy(this.pointEnd),F.applyQuaternion(this._worldQuaternionInv),I.applyQuaternion(this._worldQuaternionInv),I.divide(F),t.search(`X`)===-1&&(I.x=1),t.search(`Y`)===-1&&(I.y=1),t.search(`Z`)===-1&&(I.z=1);r.scale.copy(this._scaleStart).multiply(I),this.scaleSnap&&(t.search(`X`)!==-1&&(r.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search(`Y`)!==-1&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search(`Z`)!==-1&&(r.scale.z=Math.round(r.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(n===`rotate`){this._offset.copy(this.pointEnd).sub(this.pointStart);let e=20/this.worldPosition.distanceTo(F.setFromMatrixPosition(this.camera.matrixWorld)),n=!1;t===`XYZE`?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(F.copy(this.rotationAxis).cross(this.eye))*e):(t===`X`||t===`Y`||t===`Z`)&&(this.rotationAxis.copy(se[t]),F.copy(se[t]),i===`local`&&F.applyQuaternion(this.worldQuaternion),F.cross(this.eye),F.length()===0?n=!0:this.rotationAngle=this._offset.dot(F.normalize())*e),(t===`E`||n)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),i===`local`&&t!==`E`&&t!==`XYZE`?(r.quaternion.copy(this._quaternionStart),r.quaternion.multiply(L.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),r.quaternion.copy(L.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(R),this.dispatchEvent(le)}}pointerUp(e){(e===null||e.button===0)&&(this.dragging&&this.axis!==null&&(ce.mode=this.mode,this.dispatchEvent(ce)),this.dragging=!1,this.axis=null)}dispose(){this.disconnect(),this._root.dispose()}attach(e){return this.object=e,this._root.visible=!0,this}detach(){return this.object=void 0,this.axis=null,this._root.visible=!1,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(R),this.dispatchEvent(le),this.pointStart.copy(this.pointEnd))}getRaycaster(){return P}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}setColors(e,t,n,r){let i=this._gizmo.materialLib;i.xAxis.color.set(e),i.yAxis.color.set(t),i.zAxis.color.set(n),i.active.color.set(r),i.xAxisTransparent.color.set(e),i.yAxisTransparent.color.set(t),i.zAxisTransparent.color.set(n),i.activeTransparent.color.set(r),i.xAxis._color&&i.xAxis._color.set(e),i.yAxis._color&&i.yAxis._color.set(t),i.zAxis._color&&i.zAxis._color.set(n),i.active._color&&i.active._color.set(r),i.xAxisTransparent._color&&i.xAxisTransparent._color.set(e),i.yAxisTransparent._color&&i.yAxisTransparent._color.set(t),i.zAxisTransparent._color&&i.zAxisTransparent._color.set(n),i.activeTransparent._color&&i.activeTransparent._color.set(r)}};function de(e){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:e.button};{let t=this.domElement.getBoundingClientRect(),n=this.viewport,r,i,a,o;return n===null?(r=0,i=0,a=t.width,o=t.height):(r=n.x,i=t.height-n.y-n.w,a=n.z,o=n.w),{x:(e.clientX-t.left-r)/a*2-1,y:-(e.clientY-t.top-i)/o*2+1,button:e.button}}}function fe(e){if(this.enabled)switch(e.pointerType){case`mouse`:case`pen`:this.pointerHover(this._getPointer(e))}}function pe(e){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(e.pointerId),this.domElement.addEventListener(`pointermove`,this._onPointerMove),this.pointerHover(this._getPointer(e)),this.pointerDown(this._getPointer(e)))}function me(e){this.enabled&&this.pointerMove(this._getPointer(e))}function he(e){this.enabled&&(this.domElement.releasePointerCapture(e.pointerId),this.domElement.removeEventListener(`pointermove`,this._onPointerMove),this.pointerUp(this._getPointer(e)))}function B(e,t,n){let r=t.intersectObject(e,!0);for(let e=0;e<r.length;e++)if(r[e].object.visible||n)return r[e];return!1}var V=new u,H=new l(0,1,0),ge=new l(0,0,0),_e=new v,U=new c,W=new c,G=new l,K=new v,q=new l(1,0,0),J=new l(0,1,0),Y=new l(0,0,1),X=new l,Z=new l,Q=new l,ve=class extends d{constructor(e){super(),this.isTransformControlsRoot=!0,this.controls=e,this.visible=!1}updateMatrixWorld(e){let t=this.controls;t.object!==void 0&&(t.object.updateMatrixWorld(),t.object.parent===null?console.error(`TransformControls: The attached 3D object must be a part of the scene graph.`):t.object.parent.matrixWorld.decompose(t._parentPosition,t._parentQuaternion,t._parentScale),t.object.matrixWorld.decompose(t.worldPosition,t.worldQuaternion,t._worldScale),t._parentQuaternionInv.copy(t._parentQuaternion).invert(),t._worldQuaternionInv.copy(t.worldQuaternion).invert()),t.camera.updateMatrixWorld(),t.camera.matrixWorld.decompose(t.cameraPosition,t.cameraQuaternion,t._cameraScale),t.camera.isOrthographicCamera?t.camera.getWorldDirection(t.eye).negate():t.eye.copy(t.cameraPosition).sub(t.worldPosition).normalize(),this.parent&&(K.copy(this.parent.matrixWorld).invert(),K.decompose(this.position,this.quaternion,this.scale)),super.updateMatrixWorld(e)}dispose(){this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}},ye=class extends d{constructor(){super(),this.isTransformControlsGizmo=!0,this.type=`TransformControlsGizmo`;let e=new m({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new te({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),i=e.clone();i.opacity=.15;let o=t.clone();o.opacity=.5;let s=e.clone();s.color.setHex(16711680);let c=e.clone();c.color.setHex(65280);let l=e.clone();l.color.setHex(255);let u=e.clone();u.color.setHex(16711680),u.opacity=.5;let f=e.clone();f.color.setHex(65280),f.opacity=.5;let p=e.clone();p.color.setHex(255),p.opacity=.5;let g=e.clone();g.opacity=.25;let _=e.clone();_.color.setHex(16776960),_.opacity=.25;let v=e.clone();v.color.setHex(16776960);let y=e.clone();y.color.setHex(7895160),this.materialLib={xAxis:s,yAxis:c,zAxis:l,active:v,xAxisTransparent:u,yAxisTransparent:f,zAxisTransparent:p,activeTransparent:_};let b=new h(0,.04,.1,12);b.translate(0,.05,0);let S=new E(.08,.08,.08);S.translate(0,.04,0);let C=new x;C.setAttribute(`position`,new a([0,0,0,1,0,0],3));let T=new h(.0075,.0075,.5,3);T.translate(0,.25,0);function D(e,t){let r=new n(e,.0075,3,64,t*Math.PI*2);return r.rotateY(Math.PI/2),r.rotateX(Math.PI/2),r}function O(){let e=new x;return e.setAttribute(`position`,new a([0,0,0,1,1,1],3)),e}let ne={X:[[new A(b,s),[.5,0,0],[0,0,-Math.PI/2]],[new A(b,s),[-.5,0,0],[0,0,Math.PI/2]],[new A(T,s),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new A(b,c),[0,.5,0]],[new A(b,c),[0,-.5,0],[Math.PI,0,0]],[new A(T,c)]],Z:[[new A(b,l),[0,0,.5],[Math.PI/2,0,0]],[new A(b,l),[0,0,-.5],[-Math.PI/2,0,0]],[new A(T,l),null,[Math.PI/2,0,0]]],XYZ:[[new A(new r(.1,0),g),[0,0,0]]],XY:[[new A(new E(.15,.15,.01),p),[.15,.15,0]]],YZ:[[new A(new E(.15,.15,.01),u),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new A(new E(.15,.15,.01),f),[.15,0,.15],[-Math.PI/2,0,0]]]},k={X:[[new A(new h(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new A(new h(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new A(new h(.2,0,.6,4),i),[0,.3,0]],[new A(new h(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new A(new h(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new A(new h(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new A(new r(.2,0),i)]],XY:[[new A(new E(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new A(new E(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new A(new E(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]]},re={START:[[new A(new r(.01,2),o),null,null,null,`helper`]],END:[[new A(new r(.01,2),o),null,null,null,`helper`]],DELTA:[[new w(O(),o),null,null,null,`helper`]],X:[[new w(C,o),[-1e3,0,0],null,[1e6,1,1],`helper`]],Y:[[new w(C,o),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],`helper`]],Z:[[new w(C,o),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],`helper`]]},ie={XYZE:[[new A(D(.5,1),y),null,[0,Math.PI/2,0]]],X:[[new A(D(.5,.5),s)]],Y:[[new A(D(.5,.5),c),null,[0,0,-Math.PI/2]]],Z:[[new A(D(.5,.5),l),null,[0,Math.PI/2,0]]],E:[[new A(D(.75,1),_),null,[0,Math.PI/2,0]]]},ae={AXIS:[[new w(C,o),[-1e3,0,0],null,[1e6,1,1],`helper`]]},j={XYZE:[[new A(new ee(.25,10,8),i)]],X:[[new A(new n(.5,.1,4,24),i),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new A(new n(.5,.1,4,24),i),[0,0,0],[Math.PI/2,0,0]]],Z:[[new A(new n(.5,.1,4,24),i),[0,0,0],[0,0,-Math.PI/2]]],E:[[new A(new n(.75,.1,2,24),i)]]},M={X:[[new A(S,s),[.5,0,0],[0,0,-Math.PI/2]],[new A(T,s),[0,0,0],[0,0,-Math.PI/2]],[new A(S,s),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new A(S,c),[0,.5,0]],[new A(T,c)],[new A(S,c),[0,-.5,0],[0,0,Math.PI]]],Z:[[new A(S,l),[0,0,.5],[Math.PI/2,0,0]],[new A(T,l),[0,0,0],[Math.PI/2,0,0]],[new A(S,l),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new A(new E(.15,.15,.01),p),[.15,.15,0]]],YZ:[[new A(new E(.15,.15,.01),u),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new A(new E(.15,.15,.01),f),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new A(new E(.1,.1,.1),g)]]},N={X:[[new A(new h(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new A(new h(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new A(new h(.2,0,.6,4),i),[0,.3,0]],[new A(new h(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new A(new h(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new A(new h(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new A(new E(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new A(new E(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new A(new E(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new A(new E(.2,.2,.2),i),[0,0,0]]]},oe={X:[[new w(C,o),[-1e3,0,0],null,[1e6,1,1],`helper`]],Y:[[new w(C,o),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],`helper`]],Z:[[new w(C,o),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],`helper`]]};function P(e){let t=new d;for(let n in e)for(let r=e[n].length;r--;){let i=e[n][r][0].clone(),a=e[n][r][1],o=e[n][r][2],s=e[n][r][3],c=e[n][r][4];i.name=n,i.tag=c,a&&i.position.set(a[0],a[1],a[2]),o&&i.rotation.set(o[0],o[1],o[2]),s&&i.scale.set(s[0],s[1],s[2]),i.updateMatrix();let l=i.geometry.clone();l.applyMatrix4(i.matrix),i.geometry=l,i.renderOrder=1/0,i.position.set(0,0,0),i.rotation.set(0,0,0),i.scale.set(1,1,1),t.add(i)}return t}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=P(ne)),this.add(this.gizmo.rotate=P(ie)),this.add(this.gizmo.scale=P(M)),this.add(this.picker.translate=P(k)),this.add(this.picker.rotate=P(j)),this.add(this.picker.scale=P(N)),this.add(this.helper.translate=P(re)),this.add(this.helper.rotate=P(ae)),this.add(this.helper.scale=P(oe)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(e){let t=(this.mode===`scale`?`local`:this.space)===`local`?this.worldQuaternion:W;this.gizmo.translate.visible=this.mode===`translate`,this.gizmo.rotate.visible=this.mode===`rotate`,this.gizmo.scale.visible=this.mode===`scale`,this.helper.translate.visible=this.mode===`translate`,this.helper.rotate.visible=this.mode===`rotate`,this.helper.scale.visible=this.mode===`scale`;let n=[];n=n.concat(this.picker[this.mode].children),n=n.concat(this.gizmo[this.mode].children),n=n.concat(this.helper[this.mode].children);for(let e=0;e<n.length;e++){let r=n[e];r.visible=!0,r.rotation.set(0,0,0),r.position.copy(this.worldPosition);let i;if(i=this.camera.isOrthographicCamera?(this.camera.top-this.camera.bottom)/this.camera.zoom:this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),r.scale.set(1,1,1).multiplyScalar(i*this.size/4),r.tag===`helper`)r.visible=!1,r.name===`AXIS`?(r.visible=!!this.axis,this.axis===`X`&&(L.setFromEuler(V.set(0,0,0)),r.quaternion.copy(t).multiply(L),Math.abs(H.copy(q).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`Y`&&(L.setFromEuler(V.set(0,0,Math.PI/2)),r.quaternion.copy(t).multiply(L),Math.abs(H.copy(J).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`Z`&&(L.setFromEuler(V.set(0,Math.PI/2,0)),r.quaternion.copy(t).multiply(L),Math.abs(H.copy(Y).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`XYZE`&&(L.setFromEuler(V.set(0,Math.PI/2,0)),H.copy(this.rotationAxis),r.quaternion.setFromRotationMatrix(_e.lookAt(ge,H,J)),r.quaternion.multiply(L),r.visible=this.dragging),this.axis===`E`&&(r.visible=!1)):r.name===`START`?(r.position.copy(this.worldPositionStart),r.visible=this.dragging):r.name===`END`?(r.position.copy(this.worldPosition),r.visible=this.dragging):r.name===`DELTA`?(r.position.copy(this.worldPositionStart),r.quaternion.copy(this.worldQuaternionStart),F.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),F.applyQuaternion(this.worldQuaternionStart.clone().invert()),r.scale.copy(F),r.visible=this.dragging):(r.quaternion.copy(t),this.dragging?r.position.copy(this.worldPositionStart):r.position.copy(this.worldPosition),this.axis&&(r.visible=this.axis.search(r.name)!==-1));else{if(r.quaternion.copy(t),this.mode===`translate`||this.mode===`scale`){let e=.99,n=.2;r.name===`X`&&Math.abs(H.copy(q).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`Y`&&Math.abs(H.copy(J).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`Z`&&Math.abs(H.copy(Y).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`XY`&&Math.abs(H.copy(Y).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`YZ`&&Math.abs(H.copy(q).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`XZ`&&Math.abs(H.copy(J).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1)}else this.mode===`rotate`&&(U.copy(t),H.copy(this.eye).applyQuaternion(L.copy(t).invert()),r.name.search(`E`)!==-1&&r.quaternion.setFromRotationMatrix(_e.lookAt(this.eye,ge,J)),r.name===`X`&&(L.setFromAxisAngle(q,Math.atan2(-H.y,H.z)),L.multiplyQuaternions(U,L),r.quaternion.copy(L)),r.name===`Y`&&(L.setFromAxisAngle(J,Math.atan2(H.x,H.z)),L.multiplyQuaternions(U,L),r.quaternion.copy(L)),r.name===`Z`&&(L.setFromAxisAngle(Y,Math.atan2(H.y,H.x)),L.multiplyQuaternions(U,L),r.quaternion.copy(L)));r.visible=r.visible&&(r.name.indexOf(`X`)===-1||this.showX),r.visible=r.visible&&(r.name.indexOf(`Y`)===-1||this.showY),r.visible=r.visible&&(r.name.indexOf(`Z`)===-1||this.showZ),r.visible=r.visible&&(r.name.indexOf(`E`)===-1||this.showX&&this.showY&&this.showZ),r.visible=r.visible&&(r.name.indexOf(`XY`)===-1||this.showXY),r.visible=r.visible&&(r.name.indexOf(`YZ`)===-1||this.showYZ),r.visible=r.visible&&(r.name.indexOf(`XZ`)===-1||this.showXZ),r.visible=r.visible&&(r.name!==`E`||this.showE),r.visible=r.visible&&(r.name!==`XYZE`||this.showXYZE),r.material._color=r.material._color||r.material.color.clone(),r.material._opacity=r.material._opacity||r.material.opacity,r.material.color.copy(r.material._color),r.material.opacity=r.material._opacity,this.enabled&&this.axis&&(r.name===this.axis||this.axis.split(``).some(function(e){return r.name===e}))&&(r.material.color.copy(this.materialLib.active.color),r.material.opacity=1)}}super.updateMatrixWorld(e)}},be=class extends A{constructor(){super(new t(1e5,1e5,2,2),new m({visible:!1,wireframe:!0,side:2,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type=`TransformControlsPlane`}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode===`scale`&&(t=`local`),X.copy(q).applyQuaternion(t===`local`?this.worldQuaternion:W),Z.copy(J).applyQuaternion(t===`local`?this.worldQuaternion:W),Q.copy(Y).applyQuaternion(t===`local`?this.worldQuaternion:W),H.copy(Z),this.mode){case`translate`:case`scale`:switch(this.axis){case`X`:H.copy(this.eye).cross(X),G.copy(X).cross(H);break;case`Y`:H.copy(this.eye).cross(Z),G.copy(Z).cross(H);break;case`Z`:H.copy(this.eye).cross(Q),G.copy(Q).cross(H);break;case`XY`:G.copy(Q);break;case`YZ`:G.copy(X);break;case`XZ`:H.copy(Q),G.copy(Z);break;case`XYZ`:case`E`:G.set(0,0,0)}break;default:G.set(0,0,0)}G.length()===0?this.quaternion.copy(this.cameraQuaternion):(K.lookAt(F.set(0,0,0),G,H),this.quaternion.setFromRotationMatrix(K)),super.updateMatrixWorld(e)}},xe=`
1
+ import{OrbitControls as e}from"./OrbitControls-1xEm394I.js";import{Bt as t,En as n,Ft as r,Ht as i,I as a,In as o,It as s,Kt as c,Ln as l,N as u,Pt as d,Qt as f,Rt as p,St as m,T as h,an as g,at as _,bt as v,d as y,f as b,h as x,hn as ee,it as te,m as S,mn as C,nt as w,on as T,p as E,st as D,vt as O,w as ne,x as k,xt as A,yn as re,zt as ie}from"./three.module-B9FlcKtd.js";import{r as ae}from"./camera-HsMeC1mn.js";import{a as j,i as M,n as N,o as oe}from"./index-cDbmaVDl.js";var P=new f,F=new l,I=new l,L=new c,se={X:new l(1,0,0),Y:new l(0,1,0),Z:new l(0,0,1)},R={type:`change`},z={type:`mouseDown`,mode:null},ce={type:`mouseUp`,mode:null},le={type:`objectChange`},ue=class extends ne{constructor(e,t=null){super(void 0,t);let n=new ve(this);this._root=n;let r=new ye;this._gizmo=r,n.add(r);let i=new be;this._plane=i,n.add(i);let a=this;function o(e,t){let n=t;Object.defineProperty(a,e,{get:function(){return n===void 0?t:n},set:function(t){n!==t&&(n=t,i[e]=t,r[e]=t,a.dispatchEvent({type:e+`-changed`,value:t}),a.dispatchEvent(R))}}),a[e]=t,i[e]=t,r[e]=t}o(`camera`,e),o(`object`,void 0),o(`enabled`,!0),o(`axis`,null),o(`mode`,`translate`),o(`translationSnap`,null),o(`rotationSnap`,null),o(`scaleSnap`,null),o(`space`,`world`),o(`size`,1),this.viewport=null,o(`dragging`,!1),o(`showX`,!0),o(`showY`,!0),o(`showZ`,!0),o(`showXY`,!0),o(`showYZ`,!0),o(`showXZ`,!0),o(`showXYZE`,!0),o(`showE`,!0),o(`minX`,-1/0),o(`maxX`,1/0),o(`minY`,-1/0),o(`maxY`,1/0),o(`minZ`,-1/0),o(`maxZ`,1/0);let s=new l,u=new l,d=new c,f=new c,p=new l,m=new c,h=new l,g=new l,_=new l,v=new l;o(`worldPosition`,s),o(`worldPositionStart`,u),o(`worldQuaternion`,d),o(`worldQuaternionStart`,f),o(`cameraPosition`,p),o(`cameraQuaternion`,m),o(`pointStart`,h),o(`pointEnd`,g),o(`rotationAxis`,_),o(`rotationAngle`,0),o(`eye`,v),this._offset=new l,this._startNorm=new l,this._endNorm=new l,this._cameraScale=new l,this._parentPosition=new l,this._parentQuaternion=new c,this._parentQuaternionInv=new c,this._parentScale=new l,this._worldScaleStart=new l,this._worldQuaternionInv=new c,this._worldScale=new l,this._positionStart=new l,this._quaternionStart=new c,this._scaleStart=new l,this._getPointer=de.bind(this),this._onPointerDown=pe.bind(this),this._onPointerHover=fe.bind(this),this._onPointerMove=me.bind(this),this._onPointerUp=he.bind(this),t!==null&&this.connect(t)}connect(e){super.connect(e),this.domElement.addEventListener(`pointerdown`,this._onPointerDown),this.domElement.addEventListener(`pointermove`,this._onPointerHover),this.domElement.addEventListener(`pointerup`,this._onPointerUp),this.domElement.style.touchAction=`none`}disconnect(){this.domElement.removeEventListener(`pointerdown`,this._onPointerDown),this.domElement.removeEventListener(`pointermove`,this._onPointerHover),this.domElement.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.removeEventListener(`pointerup`,this._onPointerUp),this.domElement.style.touchAction=``}getHelper(){return this._root}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;e!==null&&P.setFromCamera(e,this.camera);let t=B(this._gizmo.picker[this.mode],P);this.axis=t?t.object.name:null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e!=null&&e.button!==0)&&this.axis!==null){e!==null&&P.setFromCamera(e,this.camera);let t=B(this._plane,P,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,z.mode=this.mode,this.dispatchEvent(z)}}pointerMove(e){let t=this.axis,n=this.mode,r=this.object,i=this.space;if(n===`scale`?i=`local`:(t===`E`||t===`XYZE`||t===`XYZ`)&&(i=`world`),r===void 0||t===null||this.dragging===!1||e!==null&&e.button!==-1)return;e!==null&&P.setFromCamera(e,this.camera);let a=B(this._plane,P,!0);if(a){if(this.pointEnd.copy(a.point).sub(this.worldPositionStart),n===`translate`)this._offset.copy(this.pointEnd).sub(this.pointStart),i===`local`&&t!==`XYZ`&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf(`X`)===-1&&(this._offset.x=0),t.indexOf(`Y`)===-1&&(this._offset.y=0),t.indexOf(`Z`)===-1&&(this._offset.z=0),i===`local`&&t!==`XYZ`?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),r.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(i===`local`&&(r.position.applyQuaternion(L.copy(this._quaternionStart).invert()),t.search(`X`)!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),t.search(`Y`)!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),t.search(`Z`)!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.position.applyQuaternion(this._quaternionStart)),i===`world`&&(r.getWorldPosition(F),t.search(`X`)!==-1&&(F.x=Math.round(F.x/this.translationSnap)*this.translationSnap),t.search(`Y`)!==-1&&(F.y=Math.round(F.y/this.translationSnap)*this.translationSnap),t.search(`Z`)!==-1&&(F.z=Math.round(F.z/this.translationSnap)*this.translationSnap),r.position.copy(r.parent.worldToLocal(F)))),r.position.x=Math.max(this.minX,Math.min(this.maxX,r.position.x)),r.position.y=Math.max(this.minY,Math.min(this.maxY,r.position.y)),r.position.z=Math.max(this.minZ,Math.min(this.maxZ,r.position.z));else if(n===`scale`){if(t.search(`XYZ`)!==-1){let e=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(e*=-1),I.set(e,e,e)}else F.copy(this.pointStart),I.copy(this.pointEnd),F.applyQuaternion(this._worldQuaternionInv),I.applyQuaternion(this._worldQuaternionInv),I.divide(F),t.search(`X`)===-1&&(I.x=1),t.search(`Y`)===-1&&(I.y=1),t.search(`Z`)===-1&&(I.z=1);r.scale.copy(this._scaleStart).multiply(I),this.scaleSnap&&(t.search(`X`)!==-1&&(r.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search(`Y`)!==-1&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search(`Z`)!==-1&&(r.scale.z=Math.round(r.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(n===`rotate`){this._offset.copy(this.pointEnd).sub(this.pointStart);let e=20/this.worldPosition.distanceTo(F.setFromMatrixPosition(this.camera.matrixWorld)),n=!1;t===`XYZE`?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(F.copy(this.rotationAxis).cross(this.eye))*e):(t===`X`||t===`Y`||t===`Z`)&&(this.rotationAxis.copy(se[t]),F.copy(se[t]),i===`local`&&F.applyQuaternion(this.worldQuaternion),F.cross(this.eye),F.length()===0?n=!0:this.rotationAngle=this._offset.dot(F.normalize())*e),(t===`E`||n)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),i===`local`&&t!==`E`&&t!==`XYZE`?(r.quaternion.copy(this._quaternionStart),r.quaternion.multiply(L.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),r.quaternion.copy(L.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(R),this.dispatchEvent(le)}}pointerUp(e){(e===null||e.button===0)&&(this.dragging&&this.axis!==null&&(ce.mode=this.mode,this.dispatchEvent(ce)),this.dragging=!1,this.axis=null)}dispose(){this.disconnect(),this._root.dispose()}attach(e){return this.object=e,this._root.visible=!0,this}detach(){return this.object=void 0,this.axis=null,this._root.visible=!1,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(R),this.dispatchEvent(le),this.pointStart.copy(this.pointEnd))}getRaycaster(){return P}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}setColors(e,t,n,r){let i=this._gizmo.materialLib;i.xAxis.color.set(e),i.yAxis.color.set(t),i.zAxis.color.set(n),i.active.color.set(r),i.xAxisTransparent.color.set(e),i.yAxisTransparent.color.set(t),i.zAxisTransparent.color.set(n),i.activeTransparent.color.set(r),i.xAxis._color&&i.xAxis._color.set(e),i.yAxis._color&&i.yAxis._color.set(t),i.zAxis._color&&i.zAxis._color.set(n),i.active._color&&i.active._color.set(r),i.xAxisTransparent._color&&i.xAxisTransparent._color.set(e),i.yAxisTransparent._color&&i.yAxisTransparent._color.set(t),i.zAxisTransparent._color&&i.zAxisTransparent._color.set(n),i.activeTransparent._color&&i.activeTransparent._color.set(r)}};function de(e){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:e.button};{let t=this.domElement.getBoundingClientRect(),n=this.viewport,r,i,a,o;return n===null?(r=0,i=0,a=t.width,o=t.height):(r=n.x,i=t.height-n.y-n.w,a=n.z,o=n.w),{x:(e.clientX-t.left-r)/a*2-1,y:-(e.clientY-t.top-i)/o*2+1,button:e.button}}}function fe(e){if(this.enabled)switch(e.pointerType){case`mouse`:case`pen`:this.pointerHover(this._getPointer(e))}}function pe(e){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(e.pointerId),this.domElement.addEventListener(`pointermove`,this._onPointerMove),this.pointerHover(this._getPointer(e)),this.pointerDown(this._getPointer(e)))}function me(e){this.enabled&&this.pointerMove(this._getPointer(e))}function he(e){this.enabled&&(this.domElement.releasePointerCapture(e.pointerId),this.domElement.removeEventListener(`pointermove`,this._onPointerMove),this.pointerUp(this._getPointer(e)))}function B(e,t,n){let r=t.intersectObject(e,!0);for(let e=0;e<r.length;e++)if(r[e].object.visible||n)return r[e];return!1}var V=new u,H=new l(0,1,0),ge=new l(0,0,0),_e=new v,U=new c,W=new c,G=new l,K=new v,q=new l(1,0,0),J=new l(0,1,0),Y=new l(0,0,1),X=new l,Z=new l,Q=new l,ve=class extends d{constructor(e){super(),this.isTransformControlsRoot=!0,this.controls=e,this.visible=!1}updateMatrixWorld(e){let t=this.controls;t.object!==void 0&&(t.object.updateMatrixWorld(),t.object.parent===null?console.error(`TransformControls: The attached 3D object must be a part of the scene graph.`):t.object.parent.matrixWorld.decompose(t._parentPosition,t._parentQuaternion,t._parentScale),t.object.matrixWorld.decompose(t.worldPosition,t.worldQuaternion,t._worldScale),t._parentQuaternionInv.copy(t._parentQuaternion).invert(),t._worldQuaternionInv.copy(t.worldQuaternion).invert()),t.camera.updateMatrixWorld(),t.camera.matrixWorld.decompose(t.cameraPosition,t.cameraQuaternion,t._cameraScale),t.camera.isOrthographicCamera?t.camera.getWorldDirection(t.eye).negate():t.eye.copy(t.cameraPosition).sub(t.worldPosition).normalize(),this.parent&&(K.copy(this.parent.matrixWorld).invert(),K.decompose(this.position,this.quaternion,this.scale)),super.updateMatrixWorld(e)}dispose(){this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}},ye=class extends d{constructor(){super(),this.isTransformControlsGizmo=!0,this.type=`TransformControlsGizmo`;let e=new m({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new te({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),i=e.clone();i.opacity=.15;let o=t.clone();o.opacity=.5;let s=e.clone();s.color.setHex(16711680);let c=e.clone();c.color.setHex(65280);let l=e.clone();l.color.setHex(255);let u=e.clone();u.color.setHex(16711680),u.opacity=.5;let f=e.clone();f.color.setHex(65280),f.opacity=.5;let p=e.clone();p.color.setHex(255),p.opacity=.5;let g=e.clone();g.opacity=.25;let _=e.clone();_.color.setHex(16776960),_.opacity=.25;let v=e.clone();v.color.setHex(16776960);let y=e.clone();y.color.setHex(7895160),this.materialLib={xAxis:s,yAxis:c,zAxis:l,active:v,xAxisTransparent:u,yAxisTransparent:f,zAxisTransparent:p,activeTransparent:_};let b=new h(0,.04,.1,12);b.translate(0,.05,0);let S=new E(.08,.08,.08);S.translate(0,.04,0);let C=new x;C.setAttribute(`position`,new a([0,0,0,1,0,0],3));let T=new h(.0075,.0075,.5,3);T.translate(0,.25,0);function D(e,t){let r=new n(e,.0075,3,64,t*Math.PI*2);return r.rotateY(Math.PI/2),r.rotateX(Math.PI/2),r}function O(){let e=new x;return e.setAttribute(`position`,new a([0,0,0,1,1,1],3)),e}let ne={X:[[new A(b,s),[.5,0,0],[0,0,-Math.PI/2]],[new A(b,s),[-.5,0,0],[0,0,Math.PI/2]],[new A(T,s),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new A(b,c),[0,.5,0]],[new A(b,c),[0,-.5,0],[Math.PI,0,0]],[new A(T,c)]],Z:[[new A(b,l),[0,0,.5],[Math.PI/2,0,0]],[new A(b,l),[0,0,-.5],[-Math.PI/2,0,0]],[new A(T,l),null,[Math.PI/2,0,0]]],XYZ:[[new A(new r(.1,0),g),[0,0,0]]],XY:[[new A(new E(.15,.15,.01),p),[.15,.15,0]]],YZ:[[new A(new E(.15,.15,.01),u),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new A(new E(.15,.15,.01),f),[.15,0,.15],[-Math.PI/2,0,0]]]},k={X:[[new A(new h(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new A(new h(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new A(new h(.2,0,.6,4),i),[0,.3,0]],[new A(new h(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new A(new h(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new A(new h(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new A(new r(.2,0),i)]],XY:[[new A(new E(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new A(new E(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new A(new E(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]]},re={START:[[new A(new r(.01,2),o),null,null,null,`helper`]],END:[[new A(new r(.01,2),o),null,null,null,`helper`]],DELTA:[[new w(O(),o),null,null,null,`helper`]],X:[[new w(C,o),[-1e3,0,0],null,[1e6,1,1],`helper`]],Y:[[new w(C,o),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],`helper`]],Z:[[new w(C,o),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],`helper`]]},ie={XYZE:[[new A(D(.5,1),y),null,[0,Math.PI/2,0]]],X:[[new A(D(.5,.5),s)]],Y:[[new A(D(.5,.5),c),null,[0,0,-Math.PI/2]]],Z:[[new A(D(.5,.5),l),null,[0,Math.PI/2,0]]],E:[[new A(D(.75,1),_),null,[0,Math.PI/2,0]]]},ae={AXIS:[[new w(C,o),[-1e3,0,0],null,[1e6,1,1],`helper`]]},j={XYZE:[[new A(new ee(.25,10,8),i)]],X:[[new A(new n(.5,.1,4,24),i),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new A(new n(.5,.1,4,24),i),[0,0,0],[Math.PI/2,0,0]]],Z:[[new A(new n(.5,.1,4,24),i),[0,0,0],[0,0,-Math.PI/2]]],E:[[new A(new n(.75,.1,2,24),i)]]},M={X:[[new A(S,s),[.5,0,0],[0,0,-Math.PI/2]],[new A(T,s),[0,0,0],[0,0,-Math.PI/2]],[new A(S,s),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new A(S,c),[0,.5,0]],[new A(T,c)],[new A(S,c),[0,-.5,0],[0,0,Math.PI]]],Z:[[new A(S,l),[0,0,.5],[Math.PI/2,0,0]],[new A(T,l),[0,0,0],[Math.PI/2,0,0]],[new A(S,l),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new A(new E(.15,.15,.01),p),[.15,.15,0]]],YZ:[[new A(new E(.15,.15,.01),u),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new A(new E(.15,.15,.01),f),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new A(new E(.1,.1,.1),g)]]},N={X:[[new A(new h(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new A(new h(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new A(new h(.2,0,.6,4),i),[0,.3,0]],[new A(new h(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new A(new h(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new A(new h(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new A(new E(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new A(new E(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new A(new E(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new A(new E(.2,.2,.2),i),[0,0,0]]]},oe={X:[[new w(C,o),[-1e3,0,0],null,[1e6,1,1],`helper`]],Y:[[new w(C,o),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],`helper`]],Z:[[new w(C,o),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],`helper`]]};function P(e){let t=new d;for(let n in e)for(let r=e[n].length;r--;){let i=e[n][r][0].clone(),a=e[n][r][1],o=e[n][r][2],s=e[n][r][3],c=e[n][r][4];i.name=n,i.tag=c,a&&i.position.set(a[0],a[1],a[2]),o&&i.rotation.set(o[0],o[1],o[2]),s&&i.scale.set(s[0],s[1],s[2]),i.updateMatrix();let l=i.geometry.clone();l.applyMatrix4(i.matrix),i.geometry=l,i.renderOrder=1/0,i.position.set(0,0,0),i.rotation.set(0,0,0),i.scale.set(1,1,1),t.add(i)}return t}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=P(ne)),this.add(this.gizmo.rotate=P(ie)),this.add(this.gizmo.scale=P(M)),this.add(this.picker.translate=P(k)),this.add(this.picker.rotate=P(j)),this.add(this.picker.scale=P(N)),this.add(this.helper.translate=P(re)),this.add(this.helper.rotate=P(ae)),this.add(this.helper.scale=P(oe)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(e){let t=(this.mode===`scale`?`local`:this.space)===`local`?this.worldQuaternion:W;this.gizmo.translate.visible=this.mode===`translate`,this.gizmo.rotate.visible=this.mode===`rotate`,this.gizmo.scale.visible=this.mode===`scale`,this.helper.translate.visible=this.mode===`translate`,this.helper.rotate.visible=this.mode===`rotate`,this.helper.scale.visible=this.mode===`scale`;let n=[];n=n.concat(this.picker[this.mode].children),n=n.concat(this.gizmo[this.mode].children),n=n.concat(this.helper[this.mode].children);for(let e=0;e<n.length;e++){let r=n[e];r.visible=!0,r.rotation.set(0,0,0),r.position.copy(this.worldPosition);let i;if(i=this.camera.isOrthographicCamera?(this.camera.top-this.camera.bottom)/this.camera.zoom:this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),r.scale.set(1,1,1).multiplyScalar(i*this.size/4),r.tag===`helper`)r.visible=!1,r.name===`AXIS`?(r.visible=!!this.axis,this.axis===`X`&&(L.setFromEuler(V.set(0,0,0)),r.quaternion.copy(t).multiply(L),Math.abs(H.copy(q).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`Y`&&(L.setFromEuler(V.set(0,0,Math.PI/2)),r.quaternion.copy(t).multiply(L),Math.abs(H.copy(J).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`Z`&&(L.setFromEuler(V.set(0,Math.PI/2,0)),r.quaternion.copy(t).multiply(L),Math.abs(H.copy(Y).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`XYZE`&&(L.setFromEuler(V.set(0,Math.PI/2,0)),H.copy(this.rotationAxis),r.quaternion.setFromRotationMatrix(_e.lookAt(ge,H,J)),r.quaternion.multiply(L),r.visible=this.dragging),this.axis===`E`&&(r.visible=!1)):r.name===`START`?(r.position.copy(this.worldPositionStart),r.visible=this.dragging):r.name===`END`?(r.position.copy(this.worldPosition),r.visible=this.dragging):r.name===`DELTA`?(r.position.copy(this.worldPositionStart),r.quaternion.copy(this.worldQuaternionStart),F.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),F.applyQuaternion(this.worldQuaternionStart.clone().invert()),r.scale.copy(F),r.visible=this.dragging):(r.quaternion.copy(t),this.dragging?r.position.copy(this.worldPositionStart):r.position.copy(this.worldPosition),this.axis&&(r.visible=this.axis.search(r.name)!==-1));else{if(r.quaternion.copy(t),this.mode===`translate`||this.mode===`scale`){let e=.99,n=.2;r.name===`X`&&Math.abs(H.copy(q).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`Y`&&Math.abs(H.copy(J).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`Z`&&Math.abs(H.copy(Y).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`XY`&&Math.abs(H.copy(Y).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`YZ`&&Math.abs(H.copy(q).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`XZ`&&Math.abs(H.copy(J).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1)}else this.mode===`rotate`&&(U.copy(t),H.copy(this.eye).applyQuaternion(L.copy(t).invert()),r.name.search(`E`)!==-1&&r.quaternion.setFromRotationMatrix(_e.lookAt(this.eye,ge,J)),r.name===`X`&&(L.setFromAxisAngle(q,Math.atan2(-H.y,H.z)),L.multiplyQuaternions(U,L),r.quaternion.copy(L)),r.name===`Y`&&(L.setFromAxisAngle(J,Math.atan2(H.x,H.z)),L.multiplyQuaternions(U,L),r.quaternion.copy(L)),r.name===`Z`&&(L.setFromAxisAngle(Y,Math.atan2(H.y,H.x)),L.multiplyQuaternions(U,L),r.quaternion.copy(L)));r.visible=r.visible&&(r.name.indexOf(`X`)===-1||this.showX),r.visible=r.visible&&(r.name.indexOf(`Y`)===-1||this.showY),r.visible=r.visible&&(r.name.indexOf(`Z`)===-1||this.showZ),r.visible=r.visible&&(r.name.indexOf(`E`)===-1||this.showX&&this.showY&&this.showZ),r.visible=r.visible&&(r.name.indexOf(`XY`)===-1||this.showXY),r.visible=r.visible&&(r.name.indexOf(`YZ`)===-1||this.showYZ),r.visible=r.visible&&(r.name.indexOf(`XZ`)===-1||this.showXZ),r.visible=r.visible&&(r.name!==`E`||this.showE),r.visible=r.visible&&(r.name!==`XYZE`||this.showXYZE),r.material._color=r.material._color||r.material.color.clone(),r.material._opacity=r.material._opacity||r.material.opacity,r.material.color.copy(r.material._color),r.material.opacity=r.material._opacity,this.enabled&&this.axis&&(r.name===this.axis||this.axis.split(``).some(function(e){return r.name===e}))&&(r.material.color.copy(this.materialLib.active.color),r.material.opacity=1)}}super.updateMatrixWorld(e)}},be=class extends A{constructor(){super(new t(1e5,1e5,2,2),new m({visible:!1,wireframe:!0,side:2,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type=`TransformControlsPlane`}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode===`scale`&&(t=`local`),X.copy(q).applyQuaternion(t===`local`?this.worldQuaternion:W),Z.copy(J).applyQuaternion(t===`local`?this.worldQuaternion:W),Q.copy(Y).applyQuaternion(t===`local`?this.worldQuaternion:W),H.copy(Z),this.mode){case`translate`:case`scale`:switch(this.axis){case`X`:H.copy(this.eye).cross(X),G.copy(X).cross(H);break;case`Y`:H.copy(this.eye).cross(Z),G.copy(Z).cross(H);break;case`Z`:H.copy(this.eye).cross(Q),G.copy(Q).cross(H);break;case`XY`:G.copy(Q);break;case`YZ`:G.copy(X);break;case`XZ`:H.copy(Q),G.copy(Z);break;case`XYZ`:case`E`:G.set(0,0,0)}break;default:G.set(0,0,0)}G.length()===0?this.quaternion.copy(this.cameraQuaternion):(K.lookAt(F.set(0,0,0),G,H),this.quaternion.setFromRotationMatrix(K)),super.updateMatrixWorld(e)}},xe=`
2
2
  varying vec3 vWorld;
3
3
  void main() {
4
4
  vec4 w = modelMatrix * vec4(position, 1.0);
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./physicsHost-EkPuIy04.js","./num-CQNAlL82.js","./three.module-B9FlcKtd.js","./rolldown-runtime-4tVxZq34.js"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./num-CQNAlL82.js";import{In as t,Ln as n,Qt as r,zt as i}from"./three.module-B9FlcKtd.js";import{a,g as o,y as s}from"./camera-DrubOxWu.js";import{T as c,g as l}from"./index-BPVRhKVV.js";function u(e,t,n){let r=null,i=null,a=!!e?.muted,o=null,s=new Map,c=null,u=!!e?.music,d=()=>l(()=>import(`./audio-JD1kyX0A.js`).then(e=>o=e.SOUND_IMPLS),[],import.meta.url).catch(()=>o={}),f=e=>{let i=s.get(e);if(!i&&r){let a=r;i=fetch(t(e)).then(e=>e.arrayBuffer()).then(e=>a.decodeAudioData(e)).catch(t=>(n(t.message,e),null)),s.set(e,i)}return i??Promise.resolve(null)},p=(e,t=!1)=>{if(!r||!i)return null;let n=e.volume??1;if(e.preset){let t=o?.[e.preset];return t?t.play(r,i,n):null}if(e.src){let a=r,o=i,s=null,c=!1;return f(e.src).then(e=>{if(!e||c)return;s=a.createBufferSource(),s.buffer=e,s.loop=t;let r=a.createGain();r.gain.value=n,s.connect(r).connect(o),s.start()}),{stop(){c=!0;try{s?.stop()}catch{}}}}return null},m=()=>{!c&&e?.music&&!a&&r&&(c=p(e.music,e.music.loop!==!1))};return d(),{play(t){if(a||!r)return;let n=e?.sounds?.[t];n?p(n):o?.[t]&&o[t].play(r,i,1)},music(e){u=e,e?m():(c?.stop(),c=null)},muted:()=>a,setMuted(t){a=t,i&&r&&i.gain.setTargetAtTime(+!t,r.currentTime,.02),t?(c?.stop(),c=null):(u||e?.music)&&(u=!0,m())},unlock(){if(r){r.state===`suspended`&&r.resume();return}let e=globalThis.AudioContext??globalThis.webkitAudioContext;if(e)try{r=new e,i=r.createGain(),i.gain.value=+!a,i.connect(r.destination),u&&m()}catch(e){n(e.message)}},dispose(){c?.stop(),r?.close().catch(()=>void 0),r=null}}}function d(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(/\s/.test(r)){n++;continue}if(/[0-9]/.test(r)||r===`-`&&/[0-9]/.test(e[n+1]??``)&&(t.length===0||t[t.length-1].t===`op`)){let r=n+1;for(;r<e.length&&/[0-9.]/.test(e[r]);)r++;t.push({t:`num`,v:Number(e.slice(n,r))}),n=r;continue}if(r===`'`||r===`"`){let i=n+1,a=``;for(;i<e.length&&e[i]!==r;)e[i]===`\\`&&i+1<e.length&&i++,a+=e[i++];if(i>=e.length)throw Error(`Unterminated string`);t.push({t:`str`,v:a}),n=i+1;continue}if(/[A-Za-z_$]/.test(r)){let r=n+1;for(;r<e.length&&/[A-Za-z0-9_$.]/.test(e[r]);)r++;t.push({t:`id`,v:e.slice(n,r)}),n=r;continue}let i=e.slice(n,n+3),a=e.slice(n,n+2);if(i===`===`||i===`!==`)t.push({t:`op`,v:i.slice(0,2)}),n+=3;else if([`==`,`!=`,`>=`,`<=`,`&&`,`||`].includes(a))t.push({t:`op`,v:a}),n+=2;else if(`!<>()`.includes(r))t.push({t:`op`,v:r}),n++;else throw Error(`Unexpected "${r}"`)}return t}var f=new Set([`__proto__`,`prototype`,`constructor`]);function p(e,t){let n=t.split(`.`);n[0]===`state`&&n.shift();let r=e;for(let e of n){if(f.has(e)||typeof r!=`object`||!r||!Object.prototype.hasOwnProperty.call(r,e))return;r=r[e]}return r}function m(e,t){let n=d(e),r=0,i=()=>n[r],a=e=>i()?.t===`op`&&i().v===e;function o(){let e=n[r++];if(!e)throw Error(`Unexpected end`);if(e.t===`num`||e.t===`str`)return e.v;if(e.t===`id`)return e.v===`true`?!0:e.v===`false`?!1:e.v===`null`||e.v===`undefined`?null:p(t,e.v);if(e.v===`(`){let e=u();if(!a(`)`))throw Error(`Missing )`);return r++,e}throw Error(`Unexpected "${e.v}"`)}function s(){let e=o(),t=i();if(t?.t===`op`&&[`==`,`!=`,`>`,`<`,`>=`,`<=`].includes(t.v)){r++;let n=o(),i=e,a=n;switch(t.v){case`==`:return e==n||e==null&&n==null;case`!=`:return e!=n;case`>`:return i>a;case`<`:return i<a;case`>=`:return i>=a;default:return i<=a}}return e}function c(){return a(`!`)?(r++,!c()):s()}function l(){let e=c();for(;a(`&&`);){r++;let t=c();e&&=t}return e}function u(){let e=l();for(;a(`||`);){r++;let t=l();e||=t}return e}let f=u();if(r<n.length)throw Error(`Unexpected "${n[r].v}"`);return f}function h(e,t){if(e===void 0)return!0;if(typeof e==`boolean`)return e;try{return!!m(e,t)}catch{return!1}}function g(e,t){return e.replace(/\{([^{}]+)\}/g,(e,n)=>{let r=n.trim(),i;try{i=/^[A-Za-z_$][A-Za-z0-9_$.]*$/.test(r)?p(t,r):m(r,t)}catch{i=void 0}return i==null?``:String(typeof i==`number`?Number.isInteger(i)?i:Math.round(i*100)/100:i)})}var _={"top-left":`grid-row:1;grid-column:1;align-items:flex-start;align-self:start;`,top:`grid-row:1;grid-column:2;align-items:center;align-self:start;text-align:center;`,"top-right":`grid-row:1;grid-column:3;align-items:flex-end;align-self:start;text-align:right;`,left:`grid-row:2;grid-column:1;align-items:flex-start;align-self:center;`,center:`grid-row:2;grid-column:2;align-items:center;align-self:center;text-align:center;`,right:`grid-row:2;grid-column:3;align-items:flex-end;align-self:center;text-align:right;`,"bottom-left":`grid-row:3;grid-column:1;align-items:flex-start;align-self:end;`,bottom:`grid-row:3;grid-column:2;align-items:center;align-self:end;text-align:center;`,"bottom-right":`grid-row:3;grid-column:3;align-items:flex-end;align-self:end;text-align:right;`},v=(e,t,n)=>`font-size:${n}px;font-size:clamp(${e}px,min(${t}cqw,${(t*1.6).toFixed(1)}cqh),${n}px)`,y=(e,t,n,r)=>`
2
+ import{t as e}from"./num-CQNAlL82.js";import{In as t,Ln as n,Qt as r,zt as i}from"./three.module-B9FlcKtd.js";import{a,g as o,y as s}from"./camera-HsMeC1mn.js";import{T as c,g as l}from"./index-cDbmaVDl.js";function u(e,t,n){let r=null,i=null,a=!!e?.muted,o=null,s=new Map,c=null,u=!!e?.music,d=()=>l(()=>import(`./audio-JD1kyX0A.js`).then(e=>o=e.SOUND_IMPLS),[],import.meta.url).catch(()=>o={}),f=e=>{let i=s.get(e);if(!i&&r){let a=r;i=fetch(t(e)).then(e=>e.arrayBuffer()).then(e=>a.decodeAudioData(e)).catch(t=>(n(t.message,e),null)),s.set(e,i)}return i??Promise.resolve(null)},p=(e,t=!1)=>{if(!r||!i)return null;let n=e.volume??1;if(e.preset){let t=o?.[e.preset];return t?t.play(r,i,n):null}if(e.src){let a=r,o=i,s=null,c=!1;return f(e.src).then(e=>{if(!e||c)return;s=a.createBufferSource(),s.buffer=e,s.loop=t;let r=a.createGain();r.gain.value=n,s.connect(r).connect(o),s.start()}),{stop(){c=!0;try{s?.stop()}catch{}}}}return null},m=()=>{!c&&e?.music&&!a&&r&&(c=p(e.music,e.music.loop!==!1))};return d(),{play(t){if(a||!r)return;let n=e?.sounds?.[t];n?p(n):o?.[t]&&o[t].play(r,i,1)},music(e){u=e,e?m():(c?.stop(),c=null)},muted:()=>a,setMuted(t){a=t,i&&r&&i.gain.setTargetAtTime(+!t,r.currentTime,.02),t?(c?.stop(),c=null):(u||e?.music)&&(u=!0,m())},unlock(){if(r){r.state===`suspended`&&r.resume();return}let e=globalThis.AudioContext??globalThis.webkitAudioContext;if(e)try{r=new e,i=r.createGain(),i.gain.value=+!a,i.connect(r.destination),u&&m()}catch(e){n(e.message)}},dispose(){c?.stop(),r?.close().catch(()=>void 0),r=null}}}function d(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(/\s/.test(r)){n++;continue}if(/[0-9]/.test(r)||r===`-`&&/[0-9]/.test(e[n+1]??``)&&(t.length===0||t[t.length-1].t===`op`)){let r=n+1;for(;r<e.length&&/[0-9.]/.test(e[r]);)r++;t.push({t:`num`,v:Number(e.slice(n,r))}),n=r;continue}if(r===`'`||r===`"`){let i=n+1,a=``;for(;i<e.length&&e[i]!==r;)e[i]===`\\`&&i+1<e.length&&i++,a+=e[i++];if(i>=e.length)throw Error(`Unterminated string`);t.push({t:`str`,v:a}),n=i+1;continue}if(/[A-Za-z_$]/.test(r)){let r=n+1;for(;r<e.length&&/[A-Za-z0-9_$.]/.test(e[r]);)r++;t.push({t:`id`,v:e.slice(n,r)}),n=r;continue}let i=e.slice(n,n+3),a=e.slice(n,n+2);if(i===`===`||i===`!==`)t.push({t:`op`,v:i.slice(0,2)}),n+=3;else if([`==`,`!=`,`>=`,`<=`,`&&`,`||`].includes(a))t.push({t:`op`,v:a}),n+=2;else if(`!<>()`.includes(r))t.push({t:`op`,v:r}),n++;else throw Error(`Unexpected "${r}"`)}return t}var f=new Set([`__proto__`,`prototype`,`constructor`]);function p(e,t){let n=t.split(`.`);n[0]===`state`&&n.shift();let r=e;for(let e of n){if(f.has(e)||typeof r!=`object`||!r||!Object.prototype.hasOwnProperty.call(r,e))return;r=r[e]}return r}function m(e,t){let n=d(e),r=0,i=()=>n[r],a=e=>i()?.t===`op`&&i().v===e;function o(){let e=n[r++];if(!e)throw Error(`Unexpected end`);if(e.t===`num`||e.t===`str`)return e.v;if(e.t===`id`)return e.v===`true`?!0:e.v===`false`?!1:e.v===`null`||e.v===`undefined`?null:p(t,e.v);if(e.v===`(`){let e=u();if(!a(`)`))throw Error(`Missing )`);return r++,e}throw Error(`Unexpected "${e.v}"`)}function s(){let e=o(),t=i();if(t?.t===`op`&&[`==`,`!=`,`>`,`<`,`>=`,`<=`].includes(t.v)){r++;let n=o(),i=e,a=n;switch(t.v){case`==`:return e==n||e==null&&n==null;case`!=`:return e!=n;case`>`:return i>a;case`<`:return i<a;case`>=`:return i>=a;default:return i<=a}}return e}function c(){return a(`!`)?(r++,!c()):s()}function l(){let e=c();for(;a(`&&`);){r++;let t=c();e&&=t}return e}function u(){let e=l();for(;a(`||`);){r++;let t=l();e||=t}return e}let f=u();if(r<n.length)throw Error(`Unexpected "${n[r].v}"`);return f}function h(e,t){if(e===void 0)return!0;if(typeof e==`boolean`)return e;try{return!!m(e,t)}catch{return!1}}function g(e,t){return e.replace(/\{([^{}]+)\}/g,(e,n)=>{let r=n.trim(),i;try{i=/^[A-Za-z_$][A-Za-z0-9_$.]*$/.test(r)?p(t,r):m(r,t)}catch{i=void 0}return i==null?``:String(typeof i==`number`?Number.isInteger(i)?i:Math.round(i*100)/100:i)})}var _={"top-left":`grid-row:1;grid-column:1;align-items:flex-start;align-self:start;`,top:`grid-row:1;grid-column:2;align-items:center;align-self:start;text-align:center;`,"top-right":`grid-row:1;grid-column:3;align-items:flex-end;align-self:start;text-align:right;`,left:`grid-row:2;grid-column:1;align-items:flex-start;align-self:center;`,center:`grid-row:2;grid-column:2;align-items:center;align-self:center;text-align:center;`,right:`grid-row:2;grid-column:3;align-items:flex-end;align-self:center;text-align:right;`,"bottom-left":`grid-row:3;grid-column:1;align-items:flex-start;align-self:end;`,bottom:`grid-row:3;grid-column:2;align-items:center;align-self:end;text-align:center;`,"bottom-right":`grid-row:3;grid-column:3;align-items:flex-end;align-self:end;text-align:right;`},v=(e,t,n)=>`font-size:${n}px;font-size:clamp(${e}px,min(${t}cqw,${(t*1.6).toFixed(1)}cqh),${n}px)`,y=(e,t,n,r)=>`
3
3
  .a3d-hud{position:absolute;inset:0;pointer-events:none;font-family:${e};color:${t};z-index:2;overflow:hidden;user-select:none;-webkit-user-select:none;container-type:size;display:grid;grid-template-columns:minmax(min-content,1fr) fit-content(56%) minmax(min-content,1fr);grid-template-rows:auto minmax(0,1fr) auto}
4
4
  .a3d-zone{display:flex;flex-direction:column;gap:8px;gap:clamp(4px,1.6cqw,8px);padding:14px;padding:clamp(8px,2.6cqw,14px);min-width:0;max-width:100%;box-sizing:border-box}
5
5
  .a3d-el{line-height:1.2;text-shadow:0 1px 3px rgba(0,0,0,.45);white-space:pre-line;overflow-wrap:break-word}
@@ -1,4 +1,4 @@
1
- import{c as e,i as t}from"./runtime-5Ti8UJJR.js";import{t as n}from"./params-BZqUA__U.js";import{d as r,l as i,o as a,s as o,u as s}from"./camera-DrubOxWu.js";import{n as c}from"./BufferGeometryUtils-BbzK4rCj.js";import{An as l,Bn as u,Bt as d,C as f,Dt as p,E as m,En as h,I as g,In as _,J as v,Jt as y,K as b,Kt as x,Ln as S,M as C,Mn as w,N as T,Ot as E,P as D,Rn as O,St as k,T as A,U as j,Ut as M,W as N,Y as P,_ as F,_n as I,bn as L,bt as R,cn as z,ct as B,d as ee,fn as te,h as ne,hn as re,it as ie,jn as ae,kn as oe,lt as se,m as V,mn as ce,nn as le,on as ue,p as de,pn as fe,rn as pe,st as me,tn as he,tt as ge,v as _e,wn as ve,x as H,xn as ye,xt as U,y as be,yt as xe,zt as Se}from"./three.module-B9FlcKtd.js";var Ce=class{pos=[];col=[];uv=[];wind=[];useUv=!1;useWind=!1;windFn=null;pushVertex(e,t,n,r,i=0,a=0){if(this.pos.push(e,t,n),this.col.push(r.r,r.g,r.b),this.useUv&&this.uv.push(i,a),this.useWind){let r=this.windFn?this.windFn(e,t,n):[0,0];this.wind.push(r[0],r[1])}}tri(e,t,n,r,i){this.pushVertex(e[0],e[1],e[2],r,i?.[0],i?.[1]),this.pushVertex(t[0],t[1],t[2],r,i?.[2],i?.[3]),this.pushVertex(n[0],n[1],n[2],r,i?.[4],i?.[5])}quad(e,t,n,r,i,a){this.tri(e,t,n,i,a?[a[0],a[1],a[2],a[3],a[4],a[5]]:void 0),this.tri(e,n,r,i,a?[a[0],a[1],a[4],a[5],a[6],a[7]]:void 0)}box(e,t,n,r=n,i={}){let[a,o,s]=e,[c,l,u]=t,d=(e,t,n)=>{if(!i.uv)return;let[r,a,o,s]=i.uv(e,t,n);return[r,a,o,a,o,s,r,s]},f=c-a,p=l-o,m=u-s;this.quad([a,o,u],[c,o,u],[c,l,u],[a,l,u],n,d(`z`,f,p)),this.quad([c,o,s],[a,o,s],[a,l,s],[c,l,s],n,d(`z`,f,p)),this.quad([c,o,u],[c,o,s],[c,l,s],[c,l,u],n,d(`x`,m,p)),this.quad([a,o,s],[a,o,u],[a,l,u],[a,l,s],n,d(`x`,m,p)),this.quad([a,l,u],[c,l,u],[c,l,s],[a,l,s],r,d(`y`,f,m)),i.bottom&&this.quad([a,o,s],[c,o,s],[c,o,u],[a,o,u],n,d(`y`,f,m))}add(e,t,n){let r=e.index?e.toNonIndexed():e,i=r.getAttribute(`position`),a=new S,o=[[0,0,0],[0,0,0],[0,0,0]],s=[[0,0,0],[0,0,0],[0,0,0]];for(let e=0;e<i.count/3;e++){for(let n=0;n<3;n++)a.fromBufferAttribute(i,e*3+n),s[n]=[a.x,a.y,a.z],a.applyMatrix4(t),o[n]=[a.x,a.y,a.z];let r=typeof n==`function`?n((s[0][0]+s[1][0]+s[2][0])/3,(s[0][1]+s[1][1]+s[2][1])/3,(s[0][2]+s[1][2]+s[2][2])/3,e):n;this.tri(o[0],o[1],o[2],r)}r!==e&&r.dispose()}get triangles(){return this.pos.length/9}build(){let e=new ne;return e.setAttribute(`position`,new g(this.pos,3)),e.setAttribute(`color`,new g(this.col,3)),this.useUv&&e.setAttribute(`uv`,new g(this.uv,2)),this.useWind&&e.setAttribute(`aWind`,new g(this.wind,2)),e.computeVertexNormals(),e.computeBoundingBox(),e.computeBoundingSphere(),e}};function we(e,t,n){let r=e.getAttribute(`position`),i=new Map;for(let e=0;e<r.count;e++){let a=`${r.getX(e).toFixed(4)},${r.getY(e).toFixed(4)},${r.getZ(e).toFixed(4)}`,o=i.get(a);o||(o=[(n()-.5)*t,(n()-.5)*t,(n()-.5)*t],i.set(a,o)),r.setXYZ(e,r.getX(e)+o[0],r.getY(e)+o[1],r.getZ(e)+o[2])}return r.needsUpdate=!0,e}var Te=(e,t,n,r=1,i=r,a=r,o=0,s=0,c=0)=>new R().compose(new S(e,t,n),new x().setFromEuler(new T(o,s,c)),new S(r,i,a)),Ee=(e,t)=>e.clone().multiplyScalar(t);function De(e,t,n=new H){if(e.length===1)return n.copy(e[0]);let r=Math.min(1,Math.max(0,t))*(e.length-1),i=Math.min(e.length-2,Math.floor(r));return n.copy(e[i]).lerp(e[i+1],r-i)}var W=(e,t,n)=>{let r=Math.min(1,Math.max(0,(n-e)/(t-e)));return r*r*(3-2*r)};function Oe(e){let t=[...e.siblings.values()].filter(e=>e.heightAt&&e.object.userData.surface!==`water`),n=e.placement?.position??[0,0,0],r=e=>{let t=e.object.userData.size;if(typeof t!=`number`)return 1/0;let r=e.object.position,i=e.object.scale,a=t/2*Math.abs(i.x||1),o=t/2*Math.abs(i.z||1);return Math.abs(n[0]-r.x)<=a&&Math.abs(n[2]-r.z)<=o?a*o:-1},i=e=>{let t=r(e);return(t<0?2:0)+(e.object.userData.surface===`terrain`?0:1)+(t>0&&Number.isFinite(t)?t/1e9:.5)};t.sort((e,t)=>i(e)-i(t));for(let n of t){if(!n.heightAt)continue;let t=n.object.position,r=n.object.scale,i=e.placement?.position??[0,0,0],a=e.placement?.scale??[1,1,1],o=n.heightAt.bind(n),s=e=>(e-i[1])/(a[1]||1),c=typeof n.object.userData.waterLevel==`number`?s(n.object.userData.waterLevel*r.y+t.y):null;return{snow:typeof n.object.userData.snowLevel==`number`?s(n.object.userData.snowLevel*r.y+t.y):null,height:(e,n)=>{let c=i[0]+e*a[0],l=i[2]+n*a[2];return s(o((c-t.x)/(r.x||1),(l-t.z)/(r.z||1))*r.y+t.y)},water:c}}return null}function ke(e,t,n,r=.15,i=!0){let a=null,o={x:0,y:0,z:0};for(let s=0;s<12;s++){let c=(e.next()-.5)*t[0],l=(e.next()-.5)*t[2],u=n?n.height(c,l):(e.next()-.5)*t[1];if(s===0&&(o={x:c,y:u,z:l}),!n)return{x:c,y:u,z:l};let d=n.water===null||u>n.water+r,f=!i||n.snow===null||n.snow===void 0||u<n.snow;if(d&&f)return{x:c,y:u,z:l};d&&(!a||u<a.y)&&(a={x:c,y:u,z:l})}return a??o}function Ae(e={}){return new E({vertexColors:!0,flatShading:e.flat??!0,roughness:e.roughness??.9,metalness:e.metalness??0,side:e.side??0})}function je(e){e.traverse(e=>{let t=e;t.geometry&&t.geometry.dispose();let n=t.material?Array.isArray(t.material)?t.material:[t.material]:[];for(let e of n){for(let t of Object.values(e))t instanceof ve&&t.dispose();e.dispose()}})}function G(e,t={}){return{object:e,dispose:()=>je(e),...t}}var Me=[`sphere`,`torus`,`ring`,`pill`,`cone`,`cube`,`halfDisc`,`squiggle`,`triangle`,`star`];function Ne(e){switch(e){case`sphere`:return new re(.5,40,28);case`torus`:return new h(.38,.14,24,64);case`ring`:return new h(.42,.045,12,64);case`pill`:return new F(.2,.6,10,24).rotateZ(Math.PI/2);case`cone`:return new f(.4,.8,40);case`cube`:return new t(.7,.7,.7,4,.08);case`halfDisc`:{let e=new A(.5,.5,.18,40,1,!1,0,Math.PI);return e.rotateX(Math.PI/2),e}case`squiggle`:{let e=Array.from({length:9},(e,t)=>new S((t/8-.5)*1.3,Math.sin(t*1.4)*.16,0));return new oe(new _e(e),80,.06,12,!1)}case`triangle`:{let e=new z;for(let t=0;t<3;t++){let n=Math.PI/2+t/3*Math.PI*2;t===0?e.moveTo(Math.cos(n)*.5,Math.sin(n)*.5):e.lineTo(Math.cos(n)*.5,Math.sin(n)*.5)}let t=new D(e,{depth:.16,bevelEnabled:!0,bevelThickness:.04,bevelSize:.04,bevelSegments:4});return t.center(),t}case`star`:{let e=new z;for(let t=0;t<10;t++){let n=Math.PI/2+t/10*Math.PI*2,r=t%2?.22:.5;t===0?e.moveTo(Math.cos(n)*r,Math.sin(n)*r):e.lineTo(Math.cos(n)*r,Math.sin(n)*r)}let t=new D(e,{depth:.14,bevelEnabled:!0,bevelThickness:.04,bevelSize:.03,bevelSegments:3});return t.center(),t}}}var Pe=(t,r)=>{let i=n(`abstractShapes`,t,r),a=i.int(`count`),o=i.vec3(`area`),s=i.colors(`colors`),c=i.num(`minSize`),l=Math.max(c,i.num(`maxSize`)),u=i.str(`style`),d=i.num(`motion`),f=i.raw(`shapes`),m=Array.isArray(f)?f.filter(e=>Me.includes(e)):[],h=m.length?m:[...Me],g=r.rng,_=[];for(let e=0;e<a;e++){let t=new S,n=-1;for(let e=0;e<14;e++){let e=new S((g.next()-.5)*o[0],(g.next()-.5)*o[1],(g.next()-.5)*o[2]),r=1/0;for(let t of _)r=Math.min(r,e.distanceTo(t.pos)-t.s*.6);r>n&&(n=r,t=e)}let r=c+(l-c)*(1-e/Math.max(1,a))**1.5*g.range(.7,1);_.push({pos:t,s:r,kind:h[e%h.length],color:s[e%s.length],rot:new T(g.range(-.6,.6),g.next()*Math.PI*2,g.range(-.8,.8)),spin:new S(g.range(-.25,.25),g.range(-.35,.35),g.range(-.2,.2)),ph:g.next()*Math.PI*2})}for(let e=_.length-1;e>0;e--){let t=Math.floor(g.next()*(e+1)),n=_[e].color;_[e].color=_[t].color,_[t].color=n}let v=u===`toon`?e({color:16777215}):u===`glossy`?new p({color:16777215,roughness:.18,clearcoat:1,clearcoatRoughness:.08}):new E({color:16777215,roughness:.62,metalness:0}),y=new j;y.name=`abstractShapes`;let b=[];for(let e of h){let t=_.filter(t=>t.kind===e);if(!t.length)continue;let n=new P(Ne(e),v,t.length);n.name=`shapes-${e}`,n.castShadow=!0,n.receiveShadow=!0,n.userData.materialTarget=!0,t.forEach((e,t)=>n.setColorAt(t,e.color)),n.frustumCulled=!1,y.add(n),b.push({mesh:n,list:t})}let C=new R,w=new x,D=new T,O=new S,k=new S,A=e=>{for(let{mesh:t,list:n}of b)n.forEach((n,r)=>{O.copy(n.pos),O.y+=Math.sin(e*.8+n.ph)*.12*d*(.5+n.s*.5),D.set(n.rot.x+n.spin.x*e*d,n.rot.y+n.spin.y*e*d,n.rot.z+n.spin.z*e*d),w.setFromEuler(D),k.setScalar(n.s),t.setMatrixAt(r,C.compose(O,w,k))}),t.instanceMatrix.needsUpdate=!0};return A(0),G(y,{update:e=>A(e)})},Fe=e=>1+2.4*(e-1)**3+1.4*(e-1)**2;function Ie(e){if(!Array.isArray(e)||e.length===0)return[[3,5,4,7,6,9,8]];let t=e=>typeof e==`number`&&Number.isFinite(e)?e:e&&typeof e==`object`&&typeof e.value==`number`?e.value:0;return e.every(e=>Array.isArray(e))?e.map(e=>e.map(t)):[e.map(t)]}var Le=(e,r)=>{let i=n(`bars3d`,e,r),a=Ie(i.raw(`data`)),o=a.length,s=Math.max(...a.map(e=>e.length),1),c=i.num(`barWidth`),l=i.num(`gap`),u=i.num(`maxHeight`),d=i.colors(`colors`),f=i.str(`colorBy`),m=i.str(`shape`),h=i.str(`animation`),g=i.num(`duration`),_=Math.max(1e-6,...a.flat().map(e=>Math.abs(e))),v=c+l,y;y=m===`cylinder`?new A(.5,.5,1,32):m===`box`?new de(1,1,1):new t(1,1,1,4,.12),y.translate(0,.5,0);let b=o*s,C=new p({roughness:.32,metalness:0,clearcoat:.6,clearcoatRoughness:.25}),w=new P(y,C,b);w.name=`bars`,w.castShadow=!0,w.receiveShadow=!0,w.userData.materialTarget=!0;let T=[],D=new H,O=0;for(let e=0;e<o;e++)for(let t=0;t<s;t++){let n=a[e][t]??0,r=Math.max(1e-4,Math.abs(n)/_*u),i=(t-(s-1)/2)*v,c=(e-(o-1)/2)*v,l=f===`row`?o>1?e/(o-1):0:f===`column`?s>1?t/(s-1):0:Math.abs(n)/_;f===`value`?De(d,l,D):D.copy(d[(f===`row`?e:t)%d.length]),w.setColorAt(O,D),T.push({x:i,z:c,h:r,i:O,delay:(t+e*.6)/Math.max(1,s+o*.6)}),O++}let k=new R,M=new x,N=new S,F=new S,I=e=>{for(let t of T){let n=1;if(h===`grow`){let r=(e-t.delay*g*.6)/(g*.5);n=r<=0?1e-4:r>=1?1:Fe(Math.min(1,r)),r>0&&r<1&&(n=Math.max(1e-4,n))}else h===`wave`&&(n=.55+.45*(.5+.5*Math.sin(e*1.6-t.x*.9-t.z*.7)));N.set(t.x,0,t.z),F.set(c,t.h*n,c),w.setMatrixAt(t.i,k.compose(N,M,F))}w.instanceMatrix.needsUpdate=!0};I(0),w.computeBoundingSphere(),w.frustumCulled=!1;let L=new j;if(L.name=`bars3d`,L.add(w),i.bool(`base`)){let e=s*v+l,n=o*v+l,r=new U(new t(e,.12,n,3,.05),new E({color:i.color(`baseColor`),roughness:.6}));r.position.y=-.06,r.receiveShadow=!0,r.castShadow=!0,r.name=`bars-base`,L.add(r)}return G(L,{update:e=>I(e)})};function Re(){let e=[],t=[],n=(n,r,i,a)=>{e.push(...n,...r,...i),t.push(a,a,a)},r=[0,0,.42],i=[0,.01,-.34],a=[0,.07,.04],o=[0,-.06,.02],s=[-.075,0,.04],c=[.075,0,.04];for(let[e,t]of[[s,a],[a,c],[c,o],[o,s]])n(r,e,t,0),n(i,t,e,0);n([0,.01,-.3],[-.14,.02,-.58],[.14,.02,-.58],0);for(let e of[-1,1]){let t=[e*.05,.01,.14],r=[e*.05,.01,-.12],i=[e*.48,0,.1],a=[e*.48,0,-.14],o=[e*1,-.01,-.26];n(t,i,a,1),n(t,a,r,1),n(i,o,a,1)}let l=new ne;return l.setAttribute(`position`,new g(e,3)),l.setAttribute(`aWing`,new g(t,1)),l.computeVertexNormals(),l}var ze=(e,t)=>{let r=n(`birds`,e,t),a=r.int(`count`),o=r.str(`mode`),s=r.vec3(`area`),c=r.num(`speed`),l=r.num(`size`),u=r.num(`spread`),d=r.str(`formation`),f=r.num(`flapSpeed`),p=r.num(`heading`)*Math.PI/180,m=r.color(`color`),h=t.rng,g=Re();g.scale(l/2,l/2,l/2);let _=new Float32Array(a),y=new Float32Array(a);for(let e=0;e<a;e++)_[e]=h.next()*Math.PI*2,y[e]=f*h.range(.82,1.18);g.setAttribute(`aPhase`,new v(_,1)),g.setAttribute(`aRate`,new v(y,1));let b=new E({color:16777215,roughness:.9,metalness:0,flatShading:!0,side:2}),C={uTime:{value:0}};b.onBeforeCompile=e=>{Object.assign(e.uniforms,C),e.vertexShader=`uniform float uTime;
1
+ import{c as e,i as t}from"./runtime-ByR4qfyV.js";import{t as n}from"./params-BZqUA__U.js";import{d as r,l as i,o as a,s as o,u as s}from"./camera-HsMeC1mn.js";import{n as c}from"./BufferGeometryUtils-BbzK4rCj.js";import{An as l,Bn as u,Bt as d,C as f,Dt as p,E as m,En as h,I as g,In as _,J as v,Jt as y,K as b,Kt as x,Ln as S,M as C,Mn as w,N as T,Ot as E,P as D,Rn as O,St as k,T as A,U as j,Ut as M,W as N,Y as P,_ as F,_n as I,bn as L,bt as R,cn as z,ct as B,d as ee,fn as te,h as ne,hn as re,it as ie,jn as ae,kn as oe,lt as se,m as V,mn as ce,nn as le,on as ue,p as de,pn as fe,rn as pe,st as me,tn as he,tt as ge,v as _e,wn as ve,x as H,xn as ye,xt as U,y as be,yt as xe,zt as Se}from"./three.module-B9FlcKtd.js";var Ce=class{pos=[];col=[];uv=[];wind=[];useUv=!1;useWind=!1;windFn=null;pushVertex(e,t,n,r,i=0,a=0){if(this.pos.push(e,t,n),this.col.push(r.r,r.g,r.b),this.useUv&&this.uv.push(i,a),this.useWind){let r=this.windFn?this.windFn(e,t,n):[0,0];this.wind.push(r[0],r[1])}}tri(e,t,n,r,i){this.pushVertex(e[0],e[1],e[2],r,i?.[0],i?.[1]),this.pushVertex(t[0],t[1],t[2],r,i?.[2],i?.[3]),this.pushVertex(n[0],n[1],n[2],r,i?.[4],i?.[5])}quad(e,t,n,r,i,a){this.tri(e,t,n,i,a?[a[0],a[1],a[2],a[3],a[4],a[5]]:void 0),this.tri(e,n,r,i,a?[a[0],a[1],a[4],a[5],a[6],a[7]]:void 0)}box(e,t,n,r=n,i={}){let[a,o,s]=e,[c,l,u]=t,d=(e,t,n)=>{if(!i.uv)return;let[r,a,o,s]=i.uv(e,t,n);return[r,a,o,a,o,s,r,s]},f=c-a,p=l-o,m=u-s;this.quad([a,o,u],[c,o,u],[c,l,u],[a,l,u],n,d(`z`,f,p)),this.quad([c,o,s],[a,o,s],[a,l,s],[c,l,s],n,d(`z`,f,p)),this.quad([c,o,u],[c,o,s],[c,l,s],[c,l,u],n,d(`x`,m,p)),this.quad([a,o,s],[a,o,u],[a,l,u],[a,l,s],n,d(`x`,m,p)),this.quad([a,l,u],[c,l,u],[c,l,s],[a,l,s],r,d(`y`,f,m)),i.bottom&&this.quad([a,o,s],[c,o,s],[c,o,u],[a,o,u],n,d(`y`,f,m))}add(e,t,n){let r=e.index?e.toNonIndexed():e,i=r.getAttribute(`position`),a=new S,o=[[0,0,0],[0,0,0],[0,0,0]],s=[[0,0,0],[0,0,0],[0,0,0]];for(let e=0;e<i.count/3;e++){for(let n=0;n<3;n++)a.fromBufferAttribute(i,e*3+n),s[n]=[a.x,a.y,a.z],a.applyMatrix4(t),o[n]=[a.x,a.y,a.z];let r=typeof n==`function`?n((s[0][0]+s[1][0]+s[2][0])/3,(s[0][1]+s[1][1]+s[2][1])/3,(s[0][2]+s[1][2]+s[2][2])/3,e):n;this.tri(o[0],o[1],o[2],r)}r!==e&&r.dispose()}get triangles(){return this.pos.length/9}build(){let e=new ne;return e.setAttribute(`position`,new g(this.pos,3)),e.setAttribute(`color`,new g(this.col,3)),this.useUv&&e.setAttribute(`uv`,new g(this.uv,2)),this.useWind&&e.setAttribute(`aWind`,new g(this.wind,2)),e.computeVertexNormals(),e.computeBoundingBox(),e.computeBoundingSphere(),e}};function we(e,t,n){let r=e.getAttribute(`position`),i=new Map;for(let e=0;e<r.count;e++){let a=`${r.getX(e).toFixed(4)},${r.getY(e).toFixed(4)},${r.getZ(e).toFixed(4)}`,o=i.get(a);o||(o=[(n()-.5)*t,(n()-.5)*t,(n()-.5)*t],i.set(a,o)),r.setXYZ(e,r.getX(e)+o[0],r.getY(e)+o[1],r.getZ(e)+o[2])}return r.needsUpdate=!0,e}var Te=(e,t,n,r=1,i=r,a=r,o=0,s=0,c=0)=>new R().compose(new S(e,t,n),new x().setFromEuler(new T(o,s,c)),new S(r,i,a)),Ee=(e,t)=>e.clone().multiplyScalar(t);function De(e,t,n=new H){if(e.length===1)return n.copy(e[0]);let r=Math.min(1,Math.max(0,t))*(e.length-1),i=Math.min(e.length-2,Math.floor(r));return n.copy(e[i]).lerp(e[i+1],r-i)}var W=(e,t,n)=>{let r=Math.min(1,Math.max(0,(n-e)/(t-e)));return r*r*(3-2*r)};function Oe(e){let t=[...e.siblings.values()].filter(e=>e.heightAt&&e.object.userData.surface!==`water`),n=e.placement?.position??[0,0,0],r=e=>{let t=e.object.userData.size;if(typeof t!=`number`)return 1/0;let r=e.object.position,i=e.object.scale,a=t/2*Math.abs(i.x||1),o=t/2*Math.abs(i.z||1);return Math.abs(n[0]-r.x)<=a&&Math.abs(n[2]-r.z)<=o?a*o:-1},i=e=>{let t=r(e);return(t<0?2:0)+(e.object.userData.surface===`terrain`?0:1)+(t>0&&Number.isFinite(t)?t/1e9:.5)};t.sort((e,t)=>i(e)-i(t));for(let n of t){if(!n.heightAt)continue;let t=n.object.position,r=n.object.scale,i=e.placement?.position??[0,0,0],a=e.placement?.scale??[1,1,1],o=n.heightAt.bind(n),s=e=>(e-i[1])/(a[1]||1),c=typeof n.object.userData.waterLevel==`number`?s(n.object.userData.waterLevel*r.y+t.y):null;return{snow:typeof n.object.userData.snowLevel==`number`?s(n.object.userData.snowLevel*r.y+t.y):null,height:(e,n)=>{let c=i[0]+e*a[0],l=i[2]+n*a[2];return s(o((c-t.x)/(r.x||1),(l-t.z)/(r.z||1))*r.y+t.y)},water:c}}return null}function ke(e,t,n,r=.15,i=!0){let a=null,o={x:0,y:0,z:0};for(let s=0;s<12;s++){let c=(e.next()-.5)*t[0],l=(e.next()-.5)*t[2],u=n?n.height(c,l):(e.next()-.5)*t[1];if(s===0&&(o={x:c,y:u,z:l}),!n)return{x:c,y:u,z:l};let d=n.water===null||u>n.water+r,f=!i||n.snow===null||n.snow===void 0||u<n.snow;if(d&&f)return{x:c,y:u,z:l};d&&(!a||u<a.y)&&(a={x:c,y:u,z:l})}return a??o}function Ae(e={}){return new E({vertexColors:!0,flatShading:e.flat??!0,roughness:e.roughness??.9,metalness:e.metalness??0,side:e.side??0})}function je(e){e.traverse(e=>{let t=e;t.geometry&&t.geometry.dispose();let n=t.material?Array.isArray(t.material)?t.material:[t.material]:[];for(let e of n){for(let t of Object.values(e))t instanceof ve&&t.dispose();e.dispose()}})}function G(e,t={}){return{object:e,dispose:()=>je(e),...t}}var Me=[`sphere`,`torus`,`ring`,`pill`,`cone`,`cube`,`halfDisc`,`squiggle`,`triangle`,`star`];function Ne(e){switch(e){case`sphere`:return new re(.5,40,28);case`torus`:return new h(.38,.14,24,64);case`ring`:return new h(.42,.045,12,64);case`pill`:return new F(.2,.6,10,24).rotateZ(Math.PI/2);case`cone`:return new f(.4,.8,40);case`cube`:return new t(.7,.7,.7,4,.08);case`halfDisc`:{let e=new A(.5,.5,.18,40,1,!1,0,Math.PI);return e.rotateX(Math.PI/2),e}case`squiggle`:{let e=Array.from({length:9},(e,t)=>new S((t/8-.5)*1.3,Math.sin(t*1.4)*.16,0));return new oe(new _e(e),80,.06,12,!1)}case`triangle`:{let e=new z;for(let t=0;t<3;t++){let n=Math.PI/2+t/3*Math.PI*2;t===0?e.moveTo(Math.cos(n)*.5,Math.sin(n)*.5):e.lineTo(Math.cos(n)*.5,Math.sin(n)*.5)}let t=new D(e,{depth:.16,bevelEnabled:!0,bevelThickness:.04,bevelSize:.04,bevelSegments:4});return t.center(),t}case`star`:{let e=new z;for(let t=0;t<10;t++){let n=Math.PI/2+t/10*Math.PI*2,r=t%2?.22:.5;t===0?e.moveTo(Math.cos(n)*r,Math.sin(n)*r):e.lineTo(Math.cos(n)*r,Math.sin(n)*r)}let t=new D(e,{depth:.14,bevelEnabled:!0,bevelThickness:.04,bevelSize:.03,bevelSegments:3});return t.center(),t}}}var Pe=(t,r)=>{let i=n(`abstractShapes`,t,r),a=i.int(`count`),o=i.vec3(`area`),s=i.colors(`colors`),c=i.num(`minSize`),l=Math.max(c,i.num(`maxSize`)),u=i.str(`style`),d=i.num(`motion`),f=i.raw(`shapes`),m=Array.isArray(f)?f.filter(e=>Me.includes(e)):[],h=m.length?m:[...Me],g=r.rng,_=[];for(let e=0;e<a;e++){let t=new S,n=-1;for(let e=0;e<14;e++){let e=new S((g.next()-.5)*o[0],(g.next()-.5)*o[1],(g.next()-.5)*o[2]),r=1/0;for(let t of _)r=Math.min(r,e.distanceTo(t.pos)-t.s*.6);r>n&&(n=r,t=e)}let r=c+(l-c)*(1-e/Math.max(1,a))**1.5*g.range(.7,1);_.push({pos:t,s:r,kind:h[e%h.length],color:s[e%s.length],rot:new T(g.range(-.6,.6),g.next()*Math.PI*2,g.range(-.8,.8)),spin:new S(g.range(-.25,.25),g.range(-.35,.35),g.range(-.2,.2)),ph:g.next()*Math.PI*2})}for(let e=_.length-1;e>0;e--){let t=Math.floor(g.next()*(e+1)),n=_[e].color;_[e].color=_[t].color,_[t].color=n}let v=u===`toon`?e({color:16777215}):u===`glossy`?new p({color:16777215,roughness:.18,clearcoat:1,clearcoatRoughness:.08}):new E({color:16777215,roughness:.62,metalness:0}),y=new j;y.name=`abstractShapes`;let b=[];for(let e of h){let t=_.filter(t=>t.kind===e);if(!t.length)continue;let n=new P(Ne(e),v,t.length);n.name=`shapes-${e}`,n.castShadow=!0,n.receiveShadow=!0,n.userData.materialTarget=!0,t.forEach((e,t)=>n.setColorAt(t,e.color)),n.frustumCulled=!1,y.add(n),b.push({mesh:n,list:t})}let C=new R,w=new x,D=new T,O=new S,k=new S,A=e=>{for(let{mesh:t,list:n}of b)n.forEach((n,r)=>{O.copy(n.pos),O.y+=Math.sin(e*.8+n.ph)*.12*d*(.5+n.s*.5),D.set(n.rot.x+n.spin.x*e*d,n.rot.y+n.spin.y*e*d,n.rot.z+n.spin.z*e*d),w.setFromEuler(D),k.setScalar(n.s),t.setMatrixAt(r,C.compose(O,w,k))}),t.instanceMatrix.needsUpdate=!0};return A(0),G(y,{update:e=>A(e)})},Fe=e=>1+2.4*(e-1)**3+1.4*(e-1)**2;function Ie(e){if(!Array.isArray(e)||e.length===0)return[[3,5,4,7,6,9,8]];let t=e=>typeof e==`number`&&Number.isFinite(e)?e:e&&typeof e==`object`&&typeof e.value==`number`?e.value:0;return e.every(e=>Array.isArray(e))?e.map(e=>e.map(t)):[e.map(t)]}var Le=(e,r)=>{let i=n(`bars3d`,e,r),a=Ie(i.raw(`data`)),o=a.length,s=Math.max(...a.map(e=>e.length),1),c=i.num(`barWidth`),l=i.num(`gap`),u=i.num(`maxHeight`),d=i.colors(`colors`),f=i.str(`colorBy`),m=i.str(`shape`),h=i.str(`animation`),g=i.num(`duration`),_=Math.max(1e-6,...a.flat().map(e=>Math.abs(e))),v=c+l,y;y=m===`cylinder`?new A(.5,.5,1,32):m===`box`?new de(1,1,1):new t(1,1,1,4,.12),y.translate(0,.5,0);let b=o*s,C=new p({roughness:.32,metalness:0,clearcoat:.6,clearcoatRoughness:.25}),w=new P(y,C,b);w.name=`bars`,w.castShadow=!0,w.receiveShadow=!0,w.userData.materialTarget=!0;let T=[],D=new H,O=0;for(let e=0;e<o;e++)for(let t=0;t<s;t++){let n=a[e][t]??0,r=Math.max(1e-4,Math.abs(n)/_*u),i=(t-(s-1)/2)*v,c=(e-(o-1)/2)*v,l=f===`row`?o>1?e/(o-1):0:f===`column`?s>1?t/(s-1):0:Math.abs(n)/_;f===`value`?De(d,l,D):D.copy(d[(f===`row`?e:t)%d.length]),w.setColorAt(O,D),T.push({x:i,z:c,h:r,i:O,delay:(t+e*.6)/Math.max(1,s+o*.6)}),O++}let k=new R,M=new x,N=new S,F=new S,I=e=>{for(let t of T){let n=1;if(h===`grow`){let r=(e-t.delay*g*.6)/(g*.5);n=r<=0?1e-4:r>=1?1:Fe(Math.min(1,r)),r>0&&r<1&&(n=Math.max(1e-4,n))}else h===`wave`&&(n=.55+.45*(.5+.5*Math.sin(e*1.6-t.x*.9-t.z*.7)));N.set(t.x,0,t.z),F.set(c,t.h*n,c),w.setMatrixAt(t.i,k.compose(N,M,F))}w.instanceMatrix.needsUpdate=!0};I(0),w.computeBoundingSphere(),w.frustumCulled=!1;let L=new j;if(L.name=`bars3d`,L.add(w),i.bool(`base`)){let e=s*v+l,n=o*v+l,r=new U(new t(e,.12,n,3,.05),new E({color:i.color(`baseColor`),roughness:.6}));r.position.y=-.06,r.receiveShadow=!0,r.castShadow=!0,r.name=`bars-base`,L.add(r)}return G(L,{update:e=>I(e)})};function Re(){let e=[],t=[],n=(n,r,i,a)=>{e.push(...n,...r,...i),t.push(a,a,a)},r=[0,0,.42],i=[0,.01,-.34],a=[0,.07,.04],o=[0,-.06,.02],s=[-.075,0,.04],c=[.075,0,.04];for(let[e,t]of[[s,a],[a,c],[c,o],[o,s]])n(r,e,t,0),n(i,t,e,0);n([0,.01,-.3],[-.14,.02,-.58],[.14,.02,-.58],0);for(let e of[-1,1]){let t=[e*.05,.01,.14],r=[e*.05,.01,-.12],i=[e*.48,0,.1],a=[e*.48,0,-.14],o=[e*1,-.01,-.26];n(t,i,a,1),n(t,a,r,1),n(i,o,a,1)}let l=new ne;return l.setAttribute(`position`,new g(e,3)),l.setAttribute(`aWing`,new g(t,1)),l.computeVertexNormals(),l}var ze=(e,t)=>{let r=n(`birds`,e,t),a=r.int(`count`),o=r.str(`mode`),s=r.vec3(`area`),c=r.num(`speed`),l=r.num(`size`),u=r.num(`spread`),d=r.str(`formation`),f=r.num(`flapSpeed`),p=r.num(`heading`)*Math.PI/180,m=r.color(`color`),h=t.rng,g=Re();g.scale(l/2,l/2,l/2);let _=new Float32Array(a),y=new Float32Array(a);for(let e=0;e<a;e++)_[e]=h.next()*Math.PI*2,y[e]=f*h.range(.82,1.18);g.setAttribute(`aPhase`,new v(_,1)),g.setAttribute(`aRate`,new v(y,1));let b=new E({color:16777215,roughness:.9,metalness:0,flatShading:!0,side:2}),C={uTime:{value:0}};b.onBeforeCompile=e=>{Object.assign(e.uniforms,C),e.vertexShader=`uniform float uTime;
2
2
  attribute float aWing;
3
3
  attribute float aPhase;
4
4
  attribute float aRate;